Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Käyttöliittymä suomeksi #59

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions arho_feature_template/gui/template_dock.ui
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Feature Templates</string>
<string>Kaavakohteiden ja -määräysten templaatit</string>
</property>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QVBoxLayout" name="verticalLayout">
Expand Down Expand Up @@ -45,7 +45,7 @@
<item>
<widget class="QLabel" name="txt_tip">
<property name="text">
<string>TextLabel</string>
<string/>
</property>
</widget>
</item>
Expand All @@ -56,7 +56,7 @@
<customwidget>
<class>QgsFilterLineEdit</class>
<extends>QLineEdit</extends>
<header>qgis.gui</header>
<header>qgsfilterlineedit.h</header>
</customwidget>
</customwidgets>
<resources/>
Expand Down
38 changes: 19 additions & 19 deletions arho_feature_template/plugin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

import os
from typing import TYPE_CHECKING, Callable, cast

from qgis.PyQt.QtCore import QCoreApplication, Qt, QTranslator
Expand All @@ -16,7 +15,6 @@
from arho_feature_template.qgis_plugin_tools.tools.i18n import setup_translation
from arho_feature_template.qgis_plugin_tools.tools.resources import plugin_name
from arho_feature_template.utils.db_utils import get_existing_database_connection_names
from arho_feature_template.utils.misc_utils import PLUGIN_PATH

if TYPE_CHECKING:
from qgis.gui import QgisInterface, QgsMapTool
Expand Down Expand Up @@ -129,39 +127,41 @@ def initGui(self) -> None: # noqa N802
self.templater = FeatureTemplater()
self.new_plan = NewPlan()

plan_icon_path = os.path.join(PLUGIN_PATH, "resources/icons/city.png") # A placeholder icon
load_icon_path = os.path.join(PLUGIN_PATH, "resources/icons/folder.png") # A placeholder icon
# plan_icon_path = os.path.join(PLUGIN_PATH, "resources/icons/city.png") # A placeholder icon
# load_icon_path = os.path.join(PLUGIN_PATH, "resources/icons/folder.png") # A placeholder icon

iface.addDockWidget(Qt.RightDockWidgetArea, self.templater.template_dock)
self.templater.template_dock.visibilityChanged.connect(self.dock_visibility_changed)

iface.mapCanvas().mapToolSet.connect(self.templater.digitize_map_tool.deactivate)

# Add main plugin action to the toolbar
self.template_dock_action = self.add_action(
"",
"Feature Templates",
None,
toggled_callback=self.toggle_template_dock,
checkable=True,
add_to_menu=True,
add_to_toolbar=True,
)

self.new_land_use_plan_action = self.add_action(
plan_icon_path,
"Create New Land Use Plan",
"",
"Luo uusi kaava",
self.add_new_plan,
add_to_menu=True,
add_to_toolbar=True,
status_tip="Create a new land use plan",
status_tip="Luo uusi kaava",
)

self.load_land_use_plan_action = self.add_action(
load_icon_path,
text="Load existing land use plan",
"",
text="Lataa/avaa kaavaa",
triggered_callback=self.load_existing_land_use_plan,
parent=iface.mainWindow(),
add_to_menu=True,
add_to_toolbar=True,
status_tip="Lataa/avaa kaava",
)

self.template_dock_action = self.add_action(
"",
"Kaavatemplaatit",
None,
toggled_callback=self.toggle_template_dock,
checkable=True,
add_to_menu=True,
add_to_toolbar=True,
)

Expand Down
Loading