Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Add feedback when recording is stopped

Luna Lovecraft26d25e981504
diff --git a/libs/ui/kis_async_action_feedback.cpp b/libs/ui/kis_async_action_feedback.cpp
index 8a6194c134..49207c8738 100644
--- a/libs/ui/kis_async_action_feedback.cpp
+++ b/libs/ui/kis_async_action_feedback.cpp
@@ -55,6 +55,11 @@ KisImportExportErrorCode KisAsyncActionFeedback::runAction(std::function<KisImpo
return runActionImpl(func);
}
+bool KisAsyncActionFeedback::runAction(std::function<bool()> func)
+{
+ return runActionImpl(func);
+}
+
void KisAsyncActionFeedback::runVoidAction(std::function<void()> func)
{
QFuture<void> result = QtConcurrent::run(func);
diff --git a/libs/ui/kis_async_action_feedback.h b/libs/ui/kis_async_action_feedback.h
index 1f27d1119c..2ba3fdc8ce 100644
--- a/libs/ui/kis_async_action_feedback.h
+++ b/libs/ui/kis_async_action_feedback.h
@@ -26,6 +26,7 @@ public:
~KisAsyncActionFeedback();
KisImportExportErrorCode runAction(std::function<KisImportExportErrorCode()> func);
+ bool runAction(std::function<bool()> func);
void runVoidAction(std::function<void()> func);
template <typename Mutex>
diff --git a/plugins/dockers/recorder/recorder_const.h b/plugins/dockers/recorder/recorder_const.h
index 9827b0827f..4a10a536b6 100644
--- a/plugins/dockers/recorder/recorder_const.h
+++ b/plugins/dockers/recorder/recorder_const.h
@@ -15,7 +15,7 @@ class QRegularExpression;
namespace RecorderConst
{
-constexpr int waitThreadTimeoutMs = 5000;
+constexpr int waitThreadTimeoutMs = 30000;
QRegularExpression snapshotFilePatternFor(const QString &extension);
diff --git a/plugins/dockers/recorder/recorder_writer.cpp b/plugins/dockers/recorder/recorder_writer.cpp
index 2fa9881de0..ebc5fa464c 100644
--- a/plugins/dockers/recorder/recorder_writer.cpp
+++ b/plugins/dockers/recorder/recorder_writer.cpp
@@ -6,6 +6,7 @@
#include "recorder_writer.h"
#include "recorder_image_copying_job.h"
+#include "kis_async_action_feedback.h"
#include "recorder_const.h"
#include "recorder_export_settings.h"
@@ -630,7 +631,19 @@ bool RecorderWriterManager::stop(bool toggleEnabled, bool saveState)
}
d->timer.stop();
- auto result = d->clearWriterPool();
+
+ bool result = false;
+
+ // Not sure if this is necessary, but, this may prevent the message from popping up when switching tabs
+ if (saveState) {
+ KisAsyncActionFeedback f(i18n("Stopping recording"), nullptr);
+ result = f.runAction([&] {
+ return d->clearWriterPool();
+ });
+ } else {
+ result = d->clearWriterPool();
+ }
+
recorderThreads.setUsed(0);
if (toggleEnabled) {
Q_EMIT stopped();