This undoes 9e2f8e5ede and try to solve the
issues present in Linux with Qt 5.9 and the one in Windows with the Dark
Style at the same time.
I think both issues come from using the filter box height as y offset. The
real offset has to be the original table header height. In Windows+Dark the
box is apparently shorter, so after moving, part of the header is clipped.
In Linux+Qt5.9, the original header height is shorter than the filter box,
so moving by the filter box height clips the filter box at the bottom.
The new height increment for the table header is also reduced to 4, so the
margin is 2 in both the bottom and the top of the filter boxes.
See issue #1493
Fix multiple problems which were introduced in commit
0f6946c19d. They all are about detection
of transaction statements. First it turned out that the commit slightly
changed the behaviour of the dirty parameter which, although there did
not seem to be any consequences of this, was turned back into the old
behaviour. Then the detection of transaction statements depended on the
structure updated flag which is totally wrong and needed to be fixed.
Next, it turned out that SQLite executed ";COMMIT;" as one statement
instead of two. This means we need to skip until after the first
semicolon and not until before it. And finally, after skipping until
after the semicolon we should perform the check for transaction
statements again before blindly giving the next statement to SQLite.
See issue #1777.
The filter box was clipped one or two pixels for both the follow-desktop
mode and the dark-style mode. This fixes it, but not sure if it will fix
the problem reported in issue #1493 in Windows.
Despite we provide a length for toUnicode() the validity/decode is being
performed only up to the first null character, so it passes as text blobs
containing bytes in the ASCII range, followed by a zero and anything else
after.
See issue #1772
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.
* Set colours using style-sheet in Data Browser tab of Preferences
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.
* Update preference colours when the application style is changed
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
See issues #1751#1493 and #1738
This allows sorting by multiple columns (as in ORDER BY Field1, Field2)
by holding the Control key while clicking on another column header in
the Browse Data tab.
See issue #1761.
When changing the sort column in the Browse Data tab we always toggled
the sort direction too. So when Field1 was sorted in ascending order,
clicking on Field2 would sort it in descending order. If Field1 was
sorted in descending order, clicking on Field2 would sort it in
ascending order. Now in both cases Field2 is sorted in ascending order
first.
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
SQLite allows some keywords to be used for table names and some other
keywords to be used for column names without using any quotes. Our
grammar parser needs to know which keywords are allowed and which are
not. In the two lists (one for table names and one for column names)
there were a few errors and omissions. This commit should fix them.
This was pointed out in #1716.
Fix a couple of problems in the detection of transaction statements
during the SQL import. Before this the detection was case-dependent as
well as dependent on the number of spaces you use. Also it did not
detect 'END TRANSACTION', 'COMMIT TRANSACTION', or 'BEGIN <qualifier>
TRANSACTION' at all. Finally, it could modify your statements if you
embed string in them which look like transaction statements. All of this
is, hopefully, fixed in this commit.
See issue #1764.
This gives precedence to the results of the query. It also removes the
comment characters that only made sense in the SQL User log. The text is
splitted so the texts are only translated once. The output of a multi-query
execution is also improved, because the results and line are constant
while the query part is quickly changing.
After the execution of a multi-query text, the final text is not separated
by a blank line so the result message is visible in the second.
For users wanting more space in the editor and query table, the results
panel is now collapsible, since the SQL Log can be used instead.
See issues #1709 and #1670.
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 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.
We don't yet support Dark Mode on macOS Mojave (or above), so need
to keep in light mode. Without this, DB4S is unusable.
Thanks to @jsejcksn for pointing us in the right direction. :)
See #1751 for for more details.
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.