mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-08 07:03:25 -06:00
Statistics dialog. Use active reservoir view as context object
This commit is contained in:
parent
14198191b1
commit
c6a3eca3c2
@ -39,7 +39,7 @@ CAF_CMD_SOURCE_INIT(RicShowGridStatisticsFeature, "RicShowGridStatisticsFeature"
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicShowGridStatisticsFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
return RiaApplication::instance()->activeReservoirView() != nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -47,16 +47,11 @@ bool RicShowGridStatisticsFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicShowGridStatisticsFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
auto eclipseView = caf::firstAncestorOfTypeFromSelectedObject<RimEclipseView*>();
|
||||
auto geoMechView = caf::firstAncestorOfTypeFromSelectedObject<RimGeoMechView*>();
|
||||
RimView * activeView = RiaApplication::instance()->activeReservoirView();
|
||||
|
||||
if (eclipseView && eclipseView->overlayInfoConfig())
|
||||
if (activeView)
|
||||
{
|
||||
eclipseView->overlayInfoConfig()->showStatisticsInfoDialog();
|
||||
}
|
||||
else if (geoMechView && geoMechView->overlayInfoConfig())
|
||||
{
|
||||
geoMechView->overlayInfoConfig()->showStatisticsInfoDialog();
|
||||
activeView->overlayInfoConfig()->showStatisticsInfoDialog();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user