#!/bin/bash
export TEXTDOMAIN=pmusic
$APPDIR/func -reset_gtk
if [ ! "$TITLE" ]; then TITLE=""; fi

export chooser="
<window title=\"Pmusic $TITLE\" icon-name=\"pmusic\">
 <vbox>
  <chooser>
   <height>500</height><width>600</width>
   <variable>CHOOSER</variable>
  </chooser>
  $XML_CHOOSER
  <hbox>
   <button cancel></button>
   <button can-default=\"true\" has-default=\"true\" use-stock=\"true\">
    <input file icon=\"gtk-apply\"></input>
    <label>$(gettext 'Ok')</label>
    <action type=\"exit\">OK</action>
   </button>
  </hbox>
 </vbox>
</window>"
I=$IFS; IFS=""
for STATEMENTS in  $($GTKDIALOG -p chooser --center); do
eval $STATEMENTS
done
IFS=$I
if [ $EXIT = "OK" ]; then
	#check if hit is directory
	if [ "$GET_OUTDIR" = "true" ] && [ ! -d "$CHOOSER" ]; then 
		TXT1="<b>$(gettext 'You have to choose a directory')</b>"
		. $APPDIR/box_ok
		exit
	fi
fi
	