mailr13813 - /branches/gui_testing/gui/analyses/__init__.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on July 21, 2011 - 18:53:
Author: bugman
Date: Thu Jul 21 18:53:54 2011
New Revision: 13813

URL: http://svn.gna.org/viewcvs/relax?rev=13813&view=rev
Log:
Fixes for the analysis reset() method.

It has been renamed to post_reset() and now removes all the GUI elements 
itself.  The call to
delete_all() is of no use because it calls delete_analysis() which removes 
data pipes and
ds.relax_gui data storage as well, and then notifies observers.


Modified:
    branches/gui_testing/gui/analyses/__init__.py

Modified: branches/gui_testing/gui/analyses/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/__init__.py?rev=13813&r1=13812&r2=13813&view=diff
==============================================================================
--- branches/gui_testing/gui/analyses/__init__.py (original)
+++ branches/gui_testing/gui/analyses/__init__.py Thu Jul 21 18:53:54 2011
@@ -86,7 +86,7 @@
         status.observers.pipe_alteration.register(self.name, 
self.pipe_switch)
 
         # Register the deletion of all analyses for the reset status 
observer.
-        status.observers.reset.register('gui analyses', self.reset)
+        status.observers.reset.register('gui analyses', self.post_reset)
 
 
     def analysis_data_loop(self):
@@ -481,11 +481,25 @@
         status.observers.gui_analysis.notify()
 
 
-    def reset(self):
-        """Reset all the analyses to an initial state."""
-
-        # First delete all analyses.
-        self.delete_all()
+    def post_reset(self):
+        """Post relax data store reset event handler."""
+
+        # Delete all tabs.
+        while self._num_analyses:
+            # The index of the tab to remove.
+            index = self._num_analyses - 1
+
+            # Delete the tab.
+            self.notebook.DeletePage(index)
+
+            # Delete the tab object.
+            self._analyses.pop(index)
+
+            # Decrement the number of analyses.
+            self._num_analyses -= 1
+
+            # Set the initial state.
+            self.set_init_state()
 
 
     def set_init_state(self):




Related Messages


Powered by MHonArc, Updated Thu Jul 21 19:20:02 2011