Commit Graph

3108 Commits

Author SHA1 Message Date
mgrojo
99bc7536ed Avoid selecting a column when the table header is clicked for sorting
See issue #1717
2019-12-22 00:15:29 +01:00
mgrojo
61c8f47861 Open URL or filenames from DB cells
A new button is added in the "Edit DB Cell" dock for interpreting the
current value as a URL or filename and opening it using the default
application for the file or a web browser for the URL.

The same can be directly invoked in the table browser using the same
shortcut as the FK navigation.

Related issue #1597
2019-12-22 00:12:04 +01:00
mgrojo
8b252a9e2b Enhancements in row and column resizing to fit contents
A new option is added to the contextual menu of row header to auto-adjust
the row heights to fit the contents.

When no setting is loaded for a table, the new default for column width
will take into account the contents.

This is related to #2006
2019-12-21 19:19:25 +01:00
Martin Kleusberg
2676651bcd grammar: Add support for empty BLOB literals
Thanks to @mgrojo for providing this fix.

See issue #2066.
2019-12-18 22:45:28 +01:00
mgrojo
cac0ae1e8c Check if some column has a NOT NULL constraint in "Set to NULL"
Before setting any cell value to NULL, the existence of a NOT NULL
constraint is checked in the selected columns of the current table. This
avoid raising several warning messages when the DB rejects the individual
values.

See issue #2021.
2019-12-16 22:23:59 +01:00
mgrojo
8e8a3aa216 Undocking Database Cell Editor was clearing input
See issue #2062
2019-12-15 18:58:01 +01:00
Martin Kleusberg
6ad853db4f Add possibly missing include
Just in case...
2019-11-22 12:22:52 +01:00
Martin Kleusberg
317918d7cd Speed up the REGEXP implementation by adding a cache
Speed up the new REGEXP implementation based on QRegularExpression for
SQL queries by adding a cache for compiled regular expression objects.

See issue #2052.
2019-11-22 12:16:53 +01:00
Martin Kleusberg
74a16912e1 Remove close buttons on tabs and add button for closing SQL tabs
This gives us some more space in the tab bar and should reduce the risk
of accidentally closing a tab. It looks prettier too. We could add an
option for this in the Preferences dialog but in order to not add too
many rarely used options, let's try it without an option first.

See issue #1968.
2019-11-20 21:17:16 +01:00
Justin Clift
fc5f9d25cf Fix our Win32 nightly builds 2019-11-20 01:34:33 +11:00
Justin Clift
574303a550 Update paths on build server for Qt 5.12.6 x64 2019-11-19 22:58:09 +11:00
mgrojo
914292f299 Use the column type affinity for the default text alignment
In this way the entire column has the same alignment and gives a hint of
the column datatype. Note that if the DB has data incoherent with the
affinity, it will not be reflected in the text alignment.

See issue #2032
2019-11-15 21:21:06 +01:00
mgrojo
d567f3856f Do not open a new SQL tab when a DB file is open or created unless there
is not any yet.

See issue #1706
2019-11-15 00:00:23 +01:00
mgrojo
c9f5d3138e Show status message when saving to project file
Otherwise, there isn't any feedback about the file having been saved.

See issue #1706
2019-11-15 00:00:23 +01:00
Martin Kleusberg
bbeada2011 Fix importing CSV files with no trailing line break and only one column
See issue #193.
2019-11-14 17:46:37 +01:00
Martin Kleusberg
ec41b491ef Fix regression from ba1270cedb 2019-11-14 17:45:54 +01:00
Martin Kleusberg
6d2db6d681 Add MIME information file
See issue #2024.
2019-11-13 22:02:45 +01:00
Tellow Krinkle
6b8fb51f04 Support custom cipher_plaintext_header_size
For all those people loading databases from their iOS devices
2019-11-13 20:57:56 +01:00
Martin Kleusberg
b01c1c94bb Use QRegularExpression instead of QRegExp for SQLite's REGEXP operator
Replace the old QRegExp class by the newer QRegularExpression class in
the implementation of SQLite's REGEXP operator. This should fix some
problems with greediness and similar options.

