Merge remote-tracking branch 'origin/3.2'

This commit is contained in:
Lipu Fei 2018-02-01 11:23:20 +01:00
commit 25713a6e64
6 changed files with 111 additions and 17 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_buildplate_container = None
@ -334,6 +337,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.