• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kalarm/lib

MessageBox Class Reference

#include <messagebox.h>

Inheritance diagram for MessageBox:

Inheritance graph
[legend]

List of all members.


Detailed Description

Enhanced KMessageBox.

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

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

Definition at line 39 of file messagebox.h.


Public Types

enum  AskType { CONT_CANCEL_DEF_CONT, CONT_CANCEL_DEF_CANCEL, YES_NO_DEF_NO }

Static Public Member Functions

static ButtonCode getContinueDefault (const QString &dontAskAgainName)
static void saveDontShowAgainContinue (const QString &dontShowAgainName, bool dontShow=true)
static void saveDontShowAgainYesNo (const QString &dontShowAgainName, bool dontShow=true, ButtonCode result=No)
static void setContinueDefault (const QString &dontAskAgainName, ButtonCode defaultButton)
static bool setDefaultShouldBeShownContinue (const QString &dontShowAgainName, bool defaultShow)
static bool shouldBeShownContinue (const QString &dontShowAgainName)
static int warningContinueCancel (QWidget *parent, const QString &text, const QString &caption=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const QString &dontAskAgainName=QString())
static int warningContinueCancel (QWidget *parent, ButtonCode defaultButton, const QString &text, const QString &caption=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const QString &dontAskAgainName=QString())

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.
Enumerator:
CONT_CANCEL_DEF_CONT 
CONT_CANCEL_DEF_CANCEL 
YES_NO_DEF_NO 

Definition at line 47 of file messagebox.h.


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.

Definition at line 45 of file messagebox.cpp.

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:
dontShowAgainName The identifier controlling whether the message box is suppressed.
dontShow If true, the message box will be suppressed and will return Continue.

Definition at line 156 of file messagebox.cpp.

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:
dontShowAgainName 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.

Definition at line 143 of file messagebox.cpp.

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.

Definition at line 36 of file messagebox.cpp.

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.

Definition at line 108 of file messagebox.cpp.

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:
dontShowAgainName The identifier controlling whether the message box is suppressed.

Definition at line 128 of file messagebox.cpp.

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

Displays a Continue/Cancel message box.

Parameters:
parent Parent widget
text Message string
caption Caption (window title) of the message box
buttonContinue The text for the first button (default = i18n("Continue"))
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.

Definition at line 65 of file messagebox.cpp.

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

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

Parameters:
parent Parent widget
defaultButton The default button for the message box. Valid values are Continue or Cancel.
text Message string
caption Caption (window title) of the message box
buttonContinue The text for the first button (default = i18n("Continue"))
dontAskAgainName If specified, the message box will only be suppressed if the user chose Continue last time.

Definition at line 77 of file messagebox.cpp.


The documentation for this class was generated from the following files:
  • messagebox.h
  • messagebox.cpp

kalarm/lib

Skip menu "kalarm/lib"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal