diff --git a/spinetoolbox/helpers.py b/spinetoolbox/helpers.py index 8cb946fcc..771ba3c63 100644 --- a/spinetoolbox/helpers.py +++ b/spinetoolbox/helpers.py @@ -29,11 +29,13 @@ import tempfile import time from typing import Sequence # pylint: disable=unused-import +from xml.etree import ElementTree import matplotlib from PySide6.QtCore import QEvent, QFile, QIODevice, QObject, QPoint, QRect, QSize, Qt, QUrl, Slot from PySide6.QtCore import __version__ as qt_version from PySide6.QtCore import __version_info__ as qt_version_info from PySide6.QtGui import ( + QAction, QBrush, QColor, QCursor, @@ -1846,3 +1848,38 @@ def order_key(name): if key_list and key_list[0].isdigit(): key_list.insert(0, "\U0010FFFF") return key_list + + +def add_keyboard_shortcut_to_tool_tip(action): + """Adds keyboard shortcut to action's tool tip. + + Args: + action (QAction): action to modify + """ + shortcut = action.shortcut() + if shortcut.isEmpty(): + return + tool_tip = action.toolTip() + if "" not in tool_tip or "

" not in tool_tip: + tool_tip = "

" + tool_tip + "

" + root = ElementTree.fromstring(tool_tip) + paragraphs = [paragraph for paragraph in root.iter("p")] + new_root = ElementTree.Element("qt") + for paragraph in paragraphs: + new_root.append(paragraph) + tool_tip_element = ElementTree.SubElement(new_root, "p") + ElementTree.SubElement(tool_tip_element, "em").text = shortcut.toString() + action.setToolTip(ElementTree.tostring(new_root, encoding="utf-8", method="html").decode()) + + +def add_keyboard_shortcuts_to_action_tool_tips(ui): + """Appends keyboard shortcuts to the tool tip texts of given UI's actions. + + Args: + ui (object): UI to modify + """ + for attribute in dir(ui): + action = getattr(ui, attribute) + if not isinstance(action, QAction): + continue + add_keyboard_shortcut_to_tool_tip(action) diff --git a/spinetoolbox/resources_icons_rc.py b/spinetoolbox/resources_icons_rc.py index 198a68a32..e09a7f10d 100644 --- a/spinetoolbox/resources_icons_rc.py +++ b/spinetoolbox/resources_icons_rc.py @@ -11,7 +11,7 @@ # this program. If not, see . ###################################################################################################################### # Created by: object code -# Created by: The Resource Compiler for Qt version 6.7.1 +# Created by: The Resource Compiler for Qt version 6.6.3 # WARNING! All changes made in this file will be lost! from PySide6 import QtCore @@ -32408,191 +32408,191 @@ \x00\x00\x004\x00\x02\x00\x00\x00\x01\x00\x00\x00\x05\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00T\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6?\ \x00\x00\x00x\x00\x00\x00\x00\x00\x01\x00\x00\x09\xf5\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6>\ \x00\x00\x00\xb2\x00\x00\x00\x00\x00\x01\x00\x008\x89\ -\x00\x00\x01\x8f\xec\xcf\x13\x09\ +\x00\x00\x01\x8aE\xfa\xa6\xa3\ \x00\x00\x00\x9e\x00\x01\x00\x00\x00\x01\x00\x00\x10N\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6?\ \x00\x00\x02R\x00\x00\x00\x00\x00\x01\x00\x06A\x9c\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6P\ \x00\x00\x01\xea\x00\x00\x00\x00\x00\x01\x00\x062\x92\ -\x00\x00\x01\x8f\xec\xcf\x13\x09\ +\x00\x00\x01\x8aE\xfa\xa6\xa3\ \x00\x00\x04p\x00\x00\x00\x00\x00\x01\x00\x06\xa8\xcd\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6P\ \x00\x00\x04\xb8\x00\x00\x00\x00\x00\x01\x00\x06\xbd\xb7\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x82\ \x00\x00\x03D\x00\x00\x00\x00\x00\x01\x00\x06\x88\x1a\ -\x00\x00\x01\x8f\xec\xcf\x13\x09\ +\x00\x00\x01\x8aE\xfa\xa6\xa3\ \x00\x00\x04\x98\x00\x00\x00\x00\x00\x01\x00\x06\xaa\xa1\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6P\ \x00\x00\x04\x0c\x00\x00\x00\x00\x00\x01\x00\x06\x99\xa7\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x82\ \x00\x00\x02\x80\x00\x00\x00\x00\x00\x01\x00\x06E\xb2\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6P\ \x00\x00\x02h\x00\x00\x00\x00\x00\x01\x00\x06B\xab\ -\x00\x00\x01\x8f\xec\xcf\x13\x09\ +\x00\x00\x01\x8aE\xfa\xa6\xa3\ \x00\x00\x03\xf6\x00\x00\x00\x00\x00\x01\x00\x06\x978\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6_\ \x00\x00\x03^\x00\x00\x00\x00\x00\x01\x00\x06\x8a3\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6P\ \x00\x00\x02\xc4\x00\x00\x00\x00\x00\x01\x00\x06Q\xfb\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6?\ \x00\x00\x02.\x00\x00\x00\x00\x00\x01\x00\x06?\xec\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6P\ \x00\x00\x03(\x00\x00\x00\x00\x00\x01\x00\x06b\xb3\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6P\ \x00\x00\x01\xbe\x00\x00\x00\x00\x00\x01\x00\x060\xaf\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x91\ \x00\x00\x03\x98\x00\x00\x00\x00\x00\x01\x00\x06\x94o\ -\x00\x00\x01\x8f\xec\xcf\x13\x09\ +\x00\x00\x01\x91+\xd8Cg\ \x00\x00\x01\xa6\x00\x00\x00\x00\x00\x01\x00\x06/\x9c\ -\x00\x00\x01\x8f\xec\xcf\x13\x09\ +\x00\x00\x01\x8aE\xfa\xa6\x92\ \x00\x00\x04$\x00\x00\x00\x00\x00\x01\x00\x06\xa0\x10\ -\x00\x00\x01\x8f\xec\xcf\x13\x09\ +\x00\x00\x01\x8aE\xfa\xa6\x92\ \x00\x00\x03\xb0\x00\x02\x00\x00\x00\x09\x00\x00\x00V\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x03~\x00\x02\x00\x00\x003\x00\x00\x00#\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x02\x0a\x00\x00\x00\x00\x00\x01\x00\x065G\ -\x00\x00\x01\x8f\xec\xcf\x13\x09\ +\x00\x00\x01\x8aE\xfa\xa6\xa3\ \x00\x00\x04T\x00\x00\x00\x00\x00\x01\x00\x06\xa3)\ -\x00\x00\x01\x8f\xec\xcf\x13\x09\ +\x00\x00\x01\x8aE\xfa\xa6\xa3\ \x00\x00\x03\xda\x00\x00\x00\x00\x00\x01\x00\x06\x96\x00\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6P\ \x00\x00\x02\xda\x00\x00\x00\x00\x00\x01\x00\x06T\x05\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6P\ \x00\x00\x02\x9e\x00\x00\x00\x00\x00\x01\x00\x06G\x93\ -\x00\x00\x01\x8f\xec\xcf\x13\x09\ +\x00\x00\x01\x8aE\xfa\xa6\xa3\ \x00\x00\x03\x02\x00\x00\x00\x00\x00\x01\x00\x06`G\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6P\ \x00\x00\x02R\x00\x00\x00\x00\x00\x01\x00\x07\x0a\xf8\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6q\ \x00\x00\x0b\xec\x00\x00\x00\x00\x00\x01\x00\x07\xbf\xb6\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x82\ \x00\x00\x060\x00\x00\x00\x00\x00\x01\x00\x06\xec\xdf\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x82\ \x00\x00\x09\x14\x00\x00\x00\x00\x00\x01\x00\x07Hx\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6`\ \x00\x00\x09\x9a\x00\x00\x00\x00\x00\x01\x00\x07_J\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6`\ \x00\x00\x06\xf6\x00\x00\x00\x00\x00\x01\x00\x07\x08\x9c\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x82\ \x00\x00\x08\x98\x00\x00\x00\x00\x00\x01\x00\x07B\xb4\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x82\ \x00\x00\x09v\x00\x00\x00\x00\x00\x01\x00\x07]\x88\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6q\ \x00\x00\x0a\xce\x00\x00\x00\x00\x00\x01\x00\x07\xa0\x8e\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6q\ \x00\x00\x07\xa0\x00\x00\x00\x00\x00\x01\x00\x07\x1ez\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x82\ \x00\x00\x07\x16\x00\x00\x00\x00\x00\x01\x00\x07\x0e8\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6q\ \x00\x00\x094\x00\x00\x00\x00\x00\x01\x00\x07ZV\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x91+\xd8C5\ \x00\x00\x08x\x00\x00\x00\x00\x00\x01\x00\x07)\xa4\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6`\ \x00\x00\x08\xba\x00\x00\x00\x00\x00\x01\x00\x07D\xc1\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6q\ \x00\x00\x07\xf2\x00\x00\x00\x00\x00\x01\x00\x07$u\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x82\ \x00\x00\x08\xee\x00\x00\x00\x00\x00\x01\x00\x07F\x1d\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x82\ \x00\x00\x06V\x00\x00\x00\x00\x00\x01\x00\x06\xee\xe8\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6`\ \x00\x00\x0a\x00\x00\x00\x00\x00\x00\x01\x00\x07~\x92\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6`\ \x00\x00\x07\xb8\x00\x00\x00\x00\x00\x01\x00\x07 m\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6`\ \x00\x00\x0b>\x00\x00\x00\x00\x00\x01\x00\x07\xa6\xd3\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6q\ \x00\x00\x06\x1a\x00\x00\x00\x00\x00\x01\x00\x06\xeap\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x82\ \x00\x00\x06\xd4\x00\x00\x00\x00\x00\x01\x00\x06\xfa\xbf\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6`\ \x00\x00\x08T\x00\x00\x00\x00\x00\x01\x00\x07(B\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6`\ \x00\x00\x07X\x00\x00\x00\x00\x00\x01\x00\x07\x1a]\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6`\ \x00\x00\x0b\xa4\x00\x00\x00\x00\x00\x01\x00\x07\xad\xdf\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6q\ \x00\x00\x0b\x0e\x00\x00\x00\x00\x00\x01\x00\x07\xa5\xce\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x81\ \x00\x00\x05\xfe\x00\x00\x00\x00\x00\x01\x00\x06\xe7K\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6q\ \x00\x00\x07\xda\x00\x00\x00\x00\x00\x01\x00\x07!\x9a\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6`\ \x00\x00\x09\xd2\x00\x00\x00\x00\x00\x01\x00\x07y\xdc\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6`\ \x00\x00\x0b\xcc\x00\x00\x00\x00\x00\x01\x00\x07\xb0:\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6`\ \x00\x00\x07:\x00\x01\x00\x00\x00\x01\x00\x07\x18\xeb\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x91+\xd8CV\ \x00\x00\x0aT\x00\x00\x00\x00\x00\x01\x00\x07\x8e%\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x82\ \x00\x00\x09^\x00\x00\x00\x00\x00\x01\x00\x07\x5ci\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x82\ \x00\x00\x09\xbc\x00\x00\x00\x00\x00\x01\x00\x07m\xb8\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x82\ \x00\x00\x06\xc0\x00\x00\x00\x00\x00\x01\x00\x06\xf6%\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6`\ \x00\x00\x0a\xf2\x00\x00\x00\x00\x00\x01\x00\x07\xa2T\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x91+\xd8CE\ \x00\x00\x0a\x80\x00\x00\x00\x00\x00\x01\x00\x07\x90\xe7\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6q\ \x00\x00\x0a$\x00\x00\x00\x00\x00\x01\x00\x07\x8c\x8f\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6q\ \x00\x00\x09\xe8\x00\x00\x00\x00\x00\x01\x00\x07{\x8f\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x91+\xd8CV\ \x00\x00\x07\x8a\x00\x00\x00\x00\x00\x01\x00\x07\x1c+\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6`\ \x00\x00\x0a\x98\x00\x00\x00\x00\x00\x01\x00\x07\x931\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6`\ \x00\x00\x06\xaa\x00\x00\x00\x00\x00\x01\x00\x06\xf4{\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x82\ \x00\x00\x0a\xb0\x00\x00\x00\x00\x00\x01\x00\x07\x94\x97\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6`\ \x00\x00\x0b\x88\x00\x00\x00\x00\x00\x01\x00\x07\xaa\x95\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x91+\xd8CE\ \x00\x00\x08&\x00\x01\x00\x00\x00\x01\x00\x07%\xca\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x82\ \x00\x00\x08@\x00\x00\x00\x00\x00\x01\x00\x07&\xa4\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6q\ \x00\x00\x0bb\x00\x00\x00\x00\x00\x01\x00\x07\xa8\xb6\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6p\ \x00\x00\x06\x86\x00\x00\x00\x00\x00\x01\x00\x06\xf0\xb4\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x91+\xd8CE\ \x00\x00\x04\xf0\x00\x00\x00\x00\x00\x01\x00\x07\x0c\x07\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6q\ \x00\x00\x05X\x00\x00\x00\x00\x00\x01\x00\x078\x22\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6`\ \x00\x00\x05\x84\x00\x00\x00\x00\x00\x01\x00\x07o\x0c\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6`\ \x00\x00\x05\xb0\x00\x00\x00\x00\x00\x01\x00\x06\xe3:\ -\x00\x00\x01\x8f\xec\xcf\x13\x09\ +\x00\x00\x01\x8aE\xfa\xa6\x92\ \x00\x00\x05\x0e\x00\x00\x00\x00\x00\x01\x00\x06\xca\xc1\ -\x00\x00\x01\x8f\xec\xcf\x13\x09\ +\x00\x00\x01\x8aE\xfa\xa6\x92\ \x00\x00\x02\x80\x00\x00\x00\x00\x00\x01\x00\x06\xc6\xaf\ -\x00\x00\x01\x8f\xec\xcf\x13\x09\ +\x00\x00\x01\x8aE\xfa\xa6\x92\ \x00\x00\x04\xce\x00\x00\x00\x00\x00\x01\x00\x06\xc4\x9c\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x92\ \x00\x00\x05\xe2\x00\x00\x00\x00\x00\x01\x00\x06\xe5\x0c\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x92\ \x00\x00\x05(\x00\x00\x00\x00\x00\x01\x00\x06\xcdK\ -\x00\x00\x01\x8f\xec\xcf\x13\x09\ +\x00\x00\x01\x8aE\xfa\xa6\x92\ \x00\x00\x04\xf0\x00\x00\x00\x00\x00\x01\x00\x06\xc8\x90\ -\x00\x00\x01\x8f\xec\xcf\x13\x09\ +\x00\x00\x01\x8aE\xfa\xa6\x92\ \x00\x00\x05X\x00\x00\x00\x00\x00\x01\x00\x06\xcf\xfe\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x92\ \x00\x00\x05\x84\x00\x00\x00\x00\x00\x01\x00\x06\xd9\xb8\ -\x00\x00\x01\x8f\xec\xcf\x12\xfa\ +\x00\x00\x01\x8aE\xfa\xa6\x92\ \x00\x00\x01&\x00\x01\x00\x00\x00\x01\x00\x03\x04\x82\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6P\ \x00\x00\x00\xe6\x00\x01\x00\x00\x00\x01\x00\x02\xbaN\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6P\ \x00\x00\x01d\x00\x00\x00\x00\x00\x01\x00\x03\x10\xa8\ -\x00\x00\x01\x8f\xec\xcf\x12\xea\ +\x00\x00\x01\x8aE\xfa\xa6P\ " def qInitResources(): diff --git a/spinetoolbox/spine_db_editor/ui/spine_db_editor_window.py b/spinetoolbox/spine_db_editor/ui/spine_db_editor_window.py index 25bfacf30..fff8627f1 100644 --- a/spinetoolbox/spine_db_editor/ui/spine_db_editor_window.py +++ b/spinetoolbox/spine_db_editor/ui/spine_db_editor_window.py @@ -14,7 +14,7 @@ ################################################################################ ## Form generated from reading UI file 'spine_db_editor_window.ui' ## -## Created by: Qt User Interface Compiler version 6.7.2 +## Created by: Qt User Interface Compiler version 6.6.3 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ @@ -44,73 +44,73 @@ def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.resize(965, 1159) - MainWindow.setLayoutDirection(Qt.LayoutDirection.LeftToRight) - MainWindow.setDockOptions(QMainWindow.DockOption.AllowNestedDocks|QMainWindow.DockOption.AllowTabbedDocks|QMainWindow.DockOption.AnimatedDocks|QMainWindow.DockOption.GroupedDragging) + MainWindow.setLayoutDirection(Qt.LeftToRight) + MainWindow.setDockOptions(QMainWindow.AllowNestedDocks|QMainWindow.AllowTabbedDocks|QMainWindow.AnimatedDocks|QMainWindow.GroupedDragging) self.actionCommit = QAction(MainWindow) self.actionCommit.setObjectName(u"actionCommit") self.actionCommit.setEnabled(True) icon = QIcon() - icon.addFile(u":/icons/menu_icons/check.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon.addFile(u":/icons/menu_icons/check.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionCommit.setIcon(icon) self.actionRollback = QAction(MainWindow) self.actionRollback.setObjectName(u"actionRollback") self.actionRollback.setEnabled(False) icon1 = QIcon() - icon1.addFile(u":/icons/menu_icons/times.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon1.addFile(u":/icons/menu_icons/times.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionRollback.setIcon(icon1) self.actionClose = QAction(MainWindow) self.actionClose.setObjectName(u"actionClose") self.actionClose.setEnabled(True) icon2 = QIcon() - icon2.addFile(u":/icons/menu_icons/window-close.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon2.addFile(u":/icons/menu_icons/window-close.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionClose.setIcon(icon2) self.actionImport = QAction(MainWindow) self.actionImport.setObjectName(u"actionImport") self.actionImport.setEnabled(False) icon3 = QIcon() - icon3.addFile(u":/icons/menu_icons/database-import.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon3.addFile(u":/icons/menu_icons/database-import.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionImport.setIcon(icon3) self.actionExport = QAction(MainWindow) self.actionExport.setObjectName(u"actionExport") self.actionExport.setEnabled(False) icon4 = QIcon() - icon4.addFile(u":/icons/menu_icons/database-export.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon4.addFile(u":/icons/menu_icons/database-export.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionExport.setIcon(icon4) self.actionCopy = QAction(MainWindow) self.actionCopy.setObjectName(u"actionCopy") self.actionCopy.setEnabled(False) icon5 = QIcon() - icon5.addFile(u":/icons/menu_icons/copy.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon5.addFile(u":/icons/menu_icons/copy.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionCopy.setIcon(icon5) self.actionPaste = QAction(MainWindow) self.actionPaste.setObjectName(u"actionPaste") self.actionPaste.setEnabled(False) icon6 = QIcon() - icon6.addFile(u":/icons/menu_icons/paste.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon6.addFile(u":/icons/menu_icons/paste.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionPaste.setIcon(icon6) self.actionStacked_style = QAction(MainWindow) self.actionStacked_style.setObjectName(u"actionStacked_style") self.actionStacked_style.setEnabled(True) icon7 = QIcon() - icon7.addFile(u":/icons/menu_icons/table.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon7.addFile(u":/icons/menu_icons/table.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionStacked_style.setIcon(icon7) self.actionGraph_style = QAction(MainWindow) self.actionGraph_style.setObjectName(u"actionGraph_style") self.actionGraph_style.setEnabled(True) icon8 = QIcon() - icon8.addFile(u":/icons/project-diagram.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon8.addFile(u":/icons/project-diagram.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionGraph_style.setIcon(icon8) self.actionView_history = QAction(MainWindow) self.actionView_history.setObjectName(u"actionView_history") self.actionView_history.setEnabled(True) icon9 = QIcon() - icon9.addFile(u":/icons/menu_icons/history.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon9.addFile(u":/icons/menu_icons/history.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionView_history.setIcon(icon9) self.actionMass_remove_items = QAction(MainWindow) self.actionMass_remove_items.setObjectName(u"actionMass_remove_items") self.actionMass_remove_items.setEnabled(False) icon10 = QIcon() - icon10.addFile(u":/icons/menu_icons/bolt-lightning.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon10.addFile(u":/icons/menu_icons/bolt-lightning.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionMass_remove_items.setIcon(icon10) self.actionExport_session = QAction(MainWindow) self.actionExport_session.setObjectName(u"actionExport_session") @@ -119,34 +119,34 @@ def setupUi(self, MainWindow): self.actionSettings = QAction(MainWindow) self.actionSettings.setObjectName(u"actionSettings") icon11 = QIcon() - icon11.addFile(u":/icons/menu_icons/cog.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon11.addFile(u":/icons/menu_icons/cog.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionSettings.setIcon(icon11) self.actionUser_guide = QAction(MainWindow) self.actionUser_guide.setObjectName(u"actionUser_guide") icon12 = QIcon() - icon12.addFile(u":/icons/menu_icons/question-circle.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon12.addFile(u":/icons/menu_icons/question-circle.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionUser_guide.setIcon(icon12) self.actionUndo = QAction(MainWindow) self.actionUndo.setObjectName(u"actionUndo") self.actionUndo.setEnabled(False) icon13 = QIcon() - icon13.addFile(u":/icons/menu_icons/undo.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon13.addFile(u":/icons/menu_icons/undo.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionUndo.setIcon(icon13) self.actionRedo = QAction(MainWindow) self.actionRedo.setObjectName(u"actionRedo") self.actionRedo.setEnabled(False) icon14 = QIcon() - icon14.addFile(u":/icons/menu_icons/redo.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon14.addFile(u":/icons/menu_icons/redo.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionRedo.setIcon(icon14) self.actionNew_db_file = QAction(MainWindow) self.actionNew_db_file.setObjectName(u"actionNew_db_file") icon15 = QIcon() - icon15.addFile(u":/icons/menu_icons/file.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon15.addFile(u":/icons/menu_icons/file.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionNew_db_file.setIcon(icon15) self.actionOpen_db_file = QAction(MainWindow) self.actionOpen_db_file.setObjectName(u"actionOpen_db_file") icon16 = QIcon() - icon16.addFile(u":/icons/menu_icons/folder-open-solid.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon16.addFile(u":/icons/menu_icons/folder-open-solid.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionOpen_db_file.setIcon(icon16) self.actionAdd_db_file = QAction(MainWindow) self.actionAdd_db_file.setObjectName(u"actionAdd_db_file") @@ -154,31 +154,31 @@ def setupUi(self, MainWindow): self.actionVacuum = QAction(MainWindow) self.actionVacuum.setObjectName(u"actionVacuum") icon17 = QIcon() - icon17.addFile(u":/icons/menu_icons/broom.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon17.addFile(u":/icons/menu_icons/broom.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionVacuum.setIcon(icon17) self.actionValue = QAction(MainWindow) self.actionValue.setObjectName(u"actionValue") self.actionValue.setCheckable(True) icon18 = QIcon() - icon18.addFile(u":/icons/menu_icons/hashtag.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon18.addFile(u":/icons/menu_icons/hashtag.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionValue.setIcon(icon18) self.actionIndex = QAction(MainWindow) self.actionIndex.setObjectName(u"actionIndex") self.actionIndex.setCheckable(True) icon19 = QIcon() - icon19.addFile(u":/icons/menu_icons/index.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon19.addFile(u":/icons/menu_icons/index.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionIndex.setIcon(icon19) self.actionElement = QAction(MainWindow) self.actionElement.setObjectName(u"actionElement") self.actionElement.setCheckable(True) icon20 = QIcon() - icon20.addFile(u":/icons/menu_icons/element.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon20.addFile(u":/icons/menu_icons/element.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionElement.setIcon(icon20) self.actionScenario = QAction(MainWindow) self.actionScenario.setObjectName(u"actionScenario") self.actionScenario.setCheckable(True) icon21 = QIcon() - icon21.addFile(u":/icons/menu_icons/scenario.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon21.addFile(u":/icons/menu_icons/scenario.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionScenario.setIcon(icon21) self.actionOpen_recent = QAction(MainWindow) self.actionOpen_recent.setObjectName(u"actionOpen_recent") @@ -186,7 +186,7 @@ def setupUi(self, MainWindow): self.actionGitHub = QAction(MainWindow) self.actionGitHub.setObjectName(u"actionGitHub") icon22 = QIcon() - icon22.addFile(u":/icons/menu_icons/github-mark.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + icon22.addFile(u":/icons/menu_icons/github-mark.svg", QSize(), QIcon.Normal, QIcon.Off) self.actionGitHub.setIcon(icon22) self.centralwidget = QWidget(MainWindow) self.centralwidget.setObjectName(u"centralwidget") @@ -198,7 +198,7 @@ def setupUi(self, MainWindow): MainWindow.setCentralWidget(self.centralwidget) self.alternative_dock_widget = QDockWidget(MainWindow) self.alternative_dock_widget.setObjectName(u"alternative_dock_widget") - self.alternative_dock_widget.setAllowedAreas(Qt.DockWidgetArea.AllDockWidgetAreas) + self.alternative_dock_widget.setAllowedAreas(Qt.AllDockWidgetAreas) self.dockWidgetContents_15 = QWidget() self.dockWidgetContents_15.setObjectName(u"dockWidgetContents_15") self.verticalLayout_18 = QVBoxLayout(self.dockWidgetContents_15) @@ -207,16 +207,16 @@ def setupUi(self, MainWindow): self.verticalLayout_18.setContentsMargins(0, 0, 0, 0) self.alternative_tree_view = AlternativeTreeView(self.dockWidgetContents_15) self.alternative_tree_view.setObjectName(u"alternative_tree_view") - self.alternative_tree_view.setEditTriggers(QAbstractItemView.EditTrigger.AnyKeyPressed|QAbstractItemView.EditTrigger.DoubleClicked|QAbstractItemView.EditTrigger.EditKeyPressed) + self.alternative_tree_view.setEditTriggers(QAbstractItemView.AnyKeyPressed|QAbstractItemView.DoubleClicked|QAbstractItemView.EditKeyPressed) self.alternative_tree_view.setDragEnabled(True) - self.alternative_tree_view.setDragDropMode(QAbstractItemView.DragDropMode.DragOnly) - self.alternative_tree_view.setSelectionMode(QAbstractItemView.SelectionMode.ExtendedSelection) + self.alternative_tree_view.setDragDropMode(QAbstractItemView.DragOnly) + self.alternative_tree_view.setSelectionMode(QAbstractItemView.ExtendedSelection) self.alternative_tree_view.setUniformRowHeights(False) self.verticalLayout_18.addWidget(self.alternative_tree_view) self.alternative_dock_widget.setWidget(self.dockWidgetContents_15) - MainWindow.addDockWidget(Qt.DockWidgetArea.RightDockWidgetArea, self.alternative_dock_widget) + MainWindow.addDockWidget(Qt.RightDockWidgetArea, self.alternative_dock_widget) self.dockWidget_parameter_value_list = QDockWidget(MainWindow) self.dockWidget_parameter_value_list.setObjectName(u"dockWidget_parameter_value_list") self.dockWidgetContents = QWidget() @@ -227,14 +227,14 @@ def setupUi(self, MainWindow): self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.treeView_parameter_value_list = ParameterValueListTreeView(self.dockWidgetContents) self.treeView_parameter_value_list.setObjectName(u"treeView_parameter_value_list") - self.treeView_parameter_value_list.setEditTriggers(QAbstractItemView.EditTrigger.AnyKeyPressed|QAbstractItemView.EditTrigger.DoubleClicked|QAbstractItemView.EditTrigger.EditKeyPressed) - self.treeView_parameter_value_list.setSelectionMode(QAbstractItemView.SelectionMode.ExtendedSelection) + self.treeView_parameter_value_list.setEditTriggers(QAbstractItemView.AnyKeyPressed|QAbstractItemView.DoubleClicked|QAbstractItemView.EditKeyPressed) + self.treeView_parameter_value_list.setSelectionMode(QAbstractItemView.ExtendedSelection) self.treeView_parameter_value_list.header().setVisible(True) self.verticalLayout.addWidget(self.treeView_parameter_value_list) self.dockWidget_parameter_value_list.setWidget(self.dockWidgetContents) - MainWindow.addDockWidget(Qt.DockWidgetArea.RightDockWidgetArea, self.dockWidget_parameter_value_list) + MainWindow.addDockWidget(Qt.RightDockWidgetArea, self.dockWidget_parameter_value_list) self.dockWidget_parameter_value = QDockWidget(MainWindow) self.dockWidget_parameter_value.setObjectName(u"dockWidget_parameter_value") self.dockWidgetContents_2 = QWidget() @@ -246,11 +246,11 @@ def setupUi(self, MainWindow): self.tableView_parameter_value = ParameterValueTableView(self.dockWidgetContents_2) self.tableView_parameter_value.setObjectName(u"tableView_parameter_value") self.tableView_parameter_value.setMouseTracking(True) - self.tableView_parameter_value.setContextMenuPolicy(Qt.ContextMenuPolicy.DefaultContextMenu) - self.tableView_parameter_value.setLayoutDirection(Qt.LayoutDirection.LeftToRight) + self.tableView_parameter_value.setContextMenuPolicy(Qt.DefaultContextMenu) + self.tableView_parameter_value.setLayoutDirection(Qt.LeftToRight) self.tableView_parameter_value.setTabKeyNavigation(False) - self.tableView_parameter_value.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectItems) - self.tableView_parameter_value.setHorizontalScrollMode(QAbstractItemView.ScrollMode.ScrollPerPixel) + self.tableView_parameter_value.setSelectionBehavior(QAbstractItemView.SelectItems) + self.tableView_parameter_value.setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel) self.tableView_parameter_value.setSortingEnabled(False) self.tableView_parameter_value.setWordWrap(False) self.tableView_parameter_value.horizontalHeader().setHighlightSections(False) @@ -260,7 +260,7 @@ def setupUi(self, MainWindow): self.verticalLayout_5.addWidget(self.tableView_parameter_value) self.dockWidget_parameter_value.setWidget(self.dockWidgetContents_2) - MainWindow.addDockWidget(Qt.DockWidgetArea.RightDockWidgetArea, self.dockWidget_parameter_value) + MainWindow.addDockWidget(Qt.RightDockWidgetArea, self.dockWidget_parameter_value) self.dockWidget_parameter_definition = QDockWidget(MainWindow) self.dockWidget_parameter_definition.setObjectName(u"dockWidget_parameter_definition") self.dockWidgetContents_5 = QWidget() @@ -271,10 +271,10 @@ def setupUi(self, MainWindow): self.verticalLayout_10.setContentsMargins(0, 0, 0, 0) self.tableView_parameter_definition = ParameterDefinitionTableView(self.dockWidgetContents_5) self.tableView_parameter_definition.setObjectName(u"tableView_parameter_definition") - self.tableView_parameter_definition.setContextMenuPolicy(Qt.ContextMenuPolicy.DefaultContextMenu) + self.tableView_parameter_definition.setContextMenuPolicy(Qt.DefaultContextMenu) self.tableView_parameter_definition.setTabKeyNavigation(False) - self.tableView_parameter_definition.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectItems) - self.tableView_parameter_definition.setHorizontalScrollMode(QAbstractItemView.ScrollMode.ScrollPerPixel) + self.tableView_parameter_definition.setSelectionBehavior(QAbstractItemView.SelectItems) + self.tableView_parameter_definition.setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel) self.tableView_parameter_definition.setSortingEnabled(False) self.tableView_parameter_definition.setWordWrap(False) self.tableView_parameter_definition.horizontalHeader().setHighlightSections(False) @@ -284,10 +284,10 @@ def setupUi(self, MainWindow): self.verticalLayout_10.addWidget(self.tableView_parameter_definition) self.dockWidget_parameter_definition.setWidget(self.dockWidgetContents_5) - MainWindow.addDockWidget(Qt.DockWidgetArea.RightDockWidgetArea, self.dockWidget_parameter_definition) + MainWindow.addDockWidget(Qt.RightDockWidgetArea, self.dockWidget_parameter_definition) self.dockWidget_entity_tree = QDockWidget(MainWindow) self.dockWidget_entity_tree.setObjectName(u"dockWidget_entity_tree") - self.dockWidget_entity_tree.setAllowedAreas(Qt.DockWidgetArea.AllDockWidgetAreas) + self.dockWidget_entity_tree.setAllowedAreas(Qt.AllDockWidgetAreas) self.dockWidgetContents_6 = QWidget() self.dockWidgetContents_6.setObjectName(u"dockWidgetContents_6") self.verticalLayout_4 = QVBoxLayout(self.dockWidgetContents_6) @@ -301,16 +301,16 @@ def setupUi(self, MainWindow): sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth(self.treeView_entity.sizePolicy().hasHeightForWidth()) self.treeView_entity.setSizePolicy(sizePolicy1) - self.treeView_entity.setEditTriggers(QAbstractItemView.EditTrigger.EditKeyPressed) - self.treeView_entity.setSelectionMode(QAbstractItemView.SelectionMode.ExtendedSelection) - self.treeView_entity.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectItems) + self.treeView_entity.setEditTriggers(QAbstractItemView.EditKeyPressed) + self.treeView_entity.setSelectionMode(QAbstractItemView.ExtendedSelection) + self.treeView_entity.setSelectionBehavior(QAbstractItemView.SelectItems) self.treeView_entity.setIconSize(QSize(20, 20)) self.treeView_entity.setUniformRowHeights(False) self.verticalLayout_4.addWidget(self.treeView_entity) self.dockWidget_entity_tree.setWidget(self.dockWidgetContents_6) - MainWindow.addDockWidget(Qt.DockWidgetArea.LeftDockWidgetArea, self.dockWidget_entity_tree) + MainWindow.addDockWidget(Qt.LeftDockWidgetArea, self.dockWidget_entity_tree) self.dockWidget_entity_graph = QDockWidget(MainWindow) self.dockWidget_entity_graph.setObjectName(u"dockWidget_entity_graph") self.dockWidgetContents_8 = QWidget() @@ -327,8 +327,8 @@ def setupUi(self, MainWindow): sizePolicy2.setHeightForWidth(self.graphicsView.sizePolicy().hasHeightForWidth()) self.graphicsView.setSizePolicy(sizePolicy2) self.graphicsView.setMouseTracking(True) - self.graphicsView.setFrameShape(QFrame.Shape.NoFrame) - self.graphicsView.setDragMode(QGraphicsView.DragMode.ScrollHandDrag) + self.graphicsView.setFrameShape(QFrame.NoFrame) + self.graphicsView.setDragMode(QGraphicsView.ScrollHandDrag) self.verticalLayout_7.addWidget(self.graphicsView) @@ -348,7 +348,7 @@ def setupUi(self, MainWindow): self.verticalLayout_7.addWidget(self.progress_bar_widget) self.dockWidget_entity_graph.setWidget(self.dockWidgetContents_8) - MainWindow.addDockWidget(Qt.DockWidgetArea.LeftDockWidgetArea, self.dockWidget_entity_graph) + MainWindow.addDockWidget(Qt.LeftDockWidgetArea, self.dockWidget_entity_graph) self.dockWidget_pivot_table = QDockWidget(MainWindow) self.dockWidget_pivot_table.setObjectName(u"dockWidget_pivot_table") self.dockWidgetContents_10 = QWidget() @@ -359,14 +359,14 @@ def setupUi(self, MainWindow): self.verticalLayout_13.setContentsMargins(0, 0, 0, 0) self.pivot_table = PivotTableView(self.dockWidgetContents_10) self.pivot_table.setObjectName(u"pivot_table") - self.pivot_table.setContextMenuPolicy(Qt.ContextMenuPolicy.DefaultContextMenu) + self.pivot_table.setContextMenuPolicy(Qt.DefaultContextMenu) self.pivot_table.setTabKeyNavigation(False) - self.pivot_table.setHorizontalScrollMode(QAbstractItemView.ScrollMode.ScrollPerPixel) + self.pivot_table.setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel) self.verticalLayout_13.addWidget(self.pivot_table) self.dockWidget_pivot_table.setWidget(self.dockWidgetContents_10) - MainWindow.addDockWidget(Qt.DockWidgetArea.LeftDockWidgetArea, self.dockWidget_pivot_table) + MainWindow.addDockWidget(Qt.LeftDockWidgetArea, self.dockWidget_pivot_table) self.dockWidget_frozen_table = QDockWidget(MainWindow) self.dockWidget_frozen_table.setObjectName(u"dockWidget_frozen_table") self.dockWidgetContents_11 = QWidget() @@ -379,20 +379,20 @@ def setupUi(self, MainWindow): self.frozen_table.setObjectName(u"frozen_table") self.frozen_table.setAcceptDrops(True) self.frozen_table.setTabKeyNavigation(False) - self.frozen_table.setSelectionMode(QAbstractItemView.SelectionMode.NoSelection) - self.frozen_table.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectRows) + self.frozen_table.setSelectionMode(QAbstractItemView.NoSelection) + self.frozen_table.setSelectionBehavior(QAbstractItemView.SelectRows) self.frozen_table.horizontalHeader().setVisible(False) self.frozen_table.verticalHeader().setVisible(False) self.verticalLayout_14.addWidget(self.frozen_table) self.dockWidget_frozen_table.setWidget(self.dockWidgetContents_11) - MainWindow.addDockWidget(Qt.DockWidgetArea.LeftDockWidgetArea, self.dockWidget_frozen_table) + MainWindow.addDockWidget(Qt.LeftDockWidgetArea, self.dockWidget_frozen_table) self.dockWidget_exports = QDockWidget(MainWindow) self.dockWidget_exports.setObjectName(u"dockWidget_exports") self.dockWidget_exports.setMaximumSize(QSize(524287, 64)) - self.dockWidget_exports.setFeatures(QDockWidget.DockWidgetFeature.DockWidgetClosable) - self.dockWidget_exports.setAllowedAreas(Qt.DockWidgetArea.BottomDockWidgetArea) + self.dockWidget_exports.setFeatures(QDockWidget.DockWidgetClosable) + self.dockWidget_exports.setAllowedAreas(Qt.BottomDockWidgetArea) self.dockWidgetContents_12 = QWidget() self.dockWidgetContents_12.setObjectName(u"dockWidgetContents_12") self.horizontalLayout_3 = QHBoxLayout(self.dockWidgetContents_12) @@ -410,7 +410,7 @@ def setupUi(self, MainWindow): self.horizontalLayout_3.addLayout(self.horizontalLayout_exports) self.dockWidget_exports.setWidget(self.dockWidgetContents_12) - MainWindow.addDockWidget(Qt.DockWidgetArea.BottomDockWidgetArea, self.dockWidget_exports) + MainWindow.addDockWidget(Qt.BottomDockWidgetArea, self.dockWidget_exports) self.metadata_dock_widget = QDockWidget(MainWindow) self.metadata_dock_widget.setObjectName(u"metadata_dock_widget") self.metadata_dock_contents = QWidget() @@ -427,7 +427,7 @@ def setupUi(self, MainWindow): self.verticalLayout_11.addWidget(self.metadata_table_view) self.metadata_dock_widget.setWidget(self.metadata_dock_contents) - MainWindow.addDockWidget(Qt.DockWidgetArea.LeftDockWidgetArea, self.metadata_dock_widget) + MainWindow.addDockWidget(Qt.LeftDockWidgetArea, self.metadata_dock_widget) self.item_metadata_dock_widget = QDockWidget(MainWindow) self.item_metadata_dock_widget.setObjectName(u"item_metadata_dock_widget") self.item_metadata_dock_contents = QWidget() @@ -445,7 +445,7 @@ def setupUi(self, MainWindow): self.verticalLayout_9.addWidget(self.item_metadata_table_view) self.item_metadata_dock_widget.setWidget(self.item_metadata_dock_contents) - MainWindow.addDockWidget(Qt.DockWidgetArea.LeftDockWidgetArea, self.item_metadata_dock_widget) + MainWindow.addDockWidget(Qt.LeftDockWidgetArea, self.item_metadata_dock_widget) self.scenario_dock_widget = QDockWidget(MainWindow) self.scenario_dock_widget.setObjectName(u"scenario_dock_widget") self.dockWidgetContents_9 = QWidget() @@ -457,17 +457,17 @@ def setupUi(self, MainWindow): self.scenario_tree_view = ScenarioTreeView(self.dockWidgetContents_9) self.scenario_tree_view.setObjectName(u"scenario_tree_view") self.scenario_tree_view.setAcceptDrops(True) - self.scenario_tree_view.setEditTriggers(QAbstractItemView.EditTrigger.AnyKeyPressed|QAbstractItemView.EditTrigger.DoubleClicked|QAbstractItemView.EditTrigger.EditKeyPressed) + self.scenario_tree_view.setEditTriggers(QAbstractItemView.AnyKeyPressed|QAbstractItemView.DoubleClicked|QAbstractItemView.EditKeyPressed) self.scenario_tree_view.setDragEnabled(True) - self.scenario_tree_view.setDragDropMode(QAbstractItemView.DragDropMode.DragDrop) - self.scenario_tree_view.setDefaultDropAction(Qt.DropAction.MoveAction) - self.scenario_tree_view.setSelectionMode(QAbstractItemView.SelectionMode.ExtendedSelection) + self.scenario_tree_view.setDragDropMode(QAbstractItemView.DragDrop) + self.scenario_tree_view.setDefaultDropAction(Qt.MoveAction) + self.scenario_tree_view.setSelectionMode(QAbstractItemView.ExtendedSelection) self.scenario_tree_view.setUniformRowHeights(False) self.verticalLayout_12.addWidget(self.scenario_tree_view) self.scenario_dock_widget.setWidget(self.dockWidgetContents_9) - MainWindow.addDockWidget(Qt.DockWidgetArea.LeftDockWidgetArea, self.scenario_dock_widget) + MainWindow.addDockWidget(Qt.LeftDockWidgetArea, self.scenario_dock_widget) self.dockWidget_entity_alternative = QDockWidget(MainWindow) self.dockWidget_entity_alternative.setObjectName(u"dockWidget_entity_alternative") self.dockWidgetContents_3 = QWidget() @@ -479,7 +479,7 @@ def setupUi(self, MainWindow): self.tableView_entity_alternative = EntityAlternativeTableView(self.dockWidgetContents_3) self.tableView_entity_alternative.setObjectName(u"tableView_entity_alternative") self.tableView_entity_alternative.setTabKeyNavigation(False) - self.tableView_entity_alternative.setHorizontalScrollMode(QAbstractItemView.ScrollMode.ScrollPerPixel) + self.tableView_entity_alternative.setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel) self.tableView_entity_alternative.setWordWrap(False) self.tableView_entity_alternative.horizontalHeader().setHighlightSections(False) self.tableView_entity_alternative.verticalHeader().setVisible(False) @@ -488,7 +488,7 @@ def setupUi(self, MainWindow): self.verticalLayout_2.addWidget(self.tableView_entity_alternative) self.dockWidget_entity_alternative.setWidget(self.dockWidgetContents_3) - MainWindow.addDockWidget(Qt.DockWidgetArea.RightDockWidgetArea, self.dockWidget_entity_alternative) + MainWindow.addDockWidget(Qt.RightDockWidgetArea, self.dockWidget_entity_alternative) self.menuBar = QMenuBar(MainWindow) self.menuBar.setObjectName(u"menuBar") self.menuBar.setGeometry(QRect(0, 0, 965, 22)) @@ -538,22 +538,25 @@ def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None)) self.actionCommit.setText(QCoreApplication.translate("MainWindow", u"&Commit...", None)) #if QT_CONFIG(tooltip) - self.actionCommit.setToolTip(QCoreApplication.translate("MainWindow", u"

