fix: refresh settings data when navigating to settings view
Extract data loading into a refresh() method on SettingsView and call it on view switch so categories, rules, and household data stay current. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -65,6 +65,8 @@ class MainWindow(QMainWindow):
|
||||
|
||||
def _switch_view(self, key: str):
|
||||
self.stack.setCurrentIndex(self._views[key])
|
||||
if key == "settings":
|
||||
self._settings_view.refresh()
|
||||
|
||||
def _apply_theme(self, theme: str):
|
||||
qss_path = Path(__file__).parent / "themes" / f"{theme}.qss"
|
||||
|
||||
@@ -39,6 +39,10 @@ class SettingsView(QWidget):
|
||||
self._build_csv_mappings_tab()
|
||||
|
||||
# Initial data load
|
||||
self.refresh()
|
||||
|
||||
def refresh(self):
|
||||
"""Reload all settings data from the database."""
|
||||
self._load_categories()
|
||||
self._load_rules()
|
||||
self._load_household()
|
||||
|
||||
Reference in New Issue
Block a user