(#539) When view is unlinked, ask user to keep either override or original range filter collection

This commit is contained in:
Magne Sjaastad
2015-10-21 12:45:35 +02:00
parent 065a688c19
commit 8de8100c3e
12 changed files with 148 additions and 8 deletions

View File

@@ -42,11 +42,17 @@ bool RicDeleteAllLinkedViewsFeature::isCommandEnabled()
void RicDeleteAllLinkedViewsFeature::onActionTriggered(bool isChecked)
{
RimProject* proj = RiaApplication::instance()->project();
if (proj->viewLinkerCollection()->viewLinker())
{
delete proj->viewLinkerCollection()->viewLinker();
proj->viewLinkerCollection()->viewLinker = NULL;
RimViewLinker* viewLinker = proj->viewLinkerCollection()->viewLinker();
if (viewLinker)
{
// Remove the view linker object from the view linker collection
// viewLinkerCollection->viewLinker is a PdmChildField containing one RimViewLinker child object
proj->viewLinkerCollection->viewLinker.removeChildObject(viewLinker);
viewLinker->applyRangeFilterCollectionByUserChoice();
delete viewLinker;
proj->uiCapability()->updateConnectedEditors();
}

View File

@@ -68,13 +68,14 @@ void RicSetMasterViewFeature::onActionTriggered(bool isChecked)
RimProject* proj = RiaApplication::instance()->project();
RimViewLinker* viewLinker = proj->viewLinkerCollection()->viewLinker();
viewLinker->applyRangeFilterCollectionByUserChoice();
RimView* previousMasterView = viewLinker->masterView();
viewLinker->setMasterView(activeView);
viewLinker->updateDependentViews();
viewLinker->addDependentView(previousMasterView);
proj->viewLinkerCollection.uiCapability()->updateConnectedEditors();
proj->updateConnectedEditors();

View File

@@ -60,8 +60,9 @@ void RicUnLinkViewFeature::onActionTriggered(bool isChecked)
if (!activeView) return;
RimViewController* viewController = activeView->viewController();
caf::SelectionManager::instance()->setSelectedItem(viewController);
viewController->applyRangeFilterCollectionByUserChoice();
caf::SelectionManager::instance()->setSelectedItem(viewController);
caf::CmdFeature* feature = caf::CmdFeatureManager::instance()->getCommandFeature("RicDeleteItemFeature");
if (feature)
{