In project loading dialog the CANCLE button did not work

CURA-4345
This commit is contained in:
alekseisasin 2017-09-25 14:32:02 +02:00
parent 4ddfb81897
commit d7ed8244ae

View file

@ -235,7 +235,7 @@ class WorkspaceDialog(QObject):
self._result["definition_changes"] = None
# If the machine needs to be re-created, the definition_changes should also be re-created.
if self._result["machine"] == "new" and self._result["definition_changes"] is None:
if "machine" in self._result and self._result["machine"] == "new" and self._result["definition_changes"] is None:
self._result["definition_changes"] = "new"
if "material" in self._result and not self._has_material_conflict:
@ -267,7 +267,7 @@ class WorkspaceDialog(QObject):
@pyqtSlot()
## Used to notify the dialog so the lock can be released.
def notifyClosed(self):
self._result = {}
self._result = {} # The result should be cleared before hide, because after it is released the main thread lock
self._visible = False
self._lock.release()
@ -283,9 +283,10 @@ class WorkspaceDialog(QObject):
@pyqtSlot()
def onCancelButtonClicked(self):
self._result = {}
self._view.hide()
self.hide()
self._result = {}
## Block thread until the dialog is closed.
def waitForClose(self):