From 3df98ecfc534dc5dbb9b3121af4fec0b0d84e200 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 11 Oct 2017 11:10:08 +0200 Subject: [PATCH 1/6] Change error/success messages for checking cluster-capability This breaks the string freeze. The developers of this plug-in are well aware. However, it turns out that for these two strings the string freeze had already broken. We'll change these strings first then translate them out of band. I hate this sort of menial administration that could've been prevented... Contributes to issue CURA-4341. --- plugins/UM3NetworkPrinting/DiscoverUM3Action.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml b/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml index 7594d1691d..b69997a53e 100644 --- a/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml +++ b/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml @@ -285,11 +285,11 @@ Cura.MachineAction } else if (base.selectedPrinter.clusterSize === 0) { - return catalog.i18nc("@label", "Cura Connect: This printer is not set up to host a group of connected Ultimaker 3 printers."); + return catalog.i18nc("@label", "This printer is not set up to host a group of Ultimaker 3 printers."); } else { - return catalog.i18nc("@label", "Cura Connect: This printer is set up to host a group of %1 connected Ultimaker 3 printers".arg(base.selectedPrinter.clusterSize)); + return catalog.i18nc("@label", "This printer is the host for a group of %1 Ultimaker 3 printers.".arg(base.selectedPrinter.clusterSize)); } } From d3853815eaadce192dadd547daa24b02cfd1ccd8 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 11 Oct 2017 11:10:42 +0200 Subject: [PATCH 2/6] Add missing strings for broken string freeze Bad. Bad! Contributes to issue CURA-4341. --- resources/i18n/cura.pot | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/resources/i18n/cura.pot b/resources/i18n/cura.pot index 409fd77c7b..9135cfc381 100644 --- a/resources/i18n/cura.pot +++ b/resources/i18n/cura.pot @@ -38,6 +38,31 @@ msgctxt "@label:status" msgid "Can't start print" msgstr "" +#: Manually added for plugins/UM3NetworkPrinting/DiscoverUM3Action.qml +msgctxt "@label" +msgid "This printer is not set up to host a group of Ultimaker 3 printers." +msgstr "" + +#: Manually added for plugins/UM3NetworkPrinting/PrinterInfoBlock.qml +msgctxt "@label" +msgid "Finishes at: " +msgstr "" + +#: Manually added for plugins/UM3NetworkPrinting/DiscoverUM3Action.qml +msgctxt "@label" +msgid "This printer is the host for a group of %1 Ultimaker 3 printers." +msgstr "" + +#: Manually added for plugins/UM3NetworkPrinting/NetworkClusterPrinterOutputDevice.py +msgctxt "@info:status" +msgid "Printer '{printer_name}' has finished printing '{job_name}'." +msgstr "" + +#: Manually added for plugins/UM3NetworkPrinting/NetworkClusterPrinterOutputDevice.py +msgctxt "@info:status" +msgid "Print finished" +msgstr "" + #: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.py:29 msgctxt "@action" msgid "Machine Settings" From 69f6a7de73b58f511b60a0335378a420e399acbf Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 11 Oct 2017 11:16:59 +0200 Subject: [PATCH 3/6] Fix mistaken negation The translator read this one wrong. Contributes to issue CURA-4341. --- resources/i18n/fr_FR/cura.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/i18n/fr_FR/cura.po b/resources/i18n/fr_FR/cura.po index b018bdade6..6a72839d43 100644 --- a/resources/i18n/fr_FR/cura.po +++ b/resources/i18n/fr_FR/cura.po @@ -1566,7 +1566,7 @@ msgstr "Cette imprimante n'est pas configurée pour héberger un groupe d'imprim #: /home/ruben/Projects/Cura/plugins/CuraPrintClusterUpload/DiscoverUM3Action.qml:287 msgctxt "@label" msgid "This printer is the host for a group of %1 connected Ultimaker 3 printers" -msgstr "L'imprimante n'est pas configurée pour héberger un groupe de %1 imprimantes connectées Ultimaker 3." +msgstr "L'imprimante est configurée pour héberger un groupe de %1 imprimantes connectées Ultimaker 3." #: /home/ruben/Projects/Cura/plugins/CuraPrintClusterUpload/PrintWindow.qml:24 msgctxt "@title:window" From cadfa14fb4af6887923c190b75c535cb5f0faf8d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 11 Oct 2017 11:22:08 +0200 Subject: [PATCH 4/6] Fix mistake in verb vs. noun of 'Print' The translator misunderstood this. It's not 'to print the details', but 'details of the print'. Contributes to issue CURA-4341. --- resources/i18n/fr_FR/cura.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/i18n/fr_FR/cura.po b/resources/i18n/fr_FR/cura.po index 6a72839d43..69b833caf3 100644 --- a/resources/i18n/fr_FR/cura.po +++ b/resources/i18n/fr_FR/cura.po @@ -163,7 +163,7 @@ msgstr "Impossible de démarrer une nouvelle tâche car l'imprimante est occupé #: /home/ruben/Projects/Cura/plugins/USBPrinting/USBPrinterOutputDevice.py:153 msgctxt "@info:title" msgid "Print Details" -msgstr "Imprimer les détails" +msgstr "Les détails d'impression" #: /home/ruben/Projects/Cura/plugins/USBPrinting/USBPrinterOutputDevice.py:456 msgctxt "@info:status" From 3c69442ceb16c7bfcf555446af3d7dec4f86300c Mon Sep 17 00:00:00 2001 From: Simon Edwards Date: Wed, 11 Oct 2017 11:54:00 +0200 Subject: [PATCH 5/6] Don't blow up at plugin start up due to the plugin path not being ready yet CL-555 --- .../NetworkClusterPrinterOutputDevice.py | 15 +++++++++++++-- .../NetworkPrinterOutputDevicePlugin.py | 13 +------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/plugins/UM3NetworkPrinting/NetworkClusterPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkClusterPrinterOutputDevice.py index 5ce498e11c..cfa793996b 100644 --- a/plugins/UM3NetworkPrinting/NetworkClusterPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkClusterPrinterOutputDevice.py @@ -19,6 +19,7 @@ from UM.Message import Message from UM.OutputDevice import OutputDeviceError from UM.i18n import i18nCatalog from UM.Qt.Duration import Duration, DurationFormat +from UM.PluginRegistry import PluginRegistry from . import NetworkPrinterOutputDevice @@ -36,7 +37,7 @@ class NetworkClusterPrinterOutputDevice(NetworkPrinterOutputDevice.NetworkPrinte printersChanged = pyqtSignal() selectedPrinterChanged = pyqtSignal() - def __init__(self, key, address, properties, api_prefix, plugin_path): + def __init__(self, key, address, properties, api_prefix): super().__init__(key, address, properties, api_prefix) # Store the address of the master. self._master_address = address @@ -47,7 +48,6 @@ class NetworkClusterPrinterOutputDevice(NetworkPrinterOutputDevice.NetworkPrinte name = key self._authentication_state = NetworkPrinterOutputDevice.AuthState.Authenticated # The printer is always authenticated - self._plugin_path = plugin_path self.setName(name) description = i18n_catalog.i18nc("@action:button Preceded by 'Ready to'.", "Print over network") @@ -709,3 +709,14 @@ class NetworkClusterPrinterOutputDevice(NetworkPrinterOutputDevice.NetworkPrinte @pyqtSlot(int, result=str) def formatDuration(self, seconds): return Duration(seconds).getDisplayString(DurationFormat.Format.Short) + + ## For cluster below + def _get_plugin_directory_name(self): + current_file_absolute_path = os.path.realpath(__file__) + directory_path = os.path.dirname(current_file_absolute_path) + _, directory_name = os.path.split(directory_path) + return directory_name + + @property + def _plugin_path(self): + return PluginRegistry.getInstance().getPluginPath(self._get_plugin_directory_name()) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevicePlugin.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevicePlugin.py index 0ed745d9d8..4d9ce29504 100644 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevicePlugin.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevicePlugin.py @@ -220,7 +220,7 @@ class NetworkPrinterOutputDevicePlugin(QObject, OutputDevicePlugin): cluster_size = int(properties.get(b"cluster_size", -1)) if force_cluster or cluster_size >= 0: printer = NetworkClusterPrinterOutputDevice.NetworkClusterPrinterOutputDevice( - name, address, properties, self._api_prefix, self._plugin_path) + name, address, properties, self._api_prefix) else: printer = NetworkPrinterOutputDevice.NetworkPrinterOutputDevice(name, address, properties, self._api_prefix) self._printers[printer.getKey()] = printer @@ -285,17 +285,6 @@ class NetworkPrinterOutputDevicePlugin(QObject, OutputDevicePlugin): Logger.log("d", "Bonjour service removed: %s" % name) self.removePrinterSignal.emit(str(name)) - ## For cluster below - def _get_plugin_directory_name(self): - current_file_absolute_path = os.path.realpath(__file__) - directory_path = os.path.dirname(current_file_absolute_path) - _, directory_name = os.path.split(directory_path) - return directory_name - - @property - def _plugin_path(self): - return PluginRegistry.getInstance().getPluginPath(self._get_plugin_directory_name()) - @pyqtSlot() def openControlPanel(self): Logger.log("d", "Opening print jobs web UI...") From b68707d29c2ded76397b578b7edeb68fe38033d2 Mon Sep 17 00:00:00 2001 From: Simon Edwards Date: Wed, 11 Oct 2017 13:52:45 +0200 Subject: [PATCH 6/6] Show the printer unreachable status in the Cura Connect tab when needed. CL-508 --- plugins/UM3NetworkPrinting/PrinterInfoBlock.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/PrinterInfoBlock.qml b/plugins/UM3NetworkPrinting/PrinterInfoBlock.qml index 256c911918..005d719266 100644 --- a/plugins/UM3NetworkPrinting/PrinterInfoBlock.qml +++ b/plugins/UM3NetworkPrinting/PrinterInfoBlock.qml @@ -39,7 +39,8 @@ Rectangle return catalog.i18nc("@label:status", "Printing"); case "idle": return catalog.i18nc("@label:status", "Available"); - case "unreachable": // TODO: new string + case "unreachable": + return catalog.i18nc("@label:MonitorStatus", "Lost connection with the printer"); case "maintenance": // TODO: new string case "unknown": default: @@ -165,6 +166,7 @@ Rectangle anchors.right: printProgressArea.left anchors.rightMargin: UM.Theme.getSize("default_margin").width color: emphasisColor + opacity: printer != null && printer.status === "unreachable" ? 0.3 : 1 Image {