mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-03 12:03:57 -06:00
Don't get build plate variants from tree any more
It's not in that tree. Contributes to issue CURA-6600.
This commit is contained in:
parent
bd714f947a
commit
f65e672887
1 changed files with 3 additions and 25 deletions
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (c) 2018 Ultimaker B.V.
|
# Copyright (c) 2019 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
from PyQt5.QtCore import Qt
|
from PyQt5.QtCore import Qt
|
||||||
|
@ -21,31 +21,9 @@ class BuildPlateModel(ListModel):
|
||||||
self.addRoleName(self.NameRole, "name")
|
self.addRoleName(self.NameRole, "name")
|
||||||
self.addRoleName(self.ContainerNodeRole, "container_node")
|
self.addRoleName(self.ContainerNodeRole, "container_node")
|
||||||
|
|
||||||
self._application = Application.getInstance()
|
|
||||||
self._variant_manager = self._application._variant_manager
|
|
||||||
self._machine_manager = self._application.getMachineManager()
|
|
||||||
|
|
||||||
self._machine_manager.globalContainerChanged.connect(self._update)
|
|
||||||
|
|
||||||
self._update()
|
self._update()
|
||||||
|
|
||||||
def _update(self):
|
def _update(self):
|
||||||
Logger.log("d", "Updating {model_class_name}.".format(model_class_name = self.__class__.__name__))
|
Logger.log("d", "Updating {model_class_name}.".format(model_class_name = self.__class__.__name__))
|
||||||
global_stack = self._machine_manager._global_container_stack
|
self.setItems([])
|
||||||
if not global_stack:
|
return
|
||||||
self.setItems([])
|
|
||||||
return
|
|
||||||
|
|
||||||
has_variants = parseBool(global_stack.getMetaDataEntry("has_variant_buildplates", False))
|
|
||||||
if not has_variants:
|
|
||||||
self.setItems([])
|
|
||||||
return
|
|
||||||
|
|
||||||
variant_dict = self._variant_manager.getVariantNodes(global_stack, variant_type = VariantType.BUILD_PLATE)
|
|
||||||
|
|
||||||
item_list = []
|
|
||||||
for name, variant_node in variant_dict.items():
|
|
||||||
item = {"name": name,
|
|
||||||
"container_node": variant_node}
|
|
||||||
item_list.append(item)
|
|
||||||
self.setItems(item_list)
|
|
Loading…
Add table
Add a link
Reference in a new issue