]> git.lyx.org Git - features.git/commitdiff
kill Alert::alert()
authorJohn Levon <levon@movementarian.org>
Mon, 31 Mar 2003 01:15:44 +0000 (01:15 +0000)
committerJohn Levon <levon@movementarian.org>
Mon, 31 Mar 2003 01:15:44 +0000 (01:15 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6653 a592a061-630c-0410-9148-cb99ea01b6c8

21 files changed:
src/ChangeLog
src/bufferlist.C
src/converter.C
src/exporter.C
src/format.C
src/frontends/Alert.C
src/frontends/Alert.h
src/frontends/Alert_pimpl.h
src/frontends/ChangeLog
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlDocument.C
src/frontends/controllers/ControlPrint.C
src/frontends/qt2/Alert_pimpl.C
src/frontends/qt2/ChangeLog
src/frontends/xforms/Alert_pimpl.C
src/frontends/xforms/ChangeLog
src/importer.C
src/insets/ChangeLog
src/insets/insetgraphics.C
src/insets/insettext.C
src/lyx_main.C

index 475b65c0c4a79e58a54206d872bf181def6e53e6..9e4c393aabf1edefbd0f4bd9934e6e2e11d4c8d4 100644 (file)
@@ -1,3 +1,13 @@
+2003-03-31  John Levon  <levon@movementarian.org>
+
+       * bufferlist.C: "Load original" -> "Load Original"
+
+       * converter.C:
+       * exporter.C:
+       * importer.C:
+       * lyx_main.C:
+       * format.C: more Alert cleanups
+
 2003-03-30  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * text2.C (removeParagraph): make it take a RowList::iterator as
index 9b76eafb63781da919cd33a87b910642865aba49..bdfd8567ca0d20be62662ad2d2add8b8672b4488 100644 (file)
@@ -365,7 +365,7 @@ Buffer * BufferList::readFile(string const & s, bool ronly)
                        text += file + _(" exists.\n\nRecover emergency save?");
 #endif
                        int const ret = Alert::prompt(_("Load emergency save?"),
-                               text, 0, _("&Recover"), _("&Load original"));
+                               text, 0, _("&Recover"), _("&Load Original"));
 
                        if (ret == 0) {
                                ts = e;
index d0f1529c921291fbccc4cb8480b865af2d010d10..bef488cf2e9ffff076eb3397d761cd5c01bd6bc9 100644 (file)
@@ -364,9 +364,17 @@ bool Converters::convert(Buffer const * buffer,
                                        Alert::error(_("Build errors"),
                                                _("There were errors during the build process."));
                                } else {
-                                       Alert::alert(_("Cannot convert file"),
-                                                  _("Error while executing"),
-                                                  command.substr(0, 50));
+#if USE_BOOST_FORMAT
+// FIXME: this should go out of here. For example, here we cannot say if
+// it is a document (.lyx) or something else. Same goes for elsewhere.
+                               Alert::error(_("Cannot convert file"),
+                                       boost::io::str(boost::format(_("An error occurred whilst running %1$s"))
+                                       % command.substr(0, 50)));
+#else
+                               Alert::error(_("Cannot convert file"),
+                                       _("An error occurred whilst running ")
+                                       + command.substr(0, 50));
+#endif
                                }
                                return false;
                        }
@@ -389,11 +397,12 @@ bool Converters::convert(Buffer const * buffer,
                                          token_base, to_base);
                        if (!lyx::rename(from, to)) {
 #if USE_BOOST_FORMAT
-                               Alert::alert(_("Error while trying to move directory:"),
-                                          from, boost::io::str(boost::format(_("to %1$s")) % to));
+                               Alert::error(_("Cannot convert file"),
+                                       boost::io::str(boost::format(_(
+                                       "Could not move a temporary file from %1$s to %2$s.")) % from % to));
 #else
-                               Alert::alert(_("Error while trying to move directory:"),
-                                          from, _("to ") + to);
+                               Alert::error(_("Cannot convert file"),
+                                          _("Could not move a temporary file from ") + from + _(" to ") + to + ".");
 #endif
                                return false;
                        }
