From a5f06d72cf53f35578037ea330840c8cc78b3a9a Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sun, 7 Feb 2016 11:47:48 +0900 Subject: [PATCH 1/5] hw_wallet: add missing import --- plugins/hw_wallet/plugin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/hw_wallet/plugin.py b/plugins/hw_wallet/plugin.py index 37b5fc30f..2ba537cfd 100644 --- a/plugins/hw_wallet/plugin.py +++ b/plugins/hw_wallet/plugin.py @@ -21,6 +21,7 @@ import time from electrum.util import ThreadJob from electrum.plugins import BasePlugin, hook +from electrum.i18n import _ class HW_PluginBase(BasePlugin, ThreadJob): From 5c2c7b155799acae5bd8467c7a339d4a94a40ef0 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sun, 7 Feb 2016 15:15:58 +0900 Subject: [PATCH 2/5] trezor: create new accounts in non-GUI thread --- gui/qt/main_window.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 89244b4fd..825e4cadb 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -1979,21 +1979,21 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): def check_next_account(self): if self.wallet.needs_next_account() and not self.checking_accounts: - try: - self.checking_accounts = True - msg = _("All the accounts in your wallet have received " - "transactions. Electrum must check whether more " - "accounts exist; one will only be shown if " - "it has been used or you give it a name.") - self.show_message(msg, title=_("Check Accounts")) - self.create_next_account() - self.update_new_account_menu() - finally: - self.checking_accounts = False + self.checking_accounts = True + msg = _("All the accounts in your wallet have received " + "transactions. Electrum must check whether more " + "accounts exist; one will only be shown if " + "it has been used or you give it a name.") + self.show_message(msg, title=_("Check Accounts")) + self.create_next_account() @protected def create_next_account(self, password): - self.wallet.create_next_account(password) + def on_done(): + self.checking_accounts = False + self.update_new_account_menu() + task = partial(self.wallet.create_next_account, password) + self.wallet.thread.add(task, on_done=on_done) def show_master_public_keys(self): dialog = WindowModalDialog(self, "Master Public Keys") From bb3de0eb63fe6770dbcd6fb059f653573c0cd91f Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sun, 7 Feb 2016 16:45:29 +0900 Subject: [PATCH 3/5] change_password_dialog: remove redundant check This is guaranteed False by wallet.can_change_password() --- gui/qt/main_window.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 825e4cadb..7f74487d6 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -1875,10 +1875,6 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): def change_password_dialog(self): from password_dialog import PasswordDialog, PW_CHANGE - if self.wallet and self.wallet.is_watching_only(): - self.show_error(_('This is a watching-only wallet')) - return - msg = (_('Your wallet is encrypted. Use this dialog to change your ' 'password. To disable wallet encryption, enter an empty new ' 'password.') if self.wallet.use_encryption From 6b9d12e369f2c78b52482831d4ff3450acb9a8a0 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sun, 7 Feb 2016 17:51:56 +0900 Subject: [PATCH 4/5] Tweak tooltip --- gui/qt/main_window.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 7f74487d6..805e0dd2a 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -2805,7 +2805,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): multiple_cb = QCheckBox(_('Use multiple change addresses')) multiple_cb.setEnabled(self.wallet.use_change) multiple_cb.setToolTip('\n'.join([ - _('In some cases, use up to 3 change addresses in order to obfuscate the recipient address.'), + _('In some cases, use up to 3 change addresses in order to break ' + 'up large coin amounts and obfuscate the recipient address.'), _('This may result in higher transactions fees.') ])) multiple_cb.setChecked(multiple_change) From c41e6945345d010a9b2b0f02be159764e1376c16 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sun, 7 Feb 2016 18:05:24 +0900 Subject: [PATCH 5/5] show_seed_dialog: return if user cancels p/w input Update stale comment. --- gui/qt/main_window.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 805e0dd2a..81acf097b 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -1150,11 +1150,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): def protected(func): '''Password request wrapper. The password is passed to the function - as the 'password' named argument. Return value is a 2-element - tuple: (Cancelled, Result) where Cancelled is True if the user - cancels the password request, otherwise False. Result is the - return value of the wrapped function, or None if cancelled. - ''' + as the 'password' named argument. "None" indicates either an + unencrypted wallet, or the user cancelled the password request. + An empty input is passed as the empty string.''' def request_password(self, *args, **kwargs): parent = self.top_level_window() password = None @@ -2024,6 +2022,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): @protected def show_seed_dialog(self, password): + if self.wallet.use_encryption and password is None: + return # User cancelled password input if not self.wallet.has_seed(): self.show_message(_('This wallet has no seed')) return