110 |
110 |
111 self.__dotRadius = 8 |
111 self.__dotRadius = 8 |
112 self.__rowHeight = 20 |
112 self.__rowHeight = 20 |
113 |
113 |
114 self.__branchColors = {} |
114 self.__branchColors = {} |
|
115 self.__allBranchesFilter = self.trUtf8("All") |
115 |
116 |
116 self.logTree.setIconSize(QSize(100 * self.__rowHeight, self.__rowHeight)) |
117 self.logTree.setIconSize(QSize(100 * self.__rowHeight, self.__rowHeight)) |
117 |
118 |
118 self.__projectRevision = -1 |
119 self.__projectRevision = -1 |
119 |
120 |
700 |
701 |
701 if noEntries < self.limitSpinBox.value() and not self.cancelled: |
702 if noEntries < self.limitSpinBox.value() and not self.cancelled: |
702 self.nextButton.setEnabled(False) |
703 self.nextButton.setEnabled(False) |
703 self.limitSpinBox.setEnabled(False) |
704 self.limitSpinBox.setEnabled(False) |
704 |
705 |
|
706 # update the log filters |
705 self.__filterLogsEnabled = False |
707 self.__filterLogsEnabled = False |
706 self.fromDate.setMinimumDate(self.__minDate) |
708 self.fromDate.setMinimumDate(self.__minDate) |
707 self.fromDate.setMaximumDate(self.__maxDate) |
709 self.fromDate.setMaximumDate(self.__maxDate) |
708 self.fromDate.setDate(self.__minDate) |
710 self.fromDate.setDate(self.__minDate) |
709 self.toDate.setMinimumDate(self.__minDate) |
711 self.toDate.setMinimumDate(self.__minDate) |
710 self.toDate.setMaximumDate(self.__maxDate) |
712 self.toDate.setMaximumDate(self.__maxDate) |
711 self.toDate.setDate(self.__maxDate) |
713 self.toDate.setDate(self.__maxDate) |
|
714 |
|
715 branchFilter = self.branchCombo.currentText() |
|
716 if not branchFilter: |
|
717 branchFilter = self.__allBranchesFilter |
|
718 self.branchCombo.clear() |
|
719 self.branchCombo.addItems( |
|
720 [self.__allBranchesFilter] + sorted(self.__branchColors.keys())) |
|
721 self.branchCombo.setCurrentIndex(self.branchCombo.findText(branchFilter)) |
|
722 |
712 self.__filterLogsEnabled = True |
723 self.__filterLogsEnabled = True |
713 self.__filterLogs() |
724 self.__filterLogs() |
714 |
725 |
715 def __readStdout(self): |
726 def __readStdout(self): |
716 """ |
727 """ |
896 @param date new date (QDate) |
907 @param date new date (QDate) |
897 """ |
908 """ |
898 self.__filterLogs() |
909 self.__filterLogs() |
899 |
910 |
900 @pyqtSlot(str) |
911 @pyqtSlot(str) |
|
912 def on_branchCombo_activated(self, txt): |
|
913 """ |
|
914 Private slot called, when a new branch is selected. |
|
915 |
|
916 @param txt text of the selected branch (string) |
|
917 """ |
|
918 self.__filterLogs() |
|
919 |
|
920 @pyqtSlot(str) |
901 def on_fieldCombo_activated(self, txt): |
921 def on_fieldCombo_activated(self, txt): |
902 """ |
922 """ |
903 Private slot called, when a new filter field is selected. |
923 Private slot called, when a new filter field is selected. |
904 |
924 |
905 @param txt text of the selected field (string) |
925 @param txt text of the selected field (string) |
920 Private method to filter the log entries. |
940 Private method to filter the log entries. |
921 """ |
941 """ |
922 if self.__filterLogsEnabled: |
942 if self.__filterLogsEnabled: |
923 from_ = self.fromDate.date().toString("yyyy-MM-dd") |
943 from_ = self.fromDate.date().toString("yyyy-MM-dd") |
924 to_ = self.toDate.date().addDays(1).toString("yyyy-MM-dd") |
944 to_ = self.toDate.date().addDays(1).toString("yyyy-MM-dd") |
|
945 branch = self.branchCombo.currentText() |
|
946 |
925 txt = self.fieldCombo.currentText() |
947 txt = self.fieldCombo.currentText() |
926 if txt == self.trUtf8("Author"): |
948 if txt == self.trUtf8("Author"): |
927 fieldIndex = self.AuthorColumn |
949 fieldIndex = self.AuthorColumn |
928 searchRx = QRegExp(self.rxEdit.text(), Qt.CaseInsensitive) |
950 searchRx = QRegExp(self.rxEdit.text(), Qt.CaseInsensitive) |
929 elif txt == self.trUtf8("Revision"): |
951 elif txt == self.trUtf8("Revision"): |
940 currentItem = self.logTree.currentItem() |
962 currentItem = self.logTree.currentItem() |
941 for topIndex in range(self.logTree.topLevelItemCount()): |
963 for topIndex in range(self.logTree.topLevelItemCount()): |
942 topItem = self.logTree.topLevelItem(topIndex) |
964 topItem = self.logTree.topLevelItem(topIndex) |
943 if topItem.text(self.DateColumn) <= to_ and \ |
965 if topItem.text(self.DateColumn) <= to_ and \ |
944 topItem.text(self.DateColumn) >= from_ and \ |
966 topItem.text(self.DateColumn) >= from_ and \ |
|
967 (branch == self.__allBranchesFilter or \ |
|
968 topItem.text(self.BranchColumn) == branch) and \ |
945 searchRx.indexIn(topItem.text(fieldIndex)) > -1: |
969 searchRx.indexIn(topItem.text(fieldIndex)) > -1: |
946 topItem.setHidden(False) |
970 topItem.setHidden(False) |
947 if topItem is currentItem: |
971 if topItem is currentItem: |
948 self.on_logTree_currentItemChanged(topItem, None) |
972 self.on_logTree_currentItemChanged(topItem, None) |
949 else: |
973 else: |