10 using namespace swift::misc::network;
11 using namespace swift::misc::simulation;
15 namespace swift::gui::settings
17 bool CTextMessageSettings::popupPrivateMessages()
const
19 return this->getPopupAllMessages() || m_popupPrivateMessages;
22 bool CTextMessageSettings::popupSupervisorMessages()
const
24 return this->getPopupAllMessages() || m_popupSupervisorMessages;
27 bool CTextMessageSettings::popupFrequencyMessages()
const
29 return this->getPopupAllMessages() || m_popupFrequencyMessages;
32 bool CTextMessageSettings::popupSelcalMessages()
const
34 return this->getPopupAllMessages() || m_popupSelcalMessages;
37 void CTextMessageSettings::disableAllPopups()
39 m_popupPrivateMessages =
false;
40 m_popupSupervisorMessages =
false;
41 m_popupFrequencyMessages =
false;
42 m_popupAllMessages =
false;
43 m_popupSelcalMessages =
false;
47 bool CTextMessageSettings::popup(
const CTextMessage &textMessage)
const
49 if (this->getPopupAllMessages()) {
return true; }
50 if (textMessage.
isPrivateMessage() && this->popupPrivateMessages()) {
return true; }
52 if (textMessage.
isSelcalMessage() && this->popupSelcalMessages()) {
return true; }
58 if (this->popup(textMessage)) {
return true; }
61 if (!this->popupFrequencyMessages()) {
return false; }
67 QString CTextMessageSettings::convertToQString(
bool i18n)
const
70 return QStringLiteral(
"Private: %1 supervisor: %2 frequency: %3 all: %4 focus: %5 latest 1st: %6")
83 case IndexPopupFrequencyMessages:
return QVariant::fromValue(this->popupFrequencyMessages());
85 case IndexPopupSupervisorMessages:
return QVariant::fromValue(this->popupSupervisorMessages());
104 case IndexPopupAllMessages: this->setPopupAllMessages(variant.
toBool());
break;
105 case IndexPopupFrequencyMessages: this->setPopupFrequencyMessages(variant.
toBool());
break;
106 case IndexPopupSupervisorMessages: this->setSupervisorMessages(variant.
toBool());
break;
107 case IndexPopupPrivateMessages: this->setPopupPrivateMessages(variant.
toBool());
break;
108 case IndexPopupSelcalMessages: this->setPopupSelcalMessages(variant.
toBool());
break;
109 case IndexFocus: this->setFocusOverlayWindows(variant.
toBool());
break;
110 case IndexLatestFirst: this->setLatestFirst(variant.
toBool());
break;
111 case IndexStyle: this->setStyleSheet(variant.
toString());
break;
ColumnIndex
Properties by index.
Non-owning reference to a CPropertyIndex with a subset of its features.
CastType frontCasted() const
First element casted to given type, usually the PropertIndex enum.
bool isMyself() const
Myself index, used with nesting.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
Value object encapsulating information of a text message.
bool isPrivateMessage() const
Is private message?
bool isRadioMessage() const
Is radio message?
const physical_quantities::CFrequency & getFrequency() const
Get frequency.
bool isSelcalMessage() const
Is this a text message encapsulating a SELCAL.
bool isSupervisorMessage() const
Supervisor message?
Comprehensive information of an aircraft.
bool hasComActiveFrequency(const physical_quantities::CFrequency &comFrequency) const
Is comFrequency selected in COM1 or COM2 as active frequency (with 5 kHz spacing for ....
Free functions in swift::misc.
SWIFT_MISC_EXPORT const QString & boolToOnOff(bool v)
Bool to on/off.
SWIFT_MISC_EXPORT const QString & boolToYesNo(bool v)
Bool to yes/no.
QVariant fromValue(T &&value)
bool toBool() const const
QString toString() const const
#define SWIFT_DEFINE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template definition of mixins for a CValueObject subclass.