diff -r e9e7eca7efee -r bf71ee032bb4 src/eric7/Debugger/VariablesFilterDialog.py --- a/src/eric7/Debugger/VariablesFilterDialog.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/Debugger/VariablesFilterDialog.py Wed Jul 13 14:55:47 2022 +0200 @@ -19,14 +19,15 @@ class VariablesFilterDialog(QDialog, Ui_VariablesFilterDialog): """ Class implementing the variables filter dialog. - + It opens a dialog window for the configuration of the variables type filter to be applied during a debugging session. """ + def __init__(self, parent=None, name=None, modal=False): """ Constructor - + @param parent parent widget of this dialog (QWidget) @param name name of this dialog (string) @param modal flag to indicate a modal dialog (boolean) @@ -38,25 +39,27 @@ self.setupUi(self) self.defaultButton = self.buttonBox.addButton( - self.tr("Save Default"), QDialogButtonBox.ButtonRole.ActionRole) - - #populate the list widgets and set the default selection + self.tr("Save Default"), QDialogButtonBox.ButtonRole.ActionRole + ) + + # populate the list widgets and set the default selection for widget in self.localsList, self.globalsList: for varType, varTypeStr in ConfigVarTypeDispStrings.items(): itm = QListWidgetItem(self.tr(varTypeStr), widget) itm.setData(Qt.ItemDataRole.UserRole, varType) - itm.setFlags(Qt.ItemFlag.ItemIsEnabled | - Qt.ItemFlag.ItemIsUserCheckable) + itm.setFlags( + Qt.ItemFlag.ItemIsEnabled | Qt.ItemFlag.ItemIsUserCheckable + ) itm.setCheckState(Qt.CheckState.Unchecked) widget.addItem(itm) - + lDefaultFilter, gDefaultFilter = Preferences.getVarFilters() self.setSelection(lDefaultFilter, gDefaultFilter) def getSelection(self): """ Public slot to retrieve the current selections. - + @return tuple of lists containing the variable filters. The first list is the locals variables filter, the second the globals variables filter. @@ -67,18 +70,18 @@ itm = self.localsList.item(row) if itm.checkState() == Qt.CheckState.Unchecked: lList.append(itm.data(Qt.ItemDataRole.UserRole)) - + gList = [] for row in range(self.globalsList.count()): itm = self.globalsList.item(row) if itm.checkState() == Qt.CheckState.Unchecked: gList.append(itm.data(Qt.ItemDataRole.UserRole)) return (lList, gList) - + def setSelection(self, lList, gList): """ Public slot to set the current selection. - + @param lList local variables filter @type list of str @param gList global variables filter @@ -90,7 +93,7 @@ itm.setCheckState(Qt.CheckState.Unchecked) else: itm.setCheckState(Qt.CheckState.Checked) - + for row in range(self.globalsList.count()): itm = self.globalsList.item(row) if itm.data(Qt.ItemDataRole.UserRole) in gList: @@ -101,7 +104,7 @@ def on_buttonBox_clicked(self, button): """ Private slot called by a button of the button box clicked. - + @param button button that was clicked (QAbstractButton) """ if button == self.defaultButton: