Skip to content

Commit

Permalink
Use done method on settings dialog to refresh the settings
Browse files Browse the repository at this point in the history
  • Loading branch information
mathPi committed Aug 25, 2024
1 parent 9c390f4 commit d18d60f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/python/main/ayab/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def __init__(self, parent: GuiMain):
for widget in self.__widget.values():
widget.connectChange()
self.__ui.reset.clicked.connect(self.__reset_and_refresh)
self.__ui.enter.clicked.connect(self.__validate_form)
self.__ui.enter.clicked.connect(self.accept)

# update buttons from settings
self.__refresh_form()
Expand Down Expand Up @@ -255,12 +255,14 @@ def __reset_and_refresh(self) -> None:
self.__prefs.reset()
self.__refresh_form()

def __validate_form(self) -> None:
self.accept()

def done(self, arg__1):
"""
Method called to close the dialog.
"""
# call the main GUI to trigger the necessary refresh
parent: GuiMain = self.parent()
parent.refresh_window_preferences_change()
super().done(arg__1)


class PrefsBoolWidget(QCheckBox):
Expand Down

0 comments on commit d18d60f

Please sign in to comment.