# SPExtraDialog
# Gerald Banon, 1998

package provide dpi.inpe.br/banon/1998/08.02.08.56 2.1

# ----------------------------------------------------------------------

proc SPExtraDialog {t string {var1 {}} {var2 {}} {var3 {}}} {
# runs with start
	$t delete 1.0 end
	TextStyles $t
# --------------------
	if {$string == \
"the entry is empty"} {
		$t insert insert "\n\t"
		Insert $t insert \
{The entry for the${var1}preference is empty.} {} $var1
		TagAdd $t italic {${var1}} -forward $var1
		$t insert insert "\n\n\t"
		Insert $t insert \
"Please fill the entry."
	}
# --------------------
	if {$string == \
"address syntax error"} {
		$t insert insert "\n\t"
		Insert $t insert \
{Please $var1 your e-mail address.} {} $var1
		$t insert insert "\n\t"
		Insert $t insert \
{It has to be of the form: <user.name@domain.name>.}
		TagAdd $t fixed {<user.name@domain.name>}
	}
# --------------------
	if {$string == \
"port syntax error"} {
		$t insert insert "\n\t"
		Insert $t insert \
{Please $var1 your port number.} {} $var1
		$t insert insert "\n\t"
		Insert $t insert \
{It should be <80> or between <1905> and <6553>,}
		TagAdd $t fixed {<80>}
		TagAdd $t fixed {<1905>}
		TagAdd $t fixed {<6553>}
		$t insert insert "\n\t"
		Insert $t insert \
{or between <800> and <65539> and preceded by the HTTP host.}
		TagAdd $t fixed {<800>}
		TagAdd $t fixed {<65539>}
	}
# --------------------
	if {$string == \
"port in use"} {
		$t insert insert "\n\t"
		Insert $t insert \
{The port numbered <$var1> is in use by another application\
or its use is not allowed.} {} $var1
		TagAdd $t fixed {<$var1>} -forward $var1
		$t insert insert "\n\n\t"
		Insert $t insert \
"Please set a port number different from <\$var1>." {} $var2
		TagAdd $t fixed {<$var1>} -forward $var2
	}
# --------------------
	if {$string == \
"access not completed"} {
		$t insert insert "\n\t"
		Insert $t insert \
{The communication with the URLib local collection server cannot be made.}
		$t insert insert "\n\n\t"
		Insert $t insert \
{<$var1> was used as server name.} {} $var1
		TagAdd $t fixed {<$var1>} -forward $var1
		$t insert insert "\n\n\t"
		Insert $t insert \
"Please make sure that the name <\$var1> is pointing" {} $var1
		TagAdd $t fixed {<$var1>} -forward $var1
		$t insert insert "\n\t"
		Insert $t insert \
"to the IP <\$var1>." {} $var2
		TagAdd $t fixed {<$var1>} -forward $var2
	}
# --------------------
	if {$string == \
"HTTP host in use"} {
		$t insert insert "\n\t"
		Insert $t insert \
{The HTTP host <$var1> is in use by another application.} {} $var1
		TagAdd $t fixed {<$var1>} -forward $var1
		$t insert insert "\n\n\t"
		Insert $t insert \
"Please set a port number different from <\$var1>." {} $var2
		TagAdd $t fixed {<$var1>} -forward $var2
	}
# --------------------
	if {$string == \
"more than one virtual host are running"} {
		$t insert insert "\n\t"
		Insert $t insert \
{More than one virtual host are running at port <$var1>.} {} $var1
		TagAdd $t fixed {<$var1>} -forward $var1
		$t insert insert "\n\n\t"
		Insert $t insert \
"Please stop the other virtual hosts at port <\$var1> before any http port change." {} $var2
		TagAdd $t fixed {<$var1>} -forward $var2
	}
# --------------------
	if {$string == \
"a virtual host is already running"} {
		$t insert insert "\n\t"
		Insert $t insert \
{At least one virtual host is already running at port <$var1>.} {} $var1
		TagAdd $t fixed {<$var1>} -forward $var1
		$t insert insert "\n\n\t"
		Insert $t insert \
"Please stop the virtual hosts at port <\$var1> before any http port change." {} $var2
		TagAdd $t fixed {<$var1>} -forward $var2
	}
## --------------------
#	if {$string == \
#"browser not found"} {
#		$t insert insert "\n\t"
#		Insert $t insert \
#{The browser $var1 has not be found.} {} $var1
#		TagAdd $t italic {$var1} -forward $var1
#		$t insert insert "\n\n\t"
#		Insert $t insert \
#"Please install it in your file system or\
#choose another browser."
#	}
# --------------------
	if {$string == \
"searching"} {
		$t insert insert "\n\t"
		Insert $t insert \
{Searching for <$var1> in the file system ...} {} $var1
		TagAdd $t bold {...} -backward
		TagAdd $t fixed {<$var1>} -forward $var1
	}
# --------------------
	if {$string == \
"syntax error"} {
		$t insert insert "\n\t"
		Insert $t insert \
{There is a syntax error in the permission line:}
		$t insert insert "\n\n\t"
		Insert $t insert \
{${var1}} {} $var1
		TagAdd $t fixed {${var1}} -forward $var1
		$t insert insert "\n\n\t"
		Insert $t insert \
{The line should be of the form: <deny from host> or <allow from host>.}
		TagAdd $t fixed {<deny from}
		TagAdd $t fixed {<allow from}
		TagAdd $t fixed {>}
		TagAdd $t fixed {>} -backward
		TagAdd $t italic {host}
		TagAdd $t italic {host} -backward
	}
# --------------------
}
