X-Git-Url: http://git.maemo.org/git/?p=mardrone;a=blobdiff_plain;f=mardrone%2FConfigDialog.qml;h=81c94fef8cfa557713adbb6e980d6fe3fd1a588b;hp=655cc0f6ec0e6dcedd375739ceb8bf3648a9a1eb;hb=d2f06e4a787ddc997224338dcefe96efe18fae01;hpb=196f6d56fb98af5849cc98d389de421822d3d5e0;ds=sidebyside diff --git a/mardrone/ConfigDialog.qml b/mardrone/ConfigDialog.qml index 655cc0f..81c94fe 100644 --- a/mardrone/ConfigDialog.qml +++ b/mardrone/ConfigDialog.qml @@ -14,6 +14,33 @@ Page { MenuItem { text:"Desktop"; onClicked: { drone.confActiveUI="ardrone_desktop.qml"}} } } + 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 }; + console.debug("appending ",uiList.get(j).name,uiList.get(j).file); + choices.append(data); + if(uiList.get(j).file==drone.confActiveUI) activeUIDialog.selectedIndex=j; + } + } + + ListModel { + id: choices + ListElement { + name:"none"; + file:"none.qml" + } + } + SelectionDialog { + id: activeUIDialog; + model:choices + onSelectedIndexChanged: { + console.debug("onSelectedIndexChanged " + model.get(selectedIndex).name + ", " + model.get(selectedIndex).file); + drone.confActiveUI=choices.get(selectedIndex).file + } + + } Flickable { id: dialogscrolarea anchors.fill: parent @@ -35,7 +62,11 @@ Page { Button { text:drone.confActiveUI anchors.right:parent.right - onClicked:uiMenu.open() + onClicked: { + // activeUIDialog.setSelectedIndex(text); + activeUIDialog.open(); + } + // onClicked:uiMenu.open() } Text { width:350 @@ -205,13 +236,13 @@ 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 - // jStick:js - Component.onCompleted: { - if (jc.status != Component.Ready) - console.log("Error loading component:", jc.errorString()); - } + } }