qml: only show channel peer node name if known, add node pubkey to ChannelCloseDialog
This commit is contained in:
@@ -51,11 +51,13 @@ Pane {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
visible: channeldetails.name
|
||||||
text: qsTr('Node name')
|
text: qsTr('Node name')
|
||||||
color: Material.accentColor
|
color: Material.accentColor
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
visible: channeldetails.name
|
||||||
text: channeldetails.name
|
text: channeldetails.name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,28 +29,51 @@ ElDialog {
|
|||||||
padding: 0
|
padding: 0
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
width: parent.width
|
anchors.fill: parent
|
||||||
height: parent.height
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
id: layout
|
id: layout
|
||||||
Layout.preferredWidth: parent.width
|
Layout.preferredWidth: parent.width - 2*constants.paddingLarge
|
||||||
Layout.leftMargin: constants.paddingLarge
|
Layout.leftMargin: constants.paddingLarge
|
||||||
Layout.rightMargin: constants.paddingLarge
|
Layout.rightMargin: constants.paddingLarge
|
||||||
columns: 2
|
columns: 2
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
visible: channeldetails.name
|
||||||
text: qsTr('Channel name')
|
text: qsTr('Channel name')
|
||||||
color: Material.accentColor
|
color: Material.accentColor
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
visible: channeldetails.name
|
||||||
text: channeldetails.name
|
text: channeldetails.name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr('Remote node ID')
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
color: Material.accentColor
|
||||||
|
}
|
||||||
|
|
||||||
|
TextHighlightPane {
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
Layout.fillWidth: true
|
||||||
|
padding: 0
|
||||||
|
leftPadding: constants.paddingSmall
|
||||||
|
|
||||||
|
Label {
|
||||||
|
width: parent.width
|
||||||
|
text: channeldetails.pubkey
|
||||||
|
font.pixelSize: constants.fontSizeLarge
|
||||||
|
font.family: FixedFont
|
||||||
|
Layout.fillWidth: true
|
||||||
|
wrapMode: Text.Wrap
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: qsTr('Short channel ID')
|
text: qsTr('Short channel ID')
|
||||||
color: Material.accentColor
|
color: Material.accentColor
|
||||||
@@ -64,11 +87,16 @@ ElDialog {
|
|||||||
|
|
||||||
InfoTextArea {
|
InfoTextArea {
|
||||||
Layout.columnSpan: 2
|
Layout.columnSpan: 2
|
||||||
Layout.preferredWidth: parent.width * 3/4
|
Layout.fillWidth: true
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
text: qsTr(channeldetails.message_force_close)
|
text: qsTr(channeldetails.message_force_close)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr('Choose closing method')
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
color: Material.accentColor
|
||||||
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
Layout.columnSpan: 2
|
Layout.columnSpan: 2
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
@@ -122,7 +150,7 @@ ElDialog {
|
|||||||
FlatButton {
|
FlatButton {
|
||||||
Layout.columnSpan: 2
|
Layout.columnSpan: 2
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: qsTr('Close')
|
text: qsTr('Close channel')
|
||||||
icon.source: '../../icons/closebutton.png'
|
icon.source: '../../icons/closebutton.png'
|
||||||
enabled: !closing
|
enabled: !closing
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ ItemDelegate {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Label {
|
Label {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: model.node_alias
|
text: model.node_alias ? model.node_alias : model.node_id
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
maximumLineCount: 2
|
maximumLineCount: 2
|
||||||
|
|||||||
@@ -78,11 +78,11 @@ class QEChannelDetails(QObject, QtEventListener):
|
|||||||
def name(self):
|
def name(self):
|
||||||
if not self._channel:
|
if not self._channel:
|
||||||
return
|
return
|
||||||
return self._wallet.wallet.lnworker.get_node_alias(self._channel.node_id) or self._channel.node_id.hex()
|
return self._wallet.wallet.lnworker.get_node_alias(self._channel.node_id) or ''
|
||||||
|
|
||||||
@pyqtProperty(str, notify=channelChanged)
|
@pyqtProperty(str, notify=channelChanged)
|
||||||
def pubkey(self):
|
def pubkey(self):
|
||||||
return self._channel.node_id.hex() #if self._channel else ''
|
return self._channel.node_id.hex()
|
||||||
|
|
||||||
@pyqtProperty(str, notify=channelChanged)
|
@pyqtProperty(str, notify=channelChanged)
|
||||||
def short_cid(self):
|
def short_cid(self):
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ class QEChannelListModel(QAbstractListModel, QtEventListener):
|
|||||||
lnworker = self.wallet.lnworker
|
lnworker = self.wallet.lnworker
|
||||||
item = {}
|
item = {}
|
||||||
item['cid'] = lnc.channel_id.hex()
|
item['cid'] = lnc.channel_id.hex()
|
||||||
item['node_alias'] = lnworker.get_node_alias(lnc.node_id) or lnc.node_id.hex()
|
item['node_id'] = lnc.node_id.hex()
|
||||||
|
item['node_alias'] = lnworker.get_node_alias(lnc.node_id) or ''
|
||||||
item['short_cid'] = lnc.short_id_for_GUI()
|
item['short_cid'] = lnc.short_id_for_GUI()
|
||||||
item['state'] = lnc.get_state_for_GUI()
|
item['state'] = lnc.get_state_for_GUI()
|
||||||
item['state_code'] = int(lnc.get_state())
|
item['state_code'] = int(lnc.get_state())
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ from PyQt5.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject
|
|||||||
|
|
||||||
from electrum.i18n import _
|
from electrum.i18n import _
|
||||||
from electrum.logging import get_logger
|
from electrum.logging import get_logger
|
||||||
from electrum.util import format_time
|
from electrum.util import format_time, AddTransactionException
|
||||||
from electrum.transaction import tx_from_any
|
from electrum.transaction import tx_from_any
|
||||||
|
|
||||||
from .qewallet import QEWallet
|
from .qewallet import QEWallet
|
||||||
|
|||||||
Reference in New Issue
Block a user