Fixed inconsistent Ok in instance import

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-11-12 20:27:55 +02:00
parent 913d81e371
commit 17916dbd24
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318
2 changed files with 4 additions and 0 deletions

View File

@ -97,6 +97,9 @@ NewInstanceDialog::NewInstanceDialog(const QString& initialGroup,
ui->verticalLayout->insertWidget(2, m_container);
m_container->addButtons(m_buttons);
connect(m_container, &PageContainer::selectedPageChanged, this, [this](BasePage* previous, BasePage* selected) {
m_buttons->button(QDialogButtonBox::Ok)->setEnabled(creationTask && !instName().isEmpty());
});
// Bonk Qt over its stupid head and make sure it understands which button is the default one...
// See: https://stackoverflow.com/questions/24556831/qbuttonbox-set-default-button

View File

@ -103,6 +103,7 @@ void ModrinthPage::retranslate()
void ModrinthPage::openedImpl()
{
BasePage::openedImpl();
suggestCurrent();
triggerSearch();
}