See issue #2040.
2019-11-11 11:29:41 +01:00
Martin Kleusberg
ecb9abf51d Add replace bar to Browse Data tab
This adds a replace bar to the already existing find bar in the Browse
Data tab. It allows the user to replace the matching text in a cell by
some other text.

See issue #1608.
2019-11-11 00:39:27 +01:00
Martin Kleusberg
3535bdbf62 Fix crash when searching in an empty table 2019-11-10 13:41:15 +01:00
mgrojo
fa3a844454 Don't enable the Attach Database button if there is no DB open 2019-11-09 17:45:40 +01:00
mgrojo
d447c739c0 Keep project open when a DB is closed
Although a project cannot be saved without an associated DB file, we allow
to keep the project open when the current DB file is closed. The only
action that closes the project is opening another project or closing the
application.

The window title must reflect the three situations:
- Nothing is open
- DB file is open
- Project is open with a DB file or not

See discussion in issue #2027
2019-11-09 17:44:58 +01:00
Martin Kleusberg
58beba0b3f Make sure table widget shortcuts do not affect other parts of the UI
When handling the Ctrl+Space and Shift+Space keyboard shortcuts in
ExtenededTableWidget, make sure to not do anything if there is 1) no
table selection, or 2) if the table widget has no focus.

See issue #2038.
2019-11-07 17:29:42 +01:00
Martin Kleusberg
15051ed0ee Fix last commit
Sorry - too tired ;)
2019-11-06 21:27:28 +01:00
Martin Kleusberg
dd6de9479a Fix build for Qt versions < 5.10 2019-11-06 20:59:24 +01:00
Martin Kleusberg
1d6214b769 Fix bug with some STL implementations
Thanks to @mgrojo for providing the fix.

See issue #2036.
2019-11-06 20:25:40 +01:00
Martin Kleusberg
ca682b2067 Fix some warnings 2019-11-06 20:25:39 +01:00
Martin Kleusberg
ba1270cedb Clean up the code and make some more minor optimisations
This also includes replacing some more Qt containers by their STL
counterparts.
2019-11-06 20:25:18 +01:00
mgrojo
b3b1ac6946 Disable entire toolbars and frames in Table Browser
The Show/Hide Style Toolbar button and the find bar buttons were not
being disabled when the database was closed. The Find Next button even made
the application crashed in that state.

This change ensures we don't forget to disable new buttons in the toolbars
and frames of the Table Browser.

The layout where the navigation buttons are inserted does not, apparently,
disable the children widget, so cannot be used in the same way.

See related issues #1976 and #1608.
2019-11-03 20:22:27 +01:00
mgrojo
74befa368b Do not prompt for saving project file on close when it is just open
The project loading code modifies the isProjectModified flag due to the
changes performed. The flag has to set after all the loading is done, so
a close of the just opened project does not prompt for saving.
2019-11-03 18:37:12 +01:00
mgrojo
b30ddf98d0 Add project file name to window title
The DB file will include the full path only when it is different to the
project file path.

currentProjectFilename is cleared and set correctly in every case.

See issue #2027
2019-11-03 18:31:15 +01:00
mgrojo
f63bcbfef8 After closing an SQL tab, set focus to the new currently selected tab
Suggested in issue #2025
2019-11-03 14:36:58 +01:00
mgrojo
3577c71193 Allow closing the last tab by opening a new clean one
This allows clearing all the SQL tabs and at the same time, avoids leaving
an empty SQL tab widget.

