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

Wizard workflow fix #851

Merged
merged 2 commits into from
Nov 30, 2023
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
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
Loading