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.
Added font combo box and spin box for selecting font and font point size
of a conditional format. The default for a new conditional format is the
corresponding setting.
Minor dialog adjustments for better display.
See issues #1976 and #1815.
The conditional format manager allows now to set the font style: bold,
italic and underline.
The project format has been updated. This is also the base for setting
other font formats without further changing the project schema.
New icons form the Silk icon set.
See issue #1976 and #1815.
After inserting an empty row into a table using the Browse Data tab, we
read the row back from the database to find out whether any (and which)
default values were inserted by SQLite. For tables with a single primary
key column the SQL statement for doing so was broken and failed every
time. So these values were only shown when refreshing the view.
This problem was introduced in a615c7b5a0.
See issue #1870.
This adds a new field to the toolbar of the Browse Data tab which allows
filtering the current table just as the other filters. With the new
field however all columns of a row are checked and only one has to
match. This provides in effect a "global" filter which works on all
columns instead of just one.
See issues #1608 and #1662.
This extends our new Bison-generated parser to also parse CREATE TABLE
statements and replaces the last parts of the Antlr-generated parser by
doing so.
Also adjust the unit tests to match the new style of parsed expressions.
They have better formatting now and identifiers are always correctly
quoted. This could not be done before and so the tests expected the old
look of expression statements.
See issue #1990.
Add support for parsing CREATE VIRTUAL TABLE statements to the new
bison-generated parser. Also remove support for this from the Antlr
parser. Parsing virtual tables is far from complete but good enough for
our purposes. It is also not worse than with the old parser.
See issue #1990.
Replace the Antlr lexer and parser for CREATE INDEX statements a new
lexer and parser generated with flex and bison. This commit is a first
step towards replacing all Antlr-realted parts of the parser. Until then
the new bison-generated parser is only used for CREATE INDEX statements
and the old Antlr-generated parser is used for CREATE TABLE statements.
These are the main reasons for replacing all of the Antlr parser:
- Getting rid of the Antlr runtime library as a dependency.
- Not depending on an old piece of sotware (we are depending on Antlr2
while Antlr4 is available at the moment. However, migrating to Antlr4
is as bad as migrating to bison).
- Better handling of expressions in statements. This proved to be a
consistent source of problems over the last couple of years.
- Somewhat better Unicode support.
- Reentrant code / multithreading support.
- I can finally uninstall Java from my computer.
See #1990.
This commit changes the class hierarchy to make primary key constraints
a type of unique constraints. This fits nicely with reality because
primary key columns do not allow duplicate values. It also makes our
life easier as the other changes which are introduced here add some code
required by both unique and primary key constraints and which now can be
shared.
Move the auto increment flag from the field class to the primary key
class. This changes how auto increment fields work and look and might be
a bit unfamiliar but it simplifies things a lot for us because an auto
increment field is always a primary key. So before we had to maintain
two places: the field with the auto increment flag and the primary key
which belongs to it. Now it is all in one place in the primary key.
Add support for storing and manipulating sort order for columns in
primary key and unique constraints. It does not add support for them to
the grammar parser though.
Finally add a way to store and manipulate on conflict clauses for unique
and primary key constraints. Again, parser support for them is not added.
This was missing from the first day of our SQLite parser. I have no idea
how nobody could notice this before. Without this SLASH definition no
table and no index could be parsed which had a "/" inside an expression.
When importing a CSV file which uses quotes to escape characters we
would throw an error if the very last character in the file is the end
quote character. This commit changes it to only error when ending in the
middle of a quoted field but not at the end anymore.
See issue #1986.
Remove the stub for parsing CREATE TABLE ... AS SELECT statements. This
provides no extra value because we never come across these statements in
our context and this is not remotely implemented in a useful way.
Also remove the statement and statement list structures as they are not
used either.
This silences a couple of compiler warnings. The changes in the grammar
parser serve the same purpose: they silence at least some of the
warnings Antlr prints while generating the parser code.
In the Edit Dialog a missing break is added to a switch statement. This
seems like it actually was an unintended fallthrough for once, setting
the focus to the hex editor instead of the RTL editor.
This removes a couple of checks whether the database is opened. They
are not really necessary because the respective buttons are disabled
anyway in case no database is loaded. This was inconsistent anyway since
not all functions were checking for this. It also gets rid of a string
which translators have to deal with even though it is never going to be
displayed.
Gaps are requested to QCustomPlot when one of the coordinates of a point
is NaN. We were using that feature for the y axis, but not for the x axis
where null values where being converted to 0, which makes less sense than
making a gap, at least for consistency.
See issue #1977
This fixes a regression introduced in commit
3f0832f449 which lead to the calculation
of numbers like sum, average, and count in the status bar not being
displayed.
This fixes a regression which was introduced by the changes in Commit
0768ccd1db. The newly added combo box for
setting the collation of a field was not created for fields which were
newly added to the table. This broke the setting of the data type for
these fields.
See issue #1973.
Add a new column to the field table of the Edit Table dialog which
allows you to set, remove, and modify the collation of each field. This
is done by showing a combo box which lists all currently available
collations.
See issue #1973.
This adds a new widget called TableBrowser which does everything the
Browse Data tab did before. All the UI data and all the code related to
this tab is moved into the new widget class. The main window now simply
uses the new widget instead of implementing all this stuff itself.
I mainly see three benefits from this change:
1) The main window class becomes smaller and starts looking less like a
master class which manages all of the application. This should make it
easier for new developers to find their way around the code.
2) A better separation of the table browser and the remaining main
window makes it clearer which class class is responsible for what. Again
this makes it easier to maintain the code when it grows.
3) If we ever want to have split views, multiple Browse Data tabs, or
something similar this is an absolute prerequisite.
This commit obviously changes a lot of code. So be prepared for
unintended changes and consider doing some extra testing.
See issue #1972.
When using a "x IS NOT NULL" expression in a statement our parser was
generating something like "xIS NOTNULL". This was especially a problem
because the table looked like it parsed correctly but actually contained
a faulty expression. So when modifying the table you would get
unexpected error messages, or worse silent errors introduced into your
table.
Also add a test case for this and for commit e7ba79f478.
See issue #1969.
Fix the parsing of complex, recursive expressions as they can be
especially used in CHECK constraints. This also improves the handling of
row value expressions which were somewhat in conflict with recursive
expressions. So with this commit we should be back to a more stable
expression parser in general.
See issue #1969.
Make sure the updating of the database structure always happens in the
main thread so it is in sync with the GUI updates. This way we know for
sure that the list of tables has been completely updated before we try
to (re-)select a table in the Browse Data tab after the DB structure
changed.
See issue #1701.
Restoring the current table and applied filters from project was not
working due to some interference with other applied changes.
Now it is done at the end of the load project function and after having
processed events. applyBrowseTableSettings is also called, otherwise
filters are applied but not visible in their input boxes.
See issue #1573