MenuItem { text:"Desktop"; onClicked: { drone.confActiveUI="ardrone_desktop.qml"}}
}
}
+
+ Component.onCompleted: {
+ for(var j = 0; j < uiList.length;++j ) {
+ var data = {'name':uiList[j].name,'modelData':uiList[j].name,'file':uiList[j].file };
+ console.debug("appending ",uiList.get(j).name,uiList.get(j).file)
+ choices.append(data);
+ if(uIList[j].file==drone.confActiveUI) activeUIDialog.selectedIndex=j;
+ }
+ }
+
+ ListModel {
+ id: choices
+ ListElement {
+ name:"none";
+ modelData:"none"
+ file:"none"
+ }
+ }
+ SelectionDialog {
+ id: activeUIDialog;
+ model:uiList
+
+ onSelectedIndexChanged: {
+ console.debug("onSelectedIndexChanged " +selectedIndex);
+ console.debug("onSelectedIndexChanged " +uiList.get(selectedIndex).name);
+ console.debug("onSelectedIndexChanged " + model.get(selectedIndex).name + ", " + model.get(selectedIndex).file);
+ drone.confActiveUI=choices.get(selectedIndex).file
+ }
+
+ }
Flickable {
id: dialogscrolarea
anchors.fill: parent
}
Button {
+ width:200
text:drone.confActiveUI
anchors.right:parent.right
- onClicked:uiMenu.open()
+ onClicked:activeUIDialog.open()
+ // onClicked:uiMenu.open()
}
Text {
width:350
}
Text {
text: "Acceleration Sensor controll"
- color:textColor
+ color:textColor
font.pixelSize :textSize
}
Switch {