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

refresh validator panel when added new dataset #978

Merged
merged 1 commit into from
Nov 5, 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
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