feat: add config load/fail toasts

This commit is contained in:
2 * r + 2 * t 2026-04-12 02:22:06 +10:00
parent 72e0a218fd
commit 24367dfb3a
2 changed files with 32 additions and 0 deletions

31
modules/ConfigToasts.qml Normal file
View file

@ -0,0 +1,31 @@
import QtQuick
import Quickshell
import Caelestia
import Caelestia.Config
Scope {
Connections {
function onLoaded(): void {
if (GlobalConfig.utilities.toasts.configLoaded)
Toaster.toast(qsTr("Config loaded"), qsTr("Config loaded successfully!"), "rule_settings");
}
function onLoadFailed(error: string): void {
Toaster.toast(qsTr("Failed to read config file"), error, "settings_alert", Toast.Warning);
}
function onSaveFailed(error: string): void {
Toaster.toast(qsTr("Failed to save config"), error, "settings_alert", Toast.Error);
}
target: GlobalConfig
}
Connections {
function onLoadFailed(error: string): void {
Toaster.toast(qsTr("Failed to read token config file"), error, "settings_alert", Toast.Warning);
}
target: TokenConfig
}
}

View file

@ -19,6 +19,7 @@ ShellRoot {
id: lock
}
ConfigToasts {}
Shortcuts {}
BatteryMonitor {}
IdleMonitors {