]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiDocument.cpp
* GuiDocument.cpp (paramsToDialog):
[lyx.git] / src / frontends / qt4 / GuiDocument.cpp
index d51f8e6f0709d1a3f3e92e4e6a9a259c46b96839..97f79af9ce9545354f671d7c9a6a38a55010e5f2 100644 (file)
@@ -583,12 +583,15 @@ void LocalLayout::validate() {
                toqstr("<p style=\"color: #c00000; font-weight: bold; \">") 
                  + invalid + toqstr("</p>");
 
-       string const layout = fromqstr(locallayoutTE->document()->toPlainText());
-       if (layout.empty())
+       string const layout = 
+               fromqstr(locallayoutTE->document()->toPlainText().trimmed());
+       if (layout.empty()) {
                is_valid_ = true;
-       else
+               infoLB->setText("");
+       } else {
                is_valid_ = TextClass::validate(layout);
-       infoLB->setText(is_valid_ ? vtext : ivtext);
+               infoLB->setText(is_valid_ ? vtext : ivtext);
+       }
        validatePB->setEnabled(false);
 }
 
@@ -723,10 +726,6 @@ GuiDocument::GuiDocument(GuiView & lv)
        // output
        outputModule = new UiWidget<Ui::OutputUi>;
 
-       connect(outputModule->xetexCB, SIGNAL(clicked()),
-               this, SLOT(change_adaptor()));
-       connect(outputModule->xetexCB, SIGNAL(toggled(bool)),
-               this, SLOT(xetexChanged(bool)));
        connect(outputModule->defaultFormatCO, SIGNAL(activated(int)),
                this, SLOT(change_adaptor()));
        connect(outputModule->mathimgSB, SIGNAL(valueChanged(double)),
@@ -747,6 +746,10 @@ GuiDocument::GuiDocument(GuiView & lv)
 
        // fonts
        fontModule = new UiWidget<Ui::FontUi>;
+       connect(fontModule->osFontsCB, SIGNAL(clicked()),
+               this, SLOT(change_adaptor()));
+       connect(fontModule->osFontsCB, SIGNAL(toggled(bool)),
+               this, SLOT(osFontsChanged(bool)));
        connect(fontModule->fontsRomanCO, SIGNAL(activated(int)),
                this, SLOT(change_adaptor()));
        connect(fontModule->fontsRomanCO, SIGNAL(activated(int)),
@@ -1070,6 +1073,8 @@ GuiDocument::GuiDocument(GuiView & lv)
                mathsModule->esintCB, SLOT(setDisabled(bool)));
        connect(mathsModule->mhchemautoCB, SIGNAL(toggled(bool)),
                mathsModule->mhchemCB, SLOT(setDisabled(bool)));
+       connect(mathsModule->mathdotsautoCB, SIGNAL(toggled(bool)),
+               mathsModule->mathdotsCB, SLOT(setDisabled(bool)));
        
        connect(mathsModule->amsCB, SIGNAL(clicked()),
                this, SLOT(change_adaptor()));
@@ -1083,7 +1088,11 @@ GuiDocument::GuiDocument(GuiView & lv)
                this, SLOT(change_adaptor()));
        connect(mathsModule->mhchemautoCB, SIGNAL(clicked()),
                this, SLOT(change_adaptor()));
-
+       connect(mathsModule->mathdotsCB, SIGNAL(clicked()),
+               this, SLOT(change_adaptor()));
+       connect(mathsModule->mathdotsautoCB, SIGNAL(clicked()),
+               this, SLOT(change_adaptor()));
+       
 
        // latex class
        latexModule = new UiWidget<Ui::LaTeXUi>;
@@ -1109,6 +1118,8 @@ GuiDocument::GuiDocument(GuiView & lv)
                this, SLOT(browseMaster()));
        connect(latexModule->suppressDateCB, SIGNAL(clicked()),
                this, SLOT(change_adaptor()));
