1
0

during wallet restore allow user to retry after invalid OTP. add abort button on kivy.

This commit is contained in:
SomberNight
2018-06-06 22:36:53 +02:00
committed by ThomasV
parent 248a3a5755
commit 531a2a5c1f
3 changed files with 37 additions and 9 deletions

View File

@@ -503,7 +503,7 @@ class ElectrumWindow(App):
else:
self.load_wallet(wallet)
else:
Logger.debug('Electrum: Wallet not found. Launching install wizard')
Logger.debug('Electrum: Wallet not found or action needed. Launching install wizard')
storage = WalletStorage(path, manual_upgrades=True)
wizard = Factory.InstallWizard(self.electrum_config, self.plugins, storage)
wizard.bind(on_wizard_complete=self.on_wizard_complete)

View File

@@ -1,6 +1,7 @@
from functools import partial
import threading
import os
from kivy.app import App
from kivy.clock import Clock
@@ -238,11 +239,23 @@ Builder.load_string('''
text: root.message2
BoxLayout:
orientation: 'horizontal'
size_hint: 1, 0.2
size_hint: 1, 0.3
Widget
CheckBox:
id:cb
on_state: Clock.schedule_once(root.on_cb)
Widget
size_hint: 1, 1
height: '48sp'
BoxLayout:
orientation: 'horizontal'
WizardButton:
id: abort
text: _('Abort creation')
on_release: root.abort_wallet_creation()
size_hint: 1, None
Widget
size_hint: 1, None
<WizardNewOTPDialog>
message : ''
@@ -618,6 +631,12 @@ class WizardKnownOTPDialog(WizardOTPDialogBase):
self.ids.otp.text = ''
self.ids.next.disabled = not self.ids.cb.active
def abort_wallet_creation(self):
self._on_release = True
os.unlink(self.wizard.storage.path)
self.wizard.terminate()
self.dismiss()
class WizardNewOTPDialog(WizardOTPDialogBase):