Make it possible to store project file without global path section

If you have a project file with an alias section, this project is not possible to open in previous versions. Add a menu entry in the Testing menu to allow storage without alias.
This commit is contained in:
Magne Sjaastad
2020-01-03 12:16:52 +01:00
parent 5df7700a75
commit 576dfa80ac
4 changed files with 93 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020 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 "RicSaveProjectNoGlobalPathsFeature.h"
#include "RiaApplication.h"
#include "RimProject.h"
#include <QAction>
#include <QDir>
CAF_CMD_SOURCE_INIT( RicSaveProjectNoGlobalPathsFeature, "RicSaveProjectNoGlobalPathsFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicSaveProjectNoGlobalPathsFeature::isCommandEnabled()
{
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicSaveProjectNoGlobalPathsFeature::onActionTriggered( bool isChecked )
{
RimProject* proj = RiaApplication::instance()->project();
if ( proj )
{
proj->writeFile();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicSaveProjectNoGlobalPathsFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "Save Project (No Global Paths)" );
}