Commit Graph

188 Commits

Author SHA1 Message Date
jsbot
073cf64a9d exportsql: issue #242 2015-04-11 23:54:05 +03:00
Samir Aguiar
0ddf048626 databrowser: Let the view update the model when sorting
When the user clicks on a header, call the sort function from
QTableView and let it call the model's sort function. This allows
the model and the view to be in sync about the sorting direction
and we don't get upside-down arrows.

See issue #231.
2015-03-22 21:04:18 +01:00
Samir Aguiar
307261718c mainwindow: Disable actions to save SQL when no file is open
See issue #233.
2015-03-20 23:54:04 +01:00
Martin Kleusberg
da6d8ba385 update: Add option to settings dialog to fully disable update checks
Add a new checkbox to the Preferences Dialog which allows the user to
fully disable automatic check for new versions instead of just ignoring
the last shown update message. This also prevents DB4S from performing
any HTTP requests.

See issues #173 and #208.
2015-03-03 00:54:21 +01:00
Martin Kleusberg
2f46dbf117 update: Avoid unnecessary redirect and thus an extra HTTP request 2015-03-03 00:41:16 +01:00
Martin Kleusberg
2c25b7ecb5 update: Fix wrong variable usage in version check code 2015-03-03 00:32:40 +01:00
Samir Aguiar
4fee089d4d Fix QStrings that had placeholders for queries
When replacing placeholders, QString::arg() looks for
the sequence %n (where n is a number between 1 and 99).
As it turns out this sequence can also appear in SQL
queries and so they were being mistakenly replaced.

See issue #203.
2015-02-14 19:28:47 +01:00
Martin Kleusberg
4fa0576853 Support tables with empty table names
Apparently SQLite supports empty table names for whatever reason. This
commit patches SQLiteBrowser to support databases with a table with an
empty name. I haven't removed the check for an empty table name in the
Create/Edit table dialog though because you probably really shouldn't
create such a table.

See issue #194.
2015-02-06 13:30:30 +01:00
Martin Kleusberg
f63b11925d cipher: Fix attaching unencrypted DB if main is encrypted and vice-versa
When attaching another database, SQLCipher assumes that it shares
passphrase and salt with the main database. Usually this isn't the case,
though. With this commit SQLiteBrowser tries to open the database to attach
before actually attaching it and asks for encryption details if needed.

This allows the user to attach unencrypted databases to an encrypted
master database and vice-versa. Note though, that attaching an encrypted
database with a non-default (i.e. <> 1024) cipher page size doesn't seem
to work - this however, is apparently a SQLCipher limitation.

See issue #174.
2015-02-04 17:16:13 +01:00
Peinthor Rene
78df7275fe windowsupdatecheck: Fix a small memory leak 2015-01-27 22:14:20 +01:00
yunfzhan
71cf0531fe Add two buttons to navigate to the head and the tail. 2014-12-02 18:23:52 -08:00
Peinthor Rene
31915c4061 compat: change to compile under qt4.7 2014-11-28 19:49:15 +01:00
Martin Kleusberg
f829f06050 Distinguish Save and Save As when saving SQL files in the Execute SQL tab
When saving a SQL file in the Execute Query tab don't always ask for a
new file name but use the file name used when last saving the tab or
used when a file was opened. Add a 'Save As' menu option with the old
behaviour of always asking for a file name.

See issue #152.
2014-11-15 12:32:30 +01:00
Martin Kleusberg
efe87a4b6e Clear result view in Execute SQL tab when running a PRAGMA statement
Clear the result table view in the Execute SQL tab of the main window
when a PRAGMA statement was executed that didn't return any rows. Before
this, running e.g. 'PRAGMA table_info(test)' and then 'PRAGMA
table_info(tset)' would still present the result from the first query
even though the second should have cleared the view.

See issue #151.
2014-11-11 19:14:58 +01:00
Martin Kleusberg
f257f9248e Move syntax highlighter objects to SqlTextEdit class
Any SqlTextEdit object has its SQL syntax highlighter anyway, so it
makes sense to move the syntax highlighter object inside the text edit
class instead of maintining somewhere else. This hopefully makes the
code a bit easier to maintain.
2014-11-09 12:20:02 +01:00
Martin Kleusberg
fca39e9e1c Don't override project file settings right after loading them
This fixes a bug which was introduced during the SQLCipher development
and which caused some settings loaded from a project file to be loaded
but then replaced by the default values which were loaded right
afterwards.
2014-11-06 16:56:08 +01:00
Martin Kleusberg
ea2512d538 cipher: Fix build on Qt4 2014-11-02 19:33:28 +01:00
Martin Kleusberg
a22ed6f9d3 cipher: Add option for changing the encryption used for the current file
Add a new menu option to the main window (only visible when built with
the sqlcipher option enabled) which opens a dialog asking for new
encryption settings. These are then applied to a new database to which
all contents of the current one are exported. The old database is then
replaced by the new one.

