diff options
-rw-r--r-- | plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml b/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml index 007db41f2b..3b31a5de36 100644 --- a/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml +++ b/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml @@ -285,18 +285,30 @@ Item optionModel: ListModel { id: extruderCountModel + Component.onCompleted: { - extruderCountModel.clear() + update() + } + + function update() + { + 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". - extruderCountModel.append({ text: String(i), value: String(i) }) + append({ text: String(i), value: String(i) }) } } } + + Connections + { + target: Cura.MachineManager + onGlobalContainerChanged: extruderCountModel.update() + } } } } |