qml: since qeswaphelper is tied to SwapDialog anyway, let's make it a direct child
This commit is contained in:
@@ -365,9 +365,29 @@ ApplicationWindow
|
|||||||
Component {
|
Component {
|
||||||
id: swapDialog
|
id: swapDialog
|
||||||
SwapDialog {
|
SwapDialog {
|
||||||
onClosed: {
|
onClosed: destroy()
|
||||||
swaphelper.destroy()
|
swaphelper: SwapHelper {
|
||||||
destroy()
|
id: _swaphelper
|
||||||
|
wallet: Daemon.currentWallet
|
||||||
|
onConfirm: {
|
||||||
|
var dialog = app.messageDialog.createObject(app, {text: message, yesno: true})
|
||||||
|
dialog.accepted.connect(function() {
|
||||||
|
_swaphelper.executeSwap(true)
|
||||||
|
})
|
||||||
|
dialog.open()
|
||||||
|
}
|
||||||
|
onAuthRequired: {
|
||||||
|
app.handleAuthRequired(_swaphelper, method)
|
||||||
|
}
|
||||||
|
onError: {
|
||||||
|
var dialog = app.messageDialog.createObject(app, { text: message })
|
||||||
|
dialog.open()
|
||||||
|
}
|
||||||
|
onSwapStarted: {
|
||||||
|
// swapdialog.close()
|
||||||
|
var progressdialog = swapProgressDialog.createObject(app, { swaphelper: swaphelper })
|
||||||
|
progressdialog.open()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -392,29 +412,6 @@ 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.accepted.connect(function() {
|
|
||||||
__swaphelper.executeSwap(true)
|
|
||||||
})
|
|
||||||
dialog.open()
|
|
||||||
}
|
|
||||||
onAuthRequired: {
|
|
||||||
app.handleAuthRequired(__swaphelper, method)
|
|
||||||
}
|
|
||||||
onError: {
|
|
||||||
var dialog = app.messageDialog.createObject(app, { text: message })
|
|
||||||
dialog.open()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
coverTimer.start()
|
coverTimer.start()
|
||||||
|
|
||||||
@@ -591,13 +588,7 @@ ApplicationWindow
|
|||||||
}
|
}
|
||||||
|
|
||||||
function startSwap() {
|
function startSwap() {
|
||||||
var swaphelper = app.swaphelper.createObject(app)
|
var swapdialog = swapDialog.createObject(app)
|
||||||
var swapdialog = swapDialog.createObject(app, { swaphelper: swaphelper })
|
|
||||||
swaphelper.swapStarted.connect(function() {
|
|
||||||
swapdialog.close()
|
|
||||||
var progressdialog = swapProgressDialog.createObject(app, { swaphelper: swaphelper })
|
|
||||||
progressdialog.open()
|
|
||||||
})
|
|
||||||
swapdialog.open()
|
swapdialog.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user