From 8e9e2e7657493b483dce23cc9d28007e350f551b Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Thu, 19 Jan 2023 12:51:49 +0300 Subject: [PATCH] UI: Options: OK button is always enabled --- src/ui/form/opt/pages/optmainpage.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/ui/form/opt/pages/optmainpage.cpp b/src/ui/form/opt/pages/optmainpage.cpp index 9e7daab3..70da6346 100644 --- a/src/ui/form/opt/pages/optmainpage.cpp +++ b/src/ui/form/opt/pages/optmainpage.cpp @@ -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); }