+       connect(latexModule->refstyleCB, SIGNAL(clicked()),
+               this, SLOT(change_adaptor()));
 
        // postscript drivers
        for (int n = 0; tex_graphics[n][0]; ++n) {
@@ -1237,6 +1248,7 @@ GuiDocument::GuiDocument(GuiView & lv)
        docPS->addPanel(latexModule, qt_("Document Class"));
        docPS->addPanel(masterChildModule, qt_("Child Documents"));
        docPS->addPanel(modulesModule, qt_("Modules"));
+       docPS->addPanel(localLayout, qt_("Local Layout"));
        docPS->addPanel(fontModule, qt_("Fonts"));
        docPS->addPanel(textLayoutModule, qt_("Text Layout"));
        docPS->addPanel(pageLayoutModule, qt_("Page Layout"));
@@ -1254,7 +1266,6 @@ GuiDocument::GuiDocument(GuiView & lv)
        docPS->addPanel(branchesModule, qt_("Branches"));
        docPS->addPanel(outputModule, qt_("Output"));
        docPS->addPanel(preambleModule, qt_("LaTeX Preamble"));
-       docPS->addPanel(localLayout, qt_("Local Layout"));
        docPS->setCurrentPanel(qt_("Document Class"));
 // FIXME: hack to work around resizing bug in Qt >= 4.2
 // bug verified with Qt 4.2.{0-3} (JSpitzm)
@@ -1574,38 +1585,39 @@ void GuiDocument::deleteBoxBackgroundColor()
 }
 
 
