瀏覽代碼

OC-2772:Display a message if the user selects to share a file or folder that does not exist on the server

masensio 11 年之前
父節點
當前提交
261d8a5167
共有 3 個文件被更改,包括 16 次插入1 次删除
  1. 1 1
      owncloud-android-library
  2. 1 0
      res/values/strings.xml
  3. 14 0
      src/com/owncloud/android/ui/activity/FileDisplayActivity.java

+ 1 - 1
owncloud-android-library

@@ -1 +1 @@
-Subproject commit 781e738347a87c2b24144e03f7fe8fe32603f2f3
+Subproject commit 09b1c3c15aa2644635796c93ee918f8b0a20ff7c

+ 1 - 0
res/values/strings.xml

@@ -246,4 +246,5 @@
 	<string name="failed_upload_quota_exceeded_text">Please check your server configuration,maybe your quota is exceeded.</string>
 	
 	<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>
 </resources>

+ 14 - 0
src/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -1345,11 +1345,25 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
 
         } else if (operation instanceof CreateFolderOperation) {
             onCreateFolderOperationFinish((CreateFolderOperation)operation, result);
+        
+        } else if (operation instanceof CreateShareOperation) {
+            onCreateShareOperation((CreateShareOperation) operation, result);
         }
         
     }
 
 
+    private void onCreateShareOperation(CreateShareOperation operation, RemoteOperationResult result) {
+        if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
+            // Show a Message
+            Toast t = Toast.makeText(this, getString(R.string.share_link_file_no_exist), Toast.LENGTH_LONG);
+            t.show();
+        }
+        
+        refeshListOfFilesFragment();
+        
+    }
+
     /**
      * Updates the view associated to the activity after the finish of an operation trying to remove a 
      * file.