Fix material_diameter handling in ExtruderStacks

CURA-4898
This commit is contained in:
Lipu Fei 2018-01-31 13:31:48 +01:00
parent 68366ccc8d
commit 3927c70625
3 changed files with 59 additions and 9 deletions

View file

@ -1,6 +1,7 @@
# Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import collections
import time
#Type hinting.
from typing import Union, List, Dict
@ -51,6 +52,8 @@ class MachineManager(QObject):
self._active_container_stack = None # type: CuraContainerStack
self._global_container_stack = None # type: GlobalStack
self.machine_extruder_material_update_dict = collections.defaultdict(list)
# Used to store the new containers until after confirming the dialog
self._new_variant_container = None
self._new_material_container = None
@ -317,6 +320,11 @@ class MachineManager(QObject):
extruder_stack.propertyChanged.connect(self._onPropertyChanged)
extruder_stack.containersChanged.connect(self._onInstanceContainersChanged)
if self._global_container_stack.getId() in self.machine_extruder_material_update_dict:
for func in self.machine_extruder_material_update_dict[self._global_container_stack.getId()]:
Application.getInstance().callLater(func)
del self.machine_extruder_material_update_dict[self._global_container_stack.getId()]
self._error_check_timer.start()
## Update self._stacks_valid according to _checkStacksForErrors and emit if change.