#/bin/bash
uic=/usr/lib/qt2/bin/uic

echo -e "baking up the ui files....\c"

cp *.ui ./bak

echo "  done!"

echo -e "compiling ui files, using: $uic ...\c"

#$uic -tr i18n coption.ui -o coptions.h
#$uic -tr i18n coption.ui -i coptions.h -o coptions.cpp
#$uic -tr i18n rpmwidget.ui -o rpmwidget.h
#$uic -tr i18n rpmwidget.ui -i rpmwidget.h -o rpmwidget.cpp
#$uic -tr i18n rpmbuildwidget.ui -o rpmbuildwidget.h
#$uic -tr i18n rpmbuildwidget.ui -i rpmbuildwidget.h -o rpmbuildwidget.cpp
$uic -tr i18n logwidget.ui -o logview.h
$uic -tr i18n logwidget.ui -i logview.h -o logview.cpp
#$uic -tr i18n fileview.ui -o fileviewwidget.h
#$uic -tr i18n fileview.ui -i fileviewwidget.h -o fileviewwidget.cpp

echo "  done!"

if [ $# == 1 ]; then
  if [ "$1" == "--move" ]; then 
    echo -e "moving files to parent dirctory ...\c"
    mv *.cpp *.h ../
    echo "  done!"
  fi
fi

echo "all done!"
