URI: 
       taccount names - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 3ecd81c94a350809e0f182962418e508048b1ed3
   DIR parent a417816e69be2d6733c50887197cca71223ea1ae
  HTML Author: thomasv <thomasv@gitorious>
       Date:   Tue,  3 Sep 2013 10:09:13 +0200
       
       account names
       
       Diffstat:
         M gui/gui_classic.py                  |       6 +++---
         M gui/installwizard.py                |       5 +++--
         M lib/wallet.py                       |      14 ++++++++++++--
       
       3 files changed, 18 insertions(+), 7 deletions(-)
       ---
   DIR diff --git a/gui/gui_classic.py b/gui/gui_classic.py
       t@@ -316,7 +316,7 @@ class ElectrumWindow(QMainWindow):
                self.notify_transactions()
        
                # account selector
       -        accounts = self.wallet.get_accounts()
       +        accounts = self.wallet.get_account_names()
                self.account_selector.clear()
                if len(accounts) > 1:
                    self.account_selector.addItems([_("All accounts")] + accounts.values())
       t@@ -1272,7 +1272,7 @@ class ElectrumWindow(QMainWindow):
                    account_items = []
        
                for k, account in account_items:
       -            name = self.wallet.labels.get(k, 'unnamed account')
       +            name = self.wallet.get_account_name(k)
                    c,u = self.wallet.get_account_balance(k)
                    account_item = QTreeWidgetItem( [ name, '', self.format_amount(c+u), ''] )
                    l.addTopLevelItem(account_item)
       t@@ -1371,7 +1371,7 @@ class ElectrumWindow(QMainWindow):
                if s == _("All accounts"):
                    self.current_account = None
                else:
       -            accounts = self.wallet.get_accounts()
       +            accounts = self.wallet.get_account_names()
                    for k, v in accounts.items():
                        if v == s:
                            self.current_account = k
   DIR diff --git a/gui/installwizard.py b/gui/installwizard.py
       t@@ -194,7 +194,8 @@ class InstallWizard(QDialog):
                        traceback.print_exc(file=sys.stdout)
                        exit()
        
       -            if not keep_it: exit()
       -
       +            if not keep_it: return
        
                self.password_dialog(wallet)
       +        
       +        return wallet
   DIR diff --git a/lib/wallet.py b/lib/wallet.py
       t@@ -813,10 +813,20 @@ class Wallet:
                return c, u
        
        
       -    def get_accounts(self):
       +    def get_account_name(self, k):
       +        if k == 0:
       +            if self.seed_version == 4: 
       +                name = 'Main account'
       +            else:
       +                name = 'Old account'
       +        else:
       +            name = self.labels.get(k, 'Unnamed account')
       +        return name
       +
       +    def get_account_names(self):
                accounts = {}
                for k, account in self.accounts.items():
       -            accounts[k] = self.labels.get(k, 'unnamed')
       +            accounts[k] = self.get_account_name(k)
                if self.imported_keys:
                    accounts[-1] = 'Imported keys'
                return accounts