Fix ToC editor undo button not present when used in the editor as opposed to a standalone tool

This commit is contained in:
Kovid Goyal 2017-05-18 21:55:46 +05:30
parent f5ace33759
commit d48c1d4eff
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -46,6 +46,10 @@ class TOCEditor(QDialog):
l.addWidget(bb)
bb.accepted.connect(self.accept)
bb.rejected.connect(self.reject)
self.undo_button = b = bb.addButton(_('&Undo'), bb.ActionRole)
b.setToolTip(_('Undo the last action, if any'))
b.setIcon(QIcon(I('edit-undo.png')))
b.clicked.connect(self.toc_view.undo)
self.read_toc()
@ -100,6 +104,7 @@ class TOCEditor(QDialog):
commit_toc(current_container(), toc, lang=self.toc_view.toc_lang,
uid=self.toc_view.toc_uid)
DEST_ROLE = Qt.UserRole
FRAG_ROLE = DEST_ROLE + 1
@ -223,4 +228,3 @@ class TOCViewer(QWidget):
def update_if_visible(self):
if self.isVisible():
self.build()