UI: Options: OK button is always enabled

This commit is contained in:
Nodir Temirkhodjaev 2023-01-19 12:51:49 +03:00
parent f658b5161f
commit 8e9e2e7657

View File

@ -130,12 +130,7 @@ QLayout *OptMainPage::setupDialogButtons()
void OptMainPage::setupOkApplyButtons()
{
const auto refreshOkApplyButtons = [&](bool anyEdited) {
m_btOk->setEnabled(anyEdited);
m_btApply->setEnabled(anyEdited);
};
m_btApply->setEnabled(ctrl()->anyEdited());
refreshOkApplyButtons(ctrl()->anyEdited());
connect(ctrl(), &OptionsController::editedChanged, this, refreshOkApplyButtons);
connect(ctrl(), &OptionsController::editedChanged, m_btApply, &QPushButton::setEnabled);
}