Fix containersChanged signal handlers

Fixes CURA-1642
This commit is contained in:
Arjen Hiemstra 2016-06-02 12:01:19 +02:00
parent 1a30dd96b1
commit 186eca160b
2 changed files with 3 additions and 3 deletions

View file

@ -101,7 +101,7 @@ class ConvexHullDecorator(SceneNodeDecorator):
if key == "print_sequence" and property_name == "value": if key == "print_sequence" and property_name == "value":
self._onChanged() self._onChanged()
def _onChanged(self): def _onChanged(self, *args):
if self._convex_hull_job: if self._convex_hull_job:
self._convex_hull_job.cancel() self._convex_hull_job.cancel()
self.setConvexHull(None) self.setConvexHull(None)

View file

@ -57,7 +57,7 @@ class ExtruderManager:
# This looks at the global container stack to see which machine is active. # This looks at the global container stack to see which machine is active.
# Then it loads the extruders for that machine and loads each of them in a # Then it loads the extruders for that machine and loads each of them in a
# list of extruders. # list of extruders.
def _reloadExtruders(self): def _reloadExtruders(self, *args):
self._extruders = [] self._extruders = []
if not self._global_container_stack: #No machine has been added yet. if not self._global_container_stack: #No machine has been added yet.
self.extrudersChanged.emit() #Yes, we just cleared the _extruders list! self.extrudersChanged.emit() #Yes, we just cleared the _extruders list!
@ -65,7 +65,7 @@ class ExtruderManager:
#Get the extruder definitions belonging to the current machine. #Get the extruder definitions belonging to the current machine.
machine = self._global_container_stack.getBottom() machine = self._global_container_stack.getBottom()
extruder_train_ids = machine.getMetaData("machine_extruder_trains") extruder_train_ids = machine.getMetaDataEntry("machine_extruder_trains")
for extruder_train_id in extruder_train_ids: for extruder_train_id in extruder_train_ids:
extruder_definitions = UM.Settings.ContainerRegistry.getInstance().findDefinitionContainers(id = extruder_train_id) #Should be only 1 definition if IDs are unique, but add the whole list anyway. extruder_definitions = UM.Settings.ContainerRegistry.getInstance().findDefinitionContainers(id = extruder_train_id) #Should be only 1 definition if IDs are unique, but add the whole list anyway.
if not extruder_definitions: #Empty list or error. if not extruder_definitions: #Empty list or error.