diff --git a/src/ui/form/prog/programeditdialog.cpp b/src/ui/form/prog/programeditdialog.cpp index 79486371..f8ea249a 100644 --- a/src/ui/form/prog/programeditdialog.cpp +++ b/src/ui/form/prog/programeditdialog.cpp @@ -369,7 +369,7 @@ QLayout *ProgramEditDialog::setupMainLayout() setupActionsGroup(); - // Zones + // Zones/Rules auto zonesRulesLayout = setupZonesRuleLayout(); // Schedule @@ -535,6 +535,8 @@ void ProgramEditDialog::setupActionsGroup() m_btgActions->addButton(m_rbAllow); m_btgActions->addButton(m_rbBlock); m_btgActions->addButton(m_rbKillProcess); + + connect(m_rbAllow, &QRadioButton::toggled, this, &ProgramEditDialog::updateZonesRulesLayout); } void ProgramEditDialog::setupAdvancedOptions() @@ -744,6 +746,15 @@ QLayout *ProgramEditDialog::setupButtonsLayout() return layout; } +void ProgramEditDialog::updateZonesRulesLayout() +{ + const bool enabled = m_rbAllow->isChecked(); + + m_cbLanOnly->setEnabled(enabled); + m_btZones->setEnabled(enabled); + m_btSelectRule->setEnabled(enabled); +} + void ProgramEditDialog::updateApplyChild() { const ApplyChildType type = m_appRow.applyParent ? ApplyChildType::FromParent diff --git a/src/ui/form/prog/programeditdialog.h b/src/ui/form/prog/programeditdialog.h index dd898150..16c3a60a 100644 --- a/src/ui/form/prog/programeditdialog.h +++ b/src/ui/form/prog/programeditdialog.h @@ -87,6 +87,7 @@ private: void setupComboScheduleType(); QLayout *setupButtonsLayout(); + void updateZonesRulesLayout(); void updateApplyChild(); void fillEditName();