Browse Source

kivy wizard: simplifications and renaming

283
ThomasV 9 years ago
parent
commit
06809917ca
  1. 26
      gui/kivy/uix/dialogs/create_restore.py
  2. 4
      gui/kivy/uix/dialogs/installwizard.py

26
gui/kivy/uix/dialogs/create_restore.py

@ -58,18 +58,6 @@ Builder.load_string('''
crcontent: crcontent crcontent: crcontent
# add electrum icon # add electrum icon
FloatLayout:
size_hint: None, None
size: 0, 0
IconButton:
id: but_close
size_hint: None, None
size: '27dp', '27dp'
top: Window.height - dp(10)
right: Window.width - dp(10)
source: 'atlas://gui/kivy/theming/light/closebutton'
on_release: root.dispatch('on_press', self)
on_release: root.dispatch('on_release', self)
BoxLayout: BoxLayout:
orientation: 'vertical' if self.width < self.height else 'horizontal' orientation: 'vertical' if self.width < self.height else 'horizontal'
padding: padding:
@ -190,7 +178,7 @@ Builder.load_string('''
root: root root: root
<InitSeedDialog> <ShowSeedDialog>
spacing: '12dp' spacing: '12dp'
GridLayout: GridLayout:
id: grid id: grid
@ -293,8 +281,6 @@ class CreateRestoreDialog(CreateAccountDialog):
def on_parent(self, instance, value): def on_parent(self, instance, value):
if value: if value:
app = App.get_running_app() app = App.get_running_app()
self.ids.but_close.disabled = True
self.ids.but_close.opacity = 0
self._back = _back = partial(app.dispatch, 'on_back') self._back = _back = partial(app.dispatch, 'on_back')
#app.navigation_higherarchy.append(_back) #app.navigation_higherarchy.append(_back)
@ -307,13 +293,7 @@ class CreateRestoreDialog(CreateAccountDialog):
class InitSeedDialog(CreateAccountDialog): class ShowSeedDialog(CreateAccountDialog):
mode = StringProperty('create')
''' Defines the mode for which to optimize the UX. defaults to 'create'.
Can be one of: 'create', 'restore', 'create_2of2', 'create_2fa'...
'''
seed_msg = StringProperty('') seed_msg = StringProperty('')
'''Text to be displayed in the TextInput''' '''Text to be displayed in the TextInput'''
@ -337,7 +317,7 @@ class InitSeedDialog(CreateAccountDialog):
#if self._back in app.navigation_higherarchy: #if self._back in app.navigation_higherarchy:
# app.navigation_higherarchy.pop() # app.navigation_higherarchy.pop()
# self._back = None # self._back = None
super(InitSeedDialog, self).close() super(ShowSeedDialog, self).close()
class RestoreSeedDialog(CreateAccountDialog): class RestoreSeedDialog(CreateAccountDialog):

4
gui/kivy/uix/dialogs/installwizard.py

@ -130,7 +130,7 @@ class InstallWizard(Widget):
self.waiting_dialog(task, msg) self.waiting_dialog(task, msg)
def create(self): def create(self):
from create_restore import InitSeedDialog from create_restore import ShowSeedDialog
seed = self.wallet.make_seed() seed = self.wallet.make_seed()
msg = _("[color=#414141]"+\ msg = _("[color=#414141]"+\
"[b]PLEASE WRITE DOWN YOUR SEED PASS[/b][/color]"+\ "[b]PLEASE WRITE DOWN YOUR SEED PASS[/b][/color]"+\
@ -146,7 +146,7 @@ class InstallWizard(Widget):
self.run('enter_pin', seed) self.run('enter_pin', seed)
else: else:
self.run('new') self.run('new')
InitSeedDialog(message=msg, seed_msg=seed, on_release=on_ok, mode='create').open() ShowSeedDialog(message=msg, seed_msg=seed, on_release=on_ok).open()
def enter_pin(self, seed): def enter_pin(self, seed):
from password_dialog import PasswordDialog from password_dialog import PasswordDialog

Loading…
Cancel
Save