Sync refactoring for multiple platforms
[mardrone] / mardrone / ConfigDialogDesktop.qml
1 import QtQuick 1.0
2 import QtDesktop 0.1
3 Rectangle {
4
5     property int textSize:20
6     property color textColor:"black"
7         id:dialog
8         CalibrateDialogDesktop {
9             id:joyStickCalibrator
10         }
11
12         anchors.fill: parent
13         TabFrame {
14         Tab {
15              title: "Display"
16           id: displayTab
17           anchors.fill: parent
18        //   anchors.leftMargin:50;anchors.rightMargin:50
19
20           Grid {
21               columns:2
22               id: dialogcontent
23               anchors.leftMargin:50;anchors.rightMargin:50
24               spacing: 20
25
26 /*           Text {
27                   font.pixelSize  :textSize
28                   text:"UI Style"
29
30           }
31         ComboBox {
32               id: activeUICombo;
33               model:  ListModel {
34                 id: choices
35                 ListElement { text: "MeeGo/Harmattan";file:"ardrone_harmattan.qml" }
36                 ListElement { text: "Desktop";file:"ardrone_desktop.qml" }
37                 }
38               onSelectedIndexChanged: {
39                   console.debug("onSelectedIndexChanged " + selectedText + ", " + choices.get(selectedIndex).file);
40                   drone.confActiveUI=choices.get(selectedIndex).file
41               }
42               selectedText:drone.confActiveUI
43               KeyNavigation.tab: t1
44               KeyNavigation.backtab: button2
45            }
46 */
47           Text {
48               width:200
49               text: "Drone IP"
50               color:textColor
51               font.pixelSize  :textSize
52            }
53
54            TextField {
55                   id: droneip
56                   width: 200
57                   height: 40
58                   anchors.right: parent.right
59                   text: drone.confDroneIp
60                   onTextChanged:{drone.confDroneIp=text;}
61            }
62
63 //          }
64
65            Text {
66               text: "Video 640x480 / Full Screen"
67               color:textColor
68               font.pixelSize  :textSize
69            }
70            CheckBox {
71               id: fullScreen
72               checked:drone.confFullScreen
73               anchors.right:parent.right
74               onCheckedChanged:{drone.confFullScreen=checked;}
75            }
76            Text {
77               color:textColor
78               text: "Show debug"
79               font.pixelSize  :textSize
80            }
81            CheckBox {
82               id: showDebug
83               checked:drone.confShowDebug
84               anchors.right:parent.right
85               onCheckedChanged:{drone.confShowDebug=checked;}
86            }
87
88            Text {
89               text: "Show engine gauges"
90               color:textColor
91               font.pixelSize  :textSize
92
93            }
94            CheckBox {
95               id: showGauges
96               checked:drone.confShowGauges
97               anchors.right:parent.right
98               onCheckedChanged:{drone.confShowGauges=checked;}
99            }
100
101            Text {
102               text: "Show horizon"
103               color:textColor
104               font.pixelSize  :textSize
105
106            }
107            CheckBox {
108               id: showHorizon
109               checked:drone.confShowHorizon
110               anchors.right:parent.right
111               onCheckedChanged:{drone.confShowHorizon=checked;}
112            }
113           } // Grid
114           } // tab
115           Tab {
116               title: "Control"
117               Grid {
118                   columns:2
119                   anchors.leftMargin:50;anchors.rightMargin:50
120                   spacing: 20
121            Text {
122               text: "Acceleration Sensor for controll"
123               color:textColor
124               font.pixelSize  :textSize
125            }
126            CheckBox {
127               id: useAccelSw
128               checked:drone.confUseAccel
129               anchors.right:parent.right
130               onCheckedChanged:{drone.confUseAccel=checked;}
131            }
132
133            Text {
134                text: "Joystick"
135               color:textColor
136               font.pixelSize  :textSize
137            }
138            CheckBox {
139               id: useJoySw
140               checked:drone.confUseJoyStick
141               anchors.right:parent.right
142               enabled:js.haveJoyStick
143               onCheckedChanged:{drone.confUseJoyStick=checked;}
144            }
145
146            Text {
147                visible:drone.confUseJoyStick
148                font.pixelSize  :textSize
149                text:"\"" + js.joyStickName + "\""
150
151            }
152            Button {
153                visible:drone.confUseJoyStick
154                text:"Calibrate"
155                anchors.right:parent.right
156               onClicked:{   joyStickCalibrator.visible = true;
157                    js.calibrate=true
158                }
159            }
160            Text {
161                visible:drone.confUseJoyStick
162                font.pixelSize  :textSize
163                text:"Show JoyStick Indicators"
164
165            }
166             CheckBox {
167                visible:drone.confUseJoyStick
168                checked:drone.confShowJSIndicators
169                anchors.right:parent.right
170                enabled:js.haveJoyStick
171                onCheckedChanged:{drone.confShowJSIndicators=checked;}
172
173            }
174
175
176            Text {
177               text: "Forward/backward gain"
178               color:textColor
179               font.pixelSize  :textSize
180            }
181
182            Slider {
183               id: forwardGain
184               anchors.right:parent.right
185               maximumValue:1.0
186               stepSize:0.01
187               value:drone.confForwardGain
188               onValueChanged:{drone.confForwardGain=value;}
189            }
190            Text {
191               text: "Right/Left gain"
192               color:textColor
193               font.pixelSize  :textSize
194            }
195
196            Slider {
197               id: rightGain
198               anchors.right:parent.right
199               maximumValue:1.0
200               stepSize:0.01
201               value:drone.confRightGain
202               onValueChanged:{drone.confRightGain=value;}
203            }
204            Text {
205               text: "accel ctrl treshold"
206               color:textColor
207               font.pixelSize  :textSize
208            }
209
210            Slider {
211               id: ctrlTreshold
212               anchors.right:parent.right
213               maximumValue:25.0
214               value:drone.confCtrlTrsh
215               onValueChanged:{drone.confCtrlTrsh=value;}
216            }
217           }
218        }
219         }
220      }