Commit Graph

175 Commits

Author SHA1 Message Date
Peinthor Rene
df91d663f9 Fix the transaction logic 2013-03-05 20:22:17 +01:00
Peinthor Rene
93acb897df fix locking the database by just opening it 2013-03-04 19:25:15 +01:00
Peinthor Rene
2920697894 add setter and a datatype list 2013-03-03 22:12:16 +01:00
Peinthor Rene
9394caffa9 add classes for a new sqlite field and table objects
plus a unittest build mode
2013-02-28 17:15:03 +01:00
Peinthor Rene
05a5db3e28 indicate database encoding in the statusbar 2013-02-23 13:18:46 +01:00
Peinthor Rene
d6533747b4 rework database encoding settings and conversions 2013-02-23 13:00:07 +01:00
Peinthor Rene
f8777ca550 add some constness 2013-02-14 18:43:46 +01:00
Peinthor Rene
ba34c1e986 add basic autocompletion for tables and fields to the sql text input
this does only work on full table names, NOT on aliases
for a full auto completion to work we need a sqlite parser
2013-02-14 17:32:54 +01:00
Peinthor Rene
158e35ae65 set the monospace font crossplattform 2013-01-29 23:10:27 +01:00
Peinthor Rene
6765737bf4 tweak fonts for sql edit widgets 2013-01-29 18:41:19 +01:00
Peinthor Rene
4601c5fc27 set better size for the browse table combobox 2013-01-29 18:37:18 +01:00
Peinthor Rene
f8e51cc07a add a foreign key setting
to open database with foreign keys enabled
2013-01-29 18:26:29 +01:00
Peinthor Rene
9c9e1a61f3 show the user a fancy subdialog will be opened 2013-01-29 08:12:43 +01:00
Peinthor Rene
f9cc48bdcc always link to shared sqlite3 2013-01-26 11:10:15 +01:00
Peinthor Rene
13792e8100 forgot to add an else branch 2013-01-26 10:25:50 +01:00
Peinthor Rene
c5dafe9617 avoid useless string copies and fix a bug with logSQL because of that 2013-01-26 10:23:04 +01:00
Peinthor Rene
fbfe25cca9 show browsetable tab on start 2013-01-26 10:22:11 +01:00
Peinthor Rene
322520270d rework the pragma view and setting
removed uninteresting PRAGMA's for user
only set PRAGMA if value has changed
commit transaction before setting pragma with user warning
show the current PRAGMA value after setting
2013-01-25 14:55:03 +01:00
Peinthor Rene
95dbd93ab8 remove sqlite_source from include path 2013-01-25 14:29:32 +01:00
Peinthor Rene
9c6bb1daed remove duplicate setDirty 2013-01-25 14:27:54 +01:00
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