Sun, 06 Jun 2021 16:30:37 +0200
Ported the plug-in to PyQt6 for eric7 and adopted it for Pyramid 2.x.
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
143
4ef44e854b39
Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
138
diff
changeset
|
3 | # Copyright (c) 2012 - 2021 Detlev Offenbach <detlev@die-offenbachs.de> |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing a dialog showing the available routes. |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
10 | import os |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
11 | |
147
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
12 | from PyQt6.QtCore import pyqtSlot, Qt, QProcess, QTimer, QCoreApplication |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
13 | from PyQt6.QtWidgets import ( |
138
72ebb74aa42d
Removed support for Python2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
132
diff
changeset
|
14 | QDialog, QDialogButtonBox, QLineEdit, QTreeWidgetItem |
72ebb74aa42d
Removed support for Python2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
132
diff
changeset
|
15 | ) |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
16 | |
147
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
17 | from EricWidgets import EricMessageBox |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
19 | from .Ui_PyramidRoutesDialog import Ui_PyramidRoutesDialog |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
20 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
21 | import Preferences |
123
97e5d21bd503
PyramidDialog, PyramidRoutesDialog: fixed a bug causing sending some input to the Pyramid process to fail.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
112
diff
changeset
|
22 | from Globals import strToQByteArray |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | class PyramidRoutesDialog(QDialog, Ui_PyramidRoutesDialog): |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
26 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | Class implementing a dialog showing the available routes. |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
28 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | def __init__(self, project, parent=None): |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
30 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
31 | Constructor |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
32 | |
54
71c83a661c83
Fixed code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
34
diff
changeset
|
33 | @param project reference to the project object |
147
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
34 | @type Project |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
35 | @param parent reference to the parent widget |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
36 | @type QWidget |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | """ |
144
5c3684ee818e
- removed support for obsolete eric6 versions
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
143
diff
changeset
|
38 | super().__init__(parent) |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
39 | self.setupUi(self) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | |
147
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
41 | self.buttonBox.button( |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
42 | QDialogButtonBox.StandardButton.Close).setEnabled(False) |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
43 | self.buttonBox.button( |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
44 | QDialogButtonBox.StandardButton.Cancel).setDefault(True) |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
45 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
46 | self.__project = project |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
47 | self.proc = None |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
48 | self.buffer = "" |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
49 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
50 | self.show() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
51 | QCoreApplication.processEvents() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
52 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
53 | def finish(self): |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
54 | """ |
54
71c83a661c83
Fixed code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
34
diff
changeset
|
55 | Public slot called when the process finished or the user pressed the |
71c83a661c83
Fixed code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
34
diff
changeset
|
56 | button. |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
57 | """ |
138
72ebb74aa42d
Removed support for Python2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
132
diff
changeset
|
58 | if ( |
72ebb74aa42d
Removed support for Python2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
132
diff
changeset
|
59 | self.proc is not None and |
147
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
60 | self.proc.state() != QProcess.ProcessState.NotRunning |
138
72ebb74aa42d
Removed support for Python2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
132
diff
changeset
|
61 | ): |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
62 | self.proc.terminate() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
63 | QTimer.singleShot(2000, self.proc.kill) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
64 | self.proc.waitForFinished(3000) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
65 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
66 | self.inputGroup.setEnabled(False) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
67 | self.inputGroup.hide() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
68 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
69 | self.proc = None |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
70 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
71 | self.__processBuffer() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
72 | |
147
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
73 | self.buttonBox.button( |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
74 | QDialogButtonBox.StandardButton.Close).setEnabled(True) |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
75 | self.buttonBox.button( |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
76 | QDialogButtonBox.StandardButton.Cancel).setEnabled(False) |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
77 | self.buttonBox.button( |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
78 | QDialogButtonBox.StandardButton.Close).setDefault(True) |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
79 | self.buttonBox.button( |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
80 | QDialogButtonBox.StandardButton.Close).setFocus( |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
81 | Qt.FocusReason.OtherFocusReason) |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
82 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
83 | def on_buttonBox_clicked(self, button): |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
84 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
85 | Private slot called by a button of the button box clicked. |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
86 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
87 | @param button button that was clicked (QAbstractButton) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
88 | """ |
147
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
89 | if button == self.buttonBox.button( |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
90 | QDialogButtonBox.StandardButton.Close |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
91 | ): |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
92 | self.close() |
147
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
93 | elif button == self.buttonBox.button( |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
94 | QDialogButtonBox.StandardButton.Cancel |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
95 | ): |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
96 | self.finish() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
97 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
98 | def __procFinished(self, exitCode, exitStatus): |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
99 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
100 | Private slot connected to the finished signal. |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
101 | |
147
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
102 | @param exitCode exit code of the process |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
103 | @type int |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
104 | @param exitStatus exit status of the process |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
105 | @type QProcess.ExitStatus |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
106 | """ |
147
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
107 | self.normal = ( |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
108 | exitStatus == QProcess.ExitStatus.NormalExit and |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
109 | exitCode == 0 |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
110 | ) |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
111 | self.finish() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
112 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
113 | def __processBuffer(self): |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
114 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
115 | Private slot to process the output buffer of the proutes command. |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
116 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
117 | self.routes.clear() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
118 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
119 | if not self.buffer: |
74
11587ae1122f
Ported to PyQt5 and eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
71
diff
changeset
|
120 | QTreeWidgetItem(self.routes, [self.tr("No routes found.")]) |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
121 | self.routes.setHeaderHidden(True) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
122 | else: |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
123 | lines = self.buffer.splitlines() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
124 | row = 0 |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
125 | headers = [] |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
126 | while row < len(lines): |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
127 | if lines[row].strip().startswith("---"): |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
128 | headerLine = lines[row - 1] |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
129 | headers = headerLine.split() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
130 | break |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
131 | row += 1 |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
132 | if headers: |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
133 | self.routes.setHeaderLabels(headers) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
134 | self.routes.setHeaderHidden(False) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
135 | row += 1 |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
136 | splitCount = len(headers) - 1 |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
137 | while row < len(lines): |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
138 | line = lines[row].strip() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
139 | parts = line.split(None, splitCount) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
140 | QTreeWidgetItem(self.routes, parts) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
141 | row += 1 |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
142 | for column in range(len(headers)): |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
143 | self.routes.resizeColumnToContents(column) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
144 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
145 | def start(self, projectPath): |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
146 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
147 | Public slot used to start the process. |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
148 | |
147
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
149 | @param projectPath path to the Pyramid project |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
150 | @type str |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
151 | @return flag indicating a successful start of the process |
147
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
152 | @rtype bool |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
153 | """ |
74
11587ae1122f
Ported to PyQt5 and eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
71
diff
changeset
|
154 | QTreeWidgetItem(self.routes, [self.tr("Getting routes...")]) |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
155 | self.routes.setHeaderHidden(True) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
156 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
157 | self.errorGroup.hide() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
158 | self.normal = False |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
159 | self.intercept = False |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
160 | |
147
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
161 | self.buttonBox.button( |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
162 | QDialogButtonBox.StandardButton.Close).setEnabled(False) |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
163 | self.buttonBox.button( |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
164 | QDialogButtonBox.StandardButton.Cancel).setEnabled(True) |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
165 | self.buttonBox.button( |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
166 | QDialogButtonBox.StandardButton.Cancel).setDefault(True) |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
167 | self.buttonBox.button( |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
168 | QDialogButtonBox.StandardButton.Cancel).setFocus( |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
169 | Qt.FocusReason.OtherFocusReason) |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
170 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
171 | self.proc = QProcess() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
172 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
173 | self.proc.finished.connect(self.__procFinished) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
174 | self.proc.readyReadStandardOutput.connect(self.__readStdout) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
175 | self.proc.readyReadStandardError.connect(self.__readStderr) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
176 | |
148
dcbd3a96f03c
Ported the plug-in to PyQt6 for eric7 and adopted it for Pyramid 2.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
147
diff
changeset
|
177 | cmd = self.__project.getPyramidCommand( |
dcbd3a96f03c
Ported the plug-in to PyQt6 for eric7 and adopted it for Pyramid 2.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
147
diff
changeset
|
178 | "proutes", |
dcbd3a96f03c
Ported the plug-in to PyQt6 for eric7 and adopted it for Pyramid 2.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
147
diff
changeset
|
179 | virtualEnv=self.__project.getProjectVirtualEnvironment() |
dcbd3a96f03c
Ported the plug-in to PyQt6 for eric7 and adopted it for Pyramid 2.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
147
diff
changeset
|
180 | ) |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
181 | args = [] |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
182 | args.append("development.ini") |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
183 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
184 | if projectPath: |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
185 | self.proc.setWorkingDirectory(projectPath) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
186 | self.proc.start(cmd, args) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
187 | procStarted = self.proc.waitForStarted() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
188 | if not procStarted: |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
189 | self.buttonBox.setFocus() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
190 | self.inputGroup.setEnabled(False) |
147
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
191 | EricMessageBox.critical( |
54
71c83a661c83
Fixed code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
34
diff
changeset
|
192 | self, |
74
11587ae1122f
Ported to PyQt5 and eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
71
diff
changeset
|
193 | self.tr('Process Generation Error'), |
11587ae1122f
Ported to PyQt5 and eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
71
diff
changeset
|
194 | self.tr( |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
195 | 'The process {0} could not be started. ' |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
196 | 'Ensure, that it is in the search path.' |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
197 | ).format(cmd)) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
198 | else: |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
199 | self.inputGroup.setEnabled(True) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
200 | self.inputGroup.show() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
201 | return procStarted |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
202 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
203 | def __readStdout(self): |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
204 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
205 | Private slot to handle the readyReadStandardOutput signal. |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
206 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
207 | It reads the output of the process and appends it to a buffer for |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
208 | delayed processing. |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
209 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
210 | if self.proc is not None: |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
211 | out = str(self.proc.readAllStandardOutput(), |
54
71c83a661c83
Fixed code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
34
diff
changeset
|
212 | Preferences.getSystem("IOEncoding"), |
71c83a661c83
Fixed code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
34
diff
changeset
|
213 | 'replace') |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
214 | self.buffer += out |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
215 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
216 | def __readStderr(self): |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
217 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
218 | Private slot to handle the readyReadStandardError signal. |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
219 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
220 | It reads the error output of the process and inserts it into the |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
221 | error pane. |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
222 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
223 | if self.proc is not None: |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
224 | err = str(self.proc.readAllStandardError(), |
54
71c83a661c83
Fixed code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
34
diff
changeset
|
225 | Preferences.getSystem("IOEncoding"), |
71c83a661c83
Fixed code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
34
diff
changeset
|
226 | 'replace') |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
227 | self.errorGroup.show() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
228 | self.errors.insertPlainText(err) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
229 | self.errors.ensureCursorVisible() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
230 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
231 | QCoreApplication.processEvents() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
232 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
233 | def on_passwordCheckBox_toggled(self, isOn): |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
234 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
235 | Private slot to handle the password checkbox toggled. |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
236 | |
147
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
237 | @param isOn flag indicating the status of the check box |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
238 | @type bool |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
239 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
240 | if isOn: |
147
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
241 | self.input.setEchoMode(QLineEdit.EchoMode.Password) |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
242 | else: |
147
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
243 | self.input.setEchoMode(QLineEdit.EchoMode.Normal) |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
244 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
245 | @pyqtSlot() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
246 | def on_sendButton_clicked(self): |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
247 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
248 | Private slot to send the input to the subversion process. |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
249 | """ |
106
2086bda4a893
Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
99
diff
changeset
|
250 | inputTxt = self.input.text() |
2086bda4a893
Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
99
diff
changeset
|
251 | inputTxt += os.linesep |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
252 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
253 | if self.passwordCheckBox.isChecked(): |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
254 | self.errors.insertPlainText(os.linesep) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
255 | self.errors.ensureCursorVisible() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
256 | |
123
97e5d21bd503
PyramidDialog, PyramidRoutesDialog: fixed a bug causing sending some input to the Pyramid process to fail.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
112
diff
changeset
|
257 | self.proc.write(strToQByteArray(inputTxt)) |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
258 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
259 | self.passwordCheckBox.setChecked(False) |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
260 | self.input.clear() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
261 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
262 | def on_input_returnPressed(self): |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
263 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
264 | Private slot to handle the press of the return key in the input field. |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
265 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
266 | self.intercept = True |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
267 | self.on_sendButton_clicked() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
268 | |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
269 | def keyPressEvent(self, evt): |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
270 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
271 | Protected slot to handle a key press event. |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
272 | |
147
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
273 | @param evt the key press event |
eb28b4b6f7f5
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
144
diff
changeset
|
274 | @type QKeyEvent |
13
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
275 | """ |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
276 | if self.intercept: |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
277 | self.intercept = False |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
278 | evt.accept() |
227a115ab2a1
Added a specialized dialog to show the configured routes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
279 | return |
144
5c3684ee818e
- removed support for obsolete eric6 versions
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
143
diff
changeset
|
280 | super().keyPressEvent(evt) |