Commit Graph

70 Commits

Author SHA1 Message Date
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
mgr
fd0b34265c Printing support #1525: pre-formatted, wrapped output of Schema column
The schema column of objects is pre-formatted with wrapped style. In this
way, if the "db.hideschemalinebreaks" setting is enabled, the printed
output is formatted in the same way, but with a wrapping style, so long
lines do not extend the Schema column too much.

Added tooltip to Preferences dialog, so it isn't a so hidden feature.
Translations updated accordingly for the release.

The header style is not applied in that same case.
2018-10-03 21:40:44 +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
mgrojo
f977534a1b Improper use of no-translation (notr) attribute
"Preview only (N/A)" must be translated
"toolBar1" although it's a window title it will never show up, so better
not request translation.
2018-08-06 19:24:46 +02:00
mgrojo
e0fcbf93ba Issue #1440: added context hints in the identifier quotes options
Give hints to the user about the context where the different quoting
options would be useful.

Declare the Standard SQL option as the recommended setting.
2018-07-08 12:32:12 +02:00
mgrojo
58a6dba100 Pref: "SQL editor font" and its size on the same row and other improvements
"SQL editor font" and "SQL editor font size" are located at the same row
for saving vertical space in the Preferences dialog.

Accelerator keys for "Wrap lines" and "Quotes for identifiers" have been
added.

Some buddies have been fixed.
2018-06-23 19:04:27 +02:00
Martin Kleusberg
9e0e3309df Move font size settings into the same row in settings dialog 2018-06-21 11:11:47 +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
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
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
d486a9ff64 Error indicators in JSON mode editor
Improve the feedback to the user for invalid JSON data using error
indicators like the SQL editor.

Do not select all the text in the JSON mode, in order to see the
syntax highlighting while browsing.

Fix the logic in the case of not compacting/prettifying.

Change "Indent" to "Pretty print" in preferences for coherence to
JSON Export dialog (actually it is not only indentation).

Do not underline error style font, so it does not overlap with
error indicators.

See issue #1173
2017-11-27 22:10:10 +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
mgrojo
87e1b9bc7c Usability improvements for Extended Table Widget and SQL
results pane

Copy for multi-line text data surrounds the text with the
<pre> tag in the HTML version for avoiding line white-space
adjustments in the pasted text. See #1058

Do not use binary data in the "Use as Filter" option.

Indicate the existence of an error in the background of the
SQL results frame. The error-indicators is reused for
disabling this functionality.

When nothing is shown, a placeholder text hints the
objective of the results pane.

The preference label for the font size of this pane is
modified for consistency (SQL Log is another widget).
2017-11-19 00:57:42 +01:00
Martin Kleusberg
88ee1ac535 dbhub: Tweak certificate UI in the preferences dialog
Don't highlight all the horizonzal headers when selecting a certificate
row in the preferences dialog.

See issue #1087.
2017-09-01 13:08:31 +02:00
Daniel Aleksandersen
44361df4e9 Change some OK buttons to Save buttons 2017-08-25 07:05:58 +02:00
Justin Clift
1dd4d189f0 Add minimum width to the Preferences dialog remote tab panels
Otherwise the display is fairly messed up on OSX
2017-07-21 16:58:41 +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
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
Justin Clift
0c7605b8d8 Indicate when display strings are being truncated
Also reduce the minimum length to 1, just in case it's useful for
people
2016-09-08 19:03:38 +01:00
Vladislav Tronko
11bff0ded8 Add cell symbol limit preference 2016-09-03 21:09:26 +03:00
Iulian Onofrei
bddbc21336 Fix incorrect default selected tabs 2016-07-26 20:05:54 +03:00
Chris Locke
fd7cd1e2de Tab order changes in dialogs (#676)
All dialogs have had their tab order verified to ensure controls flow
'correctly'.
2016-07-26 17:45:48 +01:00
Iulian Onofrei
58fb726ebf Add default field type preference
- resolves sqlitebrowser/sqlitebrowser#650
2016-07-15 01:09:38 +03: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
Martin Kleusberg
5e0d1ba34e Add option for disabling the SQL error indicators
See issue #302.
2015-06-22 12:38:50 +02:00
Martin Kleusberg
2715d75f01 Add option for setting SQL editor font
See issue #299.
2015-05-06 19:54:02 +02:00
Martin Kleusberg
861ecec527 Add option to remember last location for file dialogs
Add an option to remember the location of the last opened or saved file
and use it as the default location for the next file dialog because
always going back to the default location set in the preferences dialog
can be a real hastle.

See issues #224, #276 and #281.
2015-05-03 13:22:13 +02:00
Peinthor Rene
d8cdcbd572 add an option for the tabsize in the sql editor (default 4) 2015-04-10 09:21:01 +02:00
Samir Aguiar
c15235f15e preferencesdialog: Center text in line edit 2015-03-11 22:43:31 +01:00
Samir Aguiar
6473ea6aa0 preferencesdialog: Move regex checkbox before tabWidget in tabstop list 2015-03-11 20:54:05 +01:00
Samir Aguiar
994d37f99d preferencesdialog: Add NULL fields style options to Data Browser tab
This adds the ability to customize the text, font colour
and background colour of NULL fields.
2015-03-11 20:19:45 +01:00
Samir Aguiar
ede523269a preferencesdialog: Remove color for NULL fields 2015-03-11 20:19:45 +01:00
Samir Aguiar
0a23dfe1a2 preferencesdialog: Add new "Data Browser" tab 2015-03-11 20:19:45 +01:00
Martin Kleusberg
6d1a874f80 Add implementation of the REGEXP operator
When not configured otherwise in the Preferences Dialog register a
SQLite function for performing the regular expression matching which
SQLite doesn't implement. This adds support for the REGEXP operator even
when no extension which implements this is loaded.

See issue #215.
2015-03-06 12:52:47 +01:00
Martin Kleusberg
6b2381015c Add keyboard shortcut for language combobox in settings dialog 2015-03-03 00:57:47 +01:00
Martin Kleusberg
da6d8ba385 update: Add option to settings dialog to fully disable update checks
Add a new checkbox to the Preferences Dialog which allows the user to
fully disable automatic check for new versions instead of just ignoring
the last shown update message. This also prevents DB4S from performing
any HTTP requests.

See issues #173 and #208.
2015-03-03 00:54:21 +01:00
Chuong Vu
f3cc98317a Add NULL to the SQL Preferences tab 2015-02-15 01:13:36 +01:00