#!/bin/sh
#
# NAME
#     tsconf - show the dialog for editing the properties file
#
# SYNOPSIS
#     tsconf
#
# AUTHOR: 
#     Jan-Henrik Haukeland, hauk@tildeslash.com
#
# CVS INFO
#     $Id: tsconf.sh,v 1.3 1999/11/28 06:02:56 hauk Exp $


# We respect JAVA_HOME if it's defined. But please note, JAVA_HOME
# must point to a jdk1.1.7x version *not* a jdk1.2 version. (The swing
# packages in jdk1.2 have to many bugs that affects the tsbiff
# program)
if [ -z "${JAVA_HOME}" ] ; then
        echo "JAVA_HOME environment variable not set." 1>&2 
        exit 1
else 
    CLASSPATH=${JAVA_HOME}/lib/classes.zip
fi


TS_HOME=`dirname ${0}`/..
PRG_NAME=`basename ${0}`

TS_JAR=${TS_HOME}/lib/tsbiff.jar
SWING_JAR=${TS_HOME}/lib/swing.jar


# --------------------------------------------------------------------- #


if [ -f "${TS_JAR}" ] ; then
	CLASSPATH=${CLASSPATH}:${TS_JAR}
else
	echo "Could not find tsbiff classes in ${TS_JAR}" 1>&2 
	exit 1
fi



if [ -f "${SWING_JAR}" ] ; then
	CLASSPATH=${CLASSPATH}:${SWING_JAR}
else
	echo "Could not find swing classes in ${SWING_JAR}" 1>&2 
	exit 1
fi

# --------------------------------------------------------------------- #

TSBIFF_CMD="${JAVA_HOME}/bin/java -mx8m -classpath ${CLASSPATH} \
             ts.config.Configure"

# --------------------------------------------------------------------- #

case "$1" in
  -h|--help|help)
        echo "Usage: ${PRG_NAME} - Start the configuration utility"
	exit 0
        ;;
  *)
	exec ${TSBIFF_CMD}
        ;;
esac

exit 0
