77 |
77 |
78 self.menuactions = [] |
78 self.menuactions = [] |
79 self.menu = QMenu() |
79 self.menu = QMenu() |
80 self.menuactions.append(self.menu.addAction( |
80 self.menuactions.append(self.menu.addAction( |
81 self.trUtf8("Commit changes to repository..."), self.__commit)) |
81 self.trUtf8("Commit changes to repository..."), self.__commit)) |
|
82 self.menuactions.append(self.menu.addAction( |
|
83 self.trUtf8("Select all for commit"), self.__commitSelectAll)) |
|
84 self.menuactions.append(self.menu.addAction( |
|
85 self.trUtf8("Deselect all from commit"), self.__commitDeselectAll)) |
82 self.menu.addSeparator() |
86 self.menu.addSeparator() |
83 self.menuactions.append(self.menu.addAction( |
87 self.menuactions.append(self.menu.addAction( |
84 self.trUtf8("Add to repository"), self.__add)) |
88 self.trUtf8("Add to repository"), self.__add)) |
85 self.menuactions.append(self.menu.addAction( |
89 self.menuactions.append(self.menu.addAction( |
86 self.trUtf8("Show differences"), self.__diff)) |
90 self.trUtf8("Show differences"), self.__diff)) |
236 pysvn.wc_status_kind.deleted, |
240 pysvn.wc_status_kind.deleted, |
237 pysvn.wc_status_kind.modified] or \ |
241 pysvn.wc_status_kind.modified] or \ |
238 propStatus in [pysvn.wc_status_kind.added, |
242 propStatus in [pysvn.wc_status_kind.added, |
239 pysvn.wc_status_kind.deleted, |
243 pysvn.wc_status_kind.deleted, |
240 pysvn.wc_status_kind.modified]: |
244 pysvn.wc_status_kind.modified]: |
|
245 itm.setFlags(itm.flags() | Qt.ItemIsUserCheckable) |
241 itm.setCheckState(self.__toBeCommittedColumn, Qt.Checked) |
246 itm.setCheckState(self.__toBeCommittedColumn, Qt.Checked) |
|
247 else: |
|
248 itm.setFlags(itm.flags() & ~Qt.ItemIsUserCheckable) |
242 |
249 |
243 if statusText not in self.__statusFilters: |
250 if statusText not in self.__statusFilters: |
244 self.__statusFilters.append(statusText) |
251 self.__statusFilters.append(statusText) |
245 |
252 |
246 def start(self, fn): |
253 def start(self, fn): |
593 """ |
600 """ |
594 if self.isVisible(): |
601 if self.isVisible(): |
595 self.on_refreshButton_clicked() |
602 self.on_refreshButton_clicked() |
596 self.vcs.checkVCSStatus() |
603 self.vcs.checkVCSStatus() |
597 |
604 |
|
605 def __commitSelectAll(self): |
|
606 """ |
|
607 Private slot to select all entries for commit. |
|
608 """ |
|
609 self.__commitSelect(True) |
|
610 |
|
611 def __commitDeselectAll(self): |
|
612 """ |
|
613 Private slot to deselect all entries from commit. |
|
614 """ |
|
615 self.__commitSelect(False) |
|
616 |
598 def __add(self): |
617 def __add(self): |
599 """ |
618 """ |
600 Private slot to handle the Add context menu entry. |
619 Private slot to handle the Add context menu entry. |
601 """ |
620 """ |
602 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
621 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
861 clitems = [] |
880 clitems = [] |
862 for itm in self.statusList.selectedItems(): |
881 for itm in self.statusList.selectedItems(): |
863 if not itm.text(self.__changelistColumn): |
882 if not itm.text(self.__changelistColumn): |
864 clitems.append(itm) |
883 clitems.append(itm) |
865 return clitems |
884 return clitems |
|
885 |
|
886 def __commitSelect(self, selected): |
|
887 """ |
|
888 Private slot to select or deselect all entries. |
|
889 |
|
890 @param selected commit selection state to be set (boolean) |
|
891 """ |
|
892 for index in range(self.statusList.topLevelItemCount()): |
|
893 itm = self.statusList.topLevelItem(index) |
|
894 if itm.flags() & Qt.ItemIsUserCheckable: |
|
895 if selected: |
|
896 itm.setCheckState(self.__toBeCommittedColumn, Qt.Checked) |
|
897 else: |
|
898 itm.setCheckState(self.__toBeCommittedColumn, Qt.Unchecked) |