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... | |
|
||||||||||||
|
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 }
|
|
||||||||||||
|
||||||||||||
|
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 }
|
|
||||||||||||||||||||||||||||||||
|
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 }
|
|
||||||||||||
|
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 }
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002