mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Added stubs for hasVariants & hasMaterials
CURA-1278
This commit is contained in:
parent
f3384b043d
commit
6ffde62bcf
2 changed files with 18 additions and 6 deletions
|
@ -113,6 +113,17 @@ class MachineManagerModel(QObject):
|
||||||
def removeMachine(self, machine_id):
|
def removeMachine(self, machine_id):
|
||||||
ContainerRegistry.getInstance().removeContainer(machine_id)
|
ContainerRegistry.getInstance().removeContainer(machine_id)
|
||||||
|
|
||||||
|
@pyqtProperty(bool)
|
||||||
|
def hasMaterials(self):
|
||||||
|
# Todo: Still hardcoded.
|
||||||
|
# We should implement this properly when it's clear how a machine notifies us if it can handle materials
|
||||||
|
return True
|
||||||
|
|
||||||
|
@pyqtProperty(bool)
|
||||||
|
def hasVariants(self):
|
||||||
|
# Todo: Still hardcoded.
|
||||||
|
# We should implement this properly when it's clear how a machine notifies us if it can handle variants
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def createMachineManagerModel(engine, script_engine):
|
def createMachineManagerModel(engine, script_engine):
|
||||||
|
|
|
@ -104,12 +104,12 @@ Item
|
||||||
anchors.topMargin: visible ? UM.Theme.getSize("default_margin").height : 0
|
anchors.topMargin: visible ? UM.Theme.getSize("default_margin").height : 0
|
||||||
width: base.width
|
width: base.width
|
||||||
height: visible ? UM.Theme.getSize("sidebar_setup").height : 0
|
height: visible ? UM.Theme.getSize("sidebar_setup").height : 0
|
||||||
visible: UM.MachineManager.hasVariants || UM.MachineManager.hasMaterials
|
visible: Cura.MachineManager.hasVariants || Cura.MachineManager.hasMaterials
|
||||||
|
|
||||||
Label{
|
Label{
|
||||||
id: variantLabel
|
id: variantLabel
|
||||||
text: (UM.MachineManager.hasVariants && UM.MachineManager.hasMaterials) ? catalog.i18nc("@label","Nozzle & Material:"):
|
text: (Cura.MachineManager.hasVariants && Cura.MachineManager.hasMaterials) ? catalog.i18nc("@label","Nozzle & Material:"):
|
||||||
UM.MachineManager.hasVariants ? catalog.i18nc("@label","Nozzle:") : catalog.i18nc("@label","Material:");
|
Cura.MachineManager.hasVariants ? catalog.i18nc("@label","Nozzle:") : catalog.i18nc("@label","Material:");
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
@ -118,7 +118,8 @@ Item
|
||||||
color: UM.Theme.getColor("text");
|
color: UM.Theme.getColor("text");
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle
|
||||||
|
{
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
@ -130,7 +131,7 @@ Item
|
||||||
id: variantSelection
|
id: variantSelection
|
||||||
text: Cura.MachineManager.activeVariantName
|
text: Cura.MachineManager.activeVariantName
|
||||||
tooltip: Cura.MachineManager.activeVariantName;
|
tooltip: Cura.MachineManager.activeVariantName;
|
||||||
visible: UM.MachineManager.hasVariants
|
visible: Cura.MachineManager.hasVariants
|
||||||
|
|
||||||
height: UM.Theme.getSize("setting_control").height
|
height: UM.Theme.getSize("setting_control").height
|
||||||
width: materialSelection.visible ? (parent.width - UM.Theme.getSize("default_margin").width) / 2 : parent.width
|
width: materialSelection.visible ? (parent.width - UM.Theme.getSize("default_margin").width) / 2 : parent.width
|
||||||
|
@ -181,7 +182,7 @@ Item
|
||||||
id: materialSelection
|
id: materialSelection
|
||||||
text: Cura.MachineManager.activeMaterialName
|
text: Cura.MachineManager.activeMaterialName
|
||||||
tooltip: Cura.MachineManager.activeMaterialName
|
tooltip: Cura.MachineManager.activeMaterialName
|
||||||
visible: UM.MachineManager.hasMaterials
|
visible: Cura.MachineManager.hasMaterials
|
||||||
|
|
||||||
height: UM.Theme.getSize("setting_control").height
|
height: UM.Theme.getSize("setting_control").height
|
||||||
width: variantSelection.visible ? (parent.width - UM.Theme.getSize("default_margin").width) / 2 : parent.width
|
width: variantSelection.visible ? (parent.width - UM.Theme.getSize("default_margin").width) / 2 : parent.width
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue