8 """ |
8 """ |
9 |
9 |
10 import os |
10 import os |
11 |
11 |
12 from PyQt4.QtCore import QTimer, QProcess, Qt, pyqtSlot |
12 from PyQt4.QtCore import QTimer, QProcess, Qt, pyqtSlot |
13 from PyQt4.QtGui import QHeaderView, QLineEdit, QDialog, QDialogButtonBox, QFont, \ |
13 from PyQt4.QtGui import QHeaderView, QLineEdit, QDialog, QDialogButtonBox, \ |
14 QTreeWidgetItem |
14 QFont, QTreeWidgetItem |
15 |
15 |
16 from E5Gui import E5MessageBox |
16 from E5Gui import E5MessageBox |
17 |
17 |
18 from .Ui_SvnBlameDialog import Ui_SvnBlameDialog |
18 from .Ui_SvnBlameDialog import Ui_SvnBlameDialog |
19 |
19 |
106 self.inputGroup.setEnabled(True) |
106 self.inputGroup.setEnabled(True) |
107 self.inputGroup.show() |
107 self.inputGroup.show() |
108 |
108 |
109 def __finish(self): |
109 def __finish(self): |
110 """ |
110 """ |
111 Private slot called when the process finished or the user pressed the button. |
111 Private slot called when the process finished or the user pressed the |
|
112 button. |
112 """ |
113 """ |
113 if self.process is not None and \ |
114 if self.process is not None and \ |
114 self.process.state() != QProcess.NotRunning: |
115 self.process.state() != QProcess.NotRunning: |
115 self.process.terminate() |
116 self.process.terminate() |
116 QTimer.singleShot(2000, self.process.kill) |
117 QTimer.singleShot(2000, self.process.kill) |
117 self.process.waitForFinished(3000) |
118 self.process.waitForFinished(3000) |
118 |
119 |
119 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
120 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
120 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
121 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
121 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
122 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
122 self.buttonBox.button(QDialogButtonBox.Close).setFocus(Qt.OtherFocusReason) |
123 self.buttonBox.button(QDialogButtonBox.Close).setFocus( |
|
124 Qt.OtherFocusReason) |
123 |
125 |
124 self.inputGroup.setEnabled(False) |
126 self.inputGroup.setEnabled(False) |
125 self.inputGroup.hide() |
127 self.inputGroup.hide() |
126 |
128 |
127 self.process = None |
129 self.process = None |
176 the contents pane. |
178 the contents pane. |
177 """ |
179 """ |
178 self.process.setReadChannel(QProcess.StandardOutput) |
180 self.process.setReadChannel(QProcess.StandardOutput) |
179 |
181 |
180 while self.process.canReadLine(): |
182 while self.process.canReadLine(): |
181 s = str(self.process.readLine(), self.__ioEncoding, 'replace').strip() |
183 s = str(self.process.readLine(), self.__ioEncoding, 'replace')\ |
|
184 .strip() |
182 rev, s = s.split(None, 1) |
185 rev, s = s.split(None, 1) |
183 try: |
186 try: |
184 author, text = s.split(' ', 1) |
187 author, text = s.split(' ', 1) |
185 except ValueError: |
188 except ValueError: |
186 author = s.strip() |
189 author = s.strip() |