From 94282f3ac6f7be54ef3c015e9b41e17f7ee69a1c Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Fri, 9 Apr 2021 10:16:45 +1000 Subject: [PATCH] don't use modal dialog for project saving Fixes #1554, however in the future, we could probably make this even better. --- app/core.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/app/core.cpp b/app/core.cpp index c54283f31..92df5c3e7 100644 --- a/app/core.cpp +++ b/app/core.cpp @@ -741,14 +741,22 @@ void Core::SaveProjectInternal(Project* project, const QString& override_filenam } } - TaskDialog* task_dialog = new TaskDialog(psm, tr("Save Project"), main_window_); - - if (override_filename.isEmpty()) { - // Default behavior: set as not modified and push to top of "Open Recent" dialog - connect(task_dialog, &TaskDialog::TaskSucceeded, this, &Core::ProjectSaveSucceeded); + // We don't use a TaskDialog here because a model save dialog is annoying, particularly when + // saving auto-recoveries that the user can't anticipate. Doing this in the main thread will + // cause a brief (but often unnoticeable) pause in the GUI, which, while not ideal, is not that + // different from what already happened (modal dialog preventing use of the GUI) and in many ways + // less annoying (doesn't disrupt any current actions or pull focus from elsewhere). + // + // Ideally we could do this in a background thread and show progress in the status bar like + // Microsoft Word, but that would be far more complex. If it becomes necessary in the future, + // we will look into an approach like that. + if (psm->Start()) { + if (override_filename.isEmpty()) { + ProjectSaveSucceeded(psm); + } } - task_dialog->open(); + psm->deleteLater(); } ViewerOutput* Core::GetSequenceToExport()