History

Merge branch 'master' into 21089

David Rowe committed 9 years ago

Commit a75d0b32 parents 9b27083 881e0cb204 files · +7711 −1736Browse files

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

Unified · Split

interface/src/Application.cpp+16−7
@@ -154,6 +154,7 @@ · 153 unmodified lines
154154 #include "ui/LoginDialog.h"
155155 #include "ui/overlays/Cube3DOverlay.h"
156156 #include "ui/Snapshot.h"
157+#include "ui/SnapshotAnimated.h"
157158 #include "ui/StandAloneJSConsole.h"
158159 #include "ui/Stats.h"
159160 #include "ui/UpdateDialog.h"
@@ -5592,23 +5593,31 @@ void Application::toggleLogDialog() { · 5432 unmodified lines
55925593 }
55935594 }
55945595
5595−void Application::takeSnapshot(bool notify, float aspectRatio) {
5596− postLambdaEvent([notify, aspectRatio, this] {
5596+
5597+void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio) {
5598+ postLambdaEvent([notify, includeAnimated, aspectRatio, this] {
55975599 QMediaPlayer* player = new QMediaPlayer();
55985600 QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav");
55995601 player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath()));
56005602 player->play();
56015603
5604+ // Get a screenshot and save it
56025605 QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot(aspectRatio));
56035606
5604− emit DependencyManager::get<WindowScriptingInterface>()->snapshotTaken(path, notify);
5607+ // If we're not doing an animated snapshot as well...
5608+ if (!includeAnimated || !(SnapshotAnimated::alsoTakeAnimatedSnapshot.get())) {
5609+ // Tell the dependency manager that the capture of the still snapshot has taken place.
5610+ emit DependencyManager::get<WindowScriptingInterface>()->snapshotTaken(path, "", notify);
5611+ } else {
5612+ // Get an animated GIF snapshot and save it
5613+ SnapshotAnimated::saveSnapshotAnimated(path, aspectRatio, qApp, DependencyManager::get<WindowScriptingInterface>());
5614+ }
56055615 });
56065616 }
5607−
5608−void Application::shareSnapshot(const QString& path) {
5609− postLambdaEvent([path] {
5617+void Application::shareSnapshot(const QString& path, const QUrl& href) {
5618+ postLambdaEvent([path, href] {
56105619 // not much to do here, everything is done in snapshot code...
5611− Snapshot::uploadSnapshot(path);
5620+ Snapshot::uploadSnapshot(path, href);
56125621 });
56135622 }
56145623

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t