2019-01-12 17:05:16 +00:00
|
|
|
|
unit dMain;
|
|
|
|
|
|
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
uses
|
2019-01-12 20:24:13 +00:00
|
|
|
|
Classes, SysUtils, FileUtil, Controls, Menus, uPackage, uPackageList;
|
2019-01-12 17:05:16 +00:00
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
2019-01-12 20:24:13 +00:00
|
|
|
|
{ TdmMain }
|
2019-01-12 17:05:16 +00:00
|
|
|
|
|
2019-01-12 20:24:13 +00:00
|
|
|
|
TdmMain = class(TDataModule)
|
2019-01-12 17:05:16 +00:00
|
|
|
|
imgIcons: TImageList;
|
|
|
|
|
mmMain: TMainMenu;
|
|
|
|
|
mbInstallCheckAll: TMenuItem;
|
|
|
|
|
mbInstallExpandTree: TMenuItem;
|
|
|
|
|
mbInstallCollapseTree: TMenuItem;
|
|
|
|
|
mbInstallCheckInvert: TMenuItem;
|
|
|
|
|
mbInstallCheckNone: TMenuItem;
|
|
|
|
|
mbTree: TMenuItem;
|
|
|
|
|
mbCollapseTree: TMenuItem;
|
|
|
|
|
mbExpandTree: TMenuItem;
|
|
|
|
|
mbCheck: TMenuItem;
|
|
|
|
|
mbCheckAll: TMenuItem;
|
|
|
|
|
mbCheckInvert: TMenuItem;
|
|
|
|
|
mbCheckNone: TMenuItem;
|
|
|
|
|
mbOptions: TMenuItem;
|
|
|
|
|
mbHelp: TMenuItem;
|
|
|
|
|
mbOnlineHelp: TMenuItem;
|
|
|
|
|
mbAbout: TMenuItem;
|
|
|
|
|
mbOptonsMain: TMenuItem;
|
|
|
|
|
mbOptionsPkg: TMenuItem;
|
|
|
|
|
pmInstallTree: TPopupMenu;
|
|
|
|
|
pmInstallCheck: TPopupMenu;
|
2019-01-12 20:24:13 +00:00
|
|
|
|
procedure DataModuleCreate(Sender: TObject);
|
2019-01-20 05:59:11 +00:00
|
|
|
|
procedure mbCollapseTreeClick(Sender: TObject);
|
|
|
|
|
procedure mbExpandTreeClick(Sender: TObject);
|
2019-01-12 17:05:16 +00:00
|
|
|
|
private
|
2019-01-12 20:24:13 +00:00
|
|
|
|
// Подготовка директорий
|
|
|
|
|
procedure PrepareDirs();
|
|
|
|
|
// Подготовка списков пакетов
|
|
|
|
|
procedure PreparePackages();
|
2019-01-12 17:05:16 +00:00
|
|
|
|
public
|
2019-01-12 20:24:13 +00:00
|
|
|
|
{ Публичные переменные, которые доступны во всех юнитах с подключенным uses ..., dMain }
|
2019-01-12 17:05:16 +00:00
|
|
|
|
|
2019-01-12 20:24:13 +00:00
|
|
|
|
// путь к файлу ABTool.exe
|
|
|
|
|
ABToolExePath: String;
|
|
|
|
|
// путь к директории ABTool
|
|
|
|
|
ABToolDataPath: String;
|
|
|
|
|
// путь к директории ABTool\Packages
|
|
|
|
|
ABToolPkgPath: String;
|
|
|
|
|
// путь к директории ABTool\Languages
|
|
|
|
|
ABToolLangPath: String;
|
|
|
|
|
// путь к директории ABTool\Logs
|
|
|
|
|
ABToolLogPath: String;
|
|
|
|
|
// Список объектов пакетов программ для установки
|
|
|
|
|
SoftPackages: TPackageList;
|
|
|
|
|
// Список объектов пакетов утилит для запуска
|
|
|
|
|
ToolsPackages: TPackageList;
|
2019-01-12 17:05:16 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
var
|
2019-01-12 20:24:13 +00:00
|
|
|
|
dmMain: TdmMain;
|
2019-01-12 17:05:16 +00:00
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
2019-01-20 05:59:11 +00:00
|
|
|
|
uses fMain;
|
|
|
|
|
|
2019-01-12 17:05:16 +00:00
|
|
|
|
{$R *.lfm}
|
|
|
|
|
|
2019-01-12 20:24:13 +00:00
|
|
|
|
{ TdmMain }
|
|
|
|
|
|
|
|
|
|
{------------------------------------------------------------------------------
|
|
|
|
|
Конструктор: TdmMain.Create()
|
|
|
|
|
Назначение: Создание датамодуля, подготовка путей и списков пакетов
|
|
|
|
|
Вх. параметры: Sender: TObject
|
|
|
|
|
------------------------------------------------------------------------------}
|
|
|
|
|
procedure TdmMain.DataModuleCreate(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
PrepareDirs();
|
|
|
|
|
PreparePackages();
|
|
|
|
|
end;
|
2019-01-20 05:59:11 +00:00
|
|
|
|
|
|
|
|
|
{------------------------------------------------------------------------------
|
|
|
|
|
Процедура: TdmMain.mbCollapseTreeClick()
|
|
|
|
|
Назначение: Сворачивание дерева на активной вкладке главного окна
|
|
|
|
|
------------------------------------------------------------------------------}
|
|
|
|
|
procedure TdmMain.mbCollapseTreeClick(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
case (fmMain.PageControl.ActivePageIndex) of
|
|
|
|
|
0: fmMain.vstSoftPkgContents.FullCollapse();
|
|
|
|
|
1: fmMain.vstToolsPkgContents.FullCollapse();
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
{------------------------------------------------------------------------------
|
|
|
|
|
Процедура: TdmMain.mbCollapseTreeClick()
|
|
|
|
|
Назначение: Разворачивание дерева на активной вкладке главного окна
|
|
|
|
|
------------------------------------------------------------------------------}
|
|
|
|
|
procedure TdmMain.mbExpandTreeClick(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
case (fmMain.PageControl.ActivePageIndex) of
|
|
|
|
|
0: fmMain.vstSoftPkgContents.FullExpand();
|
|
|
|
|
1: fmMain.vstToolsPkgContents.FullExpand();
|
|
|
|
|
end;
|
|
|
|
|
end;
|
2019-01-12 20:24:13 +00:00
|
|
|
|
|
|
|
|
|
{------------------------------------------------------------------------------
|
2019-01-20 05:59:11 +00:00
|
|
|
|
Процедура: TdmMain.PreparePackages()
|
|
|
|
|
Назначение: Подготовка директорий
|
2019-01-12 20:24:13 +00:00
|
|
|
|
------------------------------------------------------------------------------}
|
|
|
|
|
procedure TdmMain.PrepareDirs();
|
|
|
|
|
begin
|
|
|
|
|
ABToolExePath := ExtractFilePath(ParamStr(0));
|
|
|
|
|
ABToolDataPath := ABToolExePath + 'ABTool\';
|
|
|
|
|
ABToolPkgPath := ABToolDataPath + 'Packages\';
|
|
|
|
|
ABToolLangPath := ABToolDataPath + 'Languages\';
|
|
|
|
|
ABToolLogPath := ABToolDataPath + 'Logs\';
|
|
|
|
|
if not DirectoryExists(ABToolPkgPath) then
|
|
|
|
|
ForceDirectories(ABToolPkgPath);
|
|
|
|
|
if not DirectoryExists(ABToolLangPath) then
|
|
|
|
|
ForceDirectories(ABToolLangPath);
|
|
|
|
|
if not DirectoryExists(ABToolLogPath) then
|
|
|
|
|
ForceDirectories(ABToolLogPath);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
{------------------------------------------------------------------------------
|
2019-01-20 05:59:11 +00:00
|
|
|
|
Процедура: TdmMain.PreparePackages()
|
|
|
|
|
Назначение: Подготовка списков пакетов
|
2019-01-12 20:24:13 +00:00
|
|
|
|
------------------------------------------------------------------------------}
|
|
|
|
|
procedure TdmMain.PreparePackages();
|
|
|
|
|
begin
|
|
|
|
|
SoftPackages := TPackageList.Create;
|
|
|
|
|
SoftPackages.Load(ptSoft);
|
|
|
|
|
ToolsPackages := TPackageList.Create;
|
|
|
|
|
ToolsPackages.Load(ptTools);
|
|
|
|
|
end;
|
2019-01-12 17:05:16 +00:00
|
|
|
|
|
2019-01-20 05:41:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-01-12 17:05:16 +00:00
|
|
|
|
end.
|
|
|
|
|
|