#!/bin/sh
dialog \
--title "Select graphic class" \
--menu "Please choose the appropriate accel-chip for \nyour card. (current: $1)" \
21 60 10 \
\
"generic"	"generic frame buffer support" \
"Cirrus"	"Cirrus Logic chipsets" \
"IBM"		"IBM (including std. vga) chipsets" \
"Matrox"	"Matrox chipsets" \
"S3"		"S3 Incorporated chipsets" \
"Tseng"         "Tseng Laboratories chipsets" \
\
2> /tmp/.graphclass 

GRAPH_CLASS=$1
GRAPH_TYPE=$2

NEW_GRAPH_CLASS=`cat /tmp/.graphclass`

if [ "$NEW_GRAPH_CLASS" != "" ]; then
  if [ "$NEW_GRAPH_CLASS" = "$GRAPH_CLASS" ]; then 
    graphic/$NEW_GRAPH_CLASS/.configure $2;
   else
    graphic/$NEW_GRAPH_CLASS/.configure;
  fi
  NEW_GRAPH_TYPE=`cat /tmp/.graphtype`
  if [ "$NEW_GRAPH_TYPE" != "" ]; then
    GRAPH_CLASS=$NEW_GRAPH_CLASS
    GRAPH_TYPE=$NEW_GRAPH_TYPE
  fi
fi

echo $GRAPH_CLASS>/tmp/.graphclass
echo $GRAPH_TYPE>/tmp/.graphtype
