10 using namespace swift::misc::network;
11 using namespace swift::misc::simulation;
15 namespace swift::gui::settings
17 CTextMessageSettings::CTextMessageSettings() {}
19 bool CTextMessageSettings::popupPrivateMessages()
const
21 return this->getPopupAllMessages() || m_popupPrivateMessages;
24 bool CTextMessageSettings::popupSupervisorMessages()
const
26 return this->getPopupAllMessages() || m_popupSupervisorMessages;
29 bool CTextMessageSettings::popupFrequencyMessages()
const
31 return this->getPopupAllMessages() || m_popupFrequencyMessages;
34 bool CTextMessageSettings::popupSelcalMessages()
const
36 return this->getPopupAllMessages() || m_popupSelcalMessages;
39 void CTextMessageSettings::disableAllPopups()
41 m_popupPrivateMessages =
false;
42 m_popupSupervisorMessages =
false;
43 m_popupFrequencyMessages =
false;
44 m_popupAllMessages =
false;
45 m_popupSelcalMessages =
false;
49 bool CTextMessageSettings::popup(
const CTextMessage &textMessage)
const
51 if (this->getPopupAllMessages()) {
return true; }
52 if (textMessage.
isPrivateMessage() && this->popupPrivateMessages()) {
return true; }
54 if (textMessage.
isSelcalMessage() && this->popupSelcalMessages()) {
return true; }
60 if (this->popup(textMessage)) {
return true; }
63 if (!this->popupFrequencyMessages()) {
return false; }
69 QString CTextMessageSettings::convertToQString(
bool i18n)
const
72 return QStringLiteral(
"Private: %1 supervisor: %2 frequency: %3 all: %4 focus: %5 latest 1st: %6")
80 if (index.
isMyself()) {
return QVariant::fromValue(*
this); }
84 case IndexPopupAllMessages:
return QVariant::fromValue(this->getPopupAllMessages());
85 case IndexPopupFrequencyMessages:
return QVariant::fromValue(this->popupFrequencyMessages());
86 case IndexPopupPrivateMessages:
return QVariant::fromValue(this->popupPrivateMessages());
87 case IndexPopupSupervisorMessages:
return QVariant::fromValue(this->popupSupervisorMessages());
88 case IndexPopupSelcalMessages:
return QVariant::fromValue(this->popupSelcalMessages());
89 case IndexStyle:
return QVariant::fromValue(this->getStyleSheet());
90 case IndexLatestFirst:
return QVariant::fromValue(this->isLatestFirst());
91 case IndexFocus:
return QVariant::fromValue(this->focusOverlayWindow());
96 void CTextMessageSettings::setPropertyByIndex(
CPropertyIndexRef index,
const QVariant &variant)
106 case IndexPopupAllMessages: this->setPopupAllMessages(variant.toBool());
break;
107 case IndexPopupFrequencyMessages: this->setPopupFrequencyMessages(variant.toBool());
break;
108 case IndexPopupSupervisorMessages: this->setSupervisorMessages(variant.toBool());
break;
109 case IndexPopupPrivateMessages: this->setPopupPrivateMessages(variant.toBool());
break;
110 case IndexPopupSelcalMessages: this->setPopupSelcalMessages(variant.toBool());
break;
111 case IndexFocus: this->setFocusOverlayWindows(variant.toBool());
break;
112 case IndexLatestFirst: this->setLatestFirst(variant.toBool());
break;
113 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.
#define SWIFT_DEFINE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template definition of mixins for a CValueObject subclass.