Show templates as separate project explorer tab. (#8902)

Add templates as separate project explorer tab.
Add support for renaming and editing templates
This commit is contained in:
jonjenssen
2022-05-11 19:46:17 +02:00
committed by GitHub
parent daf02571c2
commit 828e8ec440
17 changed files with 310 additions and 21 deletions

View File

@@ -214,9 +214,9 @@ RimProject::RimProject( void )
mainPlotCollection = new RimMainPlotCollection();
CAF_PDM_InitFieldNoDefault( &m_plotTemplateFolderItem, "PlotTemplateCollection", "Plot Templates" );
m_plotTemplateFolderItem = new RimPlotTemplateFolderItem();
m_plotTemplateFolderItem.xmlCapability()->disableIO();
CAF_PDM_InitFieldNoDefault( &m_plotTemplateTopFolder, "PlotTemplateCollection", "Plot Templates" );
m_plotTemplateTopFolder = new RimPlotTemplateFolderItem();
m_plotTemplateTopFolder.xmlCapability()->disableIO();
// For now, create a default first oilfield that contains the rest of the project
oilFields.push_back( new RimOilField );
@@ -403,12 +403,12 @@ void RimProject::setScriptDirectories( const QString& scriptDirectories )
//--------------------------------------------------------------------------------------------------
void RimProject::setPlotTemplateFolders( const QStringList& plotTemplateFolders )
{
if ( !m_plotTemplateFolderItem() )
if ( !m_plotTemplateTopFolder() )
{
m_plotTemplateFolderItem = new RimPlotTemplateFolderItem();
m_plotTemplateTopFolder = new RimPlotTemplateFolderItem();
}
m_plotTemplateFolderItem->createRootFolderItemsFromFolderPaths( plotTemplateFolders );
m_plotTemplateTopFolder->createRootFolderItemsFromFolderPaths( plotTemplateFolders );
}
//--------------------------------------------------------------------------------------------------
@@ -1322,7 +1322,7 @@ RimMeasurement* RimProject::measurement() const
//--------------------------------------------------------------------------------------------------
RimPlotTemplateFolderItem* RimProject::rootPlotTemlateItem() const
{
return m_plotTemplateFolderItem;
return m_plotTemplateTopFolder;
}
//--------------------------------------------------------------------------------------------------
@@ -1461,6 +1461,10 @@ void RimProject::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, Q
{
uiTreeOrdering.add( scriptCollection() );
}
else if ( uiConfigName == "PlotWindow.Templates" )
{
uiTreeOrdering.add( m_plotTemplateTopFolder );
}
else if ( uiConfigName == "MainWindow.DataSources" )
{
RimOilField* oilField = activeOilField();