Renamed Manager to RestartManager

Contributes to: CURA-8587
This commit is contained in:
Jelle Spijker 2021-12-08 14:33:22 +01:00
parent 27cb1d2d9f
commit fd508342fe
No known key found for this signature in database
GPG key ID: 6662DC033BE6B99A
3 changed files with 12 additions and 8 deletions

View file

@ -13,7 +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.
from .RestartManager import RestartManager # To register this type with QML.
if TYPE_CHECKING:
from PyQt5.QtCore import QObject
@ -31,7 +31,7 @@ class Marketplace(Extension):
qmlRegisterType(RemotePackageList, "Marketplace", 1, 0, "RemotePackageList")
qmlRegisterType(LocalPackageList, "Marketplace", 1, 0, "LocalPackageList")
qmlRegisterType(Manager, "Marketplace", 1, 0, "Manager")
qmlRegisterType(RestartManager, "Marketplace", 1, 0, "RestartManager")
@pyqtSlot()
def show(self) -> None:

View file

@ -1,17 +1,21 @@
# Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import Optional
from typing import Optional, TYPE_CHECKING
from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal
from cura.CuraApplication import CuraApplication
from UM.PluginRegistry import PluginRegistry
class Manager(QObject):
if TYPE_CHECKING:
from UM.PluginRegistry import PluginRegistry
from cura.CuraPackageManager import CuraPackageManager
class RestartManager(QObject):
def __init__(self, parent: Optional[QObject] = None):
super().__init__(parent = parent)
self._manager: "CuraPackageManager" = CuraApplication.getInstance().getPackageManager()
self._plugin_registry: PluginRegistry = CuraApplication.getInstance().getPluginRegistry()
self._plugin_registry: "PluginRegistry" = CuraApplication.getInstance().getPluginRegistry()
self._manager.installedPackagesChanged.connect(self.checkIfRestartNeeded)
self._plugin_registry.hasPluginsEnabledOrDisabledChanged.connect(self.checkIfRestartNeeded)

View file

@ -14,7 +14,7 @@ Window
{
id: marketplaceDialog
property variant catalog: UM.I18nCatalog { name: "cura" }
property variant manager: Marketplace.Manager { }
property variant restartManager: Marketplace.RestartManager { }
signal searchStringChanged(string new_search)
@ -234,7 +234,7 @@ Window
{
height: quitButton.height + 2 * UM.Theme.getSize("default_margin").width
color: UM.Theme.getColor("primary")
visible: manager.showRestartNotification
visible: restartManager.showRestartNotification
anchors
{
left: parent.left