mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Ref T131, allow to obtain settings from UI component
Useful if we want to avoid to duplicate the settings, but access existing ones
This commit is contained in:
@@ -31,6 +31,8 @@ using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Audio;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Input;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackMisc::Simulation::Settings;
|
||||
using namespace BlackCore;
|
||||
using namespace BlackGui;
|
||||
using namespace BlackConfig;
|
||||
@@ -126,6 +128,11 @@ namespace BlackGui
|
||||
return ui->comp_AudioSetup->playNotificationSounds();
|
||||
}
|
||||
|
||||
CSpecializedSimulatorSettings CSettingsComponent::getSimulatorSettings(const CSimulatorInfo &simulator) const
|
||||
{
|
||||
return ui->comp_SettingsSimulatorBasics->getSimulatorSettings(simulator);
|
||||
}
|
||||
|
||||
void CSettingsComponent::setSettingsTab(CSettingsComponent::SettingTab tab)
|
||||
{
|
||||
this->setCurrentIndex(static_cast<int>(tab));
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#define BLACKGUI_COMPONENTS_SETTINGSCOMPONENT_H
|
||||
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackmisc/simulation/settings/simulatorsettings.h"
|
||||
#include <QColor>
|
||||
#include <QObject>
|
||||
#include <QScopedPointer>
|
||||
@@ -57,6 +58,9 @@ namespace BlackGui
|
||||
//! \copydoc CAudioSetupComponent::playNotificationSounds
|
||||
bool playNotificationSounds() const;
|
||||
|
||||
//! Settings for given simulator
|
||||
BlackMisc::Simulation::Settings::CSpecializedSimulatorSettings getSimulatorSettings(const BlackMisc::Simulation::CSimulatorInfo &simulator) const;
|
||||
|
||||
signals:
|
||||
//! Change the windows opacity 0..100
|
||||
void changedWindowsOpacity(int opacity);
|
||||
|
||||
@@ -52,6 +52,9 @@ namespace BlackGui
|
||||
//! Save data
|
||||
void save();
|
||||
|
||||
//! Settings for given simulator
|
||||
BlackMisc::Simulation::Settings::CSpecializedSimulatorSettings getSimulatorSettings(const BlackMisc::Simulation::CSimulatorInfo &simulator) const { return m_settings.getSpecializedSettings(simulator); }
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CSettingsSimulatorBasicsComponent> ui;
|
||||
BlackMisc::Simulation::Settings::CMultiSimulatorSettings m_settings { this };
|
||||
|
||||
Reference in New Issue
Block a user