mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4796 Summary Plot Template : Add context menu to selected summary cases
This commit is contained in:
@@ -882,6 +882,10 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
menuBuilder << "RicAsciiExportSummaryPlotFeature";
|
||||
}
|
||||
}
|
||||
else if ( dynamic_cast<RimSummaryCase*>( uiItem ) )
|
||||
{
|
||||
appendPlotTemplateMenus( menuBuilder );
|
||||
}
|
||||
else if ( dynamic_cast<RimWellLogPlot*>( uiItem ) )
|
||||
{
|
||||
menuBuilder << "RicAsciiExportWellLogPlotFeature";
|
||||
@@ -1031,6 +1035,19 @@ void RimContextCommandBuilder::createExecuteScriptForCasesFeatureMenu( caf::CmdF
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimContextCommandBuilder::appendPlotTemplateMenus( caf::CmdFeatureMenuBuilder& menuBuilder )
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
RimProject* proj = app->project();
|
||||
if ( proj && proj->rootPlotTemlateItem() )
|
||||
{
|
||||
appendPlotTemplateItems( menuBuilder, proj->rootPlotTemlateItem() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1068,6 +1085,26 @@ void RimContextCommandBuilder::appendScriptItems( caf::CmdFeatureMenuBuilder& me
|
||||
menuBuilder.subMenuEnd();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimContextCommandBuilder::appendPlotTemplateItems( caf::CmdFeatureMenuBuilder& menuBuilder,
|
||||
RimPlotTemplateFolderItem* plotTemplateRoot )
|
||||
{
|
||||
for ( const auto& fileItem : plotTemplateRoot->fileNames() )
|
||||
{
|
||||
QString menuText = fileItem->uiName();
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicCreatePlotFromTemplateFeature",
|
||||
menuText,
|
||||
QVariant( fileItem->absoluteFilePath() ) );
|
||||
}
|
||||
|
||||
for ( const auto& folder : plotTemplateRoot->subFolders() )
|
||||
{
|
||||
appendPlotTemplateItems( menuBuilder, folder );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user