mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Fix extruder number
most important change was changing ``` currentIndex: function () { ... } ``` to currentIndex: { ... } ``` This changed the behavior so that the variables inside the code blocked are watched so that `currentIndex` is automatically updated. No longer needed to set the `currentIndex` from any where else anymore. CURA-10374
This commit is contained in:
parent
dc22a4980c
commit
71a0044bf8
2 changed files with 10 additions and 17 deletions
|
@ -303,18 +303,17 @@ Item
|
|||
|
||||
Component.onCompleted:
|
||||
{
|
||||
update()
|
||||
updateModel();
|
||||
}
|
||||
|
||||
function update()
|
||||
function updateModel()
|
||||
{
|
||||
clear()
|
||||
for (var i = 1; i <= Cura.MachineManager.activeMachine.maxExtruderCount; i++)
|
||||
{
|
||||
clear();
|
||||
for (var i = 1; i <= Cura.MachineManager.activeMachine.maxExtruderCount; i ++) {
|
||||
// Use String as value. JavaScript only has Number. PropertyProvider.setPropertyValue()
|
||||
// takes a QVariant as value, and Number gets translated into a float. This will cause problem
|
||||
// for integer settings such as "Number of Extruders".
|
||||
append({ text: String(i), value: String(i) })
|
||||
append({ text: String(i), value: String(i) });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -322,7 +321,9 @@ Item
|
|||
Connections
|
||||
{
|
||||
target: Cura.MachineManager
|
||||
function onGlobalContainerChanged() { extruderCountModel.update() }
|
||||
function onGlobalContainerChanged() {
|
||||
extruderCountModel.updateModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue