#!/bin/sh

# Q7Z Nautilus script
#
# AUTHOR: Chris Giles
# VERSION: 0.1

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

if which $APPLICATION.pyw 2> /dev/null
then
	#$APPLICATION.pyw ed "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
	$APPLICATION.pyw ed "$@"
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
