Changeset 52


Ignore:
Timestamp:
Apr 3, 2012, 7:28:01 AM (13 years ago)
Author:
chronos
Message:
  • Modified: Code related to persistence layer abstraction moved to separated package PersistentData.
Location:
trunk/Client
Files:
3 added
3 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Client/Application/UChronisModule.pas

    r51 r52  
    66
    77uses
    8   Classes, SysUtils, SpecializedList, UChronisClient;
     8  Classes, SysUtils, SpecializedList, UPDClient;
    99
    1010type
  • trunk/Client/Application/UDataTypes.pas

    r46 r52  
    77uses
    88  Classes, SysUtils, Controls, Spin, StdCtrls, ExtCtrls, MaskEdit, EditBtn,
    9   UChronisClient;
     9  UPDClient;
    1010
    1111type
     
    155155
    156156uses
    157   USqlDatabase, USystem, UCore, UFormItemSelect, UFormMain;
     157  USqlDatabase, UFormItemSelect, UFormMain, UCore, USystem;
    158158
    159159function GetDataType(ACustomType: Integer): TDataType;
  • trunk/Client/Forms/UFormItemAdd.pas

    r46 r52  
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    99  StdCtrls, Spin, EditBtn, MaskEdit, USqlDatabase, USystem,
    10   SpecializedDictionary, SpecializedList, UChronisClient;
     10  SpecializedDictionary, SpecializedList, UPDClient;
    1111
    1212type
  • trunk/Client/Forms/UFormItemEdit.pas

    r49 r52  
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    99  StdCtrls, Spin, EditBtn, USqlDatabase, MaskEdit, ComCtrls, USystem,
    10   SpecializedList, SpecializedDictionary, UChronisClient;
     10  SpecializedList, SpecializedDictionary, UPDClient;
    1111
    1212type
  • trunk/Client/Forms/UFormLoginProfile.pas

    r50 r52  
    1010
    1111type
    12   TConnectProtocol = (cpXMLRPC, cpDirect, cpMySQL);
     12  TConnectProtocol = (cpXMLRPC, cpDirect, cpMySQL, cpINI, cpRegistry, cpSQLLite);
    1313
    1414  { TConnectProfile }
  • trunk/Client/Forms/UFormMain.pas

    r50 r52  
    9292uses
    9393  UFormItemView, UFormItemEdit, UFormItemAdd, UFormLogin, UFormSetting, UApplicationInfo,
    94   UCore, UFormImportStructure, UFormAbout, UFormLoginProfile, UChronisClientDirect,
    95   UChronisClient, UChronisClientMySQL, UChronisClientXMLRPC, UFormMenu;
     94  UCore, UFormImportStructure, UFormAbout, UFormLoginProfile, UPDClientIni,
     95  UPDClient, UPDClientMySQL, UPDClientXMLRPC, UFormMenu, UPDClientRegistry;
    9696
    9797{$R *.lfm}
     
    241241      with TConnectProfile(Core.Profiles[Core.LastProfile]) do begin
    242242        FreeAndNil(Core.System.Client);
    243         if Protocol = cpMySQL then Core.System.Client := TChronisClientMySQL.Create
    244           else if Protocol = cpDirect then Core.System.Client := TChronisClientDirect.Create
    245           else if Protocol = cpXMLRPC then Core.System.Client := TChronisClientXMLRPC.Create;
     243        if Protocol = cpMySQL then Core.System.Client := TPDClientMySQL.Create
     244          //else if Protocol = cpDirect then Core.System.Client := TPDClientDirect.Create
     245          else if Protocol = cpXMLRPC then Core.System.Client := TPDClientXMLRPC.Create
     246          else if Protocol = cpINI then Core.System.Client := TPDClientIni.Create
     247          else if Protocol = cpRegistry then Core.System.Client := TPDClientRegistry.Create;
    246248        Core.System.Client.Host := HostName;
    247249        Core.System.Client.Schema := Database;
  • trunk/Client/Forms/UFormMenu.pas

    r49 r52  
    5454
    5555uses
    56   UFormMain, USystem, UChronisClient, UChronisClientMySQL, UCore;
     56  UFormMain, USystem, UPDClient, UCore;
    5757
    5858procedure TFormMenu.TreeViewMenuChange(Sender: TObject; Node: TTreeNode);
  • trunk/Client/Module/UModuleSystem.pas

    r51 r52  
    2727
    2828uses
    29   USystem, USqlDatabase, UChronisClient;
     29  USystem, USqlDatabase, UPDClient;
    3030
    3131{ TModuleSystem }
  • trunk/Client/Module/UModuleUser.pas

    r51 r52  
    66
    77uses
    8   Classes, SysUtils, UChronisClient, UChronisModule;
     8  Classes, SysUtils, UPDClient, UChronisModule;
    99
    1010type
  • trunk/Client/UCore.pas

    r46 r52  
    77uses
    88  Classes, SysUtils, FileUtil, UCoolTranslator, UDebugLog, USystem, Registry,
    9   USqlDatabase, UFormLoginProfile, URegistry, UChronisClient, UModuleSystem;
     9  USqlDatabase, UFormLoginProfile, URegistry, UPDClient, UModuleSystem;
    1010
    1111type
     
    4343
    4444uses
    45   UApplicationInfo, UChronisClientDirect, UChronisClientMySQL;
     45  UApplicationInfo;
    4646
    4747{ TCore }
  • trunk/Client/USystem.pas

    r51 r52  
    77uses
    88  Classes, SysUtils, SpecializedList, SpecializedDictionary, USqlDatabase,
    9   Strings, UDataTypes, Dialogs, ComCtrls, StdCtrls, Controls, UChronisClient,
     9  Strings, UDataTypes, Dialogs, ComCtrls, StdCtrls, Controls, UPDClient,
    1010  UChronisModule;
    1111
     
    9393    Base: TChronisBase;
    9494    procedure UpdateList;
     95    function IsInstalled: Boolean;
    9596    procedure Install;
    9697    procedure Uninstall;
     
    104105    procedure SetActive(AValue: Boolean);
    105106  public
    106     Types: TChronisTypeList;
    107     Client: TChronisClient;
     107    Types: TPDTypeList;
     108    Client: TPDClient;
    108109    Modules: TChronisModuleList;
    109110    ModuleSystem: TChronisModule;
     
    635636    Types.Clear;
    636637    for I := 0 to Proxy.Objects.Count - 1 do begin
    637       with TChronisType(Types.AddNew(TChronisType.Create)) do
     638      with TPDType(Types.AddNew(TPDType.Create)) do
    638639      with TObjectProxy(Proxy.Objects[I]) do begin
    639640        Id := StrToInt(Properties.Values['Id']);
     
    667668constructor TChronisBase.Create;
    668669begin
    669   Types := TChronisTypeList.Create;
     670  Types := TPDTypeList.Create;
    670671  Modules := TChronisModuleList.Create;
    671672  Modules.Base := Self;
     
    781782end;
    782783
     784function TChronisModuleList.IsInstalled: Boolean;
     785var
     786  NewType: TPDType;
     787begin
     788  with TPDType.Create do
     789  try
     790    Client := Base.Client;
     791    Name := SystemModuleObject;
     792    Result := IsDefined;
     793  finally
     794    Free;
     795  end;
     796end;
     797
    783798procedure TChronisModuleList.Install;
    784799var
    785   NewType: TChronisType;
    786 begin
    787   NewType := TChronisType.Create;
    788   NewType.Client := Base.Client;
    789   NewType.Name := SystemModuleObject;
    790   NewType.Properties.Add('SysName', 'String');
    791   NewType.Properties.Add('Name', 'String');
    792   NewType.Properties.Add('Version', 'String');
    793   NewType.Properties.Add('License', 'String');
    794   NewType.Properties.Add('Creator', 'String');
    795   NewType.Properties.Add('HomePage', 'String');
    796   NewType.Properties.Add('Installed', 'Boolean');
    797   NewType.Define;
     800  NewType: TPDType;
     801begin
     802  with TPDType.Create do
     803  try
     804    Client := Base.Client;
     805    Name := SystemModuleObject;
     806    with Properties do begin
     807      Add('SysName', 'String');
     808      Add('Name', 'String');
     809      Add('Version', 'String');
     810      Add('License', 'String');
     811      Add('Creator', 'String');
     812      Add('HomePage', 'String');
     813      Add('Installed', 'Boolean');
     814    end;
     815    Define;
     816  finally
     817    Free;
     818  end;
    798819end;
    799820
    800821procedure TChronisModuleList.Uninstall;
    801822var
    802   NewType: TChronisType;
    803 begin
    804   NewType := TChronisType.Create;
    805   NewType.Client := Base.Client;
    806   NewType.Name := SystemModuleObject;
    807   NewType.Undefine;
     823  NewType: TPDType;
     824begin
     825  with TPDType.Create do
     826  try
     827    Client := Base.Client;
     828    Name := SystemModuleObject;
     829    Undefine;
     830  finally
     831    Free;
     832  end;
    808833end;
    809834
  • trunk/Client/chronis.lpi

    r51 r52  
    8282      </local>
    8383    </RunParams>
    84     <RequiredPackages Count="6">
     84    <RequiredPackages Count="7">
    8585      <Item1>
    86         <PackageName Value="Common"/>
     86        <PackageName Value="PersistentData"/>
    8787      </Item1>
    8888      <Item2>
    89         <PackageName Value="CoolWeb"/>
    90         <MinVersion Valid="True"/>
     89        <PackageName Value="Common"/>
    9190      </Item2>
    9291      <Item3>
    93         <PackageName Value="CoolTranslator"/>
     92        <PackageName Value="CoolWeb"/>
    9493        <MinVersion Valid="True"/>
    9594      </Item3>
    9695      <Item4>
    97         <PackageName Value="LCLBase"/>
     96        <PackageName Value="CoolTranslator"/>
    9897        <MinVersion Valid="True"/>
    9998      </Item4>
    10099      <Item5>
    101         <PackageName Value="TemplateGenerics"/>
     100        <PackageName Value="LCLBase"/>
     101        <MinVersion Valid="True"/>
    102102      </Item5>
    103103      <Item6>
     104        <PackageName Value="TemplateGenerics"/>
     105      </Item6>
     106      <Item7>
    104107        <PackageName Value="LCL"/>
    105       </Item6>
     108      </Item7>
    106109    </RequiredPackages>
    107     <Units Count="28">
     110    <Units Count="23">
    108111      <Unit0>
    109112        <Filename Value="chronis.lpr"/>
     
    217220      </Unit16>
    218221      <Unit17>
    219         <Filename Value="Application/UChronisClient.pas"/>
    220         <IsPartOfProject Value="True"/>
    221         <UnitName Value="UChronisClient"/>
     222        <Filename Value="Application/UChronisModule.pas"/>
     223        <IsPartOfProject Value="True"/>
     224        <UnitName Value="UChronisModule"/>
    222225      </Unit17>
    223226      <Unit18>
    224         <Filename Value="Application/UChronisServer.pas"/>
    225         <IsPartOfProject Value="True"/>
    226         <UnitName Value="UChronisServer"/>
     227        <Filename Value="Module/UModuleSystem.pas"/>
     228        <IsPartOfProject Value="True"/>
     229        <UnitName Value="UModuleSystem"/>
    227230      </Unit18>
    228231      <Unit19>
    229         <Filename Value="Application/Clients/UChronisClientDirect.pas"/>
    230         <IsPartOfProject Value="True"/>
    231         <UnitName Value="UChronisClientDirect"/>
     232        <Filename Value="Forms/UFormItemList.pas"/>
     233        <IsPartOfProject Value="True"/>
     234        <ComponentName Value="ItemListForm"/>
     235        <ResourceBaseClass Value="Form"/>
     236        <UnitName Value="UFormItemList"/>
    232237      </Unit19>
    233238      <Unit20>
    234         <Filename Value="Application/UChronisModule.pas"/>
    235         <IsPartOfProject Value="True"/>
    236         <UnitName Value="UChronisModule"/>
     239        <Filename Value="Common/URemote.pas"/>
     240        <IsPartOfProject Value="True"/>
     241        <UnitName Value="URemote"/>
    237242      </Unit20>
    238243      <Unit21>
    239         <Filename Value="Module/UModuleSystem.pas"/>
    240         <IsPartOfProject Value="True"/>
    241         <UnitName Value="UModuleSystem"/>
     244        <Filename Value="Module/UModuleUser.pas"/>
     245        <IsPartOfProject Value="True"/>
     246        <UnitName Value="UModuleUser"/>
    242247      </Unit21>
    243248      <Unit22>
    244         <Filename Value="Forms/UFormItemList.pas"/>
    245         <IsPartOfProject Value="True"/>
    246         <ComponentName Value="ItemListForm"/>
    247         <ResourceBaseClass Value="Form"/>
    248         <UnitName Value="UFormItemList"/>
     249        <Filename Value="Forms/UFormMenu.pas"/>
     250        <IsPartOfProject Value="True"/>
     251        <ComponentName Value="FormMenu"/>
     252        <ResourceBaseClass Value="Form"/>
     253        <UnitName Value="UFormMenu"/>
    249254      </Unit22>
    250       <Unit23>
    251         <Filename Value="Application/Clients/UChronisClientXMLRPC.pas"/>
    252         <IsPartOfProject Value="True"/>
    253         <UnitName Value="UChronisClientXMLRPC"/>
    254       </Unit23>
    255       <Unit24>
    256         <Filename Value="Application/Clients/UChronisClientMySQL.pas"/>
    257         <IsPartOfProject Value="True"/>
    258         <UnitName Value="UChronisClientMySQL"/>
    259       </Unit24>
    260       <Unit25>
    261         <Filename Value="Common/URemote.pas"/>
    262         <IsPartOfProject Value="True"/>
    263         <UnitName Value="URemote"/>
    264       </Unit25>
    265       <Unit26>
    266         <Filename Value="Module/UModuleUser.pas"/>
    267         <IsPartOfProject Value="True"/>
    268         <UnitName Value="UModuleUser"/>
    269       </Unit26>
    270       <Unit27>
    271         <Filename Value="Forms/UFormMenu.pas"/>
    272         <IsPartOfProject Value="True"/>
    273         <ComponentName Value="FormMenu"/>
    274         <ResourceBaseClass Value="Form"/>
    275         <UnitName Value="UFormMenu"/>
    276       </Unit27>
    277255    </Units>
    278256  </ProjectOptions>
     
    285263      <IncludeFiles Value="$(ProjOutDir)"/>
    286264      <Libraries Value="/usr/lib/mysql;/usr/lib64/mysql"/>
    287       <OtherUnitFiles Value="Common;Forms;Application;Module;Application/Clients"/>
     265      <OtherUnitFiles Value="Common;Forms;Application;Module"/>
    288266      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
    289267    </SearchPaths>
  • trunk/Client/chronis.lpr

    r49 r52  
    1010  Forms, UPersistentForm, UTreeState, SysUtils, UFormItemView, UFormItemEdit,
    1111  UFormLogin, UFormMain, UFormItemAdd, TemplateGenerics, CoolTranslator, Common,
    12   CoolWeb, USystem, UCore, UApplicationInfo, UFormSetting, UDataTypes,
    13   UFormImportStructure, UFormItemSelect, UFormLoginProfile, UFormAbout,
    14   UChronisClient, UChronisServer, UChronisClientDirect, UChronisModule,
    15   UModuleSystem,
    16 UFormItemList, LDockTree, UChronisClientXMLRPC, UChronisClientMySQL,
    17   URemote, UModuleUser, UFormMenu
     12  CoolWeb, USystem, UCore, UApplicationInfo, UFormSetting, UFormImportStructure,
     13  UFormItemSelect, UFormLoginProfile, UFormAbout, UChronisModule, UDataTypes,
     14  UModuleSystem, UFormItemList, LDockTree, URemote, UModuleUser, UFormMenu
    1815  { you can add units after this };
    1916
Note: See TracChangeset for help on using the changeset viewer.