mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
Update extruderCount when extrudersModel got changed
CURA-3755 The Timer delay is not reliable for updating the extruder Tabs. So we now rely on the modelChanged signal of the ExtrudersModel to do the update.
This commit is contained in:
parent
04611b06af
commit
9060bbf3b2
1 changed files with 5 additions and 17 deletions
|
@ -16,23 +16,13 @@ Cura.MachineAction
|
|||
property var extrudersModel: Cura.ExtrudersModel{}
|
||||
property int extruderTabsCount: 0
|
||||
|
||||
Component.onCompleted:
|
||||
Connections
|
||||
{
|
||||
// Populate extruder tabs after a short delay, because otherwise the tabs that are added when
|
||||
// the dialog is created are stuck.
|
||||
extruderTabsCountDelay.start();
|
||||
}
|
||||
|
||||
Timer
|
||||
{
|
||||
id: extruderTabsCountDelay
|
||||
repeat: false
|
||||
interval: 1
|
||||
|
||||
onTriggered:
|
||||
target: base.extrudersModel
|
||||
onModelChanged:
|
||||
{
|
||||
var extruderCount = parseInt(machineExtruderCountProvider.properties.value);
|
||||
base.extruderTabsCount = (extruderCount > 1) ? extruderCount : 0;
|
||||
var extruderCount = base.extrudersModel.rowCount();
|
||||
base.extruderTabsCount = extruderCount > 1 ? extruderCount : 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,7 +36,6 @@ Cura.MachineAction
|
|||
onAccepted: manager.onFinishAction()
|
||||
onRejected: manager.onFinishAction()
|
||||
onClosing: manager.onFinishAction()
|
||||
onVisibilityChanged: extruderTabsCountDelay.start()
|
||||
}
|
||||
|
||||
anchors.fill: parent;
|
||||
|
@ -383,7 +372,6 @@ Cura.MachineAction
|
|||
onActivated:
|
||||
{
|
||||
manager.setMachineExtruderCount(index + 1);
|
||||
base.extruderTabsCount = (index > 0) ? index + 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue