Set a validator on QLineEdit widgets. The validator removes any
\n and \r characters, thus preventing users from copy-pasting
newline characters into these fields, and subsequently saving
them, inadvertantly, to their lyx file.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39745
a592a061-630c-0410-9148-
cb99ea01b6c8
undef_, SLOT(accept()));
connect(undef_->cancelPB, SIGNAL(clicked()),
undef_, SLOT(reject()));
undef_, SLOT(accept()));
connect(undef_->cancelPB, SIGNAL(clicked()),
undef_, SLOT(reject()));
+
+ newBranchLE->setValidator(new NoNewLineValidator(newBranchLE));
}
void GuiBranches::update(BufferParams const & params)
}
void GuiBranches::update(BufferParams const & params)
outputModule->synccustomCB->addItem("\\synctex=-1");
outputModule->synccustomCB->addItem("\\usepackage[active]{srcltx}");
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()),
// fonts
fontModule = new UiWidget<Ui::FontUi>;
connect(fontModule->osFontsCB, SIGNAL(clicked()),
connect(fontModule->fontOsfCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
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"));
updateFontlist();
fontModule->fontsizeCO->addItem(qt_("Default"));
connect(langModule->languagePackageCO, SIGNAL(currentIndexChanged(int)),
this, SLOT(languagePackageChanged(int)));
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);
QAbstractItemModel * language_model = guiApp->languageModel();
// FIXME: it would be nice if sorting was enabled/disabled via a checkbox.
language_model->sort(0);
connect(biblioModule->bibtexOptionsLE, SIGNAL(textChanged(QString)),
this, SLOT(change_adaptor()));
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);
biblioModule->citeStyleCO->addItem(qt_("Author-year"));
biblioModule->citeStyleCO->addItem(qt_("Numerical"));
biblioModule->citeStyleCO->setCurrentIndex(0);
connect(latexModule->refstyleCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
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]);
// postscript drivers
for (int n = 0; tex_graphics[n][0]; ++n) {
QString enc = qt_(tex_graphics_gui[n]);
connect(pdfSupportModule->optionsLE, SIGNAL(textChanged(QString)),
this, SLOT(change_adaptor()));
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]));
for (int i = 0; backref_opts[i][0]; ++i)
pdfSupportModule->backrefCO->addItem(qt_(backref_opts_gui[i]));
QString const command = toqstr(*it).left(toqstr(*it).indexOf(" "));
indexCO->addItem(command, command);
}
QString const command = toqstr(*it).left(toqstr(*it).indexOf(" "));
indexCO->addItem(command, command);
}
+
+ indexOptionsLE->setValidator(new NoNewLineValidator(indexOptionsLE));
+ newIndexLE->setValidator(new NoNewLineValidator(newIndexLE));
}
void GuiIndices::update(BufferParams const & params)
}
void GuiIndices::update(BufferParams const & params)