From 02603eaad5e1b6bead2444a31a82dd9df2e2b953 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 28 Apr 2013 20:22:36 +0200 Subject: [PATCH] display tool tip in shortcut dialog --- openlp/core/ui/mainwindow.py | 5 ++++- openlp/core/ui/shortcutlistform.py | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index c96176986..5e7aa4ce2 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -310,7 +310,7 @@ class Ui_MainWindow(object): can_shortcuts=True, category=UiStrings().Help, triggers=self.on_online_help_clicked) self.web_site_item = create_action(main_window, u'webSiteItem', can_shortcuts=True, category=UiStrings().Help) - # Some shortcuts not connected to buttons or menu entires. + # Shortcuts not connected to buttons or menu entires. self.search_shortcut_action = create_action(main_window, u'searchShortcut', can_shortcuts=True, category=UiStrings().File, triggers=self.on_search_shortcut_triggered) @@ -438,6 +438,9 @@ class Ui_MainWindow(object): if os.name == u'nt': self.offlineHelpItem.setText(translate('OpenLP.MainWindow', '&User Guide')) self.on_line_help_item.setText(translate('OpenLP.MainWindow', '&Online Help')) + self.search_shortcut_action.setText(UiStrings().Search) + self.search_shortcut_action.setToolTip( + translate('OpenLP.MainWindow', 'Jump to the search box of the current active plugin.')) self.web_site_item.setText(translate('OpenLP.MainWindow', '&Web Site')) for item in self.language_group.actions(): item.setText(item.objectName()) diff --git a/openlp/core/ui/shortcutlistform.py b/openlp/core/ui/shortcutlistform.py index 1b128396f..95a591e6d 100644 --- a/openlp/core/ui/shortcutlistform.py +++ b/openlp/core/ui/shortcutlistform.py @@ -129,11 +129,18 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog): continue item = QtGui.QTreeWidgetItem([category.name]) for action in category.actions: - actionText = REMOVE_AMPERSAND.sub('', action.text()) - actionItem = QtGui.QTreeWidgetItem([actionText]) - actionItem.setIcon(0, action.icon()) - actionItem.setData(0, QtCore.Qt.UserRole, action) - item.addChild(actionItem) + action_text = REMOVE_AMPERSAND.sub('', action.text()) + action_item = QtGui.QTreeWidgetItem([action_text]) + action_item.setIcon(0, action.icon()) + action_item.setData(0, QtCore.Qt.UserRole, action) + tool_tip_text = action.toolTip() + # Only display tool tips if they are helpful. + if tool_tip_text != action_text: + # Display the tool tip in all three colums. + action_item.setToolTip(0, tool_tip_text) + action_item.setToolTip(1, tool_tip_text) + action_item.setToolTip(2, tool_tip_text) + item.addChild(action_item) self.treeWidget.addTopLevelItem(item) item.setExpanded(True) self.refreshShortcutList()