Commit

Ctrl+Return

", None)) + self.actionCommit.setToolTip(QCoreApplication.translate("MainWindow", u"

Commit changes to database

", None)) #endif // QT_CONFIG(tooltip) #if QT_CONFIG(shortcut) self.actionCommit.setShortcut(QCoreApplication.translate("MainWindow", u"Ctrl+Return", None)) #endif // QT_CONFIG(shortcut) self.actionRollback.setText(QCoreApplication.translate("MainWindow", u"Roll&back", None)) #if QT_CONFIG(tooltip) - self.actionRollback.setToolTip(QCoreApplication.translate("MainWindow", u"

Rollback

Ctrl+Backspace

", None)) + self.actionRollback.setToolTip(QCoreApplication.translate("MainWindow", u"

Rollback changes since last commit.

Ctrl+Backspace

", None)) #endif // QT_CONFIG(tooltip) #if QT_CONFIG(shortcut) self.actionRollback.setShortcut(QCoreApplication.translate("MainWindow", u"Ctrl+Backspace", None)) #endif // QT_CONFIG(shortcut) self.actionClose.setText(QCoreApplication.translate("MainWindow", u"Close", None)) +#if QT_CONFIG(tooltip) + self.actionClose.setToolTip(QCoreApplication.translate("MainWindow", u"Close current tab", None)) +#endif // QT_CONFIG(tooltip) self.actionImport.setText(QCoreApplication.translate("MainWindow", u"I&mport...", None)) #if QT_CONFIG(tooltip) - self.actionImport.setToolTip(QCoreApplication.translate("MainWindow", u"

