merge imported labels with existing labels

This commit is contained in:
thomasv 2013-01-07 14:03:45 +01:00
parent 404dacd803
commit b35617f6db
1 changed files with 4 additions and 2 deletions

View File

@ -1541,11 +1541,13 @@ class ElectrumWindow(QMainWindow):
f = open(labelsFile, 'r')
data = f.read()
f.close()
self.wallet.labels = json.loads(data)
for key, value in json.loads(data).items():
self.wallet.labels[key] = value
self.wallet.save()
QMessageBox.information(None, "Labels imported", "Your labels where imported from '%s'" % str(labelsFile))
except (IOError, os.error), reason:
QMessageBox.critical(None, "Unable to export labels", "Electrum was unable to export your labels.\n" + str(reason))
QMessageBox.critical(None, "Unable to import labels", "Electrum was unable to import your labels.\n" + str(reason))
def do_export_labels(self):