Author: bugman Date: Wed Jul 20 15:48:12 2011 New Revision: 13778 URL: http://svn.gna.org/viewcvs/relax?rev=13778&view=rev Log: Modified the status bar to show the current data pipe rather than relax version. The relax version is shown in the title bar anyway! Modified: branches/gui_testing/gui/relax_gui.py Modified: branches/gui_testing/gui/relax_gui.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/relax_gui.py?rev=13778&r1=13777&r2=13778&view=diff ============================================================================== --- branches/gui_testing/gui/relax_gui.py (original) +++ branches/gui_testing/gui/relax_gui.py Wed Jul 20 15:48:12 2011 @@ -39,6 +39,7 @@ from data.gui import Gui from info import Info_box from generic_fns import state +from generic_fns.pipes import cdp_name from generic_fns.reset import reset from prompt.interpreter import Interpreter from relax_errors import RelaxError @@ -116,12 +117,12 @@ icon.CopyFromBitmap(wx.Bitmap(paths.IMAGE_PATH+'relax.gif', wx.BITMAP_TYPE_ANY)) self.SetIcon(icon) - # Statusbar fields. - bar = self.CreateStatusBar(3, 0) - bar.SetStatusWidths([-5, -1, -1]) - fields = ["(C) 2001-2011 the relax development team", "relax version", version] - for i in range(len(fields)): - bar.SetStatusText(fields[i], i) + # Set up the status bar. + self.bar = self.CreateStatusBar(3, 0) + self.bar.SetStatusWidths([-4, -1, -2]) + self.bar.SetStatusText("(C) 2001-2011 the relax development team", 0) + self.bar.SetStatusText("Current data pipe:", 1) + self.update_status_bar() # Add the start screen. self.add_start_screen() @@ -137,6 +138,9 @@ # Run a script. if script: self.user_functions.script.script_exec(script) + + # Register functions with the observer objects. + status.observers.pipe_switch.register('status bar', self.update_status_bar) def about_gui(self, event): @@ -486,3 +490,12 @@ # Execute the analysis page specific update methods. if hasattr(page, 'sync_ds'): page.sync_ds(upload) + + + def update_status_bar(self): + """Update the status bar info.""" + + # Set the current data pipe info. + pipe = cdp_name() + if pipe: + self.bar.SetStatusText(pipe, 2)