Author: bugman Date: Mon Apr 16 15:13:23 2012 New Revision: 15724 URL: http://svn.gna.org/viewcvs/relax?rev=15724&view=rev Log: Modified the spin loading wizard so that preloaded structures are the default. Modified: 1.3/gui/spin_viewer/frame.py Modified: 1.3/gui/spin_viewer/frame.py URL: http://svn.gna.org/viewcvs/relax/1.3/gui/spin_viewer/frame.py?rev=15724&r1=15723&r2=15724&view=diff ============================================================================== --- 1.3/gui/spin_viewer/frame.py (original) +++ 1.3/gui/spin_viewer/frame.py Mon Apr 16 15:13:23 2012 @@ -459,24 +459,6 @@ sizer_radio = wx.BoxSizer(wx.VERTICAL) sizer2.Add(sizer_radio, 1, wx.ALL|wx.EXPAND, 0) - # The sequence radio button. - self.radio_seq = wx.RadioButton(self, -1, "From a file containing sequence data.", style=wx.RB_GROUP) - sizer_radio.Add(self.radio_seq, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 0) - - # Spacing. - sizer_radio.AddSpacer(20) - - # The PDB radio button. - self.radio_new_pdb = wx.RadioButton(self, -1, "From a new PDB structure file.") - sizer_radio.Add(self.radio_new_pdb, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 0) - - # Spacing. - sizer_radio.AddSpacer(20) - - # The XYZ radio button. - self.radio_new_xyz = wx.RadioButton(self, -1, "From a new XYZ structure file.") - sizer_radio.Add(self.radio_new_xyz, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 0) - # Pre-loaded structure exists. self.preload_flag = False if hasattr(cdp, 'structure') and not cdp.structure.empty(): @@ -484,12 +466,34 @@ # The pre-load radio button. if self.preload_flag: + # The button. + self.radio_preload = wx.RadioButton(self, -1, "From a pre-loaded structure.", style=wx.RB_GROUP) + sizer_radio.Add(self.radio_preload, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 0) + # Spacing. sizer_radio.AddSpacer(20) - # The button. - self.radio_preload = wx.RadioButton(self, -1, "From an already loaded structure file(s).") - sizer_radio.Add(self.radio_preload, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 0) + # The sequence radio button. + if self.preload_flag: + style = 0 + else: + style = wx.RB_GROUP + self.radio_seq = wx.RadioButton(self, -1, "From a file containing sequence data.", style=style) + sizer_radio.Add(self.radio_seq, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 0) + + # Spacing. + sizer_radio.AddSpacer(20) + + # The PDB radio button. + self.radio_new_pdb = wx.RadioButton(self, -1, "From a new PDB structure file.") + sizer_radio.Add(self.radio_new_pdb, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 0) + + # Spacing. + sizer_radio.AddSpacer(20) + + # The XYZ radio button. + self.radio_new_xyz = wx.RadioButton(self, -1, "From a new XYZ structure file.") + sizer_radio.Add(self.radio_new_xyz, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 0) # Bind the buttons. self.Bind(wx.EVT_RADIOBUTTON, self._on_select, self.radio_seq) @@ -505,7 +509,10 @@ sizer.AddStretchSpacer() # Set the default selection. - self.selection = 'sequence' + if self.preload_flag: + self.selection = 'preload' + else: + self.selection = 'sequence' def _on_select(self, event):