aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/appearance/Hyprsunset.qml
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/modules/appearance/Hyprsunset.qml')
-rw-r--r--desktop/modules/appearance/Hyprsunset.qml13
1 files changed, 9 insertions, 4 deletions
diff --git a/desktop/modules/appearance/Hyprsunset.qml b/desktop/modules/appearance/Hyprsunset.qml
index 4befcb5..daf07b0 100644
--- a/desktop/modules/appearance/Hyprsunset.qml
+++ b/desktop/modules/appearance/Hyprsunset.qml
@@ -35,6 +35,9 @@ Singleton {
property string cachePathRaw: "~/.config/hyprsunset-qt/sun.json"
property string cachePath: `${home}/.config/hyprsunset-qt/sun.json`
property string notice: ""
+ // The last save's outcome, for the SaveBar: notice is location detection.
+ property string saveNotice: ""
+ property string saveError: ""
property string sunSummary: ""
property bool busy: false
property bool confLoaded: false
@@ -160,6 +163,7 @@ profile {
}
function refresh() {
+ root.saveError = "";
confProc.running = false;
confProc.running = true;
appProc.running = false;
@@ -241,13 +245,13 @@ profile {
function save() {
if (!root.confLoaded || !root.appLoaded) return;
for (const p of root.profiles) {
- if (!root.validTime(p.time)) { root.notice = `invalid time: ${p.time}`; return; }
+ if (!root.validTime(p.time)) { root.saveError = `invalid time: ${p.time}`; return; }
if (p.temperature !== null && p.temperature !== undefined &&
!root.validTemperature(p.temperature)) {
- root.notice = `invalid temperature: ${p.temperature}`; return;
+ root.saveError = `invalid temperature: ${p.temperature}`; return;
}
if (p.gamma !== null && p.gamma !== undefined && !root.validGamma(p.gamma)) {
- root.notice = `invalid gamma: ${p.gamma}`; return;
+ root.saveError = `invalid gamma: ${p.gamma}`; return;
}
}
root.savedConf = root.serializeProfiles(root.profiles);
@@ -255,7 +259,8 @@ profile {
confFile.setText(root.savedConf);
root.saveSettings();
root.restart();
- root.notice = "saved + restarted";
+ root.saveError = "";
+ root.saveNotice = "saved + restarted";
}
// Live preview via the daemon's IPC. Identity wins, then temperature, then