Import data from file

", None)) + self.actionImport.setToolTip(QCoreApplication.translate("MainWindow", u"

Import data or template from file

", None)) #endif // QT_CONFIG(tooltip) self.actionExport.setText(QCoreApplication.translate("MainWindow", u"&Export...", None)) #if QT_CONFIG(tooltip) @@ -561,79 +564,91 @@ def retranslateUi(self, MainWindow): #endif // QT_CONFIG(tooltip) self.actionCopy.setText(QCoreApplication.translate("MainWindow", u"Cop&y as text", None)) #if QT_CONFIG(tooltip) - self.actionCopy.setToolTip(QCoreApplication.translate("MainWindow", u"

Copy as text

Ctrl+C

", None)) + self.actionCopy.setToolTip(QCoreApplication.translate("MainWindow", u"

Copy selection to clipboard

Ctrl+C

", None)) #endif // QT_CONFIG(tooltip) #if QT_CONFIG(shortcut) self.actionCopy.setShortcut(QCoreApplication.translate("MainWindow", u"Ctrl+C", None)) #endif // QT_CONFIG(shortcut) self.actionPaste.setText(QCoreApplication.translate("MainWindow", u"P&aste", None)) #if QT_CONFIG(tooltip) - self.actionPaste.setToolTip(QCoreApplication.translate("MainWindow", u"

