MenuItem { text:"Desktop"; onClicked: { drone.confActiveUI="ardrone_desktop.qml"}}
}
}
+ Component.onCompleted: {
+ console.debug("Appending items to choices",uiList.count())
+ for(var j = 0; j < uiList.count();++j ) {
+ var data = {'name':uiList.get(j).name,'file':uiList.get(j).file };
+ // var data = {'name':uiList.get(j).name };
+ console.debug("appending ",uiList.get(j).name,uiList.get(j).file);
+ choices.append(data);
+ if(uiList.get(j).file==drone.confActiveUI) activeUIDialog.selectedIndex=j;
+ }
+ }
+
+ ListModel {
+ id: choices
+ ListElement {
+ name:"none";
+ file:"none.qml"
+ }
+ }
+ SelectionDialog {
+ id: activeUIDialog;
+ model:choices
+ onSelectedIndexChanged: {
+ console.debug("onSelectedIndexChanged " + model.get(selectedIndex).name + ", " + model.get(selectedIndex).file);
+ drone.confActiveUI=choices.get(selectedIndex).file
+ }
+
+ }
Flickable {
id: dialogscrolarea
anchors.fill: parent
Button {
text:drone.confActiveUI
anchors.right:parent.right
- onClicked:uiMenu.open()
+ onClicked: {
+ // activeUIDialog.setSelectedIndex(text);
+ activeUIDialog.open();
+ }
+ // onClicked:uiMenu.open()
}
Text {
width:350
property int textSize:30
id:calibrateDialog
tools:commonTools
+ Component.onCompleted: {
+ if (calibrateDialog.status != Component.Ready)
+ console.log("Error loading component:", calibrateDialog.errorString());
+ }
JoyStickCalibrator {
id:jc
- // jStick:js
- Component.onCompleted: {
- if (jc.status != Component.Ready)
- console.log("Error loading component:", jc.errorString());
- }
+
}
}