mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 14:55:03 -06: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
1 changed files with 18 additions and 2 deletions
|
@ -44,6 +44,10 @@ Cura.ComboBox {
|
|||
|
||||
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.
|
||||
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
|
||||
{
|
||||
id: propertyProvider
|
||||
|
@ -61,8 +76,8 @@ Cura.ComboBox {
|
|||
Connections
|
||||
{
|
||||
target: propertyProvider
|
||||
function onContainerStackChanged() { comboboxModel.updateModel() }
|
||||
function onIsValueUsedChanged() { comboboxModel.updateModel() }
|
||||
function onContainerStackChanged() { updateTimer.restart() }
|
||||
function onIsValueUsedChanged() { updateTimer.restart() }
|
||||
}
|
||||
|
||||
onCurrentIndexChanged: parseValueAndUpdateSetting()
|
||||
|
@ -80,6 +95,7 @@ Cura.ComboBox {
|
|||
{
|
||||
if (updateAllExtruders)
|
||||
{
|
||||
print("UPDATING ALL WITH VALUE: " + value)
|
||||
Cura.MachineManager.setSettingForAllExtruders(propertyProvider.key, "value", value)
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue