NOISSUE Improve new instance dialog

Better layout, showing more of the modpack URL
Fixed logic for enabling OK button
This commit is contained in:
Petr Mrázek
2015-04-11 12:30:18 +02:00
parent 8b4e22bbb8
commit 6775e3e72b
2 changed files with 54 additions and 42 deletions

View File

@@ -98,11 +98,10 @@ NewInstanceDialog::~NewInstanceDialog()
void NewInstanceDialog::updateDialogState()
{
ui->buttonBox->button(QDialogButtonBox::Ok)
->setEnabled(!instName().isEmpty()
&& m_selectedVersion
&& (!ui->modpackBox->isChecked()
|| ui->modpackEdit->hasAcceptableInput()));
bool allowOK = !instName().isEmpty() &&
(ui->versionBox->isChecked() && m_selectedVersion ||
(ui->modpackBox->isChecked() && ui->modpackEdit->hasAcceptableInput()));
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(allowOK);
}
void NewInstanceDialog::setSelectedVersion(BaseVersionPtr version, bool initial)