mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user