Author: bugman Date: Tue Apr 24 13:50:36 2012 New Revision: 15804 URL: http://svn.gna.org/viewcvs/relax?rev=15804&view=rev Log: Shifted the code of r15803 from the test suite into the GUI method for running the test suite. Modified: 1.3/gui/relax_gui.py 1.3/test_suite/gui_tests/__init__.py Modified: 1.3/gui/relax_gui.py URL: http://svn.gna.org/viewcvs/relax/1.3/gui/relax_gui.py?rev=15804&r1=15803&r2=15804&view=diff ============================================================================== --- 1.3/gui/relax_gui.py (original) +++ 1.3/gui/relax_gui.py Tue Apr 24 13:50:36 2012 @@ -453,6 +453,11 @@ # Change the cursor to waiting. wx.BeginBusyCursor() + # Set a new style to stay on top, refreshing to update the style (needed for Mac OS X and MS Windows). + orig_style = self.controller.GetWindowStyle() + self.controller.SetWindowStyle(orig_style | wx.STAY_ON_TOP) + self.controller.Refresh() + # Reset relax. reset() @@ -475,6 +480,10 @@ # Turn off the busy cursor. if wx.IsBusy(): wx.EndBusyCursor() + + # Restore the controller style. + self.controller.SetWindowStyle(orig_style) + self.controller.Refresh() def run_test_suite_gui(self, event): Modified: 1.3/test_suite/gui_tests/__init__.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/gui_tests/__init__.py?rev=15804&r1=15803&r2=15804&view=diff ============================================================================== --- 1.3/test_suite/gui_tests/__init__.py (original) +++ 1.3/test_suite/gui_tests/__init__.py Tue Apr 24 13:50:36 2012 @@ -27,7 +27,6 @@ from relax_errors import RelaxError from string import split from unittest import TestSuite -import wx # relax GUI test module imports. from model_free import Mf @@ -57,24 +56,6 @@ @keyword runner: A test runner such as TextTestRunner. For an example of how to write a test runner see the python documentation for TextTestRunner in the python source. @type runner: Test runner instance (TextTestRunner, BaseGUITestRunner subclass, etc.) """ - - # Get the wx app, if the test suite is launched from the gui. - self.app = wx.GetApp() - - # Force the relax controller to stay on top (needed for Mac OS X and MS Windows). - gui_launch = False - if self.app != None and hasattr(self.app, 'gui'): - # Tests launched from the GUI. - gui_launch = True - - # Store the original frame style. - orig_style = self.app.gui.controller.GetWindowStyle() - - # Set a new style to stay on top. - self.app.gui.controller.SetWindowStyle(orig_style | wx.STAY_ON_TOP) - - # Refresh to update the style. - self.app.gui.controller.Refresh() # Create an array of test suites (add your new TestCase classes here). suite_array = [] @@ -110,13 +91,5 @@ # Run the test suite. results = runner.run(full_suite) - # Restore the controller if needed. - if gui_launch: - # Reset to the original style. - self.app.gui.controller.SetWindowStyle(orig_style) - - # Refresh to update the style. - self.app.gui.controller.Refresh() - # Return the status of the tests. return results.wasSuccessful()