mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 10:45:54 +08:00
Signal are being emmitted before settings are updated. This is causing the combobox to update with the previous value. Only when using infill_pattern setting though. No idea what is causing this. This is a workaround for now.
CURA-9793
This commit is contained in:
parent
443252ae10
commit
8012cb5360
@ -44,6 +44,10 @@ Cura.ComboBox {
|
|||||||
|
|
||||||
if (propertyProvider.properties.value == key)
|
if (propertyProvider.properties.value == key)
|
||||||
{
|
{
|
||||||
|
print("propertyProvider.properties.value: " + propertyProvider.properties.value)
|
||||||
|
print("key: " + key)
|
||||||
|
print("currentIndex: " + currentIndex)
|
||||||
|
print("i: " + i)
|
||||||
// The combobox is cleared after each value change so the currentIndex must be set each time.
|
// The combobox is cleared after each value change so the currentIndex must be set each time.
|
||||||
currentIndex = i
|
currentIndex = i
|
||||||
}
|
}
|
||||||
@ -51,6 +55,17 @@ Cura.ComboBox {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Updates to the setting are delayed by interval. The signal onIsValueUsedChanged() is emitted early for some reason.
|
||||||
|
// This causes the selected value in the combobox to be updated to the previous value. (This issue is present with infill_pattern setting)
|
||||||
|
// This is a hack. If you see this in the future, try removing it and see if the combobox still works.
|
||||||
|
Timer
|
||||||
|
{
|
||||||
|
id: updateTimer
|
||||||
|
interval: 100
|
||||||
|
repeat: false
|
||||||
|
onTriggered: comboboxModel.updateModel(false)
|
||||||
|
}
|
||||||
|
|
||||||
property UM.SettingPropertyProvider propertyProvider: UM.SettingPropertyProvider
|
property UM.SettingPropertyProvider propertyProvider: UM.SettingPropertyProvider
|
||||||
{
|
{
|
||||||
id: propertyProvider
|
id: propertyProvider
|
||||||
@ -61,8 +76,8 @@ Cura.ComboBox {
|
|||||||
Connections
|
Connections
|
||||||
{
|
{
|
||||||
target: propertyProvider
|
target: propertyProvider
|
||||||
function onContainerStackChanged() { comboboxModel.updateModel() }
|
function onContainerStackChanged() { updateTimer.restart() }
|
||||||
function onIsValueUsedChanged() { comboboxModel.updateModel() }
|
function onIsValueUsedChanged() { updateTimer.restart() }
|
||||||
}
|
}
|
||||||
|
|
||||||
onCurrentIndexChanged: parseValueAndUpdateSetting()
|
onCurrentIndexChanged: parseValueAndUpdateSetting()
|
||||||
@ -80,6 +95,7 @@ Cura.ComboBox {
|
|||||||
{
|
{
|
||||||
if (updateAllExtruders)
|
if (updateAllExtruders)
|
||||||
{
|
{
|
||||||
|
print("UPDATING ALL WITH VALUE: " + value)
|
||||||
Cura.MachineManager.setSettingForAllExtruders(propertyProvider.key, "value", value)
|
Cura.MachineManager.setSettingForAllExtruders(propertyProvider.key, "value", value)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user