kivy+qt: add channel type to details
This commit is contained in:
@@ -246,6 +246,7 @@ Builder.load_string(r'''
|
|||||||
warning: ''
|
warning: ''
|
||||||
is_frozen_for_sending: False
|
is_frozen_for_sending: False
|
||||||
is_frozen_for_receiving: False
|
is_frozen_for_receiving: False
|
||||||
|
channel_type:''
|
||||||
BoxLayout:
|
BoxLayout:
|
||||||
padding: '12dp', '12dp', '12dp', '12dp'
|
padding: '12dp', '12dp', '12dp', '12dp'
|
||||||
spacing: '12dp'
|
spacing: '12dp'
|
||||||
@@ -294,6 +295,9 @@ Builder.load_string(r'''
|
|||||||
BoxLabel:
|
BoxLabel:
|
||||||
text: _('Frozen (for receiving)')
|
text: _('Frozen (for receiving)')
|
||||||
value: str(root.is_frozen_for_receiving)
|
value: str(root.is_frozen_for_receiving)
|
||||||
|
BoxLabel:
|
||||||
|
text: _('Channel type')
|
||||||
|
value: str(root.channel_type)
|
||||||
Widget:
|
Widget:
|
||||||
size_hint: 1, 0.1
|
size_hint: 1, 0.1
|
||||||
TopLabel:
|
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.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_sending = chan.is_frozen_for_sending()
|
||||||
self.is_frozen_for_receiving = chan.is_frozen_for_receiving()
|
self.is_frozen_for_receiving = chan.is_frozen_for_receiving()
|
||||||
|
self.channel_type = chan.storage['channel_type'].name_minimal
|
||||||
self.update_action_dropdown()
|
self.update_action_dropdown()
|
||||||
|
|
||||||
def update_action_dropdown(self):
|
def update_action_dropdown(self):
|
||||||
|
|||||||
@@ -193,6 +193,7 @@ class ChannelDetailsDialog(QtWidgets.QDialog, MessageBoxMixin):
|
|||||||
form_layout.addRow(_('Remote dust limit:'), self.dust_limit)
|
form_layout.addRow(_('Remote dust limit:'), self.dust_limit)
|
||||||
self.remote_reserve = self.window.format_amount_and_units(chan.config[REMOTE].reserve_sat)
|
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(_('Remote reserve:'), SelectableLabel(self.remote_reserve))
|
||||||
|
form_layout.addRow(_('Channel type:'), SelectableLabel(chan.storage['channel_type'].name_minimal))
|
||||||
vbox.addLayout(form_layout)
|
vbox.addLayout(form_layout)
|
||||||
|
|
||||||
# add htlc tree view to vbox (wouldn't scale correctly in QFormLayout)
|
# add htlc tree view to vbox (wouldn't scale correctly in QFormLayout)
|
||||||
|
|||||||
@@ -1153,6 +1153,10 @@ class ChannelType(IntFlag):
|
|||||||
byte_length = bit_length // 8 + int(bool(bit_length % 8))
|
byte_length = bit_length // 8 + int(bool(bit_length % 8))
|
||||||
return self.to_bytes(byte_length, byteorder='big')
|
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
|
del LNFC # name is ambiguous without context
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user