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.
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.
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
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.
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
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.
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.
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
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.
This simplification of the control flow in SqliteTableModel::data()
makes the function a (very) little faster, at least on my system.
But more than everything else, this makes the code a bit easier to read.
Store the relevant settings in SqliteTableModel and only update them
when they have changed. This avoids a lot of querying and converting of
variables in the data() function which is called very often and
therefore is somewhat critical for the overall performance.
Especially when we can remove the code for loading the binary bits of
the old project file format, this should allow us to get rid of a ton of
static_casts.
This is only changing internal function and variable names. Since we
have a separate class for the code from the Browse Data tab now, there
is no point to have the function names contain some sort of string like
"browseData" or similar.
Formatting applied to the data browser is copied to the HTML version of
the clipboard as CSS style. This is used also for printing.
Tested with:
- Thunderbird OK
- LibreOffice Writer OK
- LibreOffice Calc: the format is not pasted, but seems standard behaviour
in Calc
See issue #1976
This was causing that cursor navigation in table browser did not move the
scroll or that find bar required an additional scrollTo call.
Problem was introduced in 63aabb9601
See comments in PR #2013
Necessary changes:
- Added function `ExtendedTableWidget::colsInSelection` to emulate former
behaviour of `ExtendedTableWidget::selectedCols`, which is needed by the
format toolbar.
- Added call to `ui->dataTable->scrollTo(match);` in TableBrowser::find,
otherwise the scroll was not advancing to the current index.
# Conflicts:
# src/TableBrowser.cpp
# src/TableBrowser.ui
# src/icons/icons.qrc
# src/sqlitetablemodel.cpp
The requested text alignment is always combined with AlignVCenter, which is
the value used before conditional formatting was implemented and gives
better display result.
When creating a new conditional formatting while applying a format from the
toolbar to a column which does not already have one, the alignment flag
of the format is taken from the current cell. In this way, the default text
alignment for numbers is preserved.
See issue #1976 and PR #2013
The new toolbar is hidden by default and can be toggled using a button in
the main Data Browser toolbar. Margins and spacing have been updated to
improve appearance of the two toolbars.
These tool buttons apply the format to the columns which are contained in
the selection. This is done by updating or adding a new condition-less
format to the list of conditional formats of those columns.
New style icons from the Silk icon set. Changed existent ones for
coherence.
See issue #1976.
Setting a collation in a newly added field in the Edit Table dialog did
not work when the field name was edited just before. This is fixed now.
See issue #2011.
This adds a find tool bar to the Browse Data tab which allows the user
to search for values in the current table view. It only looks in
non-filtered rows and in non-hidden columns. It respected display
formats and sort order, too. The idea is to provide an additional level
of searching: the first one is done by using the filters and actually
reduces the number of rows in the view; the second level is done by
using the new find tool bar and allows you to look for values in the
remaining rows (or all rows if there is no filter).
See issue #1608.
When retrieving the list of selected columns of a table in the Browse
Data tab only take into account columns which are selected entirely, not
columns which have at least a single selected field. Before selecting a
row would implicity select all columns.
This fixes issues with resizing and with hiding a column.
See issue #1999.
When creating a new foreign key constraint in the Edit Table dialog, a
list of tables to reference is displayed. This list is updated whenever
the name of the edited table changes because this is the only table the
name of which can change while the Edit Table dialog is opened. However,
this meant that when the name of the table changes to some existing
table name, the field list of that existing table is replaced by the
field list of the current table. If the name of the current table is
changed once again, it is deleted entirely from the list. This commit
fixes this behaviour by separating the static part of the table and
field list from the one table which can change.
See issue #1991.
This adds a new option in the Preferences dialog to enable a preview of
images in BLOB cells directly in the grid view of the Browse Data tab.
See issue #2000.
Font point size preference is taken into account when creating a new
default conditional format.
New conditional formats in dialog are resized to contents.
See issues #1976 and #1815.
Combo box for selecting the desired text alignment for a conditional
format.
The default alignment in the browser has been adjusted for numbers, which
are now aligned to the right as in spreadsheets.
Project file format updated.
See issues #1976 and #1815.