Commit Graph

155 Commits

Author SHA1 Message Date
Martin Kleusberg
31bd8fd98e Fix pragma editing
Fix a bug in the pragma editing that made it impossible to change some
pragmas because the new values were not put in quotes.
2013-01-22 17:22:09 +01:00
Martin Kleusberg
317cebf2a8 Merge remote-tracking branch 'upstream/master' 2013-01-22 16:05:36 +01:00
Martin Kleusberg
68bb8f103a Merge SQLLogDock and MainWindow
Move the SQL log dock into the main window. This means the log dock is
now included in the MainWindow.ui file and its logic in MainWindow,cpp.
2013-01-22 16:03:20 +01:00
Peinthor Rene
33b1adf58d Revert the reverted "Revert "better about dialog layout""
This reverts commit 176435646f.
2013-01-22 16:01:22 +01:00
Martin Kleusberg
e4e840dc38 Make many methods and attributes of classes private
Make most variables, functions, slots etc. private instead of public.

Also make the constructors explicit.
2013-01-20 16:00:09 +01:00
Martin Kleusberg
a0c209efd8 Get rid of some global variables
Remove two global variables storing the application short name which is
the same as the organisation name and the application icon which is only
used in one place.
2013-01-20 15:16:35 +01:00
Martin Kleusberg
e52f268578 MainWindow: Remove copy and paste actions
Remove the copy and paste actions and slots from the main window code.
They have not been working for a very long time and seem to be rather
useless anyway.
2013-01-18 22:12:20 +01:00
Martin Kleusberg
d05e90e495 Improve translatability of the application
Head towards a translatable application by loading translation files for
the current locale and using tr() where ever it's needed.
2013-01-18 18:11:07 +01:00
Martin Kleusberg
88e4b177a4 Simplify and unify the dialog initialisation a bit 2013-01-18 15:12:08 +01:00
Martin Kleusberg
8115727e75 Rewrite the Import CSV Dialog using Qt Creator
Rewrite the dialog to import CSV files using a Qt Creator form file.

Simplify the CSV import a little bit.

A bit unrelated, but needed for this anyway:
Create the restorepoint right after opening a database file instead of
just doing so after the first change.
2013-01-18 14:45:22 +01:00
Martin Kleusberg
ef197e29e3 Rewrite export to SQL dump
Completely rewrite the code for exporting the entire database to an SQL
file. The new code is more concise and should be easier to understand.
It also displays a progress bar while exporting the data. Also this
change eliminated most compiler warnings.
2013-01-10 20:03:34 +01:00
Martin Kleusberg
2a7b3d47fa Clear SQL log when closing a DB and close DB before opening a new one
Clear the SQL log when closing the associated DB file.

Before opening a new database file make sure the last one is closed
correctly.
2013-01-09 20:22:18 +01:00
Martin Kleusberg
dff9221963 Rewrite export to CSV dialog
Rewrite the dialog to export tables as CSV file using Qt Designer.

Move the entire export functionality to this dialog instead of
generating the file in the main window.

Add some options for the user to change the layout of the CSV file.
2013-01-09 20:03:48 +01:00
Martin Kleusberg
ab2a4e6479 Rewrite EditDialog using Qt Designer
Create a Qt Designer form file for the edit dialog.

Clean up the edit dialog code removing some not working and not used
functionality e.g. for blob editing.
2013-01-09 16:25:45 +01:00
Martin Kleusberg
065cb3682a Rewrite the find dialog using Qt Designer
Create a Qt Designer form file for the find dialog.

Simplify the find dialog code a little bit.

Add a new comparison operator '<>' in the find dialog.
2013-01-09 15:45:24 +01:00
Martin Kleusberg
95312a6cd3 Group objects in the DB structure tab
Group the database objects by their type when inserting them into the
tree widget in the structure tab.
2013-01-09 14:31:07 +01:00
Martin Kleusberg
41ec2f6f84 Fix half a dozen bugs concerning the find dialog
Fix bug that caused invalid rows in the result table view. This could
happen because the rowid of the search result was used as the row number
in the table widget, too. Every rowid, however, is basically a random
number and to address the rows in the table widget you need continuos
numbers.

Fix bug that made it impossible to click on any column but the first one
in the result table widget. Clicking on a column in the data column lead
to wrong rows being highlighted because exactly that text was used that
the user clicked on instead of taking the text of the first column of
the row the user clicked on.

Make it impossible for the user to edit the cells of the search result
table widget. Editing these not just only makes no sense at all but can
also lead to wrong rows being selected in the main window when the rowid
in the first column was changed.

