qml: add is_imported attribute to channel list item, show different icon
if channel backup is imported
This commit is contained in:
@@ -37,7 +37,9 @@ ItemDelegate {
|
||||
Image {
|
||||
id: walleticon
|
||||
source: model.is_backup
|
||||
? '../../../icons/nocloud.png'
|
||||
? model.is_imported
|
||||
? '../../../icons/nocloud.png'
|
||||
: '../../../icons/lightning_disconnected.png'
|
||||
: model.is_trampoline
|
||||
? '../../../icons/kangaroo.png'
|
||||
: '../../../icons/lightning.png'
|
||||
|
||||
@@ -17,7 +17,7 @@ class QEChannelListModel(QAbstractListModel, QtEventListener):
|
||||
_ROLE_NAMES=('cid','state','state_code','initiator','capacity','can_send',
|
||||
'can_receive','l_csv_delay','r_csv_delay','send_frozen','receive_frozen',
|
||||
'type','node_id','node_alias','short_cid','funding_tx','is_trampoline',
|
||||
'is_backup')
|
||||
'is_backup', 'is_imported')
|
||||
_ROLE_KEYS = range(Qt.UserRole, Qt.UserRole + len(_ROLE_NAMES))
|
||||
_ROLE_MAP = dict(zip(_ROLE_KEYS, [bytearray(x.encode()) for x in _ROLE_NAMES]))
|
||||
_ROLE_RMAP = dict(zip(_ROLE_NAMES, _ROLE_KEYS))
|
||||
@@ -86,9 +86,11 @@ class QEChannelListModel(QAbstractListModel, QtEventListener):
|
||||
if lnc.is_backup():
|
||||
item['can_send'] = QEAmount()
|
||||
item['can_receive'] = QEAmount()
|
||||
item['is_imported'] = lnc.is_imported
|
||||
else:
|
||||
item['can_send'] = QEAmount(amount_msat=lnc.available_to_spend(LOCAL))
|
||||
item['can_receive'] = QEAmount(amount_msat=lnc.available_to_spend(REMOTE))
|
||||
item['is_imported'] = False
|
||||
return item
|
||||
|
||||
numOpenChannelsChanged = pyqtSignal()
|
||||
|
||||
Reference in New Issue
Block a user