mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Fix broken combobox
CURA-9793
This commit is contained in:
parent
b53c8aac54
commit
788ab7da1b
1 changed files with 27 additions and 10 deletions
|
@ -68,20 +68,37 @@ UM.TooltipArea
|
||||||
function updateModel()
|
function updateModel()
|
||||||
{
|
{
|
||||||
clear()
|
clear()
|
||||||
// Options come in as a string-representation of an OrderedDict
|
|
||||||
if(propertyProvider.properties.options)
|
if(!propertyProvider.properties.options)
|
||||||
{
|
{
|
||||||
var options = propertyProvider.properties.options.match(/^OrderedDict\(\[\((.*)\)\]\)$/);
|
return
|
||||||
if(options)
|
}
|
||||||
|
|
||||||
|
for (var i = 0; i < propertyProvider.properties["options"].keys().length; i++)
|
||||||
|
{
|
||||||
|
var key = propertyProvider.properties["options"].keys()[i]
|
||||||
|
var value = propertyProvider.properties["options"][key]
|
||||||
|
append({ text: value, code: key})
|
||||||
|
|
||||||
|
if (propertyProvider.properties.value == key)
|
||||||
{
|
{
|
||||||
options = options[1].split("), (");
|
currentIndex = i
|
||||||
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] });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// // Options come in as a string-representation of an OrderedDict
|
||||||
|
// if(propertyProvider.properties.options)
|
||||||
|
// {
|
||||||
|
// var options = propertyProvider.properties.options.match(/^OrderedDict\(\[\((.*)\)\]\)$/);
|
||||||
|
// if(options)
|
||||||
|
// {
|
||||||
|
// options = options[1].split("), (");
|
||||||
|
// 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] });
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: updateModel()
|
Component.onCompleted: updateModel()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue