mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-11 07:31:25 +02:00
clean-up: using methods PolicyRule::setBranch and PolicyRule::setTagObject
This commit is contained in:
+12
-41
@@ -185,66 +185,37 @@ void ActionsDialog::applyChanges()
|
|||||||
|
|
||||||
if (editor=="TagInt")
|
if (editor=="TagInt")
|
||||||
{
|
{
|
||||||
if (TagIntArea!=NULL)
|
FWObject *tag_object = TagIntArea->getObject();
|
||||||
{
|
// if tag_object==NULL, setTagObject clears setting in the rule
|
||||||
QString id ;
|
rule->setTagObject(tag_object);
|
||||||
if (TagIntArea->getObject()!=NULL)
|
|
||||||
id = TagIntArea->getObject()->getId().c_str();
|
|
||||||
else
|
|
||||||
id = "";
|
|
||||||
ropt->setStr("tagobject_id",id.toAscii().data());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (editor=="TagStr")
|
if (editor=="TagStr")
|
||||||
{
|
{
|
||||||
if (TagStrArea!=NULL)
|
FWObject *tag_object = TagStrArea->getObject();
|
||||||
{
|
// if tag_object==NULL, setTagObject clears setting in the rule
|
||||||
QString id ;
|
rule->setTagObject(tag_object);
|
||||||
if (TagStrArea->getObject()!=NULL)
|
|
||||||
id = TagStrArea->getObject()->getId().c_str();
|
|
||||||
else
|
|
||||||
id = "";
|
|
||||||
ropt->setStr("tagobject_id",id.toAscii().data());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (editor=="BranchChain")
|
if (editor=="BranchChain")
|
||||||
{
|
{
|
||||||
if (BranchChainArea!=NULL)
|
RuleSet *ruleset = RuleSet::cast(BranchChainArea->getObject());
|
||||||
{
|
// if ruleset==NULL, setBranch clears setting in the rule
|
||||||
QString id ;
|
rule->setBranch(ruleset);
|
||||||
if (BranchChainArea->getObject()!=NULL)
|
|
||||||
id = BranchChainArea->getObject()->getId().c_str();
|
|
||||||
else
|
|
||||||
id = "";
|
|
||||||
ropt->setStr("branch_id",id.toAscii().data());
|
|
||||||
mw->setPolicyBranchTabName(rule->getBranch());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (editor=="BranchAnchor")
|
if (editor=="BranchAnchor")
|
||||||
{
|
{
|
||||||
if (BranchAnchorArea!=NULL)
|
RuleSet *ruleset = RuleSet::cast(BranchAnchorArea->getObject());
|
||||||
{
|
// if ruleset==NULL, setBranch clears setting in the rule
|
||||||
QString id ;
|
rule->setBranch(ruleset);
|
||||||
if (BranchAnchorArea->getObject()!=NULL)
|
|
||||||
id = BranchAnchorArea->getObject()->getId().c_str();
|
|
||||||
else
|
|
||||||
id = "";
|
|
||||||
ropt->setStr("branch_id",id.toAscii().data());
|
|
||||||
mw->setPolicyBranchTabName(rule->getBranch());
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (m_dialog->useDummyNetPipe->isChecked())
|
if (m_dialog->useDummyNetPipe->isChecked())
|
||||||
ropt->setInt("ipfw_classify_method",DUMMYNETPIPE);
|
ropt->setInt("ipfw_classify_method",DUMMYNETPIPE);
|
||||||
else
|
else
|
||||||
ropt->setInt("ipfw_classify_method",DUMMYNETQUEUE);
|
ropt->setInt("ipfw_classify_method",DUMMYNETQUEUE);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mw->updateLastModifiedTimestampForAllFirewalls(rule);
|
mw->updateLastModifiedTimestampForAllFirewalls(rule);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user