Author: bugman Date: Wed Sep 21 17:54:39 2011 New Revision: 14739 URL: http://svn.gna.org/viewcvs/relax?rev=14739&view=rev Log: Bug fix for the new analysis wizard cancelling on Mac OS X. A status variable is no longer returned. Instead the EndModal() dialog method is being used to terminate modal wizards, returning the value of wx.ID_OK. The new analysis wizard is now checking for this return code. Modified: 1.3/gui/analyses/wizard.py 1.3/gui/wizard.py Modified: 1.3/gui/analyses/wizard.py URL: http://svn.gna.org/viewcvs/relax/1.3/gui/analyses/wizard.py?rev=14739&r1=14738&r2=14739&view=diff ============================================================================== --- 1.3/gui/analyses/wizard.py (original) +++ 1.3/gui/analyses/wizard.py Wed Sep 21 17:54:39 2011 @@ -66,7 +66,7 @@ # Execute the wizard. setup = self.wizard.run(modal=True) - if not setup: + if setup != wx.ID_OK: return # Return the analysis type, analysis name, and pipe name. Modified: 1.3/gui/wizard.py URL: http://svn.gna.org/viewcvs/relax/1.3/gui/wizard.py?rev=14739&r1=14738&r2=14739&view=diff ============================================================================== --- 1.3/gui/wizard.py (original) +++ 1.3/gui/wizard.py Wed Sep 21 17:54:39 2011 @@ -1071,9 +1071,6 @@ # Centre the dialog. self.Centre() - # Initialise the wizard status. - self._status = True - # Initialise the page storage. self._current_page = 0 self._num_pages = 0 @@ -1144,9 +1141,6 @@ # Page skipping. self._skip_flag.append(False) - # Bind some events. - self.Bind(wx.EVT_CLOSE, self._handler_close) - def _build_buttons(self): """Construct the buttons for all pages of the wizard.""" @@ -1253,11 +1247,8 @@ @type event: wx event """ - # Change the status. - self._status = False - # Close the window. - self.Destroy() + self.Close() def _display_page(self, i): @@ -1350,20 +1341,6 @@ self._display_page(self._current_page) - def _handler_close(self, event): - """Event handler for the close window action. - - @param event: The wx event. - @type event: wx event - """ - - # Change the status. - self._status = False - - # Destroy the window. - self.Destroy() - - def _next_fn(self): """Standard function for setting the next page to the one directly next in the sequence. @@ -1402,7 +1379,10 @@ self._exec_count[i] += 1 # Then close the dialog. - self.Destroy() + if self.IsModal(): + self.EndModal(wx.ID_OK) + else: + self.Close() def _seq_loop(self): @@ -1560,10 +1540,10 @@ # Modal operation. if modal: # Show the wizard (it should be closed by the _cancel() or _ok() methods). - self.ShowModal() + wiz_status = self.ShowModal() # Return the status. - return self._status + return wiz_status # Modeless operation. else: