Merge pull request #10501 from zfox23/snapshots_disableWhileProcessing

Prevent another GIF from being captured while one is processing
This commit is contained in:
Zach Fox 2017-05-18 15:53:57 -07:00 committed by GitHub
commit 48200fbd07
3 changed files with 7 additions and 2 deletions

View file

@ -6428,7 +6428,7 @@ void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRa
if (!includeAnimated) {
// Tell the dependency manager that the capture of the still snapshot has taken place.
emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(path, notify);
} else {
} else if (!SnapshotAnimated::isAlreadyTakingSnapshotAnimated()) {
// Get an animated GIF snapshot and save it
SnapshotAnimated::saveSnapshotAnimated(path, aspectRatio, qApp, DependencyManager::get<WindowScriptingInterface>());
}

View file

@ -51,6 +51,7 @@ private:
static void processFrames();
public:
static void saveSnapshotAnimated(QString pathStill, float aspectRatio, Application* app, QSharedPointer<WindowScriptingInterface> dm);
static bool isAlreadyTakingSnapshotAnimated() { return snapshotAnimatedFirstFrameTimestamp != 0; };
static Setting::Handle<bool> alsoTakeAnimatedSnapshot;
static Setting::Handle<float> snapshotAnimatedDuration;
};

View file

@ -44,6 +44,7 @@ function showSetupComplete() {
'<p>Snapshot location set.</p>' +
'<p>Press the big red button to take a snap!</p>' +
'</div>';
document.getElementById("snap-button").disabled = false;
}
function showSnapshotInstructions() {
var snapshotImagesDiv = document.getElementById("snapshot-images");
@ -69,7 +70,6 @@ function login() {
}));
}
function clearImages() {
document.getElementById("snap-button").disabled = false;
var snapshotImagesDiv = document.getElementById("snapshot-images");
snapshotImagesDiv.classList.remove("snapshotInstructions");
while (snapshotImagesDiv.hasChildNodes()) {
@ -650,6 +650,7 @@ window.onload = function () {
shareForUrl("p1");
appendShareBar("p1", messageOptions.isLoggedIn, messageOptions.canShare, true, false, false, messageOptions.canBlast);
document.getElementById("p1").classList.remove("processingGif");
document.getElementById("snap-button").disabled = false;
}
} else {
imageCount = message.image_data.length;
@ -688,6 +689,9 @@ function takeSnapshot() {
type: "snapshot",
action: "takeSnapshot"
}));
if (document.getElementById('stillAndGif').checked === true) {
document.getElementById("snap-button").disabled = true;
}
}
function testInBrowser(test) {