Paste

Ctrl+V

", None)) + self.actionPaste.setToolTip(QCoreApplication.translate("MainWindow", u"

Paste into selection

Ctrl+V

", None)) #endif // QT_CONFIG(tooltip) #if QT_CONFIG(shortcut) self.actionPaste.setShortcut(QCoreApplication.translate("MainWindow", u"Ctrl+V", None)) #endif // QT_CONFIG(shortcut) self.actionStacked_style.setText(QCoreApplication.translate("MainWindow", u"T&able", None)) #if QT_CONFIG(tooltip) - self.actionStacked_style.setToolTip(QCoreApplication.translate("MainWindow", u"Table view", None)) + self.actionStacked_style.setToolTip(QCoreApplication.translate("MainWindow", u"

Switch to Table view

", None)) #endif // QT_CONFIG(tooltip) self.actionGraph_style.setText(QCoreApplication.translate("MainWindow", u"&Graph", None)) #if QT_CONFIG(tooltip) - self.actionGraph_style.setToolTip(QCoreApplication.translate("MainWindow", u"Graph view", None)) + self.actionGraph_style.setToolTip(QCoreApplication.translate("MainWindow", u"

Switch to Graph view

", None)) #endif // QT_CONFIG(tooltip) self.actionView_history.setText(QCoreApplication.translate("MainWindow", u"&History...", None)) +#if QT_CONFIG(tooltip) + self.actionView_history.setToolTip(QCoreApplication.translate("MainWindow", u"

