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
If no DB is open, DB4S tries to open the dropped file as formerly.
Otherwise, the user is prompted for the action:
- Open Database or Project
- Attach Database...
- Import CSV file(s)...
See issue #1883
Add a new right click context menu to the tab bar of the Execute SQL tab
in the main window. This menu contains actions for renaming and closing
tabs. Especially the renaming feature was hard to find before.
Add a third, new action to the context menu for duplicating the tab.
Duplicating opens a new tan and copies the title and SQL text from the
selected tab.
See issue #1964.
A new button in the "Browse Data" toolbar for clearing the sorting columns
and returning to the default table order.
New icon created as a composition of icons from the Silk icon set.
See issue #1761
When browsing a view we were constructing a query which looked like
this because the rowid column was empty:
SELECT "",* FROM "view_name";
This worked because there isn't really any rowid column for views anyway
and SQLite was interpreting the first bit as an empty string literal.
However using double quotes for string literals triggers a warning in
the error log. This commit aims to avoid this warning.
headerData() now returns column name plus sort indicator in the display
role and only the column name in the edit role. This allows to use the
edit role for the plot and the copy-with-headers features, so they do not
show the sort indicator as part of the column name.
See related issue #1409 and PR #1810
Flickering was produced in the table header, due to the fact that the
the filter boxes were displayed first at the rightmost side while the
table is reset and then they are repainted when the rows appear, in order
to leave space to the vertical header with the row numbers.
Setting the minimum width of the vertical header to the current width
before any filtering or sorting avoids the issue. The minimum width is
set to the default when changing the current table.
See issues #1763 and #1941
When modifying the value of a field in the Browse Data tab, we used to
always hand over the new value to SQLite as text. This works most of the
time but can cause problems e.g. when a CHECK constraint checks the data
type of the value and expects something other than text. It is also a
pretty lazy approach in general.
This commit checks if the new value matches the affinity data type of
the column, and if it does hands over the new value as the correct data
type.
See issue #1952.
Enable the combo box in the Edit Table dialog to change the type of a
table constraint and add the code to try to transform a constraint from
one type into another as best as possible.
This changes the way we store the constraints associated with a table
from using a map to using a set. The map was mapping from the list of
field names to the constraint applied on these fields. Now the field
list is stored inside the constraint and we can store the constraints in
a simple set. This turns out to simplify the code noticeably.
This adds support for modifying the columns a constraint is applied on
in the Constraints tab of the Edit Table dialog. This is a major step
towards full constraint editing capabilities (adding new constraints,
modifying constraint type, and editing constraint type-dependent
parameters are the other missing pieces).
The reasoning behind the popup dialog is to not introduce another full
dialog on top of the Edit Table dialog. After opening the Edit Table
dialog, then switching to the Constraints tab, then opening another
modal dialog, I felt like losing track of what I am currently editing.
The popup dialog is certainly not great but feels a bit less intrusive.
Any suggestions regarding this are appreciated.
This adds support for searching "this|that" to find either "this" or "that"
or using quantifiers like "{number}". The change applies to the
Find/Replace dialog and the search bar.
See https://en.cppreference.com/w/cpp/regex/ecmascript for details of the
syntax.
This raises the requirement for an external version of QScintilla to v2.11.
See issue #1625
This adds support for changing the names of existing constraints in the
Edit Table dialog. It should be possible to extend the code to allow
further modifications of the constraints.
As a minor change, this commit makes the SQL column of the constraints
table read only.
When opening a file in read-only mode, remember that read-only flag when
adding it to the list of recently opened files. The next time it is
opened it will be again in read-only mode.
The way this is implemented (by adding a "[ro]" to the start of the path
to indicate when to open in read-only mode) was chosen in order to be
fully backwards compatible with the previous data format for the file
list.
See issue #1913.
Fix a crash when using the "Browse Table" action in the right click menu
in the Database Structure tab. It crashed whenever the table name or the
schema name started or ended with a space character.
When detecting the data type in the Edit Cell dialog, don't treat
simple numbers as a JSON document. They should be handled as text
instead.
Thanks to @mgrojo for pointing this out here.
d344f396b2 (r34132706)
A second Ctrl+Click over an already added column changes the direction of
any column.
Before this change, the effect was only applied to the last selected column
and a second Ctrl+Click on the other columns triggered a requery without
having changed anything.
This was mentioned in PR #1810. See also issue #1761.
Qt's isRightToLeft() returns true only for all left-to-right characters
in the string. That prevents the automatic switch to LTR Text mode, when
the text contains one or more left-to-right characters.
See #1793 and #1929