Changeset b28278e in sasview


Ignore:
Timestamp:
Feb 4, 2010 12:36:05 PM (14 years ago)
Author:
Gervaise Alina <gervyh@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
3e85fdde
Parents:
c363d74
Message:

adding another method set_default_perspective for plugin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guiframe/gui_manager.py

    r629e8b9 rb28278e  
    159159        """ 
    160160        pass 
    161  
     161     
     162    def set_default_perspective(self): 
     163        """ 
     164           Call back method that True to notify the parent that the current plug-in 
     165           can be set as default  perspective. 
     166           when returning False, the plug-in is not candidate for an automatic  
     167           default perspective setting 
     168        """ 
     169        return False 
    162170 
    163171class ViewerFrame(wx.Frame): 
     
    329337        """ 
    330338        self.defaultPanel    = panel_class(self, -1, style=wx.RAISED_BORDER) 
    331         self.defaultPanel.set_manager(manager=self.app_manager) 
    332        
     339         
    333340    def _load_panels(self): 
    334341        """ 
     
    390397                                  #BestSize(wx.Size(550,600))) 
    391398                                  #MinSize(wx.Size(500,500)))                  
    392                  
    393          
     399       
    394400    def get_context_menu(self, graph=None): 
    395401        """ 
     
    609615        self.show_panel(evt.GetId()) 
    610616         
    611     def on_close_welcome_panel(self ): 
     617    def on_close_welcome_panel(self): 
    612618        """ 
    613619            Close the welcome panel 
     
    617623        self._mgr.GetPane(self.panels["default"].window_name).Hide() 
    618624        self._mgr.Update() 
    619         
     625        # set a default perspective 
     626        self.set_default_perspective() 
    620627         
    621628    def show_welcome_panel(self, event): 
     
    785792                item.post_init() 
    786793         
     794    def set_default_perspective(self): 
     795        """ 
     796            Choose among the plugin the first plug-in that has  
     797            "set_default_perspective" method and its return value is True will be 
     798            as a default perspective when the welcome page is closed 
     799        """ 
     800        for item in self.plugins: 
     801            if hasattr(item, "set_default_perspective"): 
     802                if item.set_default_perspective(): 
     803                    item.on_perspective(event=None) 
     804                    return  
     805             
    787806    def set_perspective(self, panels): 
    788807        """ 
Note: See TracChangeset for help on using the changeset viewer.