#ident	"@(#)proto:desktop/menus/diskchk	1.8"
function set_diskchk
{
	for i in 1 2
	do
		let disk=i-1
		case "${DISKCHK[i]}" in
		$Yes)
			eval HD${disk}OPT=" "
			;;
		$No)
			eval HD${disk}OPT=-n
			;;
		esac
	done
	return 0
}

function choose_diskchk
{
	choose  ${chkit[$1]} "$No" "$Yes"
}
function choose_bootsector
{
	choose  $bootit "$No" "$Yes"
}
function diskchk
{
	typeset -x resp
	[ -n "$DCHKFID" ] && destroy_form $DCHKFID
	open_form -exit set_diskchk 
	let DCHKFID=$FID
	setup_table -rows 3 -cols 2 -titles DISKCHK_TITLE -widths DISKCHK_WIDTH
	next_field_prompt "$DCHK_1"
	chkit[1]=${DISKCHK[1]}
	next_field -help 'helpwin surfanalys diskopts' -exit 'check_yesno ${chkit[1]} && DISKCHK[1]=$resp' -entry msgnoerr -choice "choose_diskchk 1" chkit[1]
	if (( NDISKS > 1 )) && (( FSTOT[2] > 0 ))
	then
		next_row
		next_field_prompt "$DCHK_2"
		chkit[2]=${DISKCHK[2]}
		next_field -help 'helpwin surfanalys diskopts' -exit 'check_yesno ${chkit[2]} && DISKCHK[2]=$resp' -entry msgnoerr -choice "choose_diskchk 2" chkit[2]
	fi
	next_row
	next_field_prompt "$DO_BOOTSECTOR"
	bootit=$BOOTSECTOR
	next_field -help 'helpwin bootcode diskopts' -exit 'check_yesno $bootit && BOOTSECTOR=$resp' -entry msgnoerr -choice "choose_bootsector 2" bootit
	let DCHKTABLE_WIDTH=TABLE_WIDTH
	place_window $DCHKTABLE_WIDTH+2 7 -fg $COMBO2_FG -bg $COMBO2_BG -title "$DISKCHK_ENTRY" -current 'footer "$GENERIC_FORM_FOOTER"'
	typeset wid=$CURWIN
	run_form $DCHKFID
}