This adds support for encrypting plaintext databases, decrypting
encrypted databases and changing the password or other settings of
encrypted databases.

If this turns out to work well enough we have functional SQLCipher
encryption support with only details missing.
2014-11-02 19:06:06 +01:00
Martin Kleusberg
8fb9176f99 cipher: Show encryption status in the main window statusbar
Add a note to the status bar of the main window when an encrpyted
database is opened.

Also make some methods in the CipherDialog class const.
2014-11-02 18:15:13 +01:00
Martin Kleusberg
9ba36d02b2 Add initial SQLCipher support
Add some basic initial support for SQLCipher. Note that this is more of
a POC than a final implementation.

This commit adds an option called 'sqlcipher' to the cmake and qmake
projects which - when enabled - replaces the default SQLite3 include and
library files by their SQLCipher counter-parts. Especially on MacOS X
there might be some more work required in finding the correct include
paths. The SQLCipher library supports unencrypted databases, too, so
even if the option is enabled the program behaves like before. You can
see the difference, though, in the About Dialog where the SQLite version
string will say 'SQLCipher version xy'.

When the sqlcipher option is enabled and you try to open a file which is
neither a project file nor a normal SQLite3 database it is assumed now
that the file is an encypted database. There is no way to tell between
an invalid file and an encypted file, so in both cases a password dialog
pops up. When the correct password and page size are entered the file is
opened and can be edited like any other database before.

Creating encrypted databases isn't supported yet. So for testing you
need to fall back to the sqlcipher command line tool.

See issue #12.
2014-11-01 12:56:53 +01:00
Martin Kleusberg
280d5c1773 plot: Use default location from preferences dialog when saving picture 2014-10-15 19:53:06 +02:00
Martin Kleusberg
a0f22a1ddb SqlExecutionArea: Use log font size for execution result
Use the same configurable font size as for the SQL log pane for the
result view of the SQL execution area tabs in the main window.

See issue #131.
2014-10-15 18:46:20 +02:00
Martin Kleusberg
5d20d97e24 MainWindow: Improve saving of project files
When saving a project file make sure it's got the right file ending.
Also add it to the list of recently opened files.

Use the default location from the preferences dialog for initialising
the file dialogs for loading and saving project files.
2014-10-15 13:44:52 +02:00
Martin Kleusberg
ff5cf3e63d MainWindow: Add project files to list of recently opened files
When opening a project file add it to the list of recently opened files
instead of the database file associated with it.
2014-10-15 13:38:32 +02:00
Martin Kleusberg
63eaf01988 MainWindow: Automatically resize Schema column in DB Structure tab
Automatically resize the Schema column in the Database Structure tab of
the main window to fit its contents.

See issue #113.
2014-10-12 17:46:50 +02:00
Martin Kleusberg
ae199112a5 MainWindow: Make sure the filters are applied before getting the row num
First apply the new filter values and only when that is done get the
number of rows in the current view. This fixes the issue that, when
changing a filter, the number of rows shown under the table view is that
of the last results, not the current.

See issue #122.
2014-10-06 15:23:55 +02:00
Justin Clift
05207b0b9f Renamed project to "DB Browser for SQLite" 2014-09-21 11:14:39 +01:00
Peinthor Rene
57d086fbf2 filters: don't clear filters on refresh 2014-09-19 18:27:40 +02:00
Martin Kleusberg
b2532686a9 Fix build on Qt 4 (hopefully) after 6c52ac736 2014-09-16 19:41:07 +02:00
Martin Kleusberg
6c52ac7368 Add menu item to allow attaching other databases
Add a new menu option which allows attaching other databases. Doing so
by running the SQL code by yourself using the Execute SQL tab won't work
because the SQL tab creates a restorepoint and attaching databases while
being in a transaction is not allowed.

Note that this commit misses quite a few features: In case of name
conflicts the UI may break, there is no way to tell which databases have
been attached and the attached databases are not stored in the project
files.

