From ad51d8f1b6d9fc38131413ad06fa9de8b9d590c4 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 8 Apr 2019 13:06:28 +0200 Subject: [PATCH] Show readable machine type in add by ip page CURA-6057 --- cura/Settings/MachineManager.py | 1 + resources/qml/WelcomePages/AddPrinterByIpContent.qml | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 69978ae69f..7d0e7506b8 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -1630,6 +1630,7 @@ class MachineManager(QObject): return abbr_machine + @pyqtSlot(str, result = str) def getMachineTypeNameFromId(self, machine_type_id: str) -> str: machine_type_name = "" results = self._container_registry.findDefinitionContainersMetadata(id = machine_type_id) diff --git a/resources/qml/WelcomePages/AddPrinterByIpContent.qml b/resources/qml/WelcomePages/AddPrinterByIpContent.qml index 77a770b4fd..2930bc8dbe 100644 --- a/resources/qml/WelcomePages/AddPrinterByIpContent.qml +++ b/resources/qml/WelcomePages/AddPrinterByIpContent.qml @@ -196,7 +196,10 @@ Item { if (UM.OutputDeviceManager.hasManualDevice) { - typeText.text = UM.OutputDeviceManager.manualDeviceProperty("printer_type") + const type_id = UM.OutputDeviceManager.manualDeviceProperty("printer_type") + var readable_type = Cura.MachineManager.getMachineTypeNameFromId(type_id) + readable_type = (readable_type != "") ? readable_type : catalog.i18nc("@label", "Unknown") + typeText.text = readable_type firmwareText.text = UM.OutputDeviceManager.manualDeviceProperty("firmware_version") addressText.text = UM.OutputDeviceManager.manualDeviceProperty("address") }