mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
qt: fixes #1180
This commit is contained in:
12
qt/i2pd_qt/I2pdQtUtil.cpp
Normal file
12
qt/i2pd_qt/I2pdQtUtil.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user