#include "FloatPlacement.h"
#include "Format.h"
#include "FuncRequest.h"
-#include "HSpace.h"
#include "IndicesList.h"
#include "Language.h"
#include "LaTeXFeatures.h"
#include "OutputParams.h"
#include "PDFOptions.h"
#include "qt_helpers.h"
+#include "Session.h"
#include "Spacing.h"
#include "TextClass.h"
#include "Undo.h"
#include "frontends/alert.h"
#include <QAbstractItemModel>
-#include <QHeaderView>
+#include <QButtonGroup>
#include <QColor>
#include <QColorDialog>
#include <QCloseEvent>
#include <QFontDatabase>
+#include <QHeaderView>
#include <QScrollBar>
#include <QTextBoundaryFinder>
#include <QTextCursor>
};
+char const * lst_packages[] =
+{
+ "Listings", "Minted", ""
+};
+
+
vector<string> engine_types_;
vector<pair<string, QString> > pagestyles;
}
};
-}
+} // namespace
namespace frontend {
namespace {
{
public:
///
- ModuleSelectionManager(
- QTreeView * availableLV,
- QListView * selectedLV,
- QPushButton * addPB,
- QPushButton * delPB,
- QPushButton * upPB,
- QPushButton * downPB,
- GuiIdListModel * availableModel,
- GuiIdListModel * selectedModel,
- GuiDocument const * container)
- : GuiSelectionManager(availableLV, selectedLV, addPB, delPB,
- upPB, downPB, availableModel, selectedModel), container_(container)
+ ModuleSelectionManager(QObject * parent,
+ QTreeView * availableLV,
+ QListView * selectedLV,
+ QPushButton * addPB,
+ QPushButton * delPB,
+ QPushButton * upPB,
+ QPushButton * downPB,
+ GuiIdListModel * availableModel,
+ GuiIdListModel * selectedModel,
+ GuiDocument const * container)
+ : GuiSelectionManager(parent, availableLV, selectedLV, addPB, delPB,
+ upPB, downPB, availableModel, selectedModel),
+ container_(container)
{}
///
void updateProvidedModules(LayoutModuleList const & pm)
//
/////////////////////////////////////////////////////////////////////
-PreambleModule::PreambleModule() : current_id_(0)
+PreambleModule::PreambleModule(QWidget * parent)
+ : UiWidget<Ui::PreambleUi>(parent), current_id_(0)
{
// This is not a memory leak. The object will be destroyed
// with this.
/////////////////////////////////////////////////////////////////////
-LocalLayout::LocalLayout() : current_id_(0), validated_(false)
+LocalLayout::LocalLayout(QWidget * parent)
+ : UiWidget<Ui::LocalLayoutUi>(parent), current_id_(0), validated_(false)
{
connect(locallayoutTE, SIGNAL(textChanged()), this, SLOT(textChanged()));
connect(validatePB, SIGNAL(clicked()), this, SLOT(validatePressed()));
GuiDocument::GuiDocument(GuiView & lv)
: GuiDialog(lv, "document", qt_("Document Settings")),
- biblioChanged_(false), nonModuleChanged_(false)
+ biblioChanged_(false), nonModuleChanged_(false),
+ modulesChanged_(false), shellescapeChanged_(false)
{
setupUi(this);
// text layout
- textLayoutModule = new UiWidget<Ui::TextLayoutUi>;
+ textLayoutModule = new UiWidget<Ui::TextLayoutUi>(this);
connect(textLayoutModule->lspacingCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(textLayoutModule->lspacingCO, SIGNAL(activated(int)),
// master/child handling
- masterChildModule = new UiWidget<Ui::MasterChildUi>;
+ masterChildModule = new UiWidget<Ui::MasterChildUi>(this);
connect(masterChildModule->childrenTW, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)),
this, SLOT(includeonlyClicked(QTreeWidgetItem *, int)));
// Formats
- outputModule = new UiWidget<Ui::OutputUi>;
+ outputModule = new UiWidget<Ui::OutputUi>(this);
connect(outputModule->defaultFormatCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(outputModule->mathoutCB, SIGNAL(currentIndexChanged(int)),
this, SLOT(change_adaptor()));
+ connect(outputModule->shellescapeCB, SIGNAL(stateChanged(int)),
+ this, SLOT(shellescapeChanged()));
connect(outputModule->outputsyncCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(outputModule->synccustomCB, SIGNAL(editTextChanged(QString)),
this, SLOT(change_adaptor()));
// fonts
- fontModule = new FontModule;
+ fontModule = new FontModule(this);
connect(fontModule->osFontsCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(fontModule->osFontsCB, SIGNAL(toggled(bool)),
this, SLOT(change_adaptor()));
connect(fontModule->microtypeCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
+ connect(fontModule->dashesCB, SIGNAL(clicked()),
+ this, SLOT(change_adaptor()));
connect(fontModule->scaleSansSB, SIGNAL(valueChanged(int)),
this, SLOT(change_adaptor()));
connect(fontModule->scaleTypewriterSB, SIGNAL(valueChanged(int)),
// page layout
- pageLayoutModule = new UiWidget<Ui::PageLayoutUi>;
+ pageLayoutModule = new UiWidget<Ui::PageLayoutUi>(this);
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)),
this, SLOT(papersizeChanged(int)));
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)),
// margins
- marginsModule = new UiWidget<Ui::MarginsUi>;
+ marginsModule = new UiWidget<Ui::MarginsUi>(this);
connect(marginsModule->marginCB, SIGNAL(toggled(bool)),
this, SLOT(setCustomMargins(bool)));
connect(marginsModule->marginCB, SIGNAL(clicked()),
// language & quote
- langModule = new UiWidget<Ui::LanguageUi>;
+ langModule = new UiWidget<Ui::LanguageUi>(this);
connect(langModule->languageCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(langModule->languageCO, SIGNAL(activated(int)),
// Always put the default encoding in the first position.
langModule->encodingCO->addItem(qt_("Language Default (no inputenc)"));
QStringList encodinglist;
- Encodings::const_iterator it = encodings.begin();
- Encodings::const_iterator const end = encodings.end();
- for (; it != end; ++it)
- if (!it->unsafe())
- encodinglist.append(qt_(it->guiName()));
+ for (auto const & encvar : encodings) {
+ if (!encvar.unsafe() && !encvar.guiName().empty())
+ encodinglist.append(qt_(encvar.guiName()));
+ }
encodinglist.sort();
langModule->encodingCO->addItems(encodinglist);
// color
- colorModule = new UiWidget<Ui::ColorUi>;
+ colorModule = new UiWidget<Ui::ColorUi>(this);
connect(colorModule->fontColorPB, SIGNAL(clicked()),
this, SLOT(changeFontColor()));
connect(colorModule->delFontColorTB, SIGNAL(clicked()),
// numbering
- numberingModule = new UiWidget<Ui::NumberingUi>;
+ numberingModule = new UiWidget<Ui::NumberingUi>(this);
connect(numberingModule->depthSL, SIGNAL(valueChanged(int)),
this, SLOT(change_adaptor()));
connect(numberingModule->tocSL, SIGNAL(valueChanged(int)),
setSectionResizeMode(numberingModule->tocTW->header(), QHeaderView::ResizeToContents);
// biblio
- biblioModule = new UiWidget<Ui::BiblioUi>;
+ biblioModule = new UiWidget<Ui::BiblioUi>(this);
connect(biblioModule->citeEngineCO, SIGNAL(activated(int)),
this, SLOT(citeEngineChanged(int)));
connect(biblioModule->citeStyleCO, SIGNAL(activated(int)),
this, SLOT(updateResetDefaultBiblio()));
connect(biblioModule->biblatexBbxCO, SIGNAL(activated(int)),
this, SLOT(biblioChanged()));
+ connect(biblioModule->biblatexBbxCO, SIGNAL(editTextChanged(QString)),
+ this, SLOT(biblioChanged()));
connect(biblioModule->biblatexBbxCO, SIGNAL(editTextChanged(QString)),
this, SLOT(updateResetDefaultBiblio()));
connect(biblioModule->biblatexCbxCO, SIGNAL(activated(int)),
this, SLOT(biblioChanged()));
+ connect(biblioModule->biblatexCbxCO, SIGNAL(editTextChanged(QString)),
+ this, SLOT(biblioChanged()));
connect(biblioModule->biblatexCbxCO, SIGNAL(editTextChanged(QString)),
this, SLOT(updateResetDefaultBiblio()));
connect(biblioModule->rescanBibliosPB, SIGNAL(clicked()),
biblioModule->bibtexOptionsLE));
biblioModule->defaultBiblioCO->lineEdit()->setValidator(new NoNewLineValidator(
biblioModule->defaultBiblioCO->lineEdit()));
+ biblioModule->citePackageOptionsLE->setValidator(new NoNewLineValidator(
+ biblioModule->citePackageOptionsLE));
// NOTE: we do not provide "custom" here for security reasons!
biblioModule->bibtexCO->clear();
// maths
- mathsModule = new UiWidget<Ui::MathsUi>;
+ mathsModule = new UiWidget<Ui::MathsUi>(this);
QStringList headers;
headers << qt_("Package") << qt_("Load automatically")
<< qt_("Load always") << qt_("Do not load");
this, SLOT(change_adaptor()));
connect(mathsModule->allPackagesNotPB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
+ connect(mathsModule->MathNumberingPosCO, SIGNAL(activated(int)),
+ this, SLOT(change_adaptor()));
+
+ connect(mathsModule->MathIndentCB, SIGNAL(toggled(bool)),
+ this, SLOT(change_adaptor()));
+ connect(mathsModule->MathIndentCB, SIGNAL(toggled(bool)),
+ this, SLOT(allowMathIndent()));
+ connect(mathsModule->MathIndentCO, SIGNAL(activated(int)),
+ this, SLOT(change_adaptor()));
+ connect(mathsModule->MathIndentCO, SIGNAL(activated(int)),
+ this, SLOT(enableMathIndent(int)));
+ connect(mathsModule->MathIndentLE, SIGNAL(textChanged(const QString &)),
+ this, SLOT(change_adaptor()));
+ connect(mathsModule->MathIndentLengthCO, SIGNAL(activated(int)),
+ this, SLOT(change_adaptor()));
+
+
+ mathsModule->MathIndentCO->addItem(qt_("Default"));
+ mathsModule->MathIndentCO->addItem(qt_("Custom"));
+ mathsModule->MathIndentLE->setValidator(new LengthValidator(
+ mathsModule->MathIndentLE));
+ // initialize the length validator
+ bc().addCheckedLineEdit(mathsModule->MathIndentLE);
+ mathsModule->MathNumberingPosCO->addItem(qt_("Left"));
+ mathsModule->MathNumberingPosCO->addItem(qt_("Default"));
+ mathsModule->MathNumberingPosCO->addItem(qt_("Right"));
+ mathsModule->MathNumberingPosCO->setCurrentIndex(1);
// latex class
- latexModule = new UiWidget<Ui::LaTeXUi>;
+ latexModule = new UiWidget<Ui::LaTeXUi>(this);
connect(latexModule->optionsLE, SIGNAL(textChanged(QString)),
this, SLOT(change_adaptor()));
connect(latexModule->defaultOptionsCB, SIGNAL(clicked()),
// branches
- branchesModule = new GuiBranches;
+ branchesModule = new GuiBranches(this);
connect(branchesModule, SIGNAL(changed()),
this, SLOT(change_adaptor()));
connect(branchesModule, SIGNAL(renameBranches(docstring const &, docstring const &)),
// preamble
- preambleModule = new PreambleModule;
+ preambleModule = new PreambleModule(this);
connect(preambleModule, SIGNAL(changed()),
this, SLOT(change_adaptor()));
- localLayout = new LocalLayout;
+ localLayout = new LocalLayout(this);
connect(localLayout, SIGNAL(changed()),
this, SLOT(change_adaptor()));
// bullets
- bulletsModule = new BulletsModule;
+ bulletsModule = new BulletsModule(this);
connect(bulletsModule, SIGNAL(changed()),
this, SLOT(change_adaptor()));
// Modules
- modulesModule = new UiWidget<Ui::ModulesUi>;
+ modulesModule = new UiWidget<Ui::ModulesUi>(this);
modulesModule->availableLV->header()->setVisible(false);
setSectionResizeMode(modulesModule->availableLV->header(), QHeaderView::ResizeToContents);
modulesModule->availableLV->header()->setStretchLastSection(false);
selectionManager =
- new ModuleSelectionManager(modulesModule->availableLV,
- modulesModule->selectedLV,
- modulesModule->addPB, modulesModule->deletePB,
- modulesModule->upPB, modulesModule->downPB,
- availableModel(), selectedModel(), this);
+ new ModuleSelectionManager(this, modulesModule->availableLV,
+ modulesModule->selectedLV,
+ modulesModule->addPB,
+ modulesModule->deletePB,
+ modulesModule->upPB,
+ modulesModule->downPB,
+ availableModel(), selectedModel(), this);
connect(selectionManager, SIGNAL(updateHook()),
this, SLOT(updateModuleInfo()));
connect(selectionManager, SIGNAL(selectionChanged()),
// PDF support
- pdfSupportModule = new UiWidget<Ui::PDFSupportUi>;
+ pdfSupportModule = new UiWidget<Ui::PDFSupportUi>(this);
connect(pdfSupportModule->use_hyperrefGB, SIGNAL(toggled(bool)),
this, SLOT(change_adaptor()));
connect(pdfSupportModule->titleLE, SIGNAL(textChanged(QString)),
// listings
- listingsModule = new UiWidget<Ui::ListingsSettingsUi>;
+ listingsModule = new UiWidget<Ui::ListingsSettingsUi>(this);
connect(listingsModule->listingsED, SIGNAL(textChanged()),
this, SLOT(change_adaptor()));
connect(listingsModule->bypassCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(listingsModule->bypassCB, SIGNAL(clicked()),
this, SLOT(setListingsMessage()));
+ connect(listingsModule->packageCO, SIGNAL(activated(int)),
+ this, SLOT(change_adaptor()));
+ connect(listingsModule->packageCO, SIGNAL(activated(int)),
+ this, SLOT(listingsPackageChanged(int)));
connect(listingsModule->listingsED, SIGNAL(textChanged()),
this, SLOT(setListingsMessage()));
listingsModule->listingsTB->setPlainText(
qt_("Input listings parameters below. Enter ? for a list of parameters."));
+ for (int i = 0; lst_packages[i][0]; ++i)
+ listingsModule->packageCO->addItem(lst_packages[i]);
+
// add the panels
docPS->addPanel(latexModule, N_("Document Class"));
}
+void GuiDocument::shellescapeChanged()
+{
+ shellescapeChanged_ = true;
+ changed();
+}
+
+
+void GuiDocument::slotApply()
+{
+ bool only_shellescape_changed = !nonModuleChanged_ && !modulesChanged_;
+ bool wasclean = buffer().isClean();
+ GuiDialog::slotApply();
+ if (wasclean && only_shellescape_changed)
+ buffer().markClean();
+ modulesChanged_ = false;
+}
+
+
+void GuiDocument::slotOK()
+{
+ bool only_shellescape_changed = !nonModuleChanged_ && !modulesChanged_;
+ bool wasclean = buffer().isClean();
+ GuiDialog::slotOK();
+ if (wasclean && only_shellescape_changed)
+ buffer().markClean();
+ modulesChanged_ = false;
+}
+
+
void GuiDocument::includeonlyClicked(QTreeWidgetItem * item, int)
{
if (item == 0)
{
if (listingsModule->bypassCB->isChecked())
return QString();
+ string const package =
+ lst_packages[listingsModule->packageCO->currentIndex()];
string params = fromqstr(listingsModule->listingsED->toPlainText());
- return toqstr(InsetListingsParams(params).validate());
+ InsetListingsParams lstparams(params);
+ lstparams.setMinted(package == "Minted");
+ return toqstr(lstparams.validate());
}
}
+void GuiDocument::listingsPackageChanged(int index)
+{
+ string const package = lst_packages[index];
+ if (package == "Minted" && lyxrc.pygmentize_command.empty()) {
+ Alert::warning(_("Pygments driver command not found!"),
+ _("The driver command necessary to use the minted package\n"
+ "(pygmentize) has not been found. Make sure you have\n"
+ "the python-pygments module installed or, if the driver\n"
+ "is named differently, to add the following line to the\n"
+ "document preamble:\n\n"
+ "\\AtBeginDocument{\\renewcommand{\\MintedPygmentize}{driver}}\n\n"
+ "where 'driver' is name of the driver command."));
+ }
+}
+
+
void GuiDocument::setLSpacing(int item)
{
textLayoutModule->lspacingLE->setEnabled(item == 3);
setSkip(textLayoutModule->skipCO->currentIndex());
}
+void GuiDocument::allowMathIndent() {
+ // only disable when not checked, checked does not always allow enabling
+ if (!mathsModule->MathIndentCB->isChecked()) {
+ mathsModule->MathIndentLE->setEnabled(false);
+ mathsModule->MathIndentLengthCO->setEnabled(false);
+ }
+ if (mathsModule->MathIndentCB->isChecked()
+ && mathsModule->MathIndentCO->currentIndex() == 1) {
+ mathsModule->MathIndentLE->setEnabled(true);
+ mathsModule->MathIndentLengthCO->setEnabled(true);
+ }
+ isValid();
+}
+
+void GuiDocument::enableMathIndent(int item)
+{
+ bool const enable = (item == 1);
+ mathsModule->MathIndentLE->setEnabled(enable);
+ mathsModule->MathIndentLengthCO->setEnabled(enable);
+ isValid();
+}
+
void GuiDocument::setMargins()
{
}
+void GuiDocument::checkPossibleCiteEngines()
+{
+ // Check if the class provides a specific engine,
+ // and if so, enforce this.
+ string force_engine;
+ if (documentClass().provides("natbib")
+ || documentClass().provides("natbib-internal"))
+ force_engine = "natbib";
+ else if (documentClass().provides("jurabib"))
+ force_engine = "jurabib";
+ else if (documentClass().provides("biblatex"))
+ force_engine = "biblatex";
+ else if (documentClass().provides("biblatex-natbib"))
+ force_engine = "biblatex-natbib";
+
+ if (!force_engine.empty())
+ biblioModule->citeEngineCO->setCurrentIndex(
+ biblioModule->citeEngineCO->findData(toqstr(force_engine)));
+ biblioModule->citeEngineCO->setEnabled(force_engine.empty());
+}
+
+
void GuiDocument::rescanBibFiles()
{
if (isBiblatex())
{
modulesToParams(bp_);
- if (applyPB->isEnabled() && nonModuleChanged_) {
+ if (applyPB->isEnabled() && (nonModuleChanged_ || shellescapeChanged_)) {
int const ret = Alert::prompt(_("Unapplied changes"),
_("Some changes in the dialog were not yet applied.\n"
"If you do not apply now, they will be lost after this action."),
applyView();
}
+ modulesChanged_ = true;
bp_.makeDocumentClass();
paramsToDialog();
changed();
if (rb->isChecked())
bp_.use_package(it->first, BufferParams::package_off);
}
+ // if math is indented
+ bp_.is_math_indent = mathsModule->MathIndentCB->isChecked();
+ if (bp_.is_math_indent) {
+ // if formulas are indented
+ switch (mathsModule->MathIndentCO->currentIndex()) {
+ case 0:
+ bp_.setMathIndent(Length());
+ break;
+ case 1: {
+ Length mathindent(widgetsToLength(mathsModule->MathIndentLE,
+ mathsModule->MathIndentLengthCO));
+ bp_.setMathIndent(mathindent);
+ break;
+ }
+ default:
+ // this should never happen
+ bp_.setMathIndent(Length());
+ break;
+ }
+ }
+ switch (mathsModule->MathNumberingPosCO->currentIndex()) {
+ case 0:
+ bp_.math_numbering_side = BufferParams::LEFT;
+ break;
+ case 1:
+ bp_.math_numbering_side = BufferParams::DEFAULT;
+ break;
+ case 2:
+ bp_.math_numbering_side = BufferParams::RIGHT;
+ break;
+ default:
+ // this should never happen
+ bp_.math_numbering_side = BufferParams::DEFAULT;
+ break;
+ }
// Page Layout
if (pageLayoutModule->pagestyleCO->currentIndex() == 0)
bp_.paragraph_separation = BufferParams::ParagraphIndentSeparation;
switch (textLayoutModule->indentCO->currentIndex()) {
case 0:
- bp_.setIndentation(HSpace(HSpace::DEFAULT));
+ bp_.setParIndent(Length());
break;
- case 1: {
- HSpace indent = HSpace(
- widgetsToLength(textLayoutModule->indentLE,
- textLayoutModule->indentLengthCO)
- );
- bp_.setIndentation(indent);
+ case 1: {
+ Length parindent(widgetsToLength(textLayoutModule->indentLE,
+ textLayoutModule->indentLengthCO));
+ bp_.setParIndent(parindent);
break;
- }
+ }
default:
// this should never happen
- bp_.setIndentation(HSpace(HSpace::DEFAULT));
+ bp_.setParIndent(Length());
break;
}
} else {
// Listings
// text should have passed validation
+ idx = listingsModule->packageCO->currentIndex();
+ bp_.use_minted = string(lst_packages[idx]) == "Minted";
bp_.listings_params =
InsetListingsParams(fromqstr(listingsModule->listingsED->toPlainText())).params();
bool const nontexfonts = fontModule->osFontsCB->isChecked();
bp_.useNonTeXFonts = nontexfonts;
+ bp_.shell_escape = outputModule->shellescapeCB->isChecked();
+ if (!bp_.shell_escape)
+ theSession().shellescapeFiles().remove(buffer().absFileName());
+ else if (!theSession().shellescapeFiles().find(buffer().absFileName()))
+ theSession().shellescapeFiles().insert(buffer().absFileName());
+ Buffer & buf = const_cast<Buffer &>(buffer());
+ buf.params().shell_escape = bp_.shell_escape;
+
bp_.output_sync = outputModule->outputsyncCB->isChecked();
bp_.output_sync_macro = fromqstr(outputModule->synccustomCB->currentText());
fromqstr(fontModule->cjkFontLE->text());
bp_.use_microtype = fontModule->microtypeCB->isChecked();
+ bp_.use_dash_ligatures = !fontModule->dashesCB->isChecked();
bp_.fonts_sans_scale[nontexfonts] = fontModule->scaleSansSB->value();
bp_.fonts_sans_scale[!nontexfonts] = fontModule->font_sf_scale;
pdf.quoted_options = pdf.quoted_options_check(
fromqstr(pdfSupportModule->optionsLE->text()));
- // reset tracker
+ // reset trackers
nonModuleChanged_ = false;
+ shellescapeChanged_ = false;
}
updateEngineType(documentClass().opt_enginetype(),
bp_.citeEngineType());
+ checkPossibleCiteEngines();
+
biblioModule->citeStyleCO->setCurrentIndex(
biblioModule->citeStyleCO->findData(bp_.citeEngineType()));
biblioChanged_ = false;
// indices
- // We may be called when there is no Buffer, e.g., when
+ // We may be called when there is no Buffer, e.g., when
// the last view has just been closed.
bool const isReadOnly = isBufferAvailable() ? buffer().isReadonly() : false;
indicesModule->update(bp_, isReadOnly);
latexModule->psdriverCO->setCurrentIndex(nitem);
updateModuleInfo();
+ // math
+ mathsModule->MathIndentCB->setChecked(bp_.is_math_indent);
+ if (bp_.is_math_indent) {
+ Length const mathindent = bp_.getMathIndent();
+ int indent = 0;
+ if (!mathindent.empty()) {
+ lengthToWidgets(mathsModule->MathIndentLE,
+ mathsModule->MathIndentLengthCO,
+ mathindent, default_unit);
+ indent = 1;
+ }
+ mathsModule->MathIndentCO->setCurrentIndex(indent);
+ enableMathIndent(indent);
+ }
+ switch(bp_.math_numbering_side) {
+ case BufferParams::LEFT:
+ mathsModule->MathNumberingPosCO->setCurrentIndex(0);
+ break;
+ case BufferParams::DEFAULT:
+ mathsModule->MathNumberingPosCO->setCurrentIndex(1);
+ break;
+ case BufferParams::RIGHT:
+ mathsModule->MathNumberingPosCO->setCurrentIndex(2);
+ }
+
map<string, string> const & packages = BufferParams::auto_packages();
for (map<string, string>::const_iterator it = packages.begin();
it != packages.end(); ++it) {
if (bp_.paragraph_separation == BufferParams::ParagraphIndentSeparation) {
textLayoutModule->indentRB->setChecked(true);
- string indentation = bp_.getIndentation().asLyXCommand();
+ string parindent = bp_.getParIndent().asString();
int indent = 0;
- if (indentation != "default") {
+ if (!parindent.empty()) {
lengthToWidgets(textLayoutModule->indentLE,
- textLayoutModule->indentLengthCO,
- indentation, default_unit);
+ textLayoutModule->indentLengthCO,
+ parindent, default_unit);
indent = 1;
}
textLayoutModule->indentCO->setCurrentIndex(indent);
string lstparams =
InsetListingsParams(bp_.listings_params).separatedParams();
listingsModule->listingsED->setPlainText(toqstr(lstparams));
+ int nn = findToken(lst_packages, bp_.use_minted ? "Minted" : "Listings");
+ if (nn >= 0)
+ listingsModule->packageCO->setCurrentIndex(nn);
+
// Fonts
// some languages only work with polyglossia/XeTeX
toqstr(bp_.fonts_cjk));
else
fontModule->cjkFontLE->setText(QString());
-
+
fontModule->microtypeCB->setChecked(bp_.use_microtype);
+ fontModule->dashesCB->setChecked(!bp_.use_dash_ligatures);
fontModule->fontScCB->setChecked(bp_.fonts_expert_sc);
fontModule->fontOsfCB->setChecked(bp_.fonts_old_figures);
fontModule->scaleTypewriterSB->setValue(bp_.fontsTypewriterScale());
fontModule->font_tt_scale = bp_.fonts_typewriter_scale[!bp_.useNonTeXFonts];
- int nn = findToken(GuiDocument::fontfamilies, bp_.fonts_default_family);
+ nn = findToken(GuiDocument::fontfamilies, bp_.fonts_default_family);
if (nn >= 0)
fontModule->fontsDefaultCO->setCurrentIndex(nn);
index = 0;
outputModule->defaultFormatCO->setCurrentIndex(index);
+ outputModule->shellescapeCB->setChecked(bp_.shell_escape);
outputModule->outputsyncCB->setChecked(bp_.output_sync);
outputModule->synccustomCB->setEditText(toqstr(bp_.output_sync_macro));
// clear changed branches cache
changedBranches_.clear();
- // reset tracker
+ // reset trackers
nonModuleChanged_ = false;
+ shellescapeChanged_ = false;
}
all_unincluded = false;
}
// Both if all childs are included and if none is included
- // is equal to "include all" (i.e., ommit \includeonly).
+ // is equal to "include all" (i.e., omit \includeonly).
// Thus, reset the GUI.
if (!has_unincluded || all_unincluded) {
masterChildModule->includeallRB->setChecked(true);
biblioModule->citeEngineCO->itemData(
biblioModule->citeEngineCO->currentIndex()).toString();
+ // this can happen if the cite engine is unknown, which can happen
+ // if one is using a file that came from someone else, etc. in that
+ // case, we crash if we proceed.
+ if (engine.isEmpty())
+ return false;
+
return theCiteEnginesList[fromqstr(engine)]->getCiteFramework() == "biblatex";
}
}
bp_.useClassDefaults();
paramsToDialog();
+ changed();
}
textLayoutModule->indentCO->currentIndex() != 1 ||
// or else a length has been given
!textLayoutModule->indentLE->text().isEmpty()
+ ) &&
+ (
+ // if we're asking for math indentation
+ !mathsModule->MathIndentCB->isChecked() ||
+ // then either we haven't chosen custom
+ mathsModule->MathIndentCO->currentIndex() != 1 ||
+ // or else a length has been given
+ !mathsModule->MathIndentLE->text().isEmpty()
);
}
docstring const str = current_branch + ' ' + from_ascii(x11hexname);
dispatch(FuncRequest(LFUN_SET_COLOR, str));
}
-
- // Open insets of selected branches, close deselected ones
- dispatch(FuncRequest(LFUN_INSET_FORALL,
- "Branch inset-toggle assign"));
}
// rename branches in the document
executeBranchRenaming();