2001-08-19 13:25:15 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file QDocument.C
|
2002-09-24 13:57:09 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-10-15 18:29:01 +00:00
|
|
|
|
*
|
2002-10-09 08:59:02 +00:00
|
|
|
|
* \author Edwin Leuven
|
2002-09-24 13:57:09 +00:00
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS
|
2001-08-19 13:25:15 +00:00
|
|
|
|
*/
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
2002-12-17 20:37:13 +00:00
|
|
|
|
#include "qt_helpers.h"
|
2002-10-09 08:59:02 +00:00
|
|
|
|
|
|
|
|
|
#include "ControlDocument.h"
|
2001-08-19 13:25:15 +00:00
|
|
|
|
#include "QDocument.h"
|
|
|
|
|
#include "QDocumentDialog.h"
|
2002-10-09 08:59:02 +00:00
|
|
|
|
#include "Qt2BC.h"
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
2003-06-20 23:03:43 +00:00
|
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
|
#include "language.h"
|
|
|
|
|
#include "helper_funcs.h" // getSecond()
|
2001-03-23 06:31:30 +00:00
|
|
|
|
#include "insets/insetquotes.h"
|
2002-10-09 08:59:02 +00:00
|
|
|
|
#include "frnt_lang.h"
|
2002-12-04 02:57:14 +00:00
|
|
|
|
#include "lyxrc.h" // defaultUnit
|
2002-10-09 08:59:02 +00:00
|
|
|
|
#include "tex-strings.h" // tex_graphics
|
2003-05-13 17:01:28 +00:00
|
|
|
|
#include "support/tostr.h"
|
2003-07-10 12:14:47 +00:00
|
|
|
|
#include "support/lstrings.h"
|
2002-10-09 08:59:02 +00:00
|
|
|
|
#include "support/filetools.h" // LibFileSearch()
|
2003-05-03 19:24:36 +00:00
|
|
|
|
#include "support/BoostFormat.h"
|
2002-10-09 08:59:02 +00:00
|
|
|
|
#include "lyxtextclasslist.h"
|
2001-03-23 06:31:30 +00:00
|
|
|
|
#include "vspace.h"
|
2002-10-09 08:59:02 +00:00
|
|
|
|
#include "bufferparams.h"
|
2002-12-04 02:57:14 +00:00
|
|
|
|
#include "qt_helpers.h"
|
2003-03-28 17:19:49 +00:00
|
|
|
|
#include "floatplacement.h"
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
|
#include <qpushbutton.h>
|
|
|
|
|
#include <qmultilineedit.h>
|
2001-03-23 06:31:30 +00:00
|
|
|
|
#include <qradiobutton.h>
|
2002-10-09 08:59:02 +00:00
|
|
|
|
#include <qcombobox.h>
|
|
|
|
|
#include <qcheckbox.h>
|
2003-03-29 03:46:27 +00:00
|
|
|
|
#include <qslider.h>
|
2002-10-09 08:59:02 +00:00
|
|
|
|
#include <qlineedit.h>
|
|
|
|
|
#include <qstringlist.h>
|
|
|
|
|
#include "lengthcombo.h"
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
2002-11-08 00:09:00 +00:00
|
|
|
|
#include "QBrowseBox.h"
|
|
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
|
#include <vector>
|
2001-03-29 15:02:19 +00:00
|
|
|
|
|
2002-10-15 17:45:12 +00:00
|
|
|
|
using std::vector;
|
2003-07-10 12:14:47 +00:00
|
|
|
|
using lyx::support::bformat;
|
2002-10-15 17:45:12 +00:00
|
|
|
|
|
2001-08-19 13:25:15 +00:00
|
|
|
|
typedef Qt2CB<ControlDocument, Qt2DB<QDocumentDialog> > base_class;
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
|
2003-02-15 22:17:59 +00:00
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
|
|
char const * encodings[] = { "LaTeX default", "latin1", "latin2",
|
|
|
|
|
"latin3", "latin4", "latin5", "latin9",
|
|
|
|
|
"koi8-r", "koi8-u", "cp866", "cp1251",
|
|
|
|
|
"iso88595", "pt154", 0
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
|
2003-07-10 12:14:47 +00:00
|
|
|
|
QDocument::QDocument()
|
|
|
|
|
: base_class(_("LyX: Document Settings")),
|
|
|
|
|
lang_(getSecond(frnt::getLanguageData(false)))
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
|
void QDocument::build_dialog()
|
2001-08-29 15:37:39 +00:00
|
|
|
|
{
|
2002-10-09 08:59:02 +00:00
|
|
|
|
dialog_.reset(new QDocumentDialog(this));
|
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// biblio
|
2002-12-17 20:37:13 +00:00
|
|
|
|
dialog_->biblioModule->citeStyleCO->insertItem(qt_("Author-year"));
|
|
|
|
|
dialog_->biblioModule->citeStyleCO->insertItem(qt_("Numerical"));
|
2002-10-09 08:59:02 +00:00
|
|
|
|
dialog_->biblioModule->citeStyleCO->setCurrentItem(0);
|
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// language & quotes
|
2002-10-09 08:59:02 +00:00
|
|
|
|
vector<frnt::LanguagePair> const langs = frnt::getLanguageData(false);
|
|
|
|
|
vector<frnt::LanguagePair>::const_iterator lit = langs.begin();
|
|
|
|
|
vector<frnt::LanguagePair>::const_iterator lend = langs.end();
|
|
|
|
|
for (; lit != lend; ++lit) {
|
|
|
|
|
dialog_->langModule->languageCO->insertItem(
|
2002-12-17 20:37:13 +00:00
|
|
|
|
toqstr(lit->first));
|
2002-10-09 08:59:02 +00:00
|
|
|
|
}
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2003-02-15 22:17:59 +00:00
|
|
|
|
int i = 0;
|
|
|
|
|
while (encodings[i]) {
|
|
|
|
|
dialog_->langModule->encodingCO->insertItem(qt_(encodings[i++]));
|
|
|
|
|
}
|
2003-01-16 10:56:49 +00:00
|
|
|
|
|
2002-12-17 20:37:13 +00:00
|
|
|
|
dialog_->langModule->quoteStyleCO->insertItem(qt_("``text''"));
|
|
|
|
|
dialog_->langModule->quoteStyleCO->insertItem(qt_("''text''"));
|
|
|
|
|
dialog_->langModule->quoteStyleCO->insertItem(qt_(",,text``"));
|
|
|
|
|
dialog_->langModule->quoteStyleCO->insertItem(qt_(",,text''"));
|
|
|
|
|
dialog_->langModule->quoteStyleCO->insertItem(qt_("<EFBFBD>text<EFBFBD>"));
|
|
|
|
|
dialog_->langModule->quoteStyleCO->insertItem(qt_("<EFBFBD>text<EFBFBD>"));
|
2002-10-09 08:59:02 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// packages
|
2002-10-19 10:32:57 +00:00
|
|
|
|
for (int n = 0; tex_graphics[n][0]; ++n) {
|
2002-10-09 08:59:02 +00:00
|
|
|
|
QString enc = tex_graphics[n];
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->latexModule->psdriverCO->insertItem(enc);
|
2002-10-09 08:59:02 +00:00
|
|
|
|
}
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// paper
|
2003-03-28 17:19:49 +00:00
|
|
|
|
QComboBox * cb = dialog_->pageLayoutModule->papersizeCO;
|
2002-12-17 20:37:13 +00:00
|
|
|
|
cb->insertItem(qt_("Default"));
|
|
|
|
|
cb->insertItem(qt_("Custom"));
|
|
|
|
|
cb->insertItem(qt_("US letter"));
|
|
|
|
|
cb->insertItem(qt_("US legal"));
|
|
|
|
|
cb->insertItem(qt_("US executive"));
|
|
|
|
|
cb->insertItem(qt_("A3"));
|
|
|
|
|
cb->insertItem(qt_("A4"));
|
|
|
|
|
cb->insertItem(qt_("A5"));
|
|
|
|
|
cb->insertItem(qt_("B3"));
|
|
|
|
|
cb->insertItem(qt_("B4"));
|
|
|
|
|
cb->insertItem(qt_("B5"));
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// layout
|
2002-10-09 08:59:02 +00:00
|
|
|
|
for (LyXTextClassList::const_iterator cit = textclasslist.begin();
|
|
|
|
|
cit != textclasslist.end(); ++cit) {
|
2003-05-03 19:24:36 +00:00
|
|
|
|
if (cit->isTeXClassAvailable()) {
|
|
|
|
|
dialog_->latexModule->classCO->insertItem(toqstr(cit->description()));
|
|
|
|
|
} else {
|
|
|
|
|
string item =
|
2003-07-10 12:14:47 +00:00
|
|
|
|
bformat(_("Unavailable: %1$s"), cit->description());
|
2003-05-03 19:24:36 +00:00
|
|
|
|
dialog_->latexModule->classCO->insertItem(toqstr(item));
|
|
|
|
|
}
|
2002-10-09 08:59:02 +00:00
|
|
|
|
}
|
2001-06-05 17:05:51 +00:00
|
|
|
|
|
2002-10-19 10:32:57 +00:00
|
|
|
|
for (int n = 0; tex_fonts[n][0]; ++n) {
|
2002-10-09 08:59:02 +00:00
|
|
|
|
QString font = tex_fonts[n];
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->textLayoutModule->fontsCO->insertItem(font);
|
2002-10-09 08:59:02 +00:00
|
|
|
|
}
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->textLayoutModule->fontsizeCO->insertItem(qt_("default"));
|
|
|
|
|
dialog_->textLayoutModule->fontsizeCO->insertItem(qt_("10"));
|
|
|
|
|
dialog_->textLayoutModule->fontsizeCO->insertItem(qt_("11"));
|
|
|
|
|
dialog_->textLayoutModule->fontsizeCO->insertItem(qt_("12"));
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->textLayoutModule->skipCO->insertItem(qt_("SmallSkip"));
|
|
|
|
|
dialog_->textLayoutModule->skipCO->insertItem(qt_("MedSkip"));
|
|
|
|
|
dialog_->textLayoutModule->skipCO->insertItem(qt_("BigSkip"));
|
|
|
|
|
dialog_->textLayoutModule->skipCO->insertItem(qt_("Length"));
|
2002-10-09 08:59:02 +00:00
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->pageLayoutModule->pagestyleCO->insertItem(qt_("default"));
|
|
|
|
|
dialog_->pageLayoutModule->pagestyleCO->insertItem(qt_("empty"));
|
|
|
|
|
dialog_->pageLayoutModule->pagestyleCO->insertItem(qt_("plain"));
|
|
|
|
|
dialog_->pageLayoutModule->pagestyleCO->insertItem(qt_("headings"));
|
|
|
|
|
dialog_->pageLayoutModule->pagestyleCO->insertItem(qt_("fancy"));
|
2003-02-25 13:35:26 +00:00
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->textLayoutModule->lspacingCO->insertItem(
|
2003-01-16 10:56:49 +00:00
|
|
|
|
qt_("Single"), Spacing::Single);
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->textLayoutModule->lspacingCO->insertItem(
|
2003-01-16 10:56:49 +00:00
|
|
|
|
qt_("OneHalf"), Spacing::Onehalf);
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->textLayoutModule->lspacingCO->insertItem(
|
2003-01-16 10:56:49 +00:00
|
|
|
|
qt_("Double"), Spacing::Double);
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->textLayoutModule->lspacingCO->insertItem(
|
2003-01-16 10:56:49 +00:00
|
|
|
|
qt_("Custom"), Spacing::Other);
|
2002-10-09 08:59:02 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// margins
|
2002-10-09 08:59:02 +00:00
|
|
|
|
dialog_->setMargins(0);
|
|
|
|
|
|
2001-06-05 17:05:51 +00:00
|
|
|
|
// Manage the restore, ok, apply, restore and cancel/close buttons
|
2003-03-10 03:13:28 +00:00
|
|
|
|
bcview().setOK(dialog_->okPB);
|
|
|
|
|
bcview().setApply(dialog_->applyPB);
|
|
|
|
|
bcview().setCancel(dialog_->closePB);
|
|
|
|
|
bcview().setRestore(dialog_->restorePB);
|
2001-03-23 06:31:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-03-28 02:10:23 +00:00
|
|
|
|
void QDocument::showPreamble()
|
|
|
|
|
{
|
|
|
|
|
dialog_->showPreamble();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-08-19 13:25:15 +00:00
|
|
|
|
void QDocument::apply()
|
2001-03-23 06:31:30 +00:00
|
|
|
|
{
|
2002-10-20 01:48:28 +00:00
|
|
|
|
BufferParams & params = controller().params();
|
|
|
|
|
|
|
|
|
|
// preamble
|
|
|
|
|
params.preamble =
|
2002-12-17 20:37:13 +00:00
|
|
|
|
fromqstr(dialog_->preambleModule->preambleMLE->text());
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// biblio
|
|
|
|
|
params.use_natbib =
|
2002-10-09 08:59:02 +00:00
|
|
|
|
dialog_->biblioModule->natbibCB->isChecked();
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.use_numerical_citations =
|
2002-10-09 08:59:02 +00:00
|
|
|
|
dialog_->biblioModule->citeStyleCO->currentItem();
|
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// language & quotes
|
2002-10-09 08:59:02 +00:00
|
|
|
|
if (dialog_->langModule->singleQuoteRB->isChecked())
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.quotes_times = InsetQuotes::SingleQ;
|
2002-10-09 08:59:02 +00:00
|
|
|
|
else
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.quotes_times = InsetQuotes::DoubleQ;
|
2001-06-05 17:05:51 +00:00
|
|
|
|
|
2003-02-15 22:17:59 +00:00
|
|
|
|
if (dialog_->langModule->defaultencodingCB->isChecked()) {
|
|
|
|
|
params.inputenc = "auto";
|
|
|
|
|
} else {
|
|
|
|
|
int i = dialog_->langModule->encodingCO->currentItem();
|
|
|
|
|
if (i == 0) {
|
|
|
|
|
params.inputenc = "default";
|
|
|
|
|
} else {
|
|
|
|
|
params.inputenc = encodings[i];
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
|
InsetQuotes::quote_language lga = InsetQuotes::EnglishQ;
|
|
|
|
|
switch (dialog_->langModule->quoteStyleCO->currentItem()) {
|
|
|
|
|
case 0:
|
|
|
|
|
lga = InsetQuotes::EnglishQ;
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
lga = InsetQuotes::SwedishQ;
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
lga = InsetQuotes::GermanQ;
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
lga = InsetQuotes::PolishQ;
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
lga = InsetQuotes::FrenchQ;
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
lga = InsetQuotes::DanishQ;
|
|
|
|
|
break;
|
2001-06-05 17:05:51 +00:00
|
|
|
|
}
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.quotes_language = lga;
|
2001-06-05 17:05:51 +00:00
|
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
|
int const pos = dialog_->langModule->languageCO->currentItem();
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.language = languages.getLanguage(lang_[pos]);
|
2001-03-29 15:02:19 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// numbering
|
2003-03-29 03:46:27 +00:00
|
|
|
|
params.tocdepth = dialog_->numberingModule->tocSL->value();
|
|
|
|
|
params.secnumdepth = dialog_->numberingModule->depthSL->value();
|
2001-03-29 15:02:19 +00:00
|
|
|
|
|
2002-11-08 00:09:00 +00:00
|
|
|
|
// bullets
|
2002-12-16 22:24:33 +00:00
|
|
|
|
params.user_defined_bullets[0] = dialog_->bulletsModule->getBullet(0);
|
|
|
|
|
params.user_defined_bullets[1] = dialog_->bulletsModule->getBullet(1);
|
|
|
|
|
params.user_defined_bullets[2] = dialog_->bulletsModule->getBullet(2);
|
|
|
|
|
params.user_defined_bullets[3] = dialog_->bulletsModule->getBullet(3);
|
2002-11-08 00:09:00 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// packages
|
|
|
|
|
params.graphicsDriver =
|
2003-03-28 17:19:49 +00:00
|
|
|
|
fromqstr(dialog_->latexModule->psdriverCO->currentText());
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
if (dialog_->mathsModule->amsautoCB->isChecked()) {
|
2003-03-06 11:07:55 +00:00
|
|
|
|
params.use_amsmath = BufferParams::AMS_AUTO;
|
|
|
|
|
} else {
|
2003-03-28 17:19:49 +00:00
|
|
|
|
if (dialog_->mathsModule->amsCB->isChecked())
|
2003-03-06 15:31:23 +00:00
|
|
|
|
params.use_amsmath = BufferParams::AMS_ON;
|
|
|
|
|
else
|
|
|
|
|
params.use_amsmath = BufferParams::AMS_OFF;
|
2003-03-06 11:07:55 +00:00
|
|
|
|
}
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// layout
|
|
|
|
|
params.textclass =
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->latexModule->classCO->currentItem();
|
2003-02-25 13:35:26 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.fonts =
|
2003-03-28 17:19:49 +00:00
|
|
|
|
fromqstr(dialog_->textLayoutModule->fontsCO->currentText());
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.fontsize =
|
2003-03-28 17:19:49 +00:00
|
|
|
|
fromqstr(dialog_->textLayoutModule->fontsizeCO->currentText());
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.pagestyle =
|
2003-03-28 17:19:49 +00:00
|
|
|
|
fromqstr(dialog_->pageLayoutModule->pagestyleCO->currentText());
|
2003-02-25 13:35:26 +00:00
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
switch (dialog_->textLayoutModule->lspacingCO->currentItem()) {
|
2003-01-16 10:56:49 +00:00
|
|
|
|
case 0:
|
|
|
|
|
params.spacing.set(Spacing::Single);
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
params.spacing.set(Spacing::Onehalf);
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
params.spacing.set(Spacing::Double);
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
params.spacing.set(Spacing::Other,
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->textLayoutModule->
|
2003-01-16 10:56:49 +00:00
|
|
|
|
lspacingLE->text().toFloat()
|
|
|
|
|
);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
if (dialog_->textLayoutModule->twoColumnCB->isChecked())
|
|
|
|
|
params.columns = 2;
|
|
|
|
|
else
|
|
|
|
|
params.columns = 1;
|
|
|
|
|
|
|
|
|
|
if (dialog_->textLayoutModule->indentRB->isChecked())
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.paragraph_separation = BufferParams::PARSEP_INDENT;
|
2001-06-05 17:05:51 +00:00
|
|
|
|
else
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.paragraph_separation = BufferParams::PARSEP_SKIP;
|
2002-10-09 08:59:02 +00:00
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
switch (dialog_->textLayoutModule->skipCO->currentItem()) {
|
2002-10-09 08:59:02 +00:00
|
|
|
|
case 0:
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.setDefSkip(VSpace(VSpace::SMALLSKIP));
|
2002-10-09 08:59:02 +00:00
|
|
|
|
break;
|
|
|
|
|
case 1:
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.setDefSkip(VSpace(VSpace::MEDSKIP));
|
2002-10-09 08:59:02 +00:00
|
|
|
|
break;
|
|
|
|
|
case 2:
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.setDefSkip(VSpace(VSpace::BIGSKIP));
|
2002-10-09 08:59:02 +00:00
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
{
|
|
|
|
|
LyXLength::UNIT unit =
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->textLayoutModule->skipLengthCO->
|
2002-10-09 08:59:02 +00:00
|
|
|
|
currentLengthItem();
|
|
|
|
|
double length =
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->textLayoutModule->skipLE->text().toDouble();
|
2002-10-09 08:59:02 +00:00
|
|
|
|
VSpace vs = VSpace(LyXGlueLength(LyXLength(length,unit)));
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.setDefSkip(vs);
|
2002-10-09 08:59:02 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
default:
|
2001-06-05 17:05:51 +00:00
|
|
|
|
// DocumentDefskipCB assures that this never happens
|
2002-11-13 00:52:15 +00:00
|
|
|
|
// so Assert then !!! - jbl
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.setDefSkip(VSpace(VSpace::MEDSKIP));
|
2001-06-05 17:05:51 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.options =
|
2003-03-28 17:19:49 +00:00
|
|
|
|
fromqstr(dialog_->latexModule->optionsLE->text());
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
params.float_placement = dialog_->floatModule->get();
|
2002-10-09 08:59:02 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// paper
|
2003-07-26 23:04:39 +00:00
|
|
|
|
params.papersize2 = VMARGIN_PAPER_TYPE(
|
2003-06-10 15:13:48 +00:00
|
|
|
|
dialog_->pageLayoutModule->papersizeCO->currentItem());
|
2002-10-09 08:59:02 +00:00
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
params.paperwidth = widgetsToLength(dialog_->pageLayoutModule->paperwidthLE,
|
|
|
|
|
dialog_->pageLayoutModule->paperwidthUnitCO);
|
2002-10-09 08:59:02 +00:00
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
params.paperheight = widgetsToLength(dialog_->pageLayoutModule->paperheightLE,
|
|
|
|
|
dialog_->pageLayoutModule->paperheightUnitCO);
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
if (dialog_->pageLayoutModule->facingPagesCB->isChecked())
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.sides = LyXTextClass::TwoSides;
|
2001-06-05 17:05:51 +00:00
|
|
|
|
else
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.sides = LyXTextClass::OneSide;
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
if (dialog_->pageLayoutModule->landscapeRB->isChecked())
|
2003-07-26 23:04:39 +00:00
|
|
|
|
params.orientation = ORIENTATION_LANDSCAPE;
|
2001-06-05 17:05:51 +00:00
|
|
|
|
else
|
2003-07-26 23:04:39 +00:00
|
|
|
|
params.orientation = ORIENTATION_PORTRAIT;
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// margins
|
|
|
|
|
params.use_geometry =
|
|
|
|
|
(dialog_->marginsModule->marginCO->currentItem() == 1);
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
|
int margin = dialog_->marginsModule->marginCO->currentItem();
|
2002-10-20 01:48:28 +00:00
|
|
|
|
if (margin > 0) {
|
2002-10-09 08:59:02 +00:00
|
|
|
|
margin = margin - 1;
|
2001-06-05 17:05:51 +00:00
|
|
|
|
}
|
2003-07-26 23:04:39 +00:00
|
|
|
|
params.paperpackage = PAPER_PACKAGES(margin);
|
2003-02-25 13:35:26 +00:00
|
|
|
|
|
|
|
|
|
// set params.papersize from params.papersize2
|
2003-02-12 17:05:56 +00:00
|
|
|
|
// and params.paperpackage
|
|
|
|
|
params.setPaperStuff();
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2002-11-13 00:52:15 +00:00
|
|
|
|
MarginsModuleBase const * m(dialog_->marginsModule);
|
2002-12-01 22:59:25 +00:00
|
|
|
|
|
2002-12-04 02:57:14 +00:00
|
|
|
|
params.leftmargin = widgetsToLength(m->innerLE, m->innerUnit);
|
|
|
|
|
|
|
|
|
|
params.topmargin = widgetsToLength(m->topLE, m->topUnit);
|
|
|
|
|
|
|
|
|
|
params.rightmargin = widgetsToLength(m->outerLE, m->outerUnit);
|
|
|
|
|
|
|
|
|
|
params.bottommargin = widgetsToLength(m->bottomLE, m->bottomUnit);
|
|
|
|
|
|
|
|
|
|
params.headheight = widgetsToLength(m->headheightLE, m->headheightUnit);
|
|
|
|
|
|
|
|
|
|
params.headsep = widgetsToLength(m->headsepLE, m->headsepUnit);
|
|
|
|
|
|
|
|
|
|
params.footskip = widgetsToLength(m->footskipLE, m->footskipUnit);
|
2001-03-23 06:31:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
|
namespace {
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
|
/** Return the position of val in the vector if found.
|
|
|
|
|
If not found, return 0.
|
|
|
|
|
*/
|
|
|
|
|
template<class A>
|
|
|
|
|
typename std::vector<A>::size_type
|
|
|
|
|
findPos(std::vector<A> const & vec, A const & val)
|
2001-03-23 06:31:30 +00:00
|
|
|
|
{
|
2002-10-09 08:59:02 +00:00
|
|
|
|
typename std::vector<A>::const_iterator it =
|
|
|
|
|
std::find(vec.begin(), vec.end(), val);
|
|
|
|
|
if (it == vec.end())
|
|
|
|
|
return 0;
|
|
|
|
|
return std::distance(vec.begin(), it);
|
2001-03-23 06:31:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
|
} // namespace anom
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
|
void QDocument::update_contents()
|
2001-03-23 06:31:30 +00:00
|
|
|
|
{
|
2002-10-09 08:59:02 +00:00
|
|
|
|
if (!dialog_.get())
|
2001-06-05 17:05:51 +00:00
|
|
|
|
return;
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
BufferParams const & params = controller().params();
|
|
|
|
|
|
2002-12-04 02:57:14 +00:00
|
|
|
|
// set the default unit
|
|
|
|
|
// FIXME: move to controller
|
|
|
|
|
LyXLength::UNIT defaultUnit = LyXLength::CM;
|
|
|
|
|
switch (lyxrc.default_papersize) {
|
2003-07-26 23:04:39 +00:00
|
|
|
|
case PAPER_DEFAULT: break;
|
2002-12-04 02:57:14 +00:00
|
|
|
|
|
2003-07-26 23:04:39 +00:00
|
|
|
|
case PAPER_USLETTER:
|
|
|
|
|
case PAPER_LEGALPAPER:
|
|
|
|
|
case PAPER_EXECUTIVEPAPER:
|
2002-12-04 02:57:14 +00:00
|
|
|
|
defaultUnit = LyXLength::IN;
|
|
|
|
|
break;
|
|
|
|
|
|
2003-07-26 23:04:39 +00:00
|
|
|
|
case PAPER_A3PAPER:
|
|
|
|
|
case PAPER_A4PAPER:
|
|
|
|
|
case PAPER_A5PAPER:
|
|
|
|
|
case PAPER_B5PAPER:
|
2002-12-04 02:57:14 +00:00
|
|
|
|
defaultUnit = LyXLength::CM;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// preamble
|
2002-12-17 20:37:13 +00:00
|
|
|
|
QString preamble = toqstr(params.preamble);
|
2002-10-09 08:59:02 +00:00
|
|
|
|
dialog_->preambleModule->preambleMLE->setText(preamble);
|
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// biblio
|
2002-10-09 08:59:02 +00:00
|
|
|
|
dialog_->biblioModule->natbibCB->setChecked(
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.use_natbib);
|
2002-10-09 08:59:02 +00:00
|
|
|
|
dialog_->biblioModule->citeStyleCO->setCurrentItem(
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.use_numerical_citations ? 1 : 0);
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// language & quotes
|
2002-10-09 08:59:02 +00:00
|
|
|
|
dialog_->langModule->singleQuoteRB->setChecked(
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.quotes_times == InsetQuotes::SingleQ);
|
2002-10-09 08:59:02 +00:00
|
|
|
|
dialog_->langModule->doubleQuoteRB->setChecked(
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.quotes_times == InsetQuotes::DoubleQ);
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
|
int const pos = int(findPos(lang_,
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.language->lang()));
|
2002-10-09 08:59:02 +00:00
|
|
|
|
dialog_->langModule->languageCO->setCurrentItem(pos);
|
|
|
|
|
|
|
|
|
|
dialog_->langModule->quoteStyleCO->setCurrentItem(
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.quotes_language);
|
2003-02-25 13:35:26 +00:00
|
|
|
|
|
2003-02-15 22:17:59 +00:00
|
|
|
|
dialog_->langModule->defaultencodingCB->setChecked(true);
|
|
|
|
|
|
|
|
|
|
if (params.inputenc != "auto") {
|
|
|
|
|
dialog_->langModule->defaultencodingCB->setChecked(false);
|
|
|
|
|
if (params.inputenc == "default") {
|
|
|
|
|
dialog_->langModule->encodingCO->setCurrentItem(0);
|
|
|
|
|
} else {
|
|
|
|
|
int i = 0;
|
|
|
|
|
while (encodings[i]) {
|
|
|
|
|
if (encodings[i] == params.inputenc)
|
|
|
|
|
dialog_->langModule->encodingCO->setCurrentItem(i);
|
|
|
|
|
++i;
|
|
|
|
|
}
|
|
|
|
|
}
|
2003-01-16 10:56:49 +00:00
|
|
|
|
}
|
2002-10-09 08:59:02 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// numbering
|
2003-03-29 03:46:27 +00:00
|
|
|
|
dialog_->numberingModule->tocSL->setValue(params.tocdepth);
|
|
|
|
|
dialog_->numberingModule->depthSL->setValue(params.secnumdepth);
|
|
|
|
|
dialog_->updateNumbering();
|
2002-10-09 08:59:02 +00:00
|
|
|
|
|
2002-11-08 00:09:00 +00:00
|
|
|
|
// bullets
|
2002-12-16 22:24:33 +00:00
|
|
|
|
dialog_->bulletsModule->setBullet(0,params.user_defined_bullets[0]);
|
|
|
|
|
dialog_->bulletsModule->setBullet(1,params.user_defined_bullets[1]);
|
|
|
|
|
dialog_->bulletsModule->setBullet(2,params.user_defined_bullets[2]);
|
|
|
|
|
dialog_->bulletsModule->setBullet(3,params.user_defined_bullets[3]);
|
2002-12-01 22:59:25 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// packages
|
2002-12-17 20:37:13 +00:00
|
|
|
|
QString text = toqstr(params.graphicsDriver);
|
2003-03-28 17:19:49 +00:00
|
|
|
|
int nitem = dialog_->latexModule->psdriverCO->count();
|
2002-10-19 10:32:57 +00:00
|
|
|
|
for (int n = 0; n < nitem ; ++n) {
|
2002-10-09 08:59:02 +00:00
|
|
|
|
QString enc = tex_graphics[n];
|
2002-10-19 10:32:57 +00:00
|
|
|
|
if (enc == text) {
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->latexModule->psdriverCO->setCurrentItem(n);
|
2001-06-05 17:05:51 +00:00
|
|
|
|
}
|
2001-03-29 15:02:19 +00:00
|
|
|
|
}
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->mathsModule->amsCB->setChecked(
|
2003-03-06 15:31:23 +00:00
|
|
|
|
params.use_amsmath == BufferParams::AMS_ON);
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->mathsModule->amsautoCB->setChecked(
|
2003-03-06 11:07:55 +00:00
|
|
|
|
params.use_amsmath == BufferParams::AMS_AUTO);
|
2002-10-09 08:59:02 +00:00
|
|
|
|
|
2002-11-28 01:21:52 +00:00
|
|
|
|
switch (params.spacing.getSpace()) {
|
|
|
|
|
case Spacing::Other: nitem = 3; break;
|
|
|
|
|
case Spacing::Double: nitem = 2; break;
|
|
|
|
|
case Spacing::Onehalf: nitem = 1; break;
|
|
|
|
|
case Spacing::Default: case Spacing::Single: nitem = 0; break;
|
|
|
|
|
}
|
2002-12-01 22:59:25 +00:00
|
|
|
|
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// layout
|
2003-05-03 19:24:36 +00:00
|
|
|
|
dialog_->latexModule->classCO->setCurrentItem(params.textclass);
|
2002-10-09 08:59:02 +00:00
|
|
|
|
|
|
|
|
|
dialog_->updateFontsize(controller().textClass().opt_fontsize(),
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.fontsize);
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
|
dialog_->updatePagestyle(controller().textClass().opt_pagestyle(),
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.pagestyle);
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2002-10-19 10:32:57 +00:00
|
|
|
|
for (int n = 0; tex_fonts[n][0]; ++n) {
|
2002-10-20 01:48:28 +00:00
|
|
|
|
if (tex_fonts[n] == params.fonts) {
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->textLayoutModule->fontsCO->setCurrentItem(n);
|
2002-10-09 08:59:02 +00:00
|
|
|
|
break;
|
2001-06-05 17:05:51 +00:00
|
|
|
|
}
|
2001-03-23 06:31:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->textLayoutModule->lspacingCO->setCurrentItem(nitem);
|
2003-01-16 10:56:49 +00:00
|
|
|
|
if (params.spacing.getSpace() == Spacing::Other) {
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->textLayoutModule->lspacingLE->setText(
|
2003-01-16 10:56:49 +00:00
|
|
|
|
toqstr(tostr(params.spacing.getValue())));
|
|
|
|
|
dialog_->setLSpacing(3);
|
|
|
|
|
}
|
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
if (params.paragraph_separation
|
2002-10-09 08:59:02 +00:00
|
|
|
|
== BufferParams::PARSEP_INDENT) {
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->textLayoutModule->indentRB->setChecked(true);
|
2002-10-09 08:59:02 +00:00
|
|
|
|
} else {
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->textLayoutModule->skipRB->setChecked(true);
|
2001-06-05 17:05:51 +00:00
|
|
|
|
}
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
|
int skip = 0;
|
2002-10-20 01:48:28 +00:00
|
|
|
|
switch (params.getDefSkip().kind()) {
|
2002-10-09 08:59:02 +00:00
|
|
|
|
case VSpace::SMALLSKIP:
|
|
|
|
|
skip = 0;
|
|
|
|
|
break;
|
|
|
|
|
case VSpace::MEDSKIP:
|
|
|
|
|
skip = 1;
|
|
|
|
|
break;
|
|
|
|
|
case VSpace::BIGSKIP:
|
|
|
|
|
skip = 2;
|
|
|
|
|
break;
|
|
|
|
|
case VSpace::LENGTH:
|
|
|
|
|
{
|
|
|
|
|
skip = 3;
|
2002-10-20 01:48:28 +00:00
|
|
|
|
string const length = params.getDefSkip().asLyXCommand();
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->textLayoutModule->skipLengthCO->setCurrentItem(LyXLength(length).unit());
|
|
|
|
|
dialog_->textLayoutModule->skipLE->setText(toqstr(tostr(LyXLength(length).value())));
|
2002-10-09 08:59:02 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|
skip = 0;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->textLayoutModule->skipCO->setCurrentItem(skip);
|
2002-10-09 08:59:02 +00:00
|
|
|
|
dialog_->setSkip(skip);
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->textLayoutModule->twoColumnCB->setChecked(
|
|
|
|
|
params.columns == 2);
|
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
if (!params.options.empty()) {
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->latexModule->optionsLE->setText(
|
2002-12-17 20:37:13 +00:00
|
|
|
|
toqstr(params.options));
|
2002-10-09 08:59:02 +00:00
|
|
|
|
} else {
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->latexModule->optionsLE->setText("");
|
2001-03-29 15:02:19 +00:00
|
|
|
|
}
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->floatModule->set(params.float_placement);
|
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// paper
|
|
|
|
|
int const psize = params.papersize2;
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->pageLayoutModule->papersizeCO->setCurrentItem(psize);
|
2002-10-09 08:59:02 +00:00
|
|
|
|
dialog_->setMargins(psize);
|
|
|
|
|
dialog_->setCustomPapersize(psize);
|
|
|
|
|
|
|
|
|
|
bool const landscape =
|
2003-07-26 23:04:39 +00:00
|
|
|
|
params.orientation == ORIENTATION_LANDSCAPE;
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->pageLayoutModule->landscapeRB->setChecked(landscape);
|
|
|
|
|
dialog_->pageLayoutModule->portraitRB->setChecked(!landscape);
|
2002-10-09 08:59:02 +00:00
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
dialog_->pageLayoutModule->facingPagesCB->setChecked(
|
2002-10-20 01:48:28 +00:00
|
|
|
|
params.sides == LyXTextClass::TwoSides);
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
lengthToWidgets(dialog_->pageLayoutModule->paperwidthLE,
|
|
|
|
|
dialog_->pageLayoutModule->paperwidthUnitCO, params.paperwidth, defaultUnit);
|
2002-10-09 08:59:02 +00:00
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
lengthToWidgets(dialog_->pageLayoutModule->paperheightLE,
|
|
|
|
|
dialog_->pageLayoutModule->paperheightUnitCO, params.paperheight, defaultUnit);
|
2002-10-15 18:29:01 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
// margins
|
2002-12-01 22:59:25 +00:00
|
|
|
|
|
2003-07-10 12:14:47 +00:00
|
|
|
|
MarginsModuleBase * m = dialog_->marginsModule;
|
2002-12-01 22:59:25 +00:00
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
int item = params.paperpackage;
|
|
|
|
|
if (params.use_geometry) {
|
2002-10-09 08:59:02 +00:00
|
|
|
|
item = 1;
|
2002-10-19 10:32:57 +00:00
|
|
|
|
} else if (item > 0) {
|
2002-10-09 08:59:02 +00:00
|
|
|
|
item = item + 1;
|
|
|
|
|
}
|
2002-11-13 00:52:15 +00:00
|
|
|
|
m->marginCO->setCurrentItem(item);
|
2002-10-09 08:59:02 +00:00
|
|
|
|
dialog_->setCustomMargins(item);
|
|
|
|
|
|
2002-12-04 02:57:14 +00:00
|
|
|
|
lengthToWidgets(m->topLE, m->topUnit,
|
|
|
|
|
params.topmargin, defaultUnit);
|
2002-11-13 00:52:15 +00:00
|
|
|
|
|
2002-12-04 02:57:14 +00:00
|
|
|
|
lengthToWidgets(m->bottomLE, m->bottomUnit,
|
|
|
|
|
params.bottommargin, defaultUnit);
|
2002-11-13 00:52:15 +00:00
|
|
|
|
|
2002-12-04 02:57:14 +00:00
|
|
|
|
lengthToWidgets(m->innerLE, m->innerUnit,
|
|
|
|
|
params.leftmargin, defaultUnit);
|
2002-11-13 00:52:15 +00:00
|
|
|
|
|
2002-12-04 02:57:14 +00:00
|
|
|
|
lengthToWidgets(m->outerLE, m->outerUnit,
|
|
|
|
|
params.rightmargin, defaultUnit);
|
2002-11-13 00:52:15 +00:00
|
|
|
|
|
2002-12-04 02:57:14 +00:00
|
|
|
|
lengthToWidgets(m->headheightLE, m->headheightUnit,
|
|
|
|
|
params.headheight, defaultUnit);
|
2002-11-13 00:52:15 +00:00
|
|
|
|
|
2002-12-04 02:57:14 +00:00
|
|
|
|
lengthToWidgets(m->headsepLE, m->headsepUnit,
|
|
|
|
|
params.headsep, defaultUnit);
|
2002-11-13 00:52:15 +00:00
|
|
|
|
|
2002-12-04 02:57:14 +00:00
|
|
|
|
lengthToWidgets(m->footskipLE, m->footskipUnit,
|
|
|
|
|
params.footskip, defaultUnit);
|
2002-10-15 18:29:01 +00:00
|
|
|
|
}
|
2002-11-07 15:48:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void QDocument::saveDocDefault()
|
|
|
|
|
{
|
|
|
|
|
// we have to apply the params first
|
|
|
|
|
apply();
|
|
|
|
|
controller().saveAsDefault();
|
|
|
|
|
}
|
|
|
|
|
|
2002-11-13 00:52:15 +00:00
|
|
|
|
|
2002-11-07 15:48:38 +00:00
|
|
|
|
void QDocument::useClassDefaults()
|
|
|
|
|
{
|
|
|
|
|
BufferParams & params = controller().params();
|
|
|
|
|
|
2003-03-28 17:19:49 +00:00
|
|
|
|
params.textclass = dialog_->latexModule->classCO->currentItem();
|
2002-11-07 15:48:38 +00:00
|
|
|
|
params.useClassDefaults();
|
|
|
|
|
update_contents();
|
|
|
|
|
}
|