mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-24 09:54:16 +08:00
committed by
Mathew Sutcliffe
parent
53abc6aaa3
commit
0eaab1753d
@@ -555,6 +555,20 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CContextSimulator::changeEnabledSimulators()
|
||||||
|
{
|
||||||
|
CSimulatorPluginInfo currentPluginInfo = m_simulatorPlugin.first;
|
||||||
|
const QStringList enabledSimulators = m_enabledSimulators.getThreadLocal();
|
||||||
|
|
||||||
|
// Unload the current plugin, if it is no longer enabled
|
||||||
|
if (!currentPluginInfo.isUnspecified() && !enabledSimulators.contains(currentPluginInfo.getIdentifier()))
|
||||||
|
{
|
||||||
|
unloadSimulatorPlugin();
|
||||||
|
emit simulatorStatusChanged(ISimulator::Disconnected);
|
||||||
|
}
|
||||||
|
restoreSimulatorPlugins();
|
||||||
|
}
|
||||||
|
|
||||||
void CContextSimulator::restoreSimulatorPlugins()
|
void CContextSimulator::restoreSimulatorPlugins()
|
||||||
{
|
{
|
||||||
stopSimulatorListeners();
|
stopSimulatorListeners();
|
||||||
|
|||||||
@@ -172,6 +172,9 @@ namespace BlackCore
|
|||||||
void ps_relayStatusMessageToSimulator(const BlackMisc::CStatusMessage &message);
|
void ps_relayStatusMessageToSimulator(const BlackMisc::CStatusMessage &message);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
//! Handle a change in enabled simulators
|
||||||
|
void changeEnabledSimulators();
|
||||||
|
|
||||||
//! Reads list of enabled simulators, starts listeners
|
//! Reads list of enabled simulators, starts listeners
|
||||||
void restoreSimulatorPlugins();
|
void restoreSimulatorPlugins();
|
||||||
|
|
||||||
@@ -204,7 +207,7 @@ namespace BlackCore
|
|||||||
BlackMisc::Simulation::CAircraftModelSetLoader m_modelSetLoader { this }; //!< load model set from caches
|
BlackMisc::Simulation::CAircraftModelSetLoader m_modelSetLoader { this }; //!< load model set from caches
|
||||||
QMap<BlackMisc::Aviation::CCallsign, BlackMisc::CStatusMessageList> m_matchingMessages;
|
QMap<BlackMisc::Aviation::CCallsign, BlackMisc::CStatusMessageList> m_matchingMessages;
|
||||||
BlackMisc::CSettingReadOnly<BlackMisc::Simulation::TSimulatorMessages> m_messageSettings { this }; //!< settings for messages
|
BlackMisc::CSettingReadOnly<BlackMisc::Simulation::TSimulatorMessages> m_messageSettings { this }; //!< settings for messages
|
||||||
BlackMisc::CSettingReadOnly<BlackCore::Application::TEnabledSimulators> m_enabledSimulators { this, &CContextSimulator::restoreSimulatorPlugins };
|
BlackMisc::CSettingReadOnly<BlackCore::Application::TEnabledSimulators> m_enabledSimulators { this, &CContextSimulator::changeEnabledSimulators };
|
||||||
QString m_networkSessionId; //! Network session, if not connected empty
|
QString m_networkSessionId; //! Network session, if not connected empty
|
||||||
bool m_initallyAddAircrafts = false;
|
bool m_initallyAddAircrafts = false;
|
||||||
bool m_enableMatchingMessages = true;
|
bool m_enableMatchingMessages = true;
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ namespace BlackGui
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
//! Driver plugin enabled/disabled
|
//! Driver plugin enabled/disabled
|
||||||
//! \todo Unload plugin if user disables it while running
|
|
||||||
void ps_pluginStateChanged(const QString &identifier, bool enabled);
|
void ps_pluginStateChanged(const QString &identifier, bool enabled);
|
||||||
|
|
||||||
//! Apply max.aircraft
|
//! Apply max.aircraft
|
||||||
|
|||||||
Reference in New Issue
Block a user