mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4892 Improved names and added improved icons to linked views commands
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
#include "RicDeleteAllLinkedViewsFeature.h"
|
#include "RicDeleteAllLinkedViewsFeature.h"
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
#include "RimGridView.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimViewLinker.h"
|
#include "RimViewLinker.h"
|
||||||
#include "RimViewLinkerCollection.h"
|
#include "RimViewLinkerCollection.h"
|
||||||
@@ -30,19 +31,11 @@
|
|||||||
|
|
||||||
CAF_CMD_SOURCE_INIT( RicDeleteAllLinkedViewsFeature, "RicDeleteAllLinkedViewsFeature" );
|
CAF_CMD_SOURCE_INIT( RicDeleteAllLinkedViewsFeature, "RicDeleteAllLinkedViewsFeature" );
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
class DeleteAllLinkedViewsImpl
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
bool RicDeleteAllLinkedViewsFeature::isCommandEnabled()
|
|
||||||
{
|
|
||||||
return caf::SelectionManager::instance()->selectedItemAncestorOfType<RimViewLinkerCollection>() != nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RicDeleteAllLinkedViewsFeature::onActionTriggered( bool isChecked )
|
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
static void execute()
|
||||||
|
{
|
||||||
RimProject* proj = RiaApplication::instance()->project();
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
|
||||||
RimViewLinker* viewLinker = proj->viewLinkerCollection()->viewLinker();
|
RimViewLinker* viewLinker = proj->viewLinkerCollection()->viewLinker();
|
||||||
@@ -58,6 +51,23 @@ void RicDeleteAllLinkedViewsFeature::onActionTriggered( bool isChecked )
|
|||||||
|
|
||||||
proj->uiCapability()->updateConnectedEditors();
|
proj->uiCapability()->updateConnectedEditors();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RicDeleteAllLinkedViewsFeature::isCommandEnabled()
|
||||||
|
{
|
||||||
|
return caf::SelectionManager::instance()->selectedItemAncestorOfType<RimViewLinkerCollection>() != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicDeleteAllLinkedViewsFeature::onActionTriggered( bool isChecked )
|
||||||
|
{
|
||||||
|
DeleteAllLinkedViewsImpl::execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -65,6 +75,6 @@ void RicDeleteAllLinkedViewsFeature::onActionTriggered( bool isChecked )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicDeleteAllLinkedViewsFeature::setupActionLook( QAction* actionToSetup )
|
void RicDeleteAllLinkedViewsFeature::setupActionLook( QAction* actionToSetup )
|
||||||
{
|
{
|
||||||
actionToSetup->setText( "Delete All Linked Views" );
|
actionToSetup->setText( "Unlink All Views" );
|
||||||
actionToSetup->setIcon( QIcon( ":/Erase.png" ) );
|
actionToSetup->setIcon( QIcon( ":/UnLinkView16x16.png" ) );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user