1   
  2   
  3   
  4   
  5   
  6   
  7   
  8   
  9   
 10   
 11   
 12   
 13   
 14   
 15   
 16   
 17   
 18   
 19   
 20   
 21   
 22   
 23   
 24  """Module containing the software GUI element for listing the software used in the analysis.""" 
 25   
 26   
 27  from graphics import fetch_icon 
 28  from gui.components.base_list import Base_list 
 29  from gui.string_conv import str_to_gui 
 30  from gui.uf_objects import Uf_storage; uf_store = Uf_storage() 
 31   
 32   
 34      """The GUI element for listing the software used in the analysis.""" 
 35   
 37          """Launch the bmrb.software user function. 
 38   
 39          @param event:   The wx event. 
 40          @type event:    wx event 
 41          """ 
 42   
 43           
 44          uf_store['bmrb.software'](wx_parent=self.parent) 
  45   
 46   
 48          """Launch the bmrb.software_select user function. 
 49   
 50          @param event:   The wx event. 
 51          @type event:    wx event 
 52          """ 
 53   
 54           
 55          uf_store['bmrb.software_select'](wx_parent=self.parent) 
  56   
 57   
 59          """Override the base variables.""" 
 60   
 61           
 62          self.title = "Software" 
 63          self.observer_base_name = "software" 
 64          self.button_placement = 'bottom' 
 65   
 66           
 67          self.columns = [ 
 68              "Program name" 
 69          ] 
 70   
 71           
 72          self.button_info = [ 
 73              { 
 74                  'object': 'button_add', 
 75                  'label': ' Add', 
 76                  'icon': fetch_icon('oxygen.actions.list-add-relax-blue', "22x22"), 
 77                  'method': self.action_bmrb_software, 
 78                  'tooltip': "Specify the software used in the analysis." 
 79              }, { 
 80                  'object': 'button_select', 
 81                  'label': ' Select', 
 82                  'icon': fetch_icon('oxygen.actions.edit-select', "22x22"), 
 83                  'method': self.action_bmrb_software_select, 
 84                  'tooltip': "Select the software used in the analysis." 
 85              } 
 86          ] 
  87   
 88   
 90          """Method called from self.build_element_safe() to update the list data.""" 
 91   
 92           
 93          n = 0 
 94          if hasattr(cdp, 'exp_info') and hasattr(cdp.exp_info, 'software'): 
 95              n = len(cdp.exp_info.software) 
 96              for i in range(n): 
 97                   
 98                  self.element.InsertStringItem(i, str_to_gui(cdp.exp_info.software[i].name)) 
   99