1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-09 19:47:54 +00:00
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;
}