Enroute Flight Navigation
A navigation app for VFR pilots
GlobalSettings Class Reference

Global Settings Manager. More...

#include <GlobalSettings.h>

Signals

void acceptedTermsChanged ()
 Notifier signal.
void alwaysOpenExternalWebsitesChanged ()
 Notifier signal.
void airspaceAltitudeLimitChanged ()
 Notifier signal.
void expandNotamAbbreviationsChanged ()
 Notifier signal.
void fontSizeChanged ()
 Notifier signal.
void hideGlidingSectorsChanged ()
 Notifier signal.
void ignoreSSLProblemsChanged ()
 Notifier signal.
void lastValidAirspaceAltitudeLimitChanged ()
 Notifier signal.
void lastWhatsNewHashChanged ()
 Notifier signal.
void lastWhatsNewInMapsHashChanged ()
 Notifier signal.
void nightModeChanged ()
 Notifier signal.
void privacyHashChanged ()
 Notifier signal.
void showAltitudeAGLChanged ()
 Notifier signal.
void voiceNotificationsChanged ()
 Notifier signal.

Public Member Functions

 GlobalSettings (QObject *parent=nullptr)
 Standard constructor.
auto acceptedTerms () const -> int
 Getter function for property of the same name.
bool alwaysOpenExternalWebsites () const
 Getter function for property of the same name.
auto airspaceAltitudeLimit () const -> Units::Distance
 Getter function for property of the same name.
bool expandNotamAbbreviations () const
 Getter function for property of the same name.
auto fontSize () const -> int
 Getter function for property with the same name.
auto hideGlidingSectors () const -> bool
 Getter function for property of the same name.
auto ignoreSSLProblems () const -> bool
 Getter function for property of the same name.
auto lastValidAirspaceAltitudeLimit () const -> Units::Distance
 Getter function for property with the same name.
auto lastWhatsNewHash () const -> Units::ByteSize
 Getter function for property of the same name.
auto lastWhatsNewInMapsHash () const -> Units::ByteSize
 Getter function for property of the same name.
auto nightMode () const -> bool
 Getter function for property of the same name.
bool positioningByTrafficDataReceiver () const
 Getter function for property of the same name.
QBindable< bool > bindablePositioningByTrafficDataReceiver () const
 Getter function for property of the same name.
auto privacyHash () const -> Units::ByteSize
 Getter function for property of the same name.
auto showAltitudeAGL () const -> bool
 Getter function for property of the same name.
auto voiceNotifications () const -> uint
 Getter function for property of the same name.
void setAcceptedTerms (int terms)
 Setter function for property of the same name.
void setAlwaysOpenExternalWebsites (bool alwaysOpen)
 Setter function for property of the same name.
void setAirspaceAltitudeLimit (Units::Distance newAirspaceAltitudeLimit)
 Setter function for property of the same name.
void setExpandNotamAbbreviations (bool newExpandNotamAbbreviations)
 Setter function for property of the same name.
void setHideGlidingSectors (bool hide)
 Setter function for property of the same name.
void setFontSize (int newFontSize)
 Setter function for property of the same name.
void setIgnoreSSLProblems (bool ignore)
 Setter function for property of the same name.
void setLargeFonts (bool newLargeFonts)
 Getter function for property of the same name.
void setLastWhatsNewHash (Units::ByteSize lwnh)
 Getter function for property of the same name.
void setLastWhatsNewInMapsHash (Units::ByteSize lwnh)
 Getter function for property of the same name.
void setNightMode (bool newNightMode)
 Setter function for property of the same name.
void setPositioningByTrafficDataReceiver (bool newPositioningByTrafficDataReceiver)
 Setter function for property of the same name.
void setPrivacyHash (Units::ByteSize newHash)
 Getter function for property of the same name.
void setShowAltitudeAGL (bool newShowAltitudeAGL)
 Setter function for property of the same name.
void setVoiceNotifications (uint newVoiceNotifications)
 Setter function for property of the same name.

Properties

bool alwaysOpenExternalWebsites
 Privacy setting: always open external web sites.
