From 2ac771e1dc004e2e3d5e0159974ba2141b7dfe39 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 26 Apr 2011 14:32:30 -0600 Subject: [PATCH] ... --- src/calibre/gui2/metadata/basic_widgets.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/metadata/basic_widgets.py b/src/calibre/gui2/metadata/basic_widgets.py index 86d2a3544f..6b10448c50 100644 --- a/src/calibre/gui2/metadata/basic_widgets.py +++ b/src/calibre/gui2/metadata/basic_widgets.py @@ -957,6 +957,11 @@ class IdentifiersEdit(QLineEdit): # {{{ if x == 'isbn': x = '00isbn' return x + for k in list(val): + if k == 'isbn': + v = check_isbn(k) + if v is not None: + val[k] = v ids = sorted(val.iteritems(), key=keygen) txt = ', '.join(['%s:%s'%(k, v) for k, v in ids]) self.setText(txt.strip()) @@ -964,8 +969,8 @@ class IdentifiersEdit(QLineEdit): # {{{ return property(fget=fget, fset=fset) def initialize(self, db, id_): - self.current_val = db.get_identifiers(id_, index_is_id=True) - self.original_val = self.current_val + self.original_val = db.get_identifiers(id_, index_is_id=True) + self.current_val = self.original_val def commit(self, db, id_): if self.original_val != self.current_val: