#!/bin/sh

# PeaZip Nautilus script
#
# AUTHOR: Giorgio Tani, basing on Gias Kay Lee modification of Chris Giles' script
# VERSION: 0.2

APPLICATION="PeaZip"
TITLE="Error"
MESSAGE="Could not find the $APPLICATION executable."

if which peazip 2> /dev/null
then
	peazip -add2archive "$@"
else
	# Show an error message
	if which nautilus-error-dialog; then
		nautilus-error-dialog --title "$TITLE" --message "$MESSAGE"
	elif which gdialog; then
		gdialog --title "$TITLE" --msgbox "$MESSAGE" 20 100
	elif which kdialog; then
		kdialog --title "$TITLE" --msgbox "$MESSAGE"
	elif which gxmessage; then
		gxmessage -buttons OK -title "$TITLE" "$MESSAGE"
	elif which xmessage; then
		xmessage -buttons OK -title "$TITLE" "$MESSAGE"
	fi
fi
