mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45:33 +08:00
Ref T219, pilot name form
(used to override server credentials for VATSIM/other servers)
This commit is contained in:
78
src/blackgui/editors/pilotform.h
Normal file
78
src/blackgui/editors/pilotform.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/* Copyright (C) 2017
|
||||
* 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_EDITORS_PILOTFORM_H
|
||||
#define BLACKGUI_EDITORS_PILOTFORM_H
|
||||
|
||||
#include "blackgui/editors/form.h"
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackmisc/network/user.h"
|
||||
#include "blackmisc/network/entityflags.h"
|
||||
#include <QFrame>
|
||||
#include <QScopedPointer>
|
||||
#include <QIntValidator>
|
||||
|
||||
namespace Ui { class CPilotForm; }
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Editors
|
||||
{
|
||||
//! Pilot form (name, homebase)
|
||||
class BLACKGUI_EXPORT CPilotForm : public CForm
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
explicit CPilotForm(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CPilotForm();
|
||||
|
||||
//! Set VATSIM validation mode
|
||||
void setVatsimValidation(bool vatsim);
|
||||
|
||||
//! Values as user
|
||||
BlackMisc::Network::CUser getUser() const;
|
||||
|
||||
//! Set user values
|
||||
bool setUser(const BlackMisc::Network::CUser &user, bool ignoreEmptyUser = false);
|
||||
|
||||
//! Clear values
|
||||
void clear();
|
||||
|
||||
//! \name Form class implementations
|
||||
//! @{
|
||||
virtual void setReadOnly(bool readonly) override;
|
||||
virtual BlackMisc::CStatusMessageList validate(bool nested = false) const override;
|
||||
//! @}
|
||||
|
||||
private:
|
||||
//! Unhide password
|
||||
void unhidePassword();
|
||||
|
||||
//! Completers
|
||||
void initCompleters(BlackMisc::Network::CEntityFlags::Entity entity);
|
||||
|
||||
//! Web services read
|
||||
void onWebServiceDataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number);
|
||||
|
||||
//! Call validation
|
||||
void doValidation();
|
||||
|
||||
QScopedPointer<Ui::CPilotForm> ui;
|
||||
QScopedPointer<QIntValidator> m_vatsimIntValidator { new QIntValidator(100000, 9999999, this) };
|
||||
bool m_vatsim = false;
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user