mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 01:11:35 +00:00
kivy: fix create_restore dialog
This commit is contained in:
parent
1843d29d60
commit
cb6ebcf7d1
2 changed files with 34 additions and 24 deletions
|
@ -35,6 +35,14 @@ Builder.load_string('''
|
||||||
size_hint_y: None
|
size_hint_y: None
|
||||||
height: '48sp'
|
height: '48sp'
|
||||||
|
|
||||||
|
<CreateAccountButton@Button>:
|
||||||
|
root: None
|
||||||
|
size_hint: 1, None
|
||||||
|
height: '48sp'
|
||||||
|
on_press: if self.root: self.root.dispatch('on_press', self)
|
||||||
|
on_release: if self.root: self.root.dispatch('on_release', self)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<-CreateAccountDialog>
|
<-CreateAccountDialog>
|
||||||
text_color: .854, .925, .984, 1
|
text_color: .854, .925, .984, 1
|
||||||
|
@ -130,11 +138,11 @@ Builder.load_string('''
|
||||||
spacing: '14dp'
|
spacing: '14dp'
|
||||||
size_hint: 1, None
|
size_hint: 1, None
|
||||||
height: self.minimum_height
|
height: self.minimum_height
|
||||||
CreateAccountButtonGreen:
|
CreateAccountButton:
|
||||||
id: create
|
id: create
|
||||||
text: _('Create a Wallet')
|
text: _('Create a Wallet')
|
||||||
root: root
|
root: root
|
||||||
CreateAccountButtonBlue:
|
CreateAccountButton:
|
||||||
id: restore
|
id: restore
|
||||||
text: _('I already have a wallet')
|
text: _('I already have a wallet')
|
||||||
root: root
|
root: root
|
||||||
|
@ -174,11 +182,11 @@ Builder.load_string('''
|
||||||
spacing: '12dp'
|
spacing: '12dp'
|
||||||
size_hint: 1, None
|
size_hint: 1, None
|
||||||
height: self.minimum_height
|
height: self.minimum_height
|
||||||
CreateAccountButtonBlue:
|
CreateAccountButton:
|
||||||
id: back
|
id: back
|
||||||
text: _('Back')
|
text: _('Back')
|
||||||
root: root
|
root: root
|
||||||
CreateAccountButtonGreen:
|
CreateAccountButton:
|
||||||
id: next
|
id: next
|
||||||
text: _('Next')
|
text: _('Next')
|
||||||
root: root
|
root: root
|
||||||
|
@ -235,11 +243,11 @@ Builder.load_string('''
|
||||||
spacing: '12dp'
|
spacing: '12dp'
|
||||||
size_hint: 1, None
|
size_hint: 1, None
|
||||||
height: self.minimum_height
|
height: self.minimum_height
|
||||||
CreateAccountButtonBlue:
|
CreateAccountButton:
|
||||||
id: back
|
id: back
|
||||||
text: _('Back')
|
text: _('Back')
|
||||||
root: root
|
root: root
|
||||||
CreateAccountButtonGreen:
|
CreateAccountButton:
|
||||||
id: confirm
|
id: confirm
|
||||||
text: _('Confirm')
|
text: _('Confirm')
|
||||||
root: root
|
root: root
|
||||||
|
@ -296,12 +304,12 @@ Builder.load_string('''
|
||||||
spacing: '12dp'
|
spacing: '12dp'
|
||||||
size_hint: 1, None
|
size_hint: 1, None
|
||||||
height: self.minimum_height
|
height: self.minimum_height
|
||||||
CreateAccountButtonBlue:
|
CreateAccountButton:
|
||||||
id: back
|
id: back
|
||||||
text: _('Back')
|
text: _('Back')
|
||||||
root: root
|
root: root
|
||||||
disabled: True if root.mode[0] == 'r' else self.disabled
|
disabled: True if root.mode[0] == 'r' else self.disabled
|
||||||
CreateAccountButtonGreen:
|
CreateAccountButton:
|
||||||
id: next
|
id: next
|
||||||
text: _('Confirm') if root.mode[0] == 'r' else _('Next')
|
text: _('Confirm') if root.mode[0] == 'r' else _('Next')
|
||||||
root: root
|
root: root
|
||||||
|
@ -350,13 +358,13 @@ class CreateRestoreDialog(CreateAccountDialog):
|
||||||
self.ids.but_close.disabled = True
|
self.ids.but_close.disabled = True
|
||||||
self.ids.but_close.opacity = 0
|
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)
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
app = App.get_running_app()
|
app = App.get_running_app()
|
||||||
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(CreateRestoreDialog, self).close()
|
super(CreateRestoreDialog, self).close()
|
||||||
|
|
||||||
|
|
||||||
|
@ -389,7 +397,7 @@ class ChangePasswordDialog(CreateAccountDialog):
|
||||||
stepper.source = 'atlas://gui/kivy/theming/light/stepper_left'
|
stepper.source = 'atlas://gui/kivy/theming/light/stepper_left'
|
||||||
self._back = _back = partial(self.ids.back.dispatch, 'on_release')
|
self._back = _back = partial(self.ids.back.dispatch, 'on_release')
|
||||||
app = App.get_running_app()
|
app = App.get_running_app()
|
||||||
app.navigation_higherarchy.append(_back)
|
#app.navigation_higherarchy.append(_back)
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
ids = self.ids
|
ids = self.ids
|
||||||
|
@ -402,9 +410,9 @@ class ChangePasswordDialog(CreateAccountDialog):
|
||||||
ids.ti_confirm_password.text = ""
|
ids.ti_confirm_password.text = ""
|
||||||
ids.ti_confirm_password.focus = False
|
ids.ti_confirm_password.focus = False
|
||||||
app = App.get_running_app()
|
app = App.get_running_app()
|
||||||
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(ChangePasswordDialog, self).close()
|
super(ChangePasswordDialog, self).close()
|
||||||
|
|
||||||
|
|
||||||
|
@ -431,13 +439,13 @@ class InitSeedDialog(CreateAccountDialog):
|
||||||
stepper.opacity = 1
|
stepper.opacity = 1
|
||||||
stepper.source = 'atlas://gui/kivy/theming/light/stepper_full'
|
stepper.source = 'atlas://gui/kivy/theming/light/stepper_full'
|
||||||
self._back = _back = partial(self.ids.back.dispatch, 'on_release')
|
self._back = _back = partial(self.ids.back.dispatch, 'on_release')
|
||||||
app.navigation_higherarchy.append(_back)
|
#app.navigation_higherarchy.append(_back)
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
app = App.get_running_app()
|
app = App.get_running_app()
|
||||||
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(InitSeedDialog, self).close()
|
||||||
|
|
||||||
|
|
||||||
|
@ -464,7 +472,7 @@ class RestoreSeedDialog(CreateAccountDialog):
|
||||||
self._back = _back = partial(self.ids.back.dispatch,
|
self._back = _back = partial(self.ids.back.dispatch,
|
||||||
'on_release')
|
'on_release')
|
||||||
app = App.get_running_app()
|
app = App.get_running_app()
|
||||||
app.navigation_higherarchy.append(_back)
|
#app.navigation_higherarchy.append(_back)
|
||||||
|
|
||||||
def on_key_down(self, keyboard, keycode, key, modifiers):
|
def on_key_down(self, keyboard, keycode, key, modifiers):
|
||||||
if keycode[0] in (13, 271):
|
if keycode[0] in (13, 271):
|
||||||
|
@ -487,7 +495,7 @@ class RestoreSeedDialog(CreateAccountDialog):
|
||||||
def close(self):
|
def close(self):
|
||||||
self._remove_keyboard()
|
self._remove_keyboard()
|
||||||
app = App.get_running_app()
|
app = App.get_running_app()
|
||||||
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(RestoreSeedDialog, self).close()
|
super(RestoreSeedDialog, self).close()
|
||||||
|
|
|
@ -134,6 +134,8 @@ class HistoryScreen(CScreen):
|
||||||
yield (conf, icon, time_str, label, v_str, balance_str, tx_hash, quote_text)
|
yield (conf, icon, time_str, label, v_str, balance_str, tx_hash, quote_text)
|
||||||
|
|
||||||
def update(self, see_all=False):
|
def update(self, see_all=False):
|
||||||
|
if self.app.wallet is None:
|
||||||
|
return
|
||||||
|
|
||||||
history_card = self.screen.ids.recent_activity_card
|
history_card = self.screen.ids.recent_activity_card
|
||||||
history = self.parse_history(reversed(
|
history = self.parse_history(reversed(
|
||||||
|
|
Loading…
Add table
Reference in a new issue