The new toolbar is hidden by default and can be toggled using a button in
the main Data Browser toolbar. Margins and spacing have been updated to
improve appearance of the two toolbars.
These tool buttons apply the format to the columns which are contained in
the selection. This is done by updating or adding a new condition-less
format to the list of conditional formats of those columns.
New style icons from the Silk icon set. Changed existent ones for
coherence.
See issue #1976.
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.
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 the Ctrl+F was used in the Scintilla widgets of the SQL Log or Edit
Database Cell docks, the shortcut was ambiguous with the search find bar
action, which had window context. Now the later has widget context and a
new widget-context shortcut is explicitly connected to the action in the
editors of each new SQL tab.
See issue #1746
This adds visual sort indicators to the already working multi-column
sorting. Qt sort indicator is disabled, so only one indicator per column
is visible.
Unicode characters are used to indicate direction (triangles) and sort
column order (superscript numbers).
See issue #1761
The margins have been set to 3 for the layouts of all the main tabs. It has
been generally reduced from the default (9), except for the DB Structure
which was set to 0 and now has been increased to 3 for uniformity with the
other tabs.
The margins of interior widgets in Execute SQL tab has also been reduced to
3 from the default.
See issues #1762 and #620.
Add a new logging section to the SQL log panel called "Error Log".
Register a callback to receive errors and warnings from SQLite and add
them to the new error log section.
See issue #1754.
In 5f4d0ee7ff the Add Record button in the
Browse Table tab was inadvertently changed to only open a popup menu
after a long click but not triggering the Add Record action after a
normal click. This restores the old behaviour.
* 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 shortcut was ambiguous because it was active in the button and in the
SQL editor itself. In the button was only documentation and was made
ambiguous when enabling the feature and fixing the shortcut in
6425fb177e
Now its scope is reduced to widget like similar button shortcuts so it can
be unambiguous in the editor.
See issue #1614
New action "Save All" for saving all the files currently opened by the
application: DB file, SQL files and project file. Can be activated through
shortcut (Ctrl+Shift+S) and File menu.
Icon composed from package.png and database_save.png.
See issues #871 and #1706
"Save Project" remembers used filename, at second and successive calls
the user is not asked for the filename. Ellipsis are removed, since it
only opens a dialog the first time.
A Wait Cursor is set while saving so the user does not get the impression
that pressing "Save Project" does nothing.
"Save Project As" action is added, so the user can still save to another
filename when saved for the first time. Added icon combining package.png
and textfield_rename.png from the Silk icon set.
The base filename for a new project does not include the DB suffix.
Problems saving the project file are detected and the user warned.
See issue #1706
Even after having removed the hard-coded style from the link texts, this
combination of hyperlink over regular window background is not giving good
results in some dark theme colours. It is uncommon to have this combination
in GUI applications.
The link in the label has been replaced by a link in an embedded icon.
In order to be still recognisable as a link (apart from the hand icon) the
link hover signal is connected to a slot showing the link in the status bar
for 5 seconds.
See issue #1493
This shortcut was set for the following actions, making it ambiguous:
"View > DB Toolbar" and "Open tab" in "Execute SQL". Additionally it was
used by QScintilla for transposing lines.
Shortcut for "View > DB Toolbar" has been removed, since it's not
considered a frequently used action and there are other toolbars without
shortcut. The shortcut for QScintilla has been changed to "Ctrl+Shift+Up".
The now working shortcut is added to the "Open tab" action's tool-tip for
documentation purposes.
See issue #1647
Ctrl+O for opening a database file did no longer work. It raised this
warning:
QAction::eventFilter: Ambiguous shortcut overload: Ctrl+O
The shortcut was repeated in the UI.
This bug was introduced by e11b32ed54
It was laterally reported in #459
- New action (Alt+0) in View menu for resetting window layout (main tabs,
toolbars and docks).
- Shortcuts for tabs use positional meaning: after moving the tabs, the
number always refers to the position of the tab, and not the identity.
- Avoid using statusTip for restoring the original tab label and use
accesibleName, which is believed to be either neutral, when set, or
beneficial.
- Assure the tab is open when some function switches to it: browse table
and SQLite checks.
- Avoid flickering while clearing and adding tabs.
See issue #1675
Main tabs are made closable, so they can be closed by the user. New entries
are added to the View menu for toggling their open/closed state.
Spartan users can closed all tabs but their preferred, and then the tab bar
is hidden saving some space.
The set of open tabs and their order is automatically saved in the settings
on application exit and restored on application start.
Tab labels are stored in the statusTip attribute in order to restore them,
since those labels are not stored anywhere else.
See issues #1675 and #459
The movable attribute for the main tabs is enabled and the code is adapted
to use widget references instead of indices.
This allows user to move tabs and set a preferred order, but the order is
still not saved.
See issue #1675
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
For consistency for the other application tabs, a print button is added
to the Data Browse Tab for printing the currently browsed table or
selection of cells.
Reorder the context menu of the table header and use separators for
coherent grouping: column actions, misc and encoding.
Set buttons invisible in the DB Structure toolbar when the object is
different to the supported ones. Disabling wasn't enough because the logic
for changing icon and text wasn't working well for fields and other items.
Separate Print from object actions in that same toolbar.
New icon for Project Save so it uses the same metaphor (floppy disk) as
other save actions.
Improved the look in the clear filters icon by editing it in gimp. It had
a glitch in the funnel base.
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.
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.
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.
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
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.
* Issue #530: constraints on table prevents new record being added
This adds a new dialog for adding records to a table. The current approach
is broken for several cases where foreign keys and check constraints are
impeding the insertion of an empty record. With the dialog, the user can
inspect the constraints (tooltip) and type of fields and add values
consistent with the requirements. The data is only inserted when the user
presses the Save button.
The dialog is modelled after the Edit Table or Edit Index dialog. An upper
frame allows entering the data using widgets. The lower frame previews the
SQL statement that will be used.
The old approach for adding records is still accessible pressing Tab on
the last cell of the table.
* Fix build problem introduced in previous commit on this branch
* Dialog as fallback for failure after empty row insertion and read only text
The insertion of an empty row is always tried. When it fails due to
constraints and foreign keys, the Add Record Dialog is open so the user
can enter values for the new record considering the constraints.
When the table has not constraints, or the row insertion provides valid
values, the user is still able to insert rows using the simple approach.
SQL preview in dialog is now read-only.
* Visual improvements for the Add Record dialog
QLineEdit as item delegate for the value, so it is more visible that we
are supposed to edit the value.
Remove last end-of-line in tool-tip.
* Improvements in the "Add Record" dialog
Display of NULL values using DisplayRole (no focus) or place holder text
(when focus).
Set value to NULL through a context menu and shortcut in the value line
edit.
Take text type affinity into account for quoting or not entered numbers.
New isType and affinity functions in sqlitetypes.
Clarify wording of constraints in tooltip for value. Added the same tooltip
for the type.
Escape quotes inside string values.
Removed unused parameters warnings.
Other wording or code improvements based on the pull-request review: #1477.
* User access to the Add Record dialog
The Add Record dialog is now accessible for the user. The New Record button
is converted to a QToolButton and a new pop-up menu is added to it for
invoking the in-line table insertion (New Record) or the Add Record dialog
(Insert Values...). What's This information for the button updated.
Change the control of the page_size PRAGMA from a spin box to a combo
box in the Edit Pragma tab. This makes sure no values are entered which
aren't a power of two. The same change was done in the Cipher dialog a
while ago for the same reasons.
* Allow "getting" and setting case_sensitive_like pragma
In order to allow case insensitive filtering, the pragma
case_sensitive_like is added to the GUI. Given that this pragma cannot be
read, a special SELECT request is made in DBBrowserDB::getPragma for
inferring its value.
See issue #1489.
* Warning in the pragma case_sensitive_like
This pragma has some peculiarities, so it is convenient to warn the user
about it through a tool-tip in the value.
Menu actions that take the user to a dialog, where the action is completed
with some interaction and that could be cancelled, now have ellipsis.
Actions that only open an informative window do no longer have ellipsis.
Title case used in all menu entries.
See issue #1434
- Some actions not directly related to file operations over databases or
projects have been moved from "File" to a new "Tools" top-level menu entry.
Future tools can be added here.
- Preferences moved from "View" to "Edit" (MacOS is supposed to still have
it in the application menu).
See issue #1434
This disables translation for PRAGMA names and values in the Edit Pragma
tab. The values must not be translated when using the current
implementation because they are used as shown for reading and writing
the PRAGMA values. The names could be translated but probably should not
be because they are more fixed name than description of their function.
See issue #1489.
Add a new menu option for opening an in-memory database. When working on
an in-memory database some menu options are disabled because they only
make sense when the database is also written to disk. I have left the
Write Changes button enabled though because for some actions the current
transaction needs to be committed - even though it's only committed to
memory then.
See issues #335 and #1492.
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.