Author: bugman Date: Mon Sep 19 18:42:30 2011 New Revision: 14698 URL: http://svn.gna.org/viewcvs/relax?rev=14698&view=rev Log: Fixes for the residue.create and spin.create user function GUI pages on MS Windows. The default values are now correctly set. This affects the pop up menu in the tree part of the spin viewer window. Modified: 1.3/gui/user_functions/residue.py 1.3/gui/user_functions/spin.py Modified: 1.3/gui/user_functions/residue.py URL: http://svn.gna.org/viewcvs/relax/1.3/gui/user_functions/residue.py?rev=14698&r1=14697&r2=14698&view=diff ============================================================================== --- 1.3/gui/user_functions/residue.py (original) +++ 1.3/gui/user_functions/residue.py Mon Sep 19 18:42:30 2011 @@ -59,9 +59,8 @@ # Initialise the wizard. wizard, page = self.create_wizard(size_x=700, size_y=500, name='residue.create', uf_page=Create_page, return_page=True) - # Default molecule name. - if mol_name: - page.mol_name.SetValue(str_to_gui(mol_name)) + # Store the defaults. + page.defaults['mol_name'] = str_to_gui(mol_name) # Execute the wizard. wizard.run() @@ -257,6 +256,10 @@ for mol in molecule_loop(): self.mol_name.Append(str_to_gui(mol.name)) + # The default molecule. + if self.defaults.has_key('mol_name') and self.defaults['mol_name']: + self.mol_name.SetStringSelection(self.defaults['mol_name']) + def on_execute(self): """Execute the user function.""" Modified: 1.3/gui/user_functions/spin.py URL: http://svn.gna.org/viewcvs/relax/1.3/gui/user_functions/spin.py?rev=14698&r1=14697&r2=14698&view=diff ============================================================================== --- 1.3/gui/user_functions/spin.py (original) +++ 1.3/gui/user_functions/spin.py Mon Sep 19 18:42:30 2011 @@ -63,13 +63,9 @@ # Create the wizard. wizard, page = self.create_wizard(size_x=600, size_y=400, name='spin.create', uf_page=Create_page, return_page=True) - # Default molecule name. - if mol_name: - page.mol.SetValue(str_to_gui(mol_name)) - - # Default residue. - if res_num or res_name: - page.res.SetValue(str_to_gui("%s %s" % (res_num, res_name))) + # Store the defaults. + page.defaults['mol'] = str_to_gui(mol_name) + page.defaults['res'] = str_to_gui("%s %s" % (res_num, res_name)) # Execute the wizard. wizard.run() @@ -345,6 +341,17 @@ for mol in molecule_loop(): self.mol.Append(str_to_gui(mol.name)) + # The default molecule. + if self.defaults.has_key('mol') and self.defaults['mol']: + self.mol.SetStringSelection(self.defaults['mol']) + + # Update the residue list. + self._update_residues(None) + + # The default residue. + if self.defaults.has_key('res') and self.defaults['res']: + self.res.SetStringSelection(self.defaults['res']) + def on_execute(self): """Execute the user function."""