From c3833c2ff8e8f8e580c85cb8ec9a73524ca24594 Mon Sep 17 00:00:00 2001 From: digitalfrost Date: Thu, 18 Aug 2022 12:22:07 +0200 Subject: [PATCH] ArrangeObjectsJob.py: Refactor run method arrange from Nest2DArrange will return a boolean so we can simplify --- cura/Arranging/ArrangeObjectsJob.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cura/Arranging/ArrangeObjectsJob.py b/cura/Arranging/ArrangeObjectsJob.py index e65a442acb..d1370d46e1 100644 --- a/cura/Arranging/ArrangeObjectsJob.py +++ b/cura/Arranging/ArrangeObjectsJob.py @@ -28,18 +28,20 @@ class ArrangeObjectsJob(Job): title = i18n_catalog.i18nc("@info:title", "Finding Location")) status_message.show() - found_solution_for_all = None try: found_solution_for_all = arrange(self._nodes, Application.getInstance().getBuildVolume(), self._fixed_nodes) except: # If the thread crashes, the message should still close + found_solution_for_all = False Logger.logException("e", "Unable to arrange the objects on the buildplate. The arrange algorithm has crashed.") status_message.hide() - if found_solution_for_all is not None and not found_solution_for_all: + + if not found_solution_for_all: no_full_solution_message = Message( i18n_catalog.i18nc("@info:status", "Unable to find a location within the build volume for all objects"), title = i18n_catalog.i18nc("@info:title", "Can't Find Location"), message_type = Message.MessageType.ERROR) no_full_solution_message.show() + self.finished.emit(self)