Open Commit viewer

", None)) +#endif // QT_CONFIG(tooltip) self.actionMass_remove_items.setText(QCoreApplication.translate("MainWindow", u"P&urge...", None)) #if QT_CONFIG(tooltip) self.actionMass_remove_items.setToolTip(QCoreApplication.translate("MainWindow", u"

Mass-remove items

", None)) #endif // QT_CONFIG(tooltip) self.actionExport_session.setText(QCoreApplication.translate("MainWindow", u"E&xport session...", None)) #if QT_CONFIG(tooltip) - self.actionExport_session.setToolTip(QCoreApplication.translate("MainWindow", u"

Export current session (changes since last commit) into file

", None)) + self.actionExport_session.setToolTip(QCoreApplication.translate("MainWindow", u"

Export changes since last commit into file

", None)) #endif // QT_CONFIG(tooltip) self.actionSettings.setText(QCoreApplication.translate("MainWindow", u"Settings...", None)) +#if QT_CONFIG(tooltip) + self.actionSettings.setToolTip(QCoreApplication.translate("MainWindow", u"

Open editor settings

", None)) +#endif // QT_CONFIG(tooltip) #if QT_CONFIG(shortcut) self.actionSettings.setShortcut(QCoreApplication.translate("MainWindow", u"Ctrl+,", None)) #endif // QT_CONFIG(shortcut) self.actionUser_guide.setText(QCoreApplication.translate("MainWindow", u"User guide", None)) +#if QT_CONFIG(tooltip) + self.actionUser_guide.setToolTip(QCoreApplication.translate("MainWindow", u"

