From c0933ddb2d56363e42a7f4dd377d1668866d287f Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Tue, 30 Jul 2019 17:00:30 +0200 Subject: [PATCH] Simplify return --- plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py | 6 ++---- .../UM3NetworkPrinting/src/Network/NetworkOutputDevice.py | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py index 3f97d74068..14c17c33a3 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py @@ -170,13 +170,11 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice): # Show an error message if we're already sending a job. if self._progress.visible: - message = Message( + return Message( text=I18N_CATALOG.i18nc("@info:status", "Please wait until the current job has been sent."), title=I18N_CATALOG.i18nc("@info:title", "Print error"), lifetime=10 - ) - message.show() - return + ).show() if self._uploaded_print_job: # The mesh didn't change, let's not upload it again diff --git a/plugins/UM3NetworkPrinting/src/Network/NetworkOutputDevice.py b/plugins/UM3NetworkPrinting/src/Network/NetworkOutputDevice.py index e109904046..d138d78beb 100644 --- a/plugins/UM3NetworkPrinting/src/Network/NetworkOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/Network/NetworkOutputDevice.py @@ -118,13 +118,11 @@ class NetworkOutputDevice(UltimakerNetworkedPrinterOutputDevice): # Show an error message if we're already sending a job. if self._progress.visible: - message = Message( + return Message( text=I18N_CATALOG.i18nc("@info:status", "Please wait until the current job has been sent."), title=I18N_CATALOG.i18nc("@info:title", "Print error"), lifetime=10 - ) - message.show() - return + ).show() self.writeStarted.emit(self)