This commit make sure that we never quote cells or change their contents
when copying to the text clipboard. This way the data can't be parsed
anymore without being ambigious but for these purposes we have the
internal buffer and the HTML clipboard. This makes sure that for simple
text copies (mainly that should be single cells) the data is never
changed.
This commit also uses the normal copy code for single cells unless they
are image cells. This makes sure that copying a single cell also uses
the internal buffer which in turn avoids problems when copying and
pasting single cells with line breaks in them.
See issue #1244.
A QSortFilterProxyModel is used for filtering the values in the column so
only distinct values are accepted for the completion. With this change
the less intrusive pop-up completion can be used, displaying only unique
values in the completion menu.
We don't do anything with the extended parser yet but I'm not even sure
the window functions can be used in CREATE TABLE or CREATE INDEX
statements anyway.
As suggested by @karim at #1497, the template in GitHub can be reused if
set as parameter. Then we can discard the long body parameter and have
a single definition of the Feature Request template text.
We were already saving information on tables, etc. of attached
databases, so it only makes sense to save the path and name of the
databases as well.
See issue #1532.
This adds some extra sanity checks in the code to avoid possible
crashes. The most likely way to trigger them is loading an outdated
project file which references tables that no longer exist.
This adds a print preview step before printing in the Database Structure
tab.
This is nice to have, but it also aims to work around the problem found in
Windows, reported at issue #760.
The uniform row heights property is set so the rows without check boxes is
the same as the rows with them (the difference might only be observable
with some theme engines)
New action and button for printing the database structure.
The data in the Database Structure tree widget is converted to HTML and set
in a document that can then be printed, opening the dialog as done for
other components.
According the documentation, the default value is PortableText which is
only for writing configuration. NativeText has to be used for display to
user.
This amends 87310a62e6
Using QKeySequence(Qt::CTRL).toString() should be translated according to
OS, either to Ctrl+ or Command+.
Known problem: there are other tooltips referencing control key sequences
but they are in *.ui files and this method cannot be used.
Note: QKeySequence(Qt::CTRL + Qt::Key_Shift).toString() showed weird
output under Linux.
Added contextual menu entry and keyboard shortcut for printing the browsed
table with headers. If a region is selected, print those cells data.
Otherwise, print the entire table.
The HTML conversion used for clipboard is reused. Borders are added for
better visual output.
QScintilla counts characters for the index inside a line and number of
bytes for the global positions. When we use index we have to use text
lengths (number of characters) and when we use global position, we have to
convert previously to byte arrays. Otherwise offsets are produced in
executions containing non US-ASCII characters (accented letters, most
symbols, etc).
The bug could lead to final statements not executed by the execute-all
action, more than one line executed by the execute line action and
incorrect line references in the log.
Fix: NULL data are correctly indicated in the Cell Info footer when loading
data from the database. Previously, the automatic trigger of
editModeChanged when setting the text in the widget was causing the change
to Text data type. Now the modified flag of the widget is taken into
account.
Fix: NULL values could not be overwritten with empty strings, since the
old vs. new check was incorrectly returning false as the conversion to
string was discarding the NULL information.
Improvement: NULL values are visually indicated using the placeholder as
already done in the Add Record dialog. The italic style is applied to both
cases now for better indication and coherence to the browse data widget.
Known problem: when the cell is changed from a JSON cell to a NULL cell
and the automatic switch is on, the NULL information and visual indication
are still lost.
A new checkable button and associated setting is added for automatically
switching the editor mode in the Edit Database Cell dock in accordance to
the loaded data. The switch is done after loading data from cell, after
importing new data to the cell and when checking the button.
If the button is unchecked the behaviour is as formerly.
Since XML is not currently detected, the mode only changes to XML when SVG
is supplied.
Default value is true, since the new behaviour is considered more useful
for the general case.
Pragmas integrity_check, quick_check, foreign_key_check and optimize are
integrated in the Tools menu. The actions open a confirmation dialog
(with Help button that opens the corresponding reference page in
sqlite.org) and, after confirmation, opens a new SQL editor tab and runs
there the pragma, showing the possible results.
Sender in executeQuery is null in this case, so a check is added.
Added accelerator to Tools menu entry, which lacked one.
The XML branch in the import was incorrectly programmed. Now it sets the
appropriate selected filter.
The list of filters is initialised once and the selected filter is passed
to the dialog using the specific parameter.
Chopped the last space in the image formats list for better style.
Case insensitivity applied to the suffix check as done in other parts of
the code.
See issue #1535.
Add printing support for QScintilla widgets (SQL, JSON and XML). It can be
access through the contextual menu, shortcut (Ctrl+P) or (in the case of
the "Execute SQL" tab) from a button in the toolbar.
Ctrl+P was previously assigned to Plot Dock since
63c338c359 but, as it was foreseen in that
commit, it should be assign to print is ever supported. This change must
be mentioned in release notes.
First part of printing support. See issue #1525.
For binary data, the file save dialog allows to select text files. When
the user saves to a text file (*.txt) the visual representation of the
hex buffer is saved to the file (addresses, hexadecimal bytes and ASCII
view). In this dump, only US-ASCII seems to be considered printable, while
in screen, Latin-1 is also considered.
This was one of the enhancement suggestions in issue #1438.
This reorders the filters in the import file dialog of the Edit Cell dock
so the first entry is always in accordance to the currently selected mode.
This will also facilitate the translation of the filters, because the
translations can be reused and written without special syntax characters
(";;").
"%1 Image" is also used instead of a concatenation, because the word
order in translations will vary.
New entry under Help menu for requesting issues with the same template
used for a New Issue inside GitHub.
The "Bug Report..." entry has also been updated for adding the
corresponding template body.
Separators added in Help menu, since there are currently several different
options.
See related issue #1497
Two new options editable from a new context menu of the dock:
- Drag & Drop Qualified Names: add table name to fields and schema name
to other objects (except for "main" schema)
- Drag & Drop Enquoted Names: whether to surround the identifiers by the
configured quoting characters for identifiers.
Support for dragging & dropping of attached databases names.
Add "." as separator for multiple dropped objects other than fields (since
they are not usually used in SQL as a list). This allows to compose
qualified names by dropping the parent and the child items together. This
is only generally useful when the "Qualified Names" option is disabled.
See related issue #1433
The quotes around identifiers was hindering the automatic proposal of
fields when the table is completed or of tables when the schema name is
completed. By adding the dot surrounded by quotes (parent's end-quote and child's
begin-quote) as word separator, the child completion menu is activated
when the user presses the child's begin-quote.
See related issue #1433
According to Qt documentation:
When writing, the end-of-line terminators are translated to the local
encoding, for example '\r\n' for Win32.
Reported in issue #1502
This commit refactors vast parts of the sqlitetypes.h interface. Its
main goals are: less code, easier code, a more modern interface, reduced
likelihood for strange errors and more flexibility for future
extensions.
The main reason why the sqlitetypes.h functions were working so well in
DB4S was not because they were that stable but because they were
extremely interlinked with the rest of the code. This is fine because we
do not plan to ship them as a separate library. But it makes it hard to
find the obvious spot to fix an issue or to put a new function. It can
always be done in the sqlitetypes function or in the rest of the DB4S
code because it is just not clear what the interface between the two
should look like. This is supposed to be improved by this commit. One
main thing here is to make ownership of objects a bit clearer.
In theory the new code should be faster too but that difference will be
neglectable from a user POV.
This commit also fixes a hidden bug which caused all table constraints
to be removed in the Edit Table dialog when a single field was removed
from the table.
This is all still WIP and more work is needed to be done here.
In the Preferences dialog we allow the user to configure a list of
SQLite extensions which should be loaded whenever a new database file is
create or an existing database file is loaded. This commit changes the
order of actions after creating or opening a file so that the extensions
are loaded significantly earlier. This way they are already loaded for
most of the time during the process.
This fixes some subtle bugs. One of the more prominent ones was
triggered when there is a view which uses some function which is
defined in such an extension. After loading the file, parsing would fail
and you couldn't see the fields of the view. Browsing it would work but
trying to edit the display format crashed the application.
Ctrl+' is used by spreadsheets for copying formula/value from the cell
above.
Our shortcut copies the value inside the inline editor when it is text.
That mimics the behaviour of LibreOffice Calc. For binary data that cannot
be edited inline, the BLOB is just copied from the above cell to the
current one.
See discussion in PR #1516.