A new option, in the toolbar of the Edit Database Cell, is added for
setting word wrapping for the text editor modes. It is now independent of
the SQL preference. The configuration reading the editor/wrap_lines setting
is moved to the particular SQL editor class.
Added icon from the Silk icon set.
See issue #1796
Use the QScintilla widget for all the text modes of the Edit Database Cell
dock. All the features are believed to be preserved.
- The plain text mode is materialised removing the lexer.
- Null values are indicated now in the margin instead of using a
placeholder. The same pattern is also used for the Image and BLOB data
cases when the editor is switched to a text mode. In the dark mode, the
line number margin matches now the style-sheet and instead of the
configurable editor colours.
- Read-only state in the editor is hinted by the caret not blinking, but
the text is still selectable by keyboard or mouse.
Features and fixes added by using this widget:
- Find/Replace dialog for the plain text editor. See issue #1746
- The QScintilla widget does not strip CR characters. See issue #1793
- Line numbers and visible caret line in the text mode.
* Improve the size policy (and more and better icons)
These changes improve the size policy for translations having long texts
in some buttons by:
* Converting the text buttons in the Edit Database Cell to icons
* Making the "Type of data" label wrappable and expandable
* Converting the text buttons in the Browse Data tab to icons
* Allowing the Plot combo-boxes to shrunk
All this allows both the Browse Data and the docks to grow and shrink with
more freedom.
New icons for buttons are reused when appropriate in context menus.
Added icon for filter and improve icon for docks (has been mirrored so it
matches the actual dock position).
Added Print icon in Edit Database Cell using the extra free space, so the
print action there is more visible.
This continues the effort started in #1324.
* Convert the embedded buttons to actual toolbars
This provides more flexibility, like the way how toolbars are compacted
when they have not enough space.
The QToolButtons in Browse Data tab and in Edit Cell dialog are converted
to QActions and inserted in new toolbars embedded in the same place as
the old buttons. Everything else should stay the same (shortcuts, tool-tips
and what's-this information).
* Set style for all toolbars in Preferences and minor adjustments
The combo-box used for the main toolbar is replicated for all the toolbars
in application. In this way, users with high resolutions can use the styles
with both icons and text, while users with lower resolutions can leave the
default styles, which should be better for them.
Some icon texts has been abbreviated from their default values, so they fit
better in the toolbars when they are visible.
The print icon in Edit Cell has been moved to the right, where it would be
the first to be collapsed.
The original what's-this info for Set as NULL in Edit Cell toolbar has been
restored.
* Remove no longer used overloaded function
The addShortcutsTooltip function applying to QWidget was no longer used
after having converted all the buttons to actions, so it is removed.
The width of the UI elements is forced by the text in buttons. This is a problem in some translations,
where the text are longer than the original. This PR address this tweaking some aspects:
* change UI size policy
* make RU translation for some buttons shorter
* move Set as NULL to bottom in EditDialog
There are three reasons for not hard-coding the shortcut names in tool-tips
or other texts inside the UI elements:
- Qt uses portable names for the shortcuts, that are translated to different
key combinations depending on the operating system, e.g. Ctrl is translated
to Cmd in MacOS.
- An eventual change in a shortcut is propagated to user strings affecting
translations.
- If we ever allow configuring the shortcuts in Preferences, the text
would be incoherent.
The shortcuts are added programmatically to the tool-tips and consequently
they are removed from the UI files. The translation files have been updated
semi-automatically so the translated strings aren't lost.
Shortcuts have been added to actions that lacked them (because they are
implemented through other means) so they can be used. The WidgetShortcut
scope prevents in those cases any interference with the current shortcut
logic.
In the case of Ctrl+Return for "Execute all/selected SQL", it has been
moved from code to UI file, since it no longer made sense.
See issue #721
Added a new copy action to the binary editor context menu for copying the
selected text as seen by the user, instead of the stream of hexadecimal
digits copied by default by qhexedit.
In order to support copying from the context menu, qhexedit has been
modified for not resetting the selection when the left mouse button is
pressed. This will be converted to a pull request to qhexedit afterwards.
See related issue #1485
Added support for printing images in the Editor Dialog. A new action added
that can be activated through the context menu or shortcut for printing.
The same approach is applied to the hex editor, which also lacked a
context menu. Consequently the specific shortcut can be deleted.
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.
Added some texts to the "What's This" information of some buttons or other
widgets that lacked them. This will help the user to discover the provided
features.
Specifically, help is added for the filter fields and the remote dock.
See discussions in issues #1311 and #1312.
The new editor mode shares the same Scintilla widget as the JSON mode.
The JsonTextEdit class has been generalised. Future modes supported by
Scintilla could be added with the current pattern. As a consequence, the
EditMode is not always equal to the current stacked widget.
Some code in EditDialog has been refactored, so it is easier to understand
and modified with so many modes. textNullSet has been replaced by the use
of dataType as Null.
SVG is promoted to a new recognised data type, so it can be edited in the
XML mode.
The XML data is formatted and validated following the pattern established
by the JSON mode.
New modules are needed by the XML mode: the Qt XML module and some new
Scintilla files required by the HTML/XML lexer.
The indent_compact was incorrectly named in Setting::getDefaultValue.
See issue #1253.
Removed the related check box in the Preferences Dialog. A new checkable
tool-button with icon from the Silk collection. When checked, the
indent-on-loading and compact-on-saving feature is enabled. When widget
is destroyed, the setting value is saved from this button state.
Currently it is only usable in the JSON mode, but could be reused in XML
and any other future modes.
See issue #1173.
Some tooltips in the Edit Dialog have been corrected, since it is not only
used for text.
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.
This uses a somewhat different approach to the previous
one. It now selectively stores the data into either
the text *or* hex widget buffer, and only copies the
data between them when the edit mode is changed.
Additionally, unneeded copy operations are minimised
where possible to reduce overall slowdown.:
Add a new option for replacing the edit data dialog by an edit data dock
widget which is added to the main window and remains visible. This might
be interesting for people who otherwise would have to open the edit
dialog many times by doing tons of double clicks.
Make the EditDialog a bit more user friendly when editing binary data in
text mode:
Don't change back to the hex editor after changing any character.
Show the full binary data even if it contains a NULL byte.
Also (though a bit unrelated) disable rich text input for the text widget.
This partially fixes issue #19.
Put the image editor into a scrollarea so the dialog doesn't screw up
when importing a large image file.
When importing a file add a filter to the file dialog to only show image
files.
Allow the user to change between the text editor and the hex editor.
Allow the user to change between insert and overwrite mode in both
editors.
This makes it possible to enter any binary data into an empty cell.
Only show the old text edit widget when there is actually a text to be
edited. If the data is a image file show the image instead of some
random garbage. If it is some other binary data show the hex editor.
Create a Qt Designer form file for the edit dialog.
Clean up the edit dialog code removing some not working and not used
functionality e.g. for blob editing.