namespace {
- vector<string> getRequiredList(string const & modName)
- {
- LyXModule const * const mod = moduleList[modName];
- if (!mod)
- return vector<string>(); //empty such thing
- return mod->getRequiredModules();
- }
+vector<string> getRequiredList(string const & modName)
+{
+ LyXModule const * const mod = moduleList[modName];
+ if (!mod)
+ return vector<string>(); //empty such thing
+ return mod->getRequiredModules();
+}
- vector<string> getExcludedList(string const & modName)
- {
- LyXModule const * const mod = moduleList[modName];
- if (!mod)
- return vector<string>(); //empty such thing
- return mod->getExcludedModules();
- }
+vector<string> getExcludedList(string const & modName)
+{
+ LyXModule const * const mod = moduleList[modName];
+ if (!mod)
+ return vector<string>(); //empty such thing
+ return mod->getExcludedModules();
+}
- docstring getModuleDescription(string const & modName)
- {
- LyXModule const * const mod = moduleList[modName];
- if (!mod)
- return _("Module not found!");
- return _(mod->getDescription());
- }
+docstring getModuleDescription(string const & modName)
+{
+ LyXModule const * const mod = moduleList[modName];
+ if (!mod)
+ return _("Module not found!");
+ return _(mod->getDescription());
+}
- vector<string> getPackageList(string const & modName)
- {
- LyXModule const * const mod = moduleList[modName];
- if (!mod)
- return vector<string>(); //empty such thing
- return mod->getPackageList();
- }
+vector<string> getPackageList(string const & modName)
+{
+ LyXModule const * const mod = moduleList[modName];
+ if (!mod)
+ return vector<string>(); //empty such thing
+ return mod->getPackageList();
+}
- bool isModuleAvailable(string const & modName)
- {
- LyXModule * mod = moduleList[modName];
- if (!mod)
- return false;
- return mod->isAvailable();
- }
-} //anonymous namespace
+bool isModuleAvailable(string const & modName)
+{
+ LyXModule * mod = moduleList[modName];
+ if (!mod)
+ return false;
+ return mod->isAvailable();
+}
+
+} // anonymous namespace
+
+
+/////////////////////////////////////////////////////////////////////
+//
+// ModuleSelectionManager
+//
+/////////////////////////////////////////////////////////////////////
-ModuleSelMan::ModuleSelMan(
+ModuleSelectionManager::ModuleSelectionManager(
QListView * availableLV,
QListView * selectedLV,
QPushButton * addPB,
{}
-void ModuleSelMan::updateAddPB()
+void ModuleSelectionManager::updateAddPB()
{
int const arows = availableModel->rowCount();
QModelIndexList const availSels =
}
-void ModuleSelMan::updateDownPB()
+void ModuleSelectionManager::updateDownPB()
{
int const srows = selectedModel->rowCount();
if (srows == 0) {
find(reqs.begin(), reqs.end(), curModName) == reqs.end());
}
-void ModuleSelMan::updateUpPB()
+void ModuleSelectionManager::updateUpPB()
{
int const srows = selectedModel->rowCount();
if (srows == 0) {
upPB->setEnabled(find(reqs.begin(), reqs.end(), preModName) == reqs.end());
}
-void ModuleSelMan::updateDelPB()
+void ModuleSelectionManager::updateDelPB()
{
int const srows = selectedModel->rowCount();
if (srows == 0) {
//
/////////////////////////////////////////////////////////////////////
-PreambleModule::PreambleModule(): current_id_(0)
+PreambleModule::PreambleModule() : current_id_(0)
{
// This is not a memory leak. The object will be destroyed
// with this.
connect(textLayoutModule->bypassCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(textLayoutModule->bypassCB, SIGNAL(clicked()),
- this, SLOT(set_listings_msg()));
+ this, SLOT(setListingsMessage()));
connect(textLayoutModule->listingsED, SIGNAL(textChanged()),
- this, SLOT(set_listings_msg()));
+ this, SLOT(setListingsMessage()));
textLayoutModule->listingsTB->setPlainText(
qt_("Input listings parameters on the right. Enter ? for a list of parameters."));
textLayoutModule->lspacingLE->setValidator(new QDoubleValidator(
this, SLOT(browseMaster()));
selectionManager =
- new ModuleSelMan(latexModule->availableLV, latexModule->selectedLV,
+ new ModuleSelectionManager(latexModule->availableLV,
+ latexModule->selectedLV,
latexModule->addPB, latexModule->deletePB,
latexModule->upPB, latexModule->downPB,
availableModel(), selectedModel());
}
-docstring GuiDocument::validate_listings_params()
+QString GuiDocument::validateListingsParameters()
{
// use a cache here to avoid repeated validation
// of the same parameters
- static string param_cache = string();
- static docstring msg_cache = docstring();
+ static string param_cache;
+ static QString msg_cache;
if (textLayoutModule->bypassCB->isChecked())
- return docstring();
+ return QString();
string params = fromqstr(textLayoutModule->listingsED->toPlainText());
if (params != param_cache) {
param_cache = params;
- msg_cache = InsetListingsParams(params).validate();
+ msg_cache = toqstr(InsetListingsParams(params).validate());
}
return msg_cache;
}
-void GuiDocument::set_listings_msg()
+void GuiDocument::setListingsMessage()
{
static bool isOK = true;
- docstring msg = validate_listings_params();
- if (msg.empty()) {
+ QString msg = validateListingsParameters();
+ if (msg.isEmpty()) {
if (isOK)
return;
isOK = true;
// listingsTB->setTextColor("black");
textLayoutModule->listingsTB->setPlainText(
- qt_("Input listings parameters on the right. Enter ? for a list of parameters."));
+ qt_("Input listings parameters on the right. "
+ "Enter ? for a list of parameters."));
} else {
isOK = false;
// listingsTB->setTextColor("red");
- textLayoutModule->listingsTB->setPlainText(toqstr(msg));
+ textLayoutModule->listingsTB->setPlainText(msg);
}
}
}
// bullets
- params.user_defined_bullet(0) = bulletsModule->getBullet(0);
- params.user_defined_bullet(1) = bulletsModule->getBullet(1);
- params.user_defined_bullet(2) = bulletsModule->getBullet(2);
- params.user_defined_bullet(3) = bulletsModule->getBullet(3);
+ params.user_defined_bullet(0) = bulletsModule->bullet(0);
+ params.user_defined_bullet(1) = bulletsModule->bullet(1);
+ params.user_defined_bullet(2) = bulletsModule->bullet(2);
+ params.user_defined_bullet(3) = bulletsModule->bullet(3);
// packages
params.graphicsDriver =
bool GuiDocument::isValid()
{
- return validate_listings_params().empty()
+ return validateListingsParameters().isEmpty()
&& (textLayoutModule->skipCO->currentIndex() != 3
|| !textLayoutModule->skipLE->text().isEmpty());
}