mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
Ref T384, ATC button component and integration in text message component
This commit is contained in:
78
src/blackgui/components/atcbuttoncomponent.h
Normal file
78
src/blackgui/components/atcbuttoncomponent.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/* 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_COMPONENTS_ATCBUTTONCOMPONENT_H
|
||||
#define BLACKGUI_COMPONENTS_ATCBUTTONCOMPONENT_H
|
||||
|
||||
#include "blackcore/context/contextnetwork.h"
|
||||
#include <QFrame>
|
||||
#include <QScopedPointer>
|
||||
|
||||
namespace Ui { class CAtcButtonComponent; }
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
//! ATC stations as button bar
|
||||
class CAtcButtonComponent : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Ctor
|
||||
explicit CAtcButtonComponent(QWidget *parent = nullptr);
|
||||
|
||||
//! Dtor
|
||||
virtual ~CAtcButtonComponent();
|
||||
|
||||
//! Update
|
||||
void updateStations();
|
||||
|
||||
//! Max.number
|
||||
void setMaxNumber(int number) { m_maxNumber = number; }
|
||||
|
||||
//! Max.number
|
||||
int getMaxNumber() const { return m_maxNumber; }
|
||||
|
||||
//! Rows/columns
|
||||
void setRowsColumns(int rows, int cols, bool setMaxElements);
|
||||
|
||||
//! Ignore non ATC callsigns
|
||||
void setIgnoreNonAtcCallsigns(bool ignore) { m_ignoreNonAtc = ignore; }
|
||||
|
||||
//! Background updates
|
||||
void setBackgroundUpdates(bool backgroundUpdates) { m_backgroundUpdates = backgroundUpdates; }
|
||||
|
||||
signals:
|
||||
//! ATC station clicked
|
||||
void requestAtcStation(const BlackMisc::Aviation::CAtcStation &station);
|
||||
|
||||
private:
|
||||
//! Changed ATC stations
|
||||
void onChangedAtcStations();
|
||||
|
||||
//! Connection status did change
|
||||
void onConnectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to);
|
||||
|
||||
//! Button has been clicked
|
||||
void onButtonClicked();
|
||||
|
||||
QScopedPointer<Ui::CAtcButtonComponent> ui;
|
||||
bool m_ignoreNonAtc = true;
|
||||
bool m_backgroundUpdates = true;
|
||||
int m_maxNumber = 8;
|
||||
int m_rows = 2;
|
||||
int m_cols = 4;
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user