diff options
Diffstat (limited to 'appearance/Hyprsunset.qml')
| -rw-r--r-- | appearance/Hyprsunset.qml | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/appearance/Hyprsunset.qml b/appearance/Hyprsunset.qml index ea389fd..f488e96 100644 --- a/appearance/Hyprsunset.qml +++ b/appearance/Hyprsunset.qml @@ -36,6 +36,8 @@ Singleton { property string notice: "" property string sunSummary: "" property bool busy: false + property bool confLoaded: false + property bool appLoaded: false readonly property string header: "# Managed by hyprsunset-qt. Edits here are overwritten on save.\n" @@ -160,7 +162,12 @@ profile { Process { id: confProc command: ["cat", root.confPath] - stdout: StdioCollector { onStreamFinished: root.profiles = root.parseProfiles(text) } + stdout: StdioCollector { + onStreamFinished: { + root.profiles = root.parseProfiles(text); + root.confLoaded = true; + } + } } // hyprsunset-qt's own settings: location + daemon command. @@ -194,6 +201,7 @@ profile { root.cachePathRaw = c["cache.path"] ?? "~/.config/hyprsunset-qt/sun.json"; root.cachePath = root.expandTilde(root.cachePathRaw); root.daemonCommand = c["daemon.command"] ?? "hyprsunset"; + root.appLoaded = true; } } } @@ -216,6 +224,7 @@ 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 (p.temperature !== null && p.temperature !== undefined && |