Related to issue #2025
2019-10-31 20:44:22 +01:00
mgrojo
e2081db019 Fix problem to close the first tab using shortcut
This was introduced with implementation of #2025 and reported there.
2019-10-31 20:39:43 +01:00
mgrojo
24d4ca729b Use Ctrl+W to close a tab in SQL editor and Ctrl+F4 to close DB file
See enhancement #2025
2019-10-30 20:49:02 +01:00
mgrojo
ebb5e3b111 Fix for Qt versions older than 5.6.
constFirst() and constLast() were added to QList in Qt v5.6.

This entered in previous commit: 01378367a6
2019-10-28 21:15:51 +01:00
mgrojo
01378367a6 Easy way of selecting columns (and rows)
Add shortcuts for selection of entire columns ("Ctrl+Space") or rows
("Shift+Space") from the current cell selection.

A new menu entry in the column header is also added, including the shortcut
legend for selecting the column.

This addresses #1717 and complements #1976 for quick formatting of entire
columns or rows.
2019-10-27 23:35:48 +01:00
mgrojo
5aeca230fc Formats conditioned to row-id values to allow free cell formatting
The conditional formatting is extended to cover free single-cell
formatting. The row-id formats have precedence over regular conditional
formats.

In the styling toolbar, when single cells are selected, row-id formats are
created or updated. When entire columns are selected, regular conditional
formats are instead. Clearing formats for entire columns, remove both. For
single cells, only corresponding row-id formats.

New row-id formats are also saved to project files and loaded.

See issue #1976
2019-10-27 01:25:04 +02:00
Justin Clift
bf62a6e441 Initial attempt to get our Win64 builds working with Qt 5.12.5 2019-10-10 23:56:18 +11:00
Justin Clift
6bd176aab6 Update our nightly builds to use Qt 5.12.5
More a test to see if things are better with this Qt version than
5.11.3.
2019-10-09 21:17:27 +11:00
mgrojo
6ec1258a46 Revert last attempt to avoid a problem with font combo box
The font combo box overlaps the next column in some Qt versions. This is
another attempt at fixing it.

See comments in issue #1976
2019-10-08 23:14:06 +02:00
Martin Kleusberg
252484b486 Remove unneeded includes 2019-10-07 18:24:02 +02:00
Martin Kleusberg
4e8eff7af0 Some more minor performance improvements in often called functions 2019-10-07 18:23:43 +02:00
Martin Kleusberg
5f21c23d43 Remove some unnecessary semicolons 2019-10-07 18:18:46 +02:00
Martin Kleusberg
fad8a847ae Some more optimisations in SqliteTableModel
This improves the performance of a couple of often called functions in
SqliteTableModel some more.
2019-10-07 18:18:45 +02:00
Martin Kleusberg
6f7fb74809 Fix editing in tables with custom display formats
This enables editing for all columns which do not have a custom display
format set. It seems like this was broken for some time now, so the
entire table was effectively set to read only mode even when only a
single custom display format was configured.
2019-10-07 18:18:45 +02:00
mgrojo
50367b080e Bug fixing in the Conditional Format Manager dialog
This fixes the following issues, which might be Qt bugs or not:
- When moving an item to the top, the inserted widgets of the other items
are misplaced.
- When columns are resized to contents, the font combo box does not resize
with the column, overlapping the cells to its right.
- When adding a new item, the text just input in one filter line edit could
be lost.

See issue #1976 and comments in PR #2013.
2019-10-06 18:11:36 +02:00
mgrojo
2794957a89 Use a Filter Line Edit as editor for conditions in Conditional Formats
The Filter Line Edit is ideal for this dialog because it has already a
contextual menu for helping user with the syntax and a What's This button.

Moreover, the Line Edit looks better than the integrated persistent editor.

See issue #1976 and comments in PR #2013
2019-10-05 17:21:00 +02:00
Martin Kleusberg
a0b8b6f16a Make the cache access more efficient in SqliteTableModel::data()
This somewhat simplifies the cache access in SqliteTableModel::data()
function. Especially for not yet loaded cells this should speed up the
code too. It also reduces the function size which again should lead to a
little performance gain for every use case.
2019-10-04 19:06:58 +02:00