Эх сурвалжийг харах

Show maintenance mode error in notifications while uploading a file

# Conflicts:
#	build.gradle
#	res/values/strings.xml
davigonz 8 жил өмнө
parent
commit
ad6d867971

+ 1 - 0
src/main/java/com/owncloud/android/operations/UploadFileOperation.java

@@ -323,6 +323,7 @@ public class UploadFileOperation extends SyncOperation {
             remoteParentPath = remoteParentPath.endsWith(OCFile.PATH_SEPARATOR) ?
             remoteParentPath = remoteParentPath.endsWith(OCFile.PATH_SEPARATOR) ?
                     remoteParentPath : remoteParentPath + OCFile.PATH_SEPARATOR;
                     remoteParentPath : remoteParentPath + OCFile.PATH_SEPARATOR;
             result = grantFolderExistence(remoteParentPath, client);
             result = grantFolderExistence(remoteParentPath, client);
+
             if (!result.isSuccess()) {
             if (!result.isSuccess()) {
 
 
                 return result;
                 return result;

+ 0 - 2
src/main/java/com/owncloud/android/ui/notifications/NotificationUtils.java

@@ -74,6 +74,4 @@ public class NotificationUtils {
         }, delayInMillis); 
         }, delayInMillis); 
     
     
     }
     }
-    
-
 }
 }

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

@@ -85,6 +85,9 @@ public class ErrorMessageAdapter {
                 } else if (result.getCode() == ResultCode.INVALID_CHARACTER_DETECT_IN_SERVER) {
                 } else if (result.getCode() == ResultCode.INVALID_CHARACTER_DETECT_IN_SERVER) {
                     message = res.getString(R.string.filename_forbidden_charaters_from_server);
                     message = res.getString(R.string.filename_forbidden_charaters_from_server);
 
 
+                } else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
+                    message = res.getString(R.string.maintenance_mode);
+
                 } else {
                 } else {
                     message = String.format(
                     message = String.format(
                             res.getString(R.string.uploader_upload_failed_content_single),
                             res.getString(R.string.uploader_upload_failed_content_single),

+ 2 - 0
src/main/res/values/strings.xml

@@ -543,6 +543,8 @@
     <string name="local_file_not_found_toast">File not found in local file system</string>
     <string name="local_file_not_found_toast">File not found in local file system</string>
     <string name="confirmation_remove_files_alert">Do you really want to remove the selected items?</string>
     <string name="confirmation_remove_files_alert">Do you really want to remove the selected items?</string>
     <string name="confirmation_remove_folders_alert">Do you really want to remove the selected items and their contents?</string>
     <string name="confirmation_remove_folders_alert">Do you really want to remove the selected items and their contents?</string>
+    <string name="maintenance_mode">This Owncloud instance is in maintenance mode, so it may take a while.</string>
+
     <string name="uploads_view_upload_status_waiting_for_charging">Awaiting charge</string>
     <string name="uploads_view_upload_status_waiting_for_charging">Awaiting charge</string>
     <string name="actionbar_search">Search</string>
     <string name="actionbar_search">Search</string>
     <string name="files_drop_not_supported">This is a Nextcloud feature, please update.</string>
     <string name="files_drop_not_supported">This is a Nextcloud feature, please update.</string>