src/eric7/Plugins/VcsPlugins/vcsMercurial/LargefilesExtension/ProjectBrowserHelper.py

branch
eric7
changeset 10438
4cd7e5a8b3cf
parent 9653
e67609152c5e
child 10439
21c28b0f9e41
equal deleted inserted replaced
10437:2f70ca07f0af 10438:4cd7e5a8b3cf
22 def __init__(self, vcsObject, browserObject, projectObject): 22 def __init__(self, vcsObject, browserObject, projectObject):
23 """ 23 """
24 Constructor 24 Constructor
25 25
26 @param vcsObject reference to the vcs object 26 @param vcsObject reference to the vcs object
27 @type Hg
27 @param browserObject reference to the project browser object 28 @param browserObject reference to the project browser object
29 @type ProjectBaseBrowser
28 @param projectObject reference to the project object 30 @param projectObject reference to the project object
31 @type Project
29 """ 32 """
30 super().__init__(vcsObject, browserObject, projectObject) 33 super().__init__(vcsObject, browserObject, projectObject)
31 34
32 def initMenus(self): 35 def initMenus(self):
33 """ 36 """
34 Public method to generate the extension menus. 37 Public method to generate the extension menus.
35 38
36 Note: Derived class must implement this method. 39 Note: Derived class must implement this method.
37 40
38 @return dictionary of populated menu (dict of QMenu). The dict 41 @return dictionary of populated menu. The dict must have the keys
39 must have the keys 'mainMenu', 'multiMenu', 'backMenu', 'dirMenu' 42 'mainMenu', 'multiMenu', 'backMenu', 'dirMenu' and 'dirMultiMenu'.
40 and 'dirMultiMenu'. 43 @rtype dict of QMenu
41 """ 44 """
42 self.__menus = {} 45 self.__menus = {}
43 self.__addSingleActs = [] 46 self.__addSingleActs = []
44 self.__addMultiActs = [] 47 self.__addMultiActs = []
45 48
81 """ 84 """
82 Public method to get the menu title. 85 Public method to get the menu title.
83 86
84 Note: Derived class must implement this method. 87 Note: Derived class must implement this method.
85 88
86 @return title of the menu (string) 89 @return title of the menu
90 @rtype str
87 """ 91 """
88 return self.tr("Large Files") 92 return self.tr("Large Files")
89 93
90 def showExtensionMenu(self, key, controlled): 94 def showExtensionMenu(self, key, controlled):
91 """ 95 """
92 Public method to prepare the extension menu for display. 96 Public method to prepare the extension menu for display.
93 97
94 @param key menu key (string, one of 'mainMenu', 'multiMenu', 98 @param key menu key (one of 'mainMenu', 'multiMenu', 'backMenu', 'dirMenu'
95 'backMenu', 'dirMenu' or 'dirMultiMenu') 99 or 'dirMultiMenu')
100 @type str
96 @param controlled flag indicating to prepare the menu for a 101 @param controlled flag indicating to prepare the menu for a
97 version controlled entry or a non-version controlled entry 102 version controlled entry or a non-version controlled entry
98 (boolean) 103 @type bool
99 """ 104 """
100 if key == "mainMenu": 105 if key == "mainMenu":
101 for act in self.__addSingleActs: 106 for act in self.__addSingleActs:
102 act.setEnabled(not controlled) 107 act.setEnabled(not controlled)
103 elif key == "multiMenu": 108 elif key == "multiMenu":
106 111
107 def __hgAddLargefiles(self, mode): 112 def __hgAddLargefiles(self, mode):
108 """ 113 """
109 Private slot to add the selected files as large files. 114 Private slot to add the selected files as large files.
110 115
111 @param mode add mode (string one of 'normal' or 'large') 116 @param mode add mode (string ne of 'normal' or 'large')
117 @type str
112 """ 118 """
113 names = [] 119 names = []
114 for itm in self.browser.getSelectedItems(): 120 for itm in self.browser.getSelectedItems():
115 try: 121 try:
116 name = itm.fileName() 122 name = itm.fileName()

eric ide

mercurial