#!/bin/bash
export TEXTDOMAIN=pfilesearch #for gettext

if [ -z "$IMG" ]; then IMG="dialog-error"; fi
if [ -z "$FRAME" ]; then FRAME="$(gettext 'Error')"; fi

case $TXT1 in
	LOC0311) TXT1=$(gettext "If wanted, there can be several searchpaths.

Separate paths with <b>[OR]</b>: '/mnt/ [OR] /root/'.
'./' is used to specify current path.")
	;;
	LOC0312) TXT1=$(gettext "Searching for 'text in file' is MUCH slower than 'filename'.

Regular expressions works only when searching for filenames (not Text in file).

If having problems with local chars, use ? instead of char.")
	;;
	LOC0313) TXT1=$(gettext "To define an exact search, you can use the terms:

<b>[OR]</b> Filename/content must contain either 'this [OR] that'. This will give more results.

<b>[AND]</b> Filename/content must contain both 'this [AND] that'. This will give less results.

<b>*</b> Means anything. 'pup*back' finds both 'PuppyBackup' and 'Puppies are back'.

<b>?</b> Means any char. 'pup??back' finds only 'PuppyBackup'. '??' represent only two chars.")
	;;
	LOC0314) TXT1=$(gettext "format: MM/DD/YYYY. 
<b>atime</b> - day file was accessed.
<b>ctime</b> - day file changed 
(The actual content of file has changed).
<b>mtime</b> - day inode was modified
  (The attributes or status of file has changed - date, permissions...).")
	;;
	LOC0315) TXT1=$(gettext "<b>1k</b> = 1 kilobyte (small k).
<b>1M</b> = 1 megabyte (big M).
<b>1G</b> = 1 gigabyte (big G).")
	;;
	LOC0316) TXT1=$(gettext "Define a directory, and it will NOT be in the searchpath. Setting works recursively.")
	;;
	LOC0317) TXT1=$(gettext "If wanted, there can be several searchpaths.
Separate paths with <b>[OR]</b>: '/mnt/ [OR] /root/'.
You can use './' to specify current path.")
	;;
	LOC0318) TXT1=$(gettext 'Define a directory, and it will NOT be in the searchpath. Setting works recursively.')
	;;
esac


export ok_box="
<window title=\"pfilesearch\" icon-name=\"gtk-find\">
 <vbox>
  <frame $FRAME>
   <pixmap icon_size=\"6\"><input file stock=\"gtk-$IMG\"></input></pixmap>
   <text use-markup=\"true\"><label>\"$TXT1\"</label></text>
   <text><label>\"$TXT2\"</label></text>
  </frame>
  <hbox>
   <button can-default=\"true\" has-default=\"true\" use-stock=\"true\">
    <input file icon=\"gtk-apply\"></input>
    <label>$(gettext 'Ok')</label>
   </button>
  </hbox>
 </vbox>
</window>"
gtkdialog -p ok_box --center
TXT1=""; TXT2=""; IMG=""; FRAME="" #reset to avoid alien values in next box