feat: add config load/fail toasts
This commit is contained in:
parent
72e0a218fd
commit
24367dfb3a
2 changed files with 32 additions and 0 deletions
31
modules/ConfigToasts.qml
Normal file
31
modules/ConfigToasts.qml
Normal 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
|
||||
}
|
||||
}
|
||||
|
|
@ -19,6 +19,7 @@ ShellRoot {
|
|||
id: lock
|
||||
}
|
||||
|
||||
ConfigToasts {}
|
||||
Shortcuts {}
|
||||
BatteryMonitor {}
|
||||
IdleMonitors {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue