Commit a8dfcdeb authored by Thomas Eschenbacher's avatar Thomas Eschenbacher

show error message if no plugins were found and terminate

parent 610c967b
* enabled support for high dpi displays (icon scaling)
* show error message if no plugins were found and terminate
18.03 [2017-11-13]
......
......@@ -216,7 +216,16 @@ bool Kwave::FileContext::init(Kwave::TopWidget *top_widget)
// now we are initialized, load all plugins
Kwave::Splash::showMessage(i18n("Loading plugins..."));
statusBarMessage(i18n("Loading plugins..."), 0);
m_plugin_manager->loadAllPlugins();
if (!m_plugin_manager->loadAllPlugins()) {
statusBarMessage(i18n("Failed"), 1000);
QApplication::restoreOverrideCursor();
Kwave::MessageBox::error(top_widget,
i18n("Kwave has not been properly installed. "\
"No plugins found!")
);
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
return false;
}
statusBarMessage(i18n("Ready"), 1000);
return true;
......
......@@ -120,7 +120,7 @@ Kwave::PluginManager::~PluginManager()
}
//***************************************************************************
void Kwave::PluginManager::loadAllPlugins()
bool Kwave::PluginManager::loadAllPlugins()
{
// Try to load all plugins. This has to be called only once per
// instance of the main window!
......@@ -150,6 +150,8 @@ void Kwave::PluginManager::loadAllPlugins()
m_plugin_modules.remove(name);
}
}
return !m_plugin_modules.isEmpty();
}
//***************************************************************************
......
......@@ -80,8 +80,9 @@ namespace Kwave
* plugins will be unloaded afterwards. This also filters out
* all plugins that do not correctly load.
* @internal used once by each toplevel window at startup
* @return true if at least one plugin was loaded, false if none
*/
void loadAllPlugins();
bool loadAllPlugins();
/**
* Stops all currently running plugins
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment