Browse Source

Check type by ID in isUnknownMachineType()

CURA-6449
Lipu Fei 5 years ago
parent
commit
ce5682aa74
1 changed files with 4 additions and 2 deletions
  1. 4 2
      cura/Machines/Models/DiscoveredPrintersModel.py

+ 4 - 2
cura/Machines/Models/DiscoveredPrintersModel.py

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