mailr13627 - /branches/gui_testing/gui/wizard.py


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

Header


Content

Posted by edward on July 14, 2011 - 17:15:
Author: bugman
Date: Thu Jul 14 17:15:37 2011
New Revision: 13627

URL: http://svn.gna.org/viewcvs/relax?rev=13627&view=rev
Log:
Only the pages in the sequence have their _apply() methods calls when the 
wizard finishes.

The _seq_loop() method has been added to provide forward looping over the 
sequence.


Modified:
    branches/gui_testing/gui/wizard.py

Modified: branches/gui_testing/gui/wizard.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/wizard.py?rev=13627&r1=13626&r2=13627&view=diff
==============================================================================
--- branches/gui_testing/gui/wizard.py (original)
+++ branches/gui_testing/gui/wizard.py Thu Jul 14 17:15:37 2011
@@ -1176,8 +1176,8 @@
         @type event:    wx event
         """
 
-        # Loop over all pages and execute their _apply() methods, if not 
already done.
-        for i in range(self._num_pages):
+        # Loop over the pages in the sequence and execute their _apply() 
methods, if not already done.
+        for i in self._seq_loop():
             if not self._exec_count[i]:
                 # Execute the _apply method.
                 self._pages[i]._apply(event)
@@ -1187,6 +1187,29 @@
 
         # Then destroy the dialog.
         self.Destroy()
+
+
+    def _seq_loop(self):
+        """Loop over the sequence in the forwards direction."""
+
+        # Initialise.
+        current = 0
+
+        # First yield the initial element (always zero!).
+        yield current
+
+        # Loop over the sequence.
+        while 1:
+            # Update.
+            next = self._seq_next[current]
+            current = next
+
+            # End of the sequence.
+            if next == None:
+                break
+
+            # Yield the next index.
+            yield next
 
 
     def add_page(self, panel, apply_button=True, exec_on_next=True):




Related Messages


Powered by MHonArc, Updated Thu Jul 14 18:00:02 2011