Ref T252, formatting

This commit is contained in:
Klaus Basan
2018-02-15 22:30:39 +01:00
parent 4da3309226
commit 1970ae9f9b
7 changed files with 54 additions and 54 deletions

View File

@@ -16,6 +16,7 @@
#include <QStringList> #include <QStringList>
using namespace BlackMisc::Simulation; using namespace BlackMisc::Simulation;
using namespace BlackMisc::Simulation::Settings;
namespace BlackGui namespace BlackGui
{ {
@@ -96,7 +97,7 @@ namespace BlackGui
return this->modelSetComponent()->modelSetLoader(); return this->modelSetComponent()->modelSetLoader();
} }
const Settings::CMultiSimulatorSettings &CFirstModelSetComponent::simulatorSettings() const const CMultiSimulatorSettings &CFirstModelSetComponent::simulatorSettings() const
{ {
return this->modelLoader()->multiSimulatorSettings(); return this->modelLoader()->multiSimulatorSettings();
} }

View File

@@ -69,19 +69,19 @@ namespace BlackGui
ui->le_MaxDistance->setValidator(new QIntValidator(ui->le_MaxDistance)); ui->le_MaxDistance->setValidator(new QIntValidator(ui->le_MaxDistance));
// connects // connects
connect(sGui->getIContextSimulator(), &IContextSimulator::simulatorPluginChanged, this, &CSettingsSimulatorComponent::ps_simulatorPluginChanged); connect(sGui->getIContextSimulator(), &IContextSimulator::simulatorPluginChanged, this, &CSettingsSimulatorComponent::simulatorPluginChanged);
connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginStateChanged, this, &CSettingsSimulatorComponent::ps_pluginStateChanged); connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginStateChanged, this, &CSettingsSimulatorComponent::pluginStateChanged);
connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginDetailsRequested, this, &CSettingsSimulatorComponent::ps_showPluginDetails); connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginDetailsRequested, this, &CSettingsSimulatorComponent::showPluginDetails);
connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginConfigRequested, this, &CSettingsSimulatorComponent::ps_showPluginConfig); connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginConfigRequested, this, &CSettingsSimulatorComponent::showPluginConfig);
connect(ui->pb_ApplyMaxAircraft, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::ps_onApplyMaxRenderedAircraft); connect(ui->pb_ApplyMaxAircraft, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::onApplyMaxRenderedAircraft);
connect(ui->pb_ApplyTimeSync, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::ps_onApplyTimeSync); connect(ui->pb_ApplyTimeSync, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::onApplyTimeSync);
connect(ui->pb_ApplyMaxDistance, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::ps_onApplyMaxRenderedDistance); connect(ui->pb_ApplyMaxDistance, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::onApplyMaxRenderedDistance);
connect(ui->pb_ClearRestrictedRendering, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::ps_clearRestricedRendering); connect(ui->pb_ClearRestrictedRendering, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::clearRestricedRendering);
connect(ui->pb_DisableRendering, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::ps_onApplyDisableRendering); connect(ui->pb_DisableRendering, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::onApplyDisableRendering);
connect(ui->le_MaxAircraft, &QLineEdit::editingFinished, this, &CSettingsSimulatorComponent::ps_onApplyMaxRenderedAircraft); connect(ui->le_MaxAircraft, &QLineEdit::editingFinished, this, &CSettingsSimulatorComponent::onApplyMaxRenderedAircraft);
connect(ui->le_MaxDistance, &QLineEdit::editingFinished, this, &CSettingsSimulatorComponent::ps_onApplyMaxRenderedDistance); connect(ui->le_MaxDistance, &QLineEdit::editingFinished, this, &CSettingsSimulatorComponent::onApplyMaxRenderedDistance);
connect(ui->le_MaxAircraft, &QLineEdit::returnPressed, this, &CSettingsSimulatorComponent::ps_onApplyMaxRenderedAircraft); connect(ui->le_MaxAircraft, &QLineEdit::returnPressed, this, &CSettingsSimulatorComponent::onApplyMaxRenderedAircraft);
connect(ui->le_MaxDistance, &QLineEdit::returnPressed, this, &CSettingsSimulatorComponent::ps_onApplyMaxRenderedDistance); connect(ui->le_MaxDistance, &QLineEdit::returnPressed, this, &CSettingsSimulatorComponent::onApplyMaxRenderedDistance);
// list all available simulators // list all available simulators
for (const auto &p : getAvailablePlugins()) for (const auto &p : getAvailablePlugins())
@@ -91,10 +91,10 @@ namespace BlackGui
} }
// config // config
ps_reloadPluginConfig(); reloadPluginConfig();
// init // init
ps_simulatorPluginChanged(sGui->getIContextSimulator()->getSimulatorPluginInfo()); simulatorPluginChanged(sGui->getIContextSimulator()->getSimulatorPluginInfo());
} }
CSettingsSimulatorComponent::~CSettingsSimulatorComponent() CSettingsSimulatorComponent::~CSettingsSimulatorComponent()
@@ -145,7 +145,7 @@ namespace BlackGui
return sGui->getIContextSimulator()->getAvailableSimulatorPlugins(); 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()); Q_ASSERT(sGui && sGui->getIContextSimulator());
@@ -178,7 +178,7 @@ namespace BlackGui
// changing of GUI state will be done via received signal // changing of GUI state will be done via received signal
} }
void CSettingsSimulatorComponent::ps_onApplyMaxRenderedAircraft() void CSettingsSimulatorComponent::onApplyMaxRenderedAircraft()
{ {
// get initial aircraft to render // get initial aircraft to render
CInterpolationAndRenderingSetup setup = sGui->getIContextSimulator()->getInterpolationAndRenderingSetup(); CInterpolationAndRenderingSetup setup = sGui->getIContextSimulator()->getInterpolationAndRenderingSetup();
@@ -205,7 +205,7 @@ namespace BlackGui
this->setGuiValues(); this->setGuiValues();
} }
void CSettingsSimulatorComponent::ps_onApplyMaxRenderedDistance() void CSettingsSimulatorComponent::onApplyMaxRenderedDistance()
{ {
// get initial aircraft to render // get initial aircraft to render
CInterpolationAndRenderingSetup setup = sGui->getIContextSimulator()->getInterpolationAndRenderingSetup(); CInterpolationAndRenderingSetup setup = sGui->getIContextSimulator()->getInterpolationAndRenderingSetup();
@@ -229,7 +229,7 @@ namespace BlackGui
} }
} }
void CSettingsSimulatorComponent::ps_onApplyDisableRendering() void CSettingsSimulatorComponent::onApplyDisableRendering()
{ {
CInterpolationAndRenderingSetup setup = sGui->getIContextSimulator()->getInterpolationAndRenderingSetup(); CInterpolationAndRenderingSetup setup = sGui->getIContextSimulator()->getInterpolationAndRenderingSetup();
setup.disableRendering(); setup.disableRendering();
@@ -237,7 +237,7 @@ namespace BlackGui
this->setGuiValues(); this->setGuiValues();
} }
void CSettingsSimulatorComponent::ps_onApplyTimeSync() void CSettingsSimulatorComponent::onApplyTimeSync()
{ {
const bool timeSync = ui->cb_TimeSync->isChecked(); const bool timeSync = ui->cb_TimeSync->isChecked();
const QString os = ui->le_TimeSyncOffset->text(); const QString os = ui->le_TimeSyncOffset->text();
@@ -256,7 +256,7 @@ namespace BlackGui
} }
} }
void CSettingsSimulatorComponent::ps_clearRestricedRendering() void CSettingsSimulatorComponent::clearRestricedRendering()
{ {
CInterpolationAndRenderingSetup setup; CInterpolationAndRenderingSetup setup;
setup.clearAllRenderingRestrictions(); setup.clearAllRenderingRestrictions();
@@ -264,7 +264,7 @@ namespace BlackGui
this->setGuiValues(); 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 // I intentionally do not set the selected plugin combobox here
// as this would cause undesired roundtrips // as this would cause undesired roundtrips
@@ -283,7 +283,7 @@ namespace BlackGui
this->setGuiValues(); this->setGuiValues();
} }
void CSettingsSimulatorComponent::ps_showPluginDetails(const QString &identifier) void CSettingsSimulatorComponent::showPluginDetails(const QString &identifier)
{ {
const CSimulatorPluginInfoList simDrivers(getAvailablePlugins()); const CSimulatorPluginInfoList simDrivers(getAvailablePlugins());
const CSimulatorPluginInfo selected = simDrivers.findByIdentifier(identifier); const CSimulatorPluginInfo selected = simDrivers.findByIdentifier(identifier);
@@ -303,7 +303,7 @@ namespace BlackGui
w->show(); w->show();
} }
void CSettingsSimulatorComponent::ps_showPluginConfig(const QString &identifier) void CSettingsSimulatorComponent::showPluginConfig(const QString &identifier)
{ {
const CSimulatorPluginInfoList simDrivers(getAvailablePlugins()); const CSimulatorPluginInfoList simDrivers(getAvailablePlugins());
const CSimulatorPluginInfo selected = simDrivers.findByIdentifier(identifier); const CSimulatorPluginInfo selected = simDrivers.findByIdentifier(identifier);
@@ -321,7 +321,7 @@ namespace BlackGui
window->show(); window->show();
} }
void CSettingsSimulatorComponent::ps_reloadPluginConfig() void CSettingsSimulatorComponent::reloadPluginConfig()
{ {
// list all available simulators // list all available simulators
const auto enabledSimulators = m_enabledSimulators.getThreadLocal(); const auto enabledSimulators = m_enabledSimulators.getThreadLocal();

View File

@@ -43,38 +43,37 @@ namespace BlackGui
//! Destructor //! Destructor
virtual ~CSettingsSimulatorComponent(); virtual ~CSettingsSimulatorComponent();
private slots: private:
//! Driver plugin enabled/disabled //! Driver plugin enabled/disabled
void ps_pluginStateChanged(const QString &identifier, bool enabled); void pluginStateChanged(const QString &identifier, bool enabled);
//! Apply max.aircraft //! Apply max.aircraft
void ps_onApplyMaxRenderedAircraft(); void onApplyMaxRenderedAircraft();
//! Apply max.distance //! Apply max.distance
void ps_onApplyMaxRenderedDistance(); void onApplyMaxRenderedDistance();
//! Apply disable rendering //! Apply disable rendering
void ps_onApplyDisableRendering(); void onApplyDisableRendering();
//! Apply time sync //! Apply time sync
void ps_onApplyTimeSync(); void onApplyTimeSync();
//! Clear restricted rendering //! Clear restricted rendering
void ps_clearRestricedRendering(); void clearRestricedRendering();
//! Simulator plugin changed //! Simulator plugin changed
void ps_simulatorPluginChanged(const BlackMisc::Simulation::CSimulatorPluginInfo &info); void simulatorPluginChanged(const BlackMisc::Simulation::CSimulatorPluginInfo &info);
//! Open plugin details window //! Open plugin details window
void ps_showPluginDetails(const QString &identifier); void showPluginDetails(const QString &identifier);
//! Show plugin config //! Show plugin config
void ps_showPluginConfig(const QString &identifier); void showPluginConfig(const QString &identifier);
//! Select/deselect enabled/disabled plugins //! Select/deselect enabled/disabled plugins
void ps_reloadPluginConfig(); void reloadPluginConfig();
private:
//! Set the GUI values //! Set the GUI values
void setGuiValues(); void setGuiValues();
@@ -84,7 +83,7 @@ namespace BlackGui
QScopedPointer<Ui::CSettingsSimulatorComponent> ui; //!< UI QScopedPointer<Ui::CSettingsSimulatorComponent> ui; //!< UI
bool m_pluginLoaded = false; //!< plugin loaded? bool m_pluginLoaded = false; //!< plugin loaded?
BlackCore::CPluginManagerSimulator* m_plugins = nullptr; 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 } // namespace

View File

@@ -39,10 +39,10 @@ namespace BlackMisc
*/ */
class BLACKMISC_EXPORT IAircraftModelLoader : class BLACKMISC_EXPORT IAircraftModelLoader :
public QObject, public QObject,
public BlackMisc::Simulation::IModelsSetable, public IModelsSetable,
public BlackMisc::Simulation::IModelsUpdatable, public IModelsUpdatable,
public BlackMisc::Simulation::IModelsPerSimulatorSetable, public IModelsPerSimulatorSetable,
public BlackMisc::Simulation::IModelsPerSimulatorUpdatable public IModelsPerSimulatorUpdatable
{ {
Q_OBJECT Q_OBJECT
Q_INTERFACES(BlackMisc::Simulation::IModelsSetable) Q_INTERFACES(BlackMisc::Simulation::IModelsSetable)

View File

@@ -35,7 +35,7 @@ namespace BlackMisc
namespace FsCommon namespace FsCommon
{ {
//! Utility, parsing the aircraft.cfg files //! Utility, parsing the aircraft.cfg files
class BLACKMISC_EXPORT CAircraftCfgParser : public BlackMisc::Simulation::IAircraftModelLoader class BLACKMISC_EXPORT CAircraftCfgParser : public IAircraftModelLoader
{ {
Q_OBJECT Q_OBJECT

View File

@@ -93,25 +93,25 @@ namespace BlackMisc
{ {
if (model.getDistributor().hasDescription() && !model.getName().contains(model.getDistributor().getDescription())) if (model.getDistributor().hasDescription() && !model.getName().contains(model.getDistributor().getDescription()))
{ {
return "[ACF] " % model.getName() % " by " % model.getDistributor().getDescription(); return QStringLiteral("[ACF] ") % model.getName() % QStringLiteral(" by ") % model.getDistributor().getDescription();
} }
else else
{ {
return "[ACF] " % model.getName(); return QStringLiteral("[ACF] ") % model.getName();
} }
} }
else if (model.hasAircraftDesignator()) else if (model.hasAircraftDesignator())
{ {
if (model.getDistributor().hasDescription()) if (model.getDistributor().hasDescription())
{ {
return "[ACF] " % model.getAircraftIcaoCodeDesignator() % " by " % model.getDistributor().getDescription(); return QStringLiteral("[ACF] ") % model.getAircraftIcaoCodeDesignator() % QStringLiteral(" by ") % model.getDistributor().getDescription();
} }
else else
{ {
return "[ACF] " % model.getAircraftIcaoCodeDesignator(); return QStringLiteral("[ACF] ") % model.getAircraftIcaoCodeDesignator();
} }
} }
return "[ACF]"; return QStringLiteral("[ACF]");
} }
CAircraftModelLoaderXPlane::CAircraftModelLoaderXPlane() : IAircraftModelLoader(CSimulatorInfo::XPLANE) CAircraftModelLoaderXPlane::CAircraftModelLoaderXPlane() : IAircraftModelLoader(CSimulatorInfo::XPLANE)

View File

@@ -35,7 +35,7 @@ namespace BlackMisc
/*! /*!
* XPlane aircraft model loader * XPlane aircraft model loader
*/ */
class BLACKMISC_EXPORT CAircraftModelLoaderXPlane : public BlackMisc::Simulation::IAircraftModelLoader class BLACKMISC_EXPORT CAircraftModelLoaderXPlane : public IAircraftModelLoader
{ {
Q_OBJECT Q_OBJECT
@@ -74,10 +74,10 @@ namespace BlackMisc
QString objectName; //!< Complete basename of the object file QString objectName; //!< Complete basename of the object file
QString textureName; //!< Complete basename of the texture file. Can be empty. QString textureName; //!< Complete basename of the texture file. Can be empty.
QString filePath; //!< object filePath QString filePath; //!< object filePath
QString icao; //!< Icao type of this model QString icao; //!< Icao type of this model
QString airline; //!< Airline identifier. Can be empty. QString airline; //!< Airline identifier. Can be empty.
QString livery; //!< Livery identifier. Can be empty. QString livery; //!< Livery identifier. Can be empty.
}; };
struct CSLPackage struct CSLPackage