@@ -431,11 +440,12 @@ bool Converters::move(string const & from, string const & to, bool copy)
                                : lyx::rename(from2, to2);
                        if (!moved && no_errors) {
 #if USE_BOOST_FORMAT
-                               Alert::alert(_("Error while trying to move file:"),
-                                          from2, boost::io::str(boost::format(_("to %1$s")) % to2));
+                               Alert::error(_("Cannot convert file"),
+                                       boost::io::str(boost::format(_(
+                                       "Could not move a temporary file from %1$s to %2$s.")) % from2 % to2));
 #else
-                               Alert::alert(_("Error while trying to move file:"),
-                                          from2, _("to ") + to2);
+                               Alert::error(_("Cannot convert file"),
+                                          _("Could not move a temporary file from ") + from2 + _(" to ") + to2 + ".");
 #endif
                                no_errors = false;
                        }
@@ -568,8 +578,18 @@ bool Converters::runLaTeX(Buffer const * buffer, string const & command)
 
        // check return value from latex.run().
        if ((result & LaTeX::NO_LOGFILE)) {
-               Alert::alert(_("LaTeX did not work!"),
-                          _("Missing log file:"), name);
+               string str;
+#if USE_BOOST_FORMAT
+               boost::format fmt(_("LaTeX did not run successfully. Additionally, LyX "
+                       "could not locate the LaTeX log %1$s."));
+               fmt % name;
+               str = fmt.str();
+#else
+               str += _("LaTeX did not run successfully. Additionally, LyX "
+                       "could not locate the LaTeX log ");
+               str += name + ".";
+#endif
+               Alert::error(_("LaTeX failed"), str);
        } else if ((result & LaTeX::ERRORS)) {
                alertErrors("LaTeX", latex.getNumErrors());
        }  else if (result & LaTeX::NO_OUTPUT) {
index 8ebafda41ec79cd2c7b58e56f8c273679c8bcde4..a8957f5eb0c5691049d5cb43fe27a882dabbcba6 100644 (file)
@@ -1,12 +1,12 @@
-/* This file is part of
- * ======================================================
+/**
+ * \file exporter.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
+ * \author unknown
  *
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2001 The LyX Team.
- *
- * ====================================================== */
+ * Full author contact details are available in file CREDITS
+ */
 
 #include <config.h>
 
@@ -16,6 +16,7 @@
 #include "buffer.h"
 #include "lyx_cb.h" //ShowMessage()
 #include "support/filetools.h"
+#include "support/BoostFormat.h"
 #include "lyxrc.h"
 #include "converter.h"
 #include "format.h"
@@ -56,9 +57,16 @@ bool Exporter::Export(Buffer * buffer, string const & format,
                        }
                }
                if (backend_format.empty()) {
-                       Alert::alert(_("Cannot export file"),
-                                  _("No information for exporting to ")
-                                  + formats.prettyName(format));
+#if USE_BOOST_FORMAT
+// FIXME: better english ...
+                       Alert::error(_("Couldn't export file"),
+                                    boost::io::str(boost::format(_("No information for exporting the format %1$s."))
+                                  % formats.prettyName(format)));
+#else
+                       Alert::error(_("Couldn't export file"),
+                                    _("No information for exporting the format ")
+                                    + formats.prettyName(format) + ".");
+#endif
                        return false;
                }
        } else
