Revert "Small fix for slice before main window visible."

This reverts commit 35d6aad6cd.
This is causing a very weird crash when autoslice is enabled:
2021-01-28 12:12:35,379 - CRITICAL - [MainThread] cura.CrashHandler.__init__ [66]: An uncaught error has occurred!
2021-01-28 12:12:35,379 - CRITICAL - [MainThread] cura.CrashHandler.__init__ [69]: Traceback (most recent call last):
2021-01-28 12:12:35,379 - CRITICAL - [MainThread] cura.CrashHandler.__init__ [69]:   File "/home/trin/Gedeeld/Projects/Cura/plugins/CuraEngineBackend/CuraEngineBackend.py", line 270, in slice
2021-01-28 12:12:35,380 - CRITICAL - [MainThread] cura.CrashHandler.__init__ [69]:     self._createSnapshot()
2021-01-28 12:12:35,380 - CRITICAL - [MainThread] cura.CrashHandler.__init__ [69]:   File "/home/trin/Gedeeld/Projects/Cura/cura/Utils/Threading.py", line 31, in _call_on_qt_thread_wrapper
2021-01-28 12:12:35,380 - CRITICAL - [MainThread] cura.CrashHandler.__init__ [69]:     return func(*args, **kwargs)
2021-01-28 12:12:35,380 - CRITICAL - [MainThread] cura.CrashHandler.__init__ [69]:   File "/home/trin/Gedeeld/Projects/Cura/plugins/CuraEngineBackend/CuraEngineBackend.py", line 254, in _createSnapshot
2021-01-28 12:12:35,380 - CRITICAL - [MainThread] cura.CrashHandler.__init__ [69]:     if not CuraApplication.getInstance().isVisible:
2021-01-28 12:12:35,380 - CRITICAL - [MainThread] cura.CrashHandler.__init__ [69]: AttributeError: 'CuraApplication' object has no attribute 'isVisible'

The property exists all right. It's in the dir() of the CuraApplication instance. PyCharm's debug mode also gives a traceback when trying to evaluate the property. It clearly thinks it's there, but then it's not or something. Very weird. We need to take a better look at this than this quick fix.
This commit is contained in:
Ghostkeeper 2021-01-28 12:23:01 +01:00
parent 678516186e
commit a9bf3ed934
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -250,9 +250,6 @@ class CuraEngineBackend(QObject, Backend):
@call_on_qt_thread # must be called from the main thread because of OpenGL @call_on_qt_thread # must be called from the main thread because of OpenGL
def _createSnapshot(self) -> None: def _createSnapshot(self) -> None:
self._snapshot = None self._snapshot = None
if not CuraApplication.getInstance().isVisible():
Logger.log("w", "Attempt to create snapshot before complete initialization.")
return
Logger.log("i", "Creating thumbnail image (just before slice)...") Logger.log("i", "Creating thumbnail image (just before slice)...")
try: try:
self._snapshot = Snapshot.snapshot(width = 300, height = 300) self._snapshot = Snapshot.snapshot(width = 300, height = 300)