From e51fb88cdf9a4f860a6fd5faab449a344cb485a0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 4 Mar 2013 14:21:30 +0530 Subject: [PATCH] Show a brief descrition of every action when customizing toolbars in Preferences->Toolbars --- src/calibre/gui2/actions/catalog.py | 3 ++- src/calibre/gui2/actions/convert.py | 2 +- src/calibre/gui2/actions/delete.py | 2 +- src/calibre/gui2/actions/device.py | 3 ++- src/calibre/gui2/actions/edit_metadata.py | 2 +- src/calibre/gui2/actions/fetch_news.py | 2 +- src/calibre/gui2/actions/open.py | 4 ++-- src/calibre/gui2/actions/plugin_updates.py | 2 +- src/calibre/gui2/actions/polish.py | 3 ++- src/calibre/gui2/actions/preferences.py | 2 +- src/calibre/gui2/actions/restart.py | 2 +- src/calibre/gui2/actions/save_to_disk.py | 3 ++- src/calibre/gui2/actions/show_book_details.py | 4 ++-- src/calibre/gui2/actions/similar_books.py | 2 +- src/calibre/gui2/actions/store.py | 2 +- src/calibre/gui2/actions/view.py | 2 +- src/calibre/gui2/preferences/toolbar.py | 23 +++++++++++++++---- src/calibre/gui2/preferences/toolbar.ui | 7 ++++++ 18 files changed, 47 insertions(+), 23 deletions(-) diff --git a/src/calibre/gui2/actions/catalog.py b/src/calibre/gui2/actions/catalog.py index 6c8568e83a..a6c0877049 100644 --- a/src/calibre/gui2/actions/catalog.py +++ b/src/calibre/gui2/actions/catalog.py @@ -18,7 +18,8 @@ from calibre import sanitize_file_name_unicode class GenerateCatalogAction(InterfaceAction): name = 'Generate Catalog' - action_spec = (_('Create catalog'), 'catalog.png', 'Catalog builder', ()) + action_spec = (_('Create catalog'), 'catalog.png', + _('Create a catalog of the books in your calibre library in different formats'), ()) dont_add_to = frozenset(['context-menu-device']) def genesis(self): diff --git a/src/calibre/gui2/actions/convert.py b/src/calibre/gui2/actions/convert.py index 3034c0de18..68415db748 100644 --- a/src/calibre/gui2/actions/convert.py +++ b/src/calibre/gui2/actions/convert.py @@ -19,7 +19,7 @@ from calibre.customize.ui import plugin_for_input_format class ConvertAction(InterfaceAction): name = 'Convert Books' - action_spec = (_('Convert books'), 'convert.png', None, _('C')) + action_spec = (_('Convert books'), 'convert.png', _('Convert books between different ebook formats'), _('C')) dont_add_to = frozenset(['context-menu-device']) action_type = 'current' action_add_menu = True diff --git a/src/calibre/gui2/actions/delete.py b/src/calibre/gui2/actions/delete.py index a3ffdf03a9..fb3efd36c0 100644 --- a/src/calibre/gui2/actions/delete.py +++ b/src/calibre/gui2/actions/delete.py @@ -83,7 +83,7 @@ class MultiDeleter(QObject): # {{{ class DeleteAction(InterfaceAction): name = 'Remove Books' - action_spec = (_('Remove books'), 'trash.png', None, 'Del') + action_spec = (_('Remove books'), 'trash.png', _('Delete books'), 'Del') action_type = 'current' action_add_menu = True action_menu_clone_qaction = _('Remove selected books') diff --git a/src/calibre/gui2/actions/device.py b/src/calibre/gui2/actions/device.py index 0f97553dcb..09cadceb9c 100644 --- a/src/calibre/gui2/actions/device.py +++ b/src/calibre/gui2/actions/device.py @@ -177,7 +177,8 @@ class SendToDeviceAction(InterfaceAction): class ConnectShareAction(InterfaceAction): name = 'Connect Share' - action_spec = (_('Connect/share'), 'connect_share.png', None, None) + action_spec = (_('Connect/share'), 'connect_share.png', + _('Share books using a web server or email. Connect to special devices, etc.'), None) popup_type = QToolButton.InstantPopup def genesis(self): diff --git a/src/calibre/gui2/actions/edit_metadata.py b/src/calibre/gui2/actions/edit_metadata.py index 0ef17a59ce..968e7a072e 100644 --- a/src/calibre/gui2/actions/edit_metadata.py +++ b/src/calibre/gui2/actions/edit_metadata.py @@ -23,7 +23,7 @@ from calibre.db.errors import NoSuchFormat class EditMetadataAction(InterfaceAction): name = 'Edit Metadata' - action_spec = (_('Edit metadata'), 'edit_input.png', None, _('E')) + action_spec = (_('Edit metadata'), 'edit_input.png', _('Change the title/author/cover etc. of various books'), _('E')) action_type = 'current' action_add_menu = True diff --git a/src/calibre/gui2/actions/fetch_news.py b/src/calibre/gui2/actions/fetch_news.py index f94dfbc88c..d80bfdffe7 100644 --- a/src/calibre/gui2/actions/fetch_news.py +++ b/src/calibre/gui2/actions/fetch_news.py @@ -16,7 +16,7 @@ from calibre.gui2.actions import InterfaceAction class FetchNewsAction(InterfaceAction): name = 'Fetch News' - action_spec = (_('Fetch news'), 'news.png', None, _('F')) + action_spec = (_('Fetch news'), 'news.png', _('Download news in ebook form from various websites all over the world'), _('F')) def location_selected(self, loc): enabled = loc == 'library' diff --git a/src/calibre/gui2/actions/open.py b/src/calibre/gui2/actions/open.py index fc78df5f33..bf8c8335bb 100644 --- a/src/calibre/gui2/actions/open.py +++ b/src/calibre/gui2/actions/open.py @@ -11,8 +11,8 @@ from calibre.gui2.actions import InterfaceAction class OpenFolderAction(InterfaceAction): name = 'Open Folder' - action_spec = (_('Open containing folder'), 'document_open.png', None, - _('O')) + action_spec = (_('Open containing folder'), 'document_open.png', + _('Open the folder containing the current book\'s files'), _('O')) dont_add_to = frozenset(['context-menu-device']) action_type = 'current' diff --git a/src/calibre/gui2/actions/plugin_updates.py b/src/calibre/gui2/actions/plugin_updates.py index 6973e80d8a..0951249b57 100644 --- a/src/calibre/gui2/actions/plugin_updates.py +++ b/src/calibre/gui2/actions/plugin_updates.py @@ -15,7 +15,7 @@ from calibre.gui2.dialogs.plugin_updater import (PluginUpdaterDialog, class PluginUpdaterAction(InterfaceAction): name = 'Plugin Updater' - action_spec = (_('Plugin Updater'), None, None, ()) + action_spec = (_('Plugin Updater'), None, _('Update any plugins you have installed in calibre'), ()) action_type = 'current' def genesis(self): diff --git a/src/calibre/gui2/actions/polish.py b/src/calibre/gui2/actions/polish.py index 858ea04947..127749cc51 100644 --- a/src/calibre/gui2/actions/polish.py +++ b/src/calibre/gui2/actions/polish.py @@ -365,7 +365,8 @@ class Report(QDialog): # {{{ class PolishAction(InterfaceAction): name = 'Polish Books' - action_spec = (_('Polish books'), 'polish.png', None, _('P')) + action_spec = (_('Polish books'), 'polish.png', + _('Apply the shine of perfection to your books'), _('P')) dont_add_to = frozenset(['context-menu-device']) action_type = 'current' accepts_drops = True diff --git a/src/calibre/gui2/actions/preferences.py b/src/calibre/gui2/actions/preferences.py index bbb86b573e..b1e066f979 100644 --- a/src/calibre/gui2/actions/preferences.py +++ b/src/calibre/gui2/actions/preferences.py @@ -17,7 +17,7 @@ from calibre.constants import DEBUG, isosx class PreferencesAction(InterfaceAction): name = 'Preferences' - action_spec = (_('Preferences'), 'config.png', None, _('Ctrl+P')) + action_spec = (_('Preferences'), 'config.png', _('Configure calibre'), _('Ctrl+P')) action_add_menu = True action_menu_clone_qaction = _('Change calibre behavior') diff --git a/src/calibre/gui2/actions/restart.py b/src/calibre/gui2/actions/restart.py index 9bbabedbbf..19619e581f 100644 --- a/src/calibre/gui2/actions/restart.py +++ b/src/calibre/gui2/actions/restart.py @@ -11,7 +11,7 @@ from calibre.gui2.actions import InterfaceAction class RestartAction(InterfaceAction): name = 'Restart' - action_spec = (_('Restart'), None, None, _('Ctrl+R')) + action_spec = (_('Restart'), None, _('Restart calibre'), _('Ctrl+R')) def genesis(self): self.qaction.triggered.connect(self.restart) diff --git a/src/calibre/gui2/actions/save_to_disk.py b/src/calibre/gui2/actions/save_to_disk.py index d1e056b65a..10574aea29 100644 --- a/src/calibre/gui2/actions/save_to_disk.py +++ b/src/calibre/gui2/actions/save_to_disk.py @@ -17,7 +17,8 @@ from calibre.gui2.actions import InterfaceAction class SaveToDiskAction(InterfaceAction): name = "Save To Disk" - action_spec = (_('Save to disk'), 'save.png', None, _('S')) + action_spec = (_('Save to disk'), 'save.png', + _('Export ebook files from the calibre library'), _('S')) action_type = 'current' action_add_menu = True action_menu_clone_qaction = True diff --git a/src/calibre/gui2/actions/show_book_details.py b/src/calibre/gui2/actions/show_book_details.py index 2ab1e19edd..83e570d7b6 100644 --- a/src/calibre/gui2/actions/show_book_details.py +++ b/src/calibre/gui2/actions/show_book_details.py @@ -13,8 +13,8 @@ from calibre.gui2 import error_dialog class ShowBookDetailsAction(InterfaceAction): name = 'Show Book Details' - action_spec = (_('Show book details'), 'dialog_information.png', None, - _('I')) + action_spec = (_('Show book details'), 'dialog_information.png', + _('Show the detailed metadata for the current book in a separate window'), _('I')) dont_add_to = frozenset(['context-menu-device']) action_type = 'current' diff --git a/src/calibre/gui2/actions/similar_books.py b/src/calibre/gui2/actions/similar_books.py index 7e7c02ce0b..93cb631ef7 100644 --- a/src/calibre/gui2/actions/similar_books.py +++ b/src/calibre/gui2/actions/similar_books.py @@ -14,7 +14,7 @@ from calibre.gui2.actions import InterfaceAction class SimilarBooksAction(InterfaceAction): name = 'Similar Books' - action_spec = (_('Similar books...'), None, None, None) + action_spec = (_('Similar books...'), None, _('Show books similar to the current book'), None) popup_type = QToolButton.InstantPopup action_type = 'current' action_add_menu = True diff --git a/src/calibre/gui2/actions/store.py b/src/calibre/gui2/actions/store.py index b84836c465..896516c665 100644 --- a/src/calibre/gui2/actions/store.py +++ b/src/calibre/gui2/actions/store.py @@ -17,7 +17,7 @@ from calibre.gui2.dialogs.confirm_delete import confirm class StoreAction(InterfaceAction): name = 'Store' - action_spec = (_('Get books'), 'store.png', None, _('G')) + action_spec = (_('Get books'), 'store.png', _('Search dozens of online ebook retailers for the cheapest books'), _('G')) action_add_menu = True action_menu_clone_qaction = _('Search for ebooks') diff --git a/src/calibre/gui2/actions/view.py b/src/calibre/gui2/actions/view.py index fe7ef72986..55e07533c3 100644 --- a/src/calibre/gui2/actions/view.py +++ b/src/calibre/gui2/actions/view.py @@ -34,7 +34,7 @@ class HistoryAction(QAction): class ViewAction(InterfaceAction): name = 'View' - action_spec = (_('View'), 'view.png', None, _('V')) + action_spec = (_('View'), 'view.png', _('Read books'), _('V')) action_type = 'current' action_add_menu = True action_menu_clone_qaction = True diff --git a/src/calibre/gui2/preferences/toolbar.py b/src/calibre/gui2/preferences/toolbar.py index bae7a83e0b..8aa85af3d9 100644 --- a/src/calibre/gui2/preferences/toolbar.py +++ b/src/calibre/gui2/preferences/toolbar.py @@ -28,9 +28,10 @@ class BaseModel(QAbstractListModel): def name_to_action(self, name, gui): if name == 'Donate': - return FakeAction('Donate', _('Donate'), 'donate.png', - dont_add_to=frozenset(['context-menu', - 'context-menu-device'])) + return FakeAction( + 'Donate', _('Donate'), 'donate.png', tooltip= + _('Donate to support the development of calibre'), + dont_add_to=frozenset(['context-menu', 'context-menu-device'])) if name == 'Location Manager': return FakeAction('Location Manager', _('Location Manager'), 'reader.png', _('Switch between library and device views'), @@ -247,6 +248,18 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): self.remove_action_button.clicked.connect(self.remove_action) self.action_up_button.clicked.connect(partial(self.move, -1)) self.action_down_button.clicked.connect(partial(self.move, 1)) + self.all_actions.setMouseTracking(True) + self.current_actions.setMouseTracking(True) + self.all_actions.entered.connect(self.all_entered) + self.current_actions.entered.connect(self.current_entered) + + def all_entered(self, index): + tt = self.all_actions.model().data(index, Qt.ToolTipRole).toString() + self.help_text.setText(tt) + + def current_entered(self, index): + tt = self.current_actions.model().data(index, Qt.ToolTipRole).toString() + self.help_text.setText(tt) def what_changed(self, idx): key = unicode(self.what.itemData(idx).toString()) @@ -264,7 +277,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): names = self.all_actions.model().names(x) if names: not_added = self.current_actions.model().add(names) - ns = set([x.name for x in not_added]) + ns = set([y.name for y in not_added]) added = set(names) - ns self.all_actions.model().remove(x, added) if not_added: @@ -283,7 +296,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): names = self.current_actions.model().names(x) if names: not_removed = self.current_actions.model().remove(x) - ns = set([x.name for x in not_removed]) + ns = set([y.name for y in not_removed]) removed = set(names) - ns self.all_actions.model().add(removed) if not_removed: diff --git a/src/calibre/gui2/preferences/toolbar.ui b/src/calibre/gui2/preferences/toolbar.ui index c8ff4977eb..2bb9547b3e 100644 --- a/src/calibre/gui2/preferences/toolbar.ui +++ b/src/calibre/gui2/preferences/toolbar.ui @@ -234,6 +234,13 @@ + + + + + + +