Author: bugman Date: Wed Aug 10 15:03:41 2011 New Revision: 14315 URL: http://svn.gna.org/viewcvs/relax?rev=14315&view=rev Log: The pipe.create user function page is now using PIPE_DESC to present a list of pipe types for the user. This gives the descriptive name of the data pipe type rather than the keyword argument values. Modified: branches/gui_testing/gui/user_functions/pipe.py Modified: branches/gui_testing/gui/user_functions/pipe.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/user_functions/pipe.py?rev=14315&r1=14314&r2=14315&view=diff ============================================================================== --- branches/gui_testing/gui/user_functions/pipe.py (original) +++ branches/gui_testing/gui/user_functions/pipe.py Wed Aug 10 15:03:41 2011 @@ -27,7 +27,7 @@ import wx # relax module imports. -from generic_fns.pipes import VALID_TYPES, cdp_name, pipe_names +from generic_fns.pipes import PIPE_DESC, VALID_TYPES, cdp_name, pipe_names # GUI module imports. from base import UF_base, UF_page @@ -177,15 +177,18 @@ self.pipe_name = self.input_field(sizer, "The data pipe name:", tooltip=self.uf._doc_args_dict['pipe_name']) # The type selection. - self.pipe_type = self.combo_box(sizer, "The type of data pipe:", VALID_TYPES, tooltip=self.uf._doc_args_dict['pipe_type']) + self.pipe_type = self.combo_box(sizer, "The type of data pipe:", tooltip=self.uf._doc_args_dict['pipe_type'], read_only=True) + for i in range(len(VALID_TYPES)): + self.pipe_type.Append(PIPE_DESC[VALID_TYPES[i]]) + self.pipe_type.SetClientData(i, VALID_TYPES[i]) def on_execute(self): """Execute the user function.""" # Get the name and type. - pipe_name = str(self.pipe_name.GetValue()) - pipe_type = str(self.pipe_type.GetValue()) + pipe_name = gui_to_str(self.pipe_name.GetValue()) + pipe_type = self.pipe_type.GetClientData(self.pipe_type.GetSelection()) # Set the name. self.gui.interpreter.pipe.create(pipe_name=pipe_name, pipe_type=pipe_type)