From d1c33ef54517037c7e13939b0e84df592dad387c Mon Sep 17 00:00:00 2001 From: Date: Mon, 28 Apr 2008 16:02:38 +0000 Subject: [PATCH] bugfix 2557 --- src/gui/RuleSetView.cpp | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/gui/RuleSetView.cpp b/src/gui/RuleSetView.cpp index 2a4711bc1..4289482c2 100644 --- a/src/gui/RuleSetView.cpp +++ b/src/gui/RuleSetView.cpp @@ -2132,9 +2132,10 @@ Rule* RuleSetView::insertRule(int pos, FWObject *r) addRuleBranch( newrule_as_policy_rule ); ruleModel->insertRow(pos); + rowsInfo.insert(pos,NULL); adjustRow(pos); update(); - + updateGroups(); setCurrentCell( pos, currentColumn() ); updateCell(pos,currentColumn()); @@ -2286,18 +2287,21 @@ void RuleSetView::mousePressEvent( QMouseEvent* ev ) int row=rowAt(ev->y()); int col=columnAt(ev->x()); - + if (col==0) { - if (rowsInfo[row]!=NULL) + if (row=0) { - QWidget * wgt = indexWidget(model()->index(row,1)); - RuleGroupPanel * rfp = dynamic_cast(wgt); - if (rfp!=NULL) + if (rowsInfo[row]!=NULL) { - showHideRuleGroup(rfp); + QWidget * wgt = indexWidget(model()->index(row,1)); + RuleGroupPanel * rfp = dynamic_cast(wgt); + if (rfp!=NULL) + { + showHideRuleGroup(rfp); + } } - } + } } @@ -3946,7 +3950,7 @@ void RuleSetView::removeRule() int lastN=ruleIndex.size()-1; ruleIndex.remove (rn);//erase(rn); - + rowsInfo.remove(rn); for (int i=rn; iremoveRows( firstSelectedRule, lastSelectedRule ); - + setUpdatesEnabled(true); clearSelection(); setCurrentCell( firstSelectedRule, currentColumn() ); update(); - + updateGroups(); changingRules = false; m_project->updateLastModifiedTimestampForOneFirewall(getFirewall()); } @@ -4068,7 +4072,7 @@ void RuleSetView::moveRule() selectRE( newN , currentColumn() ); changeCurrentCell( newN, currentColumn(), true ); - + updateGroups(); changingRules = false; m_project->updateLastModifiedTimestampForOneFirewall(getFirewall()); } @@ -4117,6 +4121,7 @@ void RuleSetView::moveRuleDown() selectRE( rn+1 , currentColumn() ); update(); + updateGroups(); } } @@ -4156,6 +4161,7 @@ void RuleSetView::copyRule() FWObjectClipboard::obj_clipboard->add( rule, m_project ); } } + updateGroups(); } void RuleSetView::cutRule()