30 |
30 |
31 self.currentButton.setText( |
31 self.currentButton.setText( |
32 self.tr("Current Patch ({0})").format(currentPatch)) |
32 self.tr("Current Patch ({0})").format(currentPatch)) |
33 self.nameCombo.addItems([""] + patchesList) |
33 self.nameCombo.addItems([""] + patchesList) |
34 |
34 |
35 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) |
35 self.buttonBox.button( |
|
36 QDialogButtonBox.StandardButton.Ok).setEnabled(False) |
36 |
37 |
37 msh = self.minimumSizeHint() |
38 msh = self.minimumSizeHint() |
38 self.resize(max(self.width(), msh.width()), msh.height()) |
39 self.resize(max(self.width(), msh.width()), msh.height()) |
39 |
40 |
40 def __updateUI(self): |
41 def __updateUI(self): |
43 """ |
44 """ |
44 enable = self.nameEdit.text() != "" |
45 enable = self.nameEdit.text() != "" |
45 if self.namedButton.isChecked(): |
46 if self.namedButton.isChecked(): |
46 enable = enable and self.nameCombo.currentText() != "" |
47 enable = enable and self.nameCombo.currentText() != "" |
47 |
48 |
48 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable) |
49 self.buttonBox.button( |
|
50 QDialogButtonBox.StandardButton.Ok).setEnabled(enable) |
49 |
51 |
50 @pyqtSlot(str) |
52 @pyqtSlot(str) |
51 def on_nameEdit_textChanged(self, txt): |
53 def on_nameEdit_textChanged(self, txt): |
52 """ |
54 """ |
53 Private slot to handle changes of the new name. |
55 Private slot to handle changes of the new name. |