mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-28 11:45:40 +08:00
Ref T226, country selector
This commit is contained in:
63
src/blackgui/components/countryselector.h
Normal file
63
src/blackgui/components/countryselector.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/* 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_COUNTRYSELECTOR_H
|
||||
#define BLACKGUI_COMPONENTS_COUNTRYSELECTOR_H
|
||||
|
||||
#include "blackmisc/country.h"
|
||||
#include <QFrame>
|
||||
#include <QScopedPointer>
|
||||
|
||||
namespace Ui { class CCountrySelector; }
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
/**
|
||||
* @brief Select a valid country
|
||||
*/
|
||||
class CCountrySelector : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
explicit CCountrySelector(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CCountrySelector();
|
||||
|
||||
//! Set country
|
||||
void setCountry(const BlackMisc::CCountry &country);
|
||||
|
||||
//! Get country
|
||||
const BlackMisc::CCountry &getCountry() const { return m_current; }
|
||||
|
||||
signals:
|
||||
//! Changed country
|
||||
void countryChanged(const BlackMisc::CCountry &country);
|
||||
|
||||
private:
|
||||
//! Countries loaded
|
||||
void onCountriesLoaded();
|
||||
|
||||
//! ISO has been changed
|
||||
void onIsoChanged();
|
||||
|
||||
//! Country name has been changed
|
||||
void onCountryNameChanged(const QString &name);
|
||||
|
||||
BlackMisc::CCountry m_current;
|
||||
QScopedPointer<Ui::CCountrySelector> ui;
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user