#! /bin/bash

export delete_box="
<window title=\"Pschedule\" allow-grow=\"false\">
 <vbox>
  <frame $(gettext 'Delete')>
   <pixmap icon_size=\"6\"><input file stock=\"gtk-clear\"></input></pixmap>
   <text use-markup=\"true\"><label>\"<b>$(gettext 'Delete selected task?')</b>\"</label></text>
  </frame>
  <hbox>
   <button no></button>
   <button yes></button>
  </hbox>
 </vbox>
</window>"
I=$IFS; IFS=""
for STATEMENTS in  $(gtkdialog -p delete_box --center); do
	eval $STATEMENTS
done
IFS=$I
if [ "$EXIT" = "Yes" ]; then
	NUM=`echo $TREE | cut -d ":" -f 1`
	sed -i -e "${NUM},${NUM}d" /var/local/cron/crontabs/$USER #150401
	PS="`busybox ps`" #150401
	kill `echo "$PS" | grep 'crond' | sed -e 's%^ %%g' | cut -f 1 -d ' ' | tr '\n' ' '` 2>/dev/null #150401
	busybox crond -c /var/local/cron/crontabs #restart cron 150401
fi
