Commit 2c32084d authored by dogmaphobic's avatar dogmaphobic

Fixing some of the settings logic.

Disabling the Attitude Indicator for non map view would leave a blank screen.
parent 57c2506d
...@@ -80,7 +80,7 @@ Rectangle { ...@@ -80,7 +80,7 @@ Rectangle {
mapBackground.visible = getBool(flightDisplay.loadSetting("showMapBackground", "0")); mapBackground.visible = getBool(flightDisplay.loadSetting("showMapBackground", "0"));
mapBackground.alwaysNorth = getBool(flightDisplay.loadSetting("mapAlwaysPointsNorth", "0")); mapBackground.alwaysNorth = getBool(flightDisplay.loadSetting("mapAlwaysPointsNorth", "0"));
showAttitudeIndicator = getBool(flightDisplay.loadSetting("showAttitudeIndicator", "1")); showAttitudeIndicator = getBool(flightDisplay.loadSetting("showAttitudeIndicator", "1"));
showPitchIndicator = getBool(flightDisplay.loadSetting("showPitchWidget", "1")); showPitchIndicator = getBool(flightDisplay.loadSetting("showPitchIndicator", "1"));
showCompass = getBool(flightDisplay.loadSetting("showCompass", "1")); showCompass = getBool(flightDisplay.loadSetting("showCompass", "1"));
altitudeWidget.visible = getBool(flightDisplay.loadSetting("showAltitudeWidget", "1")); altitudeWidget.visible = getBool(flightDisplay.loadSetting("showAltitudeWidget", "1"));
speedWidget.visible = getBool(flightDisplay.loadSetting("showSpeedWidget", "1")); speedWidget.visible = getBool(flightDisplay.loadSetting("showSpeedWidget", "1"));
...@@ -161,11 +161,32 @@ Rectangle { ...@@ -161,11 +161,32 @@ Rectangle {
text: "Pitch Indicator" text: "Pitch Indicator"
checkable: true checkable: true
checked: showPitchIndicator checked: showPitchIndicator
enabled: !mapBackground.visible
onTriggered: onTriggered:
{ {
pitchWidget.visible = !pitchWidget.visible; showPitchIndicator = !showPitchIndicator;
flightDisplay.saveSetting("showPitchWidget", setBool(pitchWidget.visible)); flightDisplay.saveSetting("showPitchIndicator", setBool(showPitchIndicator));
}
}
MenuItem {
text: "Attitude Indicator"
checkable: true
checked: showAttitudeIndicator
onTriggered:
{
showAttitudeIndicator = !showAttitudeIndicator;
flightDisplay.saveSetting("showAttitudeIndicator", setBool(showAttitudeIndicator));
}
}
MenuItem {
text: "Compass"
checkable: true
checked: showCompass
onTriggered:
{
showCompass = !showCompass;
flightDisplay.saveSetting("showCompass", setBool(showCompass));
} }
} }
...@@ -235,28 +256,6 @@ Rectangle { ...@@ -235,28 +256,6 @@ Rectangle {
} }
} }
MenuItem {
text: "Compass"
checkable: true
checked: showCompass
onTriggered:
{
showCompass = !showCompass;
flightDisplay.saveSetting("showCompass", setBool(showCompass));
}
}
MenuItem {
text: "Attitude Indicator"
checkable: true
checked: showAttitudeIndicator
onTriggered:
{
showAttitudeIndicator = !showAttitudeIndicator;
flightDisplay.saveSetting("showAttitudeIndicator", setBool(showAttitudeIndicator));
}
}
MenuSeparator {} MenuSeparator {}
MenuItem { MenuItem {
...@@ -264,7 +263,7 @@ Rectangle { ...@@ -264,7 +263,7 @@ Rectangle {
onTriggered: onTriggered:
{ {
showPitchIndicator = true; showPitchIndicator = true;
flightDisplay.saveSetting("showPitchWidget", setBool(showPitchIndicator)); flightDisplay.saveSetting("showPitchIndicator", setBool(showPitchIndicator));
showAttitudeIndicator = true; showAttitudeIndicator = true;
flightDisplay.saveSetting("showAttitudeIndicator", setBool(showAttitudeIndicator)); flightDisplay.saveSetting("showAttitudeIndicator", setBool(showAttitudeIndicator));
showCompass = true; showCompass = true;
...@@ -305,7 +304,8 @@ Rectangle { ...@@ -305,7 +304,8 @@ Rectangle {
anchors.centerIn: parent anchors.centerIn: parent
rollAngle: roll rollAngle: roll
pitchAngle: pitch pitchAngle: pitch
visible: !mapBackground.visible && showAttitudeIndicator showAttitude: showAttitudeIndicator
visible: !mapBackground.visible
z: 10 z: 10
} }
...@@ -388,6 +388,7 @@ Rectangle { ...@@ -388,6 +388,7 @@ Rectangle {
size: 160 size: 160
rollAngle: roll rollAngle: roll
pitchAngle: pitch pitchAngle: pitch
showPitch: showPitchIndicator
visible: mapBackground.visible && showAttitudeIndicator visible: mapBackground.visible && showAttitudeIndicator
z: 80 z: 80
} }
......
...@@ -34,6 +34,7 @@ Item { ...@@ -34,6 +34,7 @@ Item {
property real rollAngle : 0 property real rollAngle : 0
property real pitchAngle: 0 property real pitchAngle: 0
property real size: 100 property real size: 100
property bool showPitch: true
width: size width: size
height: size height: size
...@@ -75,6 +76,7 @@ Item { ...@@ -75,6 +76,7 @@ Item {
//-- Pitch //-- Pitch
QGCPitchWidget { QGCPitchWidget {
id: pitchWidget id: pitchWidget
visible: root.showPitch
size: parent.width * 0.65 size: parent.width * 0.65
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
pitchAngle: root.pitchAngle pitchAngle: root.pitchAngle
......
...@@ -33,6 +33,7 @@ Item { ...@@ -33,6 +33,7 @@ Item {
id: root id: root
property real rollAngle : 0 property real rollAngle : 0
property real pitchAngle: 0 property real pitchAngle: 0
property bool showAttitude: true
anchors.fill: parent anchors.fill: parent
...@@ -43,6 +44,7 @@ Item { ...@@ -43,6 +44,7 @@ Item {
Image { Image {
id: rollDial id: rollDial
visible: root.showAttitude
anchors { bottom: root.verticalCenter; horizontalCenter: parent.horizontalCenter} anchors { bottom: root.verticalCenter; horizontalCenter: parent.horizontalCenter}
source: "/qml/rollDialWhite.svg" source: "/qml/rollDialWhite.svg"
mipmap: true mipmap: true
...@@ -57,6 +59,7 @@ Item { ...@@ -57,6 +59,7 @@ Item {
Image { Image {
id: pointer id: pointer
visible: root.showAttitude
anchors { bottom: root.verticalCenter; horizontalCenter: parent.horizontalCenter} anchors { bottom: root.verticalCenter; horizontalCenter: parent.horizontalCenter}
source: "/qml/rollPointerWhite.svg" source: "/qml/rollPointerWhite.svg"
mipmap: true mipmap: true
...@@ -66,6 +69,7 @@ Item { ...@@ -66,6 +69,7 @@ Item {
Image { Image {
id: crossHair id: crossHair
visible: root.showAttitude
anchors.centerIn: parent anchors.centerIn: parent
source: "/qml/crossHair.svg" source: "/qml/crossHair.svg"
mipmap: true mipmap: true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment