浏览代码

Don't show local remove for available offline files/folders

Juan Carlos González Cabrero 8 年之前
父节点
当前提交
90b6f19161
共有 1 个文件被更改,包括 5 次插入6 次删除
  1. 5 6
      src/com/owncloud/android/ui/dialog/RemoveFileDialogFragment.java

+ 5 - 6
src/com/owncloud/android/ui/dialog/RemoveFileDialogFragment.java

@@ -54,19 +54,18 @@ implements ConfirmationDialogFragmentListener {
         
         int messageStringId = R.string.confirmation_remove_alert;
         
-        int negBtn = -1;
+        int localRemoveButton = (!file.isFavorite() && (file.isFolder() || file.isDown())) ?
+            R.string.confirmation_remove_local : -1;
+
         if (file.isFolder()) {
             messageStringId = R.string.confirmation_remove_folder_alert;
-            negBtn = R.string.confirmation_remove_local;
-        } else if (file.isDown()) {
-            negBtn = R.string.confirmation_remove_local;
         }
-        
+
         args.putInt(ARG_MESSAGE_RESOURCE_ID, messageStringId);
         args.putStringArray(ARG_MESSAGE_ARGUMENTS, new String[]{file.getFileName()});
         args.putInt(ARG_POSITIVE_BTN_RES, R.string.common_yes);
         args.putInt(ARG_NEUTRAL_BTN_RES, R.string.common_no);
-        args.putInt(ARG_NEGATIVE_BTN_RES, negBtn);
+        args.putInt(ARG_NEGATIVE_BTN_RES, localRemoveButton);
         args.putParcelable(ARG_TARGET_FILE, file);
         frag.setArguments(args);