window:
	res:
		windowType	wstandard
	endres:
endwindow:
close:
	res:
		bitmapPath	$(bitmaps)
		bitmapFile	CLOSE::CBM
	endres:
endclose:
title:
	res:
		leftLabel	|g̑I
		leftKanjiFont	$(kanjiFont)
		leftFont	$(kanaFont)
		switch $(COLOR)
			case MONO:
				bitmapPath	$(bitmaps)
				backgroundFile	GRAY3
				transparent	false
				break
		endswitch
	endres:
endtitle:
dialog: dialogs
	res:
		defaultDistance		#(fWidth)
		dialogType		modeless
		defaultButton		select
	endres:
	ditem: host_list
		res:
			itemType	scrtext
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
			width		#(fWidth)+1*20
			height		#(lHeight)*7+8
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			bind1		host_select1
			bind2		host_select2
			file		/dev/null
		endres:
		act:
			put $(line)
			put $(line)@0 $(TMP_HOST1)
		endact:
	endditem:
	ditem: select
		res:
			itemType	button
			fromVert	host_list
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
			label		' I@ '
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
		endres:
		act:
			put $(TMP_HOST1) $(TMP_HOST)
			job host_select
		endact:
	endditem:
enddialog:
proc: pre
	$(TMP) = mktemp
	put /tmp/$(TMP) $(LIST)
	$(TMP) = mktemp
	put /tmp/$(TMP) $(SORT_LIST)
	put '' $(remote_host)
	$(bin)/Snet_check -lhm > $(SORT_LIST)
	sort -u -t\ +0.2 $(SORT_LIST) > $(LIST)
endproc:
proc: close
	put '' $(remote_host)
	job off
	close
endproc:
proc: off
	rm -f $(LIST) $(SORT_LIST)
endproc:
proc: open
	setval host_list file $(LIST)
	setval select sensitive false
endproc:
proc: host_select1
	switch $(TMP_HOST1)
		case '':
		case '*':
		case 'localhost':
			setval select sensitive false
			quit
	endswitch
	setval select sensitive true
endproc:
proc: host_select2
	switch $(TMP_HOST1)
		case '':
		case '*':
		case 'localhost':
			quit
	endswitch
	setval select selected true
	put $(TMP_HOST1) $(TMP_HOST)
	job host_select
	setval select selected false
endproc:
proc: host_select
	put $(TMP_HOST) $(remote_host)
	job off
	close
endproc:
