Browse Source

qml: confirm close electrum dialog instead of double-tap back button

master
Sander van Grieken 3 years ago
parent
commit
d2bab4d51a
  1. 22
      electrum/gui/qml/components/main.qml

22
electrum/gui/qml/components/main.qml

@ -30,6 +30,8 @@ ApplicationWindow
property variant activeDialogs: []
property bool _wantClose: false
header: ToolBar {
id: toolbar
@ -302,23 +304,25 @@ ApplicationWindow
stack.pop()
} else {
// 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
mainStackView.clear()
} else {
notificationPopup.show('Press Back again to exit')
closeMsgTimer.start()
var dialog = app.messageDialog.createObject(app, {
text: qsTr('Close Electrum?'),
yesno: true
})
dialog.yesClicked.connect(function() {
dialog.close()
app._wantClose = true
app.close()
})
dialog.open()
close.accepted = false
}
}
}
Timer {
id: closeMsgTimer
interval: 5000
repeat: false
}
Connections {
target: Daemon
function onWalletRequiresPassword() {

Loading…
Cancel
Save