From 8294288d7347da37d4ec434a1c11d464bc05e8b4 Mon Sep 17 00:00:00 2001 From: eshanized Date: Wed, 1 Jan 2025 09:21:39 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20chore:=20add=20enhanced=20functi?= =?UTF-8?q?ons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- usr/share/snigdhaos-welcome/snigdhaos-welcome.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/usr/share/snigdhaos-welcome/snigdhaos-welcome.py b/usr/share/snigdhaos-welcome/snigdhaos-welcome.py index eda244d..5bd5841 100644 --- a/usr/share/snigdhaos-welcome/snigdhaos-welcome.py +++ b/usr/share/snigdhaos-welcome/snigdhaos-welcome.py @@ -649,9 +649,14 @@ class Main(Gtk.Window): print(f"[ERROR]: Error in startup_toggle: {e}") def save_settings(self, state): - with open(GUI.Settings, "w") as f: - f.write("autostart=" + str(state)) - f.close() + try: + # Open the settings file in write mode and save the state (autostart) + with open(GUI.Settings, "w") as f: + f.write(f"autostart={state}") + print(f"[INFO]: Settings saved: autostart={state}") + except Exception as e: + # Handle any errors that occur while saving settings + print(f"[ERROR]: Failed to save settings: {e}") def load_settings(self): line = "True"