qml: fix lifecycle issues with swap helper.
previously tied to Channels view, now dynamically created and parented to app
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user