chiark / gitweb /
Fix wxpython 2.8 bug for quickprint selection
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Mon, 14 Sep 2015 16:49:49 +0000 (12:49 -0400)
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Mon, 14 Sep 2015 16:49:49 +0000 (12:49 -0400)
Cura/gui/simpleMode.py

index ccd31691a724e247ddaa917675810838e65fa5fb..0924322f5a4fb5b7c6ca4bb7fd4c919061d5c4c7 100644 (file)
@@ -223,6 +223,14 @@ class simpleModePanel(wx.Panel):
 
                        selection = self.materialCombo.GetSelection()
 
+                       # This is needed to avoid a wxpython 2.8 bug which returns -1
+                       # when the selection is made with SetValue
+                       if selection == -1:
+                               material_name = self.materialCombo.GetValue()
+                               for material in materials:
+                                       if material.name == material_name:
+                                               return material
+
                        return materials[selection]
                else:
                        for button in self._print_material_options: