implemented cancel feedback in project saving

The cancel button now sends a signal to the saving thread to stop.
This commit is contained in:
itsmattkc
2020-01-12 16:34:35 +11:00
parent 00b5672639
commit fa95a61c7b
4 changed files with 30 additions and 2 deletions
+11 -1
View File
@@ -1,7 +1,8 @@
#include "projectsavemanager.h"
ProjectSaveManager::ProjectSaveManager(Project *project) :
project_(project)
project_(project),
cancelled_(false)
{
}
@@ -11,6 +12,10 @@ void ProjectSaveManager::Start()
int prog = 0;
do {
if (cancelled_) {
break;
}
prog += 10;
emit ProgressChanged(prog);
@@ -20,3 +25,8 @@ void ProjectSaveManager::Start()
emit Finished();
}
void ProjectSaveManager::Cancel()
{
cancelled_ = true;
}