Skip to content

Commit 92e5b3e

Browse files
hide battery monitoring if no battery is available (#705)
1 parent 46cc915 commit 92e5b3e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+64
-47
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ build-*
3030
*.so.*
3131
*.dll
3232
*.dylib
33+
.qtc_clangd
3334

3435
# Qt-es
3536
object_script.*.Release

QOpenHD.pro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ BASEDIR = $$IN_PWD
33
LANGUAGE = C++
44
CONFIG += c++17
55
CONFIG+=sdk_no_version_check
6+
CONFIG += resources_big
7+
68
TRANSLATIONS = translations/QOpenHD_en.ts \
79
translations/QOpenHD_de.ts \
810
translations/QOpenHD_ru.ts \

qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,23 @@ ScrollView {
153153
}
154154
}*/
155155

156-
157156
SettingsCategory{
158157
m_description: "OHD LINK / STREAMING WIDGETS"
159158

159+
SettingBaseElement{
160+
m_short_description: "Show Widgets"
161+
Switch {
162+
width: 32
163+
height: elementHeight
164+
anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36
165+
166+
anchors.right: parent.right
167+
anchors.verticalCenter: parent.verticalCenter
168+
checked: settings.show_widgets
169+
onCheckedChanged: settings.show_widgets = checked
170+
}
171+
}
172+
160173
SettingBaseElement{
161174
m_short_description: "Show Downlink RSSI"
162175
m_long_description: "RSSI / Stats about downlink"

qml/ui/elements/AppSettings.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ Settings {
115115
// Note that low fps like on embedded devices also adds some latency - because of that, default to 100ms here
116116
property int smoothing: 33
117117

118+
property bool show_widgets: true
118119
property bool show_downlink_rssi: true
119120
//Const10
120121
property bool downlink_show_dbm_and_packets_per_card: true

qml/ui/widgets/AirBatteryWidget.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ BaseWidget {
1111
width: 96
1212
height: 55
1313

14-
visible: settings.show_air_battery
14+
visible: settings.show_air_battery && settings.show_widgets
1515

1616
widgetIdentifier: "air_battery_widget"
1717
bw_verbose_name: "AIR BATTERY (FC)"

qml/ui/widgets/AirspeedTempWidget.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ BaseWidget {
1111
width: 30
1212
height: 30
1313

14-
visible: settings.show_airspeed_temp
14+
visible: settings.show_airspeed_temp && settings.show_widgets
1515

1616
widgetIdentifier: "airspeed_temp_widget"
1717
bw_verbose_name: "AIRSPEED SENSOR TEMP"

qml/ui/widgets/AltitudeSecondWidget.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ BaseWidget {
1717
defaultYOffset: 64
1818
dragging: false
1919

20-
visible: settings.show_altitude_second
20+
visible: settings.show_altitude_second && settings.show_widgets
2121

2222
widgetIdentifier: "altitude_second_widget"
2323
bw_verbose_name: "SECOND ALTITUDE"

qml/ui/widgets/AltitudeWidget.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ BaseWidget {
1919
defaultXOffset: 40
2020
defaultVCenter: true
2121

22-
visible: settings.altitude_ladder_show
22+
visible: settings.altitude_ladder_show && settings.show_widgets
2323

2424
widgetIdentifier: "altitude_widget"
2525
bw_verbose_name: "ALTITUDE"

qml/ui/widgets/AoaWidget.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ BaseWidget {
1818
defaultXOffset: 60
1919
defaultVCenter: true
2020

21-
visible: settings.show_aoa
21+
visible: settings.show_aoa && settings.show_widgets
2222

2323
widgetIdentifier: "aoa_widget"
2424
bw_verbose_name: "ANGLE OF ATTACK"

qml/ui/widgets/ArrowWidget.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ BaseWidget {
1313
height: 48
1414
defaultYOffset: 135
1515

16-
visible: settings.show_arrow
16+
visible: settings.show_arrow && settings.show_widgets
1717

1818
widgetIdentifier: "arrow_widget"
1919
bw_verbose_name: "HOME ARROW"

0 commit comments

Comments
 (0)