refs #511 Handle config plugin load failure

If the config cannot be loaded properly, swift will not
crash. The proper error will be shown instead.
This commit is contained in:
Michał Garapich
2015-11-26 00:06:26 +01:00
parent ac573b8d92
commit 09244f235a

View File

@@ -11,6 +11,7 @@
#include "blackmisc/logmessage.h"
#include "blackmisc/variant.h"
#include <QComboBox>
#include <QMessageBox>
using namespace BlackMisc;
using namespace BlackMisc::PhysicalQuantities;
@@ -276,6 +277,11 @@ namespace BlackGui
QString configId = m_plugins->getPluginConfigId(selected->getIdentifier());
IPluginConfig *config = m_plugins->getPluginById<IPluginConfig>(configId);
if (!config)
{
return;
}
CPluginConfigWindow *window = config->createConfigWindow(qApp->activeWindow());
CEnableForRuntime::setRuntimeForComponents(getRuntime(), window);
window->setAttribute(Qt::WA_DeleteOnClose);