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