diff --git a/cura/PrinterOutputDevice.py b/cura/PrinterOutputDevice.py index 7f0b7c4c07..f411190fd5 100644 --- a/cura/PrinterOutputDevice.py +++ b/cura/PrinterOutputDevice.py @@ -47,8 +47,8 @@ class PrinterOutputDevice(QObject, OutputDevice): self._job_name = "" self._error_text = "" self._accepts_commands = True - self._preheat_bed_timeout = 900 #Default time-out for pre-heating the bed, in seconds. - self._preheat_bed_timer = QTimer() #Timer that tracks how long to preheat still. + self._preheat_bed_timeout = 900 # Default time-out for pre-heating the bed, in seconds. + self._preheat_bed_timer = QTimer() # Timer that tracks how long to preheat still. self._preheat_bed_timer.setSingleShot(True) self._preheat_bed_timer.timeout.connect(self.cancelPreheatBed) @@ -232,11 +232,15 @@ class PrinterOutputDevice(QObject, OutputDevice): # \return The duration of the time-out to pre-heat the bed, formatted. @pyqtProperty(str, notify = preheatBedRemainingTimeChanged) def preheatBedRemainingTime(self): + if not self._preheat_bed_timer.isActive(): + return "" period = self._preheat_bed_timer.remainingTime() if period <= 0: return "" minutes, period = divmod(period, 60000) #60000 milliseconds in a minute. seconds, _ = divmod(period, 1000) #1000 milliseconds in a second. + if minutes <= 0 and seconds <= 0: + return "" return "%d:%02d" % (minutes, seconds) ## Time the print has been printing. diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index a7223128b4..ea8917ed9f 100644 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -558,7 +558,6 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): self._preheat_bed_timer.stop() self.preheatBedRemainingTimeChanged.emit() - def close(self): Logger.log("d", "Closing connection of printer %s with ip %s", self._key, self._address) self._updateJobState("") diff --git a/resources/qml/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/DiscardOrKeepProfileChangesDialog.qml index 4c88801bb0..26c343ad5c 100644 --- a/resources/qml/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/DiscardOrKeepProfileChangesDialog.qml @@ -64,7 +64,7 @@ UM.Dialog anchors.margins: UM.Theme.getSize("default_margin").width anchors.left: parent.left anchors.right: parent.right - height: base.height - 130 + height: base.height - 200 id: tableView Component { @@ -146,7 +146,25 @@ UM.Dialog ] width: 300 currentIndex: UM.Preferences.getValue("cura/choice_on_profile_override") - onCurrentIndexChanged: UM.Preferences.setValue("cura/choice_on_profile_override", currentIndex) + onCurrentIndexChanged: + { + UM.Preferences.setValue("cura/choice_on_profile_override", currentIndex) + if (currentIndex == 1) { + // 1 == "Discard and never ask again", so only enable the "Discard" button + discardButton.enabled = true + keepButton.enabled = false + } + else if (currentIndex == 2) { + // 2 == "Keep and never ask again", so only enable the "Keep" button + keepButton.enabled = true + discardButton.enabled = false + } + else { + // 0 == "Always ask me this", so show both + keepButton.enabled = true + discardButton.enabled = true + } + } } }