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.
Focus the SQL editor of a newly created tab to make sure it receives
keyboard input without need to click it first. On my system this wasn't
the case after starting the application, i.e. the first time the SQL tab
is used.
Add an entry for the CSV export to the context menu of the Database
Structure tab of the main windows as well which preselects the currently
selected table.
When opening the CSV export dialog via the standard menu also preselect
the currently selected table when the Database Structure tab is active.
When called while the Browse Data tab of the main window is selected
also select the current table or view in the ExportCsvDialog.
Sort the table names in the combobox of the ExportCsvDialog.
Also update the table view widget and the status message in the Execute
Query tab of the main window when the query was valid but returned no
results.
Fixes#38.
When multiple rows are selected in the Browse Data tab of the main
window and the delete record button is clicked delete all selected rows
and not just one of them.
When executing multiple INSERT/UPDATE/... statements don't cancel after
the first one. Also don't try to load them into the SqliteTableModel
class - it won't work and just generates a warning.
Use a custom model for the tree view in the "Database Structure" tab in
the main window, i.e. change from a QTreeWidget to a QTreeView and do
all the item management stuff manually. This might add some code and
complexity but also offers some more flexibility for us.