#include "support/debug.h"
#include "support/FileName.h"
-#include "support/FileFilterList.h"
#include "support/filetools.h"
#include "support/lstrings.h"
{
setupUi(this);
- QList<LanguagePair> langs = languageData(false);
- for (int i = 0; i != langs.size(); ++i)
- lang_.append(langs[i].second);
-
connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
this, SLOT(change_adaptor()));
// language & quotes
- QList<LanguagePair>::const_iterator lit = langs.begin();
- QList<LanguagePair>::const_iterator lend = langs.end();
- for (; lit != lend; ++lit)
- langModule->languageCO->addItem(lit->first);
+ Languages::const_iterator lit = languages.begin();
+ Languages::const_iterator lend = languages.end();
+ for (; lit != lend; ++lit) {
+ lang_.append(toqstr(lit->second.lang()));
+ langModule->languageCO->addItem(qt_(lit->second.display()));
+ }
// Always put the default encoding in the first position.
// It is special because the displayed text is translated.
this, SLOT(change_adaptor()));
connect(latexModule->layoutPB, SIGNAL(clicked()),
this, SLOT(browseLayout()));
+ connect(latexModule->childDocGB, SIGNAL(clicked()),
+ this, SLOT(change_adaptor()));
+ connect(latexModule->childDocLE, SIGNAL(textChanged(const QString &)),
+ this, SLOT(change_adaptor()));
+ connect(latexModule->childDocPB, SIGNAL(clicked()),
+ this, SLOT(browseMaster()));
selectionManager =
new ModuleSelMan(latexModule->availableLV, latexModule->selectedLV,
{
QString const label1 = qt_("Layouts|#o#O");
QString const dir1 = toqstr(lyxrc.document_path);
- FileFilterList const filter(_("LyX Layout (*.layout)"));
+ QStringList const filter(qt_("LyX Layout (*.layout)"));
QString file = browseRelFile(QString(), bufferFilepath(),
qt_("Local layout file"), filter, false,
label1, dir1);
- if (!suffixIs(fromqstr(file), ".layout"))
+ if (!file.endsWith(".layout"))
return;
- FileName layoutFile = makeAbsPath(fromqstr(file),
+ FileName layoutFile = support::makeAbsPath(fromqstr(file),
fromqstr(bufferFilepath()));
// load the layout file
}
+void GuiDocument::browseMaster()
+{
+ QString const title = qt_("Select master document");
+ QString const dir1 = toqstr(lyxrc.document_path);
+ QString const old = latexModule->childDocLE->text();
+ QString const docpath = toqstr(support::onlyPath(buffer().absFileName()));
+ QStringList const filter(qt_("LyX Files (*.lyx)"));
+ QString file = browseRelFile(old, docpath, title, filter, false,
+ qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
+
+ latexModule->childDocLE->setText(file);
+}
+
+
void GuiDocument::classChanged()
{
int idx = latexModule->classCO->currentIndex();
preambleModule->apply(params);
// biblio
- params.setCiteEngine(biblio::ENGINE_BASIC);
+ params.setCiteEngine(ENGINE_BASIC);
if (biblioModule->citeNatbibRB->isChecked()) {
bool const use_numerical_citations =
biblioModule->citeStyleCO->currentIndex();
if (use_numerical_citations)
- params.setCiteEngine(biblio::ENGINE_NATBIB_NUMERICAL);
+ params.setCiteEngine(ENGINE_NATBIB_NUMERICAL);
else
- params.setCiteEngine(biblio::ENGINE_NATBIB_AUTHORYEAR);
+ params.setCiteEngine(ENGINE_NATBIB_AUTHORYEAR);
} else if (biblioModule->citeJurabibRB->isChecked())
- params.setCiteEngine(biblio::ENGINE_JURABIB);
+ params.setCiteEngine(ENGINE_JURABIB);
params.use_bibtopic =
biblioModule->bibtopicCB->isChecked();
params.options =
fromqstr(latexModule->optionsLE->text());
+ if (latexModule->childDocGB->isChecked())
+ params.master =
+ fromqstr(latexModule->childDocLE->text());
+ else
+ params.master = string();
+
params.float_placement = floatModule->get();
// fonts
// biblio
biblioModule->citeDefaultRB->setChecked(
- params.citeEngine() == biblio::ENGINE_BASIC);
+ params.citeEngine() == ENGINE_BASIC);
biblioModule->citeNatbibRB->setChecked(
- params.citeEngine() == biblio::ENGINE_NATBIB_NUMERICAL ||
- params.citeEngine() == biblio::ENGINE_NATBIB_AUTHORYEAR);
+ params.citeEngine() == ENGINE_NATBIB_NUMERICAL ||
+ params.citeEngine() == ENGINE_NATBIB_AUTHORYEAR);
biblioModule->citeStyleCO->setCurrentIndex(
- params.citeEngine() == biblio::ENGINE_NATBIB_NUMERICAL);
+ params.citeEngine() == ENGINE_NATBIB_NUMERICAL);
biblioModule->citeJurabibRB->setChecked(
- params.citeEngine() == biblio::ENGINE_JURABIB);
+ params.citeEngine() == ENGINE_JURABIB);
biblioModule->bibtopicCB->setChecked(
params.use_bibtopic);
latexModule->optionsLE->setText(QString());
}
+ if (!params.master.empty()) {
+ latexModule->childDocGB->setChecked(true);
+ latexModule->childDocLE->setText(
+ toqstr(params.master));
+ } else {
+ latexModule->childDocLE->setText(QString());
+ latexModule->childDocGB->setChecked(false);
+ }
+
floatModule->set(params.float_placement);
// Fonts
bool GuiDocument::initialiseParams(string const &)
{
bp_ = buffer().params();
+ // Force update on next updateContent() round.
+ current_id_ = 0;
loadModuleInfo();
return true;
}
// and then update the buffer's layout.
dispatch_bufferparams(*this, params(), LFUN_BUFFER_PARAMS_APPLY);
+ if (!params().master.empty()) {
+ FileName const master_file = support::makeAbsPath(params().master,
+ support::onlyPath(buffer().absFileName()));
+ if (isLyXFilename(master_file.absFilename())) {
+ Buffer * master = checkAndLoadLyXFile(master_file);
+ buffer().setParent(master);
+ }
+ }
+
// Generate the colours requested by each new branch.
BranchList & branchlist = params().branchlist();
if (!branchlist.empty()) {