import com.nokia.meego 1.0
import JoyStick 1.0
Page {
- property color textColor:"black"
+ property color textColor:"White"
property int textSize:30
id:dialog
tools:commonTools
- Menu {
- id:uiMenu
- visualParent:pageStack
- MenuLayout {
- MenuItem { text:"MeeGo/Harmattan 854x480"; onClicked: { drone.confActiveUI="ardrone_harmattan.qml" }}
- 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,'modelData':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;
+ if(uiList.get(j).file==drone.confActiveUI) { activeUIDialog.selectedIndex=j; uiDialogButton.text=uiList.get(j).name }
}
}
ListModel {
id: choices
- ListElement {
- name:"none";
- file:"none.qml"
- }
+ /* ListElement {name:"xyzzy" ;file:"plugh.qml"}
+ ListElement {name:"xyzzy2" ;file:"plugh.qml"}*/
}
SelectionDialog {
id: activeUIDialog;
+ height:400
model:choices
onSelectedIndexChanged: {
- console.debug("onSelectedIndexChanged " + model.get(selectedIndex).name + ", " + model.get(selectedIndex).file);
- drone.confActiveUI=choices.get(selectedIndex).file
- }
+ console.debug("onSelectedIndexChanged " + model.get(selectedIndex).name + ", " + model.get(selectedIndex).file);
+ drone.confActiveUI=choices.get(selectedIndex).file;
+ uiDialogButton.text=uiList.get(selectedIndex).name
+ }
}
Flickable {
}
Button {
- text:drone.confActiveUI
+ id:uiDialogButton
+ text:""
anchors.right:parent.right
onClicked: {
// activeUIDialog.setSelectedIndex(text);
id: useJoySw
checked:drone.confUseJoyStick
anchors.right:parent.right
- enabled:js.haveJoyStick
+ // enabled:js.haveJoyStick
onCheckedChanged:{drone.confUseJoyStick=checked;}
}
Text {
text: "Show engine gauges"
- color:textColor
+ color:textColor
font.pixelSize :textSize
}
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