Fix bug that caused the wrong row to be selected in the main window.
When the table view in the find dialog is populated the rowid shown is
increased by one for every search result. This is fair enough but then
this modified row number needs to be changed back before selecting it.
Not doing so leads to always selecting row right after the intendet one.

Fix bug when searching for entries containing a number in some field.
This was caused because the search string was changed to be surrounded
by %-signs as you'd expect when doing a containing-search. However, the
check wether we're searching for a number or not was done on the old
string. So checking for a number was positive even though the program
would actually search for a string. This way the string was not put into
'...'-signs, leading to a malformed SQL statement.

Clear all input widgets as well as the result table widget when
(re)opening the find dialog. This may be less comfortable in some
situations but at least is a bit more consequent because the column
combo box was reset anyway.
2013-01-09 01:20:30 +01:00
Martin Kleusberg
73ca1045a2 Also rename AboutDialog
Missed that file in the last commit
2013-01-08 21:45:55 +01:00
Martin Kleusberg
cda16ba0fb Remove the modified flag in the EditTableDialog
Remove the flag storing the mofification status in the edit table
dialog. It's only been used in one place and there it was not even
really needed - so why bothering updating and maintaining it?
2013-01-08 21:24:45 +01:00
Martin Kleusberg
24c3eca2e5 Rename dialog files and classes
Rename the files and classes for the dialogs to share all the same
naming pattern. This should make navigation in the code a bit easier.
Do not include dialogs not rewritten yet; they'll be edited as they are
redesigned.
2013-01-08 21:19:01 +01:00
Martin Kleusberg
32ab512f08 Rewrite the create index dialog
Use Qt Designer for the create index dialog.

Change the layout of the create index dialog completely to be easier to
use and more powerful.

Rewrite most of the index creation code to be easier to understand and
more flexible.
2013-01-08 20:55:18 +01:00
Martin Kleusberg
b38ea3c6bf Silence to debug messages 2013-01-08 19:43:57 +01:00
Martin Kleusberg
684b825a9e Add new function to DBBrowserDB which creates a new table
Add a new function to the DBBrowserDB class which creates a new table.

Use this function in most places where a table needs to be created.
2013-01-08 19:41:07 +01:00
Martin Kleusberg
f8c629ca4e Add keyboard shortcuts for the buttons in the browse tab again
Re-add the keyboard shortcuts for the find and refresh button in the
browse tab. They were lost in the process of using Qt Designer again.
2013-01-07 23:57:31 +01:00
Martin Kleusberg
6b9ad93116 Support dropping of columns
Support deleting columns of existing tables. Again this requires a
workaround because of SQLite's ALTER TABLE support.

Also show an error message to the user when editing a column failes.
2013-01-07 23:54:15 +01:00
Martin Kleusberg
fac589c3e3 Allow editing fields in existing DB tables
Make it possible to rename columns and change their types even when
editing an existing table. This requires a workaround to not use the
ALTER TABLE command which is not fully supported by SQLite.
2013-01-07 23:33:52 +01:00
Martin Kleusberg
b0af89c1cb Move code to rename table to DBBrowserDB class
Move the code to rename a table from the EditTableForm to the
DBBrowserDB class where it should be and where it obviously was intended
to be.
2013-01-07 22:43:31 +01:00
Martin Kleusberg
7904b594ed Delete the SQLite source code
Delete the SQLite source files and change all includes to external
files. This is how libraries are supposed to work and avoids spamming
the project diff with updates that were not even done by us.
2013-01-05 23:18:47 +01:00
Martin Kleusberg
1c4891ad47 Silence some runtime warnings
Rename all slots starting with "on_" because Qt tries to auto-connect
them to signals of that name. And as those signals do not exist Qt
prints a warning for each of them after every program start.
2013-01-05 16:21:28 +01:00
Martin Kleusberg
acfb40902a Reset sorting when changing the current table
Reset the sorting of the table view in the browse tab when changing the
current table. This offers not just only a more plausible behaviour to
the user but also fixes a bug that would cause an empty table to be
shown when sorting e.g. column number 5 and then changing to a table
with just 2 columns.
2013-01-05 16:08:33 +01:00
Martin Kleusberg
bed67cd970 Make sure to always escape table and column names properly
Always put `...` around the names of tables, columns and other objects
to avoid errors when the user creates objects with the name of key
words.
2013-01-05 15:31:42 +01:00
Martin Kleusberg
2201ff3234 Partially undo 9a9d32a5a7
Reload the DB structure even when changing to the browse tab asthe
structure might have been changed when coming from the SQL tab.
2013-01-05 15:16:32 +01:00
Martin Kleusberg
e7d213c546 Set text codec to UTF8 fixing the handling of special characters
Set the encoding used by Qt to UTF8. This fixes the wrong appearance of
special characters caused by SQLite using UTF8 and the application
ISO-8859 or whatever.
2013-01-05 14:48:13 +01:00
Martin Kleusberg
9e2beb6c81 Fix a few bugs in the CSV import
Start numbering the rows in the preview table view of the ImportCSVForm
with #1 instead of 0.

