#!/bin/sh -e
#Provides all mythbuntu questions asked by 
#ubiquity during install process
# Copyright (C) 2007 Mario Limonciello
# Written by Mario Limonciello <superm1@ubuntu.com>

. /usr/share/debconf/confmodule

db_capb "backup"

STATE=0
while :; do
	case "$STATE" in
	0)
		# Determine install type
		db_input high mythbuntu/install_type || true
	;;
	1)
		#detemine plugins
		db_input high mythbuntu/mytharchive || true
		db_input high mythbuntu/mythbrowser || true
		db_input high mythbuntu/mythcontrols || true
		db_input high mythbuntu/mythdvd || true
		db_input high mythbuntu/mythflix || true
		db_input high mythbuntu/mythgallery || true
		db_input high mythbuntu/mythgame || true
		db_input high mythbuntu/mythmusic || true
		db_input high mythbuntu/mythnews || true
		db_input high mythbuntu/mythphone || true
		db_input high mythbuntu/mythvideo || true
		db_input high mythbuntu/mythweather || true
		db_input high mythbuntu/mythweb || true
	;;
	2)
		#determine themes
		db_input high mythbuntu/officialthemes || true
		db_input high mythbuntu/communitythemes || true
	;;
	3)
		#determine prop. drivers
		db_input high mythbuntu/ati || true
		db_input high mythbuntu/nvidia || true
	;;
	4)
		#determine tv out settings
		db_input high mythbuntu/tvout || true
		db_input high mythbuntu/tvstandard || true
	;;
	5)
		#determine mysql info
		db_input high mythtv/mysql_mythtv_user || true
		db_input high mythtv/mysql_mythtv_password || true
		db_input high mythtv/mysql_mythtv_dbname || true
		db_input high mythtv/mysql_host || true
	;;
	*)
		break
	;;
	esac

	if db_go; then
		STATE=$(($STATE + 1))
	else
		STATE=$(($STATE - 1))
	fi
	#echo "ON STATE: $STATE"
done

if test "$STATE" = -1 
then
	exit 10
fi
