From 7c2a4a497ada8dddf457f880ceb5b8d0f17e722a Mon Sep 17 00:00:00 2001 From: pathmapper Date: Tue, 28 May 2024 12:31:13 +0200 Subject: [PATCH] Keep selection when changing sort order --- luftbildfinder_nrw.py | 11 ++++++----- metadata.txt | 6 ++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/luftbildfinder_nrw.py b/luftbildfinder_nrw.py index 81123b8..a88fe5c 100644 --- a/luftbildfinder_nrw.py +++ b/luftbildfinder_nrw.py @@ -170,10 +170,9 @@ def updateCheckboxes(): self.checkboxes.clear() for year, date, service, infolayer, layer in sorted_dates: - cb = QCheckBox( - date + " " + service.replace("wms_nw_", ""), dialog - ) - cb.setChecked(current_states.get(date, True)) + checkbox_text = f"{date} {service.replace('wms_nw_', '')}" + cb = QCheckBox(checkbox_text, dialog) + cb.setChecked(current_states.get(checkbox_text, True)) checkboxLayout.addWidget(cb) self.checkboxes.append(cb) @@ -318,7 +317,9 @@ def selected_years(): date_obj = datetime.strptime(date_text, "%Y-%m-%d") elif "." in date_text: date_obj = datetime.strptime(date_text, "%d.%m.%Y") - standardized_date = datetime.strftime(date_obj, "%Y-%m-%d") + standardized_date = datetime.strftime( + date_obj, "%Y-%m-%d" + ) year = standardized_date.split("-")[0] if service == "wms_nw_hist_dop": layer = f"nw_hist_dop_{year}" diff --git a/metadata.txt b/metadata.txt index e5029ed..f3aa0a1 100644 --- a/metadata.txt +++ b/metadata.txt @@ -10,7 +10,7 @@ about=Remark: - iDOP - vDOP tags=dop,idop,vdop,luftbild,luftbilder,nrw -version=0.3.0 +version=0.4.0 qgisMinimumVersion=3.16 author=Kreis Viersen email=open@kreis-viersen.de @@ -24,7 +24,9 @@ icon=luftbildfinder-nrw.png server=False deprecated=False -changelog=v0.3.0: +changelog=v0.4.0: + - behalte Auswahl wenn Sortierreihenfolge geändert wird + v0.3.0 - behebe Fehler bei Option Metadatenlayer v0.2.0: - berücksichtige auch Bilder ohne Angabe von Tag und Monat