-void GuiDocument::xetexChanged(bool xetex)
+void GuiDocument::osFontsChanged(bool nontexfonts)
 {
+       bool const tex_fonts = !nontexfonts;
        updateFontlist();
        updateDefaultFormat();
-       langModule->encodingCO->setEnabled(!xetex &&
+       langModule->encodingCO->setEnabled(tex_fonts &&
                !langModule->defaultencodingRB->isChecked());
-       langModule->defaultencodingRB->setEnabled(!xetex);
-       langModule->otherencodingRB->setEnabled(!xetex);
+       langModule->defaultencodingRB->setEnabled(tex_fonts);
+       langModule->otherencodingRB->setEnabled(tex_fonts);
 
-       fontModule->fontsDefaultCO->setEnabled(!xetex);
-       fontModule->fontsDefaultLA->setEnabled(!xetex);
-       fontModule->cjkFontLE->setEnabled(!xetex);
-       fontModule->cjkFontLA->setEnabled(!xetex);
+       fontModule->fontsDefaultCO->setEnabled(tex_fonts);
+       fontModule->fontsDefaultLA->setEnabled(tex_fonts);
+       fontModule->cjkFontLE->setEnabled(tex_fonts);
+       fontModule->cjkFontLA->setEnabled(tex_fonts);
        string font;
-       if (!xetex)
+       if (tex_fonts)
                font = tex_fonts_sans[fontModule->fontsSansCO->currentIndex()];
        bool scaleable = providesScale(font);
        fontModule->scaleSansSB->setEnabled(scaleable);
        fontModule->scaleSansLA->setEnabled(scaleable);
-       if (!xetex)
+       if (tex_fonts)
                font = tex_fonts_monospaced[fontModule->fontsTypewriterCO->currentIndex()];
        scaleable = providesScale(font);
        fontModule->scaleTypewriterSB->setEnabled(scaleable);
        fontModule->scaleTypewriterLA->setEnabled(scaleable);
-       if (!xetex)
+       if (tex_fonts)
                font = tex_fonts_roman[fontModule->fontsRomanCO->currentIndex()];
        fontModule->fontScCB->setEnabled(providesSC(font));
        fontModule->fontOsfCB->setEnabled(providesOSF(font));
        
-       fontModule->fontencLA->setEnabled(!xetex);
-       fontModule->fontencCO->setEnabled(!xetex);
-       if (xetex)
+       fontModule->fontencLA->setEnabled(tex_fonts);
+       fontModule->fontencCO->setEnabled(tex_fonts);
+       if (!tex_fonts)
                fontModule->fontencLE->setEnabled(false);
        else
                fontencChanged(fontModule->fontencCO->currentIndex());
@@ -1637,7 +1649,7 @@ void GuiDocument::updateFontlist()
        fontModule->fontsTypewriterCO->clear();
 
        // With XeTeX, we have access to all system fonts, but not the LaTeX fonts
-       if (outputModule->xetexCB->isChecked()) {
+       if (fontModule->osFontsCB->isChecked()) {
                fontModule->fontsRomanCO->addItem(qt_("Default"));
                fontModule->fontsSansCO->addItem(qt_("Default"));
                fontModule->fontsTypewriterCO->addItem(qt_("Default"));
@@ -1681,7 +1693,7 @@ void GuiDocument::fontencChanged(int item)
 
 void GuiDocument::romanChanged(int item)
 {
-       if (outputModule->xetexCB->isChecked())
+       if (fontModule->osFontsCB->isChecked())
                return;
        string const font = tex_fonts_roman[item];
        fontModule->fontScCB->setEnabled(providesSC(font));
@@ -1691,7 +1703,7 @@ void GuiDocument::romanChanged(int item)
 
 void GuiDocument::sansChanged(int item)
 {
-       if (outputModule->xetexCB->isChecked())
+       if (fontModule->osFontsCB->isChecked())
                return;
        string const font = tex_fonts_sans[item];
        bool scaleable = providesScale(font);
@@ -1702,7 +1714,7 @@ void GuiDocument::sansChanged(int item)
 
 void GuiDocument::ttChanged(int item)
 {
-       if (outputModule->xetexCB->isChecked())
+       if (fontModule->osFontsCB->isChecked())
                return;
        string const font = tex_fonts_monospaced[item];
        bool scaleable = providesScale(font);
@@ -1873,6 +1885,9 @@ void GuiDocument::bibtexChanged(int n)
 
 
 namespace {
+       // FIXME unicode 
+       // both of these should take a vector<docstring>
+       
        // This is an insanely complicated attempt to make this sort of thing
        // work with RTL languages.
        docstring formatStrVec(vector<string> const & v, docstring const & s) 
@@ -1881,22 +1896,24 @@ namespace {
                if (v.size() == 0)
                        return docstring();
                if (v.size() == 1) 
-                       return from_utf8(v[0]);
+                       return translateIfPossible(from_utf8(v[0]));
                if (v.size() == 2) {
                        docstring retval = _("%1$s and %2$s");
                        retval = subst(retval, _("and"), s);
-                       return bformat(retval, from_utf8(v[0]), from_utf8(v[1]));
+                       return bformat(retval, translateIfPossible(from_utf8(v[0])),
+                                      translateIfPossible(from_utf8(v[1])));
                }
                // The idea here is to format all but the last two items...
                int const vSize = v.size();
                docstring t2 = _("%1$s, %2$s");
-               docstring retval = from_utf8(v[0]);
+               docstring retval = translateIfPossible(from_utf8(v[0]));
                for (int i = 1; i < vSize - 2; ++i)
-                       retval = bformat(t2, retval, from_utf8(v[i])); 
+                       retval = bformat(t2, retval, translateIfPossible(from_utf8(v[i]))); 
                //...and then to  plug them, and the last two, into this schema
                docstring t = _("%1$s, %2$s, and %3$s");
                t = subst(t, _("and"), s);
-               return bformat(t, retval, from_utf8(v[vSize - 2]), from_utf8(v[vSize - 1]));
+               return bformat(t, retval, translateIfPossible(from_utf8(v[vSize - 2])),
+                              translateIfPossible(from_utf8(v[vSize - 1])));
        }
        
        vector<string> idsToNames(vector<string> const & idList)
@@ -1907,7 +1924,8 @@ namespace {
                for (; it != end; ++it) {
                        LyXModule const * const mod = theModuleList[*it];
                        if (!mod)
-                               retval.push_back(to_utf8(bformat(_("%1$s (unavailable)"), from_utf8(*it))));
+                               retval.push_back(to_utf8(bformat(_("%1$s (unavailable)"), 
+                                               translateIfPossible(from_utf8(*it)))));
                        else
                                retval.push_back(mod->getName());
                }
@@ -1998,7 +2016,7 @@ void GuiDocument::updateModuleInfo()
                pkgdesc = formatStrVec(reqdescs, _("or"));
                if (!desc.empty())
                        desc += "\n";
-               desc += bformat(_("Module required: %1$s."), pkgdesc);
+               desc += bformat(_("Modules required: %1$s."), pkgdesc);
        }
 
        pkglist = getExcludedList(modName);
@@ -2056,7 +2074,8 @@ void GuiDocument::updateDefaultFormat()
                return;
        // make a copy in order to consider unapplied changes
        Buffer * tmpbuf = buffer().clone();
-       tmpbuf->params().useXetex = outputModule->xetexCB->isChecked();
+       tmpbuf->params().useNonTeXFonts =
+               fontModule->osFontsCB->isChecked();
        int idx = latexModule->classCO->currentIndex();
        if (idx >= 0) {
                string const classname = classes_model_.getIDString(idx);
@@ -2097,6 +2116,7 @@ void GuiDocument::applyView()
 
        // date
        bp_.suppress_date = latexModule->suppressDateCB->isChecked();
+       bp_.use_refstyle  = latexModule->refstyleCB->isChecked();
 
        // biblio
        bp_.setCiteEngine(ENGINE_BASIC);
@@ -2204,7 +2224,7 @@ void GuiDocument::applyView()
        bp_.user_defined_bullet(3) = bulletsModule->bullet(3);
 
        // packages
-       bp_.graphicsDriver =
+       bp_.graphics_driver =
                tex_graphics[latexModule->psdriverCO->currentIndex()];
        
        // text layout
@@ -2218,9 +2238,9 @@ void GuiDocument::applyView()
        modulesToParams(bp_);
 
        // Math
-       if (mathsModule->amsautoCB->isChecked()) {
+       if (mathsModule->amsautoCB->isChecked())
                bp_.use_amsmath = BufferParams::package_auto;
-       else {
+       else {
                if (mathsModule->amsCB->isChecked())
                        bp_.use_amsmath = BufferParams::package_on;
                else
@@ -2242,7 +2262,15 @@ void GuiDocument::applyView()
                else
                        bp_.use_mhchem = BufferParams::package_off;
        }
-
+       if (mathsModule->mathdotsautoCB->isChecked())
+               bp_.use_mathdots = BufferParams::package_auto;
+       else {
+               if (mathsModule->mathdotsCB->isChecked())
+                       bp_.use_mathdots = BufferParams::package_on;
+               else
+                       bp_.use_mathdots = BufferParams::package_off;
+       }
+       
        // Page Layout
        if (pageLayoutModule->pagestyleCO->currentIndex() == 0)
                bp_.pagestyle = "default";
@@ -2360,11 +2388,11 @@ void GuiDocument::applyView()
                InsetListingsParams(fromqstr(listingsModule->listingsED->toPlainText())).params();
 
        // output
-       bp_.defaultOutputFormat = fromqstr(outputModule->defaultFormatCO->itemData(
+       bp_.default_output_format = fromqstr(outputModule->defaultFormatCO->itemData(
                outputModule->defaultFormatCO->currentIndex()).toString());
 
-       bool const xetex = outputModule->xetexCB->isChecked();
-       bp_.useXetex = xetex;
+       bool const nontexfonts = fontModule->osFontsCB->isChecked();
+       bp_.useNonTeXFonts = nontexfonts;
 
        bp_.output_sync = outputModule->outputsyncCB->isChecked();
        bp_.output_sync_macro = fromqstr(outputModule->synccustomCB->currentText());
@@ -2379,32 +2407,32 @@ void GuiDocument::applyView()
        bp_.html_math_img_scale = outputModule->mathimgSB->value();
 
        // fonts
-       if (xetex) {
+       if (nontexfonts) {
                if (fontModule->fontsRomanCO->currentIndex() == 0)
-                       bp_.fontsRoman = "default";
+                       bp_.fonts_roman = "default";
                else
-                       bp_.fontsRoman =
+                       bp_.fonts_roman =
                                fromqstr(fontModule->fontsRomanCO->currentText());
        
                if (fontModule->fontsSansCO->currentIndex() == 0)
-                       bp_.fontsSans = "default";
+                       bp_.fonts_sans = "default";
                else
-                       bp_.fontsSans =
+                       bp_.fonts_sans =
                                fromqstr(fontModule->fontsSansCO->currentText());
        
                if (fontModule->fontsTypewriterCO->currentIndex() == 0)
-                       bp_.fontsTypewriter = "default";
+                       bp_.fonts_typewriter = "default";
                else
-                       bp_.fontsTypewriter =
+                       bp_.fonts_typewriter =
                                fromqstr(fontModule->fontsTypewriterCO->currentText());
        } else {
-               bp_.fontsRoman =
+               bp_.fonts_roman =
                        tex_fonts_roman[fontModule->fontsRomanCO->currentIndex()];
        
-               bp_.fontsSans =
+               bp_.fonts_sans =
                        tex_fonts_sans[fontModule->fontsSansCO->currentIndex()];
        
-               bp_.fontsTypewriter =
+               bp_.fonts_typewriter =
                        tex_fonts_monospaced[fontModule->fontsTypewriterCO->currentIndex()];
        }
 
@@ -2415,21 +2443,21 @@ void GuiDocument::applyView()
        else if (fontModule->fontencCO->currentIndex() == 2)
                bp_.fontenc = "default";
 
-       bp_.fontsCJK =
+       bp_.fonts_cjk =
                fromqstr(fontModule->cjkFontLE->text());
 
-       bp_.fontsSansScale = fontModule->scaleSansSB->value();
+       bp_.fonts_sans_scale = fontModule->scaleSansSB->value();
 
-       bp_.fontsTypewriterScale = fontModule->scaleTypewriterSB->value();
+       bp_.fonts_typewriter_scale = fontModule->scaleTypewriterSB->value();
 
-       bp_.fontsSC = fontModule->fontScCB->isChecked();
+       bp_.fonts_expert_sc = fontModule->fontScCB->isChecked();
 
-       bp_.fontsOSF = fontModule->fontOsfCB->isChecked();
+       bp_.fonts_old_figures = fontModule->fontOsfCB->isChecked();
 
-       if (xetex)
-               bp_.fontsDefaultFamily = "default";
+       if (nontexfonts)
+               bp_.fonts_default_family = "default";
        else
-               bp_.fontsDefaultFamily = GuiDocument::fontfamilies[
+               bp_.fonts_default_family = GuiDocument::fontfamilies[
                        fontModule->fontsDefaultCO->currentIndex()];
 
        if (fontModule->fontsizeCO->currentIndex() == 0)
@@ -2514,6 +2542,7 @@ void GuiDocument::paramsToDialog()
 
        // date
        latexModule->suppressDateCB->setChecked(bp_.suppress_date);
+       latexModule->refstyleCB->setChecked(bp_.use_refstyle);
 
        // biblio
        biblioModule->citeDefaultRB->setChecked(
@@ -2633,7 +2662,7 @@ void GuiDocument::paramsToDialog()
        bulletsModule->init();
 
        // packages
-       int nitem = findToken(tex_graphics, bp_.graphicsDriver);
+       int nitem = findToken(tex_graphics, bp_.graphics_driver);
        if (nitem >= 0)
                latexModule->psdriverCO->setCurrentIndex(nitem);
        updateModuleInfo();
@@ -2653,6 +2682,11 @@ void GuiDocument::paramsToDialog()
        mathsModule->mhchemautoCB->setChecked(
                bp_.use_mhchem == BufferParams::package_auto);
 
+       mathsModule->mathdotsCB->setChecked(
+               bp_.use_mathdots == BufferParams::package_on);
+       mathsModule->mathdotsautoCB->setChecked(
+               bp_.use_mathdots == BufferParams::package_auto);
+
        switch (bp_.spacing().getSpace()) {
                case Spacing::Other: nitem = 3; break;
                case Spacing::Double: nitem = 2; break;
@@ -2760,10 +2794,7 @@ void GuiDocument::paramsToDialog()
        }
 
        // Master/Child
-       std::vector<Buffer *> children;
-       if (bufferview())
-               children = buffer().getChildren(false);
-       if (children.empty()) {
+       if (!bufferview() || !buffer().hasChildren()) {
                masterChildModule->childrenTW->clear();
                includeonlys_.clear();
                docPS->showPanel(qt_("Child Documents"), false);
@@ -2791,14 +2822,14 @@ void GuiDocument::paramsToDialog()
        // update combobox with formats
        updateDefaultFormat();
        int index = outputModule->defaultFormatCO->findData(toqstr(
-               bp_.defaultOutputFormat));
+               bp_.default_output_format));
        // set to default if format is not found 
        if (index == -1)
                index = 0;
        outputModule->defaultFormatCO->setCurrentIndex(index);
-       outputModule->xetexCB->setEnabled(bp_.baseClass()->outputType() == lyx::LATEX);
-       outputModule->xetexCB->setChecked(
-               bp_.baseClass()->outputType() == lyx::LATEX && bp_.useXetex);
+       fontModule->osFontsCB->setEnabled(bp_.baseClass()->outputType() == lyx::LATEX);
+       fontModule->osFontsCB->setChecked(
+               bp_.baseClass()->outputType() == lyx::LATEX && bp_.useNonTeXFonts);
 
        outputModule->outputsyncCB->setChecked(bp_.output_sync);
        outputModule->synccustomCB->setEditText(toqstr(bp_.output_sync_macro));
@@ -2811,65 +2842,65 @@ void GuiDocument::paramsToDialog()
        updateFontsize(documentClass().opt_fontsize(),
                        bp_.fontsize);
 
-       if (bp_.useXetex) {
+       if (bp_.useNonTeXFonts) {
                fontModule->fontencLA->setEnabled(false);
                fontModule->fontencCO->setEnabled(false);
                fontModule->fontencLE->setEnabled(false);
                for (int i = 0; i < fontModule->fontsRomanCO->count(); ++i) {
-                       if (fontModule->fontsRomanCO->itemText(i) == toqstr(bp_.fontsRoman)) {
+                       if (fontModule->fontsRomanCO->itemText(i) == toqstr(bp_.fonts_roman)) {
                                fontModule->fontsRomanCO->setCurrentIndex(i);
-                               return;
+                               break;
                        }
                }
                
                for (int i = 0; i < fontModule->fontsSansCO->count(); ++i) {
-                       if (fontModule->fontsSansCO->itemText(i) == toqstr(bp_.fontsSans)) {
+                       if (fontModule->fontsSansCO->itemText(i) == toqstr(bp_.fonts_sans)) {
                                fontModule->fontsSansCO->setCurrentIndex(i);
-                               return;
+                               break;
                        }
                }
                for (int i = 0; i < fontModule->fontsTypewriterCO->count(); ++i) {
                        if (fontModule->fontsTypewriterCO->itemText(i) == 
-                               toqstr(bp_.fontsTypewriter)) {
+                               toqstr(bp_.fonts_typewriter)) {
                                fontModule->fontsTypewriterCO->setCurrentIndex(i);
-                               return;
+                               break;
                        }
                }
        } else {
                fontModule->fontencLA->setEnabled(true);
                fontModule->fontencCO->setEnabled(true);
                fontModule->fontencLE->setEnabled(true);
-               int n = findToken(tex_fonts_roman, bp_.fontsRoman);
+               int n = findToken(tex_fonts_roman, bp_.fonts_roman);
                if (n >= 0) {
                        fontModule->fontsRomanCO->setCurrentIndex(n);
                        romanChanged(n);
                }
        
-               n = findToken(tex_fonts_sans, bp_.fontsSans);
+               n = findToken(tex_fonts_sans, bp_.fonts_sans);
                if (n >= 0) {
                        fontModule->fontsSansCO->setCurrentIndex(n);
                        sansChanged(n);
                }
        
-               n = findToken(tex_fonts_monospaced, bp_.fontsTypewriter);
+               n = findToken(tex_fonts_monospaced, bp_.fonts_typewriter);
                if (n >= 0) {
                        fontModule->fontsTypewriterCO->setCurrentIndex(n);
                        ttChanged(n);
                }
        }
 
-       if (!bp_.fontsCJK.empty())
+       if (!bp_.fonts_cjk.empty())
                fontModule->cjkFontLE->setText(
-                       toqstr(bp_.fontsCJK));
+                       toqstr(bp_.fonts_cjk));
        else
                fontModule->cjkFontLE->setText(QString());
 
-       fontModule->fontScCB->setChecked(bp_.fontsSC);
-       fontModule->fontOsfCB->setChecked(bp_.fontsOSF);
-       fontModule->scaleSansSB->setValue(bp_.fontsSansScale);
-       fontModule->scaleTypewriterSB->setValue(bp_.fontsTypewriterScale);
+       fontModule->fontScCB->setChecked(bp_.fonts_expert_sc);
+       fontModule->fontOsfCB->setChecked(bp_.fonts_old_figures);
+       fontModule->scaleSansSB->setValue(bp_.fonts_sans_scale);
+       fontModule->scaleTypewriterSB->setValue(bp_.fonts_typewriter_scale);
        
-       int nn = findToken(GuiDocument::fontfamilies, bp_.fontsDefaultFamily);
+       int nn = findToken(GuiDocument::fontfamilies, bp_.fonts_default_family);
        if (nn >= 0)
                fontModule->fontsDefaultCO->setCurrentIndex(nn);
 
@@ -3026,9 +3057,9 @@ void GuiDocument::updateIncludeonlys()
                masterChildModule->maintainAuxCB->setEnabled(true);
        }
        QTreeWidgetItem * item = 0;
-       std::vector<Buffer *> children = buffer().getChildren(false);
-       vector<Buffer *>::const_iterator it  = children.begin();
-       vector<Buffer *>::const_iterator end = children.end();
+       ListOfBuffers children = buffer().getChildren();
+       ListOfBuffers::const_iterator it  = children.begin();
+       ListOfBuffers::const_iterator end = children.end();
        bool has_unincluded = false;
        bool all_unincluded = true;
        for (; it != end; ++it) {
@@ -3288,7 +3319,8 @@ void GuiDocument::dispatchParams()
                        dispatch(FuncRequest(LFUN_SET_COLOR, str));
                }
        }
-       // FIXME: If we used an LFUN, we would not need those two lines:
+       // FIXME LFUN
+       // If we used an LFUN, we would not need these two lines:
        BufferView * bv = const_cast<BufferView *>(bufferview());
        bv->processUpdateFlags(Update::Force | Update::FitCursor);
 }
@@ -3336,7 +3368,7 @@ bool GuiDocument::isFontAvailable(string const & font) const
 
 bool GuiDocument::providesOSF(string const & font) const
 {
-       if (outputModule->xetexCB->isChecked())
+       if (fontModule->osFontsCB->isChecked())
                // FIXME: we should check if the fonts really
                // have OSF support. But how?
                return true;
@@ -3350,7 +3382,7 @@ bool GuiDocument::providesOSF(string const & font) const
 
 bool GuiDocument::providesSC(string const & font) const
 {
-       if (outputModule->xetexCB->isChecked())
+       if (fontModule->osFontsCB->isChecked())
                return false;
        if (font == "palatino")
                return isFontAvailable("mathpazo");
@@ -3362,7 +3394,7 @@ bool GuiDocument::providesSC(string const & font) const
 
 bool GuiDocument::providesScale(string const & font) const
 {
-       if (outputModule->xetexCB->isChecked())
+       if (fontModule->osFontsCB->isChecked())
                return true;
        return font == "helvet" || font == "luximono"
                || font == "berasans"  || font == "beramono";