int acceptedTerms
 Find out if Terms & Conditions have been accepted.
Units::Distance airspaceAltitudeLimit
 Airspace altitude limit for map display.
Units::Distance airspaceAltitudeLimit_min
 Minimum acceptable value for property airspaceAltitudeLimit.
Units::Distance airspaceAltitudeLimit_max
 Maximum acceptable value for property airspaceAltitudeLimit.
bool expandNotamAbbreviations
 Should we expand notam abbreviations.
int fontSize
 Font size.
bool hideGlidingSectors
 Hide gliding sectors.
bool ignoreSSLProblems
 Ignore SSL security problems.
Units::Distance lastValidAirspaceAltitudeLimit
 Last finite value of airspaceAltitudeLimit.
Units::ByteSize lastWhatsNewHash
 Hash of the last "what's new" message that was shown to the user.
Units::ByteSize lastWhatsNewInMapsHash
 Hash of the last "what's new in maps" message that was shown to the user.
bool nightMode
 Night mode.
bool positioningByTrafficDataReceiver
 Use traffic data receiver for positioning.
Units::ByteSize privacyHash
 Hash of the last "privacy" message that was accepted by the user.
bool showAltitudeAGL
 Show Altitude AGL.
uint voiceNotifications
 Voice notifications that should be played.

Detailed Description

Global Settings Manager.

This class holds a few data items and exposes them via QObject properties, so that they can be used in QML. All data stored in this class is saved via QSettings on destruction.

There exists one static instance of this class, which can be accessed via the Global functions. No other instance of this class should be used.

The methods in this class are reentrant, but not thread safe.

Definition at line 45 of file GlobalSettings.h.

Constructor & Destructor Documentation

◆ GlobalSettings()

GlobalSettings::GlobalSettings ( QObject * parent = nullptr)
explicit

Standard constructor.

Parameters
parentThe standard QObject parent pointer

Member Function Documentation

◆ acceptedTerms()

auto GlobalSettings::acceptedTerms ( ) const -> int
inlinenodiscard

Getter function for property of the same name.

Returns
Property acceptedTerms

Definition at line 175 of file GlobalSettings.h.

◆ airspaceAltitudeLimit()

auto GlobalSettings::airspaceAltitudeLimit ( ) const -> Units::Distance
nodiscard

Getter function for property of the same name.

Returns
Property airspaceAltitudeLimit

◆ alwaysOpenExternalWebsites()

bool GlobalSettings::alwaysOpenExternalWebsites ( ) const
inlinenodiscard

Getter function for property of the same name.

Returns
Property alwaysOpenExternalWebsites

Definition at line 181 of file GlobalSettings.h.

◆ bindablePositioningByTrafficDataReceiver()

QBindable< bool > GlobalSettings::bindablePositioningByTrafficDataReceiver ( ) const
inlinenodiscard

Getter function for property of the same name.

Returns
Property positioningByTrafficDataReceiver

Definition at line 253 of file GlobalSettings.h.

◆ expandNotamAbbreviations()

bool GlobalSettings::expandNotamAbbreviations ( ) const
inlinenodiscard

Getter function for property of the same name.

Returns
Property expandNotamAbbreviations

Definition at line 193 of file GlobalSettings.h.

◆ fontSize()

auto GlobalSettings::fontSize ( ) const -> int
nodiscard

Getter function for property with the same name.

Returns
Property largeFonts

◆ hideGlidingSectors()

auto GlobalSettings::hideGlidingSectors ( ) const -> bool
inlinenodiscard

Getter function for property of the same name.

Returns
Property hideGlidingSectors

Definition at line 205 of file GlobalSettings.h.

◆ ignoreSSLProblems()

auto GlobalSettings::ignoreSSLProblems ( ) const -> bool
inlinenodiscard

Getter function for property of the same name.

Returns
Property ignoreSSLProblems

Definition at line 211 of file GlobalSettings.h.

◆ lastValidAirspaceAltitudeLimit()

auto GlobalSettings::lastValidAirspaceAltitudeLimit ( ) const -> Units::Distance
nodiscard

