From 8f4dd6e282f9b0fbf1c11bd31a8393abde914332 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 28 Oct 2016 23:21:48 +0200 Subject: [PATCH] show a different toast for missing new item name --- .../filemanager/dialogs/CreateNewItemDialog.kt | 4 +++- app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-pt-rPT/strings.xml | 1 + app/src/main/res/values-sv/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 7 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CreateNewItemDialog.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CreateNewItemDialog.kt index 538394fb..0c369e8a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CreateNewItemDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CreateNewItemDialog.kt @@ -37,7 +37,9 @@ class CreateNewItemDialog() { show() getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(View.OnClickListener { val name = view.item_name.value - if (Utils.isNameValid(name)) { + if (name.isEmpty()) { + context.toast(R.string.empty_name) + } else if (Utils.isNameValid(name)) { val file = File(path, name) if (file.exists()) { context.toast(R.string.name_taken) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index cbcc2315..94516eec 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -11,6 +11,7 @@ Datei Es existiert bereits eine Datei oder ein Ordner mit diesem Namen Der Name enthält nicht erlaubte Zeichen + Please enter a name Ein unbekannter Fehler ist aufgetreten Löschen Rückgängig diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index cd5dc879..4d690af9 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -11,6 +11,7 @@ File Esiste già un file o una cartella con quel nome Il nome contiene caratteri non validi + Please enter a name Riscontrato un errore sconosciuto Elimina Annulla diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 8991c84e..ea20522a 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -11,6 +11,7 @@ ファイル その名前のディレクトリーまたはファイルが既に存在します 名前に無効な文字が含まれています + Please enter a name 不明なエラーが発生しました 削除 元に戻す diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index 0d8145d9..1117740d 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -11,6 +11,7 @@ Ficheiro Já existe um ficheiro ou pasta com esse nome O nome contém caracteres inválidos + Please enter a name Ocorreu um erro desconhecido Eliminar Desfazer diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index ff715b7f..99276907 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -11,6 +11,7 @@ Fil Katalog eller fil med detta namnet finns redan Namnet innehåller ogiltiga tecken + Please enter a name Ett okänt fel har uppstått Ta bort Ångra diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index fc74a9fa..60c3a355 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -11,6 +11,7 @@ File Directory or file with that name already exists The name contains invalid characters + Please enter a name An unknown error occurred Delete Undo