eric6/E5Gui/E5MessageBox.py

changeset 7628
f904d0eef264
parent 7360
9190402e4505
child 7759
51aa6c6b66f7
equal deleted inserted replaced
7626:7f643d41464e 7628:f904d0eef264
233 Warning) 233 Warning)
234 @keyparam yesDefault flag indicating that the Yes button should be the 234 @keyparam yesDefault flag indicating that the Yes button should be the
235 default button (boolean) 235 default button (boolean)
236 @param textFormat format of the text (Qt.TextFormat) 236 @param textFormat format of the text (Qt.TextFormat)
237 @return flag indicating the selection of the Yes button (boolean) 237 @return flag indicating the selection of the Yes button (boolean)
238 """ 238 @exception ValueError raised to indicate a bad parameter value
239 assert icon in [Critical, Information, Question, Warning] 239 """
240 if icon not in [Critical, Information, Question, Warning]:
241 raise ValueError("Bad value for 'icon' parameter.")
240 242
241 res = __messageBox( 243 res = __messageBox(
242 parent, title, text, icon, 244 parent, title, text, icon,
243 QMessageBox.StandardButtons(QMessageBox.Yes | QMessageBox.No), 245 QMessageBox.StandardButtons(QMessageBox.Yes | QMessageBox.No),
244 yesDefault and QMessageBox.Yes or QMessageBox.No, 246 yesDefault and QMessageBox.Yes or QMessageBox.No,
255 @param text text to be shown by the message box (string) 257 @param text text to be shown by the message box (string)
256 @keyparam icon icon for the dialog (Critical, Information, Question or 258 @keyparam icon icon for the dialog (Critical, Information, Question or
257 Warning) 259 Warning)
258 @param textFormat format of the text (Qt.TextFormat) 260 @param textFormat format of the text (Qt.TextFormat)
259 @return flag indicating the selection of the Retry button (boolean) 261 @return flag indicating the selection of the Retry button (boolean)
260 """ 262 @exception ValueError raised to indicate a bad parameter value
261 assert icon in [Critical, Information, Question, Warning] 263 """
264 if icon not in [Critical, Information, Question, Warning]:
265 raise ValueError("Bad value for 'icon' parameter.")
262 266
263 res = __messageBox( 267 res = __messageBox(
264 parent, title, text, icon, 268 parent, title, text, icon,
265 QMessageBox.StandardButtons(QMessageBox.Retry | QMessageBox.Abort), 269 QMessageBox.StandardButtons(QMessageBox.Retry | QMessageBox.Abort),
266 QMessageBox.Retry, 270 QMessageBox.Retry,

eric ide

mercurial