Fix #82.
This commit is contained in:
parent
c77a2535e5
commit
3d104ddccc
|
@ -66,6 +66,13 @@ Page {
|
|||
|
||||
onCheckedChanged: MSettings.pressAndHold = checked
|
||||
}
|
||||
|
||||
Switch {
|
||||
text: "Confirm on Exit"
|
||||
checked: MSettings.confirmOnExit
|
||||
|
||||
onCheckedChanged: MSettings.confirmOnExit = checked
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import Qt.labs.settings 1.0
|
|||
|
||||
Settings {
|
||||
property bool pressAndHold
|
||||
property bool confirmOnExit: true
|
||||
|
||||
property bool darkTheme
|
||||
property bool miniMode
|
||||
|
|
28
qml/main.qml
28
qml/main.qml
|
@ -336,7 +336,33 @@ ApplicationWindow {
|
|||
color: "white"
|
||||
}
|
||||
|
||||
onClicked: Qt.quit()
|
||||
onClicked: MSettings.confirmOnExit ? confirmExitDialog.open() : Qt.quit()
|
||||
|
||||
Dialog {
|
||||
x: (window.width - width) / 2
|
||||
y: (window.height - height) / 2
|
||||
width: 360
|
||||
|
||||
id: confirmExitDialog
|
||||
|
||||
parent: ApplicationWindow.overlay
|
||||
|
||||
title: "Exit"
|
||||
modal: true
|
||||
standardButtons: Dialog.Ok | Dialog.Cancel
|
||||
|
||||
contentItem: Column {
|
||||
Label { text: "Exit?" }
|
||||
CheckBox {
|
||||
text: "Do not ask next time"
|
||||
checked: !MSettings.confirmOnExit
|
||||
|
||||
onCheckedChanged: MSettings.confirmOnExit = !checked
|
||||
}
|
||||
}
|
||||
|
||||
onAccepted: Qt.quit()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue