From 945429195e3190b418a4c697d6793adf713425d3 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 24 May 2018 20:47:09 +0200 Subject: [PATCH] Move getCuraPackageManager to Uranium and initialize package manager there --- cura/CuraApplication.py | 9 --------- plugins/Toolbox/src/Toolbox.py | 2 +- resources/qml/Cura.qml | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 5db616ab3b..08ef6ee4c5 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -247,11 +247,6 @@ class CuraApplication(QtApplication): tray_icon_name = "cura-icon-32.png", **kwargs) - # Initialize the package manager to remove and install scheduled packages. - from cura.CuraPackageManager import CuraPackageManager - self._cura_package_manager = CuraPackageManager(self) - self._cura_package_manager.initialize() - self.initialize() # FOR TESTING ONLY @@ -823,10 +818,6 @@ class CuraApplication(QtApplication): self._extruder_manager = ExtruderManager.createExtruderManager() return self._extruder_manager - @pyqtSlot(result = QObject) - def getCuraPackageManager(self, *args): - return self._cura_package_manager - def getVariantManager(self, *args): return self._variant_manager diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 6dac823f06..eb5ea94811 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -160,7 +160,7 @@ class Toolbox(QObject, Extension): # This is a plugin, so most of the components required are not ready when # this is initialized. Therefore, we wait until the application is ready. def _onAppInitialized(self) -> None: - self._package_manager = Application.getInstance().getCuraPackageManager() + self._package_manager = Application.getInstance().getPackageManager() # Get the API root for the packages API depending on Cura version settings. def _getPackagesApiRoot(self) -> str: diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index e1cc4f6e45..dd5c60ea53 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -330,7 +330,7 @@ UM.MainWindow if (filename.endsWith(".curapackage")) { // Try to install plugin & close. - CuraApplication.getCuraPackageManager().installPackageViaDragAndDrop(filename); + CuraApplication.getPackageManager().installPackageViaDragAndDrop(filename); packageInstallDialog.text = catalog.i18nc("@label", "This package will be installed after restarting."); packageInstallDialog.icon = StandardIcon.Information; packageInstallDialog.open();