diff -r e01ae92db699 -r 31965986ecd1 eric6/Debugger/StartDialog.py --- a/eric6/Debugger/StartDialog.py Sat Mar 06 10:00:52 2021 +0100 +++ b/eric6/Debugger/StartDialog.py Sun Mar 28 15:00:11 2021 +0200 @@ -30,7 +30,8 @@ exceptions, parent=None, dialogType=0, modfuncList=None, tracePython=False, autoClearShell=True, autoContinue=True, - enableMultiprocess=False, multiprocessNoDebugHistory=None): + enableMultiprocess=False, multiprocessNoDebugHistory=None, + configOverride=None): """ Constructor @@ -74,6 +75,9 @@ @param multiprocessNoDebugHistory list of lists with programs not to be debugged @type list of str + @param configOverride dictionary containing the global config override + data + @type dict """ super(StartDialog, self).__init__(parent) self.setModal(True) @@ -101,14 +105,15 @@ self.ui.workdirPicker.setMode(E5PathPickerModes.DirectoryMode) self.ui.workdirPicker.setDefaultDirectory( Preferences.getMultiProject("Workspace")) - self.ui.workdirPicker.setInsertPolicy(QComboBox.InsertAtTop) + self.ui.workdirPicker.setInsertPolicy( + QComboBox.InsertPolicy.InsertAtTop) self.ui.workdirPicker.setSizeAdjustPolicy( - QComboBox.AdjustToMinimumContentsLength) + QComboBox.SizeAdjustPolicy.AdjustToMinimumContentsLengthWithIcon) self.clearButton = self.ui.buttonBox.addButton( - self.tr("Clear Histories"), QDialogButtonBox.ActionRole) + self.tr("Clear Histories"), QDialogButtonBox.ButtonRole.ActionRole) self.editButton = self.ui.buttonBox.addButton( - self.tr("Edit History"), QDialogButtonBox.ActionRole) + self.tr("Edit History"), QDialogButtonBox.ButtonRole.ActionRole) self.setWindowTitle(caption) self.ui.cmdlineCombo.clear() @@ -128,6 +133,8 @@ self.ui.consoleCheckBox.setChecked(False) venvIndex = max(0, self.ui.venvComboBox.findText(lastUsedVenvName)) self.ui.venvComboBox.setCurrentIndex(venvIndex) + self.ui.globalOverrideGroup.setChecked(configOverride["enable"]) + self.ui.redirectCheckBox.setChecked(configOverride["redirect"]) if dialogType == 0: # start debug dialog enableMultiprocessGlobal = Preferences.getDebugger( @@ -161,8 +168,9 @@ """ Private slot to enable/disable the OK button. """ - self.ui.buttonBox.button(QDialogButtonBox.Ok).setDisabled( - self.ui.modFuncCombo.currentText() == "") + self.ui.buttonBox.button( + QDialogButtonBox.StandardButton.Ok).setDisabled( + self.ui.modFuncCombo.currentText() == "") def getData(self): """ @@ -185,7 +193,21 @@ self.ui.clearShellCheckBox.isChecked(), self.ui.consoleCheckBox.isChecked(), ) + + def getGlobalOverrideData(self): + """ + Public method to retrieve the global configuration override data + entered into this dialog. + @return dictionary containing a flag indicating to activate the global + override and a flag indicating a redirect of stdin/stdout/stderr + @rtype dict + """ + return { + "enable": self.ui.globalOverrideGroup.isChecked(), + "redirect": self.ui.redirectCheckBox.isChecked(), + } + def getDebugData(self): """ Public method to retrieve the debug related data entered into this @@ -296,7 +318,7 @@ if history: from .StartHistoryEditDialog import StartHistoryEditDialog dlg = StartHistoryEditDialog(history, self) - if dlg.exec() == QDialog.Accepted: + if dlg.exec() == QDialog.DialogCode.Accepted: history = dlg.getHistory() combo = combos[historiesIndex] if combo: