gsu: User banner text also for gsu gui.
authorAndre Noll <maan@systemlinux.org>
Fri, 16 May 2014 13:35:32 +0000 (15:35 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 29 Aug 2014 19:39:58 +0000 (21:39 +0200)
Currently the $gsu_banner_txt variable is used only for subcommand
utilities but not for dialog-based tools. There is no real reason for
this restriction, so this commit starts to use the variable also for
the various GUIs.

misc/gsu/common
misc/gsu/gui
misc/gsu/subcommand

index 9b8127d..bd8276b 100644 (file)
@@ -84,5 +84,6 @@ _gsu_setup()
        _gsu_self="$(basename $0)"
        gsu_name="${gsu_name:=$_gsu_self}"
        gsu_config_var_prefix="${gsu_config_var_prefix:=$gsu_name}"
+       gsu_banner_txt="${gsu_banner_txt:-set \$gsu_banner_txt to customize this message}"
        _gsu_init_errors
 }
index 12c8b8b..2e6a7b7 100644 (file)
@@ -139,7 +139,7 @@ gsu_menu()
                let num++
                opts+=" $i $num"
        done
-       result="$(dialog --menu "$header" $opts 3>&1 1>&2 2>&3 3>&-)"
+       result="$(dialog --menu "$gsu_banner_txt ($header)" $opts 3>&1 1>&2 2>&3 3>&-)"
        ret="$?"
 }
 
@@ -208,5 +208,5 @@ gsu_gui()
        fi
        _get_root_nodes "$tree"
        subtree="$result"
-       _browse "$gsu_name main menu" "$tree" "$subtree"
+       _browse "main menu" "$tree" "$subtree"
 }
index a13d3b2..ddb351a 100644 (file)
@@ -186,7 +186,6 @@ _com_man()
 
 _gsu_banner_msg()
 {
-       gsu_banner_txt="${gsu_banner_txt:-set \$gsu_banner_txt to customize this message}"
        gsu_short_msg "### $_gsu_self -- ###"
 }