#3725 exportSnapshots : Add optional prefix

This commit is contained in:
Magne Sjaastad
2018-11-21 10:26:46 +01:00
parent 651084420c
commit 8a3907e531
6 changed files with 39 additions and 27 deletions

View File

@@ -68,7 +68,7 @@ void RicSnapshotAllPlotsToFileFeature::saveAllPlots()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicSnapshotAllPlotsToFileFeature::exportSnapshotOfAllPlotsIntoFolder(QString snapshotFolderName)
void RicSnapshotAllPlotsToFileFeature::exportSnapshotOfAllPlotsIntoFolder(const QString& snapshotFolderName, const QString& prefix)
{
RiaApplication* app = RiaApplication::instance();
@@ -91,6 +91,11 @@ void RicSnapshotAllPlotsToFileFeature::exportSnapshotOfAllPlotsIntoFolder(QStrin
if (viewWindow->isMdiWindow() && viewWindow->viewWidget())
{
QString fileName = RicSnapshotFilenameGenerator::generateSnapshotFileName(viewWindow);
if (!prefix.isEmpty())
{
fileName = prefix + fileName;
}
fileName.replace(" ", "_");
QString absoluteFileName = caf::Utils::constructFullFileName(absSnapshotPath, fileName, ".png");

View File

@@ -32,7 +32,7 @@ class RicSnapshotAllPlotsToFileFeature : public caf::CmdFeature
public:
static void saveAllPlots();
static void exportSnapshotOfAllPlotsIntoFolder(QString snapshotFolderName);
static void exportSnapshotOfAllPlotsIntoFolder(const QString& snapshotFolderName, const QString& prefix = "");
protected:
// Overrides

View File

@@ -70,7 +70,7 @@ void RicSnapshotAllViewsToFileFeature::saveAllViews()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicSnapshotAllViewsToFileFeature::exportSnapshotOfAllViewsIntoFolder(QString snapshotFolderName)
void RicSnapshotAllViewsToFileFeature::exportSnapshotOfAllViewsIntoFolder(const QString& snapshotFolderName, const QString& prefix)
{
RimProject* project = RiaApplication::instance()->project();
@@ -114,6 +114,10 @@ void RicSnapshotAllViewsToFileFeature::exportSnapshotOfAllViewsIntoFolder(QStrin
viewer->repaint();
QString fileName = RicSnapshotFilenameGenerator::generateSnapshotFileName(riv);
if (!prefix.isEmpty())
{
fileName = prefix + fileName;
}
QString absoluteFileName = caf::Utils::constructFullFileName(absSnapshotPath, fileName, ".png");

View File

@@ -32,7 +32,7 @@ class RicSnapshotAllViewsToFileFeature : public caf::CmdFeature
public:
static void saveAllViews();
static void exportSnapshotOfAllViewsIntoFolder(QString snapshotFolderName);
static void exportSnapshotOfAllViewsIntoFolder(const QString& snapshotFolderName, const QString& prefix = "");
protected:
// Overrides