Commit Graph

624 Commits

Author SHA1 Message Date
Peinthor Rene
ade0914195 Merge pull request #11 from MKleusberg/master
Fix statement leak
2013-03-18 11:19:41 -07:00
Martin Kleusberg
5dcf08b590 Fix leak in DBBrowserDB::updateRecord()
Fix a possible leak of a SQLite statement object in case of an error in
the updateRecord() method. This also preserves the correct error message.
2013-03-18 19:02:11 +01:00
Peinthor Rene
efafe42177 Fix a transaction leak 2013-03-17 22:26:43 +01:00
Peinthor Rene
66368f8a9f Merge pull request #10 from MKleusberg/master
Fix DBBrowserDB::updateRecord()
2013-03-17 13:53:28 -07:00
Martin Kleusberg
ab6fe65ec2 Merge branch 'master' of https://github.com/rp-/sqlitebrowser 2013-03-17 21:46:10 +01:00
Peinthor Rene
e128e36b3a Merge pull request #9 from MKleusberg/improve-settings-dialog
Improve settings dialog
2013-03-17 12:38:41 -07:00
Martin Kleusberg
0d042045e0 Merge branch 'improve-settings-dialog' 2013-03-17 18:38:28 +01:00
Martin Kleusberg
725a14c21d DBBrowserDB: Fix bug in updateRecord()
Fix a bug in the updateRecord() method that made it impossible to update
INT columns.
2013-03-17 18:35:08 +01:00
Martin Kleusberg
abb1c2af3e Remove the defaulttext settings field
Remove the settings field for setting the default text. It's not used at
all and I honestly have no idea what it could be useful for.
2013-03-17 16:14:37 +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
Peinthor Rene
066356e5eb Merge pull request #8 from MKleusberg/add-blob-support
Add blob support
2013-03-17 05:17:42 -07:00
Martin Kleusberg
57f4d996ca EditDialog: Don't update the DB when no changes were made
Even when clicking the OK button don't write to the database when no
changes were made.
2013-03-17 13:07:57 +01:00
Martin Kleusberg
66b1a62fa4 Better image file handling in EditDialog
Put the image editor into a scrollarea so the dialog doesn't screw up
when importing a large image file.

When importing a file add a filter to the file dialog to only show image
files.
2013-03-17 13:02:49 +01:00
Martin Kleusberg
67c141c192 Fix minor UI issues with blob editing
By default, use the overwrite mode in the hex edit widget. This way text
and hex editor start in the same mode, making it less confusing to press
the INS key to change the mode.

When editing the data using the hex editor also update the text editor.
2013-03-17 12:39:17 +01:00
Martin Kleusberg
a8af5a7c04 Use static linking for QHexEdit
Compile and link the QHexEdit as a static library.
2013-03-17 12:31:23 +01:00
Martin Kleusberg
42fdbd326c Remove BLOB ToDo from the readme file
The most important commit in this branch...
2013-03-17 02:55:47 +01:00
Martin Kleusberg
b5bade6d52 Allow user to switch between text and hex editor
Allow the user to change between the text editor and the hex editor.

Allow the user to change between insert and overwrite mode in both
editors.

This makes it possible to enter any binary data into an empty cell.
2013-03-17 02:54:07 +01:00
Martin Kleusberg
15f685a1eb Simplify EditDialog code and improve the new multiple editor feature
Remove quite a bit of old code from the EditDialog.

Fix various smaller issues with the multiple editors added in the last
commit.
2013-03-17 02:29:45 +01:00
Martin Kleusberg
b88fd9316e Use different editors in EditDialog depending on the data type
Only show the old text edit widget when there is actually a text to be
edited. If the data is a image file show the image instead of some
random garbage. If it is some other binary data show the hex editor.
2013-03-17 02:11:12 +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
0cf9ecd158 Add the QHexEdit widget
Add the QHexEdit widget as some sort of library. Feel free to improve
the project files - I won't, every build system ever made is just
horrible.
2013-03-16 23:36:36 +01:00
Peinthor Rene
ac9901abc2 the sql text view should be read only 2013-03-16 20:36:30 +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
5737925079 Add a sqlite3 antlr2 "create table" grammar + generated parser files
There is also a "create table" ast walker which fills
info for the new sqlitetype objects.
A dependency to the antlr2 runtime was added.
The grammar most probably still contain bugs.
Why all this?
First writing grammars is fun and this is the only way
we can get all information for proper table editing + some time
in the future when the grammar is finished we can provide real
auto completion.
2013-03-16 20:18:57 +01:00
Peinthor Rene
56d8103e17 Merge pull request #7 from MKleusberg/improved-copy-paste
Improve the copy to clipboard feature quite a bit
2013-03-16 12:02:27 -07: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
e548224bd9 Add proper copy support to the SQL tab table view widget
Allow copying data from the result table view widget in the SQL tab of
the main window.
2013-03-16 19:24:08 +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
Martin Kleusberg
d9cd62ba49 Implement an extended table widget to add proper copy to clipboard support
Extend the standard table widget class to make it possible to copy
multiple cells to the clipboard.
2013-03-16 18:31:12 +01:00
Peinthor Rene
1daaac93e5 ignore object files and static libs 2013-03-13 18:11:05 +01:00
Peinthor Rene
94955c1db9 add a function to return the create table statement for a given table 2013-03-13 18:09:40 +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
e91aa3833a fix warning 2013-03-13 18:02:30 +01:00
Peinthor Rene
3c6ab04485 add antlr 2.7.7 cpp runtime for parsing the sqlite3 grammar 2013-03-13 15:35:04 +01:00
Peinthor Rene
f1ce26c72a Merge pull request #6 from takluyver/update-building
Update BUILDING instructions
2013-03-13 07:33:19 -07:00
Thomas Kluyver
c51d927761 Update BUILDING instructions 2013-03-12 22:36:20 +00:00
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