#!/bin/sh

GTKDIALOG=gtkdialog

#export TMPDIR=/tmp/gtkdialog/examples/"`basename $0`"
#mkdir -p "$TMPDIR"

export DL=/usr/local/quickpet/downloader
export CONKY=conky-1.9.0.pet
export FIREFOX=firefox-57.0-i386.pet
export GOGGLESMM=gogglesmm-1.1.9-i386.pet
export GOOGLEEARTH=google-earth-pro-stable_7.1.8.3036-r0_i386.pet
export GOOGLEMUSIC=google_music_manager-i386.pet
export NVIDIA340=nvidia-340.104-K4.4.95-i386.pet
export NVIDIA380=nvidia-384.98-K4.4.95-i386.pet
export PIDGIN=pidgin-2.12.0-i686.pet
export RAMBOX=rambox-0.5.13-i386.pet
export SEAMONKEY=seamonkey-2.49.1-i386.pet 
export SLIMJET=slimjet-15.1.6.0-i686.pet
export SPOTIFY=spotify_client-1.0.66.478-i386.pet
export STEAM=steam.pet
export THUNDERBIRD=thunderbird-52.4.0-i386.pet
export TOR=tor-browser-7.0.9-i686.pet
export TORIBASH=toribash-3.5.0.pet
export WINE=wine-2.20_v3.2.pet

export TEXTDOMAIN=quickpet
export OUTPUT_CHARSET=UTF-8
. gettext.sh 

