mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4687 Summary Template : Add UI to select template
#4705 Summary Template : Add icon and use from features and dialogs
This commit is contained in:
@@ -74,6 +74,15 @@ std::vector<RimPlotTemplateFolderItem*> RimPlotTemplateFolderItem::subFolders()
|
||||
return m_subFolders.childObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotTemplateFolderItem::appendOptionItemsForPlotTemplates( QList<caf::PdmOptionItemInfo>& options,
|
||||
RimPlotTemplateFolderItem* templateFolderItem )
|
||||
{
|
||||
appendOptionItemsForPlotTemplatesRecursively( options, templateFolderItem, 0 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -176,6 +185,37 @@ void RimPlotTemplateFolderItem::defineEditorAttribute( const caf::PdmFieldHandle
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotTemplateFolderItem::appendOptionItemsForPlotTemplatesRecursively(
|
||||
QList<caf::PdmOptionItemInfo>& options, RimPlotTemplateFolderItem* templateFolderItem, int menuLevel )
|
||||
{
|
||||
{
|
||||
auto subFolders = templateFolderItem->subFolders();
|
||||
for ( auto sub : subFolders )
|
||||
{
|
||||
caf::PdmOptionItemInfo optionInfo = caf::PdmOptionItemInfo::createHeader( sub->uiName(), true );
|
||||
optionInfo.setLevel( menuLevel );
|
||||
options.push_back( optionInfo );
|
||||
|
||||
appendOptionItemsForPlotTemplatesRecursively( options, sub, menuLevel + 1 );
|
||||
}
|
||||
}
|
||||
|
||||
caf::QIconProvider templateIcon( ":/SummaryTemplate16x16.png" );
|
||||
|
||||
auto files = templateFolderItem->fileNames();
|
||||
for ( auto file : files )
|
||||
{
|
||||
caf::PdmOptionItemInfo optionInfo( file->uiName(), file, false, templateIcon );
|
||||
|
||||
optionInfo.setLevel( menuLevel );
|
||||
|
||||
options.push_back( optionInfo );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user