Cync
[mardrone] / mardrone / ConfigDialog.qml
index 81c94fe..f306388 100644 (file)
@@ -17,28 +17,28 @@ Page {
         Component.onCompleted: {
             console.debug("Appending items to choices",uiList.count())
             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,'modelData':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) activeUIDialog.selectedIndex=j;
+                if(uiList.get(j).file==drone.confActiveUI) { activeUIDialog.selectedIndex=j; uiDialogButton.text=uiList.get(j).name }
             }
         }
 
         ListModel {
              id: choices
-             ListElement {
-                 name:"none";
-                 file:"none.qml"
-             }
+      /*       ListElement {name:"xyzzy" ;file:"plugh.qml"}
+             ListElement {name:"xyzzy2" ;file:"plugh.qml"}*/
         }
         SelectionDialog {
             id: activeUIDialog;
+            height:400
             model:choices
             onSelectedIndexChanged: {
-                          console.debug("onSelectedIndexChanged " + model.get(selectedIndex).name + ", " + model.get(selectedIndex).file);
-                          drone.confActiveUI=choices.get(selectedIndex).file
-                      }
+                  console.debug("onSelectedIndexChanged " + model.get(selectedIndex).name + ", " + model.get(selectedIndex).file);
+                  drone.confActiveUI=choices.get(selectedIndex).file;
+                  uiDialogButton.text=uiList.get(selectedIndex).name
+               }
 
             }
         Flickable {
@@ -60,7 +60,8 @@ Page {
 
               }
               Button {
-                  text:drone.confActiveUI
+                  id:uiDialogButton
+                  text:""
                   anchors.right:parent.right
                   onClicked: {
                   //    activeUIDialog.setSelectedIndex(text);
@@ -117,7 +118,7 @@ Page {
               id: useJoySw
               checked:drone.confUseJoyStick
               anchors.right:parent.right
-              enabled:js.haveJoyStick
+           //   enabled:js.haveJoyStick
               onCheckedChanged:{drone.confUseJoyStick=checked;}
            }
 
@@ -164,7 +165,7 @@ Page {
 
            Text {
               text: "Show engine gauges"
-             color:textColor
+              color:textColor
               font.pixelSize  :textSize
 
            }
@@ -236,10 +237,6 @@ Page {
                 property int textSize:30
                 id:calibrateDialog
                 tools:commonTools
-                Component.onCompleted: {
-                if (calibrateDialog.status != Component.Ready)
-                    console.log("Error loading component:", calibrateDialog.errorString());
-                }
                 JoyStickCalibrator {
                     id:jc