2008-05-19 00:27:29 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2008-05-20 08:24:52 +02:00
|
|
|
# usage: make_widget LineEdit
|
2008-05-19 00:27:29 +02:00
|
|
|
|
|
|
|
LOWERNAME=`echo $1 | tr [:upper:] [:lower:]`
|
|
|
|
NAME=$1
|
2008-05-21 00:36:28 +02:00
|
|
|
CAPNAME=`echo $1 | tr [:lower:] [:upper:]`
|
2008-05-19 00:27:29 +02:00
|
|
|
NATIVE="Q${NAME}"
|
|
|
|
HEADER="${LOWERNAME}.h"
|
|
|
|
SOURCE="${LOWERNAME}.cpp"
|
|
|
|
BOTH="$HEADER $SOURCE"
|
|
|
|
QHEADER="Q${HEADER}"
|
|
|
|
|
|
|
|
cp template.h $HEADER
|
|
|
|
cp template.cpp $SOURCE
|
|
|
|
|
|
|
|
perl -pi -e "s,<Name>,${NAME},g" $BOTH
|
|
|
|
perl -pi -e "s,<NAME>,${CAPNAME},g" $BOTH
|
|
|
|
perl -pi -e "s,<name>,${LOWERNAME},g" $BOTH
|
|
|
|
perl -pi -e "s,<Native>,$NATIVE,g" $BOTH
|
|
|
|
|
2008-05-19 11:31:40 +02:00
|
|
|
echo "#include \"../../plasma/${HEADER}\"" > ../includes/${NAME}
|
2008-05-19 00:27:29 +02:00
|
|
|
|
2008-05-19 01:11:44 +02:00
|
|
|
svn add ../includes/${NAME} $BOTH
|
2008-05-19 00:27:29 +02:00
|
|
|
|