Edit moved to more menu. New note moved to button. Exit option removed from menu, now controled by button.

This commit is contained in:
Storm Dragon
2019-08-03 00:06:46 -04:00
parent b02b97c707
commit eddb54e503

View File

@@ -77,7 +77,7 @@ menulist() {
dialog --backtitle "$(gettext "Use the up and down arrow keys to find the option you want, then press enter to select it.")" \
--cancel-label "$(gettext "Exit")" \
--extra-button \
--extra-label "$(gettext "Edit")" \
--extra-label "$(gettext "New")" \
--help-button \
--help-label "$(gettext "More")" \
--ok-label "$(gettext "View")" \
@@ -94,6 +94,7 @@ more_menu() {
options=("encrypt" "$(gettext "Encrypt")")
fi
options+=(
"edit" "$(gettext "Edit")"
"delete" "$(gettext "Delete")")
local action="$(dialog --backtitle "$(gettext "Use the up and down arrow keys to find the option you want, then press enter to select it.")" \
--no-tags \
@@ -102,6 +103,7 @@ more_menu() {
case "$action" in
"decrypt") decrypt_note "$1";;
"delete") delete_note "$1";;
"edit") edit_note "$1";;
"encrypt") encrypt_note "$1";;
*) return;;
esac
@@ -271,10 +273,7 @@ while [ "$action" != "exit" ]; do
# Create menu of actions and notes.
ifs="$IFS"
IFS=$'\n'
action="$(menulist \
"add_note" "$(gettext "New note")" \
"${noteMenu[@]}" \
"exit" "$(gettext "Exit")")"
action="$(menulist "${noteMenu[@]}")"
dialogCode=$?
IFS="$ifs"
@@ -290,7 +289,7 @@ while [ "$action" != "exit" ]; do
case $dialogCode in
0) display_note "${action}";;
2) more_menu "${action#HELP }";;
3) edit_note "${action}";;
3) add_note;;
esac;;
esac
done