6 #include <QApplication>
10 #include <QStringBuilder>
12 #include <QToolButton>
13 #include <QVBoxLayout>
18 #include "ui_textmessagecomponent.h"
45 using namespace swift::core::context;
48 using namespace swift::gui::settings;
50 using namespace swift::misc::network;
51 using namespace swift::misc::audio;
52 using namespace swift::misc::aviation;
53 using namespace swift::misc::physical_quantities;
54 using namespace swift::misc::simulation;
61 ui->tw_TextMessages->setCurrentIndex(0);
62 ui->fr_TextMessage->setVisible(
false);
63 ui->tvp_TextMessagesAll->setResizeMode(CTextMessageView::ResizingAuto);
64 ui->tvp_TextMessagesAll->setWordWrap(
false);
65 ui->comp_AtcStations->setWithIcons(
false);
70 Q_ASSERT_X(c, Q_FUNC_INFO,
"Missing connect");
73 Q_ASSERT_X(c, Q_FUNC_INFO,
"Missing connect");
76 Q_ASSERT_X(c, Q_FUNC_INFO,
"Missing connect");
80 Q_ASSERT_X(c, Q_FUNC_INFO,
"Missing connect");
84 Q_ASSERT_X(c, Q_FUNC_INFO,
"Missing connect");
89 Q_ASSERT_X(c, Q_FUNC_INFO,
"Missing connect");
92 Q_ASSERT_X(c, Q_FUNC_INFO,
"Missing connect");
98 Q_ASSERT_X(c, Q_FUNC_INFO,
"Missing connect");
101 Q_ASSERT_X(c, Q_FUNC_INFO,
"Missing connect");
104 Q_ASSERT_X(c, Q_FUNC_INFO,
"Missing connect");
107 Q_ASSERT_X(c, Q_FUNC_INFO,
"Missing connect");
116 this->onSettingsChanged();
117 this->showCurrentFrequenciesFromCockpit();
118 const bool latestFirst = m_messageSettings.get().isLatestFirst();
119 ui->tvp_TextMessagesAll->setSorting(CTextMessage::IndexUtcTimestamp,
123 ui->gb_Settings->setChecked(
false);
124 ui->gb_MessageTo->setChecked(
false);
135 Q_ASSERT_X(c, Q_FUNC_INFO,
"Missing connect");
143 case TextMessagesAll:
return ui->tb_TextMessagesAll;
144 case TextMessagesCom1:
return ui->tb_TextMessagesCOM1;
145 case TextMessagesCom2:
return ui->tb_TextMessagesCOM2;
146 case TextMessagesUnicom:
return ui->tb_TextMessagesUnicom;
147 default: Q_ASSERT_X(
false, Q_FUNC_INFO,
"Wrong index");
break;
154 QWidget *w = this->getTabWidget(tab);
155 if (!w) {
return nullptr; }
156 return this->findChild<CTextMessageTextEdit *>();
161 QWidget *w = this->getTabWidget(tab);
162 if (w) { ui->tw_TextMessages->setCurrentWidget(w); }
165 void CTextMessageComponent::selectTabWidget(
const CCallsign &callsign,
bool addIfNotExisting)
167 QWidget *tab = this->findTextMessageTabByCallsign(callsign);
168 if (!tab && addIfNotExisting) { tab = this->addNewTextMessageTab(callsign); }
169 if (!tab) {
return; }
170 ui->tw_TextMessages->setCurrentWidget(tab);
173 bool CTextMessageComponent::isCloseableTab(
const QWidget *tabWidget)
const
175 if (!tabWidget) {
return false; }
176 return (tabWidget != ui->tb_TextMessagesAll && tabWidget != ui->tb_TextMessagesCOM1 &&
177 tabWidget != ui->tb_TextMessagesCOM2 && tabWidget != ui->tb_TextMessagesUnicom);
180 void CTextMessageComponent::displayTextMessage(
const CTextMessageList &messages)
182 using namespace std::chrono_literals;
183 if (messages.
isEmpty()) {
return; }
188 const bool audioCsMentioned = playNotification && m_audioSettings.get().textCallsignMentioned();
190 bool addedToAllMessages =
false;
193 bool relevantForMe =
false;
197 if (!m_usedAsOverlayWidget && message.isSelcalMessage() &&
198 ownAircraft.isSelcalSelected(message.getSelcalCode()))
203 if (msgSettings.popupSelcalMessages())
206 this->emitDisplayInInfoWindow(CVariant::from(msg), 3s);
212 if (message.isSendToUnicom())
214 ui->tep_TextMessagesUnicom->insertTextMessage(message);
217 if (!message.wasSent()) { notification = CNotificationSounds::NotificationTextMessageUnicom; }
218 relevantForMe =
true;
222 if (message.isServerMessage())
226 else if (message.isBroadcastMessage())
229 this->addPrivateChannelTextMessage(message);
230 relevantForMe =
true;
232 else if (message.isRadioMessage())
235 if (message.isSendToFrequency(ownAircraft.getCom1System().getFrequencyActive()))
237 ui->tep_TextMessagesCOM1->insertTextMessage(message);
238 if (!message.isSendToUnicom())
240 notification = CNotificationSounds::NotificationTextMessageFrequency;
242 relevantForMe =
true;
244 if (message.isSendToFrequency(ownAircraft.getCom2System().getFrequencyActive()))
246 ui->tep_TextMessagesCOM2->insertTextMessage(message);
247 if (!message.isSendToUnicom())
249 notification = CNotificationSounds::NotificationTextMessageFrequency;
251 relevantForMe =
true;
255 if (relevantForMe && audioCsMentioned && ownAircraft.hasCallsign() &&
256 message.mentionsCallsign(ownAircraft.getCallsign()))
258 notification = CNotificationSounds::NotificationTextCallsignMentioned;
263 else if (message.isPrivateMessage())
266 this->addPrivateChannelTextMessage(message);
267 relevantForMe =
true;
280 ui->tvp_TextMessagesAll->push_back(message);
281 ui->tvp_TextMessagesAll->resort();
282 addedToAllMessages =
true;
284 if (!relevantForMe) {
continue; }
287 if (playNotification && notification != CNotificationSounds::NoNotifications)
293 if (message.isServerMessage()) {
continue; }
294 if (message.isBroadcastMessage()) {
continue; }
296 if (!message.wasSent() && !message.isSendToUnicom())
299 if (!this->isCorrespondingTextMessageTabSelected(message))
301 if (msgSettings.popup(message, ownAircraft))
303 this->emitDisplayInInfoWindow(CVariant::from(message), 15s);
309 if (addedToAllMessages && ui->tvp_TextMessagesAll->isSortedByTimestampPropertyLatestLast())
311 ui->tvp_TextMessagesAll->scrollToBottom();
315 void CTextMessageComponent::onChangedAircraftCockpit(
const CSimulatedAircraft &aircraft,
321 this->showCurrentFrequenciesFromCockpit(aircraft);
324 void CTextMessageComponent::onSettingsChecked(
bool checked)
326 ui->comp_SettingsOverlay->setVisible(checked);
327 ui->comp_SettingsStyle->setVisible(checked);
328 ui->cb_LatestFirst->setVisible(checked);
329 ui->gb_Settings->setFlat(!checked);
332 void CTextMessageComponent::onMessageToChecked(
bool checked)
334 ui->comp_AtcStations->setVisible(checked);
335 ui->gb_MessageTo->setFlat(!checked);
336 if (checked) { ui->comp_AtcStations->updateStations(); }
339 void CTextMessageComponent::onSettingsChanged()
343 const bool latestFirst = m_messageSettings.get().isLatestFirst();
346 textEdit->setLatestFirst(latestFirst);
347 textEdit->setStyleSheetForContent(
style);
349 ui->comp_SettingsStyle->setStyle(this->getStyleSheet());
350 if (latestFirst != ui->cb_LatestFirst->isChecked()) { ui->cb_LatestFirst->setChecked(latestFirst); }
354 void CTextMessageComponent::onLatestFirstChanged(
bool checked)
360 CLogMessage::preformatted(m);
361 this->onSettingsChanged();
364 void CTextMessageComponent::onStyleSheetChanged()
366 this->onSettingsChanged();
369 void CTextMessageComponent::onAtcButtonClicked(
const CAtcStation &station)
375 void CTextMessageComponent::updateSettings()
377 const QString style = ui->comp_SettingsStyle->getStyle();
382 CLogMessage::preformatted(m);
383 this->onStyleSheetChanged();
388 return this->findChildren<CTextMessageTextEdit *>();
391 QString CTextMessageComponent::getStyleSheet()
const
399 bool CTextMessageComponent::isCorrespondingTextMessageTabSelected(
const CTextMessage &textMessage)
const
401 if (!this->isVisibleWidgetHack()) {
return false; }
403 if (textMessage.
isEmpty()) {
return false; }
408 if (cs.
isEmpty()) {
return false; }
409 const QWidget *tab = this->findTextMessageTabByCallsign(cs,
false);
410 if (!tab) {
return false; }
411 return ui->tw_TextMessages->currentWidget() == tab;
417 if (ui->tw_TextMessages->currentWidget() == ui->tb_TextMessagesAll) {
return true; }
418 if (textMessage.
isSendToFrequency(ownAircraft.getCom1System().getFrequencyActive()))
420 return ui->tw_TextMessages->currentWidget() == ui->tb_TextMessagesCOM1;
422 if (textMessage.
isSendToFrequency(ownAircraft.getCom2System().getFrequencyActive()))
424 return ui->tw_TextMessages->currentWidget() == ui->tb_TextMessagesCOM2;
430 bool CTextMessageComponent::isNetworkConnected()
const
435 void CTextMessageComponent::showCurrentFrequenciesFromCockpit()
438 this->showCurrentFrequenciesFromCockpit(ownAircraft);
441 void CTextMessageComponent::showCurrentFrequenciesFromCockpit(
const CSimulatedAircraft &ownAircraft)
456 QString f1 = QStringLiteral(
"COM1: %1").
arg(f1n);
457 QString f2 = QStringLiteral(
"COM2: %1").
arg(f2n);
461 ui->tb_TextMessagesCOM1->setToolTip(f1);
462 ui->tb_TextMessagesCOM1->setToolTip(f2);
464 ui->tw_TextMessages->setTabText(ui->tw_TextMessages->indexOf(ui->tb_TextMessagesCOM1), f1);
465 ui->tw_TextMessages->setTabText(ui->tw_TextMessages->indexOf(ui->tb_TextMessagesCOM2), f2);
468 this->updateAllTabs();
471 QWidget *CTextMessageComponent::addNewTextMessageTab(
const CCallsign &callsign)
473 if (callsign.
isEmpty()) {
return nullptr; }
474 QWidget *w = this->findTextMessageTabByCallsign(callsign,
false);
480 auto *newTabWidget =
new QWidget(
this);
481 newTabWidget->setObjectName(u
"Tab widget " % tabName);
482 newTabWidget->setProperty(
"callsign", callsign.
asString());
483 auto *closeButton =
new QPushButton(
"Close", newTabWidget);
486 textEdit->setObjectName(
"tep_" + tabName);
491 ui->tb_TextMessagesAll->layout()->getContentsMargins(&marginLeft, &marginTop, &marginRight, &marginBottom);
492 newTabWidget->layout()->setContentsMargins(marginLeft, marginTop, marginRight, 2);
495 newTabWidget->setLayout(
layout);
497 textEdit->setProperty(
"supervisormsg", supervisor);
498 textEdit->setStyleSheetForContent(
style);
500 const int index = ui->tw_TextMessages->addTab(newTabWidget, this->getCallsignAndRealName(callsign));
501 auto *closeButtonInTab =
new QToolButton(newTabWidget);
502 closeButtonInTab->setText(
"[X]");
503 closeButtonInTab->setProperty(
"supervisormsg", supervisor);
504 QTabBar *bar = ui->tw_TextMessages->tabBar();
512 ui->tw_TextMessages->setCurrentIndex(index);
513 closeButtonInTab->setProperty(
"tabName", tabName);
514 closeButton->setProperty(
"tabName", tabName);
519 this->setTabWidgetDescription(callsign, index);
523 void CTextMessageComponent::setTabWidgetDescription(
const CCallsign &callsign,
int widgetIndex)
525 if (callsign.
isEmpty()) {
return; }
531 if (!realName.
isEmpty()) { ui->tw_TextMessages->setTabToolTip(widgetIndex, realName); }
534 ui->tw_TextMessages->setTabText(widgetIndex, tt);
537 QString CTextMessageComponent::getCallsignAndRealName(
const CCallsign &callsign)
const
539 if (callsign.
isEmpty()) {
return {}; }
543 if (!realName.
isEmpty()) {
return callsign.
asString() % u
": " % realName; }
548 void CTextMessageComponent::updateAllTabs()
550 for (
int index = ui->tw_TextMessages->count() - 1; index >= 0; index--)
552 QWidget *tab = ui->tw_TextMessages->widget(index);
553 if (!tab) {
continue; }
554 if (!tab->
toolTip().isEmpty()) {
continue; }
556 if (cs.
isEmpty()) {
continue; }
557 this->setTabWidgetDescription(
CCallsign(cs), index);
561 void CTextMessageComponent::addPrivateChannelTextMessage(
const CTextMessage &textMessage)
573 const QWidget *tab = this->findTextMessageTabByCallsign(cs);
574 if (!tab) { tab = this->addNewTextMessageTab(cs); }
575 Q_ASSERT_X(tab, Q_FUNC_INFO,
"Missing tab");
578 if (!textEdit) {
return; }
579 textEdit->insertTextMessage(textMessage);
583 if (isBroadcast) {
return; }
609 QWidget *CTextMessageComponent::findTextMessageTabByCallsign(
const CCallsign &callsign,
610 bool callsignResolution)
const
613 for (
int index = ui->tw_TextMessages->count() - 1; index >= 0; index--)
615 QWidget *tab = ui->tw_TextMessages->widget(index);
621 if (!callsignResolution) {
return nullptr; }
631 return this->getTabWidget(TextMessagesCom1);
635 return this->getTabWidget(TextMessagesCom2);
641 QWidget *CTextMessageComponent::findTextMessageTabByName(
const QString &name)
const
643 if (name.
isEmpty()) {
return nullptr; }
646 for (
int index = ui->tw_TextMessages->count() - 1; index >= 0; index--)
648 const QString tabName = ui->tw_TextMessages->tabText(index);
650 QWidget *tab = ui->tw_TextMessages->widget(index);
656 void CTextMessageComponent::closeTextMessageTab()
661 QWidget *tw = this->findTextMessageTabByName(tabName);
662 if (!this->isCloseableTab(tw)) {
return; }
663 if (tw) { index = ui->tw_TextMessages->indexOf(tw); }
664 if (index >= 0) { ui->tw_TextMessages->removeTab(index); }
667 void CTextMessageComponent::topLevelChanged(
QWidget *widget,
bool topLevel)
671 ui->fr_TextMessage->setVisible(topLevel);
674 void CTextMessageComponent::textMessageEntered()
676 if (!ui->fr_TextMessage->isVisible() || !ui->lep_TextMessages->isVisible()) {
return; }
679 const QString cl(ui->lep_TextMessages->getLastEnteredLineFormatted());
680 if (!cl.isEmpty()) { this->handleEnteredTextMessage(cl); }
683 bool CTextMessageComponent::isVisibleWidgetHack()
const
688 CCallsign CTextMessageComponent::getCallsignPropertyForTab(
int tabIndex,
bool validated)
const
690 if (tabIndex < 0 || tabIndex >= ui->tw_TextMessages->count()) {
return {}; }
691 QWidget *tab = ui->tw_TextMessages->widget(tabIndex);
695 if (!validated) {
return cs; }
715 void CTextMessageComponent::emitDisplayInInfoWindow(
const CVariant &message,
716 std::chrono::milliseconds displayDuration)
718 if (m_usedAsOverlayWidget) {
return; }
722 void CTextMessageComponent::handleEnteredTextMessage(
const QString &textMessage)
724 if (!this->isVisibleWidgetHack()) {
return; }
727 if (cl.isEmpty()) {
return; }
730 if (!cl.startsWith(
"."))
733 cl = this->textMessageToCommand(cl);
737 if (cl.isEmpty()) {
return; }
741 QString CTextMessageComponent::textMessageToCommand(
const QString &enteredLine)
744 if (enteredLine.
isEmpty()) {
return {}; }
746 const int index = ui->tw_TextMessages->currentIndex();
748 if (index < 0 || index == ui->tw_TextMessages->indexOf(ui->tb_TextMessagesAll))
753 else if (ui->tw_TextMessages->tabText(index) ==
"SUP")
756 u
"Message cannot be send to SUP channel. To send another wallop message use .wallop instead");
761 if (index == ui->tw_TextMessages->indexOf(ui->tb_TextMessagesCOM1))
763 cmd.append(
QString::number(this->getOwnAircraft().getCom1System().getFrequencyActive().valueRounded(
764 CFrequencyUnit::MHz(), 3)));
766 else if (index == ui->tw_TextMessages->indexOf(ui->tb_TextMessagesCOM2))
768 cmd.append(
QString::number(this->getOwnAircraft().getCom2System().getFrequencyActive().valueRounded(
769 CFrequencyUnit::MHz(), 3)));
771 else if (index == ui->tw_TextMessages->indexOf(ui->tb_TextMessagesUnicom))
774 CPhysicalQuantitiesConstants::FrequencyUnicom().valueRounded(CFrequencyUnit::MHz(), 3)));
780 const QString selectedTabText = firstPartOfTabText(ui->tw_TextMessages->tabText(index).trimmed());
781 const double frequency = selectedTabText.
toDouble(&isNumber);
785 if (CComSystem::isValidCivilAviationFrequency(radioFrequency))
793 const CCallsign cs = this->getCallsignPropertyForTab(index,
true);
794 if (cs.
isEmpty()) { cmd.append(selectedTabText); }
798 else { cmd.append(selectedTabText); }
800 return cmd % u
" " % enteredLine;
804 void CTextMessageComponent::onTextMessageReceived(
const CTextMessageList &messages)
806 if (!m_activeReceive) {
return; }
807 this->displayTextMessage(messages);
810 void CTextMessageComponent::onTextMessageSent(
const CTextMessage &sentMessage)
812 if (!m_activeSend) {
return; }
813 this->displayTextMessage(sentMessage);
818 if (originator == this->componentIdentifier()) {
return false; }
822 if (!this->isVisibleWidgetHack()) {
return false; }
823 this->handleEnteredTextMessage(commandLine);
835 QWidget *w = this->findTextMessageTabByCallsign(callsign,
true);
841 w = this->addNewTextMessageTab(callsign);
846 w = this->addNewTextMessageTab(callsign);
850 ui->tw_TextMessages->setCurrentWidget(w);
863 if (freq1 == frequency)
865 this->
setTab(TextMessagesCom1);
868 if (freq2 == frequency)
870 this->
setTab(TextMessagesCom2);
873 this->
setTab(TextMessagesAll);
885 case TextMessagesAll: ui->tw_TextMessages->setCurrentWidget(ui->tb_TextMessagesAll);
break;
886 case TextMessagesCom1: ui->tw_TextMessages->setCurrentWidget(ui->tb_TextMessagesCOM1);
break;
887 case TextMessagesCom2: ui->tw_TextMessages->setCurrentWidget(ui->tb_TextMessagesCOM2);
break;
888 case TextMessagesUnicom: ui->tw_TextMessages->setCurrentWidget(ui->tb_TextMessagesUnicom);
break;
897 ui->comp_AtcStations->setRowsColumns(rows, cols, setMaxElements);
902 ui->comp_AtcStations->setBackgroundUpdates(backgroundUpdates);
907 if (!ui->gb_MessageTo->isChecked()) {
return; }
908 ui->comp_AtcStations->updateStations();
913 return ui->tw_TextMessages->widget(0) == ui->tb_TextMessagesAll;
922 if (!ui->lep_TextMessages->isVisible()) {
return; }
925 ui->lep_TextMessages->setFocus();
933 m_activeReceive = receive;
936 QString CTextMessageComponent::firstPartOfTabText(
const QString &tabText)
938 if (tabText.
isEmpty()) {
return {}; }
939 int index = tabText.
indexOf(
':');
940 if (index < 0) { index = tabText.
indexOf(
' '); }
941 if (index >= 0) {
return tabText.
left(index); }
const context::IContextAudio * getIContextAudio() const
Direct access to contexts if a CCoreFacade has been initialized.
const context::IContextOwnAircraft * getIContextOwnAircraft() const
Direct access to contexts if a CCoreFacade has been initialized.
CCoreFacade * getCoreFacade()
Get the facade.
const context::IContextNetwork * getIContextNetwork() const
Direct access to contexts if a CCoreFacade has been initialized.
bool isShuttingDown() const
Is application shutting down?
const context::CContextAudioBase * getCContextAudioBase() const
Direct access to contexts if a CCoreFacade has been initialized.
void playSelcalTone(const swift::misc::aviation::CSelcal &selcal)
SELCAL.
void playNotification(swift::misc::audio::CNotificationSounds::NotificationFlag notification, bool considerSettings, int volume=-1)
Notification sounds.
virtual swift::misc::aviation::CAtcStationList getOnlineStationsForFrequency(const swift::misc::physical_quantities::CFrequency &frequency) const =0
Online stations for frequency.
virtual swift::misc::simulation::CSimulatedAircraft getAircraftInRangeForCallsign(const swift::misc::aviation::CCallsign &callsign) const =0
Aircraft for given callsign.
virtual swift::misc::network::CUser getUserForCallsign(const swift::misc::aviation::CCallsign &callsign) const =0
User for given callsign, e.g. for text messages.
virtual bool isOnlineStation(const swift::misc::aviation::CCallsign &callsign) const =0
Online station for callsign?
virtual swift::misc::aviation::CAtcStation getOnlineStationForCallsign(const swift::misc::aviation::CCallsign &callsign) const =0
Online station for callsign.
virtual bool isAircraftInRange(const swift::misc::aviation::CCallsign &callsign) const =0
Aircraft in range.
virtual bool isConnected() const =0
Network connected?
virtual swift::misc::simulation::CSimulatedAircraft getOwnAircraft() const =0
Get own aircraft.
const CStyleSheetUtility & getStyleSheetUtility() const
Style sheet handling.
void styleSheetsChanged()
Style sheet changed.
void returnPressedUnemptyLine()
Return has been pressed, line is NOT empty (spaces are trimmed)
static const QString & fileNameTextMessage()
File name textmessage.qss.
QString style(const QString &fileName) const
Style for given file name.
Specialized text edit for displaying text messages.
void changed()
Font or style changed from within the component.
bool hasAllMessagesTab() const
Has an all tab.
void showTextMessageEntry(bool show)
Show an text entry field.
void removeAllMessagesTab()
Remove the all tab, the operation cannot be undone.
bool handleGlobalCommandLineText(const QString &commandLine, const swift::misc::CIdentifier &originator)
Used to allow direct input from global command line when visible.
void commandEntered(const QString &commandLine, const swift::misc::CIdentifier &originator)
Command line was entered.
void displayInInfoWindow(const swift::misc::CVariant &message, std::chrono::milliseconds displayDuration)
Message to be displayed in central info window.
void textMessageTabSelected()
Text message tab selected.
void setAtcButtonsRowsColumns(int rows, int cols, bool setMaxElements)
Rows/columns.
void fontSizePlus()
Font size.
void setTab(TextMessageTab tab)
Set tab.
void showCorrespondingTab(const swift::misc::aviation::CCallsign &callsign)
Display the tab for given callsign.
void updateAtcStationsButtons()
Update buttons.
~CTextMessageComponent()
Destructor.
void showSettings(bool show)
Show the settings.
bool setParentDockWidgetInfoArea(CDockWidgetInfoArea *parentDockableWidget)
Corresponding dockable widget in info area.
void fontSizeMinus()
Font size.
void setAtcButtonsBackgroundUpdates(bool backgroundUpdates)
Background updates or explicitly called.
void focusTextEntry()
Focus the text entry field.
void showCorrespondingTabForFrequency(const swift::misc::physical_quantities::CFrequency &frequency)
Display the tab for given frequency.
void activate(bool send, bool receive)
Ignore incoming send/receive signals.
bool isActivated() const
Text activated.
void setStyleSheet(const QString &styleSheet)
CSS style sheet.
bool focusOverlayWindow() const
Focus in the overlay window.
void setLatestFirst(bool latestFirst)
Latest messages 1st?
bool isLatestFirst() const
Latest messages 1st?
T get() const
Get a copy of the current value.
Value object for icons. An icon is stored in the global icon repository and identified by its index....
QIcon toQIcon() const
A QIcon.
Value object encapsulating information identifying a component of a modular distributed swift process...
Class for emitting a log message.
Derived & warning(const char16_t(&format)[N])
Set the severity to warning, providing a format string.
Derived & validationError(const char16_t(&format)[N])
Set the severity to error, providing a format string, and adding the validation category.
Derived & info(const char16_t(&format)[N])
Set the severity to info, providing a format string.
size_type size() const
Returns number of elements in the sequence.
reference front()
Access the first element.
bool isEmpty() const
Synonym for empty.
Streamable status message, e.g.
Wrapper around QVariant which provides transparent access to CValueObject methods of the contained ob...
Value object encapsulating information of audio related settings.
bool textMessageSupervisor() const
Simplified functions.
bool textMessagePrivate() const
Simplified functions.
Value object encapsulating information about an ATC station.
const CCallsign & getCallsign() const
Get callsign.
QString getCallsignAndControllerRealName() const
Callsign and controller's name if available.
const physical_quantities::CFrequency & getFrequency() const
Get frequency.
bool hasCallsign() const
Has callsign?
Value object for a list of ATC stations.
Value object encapsulating information of a callsign.
const QString & asString() const
Get callsign (normalized)
CIcons::IconIndex toIcon() const
As icon, not implemented by all classes.
void markAsBroadcastCallsign()
Set a human readable name as "broadcast" callsign.
void markAsWallopCallsign()
Set a human readable name as "wallop-channel" callsign.
bool isSupervisorCallsign() const
Supervisor?
bool isEmpty() const
Is empty?
bool isAtcCallsign() const
ATC callsign.
const QString & getStringAsSet() const
Get callsign.
bool isActiveFrequencySameFrequency(const physical_quantities::CFrequency &comFrequency) const
Is active frequency the same frequency.
swift::misc::physical_quantities::CFrequency getFrequencyActive() const
Active frequency.
Value object encapsulating information of a text message.
bool isWallopMessage() const
Is this a message send via .wallop.
bool isPrivateMessage() const
Is private message?
bool isBroadcastMessage() const
Is this a broadcast message.
bool isEmpty() const
Empty message.
bool isServerMessage() const
Initial message of server?
bool hasValidRecipient() const
Valid receviver?
bool isSendToFrequency(const physical_quantities::CFrequency &frequency) const
Send to particular frequency?
bool wasSent() const
Was sent?
const aviation::CCallsign & getSenderCallsign() const
Get callsign (from)
const aviation::CCallsign & getRecipientCallsign() const
Get callsign (to)
bool isSupervisorMessage() const
Supervisor message?
Value object encapsulating a list of text messages.
const QString & getRealName() const
Get full name.
double valueRounded(MU unit, int digits=-1) const
Rounded value in given unit.
Comprehensive information of an aircraft.
const aviation::CComSystem & getCom2System() const
Get COM2 system.
bool hasCallsign() const
Callsign not empty, no further checks.
const aviation::CCallsign & getCallsign() const
Get callsign.
const aviation::CComSystem & getCom1System() const
Get COM1 system.
SWIFT_GUI_EXPORT swift::gui::CGuiApplication * sGui
Single instance of GUI application object.
Backend services of the swift project, like dealing with the network or the simulators.
High level reusable GUI components.
Views, mainly QTableView.
Free functions in swift::misc.
void alert(QWidget *widget, int msec)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
T findChild(QAnyStringView name, Qt::FindChildOptions options) const const
QVariant property(const char *name) const const
QObject * sender() const const
QString arg(Args &&... args) const const
QString asprintf(const char *cformat,...)
qsizetype indexOf(QChar ch, qsizetype from, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
QString left(qsizetype n) &&
QString number(double n, char format, int precision)
QString simplified() const const
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
double toDouble(bool *ok) const const
QString trimmed() const const
void setTabIcon(int index, const QIcon &icon)
void setTabTextColor(int index, const QColor &color)
QString toString() const const
NotificationFlag
Play notification.
#define SWIFT_AUDIT_X(COND, WHERE, WHAT)
A weaker kind of verify.
#define SWIFT_VERIFY_X(COND, WHERE, WHAT)
A weaker kind of assert.