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
+3
View File
@@ -425,6 +425,9 @@ void Core::SaveProjectInternal(Project *project)
// Connect the save manager progress signal to the progress bar update on the dialog
connect(psm, &ProjectSaveManager::ProgressChanged, lsd, &LoadSaveDialog::SetProgress, Qt::QueuedConnection);
// Connect cancel signal (must be a direct connection or it'll be queued after the save is already finished)
connect(lsd, &LoadSaveDialog::Cancelled, psm, &ProjectSaveManager::Cancel, Qt::DirectConnection);
// Connect cleanup functions (ensure everything new'd in this function is deleteLater'd)
connect(psm, &ProjectSaveManager::Finished, lsd, &LoadSaveDialog::accept, Qt::QueuedConnection);
connect(psm, &ProjectSaveManager::Finished, lsd, &LoadSaveDialog::deleteLater, Qt::QueuedConnection);