System command command file merger (#4845)

* Move Import WellPaths command-file functionality into RicImportWellPaths

* Add new RICF_init macros for command file objects

* Make project save commands available in Python

* Fix RiaLogging build errors

* Move RiaLogging include from RiaGrpcServer.h to cpp file
This commit is contained in:
Gaute Lindkvist
2019-10-15 15:46:19 +02:00
committed by GitHub
parent f24543ce56
commit d3140b6aac
18 changed files with 349 additions and 237 deletions

View File

@@ -646,6 +646,25 @@ bool RiaApplication::loadProject( const QString& projectFileName )
return loadProject( projectFileName, PLA_NONE, nullptr );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaApplication::saveProject( QString* errorMessage )
{
CAF_ASSERT( errorMessage );
CAF_ASSERT( m_project.notNull() );
if ( !isProjectSavedToDisc() )
{
*errorMessage = "Project hasn't already been saved and no file name has been provided";
return false;
}
else
{
return saveProjectAs( m_project->fileName(), errorMessage );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -654,19 +673,22 @@ bool RiaApplication::saveProjectAs( const QString& fileName, QString* errorMessa
// Make sure we always store path with forward slash to avoid issues when opening the project file on Linux
m_project->fileName = RiaFilePathTools::toInternalSeparator( fileName );
onProjectBeingSaved();
if ( !m_project->writeFile() )
{
CAF_ASSERT( errorMessage );
*errorMessage = QString( "Not possible to save project file. Make sure you have sufficient access "
"rights.\n\nProject file location : %1" )
.arg( fileName );
return false;
}
m_preferences->lastUsedProjectFileName = fileName;
caf::PdmSettings::writeFieldsToApplicationStore( m_preferences );
onProjectSaved();
return true;
}