mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 23:45:59 +08:00
Fix missing error message when slicing with disabled extruder
Following the removal of the get/setMessage methods in the Job class, the StartSliceJob has not been updated and still used them. We now use a specific variable for storing the disabled extruders and properly display them. CURA-11904
This commit is contained in:
parent
22c17c68ac
commit
2e5e43291e
@ -544,7 +544,7 @@ class CuraEngineBackend(QObject, Backend):
|
|||||||
|
|
||||||
if job.getResult() == StartJobResult.ObjectsWithDisabledExtruder:
|
if job.getResult() == StartJobResult.ObjectsWithDisabledExtruder:
|
||||||
self._error_message = Message(catalog.i18nc("@info:status",
|
self._error_message = Message(catalog.i18nc("@info:status",
|
||||||
"Unable to slice because there are objects associated with disabled Extruder %s.") % job.getMessage(),
|
"Unable to slice because there are objects associated with disabled Extruder %s.") % job.getAssociatedDisabledExtruders(),
|
||||||
title = catalog.i18nc("@info:title", "Unable to slice"),
|
title = catalog.i18nc("@info:title", "Unable to slice"),
|
||||||
message_type = Message.MessageType.WARNING)
|
message_type = Message.MessageType.WARNING)
|
||||||
self._error_message.show()
|
self._error_message.show()
|
||||||
|
@ -146,6 +146,7 @@ class StartSliceJob(Job):
|
|||||||
self._slice_message: Arcus.PythonMessage = slice_message
|
self._slice_message: Arcus.PythonMessage = slice_message
|
||||||
self._is_cancelled: bool = False
|
self._is_cancelled: bool = False
|
||||||
self._build_plate_number: Optional[int] = None
|
self._build_plate_number: Optional[int] = None
|
||||||
|
self._associated_disabled_extruders: Optional[str] = None
|
||||||
|
|
||||||
# cache for all setting values from all stacks (global & extruder) for the current machine
|
# cache for all setting values from all stacks (global & extruder) for the current machine
|
||||||
self._all_extruders_settings: Optional[Dict[str, Any]] = None
|
self._all_extruders_settings: Optional[Dict[str, Any]] = None
|
||||||
@ -153,6 +154,9 @@ class StartSliceJob(Job):
|
|||||||
def getSliceMessage(self) -> Arcus.PythonMessage:
|
def getSliceMessage(self) -> Arcus.PythonMessage:
|
||||||
return self._slice_message
|
return self._slice_message
|
||||||
|
|
||||||
|
def getAssociatedDisabledExtruders(self) -> Optional[str]:
|
||||||
|
return self._associated_disabled_extruders
|
||||||
|
|
||||||
def setBuildPlate(self, build_plate_number: int) -> None:
|
def setBuildPlate(self, build_plate_number: int) -> None:
|
||||||
self._build_plate_number = build_plate_number
|
self._build_plate_number = build_plate_number
|
||||||
|
|
||||||
@ -334,7 +338,7 @@ class StartSliceJob(Job):
|
|||||||
if has_model_with_disabled_extruders:
|
if has_model_with_disabled_extruders:
|
||||||
self.setResult(StartJobResult.ObjectsWithDisabledExtruder)
|
self.setResult(StartJobResult.ObjectsWithDisabledExtruder)
|
||||||
associated_disabled_extruders = {p + 1 for p in associated_disabled_extruders}
|
associated_disabled_extruders = {p + 1 for p in associated_disabled_extruders}
|
||||||
self.setMessage(", ".join(map(str, sorted(associated_disabled_extruders))))
|
self._associated_disabled_extruders = ", ".join(map(str, sorted(associated_disabled_extruders)))
|
||||||
return
|
return
|
||||||
|
|
||||||
# There are cases when there is nothing to slice. This can happen due to one at a time slicing not being
|
# There are cases when there is nothing to slice. This can happen due to one at a time slicing not being
|
||||||
|
Loading…
x
Reference in New Issue
Block a user