commit fbf91a67ad1d5eeb3a723ba928d9a77071d2f578
parent 43002f2ede04404e9907e051c9c89c6d64dfc9da
Author: ThomasV <thomasv@gitorious>
Date: Fri, 4 Oct 2013 19:02:01 +0200
better account naming/renaming
Diffstat:
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py
@@ -1071,7 +1071,7 @@ class ElectrumWindow(QMainWindow):
self.update_history_tab()
def edit_account_label(self, k):
- text, ok = QInputDialog.getText(self, _('Rename account'), _('Name') + ':')
+ text, ok = QInputDialog.getText(self, _('Rename account'), _('Name') + ':', text = self.wallet.labels.get(k,''))
if ok:
label = unicode(text)
self.wallet.set_label(k,label)
diff --git a/lib/wallet.py b/lib/wallet.py
@@ -900,7 +900,21 @@ class Wallet:
else:
name = 'Old account'
else:
- name = self.labels.get(k, 'Unnamed account')
+ default = "Unnamed account"
+ m = re.match("m/0'/(\d+)", k)
+ if m:
+ num = m.group(1)
+ if num == '0':
+ default = "Main account"
+ else:
+ default = "Account %s"%num
+
+ m = re.match("m/1'/(\d+) & m/2'/(\d+)", k)
+ if m:
+ num = m.group(1)
+ default = "2of2 account %s"%num
+ name = self.labels.get(k, default)
+
return name
def get_account_names(self):