diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index c04e4d74f5..9d448e11bb 100644 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -220,6 +220,9 @@ class CuraEngineBackend(Backend): # # \param job The start slice job that was just finished. def _onStartSliceCompleted(self, job): + if self._error_message: + self._error_message.hide() + # Note that cancelled slice jobs can still call this method. if self._start_slice_job is job: self._start_slice_job = None @@ -258,6 +261,14 @@ class CuraEngineBackend(Backend): self.backendStateChange.emit(BackendState.NotStarted) return + if job.getResult() == StartSliceJob.StartJobResult.BuildPlateError: + if Application.getInstance().getPlatformActivity: + self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice because the prime tower or prime position(s) are invalid.")) + self._error_message.show() + self.backendStateChange.emit(BackendState.Error) + else: + self.backendStateChange.emit(BackendState.NotStarted) + if job.getResult() == StartSliceJob.StartJobResult.NothingToSlice: if Application.getInstance().getPlatformActivity: self._error_message = Message(catalog.i18nc("@info:status", "Nothing to slice because none of the models fit the build volume. Please scale or rotate models to fit.")) diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index b343c307af..0319186518 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -25,6 +25,7 @@ class StartJobResult(IntEnum): SettingError = 3 NothingToSlice = 4 MaterialIncompatible = 5 + BuildPlateError = 6 ## Formatter class that handles token expansion in start/end gcod @@ -80,7 +81,7 @@ class StartSliceJob(Job): return if Application.getInstance().getBuildVolume().hasErrors(): - self.setResult(StartJobResult.SettingError) + self.setResult(StartJobResult.BuildPlateError) return for extruder_stack in cura.Settings.ExtruderManager.getInstance().getMachineExtruders(stack.getId()):