mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 07:00:17 -05:00
Ensures that the "Jobs" object name reflects its beta status by appending the appropriate postfix. This change helps to differentiate beta features from stable ones within the application.
92 lines
3.2 KiB
C++
92 lines
3.2 KiB
C++
/////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Copyright (C) 2025 Equinor ASA
|
|
//
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
//
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
// for more details.
|
|
//
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#include "RimJobCollection.h"
|
|
|
|
#include "RiaLogging.h"
|
|
|
|
#include "Rim3dView.h"
|
|
#include "RimGenericJob.h"
|
|
#include "RimGridView.h"
|
|
#include "RimProject.h"
|
|
|
|
#include "cafCmdFeatureMenuBuilder.h"
|
|
|
|
CAF_PDM_SOURCE_INIT( RimJobCollection, "JobCollection" );
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
RimJobCollection::RimJobCollection()
|
|
{
|
|
CAF_PDM_InitObject( "Jobs" + RiaDefines::betaFeaturePostfix(), ":/gear.svg" );
|
|
|
|
CAF_PDM_InitFieldNoDefault( &m_jobs, "Jobs", "Jobs" );
|
|
|
|
setCustomContextMenuEnabled( true );
|
|
setDeletable( false );
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
RimJobCollection::~RimJobCollection()
|
|
{
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
std::vector<RimGenericJob*> RimJobCollection::jobs() const
|
|
{
|
|
return m_jobs.childrenByType();
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
bool RimJobCollection::isEmpty()
|
|
{
|
|
return !m_jobs.hasChildren();
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RimJobCollection::addNewJob( RimGenericJob* newJob )
|
|
{
|
|
m_jobs.push_back( newJob );
|
|
updateAllRequiredEditors();
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RimJobCollection::deleteAllJobs()
|
|
{
|
|
m_jobs.deleteChildren();
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RimJobCollection::appendMenuItems( caf::CmdFeatureMenuBuilder& menuBuilder ) const
|
|
{
|
|
menuBuilder << "RicNewOpmFlowJobFeature";
|
|
}
|