1
0

qml: add local/remote SCID alias to ChannelDetails

This commit is contained in:
Sander van Grieken
2023-11-20 13:35:18 +01:00
parent d917c27a31
commit d8d2426e83
2 changed files with 35 additions and 0 deletions

View File

@@ -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')

View File

@@ -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()