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.
For single cell without-headers copy it is better to not escape the text
since there isn't any gain in trying to escape quotes, end-of-lines or
tabs. Escaping should only be done for table like data for compatibility
to spreadsheets applications.
See issue #1244.
Added some texts to the "What's This" information of some buttons or other
widgets that lacked them. This will help the user to discover the provided
features.
Specifically, help is added for the filter fields and the remote dock.
See discussions in issues #1311 and #1312.
Set breaks in nested switch where missing.
Fix editModeChanged since it was overwriting the dataType for JSON and
SVG.
Additionally, removed unnecessary conversion in fromJson.
Two new options added to the context menu of the plot:
- Stacked bars: switches between stacked bars or grouped bars. The former
overlapped layout is avoided since it doesn't make much sense.
- Show legend: toggles the display of a plot legend with a translucent
background. Possible future improvement is dragging the legend with the
mouse.
Now that we have a proper type column in the plot selection widget, the
internal type storing can be simplified.
If the plot has more than one Y selections for one X of label type (bar
charts) the first bar is opaque, but the additional are translucent in
order to be seen, since they will overlap.
What's This information added to explain all the possible selections for
plotting.
String type columns are now selectable as X axis. In that case a bar chart
is plotted where the column values are used as bar labels.
A new Axis Type column is added to the axis selection table, so the user
knows before-hand how the plot will be drawn.
Line type and point shape combo-boxes are not enabled for bar charts, since
they don't make sense.
Columns that make no sense for the Y axis as strings and date/times are not
selectable for that axis.
Isolated column names are added to the list of possible auto-completions,
so they can be completed without having to enter first the table followed
by dot. "Table.field" completion is still supported for completing only for
fields inside that context.
See issue #1242
The original Create statement formatting is preserved when the menu option
"Copy Create statement" is selected, regardless of the setting that removes
the line breaks in the schema view.
The Edit Role is requested to the model for getting the original text data.
See issue #1300
The original Create statement formatting is preserved when the menu option
"Copy Create statement" is selected, regardless of the setting that removes
the line breaks in the schema view.
The Edit Role is requested to the model for getting the original text data.
See issue #1300
Make use of signals to connect the selection in plot to the associated
table widget. Every time that the plot is updated from the Main Window
the table widget associated to the table or query is connected to the plot
and the previous widget is disconnected. This allows the selection of the
correct table widget.
Line selection methods moved to the Extended Table Widget to be used as
slots for this connection.
The destroyed signal is also connected for resetting the plot. This fixes
a crash that already existed before this PR, when closing a SQL tab while
the plot is still associated to the table results model.
Revert the savepoint in the Execute SQL whenever possible. We need to
do this after each statement because there are some rare cases where
the next statement might be affected by what is only a temporary and
unnecessary savepoint. For example in this case:
ATTACH 'xxx' AS 'db2'
SELECT * FROM db2.xy; -- Savepoint created here
DETACH db2; -- Savepoint makes this statement fail
See issue #1249.
When dragging and dropping a table from one instance of the application
to the other, the tree structure representing the database was broken.
We would show the 'Browsables' and 'All' nodes at the top level instead
of the child nodes of the 'All' node. This happened because after
dropping a table, we would reload the database structure and rebuild the
tree structure but didn't notify the tree view in the main window about
the update. This is fixed by this commit, so the main window's widgets
are always notified about the new tree structure.
See issue #1288.
The crash is avoided if the table model is not editable, since insertRows
checks that. A table model for a DB view should be not editable, so this
fix avoids the crash and possibly other possible misbehaviours.
Three different date/time data types are detected and appropriately
displayed in the axis:
- DateTime: "yyyy-MM-dd\nhh:mm:ss"
- Date: "yyyy-MM-dd"
- Time: "hh:mm:ss"
Now that the plot may contain graphs and curves, the plottableCount()
function must be used instead of graphCount() for checking whether the plot
has any plotted items.
This had the effect reported in issue #821 of breaking the enable check for
the fetch-all button.
The tables/queries sorted by X are drawn using QCPGraph as before.
Since QCPGraph does automatically sort by X, we change to QCPCurve that
requires a third data vector to reflect the order. We get that from the
current row order.
In the case of curves, only None and Line is supported as line style.
Since the order is now important for the plot, it is automatically updated
whenever the user sorts by another column in the browsed table.
This addresses issue #821 and indirectly fixes the problem of incorrect
point->row selection link when the table is not sorted by X, reported in
issue #838.
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.
Before bbac655499 it was possible to delete
a set of selected rows. This makes it possible again by only selecting the
row if it is not already inside the selected rows. See issue #1283.
Additionally and for coherence, the "Duplicate record" from the context
menu is also made to apply to the list of selected rows. See issue #1090
This makes sense from the user point of view, since it remarks that the
options from the menu applies to that row. This change will also fix the
different behaviour of the "Delete record" and "Duplicate record" in the
context menu. See issue #1283
In the code for removing comments from SQL statements we have to make
sure to only match the '--' characters when they are not inside a quoted
string or identifier. This works fine and as expected for single quotes.
However, for double quotes it doesn't. This is fixed by this commit.
See issue #1270.
Don't set the modified flag of the main database if we're attaching or
detaching another database since these actions don't alter the original
database.
See issue #1249.