#include <sstream>
using namespace std;
+using namespace lyx::support;
///
template<class Pair>
namespace lyx {
namespace frontend {
-using support::token;
-using support::bformat;
-using support::findToken;
-using support::getVectorFromString;
-
/////////////////////////////////////////////////////////////////////
//
// PreambleModule
void GuiDocument::classChanged()
{
textclass_type const tc = latexModule->classCO->currentIndex();
- bp_.setJustBaseClass(tc);
+ bp_.setBaseClass(tc);
if (lyxrc.auto_reset_options)
bp_.useClassDefaults();
updateContents();
}
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));
}
}
params.graphicsDriver =
tex_graphics[latexModule->psdriverCO->currentIndex()];
+ // text layout
+ params.setBaseClass(latexModule->classCO->currentIndex());
+
// Modules
params.clearLayoutModules();
QStringList const selMods = selectedModel()->stringList();
for (int i = 0; i != selMods.size(); ++i)
params.addLayoutModule(lyx::fromqstr(selMods[i]));
-
if (mathsModule->amsautoCB->isChecked()) {
params.use_amsmath = BufferParams::package_auto;
} else {
params.use_esint = BufferParams::package_off;
}
- // text layout
- params.setJustBaseClass(latexModule->classCO->currentIndex());
-
if (pageLayoutModule->pagestyleCO->currentIndex() == 0)
params.pagestyle = "default";
else {
void GuiDocument::useClassDefaults()
{
- bp_.setJustBaseClass(latexModule->classCO->currentIndex());
+ bp_.setBaseClass(latexModule->classCO->currentIndex());
bp_.useClassDefaults();
updateContents();
}
{
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()];
// Apply the BufferParams. Note that this will set the base class
// and then update the buffer's layout.
- //FIXME Could this be done last? Then, I think, we'd get the automatic
- //update mentioned in the next FIXME...
dispatch_bufferparams(*this, params(), LFUN_BUFFER_PARAMS_APPLY);
// Generate the colours requested by each new branch.