1
0

give user the option to remove incomplete wallet

This commit is contained in:
ThomasV
2015-04-03 13:10:43 +02:00
parent 9aa812026a
commit 7e6bd2eb8c
3 changed files with 24 additions and 24 deletions

View File

@@ -142,10 +142,29 @@ class ElectrumGui:
qtVersion = qVersion()
return int(qtVersion[0]) >= 4 and int(qtVersion[2]) >= 7
def set_url(self, uri):
self.current_window.pay_from_URI(uri)
def run_wizard(self, storage, action):
import installwizard
if storage.file_exists and action != 'new':
msg = _("The file '%s' contains an incompletely created wallet.")%storage.path + '\n'\
+ _("Do you want to complete its creation now?")
if not util.question(msg):
if util.question(_("Do you want to delete '%s'?")%storage.path):
os.remove(storage.path)
QMessageBox.information(None, _('Warning'), _('The file was removed'), _('OK'))
return
return
wizard = installwizard.InstallWizard(self.config, self.network, storage)
wizard.show()
try:
wallet = wizard.run(action)
except BaseException as e:
traceback.print_exc(file=sys.stdout)
QMessageBox.information(None, _('Error'), str(e), _('OK'))
return
return wallet
def main(self, url):
@@ -171,15 +190,7 @@ class ElectrumGui:
action = 'new'
if action is not None:
import installwizard
wizard = installwizard.InstallWizard(self.config, self.network, storage)
wizard.show()
try:
wallet = wizard.run(action)
except BaseException as e:
traceback.print_exc(file=sys.stdout)
QMessageBox.information(None, _('Error'), str(e), _('OK'))
return
wallet = self.run_wizard(storage, action)
if not wallet:
return
else: