#!/bin/bash
export TEXTDOMAIN=pmusic
$APPDIR/func -reset_gtk
[ ! "$GTKDIALOG" ] && GTKDIALOG="gtkdialog" #puppy specific
if [ -z "$FRAME" ]; then FRAME=" "; fi
export WORKDIR=$HOME/.pmusic/tmp

export inputbox="
<window title=\"pMusic\" icon-name=\"pmusic\" window_position=\"2\">
 <vbox>
  <frame $FRAME>
   <pixmap icon_size=\"6\"><input file stock=\"gtk-$IMG\"></input></pixmap>
   <text use-markup=\"true\"><label>\"$TXT1\"</label></text>
   <entry activates-default=\"true\">
    <variable>INPUT</variable>
    <default>${DEFAULT}</default>
   </entry>
  </frame>
  <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>"
#make this workaround to allow `\ in filename
$GTKDIALOG -p inputbox > $WORKDIR/tmp
export INPUT="`cat $WORKDIR/tmp | grep -F 'INPUT=' | cut -d'"' -f2`" #'
export EXIT="`cat $WORKDIR/tmp | grep -F 'EXIT=' | cut -d'"' -f2`" #'
TXT1=""; DEFAULT=""; FRAME=""; IMG="" #reset to avoid alien text in next box
