implemented cancel feedback in project saving
The cancel button now sends a signal to the saving thread to stop.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user