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