Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 737 → Rev 736

/trunk_dos/OIDPLUS.PAS
212,7 → 212,7
if sInput = '' then
begin
(* Empty input = Delete ASN.1 ID *)
ListDeleteElementByIndex(oid^.ASNIDs, res);
ListDeleteElement(oid^.ASNIDs, res);
break;
end
else if not ASN1IDValid(sInput) then
410,6 → 410,8
i: integer;
parentOID: POID;
filenameSelf, filenameParent: string;
fileIdToDelete: string;
sTmp: string;
begin
(* Remove all children and their files recursively *)
DeleteChildrenRecursive(selfOID);
418,14 → 420,21
filenameParent := FileIdPart(selfOID^.Parent) + '.OID';
CreateOidDef(parentOID);
_ReadOidFile(filenameParent, parentOID);
if ListDeleteElementByValue(parentOID^.SubIds, selfOID^.FileId + selfOID^.DotNotation) then
for i := 0 to ListCount(parentOID^.SubIds)-1 do
begin
sTmp := ListGetElement(parentOID^.SubIds, i);
if FileIdPart(sTmp) = selfOID^.FileId then
begin
ListDeleteElement(parentOID^.SubIds, i);
_WriteOidFile(filenameParent, parentOID);
break;
end;
end;
FreeOidDef(parentOID);
 
(* Delete own file *)
filenameSelf := selfOID^.FileId + '.OID';
fileIdToDelete := selfOID^.FileId;
filenameSelf := fileIdToDelete+'.OID';
DeleteFile(filenameSelf);
end;
 
435,7 → 444,7
begin
repeat
ShowMessage('Are you sure you want to delete this OID? (Y/N)', 'DELETE OID', true);
DrawStatusBar('Y=Yes, N=No');
DrawStatusBar('Y = Yes; N = No');
 
sc := ReadKey;
if sc = #0 then
449,8 → 458,9
begin
_DeleteConfirmation := true;
break;
end
else if UpCase(sc) = 'N' then
end;
 
if UpCase(sc) = 'N' then
begin
_DeleteConfirmation := false;
break;
458,22 → 468,6
until false;
end;
 
procedure _DrawOidTitleBar(filename: string; oid: POID);
begin
if oid^.DotNotation = '' then
DrawTitleBar('OID ROOT')
else
DrawTitleBar('OID ' + oid^.DotNotation);
 
(* Put loaded filename into the title bar *)
GotoXY(ScreenWidth-Length(filename)+1,1);
TextBackground(White);
TextColor(Black);
WriteLn(filename);
TextBackground(Black);
TextColor(White);
end;
 
procedure DisplayOIDFile(filename: string);
var
isRoot: boolean;
494,7 → 488,17
(* Print OID information *)
 
ClrScr;
_DrawOidTitleBar(filename, oid);
 
if oid^.DotNotation = '' then
DrawTitleBar('OID ROOT')
else
DrawTitleBar('OID ' + oid^.DotNotation);
GotoXY(ScreenWidth-Length(filename)+1,1);
TextBackground(White);
TextColor(Black);
WriteLn(filename);
TextBackground(Black);
TextColor(White);
DrawStatusBar(DEFAULT_STATUSBAR);
GotoXY(1,2);
 
545,8 → 549,8
 
(* Now prepare the menu entries *)
 
CreateList(subsel); (* Contains the human readable OID name *)
CreateList(subfiles); (* Contains the file name *)
CreateList(subsel);
CreateList(subfiles);
 
if oid^.Parent = '' then
begin
666,9 → 670,9
'- 0 (itu-t)' + #13#10 +
'- 1 (iso)' + #13#10 +
'- 2 (joint-iso-itu-t)';
oid^.FileId := ZeroPad(0, 8);
oid^.FileId := '00000000';
oid^.DotNotation := '';
oid^.Parent := ZeroPad(0, 8);
oid^.Parent := '00000000';
_WriteOidFile(filename, oid);
FreeOidDef(oid);
end;