Skip to content

Commit

Permalink
remove profile action
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jan 23, 2024
1 parent 783ee94 commit e072b9b
Showing 1 changed file with 18 additions and 22 deletions.
40 changes: 18 additions & 22 deletions plugin/teksi_wastewater/teksi_wastewater_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@
from .gui.twwwizard import TwwWizard
from .interlis import config
from .processing_provider.provider import TwwProcessingProvider
from .tools.twwmaptools import (
TwwMapToolConnectNetworkElements,
TwwProfileMapTool,
TwwTreeMapTool,
)
from .tools.twwmaptools import TwwMapToolConnectNetworkElements, TwwTreeMapTool
from .tools.twwnetwork import TwwGraphManager
from .utils.plugin_utils import plugin_root_path
from .utils.translation import setup_i18n
Expand Down Expand Up @@ -160,15 +156,15 @@ def initGui(self):
self.toolbarButtons = []

# Create toolbar button
self.profileAction = QAction(
QIcon(os.path.join(plugin_root_path(), "icons/wastewater-profile.svg")),
self.tr("Profile"),
self.iface.mainWindow(),
)
self.profileAction.setWhatsThis(self.tr("Reach trace"))
self.profileAction.setEnabled(False)
self.profileAction.setCheckable(True)
self.profileAction.triggered.connect(self.profileToolClicked)
# self.profileAction = QAction(
# QIcon(os.path.join(plugin_root_path(), "icons/wastewater-profile.svg")),
# self.tr("Profile"),
# self.iface.mainWindow(),
# )
# self.profileAction.setWhatsThis(self.tr("Reach trace"))
# self.profileAction.setEnabled(False)
# self.profileAction.setCheckable(True)
# self.profileAction.triggered.connect(self.profileToolClicked)

self.downstreamAction = QAction(
QIcon(os.path.join(plugin_root_path(), "icons/wastewater-downstream.svg")),
Expand Down Expand Up @@ -250,14 +246,14 @@ def initGui(self):
# Add toolbar button and menu item
self.toolbar = QToolBar(self.tr("TEKSI Wastewater"))
self.toolbar.setObjectName(self.toolbar.windowTitle())
self.toolbar.addAction(self.profileAction)
# self.toolbar.addAction(self.profileAction)
self.toolbar.addAction(self.upstreamAction)
self.toolbar.addAction(self.downstreamAction)
self.toolbar.addAction(self.wizardAction)
self.toolbar.addAction(self.refreshNetworkTopologyAction)
self.toolbar.addAction(self.connectNetworkElementsAction)

self.iface.addPluginToMenu("TEKSI &Wastewater", self.profileAction)
# self.iface.addPluginToMenu("TEKSI &Wastewater", self.profileAction)
self.iface.addPluginToMenu("TEKSI &Wastewater", self.settingsAction)
self.iface.addPluginToMenu("TEKSI &Wastewater", self.aboutAction)

Expand All @@ -270,7 +266,7 @@ def initGui(self):
self.iface.addToolBar(self.toolbar)

# Local array of buttons to enable / disable based on context
self.toolbarButtons.append(self.profileAction)
# self.toolbarButtons.append(self.profileAction)
self.toolbarButtons.append(self.upstreamAction)
self.toolbarButtons.append(self.downstreamAction)
self.toolbarButtons.append(self.wizardAction)
Expand All @@ -285,9 +281,9 @@ def initGui(self):
self.network_analyzer = TwwGraphManager()
self.network_analyzer.message_emitted.connect(self.iface.messageBar().pushMessage)
# Create the map tool for profile selection
self.profile_tool = TwwProfileMapTool(
self.iface, self.profileAction, self.network_analyzer
)
# self.profile_tool = TwwProfileMapTool(
# self.iface, self.profileAction, self.network_analyzer
# )
self.profile_tool.profileChanged.connect(self.onProfileChanged)

self.upstream_tree_tool = TwwTreeMapTool(
Expand Down Expand Up @@ -318,7 +314,7 @@ def unload(self):
"""
Called when unloading
"""
self.toolbar.removeAction(self.profileAction)
# self.toolbar.removeAction(self.profileAction)
self.toolbar.removeAction(self.upstreamAction)
self.toolbar.removeAction(self.downstreamAction)
self.toolbar.removeAction(self.wizardAction)
Expand All @@ -332,7 +328,7 @@ def unload(self):

self.toolbar.deleteLater()

self.iface.removePluginMenu("TEKSI &Wastewater", self.profileAction)
# self.iface.removePluginMenu("TEKSI &Wastewater", self.profileAction)
self.iface.removePluginMenu("TEKSI &Wastewater", self.settingsAction)
self.iface.removePluginMenu("TEKSI &Wastewater", self.aboutAction)

Expand Down

0 comments on commit e072b9b

Please sign in to comment.