diff options
| author | jacob1 <jfu614@gmail.com> | 2013-06-21 02:01:07 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2013-06-21 02:01:07 (GMT) |
| commit | 7a2114bc653cb450e58e59af9b8a5469d45ec140 (patch) | |
| tree | d7f19719b6683b797af0dc6230ee994559034dc5 /src/gui/search/SearchController.cpp | |
| parent | 3aac957e501a2fc5fde868f1fe973c523968357e (diff) | |
| download | powder-7a2114bc653cb450e58e59af9b8a5469d45ec140.zip powder-7a2114bc653cb450e58e59af9b8a5469d45ec140.tar.gz | |
add error messages when errors happening while fav. / unfav.ing a save, deleting a save, or unpublishing one. Also don't use session key in url to add a comment since it isn't needed
Diffstat (limited to 'src/gui/search/SearchController.cpp')
| -rw-r--r-- | src/gui/search/SearchController.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/gui/search/SearchController.cpp b/src/gui/search/SearchController.cpp index b4b6569..312e8c5 100644 --- a/src/gui/search/SearchController.cpp +++ b/src/gui/search/SearchController.cpp @@ -222,6 +222,7 @@ void SearchController::RemoveSelected() desc << "Are you sure you want to delete " << searchModel->GetSelected().size() << " save"; if(searchModel->GetSelected().size()>1) desc << "s"; + desc << "?"; new ConfirmPrompt("Delete saves", desc.str(), new RemoveSelectedConfirmation(this)); } @@ -274,6 +275,7 @@ void SearchController::UnpublishSelected() desc << "Are you sure you want to hide " << searchModel->GetSelected().size() << " save"; if(searchModel->GetSelected().size()>1) desc << "s"; + desc << "?"; new ConfirmPrompt("Unpublish saves", desc.str(), new UnpublishSelectedConfirmation(this)); } @@ -289,13 +291,14 @@ void SearchController::unpublishSelectedC() for(int i = 0; i < saves.size(); i++) { std::stringstream saveID; - saveID << "Hiding save [" << saves[i] << "] ..."; + saveID << "Hiding save [" << saves[i] << "]"; notifyStatus(saveID.str()); if(Client::Ref().UnpublishSave(saves[i])!=RequestOkay) { std::stringstream saveIDF; - saveIDF << "\boFailed to hide [" << saves[i] << "] ..."; - notifyStatus(saveIDF.str()); + saveIDF << "\boFailed to hide [" << saves[i] << "], is this save yours?"; + notifyError(saveIDF.str()); + return false; } notifyProgress((float(i+1)/float(saves.size())*100)); } @@ -321,13 +324,14 @@ void SearchController::FavouriteSelected() for(int i = 0; i < saves.size(); i++) { std::stringstream saveID; - saveID << "Favouring save [" << saves[i] << "] ..."; + saveID << "Favouring save [" << saves[i] << "]"; notifyStatus(saveID.str()); if(Client::Ref().FavouriteSave(saves[i], true)!=RequestOkay) { std::stringstream saveIDF; - saveIDF << "\boFailed to favourite [" << saves[i] << "] ..."; - notifyStatus(saveIDF.str()); + saveIDF << "\boFailed to favourite [" << saves[i] << "], are you logged in?"; + notifyError(saveIDF.str()); + return false; } notifyProgress((float(i+1)/float(saves.size())*100)); } @@ -345,13 +349,14 @@ void SearchController::FavouriteSelected() for(int i = 0; i < saves.size(); i++) { std::stringstream saveID; - saveID << "Unfavouring save [" << saves[i] << "] ..."; + saveID << "Unfavouring save [" << saves[i] << "]"; notifyStatus(saveID.str()); if(Client::Ref().FavouriteSave(saves[i], false)!=RequestOkay) { std::stringstream saveIDF; - saveIDF << "\boFailed to remove [" << saves[i] << "] ..."; - notifyStatus(saveIDF.str()); + saveIDF << "\boFailed to unfavourite [" << saves[i] << "], are you logged in?"; + notifyError(saveIDF.str()); + return false; } notifyProgress((float(i+1)/float(saves.size())*100)); } |
