this, SLOT(change_adaptor()));
connect(textLayoutModule->lspacingCO, SIGNAL(activated(int)),
this, SLOT(setLSpacing(int)));
- connect(textLayoutModule->lspacingLE, SIGNAL(textChanged(const QString&)),
+ connect(textLayoutModule->lspacingLE, SIGNAL(textChanged(const QString &)),
this, SLOT(change_adaptor()));
connect(textLayoutModule->skipRB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
this, SLOT(enableSkip(bool)));
connect(textLayoutModule->twoColumnCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
+ connect(textLayoutModule->twoColumnCB, SIGNAL(clicked()),
+ this, SLOT(setColSep()));
connect(textLayoutModule->listingsED, SIGNAL(textChanged()),
this, SLOT(change_adaptor()));
connect(textLayoutModule->bypassCB, SIGNAL(clicked()),
}
+void GuiDocument::setColSep()
+{
+ setCustomMargins(marginsModule->marginCB->checkState() == Qt::Checked);
+}
+
+
void GuiDocument::setCustomMargins(bool custom)
{
marginsModule->topL->setEnabled(!custom);
marginsModule->footskipLE->setEnabled(!custom);
marginsModule->footskipUnit->setEnabled(!custom);
- marginsModule->columnsepL->setEnabled(!custom);
- marginsModule->columnsepLE->setEnabled(!custom);
- marginsModule->columnsepUnit->setEnabled(!custom);
+ bool const enableColSep = !custom &&
+ textLayoutModule->twoColumnCB->checkState() == Qt::Checked;
+ marginsModule->columnsepL->setEnabled(enableColSep);
+ marginsModule->columnsepLE->setEnabled(enableColSep);
+ marginsModule->columnsepUnit->setEnabled(enableColSep);
}
void GuiDocument::updateNumbering()
{
- TextClass const & tclass = bp_.getTextClass();
+ TextClass const & tclass = bp_.textClass();
numberingModule->tocTW->setUpdatesEnabled(false);
numberingModule->tocTW->clear();
int const toc = numberingModule->tocSL->value();
QString const no = qt_("No");
QString const yes = qt_("Yes");
- TextClass::const_iterator end = tclass.end();
- TextClass::const_iterator cit = tclass.begin();
QTreeWidgetItem * item = 0;
- for ( ; cit != end ; ++cit) {
- int const toclevel = (*cit)->toclevel;
- if (toclevel != Layout::NOT_IN_TOC
- && (*cit)->labeltype == LABEL_COUNTER) {
+ for (size_t i = 0; i != tclass.layoutCount(); ++i) {
+ Layout const & lt = *tclass.layout(i);
+ int const toclevel = lt.toclevel;
+ if (toclevel != Layout::NOT_IN_TOC && lt.labeltype == LABEL_COUNTER) {
item = new QTreeWidgetItem(numberingModule->tocTW);
- item->setText(0, toqstr(translateIfPossible((*cit)->name())));
+ item->setText(0, toqstr(translateIfPossible(lt.name())));
item->setText(1, (toclevel <= depth) ? yes : no);
item->setText(2, (toclevel <= toc) ? yes : no);
}
params.language = lyx::languages.getLanguage(lang_[pos]);
// numbering
- if (params.getTextClass().hasTocLevels()) {
+ if (params.textClass().hasTocLevels()) {
params.tocdepth = numberingModule->tocSL->value();
params.secnumdepth = numberingModule->depthSL->value();
}
}
// text layout
- latexModule->classCO->setCurrentIndex(params.getBaseClass());
+ latexModule->classCO->setCurrentIndex(params.baseClass());
updatePagestyle(textClass().opt_pagestyle(),
params.pagestyle);
TextClass const & GuiDocument::textClass() const
{
- return textclasslist[bp_.getBaseClass()];
+ return textclasslist[bp_.baseClass()];
}