Use connection type instead of um_network_key to see if a printer has a network connection

CURA-6011
This commit is contained in:
Jaime van Kessel 2018-12-17 10:47:14 +01:00
parent b8a4d8e80d
commit 938287095f
5 changed files with 13 additions and 5 deletions

View file

@ -23,7 +23,7 @@ from UM.Settings.SettingFunction import SettingFunction
from UM.Signal import postponeSignals, CompressTechnique
from cura.Machines.QualityManager import getMachineDefinitionIDForQualitySearch
from cura.PrinterOutputDevice import PrinterOutputDevice
from cura.PrinterOutputDevice import PrinterOutputDevice, ConnectionType
from cura.PrinterOutput.ConfigurationModel import ConfigurationModel
from cura.PrinterOutput.ExtruderConfigurationModel import ExtruderConfigurationModel
from cura.PrinterOutput.MaterialOutputModel import MaterialOutputModel
@ -521,6 +521,13 @@ class MachineManager(QObject):
def printerConnected(self):
return bool(self._printer_output_devices)
@pyqtProperty(bool, notify=printerConnectedStatusChanged)
def activeMachineHasRemoteConnection(self) -> bool:
if self._global_container_stack:
connection_type = self._global_container_stack.getMetaDataEntry("connection_type")
return connection_type in [ConnectionType.NetworkConnection, ConnectionType.CloudConnection]
return False
@pyqtProperty(str, notify = printerConnectedStatusChanged)
def activeMachineNetworkKey(self) -> str:
if self._global_container_stack: