Browse Source

qml: add local/remote SCID alias to ChannelDetails

master
Sander van Grieken 2 years ago
parent
commit
d8d2426e83
No known key found for this signature in database
GPG Key ID: 9BCF8209EA402EBA
  1. 24
      electrum/gui/qml/components/ChannelDetails.qml
  2. 11
      electrum/gui/qml/qechanneldetails.py

24
electrum/gui/qml/components/ChannelDetails.qml

@ -212,6 +212,30 @@ Pane {
text: channeldetails.shortCid
}
Label {
text: qsTr('Local SCID alias')
color: Material.accentColor
visible: channeldetails.localScidAlias
}
Label {
Layout.fillWidth: true
text: channeldetails.localScidAlias
visible: channeldetails.localScidAlias
}
Label {
text: qsTr('Remote SCID alias')
color: Material.accentColor
visible: channeldetails.remoteScidAlias
}
Label {
Layout.fillWidth: true
text: channeldetails.remoteScidAlias
visible: channeldetails.remoteScidAlias
}
Label {
visible: !channeldetails.isBackup
text: qsTr('Initiator')

11
electrum/gui/qml/qechanneldetails.py

@ -8,6 +8,7 @@ from electrum.gui import messages
from electrum.logging import get_logger
from electrum.lnutil import LOCAL, REMOTE
from electrum.lnchannel import ChanCloseOption, ChannelState
from electrum.util import format_short_id
from .auth import AuthMixin, auth_protect
from .qewallet import QEWallet
@ -99,6 +100,16 @@ class QEChannelDetails(AuthMixin, QObject, QtEventListener):
def shortCid(self):
return self._channel.short_id_for_GUI()
@pyqtProperty(str, notify=channelChanged)
def localScidAlias(self):
lsa = self._channel.get_local_scid_alias()
return format_short_id(lsa) if lsa else ''
@pyqtProperty(str, notify=channelChanged)
def remoteScidAlias(self):
rsa = self._channel.get_remote_scid_alias()
return format_short_id(rsa) if rsa else ''
@pyqtProperty(str, notify=channelChanged)
def state(self):
return self._channel.get_state_for_GUI()

Loading…
Cancel
Save