mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Show a brief descrition of every action when customizing toolbars in Preferences->Toolbars
This commit is contained in:
parent
39ec67dc26
commit
e51fb88cdf
@ -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):
|
||||
|
@ -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
|
||||
|
@ -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')
|
||||
|
@ -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):
|
||||
|
@ -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
|
||||
|
||||
|
@ -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'
|
||||
|
@ -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'
|
||||
|
||||
|
@ -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):
|
||||
|
@ -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
|
||||
|
@ -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')
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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'
|
||||
|
||||
|
@ -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
|
||||
|
@ -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')
|
||||
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
@ -234,6 +234,13 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="help_text">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="spacer_widget" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
|
Loading…
x
Reference in New Issue
Block a user