Browse Source

Upgrade notifications on status bar when uploading to show proper message about fails due to lack of permissions and removed FailedUploaderActivity

jabarros 11 năm trước cách đây
mục cha
commit
61c8f7f083

+ 2 - 1
res/values/strings.xml

@@ -270,11 +270,12 @@
 	<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="uploader_upload_forbidden_permissions">to upload in this folder</string>
 
 </resources>

+ 5 - 0
src/com/owncloud/android/utils/ErrorMessageAdapter.java

@@ -69,8 +69,13 @@ public class ErrorMessageAdapter {
                 /*
                 } 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());