Browse Source

kivy request_dialog: disable "lightning" btn if no LN part

patch-4
SomberNight 3 years ago
parent
commit
5f5e6b3cf3
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 3
      electrum/gui/kivy/uix/dialogs/request_dialog.py

3
electrum/gui/kivy/uix/dialogs/request_dialog.py

@ -31,6 +31,7 @@ Builder.load_string('''
status_color: 1,1,1,1 status_color: 1,1,1,1
shaded: False shaded: False
show_text: False show_text: False
has_lightning: False
AnchorLayout: AnchorLayout:
anchor_x: 'center' anchor_x: 'center'
BoxLayout: BoxLayout:
@ -72,6 +73,7 @@ Builder.load_string('''
height: '48dp' height: '48dp'
text: _('Lightning') text: _('Lightning')
on_release: root.mode = root.MODE_LIGHTNING on_release: root.mode = root.MODE_LIGHTNING
disabled: not root.has_lightning
TopLabel: TopLabel:
text: _('Description') + ': ' + root.description or _('None') text: _('Description') + ': ' + root.description or _('None')
TopLabel: TopLabel:
@ -160,6 +162,7 @@ class RequestDialog(Factory.Popup):
self.status = self.app.wallet.get_request_status(self.key) self.status = self.app.wallet.get_request_status(self.key)
self.status_str = req.get_status_str(self.status) self.status_str = req.get_status_str(self.status)
self.status_color = pr_color[self.status] self.status_color = pr_color[self.status]
self.has_lightning = req.is_lightning()
warning = '' warning = ''
if self.status == PR_UNPAID and self.mode == self.MODE_LIGHTNING and self.app.wallet.lnworker: if self.status == PR_UNPAID and self.mode == self.MODE_LIGHTNING and self.app.wallet.lnworker:
if self.amount_sat and self.amount_sat > self.app.wallet.lnworker.num_sats_can_receive(): if self.amount_sat and self.amount_sat > self.app.wallet.lnworker.num_sats_can_receive():

Loading…
Cancel
Save