X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2FPackage.h;h=4e5c6fa3f46e78f11ba64ab80ca0304ae5e017bf;hb=10b4a4718539ea45d908dc3d051ae2284f9678e6;hp=94e191ca576482b7e45d1db4da0c17e5758c2502;hpb=dd64477e3b32903f7663f2f1ec02f12ade1c0dec;p=lyx.git diff --git a/src/support/Package.h b/src/support/Package.h index 94e191ca57..4e5c6fa3f4 100644 --- a/src/support/Package.h +++ b/src/support/Package.h @@ -25,14 +25,6 @@ namespace support { class Package; -/** When run in-place /src/lyx is one level up from - * the whilst /src/tex2lyx/tex2lyx is - * two levels up. - */ -enum exe_build_dir_to_top_build_dir { - top_build_dir_is_one_level_up, - top_build_dir_is_two_levels_up -}; /** Initialise package() with the command line data. @@ -49,10 +41,7 @@ enum exe_build_dir_to_top_build_dir { */ void init_package(std::string const & command_line_arg0, std::string const & command_line_system_support_dir, - std::string const & command_line_user_support_dir, - exe_build_dir_to_top_build_dir); - -bool packageInitialized(); + std::string const & command_line_user_support_dir); /** Accessor to the global data. * Asserts that init_package() has been called first. @@ -62,15 +51,14 @@ Package const & package(); class Package { public: /// Default constructor does not lead to the paths being set. - Package() {} + Package() : explicit_user_support_dir_(false), in_build_dir_(false) {} /** Called by init_package, above. * All paths will be initialized. */ Package(std::string const & command_line_arg0, std::string const & command_line_system_support_dir, - std::string const & command_line_user_support_dir, - exe_build_dir_to_top_build_dir); + std::string const & command_line_user_support_dir); /** The directory containing the main executable (LyX or tex2lyx). */ @@ -113,6 +101,12 @@ public: */ FileName const & locale_dir() const { return locale_dir_; } + /** The file name that should contain the message file (.mo) + * for language code \param c. Does not check whether the + * file exists. Handles running in place. + */ + FileName messages_file(std::string const & c) const; + /** The default document directory. * Can be reset by LyXRC. */ @@ -140,11 +134,11 @@ public: */ static FileName const & get_home_dir(); - /** Command to run the configure script. - * Caution: This is "ready-to-run", i.e. in the locale encoding, not - * utf8. - */ - std::string const & configure_command() const { return configure_command_; } + /// Run configure.py + int reconfigureUserLyXDir(std::string const & option) const; + + /// + std::string getConfigureLockName() const; private: FileName binary_dir_; @@ -157,8 +151,13 @@ private: mutable FileName document_dir_; mutable FileName temp_dir_; FileName system_temp_dir_; - std::string configure_command_; + /** Command to run the configure script. + * Caution: This is "ready-to-run", i.e. in the locale encoding, not + * utf8. + */ + mutable std::string configure_command_; bool explicit_user_support_dir_; + bool in_build_dir_; }; } // namespace support