Remove deprecated functions in MachineManager

CURA-6858
This commit is contained in:
Lipu Fei 2019-10-22 13:18:01 +02:00
parent 7544d049c5
commit 38ee4bf208
15 changed files with 27 additions and 170 deletions

View file

@ -27,7 +27,7 @@ NumericTextFieldWithUnit
id: printerHeadMinMaxField
UM.I18nCatalog { id: catalog; name: "cura" }
containerStackId: Cura.MachineManager.activeMachineId
containerStackId: Cura.MachineManager.activeMachine.id
settingKey: "machine_head_with_fans_polygon"
settingStoreIndex: 1

View file

@ -32,7 +32,7 @@ Cura.ExpandablePopup
}
contentPadding: UM.Theme.getSize("default_lining").width
enabled: Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants || Cura.MachineManager.hasVariantBuildplates; //Only let it drop down if there is any configuration that you could change.
enabled: Cura.MachineManager.activeMachine.hasMaterials || Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasVariantBuildplates; //Only let it drop down if there is any configuration that you could change.
headerItem: Item
{
@ -44,7 +44,7 @@ Cura.ExpandablePopup
orientation: ListView.Horizontal
anchors.fill: parent
model: extrudersModel
visible: Cura.MachineManager.hasMaterials
visible: Cura.MachineManager.activeMachine.hasMaterials
delegate: Item
{
@ -86,7 +86,7 @@ Cura.ExpandablePopup
{
id: variantLabel
visible: Cura.MachineManager.hasVariants
visible: Cura.MachineManager.activeMachine.hasVariants
text: model.variant
elide: Text.ElideRight
@ -115,7 +115,7 @@ Cura.ExpandablePopup
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
visible: !Cura.MachineManager.hasMaterials && (Cura.MachineManager.hasVariants || Cura.MachineManager.hasVariantBuildplates)
visible: !Cura.MachineManager.activeMachine.hasMaterials && (Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasVariantBuildplates)
anchors
{

View file

@ -244,7 +244,7 @@ Item
Row
{
height: visible ? UM.Theme.getSize("print_setup_big_item").height : 0
visible: Cura.MachineManager.hasMaterials
visible: Cura.MachineManager.activeMachine.hasMaterials
Label
{
@ -305,7 +305,7 @@ Item
Row
{
height: visible ? UM.Theme.getSize("print_setup_big_item").height : 0
visible: Cura.MachineManager.hasVariants
visible: Cura.MachineManager.activeMachine.hasVariants
Label
{

View file

@ -22,13 +22,13 @@ Menu
Menu
{
title: modelData.name
property var extruder: Cura.MachineManager.getExtruder(model.index)
NozzleMenu { title: Cura.MachineManager.activeDefinitionVariantsName; visible: Cura.MachineManager.hasVariants; extruderIndex: index }
MaterialMenu { title: catalog.i18nc("@title:menu", "&Material"); visible: Cura.MachineManager.hasMaterials; extruderIndex: index }
property var extruder: Cura.MachineManager.activeMachine.extruderList[model.index]
NozzleMenu { title: Cura.MachineManager.activeDefinitionVariantsName; visible: Cura.MachineManager.activeMachine.hasVariants; extruderIndex: index }
MaterialMenu { title: catalog.i18nc("@title:menu", "&Material"); visible: Cura.MachineManager.activeMachine.hasMaterials; extruderIndex: index }
MenuSeparator
{
visible: Cura.MachineManager.hasVariants || Cura.MachineManager.hasMaterials
visible: Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasMaterials
}
MenuItem

View file

@ -84,7 +84,7 @@ UM.ManagementPage
Flow
{
id: machineActions
visible: currentItem && currentItem.id == Cura.MachineManager.activeMachineId
visible: currentItem && currentItem.id == Cura.MachineManager.activeMachine.id
anchors.left: parent.left
anchors.right: parent.right
anchors.top: machineName.bottom

View file

@ -103,7 +103,7 @@ Item
id: activateMenuButton
text: catalog.i18nc("@action:button", "Activate")
iconName: "list-activate"
enabled: !isCurrentItemActivated && Cura.MachineManager.hasMaterials
enabled: !isCurrentItemActivated && Cura.MachineManager.activeMachine.hasMaterials
onClicked:
{
forceActiveFocus()
@ -227,7 +227,7 @@ Item
text:
{
var caption = catalog.i18nc("@action:label", "Printer") + ": " + Cura.MachineManager.activeMachine.name;
if (Cura.MachineManager.hasVariants)
if (Cura.MachineManager.activeMachine.hasVariants)
{
var activeVariantName = ""
if(Cura.MachineManager.activeStack != null)

View file

@ -449,7 +449,7 @@ TabView
UM.ContainerPropertyProvider
{
id: variantPropertyProvider
containerId: Cura.MachineManager.activeVariantId
containerId: Cura.MachineManager.activeStack.variant.id
watchedProperties: [ "value" ]
key: model.key
}

View file

@ -393,7 +393,7 @@ Item
left: parent.left
}
visible: text != ""
text: catalog.i18nc("@label %1 is printer name", "Printer: %1").arg(Cura.MachineManager.activeMachineName)
text: catalog.i18nc("@label %1 is printer name", "Printer: %1").arg(Cura.MachineManager.activeMachine.name)
width: profileScrollView.width
elide: Text.ElideRight
}

View file

@ -32,7 +32,7 @@ ListView
width: listView.width
outputDevice: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null
checked: Cura.MachineManager.activeMachineId == model.id
checked: Cura.MachineManager.activeMachine.id == model.id
onClicked:
{

View file

@ -33,7 +33,7 @@ Item
// Create properties to put property provider stuff in (bindings break in qt 5.5.1 otherwise)
property var state: propertyProvider.properties.state
// There is no resolve property if there is only one stack.
property var resolve: Cura.MachineManager.activeStackId !== Cura.MachineManager.activeMachineId ? propertyProvider.properties.resolve : "None"
property var resolve: Cura.MachineManager.activeStackId !== Cura.MachineManager.activeMachine.id ? propertyProvider.properties.resolve : "None"
property var stackLevels: propertyProvider.stackLevels
property var stackLevel: stackLevels[0]
// A list of stack levels that will trigger to show the revert button