2024-12-24 12:13:24 +01:00
|
|
|
#!/usr/bin/python3
|
|
|
|
|
|
|
|
|
|
|
|
class Settings:
|
|
|
|
def __init__(self, app):
|
|
|
|
self.app = app
|
|
|
|
|
|
|
|
self.settings = self.app.gui.window.settings
|
|
|
|
|
|
|
|
self.connect()
|
|
|
|
|
|
|
|
def connect(self):
|
2024-12-24 14:10:22 +01:00
|
|
|
self.settings.visibilityChanged.connect(self.update_all)
|
|
|
|
self.settings.save_button.pressed.connect(self.write_settings)
|
2024-12-24 12:13:24 +01:00
|
|
|
|
2024-12-24 17:22:30 +01:00
|
|
|
def update_all(self, _=True): # ignore visible parameter passed by visibilityChanged event
|
2024-12-24 12:13:24 +01:00
|
|
|
self.settings.file_settings.library_path_input.setText(self.app.settings.library_path)
|
|
|
|
|
|
|
|
def update_settings(self, key, value):
|
|
|
|
match key:
|
|
|
|
case "library_path":
|
|
|
|
self.settings.file_settings.library_path_input.setText(value)
|
|
|
|
|
|
|
|
def write_settings(self):
|
|
|
|
self.app.settings.library_path = self.settings.file_settings.library_path_input.text()
|
|
|
|
|