Author: bugman Date: Mon Jul 18 14:39:32 2011 New Revision: 13690 URL: http://svn.gna.org/viewcvs/relax?rev=13690&view=rev Log: All wx Show and ShowModal calls are suppressed if status.show_gui is not set. This will allow for better GUI testing in the test suite. Modified: branches/gui_testing/gui/__init__.py branches/gui_testing/gui/analyses/__init__.py branches/gui_testing/gui/analyses/auto_model_free.py branches/gui_testing/gui/analyses/auto_noe.py branches/gui_testing/gui/analyses/auto_rx_base.py branches/gui_testing/gui/analyses/relax_control.py branches/gui_testing/gui/analyses/results_analysis.py branches/gui_testing/gui/relax_gui.py branches/gui_testing/gui/spin_viewer/frame.py branches/gui_testing/gui/user_functions/script.py branches/gui_testing/gui/wizard.py Modified: branches/gui_testing/gui/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/__init__.py?rev=13690&r1=13689&r2=13690&view=diff ============================================================================== --- branches/gui_testing/gui/__init__.py (original) +++ branches/gui_testing/gui/__init__.py Mon Jul 18 14:39:32 2011 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2009 Edward d'Auvergne # +# Copyright (C) 2009-2011 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -38,6 +38,7 @@ # relax module imports. from relax_errors import RelaxError from relax_gui import Main +from status import Status; status = Status() # relax GUI module imports. from paths import IMAGE_PATH @@ -96,11 +97,13 @@ # Make it the main application component. self.SetTopWindow(main) - # Wait a little while :) - sleep(1) + # Only show the GUI if requested. + if status.show_gui: + # Wait a little while :) + sleep(1) - # Show it. - main.Show() + # Show it. + main.Show() # All is good! return True Modified: branches/gui_testing/gui/analyses/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/__init__.py?rev=13690&r1=13689&r2=13690&view=diff ============================================================================== --- branches/gui_testing/gui/analyses/__init__.py (original) +++ branches/gui_testing/gui/analyses/__init__.py Mon Jul 18 14:39:32 2011 @@ -444,7 +444,8 @@ self.results_viewer = Results_viewer(gui=self.gui) # Open the window. - self.results_viewer.Show() + if status.show_gui: + self.results_viewer.Show() def switch_page(self, index): Modified: branches/gui_testing/gui/analyses/auto_model_free.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/auto_model_free.py?rev=13690&r1=13689&r2=13690&view=diff ============================================================================== --- branches/gui_testing/gui/analyses/auto_model_free.py (original) +++ branches/gui_testing/gui/analyses/auto_model_free.py Mon Jul 18 14:39:32 2011 @@ -225,7 +225,8 @@ dialog = About_window(self.parent) # Show the dialog. - dialog.Show() + if status.show_gui: + dialog.Show() def add_max_iterations(self, box): @@ -641,7 +642,7 @@ which_model = self.choose_global_model(False) # Display the relax controller. - if not status.debug: + if not status.debug and status.show_gui: self.gui.controller.Show() # Cancel. @@ -810,7 +811,8 @@ # The dialog. dlg = Select_tensor(None, -1, "", local_tm_flag=True) - dlg.ShowModal() + if status.show_gui: + dlg.ShowModal() # Return the choice. return dlg.selection Modified: branches/gui_testing/gui/analyses/auto_noe.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/auto_noe.py?rev=13690&r1=13689&r2=13690&view=diff ============================================================================== --- branches/gui_testing/gui/analyses/auto_noe.py (original) +++ branches/gui_testing/gui/analyses/auto_noe.py Mon Jul 18 14:39:32 2011 @@ -274,7 +274,7 @@ return # Display the relax controller (if not debugging). - if not status.debug: + if not status.debug and status.show_gui: self.gui.controller.Show() # Threading flag. Modified: branches/gui_testing/gui/analyses/auto_rx_base.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/auto_rx_base.py?rev=13690&r1=13689&r2=13690&view=diff ============================================================================== --- branches/gui_testing/gui/analyses/auto_rx_base.py (original) +++ branches/gui_testing/gui/analyses/auto_rx_base.py Mon Jul 18 14:39:32 2011 @@ -282,7 +282,7 @@ return # Display the relax controller. - if not status.debug: + if not status.debug and status.show_gui: self.gui.controller.Show() # Threading flag. Modified: branches/gui_testing/gui/analyses/relax_control.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/relax_control.py?rev=13690&r1=13689&r2=13690&view=diff ============================================================================== --- branches/gui_testing/gui/analyses/relax_control.py (original) +++ branches/gui_testing/gui/analyses/relax_control.py Mon Jul 18 14:39:32 2011 @@ -27,6 +27,9 @@ import sys import thread import wx + +# relax module imports. +from status import Status; status = Status() # relaxGUI module imports. from gui_bieri.execution.calc_modelfree import start_model_free @@ -141,7 +144,8 @@ # launch log dialog logwindow = log_window(None, -1, "") - logwindow.ShowModal() + if status.show_gui: + logwindow.ShowModal() sys.stdout = sys.__stdout__ sys.stderr = sys.__stderr__ return '' @@ -162,7 +166,8 @@ # launch log dialog logwindow = log_window(None, -1, "") - logwindow.ShowModal() + if status.show_gui: + logwindow.ShowModal() sys.stdout = sys.__stdout__ sys.stderr = sys.__stderr__ return '' @@ -183,7 +188,8 @@ # launch log dialog logwindow = log_window(None, -1, "") - logwindow.ShowModal() + if status.show_gui: + logwindow.ShowModal() sys.stdout = sys.__stdout__ sys.stderr = sys.__stderr__ return '' Modified: branches/gui_testing/gui/analyses/results_analysis.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/results_analysis.py?rev=13690&r1=13689&r2=13690&view=diff ============================================================================== --- branches/gui_testing/gui/analyses/results_analysis.py (original) +++ branches/gui_testing/gui/analyses/results_analysis.py Mon Jul 18 14:39:32 2011 @@ -1,7 +1,7 @@ ############################################################################### # # # Copyright (C) 2009 Michael Bieri # -# Copyright (C) 2010 Edward d'Auvergne # +# Copyright (C) 2010-2011 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -30,6 +30,7 @@ # relax module imports. from prompt.interpreter import Interpreter from generic_fns.mol_res_spin import spin_loop +from status import Status; status = Status() # relax GUI module imports. from gui.paths import IMAGE_PATH @@ -351,7 +352,8 @@ if 'Table_of_Results' in openfile: summary = Final_results(import_results, None, -1, "") - summary.Show() + if status.show_gui: + summary.Show() Modified: branches/gui_testing/gui/relax_gui.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/relax_gui.py?rev=13690&r1=13689&r2=13690&view=diff ============================================================================== --- branches/gui_testing/gui/relax_gui.py (original) +++ branches/gui_testing/gui/relax_gui.py Mon Jul 18 14:39:32 2011 @@ -150,7 +150,8 @@ dialog = About_gui(None, -1, "") # The dialog. - dialog.Show() + if status.show_gui: + dialog.Show() def about_relax(self, event): @@ -164,7 +165,8 @@ dialog = About_relax(None, -1, "") # The dialog. - dialog.Show() + if status.show_gui: + dialog.Show() def action_state_save(self, event): @@ -303,7 +305,8 @@ win = Free_file_format() # Show the window. - win.Show() + if status.show_gui: + win.Show() def global_parameters(self, event): @@ -317,7 +320,8 @@ win = Global_params() # Show the window. - win.Show() + if status.show_gui: + win.Show() def references(self, event): @@ -329,7 +333,8 @@ # Build and show the references window. self.references = References(self) - self.references.Show() + if status.show_gui: + self.references.Show() def relax_manual(self, event): @@ -393,7 +398,8 @@ """ # Open the window. - self.controller.Show() + if status.show_gui: + self.controller.Show() def show_prompt(self, event): @@ -408,7 +414,8 @@ self.relax_prompt = Prompt(None, -1, "", parent=self) # Open the window. - self.relax_prompt.Show() + if status.show_gui: + self.relax_prompt.Show() def show_tree(self, event): @@ -423,7 +430,8 @@ self.spin_viewer = Spin_view_window(None, -1, "", parent=self) # Open the window. - self.spin_viewer.Show() + if status.show_gui: + self.spin_viewer.Show() def state_load(self, event): Modified: branches/gui_testing/gui/spin_viewer/frame.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/spin_viewer/frame.py?rev=13690&r1=13689&r2=13690&view=diff ============================================================================== --- branches/gui_testing/gui/spin_viewer/frame.py (original) +++ branches/gui_testing/gui/spin_viewer/frame.py Mon Jul 18 14:39:32 2011 @@ -151,7 +151,8 @@ self.refresh() # Then show the window using the baseclass method. - wx.Frame.Show(self, show) + if status.show_gui: + wx.Frame.Show(self, show) def refresh(self, event=None): Modified: branches/gui_testing/gui/user_functions/script.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/user_functions/script.py?rev=13690&r1=13689&r2=13690&view=diff ============================================================================== --- branches/gui_testing/gui/user_functions/script.py (original) +++ branches/gui_testing/gui/user_functions/script.py Mon Jul 18 14:39:32 2011 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2010 Edward d'Auvergne # +# Copyright (C) 2010-2011 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -25,6 +25,9 @@ # Python module imports. import thread + +# relax module imports. +from status import Status; status = Status() # GUI module imports. from base import UF_base @@ -52,7 +55,8 @@ return # Show the relax controller. - self.gui.controller.Show() + if status.show_gui: + self.gui.controller.Show() # Execute the script in a thread. id = thread.start_new_thread(self.script_exec, (file,)) Modified: branches/gui_testing/gui/wizard.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/wizard.py?rev=13690&r1=13689&r2=13690&view=diff ============================================================================== --- branches/gui_testing/gui/wizard.py (original) +++ branches/gui_testing/gui/wizard.py Mon Jul 18 14:39:32 2011 @@ -31,6 +31,7 @@ from data import Relax_data_store; ds = Relax_data_store() from generic_fns.mol_res_spin import id_string_doc from relax_errors import RelaxImplementError +from status import Status; status = Status() # relax GUI module imports. from gui.controller import Redirect_text @@ -1145,7 +1146,8 @@ self._pages[i].on_display_post() # Show the desired page. - self._main_sizer.Show(self._page_sizers[i]) + if status.show_gui: + self._main_sizer.Show(self._page_sizers[i]) # Re-perform the window layout. self.Layout() @@ -1380,6 +1382,10 @@ # Display the first page. self._display_page(0) + # No GUI. + if not status.show_gui: + return + # Modal operation. if modal: # Show the wizard.