2012-02-13 16:50:48 -08:00
|
|
|
|
Unit bbs_cfg_Archive;
|
|
|
|
|
|
2013-11-10 12:08:54 -08:00
|
|
|
|
// ====================================================================
|
|
|
|
|
// Mystic BBS Software Copyright 1997-2013 By James Coyle
|
|
|
|
|
// ====================================================================
|
|
|
|
|
//
|
|
|
|
|
// This file is part of Mystic BBS.
|
|
|
|
|
//
|
|
|
|
|
// Mystic BBS is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// Mystic BBS is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
|
// along with Mystic BBS. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
//
|
|
|
|
|
// ====================================================================
|
|
|
|
|
|
2012-02-13 16:50:48 -08:00
|
|
|
|
{$I M_OPS.PAS}
|
|
|
|
|
|
|
|
|
|
Interface
|
|
|
|
|
|
|
|
|
|
Procedure Configuration_ArchiveEditor;
|
|
|
|
|
|
|
|
|
|
Implementation
|
|
|
|
|
|
|
|
|
|
Uses
|
|
|
|
|
m_FileIO,
|
|
|
|
|
m_Strings,
|
2013-08-29 03:04:20 -07:00
|
|
|
|
BBS_Records,
|
|
|
|
|
BBS_DataBase,
|
|
|
|
|
BBS_Common,
|
|
|
|
|
BBS_Ansi_MenuBox,
|
|
|
|
|
BBS_Ansi_MenuForm,
|
|
|
|
|
BBS_Cfg_Common;
|
2012-02-13 16:50:48 -08:00
|
|
|
|
|
|
|
|
|
Procedure EditArchive (Var Arc: RecArchive);
|
|
|
|
|
Var
|
|
|
|
|
Box : TAnsiMenuBox;
|
|
|
|
|
Form : TAnsiMenuForm;
|
|
|
|
|
Begin
|
|
|
|
|
Box := TAnsiMenuBox.Create;
|
|
|
|
|
Form := TAnsiMenuForm.Create;
|
|
|
|
|
|
|
|
|
|
Box.Header := ' Archive Editor: ' + Arc.Desc + ' ';
|
|
|
|
|
|
|
|
|
|
Box.Open (13, 5, 67, 15);
|
|
|
|
|
|
|
|
|
|
Form.HelpSize := 0;
|
|
|
|
|
|
|
|
|
|
VerticalLine (28, 7, 13);
|
|
|
|
|
|
|
|
|
|
Form.AddBol ('A', ' Active ' , 20, 7, 30, 7, 8, 3, @Arc.Active, '');
|
|
|
|
|
Form.AddStr ('X', ' Extension ' , 17, 8, 30, 8, 11, 4, 4, @Arc.Ext, '');
|
2013-08-28 18:01:55 -07:00
|
|
|
|
Form.AddTog ('O', ' OS ' , 24, 9, 30, 9, 4, 7, 0, 4, 'Windows Linux OSX All OS/2', @Arc.OSType, '');
|
2012-02-13 16:50:48 -08:00
|
|
|
|
Form.AddStr ('D', ' Description ' , 15, 10, 30, 10, 13, 30, 30, @Arc.Desc, '');
|
|
|
|
|
Form.AddStr ('P', ' Pack Cmd ' , 18, 11, 30, 11, 10, 35, 80, @Arc.Pack, '');
|
|
|
|
|
Form.AddStr ('U', ' Unpack Cmd ' , 16, 12, 30, 12, 12, 35, 80, @Arc.Unpack, '');
|
|
|
|
|
Form.AddStr ('V', ' View Cmd ' , 18, 13, 30, 13, 10, 35, 80, @Arc.View, '');
|
|
|
|
|
|
|
|
|
|
Form.Execute;
|
|
|
|
|
Box.Close;
|
|
|
|
|
|
|
|
|
|
Form.Free;
|
|
|
|
|
Box.Free;
|
|
|
|
|
End;
|
|
|
|
|
|
|
|
|
|
Procedure Configuration_ArchiveEditor;
|
|
|
|
|
Var
|
2012-02-24 08:47:28 -08:00
|
|
|
|
Box : TAnsiMenuBox;
|
|
|
|
|
List : TAnsiMenuList;
|
2013-05-08 23:12:55 -07:00
|
|
|
|
ArcFile : File of RecArchive;
|
2012-02-24 08:47:28 -08:00
|
|
|
|
Arc : RecArchive;
|
|
|
|
|
Copied : RecArchive;
|
|
|
|
|
HasCopy : Boolean = False;
|
2012-02-13 16:50:48 -08:00
|
|
|
|
|
|
|
|
|
Procedure MakeList;
|
|
|
|
|
Var
|
|
|
|
|
OS : String;
|
|
|
|
|
Begin
|
|
|
|
|
List.Clear;
|
|
|
|
|
|
2013-05-08 23:12:55 -07:00
|
|
|
|
ioReset (ArcFile, SizeOf(RecArchive), fmRWDN);
|
|
|
|
|
|
|
|
|
|
While Not Eof(ArcFile) Do Begin
|
|
|
|
|
Read (ArcFile, Arc);
|
2012-02-13 16:50:48 -08:00
|
|
|
|
|
|
|
|
|
Case Arc.OSType of
|
|
|
|
|
0 : OS := 'Windows';
|
|
|
|
|
1 : OS := 'Linux ';
|
2012-02-15 21:57:04 -08:00
|
|
|
|
2 : OS := 'OSX ';
|
2012-08-19 11:22:24 -07:00
|
|
|
|
3 : OS := 'All ';
|
2013-09-03 05:02:29 -07:00
|
|
|
|
4 : OS := 'OS/2 ';
|
2012-02-13 16:50:48 -08:00
|
|
|
|
End;
|
|
|
|
|
|
|
|
|
|
List.Add (strPadR(YesNoStr[Arc.Active], 5, ' ') + strPadR(Arc.Ext, 7, ' ') + OS + ' ' + Arc.Desc, 0);
|
|
|
|
|
End;
|
|
|
|
|
|
|
|
|
|
List.Add ('', 2);
|
|
|
|
|
End;
|
|
|
|
|
|
|
|
|
|
Begin
|
2013-08-28 15:31:33 -07:00
|
|
|
|
Assign (ArcFile, bbsCfg.DataPath + 'archive.dat');
|
2012-02-13 16:50:48 -08:00
|
|
|
|
|
2013-05-08 23:12:55 -07:00
|
|
|
|
If Not ioReset(ArcFile, SizeOf(RecArchive), fmRWDN) Then
|
|
|
|
|
If Not ioReWrite(ArcFile, SizeOf(RecArchive), fmRWDN) Then
|
|
|
|
|
Exit;
|
2012-02-13 16:50:48 -08:00
|
|
|
|
|
|
|
|
|
Box := TAnsiMenuBox.Create;
|
|
|
|
|
List := TAnsiMenuList.Create;
|
|
|
|
|
|
|
|
|
|
Box.Header := ' Archive Editor ';
|
|
|
|
|
List.NoWindow := True;
|
2012-02-15 21:26:55 -08:00
|
|
|
|
List.LoChars := #13#27#47;
|
2012-08-04 16:18:48 -07:00
|
|
|
|
List.SearchY := 20;
|
2012-02-13 16:50:48 -08:00
|
|
|
|
|
|
|
|
|
Box.Open (13, 5, 67, 20);
|
|
|
|
|
|
2012-02-15 21:26:55 -08:00
|
|
|
|
WriteXY (15, 7, 112, 'Use Ext OSID Description');
|
|
|
|
|
WriteXY (15, 8, 112, strRep('<27>', 51));
|
2012-02-13 16:50:48 -08:00
|
|
|
|
WriteXY (15, 18, 112, strRep('<27>', 51));
|
2012-02-26 03:51:59 -08:00
|
|
|
|
WriteXY (29, 19, 112, cfgCommandList);
|
2012-02-13 16:50:48 -08:00
|
|
|
|
|
|
|
|
|
Repeat
|
|
|
|
|
MakeList;
|
|
|
|
|
|
2012-02-15 21:26:55 -08:00
|
|
|
|
List.Open (13, 8, 67, 18);
|
2012-02-13 16:50:48 -08:00
|
|
|
|
List.Close;
|
|
|
|
|
|
|
|
|
|
Case List.ExitCode of
|
2012-02-24 08:47:28 -08:00
|
|
|
|
'/' : Case GetCommandOption(10, 'I-Insert|D-Delete|C-Copy|P-Paste|') of
|
2012-02-15 21:26:55 -08:00
|
|
|
|
'I' : Begin
|
2013-05-08 23:12:55 -07:00
|
|
|
|
AddRecord (ArcFile, List.Picked, SizeOf(RecArchive));
|
2012-02-15 21:26:55 -08:00
|
|
|
|
|
|
|
|
|
Arc.OSType := OSType;
|
|
|
|
|
Arc.Active := False;
|
|
|
|
|
Arc.Desc := 'New archive';
|
|
|
|
|
Arc.Ext := 'NEW';
|
|
|
|
|
Arc.Pack := '';
|
|
|
|
|
Arc.Unpack := '';
|
|
|
|
|
Arc.View := '';
|
|
|
|
|
|
2013-05-08 23:12:55 -07:00
|
|
|
|
Write (ArcFile, Arc);
|
2012-02-15 21:26:55 -08:00
|
|
|
|
|
|
|
|
|
MakeList;
|
|
|
|
|
End;
|
|
|
|
|
'D' : If ShowMsgBox(1, 'Delete this entry?') Then Begin
|
2013-05-08 23:12:55 -07:00
|
|
|
|
KillRecord (ArcFile, List.Picked, SizeOf(RecArchive));
|
|
|
|
|
|
2012-02-24 08:47:28 -08:00
|
|
|
|
MakeList;
|
|
|
|
|
End;
|
|
|
|
|
'C' : If List.Picked <> List.ListMax Then Begin
|
2013-05-08 23:12:55 -07:00
|
|
|
|
Seek (ArcFile, List.Picked - 1);
|
|
|
|
|
Read (ArcFile, Copied);
|
2012-02-24 08:47:28 -08:00
|
|
|
|
|
|
|
|
|
HasCopy := True;
|
|
|
|
|
End;
|
|
|
|
|
'P' : If HasCopy Then Begin
|
2013-05-08 23:12:55 -07:00
|
|
|
|
AddRecord (ArcFile, List.Picked, SizeOf(RecArchive));
|
|
|
|
|
Write (ArcFile, Copied);
|
2012-02-24 08:47:28 -08:00
|
|
|
|
|
2012-02-15 21:26:55 -08:00
|
|
|
|
MakeList;
|
|
|
|
|
End;
|
2012-02-13 16:50:48 -08:00
|
|
|
|
End;
|
|
|
|
|
#13 : If List.Picked <> List.ListMax Then Begin
|
2013-05-08 23:12:55 -07:00
|
|
|
|
Seek (ArcFile, List.Picked - 1);
|
|
|
|
|
Read (ArcFile, Arc);
|
2012-02-13 16:50:48 -08:00
|
|
|
|
|
|
|
|
|
EditArchive(Arc);
|
|
|
|
|
|
2013-05-08 23:12:55 -07:00
|
|
|
|
Seek (ArcFile, List.Picked - 1);
|
|
|
|
|
Write (ArcFile, Arc);
|
2012-02-13 16:50:48 -08:00
|
|
|
|
End;
|
|
|
|
|
#27 : Break;
|
|
|
|
|
End;
|
|
|
|
|
Until False;
|
|
|
|
|
|
2013-05-08 23:12:55 -07:00
|
|
|
|
Close (ArcFile);
|
2012-02-13 16:50:48 -08:00
|
|
|
|
|
|
|
|
|
Box.Close;
|
|
|
|
|
List.Free;
|
|
|
|
|
Box.Free;
|
|
|
|
|
End;
|
|
|
|
|
|
|
|
|
|
End.
|