History

fix snapshots and preview

SamGondelman committed 7 years ago

Commit e7d12dc1 parent c730e5114 files · +101 −85Browse files

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

Unified · Split

interface/src/Application.cpp+17−5
@@ -8428,6 +8428,17 @@ bool Application::takeSnapshotOperators(std::queue<SnapshotOperator>& snapshotOp · 8427 unmodified lines
84288428 return !snapshotOperators.empty();
84298429 }
84308430
8431+void Application::addSecondarySnapshotOperator(const SecondarySnapshotOperator& snapshotOperator) {
8432+ std::lock_guard<std::mutex> lock(_snapshotMutex);
8433+ _secondarySnapshotOperators.push(snapshotOperator);
8434+}
8435+
8436+bool Application::takeSecondarySnapshotOperators(std::queue<SecondarySnapshotOperator>& snapshotOperators) {
8437+ std::lock_guard<std::mutex> lock(_snapshotMutex);
8438+ _secondarySnapshotOperators.swap(snapshotOperators);
8439+ return !snapshotOperators.empty();
8440+}
8441+
84318442 void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio, const QString& filename) {
84328443 addSnapshotOperator({ [notify, includeAnimated, aspectRatio, filename](const QImage& snapshot) {
84338444 QString path = DependencyManager::get<Snapshot>()->saveSnapshot(snapshot, filename, TestScriptingInterface::getInstance()->getTestResultsLocation());
@@ -8439,16 +8450,17 @@ void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRa · 5 unmodified lines
84398450 emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(path, notify);
84408451 }
84418452 } else if (!SnapshotAnimated::isAlreadyTakingSnapshotAnimated()) {
8442− // Get an animated GIF snapshot and save it
8443− SnapshotAnimated::saveSnapshotAnimated(path, aspectRatio, qApp, DependencyManager::get<WindowScriptingInterface>());
8453+ qApp->postLambdaEvent([path, aspectRatio] {
8454+ // Get an animated GIF snapshot and save it
8455+ SnapshotAnimated::saveSnapshotAnimated(path, aspectRatio, DependencyManager::get<WindowScriptingInterface>());
8456+ });
84448457 }
84458458 }, aspectRatio });
84468459 }
84478460
84488461 void Application::takeSecondaryCameraSnapshot(const bool& notify, const QString& filename) {
8449− postLambdaEvent([notify, filename, this] {
8450− QString snapshotPath = DependencyManager::get<Snapshot>()->saveSnapshot(getActiveDisplayPlugin()->getSecondaryCameraScreenshot(), filename,
8451− TestScriptingInterface::getInstance()->getTestResultsLocation());
8462+ addSecondarySnapshotOperator([notify, filename](const QImage& snapshot) {
8463+ QString snapshotPath = DependencyManager::get<Snapshot>()->saveSnapshot(snapshot, filename, TestScriptingInterface::getInstance()->getTestResultsLocation());
84528464
84538465 emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(snapshotPath, notify);
84548466 });

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