diff --git a/modules/ConfigToasts.qml b/modules/ConfigToasts.qml new file mode 100644 index 00000000..7c43e522 --- /dev/null +++ b/modules/ConfigToasts.qml @@ -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 + } +} diff --git a/shell.qml b/shell.qml index 7ef1014d..5ccf61d3 100644 --- a/shell.qml +++ b/shell.qml @@ -19,6 +19,7 @@ ShellRoot { id: lock } + ConfigToasts {} Shortcuts {} BatteryMonitor {} IdleMonitors {