#! /bin/sh -e

THEMEDIR='/usr/share/themes/cloudy-blue-sky'

if [ ! -d $THEMEDIR ]; then
  exit 0
fi
	  
Q=`run-standalone.sh zenity  --list  --text "Would you like to install the customized transitions as well?\n The transitions are applyed only if this theme is used." --radiolist  --column "Pick" --column "Transition" TRUE "Install custom transitions" FALSE "Don't install custom transitions"; echo $ans`

if [ "$Q" = "Install custom transitions" ]; then
      # install the custom things
     	cp -rf /usr/share/themes/Blue-sky/transitions.custom /usr/share/themes/Blue-sky/transitions.ini

else

	rm -rf /usr/share/themes/Blue-sky/transitions.ini

fi


Q2=`run-standalone.sh zenity --question --text="Do you like this theme?\n If yes, please vote it to extras. \n Note: Selecting the vote button, the browser will automatically open the Cloudy Blue Sky package webpage. If the package is allready in extras you may not be able to vote.\n Thank you!" --ok-label=Vote; echo $?`

if [ "$Q2" = "0" ]; then
	dbus-send --system --type=method_call --dest=com.nokia.osso_browser /com/nokia/osso_browser/request com.nokia.osso_browser.load_url string:"maemo.org/packages/view/cloudy-blue-sky/"

fi

hildon-theme-cacher $THEMEDIR
exit 0

