Package gui :: Package components :: Module software
[hide private]
[frames] | no frames]

Source Code for Module gui.components.software

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2009-2011 Michael Bieri                                       # 
  4  # Copyright (C) 2010-2012 Edward d'Auvergne                                   # 
  5  #                                                                             # 
  6  # This file is part of the program relax.                                     # 
  7  #                                                                             # 
  8  # relax is free software; you can redistribute it and/or modify               # 
  9  # it under the terms of the GNU General Public License as published by        # 
 10  # the Free Software Foundation; either version 2 of the License, or           # 
 11  # (at your option) any later version.                                         # 
 12  #                                                                             # 
 13  # relax is distributed in the hope that it will be useful,                    # 
 14  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
 15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
 16  # GNU General Public License for more details.                                # 
 17  #                                                                             # 
 18  # You should have received a copy of the GNU General Public License           # 
 19  # along with relax; if not, write to the Free Software                        # 
 20  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   # 
 21  #                                                                             # 
 22  ############################################################################### 
 23   
 24  # Module docstring. 
 25  """Module containing the software GUI element for listing the software used in the analysis.""" 
 26   
 27  # relax module imports. 
 28  from graphics import fetch_icon 
 29   
 30  # relax GUI module imports. 
 31  from gui.components.base_list import Base_list 
 32  from gui.string_conv import str_to_gui 
 33  from gui.uf_objects import Uf_storage; uf_store = Uf_storage() 
 34   
 35   
36 -class Software(Base_list):
37 """The GUI element for listing the software used in the analysis.""" 38
39 - def action_bmrb_software(self, event):
40 """Launch the bmrb.software user function. 41 42 @param event: The wx event. 43 @type event: wx event 44 """ 45 46 # Launch the dialog. 47 uf_store['bmrb.software'](wx_parent=self.parent)
48 49
50 - def action_bmrb_software_select(self, event):
51 """Launch the bmrb.software_select user function. 52 53 @param event: The wx event. 54 @type event: wx event 55 """ 56 57 # Launch the dialog. 58 uf_store['bmrb.software_select'](wx_parent=self.parent)
59 60
61 - def setup(self):
62 """Override the base variables.""" 63 64 # GUI variables. 65 self.title = "Software" 66 self.observer_base_name = "software" 67 self.button_placement = 'bottom' 68 69 # The column titles. 70 self.columns = [ 71 "Program name" 72 ] 73 74 # Button set up. 75 self.button_info = [ 76 { 77 'object': 'button_add', 78 'label': ' Add', 79 'icon': fetch_icon('oxygen.actions.list-add-relax-blue', "22x22"), 80 'method': self.action_bmrb_software, 81 'tooltip': "Specify the software used in the analysis." 82 }, { 83 'object': 'button_select', 84 'label': ' Select', 85 'icon': fetch_icon('oxygen.actions.edit-select', "22x22"), 86 'method': self.action_bmrb_software_select, 87 'tooltip': "Select the software used in the analysis." 88 } 89 ]
90 91
92 - def update_data(self):
93 """Method called from self.build_element_safe() to update the list data.""" 94 95 # Expand the number of rows to match the number of entries, and add the data. 96 n = 0 97 if hasattr(cdp, 'exp_info') and hasattr(cdp.exp_info, 'software'): 98 n = len(cdp.exp_info.software) 99 for i in range(n): 100 # Set the software name. 101 self.element.InsertStringItem(i, str_to_gui(cdp.exp_info.software[i].name))
102