Open User guide in web browser

", None)) +#endif // QT_CONFIG(tooltip) #if QT_CONFIG(shortcut) self.actionUser_guide.setShortcut(QCoreApplication.translate("MainWindow", u"F1", None)) #endif // QT_CONFIG(shortcut) self.actionUndo.setText(QCoreApplication.translate("MainWindow", u"Un&do", None)) #if QT_CONFIG(tooltip) - self.actionUndo.setToolTip(QCoreApplication.translate("MainWindow", u"

Undo

", None)) + self.actionUndo.setToolTip(QCoreApplication.translate("MainWindow", u"

Undo last action

", None)) #endif // QT_CONFIG(tooltip) self.actionRedo.setText(QCoreApplication.translate("MainWindow", u"&Redo", None)) #if QT_CONFIG(tooltip) - self.actionRedo.setToolTip(QCoreApplication.translate("MainWindow", u"

Redo

", None)) + self.actionRedo.setToolTip(QCoreApplication.translate("MainWindow", u"

Redo last undone action

", None)) #endif // QT_CONFIG(tooltip) self.actionNew_db_file.setText(QCoreApplication.translate("MainWindow", u"&New...", None)) #if QT_CONFIG(tooltip) - self.actionNew_db_file.setToolTip(QCoreApplication.translate("MainWindow", u"

New database file

", None)) + self.actionNew_db_file.setToolTip(QCoreApplication.translate("MainWindow", u"

Create new SQLite database file

", None)) #endif // QT_CONFIG(tooltip) self.actionOpen_db_file.setText(QCoreApplication.translate("MainWindow", u"&Open...", None)) #if QT_CONFIG(tooltip) - self.actionOpen_db_file.setToolTip(QCoreApplication.translate("MainWindow", u"

Open database file

", None)) + self.actionOpen_db_file.setToolTip(QCoreApplication.translate("MainWindow", u"

Open SQLite database file

", None)) #endif // QT_CONFIG(tooltip) self.actionAdd_db_file.setText(QCoreApplication.translate("MainWindow", u"&Add...", None)) #if QT_CONFIG(tooltip) - self.actionAdd_db_file.setToolTip(QCoreApplication.translate("MainWindow", u"Add database file to the current view", None)) + self.actionAdd_db_file.setToolTip(QCoreApplication.translate("MainWindow", u"

Add database to the current view

", None)) #endif // QT_CONFIG(tooltip) self.actionVacuum.setText(QCoreApplication.translate("MainWindow", u"Vacuum", None)) +#if QT_CONFIG(tooltip) + self.actionVacuum.setToolTip(QCoreApplication.translate("MainWindow", u"

Optimize SQLite database file size

", None)) +#endif // QT_CONFIG(tooltip) self.actionValue.setText(QCoreApplication.translate("MainWindow", u"&Value", None)) #if QT_CONFIG(tooltip) - self.actionValue.setToolTip(QCoreApplication.translate("MainWindow", u"Pivot view: Value", None)) + self.actionValue.setToolTip(QCoreApplication.translate("MainWindow", u"

Switch to Pivot table's Value view

", None)) #endif // QT_CONFIG(tooltip) self.actionIndex.setText(QCoreApplication.translate("MainWindow", u"&Index", None)) #if QT_CONFIG(tooltip) - self.actionIndex.setToolTip(QCoreApplication.translate("MainWindow", u"Pivot view: Index", None)) + self.actionIndex.setToolTip(QCoreApplication.translate("MainWindow", u"

Switch to Pivot table's Index view

", None)) #endif // QT_CONFIG(tooltip) self.actionElement.setText(QCoreApplication.translate("MainWindow", u"E&lement", None)) #if QT_CONFIG(tooltip) - self.actionElement.setToolTip(QCoreApplication.translate("MainWindow", u"Pivot view: Element", None)) + self.actionElement.setToolTip(QCoreApplication.translate("MainWindow", u"

Switch to Pivot table's Element view to manage entity elements

", None)) #endif // QT_CONFIG(tooltip) self.actionScenario.setText(QCoreApplication.translate("MainWindow", u"&Scenario", None)) #if QT_CONFIG(tooltip) - self.actionScenario.setToolTip(QCoreApplication.translate("MainWindow", u"Pivot view: Scenario", None)) + self.actionScenario.setToolTip(QCoreApplication.translate("MainWindow", u"

Swith to Pivot table's Scenario view to manage scenarios

