233 |
233 |
234 def _contextMenuRequested(self, coord): |
234 def _contextMenuRequested(self, coord): |
235 """ |
235 """ |
236 Protected slot to show the context menu. |
236 Protected slot to show the context menu. |
237 |
237 |
238 @param coord the position of the mouse pointer (QPoint) |
238 @param coord the position of the mouse pointer |
|
239 @type QPoint |
239 """ |
240 """ |
240 if not self.project.isOpen(): |
241 if not self.project.isOpen(): |
241 return |
242 return |
242 |
243 |
243 with contextlib.suppress(Exception): # secok |
244 with contextlib.suppress(Exception): # secok |
322 Protected slot called before the context menu is shown. |
323 Protected slot called before the context menu is shown. |
323 |
324 |
324 It enables/disables the VCS menu entries depending on the overall |
325 It enables/disables the VCS menu entries depending on the overall |
325 VCS status and the file status. |
326 VCS status and the file status. |
326 |
327 |
327 @param menu Reference to the popup menu (QPopupMenu) |
328 @param menu Reference to the popup menu |
|
329 @type QPopupMenu |
328 """ |
330 """ |
329 if self.project.vcs is None: |
331 if self.project.vcs is None: |
330 for act in self.menuActions: |
332 for act in self.menuActions: |
331 act.setEnabled(True) |
333 act.setEnabled(True) |
332 itm = self.model().item(self.currentIndex()) |
334 itm = self.model().item(self.currentIndex()) |