267 self._createPopupMenus() |
267 self._createPopupMenus() |
268 |
268 |
269 if self.backMenu is not None: |
269 if self.backMenu is not None: |
270 self.backMenu.setEnabled(True) |
270 self.backMenu.setEnabled(True) |
271 |
271 |
272 if self.project.vcs is not None: |
272 if ( |
|
273 self.project.vcs is not None |
|
274 and not FileSystemUtilities.isRemoteFileName(self.project.getProjectPath()) |
|
275 ): |
273 self.vcsHelper = self.project.vcs.vcsGetProjectBrowserHelper( |
276 self.vcsHelper = self.project.vcs.vcsGetProjectBrowserHelper( |
274 self, self.project, self.isTranslationsBrowser |
277 self, self.project, self.isTranslationsBrowser |
275 ) |
278 ) |
276 self.vcsHelper.addVCSMenus( |
279 self.vcsHelper.addVCSMenus( |
277 self.mainMenu, |
280 self.mainMenu, |
278 self.multiMenu, |
281 self.multiMenu, |
279 self.backMenu, |
282 self.backMenu, |
280 self.dirMenu, |
283 self.dirMenu, |
281 self.dirMultiMenu, |
284 self.dirMultiMenu, |
282 ) |
285 ) |
|
286 else: |
|
287 self.vcsHelper = None |
283 |
288 |
284 def _newProject(self): |
289 def _newProject(self): |
285 """ |
290 """ |
286 Protected slot to handle the newProject signal. |
291 Protected slot to handle the newProject signal. |
287 """ |
292 """ |
500 @type QMenu |
505 @type QMenu |
501 """ |
506 """ |
502 if self.project.vcs is None: |
507 if self.project.vcs is None: |
503 for act in self.menuActions: |
508 for act in self.menuActions: |
504 act.setEnabled(True) |
509 act.setEnabled(True) |
505 else: |
510 elif self.vcsHelper is not None: |
506 self.vcsHelper.showContextMenu(menu, self.menuActions) |
511 self.vcsHelper.showContextMenu(menu, self.menuActions) |
507 |
512 |
508 def _showContextMenuMulti(self, menu): |
513 def _showContextMenuMulti(self, menu): |
509 """ |
514 """ |
510 Protected slot called before the context menu (multiple selections) is |
515 Protected slot called before the context menu (multiple selections) is |
517 @type QMenu |
522 @type QMenu |
518 """ |
523 """ |
519 if self.project.vcs is None: |
524 if self.project.vcs is None: |
520 for act in self.multiMenuActions: |
525 for act in self.multiMenuActions: |
521 act.setEnabled(True) |
526 act.setEnabled(True) |
522 else: |
527 elif self.vcsHelper is not None: |
523 self.vcsHelper.showContextMenuMulti(menu, self.multiMenuActions) |
528 self.vcsHelper.showContextMenuMulti(menu, self.multiMenuActions) |
524 |
529 |
525 def _showContextMenuDir(self, menu): |
530 def _showContextMenuDir(self, menu): |
526 """ |
531 """ |
527 Protected slot called before the context menu is shown. |
532 Protected slot called before the context menu is shown. |
533 @type QMenu |
538 @type QMenu |
534 """ |
539 """ |
535 if self.project.vcs is None: |
540 if self.project.vcs is None: |
536 for act in self.dirMenuActions: |
541 for act in self.dirMenuActions: |
537 act.setEnabled(True) |
542 act.setEnabled(True) |
538 else: |
543 elif self.vcsHelper is not None: |
539 self.vcsHelper.showContextMenuDir(menu, self.dirMenuActions) |
544 self.vcsHelper.showContextMenuDir(menu, self.dirMenuActions) |
540 |
545 |
541 def _showContextMenuDirMulti(self, menu): |
546 def _showContextMenuDirMulti(self, menu): |
542 """ |
547 """ |
543 Protected slot called before the context menu is shown. |
548 Protected slot called before the context menu is shown. |
549 @type QMenu |
554 @type QMenu |
550 """ |
555 """ |
551 if self.project.vcs is None: |
556 if self.project.vcs is None: |
552 for act in self.dirMultiMenuActions: |
557 for act in self.dirMultiMenuActions: |
553 act.setEnabled(True) |
558 act.setEnabled(True) |
554 else: |
559 elif self.vcsHelper is not None: |
555 self.vcsHelper.showContextMenuDirMulti(menu, self.dirMultiMenuActions) |
560 self.vcsHelper.showContextMenuDirMulti(menu, self.dirMultiMenuActions) |
556 |
561 |
557 def _showContextMenuBack(self, menu): # noqa: U100 |
562 def _showContextMenuBack(self, menu): # noqa: U100 |
558 """ |
563 """ |
559 Protected slot called before the context menu is shown. |
564 Protected slot called before the context menu is shown. |