Commit 6bfef995 authored by Fushan Wen's avatar Fushan Wen 💬 Committed by Nate Graham
Browse files

desktoppackage: warn on close if there are unsaved settings

CCBUG: 403384
parent 7351e80d
Pipeline #196863 passed with stage
in 3 minutes and 18 seconds
......@@ -33,6 +33,22 @@ Rectangle {
property ConfigModel globalConfigModel: globalAppletConfigModel
function closing() {
if (applyButton.enabled) {
messageDialog.item = null;
messageDialog.open();
return false;
}
return true;
}
Connections {
target: configDialog
function onClosing(event) {
event.accepted = closing();
}
}
ConfigModel {
id: globalAppletConfigModel
ConfigCategory {
......@@ -280,6 +296,7 @@ Rectangle {
if (item) {
root.open(item);
} else {
applyButton.enabled = false;
configDialog.close();
}
}
......@@ -355,13 +372,9 @@ Rectangle {
QQC2.Action {
id: cancelAction
onTriggered: {
if (applyButton.enabled) {
messageDialog.item = null;
messageDialog.open();
return;
if (root.closing()) {
configDialog.close();
}
configDialog.close();
}
shortcut: "Escape"
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment