From 4246e12c31afc2c325bde960ab9ab90684e2ec01 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Fri, 5 Oct 2018 02:03:15 +0200 Subject: [PATCH] Ref T384, overlay text message in ATC station component --- .../components/atcstationcomponent.cpp | 10 +++++++- src/blackgui/components/atcstationcomponent.h | 12 ++++++---- .../components/atcstationcomponent.ui | 23 +++++++++---------- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/blackgui/components/atcstationcomponent.cpp b/src/blackgui/components/atcstationcomponent.cpp index 69311f503..9e14d7d48 100644 --- a/src/blackgui/components/atcstationcomponent.cpp +++ b/src/blackgui/components/atcstationcomponent.cpp @@ -55,7 +55,7 @@ namespace BlackGui namespace Components { CAtcStationComponent::CAtcStationComponent(QWidget *parent) : - QTabWidget(parent), + COverlayMessagesTabWidget(parent), CIdentifiable(this), ui(new Ui::CAtcStationComponent) { @@ -74,6 +74,8 @@ namespace BlackGui ui->tb_AtcStationsLoadMetar->setText(""); ui->tb_Audio->setIcon(CIcons::appAudio16()); ui->tb_Audio->setText(""); + ui->tb_TextMessageOverlay->setIcon(CIcons::appTextMessages16()); + ui->tb_TextMessageOverlay->setText(""); // set station mode ui->tvp_AtcStationsOnline->setStationMode(CAtcStationListModel::StationsOnline); @@ -86,6 +88,7 @@ namespace BlackGui connect(ui->le_AtcStationsOnlineMetar, &QLineEdit::returnPressed, this, &CAtcStationComponent::getMetarAsEntered); connect(ui->tb_AtcStationsLoadMetar, &QPushButton::clicked, this, &CAtcStationComponent::getMetarAsEntered); connect(ui->tb_Audio, &QPushButton::clicked, this, &CAtcStationComponent::requestAudioWidget); + connect(ui->tb_TextMessageOverlay, &QPushButton::clicked, this, &CAtcStationComponent::showOverlayInlineTextMessage); connect(this, &QTabWidget::currentChanged, this, &CAtcStationComponent::atcStationsTabChanged); // "local" tab changed (booked, online) connect(ui->tvp_AtcStationsOnline, &CAtcStationView::objectClicked, this, &CAtcStationComponent::onlineAtcStationSelected); connect(ui->tvp_AtcStationsOnline, &CAtcStationView::objectSelected, this, &CAtcStationComponent::onlineAtcStationSelected); @@ -446,5 +449,10 @@ namespace BlackGui QAbstractItemModel *treeModelOld = (ui->tvp_AtcStationsOnlineTree->model()); if (treeModelOld) { CGuiUtility::clearModel(treeModelOld); } } + + void CAtcStationComponent::showOverlayInlineTextMessage() + { + COverlayMessagesTabWidget::showOverlayInlineTextMessage(TextMessagesCom1); + } } // namespace } // namespace diff --git a/src/blackgui/components/atcstationcomponent.h b/src/blackgui/components/atcstationcomponent.h index 492a3d9c7..c3f4599ca 100644 --- a/src/blackgui/components/atcstationcomponent.h +++ b/src/blackgui/components/atcstationcomponent.h @@ -12,15 +12,16 @@ #ifndef BLACKGUI_ATCSTATIONCOMPONENT_H #define BLACKGUI_ATCSTATIONCOMPONENT_H -#include "blackcore/network.h" -#include "blackgui/blackguiexport.h" #include "blackgui/components/enablefordockwidgetinfoarea.h" #include "blackgui/settings/viewupdatesettings.h" #include "blackgui/settings/atcstationssettings.h" +#include "blackgui/overlaymessagesframe.h" +#include "blackgui/blackguiexport.h" +#include "blackcore/network.h" #include "blackmisc/aviation/atcstation.h" #include "blackmisc/aviation/comsystem.h" -#include "blackmisc/identifiable.h" #include "blackmisc/pq/frequency.h" +#include "blackmisc/identifiable.h" #include #include @@ -40,7 +41,7 @@ namespace BlackGui { //! ATC stations component class BLACKGUI_EXPORT CAtcStationComponent : - public QTabWidget, + public COverlayMessagesTabWidget, public CEnableForDockWidgetInfoArea, public BlackMisc::CIdentifiable { @@ -151,6 +152,9 @@ namespace BlackGui //! Clear the online views void clearOnlineViews(); + //! Inline message + void showOverlayInlineTextMessage(); + QScopedPointer ui; QTimer m_updateTimer; QDateTime m_timestampLastReadOnlineStations; //!< stations read diff --git a/src/blackgui/components/atcstationcomponent.ui b/src/blackgui/components/atcstationcomponent.ui index bfe5a4d1e..71c6b7203 100644 --- a/src/blackgui/components/atcstationcomponent.ui +++ b/src/blackgui/components/atcstationcomponent.ui @@ -110,12 +110,6 @@ - - - 0 - 0 - - Reload ATIS @@ -126,12 +120,6 @@ - - - 0 - 0 - - Load METAR @@ -163,6 +151,16 @@ + + + + text message + + + tm + + + @@ -301,6 +299,7 @@ tb_AtcStationsLoadMetar tb_AtcStationsAtisReload tb_Audio + tb_TextMessageOverlay comp_AtcStationsSettings te_AtcStationsOnlineInfo tvp_AtcStationsOnlineTree