commit 20f93f7df0752d81f49a69480d109b4b6972a313
parent 11e1e0e9239e18f2a8774869e455e2fdf705c2f0
Author: ThomasV <thomasv@gitorious>
Date: Tue, 19 Aug 2014 10:36:55 +0200
set wallet.can_change_password and wallet.has_seed for trezor
Diffstat:
3 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py
@@ -221,7 +221,7 @@ class ElectrumWindow(QMainWindow):
# update menus
self.new_account_menu.setEnabled(self.wallet.can_create_accounts())
self.private_keys_menu.setEnabled(not self.wallet.is_watching_only())
- self.password_menu.setEnabled(not self.wallet.is_watching_only())
+ self.password_menu.setEnabled(self.wallet.can_change_password())
self.seed_menu.setEnabled(self.wallet.has_seed())
self.mpk_menu.setEnabled(self.wallet.is_deterministic())
self.import_menu.setEnabled(self.wallet.can_import())
@@ -1725,17 +1725,9 @@ class ElectrumWindow(QMainWindow):
def update_buttons_on_seed(self):
- if self.wallet.has_seed():
- self.seed_button.show()
- else:
- self.seed_button.hide()
-
- if not self.wallet.is_watching_only():
- self.password_button.show()
- self.send_button.setText(_("Send"))
- else:
- self.password_button.hide()
- self.send_button.setText(_("Create unsigned transaction"))
+ self.seed_button.setVisible(self.wallet.has_seed())
+ self.password_button.setVisible(self.wallet.can_change_password())
+ self.send_button.setText(_("Create unsigned transaction") if self.wallet.is_watching_only() else _("Send"))
def change_password_dialog(self):
diff --git a/lib/wallet.py b/lib/wallet.py
@@ -992,6 +992,12 @@ class Abstract_Wallet(object):
def can_sign(self, tx):
pass
+ def is_watching_only(self):
+ False
+
+ def can_change_password(self):
+ return not self.is_watching_only()
+
class Imported_Wallet(Abstract_Wallet):
def __init__(self, storage):
diff --git a/plugins/trezor.py b/plugins/trezor.py
@@ -108,6 +108,12 @@ class TrezorWallet(NewWallet):
def can_create_accounts(self):
return True
+ def can_change_password(self):
+ return False
+
+ def has_seed(self):
+ return False
+
def is_watching_only(self):
return False