sync repo
[mardrone] / mardrone / ConfigDialogDesktop.qml
index 3c84204..3a4dbaf 100644 (file)
@@ -11,39 +11,57 @@ Rectangle {
 
         anchors.fill: parent
         TabFrame {
 
         anchors.fill: parent
         TabFrame {
+            anchors.fill:parent
         Tab {
              title: "Display"
         Tab {
              title: "Display"
-          id: displayTab
-          anchors.fill: parent
+            id: displayTab
+            anchors.fill: parent
        //   anchors.leftMargin:50;anchors.rightMargin:50
 
           Grid {
               columns:2
               id: dialogcontent
        //   anchors.leftMargin:50;anchors.rightMargin:50
 
           Grid {
               columns:2
               id: dialogcontent
+              anchors.fill:parent
+              anchors.topMargin: 50
               anchors.leftMargin:50;anchors.rightMargin:50
               spacing: 20
 
               anchors.leftMargin:50;anchors.rightMargin:50
               spacing: 20
 
-/*           Text {
+           Text {
                   font.pixelSize  :textSize
                   text:"UI Style"
 
           }
                   font.pixelSize  :textSize
                   text:"UI Style"
 
           }
+
+           Component.onCompleted: {
+               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) activeUICombo.selectedIndex=j;
+               }
+           }
+
+           ListModel {
+                           id: choices
+                           ListElement { text: "MeeGo/Harmattan";file:"ardrone_harmattan.qml" }
+                           ListElement { text: "Symbian";file:"ardrone_symbian.qml" }
+                           ListElement { text: "Desktop";file:"ardrone_desktop.qml" }
+            }
         ComboBox {
               id: activeUICombo;
         ComboBox {
               id: activeUICombo;
-              model:  ListModel {
-                id: choices
-                ListElement { text: "MeeGo/Harmattan";file:"ardrone_harmattan.qml" }
-                ListElement { text: "Desktop";file:"ardrone_desktop.qml" }
-                }
+              width:200
+              model:uiList
               onSelectedIndexChanged: {
               onSelectedIndexChanged: {
-                  console.debug("onSelectedIndexChanged " + selectedText + ", " + choices.get(selectedIndex).file);
-                  drone.confActiveUI=choices.get(selectedIndex).file
+                  console.debug("onSelectedIndexChanged " + selectedText + ", " + model.get(selectedIndex).file);
+                  drone.confActiveUI=model.get(selectedIndex).file
               }
               }
-              selectedText:drone.confActiveUI
-              KeyNavigation.tab: t1
-              KeyNavigation.backtab: button2
+
+
+             // KeyNavigation.tab: t1
+              //KeyNavigation.backtab: button2
            }
            }
-*/
+
           Text {
               width:200
               text: "Drone IP"
           Text {
               width:200
               text: "Drone IP"
@@ -116,6 +134,8 @@ Rectangle {
               title: "Control"
               Grid {
                   columns:2
               title: "Control"
               Grid {
                   columns:2
+                  anchors.fill:parent
+                  anchors.topMargin: 50
                   anchors.leftMargin:50;anchors.rightMargin:50
                   spacing: 20
            Text {
                   anchors.leftMargin:50;anchors.rightMargin:50
                   spacing: 20
            Text {
@@ -144,13 +164,13 @@ Rectangle {
            }
 
            Text {
            }
 
            Text {
-               visible:drone.confUseJoyStick
+               visible:drone.confUseJoyStick & js.haveJoyStick
                font.pixelSize  :textSize
                text:"\"" + js.joyStickName + "\""
 
            }
            Button {
                font.pixelSize  :textSize
                text:"\"" + js.joyStickName + "\""
 
            }
            Button {
-               visible:drone.confUseJoyStick
+               visible:drone.confUseJoyStick & js.haveJoyStick
                text:"Calibrate"
                anchors.right:parent.right
               onClicked:{   joyStickCalibrator.visible = true;
                text:"Calibrate"
                anchors.right:parent.right
               onClicked:{   joyStickCalibrator.visible = true;