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 @return dictionary of populated menu (dict of QMenu). The dict |
39 @return dictionary of populated menu. The dict must have the keys 'mainMenu', |
37 must have the keys 'mainMenu', 'multiMenu', 'backMenu', 'dirMenu' |
40 'multiMenu', 'backMenu', 'dirMenu' and 'dirMultiMenu'. |
38 and 'dirMultiMenu'. |
41 @rtype dict of QMenu |
39 """ |
42 """ |
40 self.__menus = {} |
43 self.__menus = {} |
41 |
44 |
42 menu = QMenu(self.menuTitle()) |
45 menu = QMenu(self.menuTitle()) |
43 menu.setTearOffEnabled(True) |
46 menu.setTearOffEnabled(True) |
63 |
66 |
64 def menuTitle(self): |
67 def menuTitle(self): |
65 """ |
68 """ |
66 Public method to get the menu title. |
69 Public method to get the menu title. |
67 |
70 |
68 @return title of the menu (string) |
71 @return title of the menu |
|
72 @rtype str |
69 """ |
73 """ |
70 return self.tr("Shelve") |
74 return self.tr("Shelve") |
71 |
75 |
72 def showExtensionMenu(self, key, controlled): |
76 def showExtensionMenu(self, key, controlled): |
73 """ |
77 """ |
74 Public method to prepare the extension menu for display. |
78 Public method to prepare the extension menu for display. |
75 |
79 |
76 @param key menu key (string, one of 'mainMenu', 'multiMenu', |
80 @param key menu key (one of 'mainMenu', 'multiMenu', 'backMenu', 'dirMenu' |
77 'backMenu', 'dirMenu' or 'dirMultiMenu') |
81 or 'dirMultiMenu') |
|
82 @type str |
78 @param controlled flag indicating to prepare the menu for a |
83 @param controlled flag indicating to prepare the menu for a |
79 version controlled entry or a non-version controlled entry |
84 version controlled entry or a non-version controlled entry |
80 (boolean) |
85 @type bool |
81 """ |
86 """ |
82 if key in self.__menus: |
87 if key in self.__menus: |
83 self.__menus[key].setEnabled(controlled) |
88 self.__menus[key].setEnabled(controlled) |
84 |
89 |
85 def __reopenProject(self, shouldReopen, title): |
90 def __reopenProject(self, shouldReopen, title): |
86 """ |
91 """ |
87 Private method to reopen the project if needed and wanted. |
92 Private method to reopen the project if needed and wanted. |
88 |
93 |
89 @param shouldReopen flag indicating that the project should |
94 @param shouldReopen flag indicating that the project should |
90 be reopened (boolean) |
95 be reopened |
91 @param title title of the message box (string) |
96 @type bool |
|
97 @param title title of the message box |
|
98 @type str |
92 """ |
99 """ |
93 if shouldReopen: |
100 if shouldReopen: |
94 res = EricMessageBox.yesNo( |
101 res = EricMessageBox.yesNo( |
95 None, |
102 None, |
96 title, |
103 title, |