Ref T384, overlay text message in ATC station component

This commit is contained in:
Klaus Basan
2018-10-05 02:03:15 +02:00
parent 228e686b77
commit 4246e12c31
3 changed files with 28 additions and 17 deletions

View File

@@ -55,7 +55,7 @@ namespace BlackGui
namespace Components namespace Components
{ {
CAtcStationComponent::CAtcStationComponent(QWidget *parent) : CAtcStationComponent::CAtcStationComponent(QWidget *parent) :
QTabWidget(parent), COverlayMessagesTabWidget(parent),
CIdentifiable(this), CIdentifiable(this),
ui(new Ui::CAtcStationComponent) ui(new Ui::CAtcStationComponent)
{ {
@@ -74,6 +74,8 @@ namespace BlackGui
ui->tb_AtcStationsLoadMetar->setText(""); ui->tb_AtcStationsLoadMetar->setText("");
ui->tb_Audio->setIcon(CIcons::appAudio16()); ui->tb_Audio->setIcon(CIcons::appAudio16());
ui->tb_Audio->setText(""); ui->tb_Audio->setText("");
ui->tb_TextMessageOverlay->setIcon(CIcons::appTextMessages16());
ui->tb_TextMessageOverlay->setText("");
// set station mode // set station mode
ui->tvp_AtcStationsOnline->setStationMode(CAtcStationListModel::StationsOnline); ui->tvp_AtcStationsOnline->setStationMode(CAtcStationListModel::StationsOnline);
@@ -86,6 +88,7 @@ namespace BlackGui
connect(ui->le_AtcStationsOnlineMetar, &QLineEdit::returnPressed, this, &CAtcStationComponent::getMetarAsEntered); connect(ui->le_AtcStationsOnlineMetar, &QLineEdit::returnPressed, this, &CAtcStationComponent::getMetarAsEntered);
connect(ui->tb_AtcStationsLoadMetar, &QPushButton::clicked, this, &CAtcStationComponent::getMetarAsEntered); connect(ui->tb_AtcStationsLoadMetar, &QPushButton::clicked, this, &CAtcStationComponent::getMetarAsEntered);
connect(ui->tb_Audio, &QPushButton::clicked, this, &CAtcStationComponent::requestAudioWidget); 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(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::objectClicked, this, &CAtcStationComponent::onlineAtcStationSelected);
connect(ui->tvp_AtcStationsOnline, &CAtcStationView::objectSelected, this, &CAtcStationComponent::onlineAtcStationSelected); connect(ui->tvp_AtcStationsOnline, &CAtcStationView::objectSelected, this, &CAtcStationComponent::onlineAtcStationSelected);
@@ -446,5 +449,10 @@ namespace BlackGui
QAbstractItemModel *treeModelOld = (ui->tvp_AtcStationsOnlineTree->model()); QAbstractItemModel *treeModelOld = (ui->tvp_AtcStationsOnlineTree->model());
if (treeModelOld) { CGuiUtility::clearModel(treeModelOld); } if (treeModelOld) { CGuiUtility::clearModel(treeModelOld); }
} }
void CAtcStationComponent::showOverlayInlineTextMessage()
{
COverlayMessagesTabWidget::showOverlayInlineTextMessage(TextMessagesCom1);
}
} // namespace } // namespace
} // namespace } // namespace

View File

@@ -12,15 +12,16 @@
#ifndef BLACKGUI_ATCSTATIONCOMPONENT_H #ifndef BLACKGUI_ATCSTATIONCOMPONENT_H
#define BLACKGUI_ATCSTATIONCOMPONENT_H #define BLACKGUI_ATCSTATIONCOMPONENT_H
#include "blackcore/network.h"
#include "blackgui/blackguiexport.h"
#include "blackgui/components/enablefordockwidgetinfoarea.h" #include "blackgui/components/enablefordockwidgetinfoarea.h"
#include "blackgui/settings/viewupdatesettings.h" #include "blackgui/settings/viewupdatesettings.h"
#include "blackgui/settings/atcstationssettings.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/atcstation.h"
#include "blackmisc/aviation/comsystem.h" #include "blackmisc/aviation/comsystem.h"
#include "blackmisc/identifiable.h"
#include "blackmisc/pq/frequency.h" #include "blackmisc/pq/frequency.h"
#include "blackmisc/identifiable.h"
#include <QDateTime> #include <QDateTime>
#include <QModelIndex> #include <QModelIndex>
@@ -40,7 +41,7 @@ namespace BlackGui
{ {
//! ATC stations component //! ATC stations component
class BLACKGUI_EXPORT CAtcStationComponent : class BLACKGUI_EXPORT CAtcStationComponent :
public QTabWidget, public COverlayMessagesTabWidget,
public CEnableForDockWidgetInfoArea, public CEnableForDockWidgetInfoArea,
public BlackMisc::CIdentifiable public BlackMisc::CIdentifiable
{ {
@@ -151,6 +152,9 @@ namespace BlackGui
//! Clear the online views //! Clear the online views
void clearOnlineViews(); void clearOnlineViews();
//! Inline message
void showOverlayInlineTextMessage();
QScopedPointer<Ui::CAtcStationComponent> ui; QScopedPointer<Ui::CAtcStationComponent> ui;
QTimer m_updateTimer; QTimer m_updateTimer;
QDateTime m_timestampLastReadOnlineStations; //!< stations read QDateTime m_timestampLastReadOnlineStations; //!< stations read

View File

@@ -110,12 +110,6 @@
</item> </item>
<item row="0" column="3"> <item row="0" column="3">
<widget class="QToolButton" name="tb_AtcStationsAtisReload"> <widget class="QToolButton" name="tb_AtcStationsAtisReload">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Reload ATIS</string> <string>Reload ATIS</string>
</property> </property>
@@ -126,12 +120,6 @@
</item> </item>
<item row="0" column="2"> <item row="0" column="2">
<widget class="QToolButton" name="tb_AtcStationsLoadMetar"> <widget class="QToolButton" name="tb_AtcStationsLoadMetar">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Load METAR</string> <string>Load METAR</string>
</property> </property>
@@ -163,6 +151,16 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="5">
<widget class="QToolButton" name="tb_TextMessageOverlay">
<property name="toolTip">
<string>text message</string>
</property>
<property name="text">
<string>tm</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@@ -301,6 +299,7 @@
<tabstop>tb_AtcStationsLoadMetar</tabstop> <tabstop>tb_AtcStationsLoadMetar</tabstop>
<tabstop>tb_AtcStationsAtisReload</tabstop> <tabstop>tb_AtcStationsAtisReload</tabstop>
<tabstop>tb_Audio</tabstop> <tabstop>tb_Audio</tabstop>
<tabstop>tb_TextMessageOverlay</tabstop>
<tabstop>comp_AtcStationsSettings</tabstop> <tabstop>comp_AtcStationsSettings</tabstop>
<tabstop>te_AtcStationsOnlineInfo</tabstop> <tabstop>te_AtcStationsOnlineInfo</tabstop>
<tabstop>tvp_AtcStationsOnlineTree</tabstop> <tabstop>tvp_AtcStationsOnlineTree</tabstop>