Commit Graph

546 Commits

Author SHA1 Message Date
Peinthor Rene
5289adaab8 Remove the editfield dialog and the edit options outside of edittable dialog 2013-03-19 17:18:52 +01:00
Martin Kleusberg
2165e544a2 Move all settings logic to the preferences dialog
Read and write the settings only from the preferences dialog.

Remove all the copies of some settings which were stored in nearly every
dialog class individually.

Simplify the settings dialog code by removing all those not really
needed slots.
2013-03-17 16:09:28 +01:00
Martin Kleusberg
6c8712d804 Change the internal data type for cell contents to a binary type
Store the data of a DB cell in a QByteArray, i.e. a binary data type,
instead of putting it in a QString, thus converting it to a UTF8 string.

Rewrite the reading and writing of DB cells to correctly handle binary
data containing 0x00 bytes.

Change the edit dialog to actually do all the data checks etc. on a
currently invisible QHexEdit widget instead of a QTextEdit.

All these changes combined make it possible to actually store binary
data without it being corrupted. You can for example import pictures
now, export them and actually open the exported file. So this is an
improvement.
2013-03-17 01:38:48 +01:00
Martin Kleusberg
80e4708fc2 Fix selection of entire columns in browse tab
Fix the selection of entire columns in the browse tab table view. Even
when selecting multiple columns the data would be re-sorted instead of
selected; this is changed now.
2013-03-16 19:35:27 +01:00
Martin Kleusberg
5e8c14e942 Make the QTableWidget a QTableView
Rewrite some code to use a QTableView widget instead of a QTableWidget
in the browse tab of the main window, or more presicely in the new
extended table widget class. This way the widget and the data model are
separated which on the one hand means a bit more work on our side but on
the other hand also gives us a bit more flexibility. And more
importantly at the moment: This means both, the browse tab and the sql
tab, use a table view now - that's going to be helpful for the next
commit...
2013-03-16 19:10:03 +01:00
Peinthor Rene
0286520f19 set a restore point if a non SELECT was executed 2013-03-13 18:03:17 +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
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
c5dafe9617 avoid useless string copies and fix a bug with logSQL because of that 2013-01-26 10:23:04 +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
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
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
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
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
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
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
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
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
0180017dbd Delete the ChooseTableForm and DeleteTableForm dialogs
Delete those two dialog, the only use of which is to make it possible to
select a table which is totally pointless because the user can do this
in the main window and would probably do so intuitively anyway.
2013-01-02 20:03:33 +01:00
Martin Kleusberg
547e8d9964 Fix window caption of edit field dialog called by popup menu
Fix the caption of the edit field dialog to show the correct table name
when it is called by the modify field action in the popup menu or the
toolbar.
Also remove one more useless debug message.
2013-01-02 19:14:38 +01:00
Martin Kleusberg
0f323dcbfa Allow all file names when opening a DB by drag & drop 2013-01-02 19:03:52 +01:00
Martin Kleusberg
eef1c04020 Rename files to match class names 2013-01-02 19:01:47 +01:00