1
0

kivy+qt: add channel type to details

This commit is contained in:
bitromortac
2022-01-18 14:37:49 +01:00
parent db86aeb83a
commit c203ce083a
3 changed files with 10 additions and 0 deletions

View File

@@ -246,6 +246,7 @@ Builder.load_string(r'''
warning: ''
is_frozen_for_sending: False
is_frozen_for_receiving: False
channel_type:''
BoxLayout:
padding: '12dp', '12dp', '12dp', '12dp'
spacing: '12dp'
@@ -294,6 +295,9 @@ Builder.load_string(r'''
BoxLabel:
text: _('Frozen (for receiving)')
value: str(root.is_frozen_for_receiving)
BoxLabel:
text: _('Channel type')
value: str(root.channel_type)
Widget:
size_hint: 1, 0.1
TopLabel:
@@ -484,6 +488,7 @@ class ChannelDetailsPopup(Popup, Logger):
self.warning = '' if self.app.wallet.lnworker.channel_db or self.app.wallet.lnworker.is_trampoline_peer(chan.node_id) else _('Warning') + ': ' + msg
self.is_frozen_for_sending = chan.is_frozen_for_sending()
self.is_frozen_for_receiving = chan.is_frozen_for_receiving()
self.channel_type = chan.storage['channel_type'].name_minimal
self.update_action_dropdown()
def update_action_dropdown(self):

View File

@@ -193,6 +193,7 @@ class ChannelDetailsDialog(QtWidgets.QDialog, MessageBoxMixin):
form_layout.addRow(_('Remote dust limit:'), self.dust_limit)
self.remote_reserve = self.window.format_amount_and_units(chan.config[REMOTE].reserve_sat)
form_layout.addRow(_('Remote reserve:'), SelectableLabel(self.remote_reserve))
form_layout.addRow(_('Channel type:'), SelectableLabel(chan.storage['channel_type'].name_minimal))
vbox.addLayout(form_layout)
# add htlc tree view to vbox (wouldn't scale correctly in QFormLayout)

View File

@@ -1153,6 +1153,10 @@ class ChannelType(IntFlag):
byte_length = bit_length // 8 + int(bool(bit_length % 8))
return self.to_bytes(byte_length, byteorder='big')
@property
def name_minimal(self):
return self.name.replace('OPTION_', '')
del LNFC # name is ambiguous without context