]> git.lyx.org Git - features.git/commitdiff
GuiDocument.cpp: some languages only work with polyglossia, therefore enable non...
authorUwe Stöhr <uwestoehr@lyx.org>
Fri, 8 Jun 2012 03:39:00 +0000 (05:39 +0200)
committerUwe Stöhr <uwestoehr@lyx.org>
Fri, 8 Jun 2012 03:39:00 +0000 (05:39 +0200)
src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/GuiDocument.h

index 164fe9341e1f7029d735280928e912d78ab14464..4b269ca1b578df3c4ffbd09354ea63871e3413b6 100644 (file)
@@ -1060,7 +1060,7 @@ GuiDocument::GuiDocument(GuiView & lv)
        // language & quote
        langModule = new UiWidget<Ui::LanguageUi>;
        connect(langModule->languageCO, SIGNAL(activated(int)),
-               this, SLOT(change_adaptor()));
+               this, SLOT(languageChanged(int)));
        connect(langModule->defaultencodingRB, SIGNAL(clicked()),
                this, SLOT(change_adaptor()));
        connect(langModule->otherencodingRB, SIGNAL(clicked()),
@@ -1757,6 +1757,26 @@ void GuiDocument::deleteBoxBackgroundColor()
 }
 
 
+void GuiDocument::languageChanged(int i)
+{
+       // some languages only work with polyglossia/XeTeX
+       string current_language = lyx::languages.getLanguage(
+               fromqstr(langModule->languageCO->itemData(i).toString()))->lang();
+       if (current_language == "ancientgreek"
+               || current_language == "coptic" || current_language == "divehi"
+               || current_language == "hindi" || current_language == "kurmanji"
+               || current_language == "lao" || current_language == "marathi"
+               || current_language == "occitan" || current_language == "sanskrit"
+               || current_language == "syriac" || current_language == "tamil"
+               || current_language == "telugu" || current_language == "urdu") {
+                       fontModule->osFontsCB->setChecked(true);
+                       fontModule->osFontsCB->setEnabled(false);
+       }
+       else
+               fontModule->osFontsCB->setEnabled(true);
+}
+
+
 void GuiDocument::osFontsChanged(bool nontexfonts)
 {
        bool const tex_fonts = !nontexfonts;
index 4ab74c6dbf8f3a5805c0112d6f7405eb6382d692..cb89b20f5d70ab1ec3e013704c9c745956685672 100644 (file)
@@ -120,6 +120,7 @@ private Q_SLOTS:
        void deleteNoteFontColor();
        void changeBoxBackgroundColor();
        void deleteBoxBackgroundColor();
+       void languageChanged(int);
        void osFontsChanged(bool);
        void branchesRename(docstring const &, docstring const &);
 private: