Changeset 4c0572f in sasview


Ignore:
Timestamp:
Feb 25, 2011 2:03:57 PM (13 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:
8a7d922
Parents:
97ec26b
Message:

modify menu plugin name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guiframe/gui_manager.py

    re75b5fa r4c0572f  
    108108        self._tool_menu = None 
    109109        self._applications_menu_pos = -1 
     110        self._applications_menu_name = None 
    110111        self._applications_menu = None 
    111112        self._edit_menu = None 
     
    147148        self.Bind(EVT_APPEND_BOOKMARK, self.append_bookmark) 
    148149     
     150    def get_data_manager(self): 
     151        """ 
     152        """ 
     153        return self._data_manager 
     154     
    149155    def get_toolbar(self): 
    150156        """ 
     
    190196        self.SetStatusBar(self.sb) 
    191197        # Add panel 
    192         default_flag = wx.aui.AUI_MGR_DEFAULT#| wx.aui.AUI_MGR_ALLOW_ACTIVE_PANE 
     198        default_flag = wx.aui.AUI_MGR_DEFAULT| wx.aui.AUI_MGR_ALLOW_ACTIVE_PANE 
    193199        self._mgr = wx.aui.AuiManager(self, flags=default_flag) 
    194200    
     
    560566            return 
    561567        #replace or add a new menu for the current plugin 
    562         name = 'Others' 
    563         pos = self._menubar.FindMenu(name) 
     568        
     569        pos = self._menubar.FindMenu(str(self._applications_menu_name)) 
    564570        if pos != -1: 
    565571            menu_list = self._current_perspective.populate_menu(self) 
    566572            if menu_list: 
    567                 for (menu, _) in menu_list: 
    568                     hidden_menu = self._menubar.Replace(pos, menu, name)   
     573                for (menu, name) in menu_list: 
     574                    hidden_menu = self._menubar.Replace(pos, menu, name)  
     575                    self._applications_menu_name = name  
     576                #self._applications_menu_pos = pos 
    569577            else: 
    570578                hidden_menu = self._menubar.Remove(pos) 
     579                self._applications_menu_name = None 
    571580            #get the position of the menu when it first added 
    572             self._plugin_menu_pos = pos  
     581            self._applications_menu_pos = pos  
     582             
    573583        else: 
    574584            menu_list = self._current_perspective.populate_menu(self) 
    575585            if menu_list: 
    576                 for (menu, _) in menu_list: 
     586                for (menu,name) in menu_list: 
    577587                    if self._applications_menu_pos == -1: 
    578588                        self._menubar.Append(menu, name) 
    579589                    else: 
    580590                        self._menubar.Insert(self._applications_menu_pos, menu, name) 
     591                    self._applications_menu_name = name 
    581592                   
    582593    def _add_help_menu(self): 
     
    12701281                    if self.enable_add_data(new_plot) and \ 
    12711282                    hasattr(self.panel_on_focus, 'group_id'): 
    1272                         new_plot.group_id = self.panel_on_focus.group_id 
     1283                        new_plot.group_id.append(self.panel_on_focus.group_id) 
     1284            else: 
     1285                #if not append then new plot 
     1286                new_plot.group_id.append(wx.NewId()) 
    12731287            wx.PostEvent(self, NewPlotEvent(plot=new_plot, 
    12741288                                                  title=str(new_plot.title))) 
Note: See TracChangeset for help on using the changeset viewer.