30 @param vcs reference to the VCS object (Git) |
30 @param vcs reference to the VCS object (Git) |
31 @param parent reference to the parent widget (QWidget) |
31 @param parent reference to the parent widget (QWidget) |
32 """ |
32 """ |
33 super(GitPatchStatisticsDialog, self).__init__(parent) |
33 super(GitPatchStatisticsDialog, self).__init__(parent) |
34 self.setupUi(self) |
34 self.setupUi(self) |
35 self.setWindowFlags(Qt.Window) |
35 self.setWindowFlags(Qt.WindowType.Window) |
36 |
36 |
37 self.__vcs = vcs |
37 self.__vcs = vcs |
38 |
38 |
39 self.changesTreeWidget.headerItem().setText( |
39 self.changesTreeWidget.headerItem().setText( |
40 self.changesTreeWidget.columnCount(), "") |
40 self.changesTreeWidget.columnCount(), "") |
41 self.changesTreeWidget.header().setSortIndicator(2, Qt.AscendingOrder) |
41 self.changesTreeWidget.header().setSortIndicator( |
|
42 2, Qt.SortOrder.AscendingOrder) |
42 |
43 |
43 def start(self, projectDir, patchCheckData): |
44 def start(self, projectDir, patchCheckData): |
44 """ |
45 """ |
45 Public method to start the statistics process. |
46 Public method to start the statistics process. |
46 |
47 |
60 if os.path.splitdrive(repodir)[1] == os.sep: |
61 if os.path.splitdrive(repodir)[1] == os.sep: |
61 return |
62 return |
62 |
63 |
63 from .GitPatchFilesDialog import GitPatchFilesDialog |
64 from .GitPatchFilesDialog import GitPatchFilesDialog |
64 dlg = GitPatchFilesDialog(repodir, patchCheckData) |
65 dlg = GitPatchFilesDialog(repodir, patchCheckData) |
65 if dlg.exec() == QDialog.Accepted: |
66 if dlg.exec() == QDialog.DialogCode.Accepted: |
66 patchFilesList, stripCount, inaccurateEof, recount = dlg.getData() |
67 patchFilesList, stripCount, inaccurateEof, recount = dlg.getData() |
67 self.__patchCheckData = (patchFilesList, stripCount, |
68 self.__patchCheckData = (patchFilesList, stripCount, |
68 inaccurateEof, recount) |
69 inaccurateEof, recount) |
69 if patchFilesList: |
70 if patchFilesList: |
70 process = QProcess() |
71 process = QProcess() |
137 @param line string with file statistics data (string) |
138 @param line string with file statistics data (string) |
138 """ |
139 """ |
139 insertions, deletions, filename = line.strip().split(None, 2) |
140 insertions, deletions, filename = line.strip().split(None, 2) |
140 itm = QTreeWidgetItem(self.changesTreeWidget, |
141 itm = QTreeWidgetItem(self.changesTreeWidget, |
141 [insertions, deletions, filename]) |
142 [insertions, deletions, filename]) |
142 itm.setTextAlignment(0, Qt.AlignRight) |
143 itm.setTextAlignment(0, Qt.AlignmentFlag.AlignRight) |
143 itm.setTextAlignment(1, Qt.AlignRight) |
144 itm.setTextAlignment(1, Qt.AlignmentFlag.AlignRight) |
144 |
145 |
145 def __resizeColumns(self): |
146 def __resizeColumns(self): |
146 """ |
147 """ |
147 Private method to resize the list columns. |
148 Private method to resize the list columns. |
148 """ |
149 """ |
149 self.changesTreeWidget.header().resizeSections( |
150 self.changesTreeWidget.header().resizeSections( |
150 QHeaderView.ResizeToContents) |
151 QHeaderView.ResizeMode.ResizeToContents) |
151 self.changesTreeWidget.header().setStretchLastSection(True) |
152 self.changesTreeWidget.header().setStretchLastSection(True) |
152 |
153 |
153 def getData(self): |
154 def getData(self): |
154 """ |
155 """ |
155 Public method to get the data used to generate the statistics. |
156 Public method to get the data used to generate the statistics. |