Skip to content

Commit 49fd24a

Browse files
committed
Move check to initGui
Moved time zone check to initGui(), removed unnecessary line change from warning message.
1 parent 24159f9 commit 49fd24a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

arho_feature_template/plugin.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,17 @@ def __init__(self) -> None:
4343

4444
self.toolbar = iface.addToolBar("ARHO Toolbar")
4545
self.toolbar.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
46-
self.check_timezone_variable()
4746

4847
def check_timezone_variable(self):
4948
"""Check if PGTZ environment variable is correctly set."""
5049

5150
if os.environ.get("PGTZ") != "Europe/Helsinki":
5251
iface.messageBar().pushWarning(
5352
"Varoitus",
54-
"Ympäristömuuttuja PGTZ ei ole asetettu arvoon 'Europe/Helsinki'.\n"
55-
"Tämä voi johtaa väärään aikavyöhykkeeseen tallennettuihin kellonaikoihin.",
53+
(
54+
"Ympäristömuuttuja PGTZ ei ole asetettu arvoon 'Europe/Helsinki'."
55+
"Tämä voi johtaa väärään aikavyöhykkeeseen tallennettuihin kellonaikoihin."
56+
),
5657
)
5758

5859
def add_action(
@@ -251,6 +252,8 @@ def initGui(self) -> None: # noqa N802
251252
lambda: self.identify_plan_features_action.setChecked(False)
252253
)
253254

255+
self.check_timezone_variable()
256+
254257
def toggle_dock_visibility(self, dock_widget: QgsDockWidget):
255258
if dock_widget.isUserVisible():
256259
dock_widget.hide()

0 commit comments

Comments
 (0)