mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 11:17:49 -06:00
Renamed Manager to RestartManager
Contributes to: CURA-8587
This commit is contained in:
parent
27cb1d2d9f
commit
fd508342fe
3 changed files with 12 additions and 8 deletions
|
@ -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 .RemotePackageList import RemotePackageList # To register this type with QML.
|
||||||
from .LocalPackageList import LocalPackageList # 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:
|
if TYPE_CHECKING:
|
||||||
from PyQt5.QtCore import QObject
|
from PyQt5.QtCore import QObject
|
||||||
|
@ -31,7 +31,7 @@ class Marketplace(Extension):
|
||||||
|
|
||||||
qmlRegisterType(RemotePackageList, "Marketplace", 1, 0, "RemotePackageList")
|
qmlRegisterType(RemotePackageList, "Marketplace", 1, 0, "RemotePackageList")
|
||||||
qmlRegisterType(LocalPackageList, "Marketplace", 1, 0, "LocalPackageList")
|
qmlRegisterType(LocalPackageList, "Marketplace", 1, 0, "LocalPackageList")
|
||||||
qmlRegisterType(Manager, "Marketplace", 1, 0, "Manager")
|
qmlRegisterType(RestartManager, "Marketplace", 1, 0, "RestartManager")
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def show(self) -> None:
|
def show(self) -> None:
|
||||||
|
|
|
@ -1,17 +1,21 @@
|
||||||
# Copyright (c) 2021 Ultimaker B.V.
|
# Copyright (c) 2021 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# 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 PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal
|
||||||
|
|
||||||
from cura.CuraApplication import CuraApplication
|
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):
|
def __init__(self, parent: Optional[QObject] = None):
|
||||||
super().__init__(parent = parent)
|
super().__init__(parent = parent)
|
||||||
self._manager: "CuraPackageManager" = CuraApplication.getInstance().getPackageManager()
|
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._manager.installedPackagesChanged.connect(self.checkIfRestartNeeded)
|
||||||
self._plugin_registry.hasPluginsEnabledOrDisabledChanged.connect(self.checkIfRestartNeeded)
|
self._plugin_registry.hasPluginsEnabledOrDisabledChanged.connect(self.checkIfRestartNeeded)
|
|
@ -14,7 +14,7 @@ Window
|
||||||
{
|
{
|
||||||
id: marketplaceDialog
|
id: marketplaceDialog
|
||||||
property variant catalog: UM.I18nCatalog { name: "cura" }
|
property variant catalog: UM.I18nCatalog { name: "cura" }
|
||||||
property variant manager: Marketplace.Manager { }
|
property variant restartManager: Marketplace.RestartManager { }
|
||||||
|
|
||||||
signal searchStringChanged(string new_search)
|
signal searchStringChanged(string new_search)
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@ Window
|
||||||
{
|
{
|
||||||
height: quitButton.height + 2 * UM.Theme.getSize("default_margin").width
|
height: quitButton.height + 2 * UM.Theme.getSize("default_margin").width
|
||||||
color: UM.Theme.getColor("primary")
|
color: UM.Theme.getColor("primary")
|
||||||
visible: manager.showRestartNotification
|
visible: restartManager.showRestartNotification
|
||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
left: parent.left
|
left: parent.left
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue