Vidalia  0.3.1
Public Types | Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
VMessageBox Class Reference

#include <VMessageBox.h>

Inheritance diagram for VMessageBox:

Public Types

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

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, QString remember=QString(), VSettings *settings=0, QString key=QString())
 
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)
 

Private Attributes

QCheckBox * _chkRemember
 

Detailed Description

Definition at line 26 of file VMessageBox.h.

Member Enumeration Documentation

Enumerator
NoButton 
Ok 
Cancel 
Yes 
No 
Help 
Retry 
ShowLog 
ShowSettings 
Continue 
Quit 
Browse 

Definition at line 31 of file VMessageBox.h.

Constructor & Destructor Documentation

VMessageBox::VMessageBox ( QWidget *  parent = 0)

Default constructor.

Definition at line 26 of file VMessageBox.cpp.

References _chkRemember.

Member Function Documentation

QString VMessageBox::buttonText ( int  btn)
static

Converts a Button enum value to a translated string.

Definition at line 80 of file VMessageBox.cpp.

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

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

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.

Displays a 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::defaultButton ( int  button0,
int  button1,
int  button2 
)
staticprivate

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

Definition at line 38 of file VMessageBox.cpp.

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

int VMessageBox::escapeButton ( int  button0,
int  button1,
int  button2 
)
staticprivate

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

Definition at line 53 of file VMessageBox.cpp.

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

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 170 of file VMessageBox.cpp.

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

Referenced by MainWindow::displayTorVersionWarning(), MessageLog::find(), MainWindow::newIdentity(), HelpTextBrowser::setSource(), and Vidalia::showUsageMessageBox().

int VMessageBox::question ( QWidget *  parent,
QString  caption,
QString  text,
int  button0,
int  button1 = NoButton,
int  button2 = NoButton,
QString  remember = QString(),
VSettings settings = 0,
QString  key = QString() 
)
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.

Displays an question 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 123 of file VMessageBox.cpp.

References _chkRemember, buttonText(), defaultButton(), escapeButton(), and VSettings::setValue().

Referenced by AdvancedPage::browseTorConfig(), HelpTextBrowser::setSource(), MainWindow::stop(), and MainWindow::tryCookie().

int VMessageBox::selected ( int  ret,
int  button0,
int  button1,
int  button2 
)
staticprivate

Returns the Button enum value from the given return value.

Definition at line 68 of file VMessageBox.cpp.

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

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.

Displays a warning 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 187 of file VMessageBox.cpp.

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

Referenced by ConfigDialog::applyChanges(), MainWindow::authenticated(), MainWindow::authenticationFailed(), ServicePage::browseDirectory(), AdvancedPage::browseTorConfig(), MainWindow::connectFailed(), ServicePage::copyToClipboard(), NetViewer::displayRouterInfo(), MainWindow::newIdentity(), ServerPage::onAuthenticated(), MessageLog::registerLogEvents(), ServicePage::removeService(), MessageLog::rotateLogFile(), MessageLog::save(), ConfigDialog::saveChanges(), MessageLog::saveSettings(), MainWindow::sighup(), MainWindow::startFailed(), MainWindow::stop(), MainWindow::stopped(), and ServicePage::valueChanged().

Member Data Documentation

QCheckBox* VMessageBox::_chkRemember
private

Definition at line 96 of file VMessageBox.h.

Referenced by question(), and VMessageBox().


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