47 self.__okButton = self.buttonBox.button(QDialogButtonBox.Ok) |
47 self.__okButton = self.buttonBox.button(QDialogButtonBox.Ok) |
48 self.__okButton.setEnabled(False) |
48 self.__okButton.setEnabled(False) |
49 self.__previewButton = self.buttonBox.addButton( |
49 self.__previewButton = self.buttonBox.addButton( |
50 self.tr("Preview"), QDialogButtonBox.ActionRole) |
50 self.tr("Preview"), QDialogButtonBox.ActionRole) |
51 self.__previewButton.setDefault(True) |
51 self.__previewButton.setDefault(True) |
|
52 self.__previewButton.setEnabled(False) |
52 |
53 |
53 msh = self.minimumSizeHint() |
54 msh = self.minimumSizeHint() |
54 self.resize(max(self.width(), msh.width()), msh.height()) |
55 self.resize(max(self.width(), msh.width()), msh.height()) |
55 |
56 |
56 @pyqtSlot(str) |
57 @pyqtSlot(str) |
60 |
61 |
61 @param text text entered into the edit |
62 @param text text entered into the edit |
62 @type str |
63 @type str |
63 """ |
64 """ |
64 self.__okButton.setEnabled(text != "") |
65 self.__okButton.setEnabled(text != "") |
|
66 self.__previewButton.setEnabled(text != "") |
65 |
67 |
66 @pyqtSlot(QAbstractButton) |
68 @pyqtSlot(QAbstractButton) |
67 def on_buttonBox_clicked(self, button): |
69 def on_buttonBox_clicked(self, button): |
68 """ |
70 """ |
69 Private slot to act on the button pressed. |
71 Private slot to act on the button pressed. |