endl;
continue;
}
+ if (!lm->isAvailable()) {
+ docstring const msg =
+ bformat(_("The module %1$s requires a package that is\n"
+ "not available in your LaTeX installation. LaTeX output\n"
+ "may not be possible.\n"), from_utf8(modName));
+ frontend::Alert::warning(_("Package not available"), msg);
+ }
FileName layout_file = libFileSearch("layouts", lm->filename);
textClass_->read(layout_file, TextClass::MODULE);
}
}
pkgdesc += pkgList[i];
}
- if (!pkgdesc.empty())
- desc += " Requires " + pkgdesc + ".";
+ if (!pkgdesc.empty()) {
+ if (!desc.empty())
+ desc += " ";
+ desc += ("Requires " + pkgdesc + ".");
+ }
+ if (!isModuleAvailable(modName)) {
+ if (!desc.empty())
+ desc += "\n";
+ desc += "WARNING: Some packages are unavailable!";
+ }
latexModule->infoML->document()->setPlainText(toqstr(desc));
}
}
{
LyXModule const * const mod = moduleList[modName];
if (!mod)
- return string("Module unavailable!");
+ return string("Module not found!");
return mod->description;
}
-vector<string>
-GuiDocument::getPackageList(string const & modName) const
+vector<string> GuiDocument::getPackageList(string const & modName) const
{
LyXModule const * const mod = moduleList[modName];
if (!mod)
}
+bool GuiDocument::isModuleAvailable(string const & modName) const
+{
+ LyXModule * mod = moduleList[modName];
+ return mod->isAvailable();
+}
+
+
TextClass const & GuiDocument::textClass() const
{
return textclasslist[bp_.getBaseClass()];
///
std::vector<std::string> getPackageList(std::string const & modName) const;
///
+ bool isModuleAvailable(std::string const & modName) const;
+ ///
void setLanguage() const;
///
void saveAsDefault() const;