mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-17 03:37:48 -06:00
WIP: Only fetch variants if the machine has any
This commit is contained in:
parent
be211b7311
commit
76f431af76
2 changed files with 12 additions and 0 deletions
|
@ -2,6 +2,7 @@ from PyQt5.QtCore import Qt
|
||||||
|
|
||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
from UM.Qt.ListModel import ListModel
|
from UM.Qt.ListModel import ListModel
|
||||||
|
from UM.Util import parseBool
|
||||||
|
|
||||||
from cura.Machines.VariantManager import VariantType
|
from cura.Machines.VariantManager import VariantType
|
||||||
|
|
||||||
|
@ -30,6 +31,11 @@ class BuildPlateModel(ListModel):
|
||||||
self.setItems([])
|
self.setItems([])
|
||||||
return
|
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)
|
variant_dict = self._variant_manager.getVariantNodes(global_stack, variant_type = VariantType.BUILD_PLATE)
|
||||||
|
|
||||||
item_list = []
|
item_list = []
|
||||||
|
|
|
@ -5,6 +5,7 @@ from PyQt5.QtCore import Qt
|
||||||
|
|
||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
from UM.Qt.ListModel import ListModel
|
from UM.Qt.ListModel import ListModel
|
||||||
|
from UM.Util import parseBool
|
||||||
|
|
||||||
|
|
||||||
class NozzleModel(ListModel):
|
class NozzleModel(ListModel):
|
||||||
|
@ -33,6 +34,11 @@ class NozzleModel(ListModel):
|
||||||
self.setItems([])
|
self.setItems([])
|
||||||
return
|
return
|
||||||
|
|
||||||
|
has_variants = parseBool(active_global_stack.getMetaDataEntry("has_variants", False))
|
||||||
|
if not has_variants:
|
||||||
|
self.setItems([])
|
||||||
|
return
|
||||||
|
|
||||||
variant_node_dict = variant_manager.getVariantNodes(active_global_stack)
|
variant_node_dict = variant_manager.getVariantNodes(active_global_stack)
|
||||||
if not variant_node_dict:
|
if not variant_node_dict:
|
||||||
self.setItems([])
|
self.setItems([])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue