3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
14 #include "Alert_pimpl.h"
24 int Alert::prompt(string const & title, string const & question,
25 int default_button, int escape_button,
26 string const & b1, string const & b2, string const & b3)
28 if (!lyx_gui::use_gui || lyxerr.debugging()) {
30 << "----------------------------------------"
33 lyxerr << "Assuming answer is ";
34 switch (default_button) {
35 case 0: lyxerr << b1 << endl;
36 case 1: lyxerr << b2 << endl;
37 case 2: lyxerr << b3 << endl;
39 if (!lyx_gui::use_gui)
40 return default_button;
43 return prompt_pimpl(title, question,
44 default_button, escape_button, b1, b2, b3);
49 void Alert::warning(string const & title, string const & message)
51 if (!lyx_gui::use_gui || lyxerr.debugging())
52 lyxerr << "Warning: " << title
53 << "----------------------------------------"
56 warning_pimpl(title, message);
60 void Alert::error(string const & title, string const & message)
62 if (!lyx_gui::use_gui || lyxerr.debugging())
63 lyxerr << "Error: " << title << '\n'
64 << "----------------------------------------\n"
68 error_pimpl(title, message);
72 void Alert::information(string const & title, string const & message)
74 if (!lyx_gui::use_gui || lyxerr.debugging())
76 << "----------------------------------------"
80 information_pimpl(title, message);
84 pair<bool, string> const Alert::askForText(string const & msg,
87 if (!lyx_gui::use_gui || lyxerr.debugging()) {
88 lyxerr << "----------------------------------------\n"
90 << "Assuming answer is " << dflt << '\n'
91 << "----------------------------------------" << endl;
92 if (!lyx_gui::use_gui)
93 return make_pair<bool, string>(true, dflt);
96 return askForText_pimpl(msg, dflt);