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