1
0

qml: fix lifecycle issues with swap helper.

previously tied to Channels view, now dynamically created and parented to app
This commit is contained in:
Sander van Grieken
2023-02-16 13:24:23 +01:00
parent fa45e1b7ba
commit 15d73daf8d
5 changed files with 53 additions and 35 deletions

View File

@@ -7,6 +7,8 @@ import QtQuick.Controls.Material.impl 2.12
import QtQml 2.6
import QtMultimedia 5.6
import org.electrum 1.0
import "controls"
ApplicationWindow
@@ -274,6 +276,30 @@ ApplicationWindow
}
}
property alias swaphelper: _swaphelper
Component {
id: _swaphelper
SwapHelper {
id: __swaphelper
wallet: Daemon.currentWallet
onConfirm: {
var dialog = app.messageDialog.createObject(app, {text: message, yesno: true})
dialog.yesClicked.connect(function() {
dialog.close()
__swaphelper.executeSwap(true)
})
dialog.open()
}
onAuthRequired: {
app.handleAuthRequired(__swaphelper, method)
}
onError: {
var dialog = app.messageDialog.createObject(app, { text: message })
dialog.open()
}
}
}
Component.onCompleted: {
coverTimer.start()