Dialogs provided by namespace KMessageBox support a feature to hide dialogs on user request by specifying the parameter dontAskAgainName, which adds a checkbox named "Don't ask again" to the related dialog.
What is currently missing in KMessageBox namespace and therefore provided by class DontAskAgainHandler, is a widget to reenable or disable dialogs using the "Don't ask again" support in an application setting dialog.
To use this support call macro DefineDontAskAgainItem and add a call to method DontAskAgainItem::name as parameter dontAskAgainName
to related class KMessageBox methods. See the following example:
...
return KMessageBox::warningContinueCancel(..., aDontAskAgainItem.name())
#define DefineDontAskAgainItem(name, key, _text)
Definition: dontaskagain.h:39
#define i18n
Definition: main.cpp:35
To add the mentioned widget to a settings dialog call createWidget() and add the result to a dialog layout.
- Author
- Ralf Habacker ralf..nosp@m.haba.nosp@m.cker@.nosp@m.free.nosp@m.net.d.nosp@m.e