mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 05:58:27 +02:00
Prevent another GIF from being captured while one is processing
This commit is contained in:
parent
c2b140cc03
commit
8efac1e7f1
3 changed files with 7 additions and 2 deletions
|
@ -6428,7 +6428,7 @@ void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRa
|
||||||
if (!includeAnimated) {
|
if (!includeAnimated) {
|
||||||
// Tell the dependency manager that the capture of the still snapshot has taken place.
|
// Tell the dependency manager that the capture of the still snapshot has taken place.
|
||||||
emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(path, notify);
|
emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(path, notify);
|
||||||
} else {
|
} else if (!SnapshotAnimated::isAlreadyTakingSnapshotAnimated()) {
|
||||||
// Get an animated GIF snapshot and save it
|
// Get an animated GIF snapshot and save it
|
||||||
SnapshotAnimated::saveSnapshotAnimated(path, aspectRatio, qApp, DependencyManager::get<WindowScriptingInterface>());
|
SnapshotAnimated::saveSnapshotAnimated(path, aspectRatio, qApp, DependencyManager::get<WindowScriptingInterface>());
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,7 @@ private:
|
||||||
static void processFrames();
|
static void processFrames();
|
||||||
public:
|
public:
|
||||||
static void saveSnapshotAnimated(QString pathStill, float aspectRatio, Application* app, QSharedPointer<WindowScriptingInterface> dm);
|
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<bool> alsoTakeAnimatedSnapshot;
|
||||||
static Setting::Handle<float> snapshotAnimatedDuration;
|
static Setting::Handle<float> snapshotAnimatedDuration;
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,6 +44,7 @@ function showSetupComplete() {
|
||||||
'<p>Snapshot location set.</p>' +
|
'<p>Snapshot location set.</p>' +
|
||||||
'<p>Press the big red button to take a snap!</p>' +
|
'<p>Press the big red button to take a snap!</p>' +
|
||||||
'</div>';
|
'</div>';
|
||||||
|
document.getElementById("snap-button").disabled = false;
|
||||||
}
|
}
|
||||||
function showSnapshotInstructions() {
|
function showSnapshotInstructions() {
|
||||||
var snapshotImagesDiv = document.getElementById("snapshot-images");
|
var snapshotImagesDiv = document.getElementById("snapshot-images");
|
||||||
|
@ -69,7 +70,6 @@ function login() {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
function clearImages() {
|
function clearImages() {
|
||||||
document.getElementById("snap-button").disabled = false;
|
|
||||||
var snapshotImagesDiv = document.getElementById("snapshot-images");
|
var snapshotImagesDiv = document.getElementById("snapshot-images");
|
||||||
snapshotImagesDiv.classList.remove("snapshotInstructions");
|
snapshotImagesDiv.classList.remove("snapshotInstructions");
|
||||||
while (snapshotImagesDiv.hasChildNodes()) {
|
while (snapshotImagesDiv.hasChildNodes()) {
|
||||||
|
@ -650,6 +650,7 @@ window.onload = function () {
|
||||||
shareForUrl("p1");
|
shareForUrl("p1");
|
||||||
appendShareBar("p1", messageOptions.isLoggedIn, messageOptions.canShare, true, false, false, messageOptions.canBlast);
|
appendShareBar("p1", messageOptions.isLoggedIn, messageOptions.canShare, true, false, false, messageOptions.canBlast);
|
||||||
document.getElementById("p1").classList.remove("processingGif");
|
document.getElementById("p1").classList.remove("processingGif");
|
||||||
|
document.getElementById("snap-button").disabled = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
imageCount = message.image_data.length;
|
imageCount = message.image_data.length;
|
||||||
|
@ -688,6 +689,9 @@ function takeSnapshot() {
|
||||||
type: "snapshot",
|
type: "snapshot",
|
||||||
action: "takeSnapshot"
|
action: "takeSnapshot"
|
||||||
}));
|
}));
|
||||||
|
if (document.getElementById('stillAndGif').checked === true) {
|
||||||
|
document.getElementById("snap-button").disabled = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function testInBrowser(test) {
|
function testInBrowser(test) {
|
||||||
|
|
Loading…
Reference in a new issue