From: Youness Alaoui Date: Wed, 3 Jun 2015 21:06:36 +0000 (-0400) Subject: Fix a possible issue if no materials or no profiles exist X-Git-Tag: lulzbot-15.02.1-2.01~55^2~10 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=2f3948f466f70f73ef9e6e7b32b62eeb699d509c;p=cura.git Fix a possible issue if no materials or no profiles exist --- diff --git a/Cura/gui/simpleMode.py b/Cura/gui/simpleMode.py index c52fa934..32cfe3b8 100644 --- a/Cura/gui/simpleMode.py +++ b/Cura/gui/simpleMode.py @@ -39,12 +39,13 @@ class simpleModePanel(wx.Panel): selectedMaterial = button break - if selectedMaterial is None and self._print_material_options > 0: + if selectedMaterial is None and len(self._print_material_options) > 0: selectedMaterial = self._print_material_options[0] # Decide to show the panel or not if len(self._print_material_options) < 2: - self.printMaterialPanel.Show(self._print_material_options[0].profile.always_visible) + self.printMaterialPanel.Show(len(self._print_material_options) > 1 and \ + self._print_material_options[0].profile.always_visible) self.printTypePanel = wx.Panel(self) @@ -112,12 +113,13 @@ class simpleModePanel(wx.Panel): selectedProfile = button break - if selectedProfile is None and self._print_profile_options > 0: + if selectedProfile is None and len(self._print_profile_options) > 0: selectedProfile = self._print_profile_options[0] # Decide if we show the profile panel or not if len(self._print_profile_options) < 2: - self.printProfilePanel.Show(self._print_profile_options[0].profile.always_visible) + self.printTypePanel.Show(len(self._print_profile_options) > 0 and \ + self._print_profile_options[0].profile.always_visible) if selectedProfile: selectedProfile.SetValue(True)