| 50 | |
| 51 | |
| 52 | ProfileSetupDialog::ProfileSetupDialog(MinecraftAccountPtr accountToSetup, QWidget *parent) |
| 53 | : QDialog(parent), m_accountToSetup(accountToSetup), ui(new Ui::ProfileSetupDialog) |
| 54 | { |
| 55 | ui->setupUi(this); |
| 56 | ui->errorLabel->setVisible(false); |
| 57 | |
| 58 | goodIcon = APPLICATION->getThemedIcon("status-good"); |
| 59 | yellowIcon = APPLICATION->getThemedIcon("status-yellow"); |
| 60 | badIcon = APPLICATION->getThemedIcon("status-bad"); |
| 61 | |
| 62 | QRegularExpression permittedNames("[a-zA-Z0-9_]{3,16}"); |
| 63 | auto nameEdit = ui->nameEdit; |
| 64 | nameEdit->setValidator(new QRegularExpressionValidator(permittedNames)); |
| 65 | nameEdit->setClearButtonEnabled(true); |
| 66 | validityAction = nameEdit->addAction(yellowIcon, QLineEdit::LeadingPosition); |
| 67 | connect(nameEdit, &QLineEdit::textEdited, this, &ProfileSetupDialog::nameEdited); |
| 68 | |
| 69 | checkStartTimer.setSingleShot(true); |
| 70 | connect(&checkStartTimer, &QTimer::timeout, this, &ProfileSetupDialog::startCheck); |
| 71 | |
| 72 | setNameStatus(NameStatus::NotSet, QString()); |
| 73 | } |
| 74 | |
| 75 | ProfileSetupDialog::~ProfileSetupDialog() |
| 76 | { |
nothing calls this directly
no test coverage detected