]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiDocument.cpp
Not sure why "notr = 'true'" got in there.
[lyx.git] / src / frontends / qt4 / GuiDocument.cpp
index 09503272bcd2044d6fb1c92478f45a8914166d2a..6ef39dcb4def5ac21e4392e1f1647b87507beca5 100644 (file)
@@ -1046,6 +1046,8 @@ GuiDocument::GuiDocument(GuiView & lv)
                this, SLOT(change_adaptor()));
        connect(langModule->languagePackageCO, SIGNAL(currentIndexChanged(int)),
                this, SLOT(languagePackageChanged(int)));
+       connect(langModule->dynamicQuotesCB, SIGNAL(clicked()),
+               this, SLOT(change_adaptor()));
 
        langModule->languagePackageLE->setValidator(new NoNewLineValidator(
                langModule->languagePackageLE));
@@ -1067,18 +1069,12 @@ GuiDocument::GuiDocument(GuiView & lv)
        encodinglist.sort();
        langModule->encodingCO->addItems(encodinglist);
 
-       langModule->quoteStyleCO->addItem(
-               qt_("``text''"), InsetQuotes::EnglishQuotes);
-       langModule->quoteStyleCO->addItem(
-               qt_("''text''"), InsetQuotes::SwedishQuotes);
-       langModule->quoteStyleCO->addItem
-               (qt_(",,text``"), InsetQuotes::GermanQuotes);
-       langModule->quoteStyleCO->addItem(
-               qt_(",,text''"), InsetQuotes::PolishQuotes);
-       langModule->quoteStyleCO->addItem(
-               qt_("<<text>>"), InsetQuotes::FrenchQuotes);
-       langModule->quoteStyleCO->addItem(
-               qt_(">>text<<"), InsetQuotes::DanishQuotes);
+       for (int i = 0; i < quoteparams.stylescount(); ++i) {
+               InsetQuotesParams::QuoteStyle qs = InsetQuotesParams::QuoteStyle(i);
+               if (qs == InsetQuotesParams::DynamicQuotes)
+                       continue;
+               langModule->quoteStyleCO->addItem(toqstr(quoteparams.getGuiLabel(qs)), qs);
+       }
 
        langModule->languagePackageCO->addItem(
                qt_("Default"), toqstr("default"));
@@ -2658,8 +2654,9 @@ void GuiDocument::applyView()
                }
        }
 
-       bp_.quotes_language = (InsetQuotes::QuoteLanguage) langModule->quoteStyleCO->itemData(
+       bp_.quotes_style = (InsetQuotesParams::QuoteStyle) langModule->quoteStyleCO->itemData(
                langModule->quoteStyleCO->currentIndex()).toInt();
+       bp_.dynamic_quotes = langModule->dynamicQuotesCB->isChecked();
 
        QString const langname = langModule->languageCO->itemData(
                langModule->languageCO->currentIndex()).toString();
@@ -3071,7 +3068,8 @@ void GuiDocument::paramsToDialog()
        langModule->languageCO->setCurrentIndex(pos);
 
        langModule->quoteStyleCO->setCurrentIndex(
-               bp_.quotes_language);
+               bp_.quotes_style);
+       langModule->dynamicQuotesCB->setChecked(bp_.dynamic_quotes);
 
        bool default_enc = true;
        if (bp_.inputenc != "auto") {