mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
ToC Editor: Allow undo for renaming single items as well. Fixes #1769442 [TOC editor undo issue with renamed entries](https://bugs.launchpad.net/calibre/+bug/1769442)
This commit is contained in:
parent
68d82f681f
commit
9dbd6fa65a
@ -355,8 +355,7 @@ class ItemView(QFrame): # {{{
|
||||
# }}}
|
||||
|
||||
|
||||
NODE_FLAGS = (Qt.ItemIsDragEnabled|Qt.ItemIsEditable|Qt.ItemIsEnabled|
|
||||
Qt.ItemIsSelectable|Qt.ItemIsDropEnabled)
|
||||
NODE_FLAGS = (Qt.ItemIsDragEnabled|Qt.ItemIsEditable|Qt.ItemIsEnabled|Qt.ItemIsSelectable|Qt.ItemIsDropEnabled)
|
||||
|
||||
|
||||
class TreeWidget(QTreeWidget): # {{{
|
||||
@ -394,6 +393,10 @@ class TreeWidget(QTreeWidget): # {{{
|
||||
self.unserialize_tree(self.history.pop())
|
||||
self.history_state_changed.emit()
|
||||
|
||||
def commitData(self, editor):
|
||||
self.push_history()
|
||||
return QTreeWidget.commitData(self, editor)
|
||||
|
||||
def iteritems(self, parent=None):
|
||||
if parent is None:
|
||||
parent = self.invisibleRootItem()
|
||||
|
Loading…
x
Reference in New Issue
Block a user