mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-29 07:14:24 +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:
|
||||
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")
|
||||
def setGlobalVariant(self, container_node: "ContainerNode") -> None:
|
||||
self.blurSettings.emit()
|
||||
|
@ -157,7 +157,9 @@ class DiscoverUM3Action(MachineAction):
|
||||
|
||||
@pyqtSlot(str, result = 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()
|
||||
def loadConfigurationFromPrinter(self) -> None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user