mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 05:52:38 +02:00
Merge pull request #10501 from zfox23/snapshots_disableWhileProcessing
Prevent another GIF from being captured while one is processing
This commit is contained in:
commit
48200fbd07
3 changed files with 7 additions and 2 deletions
|
@ -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>());
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue