From 24367dfb3ad9d3f99f3f18a23dd044197866503e Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sun, 12 Apr 2026 02:22:06 +1000 Subject: [PATCH] feat: add config load/fail toasts --- modules/ConfigToasts.qml | 31 +++++++++++++++++++++++++++++++ shell.qml | 1 + 2 files changed, 32 insertions(+) create mode 100644 modules/ConfigToasts.qml 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 {