commit patch from slakmagik that brings user straight back to search box if search fails

This commit is contained in:
chess.griffin 2009-01-22 01:29:47 +00:00
parent 5cb04eb9a8
commit 8b4c2e1f19

View File

@ -1565,7 +1565,7 @@ gen_search_package () {
else else
if [ "$DIAG" = 1 ]; then if [ "$DIAG" = 1 ]; then
dialog --title "ERROR" --msgbox "No match for $PKG found" 8 30 dialog --title "ERROR" --msgbox "No match for $PKG found" 8 30
continue main_search
else else
echo "$SCRIPT: No match for $PKG found." 1>&2 echo "$SCRIPT: No match for $PKG found." 1>&2
continue continue
@ -2460,6 +2460,20 @@ control_c () {
fi fi
} }
main_search() {
check_if_repo_exists
dialog --inputbox \
"Enter the name of a package you would like to search for:" \
9 40 2>/$TMP/sbopkg_search_request
if [ $? != 0 ]; then
continue
fi
SRCH="$(cat $TMP/sbopkg_search_request)"
if [ ! "$SRCH" = "" ]; then
gen_search_package $SRCH
fi
}
main_menu () { main_menu () {
# This is the main dialog menu. # This is the main dialog menu.
if [ -z "$R" ]; then if [ -z "$R" ]; then
@ -2530,17 +2544,7 @@ main_menu () {
fi fi
if [ "$R" = "Search" ]; then if [ "$R" = "Search" ]; then
check_if_repo_exists main_search
dialog --inputbox \
"Enter the name of a package you would like to search for:" \
9 40 2>/$TMP/sbopkg_search_request
if [ $? != 0 ]; then
continue
fi
SRCH="$(cat $TMP/sbopkg_search_request)"
if [ ! "$SRCH" = "" ]; then
gen_search_package $SRCH
fi
fi fi
if [ "$R" = "Queue" ]; then if [ "$R" = "Queue" ]; then