diff --git a/po_runner.py b/po_runner.py index e52e96b..a6a7719 100644 --- a/po_runner.py +++ b/po_runner.py @@ -13,6 +13,10 @@ from .po_modules.po_stations import PoStationReader from .po_modules.po_stations_qgs import PoStationReaderQgs from .po_modules.po_waterlevels_reader_qgs import PoWaterlevelReaderQgs +STATIONS_QML = "styles/stations.qml" + +WATERLEVELS_QML = "styles/waterlevels.qml" + class PoRunner(object): @@ -134,10 +138,8 @@ class PoRunner(object): if self.stations is None: return - file = "styles/stations.qml" - if self.ui.rbStationsStyleSimple == button: - self._layer_apply_style_from_file(self.stations, file) + self._layer_apply_style_from_file(self.stations, STATIONS_QML) return elif self.ui.rbStationsStyleAgency == button: field = "agency" @@ -145,11 +147,11 @@ class PoRunner(object): field = "water" else: print("_bgStationsStyle_clicked: Style nicht implementiert: %s" % (button.objectName(),)) - self._layer_apply_style_from_file(self.stations, file) + self._layer_apply_style_from_file(self.stations, STATIONS_QML) return self._stations_update_labels() - self._layer_apply_style_per_category(self.stations, field, file) + self._layer_apply_style_per_category(self.stations, field, STATIONS_QML) def _cbStationsVisible_toggled(self): visible = self.ui.cbStationsVisible.isChecked() @@ -240,9 +242,8 @@ class PoRunner(object): if self.waterlevels is None: return - file = "styles/waterlevels.qml" if self.ui.rbWaterlevelsStyleSimple == button: - self._layer_apply_style_from_file(self.waterlevels, file) + self._layer_apply_style_from_file(self.waterlevels, WATERLEVELS_QML) return elif self.ui.rbWaterlevelsStyleAgency == button: field = "agency" @@ -254,11 +255,11 @@ class PoRunner(object): field = "absolute" else: print("_bgWaterlevelsStyle_clicked: Style nicht implementiert: %s" % (button.objectName(),)) - self._layer_apply_style_from_file(self.waterlevels, file) + self._layer_apply_style_from_file(self.waterlevels, WATERLEVELS_QML) return self._waterlevels_update_labels() - self._layer_apply_style_per_category(self.waterlevels, field, file) + self._layer_apply_style_per_category(self.waterlevels, field, WATERLEVELS_QML) def _cbWaterlevelsVisible_toggled(self): visible = self.ui.cbWaterlevelsVisible.isChecked()