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_GitDescribeDialog import Ui_GitDescribeDialog |
20 from .Ui_GitDescribeDialog import Ui_GitDescribeDialog |
20 |
21 |
57 """ |
58 """ |
58 Protected slot implementing a close event handler. |
59 Protected slot implementing a close event handler. |
59 |
60 |
60 @param e close event (QCloseEvent) |
61 @param e close event (QCloseEvent) |
61 """ |
62 """ |
62 if self.process is not None and \ |
63 if ( |
63 self.process.state() != QProcess.NotRunning: |
64 self.process is not None and |
|
65 self.process.state() != QProcess.NotRunning |
|
66 ): |
64 self.process.terminate() |
67 self.process.terminate() |
65 QTimer.singleShot(2000, self.process.kill) |
68 QTimer.singleShot(2000, self.process.kill) |
66 self.process.waitForFinished(3000) |
69 self.process.waitForFinished(3000) |
67 |
70 |
68 e.accept() |
71 e.accept() |
122 def __finish(self): |
125 def __finish(self): |
123 """ |
126 """ |
124 Private slot called when the process finished or the user pressed |
127 Private slot called when the process finished or the user pressed |
125 the button. |
128 the button. |
126 """ |
129 """ |
127 if self.process is not None and \ |
130 if ( |
128 self.process.state() != QProcess.NotRunning: |
131 self.process is not None and |
|
132 self.process.state() != QProcess.NotRunning |
|
133 ): |
129 self.process.terminate() |
134 self.process.terminate() |
130 QTimer.singleShot(2000, self.process.kill) |
135 QTimer.singleShot(2000, self.process.kill) |
131 self.process.waitForFinished(3000) |
136 self.process.waitForFinished(3000) |
132 |
137 |
133 self.inputGroup.setEnabled(False) |
138 self.inputGroup.setEnabled(False) |