diff --git a/electrum/gui/qml/components/ChannelDetails.qml b/electrum/gui/qml/components/ChannelDetails.qml index 75b8ab835..ede5a5a97 100644 --- a/electrum/gui/qml/components/ChannelDetails.qml +++ b/electrum/gui/qml/components/ChannelDetails.qml @@ -51,11 +51,13 @@ Pane { } Label { + visible: channeldetails.name text: qsTr('Node name') color: Material.accentColor } Label { + visible: channeldetails.name text: channeldetails.name } diff --git a/electrum/gui/qml/components/CloseChannelDialog.qml b/electrum/gui/qml/components/CloseChannelDialog.qml index a0ee83f6c..1ebae766d 100644 --- a/electrum/gui/qml/components/CloseChannelDialog.qml +++ b/electrum/gui/qml/components/CloseChannelDialog.qml @@ -29,28 +29,51 @@ ElDialog { padding: 0 ColumnLayout { - width: parent.width - height: parent.height + anchors.fill: parent spacing: 0 GridLayout { id: layout - Layout.preferredWidth: parent.width + Layout.preferredWidth: parent.width - 2*constants.paddingLarge Layout.leftMargin: constants.paddingLarge Layout.rightMargin: constants.paddingLarge columns: 2 Label { Layout.fillWidth: true + visible: channeldetails.name text: qsTr('Channel name') color: Material.accentColor } Label { Layout.fillWidth: true + visible: 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 { text: qsTr('Short channel ID') color: Material.accentColor @@ -64,11 +87,16 @@ ElDialog { InfoTextArea { Layout.columnSpan: 2 - Layout.preferredWidth: parent.width * 3/4 - Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: true text: qsTr(channeldetails.message_force_close) } + Label { + text: qsTr('Choose closing method') + Layout.columnSpan: 2 + color: Material.accentColor + } + ColumnLayout { Layout.columnSpan: 2 Layout.alignment: Qt.AlignHCenter @@ -122,7 +150,7 @@ ElDialog { FlatButton { Layout.columnSpan: 2 Layout.fillWidth: true - text: qsTr('Close') + text: qsTr('Close channel') icon.source: '../../icons/closebutton.png' enabled: !closing onClicked: { diff --git a/electrum/gui/qml/components/controls/ChannelDelegate.qml b/electrum/gui/qml/components/controls/ChannelDelegate.qml index 665b6c131..34d6b39c3 100644 --- a/electrum/gui/qml/components/controls/ChannelDelegate.qml +++ b/electrum/gui/qml/components/controls/ChannelDelegate.qml @@ -59,7 +59,7 @@ ItemDelegate { Layout.fillWidth: true Label { Layout.fillWidth: true - text: model.node_alias + text: model.node_alias ? model.node_alias : model.node_id elide: Text.ElideRight wrapMode: Text.Wrap maximumLineCount: 2 diff --git a/electrum/gui/qml/qechanneldetails.py b/electrum/gui/qml/qechanneldetails.py index 216fbd870..935073aee 100644 --- a/electrum/gui/qml/qechanneldetails.py +++ b/electrum/gui/qml/qechanneldetails.py @@ -78,11 +78,11 @@ class QEChannelDetails(QObject, QtEventListener): def name(self): if not self._channel: 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) def pubkey(self): - return self._channel.node_id.hex() #if self._channel else '' + return self._channel.node_id.hex() @pyqtProperty(str, notify=channelChanged) def short_cid(self): diff --git a/electrum/gui/qml/qechannellistmodel.py b/electrum/gui/qml/qechannellistmodel.py index 0f938a997..8e0a0c435 100644 --- a/electrum/gui/qml/qechannellistmodel.py +++ b/electrum/gui/qml/qechannellistmodel.py @@ -67,7 +67,8 @@ class QEChannelListModel(QAbstractListModel, QtEventListener): lnworker = self.wallet.lnworker item = {} 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['state'] = lnc.get_state_for_GUI() item['state_code'] = int(lnc.get_state()) diff --git a/electrum/gui/qml/qetxdetails.py b/electrum/gui/qml/qetxdetails.py index 60e157f38..790cb5460 100644 --- a/electrum/gui/qml/qetxdetails.py +++ b/electrum/gui/qml/qetxdetails.py @@ -2,7 +2,7 @@ from PyQt5.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject from electrum.i18n import _ 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 .qewallet import QEWallet