Move getCuraPackageManager to Uranium and initialize package manager there

This commit is contained in:
Ghostkeeper 2018-05-24 20:47:09 +02:00
parent 0f4f55cf6b
commit 945429195e
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A
3 changed files with 2 additions and 11 deletions

View file

@ -247,11 +247,6 @@ class CuraApplication(QtApplication):
tray_icon_name = "cura-icon-32.png", tray_icon_name = "cura-icon-32.png",
**kwargs) **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() self.initialize()
# FOR TESTING ONLY # FOR TESTING ONLY
@ -823,10 +818,6 @@ class CuraApplication(QtApplication):
self._extruder_manager = ExtruderManager.createExtruderManager() self._extruder_manager = ExtruderManager.createExtruderManager()
return self._extruder_manager return self._extruder_manager
@pyqtSlot(result = QObject)
def getCuraPackageManager(self, *args):
return self._cura_package_manager
def getVariantManager(self, *args): def getVariantManager(self, *args):
return self._variant_manager return self._variant_manager

View file

@ -160,7 +160,7 @@ class Toolbox(QObject, Extension):
# This is a plugin, so most of the components required are not ready when # 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. # this is initialized. Therefore, we wait until the application is ready.
def _onAppInitialized(self) -> None: 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. # Get the API root for the packages API depending on Cura version settings.
def _getPackagesApiRoot(self) -> str: def _getPackagesApiRoot(self) -> str:

View file

@ -330,7 +330,7 @@ UM.MainWindow
if (filename.endsWith(".curapackage")) if (filename.endsWith(".curapackage"))
{ {
// Try to install plugin & close. // 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.text = catalog.i18nc("@label", "This package will be installed after restarting.");
packageInstallDialog.icon = StandardIcon.Information; packageInstallDialog.icon = StandardIcon.Information;
packageInstallDialog.open(); packageInstallDialog.open();