|
@@ -87,34 +87,32 @@ SettingItem
|
|
|
}
|
|
|
|
|
|
onActivated: { forceActiveFocus(); propertyProvider.setPropertyValue("value", definition.options[index].key) }
|
|
|
- onModelChanged: updateCurrentIndex();
|
|
|
|
|
|
- Connections
|
|
|
+ Binding
|
|
|
{
|
|
|
- target: propertyProvider
|
|
|
- onPropertiesChanged: control.updateCurrentIndex()
|
|
|
- }
|
|
|
-
|
|
|
- function updateCurrentIndex() {
|
|
|
- // FIXME this needs to go away once 'resolve' is combined with 'value' in our data model.
|
|
|
- var value;
|
|
|
- if ((propertyProvider.properties.resolve != "None") && (stackLevel != 0) && (stackLevel != 1)) {
|
|
|
- // We have a resolve function. Indicates that the setting is not settable per extruder and that
|
|
|
- // we have to choose between the resolved value (default) and the global value
|
|
|
- // (if user has explicitly set this).
|
|
|
- value = propertyProvider.properties.resolve;
|
|
|
- } else {
|
|
|
- value = propertyProvider.properties.value;
|
|
|
- }
|
|
|
+ target: control
|
|
|
+ property: "currentIndex"
|
|
|
+ value:
|
|
|
+ {
|
|
|
+ // FIXME this needs to go away once 'resolve' is combined with 'value' in our data model.
|
|
|
+ var value;
|
|
|
+ if ((propertyProvider.properties.resolve != "None") && (base.stackLevel != 0) && (base.stackLevel != 1)) {
|
|
|
+ // We have a resolve function. Indicates that the setting is not settable per extruder and that
|
|
|
+ // we have to choose between the resolved value (default) and the global value
|
|
|
+ // (if user has explicitly set this).
|
|
|
+ value = propertyProvider.properties.resolve;
|
|
|
+ } else {
|
|
|
+ value = propertyProvider.properties.value;
|
|
|
+ }
|
|
|
|
|
|
- for(var i = 0; i < definition.options.length; ++i) {
|
|
|
- if(definition.options[i].key == value) {
|
|
|
- currentIndex = i;
|
|
|
- return;
|
|
|
+ for(var i = 0; i < control.model.length; ++i) {
|
|
|
+ if(control.model[i].key == value) {
|
|
|
+ return i;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- currentIndex = -1;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|