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.
Give hints to the user about the context where the different quoting
options would be useful.
Declare the Standard SQL option as the recommended setting.
QHexEdit widget was being set disabled instead of read-only, according to
comments, because there wasn't any setReadOnly in qhexedit. At least in
the current version, the method actually exists, so it is now used.
This allows the user to move the scroll and select text in the binary mode
of the 'Edit Database Cell' dock.
- 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.
This issue was introduced in 211f7341ff
(issue #1306).
browse_table_settings node was not closed, and consequently tab_sql node
was left inside tab_browse but the loading case for tab_sql was still
expecting it outside tab_browse. Since this was an unintended change the
tab_sql node is reverted now to its former location.
This means that all the nightly versions since
211f7341ff until this fix generate project
files with incorrect format and later versions will also not be able to
restore the SQL tabs for those project files unless manually edited.
Nevertheless, the loading code was also broken for tab_sql since there
was an incorrect skipCurrentElement call before getting to the tab_sql tag.
Resize also the Name column in the Dock since it has usually short content
and there is little space there, so it's better to resize it after every
schema population.
User can enter the encoding name with completion or select it from the
list using the mouse. This will help users to discover available codecs
and to find a suitable one in an easier way. This should help with encoding
issues like #1453.
The SQL Schema column in DB Schema dock is set to resize automatically
to adjust to the content, like it is already done for the same column in
the Database Structure tab.
A popup menu has been added in the "Open Database" button. A normal click
selects the "Open Database..." action as before. A delayed click opens the
popup menu for selecting either the "Open Database..." action or the
"Open Database Read Only..." action.
"SQL editor font" and "SQL editor font size" are located at the same row
for saving vertical space in the Preferences dialog.
Accelerator keys for "Wrap lines" and "Quotes for identifiers" have been
added.
Some buddies have been fixed.
Modified some tests for taking into account the new standard quoting and
added some more for testing the quoting configuration and for correct
parsing of different quoting styles.
Default branch in escapeIdentifier() for trying to avoid warning.
When we know that the just executed query has not returned data, reset the
table results model, so the results view is also reset.
Added QAbstractItemModel::beginResetModel() and
QAbstractItemModel::endResetModel() to the model's reset method. This
resets completely the table view.
This improves the situation for #1431, without addressing the underlying
problem of not detecting correctly the type of query. In any case, any
query not returning data should reset the results from previous queries.
The messages in the invalid modes for the current data type in "Edit
Database Cell" are improved for giving hint to the user about the correct
modes.
For this commit and 885f4f7847 see issue
#1438
The extension filter is adjusted to the type of data loaded in the editor.
Previously, only image extensions were adjusted, remaining were treated
as text. Now the following are used: *.bin, *.txt, *.json and *.svg.
For coherence, the *.bin filter is added to the import dialog.
A new option is added to the SQL tab in Preferences for choosing which
quoting characters must be used by the application when it inserts an
identifier in SQL code. The three options supported by SQLite are
available.
Default quoting characters have been changed from `Grave accents` to
"Double quotes" (SQL standard).
This options also affect the highlighting of double quoted strings: when
the SQL standard is selected, double quoted expressions are highlighted as
identifiers, otherwise as literal strings.
The multithreading patch didn't properly load all data into the cache
when this was necessary. It would only do so if the chunk size was
sufficiently high. This is fixed in this commit.
Show a progress dialog while loading all data which can be cancelled by
the user.
When cancelling the loading of all data in those cases which require all
data to be loaded, stop whatever process needs the data too.
Improve the enabling and disabling code for the insert and delete record
buttons in the Browse Data tab. With this the buttons should be enabled
if and only if they can actually be used. The commit also makes the code
easier to read because the final state of the buttons don't depend on
the call order of the involved functions anymore. Instead there is only
one function now which enables and disables them.
This also fixes one TODO in the multithreading patch.
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.
* Make sure only powers of two are entered for the page size
* Replace QSpinBox with QComboBox
Having a QSpinBox didn't make too much sense when we only have 8 valid
values. Forcing the user to type a valid value would have required a
warning message too, along with translations.
Having a QComboBox makes it clear (obviously) what values we are
expecting, without any risk of invalid values or confusion.
* Add thousands separator for page size values
If a view has been unlocked for editing by specifiying a pseudo primary
key, with this commit you can now delete records from the view if an
appropriate trigger exists.
See issue #141.
When unlocking a view for editing by specifying a pseudo-PK, then
switching to another table, and then coming back to the original view,
you would be asked again for the pseudo-PK even though it was stored.
The same applies when loading a project file for this case. This is
fixed by this commit.