kivy request_dialog: disable "lightning" btn if no LN part
This commit is contained in:
@@ -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():
|
||||||
|
|||||||
Reference in New Issue
Block a user