]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiDocument.cpp
Don't allow newline characters in document settings.
[lyx.git] / src / frontends / qt4 / GuiDocument.cpp
index a21f02b4ebc35392e7270d26a51def1808558201..31d2c14b7a8c54a859c39df4e44d068a689c1af5 100644 (file)
@@ -780,6 +780,9 @@ GuiDocument::GuiDocument(GuiView & lv)
        outputModule->synccustomCB->addItem("\\synctex=-1");
        outputModule->synccustomCB->addItem("\\usepackage[active]{srcltx}");
 
+       outputModule->synccustomCB->setValidator(new NoNewLineValidator(
+               outputModule->synccustomCB));
+
        // fonts
        fontModule = new UiWidget<Ui::FontUi>;
        connect(fontModule->osFontsCB, SIGNAL(clicked()),
@@ -819,6 +822,11 @@ GuiDocument::GuiDocument(GuiView & lv)
        connect(fontModule->fontOsfCB, SIGNAL(clicked()),
                this, SLOT(change_adaptor()));
 
+       fontModule->fontencLE->setValidator(new NoNewLineValidator(
+               fontModule->fontencLE));
+       fontModule->cjkFontLE->setValidator(new NoNewLineValidator(
+               fontModule->cjkFontLE));
+
        updateFontlist();
 
        fontModule->fontsizeCO->addItem(qt_("Default"));
@@ -1012,6 +1020,9 @@ GuiDocument::GuiDocument(GuiView & lv)
        connect(langModule->languagePackageCO, SIGNAL(currentIndexChanged(int)),
                this, SLOT(languagePackageChanged(int)));
 
+       langModule->languagePackageLE->setValidator(new NoNewLineValidator(
+               langModule->languagePackageLE));
+
        QAbstractItemModel * language_model = guiApp->languageModel();
        // FIXME: it would be nice if sorting was enabled/disabled via a checkbox.
        language_model->sort(0);
@@ -1105,6 +1116,9 @@ GuiDocument::GuiDocument(GuiView & lv)
        connect(biblioModule->bibtexOptionsLE, SIGNAL(textChanged(QString)),
                this, SLOT(change_adaptor()));
 
+       biblioModule->bibtexOptionsLE->setValidator(new NoNewLineValidator(
+               biblioModule->bibtexOptionsLE));
+
        biblioModule->citeStyleCO->addItem(qt_("Author-year"));
        biblioModule->citeStyleCO->addItem(qt_("Numerical"));
        biblioModule->citeStyleCO->setCurrentIndex(0);
@@ -1187,6 +1201,11 @@ GuiDocument::GuiDocument(GuiView & lv)
        connect(latexModule->refstyleCB, SIGNAL(clicked()),
                this, SLOT(change_adaptor()));
 
+       latexModule->optionsLE->setValidator(new NoNewLineValidator(
+               latexModule->optionsLE));
+       latexModule->childDocLE->setValidator(new NoNewLineValidator(
+               latexModule->childDocLE));
+
        // postscript drivers
        for (int n = 0; tex_graphics[n][0]; ++n) {
                QString enc = qt_(tex_graphics_gui[n]);
@@ -1288,6 +1307,17 @@ GuiDocument::GuiDocument(GuiView & lv)
        connect(pdfSupportModule->optionsLE, SIGNAL(textChanged(QString)),
                this, SLOT(change_adaptor()));
 
+       pdfSupportModule->titleLE->setValidator(new NoNewLineValidator(
+               pdfSupportModule->titleLE));
+       pdfSupportModule->authorLE->setValidator(new NoNewLineValidator(
+               pdfSupportModule->authorLE));
+       pdfSupportModule->subjectLE->setValidator(new NoNewLineValidator(
+               pdfSupportModule->subjectLE));
+       pdfSupportModule->keywordsLE->setValidator(new NoNewLineValidator(
+               pdfSupportModule->keywordsLE));
+       pdfSupportModule->optionsLE->setValidator(new NoNewLineValidator(
+               pdfSupportModule->optionsLE));
+
        for (int i = 0; backref_opts[i][0]; ++i)
                pdfSupportModule->backrefCO->addItem(qt_(backref_opts_gui[i]));