sync repo
[mardrone] / mardrone / ConfigDialogSymbian.qml
index d76f723..e96d848 100644 (file)
@@ -14,6 +14,36 @@ Page {
                 MenuItem { text:"Desktop";  onClicked: { drone.confActiveUI="ardrone_desktop.qml"}}
            }
         }
+
+        Component.onCompleted: {
+            for(var j = 0; j < uiList.length;++j ) {
+                var data = {'name':uiList[j].name,'modelData':uiList[j].name,'file':uiList[j].file };
+                console.debug("appending ",uiList.get(j).name,uiList.get(j).file)
+                choices.append(data);
+                if(uIList[j].file==drone.confActiveUI) activeUIDialog.selectedIndex=j;
+            }
+        }
+
+        ListModel {
+             id: choices
+             ListElement {
+                 name:"none";
+                 modelData:"none"
+                 file:"none"
+             }
+        }
+        SelectionDialog {
+            id: activeUIDialog;
+            model:uiList
+
+            onSelectedIndexChanged: {
+                console.debug("onSelectedIndexChanged " +selectedIndex);
+            console.debug("onSelectedIndexChanged " +uiList.get(selectedIndex).name);
+                          console.debug("onSelectedIndexChanged " + model.get(selectedIndex).name + ", " + model.get(selectedIndex).file);
+                          drone.confActiveUI=choices.get(selectedIndex).file
+                      }
+
+            }
         Flickable {
           id: dialogscrolarea
           anchors.fill: parent
@@ -33,9 +63,11 @@ Page {
 
               }
               Button {
+                  width:200
                   text:drone.confActiveUI
                   anchors.right:parent.right
-                  onClicked:uiMenu.open()
+                  onClicked:activeUIDialog.open()
+                //  onClicked:uiMenu.open()
               }
           Text {
               width:350
@@ -68,7 +100,7 @@ Page {
            }
            Text {
               text: "Acceleration Sensor controll"
-             color:textColor
+              color:textColor
               font.pixelSize  :textSize
            }
            Switch {