From ec0d2d7c17c3d905ecb8e19746d2675cee393517 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 12 Dec 2013 18:56:11 +0530 Subject: [PATCH] Add entry to edit ToC into context menu of toc viewer --- src/calibre/gui2/tweak_book/toc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/tweak_book/toc.py b/src/calibre/gui2/tweak_book/toc.py index 52bc6740e3..2f2445c860 100644 --- a/src/calibre/gui2/tweak_book/toc.py +++ b/src/calibre/gui2/tweak_book/toc.py @@ -14,7 +14,7 @@ from PyQt4.Qt import ( from calibre.ebooks.oeb.polish.toc import commit_toc, get_toc from calibre.gui2 import gprefs, error_dialog from calibre.gui2.toc.main import TOCView, ItemEdit -from calibre.gui2.tweak_book import current_container, TOP +from calibre.gui2.tweak_book import current_container, TOP, actions class TOCEditor(QDialog): @@ -134,9 +134,10 @@ class TOCViewer(QWidget): def show_context_menu(self, pos): menu = QMenu(self) - menu.addAction(self.refresh_action) + menu.addAction(actions['edit-toc']) menu.addAction(_('&Expand all'), self.view.expandAll) menu.addAction(_('&Collapse all'), self.view.collapseAll) + menu.addAction(self.refresh_action) menu.exec_(self.view.mapToGlobal(pos)) def iteritems(self, parent=None):