34 ): |
34 ): |
35 """ |
35 """ |
36 Constructor |
36 Constructor |
37 |
37 |
38 @param vcsObject reference to the vcs object |
38 @param vcsObject reference to the vcs object |
|
39 @type Git |
39 @param browserObject reference to the project browser object |
40 @param browserObject reference to the project browser object |
|
41 @type ProjectBaseBrowser |
40 @param projectObject reference to the project object |
42 @param projectObject reference to the project object |
|
43 @type Project |
41 @param isTranslationsBrowser flag indicating, the helper is requested |
44 @param isTranslationsBrowser flag indicating, the helper is requested |
42 for the translations browser (this needs some special treatment) |
45 for the translations browser (this needs some special treatment) |
43 @param parent parent widget (QWidget) |
46 @type bool |
44 @param name name of this object (string) |
47 @param parent parent widget |
|
48 @type QWidget |
|
49 @param name name of this object |
|
50 @type str |
45 """ |
51 """ |
46 VcsProjectBrowserHelper.__init__( |
52 VcsProjectBrowserHelper.__init__( |
47 self, |
53 self, |
48 vcsObject, |
54 vcsObject, |
49 browserObject, |
55 browserObject, |
59 |
65 |
60 It enables/disables the VCS menu entries depending on the overall |
66 It enables/disables the VCS menu entries depending on the overall |
61 VCS status and the file status. |
67 VCS status and the file status. |
62 |
68 |
63 @param menu reference to the menu to be shown |
69 @param menu reference to the menu to be shown |
|
70 @type QMenu |
64 @param standardItems array of standard items that need |
71 @param standardItems array of standard items that need |
65 activation/deactivation depending on the overall VCS status |
72 activation/deactivation depending on the overall VCS status |
|
73 @type list of QAction |
66 """ |
74 """ |
67 if self.browser.currentItem().data(1) == self.vcs.vcsName(): |
75 if self.browser.currentItem().data(1) == self.vcs.vcsName(): |
68 for act in self.vcsMenuActions: |
76 for act in self.vcsMenuActions: |
69 act.setEnabled(True) |
77 act.setEnabled(True) |
70 for act in standardItems: |
78 for act in standardItems: |
84 |
92 |
85 It enables/disables the VCS menu entries depending on the overall |
93 It enables/disables the VCS menu entries depending on the overall |
86 VCS status and the files status. |
94 VCS status and the files status. |
87 |
95 |
88 @param menu reference to the menu to be shown |
96 @param menu reference to the menu to be shown |
|
97 @type QMenu |
89 @param standardItems array of standard items that need |
98 @param standardItems array of standard items that need |
90 activation/deactivation depending on the overall VCS status |
99 activation/deactivation depending on the overall VCS status |
|
100 @type list of QAction |
91 """ |
101 """ |
92 vcsName = self.vcs.vcsName() |
102 vcsName = self.vcs.vcsName() |
93 items = self.browser.getSelectedItems() |
103 items = self.browser.getSelectedItems() |
94 vcsItems = 0 |
104 vcsItems = 0 |
95 # determine number of selected items under VCS control |
105 # determine number of selected items under VCS control |
118 |
128 |
119 It enables/disables the VCS menu entries depending on the overall |
129 It enables/disables the VCS menu entries depending on the overall |
120 VCS status and the directory status. |
130 VCS status and the directory status. |
121 |
131 |
122 @param menu reference to the menu to be shown |
132 @param menu reference to the menu to be shown |
|
133 @type QMenu |
123 @param standardItems array of standard items that need |
134 @param standardItems array of standard items that need |
124 activation/deactivation depending on the overall VCS status |
135 activation/deactivation depending on the overall VCS status |
|
136 @type list of QAction |
125 """ |
137 """ |
126 if self.browser.currentItem().data(1) == self.vcs.vcsName(): |
138 if self.browser.currentItem().data(1) == self.vcs.vcsName(): |
127 for act in self.vcsDirMenuActions: |
139 for act in self.vcsDirMenuActions: |
128 act.setEnabled(True) |
140 act.setEnabled(True) |
129 for act in standardItems: |
141 for act in standardItems: |
140 |
152 |
141 It enables/disables the VCS menu entries depending on the overall |
153 It enables/disables the VCS menu entries depending on the overall |
142 VCS status and the directory status. |
154 VCS status and the directory status. |
143 |
155 |
144 @param menu reference to the menu to be shown |
156 @param menu reference to the menu to be shown |
|
157 @type QMenu |
145 @param standardItems array of standard items that need |
158 @param standardItems array of standard items that need |
146 activation/deactivation depending on the overall VCS status |
159 activation/deactivation depending on the overall VCS status |
|
160 @type list of QAction |
147 """ |
161 """ |
148 vcsName = self.vcs.vcsName() |
162 vcsName = self.vcs.vcsName() |
149 items = self.browser.getSelectedItems() |
163 items = self.browser.getSelectedItems() |
150 vcsItems = 0 |
164 vcsItems = 0 |
151 # determine number of selected items under VCS control |
165 # determine number of selected items under VCS control |
175 def _addVCSMenu(self, mainMenu): |
189 def _addVCSMenu(self, mainMenu): |
176 """ |
190 """ |
177 Protected method used to add the VCS menu to all project browsers. |
191 Protected method used to add the VCS menu to all project browsers. |
178 |
192 |
179 @param mainMenu reference to the menu to be amended |
193 @param mainMenu reference to the menu to be amended |
|
194 @type QMenu |
180 """ |
195 """ |
181 self.vcsMenuActions = [] |
196 self.vcsMenuActions = [] |
182 self.vcsAddMenuActions = [] |
197 self.vcsAddMenuActions = [] |
183 |
198 |
184 menu = QMenu(self.tr("Version Control")) |
199 menu = QMenu(self.tr("Version Control")) |