mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Fix lock issue with workspace dialog
CURA-4405 - Add try-except around lock release - Fix closing the dialog with ESC
This commit is contained in:
parent
f8122320d4
commit
8a25605413
2 changed files with 25 additions and 4 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue