mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-08 22:35:03 -06:00
Merge remote-tracking branch 'origin/4.1' into CURA-6483_fix_add_by_ip
This commit is contained in:
commit
1e89ce3673
4 changed files with 23 additions and 4 deletions
|
@ -35,6 +35,8 @@ class FirstStartMachineActionsModel(ListModel):
|
|||
self._application = application
|
||||
self._application.initializationFinished.connect(self._initialize)
|
||||
|
||||
self._previous_global_stack = None
|
||||
|
||||
def _initialize(self) -> None:
|
||||
self._application.getMachineManager().globalContainerChanged.connect(self._update)
|
||||
self._update()
|
||||
|
@ -86,6 +88,12 @@ class FirstStartMachineActionsModel(ListModel):
|
|||
self.setItems([])
|
||||
return
|
||||
|
||||
# Do not update if the machine has not been switched. This can cause the SettingProviders on the Machine
|
||||
# Setting page to do a force update, but they can use potential outdated cached values.
|
||||
if self._previous_global_stack is not None and global_stack.getId() == self._previous_global_stack.getId():
|
||||
return
|
||||
self._previous_global_stack = global_stack
|
||||
|
||||
definition_id = global_stack.definition.getId()
|
||||
first_start_actions = self._application.getMachineActionManager().getFirstStartActions(definition_id)
|
||||
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,6 +69,7 @@ UM.TooltipArea
|
|||
background: Rectangle
|
||||
{
|
||||
color: UM.Theme.getColor("main_background")
|
||||
anchors.fill: parent
|
||||
|
||||
border.color:
|
||||
{
|
||||
|
|
|
@ -76,6 +76,4 @@ NumericTextFieldWithUnit
|
|||
forceUpdateOnChangeFunction()
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: add forceUpdateOnChangeFunction:
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue