From 9cb2d5307e86c812d9e3a3ecd1de6844834c7b89 Mon Sep 17 00:00:00 2001 From: Eism Date: Tue, 14 Feb 2023 17:52:24 +0200 Subject: [PATCH 1/2] Fixed the body for newly created score --- src/project/internal/projectactionscontroller.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/project/internal/projectactionscontroller.cpp b/src/project/internal/projectactionscontroller.cpp index 6e2abc19ccf8a..54a378e02027a 100644 --- a/src/project/internal/projectactionscontroller.cpp +++ b/src/project/internal/projectactionscontroller.cpp @@ -993,9 +993,11 @@ void ProjectActionsController::warnCorruptedScoreCannotBeSavedLocally(const Save bool newlyCreated) { std::string title = trc("project", "This score has become corrupted and contains errors"); - std::string body = trc("project", "You can continue saving it locally, although the file may become unusable. " - "To preserve your score, revert to the last saved version, or fix the errors manually. " - "You can also get help for this issue on musescore.org."); + std::string body = newlyCreated ? trc("project", "You can continue saving it locally, although the file may become unusable. " + "You can try to fix the errors manually, or get help for this issue on musescore.org.") + : trc("project", "You can continue saving it locally, although the file may become unusable. " + "To preserve your score, revert to the last saved version, or fix the errors manually. " + "You can also get help for this issue on musescore.org."); IInteractive::ButtonDatas buttons; buttons.push_back(interactive()->buttonData(IInteractive::Button::Cancel)); From ad1bb41dc1d0129578a73a93c0817abeded6a485 Mon Sep 17 00:00:00 2001 From: Eism Date: Tue, 14 Feb 2023 17:39:11 +0200 Subject: [PATCH 2/2] Error about not being able to upload newly created score --- src/project/internal/projectactionscontroller.cpp | 14 ++++++++++---- src/project/internal/projectactionscontroller.h | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/project/internal/projectactionscontroller.cpp b/src/project/internal/projectactionscontroller.cpp index 54a378e02027a..3a0ac625d5943 100644 --- a/src/project/internal/projectactionscontroller.cpp +++ b/src/project/internal/projectactionscontroller.cpp @@ -924,7 +924,7 @@ void ProjectActionsController::warnSaveIsNotAvailable(const Ret& ret, const Save warnScoreWithoutPartsCannotBeSaved(); break; case Err::CorruptionUponOpenningError: - warnCorruptedScoreUponOpenningCannotBeSaved(location, ret.text()); + showErrCorruptedScoreCannotBeSaved(location, ret.text()); break; case Err::CorruptionError: { auto project = currentNotationProject(); @@ -946,9 +946,15 @@ void ProjectActionsController::warnCorruptedScoreCannotBeSaved(const SaveLocatio bool newlyCreated) { switch (location.type) { - case SaveLocationType::Cloud: - warnCorruptedScoreCannotBeSavedOnCloud(errorText, newlyCreated); + case SaveLocationType::Cloud: { + if (newlyCreated) { + showErrCorruptedScoreCannotBeSaved(location, errorText); + } else { + warnCorruptedScoreCannotBeSavedOnCloud(errorText, newlyCreated); + } + break; + } case SaveLocationType::Local: warnCorruptedScoreCannotBeSavedLocally(location, errorText, newlyCreated); case SaveLocationType::Undefined: @@ -1023,7 +1029,7 @@ void ProjectActionsController::warnCorruptedScoreCannotBeSavedLocally(const Save } } -void ProjectActionsController::warnCorruptedScoreUponOpenningCannotBeSaved(const SaveLocation& location, const std::string& errorText) +void ProjectActionsController::showErrCorruptedScoreCannotBeSaved(const SaveLocation& location, const std::string& errorText) { std::string title = location.isLocal() ? trc("project", "Your score cannot be saved") : trc("project", "Your score cannot be uploaded to the cloud"); diff --git a/src/project/internal/projectactionscontroller.h b/src/project/internal/projectactionscontroller.h index 44604d7ed9bc5..679dbcc7eee30 100644 --- a/src/project/internal/projectactionscontroller.h +++ b/src/project/internal/projectactionscontroller.h @@ -142,7 +142,7 @@ class ProjectActionsController : public IProjectFilesController, public QObject, void warnCorruptedScoreCannotBeSaved(const SaveLocation& location, const std::string& errorText, bool newlyCreated); void warnCorruptedScoreCannotBeSavedOnCloud(const std::string& errorText, bool newlyCreated); void warnCorruptedScoreCannotBeSavedLocally(const SaveLocation& location, const std::string& errorText, bool newlyCreated); - void warnCorruptedScoreUponOpenningCannotBeSaved(const SaveLocation& location, const std::string& errorText); + void showErrCorruptedScoreCannotBeSaved(const SaveLocation& location, const std::string& errorText); void revertCorruptedScoreToLastSaved();