mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 11:05:44 +08:00
Aircraft parts history component
This frame component allows to display the current aircraft parts and the received history for a given callsign. refs #835
This commit is contained in:
committed by
Mathew Sutcliffe
parent
4994bf12b2
commit
7e1a3d4ef2
81
src/blackgui/components/aircraftpartshistory.h
Normal file
81
src/blackgui/components/aircraftpartshistory.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/* Copyright (C) 2016
|
||||
* 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_COMPONENT_AIRCRAFTPARTSHISTORY_H
|
||||
#define BLACKGUI_COMPONENT_AIRCRAFTPARTSHISTORY_H
|
||||
|
||||
#include "blackcore/network.h"
|
||||
#include <QFrame>
|
||||
#include <QTabWidget>
|
||||
#include <QTimer>
|
||||
#include <QTextDocument>
|
||||
|
||||
namespace Ui { class CAircraftPartsHistory; }
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
/*!
|
||||
* History frame for received aircraft parts
|
||||
*/
|
||||
class CAircraftPartsHistory : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
explicit CAircraftPartsHistory(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
~CAircraftPartsHistory();
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CAircraftPartsHistory> ui;
|
||||
QTimer m_timerCallsignUpdate { this };
|
||||
QTimer m_timerUpdateHistory { this };
|
||||
QTextDocument m_text { this };
|
||||
bool isBeingModified = false;
|
||||
|
||||
//! Init
|
||||
void initGui();
|
||||
|
||||
//! Contexts available
|
||||
bool hasContexts() const;
|
||||
|
||||
//! Is parts history enabled?
|
||||
bool partsHistoryEnabled() const;
|
||||
|
||||
private:
|
||||
//! Update the completer
|
||||
void updateCallsignCompleter();
|
||||
|
||||
//! Update parts history
|
||||
void updatePartsHistory();
|
||||
|
||||
//! Callsign was entered
|
||||
void callsignEntered();
|
||||
|
||||
//! Callsign was modified
|
||||
void callsignModified();
|
||||
|
||||
//! When values changed elsewhere
|
||||
void valuesChanged();
|
||||
|
||||
//! Toggle between enabling and disabling of history
|
||||
void toggleHistoryEnabled(bool enabled);
|
||||
|
||||
//! Connection status changed
|
||||
void connectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to);
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user