mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +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)
|
||||
{
|
||||
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());
|
||||
if (!this->getIContextSettings()) return false;
|
||||
|
||||
CSimulatorInfoList plugin = this->getAvailableSimulatorPlugins();
|
||||
if (plugin.size() == 1)
|
||||
CSimulatorInfoList plugins = this->getAvailableSimulatorPlugins();
|
||||
if (plugins.size() == 1)
|
||||
{
|
||||
// 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(
|
||||
this->getIContextSettings()->getSimulatorSettings().getSelectedPlugin()
|
||||
);
|
||||
if (this->loadSimulatorPlugin(
|
||||
this->getIContextSettings()->getSimulatorSettings().getSelectedPlugin()
|
||||
)) return true;
|
||||
|
||||
// we have plugins, but none got loaded
|
||||
// just load first one
|
||||
return this->loadSimulatorPlugin(plugins.front());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user