diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2008-12-09 18:41:23 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2008-12-09 18:41:23 +0100 |
commit | 94d36b5a5a394c033edb7d2b8c340579d4564aad (patch) | |
tree | 515801682bd7a89e909e2aa15bf29f2ac39dda81 /src/core/libs/lib-ui.sh | |
parent | a87d6a70abdb462ee1f9b6f5d65b966d1d8d3763 (diff) |
support for successive infofys + nicer output for disk stuff + stupid fix
Diffstat (limited to 'src/core/libs/lib-ui.sh')
-rw-r--r-- | src/core/libs/lib-ui.sh | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh index 6275540..e4d3f4b 100644 --- a/src/core/libs/lib-ui.sh +++ b/src/core/libs/lib-ui.sh @@ -6,7 +6,7 @@ # Taken from setup. we store dialog output in a file. TODO: can't we do this with variables? ASKDEV ANSWER="/home/arch/aif/runtime/.dialog-answer" DIA_MENU_TEXT="Use the UP and DOWN arrows to navigate menus. Use TAB to switch between buttons and ENTER to select." - +DIA_SUCCESSIVE_ITEMS="/home/arch/aif/runtime/.dia-successive-items" ### Functions that your code can use. Cli/dialog mode is fully transparant. This library takes care of it ### @@ -59,14 +59,28 @@ notify () # like notify, but user does not need to confirm explicitly when in dia mode +# $1 str +# $2 0/<listname> this infofy call is part of a successive list of things (eg repeat previous things, keep adding items to a list) (only needed for dia, cli does this by design). +# You can keep several "lists of successive things" by grouping them with <listname> +# this is somewhat similar to follow_progress. Note that this list isn't cleared unless you set $3 to 1. default 0. (optional). +# $3 0/1 this is the last one of the group of several things (eg clear buffer). default 0. (optional) infofy () { - debug "infofy: $@" + successive=${2:-0} + succ_last=${3:-0} + debug "infofy: $1" if [ "$var_UI_TYPE" = dia ] then - _dia_DIALOG --infobox "$@" 20 50 + str="$1" + if [ "$successive" != 0 ] + then + echo "$1" >> $DIA_SUCCESSIVE_ITEMS-$successive + str=`cat $DIA_SUCCESSIVE_ITEMS-$successive` + fi + [ "$succ_last" = 1 ] && rm $DIA_SUCCESSIVE_ITEMS-$successive + _dia_DIALOG --infobox "$str" 20 50 else - echo -e "$@" + echo -e "$1" fi } |