X-Git-Url: http://git.maemo.org/git/?p=mardrone;a=blobdiff_plain;f=mardrone%2FConfigDialog.qml;h=c68085180e6075cee94112e81a8bd709488aab2b;hp=31690fc1f5700e8e3d4c3cca96827bb9e0c81fef;hb=04dd9eeea7b747c1cee4882673a7e1c17519fe1a;hpb=34003bf968627b6ddf7cc279eb5a26423340cc1c diff --git a/mardrone/ConfigDialog.qml b/mardrone/ConfigDialog.qml index 31690fc..c680851 100644 --- a/mardrone/ConfigDialog.qml +++ b/mardrone/ConfigDialog.qml @@ -1,165 +1,240 @@ -import Qt 4.7 -import com.meego 1.0 +import QtQuick 1.0 +import com.nokia.meego 1.0 +import JoyStick 1.0 Page { + property color textColor:"White" + property int textSize:30 id:dialog + tools:commonTools + + 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,'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; uiDialogButton.text=uiList.get(j).name } + } + } + + ListModel { + id: choices + /* 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; + uiDialogButton.text=uiList.get(selectedIndex).name + } + + } Flickable { id: dialogscrolarea - anchors.top: parent.top - anchors.bottom: parent.bottom - width: parent.width - anchors.leftMargin:50;anchors.rightMargin:50 - - /* anchors.horizontalCenter:parent.horizontalCenter */ - + anchors.fill: parent + // anchors.leftMargin:50;anchors.rightMargin:50 contentHeight: dialogcontent.height contentWidth: parent.width Grid { columns:2 id: dialogcontent - // width: parent.width - anchors.left:parent.left;anchors.right:parent.right - anchors.leftMargin:50;anchors.rightMargin:50 - - spacing: 40 - Text { - width:400 + anchors.leftMargin:50;anchors.rightMargin:150 + spacing: 20 + + Text { + font.pixelSize :textSize + text:"UI Style" + + } + Button { + id:uiDialogButton + text:"" + anchors.right:parent.right + onClicked: { + // activeUIDialog.setSelectedIndex(text); + activeUIDialog.open(); + } + // onClicked:uiMenu.open() + } + Text { + width:350 text: "Drone IP" - + color:textColor + font.pixelSize :textSize } - LineEdit { + + TextField { id: droneip - width:300 + width: 300 + height: 40 + anchors.right: parent.right text: drone.confDroneIp onTextChanged:{drone.confDroneIp=text;} } +// } + Text { - text: "Video 640x480 / Full Screen" + text: "Video 640x480/Full Screen" + color:textColor + font.pixelSize :textSize } Switch { id: fullScreen - // enabled:drone.confFullScreen checked:drone.confFullScreen anchors.right:parent.right - // onEnabledChanged:{drone.confFullScreen=enabled;} onCheckedChanged:{drone.confFullScreen=checked;} } Text { - text: "Acceleration Sensor for controll" + text: "Acceleration Sensor controll" + color:textColor + font.pixelSize :textSize } Switch { id: useAccelSw - // enabled:drone.confUseAccel checked:drone.confUseAccel anchors.right:parent.right -// onEnabledChanged:{drone.confUseAccel=enabled;} onCheckedChanged:{drone.confUseAccel=checked;} } Text { + text: "Joystick" + color:textColor + font.pixelSize :textSize + } + Switch { + id: useJoySw + checked:drone.confUseJoyStick + anchors.right:parent.right + // enabled:js.haveJoyStick + onCheckedChanged:{drone.confUseJoyStick=checked;} + } + + Text { + visible:drone.confUseJoyStick + font.pixelSize :textSize + text:"\"" + js.joyStickName + "\"" + + } + Button { + visible:drone.confUseJoyStick + text:"Calibrate" + anchors.right:parent.right + onClicked:{ + js.calibrate=true + pageStack.push(calibrateDialog); + } + } + Text { + visible:drone.confUseJoyStick + font.pixelSize :textSize + text:"Show JoyStick Indicators" + + } + Switch { + visible:drone.confUseJoyStick + checked:drone.confShowJSIndicators + anchors.right:parent.right + enabled:js.haveJoyStick + onCheckedChanged:{drone.confShowJSIndicators=checked;} + + } + Text { + color:textColor text: "Show debug" + font.pixelSize :textSize } Switch { id: showDebug - // enabled:drone.confShowDebug checked:drone.confShowDebug anchors.right:parent.right -// onEnabledChanged:{drone.confShowDebug=enabled;} onCheckedChanged:{drone.confShowDebug=checked;} } Text { text: "Show engine gauges" + color:textColor + font.pixelSize :textSize } Switch { id: showGauges -// enabled:drone.confShowGauges checked:drone.confShowGauges anchors.right:parent.right -// onEnabledChanged:{drone.confShowGauges=enabled;} onCheckedChanged:{drone.confShowGauges=checked;} } Text { text: "Show horizon" + color:textColor + font.pixelSize :textSize } Switch { id: showHorizon checked:drone.confShowHorizon anchors.right:parent.right - onCheckedChanged:{drone.onfconfShowHorizon=enabled;} + onCheckedChanged:{drone.confShowHorizon=checked;} } Text { text: "Forward/backward gain" + color:textColor + font.pixelSize :textSize } Slider { id: forwardGain anchors.right:parent.right maximumValue:1.0 - // stepSize:0.01 - steps:0.01 + stepSize:0.01 value:drone.confForwardGain onValueChanged:{drone.confForwardGain=value;} } - /* - Text { - text: "Backward gain" - } - - Slider { - id: backwardGain - anchors.right:parent.right - maximumValue:1.0 - // stepSize:0.01 - steps:0.01 - value:drone.confBackwardGain - onValueChanged:{drone.confBackwardGain=value;} - } - - Text { - text: "Left gain" - } - - Slider { - id: leftGain - anchors.right:parent.right - maximumValue:1.0 - // stepSize:0.01 - steps:0.01 - value:drone.confLeftGain - onValueChanged:{drone.confLeftGain=value;} - } -*/ Text { text: "Right/Left gain" + color:textColor + font.pixelSize :textSize } Slider { id: rightGain anchors.right:parent.right maximumValue:1.0 - // stepSize:0.01 - steps:0.01 + stepSize:0.01 value:drone.confRightGain onValueChanged:{drone.confRightGain=value;} } Text { text: "accel ctrl treshold" + color:textColor + font.pixelSize :textSize } Slider { id: ctrlTreshold anchors.right:parent.right - // maximumValue:25.0 - // stepSize:0.01 - // steps:1 + maximumValue:25.0 value:drone.confCtrlTrsh onValueChanged:{drone.confCtrlTrsh=value;} } } } + Page { + property color textColor:"black" + property int textSize:30 + id:calibrateDialog + tools:commonTools + JoyStickCalibrator { + id:jc + + } + + } } +