Author: bugman Date: Fri Sep 6 18:39:56 2013 New Revision: 20916 URL: http://svn.gna.org/viewcvs/relax?rev=20916&view=rev Log: Created the new gui.text module for holding all of the unicode text for the GUI. This module contains unicode strings for the various analysis types, which are then all defined in one location. This is for consistency. Added: trunk/gui/text.py Modified: trunk/gui/__init__.py trunk/gui/analyses/auto_model_free.py trunk/gui/analyses/auto_r1.py trunk/gui/analyses/auto_r2.py trunk/gui/analyses/wizard.py trunk/gui/components/relax_data.py Modified: trunk/gui/__init__.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/__init__.py?rev=20916&r1=20915&r2=20916&view=diff ============================================================================== --- trunk/gui/__init__.py (original) +++ trunk/gui/__init__.py Fri Sep 6 18:39:56 2013 @@ -60,6 +60,7 @@ 'relax_gui', 'relax_prompt', 'settings', + 'text', 'wizard'] Modified: trunk/gui/analyses/auto_model_free.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/analyses/auto_model_free.py?rev=20916&r1=20915&r2=20916&view=diff ============================================================================== --- trunk/gui/analyses/auto_model_free.py (original) +++ trunk/gui/analyses/auto_model_free.py Fri Sep 6 18:39:56 2013 @@ -32,10 +32,9 @@ # relax module imports. from auto_analyses import dauvergne_protocol -from compat import u from data_store import Relax_data_store; ds = Relax_data_store() from graphics import ANALYSIS_IMAGE_PATH, IMAGE_PATH, fetch_icon -from gui import paths +from gui import paths, text from gui.about import About_base from gui.analyses.base import Base_analysis from gui.analyses.elements.spin_element import Spin_ctrl @@ -815,7 +814,7 @@ """The local model-free model list GUI element.""" # Some class variables. - desc = u("Local \u03C4\u2098 models:") + desc = "Local %s models:" % text.tm models = [ "tm0", "tm1", @@ -829,20 +828,20 @@ "tm9" ] params = [ - u("{local \u03C4\u2098}"), - u("{local \u03C4\u2098, S\u00B2}"), - u("{local \u03C4\u2098, S\u00B2, \u03C4e}"), - u("{local \u03C4\u2098, S\u00B2, Rex}"), - u("{local \u03C4\u2098, S\u00B2, \u03C4e, Rex}"), - u("{local \u03C4\u2098, S\u00B2, S\u00B2f, \u03C4s}"), - u("{local \u03C4\u2098, S\u00B2, \u03C4f, S\u00B2f, \u03C4s}"), - u("{local \u03C4\u2098, S\u00B2, S\u00B2f, \u03C4s, Rex}"), - u("{local \u03C4\u2098, S\u00B2, \u03C4f, S\u00B2f, \u03C4s, Rex}"), - u("{local \u03C4\u2098, Rex}") + "{%s}" % text.local_tm, + "{%s, %s}" % (text.local_tm, text.s2), + "{%s, %s, %s}" % (text.local_tm, text.s2, text.te), + "{%s, %s, %s}" % (text.local_tm, text.s2, text.rex), + "{%s, %s, %s, %s}" % (text.local_tm, text.s2, text.te, text.rex), + "{%s, %s, %s, %s}" % (text.local_tm, text.s2, text.s2f, text.ts), + "{%s, %s, %s, %s, %s}" % (text.local_tm, text.s2, text.tf, text.s2f, text.ts), + "{%s, %s, %s, %s, %s}" % (text.local_tm, text.s2, text.s2f, text.ts, text.rex), + "{%s, %s, %s, %s, %s, %s}" % (text.local_tm, text.s2, text.tf, text.s2f, text.ts, text.rex), + "{%s, %s}" % (text.local_tm, text.rex) ] warning = "The model-free models used in dauvergne_protocol auto-analysis should almost never be changed! The consequences will be unpredictable. Please proceed only if you are sure of what you are doing. Would you like to modify the model-free model list?" red_flag = True - tooltip = u("The list model-free models with the local \u03C4\u2098 parameter to optimise as the first step of the protocol (see the about window for details). This really should not be changed.") + tooltip = "The list model-free models with the %s parameter to optimise as the first step of the protocol (see the about window for details). This really should not be changed." % text.local_tm tooltip_button = "Open the model list selector window." @@ -865,16 +864,16 @@ "m9" ] params = [ - u("{}"), - u("{S\u00B2}"), - u("{S\u00B2, \u03C4e}"), - u("{S\u00B2, Rex}"), - u("{S\u00B2, \u03C4e, Rex}"), - u("{S\u00B2, S\u00B2f, \u03C4s}"), - u("{S\u00B2, \u03C4f, S\u00B2f, \u03C4s}"), - u("{S\u00B2, S\u00B2f, \u03C4s, Rex}"), - u("{S\u00B2, \u03C4f, S\u00B2f, \u03C4s, Rex}"), - u("{Rex}") + "{}", + "{%s}" % text.s2, + "{%s, %s}" % (text.s2, text.te), + "{%s, %s}" % (text.s2, text.rex), + "{%s, %s, %s}" % (text.s2, text.te, text.rex), + "{%s, %s, %s}" % (text.s2, text.s2f, text.ts), + "{%s, %s, %s, %s}" % (text.s2, text.tf, text.s2f, text.ts), + "{%s, %s, %s, %s}" % (text.s2, text.s2f, text.ts, text.rex), + "{%s, %s, %s, %s, %s}" % (text.s2, text.tf, text.s2f, text.ts, text.rex), + "{%s}" % text.rex ] warning = "The model-free models used in dauvergne_protocol auto-analysis should almost never be changed! The consequences will be unpredictable. Please proceed only if you are sure of what you are doing. Would you like to modify the model-free model list?" red_flag = True @@ -973,8 +972,8 @@ sub_sizer.AddSpacer(10) # The local_tm button. - button = wx.Button(self, -1, u("Local \u03C4\u2098")) - button.SetToolTipString(u("Optimise global model I, the local \u03C4\u2098 models. Please click on the 'About' button for more information.")) + button = wx.Button(self, -1, "Local %s" % text.tm) + button.SetToolTipString("Optimise global model I, the %s models. Please click on the 'About' button for more information." % text.local_tm) button.SetFont(font.normal) sub_sizer.Add(button, 1, wx.EXPAND, 0) self.Bind(wx.EVT_BUTTON, self.select_local_tm, button) Modified: trunk/gui/analyses/auto_r1.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/analyses/auto_r1.py?rev=20916&r1=20915&r2=20916&view=diff ============================================================================== --- trunk/gui/analyses/auto_r1.py (original) +++ trunk/gui/analyses/auto_r1.py Fri Sep 6 18:39:56 2013 @@ -23,8 +23,8 @@ """Module for the automatic R1 analysis frame.""" # relax module imports. -from compat import u from graphics import ANALYSIS_IMAGE_PATH, IMAGE_PATH +from gui import text from gui.analyses.auto_rx_base import Auto_rx @@ -36,4 +36,4 @@ bitmap = [ANALYSIS_IMAGE_PATH+"r1_200x200.png", IMAGE_PATH+'r1.png'] label = "R1" - gui_label = u("R\u2081") + gui_label = text.r1 Modified: trunk/gui/analyses/auto_r2.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/analyses/auto_r2.py?rev=20916&r1=20915&r2=20916&view=diff ============================================================================== --- trunk/gui/analyses/auto_r2.py (original) +++ trunk/gui/analyses/auto_r2.py Fri Sep 6 18:39:56 2013 @@ -23,8 +23,8 @@ """Module for the automatic R2 analysis frame.""" # relax module imports. -from compat import u from graphics import ANALYSIS_IMAGE_PATH, IMAGE_PATH +from gui import text from gui.analyses.auto_rx_base import Auto_rx @@ -36,4 +36,4 @@ bitmap = [ANALYSIS_IMAGE_PATH+"r2_200x200.png", IMAGE_PATH+'r2.png'] label = "R2" - gui_label = u("R\u2082") + gui_label = text.r2 Modified: trunk/gui/analyses/wizard.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/analyses/wizard.py?rev=20916&r1=20915&r2=20916&view=diff ============================================================================== --- trunk/gui/analyses/wizard.py (original) +++ trunk/gui/analyses/wizard.py Fri Sep 6 18:39:56 2013 @@ -29,8 +29,8 @@ from wx.lib import buttons # relax module imports. -from compat import u from graphics import ANALYSIS_IMAGE_PATH, IMAGE_PATH, WIZARD_IMAGE_PATH +from gui import text from gui.input_elements.value import Value from gui.misc import bitmap_setup from gui.string_conv import gui_to_str, str_to_gui @@ -104,7 +104,7 @@ # Class variables. image_path = WIZARD_IMAGE_PATH + 'pipe.png' - main_text = u("Select the name of the data pipe used at the start of the analysis and the name of the data pipe bundle to be associated with this analysis. All data in relax is kept within a special structure known as the relax data store. This store is composed of multiple data pipes, each being associated with a specific analysis type. Data pipe bundles are simple groupings of the pipes within the data store and each analysis tab is coupled to a specific bundle.\n\nSimple analyses such as the steady-state NOE and the R\u2081 and R\u2082 curve-fitting will be located within a single data pipe. More complex analyses such as the automated model-free analysis will be spread across multiple data pipes, internally created by forking the original data pipe which holds the input data, all grouped together within a single bundle.\n\nThe initialisation of a new analysis will call the pipe.create user function with the pipe name and pipe bundle as given below.") + main_text = "Select the name of the data pipe used at the start of the analysis and the name of the data pipe bundle to be associated with this analysis. All data in relax is kept within a special structure known as the relax data store. This store is composed of multiple data pipes, each being associated with a specific analysis type. Data pipe bundles are simple groupings of the pipes within the data store and each analysis tab is coupled to a specific bundle.\n\nSimple analyses such as the steady-state NOE and the %s and %s curve-fitting will be located within a single data pipe. More complex analyses such as the automated model-free analysis will be spread across multiple data pipes, internally created by forking the original data pipe which holds the input data, all grouped together within a single bundle.\n\nThe initialisation of a new analysis will call the pipe.create user function with the pipe name and pipe bundle as given below." % (text.r1, text.r2) title = 'Data pipe set up' def add_contents(self, sizer): @@ -177,7 +177,7 @@ # Class variables. image_path = IMAGE_PATH + "relax.gif" - main_text = u("A number of automatic analyses to be preformed using relax in GUI mode. Although not as flexible or powerful as the prompt/scripting modes, this provides a quick and easy setup and execution for a number of analysis types. These currently include the calculation of the steady-state NOE, the exponential curve-fitting for the R\u2081 and R\u2082 relaxation rates, and for a full and automatic model-free analysis using the d'Auvergne and Gooley, 2008b protocol. All analyses perform error propagation using the gold standard Monte Calro simulations. Please select from one of the following analysis types:") + main_text = "A number of automatic analyses to be preformed using relax in GUI mode. Although not as flexible or powerful as the prompt/scripting modes, this provides a quick and easy setup and execution for a number of analysis types. These currently include the calculation of the steady-state NOE, the exponential curve-fitting for the %s and %s relaxation rates, and for a full and automatic model-free analysis using the d'Auvergne and Gooley, 2008b protocol. All analyses perform error propagation using the gold standard Monte Calro simulations. Please select from one of the following analysis types:" % (text.r1, text.r2) title = "Start a new analysis" def add_artwork(self, sizer): @@ -233,10 +233,10 @@ self.button_noe = self.create_button(id=self.button_ids['noe'], box=sizer1, size=size, bmp=ANALYSIS_IMAGE_PATH+"noe_150x150.png", tooltip="Steady-state NOE analysis", fn=self.select_noe) # The R1 button. - self.button_r1 = self.create_button(id=self.button_ids['r1'], box=sizer1, size=size, bmp=ANALYSIS_IMAGE_PATH+"r1_150x150.png", tooltip=u("R\u2081 relaxation curve-fitting analysis"), fn=self.select_r1) + self.button_r1 = self.create_button(id=self.button_ids['r1'], box=sizer1, size=size, bmp=ANALYSIS_IMAGE_PATH+"r1_150x150.png", tooltip="%s relaxation curve-fitting analysis" % text.r1, fn=self.select_r1) # The R2 button. - self.button_r2 = self.create_button(id=self.button_ids['r2'], box=sizer1, size=size, bmp=ANALYSIS_IMAGE_PATH+"r2_150x150.png", tooltip=u("R\u2082 relaxation curve-fitting analysis"), fn=self.select_r2) + self.button_r2 = self.create_button(id=self.button_ids['r2'], box=sizer1, size=size, bmp=ANALYSIS_IMAGE_PATH+"r2_150x150.png", tooltip="%s relaxation curve-fitting analysis" % text.r1, fn=self.select_r2) # Consistency testing. self.button_consist_test = self.create_button(id=self.button_ids['consist_test'], box=sizer2, size=size, bmp=ANALYSIS_IMAGE_PATH+"consistency_testing_150x70.png", tooltip="Relaxation data consistency testing", fn=self.select_consist_test, disabled=True) Modified: trunk/gui/components/relax_data.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/components/relax_data.py?rev=20916&r1=20915&r2=20916&view=diff ============================================================================== --- trunk/gui/components/relax_data.py (original) +++ trunk/gui/components/relax_data.py Fri Sep 6 18:39:56 2013 @@ -28,8 +28,8 @@ import wx.lib.buttons # relax module imports. -from compat import u from graphics import fetch_icon +from gui import text from gui.components.base_list import Base_list from gui.components.relax_data_meta import Relax_data_meta_list from gui.icons import relax_icons @@ -301,8 +301,8 @@ # Translation table for the Rx data types. table = { "NOE": "Steady-state NOE", - "R1": u("R\u2081 longitudinal relaxation"), - "R2": u("R\u2082 transverse relaxation") + "R1": "%s longitudinal relaxation" % text.r1, + "R2": "%s transverse relaxation" % text.r2 } # Expand the number of rows to match the number of relaxation IDs, and add the IDs. Added: trunk/gui/text.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/text.py?rev=20916&view=auto ============================================================================== --- trunk/gui/text.py (added) +++ trunk/gui/text.py Fri Sep 6 18:39:56 2013 @@ -1,0 +1,47 @@ +############################################################################### +# # +# Copyright (C) 2013 Edward d'Auvergne # +# # +# This file is part of the program relax (http://www.nmr-relax.com). # +# # +# This program 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 3 of the License, or # +# (at your option) any later version. # +# # +# This program 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 this program. If not, see <http://www.gnu.org/licenses/>. # +# # +############################################################################### + +# Module docstring. +"""Module defining a number of text elements for use in the GUI. + +Some of these text elements are operating system dependent due to the incompleteness of the unicode fonts on certain systems. +""" + +# relax module imports. +from compat import SYSTEM, u + + +# Relaxation data GUI text elements. +r1 = u("R\u2081") +r2 = u("R\u2082") + +# Model-free GUI text elements. +s2 = u("S\u00B2") +s2f = u("S\u00B2f") +s2s = u("S\u00B2s") +local_tm = u("local \u03C4\u2098") +tm = u("\u03C4\u2098") +te = u("\u03C4e") +tf = u("\u03C4f") +ts = u("\u03C4s") +rex = u("R\u2091\u2093") +csa = "CSA" +r = "r"