show a different toast for missing new item name

This commit is contained in:
tibbi 2016-10-28 23:21:48 +02:00
parent 6a2841a48e
commit 8f4dd6e282
7 changed files with 9 additions and 1 deletions

View file

@ -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)

View file

@ -11,6 +11,7 @@
<string name="file">Datei</string>
<string name="name_taken">Es existiert bereits eine Datei oder ein Ordner mit diesem Namen</string>
<string name="invalid_name">Der Name enthält nicht erlaubte Zeichen</string>
<string name="empty_name">Please enter a name</string>
<string name="error_occurred">Ein unbekannter Fehler ist aufgetreten</string>
<string name="delete">Löschen</string>
<string name="undo">Rückgängig</string>

View file

@ -11,6 +11,7 @@
<string name="file">File</string>
<string name="name_taken">Esiste già un file o una cartella con quel nome</string>
<string name="invalid_name">Il nome contiene caratteri non validi</string>
<string name="empty_name">Please enter a name</string>
<string name="error_occurred">Riscontrato un errore sconosciuto</string>
<string name="delete">Elimina</string>
<string name="undo">Annulla</string>

View file

@ -11,6 +11,7 @@
<string name="file">ファイル</string>
<string name="name_taken">その名前のディレクトリーまたはファイルが既に存在します</string>
<string name="invalid_name">名前に無効な文字が含まれています</string>
<string name="empty_name">Please enter a name</string>
<string name="error_occurred">不明なエラーが発生しました</string>
<string name="delete">削除</string>
<string name="undo">元に戻す</string>

View file

@ -11,6 +11,7 @@
<string name="file">Ficheiro</string>
<string name="name_taken">Já existe um ficheiro ou pasta com esse nome</string>
<string name="invalid_name">O nome contém caracteres inválidos</string>
<string name="empty_name">Please enter a name</string>
<string name="error_occurred">Ocorreu um erro desconhecido</string>
<string name="delete">Eliminar</string>
<string name="undo">Desfazer</string>

View file

@ -11,6 +11,7 @@
<string name="file">Fil</string>
<string name="name_taken">Katalog eller fil med detta namnet finns redan</string>
<string name="invalid_name">Namnet innehåller ogiltiga tecken</string>
<string name="empty_name">Please enter a name</string>
<string name="error_occurred">Ett okänt fel har uppstått</string>
<string name="delete">Ta bort</string>
<string name="undo">Ångra</string>

View file

@ -11,6 +11,7 @@
<string name="file">File</string>
<string name="name_taken">Directory or file with that name already exists</string>
<string name="invalid_name">The name contains invalid characters</string>
<string name="empty_name">Please enter a name</string>
<string name="error_occurred">An unknown error occurred</string>
<string name="delete">Delete</string>
<string name="undo">Undo</string>