From: masensio Date: Mon, 15 Jun 2015 12:51:13 +0000 (+0200) Subject: Merge branch 'develop' into forbidden_characters_from_server X-Git-Tag: oc-android-1.7.2~1^2~20^2~3 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/75fd0f40c642f3a4fc66dfa17620417d78dd2571?ds=inline;hp=-c Merge branch 'develop' into forbidden_characters_from_server Conflicts: owncloud-android-library src/com/owncloud/android/ui/dialog/CreateFolderDialogFragment.java src/com/owncloud/android/ui/dialog/RenameFileDialogFragment.java --- 75fd0f40c642f3a4fc66dfa17620417d78dd2571 diff --combined owncloud-android-library index 4ca0ff22,639cb7ea..060ca75f --- a/owncloud-android-library +++ b/owncloud-android-library @@@ -1,1 -1,1 +1,1 @@@ - Subproject commit 4ca0ff2203a84173dca984632a1131170a169f08 -Subproject commit 639cb7eacdae0b4b6dddbd8f446d8d42eb2617b5 ++Subproject commit 060ca75f17c90b7c083bdeb8ba7376cf15f8c7ec diff --combined res/values/strings.xml index cabf0c00,7d180be4..f5ea7bcb --- a/res/values/strings.xml +++ b/res/values/strings.xml @@@ -20,6 -20,14 +20,14 @@@ + + + All files + + Settings + Logs + Close General More Accounts @@@ -78,6 -86,7 +86,7 @@@ Download Refresh file File was renamed to %1$s during upload + List Layout Share link Unshare link Yes @@@ -213,7 -222,6 +222,7 @@@ File contents already synchronized Folder could not be created Forbidden characters: / \\ < > : " | ? * + File name contains at least one invalid character File name cannot be empty Wait a moment "Unexpected problem ; please select the file from a different app" @@@ -331,10 -339,14 +340,14 @@@ Upload Video Path Download of %1$s folder could not be completed - %1$s shared \"%2$s\" with you + shared + with you + + %1$s %2$s >>%3$s<< %4$s Refresh connection Server address Not enough memory + Username diff --combined src/com/owncloud/android/ui/dialog/CreateFolderDialogFragment.java index 52e0425f,73ae8bd8..ac1e312d --- a/src/com/owncloud/android/ui/dialog/CreateFolderDialogFragment.java +++ b/src/com/owncloud/android/ui/dialog/CreateFolderDialogFragment.java @@@ -20,8 -20,6 +20,6 @@@ package com.owncloud.android.ui.dialog; - import com.actionbarsherlock.app.SherlockDialogFragment; - import com.owncloud.android.MainApp; import com.owncloud.android.R; import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.lib.resources.files.FileUtils; @@@ -31,6 -29,7 +29,7 @@@ import android.app.AlertDialog import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; + import android.support.v4.app.DialogFragment; import android.view.LayoutInflater; import android.view.View; import android.view.WindowManager.LayoutParams; @@@ -43,8 -42,8 +42,8 @@@ import android.widget.Toast * * Triggers the folder creation when name is confirmed. */ - public class CreateFolderDialogFragment - extends SherlockDialogFragment implements DialogInterface.OnClickListener { + public class CreateFolderDialogFragment + extends DialogFragment implements DialogInterface.OnClickListener { private static final String ARG_PARENT_FOLDER = "PARENT_FOLDER"; @@@ -52,9 -51,9 +51,9 @@@ /** * Public factory method to create new CreateFolderDialogFragment instances. -- * - * @param parentFolder Folder to create - * @return Dialog ready to show. ++ * + * @param parentFolder Folder to create + * @return Dialog ready to show. */ public static CreateFolderDialogFragment newInstance(OCFile parentFolder) { CreateFolderDialogFragment frag = new CreateFolderDialogFragment(); @@@ -73,7 -72,7 +72,7 @@@ mParentFolder = getArguments().getParcelable(ARG_PARENT_FOLDER); // Inflate the layout for the dialog - LayoutInflater inflater = getSherlockActivity().getLayoutInflater(); + LayoutInflater inflater = getActivity().getLayoutInflater(); View v = inflater.inflate(R.layout.edit_box_dialog, null); // Setup layout @@@ -82,7 -81,7 +81,7 @@@ inputText.requestFocus(); // Build the dialog - AlertDialog.Builder builder = new AlertDialog.Builder(getSherlockActivity()); + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setView(v) .setPositiveButton(R.string.common_ok, this) .setNegativeButton(R.string.common_cancel, this) @@@ -102,29 -101,23 +101,29 @@@ if (newFolderName.length() <= 0) { Toast.makeText( - getSherlockActivity(), + getActivity(), R.string.filename_empty, Toast.LENGTH_LONG).show(); return; } - - boolean serverWithForbiddenChars = ((ComponentsGetter)getSherlockActivity()). - - if (!FileUtils.isValidName(newFolderName)) { - Toast.makeText( - getActivity(), - R.string.filename_forbidden_characters, - Toast.LENGTH_LONG).show(); ++ boolean serverWithForbiddenChars = ((ComponentsGetter)getActivity()). + getFileOperationsHelper().isVersionWithForbiddenCharacters(); + + if (!FileUtils.isValidName(newFolderName, serverWithForbiddenChars)) { + int messageId = 0; + if (serverWithForbiddenChars) { + messageId = R.string.filename_forbidden_charaters_from_server; + } else { + messageId = R.string.filename_forbidden_characters; + } - Toast.makeText(getSherlockActivity(), messageId, Toast.LENGTH_LONG).show(); ++ Toast.makeText(getActivity(), messageId, Toast.LENGTH_LONG).show(); ++ return; } String path = mParentFolder.getRemotePath(); path += newFolderName + OCFile.PATH_SEPARATOR; - ((ComponentsGetter)getSherlockActivity()). + ((ComponentsGetter)getActivity()). getFileOperationsHelper().createFolder(path, false); } } diff --combined src/com/owncloud/android/ui/dialog/RenameFileDialogFragment.java index fa0c65de,40930608..d4bf31c2 --- a/src/com/owncloud/android/ui/dialog/RenameFileDialogFragment.java +++ b/src/com/owncloud/android/ui/dialog/RenameFileDialogFragment.java @@@ -29,6 -29,7 +29,7 @@@ import android.app.AlertDialog import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; + import android.support.v4.app.DialogFragment; import android.view.LayoutInflater; import android.view.View; import android.view.WindowManager.LayoutParams; @@@ -36,7 -37,6 +37,6 @@@ import android.widget.EditText import android.widget.TextView; import android.widget.Toast; - import com.actionbarsherlock.app.SherlockDialogFragment; import com.owncloud.android.R; import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.lib.resources.files.FileUtils; @@@ -49,7 -49,7 +49,7 @@@ import com.owncloud.android.ui.activity * Triggers the rename operation when name is confirmed. */ public class RenameFileDialogFragment - extends SherlockDialogFragment implements DialogInterface.OnClickListener { + extends DialogFragment implements DialogInterface.OnClickListener { private static final String ARG_TARGET_FILE = "TARGET_FILE"; @@@ -75,7 -75,7 +75,7 @@@ mTargetFile = getArguments().getParcelable(ARG_TARGET_FILE); // Inflate the layout for the dialog - LayoutInflater inflater = getSherlockActivity().getLayoutInflater(); + LayoutInflater inflater = getActivity().getLayoutInflater(); View v = inflater.inflate(R.layout.edit_box_dialog, null); // Setup layout @@@ -93,7 -93,7 +93,7 @@@ inputText.requestFocus(); // Build the dialog - AlertDialog.Builder builder = new AlertDialog.Builder(getSherlockActivity()); + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setView(v) .setPositiveButton(R.string.common_ok, this) .setNegativeButton(R.string.common_cancel, this) @@@ -113,28 -113,22 +113,29 @@@ if (newFileName.length() <= 0) { Toast.makeText( - getSherlockActivity(), + getActivity(), R.string.filename_empty, Toast.LENGTH_LONG).show(); return; } - - if (!FileUtils.isValidName(newFileName)) { - Toast.makeText( - getActivity(), - R.string.filename_forbidden_characters, - Toast.LENGTH_LONG).show(); + - boolean serverWithForbiddenChars = ((ComponentsGetter)getSherlockActivity()). ++ boolean serverWithForbiddenChars = ((ComponentsGetter)getActivity()). + getFileOperationsHelper().isVersionWithForbiddenCharacters(); + + if (!FileUtils.isValidName(newFileName, serverWithForbiddenChars)) { + int messageId = 0; + if (serverWithForbiddenChars) { + messageId = R.string.filename_forbidden_charaters_from_server; + } else { + messageId = R.string.filename_forbidden_characters; + } - Toast.makeText(getSherlockActivity(), messageId, Toast.LENGTH_LONG).show(); ++ Toast.makeText(getActivity(), messageId, Toast.LENGTH_LONG).show(); return; } - ((ComponentsGetter)getSherlockActivity()).getFileOperationsHelper(). - ((ComponentsGetter)getActivity()).getFileOperationsHelper().renameFile(mTargetFile, - newFileName); ++ ((ComponentsGetter)getActivity()).getFileOperationsHelper(). + renameFile(mTargetFile, newFileName); ++ } } }