packages.subr (d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf) packages.subr (6d3c0798ccbe7f6d3b677eed31206efc1227be50)
1if [ ! "$_PACKAGES_PACKAGES_SUBR" ]; then _PACKAGES_PACKAGES_SUBR=1
2#
3# Copyright (c) 2013-2016 Devin Teske
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:

--- 364 unchanged lines hidden (view full) ---

373#
374# On success, if the user doesn't press ESC or choose Cancel, use
375# f_dialog_menuitem_fetch() to populate a local variable with the item (not
376# tag) corresponding to the user's selection. The tag portion of the user's
377# selection is available through f_dialog_menutag_fetch().
378#
379f_package_menu_select()
380{
1if [ ! "$_PACKAGES_PACKAGES_SUBR" ]; then _PACKAGES_PACKAGES_SUBR=1
2#
3# Copyright (c) 2013-2016 Devin Teske
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:

--- 364 unchanged lines hidden (view full) ---

373#
374# On success, if the user doesn't press ESC or choose Cancel, use
375# f_dialog_menuitem_fetch() to populate a local variable with the item (not
376# tag) corresponding to the user's selection. The tag portion of the user's
377# selection is available through f_dialog_menutag_fetch().
378#
379f_package_menu_select()
380{
381 local __funcname=f_package_menu_deselect
381 local category="$1" page="${2:-1}"
382 local prompt= # Calculated below
383 local menu_list # Calculated below
384 local defaultitem="$3"
385 local hline="$hline_arrows_tab_punc_enter"
386
387 f_isinteger "$page" || return $DIALOG_CANCEL
388

--- 30 unchanged lines hidden (view full) ---

419 if [ $page -lt $npages ]; then
420 add_next=1
421 # Accent the `Next Page' item with an asterisk
422 # if the page-after-next is loaded/cached
423 f_isset _index_page_${varcat}_$(( $page + 1 )) &&
424 next_page="$next_page*"
425 fi
426
382 local category="$1" page="${2:-1}"
383 local prompt= # Calculated below
384 local menu_list # Calculated below
385 local defaultitem="$3"
386 local hline="$hline_arrows_tab_punc_enter"
387
388 f_isinteger "$page" || return $DIALOG_CANCEL
389

--- 30 unchanged lines hidden (view full) ---

420 if [ $page -lt $npages ]; then
421 add_next=1
422 # Accent the `Next Page' item with an asterisk
423 # if the page-after-next is loaded/cached
424 f_isset _index_page_${varcat}_$(( $page + 1 )) &&
425 next_page="$next_page*"
426 fi
427
427 local index_page
428 f_package_index_get_page "$category" $page index_page
428 local index_page __index
429 if [ "$category" = "$msg_all" ]; then
430 f_eval_catch -k __index $__funcname pkg \
431 "pkg rquery -a '%s'" "%n|%o||%c"
432 else
433 f_eval_catch -k __index $__funcname pkg \
434 "pkg rquery -g '%s' '%s/\*'" "%n|%o||%c" "$category"
435 fi
436 f_package_index_get_page "$category" $page index_page __index
429
430 menu_list="
431 ${add_prev:+'> $previous_page' '' ${SHOW_DESC:+''}}
432 ${add_next:+'> $next_page' '' ${SHOW_DESC:+''}}
433 $(
434 export SHOW_DESC
435 export VALID_VARNAME_CHARS
436 echo "$index_page" | awk -F'|' -v view="port" '

--- 757 unchanged lines hidden ---
437
438 menu_list="
439 ${add_prev:+'> $previous_page' '' ${SHOW_DESC:+''}}
440 ${add_next:+'> $next_page' '' ${SHOW_DESC:+''}}
441 $(
442 export SHOW_DESC
443 export VALID_VARNAME_CHARS
444 echo "$index_page" | awk -F'|' -v view="port" '

--- 757 unchanged lines hidden ---