Don't create too many columns when filling the preview table view.

Keep the UI responsive when reading a CSV file. This way the progress
dialog can be seen, too.

Don't crash when reading files without an empty line at their end.
2013-01-05 14:37:58 +01:00
Martin Kleusberg
a836837b57 Quiten some more debug messages
Remove some more debug messages. There is no point in showing them when
there has been no error.
2013-01-04 23:26:38 +01:00
Martin Kleusberg
a1c2aca84b Do not allow empty tables in EditTableForm
Do not allow the creation of a table without any columns as this would
lead to an SQL error.
2013-01-04 17:53:10 +01:00
Martin Kleusberg
88ee12a1ab Delete the DeleteIndexForm
Delete the DeleteIndexForm as it is no longer needed. Since the last
commit an index can be deleted directly via the popup menu.
2013-01-04 17:41:26 +01:00
Martin Kleusberg
41e0a11452 Allow deletion of indices, views and triggers
Extend the code used to delete tables to also allow the deletion of
other objects in the data base.

Change the activation of the popup menu entries to activate the
associated action when a trigger, view or index is selected.
2013-01-04 17:31:34 +01:00
Martin Kleusberg
d12bb62156 Change design of DBBrowserDB a bit and support more actions with views
Change the design of DBBrowserDB to store all DB objects in one single
map instead of having one map for table, one for views, one for triggers
etc. This requires some changes in the entire program.

Show more details of views in the DB structure tab, i.e. the names of
the fields included in the view. Allow browsing views in the browse tab
and allow exporting views as CSV.
2013-01-04 16:38:59 +01:00
Martin Kleusberg
9409622e75 Do various changes to improve usability of the main window a bit 2013-01-03 23:14:33 +01:00
Martin Kleusberg
130e389bd6 Start simplifying the dialog construction and destruction a bit 2013-01-03 16:06:30 +01:00
Martin Kleusberg
9fbddc34b5 Move content of sqlitebrowsertypes.h to sqlitedb.h 2013-01-03 15:19:17 +01:00
Martin Kleusberg
d446df58a0 Use per pixel scrolling in tree widget showing the DB structure
Do not scroll per item but per pixel when scrolling in the tree widget
in the DB structure tab of the main window. This makes scrolling much
more comfortable when the schema string includes line breaks.
2013-01-03 14:41:24 +01:00
Martin Kleusberg
8290a035e8 Add basic and shaky pragma editing
Since quite a few problems are fixed by now and the program is moving
towards rudeimentary usability again it's time to add some new features
and problems!
2013-01-03 14:36:28 +01:00
Martin Kleusberg
8ec19c4513 Update the icons
Remove no longer used icons, add a new one and replace one or two old
icons by new ones.
2013-01-02 23:34:40 +01:00
Martin Kleusberg
9b2e8cd5a4 Show those TODO message also when using the toolbar or the popup menu
This should let the user know that something's not working instead of
offering him a not working dialog and winding him up this way. That
should make the behaviour of the program much easier to understand.
2013-01-02 23:04:04 +01:00
Martin Kleusberg
7424268f28 Show a TODO message when trying to edit column of an existing table
Don't allow the user to edit the columns of an existing table and show a
warning instead. It's not working anyway.
2013-01-02 22:51:11 +01:00
Martin Kleusberg
b485e332f5 Extend remove table column function
Make it possible to remove columns in the dialog shown to design a new
table.
Show a TODO message when user tries to delete a column in an existing
table.
2013-01-02 22:45:22 +01:00
Martin Kleusberg
58b247b9aa Create savepoint when editing a table
Create a savepoint when starting to edit an existing table, release it
when the user clicks on the OK button and rollback to it if he cancels
the action.
2013-01-02 22:30:35 +01:00
Martin Kleusberg
4bebed0365 Change company name
There isn't really any company behind this project, so why name one?
2013-01-02 20:31:14 +01:00