From 6c51034e5fde0581258a1a26f406e758dd5161e7 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Mon, 9 Oct 2017 11:31:32 +0200 Subject: [PATCH 01/19] Fix sending another file after aborting an upload - CURA-4398 --- plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index 19d2d5e893..58b62217f0 100755 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -530,6 +530,9 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): if self._post_reply is None: return + # Indicate uploading was finished (so another file can be send) + self._write_finished = True + try: try: self._post_reply.uploadProgress.disconnect(self._onUploadProgress) From 59fbbef43e6bd1ad4b3e6551e4cd5172832fc103 Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 9 Oct 2017 11:58:00 +0200 Subject: [PATCH 02/19] first hide the dialog then release the lock CURA-4405 --- plugins/3MFReader/WorkspaceDialog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/3MFReader/WorkspaceDialog.py b/plugins/3MFReader/WorkspaceDialog.py index 6acccbb1bc..7c803486eb 100644 --- a/plugins/3MFReader/WorkspaceDialog.py +++ b/plugins/3MFReader/WorkspaceDialog.py @@ -276,8 +276,8 @@ class WorkspaceDialog(QObject): def hide(self): self._visible = False - self._lock.release() self._view.hide() + self._lock.release() @pyqtSlot() def onOkButtonClicked(self): From f10397acf98d640e70e7a3e7e7522644571d05d1 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 9 Oct 2017 12:38:16 +0200 Subject: [PATCH 03/19] Always set finish flag when finalizing post_reply CURA-4398 --- plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index 58b62217f0..af2e1f8c00 100755 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -527,12 +527,12 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): self._last_request_time = time() def _finalizePostReply(self): - if self._post_reply is None: - return - # Indicate uploading was finished (so another file can be send) self._write_finished = True + if self._post_reply is None: + return + try: try: self._post_reply.uploadProgress.disconnect(self._onUploadProgress) From 7d8fa71c4cad749de1437a825a62466bfb4df687 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 9 Oct 2017 13:04:55 +0200 Subject: [PATCH 04/19] Exclude other UM2 machine during quality profile upgrade CURA-4420 --- .../VersionUpgrade27to30.py | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/plugins/VersionUpgrade/VersionUpgrade27to30/VersionUpgrade27to30.py b/plugins/VersionUpgrade/VersionUpgrade27to30/VersionUpgrade27to30.py index 3b1b854761..d0b78168b4 100644 --- a/plugins/VersionUpgrade/VersionUpgrade27to30/VersionUpgrade27to30.py +++ b/plugins/VersionUpgrade/VersionUpgrade27to30/VersionUpgrade27to30.py @@ -117,8 +117,25 @@ class VersionUpgrade27to30(VersionUpgrade): # Set the definition to "ultimaker2" for Ultimaker 2 quality changes if not parser.has_section("general"): parser.add_section("general") - if os.path.basename(filename).startswith("ultimaker2_"): - parser["general"]["definition"] = "ultimaker2" + + # Need to exclude the following names: + # - ultimaker2_plus + # - ultimaker2_go + # - ultimaker2_extended + # - ultimaker2_extended_plus + exclude_prefix_list = ["ultimaker2_plus_", + "ultimaker2_go_", + "ultimaker2_extended_", + "ultimaker2_extended_plus_"] + file_base_name = os.path.basename(filename) + if file_base_name.startswith("ultimaker2_"): + skip_this = False + for exclude_prefix in exclude_prefix_list: + if file_base_name.startswith(exclude_prefix): + skip_this = True + break + if not skip_this: + parser["general"]["definition"] = "ultimaker2" # Update version numbers parser["general"]["version"] = "2" From 2b06d04327c4a0b7ed27bb687c442ba3bfda8b58 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 9 Oct 2017 13:54:15 +0200 Subject: [PATCH 05/19] Fix container indices in upgrade script from 2.5 to 2.6 --- .../VersionUpgrade25to26/VersionUpgrade25to26.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/VersionUpgrade/VersionUpgrade25to26/VersionUpgrade25to26.py b/plugins/VersionUpgrade/VersionUpgrade25to26/VersionUpgrade25to26.py index 2c598ad766..e1c14be2e1 100644 --- a/plugins/VersionUpgrade/VersionUpgrade25to26/VersionUpgrade25to26.py +++ b/plugins/VersionUpgrade/VersionUpgrade25to26/VersionUpgrade25to26.py @@ -127,7 +127,12 @@ class VersionUpgrade25to26(VersionUpgrade): machine_id = parser["general"]["id"] quality_container_id = parser["containers"]["2"] material_container_id = parser["containers"]["3"] - definition_container_id = parser["containers"]["6"] + + # we don't have definition_changes container in 2.5 + if "6" in parser["containers"]: + definition_container_id = parser["containers"]["6"] + else: + definition_container_id = parser["containers"]["5"] if definition_container_id == "custom" and not self._checkCustomFdmPrinterHasExtruderStack(machine_id): # go through all extruders and make sure that this custom FDM printer has 8 extruder stacks. From 97c107d011aac0d839fa6886a91d0e0e50e64341 Mon Sep 17 00:00:00 2001 From: "A.Sasin" Date: Mon, 9 Oct 2017 14:23:52 +0200 Subject: [PATCH 06/19] Change log update for version 3.0.0 Beta --- plugins/ChangeLogPlugin/ChangeLog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/ChangeLogPlugin/ChangeLog.txt b/plugins/ChangeLogPlugin/ChangeLog.txt index 207493468e..57e6e05d9c 100755 --- a/plugins/ChangeLogPlugin/ChangeLog.txt +++ b/plugins/ChangeLogPlugin/ChangeLog.txt @@ -1,3 +1,6 @@ +[3.0.0] +*Will be updated soon! + [2.7.0] *Top surface skin Specify print settings of the top-most layers separately in order to improve print duration and achieve higher quality top surfaces. From 1c5d352b8819f6598d3bae2b2e4a68d3c01f0f43 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 9 Oct 2017 14:34:53 +0200 Subject: [PATCH 07/19] Fix the case when active_extruder is None --- cura/Settings/QualityAndUserProfilesModel.py | 3 +++ cura/Settings/UserProfilesModel.py | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cura/Settings/QualityAndUserProfilesModel.py b/cura/Settings/QualityAndUserProfilesModel.py index f2728aff14..602f8768da 100644 --- a/cura/Settings/QualityAndUserProfilesModel.py +++ b/cura/Settings/QualityAndUserProfilesModel.py @@ -41,6 +41,9 @@ class QualityAndUserProfilesModel(ProfilesModel): new_extruder_stacks = [] if active_extruder is not None: new_extruder_stacks = [active_extruder] + else: + # if there is no active extruder, use the first one in the active extruder stacks + active_extruder = extruder_stacks[0] extruder_stacks = new_extruder_stacks + extruder_stacks # Fetch the list of useable qualities across all extruders. diff --git a/cura/Settings/UserProfilesModel.py b/cura/Settings/UserProfilesModel.py index 587e27f359..aa815ef4aa 100644 --- a/cura/Settings/UserProfilesModel.py +++ b/cura/Settings/UserProfilesModel.py @@ -41,6 +41,9 @@ class UserProfilesModel(ProfilesModel): new_extruder_stacks = [] if active_extruder is not None: new_extruder_stacks = [active_extruder] + else: + # if there is no active extruder, use the first one in the active extruder stacks + active_extruder = extruder_stacks[0] extruder_stacks = new_extruder_stacks + extruder_stacks # Fetch the list of useable qualities across all extruders. @@ -55,8 +58,8 @@ class UserProfilesModel(ProfilesModel): # If the printer has multiple extruders then quality changes related to the current extruder are kept filtered_quality_changes = [qc for qc in quality_changes_list if qc.getMetaDataEntry("quality_type") in quality_type_set and qc.getMetaDataEntry("extruder") is not None and - qc.getMetaDataEntry("extruder") == active_extruder.definition.getMetaDataEntry("quality_definition") or - qc.getMetaDataEntry("extruder") == active_extruder.definition.getId()] + (qc.getMetaDataEntry("extruder") == active_extruder.definition.getMetaDataEntry("quality_definition") or + qc.getMetaDataEntry("extruder") == active_extruder.definition.getId())] else: # If not, the quality changes of the global stack are selected filtered_quality_changes = [qc for qc in quality_changes_list if qc.getMetaDataEntry("quality_type") in quality_type_set and From cbd0bcd1b572dd9d9eb80c2ad918a5c132fd0106 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Mon, 9 Oct 2017 14:49:18 +0200 Subject: [PATCH 08/19] Manually trigger upload finished callback after request finished - CURA-4398 --- plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index af2e1f8c00..12c68079b0 100755 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -23,10 +23,8 @@ from PyQt5.QtWidgets import QMessageBox import json import os import gzip -import zlib from time import time -from time import sleep i18n_catalog = i18nCatalog("cura") @@ -1179,6 +1177,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): # Remove cached post request items. del self._material_post_objects[id(reply)] elif "print_job" in reply_url: + self._onUploadFinished() # Make sure the upload flag is reset as reply.finished is not always triggered try: reply.uploadProgress.disconnect(self._onUploadProgress) except: From 8a25605413cd5b2d07d23a67d1ceadfbc7818050 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 9 Oct 2017 15:04:27 +0200 Subject: [PATCH 09/19] Fix lock issue with workspace dialog CURA-4405 - Add try-except around lock release - Fix closing the dialog with ESC --- plugins/3MFReader/WorkspaceDialog.py | 19 ++++++++++++++++--- plugins/3MFReader/WorkspaceDialog.qml | 10 +++++++++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/plugins/3MFReader/WorkspaceDialog.py b/plugins/3MFReader/WorkspaceDialog.py index 7c803486eb..5e5eaf985e 100644 --- a/plugins/3MFReader/WorkspaceDialog.py +++ b/plugins/3MFReader/WorkspaceDialog.py @@ -272,12 +272,26 @@ class WorkspaceDialog(QObject): def notifyClosed(self): self._result = {} # The result should be cleared before hide, because after it is released the main thread lock self._visible = False - self._lock.release() + try: + self._lock.release() + except: + pass def hide(self): self._visible = False self._view.hide() - self._lock.release() + try: + self._lock.release() + except: + pass + + @pyqtSlot(bool) + def _onVisibilityChanged(self, visible): + if not visible: + try: + self._lock.release() + except: + pass @pyqtSlot() def onOkButtonClicked(self): @@ -290,7 +304,6 @@ class WorkspaceDialog(QObject): self._view.hide() self.hide() - ## Block thread until the dialog is closed. def waitForClose(self): if self._visible: diff --git a/plugins/3MFReader/WorkspaceDialog.qml b/plugins/3MFReader/WorkspaceDialog.qml index e9ef14dfa5..a633491248 100644 --- a/plugins/3MFReader/WorkspaceDialog.qml +++ b/plugins/3MFReader/WorkspaceDialog.qml @@ -10,6 +10,7 @@ import UM 1.1 as UM UM.Dialog { + id: base title: catalog.i18nc("@title:window", "Open Project") minimumWidth: 500 * screenScaleFactor @@ -30,6 +31,7 @@ UM.Dialog materialResolveComboBox.currentIndex = 0 } } + Item { anchors.fill: parent @@ -377,7 +379,7 @@ UM.Dialog anchors.right: ok_button.left anchors.rightMargin: 2 * screenScaleFactor } - Button + Button { id: ok_button text: catalog.i18nc("@action:button","Open"); @@ -386,4 +388,10 @@ UM.Dialog anchors.right: parent.right } } + + function reject() { + manager.onCancelButtonClicked(); + base.visible = false; + base.rejected(); + } } From f8a1187a8c8d36e166cd12d1af255784740bdc57 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Mon, 9 Oct 2017 16:14:02 +0200 Subject: [PATCH 10/19] Re-sending after cancelling print job now really works - CURA-4398 --- plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index 12c68079b0..b88feb6095 100755 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -836,6 +836,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): Logger.log("d", "User aborted sending print to remote.") self._progress_message.hide() self._compressing_print = False + self._write_finished = True # post_reply does not always exist, so make sure we unblock writing if self._post_reply: self._finalizePostReply() Application.getInstance().showPrintMonitor.emit(False) From 1d70426224deb0fe8c03837afe928c43568de2d0 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 9 Oct 2017 16:36:48 +0200 Subject: [PATCH 11/19] onVisibilityChanged function removed because it's never called - CURA-4405 --- plugins/3MFReader/WorkspaceDialog.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/plugins/3MFReader/WorkspaceDialog.py b/plugins/3MFReader/WorkspaceDialog.py index 5e5eaf985e..349dec177b 100644 --- a/plugins/3MFReader/WorkspaceDialog.py +++ b/plugins/3MFReader/WorkspaceDialog.py @@ -285,14 +285,6 @@ class WorkspaceDialog(QObject): except: pass - @pyqtSlot(bool) - def _onVisibilityChanged(self, visible): - if not visible: - try: - self._lock.release() - except: - pass - @pyqtSlot() def onOkButtonClicked(self): self._view.hide() From 019121521589908fc5328f19003704e71f25d680 Mon Sep 17 00:00:00 2001 From: Simon Edwards Date: Mon, 9 Oct 2017 15:27:01 +0200 Subject: [PATCH 12/19] Let the printer state text wrap too CL-521 --- plugins/UM3NetworkPrinting/PrinterInfoBlock.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/UM3NetworkPrinting/PrinterInfoBlock.qml b/plugins/UM3NetworkPrinting/PrinterInfoBlock.qml index da5ebc7e37..e2c6473da7 100644 --- a/plugins/UM3NetworkPrinting/PrinterInfoBlock.qml +++ b/plugins/UM3NetworkPrinting/PrinterInfoBlock.qml @@ -404,6 +404,8 @@ Rectangle anchors.left: parent.left anchors.right: parent.right elide: Text.ElideRight + wrapMode: Text.Wrap + font: UM.Theme.getFont("default") } From ebb8437bff60bfc00cbeba771fc14c2be6524234 Mon Sep 17 00:00:00 2001 From: Simon Edwards Date: Mon, 9 Oct 2017 15:41:18 +0200 Subject: [PATCH 13/19] Avoid using fractional pixel sizes and positions. It causes poor text rendering on Windows (and may be others) --- plugins/UM3NetworkPrinting/PrinterInfoBlock.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/PrinterInfoBlock.qml b/plugins/UM3NetworkPrinting/PrinterInfoBlock.qml index e2c6473da7..25be77bd7d 100644 --- a/plugins/UM3NetworkPrinting/PrinterInfoBlock.qml +++ b/plugins/UM3NetworkPrinting/PrinterInfoBlock.qml @@ -189,7 +189,7 @@ Rectangle PrintCoreConfiguration { id: leftExtruderInfo - width: (parent.width - extruderSeperator.width) / 2 + width: Math.floor((parent.width - extruderSeperator.width) / 2) printCoreConfiguration: printer.configuration[0] } @@ -204,7 +204,7 @@ Rectangle PrintCoreConfiguration { id: rightExtruderInfo - width: (parent.width - extruderSeperator.width) / 2 + width: Math.floor((parent.width - extruderSeperator.width) / 2) printCoreConfiguration: printer.configuration[1] } } From 7b6faf0030d9455f772c364ce4c9f16ae0bf1e21 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 10 Oct 2017 08:03:08 +0200 Subject: [PATCH 14/19] Adjust column width for Materials "Print Settings" page CURA-4428 --- resources/qml/Preferences/MaterialView.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Preferences/MaterialView.qml b/resources/qml/Preferences/MaterialView.qml index c1750b2342..b13ce1aadf 100644 --- a/resources/qml/Preferences/MaterialView.qml +++ b/resources/qml/Preferences/MaterialView.qml @@ -16,8 +16,8 @@ TabView property bool editingEnabled: false; property string currency: UM.Preferences.getValue("cura/currency") ? UM.Preferences.getValue("cura/currency") : "€" - property real firstColumnWidth: (width * 0.45) | 0 - property real secondColumnWidth: (width * 0.45) | 0 + property real firstColumnWidth: (width * 0.50) | 0 + property real secondColumnWidth: (width * 0.40) | 0 property string containerId: "" property var materialPreferenceValues: UM.Preferences.getValue("cura/material_settings") ? JSON.parse(UM.Preferences.getValue("cura/material_settings")) : {} From 7ca2ae9771d76b40587ba8a414debcb1dd89300d Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 10 Oct 2017 08:20:39 +0200 Subject: [PATCH 15/19] Adjust alignments for ComboBoxes in MachineSettings dialog CURA-4428 --- plugins/MachineSettingsAction/MachineSettingsAction.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/MachineSettingsAction/MachineSettingsAction.qml b/plugins/MachineSettingsAction/MachineSettingsAction.qml index 613a28f3b7..cd7738da11 100644 --- a/plugins/MachineSettingsAction/MachineSettingsAction.qml +++ b/plugins/MachineSettingsAction/MachineSettingsAction.qml @@ -247,7 +247,7 @@ Cura.MachineAction Row { - spacing: UM.Theme.getSize("default_margin").width + spacing: UM.Theme.getSize("default_margin").width * 4 / 5 Label { @@ -648,7 +648,7 @@ Cura.MachineAction Row { - spacing: UM.Theme.getSize("default_margin").width + spacing: UM.Theme.getSize("default_margin").width * 4 / 5 Label { From 60726ce1793ae9dd3736912e59f627dc12153903 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 10 Oct 2017 08:24:47 +0200 Subject: [PATCH 16/19] Increase minimumHeight of the Print Address dialog CURA-4428 --- plugins/UM3NetworkPrinting/DiscoverUM3Action.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml b/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml index b9b85ef2d4..7594d1691d 100644 --- a/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml +++ b/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml @@ -321,7 +321,7 @@ Cura.MachineAction title: catalog.i18nc("@title:window", "Printer Address") minimumWidth: 400 * screenScaleFactor - minimumHeight: 120 * screenScaleFactor + minimumHeight: 130 * screenScaleFactor width: minimumWidth height: minimumHeight From b14ef41056777636911cc907d082862eaf6eee36 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 10 Oct 2017 08:30:18 +0200 Subject: [PATCH 17/19] Increase the minimumHeight of the workspace summary dialog CURA-4428 --- plugins/3MFReader/WorkspaceDialog.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/3MFReader/WorkspaceDialog.qml b/plugins/3MFReader/WorkspaceDialog.qml index a633491248..b1ece2be96 100644 --- a/plugins/3MFReader/WorkspaceDialog.qml +++ b/plugins/3MFReader/WorkspaceDialog.qml @@ -14,7 +14,7 @@ UM.Dialog title: catalog.i18nc("@title:window", "Open Project") minimumWidth: 500 * screenScaleFactor - minimumHeight: 400 * screenScaleFactor + minimumHeight: 450 * screenScaleFactor width: minimumWidth height: minimumHeight From 9996c829d88684b8a15a5a120a485d795e966d02 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 10 Oct 2017 08:50:22 +0200 Subject: [PATCH 18/19] Only schedule re-slice when there is none in progress CURA-4427 After the stack error check is done, only schedule a re-slice when there is none in progress and a re-slice is needed. --- plugins/CuraEngineBackend/CuraEngineBackend.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index c89f476fa9..914aa1dee0 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -441,7 +441,7 @@ class CuraEngineBackend(QObject, Backend): def _onStackErrorCheckFinished(self): self._is_error_check_scheduled = False - if self._need_slicing: + if not self._slicing and self._need_slicing: self.needsSlicing() self._onChanged() @@ -536,7 +536,6 @@ class CuraEngineBackend(QObject, Backend): # # \param message The protobuf message containing the print time per feature def _parseMessagePrintTimes(self, message): - result = { "inset_0": message.time_inset_0, "inset_x": message.time_inset_x, From 99d9961297923cca6e49523f96015076bc41afe5 Mon Sep 17 00:00:00 2001 From: "A.Sasin" Date: Tue, 10 Oct 2017 09:16:35 +0200 Subject: [PATCH 19/19] Cura crashed because of RuntimeError after switching between monitor and prepare view CURA-4376 --- .../UM3NetworkPrinting/NetworkPrinterOutputDevice.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index af2e1f8c00..0b607c25f5 100755 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -334,13 +334,17 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): self._camera_timer.stop() if self._image_reply: + skip_abort = False try: try: self._image_reply.downloadProgress.disconnect(self._onStreamDownloadProgress) - except TypeError: - pass #The signal was never connected. - self._image_reply.abort() - except RuntimeError: + except Exception as e: + if type(e) != RuntimeError: # can happen the RuntimeError occurs before calling abort (=see below), then then the application will crash + skip_abort = True + pass #The signal was never connected. + if not skip_abort: + self._image_reply.abort() + except Exception as e: #RuntimeError pass # It can happen that the wrapped c++ object is already deleted. self._image_reply = None self._image_request = None