|
1 | 1 | from __future__ import annotations
|
2 | 2 |
|
3 |
| -import os |
4 | 3 | from typing import TYPE_CHECKING, Callable, cast
|
5 | 4 |
|
6 | 5 | from qgis.PyQt.QtCore import QCoreApplication, Qt, QTranslator
|
|
16 | 15 | from arho_feature_template.qgis_plugin_tools.tools.i18n import setup_translation
|
17 | 16 | from arho_feature_template.qgis_plugin_tools.tools.resources import plugin_name
|
18 | 17 | from arho_feature_template.utils.db_utils import get_existing_database_connection_names
|
19 |
| -from arho_feature_template.utils.misc_utils import PLUGIN_PATH |
20 | 18 |
|
21 | 19 | if TYPE_CHECKING:
|
22 | 20 | from qgis.gui import QgisInterface, QgsMapTool
|
@@ -129,39 +127,41 @@ def initGui(self) -> None: # noqa N802
|
129 | 127 | self.templater = FeatureTemplater()
|
130 | 128 | self.new_plan = NewPlan()
|
131 | 129 |
|
132 |
| - plan_icon_path = os.path.join(PLUGIN_PATH, "resources/icons/city.png") # A placeholder icon |
133 |
| - load_icon_path = os.path.join(PLUGIN_PATH, "resources/icons/folder.png") # A placeholder icon |
| 130 | + # plan_icon_path = os.path.join(PLUGIN_PATH, "resources/icons/city.png") # A placeholder icon |
| 131 | + # load_icon_path = os.path.join(PLUGIN_PATH, "resources/icons/folder.png") # A placeholder icon |
134 | 132 |
|
135 | 133 | iface.addDockWidget(Qt.RightDockWidgetArea, self.templater.template_dock)
|
136 | 134 | self.templater.template_dock.visibilityChanged.connect(self.dock_visibility_changed)
|
137 | 135 |
|
138 | 136 | iface.mapCanvas().mapToolSet.connect(self.templater.digitize_map_tool.deactivate)
|
139 | 137 |
|
140 | 138 | # Add main plugin action to the toolbar
|
141 |
| - self.template_dock_action = self.add_action( |
142 |
| - "", |
143 |
| - "Feature Templates", |
144 |
| - None, |
145 |
| - toggled_callback=self.toggle_template_dock, |
146 |
| - checkable=True, |
147 |
| - add_to_menu=True, |
148 |
| - add_to_toolbar=True, |
149 |
| - ) |
150 |
| - |
151 | 139 | self.new_land_use_plan_action = self.add_action(
|
152 |
| - plan_icon_path, |
153 |
| - "Create New Land Use Plan", |
| 140 | + "", |
| 141 | + "Luo uusi kaava", |
154 | 142 | self.add_new_plan,
|
155 | 143 | add_to_menu=True,
|
156 | 144 | add_to_toolbar=True,
|
157 |
| - status_tip="Create a new land use plan", |
| 145 | + status_tip="Luo uusi kaava", |
158 | 146 | )
|
159 | 147 |
|
160 | 148 | self.load_land_use_plan_action = self.add_action(
|
161 |
| - load_icon_path, |
162 |
| - text="Load existing land use plan", |
| 149 | + "", |
| 150 | + text="Lataa/avaa kaavaa", |
163 | 151 | triggered_callback=self.load_existing_land_use_plan,
|
164 | 152 | parent=iface.mainWindow(),
|
| 153 | + add_to_menu=True, |
| 154 | + add_to_toolbar=True, |
| 155 | + status_tip="Lataa/avaa kaava", |
| 156 | + ) |
| 157 | + |
| 158 | + self.template_dock_action = self.add_action( |
| 159 | + "", |
| 160 | + "Kaavatemplaatit", |
| 161 | + None, |
| 162 | + toggled_callback=self.toggle_template_dock, |
| 163 | + checkable=True, |
| 164 | + add_to_menu=True, |
165 | 165 | add_to_toolbar=True,
|
166 | 166 | )
|
167 | 167 |
|
|
0 commit comments