mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-05 16:51:12 -07:00
CURA-5035 Don't show required plugins
Also renamed folder of UserAgreementPlugin to UserAgreement
This commit is contained in:
parent
2751299fd3
commit
679f87ebb3
8 changed files with 34 additions and 28 deletions
|
|
@ -10,6 +10,7 @@ import tempfile
|
|||
|
||||
from PyQt5.QtCore import pyqtSlot, QObject, pyqtSignal
|
||||
|
||||
from UM.Application import Application
|
||||
from UM.Logger import Logger
|
||||
from UM.Resources import Resources
|
||||
from UM.Version import Version
|
||||
|
|
@ -102,15 +103,20 @@ class CuraPackageManager(QObject):
|
|||
|
||||
return None
|
||||
|
||||
def getAllInstalledPackagesInfo(self) -> dict:
|
||||
def getAllInstalledPackagesInfo(self, includeRequired: bool = False) -> dict:
|
||||
installed_package_id_set = set(self._installed_package_dict.keys()) | set(self._to_install_package_dict.keys())
|
||||
installed_package_id_set = installed_package_id_set.difference(self._to_remove_package_set)
|
||||
|
||||
managed_package_id_set = set(installed_package_id_set) | self._to_remove_package_set
|
||||
|
||||
# TODO: For absolutely no reason, this function seems to run in a loop
|
||||
# even though no loop is ever called with it.
|
||||
|
||||
# map of <package_type> -> <package_id> -> <package_info>
|
||||
installed_packages_dict = {}
|
||||
for package_id in installed_package_id_set:
|
||||
if package_id in Application.getInstance().getRequiredPlugins():
|
||||
continue
|
||||
if package_id in self._to_install_package_dict:
|
||||
package_info = self._to_install_package_dict[package_id]["package_info"]
|
||||
else:
|
||||
|
|
@ -133,6 +139,8 @@ class CuraPackageManager(QObject):
|
|||
package_id = plugin_package_info["package_id"]
|
||||
if package_id in managed_package_id_set:
|
||||
continue
|
||||
if package_id in Application.getInstance().getRequiredPlugins():
|
||||
continue
|
||||
|
||||
plugin_package_info["is_bundled"] = True if plugin_package_info["author"]["name"] == "Ultimaker B.V." else False
|
||||
plugin_package_info["is_active"] = self._plugin_registry.isActivePlugin(package_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue