Skip to content

Commit 9e7cd1c

Browse files
committed
Contribution to #938
1 parent 026dfe2 commit 9e7cd1c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/Interface/Modules/Render/Screenshot.cc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,19 @@ void Screenshot::takeScreenshot()
5555
void Screenshot::saveScreenshot()
5656
{
5757
index_++;
58-
QString fileName = screenshotFile();
59-
QMessageBox::information(nullptr, "ViewScene Screenshot", "Saving ViewScene screenshot to: " + fileName);
60-
screenshot_.save(fileName);
58+
auto fileName = screenshotFile();
59+
if (!fileName.isEmpty())
60+
{
61+
QMessageBox::information(nullptr, "ViewScene Screenshot", "Saving ViewScene screenshot to: " + fileName);
62+
screenshot_.save(fileName);
63+
}
6164
}
6265

6366
QString Screenshot::screenshotFile() const
6467
{
65-
return filePath + QString("/viewScene_%1_%2.png").arg(QDateTime::currentDateTime().toString("yyyy.MM.dd.HHmmss.zzz")).arg(index_);
68+
return QFileDialog::getSaveFileName(viewport_, "Save screenshot...", filePath, "*.png");
69+
//TODO: might want to have an option to save to an auto-generated file for speed
70+
//return filePath + QString("/viewScene_%1_%2.png").arg(QDateTime::currentDateTime().toString("yyyy.MM.dd.HHmmss.zzz")).arg(index_);
6671
}
6772

6873
SCIRun::Modules::Render::RGBMatrices Screenshot::toMatrix() const

0 commit comments

Comments
 (0)