#!/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-x86_64.pet
export COREBIRD=corebird-0.9-x86_64.pet
export FIREFOX=firefox-57.0-x86_64.pet
export GOGGLESMM=gogglesmm-1.1.9-x86_64.pet
export GOOGLEEARTH=google-earth-pro-stable_7.1.8.3036-r0_amd64.pet
export GOOGLEMUSIC=google_music_manager-x86_64.pet
export KRITA=krita-3.1.1-x86_64.pet
export MUMBLE=mumble-1.3.0-x86_64.pet
export MUSESCORE=musescore-2.0.3-x86_64.pet
export NVIDIA340=nvidia-340-K4.9.58-x86_64.pet 
export NVIDIA380=nvidia-384.98-K4.9.58-x86_64.pet
export NVIDIA440=nvidia-glx-440.64-k4.9.58-64.pet
export OPENSHOT=openshot-v2.4.1-x86_64.pet
export OPENHEXAGON=OpenHexagonV1.92-x86_64.pet
export PIDGIN=pidgin-2.12.0-x86_64.pet
export QCAD=qcad-3.15.3-x86_64.pet
export RAMME=ramme-2.3.0-x86_64.pet
export RAMBOX=rambox-0.5.13-x86_64.pet
export SCRIBUS=scribus-1.5.3-x86_64.pet
export SEAMONKEY=seamonkey-2.49.1-x86_64.pet 
export SPOTIFY=spotify_client-1.0.66.478-x86_64.pet
export STEAM=steam.pet
export THUNDERBIRD=thunderbird-52.4.0-x86_64.pet
export TOR=tor-browser-7.0.7-x86_64.pet
export WATERFOX=waterfox-55.2.2-x86_64.pet

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

MAIN_DIALOG='
<window title="Quickpet xenial64" 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 xenialpup64 page on forum")"'">
         <label>"'"$(gettext "xenialpup help")"'"</label>
         <action>defaultbrowser http://murga-linux.com/puppy/viewtopic.php?t=107331 &</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 "XenialPup64-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")"' google-chrome">
		        <label>google-chrome</label>
				<input file icon="chrome"></input>
				<action>defaultbrowser https://www.google.com/chrome/browser/desktop/index.html &</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")"' waterfox">
		        <label>waterfox</label>
				<input file icon="qwaterfox"></input>
				<action>$DL $WATERFOX &</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://www.skype.com/en/get-skype/ &</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")"' instagram desktop client">
		        <label>ramme</label>
		        <height>16</height>
		        <width>16</width>
				<input file icon="qramme"></input>
				<action>$DL $RAMME &</action>
			</button>
			<button tooltip-text="'"$(gettext "install")"' twitter desktop client">
		        <label>corebird</label>
		        <height>16</height>
		        <width>16</width>
				<input file icon="qcorebird"></input>
				<action>$DL $COREBIRD &</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/linux.html &</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 "low latency voice chat")"'">
		        <label>mumble</label>
		        <height>16</height>
		        <width>16</width>
				<input file icon="qmumble"></input>
				<action>$DL $MUMBLE &</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>
			<button tooltip-text="'"$(gettext "install scribus desktop publishing")"'">
		        <label>scribus</label>
				<input file icon="qscribus"></input>
				<action>$DL $SCRIBUS &</action>
			</button>
			<button tooltip-text="'"$(gettext "install texstudio LaTeX editor")"'">
		        <label>texstudio</label>
				<input file icon="qtexstudio"></input>
				<action>sfsget &</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 "computer aided design")"'">
		        <label>qcad</label>
				<input file icon="qqcad"></input>
				<action>$DL $QCAD &</action>
			</button>
			<button tooltip-text="'"$(gettext "openshot video editor")"'">
		        <label>openshot</label>
				<input file icon="qopenshot"></input>
				<action>$DL $OPENSHOT &</action>
			</button>
			<button tooltip-text="'"$(gettext "image creation and editing")"'">
		        <label>krita</label>
				<input file icon="qkrita"></input>
				<action>$DL $KRITA &</action>
			</button>
			<button tooltip-text="'"$(gettext "music composition and notation software")"'">
		        <label>musescore</label>
				<input file icon="qmusescore"></input>
				<action>$DL $MUSESCORE &</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>/usr/local/quickpet/toribash &</action>
			</button>
			<button tooltip-text="'"$(gettext "incredibly hard reaction game")"'">
		        <label>open hexagon</label>
				<input file icon="qopenhexagon"></input>
				<action>$DL $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>/usr/local/quickpet/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 "install the 32bit compatibility sfs ")"'">
		        <label>32bit compatibility sfs</label>
		        <input file icon="q32"></input>
		        <action>/usr/local/quickpet/32bit &</action>
			</button>
			<button tooltip-text="'"$(gettext "extra firmware ")"'">
		        <label>extra firmware sfs</label>
		        <input file icon="BuildingBlock"></input>
		        <action>defaultbrowser http://www.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>
			<button tooltip-text="'"$(gettext "Install proprietory nvidia graphic driver")"'">
		        <label>"'"$(gettext "nvidia 440")"'"</label>
		        <height>32</height>
		        <width>32</width>
		        <input file icon="qnvidia-settings"></input>
				<action>$DL $NVIDIA440 &</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
