diff --git a/electrum/gui/qml/components/ChannelDetails.qml b/electrum/gui/qml/components/ChannelDetails.qml index a4d741b37..fc21cdfcf 100644 --- a/electrum/gui/qml/components/ChannelDetails.qml +++ b/electrum/gui/qml/components/ChannelDetails.qml @@ -100,7 +100,7 @@ Pane { columns: 2 Label { - text: qsTr('Channel name') + text: qsTr('Node name') color: Material.accentColor } diff --git a/electrum/gui/qml/components/ChannelOpenProgressDialog.qml b/electrum/gui/qml/components/ChannelOpenProgressDialog.qml index 79bd403eb..5854dafdd 100644 --- a/electrum/gui/qml/components/ChannelOpenProgressDialog.qml +++ b/electrum/gui/qml/components/ChannelOpenProgressDialog.qml @@ -104,6 +104,7 @@ ElDialog { visible: false iconStyle: InfoTextArea.IconStyle.Error width: parent.width + textFormat: TextEdit.PlainText } InfoTextArea { diff --git a/electrum/gui/qml/components/controls/InfoTextArea.qml b/electrum/gui/qml/components/controls/InfoTextArea.qml index 78bd11c3a..67f194a90 100644 --- a/electrum/gui/qml/components/controls/InfoTextArea.qml +++ b/electrum/gui/qml/components/controls/InfoTextArea.qml @@ -14,6 +14,7 @@ GridLayout { } property int iconStyle: InfoTextArea.IconStyle.Info + property alias textFormat: infotext.textFormat columns: 1 rowSpacing: 0 @@ -31,7 +32,7 @@ GridLayout { readOnly: true rightPadding: constants.paddingLarge leftPadding: 2*constants.iconSizeLarge - wrapMode: TextInput.WordWrap + wrapMode: TextInput.Wrap textFormat: TextEdit.RichText background: Rectangle { color: Qt.rgba(1,1,1,0.05) // whiten 5% diff --git a/electrum/gui/qml/qechannellistmodel.py b/electrum/gui/qml/qechannellistmodel.py index 6a96fdc9d..3d9888cfd 100644 --- a/electrum/gui/qml/qechannellistmodel.py +++ b/electrum/gui/qml/qechannellistmodel.py @@ -39,12 +39,6 @@ class QEChannelListModel(QAbstractListModel, QtEventListener): if wallet == self.wallet: self.on_channel_updated(channel) - # elif event == 'channels_updated': - @qt_event_listener - def on_event_channels_updated(self, wallet): - if wallet == self.wallet: - self.init_model() # TODO: remove/add less crude than full re-init - def on_destroy(self): self.unregister_callbacks() @@ -124,6 +118,7 @@ class QEChannelListModel(QAbstractListModel, QtEventListener): i = i + 1 def do_update(self, modelindex, channel): + self._logger.debug(f'updating our channel {channel.short_id_for_GUI()}') modelitem = self.channels[modelindex] modelitem.update(self.channel_to_model(channel)) diff --git a/electrum/gui/qml/qechannelopener.py b/electrum/gui/qml/qechannelopener.py index 7a44b5eb5..4932f7fe8 100644 --- a/electrum/gui/qml/qechannelopener.py +++ b/electrum/gui/qml/qechannelopener.py @@ -1,7 +1,10 @@ import threading +from concurrent.futures import CancelledError +from asyncio.exceptions import TimeoutError from PyQt5.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject +from electrum.i18n import _ from electrum.gui import messages from electrum.lnutil import extract_nodeid, LNPeerAddr, ln_dummy_address from electrum.lnworker import hardcoded_trampoline_nodes @@ -168,6 +171,7 @@ class QEChannelOpener(QObject, AuthMixin): lnworker = self._wallet.wallet.lnworker def open_thread(): + error = None try: chan, _funding_tx = lnworker.open_channel( connect_str=conn_str, @@ -175,13 +179,19 @@ class QEChannelOpener(QObject, AuthMixin): funding_sat=funding_sat, push_amt_sat=0, password=password) + self._logger.debug('opening channel succeeded') + self.channelOpenSuccess.emit(chan.channel_id.hex(), chan.has_onchain_backup()) + except (CancelledError,TimeoutError): + error = _('Could not connect to channel peer') except Exception as e: - self._logger.exception("Problem opening channel: %s", repr(e)) - self.channelOpenError.emit(repr(e)) - return + error = str(e) + if not error: + error = repr(e) + finally: + if error: + self._logger.exception("Problem opening channel: %s", error) + self.channelOpenError.emit(error) - self._logger.debug('opening channel succeeded') - self.channelOpenSuccess.emit(chan.channel_id.hex(), chan.has_onchain_backup()) self._logger.debug('starting open thread') self.channelOpening.emit(conn_str)