chiark / gitweb /
Remove extra comma at the end of the print window title when in error state
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Thu, 17 Sep 2015 20:57:30 +0000 (16:57 -0400)
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Thu, 17 Sep 2015 20:57:30 +0000 (16:57 -0400)
The \n is replaced by , for the title, but if there is no temperature/bed
values being printed, then we get an extra comma at the end.
Fixes T245

Cura/gui/printWindow.py

index 6f1f484af67584da552194d6b02ec24f06bc3ee2..a50e06db38dd6ed8283a52e27fc73ca9177836e9 100644 (file)
@@ -403,7 +403,7 @@ class printWindowPlugin(wx.Frame):
                if self._infoText is not None:
                        self._infoText.SetLabel(info)
                else:
-                       self.SetTitle(info.replace('\n', ', '))
+                       self.SetTitle(info.replace('\n', ', ').strip().strip(','))
                if isPrinting != self._isPrinting:
                        self._isPrinting = isPrinting
                        preventComputerFromSleeping(self, self._isPrinting)
@@ -939,7 +939,7 @@ class printWindowAdvanced(wx.Frame):
                        info += 'Temperature: %d' % (self._printerConnection.getTemperature(0))
                if self._printerConnection.getBedTemperature() > 0:
                        info += ' Bed: %d' % (self._printerConnection.getBedTemperature())
-               self.SetTitle(info.replace('\n', ', '))
+               self.SetTitle(info.replace('\n', ', ').strip().strip(','))
                if isPrinting != self._isPrinting:
                        self._isPrinting = isPrinting
                        preventComputerFromSleeping(self, self._isPrinting)