mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
82 lines
2.4 KiB
C++
82 lines
2.4 KiB
C++
/* Copyright (C) 2015
|
|
* 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_REMOTEAIRCRAFTSELECTOR_H
|
|
#define BLACKGUI_REMOTEAIRCRAFTSELECTOR_H
|
|
|
|
#include "blackgui/blackguiexport.h"
|
|
#include "blackmisc/aviation/callsign.h"
|
|
#include "blackmisc/simulation/simulatedaircraftlist.h"
|
|
|
|
#include <QFrame>
|
|
#include <QObject>
|
|
#include <QScopedPointer>
|
|
|
|
class QShowEvent;
|
|
class QWidget;
|
|
|
|
namespace BlackMisc { namespace Simulation { class CSimulatedAircraft; } }
|
|
namespace Ui { class CRemoteAircraftSelector; }
|
|
namespace BlackGui
|
|
{
|
|
namespace Components
|
|
{
|
|
//! Select a remote aircraft
|
|
class BLACKGUI_EXPORT CRemoteAircraftSelector : public QFrame
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
//! Constructor
|
|
explicit CRemoteAircraftSelector(QWidget *parent = nullptr);
|
|
|
|
//! Destructor
|
|
virtual ~CRemoteAircraftSelector();
|
|
|
|
//! Selected callsign
|
|
BlackMisc::Aviation::CCallsign getSelectedCallsign() const;
|
|
|
|
//! Indicate if aircraft parts enabled aircraft
|
|
void indicatePartsEnabled(bool indicate);
|
|
|
|
signals:
|
|
//! Callsign changed
|
|
void changedCallsign();
|
|
|
|
protected:
|
|
//! \copydoc QWidget::showEvent
|
|
virtual void showEvent(QShowEvent *event) override;
|
|
|
|
private slots:
|
|
//! Change content of combobox
|
|
void ps_onAddedAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
|
|
|
//! IContextNetwork::removedAircraft
|
|
void ps_onRemovedAircraft(const BlackMisc::Aviation::CCallsign &callsign);
|
|
|
|
//! Combo box has been changed
|
|
void ps_comboBoxChanged(const QString &text);
|
|
|
|
private:
|
|
QScopedPointer<Ui::CRemoteAircraftSelector> ui;
|
|
|
|
QString m_currentText;
|
|
bool m_showPartsEnabled = false;
|
|
BlackMisc::Simulation::CSimulatedAircraftList m_aircraft;
|
|
|
|
//! Set combobox items
|
|
void fillComboBox();
|
|
};
|
|
} // namespace
|
|
} // namespace
|
|
|
|
#endif // guard
|