Getter function for property with the same name.

Returns
Property lastValidAirspaceAltitudeLimit

◆ lastWhatsNewHash()

auto GlobalSettings::lastWhatsNewHash ( ) const -> Units::ByteSize
inlinenodiscard

Getter function for property of the same name.

Returns
Property lastWhatsNewHash

Definition at line 223 of file GlobalSettings.h.

◆ lastWhatsNewInMapsHash()

auto GlobalSettings::lastWhatsNewInMapsHash ( ) const -> Units::ByteSize
inlinenodiscard

Getter function for property of the same name.

Returns
Property lastWhatsNewInMapsHash

Definition at line 232 of file GlobalSettings.h.

◆ nightMode()

auto GlobalSettings::nightMode ( ) const -> bool
inlinenodiscard

Getter function for property of the same name.

Returns
Property night mode

Definition at line 241 of file GlobalSettings.h.

◆ positioningByTrafficDataReceiver()

bool GlobalSettings::positioningByTrafficDataReceiver ( ) const
inlinenodiscard

Getter function for property of the same name.

Returns
Property positioningByTrafficDataReceiver

Definition at line 247 of file GlobalSettings.h.

◆ privacyHash()

auto GlobalSettings::privacyHash ( ) const -> Units::ByteSize
inlinenodiscard

Getter function for property of the same name.

Returns
Property privacyHash

Definition at line 259 of file GlobalSettings.h.

◆ setAcceptedTerms()

void GlobalSettings::setAcceptedTerms ( int terms)

Setter function for property of the same name.

Parameters
termsProperty acceptedTerms

◆ setAirspaceAltitudeLimit()

void GlobalSettings::setAirspaceAltitudeLimit ( Units::Distance newAirspaceAltitudeLimit)

Setter function for property of the same name.

If newAirspaceAltitudeLimit is less than airspaceHeightLimit_min, then airspaceHeightLimit_min will be set. If newAirspaceAltitudeLimit is higher than airspaceHeightLimit_max, then airspaceHeightLimit_max will be set.

Parameters
newAirspaceAltitudeLimitProperty airspaceAltitudeLimit

◆ setAlwaysOpenExternalWebsites()

void GlobalSettings::setAlwaysOpenExternalWebsites ( bool alwaysOpen)

Setter function for property of the same name.

Parameters
alwaysOpenProperty alwaysOpenExternalWebsites

◆ setExpandNotamAbbreviations()

void GlobalSettings::setExpandNotamAbbreviations ( bool newExpandNotamAbbreviations)

Setter function for property of the same name.

Parameters
newExpandNotamAbbreviationsProperty expandNotamAbbreviations

◆ setFontSize()

void GlobalSettings::setFontSize ( int newFontSize)

Setter function for property of the same name.

Parameters
newFontSizeProperty fontSize

◆ setHideGlidingSectors()

void GlobalSettings::setHideGlidingSectors ( bool hide)

Setter function for property of the same name.

Parameters
hideProperty hideGlidingSectors

◆ setIgnoreSSLProblems()

void GlobalSettings::setIgnoreSSLProblems ( bool ignore)

Setter function for property of the same name.

Parameters
ignoreProperty ignoreSSLProblems

◆ setLargeFonts()

void GlobalSettings::setLargeFonts ( bool newLargeFonts)

Getter function for property of the same name.

Parameters
newLargeFontsProperty largeFonts

◆ setLastWhatsNewHash()

void GlobalSettings::setLastWhatsNewHash ( Units::ByteSize lwnh)

Getter function for property of the same name.

Parameters
lwnhProperty lastWhatsNewHash

◆ setLastWhatsNewInMapsHash()

void GlobalSettings::setLastWhatsNewInMapsHash ( Units::ByteSize lwnh)

Getter function for property of the same name.

Parameters
lwnhProperty lastWhatsNewInMapsHash

◆ setNightMode()

void GlobalSettings::setNightMode ( bool newNightMode)

Setter function for property of the same name.

Parameters
newNightModeProperty nightMode

◆ setPositioningByTrafficDataReceiver()

