#!/bin/sh

GTKDIALOG=gtkdialog

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

export DL=/usr/local/quickpet/downloader
export DL2=/usr/local/quickpet/downloader2
export ANYDESK=anydesk_5.5.6-1_amd64.pet
export CHROMIUM=chromium-83-x6_64.pet
export DISSENTER=dissenter-browser_1.5.114_amd64.pet
export FIREFOX=firefox-77.0.1-x86_64.pet
export FSEARCH=fsearch-1.1-x86_64.pet
#export GOOGLECHROME=google-chrome-70.0.3538.77-1-x86_64.pet
#export GOOGLEEARTH=google-earth-pro-stable_7.1.8.3036-r0_amd64.pet
export GOOGLEMUSIC=google-play-music-x86_64.pet
export HOTSHOTS=HotShots-2.2.0-x86_64_bionic.pet
#export KRITA=krita-4.2.9-x86_64.pet
export LUTRIS=lutris_0.5.6_amd64.pet
export MOJIBAR=mojibar-1.7.5-x86_64.pet
export MUMBLE=mumble-1.3.0-x86_64.pet
export NVIDIA340=nvidia-340.108_K5.4.53_x86_64.pet 
#export NVIDIA410=nvidia-410.93_K4.19.23_x86_64.pet
export NVIDIA450=nvidia-450.57_K5.4.53_x86_64.pet
export ODRIVE=odrive-0.2.1_x86_64.pet
export OPENHEXAGON=OpenHexagonV1.92-x86_64.pet
export PIDGIN=pidgin-2.13.0-x86_64.pet
export QEMU=qemu-5.1.0-x86_64.pet
export RAMBOX=rambox-0.7.5-linux-amd64.pet
export SEAMONKEY=seamonkey-2.53.2-x86_64.pet 
export SKYPE=skypeforlinux_64-8.40.76.32.pet
export SPOTIFY=spotify-client-1.1.26-x86_64.pet
export STEAM=steam-fossa.pet
export TARTUBE=tartube-2.1.pet
export TELEGRAM=telegram-2.0.1-x86_64.pet
export THUNDERBIRD=thunderbird-68.9.0-x86_64.pet
export TOR=tor-browser-9.5-x86_64.pet
export VIVALDI=vivaldi-2.3.1440.61-x86_64.pet
export WINE=wine64-5.5_v4.1.pet
export YOUTUBEDLG=youtube-dlg-0.4-1.pet
export ZOOM=zoom-x86_64.pet

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

