chiark / gitweb /
Save the material type so the right value is restored when opening cura
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Fri, 23 Oct 2015 16:25:36 +0000 (12:25 -0400)
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Fri, 23 Oct 2015 16:26:25 +0000 (12:26 -0400)
Fixes T289

Cura/gui/simpleMode.py

index 0924322f5a4fb5b7c6ca4bb7fd4c919061d5c4c7..130aff05c3224c8494033fe72168f4fbf7caf6fb 100644 (file)
@@ -78,7 +78,10 @@ class simpleModePanel(wx.Panel):
                                        selectedMaterialType = material_type
 
                        if selectedMaterialType is None:
-                               if selectedMaterial is None or len(selectedMaterial.types) == 0:
+                               if profile.getProfileSetting('simpleModeMaterialType') == _("Others") or \
+                                  profile.getProfileSetting('simpleModeMaterialType') == _("All"):
+                                       selectedMaterialType = profile.getProfileSetting('simpleModeMaterialType')
+                               elif selectedMaterial is None or len(selectedMaterial.types) == 0:
                                        selectedMaterialType = _("Others")
                                else:
                                        selectedMaterialType = selectedMaterial.types[0]
@@ -352,6 +355,9 @@ class simpleModePanel(wx.Panel):
                        self._update(e)
 
        def _update(self, e):
+               if self.materialTypeCombo:
+                       materialType = self.materialTypeCombo.GetValue()
+                       profile.putProfileSetting('simpleModeMaterialType', materialType)
                material = self._getSelectedMaterial()
                if material:
                        profile.putProfileSetting('simpleModeMaterial', material.name)