kivy: Show lightning balance. Remove 'unmatured', 'unconfirmed'
from info dialog, as this is visible in history.
This commit is contained in:
@@ -877,7 +877,8 @@ class ElectrumWindow(App):
|
||||
self.fiat_balance = status
|
||||
else:
|
||||
c, u, x = self.wallet.get_balance()
|
||||
text = self.format_amount(c+x+u)
|
||||
l = int(self.wallet.lnworker.get_balance()) if self.wallet.lnworker else 0
|
||||
text = self.format_amount(c + x + u + l)
|
||||
self.balance = str(text.strip()) + ' [size=22dp]%s[/size]'% self.base_unit
|
||||
self.fiat_balance = self.fx.format_amount(c+u+x) + ' [size=22dp]%s[/size]'% self.fx.ccy
|
||||
|
||||
|
||||
@@ -3,10 +3,12 @@ Popup:
|
||||
confirmed: 0
|
||||
unconfirmed: 0
|
||||
unmatured: 0
|
||||
lightning: 0
|
||||
watching_only: app.wallet.is_watching_only()
|
||||
has_seed: app.wallet.has_seed()
|
||||
on_parent:
|
||||
self.confirmed, self.unconfirmed, self.unmatured = app.wallet.get_balance()
|
||||
self.lightning = int(app.wallet.lnworker.get_balance()) if app.wallet.lnworker else 0
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
ScrollView:
|
||||
@@ -34,21 +36,16 @@ Popup:
|
||||
value: (_('Enabled') if app.wallet.has_lightning() else _('Disabled')) if app.wallet.can_have_lightning() else _('Not available')
|
||||
BoxLabel:
|
||||
text: _("Balance") + ':'
|
||||
value: app.format_amount_and_units(root.confirmed + root.unconfirmed + root.unmatured + root.lightning)
|
||||
BoxLabel:
|
||||
text: _("Onchain") + ':'
|
||||
value: app.format_amount_and_units(root.confirmed + root.unconfirmed + root.unmatured)
|
||||
opacity: 1 if root.lightning else 0
|
||||
BoxLabel:
|
||||
text: _("Confirmed") + ':'
|
||||
opacity: 1 if root.confirmed else 0
|
||||
value: app.format_amount_and_units(root.confirmed)
|
||||
opacity: 1 if root.confirmed else 0
|
||||
BoxLabel:
|
||||
text: _("Unconfirmed") + ':'
|
||||
opacity: 1 if root.unconfirmed else 0
|
||||
value: app.format_amount_and_units(root.unconfirmed)
|
||||
BoxLabel:
|
||||
text: _("Unmatured") + ':'
|
||||
opacity: 1 if root.unmatured else 0
|
||||
value: app.format_amount_and_units(root.unmatured)
|
||||
opacity: 1 if root.unmatured else 0
|
||||
text: _("Lightning") + ':'
|
||||
opacity: 1 if root.lightning else 0
|
||||
value: app.format_amount_and_units(root.lightning)
|
||||
|
||||
|
||||
GridLayout:
|
||||
cols: 1
|
||||
|
||||
Reference in New Issue
Block a user