Ref T384, ATC button component and integration in text message component

This commit is contained in:
Klaus Basan
2018-10-05 02:01:17 +02:00
parent df08923455
commit 228e686b77
8 changed files with 319 additions and 25 deletions

View 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