mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 00:25:35 +08:00
Ref T226, airport completer
* a bigger one with name * same as dialog * smaller one, using the dialog
This commit is contained in:
74
src/blackgui/components/airportcompleter.h
Normal file
74
src/blackgui/components/airportcompleter.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/* 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_AIRPORTCOMPLETER_H
|
||||
#define BLACKGUI_COMPONENTS_AIRPORTCOMPLETER_H
|
||||
|
||||
#include "blackmisc/aviation/airport.h"
|
||||
#include <QFrame>
|
||||
#include <QScopedPointer>
|
||||
|
||||
namespace Ui { class CAirportCompleter; }
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
//! Airport completer, UI element so select by ICAO, name or location
|
||||
class CAirportCompleter : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Get the correct airport
|
||||
explicit CAirportCompleter(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CAirportCompleter();
|
||||
|
||||
//! Set airport
|
||||
void setAirport(const BlackMisc::Aviation::CAirport &airport);
|
||||
|
||||
//! Get airport
|
||||
const BlackMisc::Aviation::CAirport &getAirport() const { return m_current; }
|
||||
|
||||
//! The raw ICAO code text
|
||||
QString getIcaoText() const;
|
||||
|
||||
//! Read only
|
||||
void setReadOnly(bool readOnly);
|
||||
|
||||
//! Clear the form
|
||||
void clear();
|
||||
|
||||
signals:
|
||||
//! Airport has been changed
|
||||
void changedAirport(const BlackMisc::Aviation::CAirport &airport);
|
||||
|
||||
private:
|
||||
//! ICAO code has been changed in UI
|
||||
void onIcaoChanged();
|
||||
|
||||
//! Name has been changed in UI
|
||||
void onNameChanged();
|
||||
|
||||
//! Location has been changed in UI
|
||||
void onLocationChanged();
|
||||
|
||||
//! Airports backend data changed
|
||||
void onAirportsChanged();
|
||||
|
||||
QScopedPointer <Ui::CAirportCompleter> ui;
|
||||
BlackMisc::Aviation::CAirport m_current; //!< current airport
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user