mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 23:35:33 +08:00
Ref T252, formatting
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <QStringList>
|
||||
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackMisc::Simulation::Settings;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
@@ -96,7 +97,7 @@ namespace BlackGui
|
||||
return this->modelSetComponent()->modelSetLoader();
|
||||
}
|
||||
|
||||
const Settings::CMultiSimulatorSettings &CFirstModelSetComponent::simulatorSettings() const
|
||||
const CMultiSimulatorSettings &CFirstModelSetComponent::simulatorSettings() const
|
||||
{
|
||||
return this->modelLoader()->multiSimulatorSettings();
|
||||
}
|
||||
|
||||
@@ -69,19 +69,19 @@ namespace BlackGui
|
||||
ui->le_MaxDistance->setValidator(new QIntValidator(ui->le_MaxDistance));
|
||||
|
||||
// connects
|
||||
connect(sGui->getIContextSimulator(), &IContextSimulator::simulatorPluginChanged, this, &CSettingsSimulatorComponent::ps_simulatorPluginChanged);
|
||||
connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginStateChanged, this, &CSettingsSimulatorComponent::ps_pluginStateChanged);
|
||||
connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginDetailsRequested, this, &CSettingsSimulatorComponent::ps_showPluginDetails);
|
||||
connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginConfigRequested, this, &CSettingsSimulatorComponent::ps_showPluginConfig);
|
||||
connect(ui->pb_ApplyMaxAircraft, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::ps_onApplyMaxRenderedAircraft);
|
||||
connect(ui->pb_ApplyTimeSync, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::ps_onApplyTimeSync);
|
||||
connect(ui->pb_ApplyMaxDistance, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::ps_onApplyMaxRenderedDistance);
|
||||
connect(ui->pb_ClearRestrictedRendering, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::ps_clearRestricedRendering);
|
||||
connect(ui->pb_DisableRendering, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::ps_onApplyDisableRendering);
|
||||
connect(ui->le_MaxAircraft, &QLineEdit::editingFinished, this, &CSettingsSimulatorComponent::ps_onApplyMaxRenderedAircraft);
|
||||
connect(ui->le_MaxDistance, &QLineEdit::editingFinished, this, &CSettingsSimulatorComponent::ps_onApplyMaxRenderedDistance);
|
||||
connect(ui->le_MaxAircraft, &QLineEdit::returnPressed, this, &CSettingsSimulatorComponent::ps_onApplyMaxRenderedAircraft);
|
||||
connect(ui->le_MaxDistance, &QLineEdit::returnPressed, this, &CSettingsSimulatorComponent::ps_onApplyMaxRenderedDistance);
|
||||
connect(sGui->getIContextSimulator(), &IContextSimulator::simulatorPluginChanged, this, &CSettingsSimulatorComponent::simulatorPluginChanged);
|
||||
connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginStateChanged, this, &CSettingsSimulatorComponent::pluginStateChanged);
|
||||
connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginDetailsRequested, this, &CSettingsSimulatorComponent::showPluginDetails);
|
||||
connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginConfigRequested, this, &CSettingsSimulatorComponent::showPluginConfig);
|
||||
connect(ui->pb_ApplyMaxAircraft, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::onApplyMaxRenderedAircraft);
|
||||
connect(ui->pb_ApplyTimeSync, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::onApplyTimeSync);
|
||||
connect(ui->pb_ApplyMaxDistance, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::onApplyMaxRenderedDistance);
|
||||
connect(ui->pb_ClearRestrictedRendering, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::clearRestricedRendering);
|
||||
connect(ui->pb_DisableRendering, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::onApplyDisableRendering);
|
||||
connect(ui->le_MaxAircraft, &QLineEdit::editingFinished, this, &CSettingsSimulatorComponent::onApplyMaxRenderedAircraft);
|
||||
connect(ui->le_MaxDistance, &QLineEdit::editingFinished, this, &CSettingsSimulatorComponent::onApplyMaxRenderedDistance);
|
||||
connect(ui->le_MaxAircraft, &QLineEdit::returnPressed, this, &CSettingsSimulatorComponent::onApplyMaxRenderedAircraft);
|
||||
connect(ui->le_MaxDistance, &QLineEdit::returnPressed, this, &CSettingsSimulatorComponent::onApplyMaxRenderedDistance);
|
||||
|
||||
// list all available simulators
|
||||
for (const auto &p : getAvailablePlugins())
|
||||
@@ -91,10 +91,10 @@ namespace BlackGui
|
||||
}
|
||||
|
||||
// config
|
||||
ps_reloadPluginConfig();
|
||||
reloadPluginConfig();
|
||||
|
||||
// init
|
||||
ps_simulatorPluginChanged(sGui->getIContextSimulator()->getSimulatorPluginInfo());
|
||||
simulatorPluginChanged(sGui->getIContextSimulator()->getSimulatorPluginInfo());
|
||||
}
|
||||
|
||||
CSettingsSimulatorComponent::~CSettingsSimulatorComponent()
|
||||
@@ -145,7 +145,7 @@ namespace BlackGui
|
||||
return sGui->getIContextSimulator()->getAvailableSimulatorPlugins();
|
||||
}
|
||||
|
||||
void CSettingsSimulatorComponent::ps_pluginStateChanged(const QString &identifier, bool enabled)
|
||||
void CSettingsSimulatorComponent::pluginStateChanged(const QString &identifier, bool enabled)
|
||||
{
|
||||
Q_ASSERT(sGui && sGui->getIContextSimulator());
|
||||
|
||||
@@ -178,7 +178,7 @@ namespace BlackGui
|
||||
// changing of GUI state will be done via received signal
|
||||
}
|
||||
|
||||
void CSettingsSimulatorComponent::ps_onApplyMaxRenderedAircraft()
|
||||
void CSettingsSimulatorComponent::onApplyMaxRenderedAircraft()
|
||||
{
|
||||
// get initial aircraft to render
|
||||
CInterpolationAndRenderingSetup setup = sGui->getIContextSimulator()->getInterpolationAndRenderingSetup();
|
||||
@@ -205,7 +205,7 @@ namespace BlackGui
|
||||
this->setGuiValues();
|
||||
}
|
||||
|
||||
void CSettingsSimulatorComponent::ps_onApplyMaxRenderedDistance()
|
||||
void CSettingsSimulatorComponent::onApplyMaxRenderedDistance()
|
||||
{
|
||||
// get initial aircraft to render
|
||||
CInterpolationAndRenderingSetup setup = sGui->getIContextSimulator()->getInterpolationAndRenderingSetup();
|
||||
@@ -229,7 +229,7 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void CSettingsSimulatorComponent::ps_onApplyDisableRendering()
|
||||
void CSettingsSimulatorComponent::onApplyDisableRendering()
|
||||
{
|
||||
CInterpolationAndRenderingSetup setup = sGui->getIContextSimulator()->getInterpolationAndRenderingSetup();
|
||||
setup.disableRendering();
|
||||
@@ -237,7 +237,7 @@ namespace BlackGui
|
||||
this->setGuiValues();
|
||||
}
|
||||
|
||||
void CSettingsSimulatorComponent::ps_onApplyTimeSync()
|
||||
void CSettingsSimulatorComponent::onApplyTimeSync()
|
||||
{
|
||||
const bool timeSync = ui->cb_TimeSync->isChecked();
|
||||
const QString os = ui->le_TimeSyncOffset->text();
|
||||
@@ -256,7 +256,7 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void CSettingsSimulatorComponent::ps_clearRestricedRendering()
|
||||
void CSettingsSimulatorComponent::clearRestricedRendering()
|
||||
{
|
||||
CInterpolationAndRenderingSetup setup;
|
||||
setup.clearAllRenderingRestrictions();
|
||||
@@ -264,7 +264,7 @@ namespace BlackGui
|
||||
this->setGuiValues();
|
||||
}
|
||||
|
||||
void CSettingsSimulatorComponent::ps_simulatorPluginChanged(const CSimulatorPluginInfo &info)
|
||||
void CSettingsSimulatorComponent::simulatorPluginChanged(const CSimulatorPluginInfo &info)
|
||||
{
|
||||
// I intentionally do not set the selected plugin combobox here
|
||||
// as this would cause undesired roundtrips
|
||||
@@ -283,7 +283,7 @@ namespace BlackGui
|
||||
this->setGuiValues();
|
||||
}
|
||||
|
||||
void CSettingsSimulatorComponent::ps_showPluginDetails(const QString &identifier)
|
||||
void CSettingsSimulatorComponent::showPluginDetails(const QString &identifier)
|
||||
{
|
||||
const CSimulatorPluginInfoList simDrivers(getAvailablePlugins());
|
||||
const CSimulatorPluginInfo selected = simDrivers.findByIdentifier(identifier);
|
||||
@@ -303,7 +303,7 @@ namespace BlackGui
|
||||
w->show();
|
||||
}
|
||||
|
||||
void CSettingsSimulatorComponent::ps_showPluginConfig(const QString &identifier)
|
||||
void CSettingsSimulatorComponent::showPluginConfig(const QString &identifier)
|
||||
{
|
||||
const CSimulatorPluginInfoList simDrivers(getAvailablePlugins());
|
||||
const CSimulatorPluginInfo selected = simDrivers.findByIdentifier(identifier);
|
||||
@@ -321,7 +321,7 @@ namespace BlackGui
|
||||
window->show();
|
||||
}
|
||||
|
||||
void CSettingsSimulatorComponent::ps_reloadPluginConfig()
|
||||
void CSettingsSimulatorComponent::reloadPluginConfig()
|
||||
{
|
||||
// list all available simulators
|
||||
const auto enabledSimulators = m_enabledSimulators.getThreadLocal();
|
||||
|
||||
@@ -43,38 +43,37 @@ namespace BlackGui
|
||||
//! Destructor
|
||||
virtual ~CSettingsSimulatorComponent();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
//! Driver plugin enabled/disabled
|
||||
void ps_pluginStateChanged(const QString &identifier, bool enabled);
|
||||
void pluginStateChanged(const QString &identifier, bool enabled);
|
||||
|
||||
//! Apply max.aircraft
|
||||
void ps_onApplyMaxRenderedAircraft();
|
||||
void onApplyMaxRenderedAircraft();
|
||||
|
||||
//! Apply max.distance
|
||||
void ps_onApplyMaxRenderedDistance();
|
||||
void onApplyMaxRenderedDistance();
|
||||
|
||||
//! Apply disable rendering
|
||||
void ps_onApplyDisableRendering();
|
||||
void onApplyDisableRendering();
|
||||
|
||||
//! Apply time sync
|
||||
void ps_onApplyTimeSync();
|
||||
void onApplyTimeSync();
|
||||
|
||||
//! Clear restricted rendering
|
||||
void ps_clearRestricedRendering();
|
||||
void clearRestricedRendering();
|
||||
|
||||
//! Simulator plugin changed
|
||||
void ps_simulatorPluginChanged(const BlackMisc::Simulation::CSimulatorPluginInfo &info);
|
||||
void simulatorPluginChanged(const BlackMisc::Simulation::CSimulatorPluginInfo &info);
|
||||
|
||||
//! Open plugin details window
|
||||
void ps_showPluginDetails(const QString &identifier);
|
||||
void showPluginDetails(const QString &identifier);
|
||||
|
||||
//! Show plugin config
|
||||
void ps_showPluginConfig(const QString &identifier);
|
||||
void showPluginConfig(const QString &identifier);
|
||||
|
||||
//! Select/deselect enabled/disabled plugins
|
||||
void ps_reloadPluginConfig();
|
||||
void reloadPluginConfig();
|
||||
|
||||
private:
|
||||
//! Set the GUI values
|
||||
void setGuiValues();
|
||||
|
||||
@@ -84,7 +83,7 @@ namespace BlackGui
|
||||
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 };
|
||||
BlackMisc::CSetting<BlackCore::Application::TEnabledSimulators> m_enabledSimulators { this, &CSettingsSimulatorComponent::reloadPluginConfig };
|
||||
};
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user