#! /bin/sh

# The clock might be wrong and we know that we need to update the icon
# cache so we just force it.

gtk-update-icon-cache -f /usr/share/icons/hicolor

# Now that the icon cache is uptodate, we move the .desktop file into
# place.  Doing this only now prevents the Task navigator from
# reconstructing the menu before the icon is available.  This trick is
# not really necessary when using maemo-select-menu-location (as we do
# below), since maemo-select-menu-location will trigger the
# reconstructing of the Taks navigator menu as well.

if [ -f /usr/share/applications/hildon/osso-rtcom-installer.desktop ]; then
   ( cd /usr/share/applications/hildon/ && mv osso-rtcom-installer.desktop osso-rtcom-installer.inactive )
fi

# Now we are ready to let the user move the entry around, but only if
# this is a new install

oldversion="$2"

# Now we need to reboot

cat <<EOF > /tmp/request-reboot.txt
In order to complete software upgrade the device must be rebooted.
Do you want to reboot now?
EOF

maemo-confirm-text "Reboot is needed" /tmp/request-reboot.txt

if [ $? == 0 ]; then
	( sleep 6 ; mcetool --reboot ) &
fi



exit 0


