Commit Graph

126 Commits

Author SHA1 Message Date
mgrojo
82665e3f09 Find/Replace dialog for SQL editors and logs
A classic Find/Replace dialog including all the options provided
by the QScintilla editor. Additionally a "Replace All" and a
Find All" button are implemented. This complements issue #191

New shortcut in main window for opening the find/replace dialog
connected to the focused widget. Standard for Replace is Ctrl+H.
Consequently the shortcut for Copy with Headers is changed to
Ctrl+Shift+C (see issue #1058).

For SQL text widgets not embedded in the main window, the standard
shortcut cannot be enabled, otherwise it conflicts with the main
window. Therefore the shortcut Ctrl+Shift+H is enabled for all the
SQL widgets as fallback. A better solution would be desirable.
2017-11-25 21:39:41 +01:00
mgr
e8e5671588 Range of plot points can be selected in graph and in table
The user is now able of selecting a range of contiguous points in any of
the graphs of the plot, through rectangle selection or click in single
point. This selection triggers automatically the selection of the
corresponding lines in the browsed table. In this way the user can analyse
the plot in detail.

Two other minor improvements: spelling error fixed and the dummy column in
the plot selection table has now transparent foreground (intends to avoid
wondering of the user about what functionality provides this column).
2017-11-11 23:10:11 +01:00
mgr
5b6cdf231e Execute SQL tab: Add search bar for SQL code #191
The find operations in QScintilla are used for implementing a find frame
in the SQL Editor of the main window. A checkable tool button is added
in the SQL Editor toolbar for showing and hiding this frame.

There are check boxes for Whole Words, Case Sensitive and Regular
Expressions. The QScintilla facilities in the findFirst method are used
for the implementation.
2017-11-11 19:31:33 +01:00
Martin Kleusberg
ee32b3e4e1 Use nullptr where possible 2017-10-30 21:20:02 +01:00
Martin Kleusberg
66fa44497d Try to fix build on Windows
See issue #1193.
2017-10-26 23:24:04 +02:00
Martin Kleusberg
bc91126b2c Allow renaming SQL tabs by double clicking them
See issue #1186.
2017-10-22 14:08:52 +02:00
Martin Kleusberg
37e5b62842 Make code easier to read 2017-10-20 17:47:04 +02:00
Martin Kleusberg
32da4de94d Fix collate warning after addition of multi-threaded loading
The no collate function warning is triggered in a thread which is used
for loading data. However, the warning is a message box and GUI elements
can only be drawn in the main thread. So the old code would crash. This
is fixed here by jumping to the main thread for showing the message box.
2017-10-16 21:58:30 +02:00
Martin Kleusberg
d4e228d4b5 Make hidden columns persistent
With this commit the main window keeps track of the hidden columns and
re-hides them when the table is selected again. It also saves the hidden
status to the project file and restores it from there.
2017-09-18 20:41:27 +02:00
Peter Hyatt
c5c3d2366e Added hide selected columns and show all columns to tableview context menu.
Added a fix for building with MingW on Windows.
2017-09-18 19:47:27 +02:00
Martin Kleusberg
e9d4b3912a Move button for saving Execute SQL results to the toolbar
In the Execute SQL tab, move the button for saving the results of a
query as either a CSV file or a view from the bottom of the results view
to the toolbar at the top.

See issue #1122.
2017-09-10 15:00:31 +02:00
Martin Kleusberg
ea1659e1d0 Support schemata other than main in the Browse Data tab
Similar to commit 44eb2d4f99 this commit
makes use of the backend code improvements introduced in commit
532fcd3f6b.

It adds support for database schemata other than "main" to the Browse
Data tab. With this it's possible again to browse and edit data of
temporary tables using the Browse Data tab. This time, however, they are
separated logically from "main" tables. So handling temporary tables
should be a lot less error prone now, plus it's easier to tell for the
user what tables goes in what schema.

This commit changes the project file format. There is some code included
which allows loading of project files in the old format. However,
project files generated using versions after this commit can't be loaded
by older versions of DB4S.
2017-09-04 12:27:52 +02:00
Martin Kleusberg
d14fb1fbb1 dbhub: Remove remote menu, add push button to remote dock
This commit removes the File -> Remote menu entirely. The only menu item
that was left was the Save to Remote item which is replaces by a button
in the remote dock.

The button is only enabled when a database file is opened and the user
has logged in using a certificate.

Clicking the button opens the same dialog and performs the same actions
as before. The only difference is that we don't use the first client
certificate - no matter which one it is - but instead use the client
certificate that was used for logging in.
2017-08-03 17:35:36 +02:00
Martin Kleusberg
6984d451d6 Properly initialise table browser settings 2017-06-17 13:11:59 +02:00
Martin Kleusberg
21ee1f2703 Allow updating views
This adds a new context menu option that allows unlocking views for
updating. This requires appropriate triggers to be in place and the user
to type in a column name that can be used as a 'primary key' for the
view. By default views are still locked from editing.

Inserting into and deleting from views isn't supported yet.

See issue #141.
2017-05-12 18:17:50 +02:00
Martin Kleusberg
43a5175af1 dbhub: Keep track of the cloned databases
This adds a local database to keep track of all the cloned databases.
For now we only use this information to prevent exactly the same
database being downloaded twice.
2017-03-23 19:08:26 +01:00
Martin Kleusberg
1e9fec270b Merge automatic update check into dbhub.io code
Move the network part of the automatic version check code into the
dbhub.io parts. While semantically this doesn't make a lot of sense it
simplifies the code a bit, reduces the size of the main window class,
and avoids duplication of code e.g. when introducing proxy support.
2017-03-19 17:29:20 +01:00
Martin Kleusberg
3e4f3fc3d2 dbhub: Add remote dock with directory browsing support
This adds a new dock to the main window that contains all the remote
functionality (or is supposed to contain it all in the future).

It also adds a directory browsing feature which allows you to browse
through the folders and files on the dbhub server.

By double clicking a database you can download and open it. The Open
Remote menu action isn't needed anymore and has been removed.

This also fixes an issue with pushing databases where, after sending the
file is completed, the save dialog was opened.

Note that this is still WIP and is far from polished.
2017-03-18 20:40:59 +01:00
Martin Kleusberg
e43dbddbd3 Remove unnecessary includes
Hopefully this reduces the compile time a little bit.
2017-01-20 22:37:59 +01:00
Martin Kleusberg
c9ceb5da59 Add Edit Index feature
Improve the Create Index dialog so that it allows creating as well as
editing indices.

Chenge the code for the main window to allow editing existing indices.
2017-01-20 12:15:49 +01:00
Martin Kleusberg
45580865d3 Merge branch 'plotrefactoring' 2017-01-16 12:46:52 +01:00
Martin Kleusberg
50ef6cd7c3 Allow opening databases in read only mode
See issue #325.
2017-01-15 20:22:01 +01:00
Martin Kleusberg
a6f2a7d9a0 Move plot code into a separate set of files
This cleans up the main window class a bit which was getting quite large
and a bit harder to maintain than necessary.

This commit also includes two minor fixes to the plot system:
- The plot widgets are now disabled when no database file is opened.
- The progress bar shown when fetching all data is now initialised with
the correct row numbers.

Other than that this commit should in theory not change any
functionality.
2017-01-13 18:00:39 +01:00
Martin Kleusberg
6283f97598 dbhub: Add list of CA certificates and restructure code
Change the layout of the preferences dialog a bit.

Remove the server selection combo box from the preferences dialog as it
will probably never be required. The way we do logins using certificates
kind of makes this obsolete, I think.

Restructure the whole remote code a little bit. Also add helper
functions here and there.

Show a list of our the CA certificates built into the application in the
preferences dialog. This list is read only of course but still
informative as it tells the user which sites are supported ny DB4S.
2016-11-01 19:45:42 +01:00
Martin Kleusberg
4d26624bda dbhub: Add very basic support for opening remote files
This adds some initial support for opening remote files. You can enter a
URL and DB4S will try to download the file. When successful you'll be
able to specify a place and name to save the file under, and after
saving it locally to disk it'll be opened just like any local database
file.

See the included TODO comments for missing features. Most notably
missing is the HTTPS and certificate handling code. Also any support
for storing the remote source of a database is lacking.
2016-10-24 22:49:32 +02:00
Martin Kleusberg
1ced897793 Switch to using C++11 and Qt5 (#808)
* grammar: Simplify code thanks to C++11 being there

* Use lambdas instead verbose slots for duplicating record

* travis: Use Qt5
2016-10-18 17:31:20 +02:00
Martin Kleusberg
d5c6b7bb0e Remember plot settings for each table (#819)
Store and restore the plot settings for each table - just like the
filter values or the column widths. This way you can have multiple
plots, one for each table.

Also, save these settings in the project files.
2016-10-14 13:24:06 +02:00
Martin Kleusberg
da7f472864 Make shortcut for 'reload' dependent on currently active tab
Make the reload shortcut (at the moment F5 and Ctrl+R) dependent on the
currently active tab. This way it always performs some meaningful task,
depending on the current context.

See issue #759.
2016-10-13 12:22:54 +02:00
Justin Clift
f537a009a0 Add placeholder File → Remote submenu + basic Preferences options 2016-09-28 13:59:41 +01:00
Vladislav Tronko
11558a86b4 Implement switching tabs using Alt modifier + number 2016-09-26 14:11:59 +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
Vlad
3ef9491d64 Use references for safety (#747) 2016-08-25 23:02:40 +02: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
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
Martin Kleusberg
4d29271954 Introduce enum for main window tabs 2016-08-16 23:54:54 +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
d288a41dba Clean up code
Just some simplifications, nothing more.
2016-08-16 22:45:22 +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
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
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
Vlad
c91390941d Add duplicate record option (#594) 2016-05-24 19:47:09 +02: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
Lars Immisch
1192f450fd Allow viewing via the EditDialog for executed sql statements (#570)
* Allow viewing via the EditDialog for executed sql statements

Editing is disallowed, becuase we do not know which table the freeform
query operates on

* Fix whitespace

* Don't crash when changing to 'Execute SQL' tab when no database selected

* Add double click action

* A small usability improvement and indentation changes suggested by @MKleusberg
2016-04-26 00:16:30 +02:00
Martin Kleusberg
272671d7f0 Add command line option for setting table to browse after opening
Add a new command line option -t/--table for directly jumping to a table
after opening the database.

See issue #509.
2016-02-04 19:37:17 +01:00
Martin Kleusberg
6f17c3d1ea Reduce number of unneededly executed SQL commands
See issue #503.
2016-01-27 20:23:36 +01:00
gimKondo
54cea17f3a set selected data type on imported by Edit database cell
Data type isn't decided by column type, but cell's type.
And, 2 bugs is fixed.
1. prevention in-place editing data
2. the lack of tr() on text literal
2016-01-18 15:56:57 +00:00
Martin Kleusberg
d7c035874a Fix bug when cancelling the database closing
See issue #432.
2015-12-24 13:30:12 +01:00
Martin Kleusberg
672b6f693b EditDialog: Make edit dock more keyboard friendly to use
See #440, #441.
2015-12-19 14:05:45 +01:00
Martin Kleusberg
f26df79961 Add edit cell dock to main window
Add a new option for replacing the edit data dialog by an edit data dock
widget which is added to the main window and remains visible. This might
be interesting for people who otherwise would have to open the edit
dialog many times by doing tons of double clicks.
2015-12-15 22:29:15 +01:00