From 0fd0703dbb3fbac44c4598f9fb4202f9891aa22a Mon Sep 17 00:00:00 2001 From: Vitali Graf Date: Sun, 1 Feb 2026 15:51:50 +0100 Subject: [PATCH] Feature: Expand-Status beim Projektwechsel automatisch speichern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - open_existing_project() speichert nun das vorherige Projekt vor dem Wechsel - Expand-Status der aufgeklappten Tree-Knoten bleibt beim Projektwechsel erhalten - Umfassendes Logging für Debugging - Fehlerbehandlung für robuste Ausführung --- src/ui/MainWindow.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ui/MainWindow.py b/src/ui/MainWindow.py index 8ef64c0..e711fdb 100644 --- a/src/ui/MainWindow.py +++ b/src/ui/MainWindow.py @@ -257,6 +257,15 @@ class MainWindow( logger.info(f"Öffne Projekt: {project.name}") logger.debug(f"Projekt-Ordner: {project.project_dir}") + # Speichere vorheriges Projekt inkl. Expand-Status (falls vorhanden) + if hasattr(self, "project") and self.project and hasattr(self, "pdf_project") and self.pdf_project: + try: + logger.info(f"Speichere vorheriges Projekt: {self.project.name}") + self._save_project_settings() + logger.info("Vorheriges Projekt erfolgreich gespeichert") + except Exception as e: + logger.error(f"Fehler beim Speichern des vorherigen Projekts: {e}") + self.project = project try: