From 3bbb66ec32183bb51f580ffae5ecf08cc6fbf661 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 15 Jul 2026 15:27:24 +0200 Subject: [PATCH] shape-Ladefunktion Verfahrensgebiet --- functions/dialog_wrapper.py | 46 +++++++++++++++++++++++++++++++++++++ metadata.txt | 13 +++++++++++ 2 files changed, 59 insertions(+) create mode 100644 metadata.txt diff --git a/functions/dialog_wrapper.py b/functions/dialog_wrapper.py index 57bd248..16090a0 100644 --- a/functions/dialog_wrapper.py +++ b/functions/dialog_wrapper.py @@ -232,6 +232,52 @@ def ask_detailpruefung_oder_vg_laden( return "abbrechen" +def ask_detailpruefung_oder_abbrechen( + parent: Any, + title: str, + message: str, +) -> Literal["detailpruefung", "abbrechen"]: + """Zeigt Dialog mit zwei Optionen nach erkannter Flächenabweichung (Shape-Workflow). + + Optionen: + - **Detailprüfung starten**: Knickpunktbasierte Prüfung des Shape-VG-Umrings + - **Abbrechen**: Vorgang beenden, Shape-Verfahrensgebiet unverändert behalten + + Parameters + ---------- + parent : + Eltern-Widget oder None. + title : str + Dialog-Titel. + message : str + Hauptmeldung mit Flächen-Informationen. + + Returns + ------- + Literal["detailpruefung", "abbrechen"] + Genaue Entscheidung des Nutzers. + """ + if QT_VERSION == 0: # Mock-Modus + print(f"Mock-Modus: ask_detailpruefung_oder_abbrechen('{title}') → abbrechen") + return "abbrechen" + + msg = QMessageBox(parent) + msg.setIcon(ICON_QUESTION) + msg.setWindowTitle(title) + msg.setText(message) + + detail_btn = msg.addButton("Detailprüfung starten", QMessageBox.ButtonRole.AcceptRole) + msg.addButton("Abbrechen", QMessageBox.ButtonRole.RejectRole) + + exec_dialog(msg) + + clicked = msg.clickedButton() + if clicked == detail_btn: + return "detailpruefung" + else: + return "abbrechen" + + class ProgressDialog: def __init__(self, total: int, title: str = "Fortschritt", label: str = "Verarbeite..."): self.total = max(total, 1) diff --git a/metadata.txt b/metadata.txt new file mode 100644 index 0000000..fcabbf3 --- /dev/null +++ b/metadata.txt @@ -0,0 +1,13 @@ +[general] +version=26.7.2-testing +name=LNO Sachsen | Plugin Basisfunktionen +description=Plugin mit Basisfunktionen +author=Daniel Helbig, Michael Otto +homepage=https://entwicklung.flurneuordnung-sachsen.de/AG_QGIS/Plugin_SN_Basis +tracker=https://entwicklung.flurneuordnung-sachsen.de/AG_QGIS/Plugin_SN_Basis/issues +repository=https://entwicklung.flurneuordnung-sachsen.de/AG_QGIS/Plugin_SN_Basis/src/branch/testing/ +QGISMaximumVersion=4.99 +qgisMinimumVersion=3.40 +experimental=true +deprecated=false +supportsQt6=true \ No newline at end of file