diff --git a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml index b27416e199..a604bac20c 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml @@ -212,10 +212,7 @@ Cura.MachineAction text: { if (base.selectedDevice) { - // It would be great to use a more readable machine type here, - // but the new discoveredPrintersModel is not used yet in the UM networking actions. - // TODO: remove actions or replace 'connect via network' button with new flow? - return base.selectedDevice.printerType + return base.selectedDevice.printerTypeName } return "" } diff --git a/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py index 02ce91800d..73b5b456f9 100644 --- a/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py @@ -60,9 +60,13 @@ class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice): self._time_of_last_response = time() self._time_of_last_request = time() - # Set the display name from the properties + # Set the display name from the properties. self.setName(self.getProperty("name")) + # Set the display name of the printer type. + definitions = CuraApplication.getInstance().getContainerRegistry().findContainers(id = self.printerType) + self._printer_type_name = definitions[0].getName() if definitions else "" + # Keeps track of all printers in the cluster. self._printers = [] # type: List[PrinterOutputModel] self._has_received_printers = False @@ -87,6 +91,11 @@ class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice): def address(self) -> str: return self._address + ## The display name of the printer. + @pyqtProperty(str, constant=True) + def printerTypeName(self) -> str: + return self._printer_type_name + # Get all print jobs for this cluster. @pyqtProperty("QVariantList", notify=printJobsChanged) def printJobs(self) -> List[UM3PrintJobOutputModel]: