summaryrefslogtreecommitdiff
path: root/src/core/libs/lib-ui.sh
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-11-03 17:43:26 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-11-03 17:43:26 +0100
commita407cdfcde2d5d9058c15296ecce35814ffd38a1 (patch)
tree60efe59cc5777d84e3dee769515e847df28eac57 /src/core/libs/lib-ui.sh
parent69489c9c5c78a2b3c4fbdf4306d18584eeeb12ef (diff)
added infofy function that wraps around dialog --infobox + various cleanups in UI stuff
Diffstat (limited to 'src/core/libs/lib-ui.sh')
-rw-r--r--src/core/libs/lib-ui.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh
index bc32aaf..91cfca9 100644
--- a/src/core/libs/lib-ui.sh
+++ b/src/core/libs/lib-ui.sh
@@ -50,6 +50,17 @@ notify ()
}
+infofy ()
+{
+ if [ "$var_UI_TYPE" = dia ]
+ then
+ _dia_DIALOG --infobox "$@" 20 50
+ else
+ echo -e "$@"
+ fi
+}
+
+
# logging of stuff
log ()
{
@@ -173,7 +184,7 @@ _dia_ask_option ()
DIA_MENU_TITLE=$2
shift 2
- _dia_DIALOG $DEFAULT --title " $DIA_MENU_TITLE " --menu "$DIA_MENU_TEXT" 16 55 8 "$@" 2>$ANSWER
+ _dia_DIALOG $DEFAULT --colors --title " $DIA_MENU_TITLE " --menu "$DIA_MENU_TEXT" 16 55 8 "$@" 2>$ANSWER
ANSWER_OPTION=`cat $ANSWER`
echo $ANSWER_OPTION
}
@@ -181,6 +192,7 @@ _dia_ask_option ()
_cli_ask_option ()
{
+ #TODO: strip out color codes
DEFAULT=""
[ "$1" != 'no' ] && DEFAULT=$1
[ -z "$2" ] && die_error "ask_option \$2 must be the title"