Fix #840448 (Various bugs for past isbn button)

This commit is contained in:
Kovid Goyal 2011-09-03 18:18:24 -06:00
parent 60d7e4ff2d
commit 0bef23bc6f

View File

@ -1227,7 +1227,9 @@ class IdentifiersEdit(QLineEdit): # {{{
val[k] = v
ids = sorted(val.iteritems(), key=keygen)
txt = ', '.join(['%s:%s'%(k.lower(), v) for k, v in ids])
self.setText(txt.strip())
# Use clear + insert instead of setText so that undo works
self.clear()
self.insert(txt.strip())
self.setCursorPosition(0)
return property(fget=fget, fset=fset)
@ -1319,7 +1321,7 @@ class ISBNDialog(QDialog) : # {{{
self.line_edit.setStyleSheet('QLineEdit { background-color: %s }'%col)
def text(self):
return unicode(self.line_edit.text())
return check_isbn(unicode(self.line_edit.text()))
# }}}