This commit is contained in:
Black Hat 2018-10-15 09:01:53 +08:00
parent c77a2535e5
commit 3d104ddccc
3 changed files with 35 additions and 1 deletions

View File

@ -66,6 +66,13 @@ Page {
onCheckedChanged: MSettings.pressAndHold = checked onCheckedChanged: MSettings.pressAndHold = checked
} }
Switch {
text: "Confirm on Exit"
checked: MSettings.confirmOnExit
onCheckedChanged: MSettings.confirmOnExit = checked
}
} }
} }

View File

@ -4,6 +4,7 @@ import Qt.labs.settings 1.0
Settings { Settings {
property bool pressAndHold property bool pressAndHold
property bool confirmOnExit: true
property bool darkTheme property bool darkTheme
property bool miniMode property bool miniMode

View File

@ -336,7 +336,33 @@ ApplicationWindow {
color: "white" 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()
}
} }
} }
} }