eric6/Plugins/VcsPlugins/vcsGit/GitReflogBrowserDialog.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 12
13 from PyQt5.QtCore import pyqtSlot, Qt, QProcess, QTimer, QPoint 13 from PyQt5.QtCore import pyqtSlot, Qt, QProcess, QTimer, QPoint
14 from PyQt5.QtGui import QCursor 14 from PyQt5.QtGui import QCursor
15 from PyQt5.QtWidgets import QWidget, QDialogButtonBox, QHeaderView, \ 15 from PyQt5.QtWidgets import (
16 QTreeWidgetItem, QApplication, QLineEdit 16 QWidget, QDialogButtonBox, QHeaderView, QTreeWidgetItem, QApplication,
17 QLineEdit
18 )
17 19
18 from E5Gui import E5MessageBox 20 from E5Gui import E5MessageBox
19 21
20 from .Ui_GitReflogBrowserDialog import Ui_GitReflogBrowserDialog 22 from .Ui_GitReflogBrowserDialog import Ui_GitReflogBrowserDialog
21 23
90 """ 92 """
91 Protected slot implementing a close event handler. 93 Protected slot implementing a close event handler.
92 94
93 @param e close event (QCloseEvent) 95 @param e close event (QCloseEvent)
94 """ 96 """
95 if self.process is not None and \ 97 if (
96 self.process.state() != QProcess.NotRunning: 98 self.process is not None and
99 self.process.state() != QProcess.NotRunning
100 ):
97 self.process.terminate() 101 self.process.terminate()
98 QTimer.singleShot(2000, self.process.kill) 102 QTimer.singleShot(2000, self.process.kill)
99 self.process.waitForFinished(3000) 103 self.process.waitForFinished(3000)
100 104
101 self.__position = self.pos() 105 self.__position = self.pos()
235 def __finish(self): 239 def __finish(self):
236 """ 240 """
237 Private slot called when the process finished or the user pressed 241 Private slot called when the process finished or the user pressed
238 the button. 242 the button.
239 """ 243 """
240 if self.process is not None and \ 244 if (
241 self.process.state() != QProcess.NotRunning: 245 self.process is not None and
246 self.process.state() != QProcess.NotRunning
247 ):
242 self.process.terminate() 248 self.process.terminate()
243 QTimer.singleShot(2000, self.process.kill) 249 QTimer.singleShot(2000, self.process.kill)
244 self.process.waitForFinished(3000) 250 self.process.waitForFinished(3000)
245 251
246 QApplication.restoreOverrideCursor() 252 QApplication.restoreOverrideCursor()

eric ide

mercurial