MAIN_DIALOG='
<window title="Quickpet xenial" window-position="1">
	<vbox>
	<menubar> 
  <menu>
    <menuitem tooltip-text="'"$(gettext "visit the puppy forum")"'">
         <label>"'"$(gettext "puppy forum")"'"</label>
         <action>defaultbrowser http://www.murga-linux.com/puppy/ &</action>
    </menuitem>
    <menuitem tooltip-text="'"$(gettext "visit xenialpup page on forum")"'">
         <label>"'"$(gettext "xenialpup help")"'"</label>
         <action>defaultbrowser http://murga-linux.com/puppy/viewtopic.php?t=106479 &</action>
    </menuitem>
    <menuitem tooltip-text="'"$(gettext "search the forum for answers")"'">
         <label>"'"$(gettext "puppylinux search")"'"</label>
         <action>defaultbrowser http://puppylinux.org/wikka/PuppyLinuxSearchEngine &</action>
    </menuitem>
    <menuitem tooltip-text="'"$(gettext "see bug fixes so far")"'">
         <label>"'"$(gettext "installed bugfixes")"'"</label>
         <action>/usr/local/quickpet/bugfixes &</action>
    </menuitem>
    <menuitem>
         <label>"'"$(gettext "woof-woof")"'"</label>
         <action>aplay /usr/share/audio/2barks.wav &</action>
    </menuitem>
    <label>"'"$(gettext "help")"'"</label>
    </menu>
         <menu>
    <menuitem tooltip-text="'"$(gettext "open the puppy package manager")"'">
         <label>"'"$(gettext "puppy package manager")"'"</label>
         <action>ppm &</action>
    </menuitem>
    <label>"'"$(gettext "PPM")"'"</label>
    </menu>
    </menubar>
		<notebook labels="'"$(gettext "Info|Browsers|Net|office|A&V|Fun|Useful|Drivers")"'">
			<vbox>
         <text><label>"'"$(gettext "Welcome to Quickpet")"'"</label></text>
         <text><label>-------------------</label></text>
         	<text><label>"'"$(gettext "Quickpet enables you to install popular apps quickly.")"'"</label></text>
			<text><label>"'"$(gettext "more apps can be found in the puppy package manager")"'"</label></text>
			<text><label>-------------------</label></text>
			<button tooltip-text="'"$(gettext "install the latest updates & bug fixes")"'">
		        <label>"'"$(gettext "xenialpup updates")"'"</label>
		        <height>32</height>
		        <width>32</width>
		        <input file icon="qsearch"></input>
				<action>/usr/local/quickpet/xenialupdate &</action>
				<action>exit:Exit</action>
			</button>
			<button tooltip-text="'"$(gettext "xenialpup allows easy changing of 
kernels")"'">
		        <label>"'"$(gettext "change kernel")"'"</label>
		        <height>32</height>
		        <width>32</width>
		        <input file icon="application-kernel"></input>
				<action>change_kernels &</action>
			</button>
			<button tooltip-text="'"$(gettext "search the forum for answers")"'">
		        <label>"'"$(gettext "puppy search engine")"'"</label>
		        <height>32</height>
		        <width>32</width>
		        <input file icon="find"></input>
				<action>defaultbrowser http://puppylinux.org/wikka/PuppyLinuxSearchEngine &</action>
			</button>
			<button tooltip-text="'"$(gettext "chat live with other users")"'">
		        <label>"'"$(gettext "live puppy chat")"'"</label>
		        <height>32</height>
		        <width>32</width>
		        <input file icon="chat"></input>
				<action>exec defaultchat &</action>
			</button>
		    <text><label>-------------------</label></text>
            <text><label>"'"$(gettext "XenialPup-7.5")"'"</label></text>
			</vbox>
			<vbox>
		     <button tooltip-text="'"$(gettext "install")"' firefox">
		        <label>firefox</label>
				<input file icon="firefox"></input>
				<action>$DL $FIREFOX &</action>
			</button>
			<button tooltip-text="'"$(gettext "install")"' seamonkey">
		        <label>seamonkey</label>
				<input file icon="seamonkey"></input>
				<action>$DL $SEAMONKEY &</action>
			</button>
			<button tooltip-text="'"$(gettext "install")"' opera">
		        <label>opera</label>
				<input file icon="qopera"></input>
				<action>/usr/local/quickpet/opera &</action>
			</button>
			<button tooltip-text="'"$(gettext "install")"' vivaldi browser">
		        <label>vivaldi</label>
				<input file icon="qvivaldi"></input>
				<action>defaultbrowser https://vivaldi.com/ &</action>
			</button>
			<button tooltip-text="'"$(gettext "install")"' tor-browser">
		        <label>tor</label>
				<input file icon="qtor"></input>
				<action>$DL $TOR &</action>
			</button>
			<button tooltip-text="'"$(gettext "install")"' slimjet">
		        <label>slimjet</label>
				<input file icon="qslimjet"></input>
				<action>$DL $SLIMJET &</action>
			</button>
			<frame>
			<pixmap>
			<height>75</height>
			<width>75</width>
         <input file>/usr/share/icons/qpuppylogo48.png</input>
         </pixmap>
         </frame>
			</vbox>
			<vbox>
		     <button tooltip-text="'"$(gettext "install the latest java from the puppy forum")"'">
		        <label>java</label>
		        <height>16</height>
		        <width>16</width>
				<input file icon="qjava"></input>
				<action>sfsget &</action>
			</button>
			<button tooltip-text="flash installer">
		        <label>flash</label>
		        <height>16</height>
		        <width>16</width>
				<input file icon="qflash"></input>
				<action>getflash &</action>
			</button>
			<button tooltip-text="'"$(gettext "install")"' skype">
		        <label>skype</label>
		        <height>16</height>
		        <width>16</width>
				<input file icon="qskype"></input>
				<action>defaultbrowser https://login.skype.com/login &</action>
			</button>
				<button tooltip-text="'"$(gettext "install")"' dropbox">
		        <label>dropbox installer</label>
		        <height>16</height>
		        <width>16</width>
				<input file icon="qdropbox"></input>
				<action>/usr/local/quickpet/dropbox &</action>
			</button>
			<button tooltip-text="'"$(gettext "install")"' pidgin chat client">
		        <label>pidgin</label>
		        <height>16</height>
		        <width>16</width>
				<input file icon="qpidgin"></input>
				<action>$DL $PIDGIN &</action>
			</button>
			<button tooltip-text="'"$(gettext "install")"' tixati torrent client">
		        <label>tixati</label>
		        <height>16</height>
		        <width>16</width>
				<input file icon="qtixati"></input>
				<action>defaultbrowser https://www.tixati.com/download/ &</action>
			</button>
			<button tooltip-text="'"$(gettext "keep track of your broadband & network date usage")"'">
		        <label>bitmeter OS</label>
		        <height>16</height>
		        <width>16</width>
				<input file icon="qbitmeter"></input>
				<action>/usr/local/quickpet/bitmeter &</action>
			</button>
			<button tooltip-text="'"$(gettext "multi protocol chat client")"'">
		        <label>rambox</label>
		        <height>16</height>
		        <width>16</width>
				<input file icon="qrambox"></input>
				<action>$DL $RAMBOX &</action>
			</button>
			</vbox>
			<vbox>
				<button tooltip-text="'"$(gettext "install")"' libreoffice">
		        <label>libreoffice</label>
				<input file icon="qlibreoffice"></input>
				<action>sfsget &</action>
			</button>
			<button tooltip-text="'"$(gettext "install")"' thunderbird email">
		        <label>thunderbird</label>
				<input file icon="qthunderbird"></input>
				<action>&DL $THUNDERBIRD &</action>
			</button>
			<button tooltip-text="'"$(gettext "install the latest calibre ebook reader")"'">
		        <label>calibre</label>
				<input file icon="qcalibre"></input>
				<action>/usr/local/quickpet/calibre &</action>
			</button>
			</vbox>
			<vbox>
			<button tooltip-text="'"$(gettext "upload and manage upto 20,000 tracks to the cloud")"'">
		        <label>google music manager</label>
				<input file icon="qgooglemusic"></input>
				<action>$DL $GOOGLEMUSIC  &</action>
			</button>
			<button tooltip-text="'"$(gettext "desktop app for google music")"'">
		        <label>google music player</label>
				<input file icon="qgmusic"></input>
				<action>defaultbrowser https://www.googleplaymusicdesktopplayer.com/ &</action>
			</button>
			<button tooltip-text="'"$(gettext "install")"' spotify sfs">
		        <label>spotify</label>
				<input file icon="qspotify"></input>
				<action>$DL $SPOTIFY &</action>
			</button>
			<button tooltip-text="'"$(gettext "screen shot and annotation tool")"'">
		        <label>hotshots</label>
				<input file icon="qhotshots"></input>
				<action>/usr/local/quickpet/hotshots &</action>
			</button>
			<button tooltip-text="download google-earth">
		        <label>googleearth</label>
				<input file icon="qgoogle_earth"></input>
				<action>$DL $GOOGLEEARTH &</action>
			</button>
			<button tooltip-text="'"$(gettext "music player/manager")"'">
		        <label>gogglesmm</label>
				<input file icon="qgogglesmm"></input>
				<action>$DL $GOGGLESMM &</action>
			</button>
			<button tooltip-text="'"$(gettext "kodi media centre")"'">
		        <label>kodi</label>
				<input file icon="qkodi"></input>
				<action>sfsget &</action>
			</button>
			</vbox>
			<vbox>
			<button tooltip-text="'"$(gettext "3D turnbased fighting with ragdoll physics")"'">
		        <label>toribash</label>	        
				<input file icon="qtorribash"></input>
				<action>$DL $TORIBASH &</action>
			</button>
			<button tooltip-text="'"$(gettext "incredibly hard reaction game")"'">
		        <label>open hexagon</label>
				<input file icon="qopenhexagon"></input>
				<action>/usr/local/quickpet/openhexagon &</action>
			</button>
			<button tooltip-text="'"$(gettext "install steam")"'">
		        <label>steam</label>
				<input file icon="qsteam"></input>
				<action>$DL $STEAM &</action>
			</button>
			<frame>
			<pixmap>
			<height>100</height>
			<width>100</width>
         <input file>/usr/share/icons/Puppy Standard/scalable/categories/game.svg</input>
         </pixmap>
         </frame>
            </vbox>
			<vbox>
         <button tooltip-text="'"$(gettext "run windows programs")"'">
		        <label>wine</label>
				<input file icon="qwine"></input>
				<action>$DL $WINE &</action>
			</button>
			<button tooltip-text="'"$(gettext "install the latest virtualbox")"'">
		        <label>virtualbox</label>
				<input file icon="qvirtualbox"></input>
				<action>/usr/local/quickpet/virtualbox &</action>
			</button>
			<button tooltip-text="'"$(gettext "install the latest vmware player")"'">
		        <label>vmware</label>
				<input file icon="qvmware"></input>
				<action>/usr/local/quickpet/vmware &</action>
			</button>
			<button tooltip-text="'"$(gettext "install conky system monitor")"'">
		        <label>conky</label>
				<input file icon="graph"></input>
				<action>$DL $CONKY &</action>
			</button>
				<frame>
			<pixmap>
			<height>80</height>
			<width>80</width>
         <input file>/usr/share/icons/qpupster.png</input>
         </pixmap>
			</frame>
				<button tooltip-text="'"$(gettext "install devx developer package (contains gcc compiler)")"'">
		        <label>devx</label>
		        <input file icon="qsfs"></input>
		        <action>sfsget &</action>
			</button>
			<button tooltip-text="'"$(gettext "install kernel sources ")"'">
		        <label>kernel src</label>
		        <input file icon="qkernel"></input>
		        <action>sfsget &</action>
			</button>
			<button tooltip-text="'"$(gettext "extra firmware ")"'">
		        <label>extra firmware sfs</label>
		        <input file icon="BuildingBlock"></input>
		        <action>defaultbrowser http://murga-linux.com/puppy/viewtopic.php?t=97276 &</action>
			</button>
        </vbox>
			<vbox>
			<button tooltip-text="'"$(gettext "Install proprietory nvidia graphic driver")"'">
		        <label>"'"$(gettext "nvidia 340")"'"</label>
		        <height>32</height>
		        <width>32</width>
		        <input file icon="qnvidia-settings"></input>
				<action>$DL $NVIDIA340 &</action>
			</button>
			<button tooltip-text="'"$(gettext "Install proprietory nvidia graphic driver")"'">
		        <label>"'"$(gettext "nvidia 380")"'"</label>
		        <height>32</height>
		        <width>32</width>
		        <input file icon="qnvidia-settings"></input>
				<action>$DL $NVIDIA380 &</action>
			</button>
			<frame>
			<pixmap>
			<height>90</height>
			<width>90</width>
         <input file>/usr/share/icons/qpupold.png</input>
         </pixmap>
         </frame>
         <button tooltip-text="'"$(gettext "check your driver version")"'">
		        <label>"'"$(gettext "check which driver you need")"'"</label>
		        <height>32</height>
		        <width>32</width>
		        <input file icon="qnvidia-settings"></input>
				<action>defaultbrowser  http://www.nvidia.co.uk/Download/index.aspx?lang=en-uk &</action>
			</button>
			</vbox>
		</notebook>
		<hbox>
			<button cancel></button>
			</hbox>
	</vbox>
</window>'
GUI="
<window>
 <vbox>
  <menubar>
   ...
  </menubar>
 </vbox>
 <action signal=\"hide\">exit:Exit</action>
</window>"
export MAIN_DIALOG

case $1 in
	-d | --dump) echo "$MAIN_DIALOG" ;;
	*) $GTKDIALOG --program=MAIN_DIALOG ;;
esac