Ref T442, own ATC station tree view class

This commit is contained in:
Klaus Basan
2018-12-05 03:58:08 +01:00
parent 624de52724
commit 18788a8d4d
2 changed files with 168 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
/* Copyright (C) 2018
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
//! \file
#ifndef BLACKGUI_ATCSTATIONTREEVIEW_H
#define BLACKGUI_ATCSTATIONTREEVIEW_H
#include "blackgui/blackguiexport.h"
#include "blackmisc/aviation/atcstationlist.h"
#include "blackmisc/aviation/comsystem.h"
#include "blackmisc/pq/frequency.h"
#include <QTreeView>
#include <QList>
#include <QObject>
#include <QPoint>
namespace BlackGui
{
namespace Models { class CAtcStationTreeModel; }
namespace Views
{
//! ATC stations view
class BLACKGUI_EXPORT CAtcStationTreeView : public QTreeView
{
Q_OBJECT
public:
//! Constructor
explicit CAtcStationTreeView(QWidget *parent = nullptr);
//! \copydoc Models::CAtcStationListModel::changedAtcStationConnectionStatus
void changedAtcStationConnectionStatus(const BlackMisc::Aviation::CAtcStation &station, bool added);
signals:
//! Request some dummy ATC stations
void testRequestDummyAtcOnlineStations(int number);
//! Request COM frequency
void requestComFrequency(const BlackMisc::PhysicalQuantities::CFrequency &frequency, BlackMisc::Aviation::CComSystem::ComUnit unit);
//! Request a text message to
void requestTextMessageWidget(const BlackMisc::Aviation::CCallsign &callsign);
private:
//! Used model
const Models::CAtcStationTreeModel *stationModel() const;
//! The selected object
BlackMisc::Aviation::CAtcStation selectedObject() const;
//! Custom menu
void customMenu(const QPoint &point);
void tuneInAtcCom1();
void tuneInAtcCom2();
void requestTextMessage();
};
} // ns
} // ns
#endif // guard