mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#446) Added feature "Delete all linked views"
This commit is contained in:
parent
36f5f628f3
commit
4c781b12be
@ -11,6 +11,7 @@ ${CEE_CURRENT_LIST_DIR}RicShowAllLinkedViewsFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicLinkViewFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicUnLinkViewFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicShowLinkOptionsFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicDeleteAllLinkedViewsFeature.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@ -20,6 +21,7 @@ ${CEE_CURRENT_LIST_DIR}RicShowAllLinkedViewsFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicLinkViewFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicUnLinkViewFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicShowLinkOptionsFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicDeleteAllLinkedViewsFeature.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
@ -0,0 +1,62 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions AS
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicDeleteAllLinkedViewsFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimViewLinker.h"
|
||||
#include "RimViewLinkerCollection.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicDeleteAllLinkedViewsFeature, "RicDeleteAllLinkedViewsFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicDeleteAllLinkedViewsFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicDeleteAllLinkedViewsFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
if (proj->viewLinkerCollection()->viewLinker())
|
||||
{
|
||||
delete proj->viewLinkerCollection()->viewLinker();
|
||||
|
||||
proj->viewLinkerCollection()->viewLinker = NULL;
|
||||
|
||||
proj->uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicDeleteAllLinkedViewsFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("Delete All Linked Views");
|
||||
}
|
||||
|
@ -0,0 +1,38 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions AS
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicDeleteAllLinkedViewsFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
virtual bool isCommandEnabled();
|
||||
virtual void onActionTriggered( bool isChecked );
|
||||
virtual void setupActionLook(QAction* actionToSetup);
|
||||
};
|
@ -805,7 +805,7 @@ void RimProject::actionsBasedOnSelection(QMenu& contextMenu)
|
||||
{
|
||||
commandIds << "RicShowAllLinkedViewsFeature";
|
||||
commandIds << "Separator";
|
||||
commandIds << "RicDeleteItemFeature";
|
||||
commandIds << "RicDeleteAllLinkedViewsFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimWellLogPlotCollection*>(uiItem))
|
||||
{
|
||||
|
@ -70,6 +70,8 @@ RimViewLinker::RimViewLinker(void)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewLinker::~RimViewLinker(void)
|
||||
{
|
||||
removeOverrides();
|
||||
|
||||
viewLinks.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user