commit 83dbe7fbf37bc559ef4fc2ead3c818c411d5ac1e
parent 08733c09c4ebb16c0d72d73c65785e6518a53764
Author: ThomasV <thomasv@electrum.org>
Date: Tue, 30 Aug 2016 11:19:30 +0200
more fixes for kivy
Diffstat:
3 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/gui/kivy/main_window.py b/gui/kivy/main_window.py
@@ -418,10 +418,11 @@ class ElectrumWindow(App):
if not path:
return
wallet = self.daemon.load_wallet(path)
- if wallet != self.wallet:
- self.stop_wallet()
- self.load_wallet(wallet)
- self.on_resume()
+ if wallet:
+ if wallet != self.wallet:
+ self.stop_wallet()
+ self.load_wallet(wallet)
+ self.on_resume()
else:
Logger.debug('Electrum: Wallet not found. Launching install wizard')
wizard = Factory.InstallWizard(self.electrum_config, self.network, path)
@@ -537,7 +538,6 @@ class ElectrumWindow(App):
@profiler
def load_wallet(self, wallet):
self.wallet = wallet
- self.current_account = self.wallet.storage.get('current_account', None)
self.update_wallet()
# Once GUI has been initialized check if we want to announce something
# since the callback has been called before the GUI was initialized
@@ -560,7 +560,7 @@ class ElectrumWindow(App):
elif server_lag > 1:
status = _("Server lagging (%d blocks)"%server_lag)
else:
- c, u, x = self.wallet.get_balance(self.current_account)
+ c, u, x = self.wallet.get_balance()
text = self.format_amount(c+x+u)
status = str(text.strip() + ' ' + self.base_unit)
else:
@@ -790,12 +790,16 @@ class ElectrumWindow(App):
def _show_seed(self, label, password):
if self.wallet.has_password() and password is None:
return
+ keystore = self.wallet.keystore
try:
- seed = self.wallet.get_seed(password)
+ seed = keystore.get_seed(password)
+ passphrase = keystore.get_passphrase(password)
except:
self.show_error("Invalid PIN")
return
label.text = _('Seed') + ':\n' + seed
+ if passphrase:
+ label.text += '\n\n' + _('Passphrase') + ': ' + passphrase
def change_password(self, cb):
if self.wallet.has_password():
diff --git a/gui/kivy/uix/screens.py b/gui/kivy/uix/screens.py
@@ -157,7 +157,7 @@ class HistoryScreen(CScreen):
def update(self, see_all=False):
if self.app.wallet is None:
return
- history = reversed(self.app.wallet.get_history(self.app.current_account))
+ history = reversed(self.app.wallet.get_history())
history_card = self.screen.ids.history_container
history_card.clear_widgets()
count = 0
diff --git a/lib/base_wizard.py b/lib/base_wizard.py
@@ -118,14 +118,16 @@ class BaseWizard(object):
('create_seed', _('Create a new seed')),
('restore_from_seed', _('I already have a seed')),
('restore_from_key', _('Use public or private keys')),
- ('choose_hw_device', _('Use a hardware device')),
]
+ if not self.is_kivy:
+ choices.append(('choose_hw_device', _('Use a hardware device')))
else:
message = _('Add a cosigner to your multi-sig wallet')
choices = [
('restore_from_key', _('Enter cosigner key')),
- ('choose_hw_device', _('Cosign with hardware device')),
]
+ if not self.is_kivy:
+ choices.append(('choose_hw_device', _('Cosign with hardware device')))
self.choice_dialog(title=title, message=message, choices=choices, run_next=self.run)
@@ -281,7 +283,9 @@ class BaseWizard(object):
self.run('create_wallet')
elif self.wallet_type == 'multisig':
if k.xpub in map(lambda x: x.xpub, self.keystores):
- raise BaseException('duplicate key')
+ self.show_error(_('Error: duplicate master public key'))
+ self.run('choose_keystore')
+ return
self.keystores.append(k)
if len(self.keystores) == 1:
xpub = k.get_master_public_key()