diff --git a/functions/dialog_wrapper.py b/functions/dialog_wrapper.py index f86413e..6a5ddc7 100644 --- a/functions/dialog_wrapper.py +++ b/functions/dialog_wrapper.py @@ -39,6 +39,20 @@ def ask_yes_no( return default +def show_info_dialog(title: str, message: str, parent: Any = None) -> None: + """ + Zeigt einen modalen Info-Dialog mit OK-Button. + Blockiert bis der Nutzer bestätigt. + """ + try: + if QT_VERSION == 0: # Mock-Modus + print(f"Mock-Modus: show_info_dialog('{title}')") + return + QMessageBox.information(parent, title, message) + except Exception as e: + print(f"⚠️ show_info_dialog Fehler: {e}") + + OverwriteDecision = Optional[Literal["overwrite", "append", "cancel"]] diff --git a/modules/Pruefmanager.py b/modules/Pruefmanager.py index aa979d4..c1c124e 100644 --- a/modules/Pruefmanager.py +++ b/modules/Pruefmanager.py @@ -56,6 +56,20 @@ class Pruefmanager: ) info("DataGrabber Zusammenfassung", message) + # ------------------------------------------------------------------ + # Allgemeine Nutzerinteraktionen + # ------------------------------------------------------------------ + def zeige_hinweis(self, titel: str, meldung: str) -> None: + """Zeigt eine modale Hinweismeldung mit OK-Button.""" + from sn_basis.functions.dialog_wrapper import show_info_dialog + show_info_dialog(titel, meldung, parent=self.parent) + + def frage_ja_nein(self, titel: str, meldung: str, default: bool = True) -> bool: + """Stellt eine Ja/Nein-Frage. Gibt True zurück, wenn der Nutzer Ja wählt.""" + if self.ui_modus != "qgis": + return default + return ask_yes_no(titel, meldung, default=default, parent=self.parent) + # ------------------------------------------------------------------ # VERFAHRENS-DB-spezifische Entscheidungen # ------------------------------------------------------------------