29 def __init__(self, caption, lastUsedVenvName, argvList, wdList, envList, |
29 def __init__(self, caption, lastUsedVenvName, argvList, wdList, envList, |
30 exceptions, |
30 exceptions, |
31 parent=None, dialogType=0, modfuncList=None, |
31 parent=None, dialogType=0, modfuncList=None, |
32 tracePython=False, autoClearShell=True, autoContinue=True, |
32 tracePython=False, autoClearShell=True, autoContinue=True, |
33 enableMultiprocess=False, multiprocessNoDebugHistory=None, |
33 enableMultiprocess=False, multiprocessNoDebugHistory=None, |
34 configOverride=None): |
34 configOverride=None, |
|
35 forProject=False, lastUsedScriptName="", scriptsList=None): |
35 """ |
36 """ |
36 Constructor |
37 Constructor |
37 |
38 |
38 @param caption the caption to be displayed |
39 @param caption the caption to be displayed |
39 @type str |
40 @type str |
76 debugged |
77 debugged |
77 @type list of str |
78 @type list of str |
78 @param configOverride dictionary containing the global config override |
79 @param configOverride dictionary containing the global config override |
79 data |
80 data |
80 @type dict |
81 @type dict |
|
82 @param forProject flag indicating to get the parameters for a |
|
83 run/debug/... action for a project |
|
84 @type bool |
|
85 @param lastUsedScriptName name of the most recently used script |
|
86 @type str |
|
87 @param scriptsList history list of script names |
|
88 @type list of str |
81 """ |
89 """ |
82 super().__init__(parent) |
90 super().__init__(parent) |
83 self.setModal(True) |
91 self.setModal(True) |
84 |
92 |
85 self.dialogType = dialogType |
93 self.dialogType = dialogType |
100 self.ui.venvComboBox.addItem("") |
108 self.ui.venvComboBox.addItem("") |
101 self.ui.venvComboBox.addItems( |
109 self.ui.venvComboBox.addItems( |
102 sorted(ericApp().getObject("VirtualEnvManager") |
110 sorted(ericApp().getObject("VirtualEnvManager") |
103 .getVirtualenvNames())) |
111 .getVirtualenvNames())) |
104 |
112 |
|
113 self.ui.scriptnamePicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) |
|
114 self.ui.scriptnamePicker.setDefaultDirectory( |
|
115 Preferences.getMultiProject("Workspace")) |
|
116 self.ui.scriptnamePicker.setInsertPolicy( |
|
117 QComboBox.InsertPolicy.InsertAtTop) |
|
118 self.ui.scriptnamePicker.setSizeAdjustPolicy( |
|
119 QComboBox.SizeAdjustPolicy.AdjustToMinimumContentsLengthWithIcon) |
|
120 self.ui.scriptnamePicker.setFilters(self.tr( |
|
121 "Python Files (*.py *.py3);;" |
|
122 "Python GUI Files (*.pyw *.pyw3);;" |
|
123 "All Files (*)" |
|
124 )) |
|
125 self.ui.scriptnamePicker.setEnabled(not forProject) |
|
126 |
105 self.ui.workdirPicker.setMode(EricPathPickerModes.DIRECTORY_MODE) |
127 self.ui.workdirPicker.setMode(EricPathPickerModes.DIRECTORY_MODE) |
106 self.ui.workdirPicker.setDefaultDirectory( |
128 self.ui.workdirPicker.setDefaultDirectory( |
107 Preferences.getMultiProject("Workspace")) |
129 Preferences.getMultiProject("Workspace")) |
108 self.ui.workdirPicker.setInsertPolicy( |
130 self.ui.workdirPicker.setInsertPolicy( |
109 QComboBox.InsertPolicy.InsertAtTop) |
131 QComboBox.InsertPolicy.InsertAtTop) |
110 self.ui.workdirPicker.setSizeAdjustPolicy( |
132 self.ui.workdirPicker.setSizeAdjustPolicy( |
111 QComboBox.SizeAdjustPolicy.AdjustToMinimumContentsLengthWithIcon) |
133 QComboBox.SizeAdjustPolicy.AdjustToMinimumContentsLengthWithIcon) |
112 |
134 |
|
135 # TODO: extend these History actions |
113 self.clearButton = self.ui.buttonBox.addButton( |
136 self.clearButton = self.ui.buttonBox.addButton( |
114 self.tr("Clear Histories"), QDialogButtonBox.ButtonRole.ActionRole) |
137 self.tr("Clear Histories"), QDialogButtonBox.ButtonRole.ActionRole) |
115 self.editButton = self.ui.buttonBox.addButton( |
138 self.editButton = self.ui.buttonBox.addButton( |
116 self.tr("Edit History"), QDialogButtonBox.ButtonRole.ActionRole) |
139 self.tr("Edit History"), QDialogButtonBox.ButtonRole.ActionRole) |
117 |
140 |