1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-27 06:41:15 +00:00

Removed folder ID restriction (fixes #519).

This commit is contained in:
Felix Ableitner 2015-12-16 19:01:35 +01:00
parent 98f98fddb9
commit 218b489b5e
20 changed files with 24 additions and 23 deletions

View file

@ -9,6 +9,7 @@ import android.os.Bundle;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v7.widget.SwitchCompat; import android.support.v7.widget.SwitchCompat;
import android.text.Editable; import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -298,12 +299,12 @@ public class FolderFragment extends Fragment
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) { switch (item.getItemId()) {
case R.id.create: case R.id.create:
if (mFolder.id.length() > 64 || !mFolder.id.matches("[a-zA-Z0-9-_\\.]+")) { if (TextUtils.isEmpty(mFolder.id)) {
Toast.makeText(getActivity(), R.string.folder_id_invalid, Toast.LENGTH_LONG) Toast.makeText(getActivity(), R.string.folder_id_required, Toast.LENGTH_LONG)
.show(); .show();
return true; return true;
} }
if (mFolder.path.equals("")) { if (TextUtils.isEmpty(mFolder.path)) {
Toast.makeText(getActivity(), R.string.folder_path_required, Toast.LENGTH_LONG) Toast.makeText(getActivity(), R.string.folder_path_required, Toast.LENGTH_LONG)
.show(); .show();
return true; return true;

View file

@ -76,7 +76,7 @@
<!--Dialog shown when attempting to delete a folder--> <!--Dialog shown when attempting to delete a folder-->
<string name="delete_folder_confirm">Наистина ли желаете папката да бъде изтрита?</string> <string name="delete_folder_confirm">Наистина ли желаете папката да бъде изтрита?</string>
<!--Toast shown when trying to create a folder with an invalid ID--> <!--Toast shown when trying to create a folder with an invalid ID-->
<string name="folder_id_invalid">Идентификаторът на папка трябва да бъде къс (64 символа или по-малко) състоящ се само от букви, цифри, точка (.), тире (-) и подчерта (_).</string> <string name="folder_id_required">Идентификаторът на папка трябва да бъде къс (64 символа или по-малко) състоящ се само от букви, цифри, точка (.), тире (-) и подчерта (_).</string>
<!--Toast shown when trying to create a folder with an empty path--> <!--Toast shown when trying to create a folder with an empty path-->
<string name="folder_path_required">Наложително е да въведете път до папката</string> <string name="folder_path_required">Наложително е да въведете път до папката</string>
<!--Dialog shown before config export--> <!--Dialog shown before config export-->

View file

@ -76,7 +76,7 @@
<!--Dialog shown when attempting to delete a folder--> <!--Dialog shown when attempting to delete a folder-->
<string name="delete_folder_confirm">Opravdu chcete smazat tento adresář?</string> <string name="delete_folder_confirm">Opravdu chcete smazat tento adresář?</string>
<!--Toast shown when trying to create a folder with an invalid ID--> <!--Toast shown when trying to create a folder with an invalid ID-->
<string name="folder_id_invalid">ID adresáře musí být krátký identifikátor (64 znaků nebo méně) obsahující pouze písmena, čísla, tečky (.), pomlčky (-) a podtržítka (_).</string> <string name="folder_id_required">ID adresáře musí být krátký identifikátor (64 znaků nebo méně) obsahující pouze písmena, čísla, tečky (.), pomlčky (-) a podtržítka (_).</string>
<!--Toast shown when trying to create a folder with an empty path--> <!--Toast shown when trying to create a folder with an empty path-->
<string name="folder_path_required">Cesta k adresáři nesmí být prázdná</string> <string name="folder_path_required">Cesta k adresáři nesmí být prázdná</string>
<!--Dialog shown before config export--> <!--Dialog shown before config export-->

View file

@ -76,7 +76,7 @@
<!--Dialog shown when attempting to delete a folder--> <!--Dialog shown when attempting to delete a folder-->
<string name="delete_folder_confirm">Soll dieses Verzeichnis wirklich gelöscht werden?</string> <string name="delete_folder_confirm">Soll dieses Verzeichnis wirklich gelöscht werden?</string>
<!--Toast shown when trying to create a folder with an invalid ID--> <!--Toast shown when trying to create a folder with an invalid ID-->
<string name="folder_id_invalid">Die Verzeichnis-ID muss eine kurze Kennung (64 Zeichen oder weniger) sein. Sie kann nur aus Buchstaben, Zahlen und dem Punkt- (.), Bindestrich- (-), und Unterstrich- (_) Zeichen bestehen.</string> <string name="folder_id_required">Die Verzeichnis-ID muss eine kurze Kennung (64 Zeichen oder weniger) sein. Sie kann nur aus Buchstaben, Zahlen und dem Punkt- (.), Bindestrich- (-), und Unterstrich- (_) Zeichen bestehen.</string>
<!--Toast shown when trying to create a folder with an empty path--> <!--Toast shown when trying to create a folder with an empty path-->
<string name="folder_path_required">Der Ordnerpfad darf nicht leer sein</string> <string name="folder_path_required">Der Ordnerpfad darf nicht leer sein</string>
<!--Dialog shown before config export--> <!--Dialog shown before config export-->

View file

@ -73,7 +73,7 @@
<!--Dialog shown when attempting to delete a folder--> <!--Dialog shown when attempting to delete a folder-->
<string name="delete_folder_confirm">¿De verdad quieres eliminar esta carpeta?</string> <string name="delete_folder_confirm">¿De verdad quieres eliminar esta carpeta?</string>
<!--Toast shown when trying to create a folder with an invalid ID--> <!--Toast shown when trying to create a folder with an invalid ID-->
<string name="folder_id_invalid">El ID de carpeta tiene que ser un identificador corto (64 caracteres o menos) formado por letras, números y los caracteres como el punto (.), el guión (-) y el subrayado(_).</string> <string name="folder_id_required">El ID de carpeta tiene que ser un identificador corto (64 caracteres o menos) formado por letras, números y los caracteres como el punto (.), el guión (-) y el subrayado(_).</string>
<!--Toast shown when trying to create a folder with an empty path--> <!--Toast shown when trying to create a folder with an empty path-->
<string name="folder_path_required">La ruta a la carpeta no puede estar vacia</string> <string name="folder_path_required">La ruta a la carpeta no puede estar vacia</string>
<!--Dialog shown before config export--> <!--Dialog shown before config export-->

View file

@ -76,7 +76,7 @@
<!--Dialog shown when attempting to delete a folder--> <!--Dialog shown when attempting to delete a folder-->
<string name="delete_folder_confirm">Voulez-vous vraiment supprimer ce dossier ?</string> <string name="delete_folder_confirm">Voulez-vous vraiment supprimer ce dossier ?</string>
<!--Toast shown when trying to create a folder with an invalid ID--> <!--Toast shown when trying to create a folder with an invalid ID-->
<string name="folder_id_invalid">L\'ID du dossier doit être un identifiant court (64 caractères ou moins) pouvant contenir les valeurs suivantes: lettres, chiffres, point (.), tiret milieu (-), et tiret-bas (_).</string> <string name="folder_id_required">L\'ID du dossier doit être un identifiant court (64 caractères ou moins) pouvant contenir les valeurs suivantes: lettres, chiffres, point (.), tiret milieu (-), et tiret-bas (_).</string>
<!--Toast shown when trying to create a folder with an empty path--> <!--Toast shown when trying to create a folder with an empty path-->
<string name="folder_path_required">Le chemin du dossier ne doit pas être vide</string> <string name="folder_path_required">Le chemin du dossier ne doit pas être vide</string>
<!--Dialog shown before config export--> <!--Dialog shown before config export-->

View file

@ -76,7 +76,7 @@
<!--Dialog shown when attempting to delete a folder--> <!--Dialog shown when attempting to delete a folder-->
<string name="delete_folder_confirm">Vuoi veramente eliminare questa cartella?</string> <string name="delete_folder_confirm">Vuoi veramente eliminare questa cartella?</string>
<!--Toast shown when trying to create a folder with an invalid ID--> <!--Toast shown when trying to create a folder with an invalid ID-->
<string name="folder_id_invalid">L\'ID della cartella dev\'essere un identificatore breve (64 caratteri o meno) costituito solamente da lettere, numeri, punti (.), trattini (-) e trattini bassi (_).</string> <string name="folder_id_required">L\'ID della cartella dev\'essere un identificatore breve (64 caratteri o meno) costituito solamente da lettere, numeri, punti (.), trattini (-) e trattini bassi (_).</string>
<!--Toast shown when trying to create a folder with an empty path--> <!--Toast shown when trying to create a folder with an empty path-->
<string name="folder_path_required">Il percorso della cartella non può essere vuoto</string> <string name="folder_path_required">Il percorso della cartella non può essere vuoto</string>
<!--Dialog shown before config export--> <!--Dialog shown before config export-->

View file

@ -76,7 +76,7 @@
<!--Dialog shown when attempting to delete a folder--> <!--Dialog shown when attempting to delete a folder-->
<string name="delete_folder_confirm">フォルダーを削除してもよろしいですか?</string> <string name="delete_folder_confirm">フォルダーを削除してもよろしいですか?</string>
<!--Toast shown when trying to create a folder with an invalid ID--> <!--Toast shown when trying to create a folder with an invalid ID-->
<string name="folder_id_invalid">フォルダーIDは、文字、数字、ドット (.)、ダッシュ (-)、アンダースコア (_) からなる、短い識別子 (64文字以下) でなければなりません。</string> <string name="folder_id_required">フォルダーIDは、文字、数字、ドット (.)、ダッシュ (-)、アンダースコア (_) からなる、短い識別子 (64文字以下) でなければなりません。</string>
<!--Toast shown when trying to create a folder with an empty path--> <!--Toast shown when trying to create a folder with an empty path-->
<string name="folder_path_required">フォルダーのパスは空にできません</string> <string name="folder_path_required">フォルダーのパスは空にできません</string>
<!--Dialog shown before config export--> <!--Dialog shown before config export-->

View file

@ -69,7 +69,7 @@
<!--Dialog shown when attempting to delete a folder--> <!--Dialog shown when attempting to delete a folder-->
<string name="delete_folder_confirm">정말로 이 폴더를 삭제하시겠습니까?</string> <string name="delete_folder_confirm">정말로 이 폴더를 삭제하시겠습니까?</string>
<!--Toast shown when trying to create a folder with an invalid ID--> <!--Toast shown when trying to create a folder with an invalid ID-->
<string name="folder_id_invalid">폴더 ID는 문자, 숫자, 마침표(.), 붙임표(-), 밑줄 문자(_)로만 구성되어 있는 짧은 식별자(64자 이하)여야 합니다.</string> <string name="folder_id_required">폴더 ID는 문자, 숫자, 마침표(.), 붙임표(-), 밑줄 문자(_)로만 구성되어 있는 짧은 식별자(64자 이하)여야 합니다.</string>
<!--Toast shown when trying to create a folder with an empty path--> <!--Toast shown when trying to create a folder with an empty path-->
<string name="folder_path_required">폴더 경로를 공백으로 둘 수 없습니다</string> <string name="folder_path_required">폴더 경로를 공백으로 둘 수 없습니다</string>
<!--Dialog shown before config export--> <!--Dialog shown before config export-->

View file

@ -76,7 +76,7 @@
<!--Dialog shown when attempting to delete a folder--> <!--Dialog shown when attempting to delete a folder-->
<string name="delete_folder_confirm">Ønsker du virkelig å slette denne mappen?</string> <string name="delete_folder_confirm">Ønsker du virkelig å slette denne mappen?</string>
<!--Toast shown when trying to create a folder with an invalid ID--> <!--Toast shown when trying to create a folder with an invalid ID-->
<string name="folder_id_invalid">Mappe-ID må være en kort identifikator (64 tegn eller færre) bestående av kun bokstaver, tall og tegnene punktum (.), bindestrek (-) og understrek (_).</string> <string name="folder_id_required">Mappe-ID må være en kort identifikator (64 tegn eller færre) bestående av kun bokstaver, tall og tegnene punktum (.), bindestrek (-) og understrek (_).</string>
<!--Toast shown when trying to create a folder with an empty path--> <!--Toast shown when trying to create a folder with an empty path-->
<string name="folder_path_required">Mappestien kan ikke være tom</string> <string name="folder_path_required">Mappestien kan ikke være tom</string>
<!--Dialog shown before config export--> <!--Dialog shown before config export-->

View file

@ -76,7 +76,7 @@
<!--Dialog shown when attempting to delete a folder--> <!--Dialog shown when attempting to delete a folder-->
<string name="delete_folder_confirm">Weet je zeker dat je deze map wilt verwijderen?</string> <string name="delete_folder_confirm">Weet je zeker dat je deze map wilt verwijderen?</string>
<!--Toast shown when trying to create a folder with an invalid ID--> <!--Toast shown when trying to create a folder with an invalid ID-->
<string name="folder_id_invalid">De map-ID moet een korte aanduiding (64 of minder tekens) zijn, bestaande uit enkel letters, cijfers, punten (.), streepjes (-) en onderstrepingstekens (_).</string> <string name="folder_id_required">De map-ID moet een korte aanduiding (64 of minder tekens) zijn, bestaande uit enkel letters, cijfers, punten (.), streepjes (-) en onderstrepingstekens (_).</string>
<!--Toast shown when trying to create a folder with an empty path--> <!--Toast shown when trying to create a folder with an empty path-->
<string name="folder_path_required">Het mappad mag niet leeg zijn</string> <string name="folder_path_required">Het mappad mag niet leeg zijn</string>
<!--Dialog shown before config export--> <!--Dialog shown before config export-->

View file

@ -76,7 +76,7 @@
<!--Dialog shown when attempting to delete a folder--> <!--Dialog shown when attempting to delete a folder-->
<string name="delete_folder_confirm">Usunąć ten katalog?</string> <string name="delete_folder_confirm">Usunąć ten katalog?</string>
<!--Toast shown when trying to create a folder with an invalid ID--> <!--Toast shown when trying to create a folder with an invalid ID-->
<string name="folder_id_invalid">Identyfikator katalogu musi być krótki (64 lub mniej znaków), może zawierać tylko litery, cyfry, kropki, myślniki i znak podkreślenia.</string> <string name="folder_id_required">Identyfikator katalogu musi być krótki (64 lub mniej znaków), może zawierać tylko litery, cyfry, kropki, myślniki i znak podkreślenia.</string>
<!--Toast shown when trying to create a folder with an empty path--> <!--Toast shown when trying to create a folder with an empty path-->
<string name="folder_path_required">Ścieżka katalogu nie może być pusta</string> <string name="folder_path_required">Ścieżka katalogu nie może być pusta</string>
<!--Dialog shown before config export--> <!--Dialog shown before config export-->

View file

@ -76,7 +76,7 @@
<!--Dialog shown when attempting to delete a folder--> <!--Dialog shown when attempting to delete a folder-->
<string name="delete_folder_confirm">Deseja mesmo apagar esta pasta?</string> <string name="delete_folder_confirm">Deseja mesmo apagar esta pasta?</string>
<!--Toast shown when trying to create a folder with an invalid ID--> <!--Toast shown when trying to create a folder with an invalid ID-->
<string name="folder_id_invalid">O ID da pasta deve ser um nome curto (64 caracteres ou menos) e composto apenas de letras, números, ponto (.), hífen (-) ou underscore (_).</string> <string name="folder_id_required">O ID da pasta deve ser um nome curto (64 caracteres ou menos) e composto apenas de letras, números, ponto (.), hífen (-) ou underscore (_).</string>
<!--Toast shown when trying to create a folder with an empty path--> <!--Toast shown when trying to create a folder with an empty path-->
<string name="folder_path_required">O caminho da pasta não pode ficar vazio</string> <string name="folder_path_required">O caminho da pasta não pode ficar vazio</string>
<!--Dialog shown before config export--> <!--Dialog shown before config export-->

View file

@ -76,7 +76,7 @@
<!--Dialog shown when attempting to delete a folder--> <!--Dialog shown when attempting to delete a folder-->
<string name="delete_folder_confirm">Quer mesmo eliminar esta pasta?</string> <string name="delete_folder_confirm">Quer mesmo eliminar esta pasta?</string>
<!--Toast shown when trying to create a folder with an invalid ID--> <!--Toast shown when trying to create a folder with an invalid ID-->
<string name="folder_id_invalid">O ID da pasta tem que ser um identificador curto (64 caracteres ou menos) consistindo apenas em letras, números e os caracteres ponto (.), hífen (-) e sublinhado (_).</string> <string name="folder_id_required">O ID da pasta tem que ser um identificador curto (64 caracteres ou menos) consistindo apenas em letras, números e os caracteres ponto (.), hífen (-) e sublinhado (_).</string>
<!--Toast shown when trying to create a folder with an empty path--> <!--Toast shown when trying to create a folder with an empty path-->
<string name="folder_path_required">O caminho da pasta não pode estar vazio</string> <string name="folder_path_required">O caminho da pasta não pode estar vazio</string>
<!--Dialog shown before config export--> <!--Dialog shown before config export-->

View file

@ -76,7 +76,7 @@
<!--Dialog shown when attempting to delete a folder--> <!--Dialog shown when attempting to delete a folder-->
<string name="delete_folder_confirm">Вы действительно хотите удалить папку?</string> <string name="delete_folder_confirm">Вы действительно хотите удалить папку?</string>
<!--Toast shown when trying to create a folder with an invalid ID--> <!--Toast shown when trying to create a folder with an invalid ID-->
<string name="folder_id_invalid">ID папки должен быть коротким идентификатором (64 символов или меньше) состоящий из букв, цифр и символов точки (.), тире(-) и подчеркивания (_).</string> <string name="folder_id_required">ID папки должен быть коротким идентификатором (64 символов или меньше) состоящий из букв, цифр и символов точки (.), тире(-) и подчеркивания (_).</string>
<!--Toast shown when trying to create a folder with an empty path--> <!--Toast shown when trying to create a folder with an empty path-->
<string name="folder_path_required">Путь к папке не может быть пустым</string> <string name="folder_path_required">Путь к папке не может быть пустым</string>
<!--Dialog shown before config export--> <!--Dialog shown before config export-->

View file

@ -76,7 +76,7 @@
<!--Dialog shown when attempting to delete a folder--> <!--Dialog shown when attempting to delete a folder-->
<string name="delete_folder_confirm">Naozaj chcete odstrániť adresár?</string> <string name="delete_folder_confirm">Naozaj chcete odstrániť adresár?</string>
<!--Toast shown when trying to create a folder with an invalid ID--> <!--Toast shown when trying to create a folder with an invalid ID-->
<string name="folder_id_invalid">ID adresára musí byť krátky reťazec (max. 64 znakov) zložený z čísel, písmen bez diakritiky, bodky (.), pomlčky (-) alebo podtržítka (_).</string> <string name="folder_id_required">ID adresára musí byť krátky reťazec (max. 64 znakov) zložený z čísel, písmen bez diakritiky, bodky (.), pomlčky (-) alebo podtržítka (_).</string>
<!--Toast shown when trying to create a folder with an empty path--> <!--Toast shown when trying to create a folder with an empty path-->
<string name="folder_path_required">Cesta k adresáru nemôže byť prázdna</string> <string name="folder_path_required">Cesta k adresáru nemôže byť prázdna</string>
<!--Dialog shown before config export--> <!--Dialog shown before config export-->

View file

@ -69,7 +69,7 @@
<!--Dialog shown when attempting to delete a folder--> <!--Dialog shown when attempting to delete a folder-->
<string name="delete_folder_confirm">Bu klasörü gerçekten silmek istiyor musunuz?</string> <string name="delete_folder_confirm">Bu klasörü gerçekten silmek istiyor musunuz?</string>
<!--Toast shown when trying to create a folder with an invalid ID--> <!--Toast shown when trying to create a folder with an invalid ID-->
<string name="folder_id_invalid">Klasör ID, (64 karakterden daha az) ve sadece harf, sayı, nokta (.), çizgi (-) ve altçizgi (_) karakterleri içermesi gerekir.</string> <string name="folder_id_required">Klasör ID, (64 karakterden daha az) ve sadece harf, sayı, nokta (.), çizgi (-) ve altçizgi (_) karakterleri içermesi gerekir.</string>
<!--Toast shown when trying to create a folder with an empty path--> <!--Toast shown when trying to create a folder with an empty path-->
<string name="folder_path_required">Klasör yolu boş olmamalı</string> <string name="folder_path_required">Klasör yolu boş olmamalı</string>
<!--Dialog shown before config export--> <!--Dialog shown before config export-->

View file

@ -76,7 +76,7 @@
<!--Dialog shown when attempting to delete a folder--> <!--Dialog shown when attempting to delete a folder-->
<string name="delete_folder_confirm">您确定要删除该文件夹吗?</string> <string name="delete_folder_confirm">您确定要删除该文件夹吗?</string>
<!--Toast shown when trying to create a folder with an invalid ID--> <!--Toast shown when trying to create a folder with an invalid ID-->
<string name="folder_id_invalid">文件夹标识必须由不长于 64 位字符,且仅能包含字母、数字、半角句号(.)、横线(-和下划线_</string> <string name="folder_id_required">文件夹标识必须由不长于 64 位字符,且仅能包含字母、数字、半角句号(.)、横线(-和下划线_</string>
<!--Toast shown when trying to create a folder with an empty path--> <!--Toast shown when trying to create a folder with an empty path-->
<string name="folder_path_required">文件夹路径不得为空</string> <string name="folder_path_required">文件夹路径不得为空</string>
<!--Dialog shown before config export--> <!--Dialog shown before config export-->

View file

@ -66,7 +66,7 @@
<!--Dialog shown when attempting to delete a folder--> <!--Dialog shown when attempting to delete a folder-->
<string name="delete_folder_confirm">您確定要刪除此資料夾?</string> <string name="delete_folder_confirm">您確定要刪除此資料夾?</string>
<!--Toast shown when trying to create a folder with an invalid ID--> <!--Toast shown when trying to create a folder with an invalid ID-->
<string name="folder_id_invalid">資料夾識別碼必須為一段只包含半形英文字母、數字、點 (.)、連接符號 (-) 以及底線 (_) 的簡短識別碼 (不多於 64 個字元)</string> <string name="folder_id_required">資料夾識別碼必須為一段只包含半形英文字母、數字、點 (.)、連接符號 (-) 以及底線 (_) 的簡短識別碼 (不多於 64 個字元)</string>
<!--Toast shown when trying to create a folder with an empty path--> <!--Toast shown when trying to create a folder with an empty path-->
<string name="folder_path_required">資料夾路徑不得為空</string> <string name="folder_path_required">資料夾路徑不得為空</string>
<!--Dialog shown before config export--> <!--Dialog shown before config export-->

View file

@ -130,8 +130,8 @@
<!-- Dialog shown when attempting to delete a folder --> <!-- Dialog shown when attempting to delete a folder -->
<string name="delete_folder_confirm">Do you really want to delete this folder?</string> <string name="delete_folder_confirm">Do you really want to delete this folder?</string>
<!-- Toast shown when trying to create a folder with an invalid ID --> <!-- Toast shown when trying to create a folder with an empty ID -->
<string name="folder_id_invalid">The folder ID must be a short identifier (64 characters or less) consisting of letters, numbers and the dot (.), dash (-) and underscode (_) characters only.</string> <string name="folder_id_required">The folder ID must not be empty</string>
<!-- Toast shown when trying to create a folder with an empty path --> <!-- Toast shown when trying to create a folder with an empty path -->
<string name="folder_path_required">The folder path must not be empty</string> <string name="folder_path_required">The folder path must not be empty</string>