VMessageBox Class Reference

#include <vmessagebox.h>

List of all members.

Public Types

enum  Button {
  NoButton = 0, Ok, Cancel, Yes,
  No, Help, Retry, ShowLog,
  ShowSettings
}

Public Member Functions

 VMessageBox (QWidget *parent=0)

Static Public Member Functions

static int critical (QWidget *parent, QString caption, QString text, int button0, int button1=NoButton, int button2=NoButton)
static int information (QWidget *parent, QString caption, QString text, int button0, int button1=NoButton, int button2=NoButton)
static int warning (QWidget *parent, QString caption, QString text, int button0, int button1=NoButton, int button2=NoButton)
static int question (QWidget *parent, QString caption, QString text, int button0, int button1=NoButton, int button2=NoButton)
static QString buttonText (int button)

Static Private Member Functions

static int defaultButton (int button0, int button1, int button2)
static int escapeButton (int button0, int button1, int button2)
static int selected (int ret, int button0, int button1, int button2)


Detailed Description

Definition at line 35 of file vmessagebox.h.


Member Enumeration Documentation

enum VMessageBox::Button

Enumerator:
NoButton 
Ok 
Cancel 
Yes 
No 
Help 
Retry 
ShowLog 
ShowSettings 

Definition at line 40 of file vmessagebox.h.


Constructor & Destructor Documentation

VMessageBox::VMessageBox ( QWidget *  parent = 0  ) 

Default constructor.

Definition at line 33 of file vmessagebox.cpp.


Member Function Documentation

int VMessageBox::critical ( QWidget *  parent,
QString  caption,
QString  text,
int  button0,
int  button1 = NoButton,
int  button2 = NoButton 
) [static]

Displays an critical message box with the given caption, message text, and visible buttons. To specify a button as a default button or an escape button, OR the Button enum value with QMessageBox::Default or QMessageBox::Escape, respectively.

Definition at line 106 of file vmessagebox.cpp.

References buttonText(), defaultButton(), escapeButton(), p(), and selected().

Referenced by main().

int VMessageBox::information ( QWidget *  parent,
QString  caption,
QString  text,
int  button0,
int  button1 = NoButton,
int  button2 = NoButton 
) [static]

Displays an information message box with the given caption, message text, and visible buttons. To specify a button as a default button or an escape button, OR the Button enum value with QMessageBox::Default or QMessageBox::Escape, respectively.

Definition at line 140 of file vmessagebox.cpp.

References buttonText(), defaultButton(), escapeButton(), p(), and selected().

Referenced by MessageLog::find(), ServerPage::getServerAddress(), and MainWindow::newIdentity().

int VMessageBox::warning ( QWidget *  parent,
QString  caption,
QString  text,
int  button0,
int  button1 = NoButton,
int  button2 = NoButton 
) [static]

Displays a warning message box with the given caption, message text, and visible buttons. To specify as a default button or an escape button, OR the Button enum value with QMessageBox::Default or QMessageBox::Escape, respectively.

Definition at line 157 of file vmessagebox.cpp.

References buttonText(), defaultButton(), escapeButton(), p(), and selected().

Referenced by AdvancedPage::browseTorConfig(), MainWindow::connected(), MainWindow::connectFailed(), ServerPage::getServerPublicIP(), MainWindow::initiateServerShutdown(), MainWindow::newIdentity(), MessageLog::registerLogEvents(), MessageLog::rotateLogFile(), MessageLog::save(), ConfigDialog::saveChanges(), MainWindow::startFailed(), MainWindow::stop(), and MainWindow::stopped().

int VMessageBox::question ( QWidget *  parent,
QString  caption,
QString  text,
int  button0,
int  button1 = NoButton,
int  button2 = NoButton 
) [static]

Displays a warning message box with the given caption, message text, and visible buttons. To specify as a default button or an escape button, OR the Button enum value with QMessageBox::Default or QMessageBox::Escape, respectively.

Definition at line 123 of file vmessagebox.cpp.

References buttonText(), defaultButton(), escapeButton(), p(), and selected().

Referenced by AdvancedPage::browseTorConfig(), and MainWindow::initiateServerShutdown().

QString VMessageBox::buttonText ( int  button  )  [static]

Converts a Button enum value to a translated string.

Definition at line 83 of file vmessagebox.cpp.

References Cancel, Help, No, Ok, Retry, ShowLog, ShowSettings, and Yes.

Referenced by critical(), information(), question(), and warning().

int VMessageBox::defaultButton ( int  button0,
int  button1,
int  button2 
) [static, private]

Returns the button (0, 1, or 2) that is OR-ed with QMessageBox::Default, or 0 if none are.

Definition at line 41 of file vmessagebox.cpp.

Referenced by critical(), information(), question(), and warning().

int VMessageBox::escapeButton ( int  button0,
int  button1,
int  button2 
) [static, private]

Returns the button (0, 1, or 2) that is OR-ed with QMessageBox::Escape, or -1 if none are.

Definition at line 56 of file vmessagebox.cpp.

Referenced by critical(), information(), question(), and warning().

int VMessageBox::selected ( int  ret,
int  button0,
int  button1,
int  button2 
) [static, private]

Returns the Button enum value from the given return value.

Definition at line 71 of file vmessagebox.cpp.

Referenced by critical(), information(), question(), and warning().


The documentation for this class was generated from the following files:
Generated on Mon Oct 23 20:08:16 2006 for Vidalia by  doxygen 1.5.0