Commit Graph

2282 Commits

Author SHA1 Message Date
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
mgrojo
65c670acc0 Do not escape single cell data in clipboard copy
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.
2018-02-14 23:19:53 +01:00
mgrojo
b8e96379a7 Set disabled palette for the cell text editor when read-only
In this way the user gets a hint about the text being read-only while still
being able to select text with keyboard and mouse.

See issue #1123
2018-02-03 16:14:30 +01:00
mgrojo
52ae85dd28 Added some "What's This" information
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.
2018-02-02 21:27:58 +01:00
Justin Clift
e43ed17162 Include the Qt XML dll in our installation package 2018-01-30 20:34:57 +00:00
mgrojo
290461778d Fix qmake compilation for XML mode PR #1275
Also, some spaces have been replaced by tabs for uniformity.

See issue #1309
2018-01-30 21:01:44 +01:00
mgrojo
5dbb7ff645 Ensure the Escape key doesn't make Plot and Remote docks go away
Override reject() as done in other dock dialogs.

Fixes #1310
2018-01-30 20:33:15 +01:00
Manuel
c8276030ae Merge pull request #1275 from sqlitebrowser/xml_cell_edit
XML mode for the cell editor
2018-01-27 20:09:36 +01:00
mgrojo
7c9fe7039c Merge branch 'master' into xml_cell_edit
# Conflicts:
#	src/EditDialog.cpp
#	src/ExtendedScintilla.cpp
2018-01-27 19:01:08 +01:00
mgrojo
0c99f32ce7 Address comments in PR XML mode for the cell editor #1275
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.
2018-01-27 18:30:24 +01:00
Justin Clift
b5af5653fc Tweak the CentOS 7 build instructions
They should now avoid giving a warning about a missing `qwt-qt5-devel` package.
2018-01-26 17:36:38 +00:00
Manuel
87e1c2708d Merge pull request #1302 from sqlitebrowser/bar_charts
Stackable bar charts, Axis Type column and legend in plot.
2018-01-26 18:29:42 +01:00
mgrojo
42bb1c0d65 Translatable strings and default case branch
This addresses review comments by @MKleusberg in PR #1302.
2018-01-26 18:13:20 +01:00
phydroxide
74f19d7bc8 Update BUILDING.md (#1307)
* Update BUILDING.md

Package list for Yum incomplete

* Update BUILDING.md

My first git clone or contribution ever so bear with me
2018-01-26 15:29:38 +01:00
Martin Kleusberg
1110b87d95 Fix structure view after changing settings
This is fixing a follow-up issue of
012ad9217a.

See issue #1288.
2018-01-26 14:44:13 +01:00
Justin Clift
2d95ad44f7 Merge pull request #1303 from ChangJoo-Park/ChangJoo-Park-patch-1
fix typo. database in Korean
2018-01-22 16:24:38 +00:00
ChangJoo Park(박창주)
8c85ff9157 fix typo. database in Korean
database is *데이터베이스*
2018-01-22 21:40:40 +09:00
mgrojo
c5ec23e92e Stacked or grouped bars and plot legend
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.
2018-01-21 17:00:45 +01:00
mgrojo
175407645b Simplify the axis type storing, translucent additional bars and What's This
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.
2018-01-20 18:28:03 +01:00
mgrojo
aa680622c0 Bar charts and Axis Type column in Plot Dock
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.
2018-01-20 18:08:31 +01:00
mgrojo
4b3780e22a Auto-completion for column names in the SQL editor
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
2018-01-18 22:55:59 +01:00
mgrojo
7d1ddbd717 Preserve format in Copy Create Statement
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
2018-01-18 20:59:02 +01:00
mgrojo
be66535c20 Revert "Merge branch 'master' of https://github.com/sqlitebrowser/sqlitebrowser"
This reverts commit e9385e6f8b, reversing
changes made to d1261146b3.
2018-01-18 20:54:11 +01:00
mgrojo
6a8c2e7a57 Revert "Preserve format in Copy Create Statement"
This reverts commit d1261146b3.
2018-01-18 20:35:08 +01:00
mgrojo
e9385e6f8b Merge branch 'master' of https://github.com/sqlitebrowser/sqlitebrowser 2018-01-18 20:34:07 +01:00
mgrojo
d1261146b3 Preserve format in Copy Create Statement
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
2018-01-18 20:32:07 +01:00
Iulian Onofrei
31f1eafdd8 Fix macOS name in GitHub issue template 2018-01-17 18:11:40 +02:00
mgrojo
33801d5285 Synchronize PlotDock with 'Execute SQL' table. Continuation of PR #1271
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.
2018-01-16 00:37:42 +01:00
Martin Kleusberg
404f48c5a9 Fix possible 'database locked' error when detaching a database
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.
2018-01-15 23:51:30 +01:00
Martin Kleusberg
012ad9217a Fix drag & drop of tables onto the structure view
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.
2018-01-15 23:10:23 +01:00
Martin Kleusberg
39a5460500 Fix crashes in Edit Index dialog when database has no tables
Fix some crashes in the Edit Index dialog which happen if you try to add
a new index when there are no tables in the database yet.

See issue #1293.
2018-01-15 22:38:10 +01:00
Manuel
dbbd268fa2 Merge pull request #1271 from FabianInostroza/plot_table_sync
Synchronize PlotDock with 'Execute SQL' table.
2018-01-15 20:53:54 +01:00
Justin Clift
efb32857d6 Remove AppImage generation, as it's causing 100% build failure 2018-01-13 21:04:07 +00:00
Martin Kleusberg
d17bd9176e Merge branch 'GortiZ6-master' 2018-01-13 16:48:09 +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
Martin Kleusberg
58ab9cc1b7 Check for pseudo-PKs when determining whether the model is editable 2018-01-13 16:29:17 +01:00
Manuel
512b694114 Fix crash when Tab is pressed at the last cell of a view's grid (#1289)
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.
2018-01-13 16:27:19 +01:00
mgrojo
b2fbf45012 Plot: detect dates with time, pure dates and times data types
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"
2018-01-11 21:07:06 +01:00
mgrojo
ce2b33ab6d Use the correct function for checking the count of plotted items
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.
2018-01-08 23:30:55 +01:00
mgrojo
b08960f504 Plot: Respect the "Order by" clause when plotting
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.
2018-01-07 14:54:29 +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
cb98e29a7c Allow deleting and duplicating a selection of rows
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
2018-01-05 20:51:36 +01:00
mgrojo
bbac655499 Select the pointed table row when right clicking on the vertical header
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
2018-01-05 18:26:34 +01:00
Martin Kleusberg
35b8ac7771 Revert "Fix removing comments from SQL when there are quoted strings"
This reverts commit eae0730e3e.
2018-01-05 18:22:15 +01:00
Martin Kleusberg
652637232d Add tests 2018-01-05 18:20:28 +01:00
Martin Kleusberg
743e7985c2 Add support for conflict clauses to the grammar parser
Add support for parsing and generating CREATE statements with an ON
CONFLICT clause for their primary key.
2018-01-05 17:35:26 +01:00
Martin Kleusberg
29fa332f97 Fix bug introduced in eae0730e3e 2018-01-05 17:24:23 +01:00
Martin Kleusberg
eae0730e3e Fix removing comments from SQL when there are quoted strings
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.
2018-01-05 16:45:50 +01:00
Martin Kleusberg
7d2931baa2 Add a --read-only command line option
Add a new command line option -R / --read-only for opening a database in
read-only mode.

See issue #1265.
2018-01-05 16:27:23 +01:00
Martin Kleusberg
5f702db0e0 Don't set modified flag for database when attaching/detaching database
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.
2018-01-05 16:07:18 +01:00