KDE PIM / Developers / API Docs / kalarm

MessageBox Class Reference

The MessageBox class provides an extension to KMessageBox, including the option for Continue/Cancel message boxes to have a default button of Cancel. Enhanced KMessageBox. More...

#include <messagebox.h>

Inherits KMessageBox.

List of all members.

Public Types

Static Public Member Functions


Detailed Description

The MessageBox class provides an extension to KMessageBox, including the option for Continue/Cancel message boxes to have a default button of Cancel. Enhanced KMessageBox.

Author:
David Jarvie <software@astrojar.org.uk>


Member Enumeration Documentation

enum MessageBox::AskType
 

MessageBox types.

  • CONT_CANCEL_DEF_CONT - Continue/Cancel, with Continue as the default button.
  • CONT_CANCEL_DEF_CANCEL - Continue/Cancel, with Cancel as the default button.
  • YES_NO_DEF_NO - Yes/No, with No as the default button.

Member Function Documentation

KMessageBox::ButtonCode MessageBox::getContinueDefault const QString &  dontAskAgainName  )  [static]
 

Gets the default button for the Continue/Cancel message box with the specified "don't ask again" name.

Parameters:
dontAskAgainName The identifier controlling whether the message box is suppressed.

void MessageBox::setContinueDefault const QString &  dontAskAgainName,
ButtonCode  defaultButton
[static]
 

Sets the default button for the Continue/Cancel message box with the specified "don't ask again" name.

Parameters:
dontAskAgainName The identifier controlling whether the message box is suppressed.
defaultButton The default button for the message box. Valid values are Continue or Cancel.

int MessageBox::warningContinueCancel QWidget *  parent,
ButtonCode  defaultButton,
const QString &  text,
const QString &  caption = QString::null,
const KGuiItem &  buttonContinue = KStdGuiItem::cont(),
const QString &  dontAskAgainName = QString::null
[static]
 

Displays a Continue/Cancel message box with the option as to which button is the default.

Parameters:
defaultButton The default button for the message box. Valid values are Continue or Cancel.
dontAskAgainName If specified, the message box will only be suppressed if the user chose Continue last time.

int MessageBox::warningContinueCancel QWidget *  parent,
const QString &  text,
const QString &  caption = QString::null,
const KGuiItem &  buttonContinue = KStdGuiItem::cont(),
const QString &  dontAskAgainName = QString::null
[static]
 

Displays a Continue/Cancel message box.

Parameters:
dontAskAgainName If specified, (1) The message box will only be suppressed if the user chose Continue last time, and (2) The default button is that last set with either setContinueDefault() or warningContinueCancel() for the same dontAskAgainName value. If neither method has been used to set a default button, Continue is the default.

bool MessageBox::setDefaultShouldBeShownContinue const QString &  dontShowAgainName,
bool  defaultShow
[static]
 

If there is no current setting for whether a non-Yes/No message box should be shown, sets it to defaultShow.

If a Continue/Cancel message box has Cancel as the default button, either setContinueDefault() or warningContinueCancel() must have been called previously to set this for the specified dontShowAgainName value.

Returns:
true if defaultShow was written.

bool MessageBox::shouldBeShownContinue const QString &  dontShowAgainName  )  [static]
 

Returns whether a non-Yes/No message box should be shown.

If the message box has Cancel as the default button, either setContinueDefault() or warningContinueCancel() must have been called previously to set this for the specified dontShowAgainName value.

Parameters:
dontAskAgainName The identifier controlling whether the message box is suppressed.

void MessageBox::saveDontShowAgainYesNo const QString &  dontShowAgainName,
bool  dontShow = true,
ButtonCode  result = No
[static]
 

Stores whether the Yes/No message box should or should not be shown again.

Parameters:
dontAskAgainName The identifier controlling whether the message box is suppressed.
dontShow If true, the message box will be suppressed and will return result.
result The button code to return if the message box is suppressed.

void MessageBox::saveDontShowAgainContinue const QString &  dontShowAgainName,
bool  dontShow = true
[static]
 

Stores whether a non-Yes/No message box should or should not be shown again.

If the message box has Cancel as the default button, either setContinueDefault() or warningContinueCancel() must have been called previously to set this for the specified dontShowAgainName value.

Parameters:
dontAskAgainName The identifier controlling whether the message box is suppressed.
dontShow If true, the message box will be suppressed and will return Continue.

static void MessageBox::setDontShowAskAgainConfig KConfig *  cfg  )  [inline, static]
 

Sets the KConfig object to be used by the MessageBox class.


The documentation for this class was generated from the following files: