Upgrade notifications on status bar when uploading to show proper message about fails...
authorjabarros <jabarros@solidgear.es>
Fri, 11 Jul 2014 09:45:15 +0000 (11:45 +0200)
committerDavid A. Velasco <dvelasco@solidgear.es>
Fri, 25 Jul 2014 07:11:20 +0000 (09:11 +0200)
res/values/strings.xml
src/com/owncloud/android/utils/ErrorMessageAdapter.java

index 42743bf..e66c2d1 100644 (file)
        <string name="network_error_connect_timeout_exception">An error occurred while waiting for the server, the operation couldn\'t have been done</string>
        <string name="network_host_not_available">The operation couldn\'t be completed, server is unavailable</string>
        
        <string name="network_error_connect_timeout_exception">An error occurred while waiting for the server, the operation couldn\'t have been done</string>
        <string name="network_host_not_available">The operation couldn\'t be completed, server is unavailable</string>
        
-       <string name="forbidden_permissions">You do not have permissions %s</string>
+       <string name="forbidden_permissions">You do not have permission %s</string>
        <string name="forbidden_permissions_rename">to rename this file</string>
        <string name="forbidden_permissions_delete">to delete this file</string>
        <string name="share_link_forbidden_permissions">to share this file</string>
        <string name="unshare_link_forbidden_permissions">to unshare this file</string>
        <string name="forbidden_permissions_create">to create the file</string>
        <string name="forbidden_permissions_rename">to rename this file</string>
        <string name="forbidden_permissions_delete">to delete this file</string>
        <string name="share_link_forbidden_permissions">to share this file</string>
        <string name="unshare_link_forbidden_permissions">to unshare this file</string>
        <string name="forbidden_permissions_create">to create the file</string>
+       <string name="uploader_upload_forbidden_permissions">to upload in this folder</string>
 
 </resources>
 
 </resources>
index ec0ddd8..25a0dfe 100644 (file)
@@ -69,8 +69,13 @@ public class ErrorMessageAdapter {
                 /*
                 } else if (result.getCode() == ResultCode.QUOTA_EXCEEDED) {
                     message = res.getString(R.string.failed_upload_quota_exceeded_text);
                 /*
                 } else if (result.getCode() == ResultCode.QUOTA_EXCEEDED) {
                     message = res.getString(R.string.failed_upload_quota_exceeded_text);
+<<<<<<< HEAD
                   
                     */
                   
                     */
+                } else if (result.getCode() == ResultCode.FORBIDDEN) {
+                    message = String.format(res.getString(R.string.forbidden_permissions),
+                            res.getString(R.string.uploader_upload_forbidden_permissions));
+
                 } else {
                     message = String.format(res.getString(R.string.uploader_upload_failed_content_single), 
                             ((UploadFileOperation) operation).getFileName());
                 } else {
                     message = String.format(res.getString(R.string.uploader_upload_failed_content_single), 
                             ((UploadFileOperation) operation).getFileName());