Skip to content

Commit

Permalink
Error about not being able to upload newly created score
Browse files Browse the repository at this point in the history
  • Loading branch information
Eism committed Feb 14, 2023
1 parent 9cb2d53 commit ad1bb41
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions src/project/internal/projectactionscontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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:
Expand Down Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/project/internal/projectactionscontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit ad1bb41

Please sign in to comment.