
! script name: property.d/delpropclass
! topic: delete an info packet class directory

!A
!A NAME:
!A
!A 	Delete Property Class
!A
!A DESCRIPTION:
!A
!A 	This script deletes an info packet class.  Use this script when you
!A 	want to permanently remove an entire class of info packet.  When the
!A 	packet class is deleted, Synergy does not check references to the
!A 	deleted class.
!A
!# see also - htdocs/help.d/property.htm

Stat=ChangeLabelStr("ScriptNameStatus","Function: delete info packet class")

DIM Destination$[512]
DIM Answer$[512]
DIM A$[512]
DIM Name$[512]
DIM Prop_dir$[512]
DIM Class_dir$[512]
DIM Class_name$[512]
DIM Prop_name$[512]
DIM Filename$[512]
DIM Class_name$[512]
DIM D_label$[512]
DIM Choice$[512]
DIM Current_dir$[512]
DIM Ques$[512]

Stat= NamedVarStr("properties dir",WsSystemVars,"/usr/weber/database/properties/",Prop_dir$)

DeActivateUndo
Start:!
D_label$="PACKET CLASSES"
Choice$="CLASS SELECTED"
Ques$= "PACKET CLASS DIRECTORY  List  "
Answer$= SelectDirectory(Prop_dir$,"*",Ques$,D_label$,Choice$,"",Current_dir$)
IF (ExitScript(Destination$)) THEN Leave
IF  Answer$= "CANCEL" THEN Leave
Answer$= TRIM$(Answer$)
Class_dir$= Answer$
Class_name$= PathNameFile(Answer$)


stat= SetInputFormat("a1",",Y,N,")
stat= GetValue("DELETE "&Class_name$&" Yes or No ",Answer$)
IF (ExitScript(Destination$)) THEN Leave
IF Answer$= "Y" THEN
	Stat = RemoveDirTree(Class_dir$)
END IF
GOTO Start

Leave:!
LowerSelectBox
Stat=SetInputFormat("n4","")
IF NOT LEN(Destination$) THEN
	LOAD "typecontrol"
ELSE
	LOAD Destination$
END IF
END


