diff --git a/src/calibre/gui2/init.py b/src/calibre/gui2/init.py index 36e761ca79..c4de3cdfdd 100644 --- a/src/calibre/gui2/init.py +++ b/src/calibre/gui2/init.py @@ -521,7 +521,7 @@ class VLTabs(QTabBar): # {{{ def contextMenuEvent(self, ev): m = QMenu(self) - m.addAction(_('Sort tabs alphabetically'), self.sort_alphabetically) + m.addAction(QIcon.ic('sort.png'), _('Sort tabs alphabetically'), self.sort_alphabetically) hidden = self.current_db.new_api.pref('virt_libs_hidden') if hidden: s = m._s = m.addMenu(_('Restore hidden tabs')) @@ -529,17 +529,17 @@ class VLTabs(QTabBar): # {{{ s.addAction(x, partial(self.restore, x)) m.addAction(_('Hide Virtual library tabs'), self.disable_bar) if gprefs['vl_tabs_closable']: - m.addAction(_('Lock Virtual library tabs'), self.lock_tab) + m.addAction(QIcon.ic('drm-locked.png'), _('Lock Virtual library tabs'), self.lock_tab) else: - m.addAction(_('Unlock Virtual library tabs'), self.unlock_tab) + m.addAction(QIcon.ic('drm-unlocked.png'), _('Unlock Virtual library tabs'), self.unlock_tab) i = self.tabAt(ev.pos()) if i > -1: vl = str(self.tabData(i) or '') if vl: vln = vl.replace('&', '&&') m.addSeparator() - m.addAction(_('Edit "%s"') % vln, partial(self.gui.do_create_edit, name=vl)) - m.addAction(_('Delete "%s"') % vln, partial(self.gui.remove_vl_triggered, name=vl)) + m.addAction(QIcon.ic('edit_input.png'), _('Edit "%s"') % vln, partial(self.gui.do_create_edit, name=vl)) + m.addAction(QIcon.ic('trash.png'), _('Delete "%s"') % vln, partial(self.gui.remove_vl_triggered, name=vl)) m.exec(ev.globalPos()) def sort_alphabetically(self): diff --git a/src/calibre/gui2/keyboard.py b/src/calibre/gui2/keyboard.py index 05c3e296ef..76825d9c01 100644 --- a/src/calibre/gui2/keyboard.py +++ b/src/calibre/gui2/keyboard.py @@ -680,8 +680,8 @@ class ShortcutConfig(QWidget): # {{{ def show_context_menu(self, pos): menu = QMenu(self) - menu.addAction(_('Expand all'), self.view.expandAll) - menu.addAction(_('Collapse all'), self.view.collapseAll) + menu.addAction(QIcon.ic('plus.png'), _('Expand all'), self.view.expandAll) + menu.addAction(QIcon.ic('minus.png'), _('Collapse all'), self.view.collapseAll) menu.exec(self.view.mapToGlobal(pos)) def restore_defaults(self): diff --git a/src/calibre/gui2/preferences/plugins.py b/src/calibre/gui2/preferences/plugins.py index 5f717dc010..c16005ae3b 100644 --- a/src/calibre/gui2/preferences/plugins.py +++ b/src/calibre/gui2/preferences/plugins.py @@ -254,8 +254,8 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): def show_context_menu(self, pos): menu = QMenu(self) - menu.addAction(_('Expand all'), self.plugin_view.expandAll) - menu.addAction(_('Collapse all'), self.plugin_view.collapseAll) + menu.addAction(QIcon.ic('plus.png'), _('Expand all'), self.plugin_view.expandAll) + menu.addAction(QIcon.ic('minus.png'), _('Collapse all'), self.plugin_view.collapseAll) menu.exec(self.plugin_view.mapToGlobal(pos)) def show_user_installed_plugins(self, state): diff --git a/src/calibre/gui2/tweak_book/toc.py b/src/calibre/gui2/tweak_book/toc.py index 137a27b270..6f02c3b8d2 100644 --- a/src/calibre/gui2/tweak_book/toc.py +++ b/src/calibre/gui2/tweak_book/toc.py @@ -180,8 +180,8 @@ class TOCViewer(QWidget): def show_context_menu(self, pos): menu = QMenu(self) menu.addAction(actions['edit-toc']) - menu.addAction(_('&Expand all'), self.view.expandAll) - menu.addAction(_('&Collapse all'), self.view.collapseAll) + menu.addAction(QIcon.ic('plus.png'), _('&Expand all'), self.view.expandAll) + menu.addAction(QIcon.ic('minus.png'), _('&Collapse all'), self.view.collapseAll) menu.addAction(self.refresh_action) menu.exec(self.view.mapToGlobal(pos)) diff --git a/src/calibre/gui2/viewer/highlights.py b/src/calibre/gui2/viewer/highlights.py index ab92d7f53f..2140fc35a3 100644 --- a/src/calibre/gui2/viewer/highlights.py +++ b/src/calibre/gui2/viewer/highlights.py @@ -187,8 +187,8 @@ class Highlights(QTreeWidget): 'Delete this highlight', 'Delete selected highlights', len(self.selectedItems()) ), self.delete_requested.emit) m.addSeparator() - m.addAction(_('Expand all'), self.expandAll) - m.addAction(_('Collapse all'), self.collapseAll) + m.addAction(QIcon.ic('plus.png'), _('Expand all'), self.expandAll) + m.addAction(QIcon.ic('minus.png'), _('Collapse all'), self.collapseAll) self.context_menu.popup(self.mapToGlobal(point)) return True diff --git a/src/calibre/gui2/viewer/toc.py b/src/calibre/gui2/viewer/toc.py index 48255547c2..388fdb98e9 100644 --- a/src/calibre/gui2/viewer/toc.py +++ b/src/calibre/gui2/viewer/toc.py @@ -116,16 +116,16 @@ class TOCView(QTreeView): index = self.indexAt(pos) m = QMenu(self) if index.isValid(): - m.addAction(_('Expand all items under %s') % index.data(), partial(self.expand_tree, index)) + m.addAction(QIcon.ic('plus.png'), _('Expand all items under %s') % index.data(), partial(self.expand_tree, index)) m.addSeparator() - m.addAction(_('Expand all items'), self.expandAll) - m.addAction(_('Collapse all items'), self.collapseAll) + m.addAction(QIcon.ic('plus.png'), _('Expand all items'), self.expandAll) + m.addAction(QIcon.ic('minus.png'), _('Collapse all items'), self.collapseAll) m.addSeparator() if index.isValid(): - m.addAction(_('Expand all items at the level of {}').format(index.data()), partial(self.expand_at_level, index)) - m.addAction(_('Collapse all items at the level of {}').format(index.data()), partial(self.collapse_at_level, index)) + m.addAction(QIcon.ic('plus.png'), _('Expand all items at the level of {}').format(index.data()), partial(self.expand_at_level, index)) + m.addAction(QIcon.ic('minus.png'), _('Collapse all items at the level of {}').format(index.data()), partial(self.collapse_at_level, index)) m.addSeparator() - m.addAction(_('Copy Table of Contents to clipboard'), self.copy_to_clipboard) + m.addAction(QIcon.ic('edit-copy.png'), _('Copy Table of Contents to clipboard'), self.copy_to_clipboard) m.exec(self.mapToGlobal(pos)) def copy_to_clipboard(self):