eric6/Plugins/VcsPlugins/vcsMercurial/HgBookmarksInOutDialog.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_HgBookmarksInOutDialog import Ui_HgBookmarksInOutDialog 20 from .Ui_HgBookmarksInOutDialog import Ui_HgBookmarksInOutDialog
20 21
77 """ 78 """
78 if self.__hgClient: 79 if self.__hgClient:
79 if self.__hgClient.isExecuting(): 80 if self.__hgClient.isExecuting():
80 self.__hgClient.cancel() 81 self.__hgClient.cancel()
81 else: 82 else:
82 if self.process is not None and \ 83 if (
83 self.process.state() != QProcess.NotRunning: 84 self.process is not None and
85 self.process.state() != QProcess.NotRunning
86 ):
84 self.process.terminate() 87 self.process.terminate()
85 QTimer.singleShot(2000, self.process.kill) 88 QTimer.singleShot(2000, self.process.kill)
86 self.process.waitForFinished(3000) 89 self.process.waitForFinished(3000)
87 90
88 e.accept() 91 e.accept()
152 def __finish(self): 155 def __finish(self):
153 """ 156 """
154 Private slot called when the process finished or the user pressed 157 Private slot called when the process finished or the user pressed
155 the button. 158 the button.
156 """ 159 """
157 if self.process is not None and \ 160 if (
158 self.process.state() != QProcess.NotRunning: 161 self.process is not None and
162 self.process.state() != QProcess.NotRunning
163 ):
159 self.process.terminate() 164 self.process.terminate()
160 QTimer.singleShot(2000, self.process.kill) 165 QTimer.singleShot(2000, self.process.kill)
161 self.process.waitForFinished(3000) 166 self.process.waitForFinished(3000)
162 167
163 self.inputGroup.setEnabled(False) 168 self.inputGroup.setEnabled(False)

eric ide

mercurial