From 7c6566e9a154c4c226a4bedf1c8aaca3cca648b7 Mon Sep 17 00:00:00 2001 From: EKNr1 Date: Tue, 24 Dec 2024 14:10:22 +0100 Subject: [PATCH] Added functionality to the save button. --- wobuzz/gui_communication/settings.py | 5 +++-- wobuzz/ui/settings/settings.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/wobuzz/gui_communication/settings.py b/wobuzz/gui_communication/settings.py index 6c46d71..5026aad 100644 --- a/wobuzz/gui_communication/settings.py +++ b/wobuzz/gui_communication/settings.py @@ -10,9 +10,10 @@ class Settings: self.connect() def connect(self): - self.settings.file_settings.library_path_input.returnPressed.connect(self.write_settings) + self.settings.visibilityChanged.connect(self.update_all) + self.settings.save_button.pressed.connect(self.write_settings) - def update_all(self): + def update_all(self, settings_visible: bool=True): self.settings.file_settings.library_path_input.setText(self.app.settings.library_path) def update_settings(self, key, value): diff --git a/wobuzz/ui/settings/settings.py b/wobuzz/ui/settings/settings.py index c515021..40d22bf 100644 --- a/wobuzz/ui/settings/settings.py +++ b/wobuzz/ui/settings/settings.py @@ -27,8 +27,8 @@ class Settings(QDockWidget): self.tabs.addTab(self.file_settings, "Files") self.content_layout.addWidget(self.tabs) - self.save_settings_button = QPushButton("&Save", self.content) - self.content_layout.addWidget(self.save_settings_button) + self.save_button = QPushButton("&Save", self.content) + self.content_layout.addWidget(self.save_button) self.setWidget(self.content)