mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-29 23:34:32 +08:00
Move existNetworkInstances into discover action
This commit is contained in:
parent
5b818d203a
commit
fe14024620
@ -1455,13 +1455,6 @@ class MachineManager(QObject):
|
|||||||
if self.hasUserSettings and self._application.getPreferences().getValue("cura/active_mode") == 1:
|
if self.hasUserSettings and self._application.getPreferences().getValue("cura/active_mode") == 1:
|
||||||
self._application.discardOrKeepProfileChanges()
|
self._application.discardOrKeepProfileChanges()
|
||||||
|
|
||||||
|
|
||||||
## This method checks if there is an instance connected to the given network_key
|
|
||||||
def existNetworkInstances(self, network_key: str) -> bool:
|
|
||||||
metadata_filter = {"um_network_key": network_key}
|
|
||||||
containers = CuraContainerRegistry.getInstance().findContainerStacks(type = "machine", **metadata_filter)
|
|
||||||
return bool(containers)
|
|
||||||
|
|
||||||
@pyqtSlot("QVariant")
|
@pyqtSlot("QVariant")
|
||||||
def setGlobalVariant(self, container_node: "ContainerNode") -> None:
|
def setGlobalVariant(self, container_node: "ContainerNode") -> None:
|
||||||
self.blurSettings.emit()
|
self.blurSettings.emit()
|
||||||
|
@ -157,7 +157,9 @@ class DiscoverUM3Action(MachineAction):
|
|||||||
|
|
||||||
@pyqtSlot(str, result = bool)
|
@pyqtSlot(str, result = bool)
|
||||||
def existsKey(self, key: str) -> bool:
|
def existsKey(self, key: str) -> bool:
|
||||||
return CuraApplication.getInstance().getMachineManager().existNetworkInstances(network_key = key)
|
metadata_filter = {"um_network_key": key}
|
||||||
|
containers = CuraContainerRegistry.getInstance().findContainerStacks(type="machine", **metadata_filter)
|
||||||
|
return bool(containers)
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def loadConfigurationFromPrinter(self) -> None:
|
def loadConfigurationFromPrinter(self) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user