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"
25 int Alert::prompt(string const & title, string const & question,
26 int default_button, int escape_button,
27 string const & b1, string const & b2, string const & b3)
29 if (!lyx_gui::use_gui || lyxerr.debugging()) {
30 lyxerr << title << '\n'
31 << "----------------------------------------\n"
34 lyxerr << "Assuming answer is ";
35 switch (default_button) {
36 case 0: lyxerr << b1 << endl;
37 case 1: lyxerr << b2 << endl;
38 case 2: lyxerr << b3 << endl;
40 if (!lyx_gui::use_gui)
41 return default_button;
44 return prompt_pimpl(title, question,
45 default_button, escape_button, b1, b2, b3);
50 void Alert::warning(string const & title, string const & message)
52 if (!lyx_gui::use_gui || lyxerr.debugging())
53 lyxerr << "Warning: " << title << '\n'
54 << "----------------------------------------\n"
57 warning_pimpl(title, message);
61 void Alert::error(string const & title, string const & message)
63 if (!lyx_gui::use_gui || lyxerr.debugging())
64 lyxerr << "Error: " << title << '\n'
65 << "----------------------------------------\n"
69 error_pimpl(title, message);
73 void Alert::information(string const & title, string const & message)
75 if (!lyx_gui::use_gui || lyxerr.debugging())
76 lyxerr << title << '\n'
77 << "----------------------------------------\n"
81 information_pimpl(title, message);
85 pair<bool, string> const Alert::askForText(string const & msg,
88 if (!lyx_gui::use_gui || lyxerr.debugging()) {
89 lyxerr << "----------------------------------------\n"
91 << "Assuming answer is " << dflt << '\n'
92 << "----------------------------------------" << endl;
93 if (!lyx_gui::use_gui)
94 return make_pair<bool, string>(true, dflt);
97 return askForText_pimpl(msg, dflt);