mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 04:52:48 +02:00
Fix ToC editor undo button not present when used in the editor as opposed to a standalone tool
This commit is contained in:
parent
f5ace33759
commit
d48c1d4eff
1 changed files with 5 additions and 1 deletions
|
|
@ -46,6 +46,10 @@ def __init__(self, title=None, parent=None):
|
|||
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 @@ def write_toc(self):
|
|||
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 @@ def showEvent(self, ev):
|
|||
def update_if_visible(self):
|
||||
if self.isVisible():
|
||||
self.build()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue