#!/bin/sh

# Localisation
export TEXTDOMAINDIR="/usr/share/locale"
export TEXTDOMAIN=kanotix-vdr

DIALOG=Xdialog
#DIALOG=dialog

tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
trap "rm -f $tempfile" 0 1 2 5 15
$DIALOG --clear --title $"VDR Menu" \
        --menu $"Start VDR Programs\n\nMake your choice:" 28 62 2 \
        ""  "~~~~~~~~ "$"xine"" ~~~~~~~~ " \
        "1)"  $"xine-player (TV-Picture)" \
        "2)"  $"Get xine Keyboardlayout for VDR" \
        "3)"  $"Show xine Keyboardlayout" \
        "4)"  $"Change VDR IP-Adress for Xine-Player" \
        ""  "~~~~~~~~ "$"Miscellaneous"" ~~~~~~~~ " \
        "5)"  $"VDR-Update" \
        "6)"  $"Xine-Autostart (TV-Picture)" \
        "7)"  $"vdradmin (Webfrontend)" \
        "8)"  $"Exit" \
	2> $tempfile
answer="$?"
[ "$answer" = 1 ] && exit 1
answer=`cat $tempfile`
rm -f $Tempfile


case $answer in
    "1)") vdr-xine && exit;;
    "2)") rxvt -C -e vdr-xine-keymap;;
    "3)") rxvt -C -e vdr-xine-tasteninfo;;
    "4)") vdr-ip;;
    "5)") vdr-su "rxvt -C -e vdr-update";;
    "6)") rxvt -C -e vdr-xine-autorun;;
    "7)") vdr-vdradmin;;
    "8)") exit;;
    *)  break;;
esac

vdr-start-menu