From 9e1940dd4bbe20103a0341087a632ae1fea8b854 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 25 Jul 2022 16:55:05 +0200 Subject: [PATCH] Move default behaviour up in inheritance hierarchy This way, any new printer types we define will automatically get these properties that are used by the monitor stage anyway. Contributes to issue CURA-9220. --- .../src/Network/LocalClusterOutputDevice.py | 29 ----------------- .../UltimakerNetworkedPrinterOutputDevice.py | 31 ++++++++++++++++++- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py b/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py index d7d4263b3c..eaa3a7c4f5 100644 --- a/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py @@ -96,35 +96,6 @@ class LocalClusterOutputDevice(UltimakerNetworkedPrinterOutputDevice): def forceSendJob(self, print_job_uuid: str) -> None: self._getApiClient().forcePrintJob(print_job_uuid) - @pyqtProperty(bool, constant = True) - def supportsPrintJobQueue(self) -> bool: - """ - Whether this printer knows about queueing print jobs. - """ - return True # This API always supports print job queueing. - - @pyqtProperty(bool, constant = True) - def canReadPrintJobs(self) -> bool: - """ - Whether this user can read the list of print jobs and their properties. - """ - return False # On LAN, the user can always read it. - - @pyqtProperty(bool, constant = True) - def canWriteOthersPrintJobs(self) -> bool: - """ - Whether this user can change things about print jobs made by other - people. - """ - return True # On LAN, the user can always change this. - - @pyqtProperty(bool, constant = True) - def canWriteOwnPrintJobs(self) -> bool: - """ - Whether this user can change things about print jobs made by themself. - """ - return True # On LAN, the user can always change this. - def setJobState(self, print_job_uuid: str, action: str) -> None: """Set the remote print job state. diff --git a/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py index 769e92610a..5fd642eaee 100644 --- a/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Ultimaker B.V. +# Copyright (c) 2022 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import os from time import time @@ -184,6 +184,35 @@ class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice): def forceSendJob(self, print_job_uuid: str) -> None: raise NotImplementedError("forceSendJob must be implemented") + @pyqtProperty(bool, constant = True) + def supportsPrintJobQueue(self) -> bool: + """ + Whether this printer knows about queueing print jobs. + """ + return True # This API always supports print job queueing. + + @pyqtProperty(bool, constant = True) + def canReadPrintJobs(self) -> bool: + """ + Whether this user can read the list of print jobs and their properties. + """ + return True # On LAN, the user can always read it. + + @pyqtProperty(bool, constant = True) + def canWriteOthersPrintJobs(self) -> bool: + """ + Whether this user can change things about print jobs made by other + people. + """ + return True # On LAN, the user can always change this. + + @pyqtProperty(bool, constant = True) + def canWriteOwnPrintJobs(self) -> bool: + """ + Whether this user can change things about print jobs made by themself. + """ + return True # On LAN, the user can always change this. + @pyqtSlot(name="openPrintJobControlPanel") def openPrintJobControlPanel(self) -> None: raise NotImplementedError("openPrintJobControlPanel must be implemented")