Switch most usages of containerStackId to containerStack for settingPropertyProvider

This mostly makes the code a bit more logic and also decreases the number of searches in the registry
This commit is contained in:
Jaime van Kessel 2018-09-07 15:23:09 +02:00
parent 5a36bc963c
commit 4cde6c05ae
12 changed files with 29 additions and 29 deletions

View file

@ -16,6 +16,8 @@ Cura.MachineAction
property var extrudersModel: Cura.ExtrudersModel{} property var extrudersModel: Cura.ExtrudersModel{}
property int extruderTabsCount: 0 property int extruderTabsCount: 0
property var activeMachineId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.id : ""
Connections Connections
{ {
target: base.extrudersModel target: base.extrudersModel
@ -511,7 +513,7 @@ Cura.MachineAction
} }
return ""; return "";
} }
return Cura.MachineManager.activeMachineId; return base.activeMachineId
} }
key: settingKey key: settingKey
watchedProperties: [ "value", "description" ] watchedProperties: [ "value", "description" ]
@ -564,7 +566,7 @@ Cura.MachineAction
} }
return ""; return "";
} }
return Cura.MachineManager.activeMachineId; return base.activeMachineId
} }
key: settingKey key: settingKey
watchedProperties: [ "value", "description" ] watchedProperties: [ "value", "description" ]
@ -655,7 +657,7 @@ Cura.MachineAction
} }
return ""; return "";
} }
return Cura.MachineManager.activeMachineId; return base.activeMachineId
} }
key: settingKey key: settingKey
watchedProperties: [ "value", "options", "description" ] watchedProperties: [ "value", "options", "description" ]
@ -754,7 +756,7 @@ Cura.MachineAction
} }
return ""; return "";
} }
return Cura.MachineManager.activeMachineId; return base.activeMachineId
} }
key: settingKey key: settingKey
watchedProperties: [ "value", "description" ] watchedProperties: [ "value", "description" ]
@ -879,7 +881,7 @@ Cura.MachineAction
{ {
id: machineExtruderCountProvider id: machineExtruderCountProvider
containerStackId: Cura.MachineManager.activeMachineId containerStackId: base.activeMachineId
key: "machine_extruder_count" key: "machine_extruder_count"
watchedProperties: [ "value", "description" ] watchedProperties: [ "value", "description" ]
storeIndex: manager.containerIndex storeIndex: manager.containerIndex
@ -889,7 +891,7 @@ Cura.MachineAction
{ {
id: machineHeadPolygonProvider id: machineHeadPolygonProvider
containerStackId: Cura.MachineManager.activeMachineId containerStackId: base.acthiveMachineId
key: "machine_head_with_fans_polygon" key: "machine_head_with_fans_polygon"
watchedProperties: [ "value" ] watchedProperties: [ "value" ]
storeIndex: manager.containerIndex storeIndex: manager.containerIndex

View file

@ -17,7 +17,6 @@ Item {
width: childrenRect.width; width: childrenRect.width;
height: childrenRect.height; height: childrenRect.height;
property var all_categories_except_support: [ "machine_settings", "resolution", "shell", "infill", "material", "speed", property var all_categories_except_support: [ "machine_settings", "resolution", "shell", "infill", "material", "speed",
"travel", "cooling", "platform_adhesion", "dual", "meshfix", "blackmagic", "experimental"] "travel", "cooling", "platform_adhesion", "dual", "meshfix", "blackmagic", "experimental"]
@ -45,7 +44,7 @@ Item {
UM.SettingPropertyProvider UM.SettingPropertyProvider
{ {
id: meshTypePropertyProvider id: meshTypePropertyProvider
containerStackId: Cura.MachineManager.activeMachineId containerStack: Cura.MachineManager.activeMachine
watchedProperties: [ "enabled" ] watchedProperties: [ "enabled" ]
} }
@ -518,7 +517,7 @@ Item {
{ {
id: machineExtruderCount id: machineExtruderCount
containerStackId: Cura.MachineManager.activeMachineId containerStack: Cura.MachineManager.activeMachine
key: "machine_extruder_count" key: "machine_extruder_count"
watchedProperties: [ "value" ] watchedProperties: [ "value" ]
storeIndex: 0 storeIndex: 0
@ -528,7 +527,7 @@ Item {
{ {
id: printSequencePropertyProvider id: printSequencePropertyProvider
containerStackId: Cura.MachineManager.activeMachineId containerStack: Cura.MachineManager.activeMachine
key: "print_sequence" key: "print_sequence"
watchedProperties: [ "value" ] watchedProperties: [ "value" ]
storeIndex: 0 storeIndex: 0

View file

@ -384,7 +384,7 @@ UM.Dialog
UM.SettingPropertyProvider UM.SettingPropertyProvider
{ {
id: inheritStackProvider id: inheritStackProvider
containerStackId: Cura.MachineManager.activeMachineId containerStack: Cura.MachineManager.activeMachine
key: model.key ? model.key : "None" key: model.key ? model.key : "None"
watchedProperties: [ "limit_to_extruder" ] watchedProperties: [ "limit_to_extruder" ]
} }

View file

@ -306,7 +306,7 @@ UM.MainWindow
{ {
id: machineExtruderCount id: machineExtruderCount
containerStackId: Cura.MachineManager.activeMachineId containerStack: Cura.MachineManager.activeMachine
key: "machine_extruder_count" key: "machine_extruder_count"
watchedProperties: [ "value" ] watchedProperties: [ "value" ]
storeIndex: 0 storeIndex: 0
@ -1054,7 +1054,7 @@ UM.MainWindow
{ {
restart(); restart();
} }
else if(Cura.MachineManager.activeMachineId == null || Cura.MachineManager.activeMachineId == "") else if(Cura.MachineManager.activeMachine == null)
{ {
addMachineDialog.open(); addMachineDialog.open();
} }

View file

@ -103,7 +103,7 @@ Menu
{ {
id: machineExtruderCount id: machineExtruderCount
containerStackId: Cura.MachineManager.activeMachineId containerStack: Cura.MachineManager.activeMachine
key: "machine_extruder_count" key: "machine_extruder_count"
watchedProperties: [ "value" ] watchedProperties: [ "value" ]
} }

View file

@ -181,7 +181,7 @@ Rectangle
{ {
id: machineExtruderCount id: machineExtruderCount
containerStackId: Cura.MachineManager.activeMachineId containerStack: Cura.MachineManager.activeMachine
key: "machine_extruder_count" key: "machine_extruder_count"
watchedProperties: [ "value" ] watchedProperties: [ "value" ]
storeIndex: 0 storeIndex: 0
@ -191,7 +191,7 @@ Rectangle
{ {
id: machineHeatedBed id: machineHeatedBed
containerStackId: Cura.MachineManager.activeMachineId containerStack: Cura.MachineManager.activeMachine
key: "machine_heated_bed" key: "machine_heated_bed"
watchedProperties: [ "value" ] watchedProperties: [ "value" ]
storeIndex: 0 storeIndex: 0

View file

@ -595,7 +595,7 @@ Rectangle
{ {
id: machineExtruderCount id: machineExtruderCount
containerStackId: Cura.MachineManager.activeMachineId containerStack: Cura.MachineManager.activeMachine
key: "machine_extruder_count" key: "machine_extruder_count"
watchedProperties: [ "value" ] watchedProperties: [ "value" ]
storeIndex: 0 storeIndex: 0
@ -605,7 +605,7 @@ Rectangle
{ {
id: machineHeatedBed id: machineHeatedBed
containerStackId: Cura.MachineManager.activeMachineId containerStack: Cura.MachineManager.activeMachine
key: "machine_heated_bed" key: "machine_heated_bed"
watchedProperties: [ "value" ] watchedProperties: [ "value" ]
storeIndex: 0 storeIndex: 0

View file

@ -78,18 +78,18 @@ Column
UM.SettingPropertyProvider UM.SettingPropertyProvider
{ {
id: bedTemperature id: bedTemperature
containerStackId: Cura.MachineManager.activeMachineId containerStack: Cura.MachineManager.activeMachine
key: "material_bed_temperature" key: "material_bed_temperature"
watchedProperties: ["value", "minimum_value", "maximum_value", "resolve"] watchedProperties: ["value", "minimum_value", "maximum_value", "resolve"]
storeIndex: 0 storeIndex: 0
property var resolve: Cura.MachineManager.activeStackId != Cura.MachineManager.activeMachineId ? properties.resolve : "None" property var resolve: Cura.MachineManager.activeStack != Cura.MachineManager.activeMachine ? properties.resolve : "None"
} }
UM.SettingPropertyProvider UM.SettingPropertyProvider
{ {
id: machineExtruderCount id: machineExtruderCount
containerStackId: Cura.MachineManager.activeMachineId containerStack: Cura.MachineManager.activeMachine
key: "machine_extruder_count" key: "machine_extruder_count"
watchedProperties: ["value"] watchedProperties: ["value"]
} }

View file

@ -23,7 +23,7 @@ Item
watchedProperties: ["value", "minimum_value", "maximum_value", "resolve"] watchedProperties: ["value", "minimum_value", "maximum_value", "resolve"]
storeIndex: 0 storeIndex: 0
property var resolve: Cura.MachineManager.activeStackId != Cura.MachineManager.activeMachineId ? properties.resolve : "None" property var resolve: Cura.MachineManager.activeStack != Cura.MachineManager.activeMachine ? properties.resolve : "None"
} }
Rectangle Rectangle

View file

@ -139,7 +139,7 @@ Item {
{ {
id: linkedSettingIcon; id: linkedSettingIcon;
visible: Cura.MachineManager.activeStackId != Cura.MachineManager.activeMachineId && (!definition.settable_per_extruder || String(globalPropertyProvider.properties.limit_to_extruder) != "-1") && base.showLinkedSettingIcon visible: Cura.MachineManager.activeStack != Cura.MachineManager.activeMachine && (!definition.settable_per_extruder || String(globalPropertyProvider.properties.limit_to_extruder) != "-1") && base.showLinkedSettingIcon
height: parent.height; height: parent.height;
width: height; width: height;

View file

@ -607,7 +607,7 @@ Column
{ {
id: machineExtruderCount id: machineExtruderCount
containerStackId: Cura.MachineManager.activeMachineId containerStack: Cura.MachineManager.activeMachine
key: "machine_extruder_count" key: "machine_extruder_count"
watchedProperties: [ "value" ] watchedProperties: [ "value" ]
storeIndex: 0 storeIndex: 0

View file

@ -20,7 +20,6 @@ Item
property variant minimumPrintTime: PrintInformation.minimumPrintTime; property variant minimumPrintTime: PrintInformation.minimumPrintTime;
property variant maximumPrintTime: PrintInformation.maximumPrintTime; property variant maximumPrintTime: PrintInformation.maximumPrintTime;
property bool settingsEnabled: Cura.ExtruderManager.activeExtruderStackId || extrudersEnabledCount.properties.value == 1 property bool settingsEnabled: Cura.ExtruderManager.activeExtruderStackId || extrudersEnabledCount.properties.value == 1
Component.onCompleted: PrintInformation.enabled = true Component.onCompleted: PrintInformation.enabled = true
Component.onDestruction: PrintInformation.enabled = false Component.onDestruction: PrintInformation.enabled = false
UM.I18nCatalog { id: catalog; name: "cura" } UM.I18nCatalog { id: catalog; name: "cura" }
@ -1116,7 +1115,7 @@ Item
UM.SettingPropertyProvider UM.SettingPropertyProvider
{ {
id: platformAdhesionType id: platformAdhesionType
containerStackId: Cura.MachineManager.activeMachineId containerStack: Cura.MachineManager.activeMachine
key: "adhesion_type" key: "adhesion_type"
watchedProperties: [ "value", "enabled" ] watchedProperties: [ "value", "enabled" ]
storeIndex: 0 storeIndex: 0
@ -1125,7 +1124,7 @@ Item
UM.SettingPropertyProvider UM.SettingPropertyProvider
{ {
id: supportEnabled id: supportEnabled
containerStackId: Cura.MachineManager.activeMachineId containerStack: Cura.MachineManager.activeMachine
key: "support_enable" key: "support_enable"
watchedProperties: [ "value", "enabled", "description" ] watchedProperties: [ "value", "enabled", "description" ]
storeIndex: 0 storeIndex: 0
@ -1134,7 +1133,7 @@ Item
UM.SettingPropertyProvider UM.SettingPropertyProvider
{ {
id: extrudersEnabledCount id: extrudersEnabledCount
containerStackId: Cura.MachineManager.activeMachineId containerStack: Cura.MachineManager.activeMachine
key: "extruders_enabled_count" key: "extruders_enabled_count"
watchedProperties: [ "value" ] watchedProperties: [ "value" ]
storeIndex: 0 storeIndex: 0
@ -1143,7 +1142,7 @@ Item
UM.SettingPropertyProvider UM.SettingPropertyProvider
{ {
id: supportExtruderNr id: supportExtruderNr
containerStackId: Cura.MachineManager.activeMachineId containerStack: Cura.MachineManager.activeMachine
key: "support_extruder_nr" key: "support_extruder_nr"
watchedProperties: [ "value" ] watchedProperties: [ "value" ]
storeIndex: 0 storeIndex: 0