#!/bin/bash
#PupSysInfo 2.6
#GTK Stock Icons (radky)

if [ "`which gtkdialog4`" ]; then
	GTKDIALOG=gtkdialog4
elif [ "`which gtkdialog3`" ]; then
	GTKDIALOG=gtkdialog3
else
	GTKDIALOG=gtkdialog
fi

rm -f /tmp/stockicons 2>/dev/null

# define stock icons
for icon in about add apply bold cancel caps-lock-warning cdrom clear close color-picker \
connect convert copy cut  delete dialog-authentication dialog-error dialog-info \
dialog-question dialog-warning directory disconnect dnd dnd-multiple edit execute \
file find find-and-replace floppy fullscreen go-back go-down go-forward go-up \
goto-bottom goto-first goto-last goto-top harddisk help home indent index info italic \
jump-to justify-center justify-fill justify-left justify-right leave-fullscreen \
media-forward media-next media-pause media-play media-previous media-record \
media-rewind media-stop missing-image network new no ok open orientation-landscape \
orientation-portrait orientation-reverse-landscape orientation-reverse-portrait \
page-setup paste preferences print print-error print-paused print-preview \
print-report print-warning properties quit redo refresh remove revert-to-saved \
save save-as select-all select-color select-font sort-ascending sort-descending \
spell-check stop strikethrough undelete underline undo unindent yes zoom-100 \
zoom-fit zoom-in zoom-out
do
  echo -e "<item stock="'"'gtk-$icon'"'">gtk-"$icon"</item>" >> /tmp/stockicons
done

STOCKICONS=$(cat /tmp/stockicons)

# main dialog
export STOCK_ICONS='<window title="GTK Stock Icons" icon-name="gtk-about" window-position="1">
 <vbox>
  <frame Icons & IDs>
   <tree rules_hint="true" headers-visible="false"><height>400</height><width>250</width>
     '"$STOCKICONS"'
   </tree>
  </frame>
  <hbox homogeneous="true">
   <button width-request="80" use-underline="true">
     <label>"_Close"</label>
     <action type="exit">quit_now</action>
   </button>
  </hbox>
 </vbox>
</window>'

$GTKDIALOG --program=STOCK_ICONS
unset STOCK_ICONS

exit 0
