mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-10-04 11:34:50 -04:00
GH-2355 Do not allow instances to be created with whitespace prefix or suffix
This commit is contained in:
1 parent
4169f53b19
commit
12f2716f31
2 files changed
+16
-6
No files matched your search
@@ -62,12 +62,22 @@ CopyInstanceDialog::~CopyInstanceDialog()
|
||||
|
||||
void CopyInstanceDialog::updateDialogState()
|
||||
{
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!instName().isEmpty());
|
||||
auto allowOK = !instName().isEmpty();
|
||||
auto OkButton = ui->buttonBox->button(QDialogButtonBox::Ok);
|
||||
if(OkButton->isEnabled() != allowOK)
|
||||
{
|
||||
OkButton->setEnabled(allowOK);
|
||||
}
|
||||
}
|
||||
|
||||
QString CopyInstanceDialog::instName() const
|
||||
{
|
||||
return ui->instNameTextBox->text();
|
||||
auto result = ui->instNameTextBox->text().trimmed();
|
||||
if(result.size())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
QString CopyInstanceDialog::iconKey() const
|
||||
|
||||
Reference in new issue
Block a user