mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-03-04 14:46:09 -05:00
UI: Show warning on plugin load failure
Allows the user to know what plugins failed to load. This is particularly useful if we're going to block Qt5 plugins as well, or if certain plugins can't load because they're incompatible with a newer version.
This commit is contained in:
@@ -1778,15 +1778,18 @@ void OBSBasic::OBSInit()
|
||||
LoadLibraryW(L"Qt6Network");
|
||||
#endif
|
||||
#endif
|
||||
struct obs_module_failure_info mfi;
|
||||
|
||||
AddExtraModulePaths();
|
||||
blog(LOG_INFO, "---------------------------------");
|
||||
obs_load_all_modules();
|
||||
obs_load_all_modules2(&mfi);
|
||||
blog(LOG_INFO, "---------------------------------");
|
||||
obs_log_loaded_modules();
|
||||
blog(LOG_INFO, "---------------------------------");
|
||||
obs_post_load_modules();
|
||||
|
||||
BPtr<char *> failed_modules = mfi.failed_modules;
|
||||
|
||||
#ifdef BROWSER_AVAILABLE
|
||||
cef = obs_browser_init_panel();
|
||||
#endif
|
||||
@@ -2071,6 +2074,25 @@ void OBSBasic::OBSInit()
|
||||
OnFirstLoad();
|
||||
|
||||
activateWindow();
|
||||
|
||||
/* ------------------------------------------- */
|
||||
/* display warning message for failed modules */
|
||||
|
||||
if (mfi.count) {
|
||||
QString failed_plugins;
|
||||
|
||||
char **plugin = mfi.failed_modules;
|
||||
while (*plugin) {
|
||||
failed_plugins += *plugin;
|
||||
failed_plugins += "\n";
|
||||
plugin++;
|
||||
}
|
||||
|
||||
QString failed_msg =
|
||||
QTStr("PluginsFailedToLoad.Text").arg(failed_plugins);
|
||||
OBSMessageBox::warning(this, QTStr("PluginsFailedToLoad.Title"),
|
||||
failed_msg);
|
||||
}
|
||||
}
|
||||
|
||||
void OBSBasic::OnFirstLoad()
|
||||
|
||||
Reference in New Issue
Block a user