diff --git a/build_num b/build_num index 04a5d4e50..9c999db3a 100644 --- a/build_num +++ b/build_num @@ -1 +1 @@ -#define BUILD_NUM 2936 +#define BUILD_NUM 2937 diff --git a/doc/ChangeLog b/doc/ChangeLog index 586ef68bc..bf7c0ed5d 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,12 @@ +2010-05-28 vadim + + * ObjectManipulator.cpp (ObjectManipulator::editSelectedObject): + see #1447 Reverting change done for ticket #1447 in r2892 and + r2896 because of the user complaints. It appears to be more + convenient if Policy, NAT and Routing objects open in the rule set + view on double click but not in the editor. Second double clik + opens these objects in the editor. + 2010-05-25 vadim * configure.in (CPPUNIT_LIBS): fixed #1478 always use included diff --git a/src/gui/ObjectManipulator.cpp b/src/gui/ObjectManipulator.cpp index f186025d2..8fd42ca1b 100644 --- a/src/gui/ObjectManipulator.cpp +++ b/src/gui/ObjectManipulator.cpp @@ -1024,15 +1024,31 @@ void ObjectManipulator::editSelectedObject() if (RuleSet::cast(obj)!=NULL) { - // Menu item "Edit" always opens rule set in RuleSetView and in the editor - // Menu item "Open" opens only in RuleSetView. openSelectedRuleSet() - // does that. - openSelectedRuleSet(); - } + // Open rule set object in the editor if it is already opened + // in RuleSetView. If we just opened it in RuleSetView, check + // if the editor is visible and if yes, open the object in the + // editor right away. See #1331 - QCoreApplication::postEvent( - mw, new openObjectInEditorEvent( - m_project->getFileName(), obj->getId())); + if (m_project->getCurrentRuleSet() == obj) + { + QCoreApplication::postEvent( + mw, new openObjectInEditorEvent( + m_project->getFileName(), obj->getId())); + } else + { + QCoreApplication::postEvent( + m_project, new openRulesetEvent( + m_project->getFileName(), obj->getId())); + if (mw->isEditorVisible()) + QCoreApplication::postEvent( + mw, new openObjectInEditorEvent( + m_project->getFileName(), obj->getId())); + } + + } else + QCoreApplication::postEvent( + mw, new openObjectInEditorEvent( + m_project->getFileName(), obj->getId())); } void ObjectManipulator::openSelectedRuleSet() diff --git a/src/gui/unit_tests/ObjectManipulatorTest/ObjectManipulatorTest.cpp b/src/gui/unit_tests/ObjectManipulatorTest/ObjectManipulatorTest.cpp index 9315e25b0..9401c7ac6 100644 --- a/src/gui/unit_tests/ObjectManipulatorTest/ObjectManipulatorTest.cpp +++ b/src/gui/unit_tests/ObjectManipulatorTest/ObjectManipulatorTest.cpp @@ -80,7 +80,7 @@ void ObjectManipulatorTest::editSelectedObject() tree->setCurrentItem( policy, 0, QItemSelectionModel::Clear | QItemSelectionModel::SelectCurrent); - om->openSelectedRuleSet(); + om->editSelectedObject(); QTest::qWait(100); QVERIFY(mw->getOpenedEditor() == NULL); QVERIFY(mw->activeProject()->getCurrentRuleSet() == RuleSet::cast(policy->getFWObject()));