diff --git a/UM/PluginRegistry.py b/UM/PluginRegistry.py index acef0dbe2..b768c8267 100644 --- a/UM/PluginRegistry.py +++ b/UM/PluginRegistry.py @@ -206,11 +206,23 @@ def addPluginLocation(self, location: str) -> None: # Check if all required plugins are loaded: def checkRequiredPlugins(self, required_plugins: List[str]) -> bool: - plugins = self._findInstalledPlugins() - for plugin_id in required_plugins: - if plugin_id not in plugins: - Logger.log("e", "Plugin %s is required, but not added or loaded", plugin_id) - return False + disabled_plugins_that_should_be_enabled = list(set(required_plugins).intersection(set(self._disabled_plugins))) + for disabled_plugin in disabled_plugins_that_should_be_enabled: + # Yeah, this does mean that this run the plugin won't be there. But this can only happen with a corrupted + # list that was caused by bugs / manual fuckery. Enabling it here will ensure that the data is correct + # in the next run + Logger.info(f"The plugin {disabled_plugin} is required but it was disabled. Automatically re-enabling it") + self.enablePlugin(disabled_plugin) + + installed_plugins = self._findInstalledPlugins() + required_but_not_installed_plugins = list(set(required_plugins).difference(installed_plugins)) + + if required_but_not_installed_plugins: + Logger.error(f"A number of plugins that are required are not added or loaded: {required_but_not_installed_plugins}") + message_text = i18n_catalog.i18nc("@error:Required plugins not found", + "A number of plugins are required, but could not be loaded: {plugins}").format(plugins = "\n- ".join(required_but_not_installed_plugins)) + Message(text=message_text, message_type=Message.MessageType.ERROR).show() + return False return True pluginsEnabledOrDisabledChanged = pyqtSignal()