mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Introduced a Manager to centralize plugin/package management
Should have done this from the start. Will move other relevant scattered functions to this type. For now it checks if the restart banner needs to show. Taking into account that a user can toggle between enable and disable without an actual restart. Even with multiple plugins. Contributes to: CURA-8587
This commit is contained in:
parent
a61c3e9eff
commit
6c976bc9b0
4 changed files with 38 additions and 4 deletions
|
|
@ -13,6 +13,7 @@ from UM.PluginRegistry import PluginRegistry # To find out where we are stored
|
|||
|
||||
from .RemotePackageList import RemotePackageList # To register this type with QML.
|
||||
from .LocalPackageList import LocalPackageList # To register this type with QML.
|
||||
from .Manager import Manager # To register this type with QML.
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from PyQt5.QtCore import QObject
|
||||
|
|
@ -30,6 +31,7 @@ class Marketplace(Extension):
|
|||
|
||||
qmlRegisterType(RemotePackageList, "Marketplace", 1, 0, "RemotePackageList")
|
||||
qmlRegisterType(LocalPackageList, "Marketplace", 1, 0, "LocalPackageList")
|
||||
qmlRegisterType(Manager, "Marketplace", 1, 0, "Manager")
|
||||
|
||||
@pyqtSlot()
|
||||
def show(self) -> None:
|
||||
|
|
@ -44,7 +46,7 @@ class Marketplace(Extension):
|
|||
if plugin_path is None:
|
||||
plugin_path = os.path.dirname(__file__)
|
||||
path = os.path.join(plugin_path, "resources", "qml", "Marketplace.qml")
|
||||
self._window = CuraApplication.getInstance().createQmlComponent(path, {"plugin_registry": self.plugin_registry})
|
||||
self._window = CuraApplication.getInstance().createQmlComponent(path, {})
|
||||
if self._window is None: # Still None? Failed to load the QML then.
|
||||
return
|
||||
self._window.show()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue