i2pd/qt/i2pd_qt/I2pdQtUtil.cpp
2020-12-18 01:13:50 +08:00

13 lines
443 B
C++

#include "I2pdQtUtil.h"
bool isValidSingleLine(QLineEdit* widget, WrongInputPageEnum inputPage, MainWindow* mainWindow) {
bool correct = !widget->text().contains(QRegularExpression("[\r\n]"), nullptr);
if(!correct) {
mainWindow->highlightWrongInput(
QApplication::tr("Single line input expected, but it's multiline"),
inputPage,
widget);
}
return correct;
}