mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
93 lines
3.0 KiB
C++
93 lines
3.0 KiB
C++
/* Copyright (C) 2013
|
|
* 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_SETTINGSSIMULATORCOMPONENT_H
|
|
#define BLACKGUI_COMPONENTS_SETTINGSSIMULATORCOMPONENT_H
|
|
|
|
#include "blackcore/application/applicationsettings.h"
|
|
#include "blackgui/blackguiexport.h"
|
|
#include "blackmisc/settingscache.h"
|
|
#include "blackmisc/simulation/simulatorplugininfolist.h"
|
|
|
|
#include <QFrame>
|
|
#include <QObject>
|
|
#include <QScopedPointer>
|
|
#include <QString>
|
|
|
|
class QWidget;
|
|
|
|
namespace BlackCore { class CPluginManagerSimulator; }
|
|
namespace BlackMisc { namespace Simulation { class CSimulatorPluginInfo; } }
|
|
namespace Ui { class CSettingsSimulatorComponent; }
|
|
namespace BlackGui
|
|
{
|
|
namespace Components
|
|
{
|
|
//! All simulator settings component (GUI)
|
|
class BLACKGUI_EXPORT CSettingsSimulatorComponent : public QFrame
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
//! Constructor
|
|
explicit CSettingsSimulatorComponent(QWidget *parent = nullptr);
|
|
|
|
//! Destructor
|
|
virtual ~CSettingsSimulatorComponent();
|
|
|
|
private slots:
|
|
//! Driver plugin enabled/disabled
|
|
void ps_pluginStateChanged(const QString &identifier, bool enabled);
|
|
|
|
//! Apply max.aircraft
|
|
void ps_onApplyMaxRenderedAircraft();
|
|
|
|
//! Apply max.distance
|
|
void ps_onApplyMaxRenderedDistance();
|
|
|
|
//! Apply disable rendering
|
|
void ps_onApplyDisableRendering();
|
|
|
|
//! Apply time sync
|
|
void ps_onApplyTimeSync();
|
|
|
|
//! Clear restricted rendering
|
|
void ps_clearRestricedRendering();
|
|
|
|
//! Simulator plugin changed
|
|
void ps_simulatorPluginChanged(const BlackMisc::Simulation::CSimulatorPluginInfo &info);
|
|
|
|
//! Open plugin details window
|
|
void ps_showPluginDetails(const QString &identifier);
|
|
|
|
//! Show plugin config
|
|
void ps_showPluginConfig(const QString &identifier);
|
|
|
|
//! Select/deselect enabled/disabled plugins
|
|
void ps_reloadPluginConfig();
|
|
|
|
private:
|
|
//! Set the GUI values
|
|
void setGuiValues();
|
|
|
|
//! Available plugins, auto pseudo plugin added
|
|
BlackMisc::Simulation::CSimulatorPluginInfoList getAvailablePlugins() const;
|
|
|
|
QScopedPointer<Ui::CSettingsSimulatorComponent> ui; //!< UI
|
|
bool m_pluginLoaded = false; //!< plugin loaded?
|
|
BlackCore::CPluginManagerSimulator* m_plugins = nullptr;
|
|
BlackMisc::CSetting<BlackCore::Application::TEnabledSimulators> m_enabledSimulators { this, &CSettingsSimulatorComponent::ps_reloadPluginConfig };
|
|
};
|
|
}
|
|
} // namespace
|
|
|
|
#endif // guard
|