45 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
45 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
46 |
46 |
47 self.vcs = vcs |
47 self.vcs = vcs |
48 self.__hgClient = vcs.getClient() |
48 self.__hgClient = vcs.getClient() |
49 |
49 |
50 self.annotateList.headerItem().setText(self.annotateList.columnCount(), "") |
50 self.annotateList.headerItem().setText( |
|
51 self.annotateList.columnCount(), "") |
51 font = QFont(self.annotateList.font()) |
52 font = QFont(self.annotateList.font()) |
52 if Utilities.isWindowsPlatform(): |
53 if Utilities.isWindowsPlatform(): |
53 font.setFamily("Lucida Console") |
54 font.setFamily("Lucida Console") |
54 else: |
55 else: |
55 font.setFamily("Monospace") |
56 font.setFamily("Monospace") |
148 self.inputGroup.setEnabled(True) |
149 self.inputGroup.setEnabled(True) |
149 self.inputGroup.show() |
150 self.inputGroup.show() |
150 |
151 |
151 def __finish(self): |
152 def __finish(self): |
152 """ |
153 """ |
153 Private slot called when the process finished or the user pressed the button. |
154 Private slot called when the process finished or the user pressed |
|
155 the button. |
154 """ |
156 """ |
155 if self.process is not None and \ |
157 if self.process is not None and \ |
156 self.process.state() != QProcess.NotRunning: |
158 self.process.state() != QProcess.NotRunning: |
157 self.process.terminate() |
159 self.process.terminate() |
158 QTimer.singleShot(2000, self.process.kill) |
160 QTimer.singleShot(2000, self.process.kill) |
162 self.inputGroup.hide() |
164 self.inputGroup.hide() |
163 |
165 |
164 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
166 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
165 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
167 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
166 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
168 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
167 self.buttonBox.button(QDialogButtonBox.Close).setFocus(Qt.OtherFocusReason) |
169 self.buttonBox.button(QDialogButtonBox.Close).setFocus( |
|
170 Qt.OtherFocusReason) |
168 |
171 |
169 self.process = None |
172 self.process = None |
170 |
173 |
171 self.__resizeColumns() |
174 self.__resizeColumns() |
172 |
175 |
205 |
208 |
206 @param revision revision string (string) |
209 @param revision revision string (string) |
207 @param changeset changeset string (string) |
210 @param changeset changeset string (string) |
208 @param author author of the change (string) |
211 @param author author of the change (string) |
209 @param date date of the tag (string) |
212 @param date date of the tag (string) |
210 @param name name (path) of the tag (string) |
213 @param text name (path) of the tag (string) |
211 """ |
214 """ |
212 itm = QTreeWidgetItem(self.annotateList, |
215 itm = QTreeWidgetItem( |
213 [revision, changeset, author, date, "{0:d}".format(self.lineno), text]) |
216 self.annotateList, |
|
217 [revision, changeset, author, date, "{0:d}".format(self.lineno), |
|
218 text]) |
214 self.lineno += 1 |
219 self.lineno += 1 |
215 itm.setTextAlignment(0, Qt.AlignRight) |
220 itm.setTextAlignment(0, Qt.AlignRight) |
216 itm.setTextAlignment(4, Qt.AlignRight) |
221 itm.setTextAlignment(4, Qt.AlignRight) |
217 |
222 |
218 def __readStdout(self): |
223 def __readStdout(self): |
223 the annotation list. |
228 the annotation list. |
224 """ |
229 """ |
225 self.process.setReadChannel(QProcess.StandardOutput) |
230 self.process.setReadChannel(QProcess.StandardOutput) |
226 |
231 |
227 while self.process.canReadLine(): |
232 while self.process.canReadLine(): |
228 s = str(self.process.readLine(), self.__ioEncoding, 'replace').strip() |
233 s = str(self.process.readLine(), self.__ioEncoding, 'replace')\ |
|
234 .strip() |
229 self.__processOutputLine(s) |
235 self.__processOutputLine(s) |
230 |
236 |
231 def __processOutputLine(self, line): |
237 def __processOutputLine(self, line): |
232 """ |
238 """ |
233 Private method to process the lines of output. |
239 Private method to process the lines of output. |