Author: bugman Date: Thu Jul 28 08:52:23 2011 New Revision: 13937 URL: http://svn.gna.org/viewcvs/relax?rev=13937&view=rev Log: The relax icons are now used for all of relax's windows. Added: branches/gui_testing/gui/icons.py Modified: branches/gui_testing/gui/__init__.py branches/gui_testing/gui/about.py branches/gui_testing/gui/analyses/results.py branches/gui_testing/gui/controller.py branches/gui_testing/gui/message.py branches/gui_testing/gui/pipe_editor.py branches/gui_testing/gui/references.py branches/gui_testing/gui/relax_gui.py branches/gui_testing/gui/relax_prompt.py branches/gui_testing/gui/settings.py branches/gui_testing/gui/spin_viewer/frame.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=13937&r1=13936&r2=13937&view=diff ============================================================================== --- branches/gui_testing/gui/__init__.py (original) +++ branches/gui_testing/gui/__init__.py Thu Jul 28 08:52:23 2011 @@ -51,6 +51,7 @@ 'errors', 'filedialog', 'fonts', + 'icons', 'menu', 'message', 'misc', Modified: branches/gui_testing/gui/about.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/about.py?rev=13937&r1=13936&r2=13937&view=diff ============================================================================== --- branches/gui_testing/gui/about.py (original) +++ branches/gui_testing/gui/about.py Thu Jul 28 08:52:23 2011 @@ -35,7 +35,8 @@ from status import Status; status = Status() # relax GUI module imports. -from paths import IMAGE_PATH +from gui.icons import relax_icons +from gui.paths import IMAGE_PATH class About_base(wx.Frame): @@ -68,6 +69,9 @@ # Execute the base class __init__() method. super(About_base, self).__init__(parent=parent, id=id, title=title, style=self.style) + + # Set up the window icon. + self.SetIcons(relax_icons) # Create a scrolled window. self.window = wx.ScrolledWindow(self, -1) Modified: branches/gui_testing/gui/analyses/results.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/results.py?rev=13937&r1=13936&r2=13937&view=diff ============================================================================== --- branches/gui_testing/gui/analyses/results.py (original) +++ branches/gui_testing/gui/analyses/results.py Thu Jul 28 08:52:23 2011 @@ -30,9 +30,10 @@ # relax module imports. from data import Relax_data_store; ds = Relax_data_store() -# relaxGUI module imports. +# relax GUI module imports. from gui.analyses.results_analysis import see_results from gui.fonts import font +from gui.icons import relax_icons from gui.misc import add_border, gui_to_str, str_to_gui @@ -55,6 +56,9 @@ # Initialise the base frame. wx.Frame.__init__(self, parent=gui, style=wx.DEFAULT_FRAME_STYLE) + + # Set up the window icon. + self.SetIcons(relax_icons) # Set the window title, size, etc. self.SetTitle("Results viewer") Modified: branches/gui_testing/gui/controller.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/controller.py?rev=13937&r1=13936&r2=13937&view=diff ============================================================================== --- branches/gui_testing/gui/controller.py (original) +++ branches/gui_testing/gui/controller.py Thu Jul 28 08:52:23 2011 @@ -32,7 +32,8 @@ # relax module imports. from status import Status; status = Status() -# relaxGUI module imports. +# relax GUI module imports. +from gui.icons import relax_icons from gui.paths import IMAGE_PATH from message import question @@ -205,6 +206,9 @@ # Set the frame title. self.SetTitle("The relax controller") + + # Set up the window icon. + self.SetIcons(relax_icons) # Use a grid sizer for packing the elements. main_sizer = wx.BoxSizer(wx.VERTICAL) Added: branches/gui_testing/gui/icons.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/icons.py?rev=13937&view=auto ============================================================================== --- branches/gui_testing/gui/icons.py (added) +++ branches/gui_testing/gui/icons.py Thu Jul 28 08:52:23 2011 @@ -1,0 +1,48 @@ +############################################################################### +# # +# Copyright (C) 2011 Edward d'Auvergne # +# # +# This file is part of the program relax. # +# # +# relax is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# relax is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with relax; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +############################################################################### + +# Module docstring. +"""All of the icons for relax.""" + +# Python module imports. +from os import sep +import sys +import wx + +# relax module imports. +from status import Status; status = Status() + + +class Relax_icons(wx.IconBundle): + """The icon bundle class of the main relax icons.""" + + def setup(self): + """Set up the icons after the main app is created.""" + + # This is disabled on Macs. + if not 'darwin' in sys.platform: + self.AddIconFromFile(status.install_path + sep + 'graphics' + sep + 'ulysses.ico', wx.BITMAP_TYPE_ANY) + + + +# Set up the main set of icons for relax. +relax_icons = Relax_icons() Modified: branches/gui_testing/gui/message.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/message.py?rev=13937&r1=13936&r2=13937&view=diff ============================================================================== --- branches/gui_testing/gui/message.py (original) +++ branches/gui_testing/gui/message.py Thu Jul 28 08:52:23 2011 @@ -31,6 +31,7 @@ from status import Status; status = Status() # relax GUI module imports. +from gui.icons import relax_icons from gui.paths import IMAGE_PATH, icon_48x48 import gui @@ -93,6 +94,9 @@ # The dialog window. dialog = wx.MessageDialog(None, message=msg, caption=caption, style=wx.YES_NO|style) + # Set up the window icon. + dialog.SetIcons(relax_icons) + # The answer. answer = False @@ -129,6 +133,9 @@ # Initialise the base class. wx.Dialog.__init__(self, None, title='Missing data', style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER) + + # Set up the window icon. + self.SetIcons(relax_icons) # Set the initial size. self.SetSize((600, 400)) @@ -177,6 +184,3 @@ # Otherwise throw the error out to stderr. else: sys.stderr.write("Missing data: %s\n" % msg) - - - Modified: branches/gui_testing/gui/pipe_editor.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/pipe_editor.py?rev=13937&r1=13936&r2=13937&view=diff ============================================================================== --- branches/gui_testing/gui/pipe_editor.py (original) +++ branches/gui_testing/gui/pipe_editor.py Thu Jul 28 08:52:23 2011 @@ -34,6 +34,7 @@ # relax GUI module imports. from gui.components.menu import build_menu_item from gui.fonts import font +from gui.icons import relax_icons from gui.message import question from gui.misc import add_border, gui_to_str, str_to_gui from gui.paths import icon_16x16, icon_22x22, WIZARD_IMAGE_PATH @@ -61,6 +62,9 @@ # Create GUI elements wx.Frame.__init__(self, None, id=-1, title="Data pipe editor") + + # Set up the window icon. + self.SetIcons(relax_icons) # Initialise some data. self.width_col_label = 40 Modified: branches/gui_testing/gui/references.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/references.py?rev=13937&r1=13936&r2=13937&view=diff ============================================================================== --- branches/gui_testing/gui/references.py (original) +++ branches/gui_testing/gui/references.py Thu Jul 28 08:52:23 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. # # # @@ -33,6 +33,7 @@ # relax GUI module imports. from gui import paths +from gui.icons import relax_icons # HTML header. HTML_HEADER = """\ @@ -68,6 +69,9 @@ # Init the base class. super(References, self).__init__(parent, -1, "relax references", style=wx.DEFAULT_FRAME_STYLE) + + # Set up the window icon. + self.SetIcons(relax_icons) # Set an initial window size. self.SetSize((800, 800)) Modified: branches/gui_testing/gui/relax_gui.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/relax_gui.py?rev=13937&r1=13936&r2=13937&view=diff ============================================================================== --- branches/gui_testing/gui/relax_gui.py (original) +++ branches/gui_testing/gui/relax_gui.py Thu Jul 28 08:52:23 2011 @@ -55,6 +55,7 @@ from gui.controller import Controller from gui.filedialog import opendir, openfile, savefile from gui.fonts import font +from gui.icons import relax_icons from gui.menu import Menu from gui.message import dir_message, error_message, question from gui import paths @@ -80,6 +81,10 @@ # Execute the base class __init__ method. super(Main, self).__init__(parent=parent, id=id, title=title, style=wx.DEFAULT_FRAME_STYLE|wx.MAXIMIZE) + # Set up the relax icons. + relax_icons.setup() + self.SetIcons(relax_icons) + # Initialise some variables for the GUI. self.launch_dir = getcwd() @@ -112,12 +117,6 @@ # Set the title. self.SetTitle("relax " + version) - - # Set up the program icon (disabled on Macs). - self.icons = wx.IconBundle() - if not 'darwin' in sys.platform: - self.icons.AddIconFromFile(status.install_path + sep + 'graphics' + sep + 'ulysses.ico', wx.BITMAP_TYPE_ANY) - self.SetIcons(self.icons) # Set up the status bar. self.bar = self.CreateStatusBar(3, 0) Modified: branches/gui_testing/gui/relax_prompt.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/relax_prompt.py?rev=13937&r1=13936&r2=13937&view=diff ============================================================================== --- branches/gui_testing/gui/relax_prompt.py (original) +++ branches/gui_testing/gui/relax_prompt.py Thu Jul 28 08:52:23 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. # # # @@ -33,6 +33,8 @@ from info import Info_box from prompt import interpreter +# relax GUI module imports +from gui.icons import relax_icons class Prompt(wx.Frame): @@ -47,6 +49,9 @@ # Create GUI elements kwds["style"] = wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) + + # Set up the window icon. + self.SetIcons(relax_icons) # Some default values. self.size_x = 1000 Modified: branches/gui_testing/gui/settings.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/settings.py?rev=13937&r1=13936&r2=13937&view=diff ============================================================================== --- branches/gui_testing/gui/settings.py (original) +++ branches/gui_testing/gui/settings.py Thu Jul 28 08:52:23 2011 @@ -31,6 +31,7 @@ # relax GUI module imports. from gui.filedialog import openfile +from gui.icons import relax_icons from gui.message import error_message from gui.misc import gui_to_int, int_to_gui from gui import paths @@ -76,6 +77,9 @@ # Execute the base __init__() method. wx.Dialog.__init__(self, parent, id=id, title=title, style=style) + + # Set up the window icon. + self.SetIcons(relax_icons) # The main sizer. self.main_sizer = self.build_frame() 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=13937&r1=13936&r2=13937&view=diff ============================================================================== --- branches/gui_testing/gui/spin_viewer/frame.py (original) +++ branches/gui_testing/gui/spin_viewer/frame.py Thu Jul 28 08:52:23 2011 @@ -34,6 +34,7 @@ # relax GUI module imports. from gui import paths from gui.components.menu import build_menu_item +from gui.icons import relax_icons from gui.misc import gui_to_str from gui.spin_viewer.splitter import Tree_splitter @@ -50,6 +51,9 @@ # Create GUI elements kwds["style"] = wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) + + # Set up the window icon. + self.SetIcons(relax_icons) # Some default values. self.size_x = 1200 Modified: branches/gui_testing/gui/wizard.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/wizard.py?rev=13937&r1=13936&r2=13937&view=diff ============================================================================== --- branches/gui_testing/gui/wizard.py (original) +++ branches/gui_testing/gui/wizard.py Thu Jul 28 08:52:23 2011 @@ -36,6 +36,7 @@ # relax GUI module imports. from gui.controller import Redirect_text from gui.filedialog import openfile +from gui.icons import relax_icons from gui.misc import add_border, bool_to_gui, gui_to_int, int_to_gui, protected_exec, str_to_gui from gui import paths @@ -942,6 +943,9 @@ # Execute the base class method. wx.Dialog.__init__(self, None, id=-1, title=title, style=style) + # Set up the window icon. + self.SetIcons(relax_icons) + # The sizer for the dialog. sizer = wx.BoxSizer(wx.VERTICAL) self.SetSizer(sizer)