Merge pull request #4844 from OPM/improve-command-line-

#4765 Summary : Support command line snapshots without a project file
This commit is contained in:
Magne Sjaastad 2019-10-10 07:52:55 +02:00 committed by GitHub
commit 71760b0e34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -821,18 +821,15 @@ RiaApplication::ApplicationStatus RiaGuiApplication::handleArguments( cvf::Progr
}
}
if ( project() != nullptr && !project()->fileName().isEmpty() )
{
QString exportFolder = QDir::currentPath() + "/snapshots";
if ( snapshotViews )
{
RiuMainWindow* mainWnd = RiuMainWindow::instance();
CVF_ASSERT( mainWnd );
mainWnd->hideAllDockWidgets();
// 2016-11-09 : Location of snapshot folder was previously located in 'snapshot' folder
// relative to current working folder. Now harmonized to behave as RiuMainWindow::slotSnapshotAllViewsToFile()
QString absolutePathToSnapshotDir = createAbsolutePathFromProjectRelativePath( "snapshots" );
RicSnapshotAllViewsToFileFeature::exportSnapshotOfViewsIntoFolder( absolutePathToSnapshotDir );
RicSnapshotAllViewsToFileFeature::exportSnapshotOfViewsIntoFolder( exportFolder );
mainWnd->loadWinGeoAndDockToolBarLayout();
}
@ -843,13 +840,13 @@ RiaApplication::ApplicationStatus RiaGuiApplication::handleArguments( cvf::Progr
{
mainPlotWindow()->hideAllDockWidgets();
// Will be saved relative to current directory
RicSnapshotAllPlotsToFileFeature::saveAllPlots();
RicSnapshotAllPlotsToFileFeature::exportSnapshotOfPlotsIntoFolder( exportFolder );
mainPlotWindow()->loadWinGeoAndDockToolBarLayout();
}
}
}
closeProject();
return EXIT_COMPLETED;
}