}
+vector<string> LyXModule::prerequisites() const {
+#ifdef TEX2LYX
+ return vector<string>();
+#else
+ if (!checked_)
+ isAvailable();
+ return prerequisites_;
+#endif
+}
+
+
bool LyXModule::isAvailable() const {
#ifdef TEX2LYX
return true;
if (checked_)
return available_;
checked_ = true;
+ available_ = true;
//check whether all of the required packages are available
vector<string>::const_iterator it = package_list_.begin();
vector<string>::const_iterator end = package_list_.end();
for (; it != end; ++it) {
if (!LaTeXFeatures::isAvailable(*it)) {
available_ = false;
- return available_;
+ prerequisites_.push_back(*it);
}
}
- available_ = true;
return available_;
#endif
}
std::string const & catgy);
/// whether the required packages are available
bool isAvailable() const;
+ /// the missing prerequisites, if any
+ std::vector<std::string> prerequisites() const;
///
std::string const & getName() const { return name_; }
///
mutable bool checked_;
///
mutable bool available_;
+ ///
+ mutable std::vector<std::string> prerequisites_;
};
typedef std::vector<LyXModule> LyXModuleList;
continue;
}
if (!lm->isAvailable()) {
+ docstring const prereqs = from_utf8(getStringFromVector(lm->prerequisites(), "\n\t"));
docstring const msg =
- bformat(_("The module %1$s requires a package that is\n"
- "not available in your LaTeX installation, or a converter\n"
- "you have not installed. LaTeX output may not be possible.\n"),
- from_utf8(modName));
+ bformat(_("The module %1$s requires a package that is not\n"
+ "available in your LaTeX installation, or a converter that\n"
+ "you have not installed. LaTeX output may not be possible.\n"
+ "Missing prerequisites:\n"
+ "\t%2$s\n"
+ "See section 3.1.2.3 of the User's Guide for more information."),
+ from_utf8(modName), prereqs);
frontend::Alert::warning(_("Package not available"), msg);
}
FileName layout_file = libFileSearch("layouts", lm->getFilename());