diff --git a/src/gui/ActionsDialog.cpp b/src/gui/ActionsDialog.cpp index a42a481c2..000b1fecd 100644 --- a/src/gui/ActionsDialog.cpp +++ b/src/gui/ActionsDialog.cpp @@ -66,49 +66,40 @@ ActionsDialog::ActionsDialog(QWidget *parent) : QWidget(parent) m_dialog = new Ui::ActionsDialog_q; m_dialog->setupUi(this); - BranchChainArea = new FWObjectDropArea(m_dialog->branchChainNameFrame); - BranchChainArea->addAcceptedTypes("Policy"); - BranchChainArea->addAcceptedTypes("NAT"); - BranchChainArea->addAcceptedTypes("Routing"); - BranchChainArea->setHelperText("Drop rule set object here"); - m_dialog->gridLayout17->addWidget(BranchChainArea); - connect (BranchChainArea,SIGNAL(objectDeleted()),this,SLOT(changed())); - connect (BranchChainArea,SIGNAL(objectInserted()),this,SLOT(changed())); + m_dialog->iptBranchDropArea->addAcceptedTypes("Policy"); + m_dialog->iptBranchDropArea->addAcceptedTypes("NAT"); + m_dialog->iptBranchDropArea->addAcceptedTypes("Routing"); + m_dialog->iptBranchDropArea->setHelperText("Drop rule set object here"); + connect (m_dialog->iptBranchDropArea, + SIGNAL(objectDeleted()),this,SLOT(changed())); + connect (m_dialog->iptBranchDropArea, + SIGNAL(objectInserted()),this,SLOT(changed())); + m_dialog->pfBranchDropArea->addAcceptedTypes("Policy"); + m_dialog->pfBranchDropArea->addAcceptedTypes("NAT"); + m_dialog->pfBranchDropArea->addAcceptedTypes("Routing"); + m_dialog->pfBranchDropArea->setHelperText("Drop rule set object here"); + connect (m_dialog->pfBranchDropArea, + SIGNAL(objectDeleted()),this,SLOT(changed())); + connect (m_dialog->pfBranchDropArea, + SIGNAL(objectInserted()),this,SLOT(changed())); - BranchAnchorArea = new FWObjectDropArea(m_dialog->BranchAnchorPageFrame); - BranchAnchorArea->addAcceptedTypes("Policy"); - BranchAnchorArea->addAcceptedTypes("NAT"); - BranchAnchorArea->addAcceptedTypes("Routing"); - BranchAnchorArea->setHelperText("Drop rule set object here"); - m_dialog->gridLayout20->addWidget(BranchAnchorArea); - connect (BranchAnchorArea,SIGNAL(objectDeleted()),this,SLOT(changed())); - connect (BranchAnchorArea,SIGNAL(objectInserted()),this,SLOT(changed())); - - TagStrArea = new FWObjectDropArea(m_dialog->TagStrFrame); - TagStrArea->addAcceptedTypes("TagService"); - m_dialog->gridLayout4->addWidget(TagStrArea); - connect (TagStrArea,SIGNAL(objectDeleted()),this,SLOT(changed())); - connect (TagStrArea,SIGNAL(objectInserted()),this,SLOT(changed())); - - TagIntArea = new FWObjectDropArea(m_dialog->TagIntFrame); - TagIntArea->addAcceptedTypes("TagService"); - m_dialog->gridLayout9->addWidget(TagIntArea); - connect (TagIntArea,SIGNAL(objectDeleted()),this,SLOT(changed())); - connect (TagIntArea,SIGNAL(objectInserted()),this,SLOT(changed())); - - -// FWObjectDropArea * fwoda = new FWObjectDropArea(m_dialog->TagIntFrame); + m_dialog->pfTagDropArea->addAcceptedTypes("TagService"); + connect (m_dialog->pfTagDropArea, + SIGNAL(objectDeleted()),this,SLOT(changed())); + connect (m_dialog->pfTagDropArea, + SIGNAL(objectInserted()),this,SLOT(changed())); + m_dialog->iptTagDropArea->addAcceptedTypes("TagService"); + connect (m_dialog->iptTagDropArea, + SIGNAL(objectDeleted()),this,SLOT(changed())); + connect (m_dialog->iptTagDropArea, + SIGNAL(objectInserted()),this,SLOT(changed())); }; ActionsDialog::~ActionsDialog() { delete m_dialog; - delete TagIntArea; - delete TagStrArea; - delete BranchChainArea; - delete BranchAnchorArea; } void ActionsDialog::loadFWObject(FWObject *o) @@ -185,28 +176,28 @@ void ActionsDialog::applyChanges() if (editor=="TagInt") { - FWObject *tag_object = TagIntArea->getObject(); + FWObject *tag_object = m_dialog->iptTagDropArea->getObject(); // if tag_object==NULL, setTagObject clears setting in the rule rule->setTagObject(tag_object); } if (editor=="TagStr") { - FWObject *tag_object = TagStrArea->getObject(); + FWObject *tag_object = m_dialog->pfTagDropArea->getObject(); // if tag_object==NULL, setTagObject clears setting in the rule rule->setTagObject(tag_object); } if (editor=="BranchChain") { - RuleSet *ruleset = RuleSet::cast(BranchChainArea->getObject()); + RuleSet *ruleset = RuleSet::cast(m_dialog->iptBranchDropArea->getObject()); // if ruleset==NULL, setBranch clears setting in the rule rule->setBranch(ruleset); } if (editor=="BranchAnchor") { - RuleSet *ruleset = RuleSet::cast(BranchAnchorArea->getObject()); + RuleSet *ruleset = RuleSet::cast(m_dialog->pfBranchDropArea->getObject()); // if ruleset==NULL, setBranch clears setting in the rule rule->setBranch(ruleset); } @@ -284,26 +275,32 @@ void ActionsDialog::setRule(PolicyRule *r ) if (platform=="iptables") { - m_dialog->classify_txt_1->show(); + //m_dialog->classify_txt_1->show(); m_dialog->classify_terminating->show(); - m_dialog->tag_txt_1->show(); + //m_dialog->tag_txt_1->show(); m_dialog->tag_terminating->show(); + // Keep both variants of this text separate to simplify localization + QString emu_state; if (firewall->getOptionsObject()->getBool ("classify_mark_terminating")) { - m_dialog->classify_terminating->setText(tr("Emulation is currently ON, rule will be terminating") ); - m_dialog->tag_terminating->setText(tr("Emulation is currently ON, rule will be terminating") ); + emu_state = + tr("Emulation of terminating behavior for MARK and CLASSIFY " + "targets is currently ON, rule will be terminating"); } else { - m_dialog->classify_terminating->setText(tr("Emulation is currently OFF, rule will be non-terminating") ); - m_dialog->tag_terminating->setText(tr("Emulation is currently OFF, rule will be non-terminating") ); + emu_state = + tr("Emulation of terminating behavior for MARK and CLASSIFY " + "targets is currently OFF, rule will not be terminating"); } + m_dialog->classify_terminating->setText(emu_state); + m_dialog->tag_terminating->setText(emu_state); } else { - m_dialog->classify_txt_1->hide(); + //m_dialog->classify_txt_1->hide(); m_dialog->classify_terminating->hide(); - m_dialog->tag_txt_1->hide(); + //m_dialog->tag_txt_1->hide(); m_dialog->tag_terminating->hide(); } @@ -356,13 +353,13 @@ void ActionsDialog::setRule(PolicyRule *r ) { w=m_dialog->TagIntPage; FWObject *o = rule->getTagObject(); - TagIntArea->setObject(o); + m_dialog->iptTagDropArea->setObject(o); } else if (editor=="TagStr") { w=m_dialog->TagStrPage; FWObject *o = rule->getTagObject(); - TagStrArea->setObject(o); + m_dialog->pfTagDropArea->setObject(o); } else if (editor=="AccountingStr") { @@ -388,7 +385,7 @@ void ActionsDialog::setRule(PolicyRule *r ) { w=m_dialog->BranchChainPage; RuleSet *ruleset = r->getBranch(); - BranchChainArea->setObject(ruleset); + m_dialog->iptBranchDropArea->setObject(ruleset); data.registerOption( m_dialog->ipt_branch_in_mangle, ropt , "ipt_branch_in_mangle" ); @@ -397,7 +394,7 @@ void ActionsDialog::setRule(PolicyRule *r ) { w=m_dialog->BranchAnchorPage; RuleSet *ruleset = r->getBranch(); - BranchChainArea->setObject(ruleset); + m_dialog->iptBranchDropArea->setObject(ruleset); } else if (editor=="RouteIPT") { diff --git a/src/gui/actionsdialog_q.ui b/src/gui/actionsdialog_q.ui index 905b3f57a..abc582591 100644 --- a/src/gui/actionsdialog_q.ui +++ b/src/gui/actionsdialog_q.ui @@ -5,8 +5,8 @@ 0 0 - 635 - 211 + 852 + 212 @@ -106,24 +106,6 @@ QFrame::Sunken - - 8 - - - 8 - - - 8 - - - 8 - - - 8 - - - 8 - @@ -139,124 +121,66 @@ QFrame::Plain - 0 + 3 - - 0 - - - 0 - - - 0 - - - 0 - - - 2 - - - 2 - - + - Tag string: + Tag service object: false - - - - Qt::Vertical + + + + + 0 + 0 + - - QSizePolicy::MinimumExpanding - - - - 20 - 0 - - - - - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 20 - 0 - - - - - - - 200 + 100 80 - - - 80 - 16777215 - + + + 9 + - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - + Qt::Horizontal - 40 - 20 + 691 + 58 + + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 20 + 0 @@ -283,22 +207,6 @@ 2 - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 20 - 0 - - - - @@ -403,94 +311,54 @@ - - 0 - - - 0 - - - 0 - - - 0 - - - 2 - - - 2 - - - - - - - Tag value: - - - false - - - - - - - - 100 - 50 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - + + + + Tag service object: + + + false + + - + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 201 + 81 + + + + + + + + + 0 + 0 + + + + + 100 + 80 + + + + + 9 + + + + + Requires CONNMARK target @@ -500,7 +368,28 @@ - + + + + Note: this action translates into MARK target for iptables. +Normally this target is non-terminating, that is, other rules +with Classify or Tag actions below this one will process +the same packet. However, Firewall Builder can emulate +terminating behavior for this action. Option in the "compiler" +tab of the firewall object properties dialog activates emulation. + + + Emulation of terminating behavior for MARK target is currently ON, the rule will be terminating + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + + Qt::Vertical @@ -510,38 +399,12 @@ - 20 - 0 + 609 + 21 - - - - Note: this action translates into MARK target for iptables. Normally this target is non-terminating, that is, other rules with Classify or Tag actions below this one will process the same packet. However, Firewall Builder can emulate terminating behavior for this action. Option in the "compiler" tab of the firewall object properties dialog activates emulation. - - - Qt::AlignVCenter - - - true - - - - - - - Emulation is currently ON, the rule will be terminating - - - Qt::AlignCenter - - - false - - - @@ -574,22 +437,6 @@ - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 20 - 0 - - - - @@ -756,22 +603,6 @@ 0 - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 20 - 0 - - - - @@ -830,19 +661,6 @@ - - - - Note: CLASSIFY target in iptables is non-terminating, that is other rules with Classify or Mark target below this will process the same packet. However, Firewall Builder can emulate terminating behavior for this action. Emulation is activated by an option in the "compiler" tab of the firewall object properties dialog. - - - Qt::AlignVCenter - - - true - - - @@ -861,6 +679,15 @@ + + Note: CLASSIFY target in iptables is non-terminating, +that is other rules with Classify or Mark +target below this will process the same packet. +However, Firewall Builder can emulate terminating +behavior for this action. Emulation is activated +by an option in the "compiler" tab of the firewall +object properties dialog. + Emulation is currently ON, rule will be terminating @@ -927,22 +754,6 @@ - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 20 - 0 - - - - @@ -963,110 +774,58 @@ - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 589 - 21 - - - - - + - User-defined chain name: + Policy ruleset object: false - - + + + + + 0 + 0 + + - 80 + 100 80 - - QFrame::StyledPanel + + + 9 + - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - - - - Qt::Horizontal - - - - 531 - 30 - - - - - + In addition to 'filter', create branching rule in 'mangle' table as well - + + + + Qt::Horizontal + + + + 41 + 21 + + + + + Qt::Vertical @@ -1086,120 +845,62 @@ - - 0 - - - 0 - - - 0 - - - 0 - - - 2 - - - 2 - - + - Anchor name: + Policy rule set object: false - - - - Qt::Vertical + + + + + 0 + 0 + - - QSizePolicy::MinimumExpanding - - - - 20 - 0 - - - - - - - 200 - 64 + 100 + 80 - - - 64 - 10000 - + + + 9 + - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 20 - 0 - - - - - + Qt::Horizontal - 40 - 20 + 701 + 64 + + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 20 + 0 @@ -1291,42 +992,10 @@ - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 20 - 0 - - - - - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 20 - 0 - - - - @@ -1567,6 +1236,14 @@ + + + FWObjectDropArea + QWidget +
FWObjectDropArea.h
+ 1 +
+