Author: bugman Date: Thu Jun 23 16:41:04 2011 New Revision: 13186 URL: http://svn.gna.org/viewcvs/relax?rev=13186&view=rev Log: Created the wizard method block_next() to allow a page to prevent forwards progression. 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=13186&r1=13185&r2=13186&view=diff ============================================================================== --- branches/gui_testing/gui/wizard.py (original) +++ branches/gui_testing/gui/wizard.py Thu Jun 23 16:41:04 2011 @@ -943,6 +943,32 @@ panel.page_index = self._num_pages - 1 + def block_next(self, block=True): + """Prevent moving forwards (or unblock). + + @keyword block: A flag which if True will block forwards movement and if False will unblock. + @type block: bool + """ + + # The buttons to disable. + buttons = ['next', 'ok', 'finish'] + + # Disable or enable the buttons. + for i in range(len(buttons)): + # The button. + button = self._buttons[self._current_page][buttons[i]] + if button == None: + continue + + # Block. + if block: + button.Disable() + + # Unblock. + else: + button.Enable() + + def run(self): """Execute the wizard."""