src/eric7/Debugger/StartDialog.py

branch
eric7
changeset 10306
904f4c7da759
parent 10217
7888177e7463
child 10321
4a017fdf316f
equal deleted inserted replaced
10305:3fe0ba548fe5 10306:904f4c7da759
5 5
6 """ 6 """
7 Module implementing the Start Program dialog. 7 Module implementing the Start Program dialog.
8 """ 8 """
9 9
10 import enum
10 import os 11 import os
11 12
12 from PyQt6.QtCore import Qt 13 from PyQt6.QtCore import Qt
13 from PyQt6.QtWidgets import QComboBox, QDialog, QDialogButtonBox, QInputDialog 14 from PyQt6.QtWidgets import QComboBox, QDialog, QDialogButtonBox, QInputDialog
14 15
15 from eric7 import Preferences 16 from eric7 import Preferences
16 from eric7.EricWidgets.EricApplication import ericApp 17 from eric7.EricWidgets.EricApplication import ericApp
17 from eric7.EricWidgets.EricPathPicker import EricPathPickerModes 18 from eric7.EricWidgets.EricPathPicker import EricPathPickerModes
18 19
19 20 from .Ui_StartDialog import Ui_StartDialog
20 class StartDialog(QDialog): 21
22
23 class StartDialogMode(enum.Enum):
21 """ 24 """
22 Class implementing the Start Program dialog. 25 Class defining the various modes of the start dialog.
26 """
27
28 Debug = 0
29 Run = 1
30 Coverage = 2
31 Profile = 3
32
33
34 class StartDialog(QDialog, Ui_StartDialog):
35 """
36 Class implementing the Start dialog.
23 37
24 It implements a dialog that is used to start an 38 It implements a dialog that is used to start an
25 application for debugging. It asks the user to enter 39 application for debugging. It asks the user to enter
26 the commandline parameters, the working directory and 40 the commandline parameters, the working directory and
27 whether exception reporting should be disabled. 41 whether exception reporting should be disabled.
35 wdList, 49 wdList,
36 envList, 50 envList,
37 exceptions, 51 exceptions,
38 unhandledExceptions, 52 unhandledExceptions,
39 parent=None, 53 parent=None,
40 dialogType=0, 54 dialogMode=StartDialogMode.Debug,
41 modfuncList=None, 55 modfuncList=None,
42 tracePython=False, 56 tracePython=False,
43 autoClearShell=True, 57 autoClearShell=True,
44 autoContinue=True, 58 autoContinue=True,
45 enableMultiprocess=False, 59 enableMultiprocess=False,
67 @type bool 81 @type bool
68 @param unhandledExceptions flag indicating to always report unhandled exceptions 82 @param unhandledExceptions flag indicating to always report unhandled exceptions
69 @type bool 83 @type bool
70 @param parent parent widget of this dialog 84 @param parent parent widget of this dialog
71 @type QWidget 85 @type QWidget
72 @param dialogType type of the start dialog 86 @param dialogMode mode of the start dialog
73 <ul> 87 <ul>
74 <li>0 = start debug dialog</li> 88 <li>StartDialogMode.Debug = start debug dialog</li>
75 <li>1 = start run dialog</li> 89 <li>StartDialogMode.Run = start run dialog</li>
76 <li>2 = start coverage dialog</li> 90 <li>StartDialogMode.Coverage = start coverage dialog</li>
77 <li>3 = start profile dialog</li> 91 <li>StartDialogMode.Profile = start profile dialog</li>
78 </ul> 92 </ul>
79 @type int (0 to 3) 93 @type StartDialogMode
80 @param modfuncList history list of module functions 94 @param modfuncList history list of module functions
81 @type list of str 95 @type list of str
82 @param tracePython flag indicating if the Python library should 96 @param tracePython flag indicating if the Python library should
83 be traced as well 97 be traced as well
84 @type bool 98 @type bool
104 @type str 118 @type str
105 @param scriptsList history list of script names 119 @param scriptsList history list of script names
106 @type list of str 120 @type list of str
107 """ 121 """
108 super().__init__(parent) 122 super().__init__(parent)
123 self.setupUi(self)
109 self.setModal(True) 124 self.setModal(True)
110 125
111 self.dialogType = dialogType 126 self.__dialogMode = dialogMode
112 if dialogType == 0: 127 self.debugGroup.setVisible(self.__dialogMode == StartDialogMode.Debug)
113 from .Ui_StartDebugDialog import ( # __IGNORE_WARNING_I101__ 128 self.coverageGroup.setVisible(self.__dialogMode == StartDialogMode.Coverage)
114 Ui_StartDebugDialog, 129 self.profileGroup.setVisible(self.__dialogMode == StartDialogMode.Profile)
115 ) 130 # nothing special for 'Run' mode
116 131
117 self.ui = Ui_StartDebugDialog() 132 self.venvComboBox.addItem("")
118 elif dialogType == 1:
119 from .Ui_StartRunDialog import Ui_StartRunDialog # __IGNORE_WARNING_I101__
120
121 self.ui = Ui_StartRunDialog()
122 elif dialogType == 2:
123 from .Ui_StartCoverageDialog import ( # __IGNORE_WARNING_I101__
124 Ui_StartCoverageDialog,
125 )
126
127 self.ui = Ui_StartCoverageDialog()
128 elif dialogType == 3:
129 from .Ui_StartProfileDialog import ( # __IGNORE_WARNING_I101__
130 Ui_StartProfileDialog,
131 )
132
133 self.ui = Ui_StartProfileDialog()
134 self.ui.setupUi(self)
135
136 self.ui.venvComboBox.addItem("")
137 projectEnvironmentString = ( 133 projectEnvironmentString = (
138 ericApp().getObject("DebugServer").getProjectEnvironmentString() 134 ericApp().getObject("DebugServer").getProjectEnvironmentString()
139 ) 135 )
140 if projectEnvironmentString: 136 if projectEnvironmentString:
141 self.ui.venvComboBox.addItem(projectEnvironmentString) 137 self.venvComboBox.addItem(projectEnvironmentString)
142 self.ui.venvComboBox.addItems( 138 self.venvComboBox.addItems(
143 sorted(ericApp().getObject("VirtualEnvManager").getVirtualenvNames()) 139 sorted(ericApp().getObject("VirtualEnvManager").getVirtualenvNames())
144 ) 140 )
145 141
146 self.ui.scriptnamePicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) 142 self.scriptnamePicker.setMode(EricPathPickerModes.OPEN_FILE_MODE)
147 self.ui.scriptnamePicker.setDefaultDirectory( 143 self.scriptnamePicker.setDefaultDirectory(
148 Preferences.getMultiProject("Workspace") 144 Preferences.getMultiProject("Workspace")
149 ) 145 )
150 self.ui.scriptnamePicker.setInsertPolicy(QComboBox.InsertPolicy.InsertAtTop) 146 self.scriptnamePicker.setInsertPolicy(QComboBox.InsertPolicy.InsertAtTop)
151 self.ui.scriptnamePicker.setSizeAdjustPolicy( 147 self.scriptnamePicker.setSizeAdjustPolicy(
152 QComboBox.SizeAdjustPolicy.AdjustToMinimumContentsLengthWithIcon 148 QComboBox.SizeAdjustPolicy.AdjustToMinimumContentsLengthWithIcon
153 ) 149 )
154 self.ui.scriptnamePicker.setFilters( 150 self.scriptnamePicker.setFilters(
155 self.tr( 151 self.tr(
156 "Python Files (*.py *.py3);;" 152 "Python Files (*.py *.py3);;"
157 "Python GUI Files (*.pyw *.pyw3);;" 153 "Python GUI Files (*.pyw *.pyw3);;"
158 "All Files (*)" 154 "All Files (*)"
159 ) 155 )
160 ) 156 )
161 self.ui.scriptnamePicker.setEnabled(not forProject) 157 self.scriptnamePicker.setEnabled(not forProject)
162 158
163 self.ui.workdirPicker.setMode(EricPathPickerModes.DIRECTORY_MODE) 159 self.workdirPicker.setMode(EricPathPickerModes.DIRECTORY_MODE)
164 self.ui.workdirPicker.setDefaultDirectory( 160 self.workdirPicker.setDefaultDirectory(Preferences.getMultiProject("Workspace"))
165 Preferences.getMultiProject("Workspace") 161 self.workdirPicker.setInsertPolicy(QComboBox.InsertPolicy.InsertAtTop)
166 ) 162 self.workdirPicker.setSizeAdjustPolicy(
167 self.ui.workdirPicker.setInsertPolicy(QComboBox.InsertPolicy.InsertAtTop)
168 self.ui.workdirPicker.setSizeAdjustPolicy(
169 QComboBox.SizeAdjustPolicy.AdjustToMinimumContentsLengthWithIcon 163 QComboBox.SizeAdjustPolicy.AdjustToMinimumContentsLengthWithIcon
170 ) 164 )
171 165
172 self.clearButton = self.ui.buttonBox.addButton( 166 self.clearButton = self.buttonBox.addButton(
173 self.tr("Clear Histories"), QDialogButtonBox.ButtonRole.ActionRole 167 self.tr("Clear Histories"), QDialogButtonBox.ButtonRole.ActionRole
174 ) 168 )
175 self.editButton = self.ui.buttonBox.addButton( 169 self.editButton = self.buttonBox.addButton(
176 self.tr("Edit History"), QDialogButtonBox.ButtonRole.ActionRole 170 self.tr("Edit History"), QDialogButtonBox.ButtonRole.ActionRole
177 ) 171 )
178 172
179 self.setWindowTitle(caption) 173 self.setWindowTitle(caption)
180 self.ui.cmdlineCombo.completer().setCaseSensitivity( 174 self.cmdlineCombo.completer().setCaseSensitivity(
181 Qt.CaseSensitivity.CaseSensitive 175 Qt.CaseSensitivity.CaseSensitive
182 ) 176 )
183 self.ui.cmdlineCombo.clear() 177 self.cmdlineCombo.lineEdit().setClearButtonEnabled(True)
184 self.ui.cmdlineCombo.addItems(argvList) 178 self.cmdlineCombo.clear()
179 self.cmdlineCombo.addItems(argvList)
185 if len(argvList) > 0: 180 if len(argvList) > 0:
186 self.ui.cmdlineCombo.setCurrentIndex(0) 181 self.cmdlineCombo.setCurrentIndex(0)
187 182
188 self.ui.workdirPicker.clear() 183 self.workdirPicker.clear()
189 self.ui.workdirPicker.addItems(wdList) 184 self.workdirPicker.addItems(wdList)
190 if len(wdList) > 0: 185 if len(wdList) > 0:
191 self.ui.workdirPicker.setCurrentIndex(0) 186 self.workdirPicker.setCurrentIndex(0)
192 187
193 self.ui.environmentCombo.completer().setCaseSensitivity( 188 self.environmentCombo.completer().setCaseSensitivity(
194 Qt.CaseSensitivity.CaseSensitive 189 Qt.CaseSensitivity.CaseSensitive
195 ) 190 )
196 self.ui.environmentCombo.clear() 191 self.environmentCombo.lineEdit().setClearButtonEnabled(True)
197 self.ui.environmentCombo.addItems(envList) 192 self.environmentCombo.clear()
198 193 self.environmentCombo.addItems(envList)
199 self.ui.exceptionCheckBox.setChecked(exceptions) 194
200 self.ui.unhandledExceptionCheckBox.setChecked(unhandledExceptions) 195 self.exceptionCheckBox.setChecked(exceptions)
201 self.ui.clearShellCheckBox.setChecked(autoClearShell) 196 self.unhandledExceptionCheckBox.setChecked(unhandledExceptions)
202 self.ui.consoleCheckBox.setEnabled( 197 self.clearShellCheckBox.setChecked(autoClearShell)
198 self.consoleCheckBox.setEnabled(
203 Preferences.getDebugger("ConsoleDbgCommand") != "" 199 Preferences.getDebugger("ConsoleDbgCommand") != ""
204 ) 200 )
205 self.ui.consoleCheckBox.setChecked(False) 201 self.consoleCheckBox.setChecked(False)
206 202
207 venvIndex = max(0, self.ui.venvComboBox.findText(lastUsedVenvName)) 203 venvIndex = max(0, self.venvComboBox.findText(lastUsedVenvName))
208 self.ui.venvComboBox.setCurrentIndex(venvIndex) 204 self.venvComboBox.setCurrentIndex(venvIndex)
209 self.ui.globalOverrideGroup.setChecked(configOverride["enable"]) 205 self.globalOverrideGroup.setChecked(configOverride["enable"])
210 self.ui.redirectCheckBox.setChecked(configOverride["redirect"]) 206 self.redirectCheckBox.setChecked(configOverride["redirect"])
211 207
212 self.ui.scriptnamePicker.addItems(scriptsList) 208 self.scriptnamePicker.addItems(scriptsList)
213 self.ui.scriptnamePicker.setText(scriptName) 209 self.scriptnamePicker.setText(scriptName)
214 210
215 if dialogType == 0: # start debug dialog 211 if dialogMode == StartDialogMode.Debug:
216 enableMultiprocessGlobal = Preferences.getDebugger("MultiProcessEnabled") 212 enableMultiprocessGlobal = Preferences.getDebugger("MultiProcessEnabled")
217 self.ui.tracePythonCheckBox.setChecked(tracePython) 213 self.tracePythonCheckBox.setChecked(tracePython)
218 self.ui.tracePythonCheckBox.show() 214 self.tracePythonCheckBox.show()
219 self.ui.autoContinueCheckBox.setChecked(autoContinue) 215 self.autoContinueCheckBox.setChecked(autoContinue)
220 self.ui.multiprocessGroup.setEnabled(enableMultiprocessGlobal) 216 self.multiprocessGroup.setEnabled(enableMultiprocessGlobal)
221 self.ui.multiprocessGroup.setChecked( 217 self.multiprocessGroup.setChecked(
222 enableMultiprocess & enableMultiprocessGlobal 218 enableMultiprocess & enableMultiprocessGlobal
223 ) 219 )
224 self.ui.multiprocessNoDebugCombo.clear() 220 self.multiprocessNoDebugCombo.clear()
225 self.ui.multiprocessNoDebugCombo.setToolTip( 221 self.multiprocessNoDebugCombo.setToolTip(
226 self.tr( 222 self.tr(
227 "Enter the list of programs or program patterns not to be" 223 "Enter the list of programs or program patterns not to be"
228 " debugged separated by '{0}'." 224 " debugged separated by '{0}'."
229 ).format(os.pathsep) 225 ).format(os.pathsep)
230 ) 226 )
227 self.multiprocessNoDebugCombo.lineEdit().setClearButtonEnabled(True)
231 if multiprocessNoDebugHistory: 228 if multiprocessNoDebugHistory:
232 self.ui.multiprocessNoDebugCombo.completer().setCaseSensitivity( 229 self.multiprocessNoDebugCombo.completer().setCaseSensitivity(
233 Qt.CaseSensitivity.CaseSensitive 230 Qt.CaseSensitivity.CaseSensitive
234 ) 231 )
235 self.ui.multiprocessNoDebugCombo.addItems(multiprocessNoDebugHistory) 232 self.multiprocessNoDebugCombo.addItems(multiprocessNoDebugHistory)
236 self.ui.multiprocessNoDebugCombo.setCurrentIndex(0) 233 self.multiprocessNoDebugCombo.setCurrentIndex(0)
237 234
238 if dialogType == 3: # start coverage or profile dialog 235 if dialogMode == StartDialogMode.Coverage:
239 self.ui.eraseCheckBox.setChecked(True) 236 self.eraseCoverageCheckBox.setChecked(True)
240 237
241 self.ui.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setFocus( 238 if dialogMode == StartDialogMode.Profile:
239 self.eraseProfileCheckBox.setChecked(True)
240
241 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setFocus(
242 Qt.FocusReason.OtherFocusReason 242 Qt.FocusReason.OtherFocusReason
243 ) 243 )
244 244
245 self.__clearHistoryLists = False 245 self.__clearHistoryLists = False
246 self.__historiesModified = False 246 self.__historiesModified = False
250 250
251 def on_modFuncCombo_editTextChanged(self): 251 def on_modFuncCombo_editTextChanged(self):
252 """ 252 """
253 Private slot to enable/disable the OK button. 253 Private slot to enable/disable the OK button.
254 """ 254 """
255 self.ui.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setDisabled( 255 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setDisabled(
256 self.ui.modFuncCombo.currentText() == "" 256 self.modFuncCombo.currentText() == ""
257 ) 257 )
258 258
259 def getData(self): 259 def getData(self):
260 """ 260 """
261 Public method to retrieve the data entered into this dialog. 261 Public method to retrieve the data entered into this dialog.
263 @return a tuple of virtual environment, script name, argv, workdir, 263 @return a tuple of virtual environment, script name, argv, workdir,
264 environment, exceptions flag, unhandled exceptions flag, clear interpreter 264 environment, exceptions flag, unhandled exceptions flag, clear interpreter
265 flag and run in console flag 265 flag and run in console flag
266 @rtype tuple of (str, str, str, str, str, bool, bool, bool, bool) 266 @rtype tuple of (str, str, str, str, str, bool, bool, bool, bool)
267 """ 267 """
268 cmdLine = self.ui.cmdlineCombo.currentText() 268 cmdLine = self.cmdlineCombo.currentText()
269 workdir = self.ui.workdirPicker.currentText(toNative=False) 269 workdir = self.workdirPicker.currentText(toNative=False)
270 environment = self.ui.environmentCombo.currentText() 270 environment = self.environmentCombo.currentText()
271 venvName = self.ui.venvComboBox.currentText() 271 venvName = self.venvComboBox.currentText()
272 scriptName = ( 272 scriptName = (
273 self.ui.scriptnamePicker.currentText() 273 self.scriptnamePicker.currentText()
274 if self.ui.scriptnamePicker.isEnabled() 274 if self.scriptnamePicker.isEnabled()
275 else "" 275 else ""
276 ) 276 )
277 277
278 return ( 278 return (
279 venvName, 279 venvName,
280 scriptName, 280 scriptName,
281 cmdLine, 281 cmdLine,
282 workdir, 282 workdir,
283 environment, 283 environment,
284 self.ui.exceptionCheckBox.isChecked(), 284 self.exceptionCheckBox.isChecked(),
285 self.ui.unhandledExceptionCheckBox.isChecked(), 285 self.unhandledExceptionCheckBox.isChecked(),
286 self.ui.clearShellCheckBox.isChecked(), 286 self.clearShellCheckBox.isChecked(),
287 self.ui.consoleCheckBox.isChecked(), 287 self.consoleCheckBox.isChecked(),
288 ) 288 )
289 289
290 def getGlobalOverrideData(self): 290 def getGlobalOverrideData(self):
291 """ 291 """
292 Public method to retrieve the global configuration override data 292 Public method to retrieve the global configuration override data
295 @return dictionary containing a flag indicating to activate the global 295 @return dictionary containing a flag indicating to activate the global
296 override and a flag indicating a redirect of stdin/stdout/stderr 296 override and a flag indicating a redirect of stdin/stdout/stderr
297 @rtype dict 297 @rtype dict
298 """ 298 """
299 return { 299 return {
300 "enable": self.ui.globalOverrideGroup.isChecked(), 300 "enable": self.globalOverrideGroup.isChecked(),
301 "redirect": self.ui.redirectCheckBox.isChecked(), 301 "redirect": self.redirectCheckBox.isChecked(),
302 } 302 }
303 303
304 def getDebugData(self): 304 def getDebugData(self):
305 """ 305 """
306 Public method to retrieve the debug related data entered into this 306 Public method to retrieve the debug related data entered into this
311 stop at the first executable line, a flag indicating to support 311 stop at the first executable line, a flag indicating to support
312 multi process debugging and a space separated list of programs not 312 multi process debugging and a space separated list of programs not
313 to be debugged 313 to be debugged
314 @rtype tuple of (bool, bool, bool, str) 314 @rtype tuple of (bool, bool, bool, str)
315 """ 315 """
316 if self.dialogType == 0: 316 if self.__dialogMode == StartDialogMode.Debug:
317 return ( 317 return (
318 self.ui.tracePythonCheckBox.isChecked(), 318 self.tracePythonCheckBox.isChecked(),
319 self.ui.autoContinueCheckBox.isChecked(), 319 self.autoContinueCheckBox.isChecked(),
320 self.ui.multiprocessGroup.isChecked(), 320 self.multiprocessGroup.isChecked(),
321 self.ui.multiprocessNoDebugCombo.currentText(), 321 self.multiprocessNoDebugCombo.currentText(),
322 ) 322 )
323 else: 323 else:
324 return (False, False, False, "") 324 return (False, False, False, "")
325 325
326 def getCoverageData(self): 326 def getCoverageData(self):
329 dialog. 329 dialog.
330 330
331 @return flag indicating erasure of coverage info 331 @return flag indicating erasure of coverage info
332 @rtype bool 332 @rtype bool
333 """ 333 """
334 if self.dialogType == 2: 334 if self.__dialogMode == StartDialogMode.Coverage:
335 return self.ui.eraseCheckBox.isChecked() 335 return self.eraseCoverageCheckBox.isChecked()
336 else: 336 else:
337 return False 337 return False
338 338
339 def getProfilingData(self): 339 def getProfilingData(self):
340 """ 340 """
342 dialog. 342 dialog.
343 343
344 @return flag indicating erasure of profiling info 344 @return flag indicating erasure of profiling info
345 @rtype bool 345 @rtype bool
346 """ 346 """
347 if self.dialogType == 3: 347 if self.__dialogMode == StartDialogMode.Profile:
348 return self.ui.eraseCheckBox.isChecked() 348 return self.eraseProfileCheckBox.isChecked()
349 else: 349 else:
350 return False 350 return False
351 351
352 def __clearHistories(self): 352 def __clearHistories(self):
353 """ 353 """
355 clear the lists. 355 clear the lists.
356 """ 356 """
357 self.__clearHistoryLists = True 357 self.__clearHistoryLists = True
358 self.__historiesModified = False # clear catches it all 358 self.__historiesModified = False # clear catches it all
359 359
360 cmdLine = self.ui.cmdlineCombo.currentText() 360 cmdLine = self.cmdlineCombo.currentText()
361 workdir = self.ui.workdirPicker.currentText() 361 workdir = self.workdirPicker.currentText()
362 environment = self.ui.environmentCombo.currentText() 362 environment = self.environmentCombo.currentText()
363 scriptName = self.ui.scriptnamePicker.currentText() 363 scriptName = self.scriptnamePicker.currentText()
364 364
365 self.ui.cmdlineCombo.clear() 365 self.cmdlineCombo.clear()
366 self.ui.workdirPicker.clear() 366 self.workdirPicker.clear()
367 self.ui.environmentCombo.clear() 367 self.environmentCombo.clear()
368 self.ui.scriptnamePicker.clear() 368 self.scriptnamePicker.clear()
369 369
370 self.ui.cmdlineCombo.addItem(cmdLine) 370 self.cmdlineCombo.addItem(cmdLine)
371 self.ui.workdirPicker.addItem(workdir) 371 self.workdirPicker.addItem(workdir)
372 self.ui.environmentCombo.addItem(environment) 372 self.environmentCombo.addItem(environment)
373 self.ui.scriptnamePicker.addItem("") 373 self.scriptnamePicker.addItem("")
374 self.ui.scriptnamePicker.setCurrentText(scriptName) 374 self.scriptnamePicker.setCurrentText(scriptName)
375 375
376 if self.dialogType == 0: 376 if self.__dialogMode == StartDialogMode.Debug:
377 noDebugList = self.ui.multiprocessNoDebugCombo.currentText() 377 noDebugList = self.multiprocessNoDebugCombo.currentText()
378 self.ui.multiprocessNoDebugCombo.clear() 378 self.multiprocessNoDebugCombo.clear()
379 self.ui.multiprocessNoDebugCombo.addItem(noDebugList) 379 self.multiprocessNoDebugCombo.addItem(noDebugList)
380 380
381 def __editHistory(self): 381 def __editHistory(self):
382 """ 382 """
383 Private slot to edit a history list. 383 Private slot to edit a history list.
384 """ 384 """
391 self.tr("Working Directory"), 391 self.tr("Working Directory"),
392 self.tr("Environment"), 392 self.tr("Environment"),
393 ] 393 ]
394 widgets = [ 394 widgets = [
395 None, 395 None,
396 self.ui.scriptnamePicker, 396 self.scriptnamePicker,
397 self.ui.cmdlineCombo, 397 self.cmdlineCombo,
398 self.ui.workdirPicker, 398 self.workdirPicker,
399 self.ui.environmentCombo, 399 self.environmentCombo,
400 ] 400 ]
401 if self.dialogType == 0: 401 if self.__dialogMode == StartDialogMode.Debug:
402 histories.append(self.tr("No Debug Programs")) 402 histories.append(self.tr("No Debug Programs"))
403 widgets.append(self.ui.multiprocessNoDebugCombo) 403 widgets.append(self.multiprocessNoDebugCombo)
404 historyKind, ok = QInputDialog.getItem( 404 historyKind, ok = QInputDialog.getItem(
405 self, 405 self,
406 self.tr("Edit History"), 406 self.tr("Edit History"),
407 self.tr("Select the history list to be edited:"), 407 self.tr("Select the history list to be edited:"),
408 histories, 408 histories,
458 programs lists 458 programs lists
459 @rtype tuple of five list of str 459 @rtype tuple of five list of str
460 """ 460 """
461 noDebugHistory = ( 461 noDebugHistory = (
462 [ 462 [
463 self.ui.multiprocessNoDebugCombo.itemText(index) 463 self.multiprocessNoDebugCombo.itemText(index)
464 for index in range(self.ui.multiprocessNoDebugCombo.count()) 464 for index in range(self.multiprocessNoDebugCombo.count())
465 ] 465 ]
466 if self.dialogType == 0 466 if self.__dialogMode == StartDialogMode.Debug
467 else None 467 else None
468 ) 468 )
469 return ( 469 return (
470 self.ui.scriptnamePicker.getPathItems(), 470 self.scriptnamePicker.getPathItems(),
471 [ 471 [
472 self.ui.cmdlineCombo.itemText(index) 472 self.cmdlineCombo.itemText(index)
473 for index in range(self.ui.cmdlineCombo.count()) 473 for index in range(self.cmdlineCombo.count())
474 ], 474 ],
475 self.ui.workdirPicker.getPathItems(), 475 self.workdirPicker.getPathItems(),
476 [ 476 [
477 self.ui.environmentCombo.itemText(index) 477 self.environmentCombo.itemText(index)
478 for index in range(self.ui.environmentCombo.count()) 478 for index in range(self.environmentCombo.count())
479 ], 479 ],
480 noDebugHistory, 480 noDebugHistory,
481 ) 481 )
482 482
483 def on_buttonBox_clicked(self, button): 483 def on_buttonBox_clicked(self, button):

eric ide

mercurial