480 @param menu reference to the menu to be shown (QMenu) |
480 @param menu reference to the menu to be shown (QMenu) |
481 """ |
481 """ |
482 # nothing to do for now |
482 # nothing to do for now |
483 return |
483 return |
484 |
484 |
485 def _selectEntries(self, local=True, filter=None): |
485 def _selectEntries(self, local=True, filterList=None): |
486 """ |
486 """ |
487 Protected method to select entries based on their VCS status. |
487 Protected method to select entries based on their VCS status. |
488 |
488 |
489 @param local flag indicating local (i.e. non VCS controlled) |
489 @param local flag indicating local (i.e. non VCS controlled) |
490 file/directory entries should be selected (boolean) |
490 file/directory entries should be selected (boolean) |
491 @param filter list of classes to check against |
491 @param filterList list of classes to check against |
492 """ |
492 """ |
493 if self.project.vcs is None: |
493 if self.project.vcs is None: |
494 return |
494 return |
495 |
495 |
496 if local: |
496 if local: |
512 endIndex = None |
512 endIndex = None |
513 selectedEntries = 0 |
513 selectedEntries = 0 |
514 index = self.model().index(0, 0) |
514 index = self.model().index(0, 0) |
515 while index.isValid(): |
515 while index.isValid(): |
516 itm = self.model().item(index) |
516 itm = self.model().item(index) |
517 if self.wantedItem(itm, filter) and \ |
517 if self.wantedItem(itm, filterList) and \ |
518 compareString == itm.data(1): |
518 compareString == itm.data(1): |
519 if startIndex is not None and \ |
519 if startIndex is not None and \ |
520 startIndex.parent() != index.parent(): |
520 startIndex.parent() != index.parent(): |
521 self._setItemRangeSelected(startIndex, endIndex, True) |
521 self._setItemRangeSelected(startIndex, endIndex, True) |
522 startIndex = None |
522 startIndex = None |
545 |
545 |
546 def selectLocalEntries(self): |
546 def selectLocalEntries(self): |
547 """ |
547 """ |
548 Public slot to handle the select local files context menu entries. |
548 Public slot to handle the select local files context menu entries. |
549 """ |
549 """ |
550 self._selectEntries(local=True, filter=[ProjectBrowserFileItem]) |
550 self._selectEntries(local=True, filterList=[ProjectBrowserFileItem]) |
551 |
551 |
552 def selectVCSEntries(self): |
552 def selectVCSEntries(self): |
553 """ |
553 """ |
554 Public slot to handle the select VCS files context menu entries. |
554 Public slot to handle the select VCS files context menu entries. |
555 """ |
555 """ |
556 self._selectEntries(local=False, filter=[ProjectBrowserFileItem]) |
556 self._selectEntries(local=False, filterList=[ProjectBrowserFileItem]) |
557 |
557 |
558 def selectLocalDirEntries(self): |
558 def selectLocalDirEntries(self): |
559 """ |
559 """ |
560 Public slot to handle the select local directories context menu |
560 Public slot to handle the select local directories context menu |
561 entries. |
561 entries. |
562 """ |
562 """ |
563 self._selectEntries( |
563 self._selectEntries( |
564 local=True, |
564 local=True, |
565 filter=[ProjectBrowserSimpleDirectoryItem, |
565 filterList=[ProjectBrowserSimpleDirectoryItem, |
566 ProjectBrowserDirectoryItem]) |
566 ProjectBrowserDirectoryItem]) |
567 |
567 |
568 def selectVCSDirEntries(self): |
568 def selectVCSDirEntries(self): |
569 """ |
569 """ |
570 Public slot to handle the select VCS directories context menu entries. |
570 Public slot to handle the select VCS directories context menu entries. |
571 """ |
571 """ |
572 self._selectEntries( |
572 self._selectEntries( |
573 local=False, |
573 local=False, |
574 filter=[ProjectBrowserSimpleDirectoryItem, |
574 filterList=[ProjectBrowserSimpleDirectoryItem, |
575 ProjectBrowserDirectoryItem]) |
575 ProjectBrowserDirectoryItem]) |
576 |
576 |
577 def getExpandedItemNames(self): |
577 def getExpandedItemNames(self): |
578 """ |
578 """ |
579 Public method to get the file/directory names of all expanded items. |
579 Public method to get the file/directory names of all expanded items. |
580 |
580 |