Commit Graph

90 Commits

Author SHA1 Message Date
Justin Clift
66e3322088 Add macOS .dylib extension to the extension selector dialog 2018-12-13 16:50:45 +11:00
Martin Kleusberg
d86b45e7e6 dbhub: Open Preferences dialog on the correct tab
When opening the Preferences dialog from the Remote dock, we now show
the Remote tab by default.
2018-12-12 14:23:44 +01:00
Iulian Onofrei
d526fa0b64 Add last location saving and loading per action type (#1587)
* Fixed code style

* Added last location saving and loading per action type

This saves and loads different paths per action type when presenting the
native file dialog popup.
2018-10-27 22:24:01 +02:00
Manuel
5cf00ddd8d Leaving the loading of extensions enabled might be a security risk (#1558)
* Leaving the loading of extensions enabled might be a security risk

Using sqlite3_enable_load_extension not only allows loading extensions
through the C-API but also through the SQL functioon load_extension().
That might be a security risk if the user is unaware that executing an
SQL file can lead to native code execution and not only to database file
modification.

See issue #1551

* Preference for allowing loading extensions from SQL code

New setting that authorizes the execution of load_extension() from SQL
code. Default value, false, following the design decision of SQLite, that
disables this function unless by default.

Added notice about the option in the calltips of the two function
variants.
2018-10-10 21:26:59 +02:00
Martin Kleusberg
8795ba591c Don't add multiple "All files" filter to the Open/Save file dialogs
See issue #1556.
2018-10-05 13:27:09 +02:00
mgrojo
04f27ccf4b Threshold in row count for disabling value completion
A setting is added for disabling the value completion when the row count
of the table is greater than the threshold.
2018-09-28 16:19:17 +02:00
mgr
ab991c5755 Preferences > SQL: Avoid different heights due to having check boxes or not
The uniform row heights property is set so the rows without check boxes is
the same as the rows with them (the difference might only be observable
with some theme engines)
2018-09-27 21:06:59 +02:00
Martin Kleusberg
bf505edf66 Code refactoring
This commit refactors vast parts of the sqlitetypes.h interface. Its
main goals are: less code, easier code, a more modern interface, reduced
likelihood for strange errors and more flexibility for future
extensions.

The main reason why the sqlitetypes.h functions were working so well in
DB4S was not because they were that stable but because they were
extremely interlinked with the rest of the code. This is fine because we
do not plan to ship them as a separate library. But it makes it hard to
find the obvious spot to fix an issue or to put a new function. It can
always be done in the sqlitetypes function or in the rest of the DB4S
code because it is just not clear what the interface between the two
should look like. This is supposed to be improved by this commit. One
main thing here is to make ownership of objects a bit clearer.

In theory the new code should be faster too but that difference will be
neglectable from a user POV.

This commit also fixes a hidden bug which caused all table constraints
to be removed in the Edit Table dialog when a single field was removed
from the table.

This is all still WIP and more work is needed to be done here.
2018-09-05 22:24:46 +02:00
mgrojo
5c7238d3d0 Preference for quoting identifier mechanism
A new option is added to the SQL tab in Preferences for choosing which
quoting characters must be used by the application when it inserts an
identifier in SQL code. The three options supported by SQLite are
available.

Default quoting characters have been changed from `Grave accents` to
"Double quotes" (SQL standard).

This options also affect the highlighting of double quoted strings: when
the SQL standard is selected, double quoted expressions are highlighted as
identifiers, otherwise as literal strings.
2018-06-18 17:49:12 +02:00
GortiZ
e7752d7398 KUbuntu 14.04 support restored (#1298)
* - [NEW] Add new interface and functionality to manage database file extension. (Implements feature request #659)

* - [FIX] Fixed CMake file to src.pro

* - Applied changes requested by mgrojo to uniform code with sqlitebrowser standards
- Add "history" when closing editor window, but reopen before closing preferences
- Revert some changes done by QtCreator

* Refuse from previous commit

* Additional changes requested by MKleusberg:
- [CHG] Always add "All files (*)" to filters
- [FIX] Removed unused include

* merged from master

* Merge sqlitebrowser master

* [FIX] Fixed compatibility to compile on KUbuntu 14.04 with Qt 5.2.1

* [FIX] Fix Qt version for QOpenGLWidget support on previous commit

* [CHG] Uniformed QT_VERSION_CHECK style
[CHG] Reverted macOS check on Mainwindow for OpenGL context creation
2018-05-20 15:56:01 +02:00
mgrojo
85dbe7b016 Setting for line wrap in Scintilla editors
A new setting is added to the 'SQL' tab of the Preferences dialog. It
enables the line wrapping in the editors with none/character/word/
whitespace boundaries.

See comments in issue #1173.
2018-03-28 22:26:07 +02:00
mgrojo
379bbb81a2 Support for dark themes in default settings and restore defaults button
All the colour configurations have been reviewed under an operating-system theme
dark theme.

Some hard-coded colours in QScintilla editors and Data Browser have been
replaced by queries of the system palette or reuse of our settings.

New settings for foreground and background colours for QScintilla editors
defaulting to system colours. This is mainly needed because if the user
saves colour settings for a dark theme and then he changes the system theme
back to a light theme, then the foreground colours are preserved while the
background would fall back to the system theme leading to an incompatible
combination. This also gives more freedom to the user in defining his own
colour combinations.

Since only the default colour settings adapt to the system theme, and once
settings are saved this can no longer happen, a 'Restore Defaults' button
is added so the default adapted colour settings can be restored. This is
also useful for restoring default behaviour when wanted.

Other fixes and improvements: waiting cursor while saving; check boxes in
SQL tab for bold, italic and underline when applicable; avoid translation
of hidden colour setting names used in code.

See related issue #1324.
2018-02-25 19:13:28 +01:00
Giuseppe Zizza
a993c19853 File Extension management interface (#659)
[NEW] Add new interface and functionality to manage database file
extension. (Implements feature request #659)
2018-01-13 16:43:24 +01:00
mgrojo
b99edacc9f Automatic completion of SQL keywords in upper case
Added a new setting for completing the SQL keywords in upper case (default
being true).

Scintilla setAutoCompletionCaseSensitivity is set to false. Otherwise the
completion is only done in lowercase when both case versions are added,
or if only upper case version is added, writing lower case letters does
not use the upper case version of the word in the completion list. This
change doesn't have apparently any downside, since SQL is actually case
insensitive.

Consequently the list of keywords is only added in one of the two letter
case versions, depending on the new setting value.

The new preference check-box is only enabled when the auto-complete
check-box is checked.

See issues #1238 and #1287.
2018-01-06 21:53:15 +01:00
mgrojo
d2200de4b0 Avoid warning in setPointSize when Preferences are opened
The warning was introduced in 387449b751
because the initial value in the UI is 0.

See issue #1263.
2017-12-12 00:17:19 +01:00
mgrojo
387449b751 Preview for the Data Browser font in Preferences
The 'Displayed text' boxes preview now the Data Browser font that the user
sets in the corresponding widgets.

See issue #1263
2017-12-12 00:08:22 +01:00
mgrojo
7ac93e34ed Allow user to set the BLOB text. Preview for field display in Preferences
A new setting allows the user to set the text for BLOB data in the cell.

The existing line-edit for setting the NULL text and the new one for BLOB
are updated with the cell background and foreground colors, providing a
preview of the desired changes. An additional preview-only box is added for
the regular fields.

See issue #1263

Settings in Database tab are left-aligned for consistency to other tabs.
See comment in #1173.
2017-12-11 22:00:03 +01:00
mgrojo
232130bc60 Indent/Compact setting moved to Cell Editor
Removed the related check box in the Preferences Dialog. A new checkable
tool-button with icon from the Silk collection. When checked, the
indent-on-loading and compact-on-saving feature is enabled. When widget
is destroyed, the setting value is saved from this button state.

Currently it is only usable in the JSON mode, but could be reused in XML
and any other future modes.

See issue #1173.

Some tooltips in the Edit Dialog have been corrected, since it is not only
used for text.
2017-12-08 17:50:15 +01:00
mgrojo
8fbf44bffe New toolbars, new action icons and toolbar style preference
Two new application toolbars: Extra DB (attach, close database) and Project
(Open, Save). Can be disabled and moved as usual.

Icons for Close Database and Attach Database actions, which lacked ones.

Different icon for the dock configuration, so they are visually
distinguishable from the toolbar configurations.

New preference for the toolbar style, with default value: text besides icon
as before. But in order for the style to change, the value in UI must be
ToolButtonIconOnly.

Needed new icons from famfamfam.com's Silk collection.

See related issue #331
2017-12-04 22:49:48 +01:00
mgrojo
67c5ed963e Compact and indent on JSON cell editor
New setting for enabling the following feature:
when JSON data is loaded in the JSON cell editor, the text is
indented. Before JSON data written back into the cell, the text
is compacted.

See issue #1173

Minor adjustment in preference label: removed ":" for consistency.
2017-11-23 00:39:17 +01:00
Martin Kleusberg
3bd2dc3bc1 Replace 'foreach' by range-based for loop from C++11 2017-10-30 13:10:08 +01:00
Martin Kleusberg
9fe9bf9381 Improve design and handling of the remote tab in the preferences dialog
In the remote tab of the preferences dialog all items in the root ca and
the client cert table views were shown as disabled. The grey text made
them hard to read and the disabled look and feel could be confusing as
to what DB4S tries to tell you by doing that. It also made it hard to
select the entire row in the client cert table view when you wanted to
delete it. All this is fixed by this commit which 'enables' the items.
2017-07-28 13:55:36 +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
f1194d845e Rename all the settings accessor functions
Rename the settings accessor functions from Settings::getSettingsValue()
(and similar) to Settings::getValue() (and similar). The 'Settings' bit
seems a bit redundant and costs a lot of screen space.
2017-03-20 23:16:52 +01:00
Martin Kleusberg
e6390b4d22 dbhub: Automatically generate a file name to save a database under
When fetching a remote database automatically generate a file name to
save the database as instead of asking the user for a path and name.

Also add a preferences option to set the directory for all cloned remote
databases.

This is obviously a trade-off: on the one hand this makes opening remote
databases simpler (it's just a double click), on the other hand it takes
control away from the users. The main reason for doing this, however, is
to indicate to the user that the cloned databases are going to be
controlled by DB4S. We have to keep track of the local databases in
order to update them from the right place, push them back to the right
place, etc. And because the local copies are under DB4S control we don't
want the user to move, rename, or delete them.
2017-03-20 23:06:58 +01:00
Martin Kleusberg
9570d4b332 Remove unnecessary include 2017-01-19 23:11:04 +01:00
Martin Kleusberg
95c1781fa8 Remove unnecessary include 2017-01-14 13:12:50 +01:00
Martin Kleusberg
60e4cb758e dbhub: Add client certificate management
Add a list of all configured client certificates to the preferences
dialog and show some information on them.

Add two button to the preferences dialog to add and remove client
certificates.

Copy configured client certificates to some safe place where they aren't
deleted by accident.

Change the remote code to expect certificate and private key in one
file. The path to this file is still hardcoded, now to client.cert.pem.

Remove the example client certificate as it's not up-to-date anymore
anyway.

Still missing: Option to use a configured client certificate from the
preferences dialog to authenticate.
2016-11-01 22:54:50 +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
Justin Clift
f537a009a0 Add placeholder File → Remote submenu + basic Preferences options 2016-09-28 13:59:41 +01: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
Vladislav Tronko
11bff0ded8 Add cell symbol limit preference 2016-09-03 21:09:26 +03:00
Justin Clift
ec2d060df6 Use QFontInfo so Windows chooses a correct font 2016-08-28 15:41:18 +01:00
Vladislav Tronko
f64afff986 Check availability of font before setting up QFontComboBoxes 2016-08-28 16:17:56 +03:00
Vladislav Tronko
c7942dabb8 Specify monospace font for SQL editor correctly
If Monospace is not available(which happens with Monospace on Windows),
Qt's font matching algorithm tries to find another matching font
2016-08-28 14:12:20 +03:00
Vladislav Tronko
6dd2e596be Revert "Set a default font in the SQL tab too"
This reverts commit 49786e1309.
2016-08-28 14:12:20 +03:00
Justin Clift
04947c3dc4 Improve the robustness of the Preferences dialog font selection 2016-08-27 22:58:24 +01:00
Justin Clift
49786e1309 Set a default font in the SQL tab too
Copied from Vlad's fix yesterday
2016-08-27 20:34:10 +01:00
Vladislav Tronko
b15c7f20a5 Fixed default font obtaining 2016-08-27 00:24:48 +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
Iulian Onofrei
8fcaae39a3 Enabled line breaks in schema removal by default 2016-08-01 16:16:55 +03:00
Iulian Onofrei
58fb726ebf Add default field type preference
- resolves sqlitebrowser/sqlitebrowser#650
2016-07-15 01:09:38 +03:00
Justin Clift
76aeba0765 Update the CSV export dialog to use the PreferencesDialog methods 2016-05-25 17:33:19 +01:00
Martin Kleusberg
63e8540de4 Add option to disable auto completion in the SQL editor
See issue #537.
2016-04-23 21:13:48 +02:00
Martin Kleusberg
93cdbd0f80 Filters: Add settings option for the delay time
Introduce a new option in the Preferences dialog for setting the delay
time which the filter widgets are waiting for before applying the newly
set value.

Also reduce the default delay time from 300 to 200 ms.

See issue #490.
2016-01-27 22:24:16 +01:00
Martin Kleusberg
3376bd9353 Add option to execute arbitrary SQL when loading any database
This adds an option to execute arbitrary SQL statements whenever a
database is opened or created.

See issue #451 for a possible use case.
2015-12-22 17:49:51 +01:00
Martin Kleusberg
1ea45a54d6 Allow escaping of filter wildcard characters
See issue #421.
2015-10-05 19:57:44 +02:00
Martin Kleusberg
a8c52eba12 Make Data Browser font and font size configurable
See issue #383.

Also delete the custom styling sheets for the Data Browser tab in the
Preferences Dialog - no need to have these group boxes look differently
from all the others.
2015-08-23 18:19:19 +02:00
Martin Kleusberg
c235379523 Add option for horizontal tiling between code editor and result view
Add a new option to the Preferences Dialog which activates horizontal
tiling between the SQL code editor and the result view in the Execute
SQL tab, i.e. the two widgets are shown side by side instead of one over
the other.

See issue #380.
2015-07-08 21:48:14 +02:00
schdub
b2e8dc3500 enhancement: advanced data browser colors preferences 2015-07-01 20:20:14 +03:00