Skip to content

Commit

Permalink
refresh validator panel when added new dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Nov 5, 2024
1 parent 4b06337 commit 9424315
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions QgisModelBaker/gui/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def _reset_gui(self):

self.setDisabled(True)

def set_current_layer(self, layer):
def set_current_layer(self, layer, force_reload=False):
if self.isHidden():
return

Expand All @@ -228,7 +228,10 @@ def set_current_layer(self, layer):
if not schema_identificator:
self.setDisabled(True)
return
if schema_identificator == self.current_schema_identificator:
if (
schema_identificator == self.current_schema_identificator
and not force_reload
):
self.setEnabled(True)
return

Expand Down Expand Up @@ -304,7 +307,7 @@ def set_current_layer(self, layer):

def _visibility_changed(self, visible):
if visible:
self.set_current_layer(self.iface.activeLayer())
self.set_current_layer(self.iface.activeLayer(), True)

def _refresh_schemadata_models(self):
db_connector = db_utils.get_db_connector(self.current_configuration)
Expand Down
1 change: 1 addition & 0 deletions QgisModelBaker/qgismodelbaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ def show_datasetmanager_dialog(self):

def datasetmanager_dialog_finished(self):
self.__dataset_selector.reset_model(self.iface.layerTreeView().currentLayer())
self.__validate_dock.set_current_layer(self.iface.activeLayer(), True)
self.__datasetmanager_action.setChecked(False)
self.datasetmanager_dlg = None

Expand Down

0 comments on commit 9424315

Please sign in to comment.