When disabling an extruder due to sync, always show a message.

Originally it would only show a message if the extruder was actually used,
but this didn't take the flow into account when you would first sync and then load a model.
In that case, the user never got a message and never got any notification that (and why) any of the extruders
got disabled.

CURA-5693
This commit is contained in:
Jaime van Kessel 2019-01-31 11:30:37 +01:00
parent e40b730457
commit 3734b980d8

View file

@ -1367,7 +1367,6 @@ class MachineManager(QObject):
self.switchPrinterType(configuration.printerType) self.switchPrinterType(configuration.printerType)
used_extruder_stack_list = ExtruderManager.getInstance().getUsedExtruderStacks() used_extruder_stack_list = ExtruderManager.getInstance().getUsedExtruderStacks()
used_extruder_position_set = {es.getMetaDataEntry("position") for es in used_extruder_stack_list}
disabled_used_extruder_position_set = set() disabled_used_extruder_position_set = set()
extruders_to_disable = set() extruders_to_disable = set()
@ -1393,7 +1392,7 @@ class MachineManager(QObject):
# If the machine doesn't have a hotend or material, disable this extruder # If the machine doesn't have a hotend or material, disable this extruder
if int(position) in extruders_to_disable: if int(position) in extruders_to_disable:
self._global_container_stack.extruders[position].setEnabled(False) self._global_container_stack.extruders[position].setEnabled(False)
if position in used_extruder_position_set:
need_to_show_message = True need_to_show_message = True
disabled_used_extruder_position_set.add(int(position)) disabled_used_extruder_position_set.add(int(position))
@ -1432,7 +1431,7 @@ class MachineManager(QObject):
extruders_str = ", ".join(str(x) for x in sorted(disabled_used_extruder_position_set)) extruders_str = ", ".join(str(x) for x in sorted(disabled_used_extruder_position_set))
msg_str = msg_str.format(extruders = extruders_str) msg_str = msg_str.format(extruders = extruders_str)
message = Message(catalog.i18nc("@info:status", msg_str), message = Message(catalog.i18nc("@info:status", msg_str),
title = catalog.i18nc("@info:title", "Extruders Disabled")) title = catalog.i18nc("@info:title", "Extruder(s) Disabled"))
message.show() message.show()
# See if we need to show the Discard or Keep changes screen # See if we need to show the Discard or Keep changes screen