From 44331a078a054647dc32b17574baa8123550bc1f Mon Sep 17 00:00:00 2001 From: Tim Sutton Date: Thu, 21 Nov 2024 09:31:34 +0000 Subject: [PATCH] Disable CRS check box if project is in EPSG 4326 Fixes #624 --- geest/gui/panels/create_project_panel.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/geest/gui/panels/create_project_panel.py b/geest/gui/panels/create_project_panel.py index 544a679..9e0c791 100644 --- a/geest/gui/panels/create_project_panel.py +++ b/geest/gui/panels/create_project_panel.py @@ -70,6 +70,17 @@ def initUI(self): self.load_boundary_button.clicked.connect(self.load_boundary) self.progress_bar.setVisible(False) + # If the project CRS is EPGS:4326, disable the checkbox + project_crs = QgsProject.instance().crs().authid() + log_message(f"Project CRS: {project_crs}") + if project_crs == "EPSG:4326" or project_crs == "": + log_message( + "Project CRS is EPSG:4326 or blank, disabling boundary CRS checkbox" + ) + self.use_boundary_crs.setEnabled(False) + else: + log_message("Project CRS is not EPSG:4326, enabling boundary CRS checkbox") + self.use_boundary_crs.setEnabled(True) def on_previous_button_clicked(self): self.switch_to_previous_tab.emit()