Author: bugman Date: Wed Jun 15 16:25:59 2011 New Revision: 13044 URL: http://svn.gna.org/viewcvs/relax?rev=13044&view=rev Log: All analyses are now deleted prior to loading the save file. Modified: branches/gui_testing/gui/relax_gui.py Modified: branches/gui_testing/gui/relax_gui.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/relax_gui.py?rev=13044&r1=13043&r2=13044&view=diff ============================================================================== --- branches/gui_testing/gui/relax_gui.py (original) +++ branches/gui_testing/gui/relax_gui.py Wed Jun 15 16:25:59 2011 @@ -230,6 +230,23 @@ webbrowser.open_new('mailto:relax-users@xxxxxxx') + def delete_analysis(self, index): + """Delete the analysis tab and data store corresponding to the index. + + @param index: The index of the analysis to delete. + @type index: int + """ + + # Delete the data store object. + ds.relax_gui.analyses.pop(index) + + # Delete the tab. + self.notebook.DeletePage(index) + + # Delete the tab object. + self.analyses.pop(index) + + def exit_gui(self, event=None): """Catch the main window closure and perform the exit procedure. @@ -564,6 +581,11 @@ # Don't do anything. return + # Delete the current tabs. + while len(self.analyses): + # Remove the last analysis, until there is nothing left. + self.delete_analysis(len(self.analyses)-1) + # Reset the relax data store. reset()