", None)) #endif // QT_CONFIG(tooltip) self.actionOpen_recent.setText(QCoreApplication.translate("MainWindow", u"Open recent", None)) self.actionGitHub.setText(QCoreApplication.translate("MainWindow", u"GitHub", None)) diff --git a/spinetoolbox/spine_db_editor/ui/spine_db_editor_window.ui b/spinetoolbox/spine_db_editor/ui/spine_db_editor_window.ui index 0852f5715..4de573026 100644 --- a/spinetoolbox/spine_db_editor/ui/spine_db_editor_window.ui +++ b/spinetoolbox/spine_db_editor/ui/spine_db_editor_window.ui @@ -27,10 +27,10 @@ MainWindow - Qt::LayoutDirection::LeftToRight + Qt::LeftToRight - QMainWindow::DockOption::AllowNestedDocks|QMainWindow::DockOption::AllowTabbedDocks|QMainWindow::DockOption::AnimatedDocks|QMainWindow::DockOption::GroupedDragging + QMainWindow::AllowNestedDocks|QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks|QMainWindow::GroupedDragging @@ -42,7 +42,7 @@ - Qt::DockWidgetArea::AllDockWidgetAreas + Qt::AllDockWidgetAreas Alternative @@ -73,16 +73,16 @@ alternative tree - QAbstractItemView::EditTrigger::AnyKeyPressed|QAbstractItemView::EditTrigger::DoubleClicked|QAbstractItemView::EditTrigger::EditKeyPressed + QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed true - QAbstractItemView::DragDropMode::DragOnly + QAbstractItemView::DragOnly - QAbstractItemView::SelectionMode::ExtendedSelection + QAbstractItemView::ExtendedSelection false @@ -122,10 +122,10 @@ parameter value list - QAbstractItemView::EditTrigger::AnyKeyPressed|QAbstractItemView::EditTrigger::DoubleClicked|QAbstractItemView::EditTrigger::EditKeyPressed + QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed - QAbstractItemView::SelectionMode::ExtendedSelection + QAbstractItemView::ExtendedSelection true @@ -165,22 +165,22 @@ true - Qt::ContextMenuPolicy::DefaultContextMenu + Qt::DefaultContextMenu parameter value - Qt::LayoutDirection::LeftToRight + Qt::LeftToRight false - QAbstractItemView::SelectionBehavior::SelectItems + QAbstractItemView::SelectItems - QAbstractItemView::ScrollMode::ScrollPerPixel + QAbstractItemView::ScrollPerPixel false @@ -229,7 +229,7 @@ - Qt::ContextMenuPolicy::DefaultContextMenu + Qt::DefaultContextMenu parameter definition @@ -238,10 +238,10 @@ false - QAbstractItemView::SelectionBehavior::SelectItems + QAbstractItemView::SelectItems - QAbstractItemView::ScrollMode::ScrollPerPixel + QAbstractItemView::ScrollPerPixel false @@ -265,7 +265,7 @@ - Qt::DockWidgetArea::AllDockWidgetAreas + Qt::AllDockWidgetAreas Entity tree @@ -302,13 +302,13 @@ entity tree - QAbstractItemView::EditTrigger::EditKeyPressed + QAbstractItemView::EditKeyPressed - QAbstractItemView::SelectionMode::ExtendedSelection + QAbstractItemView::ExtendedSelection - QAbstractItemView::SelectionBehavior::SelectItems + QAbstractItemView::SelectItems @@ -360,10 +360,10 @@ true - QFrame::Shape::NoFrame + QFrame::NoFrame - QGraphicsView::DragMode::ScrollHandDrag + QGraphicsView::ScrollHandDrag @@ -406,13 +406,13 @@ - Qt::ContextMenuPolicy::DefaultContextMenu + Qt::DefaultContextMenu false - QAbstractItemView::ScrollMode::ScrollPerPixel + QAbstractItemView::ScrollPerPixel @@ -452,10 +452,10 @@ false - QAbstractItemView::SelectionMode::NoSelection + QAbstractItemView::NoSelection - QAbstractItemView::SelectionBehavior::SelectRows + QAbstractItemView::SelectRows false @@ -476,10 +476,10 @@ - QDockWidget::DockWidgetFeature::DockWidgetClosable + QDockWidget::DockWidgetClosable - Qt::DockWidgetArea::BottomDockWidgetArea + Qt::BottomDockWidgetArea Exports @@ -512,7 +512,7 @@ - Qt::Orientation::Horizontal + Qt::Horizontal @@ -637,19 +637,19 @@ scenario tree - QAbstractItemView::EditTrigger::AnyKeyPressed|QAbstractItemView::EditTrigger::DoubleClicked|QAbstractItemView::EditTrigger::EditKeyPressed + QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed true - QAbstractItemView::DragDropMode::DragDrop + QAbstractItemView::DragDrop - Qt::DropAction::MoveAction + Qt::MoveAction - QAbstractItemView::SelectionMode::ExtendedSelection + QAbstractItemView::ExtendedSelection false @@ -689,7 +689,7 @@ false - QAbstractItemView::ScrollMode::ScrollPerPixel + QAbstractItemView::ScrollPerPixel false @@ -776,7 +776,7 @@ &Commit... - <html><head/><body><p>Commit</p><p>Ctrl+Return</p></body></html> + <html><head/><body><p>Commit changes to database</p></body></html> Ctrl+Return @@ -794,7 +794,7 @@ Roll&back - <html><head/><body><p>Rollback</p><p>Ctrl+Backspace</p></body></html> + <html><head/><body><p>Rollback changes since last commit.</p><p>Ctrl+Backspace</p></body></html> Ctrl+Backspace @@ -811,6 +811,9 @@ Close + + Close current tab + @@ -824,7 +827,7 @@ I&mport... - <html><head/><body><p>Import data from file</p></body></html> + <html><head/><body><p>Import data or template from file</p></body></html> @@ -854,7 +857,7 @@ Cop&y as text - <html><head/><body><p>Copy as text</p><p>Ctrl+C</p></body></html> + <html><head/><body><p>Copy selection to clipboard</p><p>Ctrl+C</p></body></html> Ctrl+C @@ -872,7 +875,7 @@ P&aste - <html><head/><body><p>Paste</p><p>Ctrl+V</p></body></html> + <html><head/><body><p>Paste into selection</p><p>Ctrl+V</p></body></html> Ctrl+V @@ -890,7 +893,7 @@ T&able - Table view + <html><head/><body><p>Switch to Table view</p></body></html> @@ -905,7 +908,7 @@ &Graph - Graph view + <html><head/><body><p>Switch to Graph view</p></body></html> @@ -919,6 +922,9 @@ &History... + + <html><head/><body><p>Open Commit viewer</p></body></html> + @@ -947,7 +953,7 @@ E&xport session... - <html><head/><body><p>Export current session (changes since last commit) into file</p></body></html> + <html><head/><body><p>Export changes since last commit into file</p></body></html> @@ -958,6 +964,9 @@ Settings... + + <html><head/><body><p>Open editor settings</p></body></html> + Ctrl+, @@ -970,6 +979,9 @@ User guide + + <html><head/><body><p>Open User guide in web browser</p></body></html> + F1 @@ -986,7 +998,7 @@ Un&do - <html><head/><body><p>Undo</p></body></html> + <html><head/><body><p>Undo last action</p></body></html> @@ -1001,7 +1013,7 @@ &Redo - <html><head/><body><p>Redo</p></body></html> + <html><head/><body><p>Redo last undone action</p></body></html> @@ -1013,7 +1025,7 @@ &New... - <html><head/><body><p>New database file</p></body></html> + <html><head/><body><p>Create new SQLite database file</p></body></html> @@ -1025,7 +1037,7 @@ &Open... - <html><head/><body><p>Open database file</p></body></html> + <html><head/><body><p>Open SQLite database file</p></body></html> @@ -1037,7 +1049,7 @@ &Add... - Add database file to the current view + <html><head/><body><p>Add database to the current view</p></body></html> @@ -1048,6 +1060,9 @@ Vacuum + + <html><head/><body><p>Optimize SQLite database file size</p></body></html> + @@ -1061,7 +1076,7 @@ &Value - Pivot view: Value + <html><head/><body><p>Switch to Pivot table's Value view</p></body></html> @@ -1076,7 +1091,7 @@ &Index - Pivot view: Index + <html><head/><body><p>Switch to Pivot table's Index view</p></body></html> @@ -1091,7 +1106,7 @@ E&lement - Pivot view: Element + <html><head/><body><p>Switch to Pivot table's Element view to manage entity elements</p></body></html> @@ -1106,7 +1121,7 @@ &Scenario - Pivot view: Scenario + <html><head/><body><p>Swith to Pivot table's Scenario view to manage scenarios</p></body></html> diff --git a/spinetoolbox/spine_db_editor/widgets/spine_db_editor.py b/spinetoolbox/spine_db_editor/widgets/spine_db_editor.py index 17671149e..9c62f682c 100644 --- a/spinetoolbox/spine_db_editor/widgets/spine_db_editor.py +++ b/spinetoolbox/spine_db_editor/widgets/spine_db_editor.py @@ -31,6 +31,7 @@ from spinedb_api.spine_io.importers.excel_reader import get_mapped_data_from_xlsx from ...config import APPLICATION_PATH, SPINE_TOOLBOX_REPO_URL from ...helpers import ( + add_keyboard_shortcuts_to_action_tool_tips, busy_effect, call_on_focused_widget, format_string_list, @@ -83,6 +84,7 @@ def __init__(self, db_mngr): # Setup UI from Qt Designer file self.ui = Ui_MainWindow() self.ui.setupUi(self) + add_keyboard_shortcuts_to_action_tool_tips(self.ui) self.takeCentralWidget().deleteLater() self.toolbar = DBEditorToolBar(self) self.addToolBar(Qt.TopToolBarArea, self.toolbar) @@ -336,9 +338,7 @@ def _replace_undo_redo_actions(self, new_undo_action, new_redo_action): @Slot() def _refresh_undo_redo_actions(self): self.ui.actionUndo.setEnabled(self.undo_action.isEnabled()) - self.ui.actionUndo.setToolTip(f"

{self.undo_action.text()}

Ctrl+Z

") self.ui.actionRedo.setEnabled(self.redo_action.isEnabled()) - self.ui.actionRedo.setToolTip(f"

{self.redo_action.text()}

Ctrl+Y

