eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListDialog.py

changeset 7257
c4d0cac9b5c9
parent 7229
53054eb5b15a
child 7360
9190402e4505
equal deleted inserted replaced
7256:4ef3b78ebb4e 7257:c4d0cac9b5c9
9 9
10 10
11 import os 11 import os
12 12
13 from PyQt5.QtCore import pyqtSlot, QProcess, Qt, QTimer, QCoreApplication 13 from PyQt5.QtCore import pyqtSlot, QProcess, Qt, QTimer, QCoreApplication
14 from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QHeaderView, \ 14 from PyQt5.QtWidgets import (
15 QTreeWidgetItem, QLineEdit 15 QDialog, QDialogButtonBox, QHeaderView, QTreeWidgetItem, QLineEdit
16 )
16 17
17 from E5Gui import E5MessageBox 18 from E5Gui import E5MessageBox
18 19
19 from .Ui_HgQueuesListDialog import Ui_HgQueuesListDialog 20 from .Ui_HgQueuesListDialog import Ui_HgQueuesListDialog
20 21
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()
206 def __finish(self): 209 def __finish(self):
207 """ 210 """
208 Private slot called when the process finished or the user pressed 211 Private slot called when the process finished or the user pressed
209 the button. 212 the button.
210 """ 213 """
211 if self.process is not None and \ 214 if (
212 self.process.state() != QProcess.NotRunning: 215 self.process is not None and
216 self.process.state() != QProcess.NotRunning
217 ):
213 self.process.terminate() 218 self.process.terminate()
214 QTimer.singleShot(2000, self.process.kill) 219 QTimer.singleShot(2000, self.process.kill)
215 self.process.waitForFinished(3000) 220 self.process.waitForFinished(3000)
216 221
217 self.inputGroup.setEnabled(False) 222 self.inputGroup.setEnabled(False)

eric ide

mercurial