mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-09 07:56:22 -06:00
Use printer type name instead of id
This commit is contained in:
parent
93f2641be7
commit
99832c3a68
2 changed files with 11 additions and 5 deletions
|
@ -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 ""
|
||||
}
|
||||
|
|
|
@ -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]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue