Plugins/VcsPlugins/vcsMercurial/ShelveExtension/ProjectBrowserHelper.py

changeset 3312
7535e5a5cbce
parent 3305
cf4f22a19dc6
child 3359
6b6c224d67d6
equal deleted inserted replaced
3311:b4775920f5b8 3312:7535e5a5cbce
30 30
31 def initMenus(self): 31 def initMenus(self):
32 """ 32 """
33 Public method to generate the extension menus. 33 Public method to generate the extension menus.
34 34
35 Note: Derived class must implement this method.
36
37 @return dictionary of populated menu (dict of QMenu). The dict 35 @return dictionary of populated menu (dict of QMenu). The dict
38 must have the keys 'mainMenu', 'multiMenu', 'backMenu', 'dirMenu' 36 must have the keys 'mainMenu', 'multiMenu', 'backMenu', 'dirMenu'
39 and 'dirMultiMenu'. 37 and 'dirMultiMenu'.
40 """ 38 """
41 self.__menus = {} 39 self.__menus = {}
64 62
65 def menuTitle(self): 63 def menuTitle(self):
66 """ 64 """
67 Public method to get the menu title. 65 Public method to get the menu title.
68 66
69 Note: Derived class must implement this method.
70
71 @return title of the menu (string) 67 @return title of the menu (string)
72 """ 68 """
73 return self.tr("Shelve") 69 return self.tr("Shelve")
70
71 def showExtensionMenu(self, key, controlled):
72 """
73 Public method to prepare the extension menu for display.
74
75 @param key menu key (string, one of 'mainMenu', 'multiMenu',
76 'backMenu', 'dirMenu' or 'dirMultiMenu')
77 @param controlled flag indicating to prepare the menu for a
78 version controlled entry or a non-version controlled entry
79 (boolean)
80 """
81 if key in self.__menus:
82 self.__menus[key].setEnabled(controlled)
74 83
75 def __reopenProject(self, shouldReopen, title): 84 def __reopenProject(self, shouldReopen, title):
76 """ 85 """
77 Private method to reopen the project if needed and wanted. 86 Private method to reopen the project if needed and wanted.
78 87

eric ide

mercurial