mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2398 Fracture : Hide "New Fracture" in context menu when no Fracture Template is defined
This commit is contained in:
parent
5855e412e7
commit
7dbd6c1027
@ -49,6 +49,9 @@ CAF_CMD_SOURCE_INIT(RicNewSimWellFractureAtPosFeature, "RicNewSimWellFractureAtP
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewSimWellFractureAtPosFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
if (proj->allFractureTemplates().empty()) return;
|
||||
|
||||
RimView* activeView = RiaApplication::instance()->activeReservoirView();
|
||||
if (!activeView) return;
|
||||
|
||||
@ -120,6 +123,9 @@ void RicNewSimWellFractureAtPosFeature::setupActionLook(QAction* actionToSetup)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewSimWellFractureAtPosFeature::isCommandEnabled()
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
if (proj->allFractureTemplates().empty()) return false;
|
||||
|
||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
||||
if (!pdmUiItem) return false;
|
||||
|
||||
|
@ -50,6 +50,9 @@ CAF_CMD_SOURCE_INIT(RicNewSimWellFractureFeature, "RicNewSimWellFractureFeature"
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewSimWellFractureFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
if (proj->allFractureTemplates().empty()) return;
|
||||
|
||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
||||
if (!pdmUiItem) return;
|
||||
|
||||
@ -109,6 +112,9 @@ void RicNewSimWellFractureFeature::setupActionLook(QAction* actionToSetup)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewSimWellFractureFeature::isCommandEnabled()
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
if (proj->allFractureTemplates().empty()) return false;
|
||||
|
||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
||||
if (!pdmUiItem) return false;
|
||||
|
||||
|
@ -22,6 +22,8 @@
|
||||
|
||||
#include "RicNewWellPathFractureFeature.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "RiuSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
@ -35,6 +37,9 @@ CAF_CMD_SOURCE_INIT(RicNewWellPathFractureAtPosFeature, "RicNewWellPathFractureA
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewWellPathFractureAtPosFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
if (proj->allFractureTemplates().empty()) return;
|
||||
|
||||
RiuSelectionManager* riuSelManager = RiuSelectionManager::instance();
|
||||
RiuSelectionItem* selItem = riuSelManager->selectedItem(RiuSelectionManager::RUI_TEMPORARY);
|
||||
|
||||
@ -61,5 +66,8 @@ void RicNewWellPathFractureAtPosFeature::setupActionLook(QAction* actionToSetup)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewWellPathFractureAtPosFeature::isCommandEnabled()
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
if (proj->allFractureTemplates().empty()) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -96,6 +96,9 @@ void RicNewWellPathFractureFeature::addFracture(RimWellPath* wellPath, double me
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewWellPathFractureFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
if (proj->allFractureTemplates().empty()) return;
|
||||
|
||||
RimWellPathFractureCollection* fractureColl = RicNewWellPathFractureFeature::selectedWellPathFractureCollection();
|
||||
if (!fractureColl) return;
|
||||
|
||||
@ -120,6 +123,9 @@ void RicNewWellPathFractureFeature::setupActionLook(QAction* actionToSetup)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewWellPathFractureFeature::isCommandEnabled()
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
if (proj->allFractureTemplates().empty()) return false;
|
||||
|
||||
if (selectedWellPathFractureCollection())
|
||||
{
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user