#!/bin/sh
#Lesser GPL licence v2 (http://www.fsf.org/licensing/licenses/lgpl.html)
#v3.02 Nov 2007 BK: updated. handle PET pkgs only.
#v3.99 apr2008 BK: run /usr/local/petget/pkg_chooser.sh instead of petget.
#v404 add choice of Universal Installer.
#w015 march 2009 BK: update for Woof.
#110402 added button to choose and install SFS file.
#110813 fixed package-management url.
#110814 01micko: convert script from gtkdialog2 to gtkdialog3+.
#110910 BK: get a syntax error with gtkdialog3 (patriot-e version), bump to gtkdialog4.
#120201 rodin.s: internationalized.

export TEXTDOMAINDIR=/usr/share/locale
export TEXTDOMAIN=dotpup
eval_gettext () {
  local myMESSAGE=$(gettext "$1")
  eval echo \"$myMESSAGE\"
}

. /etc/DISTRO_SPECS

#echo '#!/bin/sh' > /tmp/dotpup.sh
#echo 'cd /usr/local/Dotpup-downloader-mu05' >> /tmp/dotpup.sh
#echo 'exec /usr/local/Dotpup-downloader-mu05/start-downloader' >> /tmp/dotpup.sh
#chmod 755 /tmp/dotpup.sh

#  <text><label>If you wish, you can use Mark Ulrichs DotPup Downloader, which is a one-stop find and install application. The DotPup Downloader does not show all the information that may be present on a webpage containing DotPups, nor does it list all DotPups, but it is still very nice.</label></text>

#  <text><label>The PETget package manager can install and uninstall PET packages, and also uninstall registered DotPups.</label></text>

#  <hbox>
#   <text><label>Click button to run the DotPup Downloader:</label></text>
#   <vbox>
#    <button>
#     <input file>/usr/local/lib/X11/mini-icons/dotpup.xpm</input>
#     <action>/tmp/dotpup.sh &</action>
#     <action>EXIT:12</action>
#    </button>
#   </vbox>
#  </hbox>

# <frame Further information>
#  <text><label>It is recommended that you look through the official PETs for what you want first, for maximum compatibility. Then look at unofficial PETs. There is also an older 'DotPup' package system and you can recognise these by the '.pup' extension on the filename. For the sake of consistency and compatibility DotPup packages are discouraged, but if you want to install them, please first install the 'dotpuphandler' PET package, which enables DotPups to be installed by clicking on them in ROX-Filer. Most DotPups register with PETget, the PET package manager, so can be uninstalled by PETget, so there is some integration. There are lots of DotPups out there for historical reasons -- other than that, PET is preferable.</label></text>
# </frame>

DLG1="
<window title=\"$(gettext 'Install')\">
 <vbox>
 <text><label>`gettext \"The word 'install' can mean two different things, either to install additional applications in the current Puppy, or to install Puppy to some other media. Take your pick!\"`</label></text>
 
 <frame $(gettext 'Install Puppy')>
  <text><label>$(gettext 'Puppy can be installed to just about anything, including internal hard drive, USB drive, and Zip/LS120 diskette. If for example you are now running Puppy from live-CD and fancy booting Puppy off a USB Flash drive, this is the right place. There are two tools, the Puppy Universal Installer, and BootFlash -- the first is recommended, BootFlash is your second choice, a specialised tool if you cannot get the computer to boot from a USB drive.')</label></text>
  <hbox>
   <text><label>$(gettext 'Click button to run the Universal Installer:')</label></text>
   <vbox>
    <button>
     <input file>/usr/local/lib/X11/mini-icons/mini-ray.xpm</input>
     <action>/usr/sbin/puppyinstaller &</action>
     <action>EXIT:14</action>
    </button>
   </vbox>
  </hbox>
  <hbox>
   <text><label>$(gettext 'Click button to run BootFlash USB installer:')</label></text>
   <vbox>
    <button>
     <input file>/usr/local/lib/X11/mini-icons/mini-ray.xpm</input>
     <action>/usr/sbin/bootflash &</action>
     <action>EXIT:14</action>
    </button>
   </vbox>
  </hbox>
 </frame>

 <frame $(gettext 'Install applications')>
  <text><label>`eval_gettext \"The Puppy Package Manager is a tool for installing and uninstalling packages (applications). There are online repositories of \\\${DISTRO_BINARY_COMPAT} and Puppy packages -- the latter are known as PET packages and are identified by '.pet' on the end of their filename. Note that apart from the official \\\${DISTRO_BINARY_COMPAT} and PET repositories, Puppy enthusiasts have created many PETs at other locations, and all you need to do is download one and click on it to install it.\"`</label></text>

  <hbox>
   <text><label>$(gettext 'Click button for Package Manager introduction webpage:')</label></text>
   <vbox>
    <button>
     <input file>/usr/local/lib/X11/mini-icons/info16.xpm</input>
     <action>defaultbrowser http://puppylinux.com/development/package-management.htm & </action>
    </button>
   </vbox>
  </hbox>

  <hbox>
   <text><label>$(gettext 'Click button to run the Puppy Package Manager:')</label></text>
   <vbox>
    <button>
     <input file>/usr/local/lib/X11/mini-icons/pet16.xpm</input>
     <action>/usr/local/petget/pkg_chooser.sh &</action>
     <action>EXIT:14</action>
    </button>
   </vbox>
  </hbox>
  
  <text><label>$(gettext 'The above web link also introduces SFS files. These are application combo-packs, very easy to install and uninstall.')</label></text>
  <hbox>
   <text><label>$(gettext 'Click button to choose an SFS file from the official repo:')</label></text>
   <vbox>
    <button>
     <input file>/usr/local/lib/X11/mini-icons/pet16.xpm</input>
     <action>/usr/sbin/sfsget &</action>
     <action>EXIT:14</action>
    </button>
   </vbox>
  </hbox>
  
 </frame>
 
 </vbox>
</window>
"

echo "$DLG1" | gtkdialog4 --stdin

###END###
