mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 11:05:44 +08:00
refs #237, load first plugin if settings do not match, provide a warning if no plugin is loaded
This commit is contained in:
@@ -448,7 +448,11 @@ namespace BlackCore
|
|||||||
if (this->m_contextSettings)
|
if (this->m_contextSettings)
|
||||||
{
|
{
|
||||||
connect(this->m_contextSettings, &IContextSettings::changedSettings, this->m_contextSimulator, &IContextSimulator::settingsChanged);
|
connect(this->m_contextSettings, &IContextSettings::changedSettings, this->m_contextSimulator, &IContextSimulator::settingsChanged);
|
||||||
this->m_contextSimulator->loadSimulatorPluginFromSettings();
|
if (!this->m_contextSimulator->loadSimulatorPluginFromSettings())
|
||||||
|
{
|
||||||
|
qWarning() << "No simulator plugin loaded";
|
||||||
|
this->sendStatusMessage(CStatusMessage::getWarningMessage("No simulator plugin loaded", CStatusMessage::TypeSimulator));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -150,17 +150,21 @@ namespace BlackCore
|
|||||||
Q_ASSERT(this->getIContextSettings());
|
Q_ASSERT(this->getIContextSettings());
|
||||||
if (!this->getIContextSettings()) return false;
|
if (!this->getIContextSettings()) return false;
|
||||||
|
|
||||||
CSimulatorInfoList plugin = this->getAvailableSimulatorPlugins();
|
CSimulatorInfoList plugins = this->getAvailableSimulatorPlugins();
|
||||||
if (plugin.size() == 1)
|
if (plugins.size() == 1)
|
||||||
{
|
{
|
||||||
// load, independent from settings, we have only driver
|
// load, independent from settings, we have only driver
|
||||||
return this->loadSimulatorPlugin(plugin.front());
|
return this->loadSimulatorPlugin(plugins.front());
|
||||||
}
|
}
|
||||||
else if (plugin.size() > 1)
|
else if (plugins.size() > 1)
|
||||||
{
|
{
|
||||||
return this->loadSimulatorPlugin(
|
if (this->loadSimulatorPlugin(
|
||||||
this->getIContextSettings()->getSimulatorSettings().getSelectedPlugin()
|
this->getIContextSettings()->getSimulatorSettings().getSelectedPlugin()
|
||||||
);
|
)) return true;
|
||||||
|
|
||||||
|
// we have plugins, but none got loaded
|
||||||
|
// just load first one
|
||||||
|
return this->loadSimulatorPlugin(plugins.front());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user