History

Merge pull request #12343 from NissimHadar/saveSnapshotWithName

Added option to select snapshot filename in scripts.

John Conklin II committed 8 years ago

Commit 3377aac2 parents 51bf3c1 5579eac6 files · +37 −21Browse files

Showing the changes to interface/src/Application.cpp (1 of 6 files). Show all

Unified · Split

interface/src/Application.cpp+6−6
@@ -6935,10 +6935,10 @@ void Application::loadAvatarBrowser() const { · 6934 unmodified lines
69356935 DependencyManager::get<HMDScriptingInterface>()->openTablet();
69366936 }
69376937
6938−void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio) {
6939− postLambdaEvent([notify, includeAnimated, aspectRatio, this] {
6938+void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio, const QString& filename) {
6939+ postLambdaEvent([notify, includeAnimated, aspectRatio, filename, this] {
69406940 // Get a screenshot and save it
6941− QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot(aspectRatio));
6941+ QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot(aspectRatio), filename);
69426942 // If we're not doing an animated snapshot as well...
69436943 if (!includeAnimated) {
69446944 // Tell the dependency manager that the capture of the still snapshot has taken place.
@@ -6950,9 +6950,9 @@ void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRa · 5 unmodified lines
69506950 });
69516951 }
69526952
6953−void Application::takeSecondaryCameraSnapshot() {
6954− postLambdaEvent([this] {
6955− QString snapshotPath = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getSecondaryCameraScreenshot());
6953+void Application::takeSecondaryCameraSnapshot(const QString& filename) {
6954+ postLambdaEvent([filename, this] {
6955+ QString snapshotPath = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getSecondaryCameraScreenshot(), filename);
69566956 emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(snapshotPath, true);
69576957 });
69586958 }