]> git.lyx.org Git - features.git/blob - src/frontends/qt4/QDocumentDialog.C
930a722acc4912b4783dfe6d5a5a10548f2fcc7e
[features.git] / src / frontends / qt4 / QDocumentDialog.C
1 /**
2  * \file QDocumentDialog.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Edwin Leuven
7  * \author Abdelrazak Younes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14 #include "QDocument.h"
15 #include "QDocumentDialog.h"
16
17 #include <QCloseEvent>
18
19 #include "FloatPlacement.h"
20 #include "lengthcombo.h"
21 #include "validators.h"
22 #include "panelstack.h"
23 #include "Qt2BC.h"
24 #include "checkedwidgets.h"
25 #include "qt_helpers.h"
26
27 #include "bufferparams.h"
28 #include "gettext.h"
29 #include "helper_funcs.h" // getSecond()
30 #include "language.h"
31 #include "lyxrc.h" // defaultUnit
32 #include "lyxtextclasslist.h"
33 #include "tex-strings.h" // tex_graphics
34 #include "Spacing.h"
35
36 #include "controllers/ControlDocument.h"
37 #include "controllers/frnt_lang.h"
38
39 #include "support/lstrings.h"
40
41 #include "controllers/ControlDocument.h"
42 #include "controllers/frnt_lang.h"
43
44
45 using lyx::support::token;
46 using lyx::support::bformat;
47 using lyx::support::findToken;
48 using lyx::support::getVectorFromString;
49
50 using std::distance;
51 using std::vector;
52 using std::string;
53
54
55 namespace lyx {
56 namespace frontend {
57
58
59 namespace {
60
61 // FIXME: This list is incomplete. It should not be hardcoded but come from
62 // the available encodings in src/encodings.C
63 // FIXME: "default" is no valid encoding anymore. Nevertheless it occurs also
64 // in other source files.
65 char const * encodings[] = { "LaTeX default", "latin1", "latin2",
66         "latin3", "latin4", "latin5", "latin9",
67         "koi8-r", "koi8-u", "cp866", "cp1251",
68         "iso88595", "pt154", "utf8", 0
69 };
70
71 }
72
73 QDocumentDialog::QDocumentDialog(QDocument * form)
74         : form_(form),
75         lang_(getSecond(getLanguageData(false)))
76 {
77         setupUi(this);
78
79         connect(okPB, SIGNAL(clicked()),
80                 form, SLOT(slotOK()));
81         connect(applyPB, SIGNAL(clicked()),
82                 form, SLOT(slotApply()));
83         connect(closePB, SIGNAL(clicked()),
84                 form, SLOT(slotClose()));
85         connect(restorePB, SIGNAL(clicked()),
86                 form, SLOT(slotRestore()));
87
88
89         connect(savePB, SIGNAL( clicked() ), 
90                 this, SLOT( saveDefaultClicked() ) );
91         connect(defaultPB, SIGNAL( clicked() ), 
92                 this, SLOT( useDefaultsClicked() ) );
93
94         // Manage the restore, ok, apply, restore and cancel/close buttons
95         form_->bcview().setOK(okPB);
96         form_->bcview().setApply(applyPB);
97         form_->bcview().setCancel(closePB);
98         form_->bcview().setRestore(restorePB);
99
100
101         textLayoutModule = new UiWidget<Ui::TextLayoutUi>;
102         // text layout
103         connect(textLayoutModule->lspacingCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
104         connect(textLayoutModule->lspacingCO, SIGNAL(activated(int)), this, SLOT(setLSpacing(int)));
105         connect(textLayoutModule->lspacingLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
106         connect(textLayoutModule->skipRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
107         connect(textLayoutModule->indentRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
108         connect(textLayoutModule->skipCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
109         connect(textLayoutModule->skipLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
110         connect(textLayoutModule->skipLengthCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
111         connect(textLayoutModule->skipCO, SIGNAL(activated(int)), this, SLOT(setSkip(int)));
112         connect(textLayoutModule->skipRB, SIGNAL(toggled(bool)), this, SLOT(enableSkip(bool)));
113         connect(textLayoutModule->twoColumnCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
114         textLayoutModule->lspacingLE->setValidator(new QDoubleValidator(
115                 textLayoutModule->lspacingLE));
116         textLayoutModule->skipLE->setValidator(unsignedLengthValidator(
117                 textLayoutModule->skipLE));
118
119         textLayoutModule->skipCO->addItem(qt_("SmallSkip"));
120         textLayoutModule->skipCO->addItem(qt_("MedSkip"));
121         textLayoutModule->skipCO->addItem(qt_("BigSkip"));
122         textLayoutModule->skipCO->addItem(qt_("Length"));
123         // remove the %-items from the unit choice
124         textLayoutModule->skipLengthCO->noPercents();
125         textLayoutModule->lspacingCO->insertItem(
126                 Spacing::Single, qt_("Single"));
127         textLayoutModule->lspacingCO->insertItem(
128                 Spacing::Onehalf, qt_("OneHalf"));
129         textLayoutModule->lspacingCO->insertItem(
130                 Spacing::Double, qt_("Double"));
131         textLayoutModule->lspacingCO->insertItem(
132                 Spacing::Other, qt_("Custom"));
133
134         // initialize the length validator
135         addCheckedLineEdit(form_->bcview(), textLayoutModule->skipLE);
136
137
138
139
140         fontModule = new UiWidget<Ui::FontUi>;
141         // fonts
142         connect(fontModule->fontsRomanCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
143         connect(fontModule->fontsRomanCO, SIGNAL(activated(int)), this, SLOT(romanChanged(int)));
144         connect(fontModule->fontsSansCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
145         connect(fontModule->fontsSansCO, SIGNAL(activated(int)), this, SLOT(sansChanged(int)));
146         connect(fontModule->fontsTypewriterCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
147         connect(fontModule->fontsTypewriterCO, SIGNAL(activated(int)), this, SLOT(ttChanged(int)));
148         connect(fontModule->fontsDefaultCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
149         connect(fontModule->fontsizeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
150         connect(fontModule->scaleSansSB, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor()));
151         connect(fontModule->scaleTypewriterSB, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor()));
152         connect(fontModule->fontScCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
153         connect(fontModule->fontOsfCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
154
155         for (int n = 0; tex_fonts_roman[n][0]; ++n) {
156                 QString font = toqstr(tex_fonts_roman_gui[n]);
157                 if (!form_->controller().isFontAvailable(tex_fonts_roman[n]))
158                         font += qt_(" (not installed)");
159                 fontModule->fontsRomanCO->addItem(font);
160         }
161         for (int n = 0; tex_fonts_sans[n][0]; ++n) {
162                 QString font = toqstr(tex_fonts_sans_gui[n]);
163                 if (!form_->controller().isFontAvailable(tex_fonts_sans[n]))
164                         font += qt_(" (not installed)");
165                 fontModule->fontsSansCO->addItem(font);
166         }
167         for (int n = 0; tex_fonts_monospaced[n][0]; ++n) {
168                 QString font = toqstr(tex_fonts_monospaced_gui[n]);
169                 if (!form_->controller().isFontAvailable(tex_fonts_monospaced[n]))
170                         font += qt_(" (not installed)");
171                 fontModule->fontsTypewriterCO->addItem(font);
172         }
173
174         fontModule->fontsizeCO->addItem(qt_("default"));
175         fontModule->fontsizeCO->addItem(qt_("10"));
176         fontModule->fontsizeCO->addItem(qt_("11"));
177         fontModule->fontsizeCO->addItem(qt_("12"));
178
179         for (int n = 0; ControlDocument::fontfamilies_gui[n][0]; ++n)
180                 fontModule->fontsDefaultCO->addItem(
181                         qt_(ControlDocument::fontfamilies_gui[n]));
182
183
184
185
186         pageLayoutModule = new UiWidget<Ui::PageLayoutUi>;
187         // page layout
188         connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), this, SLOT(setCustomPapersize(int)));
189         connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), this, SLOT(setCustomPapersize(int)));
190         connect(pageLayoutModule->portraitRB, SIGNAL(toggled(bool)), this, SLOT(portraitChanged()));
191         connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
192         connect(pageLayoutModule->paperheightLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
193         connect(pageLayoutModule->paperwidthLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
194         connect(pageLayoutModule->paperwidthUnitCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
195         connect(pageLayoutModule->paperheightUnitCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
196         connect(pageLayoutModule->portraitRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
197         connect(pageLayoutModule->landscapeRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
198         connect(pageLayoutModule->facingPagesCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
199         connect(pageLayoutModule->pagestyleCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
200         pageLayoutModule->pagestyleCO->addItem(qt_("default"));
201         pageLayoutModule->pagestyleCO->addItem(qt_("empty"));
202         pageLayoutModule->pagestyleCO->addItem(qt_("plain"));
203         pageLayoutModule->pagestyleCO->addItem(qt_("headings"));
204         pageLayoutModule->pagestyleCO->addItem(qt_("fancy"));
205         addCheckedLineEdit(form_->bcview(), pageLayoutModule->paperheightLE,
206                 pageLayoutModule->paperheightL);
207         addCheckedLineEdit(form_->bcview(), pageLayoutModule->paperwidthLE,
208                 pageLayoutModule->paperwidthL);
209
210         // paper
211         QComboBox * cb = pageLayoutModule->papersizeCO;
212         cb->addItem(qt_("Default"));
213         cb->addItem(qt_("Custom"));
214         cb->addItem(qt_("US letter"));
215         cb->addItem(qt_("US legal"));
216         cb->addItem(qt_("US executive"));
217         cb->addItem(qt_("A3"));
218         cb->addItem(qt_("A4"));
219         cb->addItem(qt_("A5"));
220         cb->addItem(qt_("B3"));
221         cb->addItem(qt_("B4"));
222         cb->addItem(qt_("B5"));
223         // remove the %-items from the unit choice
224         pageLayoutModule->paperwidthUnitCO->noPercents();
225         pageLayoutModule->paperheightUnitCO->noPercents();
226         pageLayoutModule->paperheightLE->setValidator(unsignedLengthValidator(
227                 pageLayoutModule->paperheightLE));
228         pageLayoutModule->paperwidthLE->setValidator(unsignedLengthValidator(
229                 pageLayoutModule->paperwidthLE));
230
231
232
233
234         marginsModule = new UiWidget<Ui::MarginsUi>;
235         // margins
236         connect(marginsModule->marginCB, SIGNAL(toggled(bool)), this, SLOT(setCustomMargins(bool)));
237         connect(marginsModule->marginCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
238         connect(marginsModule->topLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
239         connect(marginsModule->topUnit, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
240         connect(marginsModule->bottomLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
241         connect(marginsModule->bottomUnit, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
242         connect(marginsModule->innerLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
243         connect(marginsModule->innerUnit, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
244         connect(marginsModule->outerLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
245         connect(marginsModule->outerUnit, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
246         connect(marginsModule->headheightLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
247         connect(marginsModule->headheightUnit, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
248         connect(marginsModule->headsepLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
249         connect(marginsModule->headsepUnit, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
250         connect(marginsModule->footskipLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
251         connect(marginsModule->footskipUnit, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
252         marginsModule->topLE->setValidator(unsignedLengthValidator(
253                 marginsModule->topLE));
254         marginsModule->bottomLE->setValidator(unsignedLengthValidator(
255                 marginsModule->bottomLE));
256         marginsModule->innerLE->setValidator(unsignedLengthValidator(
257                 marginsModule->innerLE));
258         marginsModule->outerLE->setValidator(unsignedLengthValidator(
259                 marginsModule->outerLE));
260         marginsModule->headsepLE->setValidator(unsignedLengthValidator(
261                 marginsModule->headsepLE));
262         marginsModule->headheightLE->setValidator(unsignedLengthValidator(
263                 marginsModule->headheightLE));
264         marginsModule->footskipLE->setValidator(unsignedLengthValidator(
265                 marginsModule->footskipLE));
266
267         addCheckedLineEdit(form_->bcview(), marginsModule->topLE,
268                 marginsModule->topL);
269         addCheckedLineEdit(form_->bcview(), marginsModule->bottomLE,
270                 marginsModule->bottomL);
271         addCheckedLineEdit(form_->bcview(), marginsModule->innerLE,
272                 marginsModule->innerL);
273         addCheckedLineEdit(form_->bcview(), marginsModule->outerLE,
274                 marginsModule->outerL);
275         addCheckedLineEdit(form_->bcview(), marginsModule->headsepLE,
276                 marginsModule->headsepL);
277         addCheckedLineEdit(form_->bcview(), marginsModule->headheightLE,
278                 marginsModule->headheightL);
279         addCheckedLineEdit(form_->bcview(), marginsModule->footskipLE,
280                 marginsModule->footskipL);
281
282
283
284
285
286         langModule = new UiWidget<Ui::LanguageUi>;
287     connect( langModule->defaultencodingCB, SIGNAL( toggled(bool) ), langModule->encodingL, SLOT( setDisabled(bool) ) );
288     connect( langModule->defaultencodingCB, SIGNAL( toggled(bool) ), langModule->encodingCO, SLOT( setDisabled(bool) ) );
289         // language & quote
290         connect(langModule->languageCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
291         connect(langModule->defaultencodingCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
292         connect(langModule->encodingCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
293         connect(langModule->quoteStyleCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
294         // language & quotes
295         vector<LanguagePair> const langs = getLanguageData(false);
296         vector<LanguagePair>::const_iterator lit  = langs.begin();
297         vector<LanguagePair>::const_iterator lend = langs.end();
298         for (; lit != lend; ++lit) {
299                 langModule->languageCO->addItem(
300                         toqstr(lit->first));
301         }
302
303         int k = 0;
304         while (encodings[k]) {
305                 langModule->encodingCO->addItem(qt_(encodings[k++]));
306         }
307
308         langModule->quoteStyleCO->addItem(qt_("``text''"));
309         langModule->quoteStyleCO->addItem(qt_("''text''"));
310         langModule->quoteStyleCO->addItem(qt_(",,text``"));
311         langModule->quoteStyleCO->addItem(qt_(",,text''"));
312         langModule->quoteStyleCO->addItem(qt_("<<text>>"));
313         langModule->quoteStyleCO->addItem(qt_(">>text<<"));
314
315
316
317         numberingModule = new UiWidget<Ui::NumberingUi>;
318         // numbering
319         connect(numberingModule->depthSL, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor()));
320         connect(numberingModule->tocSL, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor()));
321         connect(numberingModule->depthSL, SIGNAL(valueChanged(int)), this, SLOT(updateNumbering()));
322         connect(numberingModule->tocSL, SIGNAL(valueChanged(int)), this, SLOT(updateNumbering()));
323         numberingModule->tocTW->setColumnCount(3);
324         numberingModule->tocTW->headerItem()->setText(0, qt_("Example"));
325         numberingModule->tocTW->headerItem()->setText(1, qt_("Numbered"));
326         numberingModule->tocTW->headerItem()->setText(2, qt_("Appears in TOC"));
327
328
329         biblioModule = new UiWidget<Ui::BiblioUi>;
330         connect( biblioModule->citeNatbibRB, SIGNAL( toggled(bool) ), biblioModule->citationStyleL, SLOT( setEnabled(bool) ) );
331         connect( biblioModule->citeNatbibRB, SIGNAL( toggled(bool) ), biblioModule->citeStyleCO, SLOT( setEnabled(bool) ) );
332         // biblio
333         connect(biblioModule->citeDefaultRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
334         connect(biblioModule->citeNatbibRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
335         connect(biblioModule->citeStyleCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
336         connect(biblioModule->citeJurabibRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
337         connect(biblioModule->bibtopicCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
338         // biblio
339         biblioModule->citeStyleCO->addItem(qt_("Author-year"));
340         biblioModule->citeStyleCO->addItem(qt_("Numerical"));
341         biblioModule->citeStyleCO->setCurrentIndex(0);
342
343
344
345         mathsModule = new UiWidget<Ui::MathsUi>;
346     connect( mathsModule->amsautoCB, SIGNAL( toggled(bool) ), mathsModule->amsCB, SLOT( setDisabled(bool) ) );
347         // maths
348         connect(mathsModule->amsCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
349         connect(mathsModule->amsautoCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
350
351
352         latexModule = new UiWidget<Ui::LaTeXUi>;
353         // latex class
354         connect(latexModule->classCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
355         connect(latexModule->optionsLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
356         connect(latexModule->psdriverCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
357         connect(latexModule->classCO, SIGNAL(activated(int)), this, SLOT(classChanged()));
358         // packages
359         for (int n = 0; tex_graphics[n][0]; ++n) {
360                 QString enc = tex_graphics[n];
361                 latexModule->psdriverCO->addItem(enc);
362         }
363         // latex
364         for (LyXTextClassList::const_iterator cit = textclasslist.begin();
365              cit != textclasslist.end(); ++cit) {
366                 if (cit->isTeXClassAvailable()) {
367                         latexModule->classCO->addItem(toqstr(cit->description()));
368                 } else {
369                         docstring item =
370                                 bformat(_("Unavailable: %1$s"), lyx::from_utf8(cit->description()));
371                         latexModule->classCO->addItem(toqstr(item));
372                 }
373         }
374
375         // branches
376         branchesModule = new QBranches;
377         connect(branchesModule, SIGNAL(changed()), this, SLOT(change_adaptor()));
378
379         // preamble
380         preambleModule = new UiWidget<Ui::PreambleUi>;
381         connect(preambleModule->preambleTE, SIGNAL(textChanged()), this, SLOT(change_adaptor()));
382
383
384         // bullets
385         bulletsModule = new BulletsModule;
386         connect(bulletsModule, SIGNAL(changed()), this, SLOT(change_adaptor()));
387
388
389         // float
390         floatModule = new FloatPlacement;
391         connect(floatModule, SIGNAL(changed()), this, SLOT(change_adaptor()));
392
393         docPS->addPanel(latexModule, _("Document Class"));
394         docPS->addPanel(fontModule, _("Fonts"));
395         docPS->addPanel(textLayoutModule, _("Text Layout"));
396         docPS->addPanel(pageLayoutModule, _("Page Layout"));
397         docPS->addPanel(marginsModule, _("Page Margins"));
398         docPS->addPanel(langModule, _("Language"));
399         docPS->addPanel(numberingModule, _("Numbering & TOC"));
400         docPS->addPanel(biblioModule, _("Bibliography"));
401         docPS->addPanel(mathsModule, _("Math Options"));
402         docPS->addPanel(floatModule, _("Float Placement"));
403         docPS->addPanel(bulletsModule, _("Bullets"));
404         docPS->addPanel(branchesModule, _("Branches"));
405         docPS->addPanel(preambleModule, _("LaTeX Preamble"));
406         docPS->setCurrentPanel(_("Document Class"));
407 }
408
409
410 QDocumentDialog::~QDocumentDialog()
411 {
412 }
413
414
415 void QDocumentDialog::showPreamble()
416 {
417         docPS->setCurrentPanel(_("LaTeX Preamble"));
418 }
419
420
421 void QDocumentDialog::saveDefaultClicked()
422 {
423         form_->saveDocDefault();
424 }
425
426
427 void QDocumentDialog::useDefaultsClicked()
428 {
429         form_->useClassDefaults();
430 }
431
432
433 void QDocumentDialog::change_adaptor()
434 {
435         form_->changed();
436 }
437
438
439 void QDocumentDialog::closeEvent(QCloseEvent * e)
440 {
441         form_->slotWMHide();
442         e->accept();
443 }
444
445
446 void QDocumentDialog::setLSpacing(int item)
447 {
448         textLayoutModule->lspacingLE->setEnabled(item == 3);
449 }
450
451
452 void QDocumentDialog::setSkip(int item)
453 {
454         bool const enable = (item == 3);
455         textLayoutModule->skipLE->setEnabled(enable);
456         textLayoutModule->skipLengthCO->setEnabled(enable);
457 }
458
459
460 void QDocumentDialog::enableSkip(bool skip)
461 {
462         textLayoutModule->skipCO->setEnabled(skip);
463         textLayoutModule->skipLE->setEnabled(skip);
464         textLayoutModule->skipLengthCO->setEnabled(skip);
465         if (skip)
466                 setSkip(textLayoutModule->skipCO->currentIndex());
467 }
468
469 void QDocumentDialog::portraitChanged()
470 {
471         setMargins(pageLayoutModule->papersizeCO->currentIndex());
472 }
473
474 void QDocumentDialog::setMargins(bool custom)
475 {
476         marginsModule->marginCB->setChecked(custom);
477         setCustomMargins(custom);
478 }
479
480
481 void QDocumentDialog::setCustomPapersize(int papersize)
482 {
483         bool const custom = (papersize == 1);
484
485         pageLayoutModule->paperwidthL->setEnabled(custom);
486         pageLayoutModule->paperwidthLE->setEnabled(custom);
487         pageLayoutModule->paperwidthUnitCO->setEnabled(custom);
488         pageLayoutModule->paperheightL->setEnabled(custom);
489         pageLayoutModule->paperheightLE->setEnabled(custom);
490         pageLayoutModule->paperheightLE->setFocus();
491         pageLayoutModule->paperheightUnitCO->setEnabled(custom);
492 }
493
494
495 void QDocumentDialog::setCustomMargins(bool custom)
496 {
497         marginsModule->topL->setEnabled(!custom);
498         marginsModule->topLE->setEnabled(!custom);
499         marginsModule->topUnit->setEnabled(!custom);
500
501         marginsModule->bottomL->setEnabled(!custom);
502         marginsModule->bottomLE->setEnabled(!custom);
503         marginsModule->bottomUnit->setEnabled(!custom);
504
505         marginsModule->innerL->setEnabled(!custom);
506         marginsModule->innerLE->setEnabled(!custom);
507         marginsModule->innerUnit->setEnabled(!custom);
508
509         marginsModule->outerL->setEnabled(!custom);
510         marginsModule->outerLE->setEnabled(!custom);
511         marginsModule->outerUnit->setEnabled(!custom);
512
513         marginsModule->headheightL->setEnabled(!custom);
514         marginsModule->headheightLE->setEnabled(!custom);
515         marginsModule->headheightUnit->setEnabled(!custom);
516
517         marginsModule->headsepL->setEnabled(!custom);
518         marginsModule->headsepLE->setEnabled(!custom);
519         marginsModule->headsepUnit->setEnabled(!custom);
520
521         marginsModule->footskipL->setEnabled(!custom);
522         marginsModule->footskipLE->setEnabled(!custom);
523         marginsModule->footskipUnit->setEnabled(!custom);
524 }
525
526
527 void QDocumentDialog::updateFontsize(string const & items, string const & sel)
528 {
529         fontModule->fontsizeCO->clear();
530         fontModule->fontsizeCO->addItem(qt_("default"));
531
532         for (int n = 0; !token(items,'|',n).empty(); ++n)
533                 fontModule->fontsizeCO->
534                         addItem(toqstr(token(items,'|',n)));
535
536         for (int n = 0; n < fontModule->fontsizeCO->count(); ++n) {
537                 if (fromqstr(fontModule->fontsizeCO->itemText(n)) == sel) {
538                         fontModule->fontsizeCO->setCurrentIndex(n);
539                         break;
540                 }
541         }
542 }
543
544
545 void QDocumentDialog::romanChanged(int item)
546 {
547         string const font = tex_fonts_roman[item];
548         
549         fontModule->fontScCB->setEnabled(
550                 form_->controller().providesSC(font));
551         fontModule->fontOsfCB->setEnabled(
552                 form_->controller().providesOSF(font));
553 }
554
555
556 void QDocumentDialog::sansChanged(int item)
557 {
558         string const font = tex_fonts_sans[item];
559         
560         fontModule->scaleSansSB->setEnabled(
561                 form_->controller().providesScale(font));
562 }
563
564
565 void QDocumentDialog::ttChanged(int item)
566 {
567         string const font = tex_fonts_monospaced[item];
568         
569         fontModule->scaleTypewriterSB->setEnabled(
570                 form_->controller().providesScale(font));
571 }
572
573
574 void QDocumentDialog::updatePagestyle(string const & items, string const & sel)
575 {
576         pageLayoutModule->pagestyleCO->clear();
577         pageLayoutModule->pagestyleCO->addItem("default");
578
579         for (int n=0; !token(items,'|',n).empty(); ++n)
580                 pageLayoutModule->pagestyleCO->
581                         addItem(toqstr(token(items,'|',n)));
582
583         for (int n = 0; n<pageLayoutModule->pagestyleCO->count(); ++n) {
584                 if (fromqstr(pageLayoutModule->pagestyleCO->itemText(n))==sel) {
585                         pageLayoutModule->pagestyleCO->setCurrentIndex(n);
586                         break;
587                 }
588         }
589 }
590
591
592 void QDocumentDialog::classChanged()
593 {
594         ControlDocument & cntrl = form_->controller();
595         BufferParams & params = cntrl.params();
596
597         lyx::textclass_type const tc = latexModule->classCO->currentIndex();
598
599         if (form_->controller().loadTextclass(tc)) {
600                 params.textclass = tc;
601                 if (lyxrc.auto_reset_options)
602                         params.useClassDefaults();
603                 form_->update_contents();
604         } else {
605                 latexModule->classCO->setCurrentIndex(params.textclass);
606         }
607 }
608
609
610 void QDocumentDialog::updateNumbering()
611 {
612         LyXTextClass const & tclass =
613                 form_->controller().params().getLyXTextClass();
614
615         numberingModule->tocTW->setUpdatesEnabled(false);
616         numberingModule->tocTW->clear();
617
618         int const depth = numberingModule->depthSL->value();
619         int const toc = numberingModule->tocSL->value();
620         QString const no = qt_("No");
621         QString const yes = qt_("Yes");
622         LyXTextClass::const_iterator end = tclass.end();
623         LyXTextClass::const_iterator cit = tclass.begin();
624         QTreeWidgetItem * item = 0;
625         for ( ; cit != end ; ++cit) {
626                 int const toclevel = (*cit)->toclevel;
627                 if (toclevel != LyXLayout::NOT_IN_TOC 
628                     && (*cit)->labeltype == LABEL_COUNTER) {
629                         item = new QTreeWidgetItem(numberingModule->tocTW);
630                         item->setText(0, qt_((*cit)->name()));
631                         item->setText(1, (toclevel <= depth) ? yes : no);
632                         item->setText(2, (toclevel <= toc) ? yes : no);
633                 }
634         }
635
636         numberingModule->tocTW->setUpdatesEnabled(true);
637         numberingModule->tocTW->update();
638 }
639
640 void QDocumentDialog::apply(BufferParams & params)
641 {
642         // preamble
643         params.preamble =
644                 fromqstr(preambleModule->preambleTE->document()->toPlainText());
645
646         // biblio
647         params.cite_engine = biblio::ENGINE_BASIC;
648
649         if (biblioModule->citeNatbibRB->isChecked()) {
650                 bool const use_numerical_citations =
651                         biblioModule->citeStyleCO->currentIndex();
652                 if (use_numerical_citations)
653                         params.cite_engine = biblio::ENGINE_NATBIB_NUMERICAL;
654                 else
655                         params.cite_engine = biblio::ENGINE_NATBIB_AUTHORYEAR;
656
657         } else if (biblioModule->citeJurabibRB->isChecked())
658                 params.cite_engine = biblio::ENGINE_JURABIB;
659
660         params.use_bibtopic =
661                 biblioModule->bibtopicCB->isChecked();
662
663         // language & quotes
664         if (langModule->defaultencodingCB->isChecked()) {
665                 params.inputenc = "auto";
666         } else {
667                 int i = langModule->encodingCO->currentIndex();
668                 if (i == 0) {
669                         params.inputenc = "default";
670                 } else {
671                         params.inputenc = encodings[i];
672                 }
673         }
674
675         InsetQuotes::quote_language lga = InsetQuotes::EnglishQ;
676         switch (langModule->quoteStyleCO->currentIndex()) {
677         case 0:
678                 lga = InsetQuotes::EnglishQ;
679                 break;
680         case 1:
681                 lga = InsetQuotes::SwedishQ;
682                 break;
683         case 2:
684                 lga = InsetQuotes::GermanQ;
685                 break;
686         case 3:
687                 lga = InsetQuotes::PolishQ;
688                 break;
689         case 4:
690                 lga = InsetQuotes::FrenchQ;
691                 break;
692         case 5:
693                 lga = InsetQuotes::DanishQ;
694                 break;
695         }
696         params.quotes_language = lga;
697
698         int const pos = langModule->languageCO->currentIndex();
699         params.language = languages.getLanguage(lang_[pos]);
700
701         // numbering
702         if (params.getLyXTextClass().hasTocLevels()) {
703                 params.tocdepth = numberingModule->tocSL->value();
704                 params.secnumdepth = numberingModule->depthSL->value();
705         }
706
707         // bullets
708         params.user_defined_bullet(0) = bulletsModule->getBullet(0);
709         params.user_defined_bullet(1) = bulletsModule->getBullet(1);
710         params.user_defined_bullet(2) = bulletsModule->getBullet(2);
711         params.user_defined_bullet(3) = bulletsModule->getBullet(3);
712
713         // packages
714         params.graphicsDriver =
715                 fromqstr(latexModule->psdriverCO->currentText());
716
717         if (mathsModule->amsautoCB->isChecked()) {
718                 params.use_amsmath = BufferParams::AMS_AUTO;
719         } else {
720                 if (mathsModule->amsCB->isChecked())
721                         params.use_amsmath = BufferParams::AMS_ON;
722                 else
723                         params.use_amsmath = BufferParams::AMS_OFF;
724         }
725
726         // text layout
727         params.textclass =
728                 latexModule->classCO->currentIndex();
729
730         params.pagestyle =
731                 fromqstr(pageLayoutModule->pagestyleCO->currentText());
732
733         switch (textLayoutModule->lspacingCO->currentIndex()) {
734         case 0:
735                 params.spacing().set(Spacing::Single);
736                 break;
737         case 1:
738                 params.spacing().set(Spacing::Onehalf);
739                 break;
740         case 2:
741                 params.spacing().set(Spacing::Double);
742                 break;
743         case 3:
744                 params.spacing().set(Spacing::Other,
745                         fromqstr(textLayoutModule->lspacingLE->text()));
746                 break;
747         }
748
749         if (textLayoutModule->twoColumnCB->isChecked())
750                 params.columns = 2;
751         else
752                 params.columns = 1;
753
754         if (textLayoutModule->indentRB->isChecked())
755                 params.paragraph_separation = BufferParams::PARSEP_INDENT;
756         else
757                 params.paragraph_separation = BufferParams::PARSEP_SKIP;
758
759         switch (textLayoutModule->skipCO->currentIndex()) {
760         case 0:
761                 params.setDefSkip(VSpace(VSpace::SMALLSKIP));
762                 break;
763         case 1:
764                 params.setDefSkip(VSpace(VSpace::MEDSKIP));
765                 break;
766         case 2:
767                 params.setDefSkip(VSpace(VSpace::BIGSKIP));
768                 break;
769         case 3:
770         {
771                 VSpace vs = VSpace(
772                         widgetsToLength(textLayoutModule->skipLE,
773                                 textLayoutModule->skipLengthCO)
774                         );
775                 params.setDefSkip(vs);
776                 break;
777         }
778         default:
779                 // DocumentDefskipCB assures that this never happens
780                 // so Assert then !!!  - jbl
781                 params.setDefSkip(VSpace(VSpace::MEDSKIP));
782                 break;
783         }
784
785         params.options =
786                 fromqstr(latexModule->optionsLE->text());
787
788         params.float_placement = floatModule->get();
789
790         // fonts
791         params.fontsRoman =
792                 tex_fonts_roman[fontModule->fontsRomanCO->currentIndex()];
793
794         params.fontsSans =
795                 tex_fonts_sans[fontModule->fontsSansCO->currentIndex()];
796
797         params.fontsTypewriter =
798                 tex_fonts_monospaced[fontModule->fontsTypewriterCO->currentIndex()];
799
800         params.fontsSansScale = fontModule->scaleSansSB->value();
801
802         params.fontsTypewriterScale = fontModule->scaleTypewriterSB->value();
803
804         params.fontsSC = fontModule->fontScCB->isChecked();
805
806         params.fontsOSF = fontModule->fontOsfCB->isChecked();
807
808         params.fontsDefaultFamily = ControlDocument::fontfamilies[
809                 fontModule->fontsDefaultCO->currentIndex()];
810
811         if (fontModule->fontsizeCO->currentIndex() == 0)
812                 params.fontsize = "default";
813         else
814                 params.fontsize =
815                         fromqstr(fontModule->fontsizeCO->currentText());
816
817         // paper
818         params.papersize = PAPER_SIZE(
819                 pageLayoutModule->papersizeCO->currentIndex());
820
821         // custom, A3, B3 and B4 paper sizes need geometry
822         int psize = pageLayoutModule->papersizeCO->currentIndex();
823         bool geom_papersize = (psize == 1 || psize == 5 || psize == 8 || psize == 9);
824
825         params.paperwidth = widgetsToLength(pageLayoutModule->paperwidthLE,
826                 pageLayoutModule->paperwidthUnitCO);
827
828         params.paperheight = widgetsToLength(pageLayoutModule->paperheightLE,
829                 pageLayoutModule->paperheightUnitCO);
830
831         if (pageLayoutModule->facingPagesCB->isChecked())
832                 params.sides = LyXTextClass::TwoSides;
833         else
834                 params.sides = LyXTextClass::OneSide;
835
836         if (pageLayoutModule->landscapeRB->isChecked())
837                 params.orientation = ORIENTATION_LANDSCAPE;
838         else
839                 params.orientation = ORIENTATION_PORTRAIT;
840
841         // margins
842         params.use_geometry =
843                 (!marginsModule->marginCB->isChecked()
844                 || geom_papersize);
845
846         Ui::MarginsUi const * m(marginsModule);
847
848         params.leftmargin = widgetsToLength(m->innerLE, m->innerUnit);
849
850         params.topmargin = widgetsToLength(m->topLE, m->topUnit);
851
852         params.rightmargin = widgetsToLength(m->outerLE, m->outerUnit);
853
854         params.bottommargin = widgetsToLength(m->bottomLE, m->bottomUnit);
855
856         params.headheight = widgetsToLength(m->headheightLE, m->headheightUnit);
857
858         params.headsep = widgetsToLength(m->headsepLE, m->headsepUnit);
859
860         params.footskip = widgetsToLength(m->footskipLE, m->footskipUnit);
861
862         branchesModule->apply(params);
863 }
864
865 namespace {
866
867 /** Return the position of val in the vector if found.
868     If not found, return 0.
869  */
870 template<class A>
871 typename std::vector<A>::size_type
872 findPos(std::vector<A> const & vec, A const & val)
873 {
874         typename std::vector<A>::const_iterator it =
875                 std::find(vec.begin(), vec.end(), val);
876         if (it == vec.end())
877                 return 0;
878         return distance(vec.begin(), it);
879 }
880
881 } // namespace anom
882
883
884 void QDocumentDialog::update(BufferParams const & params)
885 {
886         // set the default unit
887         // FIXME: move to controller
888         LyXLength::UNIT defaultUnit = LyXLength::CM;
889         switch (lyxrc.default_papersize) {
890                 case PAPER_DEFAULT: break;
891
892                 case PAPER_USLETTER:
893                 case PAPER_USLEGAL:
894                 case PAPER_USEXECUTIVE:
895                         defaultUnit = LyXLength::IN;
896                         break;
897
898                 case PAPER_A3:
899                 case PAPER_A4:
900                 case PAPER_A5:
901                 case PAPER_B3:
902                 case PAPER_B4:
903                 case PAPER_B5:
904                         defaultUnit = LyXLength::CM;
905                         break;
906                 case PAPER_CUSTOM:
907                         break;
908         }
909
910         // preamble
911         QString preamble = toqstr(params.preamble);
912         preambleModule->preambleTE->document()->setPlainText(preamble);
913
914         // biblio
915         biblioModule->citeDefaultRB->setChecked(
916                 params.cite_engine == biblio::ENGINE_BASIC);
917
918         biblioModule->citeNatbibRB->setChecked(
919                 params.cite_engine == biblio::ENGINE_NATBIB_NUMERICAL ||
920                 params.cite_engine == biblio::ENGINE_NATBIB_AUTHORYEAR);
921
922         biblioModule->citeStyleCO->setCurrentIndex(
923                 params.cite_engine == biblio::ENGINE_NATBIB_NUMERICAL);
924
925         biblioModule->citeJurabibRB->setChecked(
926                 params.cite_engine == biblio::ENGINE_JURABIB);
927
928         biblioModule->bibtopicCB->setChecked(
929                 params.use_bibtopic);
930
931         // language & quotes
932         int const pos = int(findPos(lang_,
933                                     params.language->lang()));
934         langModule->languageCO->setCurrentIndex(pos);
935
936         langModule->quoteStyleCO->setCurrentIndex(
937                 params.quotes_language);
938
939         langModule->defaultencodingCB->setChecked(true);
940
941         if (params.inputenc != "auto") {
942                 langModule->defaultencodingCB->setChecked(false);
943                 // FIXME: "default" is no valid encoding anymore
944                 if (params.inputenc == "default") {
945                         langModule->encodingCO->setCurrentIndex(0);
946                 } else {
947                         int i = 0;
948                         while (encodings[i]) {
949                                 if (encodings[i] == params.inputenc) {
950                                         langModule->encodingCO->setCurrentIndex(i);
951                                         break;
952                                 }
953                                 ++i;
954                         }
955                         // FIXME: possible data loss because of encodings is
956                         // incomplete
957                 }
958         }
959
960         // numbering
961         int const min_toclevel = form_->controller().textClass().min_toclevel();
962         int const max_toclevel = form_->controller().textClass().max_toclevel();
963         if (form_->controller().textClass().hasTocLevels()) {
964                 numberingModule->setEnabled(true);
965                 numberingModule->depthSL->setMinimum(min_toclevel - 1);
966                 numberingModule->depthSL->setMaximum(max_toclevel);
967                 numberingModule->depthSL->setValue(params.secnumdepth);
968                 numberingModule->tocSL->setMaximum(min_toclevel - 1);
969                 numberingModule->tocSL->setMaximum(max_toclevel);
970                 numberingModule->tocSL->setValue(params.tocdepth);
971                 updateNumbering();
972         } else {
973                 numberingModule->setEnabled(false);
974                 numberingModule->tocTW->clear();
975         }
976
977         // bullets
978         bulletsModule->setBullet(0, params.user_defined_bullet(0));
979         bulletsModule->setBullet(1, params.user_defined_bullet(1));
980         bulletsModule->setBullet(2, params.user_defined_bullet(2));
981         bulletsModule->setBullet(3, params.user_defined_bullet(3));
982         bulletsModule->init();
983
984         // packages
985         QString text = toqstr(params.graphicsDriver);
986         int nitem = latexModule->psdriverCO->count();
987         for (int n = 0; n < nitem ; ++n) {
988                 QString enc = tex_graphics[n];
989                 if (enc == text) {
990                         latexModule->psdriverCO->setCurrentIndex(n);
991                 }
992         }
993
994
995         mathsModule->amsCB->setChecked(
996                 params.use_amsmath == BufferParams::AMS_ON);
997         mathsModule->amsautoCB->setChecked(
998                 params.use_amsmath == BufferParams::AMS_AUTO);
999
1000         switch (params.spacing().getSpace()) {
1001                 case Spacing::Other: nitem = 3; break;
1002                 case Spacing::Double: nitem = 2; break;
1003                 case Spacing::Onehalf: nitem = 1; break;
1004                 case Spacing::Default: case Spacing::Single: nitem = 0; break;
1005         }
1006
1007         // text layout
1008         latexModule->classCO->setCurrentIndex(params.textclass);
1009
1010         updatePagestyle(form_->controller().textClass().opt_pagestyle(),
1011                                  params.pagestyle);
1012
1013         textLayoutModule->lspacingCO->setCurrentIndex(nitem);
1014         if (params.spacing().getSpace() == Spacing::Other) {
1015                 textLayoutModule->lspacingLE->setText(
1016                         toqstr(params.spacing().getValueAsString()));
1017         }
1018         setLSpacing(nitem);
1019
1020         if (params.paragraph_separation
1021             == BufferParams::PARSEP_INDENT) {
1022                 textLayoutModule->indentRB->setChecked(true);
1023         } else {
1024                 textLayoutModule->skipRB->setChecked(true);
1025         }
1026
1027         int skip = 0;
1028         switch (params.getDefSkip().kind()) {
1029         case VSpace::SMALLSKIP:
1030                 skip = 0;
1031                 break;
1032         case VSpace::MEDSKIP:
1033                 skip = 1;
1034                 break;
1035         case VSpace::BIGSKIP:
1036                 skip = 2;
1037                 break;
1038         case VSpace::LENGTH:
1039         {
1040                 skip = 3;
1041                 string const length = params.getDefSkip().asLyXCommand();
1042                 lengthToWidgets(textLayoutModule->skipLE,
1043                         textLayoutModule->skipLengthCO,
1044                         length, defaultUnit);
1045                 break;
1046         }
1047         default:
1048                 skip = 0;
1049                 break;
1050         }
1051         textLayoutModule->skipCO->setCurrentIndex(skip);
1052         setSkip(skip);
1053
1054         textLayoutModule->twoColumnCB->setChecked(
1055                 params.columns == 2);
1056
1057         if (!params.options.empty()) {
1058                 latexModule->optionsLE->setText(
1059                         toqstr(params.options));
1060         } else {
1061                 latexModule->optionsLE->setText("");
1062         }
1063
1064         floatModule->set(params.float_placement);
1065
1066         //fonts
1067         updateFontsize(form_->controller().textClass().opt_fontsize(),
1068                         params.fontsize);
1069
1070         int n = findToken(tex_fonts_roman, params.fontsRoman);
1071         if (n >= 0)
1072                 fontModule->fontsRomanCO->setCurrentIndex(n);
1073
1074         n = findToken(tex_fonts_sans, params.fontsSans);
1075         if (n >= 0)
1076                 fontModule->fontsSansCO->setCurrentIndex(n);
1077
1078         n = findToken(tex_fonts_monospaced, params.fontsTypewriter);
1079         if (n >= 0)
1080                 fontModule->fontsTypewriterCO->setCurrentIndex(n);
1081
1082         fontModule->fontScCB->setChecked(params.fontsSC);
1083         fontModule->fontOsfCB->setChecked(params.fontsOSF);
1084         fontModule->fontScCB->setEnabled(
1085                 form_->controller().providesSC(params.fontsRoman));
1086         fontModule->fontOsfCB->setEnabled(
1087                 form_->controller().providesOSF(params.fontsRoman));
1088         fontModule->scaleSansSB->setValue(params.fontsSansScale);
1089         fontModule->scaleTypewriterSB->setValue(
1090                 params.fontsTypewriterScale);
1091         fontModule->scaleSansSB->setEnabled(
1092                 form_->controller().providesScale(params.fontsSans));
1093         fontModule->scaleTypewriterSB->setEnabled(
1094                 form_->controller().providesScale(params.fontsTypewriter));
1095         n = findToken(ControlDocument::fontfamilies, params.fontsDefaultFamily);
1096         if (n >= 0)
1097                 fontModule->fontsDefaultCO->setCurrentIndex(n);
1098
1099         // paper
1100         int const psize = params.papersize;
1101         pageLayoutModule->papersizeCO->setCurrentIndex(psize);
1102         setCustomPapersize(psize);
1103
1104         bool const landscape =
1105                 params.orientation == ORIENTATION_LANDSCAPE;
1106         pageLayoutModule->landscapeRB->setChecked(landscape);
1107         pageLayoutModule->portraitRB->setChecked(!landscape);
1108
1109         pageLayoutModule->facingPagesCB->setChecked(
1110                 params.sides == LyXTextClass::TwoSides);
1111
1112
1113         lengthToWidgets(pageLayoutModule->paperwidthLE,
1114                 pageLayoutModule->paperwidthUnitCO, params.paperwidth, defaultUnit);
1115
1116         lengthToWidgets(pageLayoutModule->paperheightLE,
1117                 pageLayoutModule->paperheightUnitCO, params.paperheight, defaultUnit);
1118
1119         // margins
1120         Ui::MarginsUi * m = marginsModule;
1121
1122         setMargins(!params.use_geometry);
1123
1124         lengthToWidgets(m->topLE, m->topUnit,
1125                 params.topmargin, defaultUnit);
1126
1127         lengthToWidgets(m->bottomLE, m->bottomUnit,
1128                 params.bottommargin, defaultUnit);
1129
1130         lengthToWidgets(m->innerLE, m->innerUnit,
1131                 params.leftmargin, defaultUnit);
1132
1133         lengthToWidgets(m->outerLE, m->outerUnit,
1134                 params.rightmargin, defaultUnit);
1135
1136         lengthToWidgets(m->headheightLE, m->headheightUnit,
1137                 params.headheight, defaultUnit);
1138
1139         lengthToWidgets(m->headsepLE, m->headsepUnit,
1140                 params.headsep, defaultUnit);
1141
1142         lengthToWidgets(m->footskipLE, m->footskipUnit,
1143                 params.footskip, defaultUnit);
1144
1145         branchesModule->update(params);
1146 }
1147
1148
1149
1150
1151 } // namespace frontend
1152 } // namespace lyx
1153
1154 #include "QDocumentDialog_moc.cpp"