#1730 Include more information in snapshot filenames

This commit is contained in:
Bjørnar Grip Fjær
2017-08-04 11:25:17 +02:00
parent 88186619db
commit 37456bfa9b
11 changed files with 375 additions and 78 deletions

View File

@@ -26,6 +26,8 @@
#include "RimViewWindow.h"
#include "RiuMainPlotWindow.h"
#include "RicSnapshotFilenameGenerator.h"
#include "cafUtils.h"
#include <QAction>
@@ -51,11 +53,11 @@ void RicSnapshotViewToFileFeature::saveSnapshotAs(const QString& fileName, RimVi
{
if (image.save(fileName))
{
qDebug() << "Exported snapshot image to " << fileName;
RiaLogging::info(QString("Exported snapshot image to %1").arg(fileName));
}
else
{
qDebug() << "Error when trying to export snapshot image to " << fileName;
RiaLogging::error(QString("Error when trying to export snapshot image to %1").arg(fileName));
}
}
}
@@ -99,7 +101,7 @@ void RicSnapshotViewToFileFeature::onActionTriggered(bool isChecked)
startPath = app->lastUsedDialogDirectory("IMAGE_SNAPSHOT");
}
startPath += "/image.png";
startPath = caf::Utils::constructFullFileName(startPath, RicSnapshotFilenameGenerator::generateSnapshotFileName(viewWindow), ".png");
QString fileName = QFileDialog::getSaveFileName(NULL, tr("Export to File"), startPath);
if (fileName.isEmpty())