mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 07:03:56 -06:00
WIP: Add first-start machine actions
This commit is contained in:
parent
d4c0104bc2
commit
8d68db9ff0
16 changed files with 288 additions and 1559 deletions
|
@ -41,6 +41,7 @@ UM.TooltipArea
|
|||
// callback functions
|
||||
property var forceUpdateOnChangeFunction: dummy_func
|
||||
property var afterOnEditingFinishedFunction: dummy_func
|
||||
property var setValueFunction: null
|
||||
|
||||
// a dummy function for default property values
|
||||
function dummy_func() {}
|
||||
|
@ -76,7 +77,7 @@ UM.TooltipArea
|
|||
for (var i = 0; i < options.length; i++)
|
||||
{
|
||||
var option = options[i].substring(1, options[i].length - 1).split("', '")
|
||||
append({text: option[1], value: option[0]})
|
||||
append({ text: option[1], value: option[0] })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -118,9 +119,17 @@ UM.TooltipArea
|
|||
|
||||
onActivated:
|
||||
{
|
||||
if (propertyProvider.properties.value != model.get(index).value)
|
||||
var newValue = model.get(index).value
|
||||
if (propertyProvider.properties.value != newValue)
|
||||
{
|
||||
propertyProvider.setPropertyValue("value", model.get(index).value)
|
||||
if (setValueFunction !== null)
|
||||
{
|
||||
setValueFunction(newValue)
|
||||
}
|
||||
else
|
||||
{
|
||||
propertyProvider.setPropertyValue("value", newValue)
|
||||
}
|
||||
forceUpdateOnChangeFunction()
|
||||
afterOnEditingFinishedFunction()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue