File indexing completed on 2025-02-16 13:11:44
0001 /* 0002 This file is part of the KDE libraries 0003 SPDX-FileCopyrightText: 1999 Waldo Bastian <bastian@kde.org> 0004 0005 SPDX-License-Identifier: LGPL-2.0-only 0006 */ 0007 0008 // krazy:excludeall=dpointer 0009 0010 #ifndef KMESSAGEBOX_H 0011 #define KMESSAGEBOX_H 0012 0013 #include <QDialogButtonBox> 0014 #include <QMessageBox> 0015 #include <QStringList> 0016 0017 #include <kguiitem.h> 0018 #include <kstandardguiitem.h> 0019 0020 #include <kwidgetsaddons_export.h> 0021 0022 class KMessageBoxDontAskAgainInterface; 0023 class KMessageBoxNotifyInterface; 0024 class QDialog; 0025 class QDialogButtonBox; 0026 class QWidget; 0027 class KConfig; 0028 0029 /** 0030 * Easy message dialog box. 0031 * 0032 * Provides convenience functions for some i18n'ed standard dialogs, 0033 * as well as audible notification via @ref KNotification 0034 * 0035 * The text in message boxes is wrapped automatically. The text may either 0036 * be plaintext or richtext. If the text is plaintext, a newline-character 0037 * may be used to indicate the end of a paragraph. 0038 * 0039 * \image html kmessagebox.png "An information dialog box" 0040 * 0041 * @author Waldo Bastian (bastian@kde.org) 0042 */ 0043 namespace KMessageBox 0044 { 0045 /** 0046 * Button types. 0047 */ 0048 enum ButtonCode { 0049 Ok = 1, 0050 Cancel = 2, 0051 PrimaryAction = 3, ///< @since 5.100 0052 SecondaryAction = 4, ///< @since 5.100 0053 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 0054 /// @deprecated Since 5.100, use PrimaryAction. 0055 Yes KWIDGETSADDONS_ENUMERATOR_DEPRECATED_VERSION(5, 100, "Use PrimaryAction.") = PrimaryAction, 0056 /// @deprecated Since 5.100, use SecondaryAction. 0057 No KWIDGETSADDONS_ENUMERATOR_DEPRECATED_VERSION(5, 100, "Use SecondaryAction.") = SecondaryAction, 0058 #endif 0059 Continue = 5, 0060 }; 0061 0062 enum DialogType { 0063 QuestionTwoActions = 1, ///< @since 5.100 0064 WarningTwoActions = 2, ///< @since 5.100 0065 WarningContinueCancel = 3, 0066 WarningTwoActionsCancel = 4, ///< @since 5.100 0067 Information = 5, 0068 // Reserved for: SSLMessageBox = 6 0069 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 97) 0070 Sorry ///< @deprecated Since 5.97, use Error. 0071 KWIDGETSADDONS_ENUMERATOR_DEPRECATED_VERSION(5, 97, "Use Error.") = 7, 0072 #endif 0073 Error = 8, 0074 QuestionTwoActionsCancel = 9, ///< @since 5.100 0075 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 0076 /// @deprecated Since 5.100, use QuestionTwoActions. 0077 QuestionYesNo KWIDGETSADDONS_ENUMERATOR_DEPRECATED_VERSION(5, 100, "Use QuestionTwoActions.") = QuestionTwoActions, 0078 /// @deprecated Since 5.100, use WarningTwoActions. 0079 WarningYesNo KWIDGETSADDONS_ENUMERATOR_DEPRECATED_VERSION(5, 100, "Use WarningTwoActions.") = WarningTwoActions, 0080 /// @deprecated Since 5.100, use WarningTwoActionsCancel. 0081 WarningYesNoCancel KWIDGETSADDONS_ENUMERATOR_DEPRECATED_VERSION(5, 100, "Use WarningTwoActionsCancel.") = WarningTwoActionsCancel, 0082 /// @deprecated Since 5.100, use QuestionTwoActionsCancel. 0083 QuestionYesNoCancel KWIDGETSADDONS_ENUMERATOR_DEPRECATED_VERSION(5, 100, "Use QuestionTwoActionsCancel.") = QuestionTwoActionsCancel, 0084 #endif 0085 }; 0086 0087 /** 0088 * @see Options 0089 */ 0090 enum Option { 0091 Notify = 1, ///< Emit a KNotify event 0092 AllowLink = 2, ///< The message may contain links. 0093 Dangerous = 4, ///< The action to be confirmed by the dialog is a potentially destructive one. The default button will be set to Cancel or SecondaryAction, 0094 ///< depending on which is available. 0095 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 97) 0096 PlainCaption ///< @deprecated Since 5.0 this option is ignored. 0097 KWIDGETSADDONS_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 97, 5, 0, "This option is ignored..") = 8, 0098 #endif 0099 NoExec = 16, ///< Do not call exec() in createKMessageBox() 0100 WindowModal = 32, ///< The window is to be modal relative to its parent. By default, it is application modal. 0101 }; 0102 0103 /** 0104 * Stores a combination of #Option values. 0105 */ 0106 Q_DECLARE_FLAGS(Options, Option) 0107 0108 // This declaration must be defined before first Option is used in method signatures 0109 Q_DECLARE_OPERATORS_FOR_FLAGS(Options) 0110 0111 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 0112 /** 0113 * Display a simple "question" dialog. 0114 * 0115 * @param parent Parent widget. 0116 * @param text Message string. 0117 * @param title Message box title. The application name is added to 0118 * the title. The default title is i18n("Question"). 0119 * @param buttonYes The text for the first button. 0120 * The default is KStandardGuiItem::yes(). 0121 * @param buttonNo The text for the second button. 0122 * The default is KStandardGuiItem::no(). 0123 * @param dontAskAgainName If provided, a checkbox is added with which 0124 * further confirmation can be turned off. 0125 * The string is used to lookup and store the setting 0126 * in the applications config file. 0127 * The setting is stored in the "Notification Messages" group. 0128 * If @p dontAskAgainName starts with a ':' then the setting 0129 * is stored in the global config file. 0130 * @param options see Option 0131 * 0132 * @return 'Yes' is returned if the Yes-button is pressed. 'No' is returned 0133 * if the No-button is pressed. 0134 * 0135 * To be used for questions like "Do you have a printer?" 0136 * 0137 * The default button is "Yes". Pressing "Esc" selects "No". 0138 * 0139 * @deprecated Since 5.100, use questionTwoActions() 0140 */ 0141 KWIDGETSADDONS_EXPORT 0142 KWIDGETSADDONS_DEPRECATED_VERSION(5, 100, "Use questionTwoActions()") 0143 ButtonCode questionYesNo(QWidget *parent, 0144 const QString &text, 0145 const QString &title = QString(), 0146 const KGuiItem &buttonYes = KStandardGuiItem::yes(), 0147 const KGuiItem &buttonNo = KStandardGuiItem::no(), 0148 const QString &dontAskAgainName = QString(), 0149 Options options = Notify); 0150 #endif 0151 0152 /** 0153 * Display a "question" dialog with two action buttons. 0154 * 0155 * To be used for questions like "Do you want to save the message for later or discard it?". 0156 * 0157 * The default button is the primary button. Pressing "Esc" triggers the secondary button. 0158 * 0159 * @param parent the parent widget 0160 * @param text the message string 0161 * @param title the message box title. If an empty string, defaults to i18n("Question"). 0162 * @param primaryAction the action for the primary button 0163 * @param secondaryAction the action for the secondary button 0164 * @param dontAskAgainName If not an empty string, a checkbox is added with which 0165 * further confirmation can be turned off. 0166 * The string is used to lookup and store the setting 0167 * in the applications config file. 0168 * The setting is stored in the "Notification Messages" group. 0169 * If @p dontAskAgainName starts with a ':' then the setting 0170 * is stored in the global config file. 0171 * @param options see Option 0172 * 0173 * @returns @c PrimaryAction if the primary button is triggered, @c SecondaryAction 0174 * if the secondary button is triggered. 0175 * 0176 * @since 5.100 0177 */ 0178 KWIDGETSADDONS_EXPORT 0179 ButtonCode questionTwoActions(QWidget *parent, 0180 const QString &text, 0181 const QString &title, 0182 const KGuiItem &primaryAction, 0183 const KGuiItem &secondaryAction, 0184 const QString &dontAskAgainName = QString(), 0185 Options options = Notify); 0186 0187 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 0188 /** 0189 * Display a simple "question" dialog. 0190 * 0191 * @param parent Parent widget. 0192 * @param text Message string. 0193 * @param title Message box title. The application name is added to 0194 * the title. The default title is i18n("Question"). 0195 * @param buttonYes The text for the first button. 0196 * The default is KStandardGuiItem::yes(). 0197 * @param buttonNo The text for the second button. 0198 * The default is KStandardGuiItem::no(). 0199 * @param buttonCancel The text for the third button. 0200 * The default is KStandardGuiItem::cancel(). 0201 * @param dontAskAgainName If provided, a checkbox is added with which 0202 * further confirmation can be turned off. 0203 * The string is used to lookup and store the setting 0204 * in the applications config file. 0205 * The setting is stored in the "Notification Messages" group. 0206 * If @p dontAskAgainName starts with a ':' then the setting 0207 * is stored in the global config file. 0208 * @param options see Options 0209 * 0210 * @return 'Yes' is returned if the Yes-button is pressed. 'No' is returned 0211 * if the No-button is pressed. 0212 * 0213 * To be used for questions like "Do you want to discard the message or save it for later?", 0214 * 0215 * The default button is "Yes". Pressing "Esc" selects "Cancel". 0216 * 0217 * @deprecated Since 5.100, use questionTwoActionsCancel() 0218 */ 0219 KWIDGETSADDONS_EXPORT 0220 KWIDGETSADDONS_DEPRECATED_VERSION(5, 100, "Use questionTwoActionsCancel()") 0221 ButtonCode questionYesNoCancel(QWidget *parent, 0222 const QString &text, 0223 const QString &title = QString(), 0224 const KGuiItem &buttonYes = KStandardGuiItem::yes(), 0225 const KGuiItem &buttonNo = KStandardGuiItem::no(), 0226 const KGuiItem &buttonCancel = KStandardGuiItem::cancel(), 0227 const QString &dontAskAgainName = QString(), 0228 Options options = Notify); 0229 #endif 0230 0231 /** 0232 * Display a "question" dialog with two action buttons and a cancel button. 0233 * 0234 * To be used for questions like "Do you want to save the message for later or discard it?". 0235 * 0236 * The default button is the primary button. Pressing "Esc" triggers the cancel button. 0237 * 0238 * @param parent the parent widget 0239 * @param text the message string 0240 * @param title the message box title. If an empty string, defaults to i18n("Question"). 0241 * @param primaryAction the action for the primary button 0242 * @param secondaryAction the action for the secondary button 0243 * @param cancelAction the action for the cancel button 0244 * @param dontAskAgainName If not an empty string, a checkbox is added with which 0245 * further confirmation can be turned off. 0246 * The string is used to lookup and store the setting 0247 * in the applications config file. 0248 * The setting is stored in the "Notification Messages" group. 0249 * If @p dontAskAgainName starts with a ':' then the setting 0250 * is stored in the global config file. 0251 * @param options see Option 0252 * 0253 * @returns @c PrimaryAction if the primary button is triggered, @c SecondaryAction 0254 * if the secondary button is triggered. @c Cancel if the cancel button is triggered. 0255 * 0256 * @since 5.100 0257 */ 0258 KWIDGETSADDONS_EXPORT 0259 ButtonCode questionTwoActionsCancel(QWidget *parent, 0260 const QString &text, 0261 const QString &title, 0262 const KGuiItem &primaryAction, 0263 const KGuiItem &secondaryAction, 0264 const KGuiItem &cancelAction = KStandardGuiItem::cancel(), 0265 const QString &dontAskAgainName = QString(), 0266 Options options = Notify); 0267 0268 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 0269 /** 0270 * Display a "question" dialog with a listbox to show information to the user 0271 * 0272 * @param parent Parent widget. 0273 * @param text Message string. 0274 * @param strlist List of strings to be written in the listbox. If the list is 0275 * empty, it doesn't show any listbox, working as questionYesNo. 0276 * @param title Message box title. The application name is added to 0277 * the title. The default title is i18n("Question"). 0278 * @param buttonYes The text for the first button. 0279 * The default is KStandardGuiItem::yes(). 0280 * @param buttonNo The text for the second button. 0281 * The default is KStandardGuiItem::no(). 0282 * @param dontAskAgainName If provided, a checkbox is added with which 0283 * further confirmation can be turned off. 0284 * The string is used to lookup and store the setting 0285 * in the applications config file. 0286 * The setting is stored in the "Notification Messages" group. 0287 * If @p dontAskAgainName starts with a ':' then the setting 0288 * is stored in the global config file. 0289 * @param options see Options 0290 * 0291 * @return 'Yes' is returned if the Yes-button is pressed. 'No' is returned 0292 * if the No-button is pressed. 0293 * 0294 * To be used for questions like "Do you really want to delete these files?" 0295 * And show the user exactly which files are going to be deleted in case 0296 * he presses "Yes" 0297 * 0298 * The default button is "Yes". Pressing "Esc" selects "No". 0299 * 0300 * @deprecated Since 5.100, use questionTwoActionsList() 0301 */ 0302 KWIDGETSADDONS_EXPORT 0303 KWIDGETSADDONS_DEPRECATED_VERSION(5, 100, "Use questionTwoActionsList()") 0304 ButtonCode questionYesNoList(QWidget *parent, 0305 const QString &text, 0306 const QStringList &strlist, 0307 const QString &title = QString(), 0308 const KGuiItem &buttonYes = KStandardGuiItem::yes(), 0309 const KGuiItem &buttonNo = KStandardGuiItem::no(), 0310 const QString &dontAskAgainName = QString(), 0311 Options options = Notify); 0312 #endif 0313 0314 /** 0315 * Display a "question" dialog with a listbox to show information to the user 0316 * and two action buttons. 0317 * 0318 * To be used for questions like "Do you really want to delete these files?" 0319 * and show the user exactly which files are going to be deleted in case. 0320 * 0321 * The default button is the primary button. Pressing "Esc" triggers the secondary button. 0322 * 0323 * @param parent the parent widget 0324 * @param text the message string 0325 * @param strlist List of strings to be written in the listbox. If the list is 0326 * empty, it doesn't show any listbox, working as questionTwoActions(). 0327 * @param title the message box title. If an empty string, defaults to i18n("Question"). 0328 * @param primaryAction the action for the primary button 0329 * @param secondaryAction the action for the secondary button 0330 * @param dontAskAgainName If not an empty string, a checkbox is added with which 0331 * further confirmation can be turned off. 0332 * The string is used to lookup and store the setting 0333 * in the applications config file. 0334 * The setting is stored in the "Notification Messages" group. 0335 * If @p dontAskAgainName starts with a ':' then the setting 0336 * is stored in the global config file. 0337 * @param options see Option 0338 * 0339 * @returns @c PrimaryAction if the primary button is triggered, @c SecondaryAction 0340 * if the secondary button is triggered. 0341 * 0342 * @since 5.100 0343 */ 0344 KWIDGETSADDONS_EXPORT 0345 ButtonCode questionTwoActionsList(QWidget *parent, 0346 const QString &text, 0347 const QStringList &strlist, 0348 const QString &title, 0349 const KGuiItem &primaryAction, 0350 const KGuiItem &secondaryAction, 0351 const QString &dontAskAgainName = QString(), 0352 Options options = Notify); 0353 0354 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 0355 /** 0356 * Display a "warning" dialog. 0357 * 0358 * @param parent Parent widget. 0359 * @param text Message string. 0360 * @param title Message box title. The application name is added to 0361 * the title. The default title is i18n("Warning"). 0362 * @param buttonYes The text for the first button. 0363 * The default is KStandardGuiItem::yes(). 0364 * @param buttonNo The text for the second button. 0365 * The default is KStandardGuiItem::no(). 0366 * @param dontAskAgainName If provided, a checkbox is added with which 0367 * further confirmation can be turned off. 0368 * The string is used to lookup and store the setting 0369 * in the applications config file. 0370 * The setting is stored in the "Notification Messages" group. 0371 * If @p dontAskAgainName starts with a ':' then the setting 0372 * is stored in the global config file. 0373 * @param options see Options 0374 * 0375 * @return @p Yes is returned if the Yes-button is pressed. @p No is returned 0376 * if the No-button is pressed. 0377 * 0378 * To be used for questions "Shall I update your configuration?" 0379 * The text should explain the implication of both options. 0380 * 0381 * The default button is "No". Pressing "Esc" selects "No". 0382 * 0383 * @deprecated Since 5.100, use warningTwoActions() 0384 */ 0385 KWIDGETSADDONS_EXPORT 0386 KWIDGETSADDONS_DEPRECATED_VERSION(5, 100, "Use warningTwoActions()") 0387 ButtonCode warningYesNo(QWidget *parent, 0388 const QString &text, 0389 const QString &title = QString(), 0390 const KGuiItem &buttonYes = KStandardGuiItem::yes(), 0391 const KGuiItem &buttonNo = KStandardGuiItem::no(), 0392 const QString &dontAskAgainName = QString(), 0393 Options options = Options(Notify | Dangerous)); 0394 #endif 0395 0396 /** 0397 * Display a "warning" dialog with two action buttons. 0398 * 0399 * To be used for questions like "Shall I update your configuration?". 0400 * The text should explain the implication of both actions. 0401 * 0402 * The default button is the secondary button. Pressing "Esc" triggers the secondary button. 0403 * 0404 * @param parent the parent widget 0405 * @param text the message string 0406 * @param title the message box title. If an empty string, defaults to i18n("Warning"). 0407 * @param primaryAction the action for the primary button 0408 * @param secondaryAction the action for the secondary button 0409 * @param dontAskAgainName If not an empty string, a checkbox is added with which 0410 * further confirmation can be turned off. 0411 * The string is used to lookup and store the setting 0412 * in the applications config file. 0413 * The setting is stored in the "Notification Messages" group. 0414 * If @p dontAskAgainName starts with a ':' then the setting 0415 * is stored in the global config file. 0416 * @param options see Options 0417 * 0418 * @returns @c PrimaryAction if the primary button is triggered, @c SecondaryAction 0419 * if the secondary button is triggered. 0420 * 0421 * @since 5.100 0422 */ 0423 KWIDGETSADDONS_EXPORT 0424 ButtonCode warningTwoActions(QWidget *parent, 0425 const QString &text, 0426 const QString &title, 0427 const KGuiItem &primaryAction, 0428 const KGuiItem &secondaryAction, 0429 const QString &dontAskAgainName = QString(), 0430 Options options = Options(Notify | Dangerous)); 0431 0432 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 0433 /** 0434 * Display a "warning" dialog with a listbox to show information to the user 0435 * 0436 * @param parent Parent widget. 0437 * @param text Message string. 0438 * @param strlist List of strings to be written in the listbox. If the list is 0439 * empty, it doesn't show any listbox, working as questionYesNo. 0440 * @param title Message box title. The application name is added to 0441 * the title. The default title is i18n("Question"). 0442 * @param buttonYes The text for the first button. 0443 * The default is KStandardGuiItem::yes(). 0444 * @param buttonNo The text for the second button. 0445 * The default is KStandardGuiItem::no(). 0446 * @param dontAskAgainName If provided, a checkbox is added with which 0447 * further confirmation can be turned off. 0448 * The string is used to lookup and store the setting 0449 * in the applications config file. 0450 * The setting is stored in the "Notification Messages" group. 0451 * If @p dontAskAgainName starts with a ':' then the setting 0452 * is stored in the global config file. 0453 * @param options see Options 0454 * 0455 * @return 'Yes' is returned if the Yes-button is pressed. 'No' is returned 0456 * if the No-button is pressed. 0457 * 0458 * To be used for questions like "Do you really want to delete these files?" 0459 * And show the user exactly which files are going to be deleted in case 0460 * he presses "Yes" 0461 * 0462 * The default button is "No". Pressing "Esc" selects "No". 0463 * 0464 * @deprecated Since 5.100, use warningTwoActionsList() 0465 */ 0466 KWIDGETSADDONS_EXPORT 0467 KWIDGETSADDONS_DEPRECATED_VERSION(5, 100, "Use warningTwoActionsList()") 0468 ButtonCode warningYesNoList(QWidget *parent, 0469 const QString &text, 0470 const QStringList &strlist, 0471 const QString &title = QString(), 0472 const KGuiItem &buttonYes = KStandardGuiItem::yes(), 0473 const KGuiItem &buttonNo = KStandardGuiItem::no(), 0474 const QString &dontAskAgainName = QString(), 0475 Options options = Options(Notify | Dangerous)); 0476 #endif 0477 0478 /** 0479 * Display a "warning" dialog with a listbox to show information to the user 0480 * and two action buttons. 0481 * 0482 * To be used for questions like "Shall I update your configuration?". 0483 * The text should explain the implication of both actions. 0484 * 0485 * The default button is the secondary button. Pressing "Esc" triggers the secondary button. 0486 * 0487 * @param parent the parent widget 0488 * @param text the message string 0489 * @param strlist List of strings to be written in the listbox. If the list is 0490 * empty, it doesn't show any listbox, working as warningTwoActions. 0491 * @param title the message box title. If an empty string, defaults to i18n("Warning"). 0492 * @param primaryAction the action for the primary button 0493 * @param secondaryAction the action for the secondary button 0494 * @param dontAskAgainName If not an empty string, a checkbox is added with which 0495 * further confirmation can be turned off. 0496 * The string is used to lookup and store the setting 0497 * in the applications config file. 0498 * The setting is stored in the "Notification Messages" group. 0499 * If @p dontAskAgainName starts with a ':' then the setting 0500 * is stored in the global config file. 0501 * @param options see Options 0502 * 0503 * @returns @c PrimaryAction if the primary button is triggered, @c SecondaryAction 0504 * if the secondary button is triggered. 0505 * 0506 * @since 5.100 0507 */ 0508 KWIDGETSADDONS_EXPORT 0509 ButtonCode warningTwoActionsList(QWidget *parent, 0510 const QString &text, 0511 const QStringList &strlist, 0512 const QString &title, 0513 const KGuiItem &primaryAction, 0514 const KGuiItem &secondaryAction, 0515 const QString &dontAskAgainName = QString(), 0516 Options options = Options(Notify | Dangerous)); 0517 0518 /** 0519 * Display a "warning" dialog. 0520 * 0521 * @param parent Parent widget. 0522 * @param text Message string. 0523 * @param title Message box title. The application name is added to 0524 * the title. The default title is i18n("Warning"). 0525 * @param buttonContinue The text for the first button. 0526 * The default is KStandardGuiItem::cont(). 0527 * @param buttonCancel The text for the second button. 0528 * The default is KStandardGuiItem::cancel(). 0529 * @param dontAskAgainName If provided, a checkbox is added with which 0530 * further confirmation can be turned off. 0531 * The string is used to lookup and store the setting 0532 * in the applications config file. 0533 * The setting is stored in the "Notification Messages" group. 0534 * If @p dontAskAgainName starts with a ':' then the setting 0535 * is stored in the global config file. 0536 * @param options see Options 0537 * 0538 * @return @p Continue is returned if the Continue-button is pressed. 0539 * @p Cancel is returned if the Cancel-button is pressed. 0540 * 0541 * To be used for questions like "You are about to Print. Are you sure?" 0542 * the continueButton should then be labeled "Print". 0543 * 0544 * The default button is buttonContinue. Pressing "Esc" selects "Cancel". 0545 */ 0546 KWIDGETSADDONS_EXPORT ButtonCode warningContinueCancel(QWidget *parent, 0547 const QString &text, 0548 const QString &title = QString(), 0549 const KGuiItem &buttonContinue = KStandardGuiItem::cont(), 0550 const KGuiItem &buttonCancel = KStandardGuiItem::cancel(), 0551 const QString &dontAskAgainName = QString(), 0552 Options options = Notify); 0553 0554 /** 0555 * Display a "warning" dialog with a collapsible "Details" section. 0556 * 0557 * @since 5.61 0558 */ 0559 KWIDGETSADDONS_EXPORT ButtonCode warningContinueCancelDetailed(QWidget *parent, 0560 const QString &text, 0561 const QString &title = QString(), 0562 const KGuiItem &buttonContinue = KStandardGuiItem::cont(), 0563 const KGuiItem &buttonCancel = KStandardGuiItem::cancel(), 0564 const QString &dontAskAgainName = QString(), 0565 Options options = Notify, 0566 const QString &details = QString()); 0567 0568 /** 0569 * Display a "warning" dialog with a listbox to show information to the user. 0570 * 0571 * @param parent Parent widget. 0572 * @param text Message string. 0573 * @param strlist List of strings to be written in the listbox. If the 0574 * list is empty, it doesn't show any listbox, working 0575 * as warningContinueCancel. 0576 * @param title Message box title. The application name is added to 0577 * the title. The default title is i18n("Warning"). 0578 * @param buttonContinue The text for the first button. 0579 * The default is KStandardGuiItem::cont(). 0580 * @param buttonCancel The text for the second button. 0581 * The default is KStandardGuiItem::cancel(). 0582 * @param dontAskAgainName If provided, a checkbox is added with which 0583 * further confirmation can be turned off. 0584 * The string is used to lookup and store the setting 0585 * in the applications config file. 0586 * The setting is stored in the "Notification Messages" group. 0587 * If @p dontAskAgainName starts with a ':' then the setting 0588 * is stored in the global config file. 0589 * 0590 * @param options see Options 0591 * 0592 * @return @p Continue is returned if the Continue-button is pressed. 0593 * @p Cancel is returned if the Cancel-button is pressed. 0594 * 0595 * To be used for questions like "You are about to Print. Are you sure?" 0596 * the continueButton should then be labeled "Print". 0597 * 0598 * The default button is buttonContinue. Pressing "Esc" selects "Cancel". 0599 */ 0600 KWIDGETSADDONS_EXPORT ButtonCode warningContinueCancelList(QWidget *parent, 0601 const QString &text, 0602 const QStringList &strlist, 0603 const QString &title = QString(), 0604 const KGuiItem &buttonContinue = KStandardGuiItem::cont(), 0605 const KGuiItem &buttonCancel = KStandardGuiItem::cancel(), 0606 const QString &dontAskAgainName = QString(), 0607 Options options = Notify); 0608 0609 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 0610 /** 0611 * Display a Yes/No/Cancel "warning" dialog. 0612 * 0613 * @param parent Parent widget. 0614 * @param text Message string. 0615 * @param title Message box title. The application name is added to 0616 * the title. The default title is i18n("Warning"). 0617 * @param buttonYes The text for the first button. 0618 * The default is KStandardGuiItem::yes(). 0619 * @param buttonNo The text for the second button. 0620 * The default is KStandardGuiItem::no(). 0621 * @param buttonCancel The text for the third button. 0622 * The default is KStandardGuiItem::cancel(). 0623 * @param dontAskAgainName If provided, a checkbox is added with which 0624 * further questions can be turned off. If turned off 0625 * all questions will be automatically answered with the 0626 * last answer (either Yes or No). 0627 * The string is used to lookup and store the setting 0628 * in the applications config file. 0629 * The setting is stored in the "Notification Messages" group. 0630 * If @p dontAskAgainName starts with a ':' then the setting 0631 * is stored in the global config file. 0632 * @param options see Options 0633 * 0634 * @return @p Yes is returned if the Yes-button is pressed. @p No is returned 0635 * if the No-button is pressed. @p Cancel is retunred if the Cancel- 0636 * button is pressed. 0637 * 0638 * To be used for questions "Do you want to save your changes?" 0639 * The text should explain the implication of choosing 'No'. 0640 * 0641 * The default button is "Yes". Pressing "Esc" selects "Cancel" 0642 * 0643 * @deprecated Since 5.100, use warningTwoActionsCancel() 0644 */ 0645 KWIDGETSADDONS_EXPORT 0646 KWIDGETSADDONS_DEPRECATED_VERSION(5, 100, "Use warningTwoActionsCancel()") 0647 ButtonCode warningYesNoCancel(QWidget *parent, 0648 const QString &text, 0649 const QString &title = QString(), 0650 const KGuiItem &buttonYes = KStandardGuiItem::yes(), 0651 const KGuiItem &buttonNo = KStandardGuiItem::no(), 0652 const KGuiItem &buttonCancel = KStandardGuiItem::cancel(), 0653 const QString &dontAskAgainName = QString(), 0654 Options options = Notify); 0655 #endif 0656 0657 /** 0658 * Display a "warning" dialog with two action buttons and a cancel button. 0659 * 0660 * To be used for questions like "Shall I update your configuration?". 0661 * The text should explain the implication of both actions. 0662 * 0663 * The default button is the cancel button. Pressing "Esc" triggers the cancel button. 0664 * 0665 * @param parent the parent widget 0666 * @param text the message string 0667 * @param title the message box title. If an empty string, defaults to i18n("Warning"). 0668 * @param primaryAction the action for the primary button 0669 * @param secondaryAction the action for the secondary button 0670 * @param cancelAction the action for the cancel button 0671 * @param dontAskAgainName If not an empty string, a checkbox is added with which 0672 * further confirmation can be turned off. 0673 * The string is used to lookup and store the setting 0674 * in the applications config file. 0675 * The setting is stored in the "Notification Messages" group. 0676 * If @p dontAskAgainName starts with a ':' then the setting 0677 * is stored in the global config file. 0678 * @param options see Options 0679 * 0680 * @returns @c PrimaryAction if the primary button is triggered, @c SecondaryAction 0681 * if the secondary button is triggered. @c Cancel if the cancel button is triggered. 0682 * 0683 * @since 5.100 0684 */ 0685 KWIDGETSADDONS_EXPORT 0686 ButtonCode warningTwoActionsCancel(QWidget *parent, 0687 const QString &text, 0688 const QString &title, 0689 const KGuiItem &primaryAction, 0690 const KGuiItem &secondaryAction, 0691 const KGuiItem &cancelAction = KStandardGuiItem::cancel(), 0692 const QString &dontAskAgainName = QString(), 0693 Options options = Options(Notify | Dangerous)); 0694 0695 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 0696 /** 0697 * Display a Yes/No/Cancel "warning" dialog with a listbox to show information 0698 * to the user. 0699 * 0700 * @param parent Parent widget. 0701 * @param text Message string. 0702 * @param strlist List of strings to be written in the listbox. If the 0703 * list is empty, it doesn't show any listbox, working 0704 * as warningYesNoCancel. 0705 * @param title Message box title. The application name is added to 0706 * the title. The default title is i18n("Warning"). 0707 * @param buttonYes The text for the first button. 0708 * The default is KStandardGuiItem::yes(). 0709 * @param buttonNo The text for the second button. 0710 * The default is KStandardGuiItem::no(). 0711 * @param buttonCancel The text for the third button. 0712 * The default is KStandardGuiItem::cancel(). 0713 * @param dontAskAgainName If provided, a checkbox is added with which 0714 * further questions can be turned off. If turned off 0715 * all questions will be automatically answered with the 0716 * last answer (either Yes or No). 0717 * The string is used to lookup and store the setting 0718 * in the applications config file. 0719 * The setting is stored in the "Notification Messages" group. 0720 * If @p dontAskAgainName starts with a ':' then the setting 0721 * is stored in the global config file. 0722 * @param options see Options 0723 * 0724 * @return @p Yes is returned if the Yes-button is pressed. @p No is returned 0725 * if the No-button is pressed. @p Cancel is retunred if the Cancel- 0726 * button is pressed. 0727 * 0728 * To be used for questions "Do you want to save your changes?" 0729 * The text should explain the implication of choosing 'No'. 0730 * 0731 * The default button is "Yes". Pressing "Esc" selects "Cancel" 0732 * 0733 * @deprecated Since 5.100, use warningTwoActionsCancelList() 0734 */ 0735 KWIDGETSADDONS_EXPORT 0736 KWIDGETSADDONS_DEPRECATED_VERSION(5, 100, "Use warningTwoActionsCancelList()") 0737 ButtonCode warningYesNoCancelList(QWidget *parent, 0738 const QString &text, 0739 const QStringList &strlist, 0740 const QString &title = QString(), 0741 const KGuiItem &buttonYes = KStandardGuiItem::yes(), 0742 const KGuiItem &buttonNo = KStandardGuiItem::no(), 0743 const KGuiItem &buttonCancel = KStandardGuiItem::cancel(), 0744 const QString &dontAskAgainName = QString(), 0745 Options options = Notify); 0746 #endif 0747 0748 /** 0749 * Display a "warning" dialog with a listbox to show information 0750 * to the user, two action buttons and a cancel button. 0751 * 0752 * To be used for questions like "Shall I update your configuration?". 0753 * The text should explain the implication of both actions. 0754 * 0755 * The default button is the cancel button. Pressing "Esc" triggers the cancel button. 0756 * 0757 * @param parent the parent widget 0758 * @param text the message string 0759 * @param strlist a List of strings to be written in the listbox. If the 0760 * list is empty, it doesn't show any listbox, working 0761 * as warningTwoActionsCancel(). 0762 * @param title the message box title. If an empty string, defaults to i18n("Warning"). 0763 * @param primaryAction the action for the primary button 0764 * @param secondaryAction the action for the secondary button 0765 * @param cancelAction the action for the cancel button 0766 * @param dontAskAgainName If not an empty string, a checkbox is added with which 0767 * further confirmation can be turned off. 0768 * The string is used to lookup and store the setting 0769 * in the applications config file. 0770 * The setting is stored in the "Notification Messages" group. 0771 * If @p dontAskAgainName starts with a ':' then the setting 0772 * is stored in the global config file. 0773 * @param options see Options 0774 * 0775 * @returns @c PrimaryAction if the primary button is triggered, @c SecondaryAction 0776 * if the secondary button is triggered. @c Cancel if the cancel button is triggered. 0777 * 0778 * @since 5.100 0779 */ 0780 KWIDGETSADDONS_EXPORT 0781 ButtonCode warningTwoActionsCancelList(QWidget *parent, 0782 const QString &text, 0783 const QStringList &strlist, 0784 const QString &title, 0785 const KGuiItem &primaryAction, 0786 const KGuiItem &secondaryAction, 0787 const KGuiItem &cancelAction = KStandardGuiItem::cancel(), 0788 const QString &dontAskAgainName = QString(), 0789 Options options = Options(Notify | Dangerous)); 0790 0791 /** 0792 * Display an "Error" dialog. 0793 * 0794 * @param parent Parent widget. 0795 * @param text Message string. 0796 * @param title Message box title. The application name is added to 0797 * the title. The default title is i18n("Error"). 0798 * @param options see Options 0799 * 0800 * Your program messed up and now it's time to inform the user. 0801 * To be used for important things like "Sorry, I deleted your hard disk." 0802 * 0803 * The default button is "&OK". Pressing "Esc" selects the OK-button. 0804 * 0805 * @note The OK button will always have the i18n'ed text '&OK'. 0806 */ 0807 KWIDGETSADDONS_EXPORT void error(QWidget *parent, const QString &text, const QString &title = QString(), Options options = Notify); 0808 0809 /** 0810 * Display an "Error" dialog. 0811 * 0812 * @param parent Parent widget. 0813 * @param text Message string. 0814 * @param title Message box title. The application name is added to 0815 * the title. The default title is i18n("Error"). 0816 * @param buttonOk The text for the only button. 0817 * The default is KStandardGuiItem::ok(). 0818 * @param options see Options 0819 * 0820 * There is only one button, therefore it's the default button, and pressing "Esc" selects it as well. 0821 * 0822 * @since 5.97 0823 */ 0824 KWIDGETSADDONS_EXPORT 0825 void error(QWidget *parent, 0826 const QString &text, 0827 const QString &title /*= QString()*/, 0828 const KGuiItem &buttonOk /*= KStandardGuiItem::ok()*/, 0829 Options options = Notify); // TODO KF6 merge with previous overload 0830 0831 /** 0832 * Display an "Error" dialog with a listbox. 0833 * 0834 * @param parent Parent widget. 0835 * @param text Message string. 0836 * @param strlist List of strings to be written in the listbox. If the 0837 * list is empty, it doesn't show any listbox, working 0838 * as error(). 0839 * @param title Message box title. The application name is added to 0840 * the title. The default title is i18n("Error"). 0841 * @param options see Options 0842 * 0843 * Your program messed up and now it's time to inform the user. 0844 * To be used for important things like "Sorry, I deleted your hard disk." 0845 * 0846 * The default button is "&OK". Pressing "Esc" selects the OK-button. 0847 * 0848 * @note The OK button will always have the i18n'ed text '&OK'. 0849 */ 0850 KWIDGETSADDONS_EXPORT void 0851 errorList(QWidget *parent, const QString &text, const QStringList &strlist, const QString &title = QString(), Options options = Notify); 0852 0853 /** 0854 * Displays an "Error" dialog with a "Details >>" button. 0855 * 0856 * @param parent Parent widget. 0857 * @param text Message string. 0858 * @param details Detailed message string. 0859 * @param title Message box title. The application name is added to 0860 * the title. The default title is i18n("Error"). 0861 * @param options see Options 0862 * 0863 * Your program messed up and now it's time to inform the user. 0864 * To be used for important things like "Sorry, I deleted your hard disk." 0865 * 0866 * The @p details message can contain additional information about 0867 * the problem and can be shown on request to advanced/interested users. 0868 * 0869 * The default button is "&OK". Pressing "Esc" selects the OK-button. 0870 * 0871 * @note The OK button will always have the i18n'ed text '&OK'. 0872 */ 0873 KWIDGETSADDONS_EXPORT void 0874 detailedError(QWidget *parent, const QString &text, const QString &details, const QString &title = QString(), Options options = Notify); 0875 0876 /** 0877 * Displays an "Error" dialog with a "Details >>" button. 0878 * 0879 * @param parent Parent widget. 0880 * @param text Message string. 0881 * @param details Detailed message string. 0882 * @param title Message box title. The application name is added to 0883 * the title. The default title is i18n("Error"). 0884 * @param buttonOk The text for the only button. 0885 * The default is KStandardGuiItem::ok(). 0886 * @param options see Options 0887 * 0888 * Your program messed up and now it's time to inform the user. 0889 * To be used for important things like "Sorry, I deleted your hard disk." 0890 * 0891 * The @p details message can contain additional information about 0892 * the problem and can be shown on request to advanced/interested users. 0893 * 0894 * There is only one button, therefore it's the default button, and pressing "Esc" selects it as well. 0895 * 0896 * @since 5.97 0897 */ 0898 KWIDGETSADDONS_EXPORT 0899 void detailedError(QWidget *parent, 0900 const QString &text, 0901 const QString &details, 0902 const QString &title /*= QString()*/, 0903 const KGuiItem &buttonOk /*= KStandardGuiItem::ok()*/, 0904 Options options = Notify); // TODO KF6 merge with previous overload 0905 0906 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 97) 0907 /** 0908 * Display a "Sorry" dialog. 0909 * 0910 * @param parent Parent widget. 0911 * @param text Message string. 0912 * @param title Message box title. The application name is added to 0913 * the title. The default title is i18n("Sorry"). 0914 * @param options see OptionsType 0915 * 0916 * Either your program messed up and asks for understanding 0917 * or your user did something stupid. 0918 * 0919 * To be used for small problems like 0920 * "Sorry, I can't find the file you specified." 0921 * 0922 * The default button is "&OK". Pressing "Esc" selects the OK-button. 0923 * 0924 * @note The OK button will always have the i18n'ed text '&OK'. 0925 * See the overload with a KGuiItem argument to change that. 0926 * 0927 * @deprecated Since 5.97, use error(). 0928 */ 0929 KWIDGETSADDONS_EXPORT 0930 KWIDGETSADDONS_DEPRECATED_VERSION(5, 97, "Use error().") 0931 void sorry(QWidget *parent, const QString &text, const QString &title = QString(), Options options = Notify); 0932 #endif 0933 0934 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 97) 0935 /** 0936 * Display a "Sorry" dialog. 0937 * 0938 * @param parent Parent widget. 0939 * @param text Message string. 0940 * @param title Message box title. The application name is added to 0941 * the title. The default title is i18n("Sorry"). 0942 * @param buttonOk The text for the only button. 0943 * The default is KStandardGuiItem::ok(). 0944 * @param options see OptionsType 0945 * 0946 * Either your program messed up and asks for understanding 0947 * or your user did something stupid. 0948 * 0949 * To be used for small problems like 0950 * "Sorry, I can't find the file you specified." 0951 * 0952 * The default button is "&OK". Pressing "Esc" selects the OK-button. 0953 * 0954 * There is only one button, therefore it's the default button, and pressing "Esc" selects it as well. 0955 * @since 5.63 0956 * 0957 * @deprecated Since 5.97 use error(). 0958 */ 0959 KWIDGETSADDONS_EXPORT 0960 KWIDGETSADDONS_DEPRECATED_VERSION(5, 97, "Use error().") 0961 void sorry(QWidget *parent, 0962 const QString &text, 0963 const QString &title /*= QString()*/, 0964 const KGuiItem &buttonOk /*= KStandardGuiItem::ok()*/, 0965 Options options = Notify); 0966 #endif 0967 0968 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 97) 0969 /** 0970 * Displays a "Sorry" dialog with a "Details >>" button. 0971 * 0972 * @param parent Parent widget. 0973 * @param text Message string. 0974 * @param details Detailed message string. 0975 * @param title Message box title. The application name is added to 0976 * the title. The default title is i18n("Sorry"). 0977 * @param options see Options 0978 * 0979 * Either your program messed up and asks for understanding 0980 * or your user did something stupid. 0981 * 0982 * To be used for small problems like 0983 * "Sorry, I can't find the file you specified." 0984 * 0985 * And then @p details can contain something like 0986 * "foobar.txt was not found in any of 0987 * the following directories: 0988 * /usr/bin,/usr/local/bin,/usr/sbin" 0989 * 0990 * The default button is "&OK". Pressing "Esc" selects the OK-button. 0991 * 0992 * @note The OK button will always have the i18n'ed text '&OK'. 0993 * See the overload with a KGuiItem argument to change that. 0994 * 0995 * @deprecated Since 5.97 use detailedError(). 0996 */ 0997 KWIDGETSADDONS_EXPORT 0998 KWIDGETSADDONS_DEPRECATED_VERSION(5, 97, "Use detailedError().") 0999 void detailedSorry(QWidget *parent, const QString &text, const QString &details, const QString &title = QString(), Options options = Notify); 1000 #endif 1001 1002 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 97) 1003 /** 1004 * Displays a "Sorry" dialog with a "Details >>" button. 1005 * 1006 * @param parent Parent widget. 1007 * @param text Message string. 1008 * @param details Detailed message string. 1009 * @param title Message box title. The application name is added to 1010 * the title. The default title is i18n("Sorry"). 1011 * @param buttonOk The text for the only button. 1012 * The default is KStandardGuiItem::ok(). 1013 * @param options see Options 1014 * 1015 * Either your program messed up and asks for understanding 1016 * or your user did something stupid. 1017 * 1018 * To be used for small problems like 1019 * "Sorry, I can't find the file you specified." 1020 * 1021 * And then @p details can contain something like 1022 * "foobar.txt was not found in any of 1023 * the following directories: 1024 * /usr/bin,/usr/local/bin,/usr/sbin" 1025 * 1026 * There is only one button, therefore it's the default button, and pressing "Esc" selects it as well. 1027 * @since 5.63 1028 * 1029 * @deprecated Since 5.97 use detailedError(). 1030 */ 1031 KWIDGETSADDONS_EXPORT 1032 KWIDGETSADDONS_DEPRECATED_VERSION(5, 97, "Use detailedError().") 1033 void detailedSorry(QWidget *parent, 1034 const QString &text, 1035 const QString &details, 1036 const QString &title /* = QString() */, 1037 const KGuiItem &buttonOk /*= KStandardGuiItem::ok()*/, 1038 Options options = Notify); 1039 #endif 1040 1041 /** 1042 * Display an "Information" dialog. 1043 * 1044 * @param parent Parent widget. 1045 * @param text Message string. 1046 * @param title Message box title. The application name is added to 1047 * the title. The default title is i18n("Information"). 1048 * @param dontShowAgainName If provided, a checkbox is added with which 1049 * further notifications can be turned off. 1050 * The string is used to lookup and store the setting 1051 * in the applications config file. 1052 * The setting is stored in the "Notification Messages" group. 1053 * @param options see Options 1054 * 1055 * 1056 * Your program wants to tell the user something. 1057 * To be used for things like: 1058 * "Your bookmarks have been rearranged." 1059 * 1060 * The default button is "&OK". Pressing "Esc" selects the OK-button. 1061 * 1062 * @note The OK button will always have the i18n'ed text '&OK'. 1063 */ 1064 KWIDGETSADDONS_EXPORT void 1065 information(QWidget *parent, const QString &text, const QString &title = QString(), const QString &dontShowAgainName = QString(), Options options = Notify); 1066 1067 /** 1068 * Display an "Information" dialog with a listbox. 1069 * 1070 * @param parent Parent widget. 1071 * @param text Message string. 1072 * @param strlist List of strings to be written in the listbox. If the 1073 * list is empty, it doesn't show any listbox, working 1074 * as information. 1075 * @param title Message box title. The application name is added to 1076 * the title. The default title is i18n("Information"). 1077 * @param dontShowAgainName If provided, a checkbox is added with which 1078 * further notifications can be turned off. 1079 * The string is used to lookup and store the setting 1080 * in the applications config file. 1081 * The setting is stored in the "Notification Messages" group. 1082 * @param options see Options 1083 * 1084 * 1085 * Your program wants to tell the user something. 1086 * To be used for things like: 1087 * "The following bookmarks have been rearranged:" 1088 * 1089 * The default button is "&OK". Pressing "Esc" selects the OK-button. 1090 * 1091 * @note The OK button will always have the i18n'ed text '&OK'. 1092 */ 1093 KWIDGETSADDONS_EXPORT void informationList(QWidget *parent, 1094 const QString &text, 1095 const QStringList &strlist, 1096 const QString &title = QString(), 1097 const QString &dontShowAgainName = QString(), 1098 Options options = Notify); 1099 1100 /** 1101 * Enable all messages which have been turned off with the 1102 * @p dontShowAgainName feature. 1103 */ 1104 KWIDGETSADDONS_EXPORT void enableAllMessages(); 1105 1106 /** 1107 * Re-enable a specific @p dontShowAgainName messages that had 1108 * previously been turned off. 1109 * @see saveDontShowAgainTwoActions() 1110 * @see saveDontShowAgainContinue() 1111 */ 1112 KWIDGETSADDONS_EXPORT void enableMessage(const QString &dontShowAgainName); 1113 1114 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 97) 1115 /** 1116 * Display an "About" dialog. 1117 * 1118 * @param parent Parent widget. 1119 * @param text Message string. 1120 * @param title Message box title. The application name is added to 1121 * the title. The default title is i18n("About \<appname\>"). 1122 * @param options see Options 1123 * 1124 * 1125 * Your program wants to show some general information about the application 1126 * like the authors's names and email addresses. 1127 * 1128 * The default button is "&OK". 1129 * 1130 * @note The OK button will always have the i18n'ed text '&OK'. 1131 * 1132 * @deprecated Since 5.0, use QMessageBox::about(). No known users of the extre features here. 1133 */ 1134 KWIDGETSADDONS_EXPORT 1135 KWIDGETSADDONS_DEPRECATED_VERSION_BELATED(5, 97, 5, 0, "Use QMessageBox::about()") 1136 void about(QWidget *parent, const QString &text, const QString &title = QString(), Options options = Notify); 1137 #endif 1138 1139 /** 1140 * Alternate method to show a messagebox: 1141 * 1142 * @param parent Parent widget. 1143 * @param type type of message box: QuestionTwoActions, WarningTwoActions, WarningContinueCancel... 1144 * @param text Message string. 1145 * @param title Message box title. 1146 * @param primaryAction The KGuiItem for the first button. 1147 * The default (deprecated since 5.100) is KStandardGuiItem::yes(). 1148 * @param secondaryAction The KGuiItem for the second button. 1149 * The default (deprecated since 5.100) is KStandardGuiItem::no(). 1150 * @param cancelAction The text for the third button. 1151 * The default is KStandardGuiItem::cancel(). 1152 * @param dontShowAskAgainName If provided, a checkbox is added with which 1153 * further questions/information can be turned off. If turned off 1154 * all questions will be automatically answered with the 1155 * last answer (either PrimaryAction or SecondaryAction), 1156 * if the message box needs an answer. 1157 * The string is used to lookup and store the setting 1158 * in the applications config file. 1159 * @param options see Options 1160 * Note: for ContinueCancel, primaryAction is the continue button and secondaryAction is unused. 1161 * and for Information, none is used. 1162 * @return a button code, as defined in KMessageBox. 1163 */ 1164 KWIDGETSADDONS_EXPORT 1165 ButtonCode messageBox(QWidget *parent, 1166 DialogType type, 1167 const QString &text, 1168 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 1169 const QString &title = QString(), 1170 const KGuiItem &primaryAction = KStandardGuiItem::yes(), 1171 const KGuiItem &secondaryAction = KStandardGuiItem::no(), 1172 #else 1173 const QString &title, 1174 const KGuiItem &primaryAction, 1175 const KGuiItem &secondaryAction, 1176 #endif 1177 const KGuiItem &cancelAction = KStandardGuiItem::cancel(), 1178 const QString &dontShowAskAgainName = QString(), 1179 Options options = Notify); 1180 1181 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 1182 /** 1183 * @return true if the corresponding yes/no message box should be shown. 1184 * @param dontShowAgainName the name that identify the message box. If 1185 * empty, true is always returned. 1186 * @param result is set to the result (Yes or No) that was chosen the last 1187 * time the message box was shown. Only meaningful, if the message box 1188 * should not be shown. 1189 * 1190 * @deprecated Since 5.100, use shouldBeShownTwoActions() 1191 */ 1192 KWIDGETSADDONS_EXPORT 1193 KWIDGETSADDONS_DEPRECATED_VERSION(5, 100, "Use shouldBeShownTwoActions()") 1194 bool shouldBeShownYesNo(const QString &dontShowAgainName, ButtonCode &result); 1195 #endif 1196 1197 /** 1198 * @param dontShowAgainName the name that identifies the message box. 1199 * If empty, @c true is always returned. 1200 * @param result reference to a variable to be set to the choice (@c PrimaryAction or @c SecondaryAction) 1201 * that was chosen the last time the message box was shown. 1202 * Only meaningful if the message box should not be shown. 1203 * @returns @c true if the corresponding two actions message box should be shown, @c false otherwise. 1204 * 1205 * @since 5.100 1206 */ 1207 KWIDGETSADDONS_EXPORT 1208 bool shouldBeShownTwoActions(const QString &dontShowAgainName, ButtonCode &result); 1209 1210 /** 1211 * @return true if the corresponding continue/cancel message box should be 1212 * shown. 1213 * @param dontShowAgainName the name that identify the message box. If 1214 * empty, true is always returned. 1215 */ 1216 KWIDGETSADDONS_EXPORT bool shouldBeShownContinue(const QString &dontShowAgainName); 1217 1218 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 1219 /** 1220 * Save the fact that the yes/no message box should not be shown again. 1221 * @param dontShowAgainName the name that identify the message box. If 1222 * empty, this method does nothing. 1223 * @param result the value (Yes or No) that should be used as the result 1224 * for the message box. 1225 * 1226 * @deprecated Since 5.100, use saveDontShowAgainTwoActions() 1227 */ 1228 KWIDGETSADDONS_EXPORT 1229 KWIDGETSADDONS_DEPRECATED_VERSION(5, 100, "Use saveDontShowAgainTwoActions()") 1230 void saveDontShowAgainYesNo(const QString &dontShowAgainName, ButtonCode result); 1231 #endif 1232 1233 /** 1234 * Save the fact that a two actions message box should not be shown again. 1235 * 1236 * @param dontShowAgainName the name that identifies the message box. 1237 * If empty, this method does nothing. 1238 * @param result the value (@c PrimaryAction or @c SecondaryAction) that should be used 1239 * as the result for the message box. 1240 * 1241 * @since 5.100 1242 */ 1243 KWIDGETSADDONS_EXPORT 1244 void saveDontShowAgainTwoActions(const QString &dontShowAgainName, ButtonCode result); 1245 1246 /** 1247 * Save the fact that the continue/cancel message box should not be shown 1248 * again. 1249 * @param dontShowAgainName the name that identify the message box. If 1250 * empty, this method does nothing. 1251 */ 1252 KWIDGETSADDONS_EXPORT void saveDontShowAgainContinue(const QString &dontShowAgainName); 1253 1254 /** 1255 * Use @p cfg for all settings related to the dontShowAgainName feature. 1256 * If @p cfg is 0 (default) KGlobal::config() will be used. 1257 */ 1258 KWIDGETSADDONS_EXPORT void setDontShowAgainConfig(KConfig *cfg); 1259 1260 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 0) 1261 /** 1262 * @deprecated since 5.0, use setDontShowAgainConfig() 1263 */ 1264 KWIDGETSADDONS_EXPORT 1265 KWIDGETSADDONS_DEPRECATED_VERSION(5, 0, "Use KMessageBox::setDontShowAgainConfig(KConfig*)") 1266 inline void setDontShowAskAgainConfig(KConfig *cfg) 1267 { 1268 setDontShowAgainConfig(cfg); 1269 } 1270 #endif 1271 1272 /** 1273 * Use @p dontAskAgainInterface for all settings related to the dontShowAgain feature. 1274 * This method does not take ownership of @p dontAskAgainInterface. 1275 * 1276 * @since 5.0 1277 */ 1278 KWIDGETSADDONS_EXPORT void setDontShowAgainInterface(KMessageBoxDontAskAgainInterface *dontAskAgainInterface); 1279 1280 /** 1281 * Use @p notifyInterface to send notifications. 1282 * This method does not take ownership of @p notifyInterface. 1283 * 1284 * @since 5.0 1285 */ 1286 KWIDGETSADDONS_EXPORT void setNotifyInterface(KMessageBoxNotifyInterface *notifyInterface); 1287 1288 /** 1289 * Create content and layout of a standard dialog 1290 * 1291 * @param dialog The parent dialog base 1292 * @param buttons a QDialogButtonBox instance. This function will take care of connecting to it. 1293 * @param icon Which predefined icon the message box shall show. 1294 * @param text Message string. 1295 * @param strlist List of strings to be written in the listbox. 1296 * If the list is empty, it doesn't show any listbox 1297 * @param ask The text of the checkbox. If empty none will be shown. 1298 * @param checkboxReturn The result of the checkbox. If it's initially 1299 * true then the checkbox will be checked by default. 1300 * May be a null pointer. Incompatible with NoExec. 1301 * @param options see Options 1302 * @param details Detailed message string. 1303 * @return A QDialogButtonBox::StandardButton button code, not a KMessageBox 1304 * button code, based on the buttonmask given to the constructor of 1305 * the @p dialog (ie. will return QDialogButtonBox::Yes instead of 1306 * KMessageBox::PrimaryAction). Will return QDialogButtonBox::NoButton if the 1307 * message box is queued for display instead of exec()ed immediately 1308 * or if the option NoExec is set. 1309 * @note Unless NoExec is used, 1310 * the @p dialog that is passed in is deleted by this 1311 * function. Do not delete it yourself. 1312 */ 1313 KWIDGETSADDONS_EXPORT QDialogButtonBox::StandardButton createKMessageBox(QDialog *dialog, 1314 QDialogButtonBox *buttons, 1315 QMessageBox::Icon icon, // krazy:exclude=qclasses 1316 const QString &text, 1317 const QStringList &strlist, 1318 const QString &ask, 1319 bool *checkboxReturn, 1320 Options options, 1321 const QString &details = QString()); 1322 1323 /** 1324 * Create content and layout of a standard dialog 1325 * 1326 * @param dialog The parent dialog base 1327 * @param buttons a QDialogButtonBox instance. This function will take care of connecting to it. 1328 * @param icon A QPixmap containing the icon to be displayed in the 1329 * dialog next to the text. 1330 * @param text Message string. 1331 * @param strlist List of strings to be written in the listbox. 1332 * If the list is empty, it doesn't show any listbox 1333 * @param ask The text of the checkbox. If empty none will be shown. 1334 * @param checkboxReturn The result of the checkbox. If it's initially 1335 * true then the checkbox will be checked by default. 1336 * May be a null pointer. Incompatible with NoExec. 1337 * @param options see Options 1338 * @param details Detailed message string. 1339 * @param notifyType The type of notification to send when this message 1340 * is presentend. 1341 * @return A QDialogButtonBox::StandardButton button code, not a KMessageBox 1342 * button code, based on the buttonmask given to the constructor of 1343 * the @p dialog (ie. will return QDialogButtonBox::Yes instead of 1344 * KMessageBox::PrimaryAction). Will return QDialogButtonBox::NoButton if the 1345 * message box is queued for display instead of exec()ed immediately 1346 * or if the option NoExec is set. 1347 * @note Unless NoExec is used, 1348 * the @p dialog that is passed in is deleted by this 1349 * function. Do not delete it yourself. 1350 */ 1351 KWIDGETSADDONS_EXPORT QDialogButtonBox::StandardButton createKMessageBox(QDialog *dialog, 1352 QDialogButtonBox *buttons, 1353 const QIcon &icon, 1354 const QString &text, 1355 const QStringList &strlist, 1356 const QString &ask, 1357 bool *checkboxReturn, 1358 Options options, 1359 const QString &details = QString(), 1360 QMessageBox::Icon notifyType = QMessageBox::Information); // krazy:exclude=qclasses 1361 1362 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 1363 /** 1364 * This function accepts the window id of the parent window, instead 1365 * of QWidget*. It should be used only when necessary. 1366 * 1367 * @deprecated Since 5.100, use questionTwoActionsWId() 1368 */ 1369 KWIDGETSADDONS_EXPORT 1370 KWIDGETSADDONS_DEPRECATED_VERSION(5, 100, "Use questionTwoActionsWId()") 1371 ButtonCode questionYesNoWId(WId parent_id, 1372 const QString &text, 1373 const QString &title = QString(), 1374 const KGuiItem &buttonYes = KStandardGuiItem::yes(), 1375 const KGuiItem &buttonNo = KStandardGuiItem::no(), 1376 const QString &dontAskAgainName = QString(), 1377 Options options = Notify); 1378 #endif 1379 1380 /** 1381 * This function accepts the window id of the parent window, instead 1382 * of QWidget*. It should be used only when necessary. 1383 * 1384 * @see questionTwoActions() 1385 * @since 5.100 1386 */ 1387 KWIDGETSADDONS_EXPORT 1388 ButtonCode questionTwoActionsWId(WId parent_id, 1389 const QString &text, 1390 const QString &title, 1391 const KGuiItem &primaryAction, 1392 const KGuiItem &secondaryAction, 1393 const QString &dontAskAgainName = QString(), 1394 Options options = Notify); 1395 1396 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 1397 /** 1398 * This function accepts the window id of the parent window, instead 1399 * of QWidget*. It should be used only when necessary. 1400 * 1401 * @deprecated Since 5.100, use questionTwoActionsCancelWId() 1402 */ 1403 KWIDGETSADDONS_EXPORT 1404 KWIDGETSADDONS_DEPRECATED_VERSION(5, 100, "Use questionTwoActionsCancelWId()") 1405 ButtonCode questionYesNoCancelWId(WId parent_id, 1406 const QString &text, 1407 const QString &title = QString(), 1408 const KGuiItem &buttonYes = KStandardGuiItem::yes(), 1409 const KGuiItem &buttonNo = KStandardGuiItem::no(), 1410 const KGuiItem &buttonCancel = KStandardGuiItem::cancel(), 1411 const QString &dontAskAgainName = QString(), 1412 Options options = Notify); 1413 #endif 1414 1415 /** 1416 * This function accepts the window id of the parent window, instead 1417 * of QWidget*. It should be used only when necessary. 1418 * 1419 * @see questionTwoActionsCancel() 1420 * @since 5.100 1421 */ 1422 KWIDGETSADDONS_EXPORT 1423 ButtonCode questionTwoActionsCancelWId(WId parent_id, 1424 const QString &text, 1425 const QString &title, 1426 const KGuiItem &primaryAction, 1427 const KGuiItem &secondaryAction, 1428 const KGuiItem &cancelAction = KStandardGuiItem::cancel(), 1429 const QString &dontAskAgainName = QString(), 1430 Options options = Notify); 1431 1432 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 1433 /** 1434 * This function accepts the window id of the parent window, instead 1435 * of QWidget*. It should be used only when necessary. 1436 * 1437 * @deprecated Since 5.100, use questionTwoActionsListWId() 1438 */ 1439 KWIDGETSADDONS_EXPORT 1440 KWIDGETSADDONS_DEPRECATED_VERSION(5, 100, "Use questionTwoActionsListWId()") 1441 ButtonCode questionYesNoListWId(WId parent_id, 1442 const QString &text, 1443 const QStringList &strlist, 1444 const QString &title = QString(), 1445 const KGuiItem &buttonYes = KStandardGuiItem::yes(), 1446 const KGuiItem &buttonNo = KStandardGuiItem::no(), 1447 const QString &dontAskAgainName = QString(), 1448 Options options = Notify); 1449 #endif 1450 1451 /** 1452 * This function accepts the window id of the parent window, instead 1453 * of QWidget*. It should be used only when necessary. 1454 * 1455 * @see questionTwoActionsList() 1456 * @since 5.100 1457 */ 1458 KWIDGETSADDONS_EXPORT 1459 ButtonCode questionTwoActionsListWId(WId parent_id, 1460 const QString &text, 1461 const QStringList &strlist, 1462 const QString &title, 1463 const KGuiItem &primaryAction, 1464 const KGuiItem &secondaryAction, 1465 const QString &dontAskAgainName = QString(), 1466 Options options = Notify); 1467 1468 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 1469 /** 1470 * This function accepts the window id of the parent window, instead 1471 * of QWidget*. It should be used only when necessary. 1472 * 1473 * @deprecated Since 5.100, use warningTwoActionsWId() 1474 */ 1475 KWIDGETSADDONS_EXPORT 1476 KWIDGETSADDONS_DEPRECATED_VERSION(5, 100, "Use warningTwoActionsWId()") 1477 ButtonCode warningYesNoWId(WId parent_id, 1478 const QString &text, 1479 const QString &title = QString(), 1480 const KGuiItem &buttonYes = KStandardGuiItem::yes(), 1481 const KGuiItem &buttonNo = KStandardGuiItem::no(), 1482 const QString &dontAskAgainName = QString(), 1483 Options options = Options(Notify | Dangerous)); 1484 #endif 1485 1486 /** 1487 * This function accepts the window id of the parent window, instead 1488 * of QWidget*. It should be used only when necessary. 1489 * 1490 * @see warningTwoActions() 1491 * @since 5.100 1492 */ 1493 KWIDGETSADDONS_EXPORT 1494 ButtonCode warningTwoActionsWId(WId parent_id, 1495 const QString &text, 1496 const QString &title, 1497 const KGuiItem &primaryAction, 1498 const KGuiItem &secondaryAction, 1499 const QString &dontAskAgainName = QString(), 1500 Options options = Options(Notify | Dangerous)); 1501 1502 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 1503 /** 1504 * This function accepts the window id of the parent window, instead 1505 * of QWidget*. It should be used only when necessary. 1506 * 1507 * @deprecated Since 5.100, use warningTwoActionsListWId() 1508 */ 1509 KWIDGETSADDONS_EXPORT 1510 KWIDGETSADDONS_DEPRECATED_VERSION(5, 100, "Use warningTwoActionsListWId()") 1511 ButtonCode warningYesNoListWId(WId parent_id, 1512 const QString &text, 1513 const QStringList &strlist, 1514 const QString &title = QString(), 1515 const KGuiItem &buttonYes = KStandardGuiItem::yes(), 1516 const KGuiItem &buttonNo = KStandardGuiItem::no(), 1517 const QString &dontAskAgainName = QString(), 1518 Options options = Options(Notify | Dangerous)); 1519 #endif 1520 1521 /** 1522 * This function accepts the window id of the parent window, instead 1523 * of QWidget*. It should be used only when necessary. 1524 * 1525 * @see warningTwoActionsList() 1526 * @since 5.100 1527 */ 1528 KWIDGETSADDONS_EXPORT 1529 ButtonCode warningTwoActionsListWId(WId parent_id, 1530 const QString &text, 1531 const QStringList &strlist, 1532 const QString &title, 1533 const KGuiItem &primaryAction, 1534 const KGuiItem &secondaryAction, 1535 const QString &dontAskAgainName = QString(), 1536 Options options = Options(Notify | Dangerous)); 1537 1538 /** 1539 * This function accepts the window id of the parent window, instead 1540 * of QWidget*. It should be used only when necessary. 1541 */ 1542 KWIDGETSADDONS_EXPORT ButtonCode warningContinueCancelWId(WId parent_id, 1543 const QString &text, 1544 const QString &title = QString(), 1545 const KGuiItem &buttonContinue = KStandardGuiItem::cont(), 1546 const KGuiItem &buttonCancel = KStandardGuiItem::cancel(), 1547 const QString &dontAskAgainName = QString(), 1548 Options options = Notify); 1549 1550 /** 1551 * This function accepts the window id of the parent window, instead 1552 * of QWidget*. It should be used only when necessary. 1553 */ 1554 KWIDGETSADDONS_EXPORT ButtonCode warningContinueCancelListWId(WId parent_id, 1555 const QString &text, 1556 const QStringList &strlist, 1557 const QString &title = QString(), 1558 const KGuiItem &buttonContinue = KStandardGuiItem::cont(), 1559 const KGuiItem &buttonCancel = KStandardGuiItem::cancel(), 1560 const QString &dontAskAgainName = QString(), 1561 Options options = Notify); 1562 1563 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 1564 /** 1565 * This function accepts the window id of the parent window, instead 1566 * of QWidget*. It should be used only when necessary. 1567 * 1568 * @deprecated Since 5.100, use warningTwoActionsCancelWId() 1569 */ 1570 KWIDGETSADDONS_EXPORT 1571 KWIDGETSADDONS_DEPRECATED_VERSION(5, 100, "Use warningTwoActionsCancelWId()") 1572 ButtonCode warningYesNoCancelWId(WId parent_id, 1573 const QString &text, 1574 const QString &title = QString(), 1575 const KGuiItem &buttonYes = KStandardGuiItem::yes(), 1576 const KGuiItem &buttonNo = KStandardGuiItem::no(), 1577 const KGuiItem &buttonCancel = KStandardGuiItem::cancel(), 1578 const QString &dontAskAgainName = QString(), 1579 Options options = Notify); 1580 #endif 1581 1582 /** 1583 * This function accepts the window id of the parent window, instead 1584 * of QWidget*. It should be used only when necessary. 1585 * 1586 * @see warningTwoActionsCancel() 1587 * @since 5.100 1588 */ 1589 KWIDGETSADDONS_EXPORT 1590 ButtonCode warningTwoActionsCancelWId(WId parent_id, 1591 const QString &text, 1592 const QString &title, 1593 const KGuiItem &primaryAction, 1594 const KGuiItem &secondaryAction, 1595 const KGuiItem &cancelAction = KStandardGuiItem::cancel(), 1596 const QString &dontAskAgainName = QString(), 1597 Options options = Options(Notify | Dangerous)); 1598 1599 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 1600 /** 1601 * This function accepts the window id of the parent window, instead 1602 * of QWidget*. It should be used only when necessary. 1603 * 1604 * @deprecated Since 5.100, use warningTwoActionsCancelListWId() 1605 */ 1606 KWIDGETSADDONS_EXPORT 1607 KWIDGETSADDONS_DEPRECATED_VERSION(5, 100, "Use warningTwoActionsCancelListWId()") 1608 ButtonCode warningYesNoCancelListWId(WId parent_id, 1609 const QString &text, 1610 const QStringList &strlist, 1611 const QString &title = QString(), 1612 const KGuiItem &buttonYes = KStandardGuiItem::yes(), 1613 const KGuiItem &buttonNo = KStandardGuiItem::no(), 1614 const KGuiItem &buttonCancel = KStandardGuiItem::cancel(), 1615 const QString &dontAskAgainName = QString(), 1616 Options options = Notify); 1617 #endif 1618 1619 /** 1620 * This function accepts the window id of the parent window, instead 1621 * of QWidget*. It should be used only when necessary. 1622 * 1623 * @see warningTwoActionsCancelList() 1624 * @since 5.100 1625 */ 1626 KWIDGETSADDONS_EXPORT 1627 ButtonCode warningTwoActionsCancelListWId(WId parent_id, 1628 const QString &text, 1629 const QStringList &strlist, 1630 const QString &title, 1631 const KGuiItem &primaryAction, 1632 const KGuiItem &secondaryAction, 1633 const KGuiItem &cancelAction = KStandardGuiItem::cancel(), 1634 const QString &dontAskAgainName = QString(), 1635 Options options = Options(Notify | Dangerous)); 1636 1637 /** 1638 * This function accepts the window id of the parent window, instead 1639 * of QWidget*. It should be used only when necessary. 1640 */ 1641 KWIDGETSADDONS_EXPORT void errorWId(WId parent_id, const QString &text, const QString &title = QString(), Options options = Notify); 1642 1643 /** 1644 * This function accepts the window id of the parent window, instead 1645 * of QWidget*. It should be used only when necessary. 1646 */ 1647 KWIDGETSADDONS_EXPORT void 1648 errorListWId(WId parent_id, const QString &text, const QStringList &strlist, const QString &title = QString(), Options options = Notify); 1649 1650 /** 1651 * This function accepts the window id of the parent window, instead 1652 * of QWidget*. It should be used only when necessary. 1653 */ 1654 KWIDGETSADDONS_EXPORT void 1655 detailedErrorWId(WId parent_id, const QString &text, const QString &details, const QString &title = QString(), Options options = Notify); 1656 1657 /** 1658 * This function accepts the window id of the parent window, instead 1659 * of QWidget*. It should be used only when necessary. 1660 * @since 5.97 1661 */ 1662 KWIDGETSADDONS_EXPORT 1663 void detailedErrorWId(WId parent_id, 1664 const QString &text, 1665 const QString &details, 1666 const QString &title /*= QString()*/, 1667 const KGuiItem &buttonOk /*= KStandardGuiItem::ok()*/, 1668 Options options = Notify); // TODO KF6 merge with previous overload 1669 1670 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 97) 1671 /** 1672 * This function accepts the window id of the parent window, instead 1673 * of QWidget*. It should be used only when necessary. 1674 * @deprecated Since 5.97 use errorWId(). 1675 */ 1676 KWIDGETSADDONS_EXPORT 1677 KWIDGETSADDONS_DEPRECATED_VERSION(5, 97, "Use errorWId().") 1678 void sorryWId(WId parent_id, const QString &text, const QString &title = QString(), Options options = Notify); 1679 #endif 1680 1681 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 97) 1682 /** 1683 * This function accepts the window id of the parent window, instead 1684 * of QWidget*. It should be used only when necessary. 1685 * @deprecated Since 5.97 use detailedErrorWId(). 1686 */ 1687 KWIDGETSADDONS_EXPORT 1688 KWIDGETSADDONS_DEPRECATED_VERSION(5, 97, "Use detailedErrorWId().") 1689 void detailedSorryWId(WId parent_id, const QString &text, const QString &details, const QString &title = QString(), Options options = Notify); 1690 #endif 1691 1692 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 97) 1693 /** 1694 * This function accepts the window id of the parent window, instead 1695 * of QWidget*. It should be used only when necessary. 1696 * @since 5.63 1697 * @deprecated Since 5.97 use detailedErrorWId(). 1698 */ 1699 KWIDGETSADDONS_EXPORT 1700 KWIDGETSADDONS_DEPRECATED_VERSION(5, 97, "Use detailedErrorWId().") 1701 void detailedSorryWId(WId parent_id, 1702 const QString &text, 1703 const QString &details, 1704 const QString &title /*= QString()*/, 1705 const KGuiItem &buttonOk /*= KStandardGuiItem::ok()*/, 1706 Options options = Notify); 1707 #endif 1708 1709 /** 1710 * This function accepts the window id of the parent window, instead 1711 * of QWidget*. It should be used only when necessary. 1712 */ 1713 KWIDGETSADDONS_EXPORT void 1714 informationWId(WId parent_id, const QString &text, const QString &title = QString(), const QString &dontShowAgainName = QString(), Options options = Notify); 1715 1716 /** 1717 * This function accepts the window id of the parent window, instead 1718 * of QWidget*. It should be used only when necessary. 1719 */ 1720 KWIDGETSADDONS_EXPORT void informationListWId(WId parent_id, 1721 const QString &text, 1722 const QStringList &strlist, 1723 const QString &title = QString(), 1724 const QString &dontShowAgainName = QString(), 1725 Options options = Notify); 1726 1727 /** 1728 * This function accepts the window id of the parent window, instead 1729 * of QWidget*. It should be used only when necessary. 1730 */ 1731 KWIDGETSADDONS_EXPORT 1732 ButtonCode messageBoxWId(WId parent_id, 1733 DialogType type, 1734 const QString &text, 1735 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 100) 1736 const QString &title = QString(), 1737 const KGuiItem &primaryAction = KStandardGuiItem::yes(), 1738 const KGuiItem &secondaryAction = KStandardGuiItem::no(), 1739 #else 1740 const QString &title, 1741 const KGuiItem &primaryAction, 1742 const KGuiItem &secondaryAction, 1743 #endif 1744 const KGuiItem &cancelAction = KStandardGuiItem::cancel(), 1745 const QString &dontShowAskAgainName = QString(), 1746 Options options = Notify); 1747 } 1748 1749 #endif