* Only use this if the user cannot perform some remedial action.
* \p askshowagain will display a check box where the user can turn off the
* warning for future cases. Ponder carefully if this is feasible.
+ *
+ * The console output takes care of converting any Qt html to plain text.
*/
void warning(docstring const & title, docstring const & message,
bool const & askshowagain = false);
* Display a warning to the user. Title should be a short (general) summary.
* Only use this if the user cannot perform some remedial action.
* On some systems it is possible to show a backtrace.
+ *
+ * The console output takes care of converting any Qt html to plain text.
*/
void error(docstring const & title, docstring const & message, bool backtrace = false);
namespace Alert {
+docstring toPlainText(docstring const & msg)
+{
+ return qstring_to_ucs4(qtHtmlToPlainText(toqstr(msg)));
+}
+
+
int doPrompt(docstring const & title0, docstring const & question,
int default_button, int cancel_button,
docstring const & b1, docstring const & b2,
{
//lyxerr << "PROMPT" << title0 << "FOCUS: " << qApp->focusWidget() << endl;
if (!use_gui || lyxerr.debugging()) {
- lyxerr << title0 << '\n'
+ lyxerr << toPlainText(title0) << '\n'
<< "----------------------------------------\n"
- << question << endl;
+ << toPlainText(question) << endl;
lyxerr << "Assuming answer is ";
switch (default_button) {
void doWarning(docstring const & title0, docstring const & message,
bool const & askshowagain)
{
- lyxerr << "Warning: " << title0 << '\n'
+ lyxerr << "Warning: " << toPlainText(title0) << '\n'
<< "----------------------------------------\n"
- << message << endl;
+ << toPlainText(message) << endl;
if (!use_gui)
return;
void doError(docstring const & title0, docstring const & message, bool backtrace)
{
- lyxerr << "Error: " << title0 << '\n'
+ lyxerr << "Error: " << toPlainText(title0) << '\n'
<< "----------------------------------------\n"
- << message << endl;
+ << toPlainText(message) << endl;
QString details;
if (backtrace) {
void doInformation(docstring const & title0, docstring const & message)
{
if (!use_gui || lyxerr.debugging())
- lyxerr << title0 << '\n'
+ lyxerr << toPlainText(title0) << '\n'
<< "----------------------------------------\n"
- << message << endl;
+ << toPlainText(message) << endl;
if (!use_gui)
return;
{
if (!use_gui || lyxerr.debugging()) {
lyxerr << "----------------------------------------\n"
- << msg << '\n'
+ << toPlainText(msg) << '\n'
<< "Assuming answer is " << dflt << '\n'
<< "----------------------------------------" << endl;
if (!use_gui) {