X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/5bcfed8eae3ae09e6e4b1c6d6915749ad0f362a0..bcc972d63d3ed1d76b51a8a03a27e809983dc756:/src/com/owncloud/android/ui/dialog/EditNameDialog.java diff --git a/src/com/owncloud/android/ui/dialog/EditNameDialog.java b/src/com/owncloud/android/ui/dialog/EditNameDialog.java index a5485244..862715fd 100644 --- a/src/com/owncloud/android/ui/dialog/EditNameDialog.java +++ b/src/com/owncloud/android/ui/dialog/EditNameDialog.java @@ -3,9 +3,8 @@ * Copyright (C) 2012-2013 ownCloud Inc. * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -28,9 +27,11 @@ import android.view.View; import android.view.WindowManager.LayoutParams; 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.oc_framework.utils.FileUtils; /** @@ -129,6 +130,10 @@ public class EditNameDialog extends SherlockDialogFragment implements DialogInte switch (which) { case AlertDialog.BUTTON_POSITIVE: { mNewFilename = ((TextView)(getDialog().findViewById(R.id.user_input))).getText().toString(); + if (!FileUtils.isValidName(mNewFilename)) { + Toast.makeText(getSherlockActivity(), R.string.filename_forbidden_characters, Toast.LENGTH_LONG).show(); + return; + } mResult = true; } case AlertDialog.BUTTON_NEGATIVE: { // fall through