Replace lyxerr based warnings and errors with Alert::error() and Alert::warning().

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16824 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-01-23 13:09:28 +00:00
parent 6d7cd27910
commit a8c862dfe9

View File

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