In order to have matching colours in all the preferences, the individual
colour settings in Data Browser and SQL tabs are reset to default values
matching the corresponding style setting (dark stylesheet or follow desktop,
which could be dark or light as always).
Additionally, several problems with colour settings in QScintilla have
been fixed:
- We don't use indentation guides
- both sets of lexer colour settings must be used, otherwise the result is
inconsistant and unpredictable:
* lexer->setDefaultColor|Paper and lexer->setColor|Paper
The margins have been set to 3 for the layouts of all the main tabs. It has
been generally reduced from the default (9), except for the DB Structure
which was set to 0 and now has been increased to 3 for uniformity with the
other tabs.
The margins of interior widgets in Execute SQL tab has also been reduced to
3 from the default.
See issues #1762 and #620.
The colours of the frame and text-lines previewing the settings in Data
Browser tab need to have being set using a style-sheet, otherwise they
are eclipsed by the dark style-sheet when in use.
A new setting allows to follow the system style or set a new dark style
based on a the style-sheet provided by
https://github.com/ColinDuquesnoy/QDarkStyleSheet
The style-sheet is licensed under the MIT license. Images contained in
that project are licensed under CC-BY license.
Pending issues:
- Use of stylesheets is incompatible to QPalette. Some colours for
previewing settings in the Preferences dialog are eclipsed by the style-
sheet
See https://github.com/ColinDuquesnoy/QDarkStyleSheet/issues/48
- Changing the style should select matching background and foreground
colours for the Browse Data and SQL tabs in Preferences.
See issues #1751#1493 and #1738
We didn't install all the collations and callbacks we have when creating
a new database. They were only installed when opening an existing
database.
To avoid issues like this the code for creating a new database is
stripped down to a bare minimum. After the database is created, we
immediately close it now and open it again through the standard open
code.
Add a new logging section to the SQL log panel called "Error Log".
Register a callback to receive errors and warnings from SQLite and add
them to the new error log section.
See issue #1754.
In order to work around #1658 (QTBUG-73721) the word wrapping is disabled
when compiling with Qt 5.12.x. This workaround will also allow compiling
with better macOS dark theme support by using Qt 5.12 (see issues #1493 and
#1751 and Qt bug reports: QTBUG-68891 and QTBUG-71020) without affecting
builds using previous versions of Qt.
The automatic update check is performed early during the application
start. It turns out that, when using a Wifi connection, the Qt
networking code is not ready yet at this point which leads to an
"Network inaccessible" error. This commit delays the automatic update
check until the network configuration is loaded completely.
See issue #1595.
Allow user to define their own display formats. The SQL code is editable
and the combo box changes automatically to custom if the user edits one
of the predefined formats.
The display format (either custom or predefined) is validated with a
case-insensitive regex so at least it contains a function applied to the column
name.
Added a new callback for executeSQL following the model of sqlite3_exec.
Using this, the number of columns is got from a checking query execution. If
it is not one, the custom display format is also rejected.
Note that these validations might still be fooled in some unforeseen way, but
the users should know what they're doing.
See issue #573
Fix a few issues in the alterTable() code. One type of issue would
happen if there are any keys or constraints in the table. Because the
check whether more changes are needed did not work as expected, we would
try to edit the table again, even though it is already correct. The
second type of issue (which can be triggered independently but which can
also be a follow-up issue to the first one) tries to access the table by
its old name even though it might already have been renamed.
See issue #1725.
When importing a SQL file into a new database, we would create a
database file, import everything, then close the database and open it in
the GUI. While closing, however, the application asks you whether you
want to save the changes you made which can be confusing. This is solved
by creating an empty database, then closing it immediately without any
changes just to then open it in the GUI. Only then the import takes
place.
See comment in issue #1045.
This commit attempts to speed up the SQL import a bit by removing
unnecessary conversions and counting of characters. It's still far from
perfect though.
See issue #1045.
* Add warnings to cmake compilation
Use the same set of warning flags that are used for qmake compilation.
See comments in #1718.
* Add condition for warning flags not supported by GCC 5.5
Satisfy Travis build by adding the unrecognised warning flags only when
the compiler version is greater or equal 7.0. Maybe those flags are
available in previous versions, but I don't know when they were introduced.
Tested with GCC 7.3.
* CMake option for enabling GCC warnings
This option follows the qmake configuration, where the same all_warnings
option exist. This allows users to select compiling with or without
warnings using "cmake -DALL_WARNINGS=ON" or OFF.
With SQLCipher4 the encryption was not working as expected because the
KDF and HMAC algorithms were not set properly. This is fixed in this
commit so it should work now with SQLCipher4 as well as SQLCipher3.
See issues #1690 and #1732.
Qt Creator and lupdate are giving warnings about this class lacking the
Q_OBJECT macro. Although it seems to not be needed, adding it will silence
the warnings without drawbacks.
See issue #1740.
Truncating the text in bytes boundaries for the quick test was breaking
the text detection for Russian and probably any script encoded in more than
one byte. The problem occurred probably when a multibyte character was
truncated at the 512 boundary. This is a bit improbable in latin-based
languages like German or Spanish, whose most characters are a byte, but
very easy in other scripts, like Cyrillic, whose characters are encoded in
more than one.
The new approach is based in QTextCodec finding invalid characters using
the current encoding, which seems immune to the truncation problem.
According to callgrind, it has also better performance, probably because it
does not involve memory comparison.
See issue #1731
In 5f4d0ee7ff the Add Record button in the
Browse Table tab was inadvertently changed to only open a popup menu
after a long click but not triggering the Add Record action after a
normal click. This restores the old behaviour.
Remove the window function grammar rules. I think they are not needed
anyway as long as we only parse CREATE TABLE and CREATE INDEX
statements and unexpectedly they do seem to cause problems. It it still
worth investigating how this is possible but for now removing them seems
like the best option.
See issue #1733.
* Improve the size policy (and more and better icons)
These changes improve the size policy for translations having long texts
in some buttons by:
* Converting the text buttons in the Edit Database Cell to icons
* Making the "Type of data" label wrappable and expandable
* Converting the text buttons in the Browse Data tab to icons
* Allowing the Plot combo-boxes to shrunk
All this allows both the Browse Data and the docks to grow and shrink with
more freedom.
New icons for buttons are reused when appropriate in context menus.
Added icon for filter and improve icon for docks (has been mirrored so it
matches the actual dock position).
Added Print icon in Edit Database Cell using the extra free space, so the
print action there is more visible.
This continues the effort started in #1324.
* Convert the embedded buttons to actual toolbars
This provides more flexibility, like the way how toolbars are compacted
when they have not enough space.
The QToolButtons in Browse Data tab and in Edit Cell dialog are converted
to QActions and inserted in new toolbars embedded in the same place as
the old buttons. Everything else should stay the same (shortcuts, tool-tips
and what's-this information).
* Set style for all toolbars in Preferences and minor adjustments
The combo-box used for the main toolbar is replicated for all the toolbars
in application. In this way, users with high resolutions can use the styles
with both icons and text, while users with lower resolutions can leave the
default styles, which should be better for them.
Some icon texts has been abbreviated from their default values, so they fit
better in the toolbars when they are visible.
The print icon in Edit Cell has been moved to the right, where it would be
the first to be collapsed.
The original what's-this info for Set as NULL in Edit Cell toolbar has been
restored.
* Remove no longer used overloaded function
The addShortcutsTooltip function applying to QWidget was no longer used
after having converted all the buttons to actions, so it is removed.
The shortcut was ambiguous because it was active in the button and in the
SQL editor itself. In the button was only documentation and was made
ambiguous when enabling the feature and fixing the shortcut in
6425fb177e
Now its scope is reduced to widget like similar button shortcuts so it can
be unambiguous in the editor.
See issue #1614