kalarm/lib

#include <messagebox.h>

Inherits KMessageBox.

Public Types

enum  AskType { CONT_CANCEL_DEF_CONT , CONT_CANCEL_DEF_CANCEL , YES_NO_DEF_NO }
 

Static Public Member Functions

static ButtonCode getContinueDefault (const TQString &dontAskAgainName)
 
static void setContinueDefault (const TQString &dontAskAgainName, ButtonCode defaultButton)
 
static int warningContinueCancel (TQWidget *parent, ButtonCode defaultButton, const TQString &text, const TQString &caption=TQString(), const KGuiItem &buttonContinue=KStdGuiItem::cont(), const TQString &dontAskAgainName=TQString())
 
static int warningContinueCancel (TQWidget *parent, const TQString &text, const TQString &caption=TQString(), const KGuiItem &buttonContinue=KStdGuiItem::cont(), const TQString &dontAskAgainName=TQString())
 
static bool setDefaultShouldBeShownContinue (const TQString &dontShowAgainName, bool defaultShow)
 
static bool shouldBeShownContinue (const TQString &dontShowAgainName)
 
static void saveDontShowAgainYesNo (const TQString &dontShowAgainName, bool dontShow=true, ButtonCode result=No)
 
static void saveDontShowAgainContinue (const TQString &dontShowAgainName, bool dontShow=true)
 
static void setDontShowAskAgainConfig (TDEConfig *cfg)
 

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 softw.nosp@m.are@.nosp@m.astro.nosp@m.jar..nosp@m.org.u.nosp@m.k

Definition at line 36 of file messagebox.h.

Member Enumeration Documentation

◆ 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.

Definition at line 44 of file messagebox.h.

Member Function Documentation

◆ getContinueDefault()

KMessageBox::ButtonCode MessageBox::getContinueDefault ( const TQString &  dontAskAgainName)
static

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

Parameters
dontAskAgainNameThe identifier controlling whether the message box is suppressed.

Definition at line 43 of file messagebox.cpp.

◆ saveDontShowAgainContinue()

void MessageBox::saveDontShowAgainContinue ( const TQString &  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
dontShowAgainNameThe identifier controlling whether the message box is suppressed.
dontShowIf true, the message box will be suppressed and will return Continue.

Definition at line 155 of file messagebox.cpp.

◆ saveDontShowAgainYesNo()

void MessageBox::saveDontShowAgainYesNo ( const TQString &  dontShowAgainName,
bool  dontShow = true,
ButtonCode  result = No 
)
static

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

Parameters
dontShowAgainNameThe identifier controlling whether the message box is suppressed.
dontShowIf true, the message box will be suppressed and will return result.
resultThe button code to return if the message box is suppressed.

Definition at line 142 of file messagebox.cpp.

◆ setContinueDefault()

void MessageBox::setContinueDefault ( const TQString &  dontAskAgainName,
ButtonCode  defaultButton 
)
static

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

Parameters
dontAskAgainNameThe identifier controlling whether the message box is suppressed.
defaultButtonThe default button for the message box. Valid values are Continue or Cancel.

Definition at line 34 of file messagebox.cpp.

◆ setDefaultShouldBeShownContinue()

bool MessageBox::setDefaultShouldBeShownContinue ( const TQString &  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 106 of file messagebox.cpp.

◆ setDontShowAskAgainConfig()

static void MessageBox::setDontShowAskAgainConfig ( TDEConfig *  cfg)
inlinestatic

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

Definition at line 117 of file messagebox.h.

◆ shouldBeShownContinue()

bool MessageBox::shouldBeShownContinue ( const TQString &  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
dontShowAgainNameThe identifier controlling whether the message box is suppressed.

Definition at line 127 of file messagebox.cpp.

◆ warningContinueCancel() [1/2]

int MessageBox::warningContinueCancel ( TQWidget *  parent,
ButtonCode  defaultButton,
const TQString &  text,
const TQString &  caption = TQString(),
const KGuiItem &  buttonContinue = KStdGuiItem::cont(),
const TQString &  dontAskAgainName = TQString() 
)
static

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

Parameters
parentParent widget
defaultButtonThe default button for the message box. Valid values are Continue or Cancel.
textMessage string
captionCaption (window title) of the message box
buttonContinueThe text for the first button (default = i18n("Continue"))
dontAskAgainNameIf specified, the message box will only be suppressed if the user chose Continue last time.

Definition at line 75 of file messagebox.cpp.

◆ warningContinueCancel() [2/2]

int MessageBox::warningContinueCancel ( TQWidget *  parent,
const TQString &  text,
const TQString &  caption = TQString(),
const KGuiItem &  buttonContinue = KStdGuiItem::cont(),
const TQString &  dontAskAgainName = TQString() 
)
static

Displays a Continue/Cancel message box.

Parameters
parentParent widget
textMessage string
captionCaption (window title) of the message box
buttonContinueThe text for the first button (default = i18n("Continue"))
dontAskAgainNameIf 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 63 of file messagebox.cpp.


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