Improved messages for operations on files not existing anymore in the server
authorDavid A. Velasco <dvelasco@solidgear.es>
Tue, 2 Sep 2014 08:13:14 +0000 (10:13 +0200)
committerDavid A. Velasco <dvelasco@solidgear.es>
Tue, 2 Sep 2014 08:13:14 +0000 (10:13 +0200)
res/values/strings.xml
src/com/owncloud/android/utils/ErrorMessageAdapter.java

index 143fce8..13c7bbe 100644 (file)
 
        <string name="share_link_no_support_share_api">Sorry, sharing is not enabled on your server. Please contact your
                administrator.</string>
-       <string name="share_link_file_no_exist">Unable to share this file or folder. Please, make sure it exists</string>
+       <string name="share_link_file_no_exist">Unable to share. Please check whether the file exists</string>
        <string name="share_link_file_error">An error occurred while trying to share this file or folder</string>
-       <string name="unshare_link_file_no_exist">Unable to unshare this file or folder. It does not exist.</string>
+       <string name="unshare_link_file_no_exist">Unable to unshare. Please check whether the file exists</string>
        <string name="unshare_link_file_error">An error occurred while trying to unshare this file or folder</string>
 
        <string name="activity_chooser_send_file_title">Send</string>
        <string name="file_list_empty_moving">Nothing in here. You can add a folder!</string>
        <string name="move_choose_button_text">Choose</string>
 
+       <string name="move_file_not_found">Unable to move. Please check whether the file exists</string>
        <string name="move_file_invalid_into_descendent">It is not possible to move a folder into a descendant</string>
        <string name="move_file_invalid_overwrite">The file exists already in the destination folder</string>
        <string name="move_file_error">An error occurred while trying to move this file or folder</string>
index 04d34f4..e56e876 100644 (file)
@@ -189,7 +189,10 @@ public class ErrorMessageAdapter {
             }
         } else if (operation instanceof MoveFileOperation) {
 
-            if (result.getCode() == ResultCode.INVALID_MOVE_INTO_DESCENDANT)  {
+            if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
+                message = res.getString(R.string.move_file_not_found);
+                
+            } else if (result.getCode() == ResultCode.INVALID_MOVE_INTO_DESCENDANT)  {
                 message = res.getString(R.string.move_file_invalid_into_descendent);
 
             } else if (result.getCode() == ResultCode.INVALID_OVERWRITE) {