@@ -83,8 +91,8 @@ bool Exporter::Export(Buffer * buffer, string const & format,
        else if (backend_format == format)
                buffer->makeLaTeXFile(filename, string(), true);
        else if (contains(buffer->filePath(), ' ')) {
-               Alert::alert(_("Cannot run LaTeX."),
-                          _("The path to the lyx file cannot contain spaces."));
+               Alert::error(_("File name error"),
+                          _("The directory path to the document cannot contain spaces."));
                return false;
        } else
                buffer->makeLaTeXFile(filename, buffer->filePath(), false);
index b8df07ce3b803993d9ae100f0143f3944d8dcd03..27b6d9d3f17eb5c1b5587af8d1c6d62ab20d2dcb 100644 (file)
@@ -158,12 +158,14 @@ bool Formats::view(Buffer const * buffer, string const & filename,
            format->isChildFormat())
                format = getFormat(format->parentFormat());
        if (!format || format->viewer().empty()) {
+// I believe this is the wrong place to show alerts, it should be done by
+// the caller (this should be "utility" code
 #if USE_BOOST_FORMAT
-               Alert::alert(_("Cannot view file"),
+               Alert::error(_("Cannot view file"),
                             boost::io::str(boost::format(_("No information for viewing %1$s"))
                           % prettyName(format_name)));
 #else
-               Alert::alert(_("Cannot view file"),
+               Alert::error(_("Cannot view file"),
                             _("No information for viewing ")
                             + prettyName(format_name));
 #endif
@@ -199,9 +201,15 @@ bool Formats::view(Buffer const * buffer, string const & filename,
        int const res = one.startscript(Systemcall::DontWait, command);
 
        if (res) {
-               Alert::alert(_("Cannot view file"),
-                          _("Error while executing"),
-                          command.substr(0, 50));
+#if USE_BOOST_FORMAT
+               Alert::error(_("Cannot view file"),
+                            boost::io::str(boost::format(_("An error occurred whilst running %1$s"))
+                          % command.substr(0, 50)));
+#else
+               Alert::error(_("Cannot view file"),
+                            _("An error occurred whilst running ")
+                            + command.substr(0, 50));
+#endif
                return false;
        }
        return true;
index 5b39e2e5bcfeea29e3a460972a05fea8b237a11f..51e96f9e3c975074ed392b2c834819e02a751c18 100644 (file)
@@ -21,18 +21,6 @@ using std::endl;
 using std::pair;
 using std::make_pair;
 
-void Alert::alert(string const & s1, string const & s2, string const & s3)
-{
-       if (!lyxrc.use_gui) {
-               lyxerr << "------------------------------" << endl
-                      << s1 << endl << s2 << endl << s3 << endl
-                      << "------------------------------" << endl;
-       } else {
-               alert_pimpl(s1, s2, s3);
-       }
-}
-
-
 int Alert::prompt(string const & title, string const & question,
            int default_button,
           string const & b1, string const & b2, string const & b3)
index ead44a879d92026975b35b4190973d0188532937..f49d1d587ce103a9b137b6883dea8758026f26c7 100644 (file)
@@ -33,13 +33,13 @@ int prompt(string const & title, string const & question,
           string const & b1, string const & b2, string const & b3 = string());
 
 /**
- * Display a warning to the user. Title should be a short summary.
+ * Display a warning to the user. Title should be a short (general) summary.
  * Only use this if the user cannot perform some remedial action.
  */
 void warning(string const & title, string const & message);
 
 /**
- * Display a warning to the user. Title should be a short summary.
+ * Display a warning to the user. Title should be a short (general) summary.
  * Only use this if the user cannot perform some remedial action.
  */
 void error(string const & title, string const & message);
@@ -52,10 +52,6 @@ void error(string const & title, string const & message);
  */
 void information(string const & title, string const & message);
 
-/// show an alert message. DO NOT USE !!
-void alert(string const & title, string const & s1 = string(),
-          string const & s2 = string());
-
 /// Asks for a text. DO NOT USE !!
 std::pair<bool, string> const
 askForText(string const & msg,
index f9c587d5875acdfe3b4bb99761d1bbd9efbadf1d..88becb95d647f39ccc6f77896137891f4edff3c5 100644 (file)
@@ -12,8 +12,6 @@
 
 // GUI-specific implementations
 
-void alert_pimpl(string const & s1, string const & s2, string const & s3);
-
 int prompt_pimpl(string const & title, string const & question,
            int default_button,
           string const & b1, string const & b2, string const & b3);
index 6d724c6a04d2bb2c069a17f73fe17539f84a5d3b..660221fc69c7c3175d7d78f19750e71b721a1c45 100644 (file)
@@ -1,3 +1,9 @@
+2003-03-31  John Levon  <levon@movementarian.org>
+
+       * Alert_pimpl.h:
+       * Alert.h:
+       * Alert.C: finally kill alert()
+
 2003-03-30  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * screen.C (drawFromTo): adjust for RowList.
index ab9bda9b0f25e70139b92e7787d6b8488350ae3e..04ccecf118f352eb63e7b80d2431bc754cd18076 100644 (file)
@@ -1,3 +1,8 @@
+2003-03-31  John Levon  <levon@movementarian.org>
+
+       * ControlPrint.C:
+       * ControlDocument.C: more Alert cleanups
+
 2003-03-29  John Levon  <levon@movementarian.org>
 
        * ControlSpellchecker.C: Alert cleanup
index d730f2b7b96a5ca8d01c8aef6e8a43ccdc4c331c..77dc09462fd4291fb8712dcb9ddf73c32f5e3a62 100644 (file)
@@ -121,36 +121,60 @@ void ControlDocument::classApply()
                old_class, new_class,
                &*(lv_.buffer()->paragraphs.begin()),
                lv_.buffer()->params);
-       if (ret) {
-               string s;
-               if (ret == 1) {
-                       s = _("One paragraph couldn't be converted");
-               } else {
+
+       if (!ret)
+               return;
+
+       string s;
 #if USE_BOOST_FORMAT
-                       boost::format fmt(_("%1$s paragraphs couldn't be converted"));
-                       fmt % ret;
-                       s = fmt.str();
+       if (ret == 1) {
+               boost::format fmt(_("One paragraph could not be converted\n"
+                       "into the document class %2$s."));
+               fmt % textclasslist[new_class].name();
+               s = fmt.str();
+       } else {
+               boost::format fmt(_("%1$s paragraphs could not be converted\n"
+                       "into the document class %2$s."));
+               fmt % tostr(ret);
+               fmt % textclasslist[new_class].name();
+               s = fmt.str();
+       }
 #else
-                       s += tostr(ret);
-                       s += _(" paragraphs couldn't be converted");
-#endif
-               }
-               Alert::alert(_("Conversion Errors!"),s,
-                            _("into chosen document class"));
+       if (ret == 1) {
+               s += _("One paragraph could not be converted\n"
+                       "into the document class ");
+               s += textclasslist[new_class].name() + ".";
+       } else {
+               s += tostr(ret);
+               s += _(" paragraphs could not be converted\n"
+                       "into the document class ");
+               s += textclasslist[new_class].name() + ".";
        }
+#endif
+       Alert::warning(_("Class conversion errors"), s);
 }
 
 
 bool ControlDocument::loadTextclass(lyx::textclass_type tc) const
 {
        bool const success = textclasslist[tc].load();
-       if (!success) {
-               // problem changing class
-               // -- warn user (to retain old style)
-               Alert::alert(_("Conversion Errors!"),
-                            _("Errors loading new document class."),
-                            _("Reverting to original document class."));
-       }
+       if (success)
+               return success;
+
+       string s;
+
+#if USE_BOOST_FORMAT
+       boost::format fmt(_("The document could not be converted\n"
+                       "into the document class %1$s."));
+       fmt % textclasslist[tc].name();
+       s = fmt.str();
+#else
+       s += _("The document could not be converted\n"
+              "into the document class ");
+       s += textclasslist[tc].name() + ".";
+#endif
+       Alert::error(_("Could not change class"), s);
+
        return success;
 }
 
index bcc51336dd79a4ae97312442d5290453650f2c97..04128b71c4ba555f0ce2e9329cdb8765a21505b4 100644 (file)
@@ -29,6 +29,7 @@
 #include "support/filetools.h"
 #include "support/path.h"
 #include "support/systemcall.h"
+#include "support/BoostFormat.h"
 
 #include "debug.h" // for lyxerr
 
@@ -81,6 +82,26 @@ string const ControlPrint::Browse(string const & in_name)
 }
 
 
+namespace {
+
+void showPrintError(string const & name)
+{
+#if USE_BOOST_FORMAT
+               boost::format fmt(_("Could not print the document %1$s.\n"
+                       "Check that your printer is set up correctly."));
+               fmt % MakeDisplayPath(name, 50);
+               string str = fmt.str();
+#else
+               string str = _("Could not print the document ");
+               str += MakeDisplayPath(name, 50);
+               str += _(".\nCheck that your printer is set up correctly.");
+#endif
+               Alert::error(_("Print document failed"), str);
+}
+
+}
+
+
 /// print the current buffer
 void ControlPrint::apply()
 {
@@ -142,9 +163,7 @@ void ControlPrint::apply()
        command += converters.dvips_options(buffer()) + ' ';
 
        if (!Exporter::Export(buffer(), "dvi", true)) {
-               Alert::alert(_("Error:"),
-                          _("Unable to print"),
-                          _("Check that your parameters are correct"));
+               showPrintError(buffer()->fileName());
                return;
        }
 
@@ -205,9 +224,6 @@ void ControlPrint::apply()
        lyxerr[Debug::LATEX] << "ControlPrint::apply(): print command = \""
                             << command << '"' << endl;
 
-       if (res != 0) {
-               Alert::alert(_("Error:"),
-                          _("Unable to print"),
-                          _("Check that your parameters are correct"));
-       }
+       if (res != 0)
+               showPrintError(buffer()->fileName());
 }
index 3281e70b30c409fb64769e11a2552a31b722a075..0cebcd0fdcd38aa60d039624b01d377c625bf7fe 100644 (file)
 using std::pair;
 using std::make_pair;
 
-
-void alert_pimpl(string const & s1, string const & s2, string const & s3)
-{
-       QMessageBox::warning(0, "LyX",
-                            toqstr(s1 + '\n' + '\n' + s2 + '\n' + s3));
-}
-
-
 int prompt_pimpl(string const & tit, string const & question,
            int default_button,
           string const & b1, string const & b2, string const & b3)
index f2f46a65674ccb51a1c97d729eb486dde5eb3ac7..31d593e797e373d2b733caa8efbe823af1c904eb 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-31  John Levon  <levon@movementarian.org>
+
+       * Alert_pimpl.C: remove alert()
+
 2003-03-29  John Levon  <levon@movementarian.org>
 
        * QBrowseBox.C: handle transparent pixmaps
index 298b4dfc1a13931f833d3b500113c6403bca2dde..8a7f950fb45c39838eae5bc549e6ce57570fb723 100644 (file)
@@ -25,13 +25,6 @@ using std::pair;
 using std::make_pair;
 using std::endl;
 
-void alert_pimpl(string const & s1, string const & s2, string const & s3)
-{
-       fl_set_resource("flAlert.dismiss.label", _("Dismiss"));
-       fl_show_alert(s1.c_str(), s2.c_str(), s3.c_str(), 0);
-}
-
-
 void warning_pimpl(string const &, string const & message)
 {
        fl_show_messages(message.c_str());
@@ -60,7 +53,6 @@ int prompt_pimpl(string const &, string const & question,
        boost::tie(b1label, b1sc) = parse_shortcut(b1);
        boost::tie(b2label, b2sc) = parse_shortcut(b2);
        boost::tie(b3label, b3sc) = parse_shortcut(b3);
-       lyxerr  << "Parsed " << b1 << " as " << b1label << " and " << b1sc << endl;
 
        if (b3.empty()) {
                fl_set_choices_shortcut(b1sc.c_str(), b2sc.c_str(), "");
index d116238a702447e38ca74959ff4ee54abaab811f..476766919f9804e5f1b717e8512b0a175d1a4552 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-31  John Levon  <levon@movementarian.org>
+
+       * Alert_pimpl.C: remove alert()
+
 2003-03-29  John Levon  <levon@movementarian.org>
 
        * bmtable.c: handle transparent pixels
index d1ffa0537cd44a7e59f43acaa0ea2283a4204010..50601b456c929c2ef92e9ac58631208cff9ef544 100644 (file)
@@ -1,12 +1,13 @@
-/* This file is part of
- * ======================================================
+/**
+ * \file exporter.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
+ * \author unknown
  *
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2001 The LyX Team.
- *
- * ====================================================== */
+ * Full author contact details are available in file CREDITS
+ */
+
 
 #include <config.h>
 
@@ -62,13 +63,14 @@ bool Importer::Import(LyXView * lv, string const & filename,
                }
                if (loader_format.empty()) {
 #if USE_BOOST_FORMAT
-                       Alert::alert(_("Cannot import file"),
-                                    boost::io::str(boost::format(_("No information for importing from %1$s"))
+// FIXME: better english ...
+                       Alert::error(_("Couldn't import file"),
+                                    boost::io::str(boost::format(_("No information for importing the format %1$s."))
                                   % formats.prettyName(format)));
 #else
-                       Alert::alert(_("Cannot import file"),
-                                    _("No information for importing from ")
-                                    + formats.prettyName(format));
+                       Alert::error(_("Couldn't import file"),
+                                    _("No information for importing the format ")
+                                    + formats.prettyName(format) + ".");
 #endif
                        return false;
                }
index fb60c92316d971c4de7a0d5bd70675e7fef625ec..a9f2bd3a59166e030668890a8f1a0ffd8e73c487 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-31  John Levon  <levon@movementarian.org>
+
+       * insettext.C: Alert fix
+
 2003-03-30  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * insettext.C (ascent): adjust for RowList
index 1182ad0ef11cf69f0a5bb05f382a7b990801eaed..834e3c629d4829799807daaf7af7599d8c505af7 100644 (file)
@@ -654,8 +654,16 @@ string const InsetGraphics::prepareFile(Buffer const * buf) const
                                << temp_file
                                << (success ? " succeeded\n" : " failed\n");
                        if (!success) {
-                               Alert::alert(_("Cannot copy file"), orig_file_with_path,
-                                       _("into tempdir"));
+#if USE_BOOST_FORMAT
+                               boost::format fmt(_("Could not copy the file\n%1$s\ninto the temporary directory."));
+                               fmt % orig_file_with_path;
+                               string str = fmt.str();
+#else
+                               string str = _("Could not copy the file\n");
+                               str += orig_file_with_path;
+                               str += _("\ninto the temporary directory.");
+#endif
+                               Alert::error(_("Graphics display failed"), str);
                                return orig_file;
                        }
                }
@@ -689,15 +697,19 @@ string const InsetGraphics::prepareFile(Buffer const * buf) const
                        << command << endl;
                Systemcall one;
                one.startscript(Systemcall::Wait, command);
-               if (!IsFileReadable(ChangeExtension(outfile_base, to)))
+               if (!IsFileReadable(ChangeExtension(outfile_base, to))) {
 #if USE_BOOST_FORMAT
-                       Alert::alert(_("Cannot convert Image (not existing file?)"),
-                                    boost::io::str(boost::format(_("No information for converting from %1$s to %2$s"))
-                               % from % to));
+                       boost::format fmt(_("No information for converting %1$s format files to %1$s.\n"
+                               "Try defining a convertor in the preferences."));
+                       fmt % from % to;
+                       string str = fmt.str();
 #else
-                       Alert::alert(_("Cannot convert Image (not existing file?)"),
-                                    _("No information for converting from ") + from + " to " + to);
+                       string str = _("No information for converting ");
+                       str += from + _(" format files to " + to;
+                       str += ".\nTry defining a convertor in the preferences.");
 #endif
+                       Alert::error(_("Could not convert image"), str);
+               }
        }
 
        return RemoveExtension(temp_file);
index 6a523f2a843a45d36bcd0a7a5cfeac2ee3e1a089..424c707a10dc9510e3994b04dc9364f88b0e431a 100644 (file)
@@ -1290,9 +1290,7 @@ Inset::RESULT InsetText::localDispatch(FuncRequest const & ev)
 #ifdef WITH_WARNINGS
 #warning FIXME horrendously bad UI
 #endif
-                               Alert::alert(_("Impossible operation!"),
-                                                  _("Cannot include more than one paragraph!"),
-                                                  _("Sorry."));
+                               Alert::error(_("Paste failed"), _("Cannot include more than one paragraph."));
                                break;
                        }
                }
index 25b984fd3b1de0d10fdec33306e18cd5fc12d814..248ae2aa9d9d087383bd6eca1115fa9b315eb6e5 100644 (file)
@@ -641,13 +641,14 @@ bool LyX::readRcFile(string const & name)
                                    << " in " << lyxrc_path << endl;
                if (lyxrc.read(lyxrc_path) < 0) {
 #if USE_BOOST_FORMAT
-                       Alert::alert(_("LyX Warning!"),
-                                  boost::io::str(boost::format(_("Error while reading %1$s.")) % lyxrc_path),
-                                  _("Using built-in defaults."));
+                       Alert::warning(_("Could not read preferences"),
+                                  boost::io::str(boost::format(
+                                  _("Error while reading the preferences file\n%1$s.\n"
+                                    "LyX will use the built-in defaults.")) % lyxrc_path));
 #else
-                       Alert::alert(_("LyX Warning!"),
-                                  _("Error while reading ") + lyxrc_path,
-                                  _("Using built-in defaults."));
+                       Alert::warning(_("Could not read preferences"),
+                                  string(_("Error while reading the preferences file\n"))
+                                  + lyxrc_path + _("LyX will use the built-in defaults."));
 #endif
                        return false;
                }