From d4aeeaf541915402efbc4eef5f49e2ab508b957c Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 31 Mar 2023 18:35:46 +0200 Subject: [PATCH] follow-up c98b9e8d7b58002c8d45799293fbbd394ae31de3 (unintended deletion) --- electrum/gui/qml/components/Channels.qml | 54 ++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/electrum/gui/qml/components/Channels.qml b/electrum/gui/qml/components/Channels.qml index c186b7cf1..c75661bed 100644 --- a/electrum/gui/qml/components/Channels.qml +++ b/electrum/gui/qml/components/Channels.qml @@ -117,6 +117,60 @@ Pane { } } + ButtonContainer { + Layout.fillWidth: true + FlatButton { + Layout.fillWidth: true + Layout.preferredWidth: 1 + text: qsTr('Swap'); + visible: Daemon.currentWallet.lightningCanSend.satsInt > 0 || Daemon.currentWallet.lightningCanReceive.satInt > 0 + icon.source: Qt.resolvedUrl('../../icons/update.png') + onClicked: { + var swaphelper = app.swaphelper.createObject(app) + swaphelper.swapStarted.connect(function() { + var dialog = swapProgressDialog.createObject(app, { swaphelper: swaphelper }) + dialog.open() + }) + var dialog = swapDialog.createObject(root, { swaphelper: swaphelper }) + dialog.open() + } + } + + FlatButton { + Layout.fillWidth: true + Layout.preferredWidth: 1 + text: qsTr('Open Channel') + onClicked: { + var dialog = openChannelDialog.createObject(root) + dialog.open() + } + icon.source: '../../icons/lightning.png' + } + + } + + } + + Component { + id: swapDialog + SwapDialog { + onClosed: destroy() + } + } + + Component { + id: swapProgressDialog + SwapProgressDialog { + onClosed: destroy() + } + } + + Component { + id: openChannelDialog + OpenChannelDialog { + onClosed: destroy() + } + } Component { id: importChannelBackupDialog