eric6/Plugins/VcsPlugins/vcsMercurial/HgBookmarksListDialog.py

changeset 7257
c4d0cac9b5c9
parent 7229
53054eb5b15a
child 7360
9190402e4505
equal deleted inserted replaced
7256:4ef3b78ebb4e 7257:c4d0cac9b5c9
8 """ 8 """
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 (
14 QPoint 14 pyqtSlot, QProcess, Qt, QTimer, QCoreApplication, QPoint
15 from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QHeaderView, \ 15 )
16 QTreeWidgetItem, QLineEdit, QMenu, QInputDialog 16 from PyQt5.QtWidgets import (
17 QDialog, QDialogButtonBox, QHeaderView, QTreeWidgetItem, QLineEdit, QMenu,
18 QInputDialog
19 )
17 20
18 from E5Gui.E5Application import e5App 21 from E5Gui.E5Application import e5App
19 from E5Gui import E5MessageBox 22 from E5Gui import E5MessageBox
20 23
21 from .Ui_HgBookmarksListDialog import Ui_HgBookmarksListDialog 24 from .Ui_HgBookmarksListDialog import Ui_HgBookmarksListDialog
74 """ 77 """
75 if self.__hgClient: 78 if self.__hgClient:
76 if self.__hgClient.isExecuting(): 79 if self.__hgClient.isExecuting():
77 self.__hgClient.cancel() 80 self.__hgClient.cancel()
78 else: 81 else:
79 if self.process is not None and \ 82 if (
80 self.process.state() != QProcess.NotRunning: 83 self.process is not None and
84 self.process.state() != QProcess.NotRunning
85 ):
81 self.process.terminate() 86 self.process.terminate()
82 QTimer.singleShot(2000, self.process.kill) 87 QTimer.singleShot(2000, self.process.kill)
83 self.process.waitForFinished(3000) 88 self.process.waitForFinished(3000)
84 89
85 e.accept() 90 e.accept()
157 def __finish(self): 162 def __finish(self):
158 """ 163 """
159 Private slot called when the process finished or the user pressed 164 Private slot called when the process finished or the user pressed
160 the button. 165 the button.
161 """ 166 """
162 if self.process is not None and \ 167 if (
163 self.process.state() != QProcess.NotRunning: 168 self.process is not None and
169 self.process.state() != QProcess.NotRunning
170 ):
164 self.process.terminate() 171 self.process.terminate()
165 QTimer.singleShot(2000, self.process.kill) 172 QTimer.singleShot(2000, self.process.kill)
166 self.process.waitForFinished(3000) 173 self.process.waitForFinished(3000)
167 174
168 self.inputGroup.setEnabled(False) 175 self.inputGroup.setEnabled(False)

eric ide

mercurial