Sync refactoring for multiple platforms
[mardrone] / mardrone / ConfigDialogDesktop.qml
index 0dd03a5..3c84204 100644 (file)
@@ -2,16 +2,20 @@ import QtQuick 1.0
 import QtDesktop 0.1
 Rectangle {
 
-        property int textSize:12
+    property int textSize:20
+    property color textColor:"black"
         id:dialog
+        CalibrateDialogDesktop {
+            id:joyStickCalibrator
+        }
 
         anchors.fill: parent
-        Flickable {
-          id: dialogscrolarea
+        TabFrame {
+        Tab {
+             title: "Display"
+          id: displayTab
           anchors.fill: parent
        //   anchors.leftMargin:50;anchors.rightMargin:50
-          contentHeight: dialogcontent.height
-          contentWidth: parent.width
 
           Grid {
               columns:2
@@ -19,12 +23,12 @@ Rectangle {
               anchors.leftMargin:50;anchors.rightMargin:50
               spacing: 20
 
-         Text {
+/*           Text {
                   font.pixelSize  :textSize
                   text:"UI Style"
 
           }
-          ComboBox {
+        ComboBox {
               id: activeUICombo;
               model:  ListModel {
                 id: choices
@@ -32,14 +36,14 @@ Rectangle {
                 ListElement { text: "Desktop";file:"ardrone_desktop.qml" }
                 }
               onSelectedIndexChanged: {
-                  console.debug(selectedText + ", " + choices.get(selectedIndex).file);
+                  console.debug("onSelectedIndexChanged " + selectedText + ", " + choices.get(selectedIndex).file);
                   drone.confActiveUI=choices.get(selectedIndex).file
               }
-
+              selectedText:drone.confActiveUI
               KeyNavigation.tab: t1
               KeyNavigation.backtab: button2
            }
-
+*/
           Text {
               width:200
               text: "Drone IP"
@@ -70,30 +74,7 @@ Rectangle {
               onCheckedChanged:{drone.confFullScreen=checked;}
            }
            Text {
-              text: "Acceleration Sensor for controll"
-             color:textColor
-              font.pixelSize  :textSize
-           }
-           CheckBox {
-              id: useAccelSw
-              checked:drone.confUseAccel
-              anchors.right:parent.right
-              onCheckedChanged:{drone.confUseAccel=checked;}
-           }
-           Text {
-              text: "Joystick for controll"
-             color:textColor
-              font.pixelSize  :textSize
-           }
-           CheckBox {
-              id: useJoySw
-              checked:drone.confUseJoyStick
-              anchors.right:parent.right
-             enabled:drone.confHaveJoyStick
-              onCheckedChanged:{drone.confUseJoyStick=checked;}
-           }
-           Text {
-             color:textColor
+              color:textColor
               text: "Show debug"
               font.pixelSize  :textSize
            }
@@ -106,7 +87,7 @@ Rectangle {
 
            Text {
               text: "Show engine gauges"
-             color:textColor
+              color:textColor
               font.pixelSize  :textSize
 
            }
@@ -119,7 +100,7 @@ Rectangle {
 
            Text {
               text: "Show horizon"
-             color:textColor
+              color:textColor
               font.pixelSize  :textSize
 
            }
@@ -129,6 +110,68 @@ Rectangle {
               anchors.right:parent.right
               onCheckedChanged:{drone.confShowHorizon=checked;}
            }
+          } // Grid
+          } // tab
+          Tab {
+              title: "Control"
+              Grid {
+                  columns:2
+                  anchors.leftMargin:50;anchors.rightMargin:50
+                  spacing: 20
+           Text {
+              text: "Acceleration Sensor for controll"
+             color:textColor
+              font.pixelSize  :textSize
+           }
+           CheckBox {
+              id: useAccelSw
+              checked:drone.confUseAccel
+              anchors.right:parent.right
+              onCheckedChanged:{drone.confUseAccel=checked;}
+           }
+
+           Text {
+               text: "Joystick"
+              color:textColor
+              font.pixelSize  :textSize
+           }
+           CheckBox {
+              id: useJoySw
+              checked:drone.confUseJoyStick
+              anchors.right:parent.right
+              enabled:js.haveJoyStick
+              onCheckedChanged:{drone.confUseJoyStick=checked;}
+           }
+
+           Text {
+               visible:drone.confUseJoyStick
+               font.pixelSize  :textSize
+               text:"\"" + js.joyStickName + "\""
+
+           }
+           Button {
+               visible:drone.confUseJoyStick
+               text:"Calibrate"
+               anchors.right:parent.right
+              onClicked:{   joyStickCalibrator.visible = true;
+                   js.calibrate=true
+               }
+           }
+           Text {
+               visible:drone.confUseJoyStick
+               font.pixelSize  :textSize
+               text:"Show JoyStick Indicators"
+
+           }
+            CheckBox {
+               visible:drone.confUseJoyStick
+               checked:drone.confShowJSIndicators
+               anchors.right:parent.right
+               enabled:js.haveJoyStick
+               onCheckedChanged:{drone.confShowJSIndicators=checked;}
+
+           }
+
 
            Text {
               text: "Forward/backward gain"
@@ -173,4 +216,5 @@ Rectangle {
            }
           }
        }
+        }
      }