Add the get auto open diary method to the config manager

This commit is contained in:
Gustavo Henrique Santos Souza de Miranda 2025-07-23 07:18:50 -03:00
parent d9753a375f
commit ed8619fbf9
1 changed files with 5 additions and 0 deletions

View File

@ -46,6 +46,8 @@ class ConfigManager(metaclass=SingletonMeta):
if self.__data["settings"]["diary"]["auto_open_diary_on_startup"] == "": if self.__data["settings"]["diary"]["auto_open_diary_on_startup"] == "":
self.auto_open_diary = None self.auto_open_diary = None
else:
self.auto_open_diary = self.__data["settings"]["diary"]["auto_open_diary_on_startup"]
self.auto_open_new_diary = self.__data["settings"]["diary"]["auto_open_on_creation"] self.auto_open_new_diary = self.__data["settings"]["diary"]["auto_open_on_creation"]
else: else:
print("Error: config.toml not found.") print("Error: config.toml not found.")
@ -103,5 +105,8 @@ class ConfigManager(metaclass=SingletonMeta):
def set_auto_open_diary(self, value: str): def set_auto_open_diary(self, value: str):
self.auto_open_diary = value self.auto_open_diary = value
def get_auto_open_diary(self):
return self.auto_open_diary
def set_auto_open_new_diary(self, value: bool): def set_auto_open_new_diary(self, value: bool):
self.auto_open_new_diary = value self.auto_open_new_diary = value