Check type by ID in isUnknownMachineType()

CURA-6449
This commit is contained in:
Lipu Fei 2019-04-17 09:32:31 +02:00
parent d9018220b5
commit ce5682aa74

View file

@ -62,12 +62,14 @@ class DiscoveredPrinter(QObject):
from cura.CuraApplication import CuraApplication from cura.CuraApplication import CuraApplication
readable_type = CuraApplication.getInstance().getMachineManager().getMachineTypeNameFromId(self._machine_type) readable_type = CuraApplication.getInstance().getMachineManager().getMachineTypeNameFromId(self._machine_type)
if not readable_type: if not readable_type:
readable_type = "unknown" readable_type = catalog.i18nc("@label", "Unknown")
return readable_type return readable_type
@pyqtProperty(bool, notify = machineTypeChanged) @pyqtProperty(bool, notify = machineTypeChanged)
def isUnknownMachineType(self) -> bool: def isUnknownMachineType(self) -> bool:
return self.readableMachineType == "unknown" from cura.CuraApplication import CuraApplication
readable_type = CuraApplication.getInstance().getMachineManager().getMachineTypeNameFromId(self._machine_type)
return not readable_type
@pyqtProperty(QObject, constant = True) @pyqtProperty(QObject, constant = True)
def device(self) -> "NetworkedPrinterOutputDevice": def device(self) -> "NetworkedPrinterOutputDevice":