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
8428 return !snapshotOperators.empty();8428 return !snapshotOperators.empty();
8429}8429}
8430 8430
8431void Application::addSecondarySnapshotOperator(const SecondarySnapshotOperator& snapshotOperator) {
8432 std::lock_guard<std::mutex> lock(_snapshotMutex);
8433 _secondarySnapshotOperators.push(snapshotOperator);
8434}
8435
8436bool Application::takeSecondarySnapshotOperators(std::queue<SecondarySnapshotOperator>& snapshotOperators) {
8437 std::lock_guard<std::mutex> lock(_snapshotMutex);
8438 _secondarySnapshotOperators.swap(snapshotOperators);
8439 return !snapshotOperators.empty();
8440}
8441
8431void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio, const QString& filename) {8442void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio, const QString& filename) {
8432 addSnapshotOperator({ [notify, includeAnimated, aspectRatio, filename](const QImage& snapshot) {8443 addSnapshotOperator({ [notify, includeAnimated, aspectRatio, filename](const QImage& snapshot) {
8433 QString path = DependencyManager::get<Snapshot>()->saveSnapshot(snapshot, filename, TestScriptingInterface::getInstance()->getTestResultsLocation());8444 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
8439 emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(path, notify);8450 emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(path, notify);
8440 }8451 }
8441 } else if (!SnapshotAnimated::isAlreadyTakingSnapshotAnimated()) {8452 } else if (!SnapshotAnimated::isAlreadyTakingSnapshotAnimated()) {
8442 // Get an animated GIF snapshot and save it8453 qApp->postLambdaEvent([path, aspectRatio] {
8443 SnapshotAnimated::saveSnapshotAnimated(path, aspectRatio, qApp, DependencyManager::get<WindowScriptingInterface>());8454 // Get an animated GIF snapshot and save it
8455 SnapshotAnimated::saveSnapshotAnimated(path, aspectRatio, DependencyManager::get<WindowScriptingInterface>());
8456 });
8444 }8457 }
8445 }, aspectRatio });8458 }, aspectRatio });
8446}8459}
8447 8460
8448void Application::takeSecondaryCameraSnapshot(const bool& notify, const QString& filename) {8461void Application::takeSecondaryCameraSnapshot(const bool& notify, const QString& filename) {
8449 postLambdaEvent([notify, filename, this] {8462 addSecondarySnapshotOperator([notify, filename](const QImage& snapshot) {
8450 QString snapshotPath = DependencyManager::get<Snapshot>()->saveSnapshot(getActiveDisplayPlugin()->getSecondaryCameraScreenshot(), filename,8463 QString snapshotPath = DependencyManager::get<Snapshot>()->saveSnapshot(snapshot, filename, TestScriptingInterface::getInstance()->getTestResultsLocation());
8451 TestScriptingInterface::getInstance()->getTestResultsLocation());
8452 8464
8453 emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(snapshotPath, notify);8465 emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(snapshotPath, notify);
8454 });8466 });

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