Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

Alert Namespace Reference


Functions

int prompt (string const &title, string const &question, int default_button, int cancel_button, string const &b1, string const &b2, string const &b3=string())
 Prompt for a question. More...

void warning (string const &title, string const &message)
 Display a warning to the user. More...

void error (string const &title, string const &message)
 Display a warning to the user. More...

void information (string const &title, string const &message)
 Informational message. More...

std::pair< bool, string
> const 
askForText (string const &msg, string const &dflt=string())
 Asks for a text. DO NOT USE !! More...


Function Documentation

pair< bool, string > const Alert::askForText string const &    msg,
string const &    dflt = string()
 

Asks for a text. DO NOT USE !!

Definition at line 78 of file Alert.C.

Referenced by LyXVC::checkIn, MathHullInset::dispatch, and LyXVC::registrer.

00080 {
00081         if (!lyx_gui::use_gui) {
00082                 lyxerr << "----------------------------------------" << endl
00083                        << msg << endl
00084                        << "Assuming answer is " << dflt
00085                        << "----------------------------------------" << endl;
00086                 return make_pair<bool, string>(true, dflt);
00087         } else {
00088                 return askForText_pimpl(msg, dflt);
00089         }
00090 }

void Alert::error string const &    title,
string const &    message
 

Display a warning to the user.

Title should be a short (general) summary. Only use this if the user cannot perform some remedial action.

Definition at line 56 of file Alert.C.

Referenced by browseDir, browseFile, ControlSpellchecker::checkAlive, Converters::convert, ErrorItem::ErrorItem, Exporter::Export, getContentsOfAsciiFile, FontInfo::getFontname, Importer::Import, BufferView::insertLyXFile, Trans::Load, ControlDocument::loadTextclass, InsetText::localDispatch, LyXFont::lyxRead, Buffer::makeDocBookFile, Buffer::makeLaTeXFile, Buffer::makeLinuxDocFile, Converters::move, newFile, InsetGraphics::prepareFile, LyXTextClass::Read, LyXLayout::Read, Buffer::readBody, readFile, Buffer::readFile, LyXVC::registrer, Buffer::runChktex, Converters::runLaTeX, setAscentFractions, InsetERT::setFont, showFileError, showPrintError, ControlSpellchecker::startSession, InsetTabular::tabularFeatures, FormLog::update, Formats::view, and Buffer::writeFileAscii.

00057 {
00058         if (lyx_gui::use_gui)
00059                 return error_pimpl(title, message);
00060 
00061         lyxerr << "Error: " << title << endl;
00062         lyxerr << "----------------------------------------" << endl;
00063         lyxerr << message << endl;
00064 }

void Alert::information string const &    title,
string const &    message
 

Informational message.

Use very very sparingly. That is, you must apply to me, in triplicate, under the sea, breathing in petrol and reciting the Nicene Creed, whilst running uphill and also eating.

Definition at line 67 of file Alert.C.

Referenced by LColor::Pimpl::fill, Reconfigure, and ControlSpellchecker::showSummary.

00068 {
00069         if (lyx_gui::use_gui)
00070                 return information_pimpl(title, message);
00071 
00072         lyxerr << title << endl;
00073         lyxerr << "----------------------------------------" << endl;
00074         lyxerr << message << endl;
00075 }

int Alert::prompt string const &    title,
string const &    question,
int    default_button,
int    cancel_button,
string const &    b1,
string const &    b2,
string const &    b3 = string()
 

Prompt for a question.

Returns 0-2 for the chosen button. Set default_button and cancel_button to reasonable values. b1-b3 should have accelerators marked with an '&'. title should be a short summary. Strings should be gettextised. Please think about the poor user.

Remember to use boost::format. If you make any of these buttons "Yes" or "No", I will personally come around to your house and slap you with fish, and not in an enjoyable way either.

Definition at line 24 of file Alert.C.

Referenced by BufferList::close, LyXFunc::dispatch, LyXFunc::doImport, ensureBufferClean, BufferView::Pimpl::loadLyXFile, loadLyXFile, MenuWrite, BufferList::quitWriteBuffer, readFile, LyXVC::revert, and WriteAs.

00027 {
00028         if (lyx_gui::use_gui)
00029                 return prompt_pimpl(title, question,
00030                         default_button, escape_button, b1, b2, b3);
00031 
00032         lyxerr << title << endl;
00033         lyxerr << "----------------------------------------" << endl;
00034         lyxerr << question << endl;
00035         lyxerr << "Assuming answer is ";
00036         switch (default_button) {
00037                 case 0: lyxerr << b1 << endl;
00038                 case 1: lyxerr << b2 << endl;
00039                 case 2: lyxerr << b3 << endl;
00040         }
00041         return default_button;
00042 }

void Alert::warning string const &    title,
string const &    message
 

Display a warning to the user.

Title should be a short (general) summary. Only use this if the user cannot perform some remedial action.

Definition at line 45 of file Alert.C.

Referenced by FormDialogView::postWarning, FormBase::postWarning, QuitLyX, Buffer::readFile, BufferParams::readToken, Converters::runLaTeX, Chktex::scanLogFile, showFileError, unknownClass, and Buffer::~Buffer.

00046 {
00047         if (lyx_gui::use_gui)
00048                 return warning_pimpl(title, message);
00049 
00050         lyxerr << "Warning: " << title << endl;
00051         lyxerr << "----------------------------------------" << endl;
00052         lyxerr << message << endl;
00053 }


Generated on Fri Jul 18 01:19:06 2003 for lyx by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002