diff -r e9e7eca7efee -r bf71ee032bb4 src/eric7/VirtualEnv/VirtualenvNameDialog.py --- a/src/eric7/VirtualEnv/VirtualenvNameDialog.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/VirtualEnv/VirtualenvNameDialog.py Wed Jul 13 14:55:47 2022 +0200 @@ -19,10 +19,11 @@ Class implementing a dialog to enter the logical name for a new virtual environment. """ + def __init__(self, environments, currentName, parent=None): """ Constructor - + @param environments list of environment names to be shown @type list of str @param currentName name to be shown in the name edit @@ -32,29 +33,30 @@ """ super().__init__(parent) self.setupUi(self) - + self.envsList.addItems(environments) self.nameEdit.setText(currentName) - + self.nameEdit.setFocus(Qt.FocusReason.OtherFocusReason) self.nameEdit.selectAll() - + @pyqtSlot(str) def on_nameEdit_textChanged(self, txt): """ Private slot to handle a change of the environment name. - + @param txt contens of the name edit @type str """ items = self.envsList.findItems(txt, Qt.MatchFlag.MatchExactly) self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( - bool(txt) and len(items) == 0) - + bool(txt) and len(items) == 0 + ) + def getName(self): """ Public method to get the entered name. - + @return name for the environment @rtype str """