Commit Graph

500 Commits

Author SHA1 Message Date
Vladislav Tronko
b9dd11df53 Escape HTML entities in Execute SQL output(fixes #777) 2016-09-25 21:01:55 +03:00
Iulian Onofrei
d825af8c69 Update MainWindow.cpp
Fix Travis build error introduced by the last merged PR
2016-09-23 15:23:21 +03:00
Iulian Onofrei
420b98fee3 Fixed executing current SQL line not working for multiple lines SQLs (#780) 2016-09-23 00:17:48 +03:00
Iulian Onofrei
55d8905b90 Fixed SQL log containing incorrect lines when executing the current line
- related to #768
- introduced by 649b1790
2016-09-09 00:46:29 +03:00
Vladislav Tronko
8783728c19 Moved inserting empty row inside model code 2016-09-06 23:01:03 +03:00
Vladislav Tronko
3a06395f88 Divide PreferencesDialog in two classes
This forces PreferencesDialog to serve only for UI needs.
Plus, this opens the door for adding another class for shortcut
management without pain.
2016-09-03 22:30:55 +03:00
Martin Kleusberg
684958b29c Only reload DB schema when necessary
We used to reload the database schema whenever it might have been
changed and the latest version was required. For example: when the user
switches to the Structure tab we need the current schema; so we just
reloaded it to be safe - it might have been changed in the Execute SQL
tab or wherever.

With this commit we don't reload the database schema anymore when an
up-to-date version is needed but instead when it was changed by the
application. So in the example above it's not reloaded at all anymore.
Only if and when the user would execute some structure changing SQL it
would be reloaded.

Benefits:
- Better performance
- State of the structure tree view isn't lost as frequently
- Structure tree view gets updated when changing the structure in the
  Execute SQL tab

Downsides:
- Less error proof (testing!)
- No 'automatic' updates when the db is changed by an external
  application.

Any suggestions welcome!
2016-08-30 00:29:50 +02:00
Martin Kleusberg
a1e08b37c9 Rename ExportCsvDialog to ExportData dialog
Sorry for the big change but I think it's preferable to not call it CSV
dialog when it's not just doing CSV.
2016-08-25 23:12:36 +02:00
Vlad
3ef9491d64 Use references for safety (#747) 2016-08-25 23:02:40 +02:00
Vladislav Tronko
281cf5cb73 Close database only if it was opened 2016-08-25 13:46:24 +03:00
Vladislav Tronko
50a1231580 Remove magic numbers 2016-08-25 12:07:58 +03:00
Martin Kleusberg
f91773b291 Add basic JSON export feature
This adds some basic functionality for exporting JSON files by extending
the CSV export dialog. There is still a bit of work required for
fine-tuning the JSON export feature though. But a standard export of a
table s working well already.

See issue #688.
2016-08-25 01:04:12 +02:00
Justin Clift
078c48d679 Delete [object] button's tooltip now changes with object type 2016-08-22 16:00:26 +01:00
Justin Clift
48643430a5 Add SQLCipher FAQ option in the Help menu
This new Help menu option only displays for SQLCipher enabled
builds.  For non-SQLCipher ones, it's not shown.

Closes #734.
2016-08-19 16:16:29 +01:00
Vladislav Tronko
f4590da1d8 Slight changes on editing permissions 2016-08-19 13:22:58 +03:00
Martin Kleusberg
4d29271954 Introduce enum for main window tabs 2016-08-16 23:54:54 +02:00
Martin Kleusberg
bbc14d61ba Don't set model for Browse Data view at startup
No nee to bother with this. It gets cleared again later during startup
anyway.
2016-08-16 22:54:16 +02:00
Martin Kleusberg
27f8b96edc Simplify code
The parameter for populateTable isn't needed anymore
2016-08-16 22:51:21 +02:00
Martin Kleusberg
efd4fc4820 Bugfix
This fixes a bug in the foreign key handling in the Browse Data tab
which I introduced during my optimisations.
2016-08-16 22:46:28 +02:00
Martin Kleusberg
d288a41dba Clean up code
Just some simplifications, nothing more.
2016-08-16 22:45:22 +02:00
Martin Kleusberg
0dab0a28a1 Don't refresh Browse Data tab if it isn't visible anyway
This doesn't reduce the number of populateTable calls (well, obviously)
but it reduces the cost of some of the more useless ones a lot.
2016-08-16 22:27:56 +02:00
Martin Kleusberg
c65c07a433 Browseable objects always are tables or views; no need to check 2016-08-15 23:22:42 +02:00
Martin Kleusberg
014174bc26 Get rid of the resetBrowser() method
This hopefully helps to simplify and restructure the code. If it turns
out to make things only worse we can undo it. This *should* make no
changes for the user.
2016-08-15 23:08:32 +02:00
Martin Kleusberg
5fd3a80c0d Remove unnecessary calls to populateTable()
This simplifies the code and speeds up some processes. A little bit at
least.
2016-08-15 21:59:42 +02:00
Martin Kleusberg
2799c29bbb Don't delete and re-create the database model when closing a database
This simplifies the code a bit.
2016-08-15 21:27:51 +02:00
Vladislav Tronko
57672f6d83 Cut off redundant expensive constructions 2016-08-15 10:32:03 +03:00
Martin Kleusberg
777088fc80 Improve code for deleting table rows
Actually handle the case that deleting rows might fail in the
SqliteTableModel. That's where this sort of check belongs.

This allows us to get rid of the full refresh of the table view after
deleting a row in the Browse Data tab. Thanks to @innermous for pointing
this out!
2016-08-14 16:39:37 +02:00
Vladislav Tronko
dbda6871b6 Fix Travis build 2016-08-13 02:44:37 +03:00
Vladislav Tronko
ad10e8016c Polished cell editor widget 2016-08-13 01:56:14 +03:00
Justin Clift
b835ae800b Reimplement data loading and handling for the Edit Cell
This uses a somewhat different approach to the previous
one.  It now selectively stores the data into either
the text *or* hex widget buffer, and only copies the
data between them when the edit mode is changed.

Additionally, unneeded copy operations are minimised
where possible to reduce overall slowdown.:
2016-08-09 13:04:32 +01:00
Justin Clift
e66ac3e666 Only update contents of the Edit Cell dock when its visible
This significantly speeds up keyboard navigation with large
cell data (eg images), then the Edit Cell dock is turned off
2016-08-06 15:22:27 +01:00
Iulian Onofrei
a39554fd11 Update CreateIndex dialog and actions (#704) 2016-08-05 14:04:19 +01:00
Iulian Onofrei
163ce09943 Fix crash after closing unsaved database (#690)
(introduced by @6f17c3d1)
2016-08-01 15:29:48 +01:00
Iulian Onofrei
f2a4ee3057 Fixed code style
- replaced hacky code
2016-08-01 11:58:34 +03:00
Justin Clift
b773e77a0c Corrected a minor comment 2016-07-27 20:57:25 +01:00
Justin Clift
89baf3464d Adjust the layout of the Edit Cell as per #673 (#679) 2016-07-27 20:41:01 +01:00
Justin Clift
0d7a42b530 Enable the workaround for & characters in titles on all platforms
It wasn't just happening on Windows, but on OSX too.  Untested on
others, but wouldn't be suprising if it was on all platforms.
2016-07-26 16:29:38 +01:00
Justin Clift
9fe42b1399 Edits via the in-place editor now propagate to the Edit Cell 2016-07-26 15:35:21 +01:00
Iulian Onofrei
d03aef1e35 Fix transactions not being ignored when executing SQL (#656)
* Fix transactions not being ignored when executing SQL

* Fix transactions not being ignored when importing from SQL

* Fix Travis build error

* Fix Travis build error
2016-07-24 12:55:16 +01:00
Justin Clift
f881f95ea9 Rationalise the Edit Cell dock and Windows code into one
Prior to this PR, we've had the Edit Cell be available both in a "dock"
and "window" mode.  Both at the same time. (!)

The "dock" mode already had tear off window functionality and was more
complete, whereas the "window" mode was buggy and didn't really add
anything new.

This PR removes the "window" version of the dock, and cleans up the
handling of "dock" mode, so there's just one Edit Cell dock now.  It
can be torn off and used as a window, docked to the main UI (by double
clicking its title bar), and toggled on/off with Ctrl-E (Cmd-E on OSX).
2016-07-21 22:55:13 +01:00
Vladislav Tronko
0f88fac26f Check selection before exporting to CSV 2016-07-21 18:32:00 +03:00
Vladislav Tronko
2cbc2bec28 Load window settings at the start of init 2016-07-21 16:05:44 +03:00
Justin Clift
21ad12cba8 Add Ctrl-E (Cmd-E on OSX) shortcut to toggle the Edit Cell on and off 2016-07-20 21:10:10 +01:00
Iulian Onofrei
46ccc3a8d8 Fixes #510
- refresh the table after toggling the Show row id column option
2016-07-12 23:39:57 +03:00
Vladislav Tronko
f39dc20f63 Update buttons in removal message boxes 2016-06-08 00:41:27 +03:00
Vlad
c91390941d Add duplicate record option (#594) 2016-05-24 19:47:09 +02:00
Justin Clift
6b8a44fb90 Merge pull request #600 from revolter/master
Fix database toolbar actions not updating after deleting a table
2016-05-22 01:17:37 +01:00
Iulian Onofrei
cc055fbef1 Fix database toolbar actions not updating after deleting a table 2016-05-22 02:29:57 +03:00
Vladislav Tronko
330af1a6a9 Prevent crash when removing records 2016-05-14 18:50:48 +03:00
Martin Kleusberg
b00c4f791f plot: Add button to load all data
See issue #499.

This also fixes a bug introduced in 6784a6a854
which effectively disabled the partial prefetch mechanism on large
tables.
2016-05-05 22:57:57 +02:00