mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 02:35:33 +08:00
refs #829, consolidated settings for simulator/messages
* move traits from blackcore to blackmisc * renamed CSimulatorSettings/Messages
This commit is contained in:
@@ -12,21 +12,20 @@
|
||||
#ifndef BLACKGUI_COMPONENTS_DBMAPPINGCOMPONENT_H
|
||||
#define BLACKGUI_COMPONENTS_DBMAPPINGCOMPONENT_H
|
||||
|
||||
#include "blackcore/data/authenticateduser.h"
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackgui/components/enablefordockwidgetinfoarea.h"
|
||||
#include "blackgui/enableforviewbasedindicator.h"
|
||||
#include "blackgui/menus/menudelegate.h"
|
||||
#include "blackgui/overlaymessagesframe.h"
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackcore/data/authenticateduser.h"
|
||||
#include "blackmisc/aviation/airlineicaocode.h"
|
||||
#include "blackmisc/datacache.h"
|
||||
#include "blackmisc/digestsignal.h"
|
||||
#include "blackmisc/network/entityflags.h"
|
||||
#include "blackmisc/simulation/aircraftmodel.h"
|
||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||
#include "blackmisc/simulation/distributor.h"
|
||||
#include "blackmisc/simulation/fscommon/vpilotrulesreader.h"
|
||||
#include "blackmisc/simulation/simulatorinfo.h"
|
||||
#include "blackmisc/datacache.h"
|
||||
#include "blackmisc/digestsignal.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackmisc/statusmessagelist.h"
|
||||
|
||||
@@ -307,8 +306,8 @@ namespace BlackGui
|
||||
QScopedPointer<CDbAutoSimulatorStashingComponent> m_autoSimulatorDialog; //!< dialog auto simulator update
|
||||
QScopedPointer<CDbModelMappingModifyComponent> m_modelModifyDialog; //!< dialog when modifying models
|
||||
BlackMisc::Simulation::FsCommon::CVPilotRulesReader m_vPilotReader; //!< read vPilot rules
|
||||
BlackMisc::CData<BlackCore::Data::TAuthenticatedDbUser> m_swiftDbUser { this };
|
||||
BlackMisc::CDigestSignal m_dsStashedModelsChanged { this, &CDbMappingComponent::ps_digestStashedModelsChanged, &CDbMappingComponent::ps_onStashedModelsChangedDigest, 750, 25 };
|
||||
BlackMisc::CData<BlackCore::Data::TAuthenticatedDbUser> m_swiftDbUser { this };
|
||||
const bool vPilotSupport = true; //!< vPilot support
|
||||
bool m_vPilot1stInit = true; //!< vPilot extensions initaliazed?
|
||||
bool m_vPilotEnabled = false; //!< use vPilot extensions
|
||||
|
||||
@@ -12,10 +12,9 @@
|
||||
#ifndef BLACKGUI_COMPONENTS_DBOWNMODELSETCOMPONENT_H
|
||||
#define BLACKGUI_COMPONENTS_DBOWNMODELSETCOMPONENT_H
|
||||
|
||||
#include "blackcore/simulator/simulatorsettings.h"
|
||||
#include "blackgui/components/dbmappingcomponentaware.h"
|
||||
#include "blackgui/menus/menudelegate.h"
|
||||
#include "blackmisc/settingscache.h"
|
||||
#include "blackmisc/simulation/modelsettings.h"
|
||||
#include "blackmisc/simulation/aircraftmodelinterfaces.h"
|
||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||
#include "blackmisc/simulation/aircraftmodelsetloader.h"
|
||||
@@ -145,7 +144,7 @@ namespace BlackGui
|
||||
QScopedPointer<Ui::CDbOwnModelSetComponent> ui;
|
||||
QScopedPointer<CDbOwnModelSetDialog> m_modelSetDialog;
|
||||
BlackMisc::Simulation::CAircraftModelSetLoader m_modelSetLoader { this };
|
||||
BlackMisc::CSetting<BlackCore::Simulator::TDistributorListPreferences> m_distributorPreferences { this, &CDbOwnModelSetComponent::ps_distributorPreferencesChanged };
|
||||
BlackMisc::CSetting<BlackMisc::Simulation::TDistributorListPreferences> m_distributorPreferences { this, &CDbOwnModelSetComponent::ps_distributorPreferencesChanged };
|
||||
|
||||
// -------------------------- custom menus -----------------------------------
|
||||
|
||||
|
||||
@@ -12,10 +12,9 @@
|
||||
#ifndef BLACKGUI_COMPONENTS_DISTRIBUTORPREFERENCESCOMPONENT_H
|
||||
#define BLACKGUI_COMPONENTS_DISTRIBUTORPREFERENCESCOMPONENT_H
|
||||
|
||||
#include "blackcore/simulator/simulatorsettings.h"
|
||||
#include "blackmisc/settingscache.h"
|
||||
#include "blackmisc/simulation/aircraftmodelsetloader.h"
|
||||
#include "blackmisc/simulation/distributorlist.h"
|
||||
#include "blackmisc/simulation/modelsettings.h"
|
||||
#include "blackmisc/simulation/simulatorinfo.h"
|
||||
|
||||
#include <QFrame>
|
||||
@@ -25,7 +24,6 @@
|
||||
class QWidget;
|
||||
|
||||
namespace Ui { class CDistributorPreferencesComponent; }
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
class COverlayMessagesFrame;
|
||||
@@ -72,7 +70,7 @@ namespace BlackGui
|
||||
QScopedPointer<Ui::CDistributorPreferencesComponent> ui;
|
||||
BlackGui::COverlayMessagesFrame *m_overlayMessageFrame = nullptr;
|
||||
BlackMisc::Simulation::CAircraftModelSetLoader m_modelSetLoader { this };
|
||||
BlackMisc::CSetting<BlackCore::Simulator::TDistributorListPreferences> m_distributorPreferences { this, &CDistributorPreferencesComponent::ps_preferencesChanged };
|
||||
BlackMisc::CSetting<BlackMisc::Simulation::TDistributorListPreferences> m_distributorPreferences { this, &CDistributorPreferencesComponent::ps_preferencesChanged };
|
||||
|
||||
//! Update
|
||||
void updateContainerMaybeAsync(const BlackMisc::Simulation::CDistributorList &models, bool sortByOrder = true);
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace BlackGui
|
||||
explicit CSettingsGuiComponent(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
~CSettingsGuiComponent();
|
||||
virtual ~CSettingsGuiComponent();
|
||||
|
||||
//! Hide opacity elements
|
||||
void hideOpacity(bool hide);
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace BlackGui
|
||||
void CSettingsSimulatorBasicsComponent::ps_save()
|
||||
{
|
||||
const CSimulatorInfo simulator(ui->comp_SimulatorSelector->getValue());
|
||||
CSettings s = this->getSettings(simulator);
|
||||
CSimulatorSettings s = this->getSettings(simulator);
|
||||
const QString sd(ui->le_SimulatorDirectory->text().trimmed());
|
||||
const QStringList md(this->parseDirectories(ui->pte_ModelDirectories->toPlainText()));
|
||||
const QStringList ed(this->parseDirectories(ui->pte_ExcludeDirectories->toPlainText()));
|
||||
@@ -193,15 +193,15 @@ namespace BlackGui
|
||||
ui->pte_ModelDirectories->setPlainText(d);
|
||||
}
|
||||
|
||||
CSettings CSettingsSimulatorBasicsComponent::getSettings(const CSimulatorInfo &simulator) const
|
||||
CSimulatorSettings CSettingsSimulatorBasicsComponent::getSettings(const CSimulatorInfo &simulator) const
|
||||
{
|
||||
const CSettings s = this->m_settings.getSettings(simulator);
|
||||
const CSimulatorSettings s = this->m_settings.getSettings(simulator);
|
||||
return s;
|
||||
}
|
||||
|
||||
void CSettingsSimulatorBasicsComponent::displaySettings(const CSimulatorInfo &simulator)
|
||||
{
|
||||
const CSettings s = this->getSettings(simulator);
|
||||
const CSimulatorSettings s = this->getSettings(simulator);
|
||||
this->displayExcludeDirectoryPatterns(s.getModelExcludeDirectoryPatterns());
|
||||
this->displayModelDirectories(s.getModelDirectories());
|
||||
ui->le_SimulatorDirectory->setText(s.getSimulatorDirectory());
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#ifndef BLACKGUI_COMPONENTS_SETTINGSSIMULATORBASICSCOMPONENT_H
|
||||
#define BLACKGUI_COMPONENTS_SETTINGSSIMULATORBASICSCOMPONENT_H
|
||||
|
||||
#include "blackmisc/simulation/simulationsettings.h"
|
||||
#include "blackmisc/simulation/simulatorsettings.h"
|
||||
#include <QFrame>
|
||||
#include <QFileDialog>
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace BlackGui
|
||||
void displayModelDirectories(const QStringList &dirs);
|
||||
|
||||
//! Current settings
|
||||
BlackMisc::Simulation::CSettings getSettings(const BlackMisc::Simulation::CSimulatorInfo &simulator) const;
|
||||
BlackMisc::Simulation::CSimulatorSettings getSettings(const BlackMisc::Simulation::CSimulatorInfo &simulator) const;
|
||||
|
||||
//! Display simulator`s settings
|
||||
void displaySettings(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "settingssimulatormessagescomponent.h"
|
||||
#include "ui_settingssimulatormessagescomponent.h"
|
||||
#include "blackmisc/simulation/simulationsettings.h"
|
||||
#include "blackmisc/simulation/simulatorsettings.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Simulation;
|
||||
@@ -34,7 +34,7 @@ namespace BlackGui
|
||||
|
||||
void CSettingsSimulatorMessagesComponent::ps_save()
|
||||
{
|
||||
CSettingsSimulatorMessages settings;
|
||||
CSimulatorMessagesSettings settings;
|
||||
settings.setGloballyEnabled(ui->cb_Messages->isChecked());
|
||||
if (ui->rb_NoTechnicalMessages->isChecked())
|
||||
{
|
||||
@@ -53,11 +53,11 @@ namespace BlackGui
|
||||
settings.setTechnicalLogSeverity(CStatusMessage::SeverityInfo);
|
||||
}
|
||||
|
||||
CSettingsSimulatorMessages::TextMessageType mt = CSettingsSimulatorMessages::NoTextMessages;
|
||||
if (ui->cb_PrivateMessages->isChecked()) { mt |= CSettingsSimulatorMessages::TextMessagePrivate; }
|
||||
if (ui->cb_SupervisorMessages->isChecked()) { mt |= CSettingsSimulatorMessages::TextMessageSupervisor; }
|
||||
if (ui->cb_Com1->isChecked()) { mt |= CSettingsSimulatorMessages::TextMessagesCom1; }
|
||||
if (ui->cb_Com2->isChecked()) { mt |= CSettingsSimulatorMessages::TextMessagesCom2; };
|
||||
CSimulatorMessagesSettings::TextMessageType mt = CSimulatorMessagesSettings::NoTextMessages;
|
||||
if (ui->cb_PrivateMessages->isChecked()) { mt |= CSimulatorMessagesSettings::TextMessagePrivate; }
|
||||
if (ui->cb_SupervisorMessages->isChecked()) { mt |= CSimulatorMessagesSettings::TextMessageSupervisor; }
|
||||
if (ui->cb_Com1->isChecked()) { mt |= CSimulatorMessagesSettings::TextMessagesCom1; }
|
||||
if (ui->cb_Com2->isChecked()) { mt |= CSimulatorMessagesSettings::TextMessagesCom2; };
|
||||
settings.setRelayedTextMessages(mt);
|
||||
|
||||
// save
|
||||
@@ -66,7 +66,7 @@ namespace BlackGui
|
||||
|
||||
void CSettingsSimulatorMessagesComponent::ps_load()
|
||||
{
|
||||
const CSettingsSimulatorMessages settings(this->m_settings.get());
|
||||
const CSimulatorMessagesSettings settings(this->m_settings.get());
|
||||
ui->cb_Messages->setChecked(settings.isGloballyEnabled());
|
||||
if (settings.isRelayedInfoMessages())
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#ifndef BLACKGUI_COMPONENTS_SETTINGSSIMULATORMESSAGESCOMPONENT_H
|
||||
#define BLACKGUI_COMPONENTS_SETTINGSSIMULATORMESSAGESCOMPONENT_H
|
||||
|
||||
#include "blackmisc/simulation/simulationsettings.h"
|
||||
#include "blackmisc/simulation/simulatorsettings.h"
|
||||
#include <QFrame>
|
||||
#include <QScopedPointer>
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackgui/components/enablefordockwidgetinfoarea.h"
|
||||
#include "blackcore/simulator/simulatorsettings.h"
|
||||
#include "blackmisc/geo/coordinategeodetic.h"
|
||||
#include "blackmisc/identifiable.h"
|
||||
#include "blackmisc/simulation/simulatorsettings.h"
|
||||
#include "blackmisc/weather/weatherscenario.h"
|
||||
#include "blackmisc/identifiable.h"
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QModelIndex>
|
||||
@@ -34,7 +34,6 @@ namespace Ui { class CWeatherComponent; }
|
||||
namespace BlackGui
|
||||
{
|
||||
class CDockWidgetInfoArea;
|
||||
|
||||
namespace Components
|
||||
{
|
||||
//! Weather component
|
||||
@@ -76,7 +75,7 @@ namespace BlackGui
|
||||
QVector<BlackMisc::Weather::CWeatherScenario> m_weatherScenarios;
|
||||
QTimer m_weatherUpdateTimer { this };
|
||||
BlackMisc::Geo::CCoordinateGeodetic m_lastOwnAircraftPosition;
|
||||
BlackMisc::CSetting<BlackCore::Simulator::TSelectedWeatherScenario> m_weatherScenarioSetting { this };
|
||||
BlackMisc::CSetting<BlackMisc::Simulation::TSelectedWeatherScenario> m_weatherScenarioSetting { this };
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -13,9 +13,7 @@
|
||||
#define BLACKGUI_EDITORS_OWNMODELSETFORM_H
|
||||
|
||||
#include "form.h"
|
||||
#include "blackcore/simulator/simulatorsettings.h"
|
||||
#include "blackmisc/simulation/distributorlist.h"
|
||||
|
||||
#include "blackmisc/simulation/modelsettings.h"
|
||||
#include <QObject>
|
||||
#include <QScopedPointer>
|
||||
|
||||
@@ -111,7 +109,7 @@ namespace BlackGui
|
||||
|
||||
QScopedPointer<Ui::COwnModelSetForm> ui;
|
||||
BlackMisc::Simulation::CSimulatorInfo m_simulator;
|
||||
BlackMisc::CSetting<BlackCore::Simulator::TDistributorListPreferences> m_distributorPreferences { this, &COwnModelSetForm::ps_preferencesChanged };
|
||||
BlackMisc::CSetting<BlackMisc::Simulation::TDistributorListPreferences> m_distributorPreferences { this, &COwnModelSetForm::ps_preferencesChanged };
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user