Browse Source

kivy: show node alias in channels dialog. Rename the menu back to 'Channels'

patch-4
ThomasV 4 years ago
parent
commit
f4fe80dfd1
  1. 2
      electrum/gui/kivy/main.kv
  2. 14
      electrum/gui/kivy/uix/dialogs/lightning_channels.py

2
electrum/gui/kivy/main.kv

@ -461,7 +461,7 @@ BoxLayout:
text: _('Addresses') text: _('Addresses')
ActionOvrButton: ActionOvrButton:
name: 'lightning_channels_dialog' name: 'lightning_channels_dialog'
text: _('Lightning') text: _('Channels')
ActionOvrButton: ActionOvrButton:
name: 'settings' name: 'settings'
text: _('Settings') text: _('Settings')

14
electrum/gui/kivy/uix/dialogs/lightning_channels.py

@ -126,8 +126,8 @@ Builder.load_string(r'''
short_channel_id: '<channelId not set>' short_channel_id: '<channelId not set>'
status: '' status: ''
is_backup: False is_backup: False
local_balance: '' balances: ''
remote_balance: '' node_alias: ''
_chan: None _chan: None
BoxLayout: BoxLayout:
size_hint: 0.7, None size_hint: 0.7, None
@ -143,7 +143,7 @@ Builder.load_string(r'''
CardLabel: CardLabel:
font_size: '13sp' font_size: '13sp'
shorten: True shorten: True
text: root.status text: root.node_alias
Widget Widget
BoxLayout: BoxLayout:
size_hint: 0.3, None size_hint: 0.3, None
@ -152,12 +152,12 @@ Builder.load_string(r'''
orientation: 'vertical' orientation: 'vertical'
Widget Widget
CardLabel: CardLabel:
text: root.local_balance if not root.is_backup else '' text: root.status
font_size: '13sp' font_size: '13sp'
halign: 'right' halign: 'right'
Widget Widget
CardLabel: CardLabel:
text: root.remote_balance if not root.is_backup else '' text: root.balances if not root.is_backup else ''
font_size: '13sp' font_size: '13sp'
halign: 'right' halign: 'right'
Widget Widget
@ -566,8 +566,7 @@ class LightningChannelsDialog(Factory.Popup):
item.status = chan.get_state_for_GUI() item.status = chan.get_state_for_GUI()
item.short_channel_id = chan.short_id_for_GUI() item.short_channel_id = chan.short_id_for_GUI()
l, r = self.format_fields(chan) l, r = self.format_fields(chan)
item.local_balance = _('Local') + ':' + l item.balances = l + '/' + r
item.remote_balance = _('Remote') + ': ' + r
self.update_can_send() self.update_can_send()
def update(self): def update(self):
@ -585,6 +584,7 @@ class LightningChannelsDialog(Factory.Popup):
item.active = not i.is_closed() item.active = not i.is_closed()
item.is_backup = i.is_backup() item.is_backup = i.is_backup()
item._chan = i item._chan = i
item.node_alias = lnworker.get_node_alias(i.node_id)
self.update_item(item) self.update_item(item)
channel_cards.add_widget(item) channel_cards.add_widget(item)
self.update_can_send() self.update_can_send()

Loading…
Cancel
Save