qml: confirm close electrum dialog instead of double-tap back button
This commit is contained in:
@@ -30,6 +30,8 @@ ApplicationWindow
|
|||||||
|
|
||||||
property variant activeDialogs: []
|
property variant activeDialogs: []
|
||||||
|
|
||||||
|
property bool _wantClose: false
|
||||||
|
|
||||||
header: ToolBar {
|
header: ToolBar {
|
||||||
id: toolbar
|
id: toolbar
|
||||||
|
|
||||||
@@ -302,23 +304,25 @@ ApplicationWindow
|
|||||||
stack.pop()
|
stack.pop()
|
||||||
} else {
|
} else {
|
||||||
// destroy most GUI components so that we don't dump so many null reference warnings on exit
|
// destroy most GUI components so that we don't dump so many null reference warnings on exit
|
||||||
if (closeMsgTimer.running) {
|
if (app._wantClose) {
|
||||||
app.header.visible = false
|
app.header.visible = false
|
||||||
mainStackView.clear()
|
mainStackView.clear()
|
||||||
} else {
|
} else {
|
||||||
notificationPopup.show('Press Back again to exit')
|
var dialog = app.messageDialog.createObject(app, {
|
||||||
closeMsgTimer.start()
|
text: qsTr('Close Electrum?'),
|
||||||
|
yesno: true
|
||||||
|
})
|
||||||
|
dialog.yesClicked.connect(function() {
|
||||||
|
dialog.close()
|
||||||
|
app._wantClose = true
|
||||||
|
app.close()
|
||||||
|
})
|
||||||
|
dialog.open()
|
||||||
close.accepted = false
|
close.accepted = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: closeMsgTimer
|
|
||||||
interval: 5000
|
|
||||||
repeat: false
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: Daemon
|
target: Daemon
|
||||||
function onWalletRequiresPassword() {
|
function onWalletRequiresPassword() {
|
||||||
|
|||||||
Reference in New Issue
Block a user