]> git.lyx.org Git - features.git/commitdiff
Replace lyxerr based warnings and errors with Alert::error() and Alert::warning().
authorAbdelrazak Younes <younes@lyx.org>
Tue, 23 Jan 2007 13:09:28 +0000 (13:09 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Tue, 23 Jan 2007 13:09:28 +0000 (13:09 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16824 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/package.C.in

index 6edd7abde4470c8869571460440e1306c5780093..031d71cab9edc458d74ef8aa330645743b51766a 100644 (file)
@@ -19,6 +19,8 @@
 #include "debug.h"
 #include "gettext.h"
 
+#include "frontends/Alert.h"
+
 #include "support/environment.h"
 #include "support/filetools.h"
 #include "support/lstrings.h"
@@ -440,10 +442,9 @@ string const abs_path_from_binary_name(string const & exe)
        string const abs_binary = get_binary_path(exe);
        if (abs_binary.empty()) {
                // FIXME UNICODE
-               lyxerr << lyx::to_utf8(bformat(_("Unable to determine the path to the "
-                                                "LyX binary from the command line %1$s"),
-                                                lyx::from_utf8(exe)))
-                      << std::endl;
+               frontend::Alert::error(_("LyX binary not found"), bformat(
+                       _("Unable to determine the path to the LyX binary from the command line %1$s"),
+                       lyx::from_utf8(exe)));
                bail_out();
        }
        return abs_binary;
@@ -562,15 +563,15 @@ get_system_support_dir(string const & abs_binary,
        }
 
        // FIXME UNICODE
-       lyxerr << lyx::to_utf8(bformat(_("Unable to determine the system directory "
+       frontend::Alert::error(_("No system directory"),
+               bformat(_("Unable to determine the system directory "
                                         "having searched\n"
                                         "\t%1$s\n"
                                         "Use the '-sysdir' command line parameter or "
                                         "set the environment variable LYX_DIR_15x to "
                                         "the LyX system directory containing the file "
                                         "`chkconfig.ltx'."),
-                         lyx::from_utf8(searched_dirs_str)))
-              << std::endl;
+                         lyx::from_utf8(searched_dirs_str)));
 
        bail_out();
        // Keep the compiler happy.
@@ -648,11 +649,10 @@ bool check_command_line_dir(string const & dir,
        FileName const abs_path = fileSearch(dir, file);
        if (abs_path.empty()) {
                // FIXME UNICODE
-               lyxerr << lyx::to_utf8(bformat(_("Invalid %1$s switch.\n"
-                                                "Directory %2$s does not contain %3$s."),
-                                 lyx::from_utf8(command_line_switch), lyx::from_utf8(dir),
-                                 lyx::from_utf8(file)))
-                      << std::endl;
+               frontend::Alert::warning(_("File not found"), bformat(
+                       _("Invalid %1$s switch.\nDirectory %2$s does not contain %3$s."),
+                       lyx::from_utf8(command_line_switch), lyx::from_utf8(dir),
+                       lyx::from_utf8(file)));
        }
 
        return !abs_path.empty();
@@ -676,10 +676,11 @@ bool check_env_var_dir(string const & dir,
        FileName const abs_path = fileSearch(dir, file);
        if (abs_path.empty()) {
                // FIXME UNICODE
-               lyxerr << lyx::to_utf8(bformat(_("Invalid %1$s environment variable.\n"
-                                                "Directory %2$s does not contain %3$s."),
-                                 lyx::from_utf8(env_var), lyx::from_utf8(dir), lyx::from_utf8(file)))
-                      << std::endl;
+               frontend::Alert::warning(_("File not found"), bformat(
+                       _("Invalid %1$s environment variable.\n"
+                               "Directory %2$s does not contain %3$s."),
+                       lyx::from_utf8(env_var), lyx::from_utf8(dir),
+                       lyx::from_utf8(file)));
        }
 
        return !abs_path.empty();
@@ -703,8 +704,8 @@ bool check_env_var_dir(string const & dir,
                docstring const fmt =
                        _("Invalid %1$s environment variable.\n%2$s is not a directory.");
 
-               lyxerr << lyx::to_utf8(bformat(fmt, lyx::from_utf8(env_var), lyx::from_utf8(dir)))
-                      << std::endl;
+               frontend::Alert::warning(_("Directory not found"), bformat(
+                       fmt, lyx::from_utf8(env_var), lyx::from_utf8(dir)));
        }
 
        return success;