From 9fd5d402e1105c733f5c9614460e1b77ba479938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Carrillo?= Date: Tue, 21 May 2024 09:03:22 -0500 Subject: [PATCH] Take filters that don't have a config dialog into account when initializing it --- swiss_locator/gui/config_dialog.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/swiss_locator/gui/config_dialog.py b/swiss_locator/gui/config_dialog.py index 5939e81..6e26eed 100644 --- a/swiss_locator/gui/config_dialog.py +++ b/swiss_locator/gui/config_dialog.py @@ -54,11 +54,12 @@ def __init__(self, parent=None): self.lang.addItem(key, val) for filter_type in FilterType: cb = self.findChild(QComboBox, "{}_priority".format(filter_type.value)) - cb.addItem(self.tr("Highest"), QgsLocatorFilter.Highest) - cb.addItem(self.tr("High"), QgsLocatorFilter.High) - cb.addItem(self.tr("Medium"), QgsLocatorFilter.Medium) - cb.addItem(self.tr("Low"), QgsLocatorFilter.Low) - cb.addItem(self.tr("Lowest"), QgsLocatorFilter.Lowest) + if cb is not None: # Some filters might not have a config dialog + cb.addItem(self.tr("Highest"), QgsLocatorFilter.Highest) + cb.addItem(self.tr("High"), QgsLocatorFilter.High) + cb.addItem(self.tr("Medium"), QgsLocatorFilter.Medium) + cb.addItem(self.tr("Low"), QgsLocatorFilter.Low) + cb.addItem(self.tr("Lowest"), QgsLocatorFilter.Lowest) self.crs.addItem( self.tr("Use map CRS if possible, defaults to CH1903+"), "project"