kivy wallet info screen: handle "show seed" for watch-only/no-seed case

For a watch-only wallet, previously a superfluous dummy "Tap to show"
box was shown.
For a has no seed stored (but not watch-only) wallet (e.g. bip39/xprv/imported_privkeys),
the "show seed" option was there and it raised an uncaught exception.
This commit is contained in:
SomberNight 2020-03-02 06:12:24 +01:00
parent d4fc73e2b4
commit 387c2a1acd
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9
2 changed files with 6 additions and 2 deletions

View file

@ -148,6 +148,9 @@
font_size: '6pt'
name: ''
data: ''
visible: True
opacity: 1 if self.visible else 0
disabled: not self.visible
text: self.data if self.data else _('Tap to show')
touched: False
padding: '10dp', '10dp'

View file

@ -63,12 +63,13 @@ Popup:
data: app.wallet.get_master_public_key() or 'None'
name: _('Master Public Key')
TopLabel:
text: _('This wallet is watching-only') if root.watching_only else _('Seed')
text: _('This wallet is watching-only') if root.watching_only else (_('Seed') if root.has_seed else _('No seed stored for wallet'))
RefLabel:
id: seed_label
visible: root.has_seed
data: ''
name: _('Seed')
on_touched: if not self.data and not root.watching_only: app.show_seed(seed_label)
on_touched: if not self.data and root.has_seed: app.show_seed(seed_label)
BoxLayout:
size_hint: 1, None