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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.