mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7481 Usability : Include case name in menu item text
This commit is contained in:
parent
aa8c630c98
commit
f56b442e26
@ -92,15 +92,26 @@ void RicImportGridModelFromSummaryCaseFeature::setupActionLook( QAction* actionT
|
|||||||
|
|
||||||
RimFileSummaryCase* summaryCase = caf::SelectionManager::instance()->selectedItemOfType<RimFileSummaryCase>();
|
RimFileSummaryCase* summaryCase = caf::SelectionManager::instance()->selectedItemOfType<RimFileSummaryCase>();
|
||||||
|
|
||||||
auto gridCase = gridModelFromSummaryCase( summaryCase );
|
QString summaryCaseName;
|
||||||
|
if ( summaryCase ) summaryCaseName = summaryCase->caseName();
|
||||||
|
|
||||||
|
QString txt;
|
||||||
|
auto gridCase = gridModelFromSummaryCase( summaryCase );
|
||||||
if ( gridCase )
|
if ( gridCase )
|
||||||
{
|
{
|
||||||
actionToSetup->setText( "Open Grid Model View" );
|
txt = "Open Grid Model View";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
actionToSetup->setText( "Import Grid Model" );
|
txt = "Import Grid Model";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !summaryCaseName.isEmpty() )
|
||||||
|
{
|
||||||
|
txt += QString( " for '%1'" ).arg( summaryCaseName );
|
||||||
|
}
|
||||||
|
|
||||||
|
actionToSetup->setText( txt );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -260,9 +260,10 @@ void RiuSummaryQwtPlot::contextMenuEvent( QContextMenuEvent* event )
|
|||||||
{
|
{
|
||||||
int summaryCaseId = summaryCase->caseId();
|
int summaryCaseId = summaryCase->caseId();
|
||||||
QVariant summaryCaseIdVariant( summaryCaseId );
|
QVariant summaryCaseIdVariant( summaryCaseId );
|
||||||
|
auto modelName = summaryCase->nativeCaseName();
|
||||||
|
|
||||||
menuBuilder.addCmdFeatureWithUserData( "RicImportGridModelFromSummaryCurveFeature",
|
menuBuilder.addCmdFeatureWithUserData( "RicImportGridModelFromSummaryCurveFeature",
|
||||||
"Open Grid Model",
|
QString( "Open Grid Model '%1'" ).arg( modelName ),
|
||||||
summaryCaseIdVariant );
|
summaryCaseIdVariant );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user