Author: bugman Date: Thu Aug 4 12:25:23 2011 New Revision: 14115 URL: http://svn.gna.org/viewcvs/relax?rev=14115&view=rev Log: The results file viewer 'open' button is now partially functional. Modified: branches/gui_testing/gui/analyses/results.py Modified: branches/gui_testing/gui/analyses/results.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/results.py?rev=14115&r1=14114&r2=14115&view=diff ============================================================================== --- branches/gui_testing/gui/analyses/results.py (original) +++ branches/gui_testing/gui/analyses/results.py Thu Aug 4 12:25:23 2011 @@ -35,7 +35,7 @@ from gui.analyses.results_analysis import see_results from gui.fonts import font from gui.icons import relax_icons -from gui.misc import add_border, gui_to_str, str_to_gui +from gui.misc import add_border, gui_to_str, open_file, str_to_gui class Results_viewer(wx.Frame): @@ -196,24 +196,29 @@ @type event: wx event """ - # The selected file. - choice = gui_to_str(self.list.GetStringSelection()) - # No choice. - if not choice: + if self.list.GetSelection() == wx.NOT_FOUND: return + # Get the data. + data = self.list.GetClientData(self.list.GetSelection()) + + # Grace files. + if data[0] == 'grace': + print "grace" + # A special table. - if choice == 'Table_of_Results': + elif data[0] == 'Table_of_Results': # The data. model_result = [ds.relax_gui.table_residue, ds.relax_gui.table_model, ds.relax_gui.table_s2, ds.relax_gui.table_rex, ds.relax_gui.table_te] # Open. see_results(choice, model_result) - # Open the file. + # Open all other files in which ever editor the platform decides on. else: - see_results(choice, None) + open_file(data[1]) + def update_choices(self, event):