Skip to content

Commit c1e7ba0

Browse files
Merge remote-tracking branch 'origin/suggestion-font-size-setting' into suggestion-font-size-setting
# Conflicts: # app/src/main/res/values/strings.xml
2 parents 9cde31c + 38d7bff commit c1e7ba0

File tree

6 files changed

+26
-2
lines changed

6 files changed

+26
-2
lines changed

app/src/main/java/com/coderGtm/yantra/commands/notepad/Command.kt

+20
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,26 @@ class Command(terminal: Terminal) : BaseCommand(terminal) {
7575
}
7676
return
7777
}
78+
if (action == "edit") {
79+
if (notes.contains(name)) {
80+
YantraLauncherDialog(terminal.activity).takeInput(
81+
title = terminal.activity.getString(R.string.edit_note, name),
82+
message = terminal.activity.getString(R.string.enter_note_content),
83+
cancellable = false,
84+
inputType = InputType.TYPE_TEXT_FLAG_MULTI_LINE,
85+
initialInput = terminal.preferenceObject.getString("notepad_note_${name}", "") ?: "",
86+
positiveButton = terminal.activity.getString(R.string.save),
87+
positiveAction = {
88+
val note_text = it.trim()
89+
terminal.preferenceObject.edit().putString("notepad_note_${name}", note_text).apply()
90+
output(terminal.activity.getString(R.string.note_saved_to_notepad, name), terminal.theme.successTextColor)
91+
}
92+
)
93+
} else {
94+
output(terminal.activity.getString(R.string.no_note_fond_by_the_name, name), terminal.theme.errorTextColor)
95+
}
96+
return
97+
}
7898
if (action == "delete") {
7999
if (notes.contains(name)) {
80100
terminal.preferenceObject.edit().remove("notepad_note_${name}").apply()

app/src/main/java/com/coderGtm/yantra/terminal/Helper.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ fun showSuggestions(
333333
overrideLastWord = true
334334
}
335335
val regex = Regex(Pattern.quote(input.removePrefix(args[0]).trim()), RegexOption.IGNORE_CASE)
336-
val notepadArgs = listOf("list","read","new","delete")
336+
val notepadArgs = listOf("list","read","new","edit","delete")
337337
for (arg in notepadArgs) {
338338
if (regex.containsMatchIn(arg)) {
339339
suggestions.add(arg)

app/src/main/res/values-es/strings.xml

+1
Original file line numberDiff line numberDiff line change
@@ -580,4 +580,5 @@
580580
<string name="terminal_text_color_reset">Reiniciar color del tema del texto de la terminal.</string>
581581
<string name="terminal_text_color_set_to"> Color del texto de la terminal establecido a #%1$s</string>
582582
<string name="no_sound_effects_found">No se encontraron efectos de sonido personalizados!</string>
583+
<string name="edit_note">Edit Note (%1$s)</string>
583584
</resources>

app/src/main/res/values-it/strings.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@
566566
<string name="playing_sound_effect">Riproduzione degli effetti sonori: %1$s...</string>
567567
<string name="sfx_not_found">Effetto sonoro dell\'app specifica (\'%1$s\') non è stato trovato. Aggiungilo dalla memoria interna dell\'app dalle \'impostazioni\'.</string>
568568
<string name="cmd_notepad_title"><![CDATA[notepad [list / new <nome> / read <nome> / delete <nome>]]]></string>
569-
<string name="cmd_notepad_help"><![CDATA[Un semplice blocco note in-app per prendere appunti al volo. Usa il comando `notepad list` per visualizzare tutte le tue note. Per creare una nuova nota, digita `notepad new <nome_nota>`. Per leggere una nota esistente, usa il comando `notepad read <nome_nota>`. Se vuoi eliminare una nota, usa il comando `notepad delete <nome_nota>`.]]></string>
569+
<string name="cmd_notepad_help"><![CDATA[Un semplice blocco note in-app per prendere appunti al volo. Usa il comando `notepad list` per visualizzare tutte le tue note. Per creare una nuova nota, digita `notepad new <nome_nota>`. Per leggere una nota esistente, usa il comando `notepad read <nome_nota>`, e per modificare una nota, usa il comando `notepad edit <nome_nota>`. Se vuoi eliminare una nota, usa il comando `notepad delete <nome_nota>`.]]></string>
570570
<string name="no_notes_found">Nessuna nota trovata...</string>
571571
<string name="notepad">Blocco note:</string>
572572
<string name="note_exists">Una nota con questo nome esiste già! Perfavore, usa un nome diverso.</string>
@@ -580,4 +580,5 @@
580580
<string name="terminal_text_color_reset">Il colore del testo del terminale è stato reimpostato al tema.</string>
581581
<string name="terminal_text_color_set_to">Il colore del testo del terminale è stato impostato a #%1$s</string>
582582
<string name="no_sound_effects_found">Nessun suono personalizzato è stato trovato!</string>
583+
<string name="edit_note">Modifica la nota (%1$s)</string>
583584
</resources>

app/src/main/res/values-ru/strings.xml

+1
Original file line numberDiff line numberDiff line change
@@ -580,4 +580,5 @@
580580
<string name="terminal_text_color_reset">Цвет текста терминала сброшен до темы.</string>
581581
<string name="terminal_text_color_set_to">Цвет текста треминала был изменён на #%1$s</string>
582582
<string name="no_sound_effects_found">Пользовательские звуковые эффекты не найдены!</string>
583+
<string name="edit_note">Edit Note (%1$s)</string>
583584
</resources>

app/src/main/res/values-uk/strings.xml

+1
Original file line numberDiff line numberDiff line change
@@ -580,4 +580,5 @@
580580
<string name="terminal_text_color_reset">Terminal text color reset to theme.</string>
581581
<string name="terminal_text_color_set_to">Terminal text color set to #%1$s</string>
582582
<string name="no_sound_effects_found">No custom sound effects found!</string>
583+
<string name="edit_note">Edit Note (%1$s)</string>
583584
</resources>

0 commit comments

Comments
 (0)