#include "insets/InsetListingsParams.h"
-//#include "support/debug.h"
#include "support/FileName.h"
#include "support/filetools.h"
#include "support/lstrings.h"
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()),
this, SLOT(change_adaptor()));
connect(marginsModule->footskipUnit, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
+ connect(marginsModule->columnsepLE, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_adaptor()));
+ connect(marginsModule->columnsepUnit, SIGNAL(activated(int)),
+ this, SLOT(change_adaptor()));
marginsModule->topLE->setValidator(unsignedLengthValidator(
marginsModule->topLE));
marginsModule->bottomLE->setValidator(unsignedLengthValidator(
marginsModule->headheightLE));
marginsModule->footskipLE->setValidator(unsignedLengthValidator(
marginsModule->footskipLE));
+ marginsModule->columnsepLE->setValidator(unsignedLengthValidator(
+ marginsModule->columnsepLE));
bc().addCheckedLineEdit(marginsModule->topLE,
marginsModule->topL);
marginsModule->headheightL);
bc().addCheckedLineEdit(marginsModule->footskipLE,
marginsModule->footskipL);
+ bc().addCheckedLineEdit(marginsModule->columnsepLE,
+ marginsModule->columnsepL);
langModule = new UiWidget<Ui::LanguageUi>;
}
-void GuiDocument::closeEvent(QCloseEvent * e)
-{
- slotClose();
- e->accept();
-}
-
-
void GuiDocument::setLSpacing(int item)
{
textLayoutModule->lspacingLE->setEnabled(item == 3);
}
+void GuiDocument::setColSep()
+{
+ setCustomMargins(marginsModule->marginCB->checkState() == Qt::Checked);
+}
+
+
void GuiDocument::setCustomMargins(bool custom)
{
marginsModule->topL->setEnabled(!custom);
marginsModule->footskipL->setEnabled(!custom);
marginsModule->footskipLE->setEnabled(!custom);
marginsModule->footskipUnit->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::classChanged()
{
- textclass_type const tc = latexModule->classCO->currentIndex();
+ TextClassIndex const tc = latexModule->classCO->currentIndex();
bp_.setBaseClass(tc);
if (lyxrc.auto_reset_options) {
if (applyPB->isEnabled()) {
namespace {
- //This is an insanely complicated attempt to make this sort of thing
- //work with RTL languages.
+ // This is an insanely complicated attempt to make this sort of thing
+ // work with RTL languages.
docstring formatStrVec(vector<string> const & v, docstring const & s)
{
//this mess formats the list as "v[0], v[1], ..., [s] v[n]"
void GuiDocument::updateNumbering()
{
- TextClass const & tclass = bp_.getTextClass();
+ TextClass const & tclass = bp_.textClass();
numberingModule->tocTW->setUpdatesEnabled(false);
numberingModule->tocTW->clear();
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();
}
params.headheight = widgetsToLength(m->headheightLE, m->headheightUnit);
params.headsep = widgetsToLength(m->headsepLE, m->headsepUnit);
params.footskip = widgetsToLength(m->footskipLE, m->footskipUnit);
+ params.columnsep = widgetsToLength(m->columnsepLE, m->columnsepUnit);
branchesModule->apply(params);
}
// text layout
- latexModule->classCO->setCurrentIndex(params.getBaseClass());
+ latexModule->classCO->setCurrentIndex(params.baseClass());
updatePagestyle(textClass().opt_pagestyle(),
params.pagestyle);
lengthToWidgets(m->footskipLE, m->footskipUnit,
params.footskip, defaultUnit);
+ lengthToWidgets(m->columnsepLE, m->columnsepUnit,
+ params.columnsep, defaultUnit);
+
branchesModule->update(params);
// PDF support
bool GuiDocument::isValid()
{
- return validate_listings_params().empty();
+ return (validate_listings_params().empty() &&
+ (textLayoutModule->skipCO->currentIndex() != 3 ||
+ !textLayoutModule->skipLE->text().isEmpty()));
}
TextClass const & GuiDocument::textClass() const
{
- return textclasslist[bp_.getBaseClass()];
+ return textclasslist[bp_.baseClass()];
}