]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QDocumentDialog.C
* Painter.h:
[lyx.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", 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
376
377         branchesModule = new QBranches;
378         connect(branchesModule, SIGNAL(changed()), this, SLOT(change_adaptor()));
379
380
381         // preamble
382         preambleModule = new UiWidget<Ui::PreambleUi>;
383         connect(preambleModule->preambleTE, SIGNAL(textChanged()), this, SLOT(change_adaptor()));
384
385
386         // bullets
387         bulletsModule = new BulletsModule;
388         connect(bulletsModule, SIGNAL(changed()), this, SLOT(change_adaptor()));
389
390
391         // float
392         floatModule = new FloatPlacement;
393         connect(floatModule, SIGNAL(changed()), this, SLOT(change_adaptor()));
394
395         docPS->addPanel(latexModule, _("Document Class"));
396         docPS->addPanel(fontModule, _("Fonts"));
397         docPS->addPanel(textLayoutModule, _("Text Layout"));
398         docPS->addPanel(pageLayoutModule, _("Page Layout"));
399         docPS->addPanel(marginsModule, _("Page Margins"));
400         docPS->addPanel(langModule, _("Language"));
401         docPS->addPanel(numberingModule, _("Numbering & TOC"));
402         docPS->addPanel(biblioModule, _("Bibliography"));
403         docPS->addPanel(mathsModule, _("Math Options"));
404         docPS->addPanel(floatModule, _("Float Placement"));
405         docPS->addPanel(bulletsModule, _("Bullets"));
406         docPS->addPanel(branchesModule, _("Branches"));
407         docPS->addPanel(preambleModule, _("LaTeX Preamble"));
408         docPS->setCurrentPanel(_("Document Class"));
409 }
410
411
412 QDocumentDialog::~QDocumentDialog()
413 {
414 }
415
416
417 void QDocumentDialog::showPreamble()
418 {
419         docPS->setCurrentPanel(_("LaTeX Preamble"));
420 }
421
422
423 void QDocumentDialog::saveDefaultClicked()
424 {
425         form_->saveDocDefault();
426 }
427
428
429 void QDocumentDialog::useDefaultsClicked()
430 {
431         form_->useClassDefaults();
432 }
433
434
435 void QDocumentDialog::change_adaptor()
436 {
437         form_->changed();
438 }
439
440
441 void QDocumentDialog::closeEvent(QCloseEvent * e)
442 {
443         form_->slotWMHide();
444         e->accept();
445 }
446
447
448 void QDocumentDialog::setLSpacing(int item)
449 {
450         textLayoutModule->lspacingLE->setEnabled(item == 3);
451 }
452
453
454 void QDocumentDialog::setSkip(int item)
455 {
456         bool const enable = (item == 3);
457         textLayoutModule->skipLE->setEnabled(enable);
458         textLayoutModule->skipLengthCO->setEnabled(enable);
459 }
460
461
462 void QDocumentDialog::enableSkip(bool skip)
463 {
464         textLayoutModule->skipCO->setEnabled(skip);
465         textLayoutModule->skipLE->setEnabled(skip);
466         textLayoutModule->skipLengthCO->setEnabled(skip);
467         if (skip)
468                 setSkip(textLayoutModule->skipCO->currentIndex());
469 }
470
471 void QDocumentDialog::portraitChanged()
472 {
473         setMargins(pageLayoutModule->papersizeCO->currentIndex());
474 }
475
476 void QDocumentDialog::setMargins(bool custom)
477 {
478         marginsModule->marginCB->setChecked(custom);
479         setCustomMargins(custom);
480 }
481
482
483 void QDocumentDialog::setCustomPapersize(int papersize)
484 {
485         bool const custom = (papersize == 1);
486
487         pageLayoutModule->paperwidthL->setEnabled(custom);
488         pageLayoutModule->paperwidthLE->setEnabled(custom);
489         pageLayoutModule->paperwidthUnitCO->setEnabled(custom);
490         pageLayoutModule->paperheightL->setEnabled(custom);
491         pageLayoutModule->paperheightLE->setEnabled(custom);
492         pageLayoutModule->paperheightLE->setFocus();
493         pageLayoutModule->paperheightUnitCO->setEnabled(custom);
494 }
495
496
497 void QDocumentDialog::setCustomMargins(bool custom)
498 {
499         marginsModule->topL->setEnabled(!custom);
500         marginsModule->topLE->setEnabled(!custom);
501         marginsModule->topUnit->setEnabled(!custom);
502
503         marginsModule->bottomL->setEnabled(!custom);
504         marginsModule->bottomLE->setEnabled(!custom);
505         marginsModule->bottomUnit->setEnabled(!custom);
506
507         marginsModule->innerL->setEnabled(!custom);
508         marginsModule->innerLE->setEnabled(!custom);
509         marginsModule->innerUnit->setEnabled(!custom);
510
511         marginsModule->outerL->setEnabled(!custom);
512         marginsModule->outerLE->setEnabled(!custom);
513         marginsModule->outerUnit->setEnabled(!custom);
514
515         marginsModule->headheightL->setEnabled(!custom);
516         marginsModule->headheightLE->setEnabled(!custom);
517         marginsModule->headheightUnit->setEnabled(!custom);
518
519         marginsModule->headsepL->setEnabled(!custom);
520         marginsModule->headsepLE->setEnabled(!custom);
521         marginsModule->headsepUnit->setEnabled(!custom);
522
523         marginsModule->footskipL->setEnabled(!custom);
524         marginsModule->footskipLE->setEnabled(!custom);
525         marginsModule->footskipUnit->setEnabled(!custom);
526 }
527
528
529 void QDocumentDialog::updateFontsize(string const & items, string const & sel)
530 {
531         fontModule->fontsizeCO->clear();
532         fontModule->fontsizeCO->addItem(qt_("default"));
533
534         for (int n = 0; !token(items,'|',n).empty(); ++n)
535                 fontModule->fontsizeCO->
536                         addItem(toqstr(token(items,'|',n)));
537
538         for (int n = 0; n < fontModule->fontsizeCO->count(); ++n) {
539                 if (fromqstr(fontModule->fontsizeCO->itemText(n)) == sel) {
540                         fontModule->fontsizeCO->setCurrentIndex(n);
541                         break;
542                 }
543         }
544 }
545
546
547 void QDocumentDialog::romanChanged(int item)
548 {
549         string const font = tex_fonts_roman[item];
550         
551         fontModule->fontScCB->setEnabled(
552                 form_->controller().providesSC(font));
553         fontModule->fontOsfCB->setEnabled(
554                 form_->controller().providesOSF(font));
555 }
556
557
558 void QDocumentDialog::sansChanged(int item)
559 {
560         string const font = tex_fonts_sans[item];
561         
562         fontModule->scaleSansSB->setEnabled(
563                 form_->controller().providesScale(font));
564 }
565
566
567 void QDocumentDialog::ttChanged(int item)
568 {
569         string const font = tex_fonts_monospaced[item];
570         
571         fontModule->scaleTypewriterSB->setEnabled(
572                 form_->controller().providesScale(font));
573 }
574
575
576 void QDocumentDialog::updatePagestyle(string const & items, string const & sel)
577 {
578         pageLayoutModule->pagestyleCO->clear();
579         pageLayoutModule->pagestyleCO->addItem("default");
580
581         for (int n=0; !token(items,'|',n).empty(); ++n)
582                 pageLayoutModule->pagestyleCO->
583                         addItem(toqstr(token(items,'|',n)));
584
585         for (int n = 0; n<pageLayoutModule->pagestyleCO->count(); ++n) {
586                 if (fromqstr(pageLayoutModule->pagestyleCO->itemText(n))==sel) {
587                         pageLayoutModule->pagestyleCO->setCurrentIndex(n);
588                         break;
589                 }
590         }
591 }
592
593
594 void QDocumentDialog::classChanged()
595 {
596         ControlDocument & cntrl = form_->controller();
597         BufferParams & params = cntrl.params();
598
599         lyx::textclass_type const tc = latexModule->classCO->currentIndex();
600
601         if (form_->controller().loadTextclass(tc)) {
602                 params.textclass = tc;
603                 if (lyxrc.auto_reset_options)
604                         params.useClassDefaults();
605                 form_->update_contents();
606         } else {
607                 latexModule->classCO->setCurrentIndex(params.textclass);
608         }
609 }
610
611
612 void QDocumentDialog::updateNumbering()
613 {
614         LyXTextClass const & tclass =
615                 form_->controller().params().getLyXTextClass();
616
617         numberingModule->tocTW->setUpdatesEnabled(false);
618         numberingModule->tocTW->clear();
619
620         int const depth = numberingModule->depthSL->value();
621         int const toc = numberingModule->tocSL->value();
622         QString const no = qt_("No");
623         QString const yes = qt_("Yes");
624         LyXTextClass::const_iterator end = tclass.end();
625         LyXTextClass::const_iterator cit = tclass.begin();
626         QTreeWidgetItem * item = 0;
627         for ( ; cit != end ; ++cit) {
628                 int const toclevel = (*cit)->toclevel;
629                 if (toclevel != LyXLayout::NOT_IN_TOC 
630                     && (*cit)->labeltype == LABEL_COUNTER) {
631                         item = new QTreeWidgetItem(numberingModule->tocTW);
632                         item->setText(0, qt_((*cit)->name()));
633                         item->setText(1, (toclevel <= depth) ? yes : no);
634                         item->setText(2, (toclevel <= toc) ? yes : no);
635                 }
636         }
637
638         numberingModule->tocTW->setUpdatesEnabled(true);
639         numberingModule->tocTW->update();
640 }
641
642 void QDocumentDialog::apply(BufferParams & params)
643 {
644         // preamble
645         params.preamble =
646                 fromqstr(preambleModule->preambleTE->document()->toPlainText());
647
648         // biblio
649         params.cite_engine = biblio::ENGINE_BASIC;
650
651         if (biblioModule->citeNatbibRB->isChecked()) {
652                 bool const use_numerical_citations =
653                         biblioModule->citeStyleCO->currentIndex();
654                 if (use_numerical_citations)
655                         params.cite_engine = biblio::ENGINE_NATBIB_NUMERICAL;
656                 else
657                         params.cite_engine = biblio::ENGINE_NATBIB_AUTHORYEAR;
658
659         } else if (biblioModule->citeJurabibRB->isChecked())
660                 params.cite_engine = biblio::ENGINE_JURABIB;
661
662         params.use_bibtopic =
663                 biblioModule->bibtopicCB->isChecked();
664
665         // language & quotes
666         if (langModule->defaultencodingCB->isChecked()) {
667                 params.inputenc = "auto";
668         } else {
669                 int i = langModule->encodingCO->currentIndex();
670                 if (i == 0) {
671                         params.inputenc = "default";
672                 } else {
673                         params.inputenc = encodings[i];
674                 }
675         }
676
677         InsetQuotes::quote_language lga = InsetQuotes::EnglishQ;
678         switch (langModule->quoteStyleCO->currentIndex()) {
679         case 0:
680                 lga = InsetQuotes::EnglishQ;
681                 break;
682         case 1:
683                 lga = InsetQuotes::SwedishQ;
684                 break;
685         case 2:
686                 lga = InsetQuotes::GermanQ;
687                 break;
688         case 3:
689                 lga = InsetQuotes::PolishQ;
690                 break;
691         case 4:
692                 lga = InsetQuotes::FrenchQ;
693                 break;
694         case 5:
695                 lga = InsetQuotes::DanishQ;
696                 break;
697         }
698         params.quotes_language = lga;
699
700         int const pos = langModule->languageCO->currentIndex();
701         params.language = languages.getLanguage(lang_[pos]);
702
703         // numbering
704         if (params.getLyXTextClass().hasTocLevels()) {
705                 params.tocdepth = numberingModule->tocSL->value();
706                 params.secnumdepth = numberingModule->depthSL->value();
707         }
708
709         // bullets
710         params.user_defined_bullet(0) = bulletsModule->getBullet(0);
711         params.user_defined_bullet(1) = bulletsModule->getBullet(1);
712         params.user_defined_bullet(2) = bulletsModule->getBullet(2);
713         params.user_defined_bullet(3) = bulletsModule->getBullet(3);
714
715         // packages
716         params.graphicsDriver =
717                 fromqstr(latexModule->psdriverCO->currentText());
718
719         if (mathsModule->amsautoCB->isChecked()) {
720                 params.use_amsmath = BufferParams::AMS_AUTO;
721         } else {
722                 if (mathsModule->amsCB->isChecked())
723                         params.use_amsmath = BufferParams::AMS_ON;
724                 else
725                         params.use_amsmath = BufferParams::AMS_OFF;
726         }
727
728         // text layout
729         params.textclass =
730                 latexModule->classCO->currentIndex();
731
732         params.pagestyle =
733                 fromqstr(pageLayoutModule->pagestyleCO->currentText());
734
735         switch (textLayoutModule->lspacingCO->currentIndex()) {
736         case 0:
737                 params.spacing().set(Spacing::Single);
738                 break;
739         case 1:
740                 params.spacing().set(Spacing::Onehalf);
741                 break;
742         case 2:
743                 params.spacing().set(Spacing::Double);
744                 break;
745         case 3:
746                 params.spacing().set(Spacing::Other,
747                         fromqstr(textLayoutModule->lspacingLE->text()));
748                 break;
749         }
750
751         if (textLayoutModule->twoColumnCB->isChecked())
752                 params.columns = 2;
753         else
754                 params.columns = 1;
755
756         if (textLayoutModule->indentRB->isChecked())
757                 params.paragraph_separation = BufferParams::PARSEP_INDENT;
758         else
759                 params.paragraph_separation = BufferParams::PARSEP_SKIP;
760
761         switch (textLayoutModule->skipCO->currentIndex()) {
762         case 0:
763                 params.setDefSkip(VSpace(VSpace::SMALLSKIP));
764                 break;
765         case 1:
766                 params.setDefSkip(VSpace(VSpace::MEDSKIP));
767                 break;
768         case 2:
769                 params.setDefSkip(VSpace(VSpace::BIGSKIP));
770                 break;
771         case 3:
772         {
773                 VSpace vs = VSpace(
774                         widgetsToLength(textLayoutModule->skipLE,
775                                 textLayoutModule->skipLengthCO)
776                         );
777                 params.setDefSkip(vs);
778                 break;
779         }
780         default:
781                 // DocumentDefskipCB assures that this never happens
782                 // so Assert then !!!  - jbl
783                 params.setDefSkip(VSpace(VSpace::MEDSKIP));
784                 break;
785         }
786
787         params.options =
788                 fromqstr(latexModule->optionsLE->text());
789
790         params.float_placement = floatModule->get();
791
792         // fonts
793         params.fontsRoman =
794                 tex_fonts_roman[fontModule->fontsRomanCO->currentIndex()];
795
796         params.fontsSans =
797                 tex_fonts_sans[fontModule->fontsSansCO->currentIndex()];
798
799         params.fontsTypewriter =
800                 tex_fonts_monospaced[fontModule->fontsTypewriterCO->currentIndex()];
801
802         params.fontsSansScale = fontModule->scaleSansSB->value();
803
804         params.fontsTypewriterScale = fontModule->scaleTypewriterSB->value();
805
806         params.fontsSC = fontModule->fontScCB->isChecked();
807
808         params.fontsOSF = fontModule->fontOsfCB->isChecked();
809
810         params.fontsDefaultFamily = ControlDocument::fontfamilies[
811                 fontModule->fontsDefaultCO->currentIndex()];
812
813         if (fontModule->fontsizeCO->currentIndex() == 0)
814                 params.fontsize = "default";
815         else
816                 params.fontsize =
817                         fromqstr(fontModule->fontsizeCO->currentText());
818
819         // paper
820         params.papersize = PAPER_SIZE(
821                 pageLayoutModule->papersizeCO->currentIndex());
822
823         // custom, A3, B3 and B4 paper sizes need geometry
824         int psize = pageLayoutModule->papersizeCO->currentIndex();
825         bool geom_papersize = (psize == 1 || psize == 5 || psize == 8 || psize == 9);
826
827         params.paperwidth = widgetsToLength(pageLayoutModule->paperwidthLE,
828                 pageLayoutModule->paperwidthUnitCO);
829
830         params.paperheight = widgetsToLength(pageLayoutModule->paperheightLE,
831                 pageLayoutModule->paperheightUnitCO);
832
833         if (pageLayoutModule->facingPagesCB->isChecked())
834                 params.sides = LyXTextClass::TwoSides;
835         else
836                 params.sides = LyXTextClass::OneSide;
837
838         if (pageLayoutModule->landscapeRB->isChecked())
839                 params.orientation = ORIENTATION_LANDSCAPE;
840         else
841                 params.orientation = ORIENTATION_PORTRAIT;
842
843         // margins
844         params.use_geometry =
845                 (!marginsModule->marginCB->isChecked()
846                 || geom_papersize);
847
848         Ui::MarginsUi const * m(marginsModule);
849
850         params.leftmargin = widgetsToLength(m->innerLE, m->innerUnit);
851
852         params.topmargin = widgetsToLength(m->topLE, m->topUnit);
853
854         params.rightmargin = widgetsToLength(m->outerLE, m->outerUnit);
855
856         params.bottommargin = widgetsToLength(m->bottomLE, m->bottomUnit);
857
858         params.headheight = widgetsToLength(m->headheightLE, m->headheightUnit);
859
860         params.headsep = widgetsToLength(m->headsepLE, m->headsepUnit);
861
862         params.footskip = widgetsToLength(m->footskipLE, m->footskipUnit);
863
864         branchesModule->apply(params);
865 }
866
867 namespace {
868
869 /** Return the position of val in the vector if found.
870     If not found, return 0.
871  */
872 template<class A>
873 typename std::vector<A>::size_type
874 findPos(std::vector<A> const & vec, A const & val)
875 {
876         typename std::vector<A>::const_iterator it =
877                 std::find(vec.begin(), vec.end(), val);
878         if (it == vec.end())
879                 return 0;
880         return distance(vec.begin(), it);
881 }
882
883 } // namespace anom
884
885
886 void QDocumentDialog::update(BufferParams const & params)
887 {
888         // set the default unit
889         // FIXME: move to controller
890         LyXLength::UNIT defaultUnit = LyXLength::CM;
891         switch (lyxrc.default_papersize) {
892                 case PAPER_DEFAULT: break;
893
894                 case PAPER_USLETTER:
895                 case PAPER_USLEGAL:
896                 case PAPER_USEXECUTIVE:
897                         defaultUnit = LyXLength::IN;
898                         break;
899
900                 case PAPER_A3:
901                 case PAPER_A4:
902                 case PAPER_A5:
903                 case PAPER_B3:
904                 case PAPER_B4:
905                 case PAPER_B5:
906                         defaultUnit = LyXLength::CM;
907                         break;
908                 case PAPER_CUSTOM:
909                         break;
910         }
911
912         // preamble
913         QString preamble = toqstr(params.preamble);
914         preambleModule->preambleTE->document()->setPlainText(preamble);
915
916         // biblio
917         biblioModule->citeDefaultRB->setChecked(
918                 params.cite_engine == biblio::ENGINE_BASIC);
919
920         biblioModule->citeNatbibRB->setChecked(
921                 params.cite_engine == biblio::ENGINE_NATBIB_NUMERICAL ||
922                 params.cite_engine == biblio::ENGINE_NATBIB_AUTHORYEAR);
923
924         biblioModule->citeStyleCO->setCurrentIndex(
925                 params.cite_engine == biblio::ENGINE_NATBIB_NUMERICAL);
926
927         biblioModule->citeJurabibRB->setChecked(
928                 params.cite_engine == biblio::ENGINE_JURABIB);
929
930         biblioModule->bibtopicCB->setChecked(
931                 params.use_bibtopic);
932
933         // language & quotes
934         int const pos = int(findPos(lang_,
935                                     params.language->lang()));
936         langModule->languageCO->setCurrentIndex(pos);
937
938         langModule->quoteStyleCO->setCurrentIndex(
939                 params.quotes_language);
940
941         langModule->defaultencodingCB->setChecked(true);
942
943         if (params.inputenc != "auto") {
944                 langModule->defaultencodingCB->setChecked(false);
945                 // FIXME: "default" is no valid encoding anymore
946                 if (params.inputenc == "default") {
947                         langModule->encodingCO->setCurrentIndex(0);
948                 } else {
949                         int i = 0;
950                         while (encodings[i]) {
951                                 if (encodings[i] == params.inputenc) {
952                                         langModule->encodingCO->setCurrentIndex(i);
953                                         break;
954                                 }
955                                 ++i;
956                         }
957                         // FIXME: possible data loss because of encodings is
958                         // incomplete
959                 }
960         }
961
962         // numbering
963         int const min_toclevel = form_->controller().textClass().min_toclevel();
964         int const max_toclevel = form_->controller().textClass().max_toclevel();
965         if (form_->controller().textClass().hasTocLevels()) {
966                 numberingModule->setEnabled(true);
967                 numberingModule->depthSL->setMinimum(min_toclevel - 1);
968                 numberingModule->depthSL->setMaximum(max_toclevel);
969                 numberingModule->depthSL->setValue(params.secnumdepth);
970                 numberingModule->tocSL->setMaximum(min_toclevel - 1);
971                 numberingModule->tocSL->setMaximum(max_toclevel);
972                 numberingModule->tocSL->setValue(params.tocdepth);
973                 updateNumbering();
974         } else {
975                 numberingModule->setEnabled(false);
976                 numberingModule->tocTW->clear();
977         }
978
979         // bullets
980         bulletsModule->setBullet(0, params.user_defined_bullet(0));
981         bulletsModule->setBullet(1, params.user_defined_bullet(1));
982         bulletsModule->setBullet(2, params.user_defined_bullet(2));
983         bulletsModule->setBullet(3, params.user_defined_bullet(3));
984         bulletsModule->init();
985
986         // packages
987         QString text = toqstr(params.graphicsDriver);
988         int nitem = latexModule->psdriverCO->count();
989         for (int n = 0; n < nitem ; ++n) {
990                 QString enc = tex_graphics[n];
991                 if (enc == text) {
992                         latexModule->psdriverCO->setCurrentIndex(n);
993                 }
994         }
995
996
997         mathsModule->amsCB->setChecked(
998                 params.use_amsmath == BufferParams::AMS_ON);
999         mathsModule->amsautoCB->setChecked(
1000                 params.use_amsmath == BufferParams::AMS_AUTO);
1001
1002         switch (params.spacing().getSpace()) {
1003                 case Spacing::Other: nitem = 3; break;
1004                 case Spacing::Double: nitem = 2; break;
1005                 case Spacing::Onehalf: nitem = 1; break;
1006                 case Spacing::Default: case Spacing::Single: nitem = 0; break;
1007         }
1008
1009         // text layout
1010         latexModule->classCO->setCurrentIndex(params.textclass);
1011
1012         updatePagestyle(form_->controller().textClass().opt_pagestyle(),
1013                                  params.pagestyle);
1014
1015         textLayoutModule->lspacingCO->setCurrentIndex(nitem);
1016         if (params.spacing().getSpace() == Spacing::Other) {
1017                 textLayoutModule->lspacingLE->setText(
1018                         toqstr(params.spacing().getValueAsString()));
1019         }
1020         setLSpacing(nitem);
1021
1022         if (params.paragraph_separation
1023             == BufferParams::PARSEP_INDENT) {
1024                 textLayoutModule->indentRB->setChecked(true);
1025         } else {
1026                 textLayoutModule->skipRB->setChecked(true);
1027         }
1028
1029         int skip = 0;
1030         switch (params.getDefSkip().kind()) {
1031         case VSpace::SMALLSKIP:
1032                 skip = 0;
1033                 break;
1034         case VSpace::MEDSKIP:
1035                 skip = 1;
1036                 break;
1037         case VSpace::BIGSKIP:
1038                 skip = 2;
1039                 break;
1040         case VSpace::LENGTH:
1041         {
1042                 skip = 3;
1043                 string const length = params.getDefSkip().asLyXCommand();
1044                 lengthToWidgets(textLayoutModule->skipLE,
1045                         textLayoutModule->skipLengthCO,
1046                         length, defaultUnit);
1047                 break;
1048         }
1049         default:
1050                 skip = 0;
1051                 break;
1052         }
1053         textLayoutModule->skipCO->setCurrentIndex(skip);
1054         setSkip(skip);
1055
1056         textLayoutModule->twoColumnCB->setChecked(
1057                 params.columns == 2);
1058
1059         if (!params.options.empty()) {
1060                 latexModule->optionsLE->setText(
1061                         toqstr(params.options));
1062         } else {
1063                 latexModule->optionsLE->setText("");
1064         }
1065
1066         floatModule->set(params.float_placement);
1067
1068         //fonts
1069         updateFontsize(form_->controller().textClass().opt_fontsize(),
1070                         params.fontsize);
1071
1072         int n = findToken(tex_fonts_roman, params.fontsRoman);
1073         if (n >= 0)
1074                 fontModule->fontsRomanCO->setCurrentIndex(n);
1075
1076         n = findToken(tex_fonts_sans, params.fontsSans);
1077         if (n >= 0)
1078                 fontModule->fontsSansCO->setCurrentIndex(n);
1079
1080         n = findToken(tex_fonts_monospaced, params.fontsTypewriter);
1081         if (n >= 0)
1082                 fontModule->fontsTypewriterCO->setCurrentIndex(n);
1083
1084         fontModule->fontScCB->setChecked(params.fontsSC);
1085         fontModule->fontOsfCB->setChecked(params.fontsOSF);
1086         fontModule->fontScCB->setEnabled(
1087                 form_->controller().providesSC(params.fontsRoman));
1088         fontModule->fontOsfCB->setEnabled(
1089                 form_->controller().providesOSF(params.fontsRoman));
1090         fontModule->scaleSansSB->setValue(params.fontsSansScale);
1091         fontModule->scaleTypewriterSB->setValue(
1092                 params.fontsTypewriterScale);
1093         fontModule->scaleSansSB->setEnabled(
1094                 form_->controller().providesScale(params.fontsSans));
1095         fontModule->scaleTypewriterSB->setEnabled(
1096                 form_->controller().providesScale(params.fontsTypewriter));
1097         n = findToken(ControlDocument::fontfamilies, params.fontsDefaultFamily);
1098         if (n >= 0)
1099                 fontModule->fontsDefaultCO->setCurrentIndex(n);
1100
1101         // paper
1102         int const psize = params.papersize;
1103         pageLayoutModule->papersizeCO->setCurrentIndex(psize);
1104         setCustomPapersize(psize);
1105
1106         bool const landscape =
1107                 params.orientation == ORIENTATION_LANDSCAPE;
1108         pageLayoutModule->landscapeRB->setChecked(landscape);
1109         pageLayoutModule->portraitRB->setChecked(!landscape);
1110
1111         pageLayoutModule->facingPagesCB->setChecked(
1112                 params.sides == LyXTextClass::TwoSides);
1113
1114
1115         lengthToWidgets(pageLayoutModule->paperwidthLE,
1116                 pageLayoutModule->paperwidthUnitCO, params.paperwidth, defaultUnit);
1117
1118         lengthToWidgets(pageLayoutModule->paperheightLE,
1119                 pageLayoutModule->paperheightUnitCO, params.paperheight, defaultUnit);
1120
1121         // margins
1122         Ui::MarginsUi * m = marginsModule;
1123
1124         setMargins(!params.use_geometry);
1125
1126         lengthToWidgets(m->topLE, m->topUnit,
1127                 params.topmargin, defaultUnit);
1128
1129         lengthToWidgets(m->bottomLE, m->bottomUnit,
1130                 params.bottommargin, defaultUnit);
1131
1132         lengthToWidgets(m->innerLE, m->innerUnit,
1133                 params.leftmargin, defaultUnit);
1134
1135         lengthToWidgets(m->outerLE, m->outerUnit,
1136                 params.rightmargin, defaultUnit);
1137
1138         lengthToWidgets(m->headheightLE, m->headheightUnit,
1139                 params.headheight, defaultUnit);
1140
1141         lengthToWidgets(m->headsepLE, m->headsepUnit,
1142                 params.headsep, defaultUnit);
1143
1144         lengthToWidgets(m->footskipLE, m->footskipUnit,
1145                 params.footskip, defaultUnit);
1146
1147         branchesModule->update(params);
1148 }
1149
1150
1151
1152
1153 } // namespace frontend
1154 } // namespace lyx
1155
1156 #include "QDocumentDialog_moc.cpp"