Skip to content

Commit

Permalink
set the list panel with the db_id instead of the mode. Might resolve #…
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Jul 16, 2024
1 parent d45fd3a commit db67f2f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions QgisModelBaker/gui/workflow_wizard/database_selection_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,24 @@ def _type_changed(self):
value._show_panel()

def restore_configuration(self, configuration, get_config_from_project=False):
configuration = Ili2DbCommandConfiguration()
valid = False
mode = None
layer_configuration = Ili2DbCommandConfiguration()

if get_config_from_project:
# tries to take settings from the project
layer = self._relevant_layer()
if layer:
source_provider = layer.dataProvider()
valid, mode = db_utils.get_configuration_from_sourceprovider(
source_provider, configuration
source_provider, layer_configuration
)

if valid and mode:
# uses the settings from the project and provides it to the gui
configuration = layer_configuration
configuration.tool = mode
self._lst_panel[mode].set_fields(configuration)
else:
# takes settings from QSettings and provides it to the gui
settings = QSettings()
Expand All @@ -112,13 +114,12 @@ def restore_configuration(self, configuration, get_config_from_project=False):
db_factory = self.db_simple_factory.create_factory(db_id)
config_manager = db_factory.get_db_command_config_manager(configuration)
config_manager.load_config_from_qsettings()
self._lst_panel[db_id].set_fields(configuration)

mode = settings.value("QgisModelBaker/importtype")
mode = DbIliMode[mode] if mode else self.db_simple_factory.default_database
mode = mode & ~DbIliMode.ili
configuration.tool = mode

self._lst_panel[mode].set_fields(configuration)
self.type_combo_box.setCurrentIndex(self.type_combo_box.findData(mode))
self._type_changed()

Expand Down

0 comments on commit db67f2f

Please sign in to comment.