mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 01:25:51 +08:00
WIP: Only fetch variants if the machine has any
This commit is contained in:
parent
be211b7311
commit
76f431af76
@ -2,6 +2,7 @@ from PyQt5.QtCore import Qt
|
||||
|
||||
from UM.Application import Application
|
||||
from UM.Qt.ListModel import ListModel
|
||||
from UM.Util import parseBool
|
||||
|
||||
from cura.Machines.VariantManager import VariantType
|
||||
|
||||
@ -30,6 +31,11 @@ class BuildPlateModel(ListModel):
|
||||
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 = []
|
||||
|
@ -5,6 +5,7 @@ from PyQt5.QtCore import Qt
|
||||
|
||||
from UM.Application import Application
|
||||
from UM.Qt.ListModel import ListModel
|
||||
from UM.Util import parseBool
|
||||
|
||||
|
||||
class NozzleModel(ListModel):
|
||||
@ -33,6 +34,11 @@ class NozzleModel(ListModel):
|
||||
self.setItems([])
|
||||
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)
|
||||
if not variant_node_dict:
|
||||
self.setItems([])
|
||||
|
Loading…
x
Reference in New Issue
Block a user