Browse Source

show_seed_dialog: return if user cancels p/w input

Update stale comment.
master
Neil Booth 10 years ago
parent
commit
c41e694534
  1. 10
      gui/qt/main_window.py

10
gui/qt/main_window.py

@ -1150,11 +1150,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
def protected(func): def protected(func):
'''Password request wrapper. The password is passed to the function '''Password request wrapper. The password is passed to the function
as the 'password' named argument. Return value is a 2-element as the 'password' named argument. "None" indicates either an
tuple: (Cancelled, Result) where Cancelled is True if the user unencrypted wallet, or the user cancelled the password request.
cancels the password request, otherwise False. Result is the An empty input is passed as the empty string.'''
return value of the wrapped function, or None if cancelled.
'''
def request_password(self, *args, **kwargs): def request_password(self, *args, **kwargs):
parent = self.top_level_window() parent = self.top_level_window()
password = None password = None
@ -2024,6 +2022,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
@protected @protected
def show_seed_dialog(self, password): 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(): if not self.wallet.has_seed():
self.show_message(_('This wallet has no seed')) self.show_message(_('This wallet has no seed'))
return return

Loading…
Cancel
Save