When the filter lines have not been generated for a Extended Table
(currently the case for Execute SQL tables), the filter actions make no
sense, so they are disabled.
See issue #1469
This adds support for all operators when applied to string values.
Formerly they were always treated as a Containing (LIKE) operator, but
after the implementation of bbe2e33ea4 the
lack of these operators were more visible and, at least, the omission of
<> seems a bug. But the omission of the others may also be a limitation.
For easing the return to the old behaviour, the Containing filter option
now takes into account the necessity of escaping the value when it starts
by one of the operator characters.
For operators applied to strings the behaviour is documented by Sqlite3
here: https://www.sqlite.org/datatype3.html#collating_sequences
See related issue #1463.
Added contextual menus in filter line box and cells for assisting in using
filters and for discovering existing filters.
The menu in the filter line adds "What's This" option and helper options
that add the operator and a selected placeholder (?) for easy editing.
Special options for NULL and empty strings are also added. Those work
directly.
The menu in the cells works as the current "Use as Filter" but for
different operators. In this case, only the range operator is incomplete.
Currently, not all the operators make sense for strings because we take
them as LIKE filters. At least the Not Equal filter (<>) should work, but
the other would also make sense. This will be addressed in future commits.
- Set the line terminator according to operating system (text and SQL
versions).
- Quote identifiers using the user preference and string literals as 'SQL
standard'.
- Support BLOB literals for any kind of binary data and avoid converting
any kind of image to PNG in the process of setting the BLOB literal in SQL.
As said by the author GortiZ6:
> I've added the ability to copy fields from tables in SQL format.
> I found much robust and easier copy data in SQL from one DB to another so that if the number of columns differs or if I want to build a single SQL file to share several fields from several table with someone I can do it.
Make strings translatable, remove some more debug code, fix tests,
reduce size of patch slightly, remove weird tooltip, don't crash when
closing database, simplify code, fix filters, don't link agains pthread
on Windows.
* - [NEW] Add new interface and functionality to manage database file extension. (Implements feature request #659)
* - [FIX] Fixed CMake file to src.pro
* - Applied changes requested by mgrojo to uniform code with sqlitebrowser standards
- Add "history" when closing editor window, but reopen before closing preferences
- Revert some changes done by QtCreator
* Refuse from previous commit
* Additional changes requested by MKleusberg:
- [CHG] Always add "All files (*)" to filters
- [FIX] Removed unused include
* merged from master
* Merge sqlitebrowser master
* [FIX] Fixed compatibility to compile on KUbuntu 14.04 with Qt 5.2.1
* [FIX] Fix Qt version for QOpenGLWidget support on previous commit
* [CHG] Uniformed QT_VERSION_CHECK style
[CHG] Reverted macOS check on Mainwindow for OpenGL context creation
When selecting an entire row or multiple entire rows in the table view
and hitting the delete key, delete the records and not just the cell
contents.
See issue #1391.
For single cell without-headers copy it is better to not escape the text
since there isn't any gain in trying to escape quotes, end-of-lines or
tabs. Escaping should only be done for table like data for compatibility
to spreadsheets applications.
See issue #1244.
Make use of signals to connect the selection in plot to the associated
table widget. Every time that the plot is updated from the Main Window
the table widget associated to the table or query is connected to the plot
and the previous widget is disconnected. This allows the selection of the
correct table widget.
Line selection methods moved to the Extended Table Widget to be used as
slots for this connection.
The destroyed signal is also connected for resetting the plot. This fixes
a crash that already existed before this PR, when closing a SQL tab while
the plot is still associated to the table results model.
For table cells with text larger than 32768 characters, the data gets
truncated. If the user doesn't notice this somehow and hits the Escape
key the truncated data is written back to the database resulting in a
possible data loss.
This problem is fixed by this commit in two ways:
1) The maximum length of the editor widgets is increased to the maximum
value making this problem much more unlikely.
2) If the user is still hitting this value, i.e. the text is truncated
anyway, the widget is put into read only mode and no data is written
back to the database.
See issue #1281.
Don't copy images or other binary data to the text MIME type of the
system clipboard. They are still copied into the internal buffer and
into the HTML MIME type though. We don't copy them into the text-only
clipboard because that doesn't really work well. Neither the original
binary data nor a "BLOB" string nor the BASE64 encoded data seem to be a
safe bet, so we just omit these cells.
At the time of pasting, use the generator and date meta tags in the HTML
version for knowing whether our data in the system clipboard has been
overwritten. If not, the internal buffer has better data, so we use it.
Since the binary data is not excluded in the system clipboard, images
are also included embedded in the HTML table. Other binary data are encoded
as base64 strings.
This fixes a crash which happens if you copy a range which contains at
least one cell of binary data and which has a hidden column in the
middle of it.
Copied HTML now passes validation from https://validator.w3.org/check
Thunderbird accepts now our HTML version of the copied data.
Added a meta generator key. See discussion in issue #1244
<meta name="generator" content="DB Browser for SQLite">
We have two different sources when pasting data into a table view: the
system clipboard and the internal copy-paste buffer. Both work slightly
different but most code is duplicated between them. This commit cleans
up the pasting code by merging the two code paths into a single one.
This does not only reduce the amount of duplicated code but also enables
some features for both sources that were only available for one of the
sources. This includes duplicating data by copying from a single cell to
multiple cells and the message box asking for confirmation when the
source and destination ranges do not match. These features were only
available for the system clipboard before and should now work for both
sources.
When copying binary data or similar using the internal copy-paste buffer
we need to clear the system clipboard first in order to avoid confusion
between the two paste sources. Just calling clear() on the clipboard
doesn't seem to work on my system, so this commit manually sets the
clipboard text to a null string.
Use a shared internal copy-paste buffer for all table views in the
application instead of having one buffer per view. This is not only less
confusing because it more closely resembles the behaviour of the system
clipboard but it also allows copying BLOB data from a Execute SQL result
view to a Browse Data table.
When the clipboard is empty and trying to paste from it we would set the
selected field to NULL. This is fixed by this commit, so that nothing
happens.
When copying cells from a spreadsheet application an extra line break is
appended to the clipboard text. This commit adds some extra code to our
parser to remove this line break. Without this we would paste a single
NULL value into an additional line.
See issue #1244.
Copying data from hidden columns is not only confusing but does also
break some common use cases. This commit makes sure that we're not
copying any data from hidden columns. That means the only way to get the
old behaviour now is to unhide all columns, including the rowid column.
See issue #1094.
A classic Find/Replace dialog including all the options provided
by the QScintilla editor. Additionally a "Replace All" and a
Find All" button are implemented. This complements issue #191
New shortcut in main window for opening the find/replace dialog
connected to the focused widget. Standard for Replace is Ctrl+H.
Consequently the shortcut for Copy with Headers is changed to
Ctrl+Shift+C (see issue #1058).
For SQL text widgets not embedded in the main window, the standard
shortcut cannot be enabled, otherwise it conflicts with the main
window. Therefore the shortcut Ctrl+Shift+H is enabled for all the
SQL widgets as fallback. A better solution would be desirable.
This adds support for pasting a single value into all selected cells in
the Browse Data tab in order to mimic the behaviour of standard
spreadsheet application more closely.
* Add Signal if File dropped
* Check if Index is valid
Send Signal and return if Index is invalid and File was dropped
* Connect Dropsignal to fileopen
New icons in resources from our icon set: Silk from
famfamfam.com
Icon for close. Applied to the find bar (see issue #191).
New icon for special copy. Applied to the "Copy with
Headers" option.
Removed the execution permission from some icon files.
results pane
Copy for multi-line text data surrounds the text with the
<pre> tag in the HTML version for avoiding line white-space
adjustments in the pasted text. See #1058
Do not use binary data in the "Use as Filter" option.
Indicate the existence of an error in the background of the
SQL results frame. The error-indicators is reused for
disabling this functionality.
When nothing is shown, a placeholder text hints the
objective of the results pane.
The preference label for the font size of this pane is
modified for consistency (SQL Log is another widget).
Both "Copy" and "Copy with Headers" write in HTML and text format to the
system clipboard, when the selection includes more than one cell. This lets
the pasting application choose the most appropriate format.
Images have now no precedence over text when requesting the clipboard
content, so pasting from applications like LibreCalc, that set both formats
in the clipboard, works as expected, instead of pasting an image of the
copied text.
Copying and pasting inside the DB4S should not be affected, since the
application requests the text format and uses the internal buffer when
necessary (binary data included).
Related issue: #1058
Deactivate all menu actions in the context menu in the Browse Data tab
if no database file is opened. Without a database the read-only actions
were still enabled and would lead to a crash.
See issue #1228.
Ctrl+H invokes the Copy with Headersers action in the Extended Table Widget
as suggested in #1058.
The following options in context menu display now their shortcuts:
Set to Null, Copy, Copy with Headers and Paste.
Some other shortcuts are now displayed in the corresponding tooltips.
A new option in the context menu of the table widget is added for copying
to clipboard the content of the selected cells prepended with the
appropiate column names.
See issue #1058
* Added an option in the context menu for using the currently selected cell
as filter in this column. This allows quick filtering by selected values.
* Changes to pull request #1182 requested by @MKleusberg: get internal cell data and check for the NULL special case.
Similar to commit 44eb2d4f99 this commit
makes use of the backend code improvements introduced in commit
532fcd3f6b.
It adds support for database schemata other than "main" to the Browse
Data tab. With this it's possible again to browse and edit data of
temporary tables using the Browse Data tab. This time, however, they are
separated logically from "main" tables. So handling temporary tables
should be a lot less error prone now, plus it's easier to tell for the
user what tables goes in what schema.
This commit changes the project file format. There is some code included
which allows loading of project files in the old format. However,
project files generated using versions after this commit can't be loaded
by older versions of DB4S.