chiark / gitweb /
Fix the exception when there is no engine result and one opens the layer view.
authordaid <daid303@gmail.com>
Thu, 6 Feb 2014 13:37:07 +0000 (14:37 +0100)
committerdaid <daid303@gmail.com>
Thu, 6 Feb 2014 13:37:07 +0000 (14:37 +0100)
Cura/gui/tools/youmagineGui.py
Cura/gui/util/engineResultView.py
Cura/gui/util/openglGui.py

index b6304850e871af8bb6f8e8b2435bb65d6b7f882b..fd36e5d74406d10eea98ee150c43b63de4306e57 100644 (file)
@@ -88,6 +88,7 @@ class youmagineManager(object):
                                if self._getAuthorizationWindow.abort:
                                        wx.CallAfter(self._getAuthorizationWindow.Destroy)
                                        return
+                               #TODO: Bug, this should not be called from a python thread but a wx.Timer (wx.TheClipboard does not function from threads on Linux)
                                clipboard = getClipboardText()
                                if len(clipboard) == 20:
                                        if clipboard != lastTriedClipboard and re.match('[a-zA-Z0-9]*', clipboard):
index 9fa2ff2685ef16e805792363dded8d0a2bccc42f..67ceb53dfa1c965cd3c63caeb074a9d20c8586b0 100644 (file)
@@ -71,7 +71,7 @@ class engineResultView(object):
                glLineWidth(2)
 
                layerNr = self.layerSelect.getValue()
-               if layerNr == self.layerSelect.getMaxValue():
+               if layerNr == self.layerSelect.getMaxValue() and result is not None:
                        layerNr = max(layerNr, len(result._polygons))
                viewZ = (layerNr - 1) * profile.getProfileSettingFloat('layer_height') + profile.getProfileSettingFloat('bottom_thickness')
                self._parent._viewTarget[2] = viewZ
index 62588dcce40765471ec3e63b638995bfdd92811e..dbba4a8aaabbd0f95296cf1d92211e9fc1d2a856 100644 (file)
@@ -237,6 +237,8 @@ class glGuiPanel(glcanvas.GLCanvas):
                                openglHelpers.glDrawStringLeft("fps:%d" % (1 / renderTime))
                        self.SwapBuffers()
                except:
+                       # When an exception happens, catch it and show a message box. If the exception is not caught the draw function bugs out.
+                       # Only show this exception once so we do not overload the user with popups.
                        errStr = _("An error has occurred during the 3D view drawing.")
                        tb = traceback.extract_tb(sys.exc_info()[2])
                        errStr += "\n%s: '%s'" % (str(sys.exc_info()[0].__name__), str(sys.exc_info()[1]))