") @Slot(bool) def update_commit_enabled(self, _clean=False): diff --git a/spinetoolbox/spine_db_editor/widgets/toolbar.py b/spinetoolbox/spine_db_editor/widgets/toolbar.py index a87e08e49..a90d23529 100644 --- a/spinetoolbox/spine_db_editor/widgets/toolbar.py +++ b/spinetoolbox/spine_db_editor/widgets/toolbar.py @@ -35,7 +35,7 @@ filter_configs, name_from_dict, ) -from spinetoolbox.helpers import CharIconEngine +from spinetoolbox.helpers import CharIconEngine, add_keyboard_shortcut_to_tool_tip, plain_to_tool_tip class DBEditorToolBar(QToolBar): @@ -44,14 +44,20 @@ def __init__(self, db_editor): self.setObjectName("spine_db_editor_toolbar") self._db_editor = db_editor self.reload_action = QAction(QIcon(CharIconEngine("\uf021")), "Reload") + self.reload_action.setToolTip("Reload data from database keeping changes") self.reload_action.setShortcut(QKeySequence(Qt.Modifier.CTRL | Qt.Key.Key_R)) + add_keyboard_shortcut_to_tool_tip(self.reload_action) self.reload_action.setEnabled(False) self.reset_docks_action = QAction(QIcon(CharIconEngine("\uf2d2")), "Reset docks") + self.reset_docks_action.setToolTip(plain_to_tool_tip("Reset window back to default configuration<")) self.show_toolbox_action = QAction(QIcon(":/symbols/Spine_symbol.png"), "Show Toolbox") self.show_toolbox_action.setShortcut(QKeySequence(Qt.Modifier.CTRL | Qt.Key.Key_Escape)) - self.show_toolbox_action.setToolTip("Show Spine Toolbox (Ctrl+ESC)") + self.show_toolbox_action.setToolTip("Show Spine Toolbox window") + add_keyboard_shortcut_to_tool_tip(self.show_toolbox_action) self._filter_action = QAction(QIcon(CharIconEngine("\uf0b0")), "Filter") + self._filter_action.setToolTip(plain_to_tool_tip("Set DB API level scenario filters<")) self.show_url_action = QAction(QIcon(CharIconEngine("\uf550")), "Show URLs") + self.show_url_action.setToolTip(plain_to_tool_tip("Show URLs of currently databases in the session")) self._add_actions() self._connect_signals() self.setMovable(False) diff --git a/spinetoolbox/ui_main.py b/spinetoolbox/ui_main.py index c07135997..16a0afd6b 100644 --- a/spinetoolbox/ui_main.py +++ b/spinetoolbox/ui_main.py @@ -54,6 +54,7 @@ from .config import DEFAULT_WORK_DIR, MAINWINDOW_SS, ONLINE_DOCUMENTATION_URL, SPINE_TOOLBOX_REPO_URL from .helpers import ( ChildCyclingKeyPressFilter, + add_keyboard_shortcuts_to_action_tool_tips, busy_effect, color_from_index, create_dir, @@ -125,7 +126,6 @@ class ToolboxUI(QMainWindow): persistent_console_requested = Signal(object, str, tuple, str) def __init__(self): - """Initializes application and main window.""" from .ui.mainwindow import Ui_MainWindow # pylint: disable=import-outside-toplevel super().__init__(flags=Qt.Window) @@ -135,14 +135,15 @@ def __init__(self): self._update_qsettings() locale.setlocale(locale.LC_NUMERIC, 'C') self.ui = Ui_MainWindow() - self.ui.setupUi(self) # Set up gui widgets from Qt Designer files + self.ui.setupUi(self) + add_keyboard_shortcuts_to_action_tool_tips(self.ui) self.label_item_name = QLabel() self._button_item_dir = QToolButton() self._properties_title = QWidget() self._setup_properties_title() self.takeCentralWidget().deleteLater() self.setWindowIcon(QIcon(":/symbols/app.ico")) - set_taskbar_icon() # in helpers.py + set_taskbar_icon() self.ui.graphicsView.set_ui(self) self.key_press_filter = ChildCyclingKeyPressFilter(self) self.ui.tabWidget_item_properties.installEventFilter(self.key_press_filter) diff --git a/spinetoolbox/widgets/custom_qwidgets.py b/spinetoolbox/widgets/custom_qwidgets.py index 2a9c6ea07..f6761c120 100644 --- a/spinetoolbox/widgets/custom_qwidgets.py +++ b/spinetoolbox/widgets/custom_qwidgets.py @@ -760,7 +760,7 @@ def _handle_check_box_state_changed(self, _checked): ) if self._warn_checked_non_data_items: if self._item_check_boxes_widget.any_structural_item_checked(): - self._ui.warning_label.setText("Warning! Structural data items selected.") + self._ui.warning_label.setText("Warning! You are about to delete structural items.") else: self._ui.warning_label.clear() diff --git a/spinetoolbox/widgets/toolbars.py b/spinetoolbox/widgets/toolbars.py index 04edf4095..53e250a3e 100644 --- a/spinetoolbox/widgets/toolbars.py +++ b/spinetoolbox/widgets/toolbars.py @@ -159,7 +159,8 @@ def _make_tool_button(self, icon, text, slot=None, tip=None): button = NiceButton() button.setIcon(icon) button.setText(text) - button.setToolTip(f"

{tip}

") + if tip is not None: + button.setToolTip(f"

{tip}

") if slot is not None: button.clicked.connect(slot) self._add_tool_button(button) diff --git a/tests/test_helpers.py b/tests/test_helpers.py index 201f7aa98..39b511420 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -19,11 +19,14 @@ import unittest from unittest.mock import MagicMock, patch from PySide6.QtCore import QSettings +from PySide6.QtGui import QAction, QKeySequence from PySide6.QtWidgets import QLineEdit, QWidget from spine_engine.load_project_items import load_item_specification_factories from spinetoolbox.config import PROJECT_FILENAME, PROJECT_LOCAL_DATA_DIR_NAME, PROJECT_LOCAL_DATA_FILENAME from spinetoolbox.helpers import ( HTMLTagFilter, + add_keyboard_shortcut_to_tool_tip, + add_keyboard_shortcuts_to_action_tool_tips, copy_files, create_dir, dir_is_valid, @@ -54,7 +57,7 @@ tuple_itemgetter, unique_name, ) -from tests.mock_helpers import TestCaseWithQApplication +from tests.mock_helpers import TestCaseWithQApplication, q_object class TestHelpers(TestCaseWithQApplication): @@ -462,5 +465,72 @@ def test_makes_tool_tips(self): self.assertEqual(plain_to_tool_tip("Is not None."), plain_to_rich("Is not None.")) +class TestAddKeyboardShortcutToToolTip(TestCaseWithQApplication): + def test_tool_tip_remains_unchanged_without_shortcut(self): + with q_object(QAction()) as action: + text = "

A useful action

" + action.setToolTip(text) + add_keyboard_shortcut_to_tool_tip(action) + self.assertEqual(action.toolTip(), text) + + def test_shortcut_get_added_to_html_tool_tip(self): + with q_object(QAction()) as action: + text = "

A useful action

" + action.setToolTip(text) + action.setShortcut(QKeySequence("g")) + add_keyboard_shortcut_to_tool_tip(action) + self.assertEqual(action.toolTip(), "

A useful action

G

") + + def test_shortcut_get_added_to_plain_text_tool_tip(self): + with q_object(QAction()) as action: + text = "A useful action" + action.setToolTip(text) + action.setShortcut(QKeySequence("g")) + add_keyboard_shortcut_to_tool_tip(action) + self.assertEqual(action.toolTip(), "

A useful action

G

") + + def test_html_formatting_within_tool_tip_is_preserved(self): + with q_object(QAction()) as action: + text = "

A useful action

" + action.setToolTip(text) + action.setShortcut(QKeySequence("g")) + add_keyboard_shortcut_to_tool_tip(action) + self.assertEqual(action.toolTip(), "

A useful action

G

") + + +class TestAddKeyboardShortcutsToActionToolTips(TestCaseWithQApplication): + def test_ui_without_actions_works(self): + class Ui: + no_action = object() + + ui = Ui() + add_keyboard_shortcuts_to_action_tool_tips(ui) + + def test_ui_with_action_without_shortscuts_leaves_tool_tips_as_is(self): + class Ui: + no_action = object() + action = None + + ui = Ui() + with q_object(QAction()) as action: + action.setToolTip("A highly useful thing") + ui.action = action + add_keyboard_shortcuts_to_action_tool_tips(ui) + self.assertEqual(action.toolTip(), "A highly useful thing") + + def test_shortcut_gets_appended_to_tool_tip(self): + class Ui: + no_action = object() + action = None + + ui = Ui() + with q_object(QAction()) as action: + action.setToolTip("A highly useful thing") + action.setShortcut(QKeySequence("w")) + ui.action = action + add_keyboard_shortcuts_to_action_tool_tips(ui) + self.assertEqual(action.toolTip(), "

A highly useful thing

W

") + + if __name__ == "__main__": unittest.main() diff --git a/tests/widgets/test_custom_qwidgets.py b/tests/widgets/test_custom_qwidgets.py index 46300aa55..036986ced 100644 --- a/tests/widgets/test_custom_qwidgets.py +++ b/tests/widgets/test_custom_qwidgets.py @@ -99,7 +99,7 @@ def test_warning_label(self): with _select_database_items_dialog(None, None) as dialog: self.assertEqual(dialog._ui.warning_label.text(), "") dialog._item_check_boxes_widget._item_check_boxes["entity_class"].setChecked(True) - self.assertEqual(dialog._ui.warning_label.text(), "Warning! Structural data items selected.") + self.assertEqual(dialog._ui.warning_label.text(), "Warning! You are about to delete structural items.") @contextmanager