Commit Graph

22 Commits

Author SHA1 Message Date
Martin Kleusberg
82d78384e0 EditTableDialog: Some minor code clean up 2013-05-31 14:29:45 +02:00
Martin Kleusberg
7e319bd80f EditTableDialog: Fix adding new fields to table
Fix the function to add new columns to an existing table to work
properly with the recent changes.
2013-05-31 14:21:11 +02:00
Martin Kleusberg
b1333c90c7 EditTableDialog: Make it possible to change the type of existing columns
Restore the possibility to change the data type of a column of an
existing table - a feature we lost some time ago.

Also change the updateTypes() method to not actually update the types of
all columns when only one can be changed at a time.
2013-05-31 14:14:30 +02:00
Martin Kleusberg
8063502def EditTableDialog: Allow renaming columns of existing tables
Make it possible to rename the columns of already existing tables using
the EditTableDialog. This is a feature we lost somewhere around commit
b36800ea02.
2013-05-30 15:35:25 +02:00
Martin Kleusberg
8c86a01faf EditTableDialog: Don't change the cursor when renaming the table
Renaming a table doesn't take a lot of time hence no need to change the
cursor.
2013-05-25 17:22:20 +02:00
Martin Kleusberg
f3ae25572d DBBrowserDB: Remove the dirty flag
Remove the dirty flag as it is no longer needed. Because we track the
savepoints currently held open we can just use that list to see wether
there are changes to be committed. So there is no need to track this in
a separate variable.
2013-05-23 18:16:58 +02:00
Martin Kleusberg
a1b72c5eef Extend the entire savepoint logic to allow multiple active savepoints
Allow multiple savepoints in DBBrowserDB, i.e. setRestorePoint() doesn't
simply return if the DB is already set to dirty but creates an
additional savepoint.

Track the names of all savepoints which have not been either saved or
reverted yet.

Finally, and that's the whole point of this commit, change the savepoint
logic of the EditTableDialog. We used to have a transaction started when
opening a database which was only committed when the file was closed
again. This way the EditFileDialog could savely create a savepoint when
being opened and just release it when OK was clicked or revert to it
when cancel was clicked. Getting rid of the transaction broke this
logic. The dialog still worked but as the savepoint was released when
the changes were applied all changes made via the dialog were
immediately committed to the database. So clicking the revert button had
no effect on those changes. This is at best an unexpected behaviour but
could also be a problem when some changes are reverted while others
aren't. So, having the option now of keeping multiple savepoints opened
this problem can be fixed by just creating a new savepoint every time
the dialog is opened, reverting to it when it is cancelled and _not_
releasing it when OK is clicked.

I hope this works!
2013-05-23 17:41:16 +02:00
Martin Kleusberg
5b9d5cc40b Remove some debug messages. Change some error messages..
Remove some useless debug messages, e.g. because they just print an SQL
string which you can see in the SQL log window anyway.

Change some "critical" errors messages to just warning. No sense in
printing a critical error message when the program can handle the
problem by itself.
2013-05-08 22:03:04 +02:00
Peinthor Rene
7614f40146 forgot a ! after var rename 2013-03-28 21:16:00 +01:00
Peinthor Rene
b36800ea02 disable editing of table data if not a new table
we currently don't support it
2013-03-28 19:00:45 +01:00
Peinthor Rene
c4f09765b3 add columns if modifying tables 2013-03-24 13:02:27 +01:00
Peinthor Rene
b47ef8f3f7 add PK and autoincrement click logic to edittabledialog 2013-03-19 17:18:52 +01:00
Peinthor Rene
bf29ebb37c add new field properties default value and check constraint 2013-03-19 17:18:52 +01:00
Peinthor Rene
c3e0d8782c Fix broken table object/sqltext edit update 2013-03-19 17:18:52 +01:00
Peinthor Rene
1b0d5a2ff9 Fix view updating after remove field in edittable dialog
rename the FieldList typedef to FieldVector
use a object instead of a table pointer in edittable dialog
2013-03-19 17:18:52 +01:00
Peinthor Rene
05da4bfe8e Rework the create/modify table dialog.
In the crusade to remove the ugly edit field dialog.
Editing tables does currently not work because of a locking issue.
2013-03-16 20:22:23 +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
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
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
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