eric6/Debugger/StartDialog.py

Sat, 27 Feb 2021 12:08:23 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 27 Feb 2021 12:08:23 +0100
changeset 8138
169e65a6787c
parent 7923
91e843545d9a
child 8043
0acf98cd089a
child 8143
2c730d5fd177
permissions
-rw-r--r--

Shell: added functionality to show a prompt when the main client process has exited (e.g. a script ended).

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7901
diff changeset
3 # Copyright (c) 2002 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the Start Program dialog.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
7901
6ff7ccf0cb50 Debugger: refined the handling of not to be debugged scripts for multiprocess debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7882
diff changeset
10 import os
6ff7ccf0cb50 Debugger: refined the handling of not to be debugged scripts for multiprocess debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7882
diff changeset
11
5372
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
12 from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QComboBox, QInputDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
4582
3a1d1d4c6f4f Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
14 from E5Gui.E5PathPicker import E5PathPickerModes
6352
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
15 from E5Gui.E5Application import e5App
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 import Preferences
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
19
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 class StartDialog(QDialog):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 Class implementing the Start Program dialog.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 It implements a dialog that is used to start an
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 application for debugging. It asks the user to enter
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 the commandline parameters, the working directory and
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 whether exception reporting should be disabled.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 """
6352
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
29 def __init__(self, caption, lastUsedVenvName, argvList, wdList, envList,
5899
0516f6548ca6 Added the capability to enter an interpreter in the Start... dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
30 exceptions,
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
31 parent=None, dialogType=0, modfuncList=None,
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
32 tracePython=False, autoClearShell=True, autoContinue=True,
7874
8dcb77600690 Debugger: removed the 'fork' options for the Run and Debug start options because they are obsolete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7856
diff changeset
33 enableMultiprocess=False, multiprocessNoDebugHistory=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36
6352
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
37 @param caption the caption to be displayed
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
38 @type str
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
39 @param lastUsedVenvName name of the most recently used virtual
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
40 environment
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
41 @type str
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
42 @param argvList history list of command line arguments
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
43 @type list of str
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
44 @param wdList history list of working directories
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
45 @type list of str
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
46 @param envList history list of environment parameter settings
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
47 @type list of str
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
48 @param exceptions exception reporting flag
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
49 @type bool
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
50 @param parent parent widget of this dialog
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
51 @type QWidget
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
52 @param dialogType type of the start dialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 <ul>
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 <li>0 = start debug dialog</li>
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 <li>1 = start run dialog</li>
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 <li>2 = start coverage dialog</li>
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 <li>3 = start profile dialog</li>
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 </ul>
6352
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
59 @type int (0 to 3)
7409
1413bfe73d41 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
60 @param modfuncList history list of module functions
6352
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
61 @type list of str
7409
1413bfe73d41 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
62 @param tracePython flag indicating if the Python library should
6352
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
63 be traced as well
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
64 @type bool
7409
1413bfe73d41 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
65 @param autoClearShell flag indicating, that the interpreter window
6352
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
66 should be cleared automatically
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
67 @type bool
7409
1413bfe73d41 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
68 @param autoContinue flag indicating, that the debugger should not
6352
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
69 stop at the first executable line
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
70 @type bool
7409
1413bfe73d41 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
71 @param enableMultiprocess flag indicating the support for multi process
1413bfe73d41 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
72 debugging
6352
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
73 @type bool
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
74 @param multiprocessNoDebugHistory list of lists with programs not to be
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
75 debugged
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
76 @type list of str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 """
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2302
diff changeset
78 super(StartDialog, self).__init__(parent)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 self.setModal(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
81 self.dialogType = dialogType
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
82 if dialogType == 0:
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
83 from .Ui_StartDebugDialog import Ui_StartDebugDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 self.ui = Ui_StartDebugDialog()
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
85 elif dialogType == 1:
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
86 from .Ui_StartRunDialog import Ui_StartRunDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 self.ui = Ui_StartRunDialog()
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
88 elif dialogType == 2:
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
89 from .Ui_StartCoverageDialog import Ui_StartCoverageDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 self.ui = Ui_StartCoverageDialog()
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
91 elif dialogType == 3:
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
92 from .Ui_StartProfileDialog import Ui_StartProfileDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 self.ui = Ui_StartProfileDialog()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 self.ui.setupUi(self)
5899
0516f6548ca6 Added the capability to enter an interpreter in the Start... dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
95
6352
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
96 self.ui.venvComboBox.addItem("")
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
97 self.ui.venvComboBox.addItems(
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
98 sorted(e5App().getObject("VirtualEnvManager")
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
99 .getVirtualenvNames()))
5899
0516f6548ca6 Added the capability to enter an interpreter in the Start... dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
100
4582
3a1d1d4c6f4f Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
101 self.ui.workdirPicker.setMode(E5PathPickerModes.DirectoryMode)
3a1d1d4c6f4f Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
102 self.ui.workdirPicker.setDefaultDirectory(
3a1d1d4c6f4f Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
103 Preferences.getMultiProject("Workspace"))
4589
b648ccbdbef9 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4582
diff changeset
104 self.ui.workdirPicker.setInsertPolicy(QComboBox.InsertAtTop)
b648ccbdbef9 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4582
diff changeset
105 self.ui.workdirPicker.setSizeAdjustPolicy(
b648ccbdbef9 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4582
diff changeset
106 QComboBox.AdjustToMinimumContentsLength)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 112
diff changeset
108 self.clearButton = self.ui.buttonBox.addButton(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
109 self.tr("Clear Histories"), QDialogButtonBox.ActionRole)
5372
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
110 self.editButton = self.ui.buttonBox.addButton(
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
111 self.tr("Edit History"), QDialogButtonBox.ActionRole)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 self.setWindowTitle(caption)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 self.ui.cmdlineCombo.clear()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 self.ui.cmdlineCombo.addItems(argvList)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 if len(argvList) > 0:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 self.ui.cmdlineCombo.setCurrentIndex(0)
4582
3a1d1d4c6f4f Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
118 self.ui.workdirPicker.clear()
3a1d1d4c6f4f Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
119 self.ui.workdirPicker.addItems(wdList)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 if len(wdList) > 0:
4582
3a1d1d4c6f4f Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
121 self.ui.workdirPicker.setCurrentIndex(0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 self.ui.environmentCombo.clear()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 self.ui.environmentCombo.addItems(envList)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 self.ui.exceptionCheckBox.setChecked(exceptions)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 self.ui.clearShellCheckBox.setChecked(autoClearShell)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126 self.ui.consoleCheckBox.setEnabled(
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 Preferences.getDebugger("ConsoleDbgCommand") != "")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 self.ui.consoleCheckBox.setChecked(False)
6352
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
129 venvIndex = max(0, self.ui.venvComboBox.findText(lastUsedVenvName))
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
130 self.ui.venvComboBox.setCurrentIndex(venvIndex)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
132 if dialogType == 0: # start debug dialog
7422
9a008ab4811b Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7411
diff changeset
133 enableMultiprocessGlobal = Preferences.getDebugger(
9a008ab4811b Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7411
diff changeset
134 "MultiProcessEnabled")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 self.ui.tracePythonCheckBox.setChecked(tracePython)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 self.ui.tracePythonCheckBox.show()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 self.ui.autoContinueCheckBox.setChecked(autoContinue)
7422
9a008ab4811b Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7411
diff changeset
138 self.ui.multiprocessGroup.setEnabled(enableMultiprocessGlobal)
9a008ab4811b Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7411
diff changeset
139 self.ui.multiprocessGroup.setChecked(
9a008ab4811b Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7411
diff changeset
140 enableMultiprocess & enableMultiprocessGlobal)
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
141 self.ui.multiprocessNoDebugCombo.clear()
7901
6ff7ccf0cb50 Debugger: refined the handling of not to be debugged scripts for multiprocess debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7882
diff changeset
142 self.ui.multiprocessNoDebugCombo.setToolTip(self.tr(
6ff7ccf0cb50 Debugger: refined the handling of not to be debugged scripts for multiprocess debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7882
diff changeset
143 "Enter the list of programs or program patterns not to be"
6ff7ccf0cb50 Debugger: refined the handling of not to be debugged scripts for multiprocess debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7882
diff changeset
144 " debugged separated by '{0}'.").format(os.pathsep)
6ff7ccf0cb50 Debugger: refined the handling of not to be debugged scripts for multiprocess debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7882
diff changeset
145 )
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
146 if multiprocessNoDebugHistory:
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
147 self.ui.multiprocessNoDebugCombo.addItems(
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
148 multiprocessNoDebugHistory)
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
149 self.ui.multiprocessNoDebugCombo.setCurrentIndex(0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
151 if dialogType == 3: # start coverage or profile dialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 self.ui.eraseCheckBox.setChecked(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154 self.__clearHistoryLists = False
5373
7826884089fd Added some TODOs to improve history handling of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5372
diff changeset
155 self.__historiesModified = False
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156
3366
6084bb3c3911 Made some changes to have a bunch of dialogs with correct sizes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
157 msh = self.minimumSizeHint()
6084bb3c3911 Made some changes to have a bunch of dialogs with correct sizes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
158 self.resize(max(self.width(), msh.width()), msh.height())
6084bb3c3911 Made some changes to have a bunch of dialogs with correct sizes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
159
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160 def on_modFuncCombo_editTextChanged(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 Private slot to enable/disable the OK button.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 """
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 112
diff changeset
164 self.ui.buttonBox.button(QDialogButtonBox.Ok).setDisabled(
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 self.ui.modFuncCombo.currentText() == "")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167 def getData(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169 Public method to retrieve the data entered into this dialog.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170
7882
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7874
diff changeset
171 @return a tuple of interpreter, argv, workdir, environment,
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7874
diff changeset
172 exceptions flag, clear interpreter flag and run in console flag
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7874
diff changeset
173 @rtype tuple of (str, str, str, str, bool, bool, bool)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 cmdLine = self.ui.cmdlineCombo.currentText()
6720
ba02b7a62dbc StartDialog: fixed workdir path conversion.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
176 workdir = self.ui.workdirPicker.currentText(toNative=False)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 environment = self.ui.environmentCombo.currentText()
6352
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
178 venvName = self.ui.venvComboBox.currentText()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179
6352
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
180 return (venvName,
5899
0516f6548ca6 Added the capability to enter an interpreter in the Start... dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
181 cmdLine,
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 workdir,
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 environment,
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184 self.ui.exceptionCheckBox.isChecked(),
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
185 self.ui.clearShellCheckBox.isChecked(),
5899
0516f6548ca6 Added the capability to enter an interpreter in the Start... dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
186 self.ui.consoleCheckBox.isChecked(),
0516f6548ca6 Added the capability to enter an interpreter in the Start... dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
187 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 def getDebugData(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190 """
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
191 Public method to retrieve the debug related data entered into this
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
192 dialog.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
194 @return a tuple of a flag indicating, if the Python library should be
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
195 traced as well, a flag indicating, that the debugger should not
7874
8dcb77600690 Debugger: removed the 'fork' options for the Run and Debug start options because they are obsolete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7856
diff changeset
196 stop at the first executable line, a flag indicating to support
8dcb77600690 Debugger: removed the 'fork' options for the Run and Debug start options because they are obsolete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7856
diff changeset
197 multi process debugging and a space separated list of programs not
8dcb77600690 Debugger: removed the 'fork' options for the Run and Debug start options because they are obsolete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7856
diff changeset
198 to be debugged
8dcb77600690 Debugger: removed the 'fork' options for the Run and Debug start options because they are obsolete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7856
diff changeset
199 @rtype tuple of (bool, bool, bool, str)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200 """
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
201 if self.dialogType == 0:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 return (self.ui.tracePythonCheckBox.isChecked(),
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 self.ui.autoContinueCheckBox.isChecked(),
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
204 self.ui.multiprocessGroup.isChecked(),
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
205 self.ui.multiprocessNoDebugCombo.currentText())
6891
93f82da09f22 Fixed some code style issues detected by the new 'return' checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6720
diff changeset
206 else:
7874
8dcb77600690 Debugger: removed the 'fork' options for the Run and Debug start options because they are obsolete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7856
diff changeset
207 return (False, False, False, "")
8dcb77600690 Debugger: removed the 'fork' options for the Run and Debug start options because they are obsolete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7856
diff changeset
208
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209 def getCoverageData(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
210 """
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
211 Public method to retrieve the coverage related data entered into this
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
212 dialog.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213
7882
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7874
diff changeset
214 @return flag indicating erasure of coverage info
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7874
diff changeset
215 @rtype bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
216 """
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
217 if self.dialogType == 2:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
218 return self.ui.eraseCheckBox.isChecked()
6891
93f82da09f22 Fixed some code style issues detected by the new 'return' checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6720
diff changeset
219 else:
93f82da09f22 Fixed some code style issues detected by the new 'return' checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6720
diff changeset
220 return False
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
221
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222 def getProfilingData(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223 """
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
224 Public method to retrieve the profiling related data entered into this
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
225 dialog.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226
7882
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7874
diff changeset
227 @return flag indicating erasure of profiling info
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7874
diff changeset
228 @rtype bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 """
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
230 if self.dialogType == 3:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 return self.ui.eraseCheckBox.isChecked()
6891
93f82da09f22 Fixed some code style issues detected by the new 'return' checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6720
diff changeset
232 else:
93f82da09f22 Fixed some code style issues detected by the new 'return' checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6720
diff changeset
233 return False
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235 def __clearHistories(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
236 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
237 Private slot to clear the combo boxes lists and record a flag to
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 clear the lists.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 self.__clearHistoryLists = True
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
241 self.__historiesModified = False # clear catches it all
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
242
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
243 cmdLine = self.ui.cmdlineCombo.currentText()
4582
3a1d1d4c6f4f Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
244 workdir = self.ui.workdirPicker.currentText()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
245 environment = self.ui.environmentCombo.currentText()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
246
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
247 self.ui.cmdlineCombo.clear()
4582
3a1d1d4c6f4f Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
248 self.ui.workdirPicker.clear()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
249 self.ui.environmentCombo.clear()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
250
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
251 self.ui.cmdlineCombo.addItem(cmdLine)
4582
3a1d1d4c6f4f Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
252 self.ui.workdirPicker.addItem(workdir)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
253 self.ui.environmentCombo.addItem(environment)
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
254
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
255 if self.dialogType == 0:
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
256 noDebugList = self.ui.multiprocessNoDebugCombo.currentText()
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
257 self.ui.multiprocessNoDebugCombo.clear()
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
258 self.ui.multiprocessNoDebugCombo.addItem(noDebugList)
5372
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
259
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
260 def __editHistory(self):
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
261 """
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
262 Private slot to edit a history list.
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
263 """
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
264 histories = [
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
265 "",
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
266 self.tr("Command Line"),
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
267 self.tr("Working Directory"),
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
268 self.tr("Environment"),
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
269 ]
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
270 combos = [
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
271 None,
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
272 self.ui.cmdlineCombo,
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
273 self.ui.workdirPicker,
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
274 self.ui.environmentCombo,
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
275 ]
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
276 if self.dialogType == 0:
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
277 histories.append(self.tr("No Debug Programs"))
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
278 combos.append(self.ui.multiprocessNoDebugCombo)
5372
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
279 historyKind, ok = QInputDialog.getItem(
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
280 self,
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
281 self.tr("Edit History"),
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
282 self.tr("Select the history list to be edited:"),
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
283 histories,
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
284 0, False)
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
285 if ok and historyKind:
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
286 history = []
5372
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
287 historiesIndex = histories.index(historyKind)
6352
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
288 if historiesIndex == 2:
5372
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
289 history = self.ui.workdirPicker.getPathItems()
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
290 else:
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
291 combo = combos[historiesIndex]
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
292 if combo:
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
293 for index in range(combo.count()):
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
294 history.append(combo.itemText(index))
5372
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
295
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
296 if history:
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
297 from .StartHistoryEditDialog import StartHistoryEditDialog
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
298 dlg = StartHistoryEditDialog(history, self)
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
299 if dlg.exec() == QDialog.Accepted:
7856
82c461fa8a68 Fixed a few issues introduced by the recent merge and some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7802
diff changeset
300 history = dlg.getHistory()
82c461fa8a68 Fixed a few issues introduced by the recent merge and some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7802
diff changeset
301 combo = combos[historiesIndex]
82c461fa8a68 Fixed a few issues introduced by the recent merge and some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7802
diff changeset
302 if combo:
82c461fa8a68 Fixed a few issues introduced by the recent merge and some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7802
diff changeset
303 combo.clear()
82c461fa8a68 Fixed a few issues introduced by the recent merge and some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7802
diff changeset
304 combo.addItems(history)
82c461fa8a68 Fixed a few issues introduced by the recent merge and some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7802
diff changeset
305
82c461fa8a68 Fixed a few issues introduced by the recent merge and some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7802
diff changeset
306 self.__historiesModified = True
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
307
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
308 def historiesModified(self):
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
309 """
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
310 Public method to test for modified histories.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
311
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
312 @return flag indicating modified histories
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
313 @rtype bool
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
314 """
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
315 return self.__historiesModified
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
316
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
317 def clearHistories(self):
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
318 """
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
319 Public method to test, if histories shall be cleared.
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
320
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
321 @return flag indicating histories shall be cleared
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
322 @rtype bool
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
323 """
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
324 return self.__clearHistoryLists
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
325
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
326 def getHistories(self):
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
327 """
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
328 Public method to get the lists of histories.
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
329
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
330 @return tuple containing the histories of command line arguments,
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
331 working directories, environment settings and no debug programs
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
332 lists
5899
0516f6548ca6 Added the capability to enter an interpreter in the Start... dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
333 @rtype tuple of four list of str
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
334 """
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
335 if self.dialogType == 0:
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
336 noDebugHistory = [
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
337 self.ui.multiprocessNoDebugCombo.itemText(index)
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
338 for index in range(self.ui.multiprocessNoDebugCombo.count())
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
339 ]
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
340 else:
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
341 noDebugHistory = None
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
342 return (
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
343 [self.ui.cmdlineCombo.itemText(index) for index in range(
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
344 self.ui.cmdlineCombo.count())],
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
345 self.ui.workdirPicker.getPathItems(),
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
346 [self.ui.environmentCombo.itemText(index) for index in range(
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
347 self.ui.environmentCombo.count())],
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7409
diff changeset
348 noDebugHistory,
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
349 )
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
350
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
351 def on_buttonBox_clicked(self, button):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
352 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
353 Private slot called by a button of the button box clicked.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
354
7882
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7874
diff changeset
355 @param button button that was clicked
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7874
diff changeset
356 @type QAbstractButton
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
357 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
358 if button == self.clearButton:
880
52ed20236a1c Added the option to not use the native file dialog to prevent crashes on Linux.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
359 self.__clearHistories()
5372
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
360 elif button == self.editButton:
7ba8d3d61fdd Added the capability to edit the history lists to the start dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
361 self.__editHistory()

eric ide

mercurial