mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-10 05:55:33 +08:00
refs #485, moved some gui classes to components
Originally components was meant for runtime based components. No longer true, so some classes now better find into that namespace.
This commit is contained in:
committed by
Mathew Sutcliffe
parent
96913c6dc1
commit
6a06aa0460
85
src/blackgui/components/simulatorselector.h
Normal file
85
src/blackgui/components/simulatorselector.h
Normal file
@@ -0,0 +1,85 @@
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#ifndef BLACKGUI_COMPONENTS_SIMULATORSELECTOR_H
|
||||
#define BLACKGUI_COMPONENTS_SIMULATORSELECTOR_H
|
||||
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackmisc/simulation/simulatorinfo.h"
|
||||
#include <QScopedPointer>
|
||||
#include <QFrame>
|
||||
|
||||
namespace Ui { class CSimulatorSelector; }
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
/*!
|
||||
* Select simulator
|
||||
*/
|
||||
class BLACKGUI_EXPORT CSimulatorSelector : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! How to display
|
||||
enum Mode
|
||||
{
|
||||
CheckBoxes,
|
||||
RadioButtons
|
||||
};
|
||||
|
||||
//! Constructor
|
||||
explicit CSimulatorSelector(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
~CSimulatorSelector();
|
||||
|
||||
//! How to display
|
||||
void setMode(Mode mode);
|
||||
|
||||
//! No selection treated same as all selected (filters)
|
||||
void setNoSelectionMeansAll(bool v) { this->m_noSelectionMeansAll = v; }
|
||||
|
||||
//! Get the value
|
||||
BlackMisc::Simulation::CSimulatorInfo getValue() const;
|
||||
|
||||
//! Set the value
|
||||
void setValue(const BlackMisc::Simulation::CSimulatorInfo &info);
|
||||
|
||||
//! Set all, only making sense with checkboxes
|
||||
void setAll();
|
||||
|
||||
//! Not selected at all
|
||||
bool isUnselected() const;
|
||||
|
||||
//! All selected
|
||||
bool areAllSelected() const;
|
||||
|
||||
signals:
|
||||
//! Value has been changed
|
||||
void changed(const BlackMisc::Simulation::CSimulatorInfo &info);
|
||||
|
||||
private slots:
|
||||
//! Radio button changed
|
||||
void ps_RadioButtonChanged(bool checked);
|
||||
|
||||
//! Checkbox changed
|
||||
void ps_CheckBoxChanged(bool checked);
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CSimulatorSelector> ui;
|
||||
Mode m_mode = CheckBoxes;
|
||||
bool m_noSelectionMeansAll = false; //!< for filters, no selection means all
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user