diff --git a/src/mapclient/view/workflow/workflowwidget.py b/src/mapclient/view/workflow/workflowwidget.py index d6a97d1..5a21cb2 100644 --- a/src/mapclient/view/workflow/workflowwidget.py +++ b/src/mapclient/view/workflow/workflowwidget.py @@ -219,16 +219,18 @@ def setWidgetUndoRedoStack(self, stack): self._main_window.set_current_undo_redo_stack(stack) def new(self, pmr=False): + self.close() + workflowDir = self._get_workflow_dir() if workflowDir: - self._createNewWorkflow(workflowDir, pmr) + self._create_new_workflow(workflowDir, pmr) def _workflow_finished(self, successfully): if successfully: close_after = self._main_window.model().optionsManager().getOption(CLOSE_AFTER) mb = MessageBox(QtWidgets.QMessageBox.Icon.Information, "Workflow Finished", "Workflow finished successfully.", - QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Default, + QtWidgets.QMessageBox.StandardButton.Ok | QtWidgets.QMessageBox.StandardButton.Default, parent=self._main_window, close_after=close_after) mb.setIconPixmap(QtGui.QPixmap(":/mapclient/images/green_tick.png").scaled(64, 64)) @@ -281,7 +283,7 @@ def rm_tree_unsuccessful(_one, _two, _three): @handle_runtime_error @set_wait_cursor - def _createNewWorkflow(self, workflow_dir, pmr): + def _create_new_workflow(self, workflow_dir, pmr): m = self._main_window.model().workflowManager() om = self._main_window.model().optionsManager() m.new(workflow_dir)