Default protocol support
This commit is contained in:
parent
2f6fc90ab4
commit
a0f902afb4
|
@ -42,8 +42,8 @@ Type
|
|||
Constructor Create (Var Owner: Pointer);
|
||||
Destructor Destroy; Override;
|
||||
|
||||
Procedure dszGetFile (Var LogFile: Text; Var FName: String; Var Res: Boolean);
|
||||
Function dszSearch (FName: String) : Boolean;
|
||||
Procedure DszGetFile (Var LogFile: Text; Var FName: String; Var Res: Boolean);
|
||||
Function DszSearch (FName: String) : Boolean;
|
||||
Procedure GetTransferTime (Size: Longint; Var Mins : Integer; Var Secs: Byte);
|
||||
Procedure ExecuteArchive (FName: String; Temp: String; Mask: String; Mode: Byte);
|
||||
Procedure ExecuteProtocol (Send: Boolean; FName: String);
|
||||
|
@ -57,7 +57,7 @@ Type
|
|||
Procedure BatchDelete;
|
||||
Procedure SetFileScan;
|
||||
Procedure GetFileScan;
|
||||
Function SelectProtocol (Batch : Boolean) : Char;
|
||||
Function SelectProtocol (UseDefault, Batch: Boolean) : Char;
|
||||
Function WildcardMatch (Wildcard, FName: String) : Boolean;
|
||||
Procedure CheckFileNameLength (FPath : String; Var FName : String);
|
||||
Procedure GetFileDescription (FN: String);
|
||||
|
@ -406,7 +406,7 @@ Begin
|
|||
|
||||
If Not FileExist(Data) Then Exit;
|
||||
|
||||
If SelectProtocol(False) = 'Q' Then Exit;
|
||||
If SelectProtocol(True, False) = 'Q' Then Exit;
|
||||
|
||||
ExecuteProtocol(True, Data);
|
||||
|
||||
|
@ -934,14 +934,38 @@ Begin
|
|||
Result := True;
|
||||
End;
|
||||
|
||||
Function TFileBase.SelectProtocol (Batch: Boolean) : Char;
|
||||
Var
|
||||
Keys : String;
|
||||
OldP1 : String;
|
||||
Ch : Char;
|
||||
Function TFileBase.SelectProtocol (UseDefault, Batch: Boolean) : Char;
|
||||
|
||||
Function LoadByKey (Key: Char) : Boolean;
|
||||
Begin
|
||||
OldP1 := Session.io.PromptInfo[1];
|
||||
Result := 'Q';
|
||||
Result := False;
|
||||
|
||||
If Key = 'Q' Then Exit;
|
||||
|
||||
Reset (ProtocolFile);
|
||||
|
||||
While Not Eof(ProtocolFile) Do Begin
|
||||
Read (ProtocolFile, Protocol);
|
||||
|
||||
If ((Protocol.Active) And (Key = Protocol.Key) And (Protocol.Batch = Batch) And (Protocol.OSType = OSType)) Then Begin
|
||||
Result := True;
|
||||
Break;
|
||||
End;
|
||||
End;
|
||||
|
||||
Close(ProtocolFile);
|
||||
End;
|
||||
|
||||
Var
|
||||
SavedP1 : String;
|
||||
SavedP2 : String;
|
||||
Keys : String;
|
||||
Begin
|
||||
SavedP1 := Session.io.PromptInfo[1];
|
||||
SavedP2 := Session.io.PromptInfo[2];
|
||||
Result := Session.User.ThisUser.Protocol;
|
||||
|
||||
If Not LoadByKey(Result) Then Begin
|
||||
Keys := 'Q';
|
||||
|
||||
Session.io.OutFullLn(Session.GetPrompt(359));
|
||||
|
@ -950,6 +974,7 @@ Begin
|
|||
|
||||
While Not Eof(ProtocolFile) Do Begin
|
||||
Read (ProtocolFile, Protocol);
|
||||
|
||||
If Protocol.Active And (Protocol.Batch = Batch) And (Protocol.OSType = OSTYpe) Then Begin
|
||||
Keys := Keys + Protocol.Key;
|
||||
|
||||
|
@ -964,22 +989,23 @@ Begin
|
|||
|
||||
Session.io.OutFull (Session.GetPrompt(62));
|
||||
|
||||
Session.io.PromptInfo[1] := OldP1;
|
||||
Result := Session.io.OneKey(Keys, True);
|
||||
|
||||
Ch := Session.io.OneKey(Keys, True);
|
||||
If Result = 'Q' Then Begin
|
||||
Session.io.PromptInfo[1] := SavedP1;
|
||||
Session.io.PromptInfo[2] := SavedP2;
|
||||
|
||||
If Ch = 'Q' Then Exit;
|
||||
|
||||
Reset (ProtocolFile);
|
||||
While Not Eof(ProtocolFile) Do Begin
|
||||
Read(ProtocolFile, Protocol);
|
||||
If ((Protocol.Active) And (Ch = Protocol.Key) And (Protocol.Batch = Batch) And (Protocol.OSType = OSType)) Then Break;
|
||||
Exit;
|
||||
End;
|
||||
Close(ProtocolFile);
|
||||
End;
|
||||
|
||||
LoadByKey(Result);
|
||||
|
||||
Session.io.PromptInfo[1] := Protocol.Desc;
|
||||
|
||||
Session.io.OutFullLn (Session.GetPrompt(65));
|
||||
|
||||
Result := Ch;
|
||||
Session.io.PromptInfo[1] := SavedP1;
|
||||
End;
|
||||
|
||||
Procedure TFileBase.ExecuteArchive (FName: String; Temp: String; Mask: String; Mode: Byte);
|
||||
|
@ -1133,6 +1159,7 @@ Begin
|
|||
End;
|
||||
|
||||
Session.io.OutFull (Session.GetPrompt(47));
|
||||
|
||||
FName := Session.io.GetInput(70, 70, 11, '');
|
||||
|
||||
If FName = '' Then Exit;
|
||||
|
@ -2548,7 +2575,7 @@ Begin
|
|||
FileName := FBase.Path + FileName;
|
||||
End;
|
||||
|
||||
If SelectProtocol(Blind) = 'Q' Then Begin
|
||||
If SelectProtocol(True, Blind) = 'Q' Then Begin
|
||||
FBase := OLD;
|
||||
Exit;
|
||||
End;
|
||||
|
@ -2842,7 +2869,7 @@ Begin
|
|||
|
||||
Session.io.OutFullLn (Session.GetPrompt(79));
|
||||
|
||||
If SelectProtocol(True) = 'Q' Then Exit;
|
||||
If SelectProtocol(True, True) = 'Q' Then Exit;
|
||||
|
||||
Assign (FL, Session.TempPath + 'file.lst');
|
||||
ReWrite (FL);
|
||||
|
@ -2874,7 +2901,7 @@ Begin
|
|||
For A := 1 to BatchNum Do Begin
|
||||
Session.io.PromptInfo[1] := JustFile(Batch[A].FileName);
|
||||
|
||||
If dszSearch (Batch[A].FileName) Then Begin
|
||||
If DszSearch (Batch[A].FileName) Then Begin
|
||||
Session.SystemLog ('Download: ' + Batch[A].FileName);
|
||||
|
||||
Session.io.OutFullLn (Session.GetPrompt(385));
|
||||
|
|
Loading…
Reference in New Issue