mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Fix #1970497 [Edit Metadata: 'Undo' glitch on identifier field](https://bugs.launchpad.net/calibre/+bug/1970497)
This commit is contained in:
parent
065ba80ed9
commit
ab3a37cdf1
@ -1630,8 +1630,10 @@ class IdentifiersEdit(QLineEdit, ToMetadataMixin):
|
|||||||
val[k] = v
|
val[k] = v
|
||||||
ids = sorted(iteritems(val), key=keygen)
|
ids = sorted(iteritems(val), key=keygen)
|
||||||
txt = ', '.join(['%s:%s'%(k.lower(), vl) for k, vl in ids])
|
txt = ', '.join(['%s:%s'%(k.lower(), vl) for k, vl in ids])
|
||||||
# Use selectAll + insert instead of setText so that undo works
|
if self.allow_undo:
|
||||||
self.selectAll(), self.insert(txt.strip())
|
self.selectAll(), self.insert(txt.strip())
|
||||||
|
else:
|
||||||
|
self.setText(txt.strip())
|
||||||
self.setCursorPosition(0)
|
self.setCursorPosition(0)
|
||||||
|
|
||||||
def initialize(self, db, id_):
|
def initialize(self, db, id_):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user