void GlobalSettings::setPositioningByTrafficDataReceiver ( bool newPositioningByTrafficDataReceiver)

Setter function for property of the same name.

Parameters
newPositioningByTrafficDataReceiverProperty positioningByTrafficDataReceiver

◆ setPrivacyHash()

void GlobalSettings::setPrivacyHash ( Units::ByteSize newHash)

Getter function for property of the same name.

Parameters
newHashProperty privacyHash

◆ setShowAltitudeAGL()

void GlobalSettings::setShowAltitudeAGL ( bool newShowAltitudeAGL)

Setter function for property of the same name.

Parameters
newShowAltitudeAGLProperty showAltitudeAGL

◆ setVoiceNotifications()

void GlobalSettings::setVoiceNotifications ( uint newVoiceNotifications)

Setter function for property of the same name.

Parameters
newVoiceNotificationsProperty voiceNotifications

◆ showAltitudeAGL()

auto GlobalSettings::showAltitudeAGL ( ) const -> bool
inlinenodiscard

Getter function for property of the same name.

Returns
Property positioningByTrafficDataReceiver

Definition at line 265 of file GlobalSettings.h.

◆ voiceNotifications()

auto GlobalSettings::voiceNotifications ( ) const -> uint
inlinenodiscard

Getter function for property of the same name.

Returns
Property voiceNotifications

Definition at line 271 of file GlobalSettings.h.

Property Documentation

◆ acceptedTerms

int GlobalSettings::acceptedTerms
readwrite

Find out if Terms & Conditions have been accepted.

This property says which version of our "terms and conditions" have been accepted by the user; this is used to determine whether the first-use-dialog should be shown. If nothing has been accepted yet, 0 is returned.

Definition at line 89 of file GlobalSettings.h.

◆ airspaceAltitudeLimit

Units::Distance GlobalSettings::airspaceAltitudeLimit
readwrite

Airspace altitude limit for map display.

This property holds an altitude. The moving map will ony display airspaces whose lower boundary is lower than this altitude. The altitude value lies in the range [airspaceHeightLimit_min, airspaceHeightLimit_max] or takes a non-finite value to indicate that all airspaces shall be shown.

Definition at line 97 of file GlobalSettings.h.

◆ airspaceAltitudeLimit_max

Units::Distance GlobalSettings::airspaceAltitudeLimit_max

Maximum acceptable value for property airspaceAltitudeLimit.

This is currently set to 15.000 ft

Definition at line 109 of file GlobalSettings.h.

◆ airspaceAltitudeLimit_min

Units::Distance GlobalSettings::airspaceAltitudeLimit_min

Minimum acceptable value for property airspaceAltitudeLimit.

This is currently set to 3.000 ft

Definition at line 103 of file GlobalSettings.h.

◆ fontSize

int GlobalSettings::fontSize
readwrite

Font size.

This is a value between 14 (normal font size) and 20 (giant fonts)

Definition at line 118 of file GlobalSettings.h.

◆ lastWhatsNewHash

Units::ByteSize GlobalSettings::lastWhatsNewHash
readwrite

Hash of the last "what's new" message that was shown to the user.

This property is used in the app to determine if the message has been shown or not.

Definition at line 134 of file GlobalSettings.h.

◆ lastWhatsNewInMapsHash

Units::ByteSize GlobalSettings::lastWhatsNewInMapsHash
readwrite

Hash of the last "what's new in maps" message that was shown to the user.

This property is used in the app to determine if the message has been shown or not.

Definition at line 141 of file GlobalSettings.h.

◆ privacyHash

Units::ByteSize GlobalSettings::privacyHash
readwrite

Hash of the last "privacy" message that was accepted by the user.

This property is used in the app to determine if the message has been shown or not.

Definition at line 154 of file GlobalSettings.h.

◆ voiceNotifications

uint GlobalSettings::voiceNotifications
readwrite

Voice notifications that should be played.

This property is an "or" of the entries of Notifications::Notification::Importance. It determines which notifications should be spoken.

Definition at line 164 of file GlobalSettings.h.


The documentation for this class was generated from the following file: