kivy wizard: simplifications and renaming

This commit is contained in:
ThomasV 2016-01-16 09:30:11 +01:00
parent 1144afefb5
commit 06809917ca
2 changed files with 5 additions and 25 deletions

View File

@ -58,18 +58,6 @@ Builder.load_string('''
crcontent: crcontent
# 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:
orientation: 'vertical' if self.width < self.height else 'horizontal'
padding:
@ -190,7 +178,7 @@ Builder.load_string('''
root: root
<InitSeedDialog>
<ShowSeedDialog>
spacing: '12dp'
GridLayout:
id: grid
@ -293,8 +281,6 @@ class CreateRestoreDialog(CreateAccountDialog):
def on_parent(self, instance, value):
if value:
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')
#app.navigation_higherarchy.append(_back)
@ -307,13 +293,7 @@ class CreateRestoreDialog(CreateAccountDialog):
class InitSeedDialog(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'...
'''
class ShowSeedDialog(CreateAccountDialog):
seed_msg = StringProperty('')
'''Text to be displayed in the TextInput'''
@ -337,7 +317,7 @@ class InitSeedDialog(CreateAccountDialog):
#if self._back in app.navigation_higherarchy:
# app.navigation_higherarchy.pop()
# self._back = None
super(InitSeedDialog, self).close()
super(ShowSeedDialog, self).close()
class RestoreSeedDialog(CreateAccountDialog):

View File

@ -130,7 +130,7 @@ class InstallWizard(Widget):
self.waiting_dialog(task, msg)
def create(self):
from create_restore import InitSeedDialog
from create_restore import ShowSeedDialog
seed = self.wallet.make_seed()
msg = _("[color=#414141]"+\
"[b]PLEASE WRITE DOWN YOUR SEED PASS[/b][/color]"+\
@ -146,7 +146,7 @@ class InstallWizard(Widget):
self.run('enter_pin', seed)
else:
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):
from password_dialog import PasswordDialog