custom = 2
};
-} // anonymous namespace
-
-namespace lyx {
-
-RGBColor set_backgroundcolor;
+lyx::RGBColor set_backgroundcolor;
bool is_backgroundcolor;
-RGBColor set_fontcolor;
+lyx::RGBColor set_fontcolor;
bool is_fontcolor;
-RGBColor set_notefontcolor;
-RGBColor set_boxbgcolor;
+lyx::RGBColor set_notefontcolor;
+lyx::RGBColor set_boxbgcolor;
bool forced_fontspec_activation;
+} // anonymous namespace
+
+namespace lyx {
+
namespace {
// used when sorting the textclass list.
class less_textclass_avail_desc
- : public binary_function<string, string, int>
{
public:
bool operator()(string const & lhs, string const & rhs) const
public:
///
ModuleSelectionManager(QObject * parent,
- QTreeView * availableLV,
- QTreeView * selectedLV,
- QPushButton * addPB,
- QPushButton * delPB,
- QPushButton * upPB,
- QPushButton * downPB,
- QStandardItemModel * availableModel,
- GuiIdListModel * selectedModel,
+ QTreeView * availableLVarg,
+ QTreeView * selectedLVarg,
+ QPushButton * addPBarg,
+ QPushButton * delPBarg,
+ QPushButton * upPBarg,
+ QPushButton * downPBarg,
+ QStandardItemModel * availableModelarg,
+ GuiIdListModel * selectedModelarg,
GuiDocument const * container)
- : GuiSelectionManager(parent, availableLV, selectedLV, addPB, delPB,
- upPB, downPB, availableModel, selectedModel),
+ : GuiSelectionManager(parent, availableLVarg, selectedLVarg, addPBarg, delPBarg,
+ upPBarg, downPBarg, availableModelarg, selectedModelarg),
container_(container)
{}
///
/////////////////////////////////////////////////////////////////////
PreambleModule::PreambleModule(QWidget * parent)
- : UiWidget<Ui::PreambleUi>(parent), current_id_(0)
+ : UiWidget<Ui::PreambleUi>(parent), current_id_(nullptr)
{
// This is not a memory leak. The object will be destroyed
// with this.
// https://stackoverflow.com/questions/13027091/how-to-override-tab-width-in-qt
const int tabStop = 4;
QFontMetrics metrics(preambleTE->currentFont());
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
+ // horizontalAdvance() is available starting in 5.11.0
+ // setTabStopDistance() is available starting in 5.10.0
+ preambleTE->setTabStopDistance(tabStop * metrics.horizontalAdvance(' '));
+#else
preambleTE->setTabStopWidth(tabStop * metrics.width(' '));
+#endif
}
LocalLayout::LocalLayout(QWidget * parent)
- : UiWidget<Ui::LocalLayoutUi>(parent), current_id_(0), validated_(false)
+ : UiWidget<Ui::LocalLayoutUi>(parent), current_id_(nullptr), validated_(false)
{
locallayoutTE->setFont(guiApp->typewriterSystemFont());
locallayoutTE->setWordWrapMode(QTextOption::NoWrap);
connect(masterChildModule->includeonlyRB, SIGNAL(toggled(bool)),
masterChildModule->childrenTW, SLOT(setEnabled(bool)));
connect(masterChildModule->includeonlyRB, SIGNAL(toggled(bool)),
- masterChildModule->maintainAuxCB, SLOT(setEnabled(bool)));
+ masterChildModule->maintainGB, SLOT(setEnabled(bool)));
connect(masterChildModule->includeallRB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(masterChildModule->includeonlyRB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
- connect(masterChildModule->maintainAuxCB, SIGNAL(clicked()),
+ connect(masterChildModule->maintainCRNoneRB, SIGNAL(clicked()),
+ this, SLOT(change_adaptor()));
+ connect(masterChildModule->maintainCRMostlyRB, SIGNAL(clicked()),
+ this, SLOT(change_adaptor()));
+ connect(masterChildModule->maintainCRStrictRB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
masterChildModule->childrenTW->setColumnCount(2);
masterChildModule->childrenTW->headerItem()->setText(0, qt_("Child Document"));
masterChildModule->childrenTW->headerItem()->setText(1, qt_("Include to Output"));
- masterChildModule->childrenTW->resizeColumnToContents(1);
- masterChildModule->childrenTW->resizeColumnToContents(2);
-
+#if (QT_VERSION > 0x050000)
+ masterChildModule->childrenTW->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
+ masterChildModule->childrenTW->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
+#else
+ masterChildModule->childrenTW->header()->setResizeMode(0, QHeaderView::ResizeToContents);
+ masterChildModule->childrenTW->header()->setResizeMode(1, QHeaderView::ResizeToContents);
+#endif
// Formats
outputModule = new UiWidget<Ui::OutputUi>(this);
connect(outputModule->shellescapeCB, SIGNAL(stateChanged(int)),
this, SLOT(shellescapeChanged()));
- connect(outputModule->outputsyncCB, SIGNAL(clicked()),
- this, SLOT(change_adaptor()));
+ connect(outputModule->outputsyncCB, SIGNAL(toggled(bool)),
+ this, SLOT(setOutputSync(bool)));
connect(outputModule->synccustomCB, SIGNAL(editTextChanged(QString)),
this, SLOT(change_adaptor()));
outputModule->synccustomCB->addItem("");
outputModule->synccustomCB));
connect(outputModule->saveTransientPropertiesCB, SIGNAL(clicked()),
- this, SLOT(change_adaptor()));
+ this, SLOT(change_adaptor()));
+ connect(outputModule->postponeFragileCB, SIGNAL(clicked()),
+ this, SLOT(change_adaptor()));
// language & quote
this, SLOT(change_adaptor()));
connect(pdfSupportModule->bookmarksopenGB, SIGNAL(toggled(bool)),
this, SLOT(change_adaptor()));
+ connect(pdfSupportModule->bookmarksopenGB, SIGNAL(toggled(bool)),
+ this, SLOT(bookmarksopenChanged(bool)));
connect(pdfSupportModule->bookmarksopenlevelSB, SIGNAL(valueChanged(int)),
this, SLOT(change_adaptor()));
connect(pdfSupportModule->breaklinksCB, SIGNAL(toggled(bool)),
changed();
}
+void GuiDocument::bookmarksopenChanged(bool state)
+{
+ pdfSupportModule->bookmarksopenlevelSB->setEnabled(state);
+ pdfSupportModule->bookmarksopenlevelLA->setEnabled(state);
+}
+
void GuiDocument::slotApply()
{
void GuiDocument::includeonlyClicked(QTreeWidgetItem * item, int)
{
- if (item == 0)
+ if (item == nullptr)
return;
string child = fromqstr(item->text(0));
if (isOK)
return;
isOK = true;
- // listingsTB->setTextColor("black");
+ // listingsModule->listingsTB->setTextColor("black");
listingsModule->listingsTB->setPlainText(
qt_("Input listings parameters below. "
"Enter ? for a list of parameters."));
} else {
isOK = false;
- // listingsTB->setTextColor("red");
+ // listingsModule->listingsTB->setTextColor("red");
listingsModule->listingsTB->setPlainText(msg);
}
}
Language const * lang = lyx::languages.getLanguage(
fromqstr(langModule->languageCO->itemData(i).toString()));
if (lang->babel().empty() && !lang->polyglossia().empty()
- && lang->requires() != "CJK" && lang->requires() != "japanese") {
+ && lang->required() != "CJK" && lang->required() != "japanese") {
// If we force to switch fontspec on, store
// current state (#8717)
if (fontModule->osFontsCB->isEnabled())
biblioModule->citeEngineCO->currentIndex()).toString();
LyXCiteEngine const * ce = theCiteEnginesList[fromqstr(engine)];
- bool const citepack = ce->requires("biblatex.sty") || ce->requires("jurabib.sty")
- || ce->requires("natbib.sty");
+ bool const citepack = ce->required("biblatex.sty") || ce->required("jurabib.sty")
+ || ce->required("natbib.sty");
biblioModule->citePackageOptionsLE->setEnabled(citepack);
biblioModule->citePackageOptionsL->setEnabled(citepack);
}
int const toc = numberingModule->tocSL->value();
QString const no = qt_("No");
QString const yes = qt_("Yes");
- QTreeWidgetItem * item = 0;
+ QTreeWidgetItem * item = nullptr;
DocumentClass::const_iterator lit = tclass.begin();
DocumentClass::const_iterator len = tclass.end();
bp_.addIncludedChildren(*it);
}
}
- bp_.maintain_unincluded_children =
- masterChildModule->maintainAuxCB->isChecked();
+ if (masterChildModule->maintainCRNoneRB->isChecked())
+ bp_.maintain_unincluded_children =
+ BufferParams::CM_None;
+ else if (masterChildModule->maintainCRMostlyRB->isChecked())
+ bp_.maintain_unincluded_children =
+ BufferParams::CM_Mostly;
+ else
+ bp_.maintain_unincluded_children =
+ BufferParams::CM_Strict;
+ updateIncludeonlyDisplay();
// Float Settings
bp_.float_placement = floatModule->getPlacement();
bp_.save_transient_properties =
outputModule->saveTransientPropertiesCB->isChecked();
+ bp_.postpone_fragile_content =
+ outputModule->postponeFragileCB->isChecked();
// fonts
bp_.fonts_roman[nontexfonts] =
masterChildModule->setEnabled(true);
includeonlys_ = bp_.getIncludedChildren();
updateIncludeonlys();
+ updateIncludeonlyDisplay();
+ }
+ switch (bp_.maintain_unincluded_children) {
+ case BufferParams::CM_None:
+ masterChildModule->maintainCRNoneRB->setChecked(true);
+ break;
+ case BufferParams::CM_Mostly:
+ masterChildModule->maintainCRMostlyRB->setChecked(true);
+ break;
+ case BufferParams::CM_Strict:
+ default:
+ masterChildModule->maintainCRStrictRB->setChecked(true);
+ break;
}
- masterChildModule->maintainAuxCB->setChecked(
- bp_.maintain_unincluded_children);
// Float Settings
floatModule->setPlacement(bp_.float_placement);
langModule->languageCO->currentIndex()).toString()));
bool const need_fontspec =
lang->babel().empty() && !lang->polyglossia().empty()
- && lang->requires() != "CJK" && lang->requires() != "japanese";
+ && lang->required() != "CJK" && lang->required() != "japanese";
bool const os_fonts_available =
bp_.baseClass()->outputType() == lyx::LATEX
&& LaTeXFeatures::isAvailable("fontspec");
outputModule->shellescapeCB->setChecked(bp_.shell_escape);
outputModule->outputsyncCB->setChecked(bp_.output_sync);
outputModule->synccustomCB->setEditText(toqstr(bp_.output_sync_macro));
+ outputModule->synccustomCB->setEnabled(bp_.output_sync);
+ outputModule->synccustomLA->setEnabled(bp_.output_sync);
outputModule->mathimgSB->setValue(bp_.html_math_img_scale);
outputModule->mathoutCB->setCurrentIndex(bp_.html_math_output);
outputModule->saveTransientPropertiesCB
->setChecked(bp_.save_transient_properties);
+ outputModule->postponeFragileCB
+ ->setChecked(bp_.postpone_fragile_content);
// paper
bool const extern_geometry =
pdfSupportModule->bookmarksopenGB->setChecked(pdf.bookmarksopen);
pdfSupportModule->bookmarksopenlevelSB->setValue(pdf.bookmarksopenlevel);
+ pdfSupportModule->bookmarksopenlevelSB->setEnabled(pdf.bookmarksopen);
+ pdfSupportModule->bookmarksopenlevelLA->setEnabled(pdf.bookmarksopen);
pdfSupportModule->breaklinksCB->setChecked(pdf.breaklinks);
pdfSupportModule->pdfborderCB->setChecked(pdf.pdfborder);
unavbrush.setColor(Qt::gray);
for (modInfoStruct const & m : modInfoList) {
QStandardItem * item = new QStandardItem();
- QStandardItem * catItem = new QStandardItem();
+ QStandardItem * catItem;
QString const catname = m.category;
QList<QStandardItem *> fcats = modules_av_model_.findItems(catname, Qt::MatchExactly);
if (!fcats.empty())
catItem = fcats.first();
else {
+ catItem = new QStandardItem();
catItem->setText(catname);
catItem->setFont(catfont);
modules_av_model_.insertRow(i, catItem);
}
-void GuiDocument::updateIncludeonlys()
+void GuiDocument::updateIncludeonlyDisplay()
{
- masterChildModule->childrenTW->clear();
- QString const no = qt_("No");
- QString const yes = qt_("Yes");
-
if (includeonlys_.empty()) {
masterChildModule->includeallRB->setChecked(true);
masterChildModule->childrenTW->setEnabled(false);
- masterChildModule->maintainAuxCB->setEnabled(false);
+ masterChildModule->maintainGB->setEnabled(false);
} else {
masterChildModule->includeonlyRB->setChecked(true);
masterChildModule->childrenTW->setEnabled(true);
- masterChildModule->maintainAuxCB->setEnabled(true);
+ masterChildModule->maintainGB->setEnabled(true);
}
+}
+
+
+void GuiDocument::updateIncludeonlys()
+{
+ masterChildModule->childrenTW->clear();
+ QString const no = qt_("No");
+ QString const yes = qt_("Yes");
+
ListOfBuffers children = buffer().getChildren();
ListOfBuffers::const_iterator it = children.begin();
ListOfBuffers::const_iterator end = children.end();
else
all_unincluded = false;
}
- // Both if all childs are included and if none is included
+ // Both if all children are included and if none is included
// is equal to "include all" (i.e., omit \includeonly).
- // Thus, reset the GUI.
- if (!has_unincluded || all_unincluded) {
- masterChildModule->includeallRB->setChecked(true);
- masterChildModule->childrenTW->setEnabled(false);
+ if (!has_unincluded || all_unincluded)
includeonlys_.clear();
- }
- // If all are included, we need to update again.
- if (!has_unincluded)
- updateIncludeonlys();
}
BufferId GuiDocument::id() const
{
BufferView const * const view = bufferview();
- return view? &view->buffer() : 0;
+ return view? &view->buffer() : nullptr;
}
change_adaptor();
}
+void GuiDocument::setOutputSync(bool on)
+{
+ outputModule->synccustomCB->setEnabled(on);
+ outputModule->synccustomLA->setEnabled(on);
+ change_adaptor();
+}
+
Dialog * createGuiDocument(GuiView & lv) { return new GuiDocument(lv); }