diff --git a/electrum/gui/qml/components/ChannelOpenProgressDialog.qml b/electrum/gui/qml/components/ChannelOpenProgressDialog.qml index a06d092e7..79bd403eb 100644 --- a/electrum/gui/qml/components/ChannelOpenProgressDialog.qml +++ b/electrum/gui/qml/components/ChannelOpenProgressDialog.qml @@ -27,6 +27,12 @@ ElDialog { property alias error: errorText.text property alias peer: peerText.text + function reset() { + state = '' + errorText.text = '' + peerText.text = '' + } + Item { id: s state: '' @@ -52,6 +58,7 @@ ElDialog { id: content anchors.centerIn: parent width: parent.width + spacing: constants.paddingLarge RowLayout { Layout.alignment: Qt.AlignHCenter @@ -103,6 +110,7 @@ ElDialog { id: infoText visible: false text: qsTr('Channel will be open after 3 confirmations') + width: parent.width } } } diff --git a/electrum/gui/qml/components/OpenChannel.qml b/electrum/gui/qml/components/OpenChannel.qml index 2950284ad..cfb6bf6f6 100644 --- a/electrum/gui/qml/components/OpenChannel.qml +++ b/electrum/gui/qml/components/OpenChannel.qml @@ -157,12 +157,6 @@ Pane { } } - property var channelOpenProgressDialogInstance - Component { - id: channelOpenProgressDialog - ChannelOpenProgressDialog { } - } - ChannelOpener { id: channelopener wallet: Daemon.currentWallet @@ -190,21 +184,22 @@ Pane { } onChannelOpening: { console.log('Channel is opening') - channelOpenProgressDialogInstance = channelOpenProgressDialog.createObject(app, {peer: peer}) - channelOpenProgressDialogInstance.open() + app.channelOpenProgressDialog.reset() + app.channelOpenProgressDialog.peer = peer + app.channelOpenProgressDialog.open() } onChannelOpenError: { - channelOpenProgressDialogInstance.state = 'failed' - channelOpenProgressDialogInstance.error = message + app.channelOpenProgressDialog.state = 'failed' + app.channelOpenProgressDialog.error = message } onChannelOpenSuccess: { var message = 'success!' if (!has_backup) message = message + ' (but no backup. TODO: show QR)' - channelOpenProgressDialogInstance.state = 'success' - channelOpenProgressDialogInstance.error = message + app.channelOpenProgressDialog.state = 'success' + app.channelOpenProgressDialog.error = message channelopener.wallet.channelModel.new_channel(cid) -// app.stack.pop() + app.stack.pop() } } diff --git a/electrum/gui/qml/components/main.qml b/electrum/gui/qml/components/main.qml index 88f1f3f7f..38a5be2ee 100644 --- a/electrum/gui/qml/components/main.qml +++ b/electrum/gui/qml/components/main.qml @@ -186,6 +186,11 @@ ApplicationWindow } } + property alias channelOpenProgressDialog: _channelOpenProgressDialog + ChannelOpenProgressDialog { + id: _channelOpenProgressDialog + } + NotificationPopup { id: notificationPopup }