73 |
73 |
74 self.menuactions = [] |
74 self.menuactions = [] |
75 self.menu = QMenu() |
75 self.menu = QMenu() |
76 self.menuactions.append(self.menu.addAction( |
76 self.menuactions.append(self.menu.addAction( |
77 self.trUtf8("Commit changes to repository..."), self.__commit)) |
77 self.trUtf8("Commit changes to repository..."), self.__commit)) |
|
78 self.menuactions.append(self.menu.addAction( |
|
79 self.trUtf8("Select all for commit"), self.__commitSelectAll)) |
|
80 self.menuactions.append(self.menu.addAction( |
|
81 self.trUtf8("Deselect all from commit"), self.__commitDeselectAll)) |
78 self.menu.addSeparator() |
82 self.menu.addSeparator() |
79 self.menuactions.append(self.menu.addAction( |
83 self.menuactions.append(self.menu.addAction( |
80 self.trUtf8("Add to repository"), self.__add)) |
84 self.trUtf8("Add to repository"), self.__add)) |
81 self.menuactions.append(self.menu.addAction( |
85 self.menuactions.append(self.menu.addAction( |
82 self.trUtf8("Show differences"), self.__diff)) |
86 self.trUtf8("Show differences"), self.__diff)) |
267 itm.setTextAlignment(10, Qt.AlignRight) |
271 itm.setTextAlignment(10, Qt.AlignRight) |
268 itm.setTextAlignment(11, Qt.AlignLeft) |
272 itm.setTextAlignment(11, Qt.AlignLeft) |
269 itm.setTextAlignment(12, Qt.AlignLeft) |
273 itm.setTextAlignment(12, Qt.AlignLeft) |
270 |
274 |
271 if status in "ADM" or propStatus in "M": |
275 if status in "ADM" or propStatus in "M": |
|
276 itm.setFlags(itm.flags() | Qt.ItemIsUserCheckable) |
272 itm.setCheckState(self.__toBeCommittedColumn, Qt.Checked) |
277 itm.setCheckState(self.__toBeCommittedColumn, Qt.Checked) |
|
278 else: |
|
279 itm.setFlags(itm.flags() & ~Qt.ItemIsUserCheckable) |
273 |
280 |
274 self.hidePropertyStatusColumn = self.hidePropertyStatusColumn and \ |
281 self.hidePropertyStatusColumn = self.hidePropertyStatusColumn and \ |
275 propStatus == " " |
282 propStatus == " " |
276 self.hideLockColumns = self.hideLockColumns and \ |
283 self.hideLockColumns = self.hideLockColumns and \ |
277 locked == " " and lockinfo == " " |
284 locked == " " and lockinfo == " " |
687 """ |
694 """ |
688 if self.isVisible(): |
695 if self.isVisible(): |
689 self.on_refreshButton_clicked() |
696 self.on_refreshButton_clicked() |
690 self.vcs.checkVCSStatus() |
697 self.vcs.checkVCSStatus() |
691 |
698 |
|
699 def __commitSelectAll(self): |
|
700 """ |
|
701 Private slot to select all entries for commit. |
|
702 """ |
|
703 self.__commitSelect(True) |
|
704 |
|
705 def __commitDeselectAll(self): |
|
706 """ |
|
707 Private slot to deselect all entries from commit. |
|
708 """ |
|
709 self.__commitSelect(False) |
|
710 |
692 def __add(self): |
711 def __add(self): |
693 """ |
712 """ |
694 Private slot to handle the Add context menu entry. |
713 Private slot to handle the Add context menu entry. |
695 """ |
714 """ |
696 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) |
715 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) |
955 clitems = [] |
974 clitems = [] |
956 for itm in self.statusList.selectedItems(): |
975 for itm in self.statusList.selectedItems(): |
957 if itm.text(self.__changelistColumn) == "": |
976 if itm.text(self.__changelistColumn) == "": |
958 clitems.append(itm) |
977 clitems.append(itm) |
959 return clitems |
978 return clitems |
|
979 |
|
980 def __commitSelect(self, selected): |
|
981 """ |
|
982 Private slot to select or deselect all entries. |
|
983 |
|
984 @param selected commit selection state to be set (boolean) |
|
985 """ |
|
986 for index in range(self.statusList.topLevelItemCount()): |
|
987 itm = self.statusList.topLevelItem(index) |
|
988 if itm.flags() & Qt.ItemIsUserCheckable: |
|
989 if selected: |
|
990 itm.setCheckState(self.__toBeCommittedColumn, Qt.Checked) |
|
991 else: |
|
992 itm.setCheckState(self.__toBeCommittedColumn, Qt.Unchecked) |