- Timestamp:
- Feb 1, 2011 7:47:54 PM (14 years ago)
- 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:
- cab076b
- Parents:
- 4986ce7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/gui_manager.py
rcbf22e5 r7bc88bf 103 103 self._help_menu = None 104 104 self._tool_menu = None 105 self._plugin_menu = None105 self._plugin_menu_pos = -1 106 106 ## Find plug-ins 107 107 # Modify this so that we can specify the directory to look into … … 476 476 self._add_menu_application() 477 477 self._add_menu_tool() 478 self._add_current_plugin_menu() 478 479 self._add_menu_window() 479 480 self._add_help_menu() 480 self._add_current_plugin_menu()481 481 self.SetMenuBar(self._menubar) 482 482 … … 507 507 Add available plug-in sub-menus. 508 508 """ 509 if self._menubar is None:509 if (self._menubar is None) or (self._current_perspective is None): 510 510 return 511 512 pos = self._menubar.GetMenuCount() 513 if self._current_perspective is not None: 514 if self._current_perspective != self._plotting_plugin: 515 menu_list = self._current_perspective.populate_menu(self) 516 if menu_list: 517 for (menu, name) in menu_list: 518 self._plugin_menu = self._menubar.Append(menu, 'Others') 519 #else: 520 # self._plugin_menu = self._menubar.Append(wx.Menu(), 'all') 521 #else: 522 # self._plugin_menu = self._menubar.Insert(pos, wx.Menu(), 'all') 523 511 #replace or add a new menu for the current plugin 512 name = 'Others' 513 pos = self._menubar.FindMenu(name) 514 if pos != -1: 515 menu_list = self._current_perspective.populate_menu(self) 516 if menu_list: 517 for (menu, _) in menu_list: 518 hidden_menu = self._menubar.Replace(self._plugin_menu_pos, 519 menu, name) 520 else: 521 hidden_menu = self._menubar.Remove(pos) 522 #get the position of the menu when it first added 523 self._plugin_menu_pos = pos 524 else: 525 menu_list = self._current_perspective.populate_menu(self) 526 if menu_list: 527 for (menu, _) in menu_list: 528 if self._plugin_menu_pos == -1: 529 self._menubar.Append(menu, name) 530 else: 531 self._menubar.Insert(self._plugin_menu_pos, menu, name) 532 524 533 def _add_help_menu(self): 525 534 """
Note: See TracChangeset
for help on using the changeset viewer.