See issue #100.
2014-09-16 19:19:00 +02:00
Peinthor Rene
9682d34ca7 execsql: use the correct statement length 2014-09-04 20:33:48 +02:00
Martin Kleusberg
7d4248ecb4 Keep field information in sqlb::Table object rather than DBBrowserObject
Keep all the table and field information in a sqlb::Table object (which
itself is stored in DBBrowserObject) rather than storing field
information in DBBrowserObject and sqlb::Table objects at the same time.
2014-08-26 17:52:15 +02:00
Peinthor Rene
63c338c359 plot: add another shortcut to plot CTRL+D
if we maybe have print support in the future,
we can assign CTRL+P to print than
2014-08-24 16:58:13 +02:00
Peinthor Rene
681b143649 dbschema: shortcut for schema pane 2014-08-24 16:50:41 +02:00
Martin Kleusberg
beae69296c MainWindow: Add new dock showing the DB schema
See issue #75.
2014-08-22 15:05:23 +02:00
Martin Kleusberg
5f4066c351 MainWindow: Show line numbers in SQL log 2014-07-31 21:19:41 +02:00
mafagafogigante
262612928d some comments were corrected 2014-07-31 08:56:24 +01:00
Martin Kleusberg
17cf2018ca Remove dependency to main window from DBBrowserDB class
Get rid of the dependency to the MainWindow class in the DBBrowserDB
class. It was only used for calling the log SQL and set database state
functions anyway. The same result can be achieved emitting Qt slots.
2014-07-12 16:13:32 +02:00
Martin Kleusberg
dca664270f MainWindow: Make it possible to cancel closing of database file
When closing the database, either by using the menu item or by closing
the window, the user is asked whether the changes he made shall be
saved or not. Add a third button to this message box which makes it
possible to cancel the action.
2014-06-20 13:03:23 +02:00
Martin Kleusberg
2136813bd6 MainWindow: Add Ctrl+Return shortcut for executing SQL and add tooltips
Add the Ctrl+Return shortcut for executing the current SQL again. This
needs to be done using C++ code instead of setting it in Qt Designer
because setting multiple shortcuts in the latter means defining a key
sequence row.

Also add the keyboard shortcuts to the tooltips of the buttons as they
didn't appear anywhere in the program.
2014-06-14 13:51:12 +02:00
Martin Kleusberg
1e787b4d22 sqbpro: Allow relative database file paths
When the path to the database file given in a project file doesn't exist
try parsing it relative to the path of the loaded project file. This
makes it possible to move project and database file around together
without need to manually correct the path in the project file.

See #36.
2014-06-11 21:01:06 +02:00
Martin Kleusberg
daf12d413c Remove unnecessary overloaded function 2014-06-08 12:48:53 +02:00
Martin Kleusberg
8c8187740d MainWindow: Increase default size, tabify docks by default
Increase the default size of the main window a bit.

Move the SQL log dock to the right side and tabify it with the plot
dock. This way there is much more space for actual information by
default.

The idea behind both changes is to make it easier for first time users
to find their way around and offer them a more appropriate window layout
for the usual tasks. The layout is still entirely configurable and
non-first-time users are not affected at all.
2014-06-07 00:14:50 +02:00
Martin Kleusberg
62622ae8e8 Add support for basic project files
This add support for saving and loading of SQLiteBrowser project files.
As of now these files contain a reference to the used database file,
store some window and widget settings as well as the content of the SQL
tabs.

Note that while working this is a first draft only. Especially the
parsing code still might contain a bug or two and there is a lot more
information to be added to these files later (like filters, plot
settings, etc.).

Also note that the main intention behind these project files was to make
the life of users easier while not getting into the way of those who don't
need them. The program still remains a database browser and doesn't
become a visual database studio thing.
2014-06-06 23:32:35 +02:00
Martin Kleusberg
5e1169b43d MainWindow: Keep column widths for each table in Browse Data tab
Store the column widths of the table view widget for each table/view
individually and restore them when changing back to the table/view.
2014-06-01 19:47:20 +02:00
Martin Kleusberg
297bfbce0a Move filter header from window to table widget and show sort indicators
Move the FilterTableHeader object from the MainWindow to the
ExtendedTableWidget class because it actually is a part of the latter,
not the former.

Show sort order arrows in the table header of the Browse Data tab after
clicking it.
2014-05-25 14:35:56 +02:00
Peinthor Rene
80d5c1a117 qt5 different including hit me again 2014-05-25 13:33:11 +02:00
Peinthor Rene
f7315f5f90 add a few more help menu entries
website, wiki, bug report
2014-05-25 12:58:01 +02:00
Peinthor Rene
b5e5d3b0c5 updater: show the url we got from the release file 2014-05-16 18:29:13 +02:00
Peinthor Rene
1fdf3e4fd4 updater: exit a possible redirect loop 2014-05-16 18:24:26 +02:00