#include "frontends/alert.h"
#include "frontends/Application.h"
-#include "graphics/Previews.h"
-
#include "support/lassert.h"
#include "support/debug.h"
#include "support/environment.h"
/// the parsed command line batch command if any
vector<string> batch_commands;
- ///
- graphics::Previews preview_;
///
SpellChecker * spell_checker_;
///
{
// Minimal setting of locale before parsing command line
try {
- init_package(os::utf8_argv(0), string(), string(),
- top_build_dir_is_one_level_up);
+ init_package(os::utf8_argv(0), string(), string());
+ // we do not get to this point when init_package throws an exception
+ locale_init();
} catch (ExceptionMessage const & message) {
LYXERR(Debug::LOCALE, message.title_ + ", " + message.details_);
}
- // FIXME: This breaks out of source build under Windows.
- locale_init();
// Here we need to parse the command line. At least
// we need to parse for "-dbg" and "-help"
easyParse(argc, argv);
try {
- init_package(os::utf8_argv(0),
- cl_system_support, cl_user_support,
- top_build_dir_is_one_level_up);
+ init_package(os::utf8_argv(0), cl_system_support, cl_user_support);
} catch (ExceptionMessage const & message) {
if (message.type_ == ErrorException) {
Alert::error(message.title_, message.details_);
"hope you have not lost any data.\n"
"Please read the bug-reporting instructions "
"in 'Help->Introduction' and send us a bug report, "
- "if necessary. Thanks !\nBye.");
+ "if necessary. Thanks!\nBye.");
break;
case SIGINT:
case SIGTERM:
"templates");
}
+ // init LyXDir environment variable
+ string const lyx_dir = package().lyx_dir().absFileName();
+ LYXERR(Debug::INIT, "Setting LyXDir... to \"" << lyx_dir << "\"");
+ if (!setEnv("LyXDir", lyx_dir))
+ LYXERR(Debug::INIT, "\t... failed!");
+
//
// Read configuration files
//
prependEnvPath("PATH", package().binary_dir().absFileName());
#endif
if (!lyxrc.path_prefix.empty())
- prependEnvPath("PATH", lyxrc.path_prefix);
+ prependEnvPath("PATH", replaceEnvironmentPath(lyxrc.path_prefix));
// Check that user LyX directory is ok.
if (queryUserLyXDir(package().explicit_user_support()))
os::windows_style_tex_paths(lyxrc.windows_style_tex_paths);
if (!lyxrc.path_prefix.empty())
- prependEnvPath("PATH", lyxrc.path_prefix);
+ prependEnvPath("PATH", replaceEnvironmentPath(lyxrc.path_prefix));
FileName const document_path(lyxrc.document_path);
if (document_path.exists() && document_path.isDirectory())
}
-graphics::Previews & thePreviews()
-{
- LASSERT(singleton_, /**/);
- return singleton_->pimpl_->preview_;
-}
-
-
Session & theSession()
{
LASSERT(singleton_, /**/);