eric6/Plugins/VcsPlugins/vcsMercurial/HgAnnotateDialog.py

changeset 7257
c4d0cac9b5c9
parent 7229
53054eb5b15a
child 7360
9190402e4505
equal deleted inserted replaced
7256:4ef3b78ebb4e 7257:c4d0cac9b5c9
10 10
11 import os 11 import os
12 import re 12 import re
13 13
14 from PyQt5.QtCore import pyqtSlot, QProcess, QTimer, Qt, QCoreApplication 14 from PyQt5.QtCore import pyqtSlot, QProcess, QTimer, Qt, QCoreApplication
15 from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QHeaderView, \ 15 from PyQt5.QtWidgets import (
16 QLineEdit, QTreeWidgetItem 16 QDialog, QDialogButtonBox, QHeaderView, QLineEdit, QTreeWidgetItem
17 )
17 18
18 from E5Gui import E5MessageBox 19 from E5Gui import E5MessageBox
19 20
20 from .Ui_HgAnnotateDialog import Ui_HgAnnotateDialog 21 from .Ui_HgAnnotateDialog import Ui_HgAnnotateDialog
21 22
71 """ 72 """
72 if self.__hgClient: 73 if self.__hgClient:
73 if self.__hgClient.isExecuting(): 74 if self.__hgClient.isExecuting():
74 self.__hgClient.cancel() 75 self.__hgClient.cancel()
75 else: 76 else:
76 if self.process is not None and \ 77 if (
77 self.process.state() != QProcess.NotRunning: 78 self.process is not None and
79 self.process.state() != QProcess.NotRunning
80 ):
78 self.process.terminate() 81 self.process.terminate()
79 QTimer.singleShot(2000, self.process.kill) 82 QTimer.singleShot(2000, self.process.kill)
80 self.process.waitForFinished(3000) 83 self.process.waitForFinished(3000)
81 84
82 e.accept() 85 e.accept()
147 def __finish(self): 150 def __finish(self):
148 """ 151 """
149 Private slot called when the process finished or the user pressed 152 Private slot called when the process finished or the user pressed
150 the button. 153 the button.
151 """ 154 """
152 if self.process is not None and \ 155 if (
153 self.process.state() != QProcess.NotRunning: 156 self.process is not None and
157 self.process.state() != QProcess.NotRunning
158 ):
154 self.process.terminate() 159 self.process.terminate()
155 QTimer.singleShot(2000, self.process.kill) 160 QTimer.singleShot(2000, self.process.kill)
156 self.process.waitForFinished(3000) 161 self.process.waitForFinished(3000)
157 162
158 self.inputGroup.setEnabled(False) 163 self.inputGroup.setEnabled(False)

eric ide

mercurial