5 |
5 |
6 """ |
6 """ |
7 Module implementing a dialog showing the available routes. |
7 Module implementing a dialog showing the available routes. |
8 """ |
8 """ |
9 |
9 |
10 from __future__ import unicode_literals |
|
11 try: |
|
12 str = unicode |
|
13 except NameError: |
|
14 pass |
|
15 |
|
16 import os |
10 import os |
17 |
11 |
18 from PyQt5.QtCore import QProcess, QTimer, pyqtSlot, Qt, QCoreApplication |
12 from PyQt5.QtCore import QProcess, QTimer, pyqtSlot, Qt, QCoreApplication |
19 from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QLineEdit, \ |
13 from PyQt5.QtWidgets import ( |
20 QTreeWidgetItem |
14 QDialog, QDialogButtonBox, QLineEdit, QTreeWidgetItem |
|
15 ) |
21 |
16 |
22 from E5Gui import E5MessageBox |
17 from E5Gui import E5MessageBox |
23 |
18 |
24 from .Ui_PyramidRoutesDialog import Ui_PyramidRoutesDialog |
19 from .Ui_PyramidRoutesDialog import Ui_PyramidRoutesDialog |
25 |
20 |
55 def finish(self): |
50 def finish(self): |
56 """ |
51 """ |
57 Public slot called when the process finished or the user pressed the |
52 Public slot called when the process finished or the user pressed the |
58 button. |
53 button. |
59 """ |
54 """ |
60 if self.proc is not None and \ |
55 if ( |
61 self.proc.state() != QProcess.NotRunning: |
56 self.proc is not None and |
|
57 self.proc.state() != QProcess.NotRunning |
|
58 ): |
62 self.proc.terminate() |
59 self.proc.terminate() |
63 QTimer.singleShot(2000, self.proc.kill) |
60 QTimer.singleShot(2000, self.proc.kill) |
64 self.proc.waitForFinished(3000) |
61 self.proc.waitForFinished(3000) |
65 |
62 |
66 self.inputGroup.setEnabled(False) |
63 self.inputGroup.setEnabled(False) |