Skip to content

Commit

Permalink
Update schemas combo on user/password changes
Browse files Browse the repository at this point in the history
  • Loading branch information
domi4484 committed Dec 1, 2023
1 parent e3e2233 commit 1c0100d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion QgisModelBaker/gui/panel/pg_config_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ def __init__(self, parent, db_action_type):
self.pg_database_line_edit.textChanged.connect(self._fields_modified)
self.pg_schema_combo_box.currentTextChanged.connect(self.notify_fields_modified)

self.pg_auth_settings.usernameChanged.connect(self._fields_modified)
self.pg_auth_settings.passwordChanged.connect(self._fields_modified)
self.pg_auth_settings.configIdChanged.connect(self._fields_modified)

# Fill pg_services combo box
self.pg_service_combo_box.addItem(self.tr("None"), None)
for service in pgserviceparser.service_names():
Expand Down Expand Up @@ -174,6 +178,14 @@ def __init__(self, parent, db_action_type):

self._show_panel()

def __del__(self):
# Make sure the refresh schemas task is finished to avoid crashes
try:
if self._read_pg_schemas_task:
self._read_pg_schemas_task.wait()
except RuntimeError:
pass

def _show_panel(self):

self._fill_schema_combo_box()
Expand Down Expand Up @@ -462,7 +474,6 @@ def _keep_custom_settings(self):
)

def _fields_modified(self):

self._fill_schema_combo_box_timer.start(self.REFRESH_SCHEMAS_TIMEOUT_MS)

self.notify_fields_modified.emit()
Expand Down

0 comments on commit 1c0100d

Please sign in to comment.