UI: ProgramEdit: Disable blocked Zones/Rules row

This commit is contained in:
Nodir Temirkhodjaev 2024-09-23 13:57:53 +05:00
parent aaa34046e0
commit 79145ed9a1
2 changed files with 13 additions and 1 deletions

View File

@ -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

View File

@ -87,6 +87,7 @@ private:
void setupComboScheduleType();
QLayout *setupButtonsLayout();
void updateZonesRulesLayout();
void updateApplyChild();
void fillEditName();