34 self.setupUi(self) |
34 self.setupUi(self) |
35 |
35 |
36 self.envsList.addItems(environments) |
36 self.envsList.addItems(environments) |
37 self.nameEdit.setText(currentName) |
37 self.nameEdit.setText(currentName) |
38 |
38 |
39 self.nameEdit.setFocus(Qt.OtherFocusReason) |
39 self.nameEdit.setFocus(Qt.FocusReason.OtherFocusReason) |
40 self.nameEdit.selectAll() |
40 self.nameEdit.selectAll() |
41 |
41 |
42 @pyqtSlot(str) |
42 @pyqtSlot(str) |
43 def on_nameEdit_textChanged(self, txt): |
43 def on_nameEdit_textChanged(self, txt): |
44 """ |
44 """ |
45 Private slot to handle a change of the environment name. |
45 Private slot to handle a change of the environment name. |
46 |
46 |
47 @param txt contens of the name edit |
47 @param txt contens of the name edit |
48 @type str |
48 @type str |
49 """ |
49 """ |
50 items = self.envsList.findItems(txt, Qt.MatchExactly) |
50 items = self.envsList.findItems(txt, Qt.MatchFlag.MatchExactly) |
51 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled( |
51 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( |
52 bool(txt) and len(items) == 0) |
52 bool(txt) and len(items) == 0) |
53 |
53 |
54 def getName(self): |
54 def getName(self): |
55 """ |
55 """ |
56 Public method to get the entered name. |
56 Public method to get the entered name. |