Skip to content

Commit

Permalink
Merge pull request #851 from opengisch/tidbidfollowupfixes
Browse files Browse the repository at this point in the history
Wizard workflow fix
  • Loading branch information
signedav authored Nov 30, 2023
2 parents 80aff1f + 7ab735d commit 50d6270
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
QCompleter,
QHeaderView,
QStyledItemDelegate,
QTextEdit,
QWizardPage,
)

Expand Down Expand Up @@ -77,11 +78,21 @@ def updateEditorGeometry(self, editor, option, index):
editor.setGeometry(option.rect)

def paint(self, painter, option, index):
opt = self.createEditor(self.parent, option, index)
opt.editable = False
value = index.data(int(gui_utils.SourceModel.Roles.DATASET_NAME))
num = self.items.index(value) if value in self.items else 0
opt.setCurrentIndex(num)
if (
index.model()
.index(index.row(), gui_utils.SourceModel.Columns.IS_CATALOGUE)
.data(int(gui_utils.SourceModel.Roles.IS_CATALOGUE))
):
opt = QTextEdit()
opt.editable = False
opt.setText("---")
opt.setEnabled(False)
else:
opt = self.createEditor(self.parent, option, index)
opt.editable = False
value = index.data(int(gui_utils.SourceModel.Roles.DATASET_NAME))
num = self.items.index(value) if value in self.items else 0
opt.setCurrentIndex(num)
opt.resize(option.rect.width(), option.rect.height())
pixmap = QPixmap(opt.width(), opt.height())
opt.render(pixmap)
Expand Down
12 changes: 8 additions & 4 deletions QgisModelBaker/gui/workflow_wizard/workflow_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,14 @@ def next_id(self):
self.schema_configuration_page.setComplete(True)

if self.current_id == PageIds.ImportSchemaExecution:
# if transfer files available, then go to data import
if self.import_data_file_model.rowCount():
return PageIds.ImportDataConfiguration

# if basket handling active, go to the create basket
if self._basket_handling(self.import_schema_configuration):
return PageIds.DefaultBaskets

# if transfer files available, then go to data import
if self.import_data_file_model.rowCount():
return PageIds.ImportDataConfiguration

# if transfer file are possible (by getting via UsabILIty Hub), go to the data import
self.log_panel.print_info(
self.tr(
Expand All @@ -323,6 +323,10 @@ def next_id(self):
return PageIds.ProjectCreation

if self.current_id == PageIds.DefaultBaskets:
# if transfer files available, then go to data import
if self.import_data_file_model.rowCount():
return PageIds.ImportDataConfiguration

# if transfer file are possible (by getting via UsabILIty Hub), go to the data import
self.log_panel.print_info(
self.tr(
Expand Down

0 comments on commit 50d6270

Please sign in to comment.