MAIN_DIALOG='
<window title="Quickpet FossaPup64" icon-name="distributor-logo-puppy" window-position="1">
<vbox>
<menubar> 
  <menu>
    <menuitem tooltip-text="'"$(gettext "visit the puppy forum")"'">
         <label>"'"$(gettext "puppy forum")"'"</label>
         <action>defaultbrowser https://puppylinux.rockedge.org/index.php &</action>
    </menuitem>
    <menuitem tooltip-text="'"$(gettext "visit the Fossapup64 page on forum")"'">
         <label>"'"$(gettext "Fossapup help")"'"</label>
         <action>defaultbrowser "https://forum.puppylinux.com/viewforum.php?f=146" &</action>
    </menuitem>
    <menuitem tooltip-text="'"$(gettext "search the forum for answers")"'">
         <label>"'"$(gettext "puppylinux search")"'"</label>
         <action>defaultbrowser https://rockedge.org/psearch/ &</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>
     <menuitem tooltip-text="'"$(gettext "extra packages contributed by users")"'">
         <label>"'"$(gettext "User Contributed Packages")"'"</label>
         <action>defaultbrowser "https://forum.puppylinux.com/viewtopic.php?f=146&t=1239" &</action>
    </menuitem>
    <label>"'"$(gettext "ppm")"'"</label>
    </menu>
 <menu>
    <menuitem tooltip-text="'"$(gettext "make a bootable usb of another distro")"'">
         <label>"'"$(gettext "isobooter")"'"</label>
         <action>defaultbrowser http://www.murga-linux.com/puppy/viewtopic.php?t=67235 &</action>
    </menuitem>
    <label>"'"$(gettext "isobooter")"'"</label>
 </menu>
  <menu>
    <menuitem tooltip-text="'"$(gettext "fossapup tips and tricks")"'">
         <label>"'"$(gettext "tips & tricks")"'"</label>
         <action>defaultbrowser "https://forum.puppylinux.com/viewtopic.php?f=146&t=1238" &</action>
    </menuitem>
    <label>"'"$(gettext "Tips & Tricks")"'"</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 "Fossapup updates")"'"</label>
		        <height>32</height>
		        <width>32</width>
		        <input file icon="puppylogo48"></input>
				<action>/usr/local/quickpet/fossaupdate &</action>
				<action>exit:Exit</action>
			</button>
			<button tooltip-text="'"$(gettext "fossapup 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 https://rockedge.org/psearch/ &</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>
		</vbox>
		<vbox>
		     <button tooltip-text="'"$(gettext "install")"' firefox">
		        <label>firefox</label>
				<input file icon="firefox"></input>
				<action>$DL2 $FIREFOX &</action>
			</button>
			<button tooltip-text="'"$(gettext "install")"' seamonkey">
		        <label>seamonkey</label>
				<input file icon="seamonkey"></input>
				<action>$DL2 $SEAMONKEY &</action>
			</button>
			<button tooltip-text="'"$(gettext "install")"' opera">
		        <label>opera</label>
				<input file icon="qopera"></input>
				<action>defaultbrowser https://www.opera.com/ &</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/ &</action>
			</button>
			<button tooltip-text="'"$(gettext "install")"' vivaldi browser">
		        <label>vivaldi</label>
				<input file icon="qvivaldi"></input>
				<action>/usr/local/quickpet/vivaldi &</action>
			</button>
			<button tooltip-text="'"$(gettext "install")"' a patched chromium that has hardware acceleration">
		        <label>chromium</label>
				<input file icon="qchromium"></input>
				<action>$DL2 $CHROMIUM &</action>
			</button>
			<button tooltip-text="'"$(gettext "install")"' tor-browser">
		        <label>tor</label>
				<input file icon="qtor"></input>
				<action>$DL2 $TOR &</action>
			</button>
			<button tooltip-text="'"$(gettext "comment on every page on the internet")"' ">
		        <label>dissenter</label>
				<input file icon="qdissenter"></input>
				<action>defaultbrowser https://dissenter.com/download &</action>
			</button>
         <frame>			
		<pixmap>
			<height>70</height>
			<width>70</width>
         <input file>/usr/share/icons/PMaterial/scalable/categories/applications-internet.svg</input>
         </pixmap>
         </frame>
			</vbox>
			<vbox>
		     <button tooltip-text="'"$(gettext "install java")"'">
		        <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>$DL2 $SKYPE &</action>
			</button>
			<button tooltip-text="download google-earth">
		        <label>googleearth</label>
				<input file icon="qgoogle_earth"></input>
				<action>defaultbrowser https://www.google.co.uk/intl/en_uk/earth/versions/#earth-pro &</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")"' chirp twitter client">
		        <label>chirp</label>
		        <height>16</height>
		        <width>16</width>
				<input file icon="qchirp"></input>
				<action>sfsget &</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 "multi protocol chat client")"'">
		        <label>rambox</label>
		        <height>16</height>
		        <width>16</width>
				<input file icon="qrambox"></input>
				<action>$DL2 $RAMBOX &</action>
			</button>
			<button tooltip-text="'"$(gettext "install")"' megasync cloud storage sync">
		        <label>megasync</label>
		        <height>16</height>
		        <width>16</width>
				<input file icon="qmega"></input>
				<action>defaultbrowser https://mega.nz/sync &</action>
			</button>
				<button tooltip-text="'"$(gettext "install")"' google drive sync">
		        <label>opendrive</label>
		        <height>16</height>
		        <width>16</width>
				<input file icon="qodrive"></input>
				<action>$DL $ODRIVE &</action>
			</button>
				<button tooltip-text="'"$(gettext "setup")"' protonvpn">
		        <label>protonvpn</label>
		        <height>16</height>
		        <width>16</width>
				<input file icon="qproton"></input>
				<action>defaultbrowser "https://forum.puppylinux.com/viewtopic.php?f=85&t=1085" &</action>
			</button>
			</vbox>
			<vbox>
			<button tooltip-text="'"$(gettext "office suite")"'">
		        <label>libreoffice</label>
				<input file icon="qlibreoffice"></input>
				<action>sfsget &</action>
			</button>
			<button tooltip-text="'"$(gettext "office suite")"'">
		        <label>openoffice</label>
				<input file icon="qopenoffice"></input>
				<action>sfsget &</action>
			</button>
			<button tooltip-text="'"$(gettext "office suite")"'">
		        <label>wps-office</label>
				<input file icon="qwpsoffice"></input>
				<action>sfsget &</action>
			</button>						
			<button tooltip-text="'"$(gettext "install")"' thunderbird email">
		        <label>thunderbird</label>
				<input file icon="qthunderbird"></input>
				<action>$DL2 $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 "3D computer aided design")"'">
		        <label>freecad</label>
				<input file icon="qfreecad"></input>
				<action>sfsget &</action>
			</button>
			<button tooltip-text="'"$(gettext "desktop sharing")"'">
		        <label>anydesk</label>
				<input file icon="qanydesk"></input>
				<action>$DL2 $ANYDESK &</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")"' zoom video conferencing">
		        <label>zoom</label>
		        <height>16</height>
		        <width>16</width>
				<input file icon="qzoom"></input>
				<action>$DL $ZOOM &</action>
			</button>
				<button tooltip-text="'"$(gettext "install")"' emoji tray app">
		        <label>mojibar</label>
		        <height>16</height>
		        <width>16</width>
				<input file icon="face-smile"></input>
				<action>$DL2 $MOJIBAR &</action>
			</button>		
			</vbox>
			<vbox>
			<button tooltip-text="'"$(gettext "install")"' spotify sfs">
		        <label>spotify</label>
				<input file icon="qspotify"></input>
				<action>$DL2 $SPOTIFY &</action>
			</button>
			<button tooltip-text="'"$(gettext "screen shot and annotation tool")"'">
		        <label>hotshots</label>
				<input file icon="qhotshots"></input>
				<action>$DL $HOTSHOTS &</action>
			</button>
			<button tooltip-text="'"$(gettext "image creation and editing")"'">
		        <label>gimp</label>
				<input file icon="qgimp"></input>
				<action>sfsget &</action>
			</button>
			<button tooltip-text="'"$(gettext "image creation and editing")"'">
		        <label>krita</label>
				<input file icon="qkrita"></input>
				<action>sfsget &</action>
			</button>
			<button tooltip-text="'"$(gettext "vector image creation and editing")"'">
		        <label>inkscape</label>
				<input file icon="qinkscape"></input>
				<action>sfsget &</action>
			</button>
			<button tooltip-text="'"$(gettext "youtube downloader")"'">
		        <label>tartube</label>
				<input file icon="qyoutube"></input>
				<action>$DL2 $TARTUBE &</action>
			</button>
			<button tooltip-text="'"$(gettext "kodi media centre")"'">
		        <label>kodi</label>
				<input file icon="qkodi"></input>
				<action>sfsget &</action>
			</button>
			<button tooltip-text="'"$(gettext "video editor")"'">
		        <label>kdenlive</label>
				<input file icon="qkden"></input>
				<action>sfsget &</action>
			</button>
			<button tooltip-text="'"$(gettext "live streaming and recording")"'">
		        <label>obs-studio</label>
				<input file icon="qobs"></input>
				<action>sfsget &</action>
			</button>
			<button tooltip-text="'"$(gettext "DJ mixing")"'">
		        <label>mixxx</label>
				<input file icon="qmixxx"></input>
				<action>/usr/local/quickpet/mixxx &</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>/usr/local/quickpet/openhexagon &</action>
			</button>
			<button tooltip-text="'"$(gettext "install lutris")"'">
		        <label>lutris</label>
				<input file icon="qlutris"></input>
				<action>sfsget &</action>
			</button>
			<button tooltip-text="'"$(gettext "install steam")"'">
		        <label>steam</label>
				<input file icon="qsteam"></input>
				<action>$DL2 $STEAM &</action>
			</button>
			<frame>
			<pixmap>
			<height>100</height>
			<width>100</width>
         <input file>/usr/share/icons/PMaterial/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>$DL2 $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 the latest qemu")"'">
		        <label>qemu</label>
				<input file icon="qqemu"></input>
				<action>$DL2 $QEMU &</action>
			</button>
			<button tooltip-text="'"$(gettext "very quick search tool")"'">
		        <label>fsearch</label>
				<input file icon="find"></input>
				<action>$DL $FSEARCH &</action>
			</button>
			<button tooltip-text="'"$(gettext "gtk2 & 3 theme maker")"'">
		        <label>themix</label>
				<input file icon="gtktheme"></input>
				<action>sfsget &</action>
			</button>
				<frame>
			<pixmap>
			<height>50</height>
			<width>50</width>
         <input file>/usr/share/icons/qvincent.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>sfsget &</action>
			</button>
			<button tooltip-text="'"$(gettext "extra firmware ")"'">
		        <label>extra firmware sfs</label>
		        <input file icon="BuildingBlock"></input>
		        <action>sfsget &</action>
			</button>
        </vbox>
			<vbox>
			<hbox>
			<text><label>"'"$(gettext "Check Driver Version")"'"</label></text>
				<button tooltip-text="'"$(gettext "Check Nvidia Website")"'">
		        <label>"'"$(gettext "nvidia website")"'"</label>
		        <height>16</height>
		        <width>16</width>
		        <input file icon="qnvidia-settings"></input>
				<action>defaultbrowser https://www.nvidia.co.uk/Download/index.aspx? &</action>
			</button>
			</hbox>
			<vbox>
			<button tooltip-text="'"$(gettext "Install the proprietory nvidia graphic driver")"'">
		        <label>"'"$(gettext "nvidia 340")"'"</label>
		        <height>16</height>
		        <width>16</width>
		        <input file icon="qnvidia-settings"></input>
				<action>$DL2 $NVIDIA340 &</action>
			</button>
			<button tooltip-text="'"$(gettext "Install the proprietory nvidia graphic driver")"'">
		        <label>"'"$(gettext "nvidia 450")"'"</label>
		        <height>16</height>
		        <width>16</width>
		        <input file icon="qnvidia-settings"></input>
				<action>$DL2 $NVIDIA450 &</action>
			</button>
			</vbox>
			<frame>
			<pixmap>
			<height>70</height>
			<width>70</width>
         <input file>/usr/share/icons/qpupold.png</input>
         </pixmap>
         </frame>
			</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
