mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-05 21:56:46 -06:00
#12236 Summary Cases: Allow reordering of summary cases
This commit is contained in:
1 parent
85b9214ac1
commit
61ff5748ce
4 files changed
+34
-4
No files matched your search
@@ -47,6 +47,7 @@
|
||||
#include "RimSummaryMultiPlotCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "cafPdmFieldReorderCapability.h"
|
||||
#include "cafProgressInfo.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
@@ -102,6 +103,8 @@ RimSummaryCaseMainCollection::RimSummaryCaseMainCollection()
|
||||
CAF_PDM_InitObject( "Summary Cases", ":/SummaryCases16x16.png" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_cases, "SummaryCases", "" );
|
||||
caf::PdmFieldReorderCapability::addToField( &m_cases );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_caseCollections, "SummaryCaseCollections", "" );
|
||||
}
|
||||
|
||||
@@ -208,6 +211,19 @@ void RimSummaryCaseMainCollection::removeCases( std::vector<RimSummaryCase*>& ca
|
||||
dataSourceHasChanged.send();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCaseMainCollection::moveCase( RimSummaryCase* summaryCase, int destinationIndex )
|
||||
{
|
||||
auto currentIndex = m_cases.indexOf( summaryCase );
|
||||
if ( currentIndex < m_cases.size() )
|
||||
{
|
||||
m_cases.erase( currentIndex );
|
||||
m_cases.insertAt( std::min( destinationIndex, (int)m_cases.size() ), summaryCase );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -60,6 +60,7 @@ public:
|
||||
void addCase( RimSummaryCase* summaryCase );
|
||||
void removeCase( RimSummaryCase* summaryCase, bool notifyChange = true );
|
||||
void removeCases( std::vector<RimSummaryCase*>& cases );
|
||||
void moveCase( RimSummaryCase* summaryCase, int destinationIndex );
|
||||
|
||||
RimSummaryEnsemble* addEnsemble( const std::vector<RimSummaryCase*>& summaryCases,
|
||||
const QString& coolectionName,
|
||||
|
||||
Reference in new issue
Block a user