🧹 chore: add enhanced functions

This commit is contained in:
eshanized
2025-01-01 09:21:39 +05:30
parent 50f258f36f
commit 8294288d73

View File

@@ -649,9 +649,14 @@ class Main(Gtk.Window):
print(f"[ERROR]: Error in startup_toggle: {e}") print(f"[ERROR]: Error in startup_toggle: {e}")
def save_settings(self, state): def save_settings(self, state):
try:
# Open the settings file in write mode and save the state (autostart)
with open(GUI.Settings, "w") as f: with open(GUI.Settings, "w") as f:
f.write("autostart=" + str(state)) f.write(f"autostart={state}")
f.close() 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): def load_settings(self):
line = "True" line = "True"