| 18 | namespace validators { |
| 19 | |
| 20 | ScreenNameValidator::ScreenNameValidator(QLineEdit *lineEdit, ValidationError *error, const ScreenList *pScreens) |
| 21 | : LineEditValidator(lineEdit, error) |
| 22 | { |
| 23 | addValidator(std::make_unique<EmptyStringValidator>(tr("Computer name cannot be empty"))); |
| 24 | addValidator(std::make_unique<SpacesValidator>(tr("Computer name cannot contain spaces"))); |
| 25 | addValidator(std::make_unique<ComputerNameValidator>(tr("Contains invalid characters or is too long"))); |
| 26 | addValidator( |
| 27 | std::make_unique<ScreenDuplicationsValidator>( |
| 28 | tr("A computer with this name already exists"), lineEdit ? lineEdit->text() : "", pScreens |
| 29 | ) |
| 30 | ); |
| 31 | } |
| 32 | |
| 33 | } // namespace validators |