Skip to content

Commit

Permalink
icon
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Nov 24, 2023
1 parent f7642b6 commit f23f751
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
34 changes: 18 additions & 16 deletions QgisModelBaker/gui/panel/tid_configurator_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,24 @@ def __init__(self, parent=None):
def setup_dialog(self, qgis_project, db_connector=None):
self.qgis_project = qgis_project

if db_connector:
self.db_connector = db_connector
else:
# getting the data source of the first layer in the layer tree
first_tree_layer = qgis_project.layerTreeRoot().findLayers()[0]
if first_tree_layer:
configuration = Ili2DbCommandConfiguration()
source_provider = first_tree_layer.layer().dataProvider()
valid, mode = db_utils.get_configuration_from_sourceprovider(
source_provider, configuration
)
if valid:
configuration.tool = mode
self.db_connector = db_utils.get_db_connector(configuration)

self._reset_tid_configuration()
if self.qgis_project:
if db_connector:
self.db_connector = db_connector
else:
# getting the data source of the first layer in the layer tree
layers = qgis_project.layerTreeRoot().findLayers()
if layers:
first_tree_layer = layers[0]
configuration = Ili2DbCommandConfiguration()
source_provider = first_tree_layer.layer().dataProvider()
valid, mode = db_utils.get_configuration_from_sourceprovider(
source_provider, configuration
)
if valid:
configuration.tool = mode
self.db_connector = db_utils.get_db_connector(configuration)

self._reset_tid_configuration()

def _reset_tid_configuration(self):
self.layer_tids_panel.load_tid_config(self.qgis_project)
Expand Down
2 changes: 2 additions & 0 deletions QgisModelBaker/images/QgisModelBaker-tidmanager-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions QgisModelBaker/qgismodelbaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ def unload(self):
self.iface.removePluginDatabaseMenu(
self.tr("Model Baker"), self.__datasetmanager_action
)
self.iface.removePluginDatabaseMenu(
self.tr("Model Baker"), self.__tidmanager_action
)
self.iface.removePluginDatabaseMenu(
self.tr("Model Baker"), self.__validate_action
)
Expand All @@ -275,6 +278,7 @@ def unload(self):
)
del self.__workflow_wizard_action
del self.__datasetmanager_action
del self.__tidmanager_action
del self.__validate_action
del self.__configure_action
del self.__help_action
Expand Down

0 comments on commit f23f751

Please sign in to comment.