#!/bin/sh

chown -R user.users /home/user/.quickclip/
chown -R user.users /home/user/MyDocs/Quick_Clip/

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

echo "A reboot is required to complete the plugin insallation. Remember to reboot
after the installation is finished." > /tmp/qc_reboot.txt

/usr/bin/maemo-confirm-text "Reboot Required" /tmp/qc_reboot.txt

if [ -d "$HOME/.quickclip/data/" ]; then

   echo "There have been a few major changes in where and how Quick Clip stores data
   in this version (.0.4.4), so if you are upgrading from version 0.3.1 or earlier
   please read this carefully. If this is the first time you've installed Quick Clip,
   or you're upgrading from a 0.4.x release, you can skip right over this.

   There have been two major changes: Quick Clip's new default storage directory is
   /home/user/MyDocs/Quick_Clip/ instead of /home/user/.quickclip/data/. This means that
   a folder called Quick_Clip should appear directly under the name of your device
   in Nokia's File Manager. This allows you to easily access your clippings with 3rd
   party programs. If you are using the default storage path, it is recommended that
   you move your files to the new default directory. If you are using a custom
   storage path, you shouldn't need to do anything but re-enter it in the settings
   dialog.

   In addition to that, the format that the names of your Target Files are stored in
   has changed. This means that after installion of this version, Quick Clip's menu
   will be reset to the original defaults of Example File 1, Example File 2 and Ect.
   This DOES NOT mean your clipped files have been deleted. It just means that Quick
   Clip is unsure of their names. To set up Quick Clip like it was before this upgrade,
   just re-enter the names of your files word-for-word like they were before. But
   make sure you enter them exactly like they were, even a small change (like case
   differences), will cause Quick Clip to create a new file and not re-use the old ones. 
   After doing this, Quick Clip should be ready to use.

   If you need to reference this text again, it is always accessible via
   Help > Quick Clip > Upgrading." > /tmp/qc_upgrade.txt

   /usr/bin/maemo-confirm-text "Upgrade Warning" /tmp/qc_upgrade.txt

fi