Changeset 23


Ignore:
Timestamp:
Apr 4, 2025, 9:22:05 AM (5 days ago)
Author:
chronos
Message:
  • Modified: All unit renamed to names without U prefix.
  • Modified: Removed global form variables.
  • Modified: Code cleanup.
Location:
trunk
Files:
4 edited
29 moved

Legend:

Unmodified
Added
Removed
  • trunk/Backends/Bazaar/Bazaar.pas

    r22 r23  
    1 unit UBazaar;
     1unit Bazaar;
    22
    33interface
    44
    55uses
    6   Classes, SysUtils, UBackend, UVCS;
     6  Classes, SysUtils, Backend, VCS;
    77
    88type
  • trunk/Backends/CVS/CVS.pas

    r22 r23  
    1 unit UCVS;
     1unit CVS;
    22
    33interface
    44
    55uses
    6   Classes, SysUtils, UVCS, UBackend;
     6  Classes, SysUtils, VCS, Backend;
    77
    88type
  • trunk/Backends/Git/Git.pas

    r22 r23  
    1 unit UGit;
     1unit Git;
    22
    33interface
    44
    55uses
    6   Classes, SysUtils, UVCS, UBackend;
     6  Classes, SysUtils, VCS, Backend;
    77
    88type
  • trunk/Backends/Subversion/Subversion.pas

    r22 r23  
    1 unit USubversion;
     1unit Subversion;
    22
    33interface
    44
    55uses
    6   Classes, SysUtils, UVCS, UBackend, XMLRead, DOM, XML;
     6  Classes, SysUtils, VCS, Backend, XMLRead, DOM, XML;
    77
    88type
  • trunk/Core.pas

    r22 r23  
    1 unit UCore;
     1unit Core;
    22
    33interface
    44
    55uses
    6   Classes, SysUtils, XMLConf, LazFileUtils, ActnList, Controls, UVCS, UProject,
    7   LastOpenedList, Forms, Dialogs, Menus, Contnrs, UBackend;
     6  Classes, SysUtils, XMLConf, LazFileUtils, ActnList, Controls, VCS, Project,
     7  LastOpenedList, Forms, Dialogs, Menus, Generics.Collections, Backend, FormMain;
    88
    99type
     
    6565    function DetectBackend(Directory: string): TBackend;
    6666  public
    67     Backends: TObjectList; // TList<TBackend>
     67    Backends: TList<TBackend>;
    6868    Project: TProject;
    6969    ProjectGroup: TProjectGroup;
    7070    UserName: string;
    7171    Email: string;
     72    FormMain: TFormMain;
    7273    procedure LoadConfig;
    7374    procedure SaveConfig;
     
    8788
    8889uses
    89   UFormMain, UFormBrowse, UFormSettings, UFormCommit, UFormCheckout,
    90   USubversion, UBazaar, UCVS, UGit, UFormTest, UFormProjectGroup;
     90  FormBrowse, FormSettings, FormCommit, FormCheckout,
     91  Subversion, Bazaar, CVS, Git, FormTest, FormProjectGroup;
    9192
    9293{ TCore }
     
    9495procedure TCore.AQuitExecute(Sender: TObject);
    9596begin
     97  FormMain.Close;
    9698  Application.Terminate;
    9799end;
     
    123125
    124126procedure TCore.ASettingsExecute(Sender: TObject);
    125 begin
    126   FormSettings.Load(XMLConfig1);
    127   if FormSettings.ShowModal = mrOk then begin
    128     FormSettings.Save(XMLConfig1);
     127var
     128  FormSettings: TFormSettings;
     129begin
     130  FormSettings := TFormSettings.Create(nil);
     131  try
     132    FormSettings.Load(XMLConfig1);
     133    if FormSettings.ShowModal = mrOk then begin
     134      FormSettings.Save(XMLConfig1);
     135    end;
     136  finally
     137    FormSettings.Free;
    129138  end;
    130139end;
    131140
    132141procedure TCore.AViewTestExecute(Sender: TObject);
    133 begin
    134   FormTest.Show;
     142var
     143  FormTest: TFormTest;
     144begin
     145  FormTest := TFormTest.Create(nil);
     146  try
     147    FormTest.Show;
     148  finally
     149    FormTest.Free;
     150  end;
    135151end;
    136152
    137153procedure TCore.DataModuleCreate(Sender: TObject);
    138154begin
    139   Backends := TObjectList.Create;
     155  Backends := TList<TBackend>.Create;
    140156  Project := nil;
     157
     158  Application.CreateForm(TFormMain, FormMain);
     159  FormMain.Show;
    141160end;
    142161
     
    235254    Project.Directory := Directory;
    236255    UpdateInterface;
    237     FormBrowse.Directory := Project.Directory;
    238     FormBrowse.ReloadList;
     256    FormMain.FormBrowse.Directory := Project.Directory;
     257    FormMain.FormBrowse.ReloadList;
    239258    LastOpenedListProject.AddItem(Project.Directory);
    240259  end else ShowMessage('Directory ''' + Directory + ''' not recognized as working copy of any of supported VCS systems');
     
    247266  ProjectGroup.FileName := FileName;
    248267  UpdateInterface;
    249   FormProjectGroup.ReloadTree;
     268  FormMain.FormProjectGroup.ReloadTree;
    250269  LastOpenedListProjectGroup.AddItem(FileName);
    251270end;
     
    266285begin
    267286  FreeAndNil(Project);
    268   FormBrowse.Directory := '';
    269   FormBrowse.ReloadList;
     287  FormMain.FormBrowse.Directory := '';
     288  FormMain.FormBrowse.ReloadList;
    270289  UpdateInterface;
    271290end;
     
    275294  FreeAndNil(ProjectGroup);
    276295  UpdateInterface;
    277   FormProjectGroup.ReloadTree;
     296  FormMain.FormProjectGroup.ReloadTree;
    278297end;
    279298
     
    284303  ProjectGroup.FileName := 'New project group.vcgrp';
    285304  UpdateInterface;
    286   FormProjectGroup.ReloadTree;
     305  FormMain.FormProjectGroup.ReloadTree;
    287306end;
    288307
     
    320339var
    321340  TempProject: TProject;
    322 begin
    323   if LastOpenedListRepoURL.Items.Count > 0 then
    324     FormCheckout.EditURL.Text := LastOpenedListRepoURL.Items[0];
    325   if LastOpenedListNewDir.Items.Count > 0 then
    326     FormCheckout.EditDir.Text := LastOpenedListNewDir.Items[0];
    327   if FormCheckout.ShowModal = mrOk then begin
    328     LastOpenedListRepoURL.AddItem(FormCheckout.EditURL.Text);
    329     LastOpenedListNewDir.AddItem(FormCheckout.EditDir.Text);
    330     TempProject := TProject.Create;
    331     try
    332       TempProject.Backend := TBackend(FormCheckout.ComboBox1.Items.Objects[FormCheckout.ComboBox1.ItemIndex]);
    333       TempProject.Directory := FormCheckout.EditDir.Text;
    334       TempProject.RepositoryURL := FormCheckout.EditURL.Text;
    335       TempProject.WorkingCopy.Checkout;
    336     finally
    337       TempProject.Free;
     341  FormCheckout: TFormCheckout;
     342begin
     343  FormCheckout := TFormCheckout.Create(nil);
     344  try
     345    if LastOpenedListRepoURL.Items.Count > 0 then
     346      FormCheckout.EditURL.Text := LastOpenedListRepoURL.Items[0];
     347    if LastOpenedListNewDir.Items.Count > 0 then
     348      FormCheckout.EditDir.Text := LastOpenedListNewDir.Items[0];
     349    if FormCheckout.ShowModal = mrOk then begin
     350      LastOpenedListRepoURL.AddItem(FormCheckout.EditURL.Text);
     351      LastOpenedListNewDir.AddItem(FormCheckout.EditDir.Text);
     352      TempProject := TProject.Create;
     353      try
     354        TempProject.Backend := TBackend(FormCheckout.ComboBox1.Items.Objects[FormCheckout.ComboBox1.ItemIndex]);
     355        TempProject.Directory := FormCheckout.EditDir.Text;
     356        TempProject.RepositoryURL := FormCheckout.EditURL.Text;
     357        TempProject.WorkingCopy.Checkout;
     358      finally
     359        TempProject.Free;
     360      end;
     361      ProjectOpen(FormCheckout.EditDir.Text);
    338362    end;
    339     ProjectOpen(FormCheckout.EditDir.Text);
     363  finally
     364    FormCheckout.Free;
    340365  end;
    341366end;
     
    347372
    348373procedure TCore.ACommandCommitExecute(Sender: TObject);
    349 begin
    350   if FormCommit.ShowModal = mrOk then begin
    351     Project.WorkingCopy.Commit(FormCommit.MemoMessage.Lines);
     374var
     375  FormCommit: TFormCommit;
     376begin
     377  FormCommit := TFormCommit.Create(nil);
     378  try
     379    if FormCommit.ShowModal = mrOk then begin
     380      Project.WorkingCopy.Commit(FormCommit.MemoMessage.Lines);
     381    end;
     382  finally
     383    FormCommit.Free;
    352384  end;
    353385end;
  • trunk/Forms/FormBrowse.lfm

    r22 r23  
    11object FormBrowse: TFormBrowse
    22  Left = 479
    3   Height = 538
     3  Height = 807
    44  Top = 279
    5   Width = 964
     5  Width = 1446
    66  Caption = 'Browse'
    7   ClientHeight = 538
    8   ClientWidth = 964
     7  ClientHeight = 807
     8  ClientWidth = 1446
     9  DesignTimePPI = 144
    910  Menu = MainMenu1
    1011  OnCreate = FormCreate
    1112  OnDestroy = FormDestroy
    1213  OnShow = FormShow
    13   LCLVersion = '1.5'
     14  LCLVersion = '3.6.0.0'
    1415  object TreeView1: TTreeView
    1516    Left = 0
    16     Height = 538
     17    Height = 807
    1718    Top = 0
    18     Width = 241
     19    Width = 362
    1920    Align = alLeft
    20     DefaultItemHeight = 24
    2121    TabOrder = 0
    2222  end
    2323  object Splitter1: TSplitter
    24     Left = 241
    25     Height = 538
     24    Left = 362
     25    Height = 807
    2626    Top = 0
    27     Width = 5
     27    Width = 8
    2828  end
    2929  object ListView1: TListView
    30     Left = 246
    31     Height = 538
     30    Left = 370
     31    Height = 807
    3232    Top = 0
    33     Width = 718
     33    Width = 1076
    3434    Align = alClient
    3535    Columns = <   
    3636      item
    3737        Caption = 'Name'
    38         Width = 300
     38        Width = 450
    3939      end   
    4040      item
    4141        Caption = 'Revision'
    42         Width = 80
     42        Width = 120
    4343      end   
    4444      item
    4545        Caption = 'Last change date'
    46         Width = 100
     46        Width = 150
    4747      end   
    4848      item
    4949        Caption = 'Last author'
    50         Width = 100
     50        Width = 150
    5151      end   
    5252      item
    5353        Caption = 'Status'
    54         Width = 259
     54        Width = 388
    5555      end>
    5656    OwnerData = True
     
    6767  object PopupMenu1: TPopupMenu
    6868    Images = Core.ImageList1
    69     left = 353
    70     top = 131
     69    Left = 530
     70    Top = 197
    7171    object MenuItem1: TMenuItem
    7272      Action = AAdd
     
    9393  object ActionList1: TActionList
    9494    Images = Core.ImageList1
    95     left = 352
    96     top = 208
     95    Left = 528
     96    Top = 312
    9797    object AAdd: TAction
    9898      Caption = 'Add'
     
    123123  end
    124124  object MainMenu1: TMainMenu
    125     left = 429
    126     top = 516
     125    Left = 644
     126    Top = 774
    127127  end
    128128end
  • trunk/Forms/FormBrowse.pas

    r22 r23  
    1 unit UFormBrowse;
     1unit FormBrowse;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    7   ExtCtrls, Menus, ActnList, FindFile, UVCS, Contnrs, LazFileUtils;
     7  ExtCtrls, Menus, ActnList, FindFile, VCS, Generics.Collections, LazFileUtils;
    88
    99type
     
    4545      Selected: Boolean);
    4646  private
    47     FileList: TObjectList;
     47    FileList: TFileStatusList;
    4848  public
    4949    Directory: string;
     
    5252  end;
    5353
    54 var
    55   FormBrowse: TFormBrowse;
    56 
    5754
    5855implementation
    5956
    6057uses
    61   UCore, UFormLog;
     58  Core, FormLog;
    6259
    6360{$R *.lfm}
     
    9693
    9794procedure TFormBrowse.ALogShowExecute(Sender: TObject);
    98 begin
    99   FormLog.FileName := Directory + DirectorySeparator + ListView1.Selected.Caption;
    100   FormLog.ShowModal;
     95var
     96  FormLog: TFormLog;
     97begin
     98  FormLog := TFormLog.Create(nil);
     99  try
     100    FormLog.FileName := Directory + DirectorySeparator + ListView1.Selected.Caption;
     101    FormLog.ShowModal;
     102  finally
     103    FormLog.Free;
     104  end;
    101105end;
    102106
    103107procedure TFormBrowse.AAddExecute(Sender: TObject);
    104108begin
    105   Core.Project.WorkingCopy.Add(Directory + DirectorySeparator + ListView1.Selected.Caption);
     109  Core.Core.Project.WorkingCopy.Add(Directory + DirectorySeparator + ListView1.Selected.Caption);
    106110end;
    107111
     
    126130begin
    127131  if InputQuery('Rename', 'Enter new name', NewName) then
    128     Core.Project.WorkingCopy.Move(Directory + DirectorySeparator + ListView1.Selected.Caption, NewName);
     132    Core.Core.Project.WorkingCopy.Move(Directory + DirectorySeparator + ListView1.Selected.Caption, NewName);
    129133end;
    130134
    131135procedure TFormBrowse.FormCreate(Sender: TObject);
    132136begin
    133   FileList := TObjectList.Create;
     137  FileList := TFileStatusList.Create;
    134138end;
    135139
    136140procedure TFormBrowse.FormDestroy(Sender: TObject);
    137141begin
    138   FileList.Free;
     142  FreeAndNil(FileList);
    139143end;
    140144
     
    155159begin
    156160  FileList.Clear;
    157   if Assigned(Core.Project) then begin
     161  if Assigned(Core.Core.Project) then begin
    158162  FileStatusList := TFileStatusList.Create;
    159163  try
    160   Core.Project.WorkingCopy.GetStatus(Directory, FileStatusList);
     164  Core.Core.Project.WorkingCopy.GetStatus(Directory, FileStatusList);
    161165
    162166  if DirectoryExistsUTF8(Directory) then begin
     
    172176        NewFileItem.FileName := FoundFileList[I];
    173177        RelativeName := NewFileItem.FileName;
    174         if Copy(RelativeName, 1, Length(Core.Project.WorkingCopy.Path)) = Core.Project.WorkingCopy.Path then
    175           Delete(RelativeName, 1, Length(Core.Project.WorkingCopy.Path));
     178        if Copy(RelativeName, 1, Length(Core.Core.Project.WorkingCopy.Path)) = Core.Core.Project.WorkingCopy.Path then
     179          Delete(RelativeName, 1, Length(Core.Core.Project.WorkingCopy.Path));
    176180        if Copy(RelativeName, 1, 1) = DirectorySeparator then
    177181          Delete(RelativeName, 1, Length(DirectorySeparator));
  • trunk/Forms/FormCheckout.pas

    r22 r23  
    1 unit UFormCheckout;
     1unit FormCheckout;
    22
    33interface
     
    2828  end;
    2929
    30 var
    31   FormCheckout: TFormCheckout;
    32 
    3330
    3431implementation
     
    3734
    3835uses
    39   UCore, UBackend;
     36  Core, Backend;
    4037
    4138{ TFormCheckout }
     
    5451begin
    5552  ComboBox1.Clear;
    56   for I := 0 to Core.Backends.Count - 1 do
    57     ComboBox1.AddItem(TBackend(Core.Backends[I]).Name, Core.Backends[I]);
     53  for I := 0 to Core.Core.Backends.Count - 1 do
     54    ComboBox1.AddItem(Core.Core.Backends[I].Name, Core.Core.Backends[I]);
    5855  if ComboBox1.Items.Count > 0 then
    5956    ComboBox1.ItemIndex := 0;
  • trunk/Forms/FormCommit.pas

    r22 r23  
    1 unit UFormCommit;
     1unit FormCommit;
    22
    33interface
  • trunk/Forms/FormConsole.pas

    r22 r23  
    1 unit UFormConsole;
     1unit FormConsole;
    22
    33interface
     
    3333    procedure Perform;
    3434  end;
    35 
    36 var
    37   FormConsole: TFormConsole;
    3835
    3936
  • trunk/Forms/FormFavorites.pas

    r22 r23  
    1 unit UFormFavorites;
     1unit FormFavorites;
    22
    33interface
     
    1010  end;
    1111
    12 var
    13   FormFavorites: TFormFavorites;
    14 
    1512
    1613implementation
  • trunk/Forms/FormLog.pas

    r22 r23  
    1 unit UFormLog;
     1unit FormLog;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    7   StdCtrls, ExtCtrls, UVCS;
     7  StdCtrls, ExtCtrls, VCS;
    88
    99type
     
    3232  end;
    3333
    34 var
    35   FormLog: TFormLog;
    36 
    3734
    3835implementation
    3936
    4037uses
    41   UCore;
     38  Core;
    4239
    4340{$R *.lfm}
     
    5754procedure TFormLog.FormShow(Sender: TObject);
    5855begin
    59   Core.Project.WorkingCopy.GetLog(FileName, LogList);
     56  Core.Core.Project.WorkingCopy.GetLog(FileName, LogList);
    6057  ReloadList;
    6158end;
  • trunk/Forms/FormMain.lfm

    r22 r23  
    11object FormMain: TFormMain
    22  Left = 687
    3   Height = 801
     3  Height = 767
    44  Top = 411
    55  Width = 1408
    66  Caption = 'VCSCommander'
    7   ClientHeight = 801
     7  ClientHeight = 767
    88  ClientWidth = 1408
    99  DesignTimePPI = 144
     
    1111  OnActivate = FormActivate
    1212  OnClose = FormClose
     13  OnCreate = FormCreate
     14  OnDestroy = FormDestroy
    1315  OnShow = FormShow
    1416  Position = poScreenCenter
     
    4345    Left = 0
    4446    Height = 28
    45     Top = 773
     47    Top = 739
    4648    Width = 1408
    4749    Panels = <>
  • trunk/Forms/FormMain.pas

    r22 r23  
    1 unit UFormMain;
     1unit FormMain;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    7   Menus, ActnList, ExtCtrls;
     7  Menus, ActnList, ExtCtrls, FormBrowse, FormProjectGroup;
    88
    99type
     
    5050    procedure FormActivate(Sender: TObject);
    5151    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     52    procedure FormCreate(Sender: TObject);
     53    procedure FormDestroy(Sender: TObject);
    5254    procedure FormShow(Sender: TObject);
    5355    procedure MenuItemFileClick(Sender: TObject);
     
    5557    Initialized: Boolean;
    5658  public
     59    FormBrowse: TFormBrowse;
     60    FormProjectGroup: TFormProjectGroup;
    5761    procedure ProjectGroupOpenRecentExecute(Sender: TObject);
    5862    procedure OpenRecentExecute(Sender: TObject);
     
    6064    procedure DockInit;
    6165  end;
    62 
    63 var
    64   FormMain: TFormMain;
    6566
    6667
     
    7071
    7172uses
    72   UCore, UFormBrowse, UFormProjectGroup;
     73  Core;
    7374
    7475{ TFormMain }
     
    8687procedure TFormMain.OpenRecentExecute(Sender: TObject);
    8788begin
    88   Core.ProjectOpen(Core.LastOpenedListProject.Items[TMenuItem(Sender).MenuIndex]);
     89  Core.Core.ProjectOpen(Core.Core.LastOpenedListProject.Items[TMenuItem(Sender).MenuIndex]);
    8990end;
    9091
    9192procedure TFormMain.ProjectGroupOpenRecentExecute(Sender: TObject);
    9293begin
    93   Core.ProjectGroupOpen(Core.LastOpenedListProjectGroup.Items[TMenuItem(Sender).MenuIndex]);
     94  Core.Core.ProjectGroupOpen(Core.Core.LastOpenedListProjectGroup.Items[TMenuItem(Sender).MenuIndex]);
    9495end;
    9596
     
    9899  if not Initialized then begin
    99100    Initialized := True;
    100     Core.Init;
     101    Core.Core.Init;
    101102  end;
    102103end;
     
    104105procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    105106begin
    106   Core.Done;
     107  Core.Core.Done;
     108end;
     109
     110procedure TFormMain.FormCreate(Sender: TObject);
     111begin
     112  FormBrowse := TFormBrowse.Create(nil);
     113  FormProjectGroup := TFormProjectGroup.Create(nil);
     114end;
     115
     116procedure TFormMain.FormDestroy(Sender: TObject);
     117begin
     118  FreeAndNil(FormProjectGroup);
     119  FreeAndNil(FormBrowse);
    107120end;
    108121
     
    114127begin
    115128  NewCaption := '';
    116   if Assigned(Core.Project) then
    117     NewCaption := Core.Project.Directory + ' (' + Core.Project.Backend.Name + ') - ';
     129  if Assigned(Core.Core.Project) then
     130    NewCaption := Core.Core.Project.Directory + ' (' + Core.Core.Project.Backend.Name + ') - ';
    118131  NewCaption := NewCaption + AppName;
    119132  Caption := NewCaption;
  • trunk/Forms/FormProjectGroup.pas

    r22 r23  
    1 unit UFormProjectGroup;
     1unit FormProjectGroup;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    7   Menus, ActnList, UProject, LazFileUtils;
     7  Menus, ActnList, Project, LazFileUtils;
    88
    99type
     
    2727  end;
    2828
    29 var
    30   FormProjectGroup: TFormProjectGroup;
    31 
    3229
    3330implementation
     
    3633
    3734uses
    38   UCore;
     35  Core;
    3936
    4037{ TFormProjectGroup }
     
    5047begin
    5148  TreeView1.Items.Clear;
    52   if Assigned(Core.ProjectGroup) then begin
    53     TreeView1.Items.AddChild(nil, ExtractFileNameOnly(Core.ProjectGroup.FileName));
    54     for I := 0 to Core.ProjectGroup.Projects.Count - 1 do
     49  if Assigned(Core.Core.ProjectGroup) then begin
     50    TreeView1.Items.AddChild(nil, ExtractFileNameOnly(Core.Core.ProjectGroup.FileName));
     51    for I := 0 to Core.Core.ProjectGroup.Projects.Count - 1 do
    5552      TreeView1.Items.AddChildObject(TreeView1.TopItem,
    56         ExtractFileName(TProject(Core.ProjectGroup.Projects[I]).Directory),
    57         Core.ProjectGroup.Projects[I]);
     53        ExtractFileName(Core.Core.ProjectGroup.Projects[I].Directory),
     54        Core.Core.ProjectGroup.Projects[I]);
    5855  end;
    5956  UpdateInterface;
  • trunk/Forms/FormSettings.lfm

    r22 r23  
    11object FormSettings: TFormSettings
    22  Left = 342
    3   Height = 497
     3  Height = 746
    44  Top = 145
    5   Width = 686
     5  Width = 1029
    66  Caption = 'Settings'
    7   ClientHeight = 497
    8   ClientWidth = 686
     7  ClientHeight = 746
     8  ClientWidth = 1029
     9  DesignTimePPI = 144
    910  OnCreate = FormCreate
    10   LCLVersion = '1.5'
     11  LCLVersion = '3.6.0.0'
    1112  object ButtonCancel: TButton
    12     Left = 592
    13     Height = 25
    14     Top = 464
    15     Width = 75
     13    Left = 888
     14    Height = 38
     15    Top = 696
     16    Width = 112
    1617    Caption = 'Cancel'
    1718    ModalResult = 2
     
    1920  end
    2021  object ButtonOk: TButton
    21     Left = 496
    22     Height = 25
    23     Top = 464
    24     Width = 75
     22    Left = 744
     23    Height = 38
     24    Top = 696
     25    Width = 112
    2526    Caption = 'Ok'
    2627    ModalResult = 1
     
    2829  end
    2930  object Label1: TLabel
    30     Left = 16
    31     Height = 25
    32     Top = 16
    33     Width = 107
     31    Left = 24
     32    Height = 26
     33    Top = 24
     34    Width = 97
    3435    Caption = 'User name:'
    3536    ParentColor = False
    3637  end
    3738  object Label2: TLabel
    38     Left = 16
    39     Height = 25
    40     Top = 64
    41     Width = 57
     39    Left = 24
     40    Height = 26
     41    Top = 96
     42    Width = 52
    4243    Caption = 'Email:'
    4344    ParentColor = False
    4445  end
    4546  object EditUserName: TEdit
    46     Left = 152
    47     Height = 35
    48     Top = 8
    49     Width = 264
     47    Left = 228
     48    Height = 43
     49    Top = 12
     50    Width = 396
    5051    TabOrder = 2
    5152  end
    5253  object EditEmail: TEdit
    53     Left = 152
    54     Height = 35
    55     Top = 56
    56     Width = 264
     54    Left = 228
     55    Height = 43
     56    Top = 84
     57    Width = 396
    5758    TabOrder = 3
    5859  end
  • trunk/Forms/FormSettings.pas

    r22 r23  
    1 unit UFormSettings;
     1unit FormSettings;
    22
    33interface
     
    2424  end;
    2525
    26 var
    27   FormSettings: TFormSettings;
    28 
    2926
    3027implementation
     
    3330
    3431uses
    35   UCore;
     32  Core;
    3633
    3734{ TFormSettings }
     
    4441procedure TFormSettings.Load(XMLConfig: TXMLConfig);
    4542begin
    46   EditUserName.Text := Core.UserName;
    47   EditEmail.Text := Core.Email;
     43  EditUserName.Text := Core.Core.UserName;
     44  EditEmail.Text := Core.Core.Email;
    4845end;
    4946
    5047procedure TFormSettings.Save(XMLConfig: TXMLConfig);
    5148begin
    52   Core.UserName := EditUserName.Text;
    53   Core.Email := EditEmail.Text;
     49  Core.Core.UserName := EditUserName.Text;
     50  Core.Core.Email := EditEmail.Text;
    5451end;
    5552
  • trunk/Forms/FormTest.lfm

    r22 r23  
    11object FormTest: TFormTest
    22  Left = 477
    3   Height = 587
     3  Height = 880
    44  Top = 365
    5   Width = 878
     5  Width = 1317
    66  Caption = 'Test'
    7   ClientHeight = 587
    8   ClientWidth = 878
     7  ClientHeight = 880
     8  ClientWidth = 1317
     9  DesignTimePPI = 144
    910  OnShow = FormShow
    10   LCLVersion = '1.5'
     11  LCLVersion = '3.6.0.0'
    1112  object ListView1: TListView
    12     Left = 16
    13     Height = 512
    14     Top = 64
    15     Width = 856
     13    Left = 24
     14    Height = 768
     15    Top = 96
     16    Width = 1284
    1617    Anchors = [akTop, akLeft, akRight, akBottom]
    1718    Columns = <   
    1819      item
    1920        Caption = 'Action'
    20         Width = 250
     21        Width = 375
    2122      end   
    2223      item
    2324        Caption = 'Duration'
    24         Width = 100
     25        Width = 150
    2526      end   
    2627      item
    2728        Caption = 'Result'
    28         Width = 489
     29        Width = 744
    2930      end>
    3031    ReadOnly = True
     
    3435  end
    3536  object ButtonStart: TButton
    36     Left = 776
    37     Height = 25
    38     Top = 24
    39     Width = 75
     37    Left = 1164
     38    Height = 38
     39    Top = 36
     40    Width = 112
    4041    Caption = 'Start'
     42    TabOrder = 1
    4143    OnClick = ButtonStartClick
    42     TabOrder = 1
    4344  end
    4445  object ComboBox1: TComboBox
    45     Left = 136
    46     Height = 37
    47     Top = 19
    48     Width = 324
     46    Left = 204
     47    Height = 42
     48    Top = 28
     49    Width = 486
    4950    ItemHeight = 0
    5051    Style = csDropDownList
     
    5253  end
    5354  object Label1: TLabel
    54     Left = 14
    55     Height = 25
    56     Top = 19
    57     Width = 85
     55    Left = 21
     56    Height = 26
     57    Top = 28
     58    Width = 78
    5859    Caption = 'Backend:'
    5960    ParentColor = False
  • trunk/Forms/FormTest.pas

    r22 r23  
    1 unit UFormTest;
     1unit FormTest;
    22
    33interface
     
    2424  end;
    2525
    26 var
    27   FormTest: TFormTest;
    28 
    2926
    3027implementation
     
    3330
    3431uses
    35   UCore, UBackend, UProject, UVCS;
     32  Core, Backend, Project, VCS;
    3633
    3734{ TFormTest }
     
    4239begin
    4340  ComboBox1.Clear;
    44   for I := 0 to Core.Backends.Count - 1 do
    45     ComboBox1.AddItem(TBackend(Core.Backends[I]).Name, Core.Backends[I]);
     41  for I := 0 to Core.Core.Backends.Count - 1 do
     42    ComboBox1.AddItem(Core.Core.Backends[I].Name, Core.Core.Backends[I]);
    4643  if ComboBox1.Items.Count > 0 then
    4744    ComboBox1.ItemIndex := 0;
     
    7168  ListView1.Items.Clear;
    7269  Project := TProject.Create;
    73   Project.Backend := TBackend(Core.Backends[ComboBox1.ItemIndex]);
    74   Project.WorkingCopy.UserName := Core.UserName;
    75   Project.WorkingCopy.Email := Core.Email;
     70  Project.Backend := Core.Core.Backends[ComboBox1.ItemIndex];
     71  Project.WorkingCopy.UserName := Core.Core.UserName;
     72  Project.WorkingCopy.Email := Core.Core.Email;
    7673  try
    7774    //RemoveDir(TestDir);
  • trunk/Languages/VCSCommander.cs.po

    r22 r23  
    1212"X-Generator: Poedit 3.4.2\n"
    1313
    14 #: uproject.swrongfileformat
     14#: project.swrongfileformat
     15#, fuzzy
     16msgctxt "project.swrongfileformat"
    1517msgid "Wrong file format"
    1618msgstr "ŠpatnÜ formát souboru"
     19
  • trunk/Languages/VCSCommander.pot

    r22 r23  
    22msgstr "Content-Type: text/plain; charset=UTF-8"
    33
    4 #: uproject.swrongfileformat
     4#: project.swrongfileformat
     5msgctxt "project.swrongfileformat"
    56msgid "Wrong file format"
    67msgstr ""
  • trunk/Units/Backend.pas

    r22 r23  
    1 unit UBackend;
     1unit Backend;
    22
    33interface
    44
    55uses
    6   Classes, SysUtils, UVCS;
     6  Classes, SysUtils, VCS;
    77
    88type
  • trunk/Units/Project.pas

    r22 r23  
    1 unit UProject;
     1unit Project;
    22
    33interface
    44
    55uses
    6   Classes, SysUtils, UVCS, UBackend, Contnrs, DOM, XMLRead, XMLWrite, XML,
    7   LazFileUtils;
     6  Classes, SysUtils, VCS, Backend, Generics.Collections, DOM, XMLRead, XMLWrite,
     7  XML, LazFileUtils;
    88
    99type
     
    3434  { TProjects }
    3535
    36   TProjects = class(TObjectList)
     36  TProjects = class(TObjectList<TProject>)
    3737    procedure LoadXMLNode(Node: TDOMNode);
    3838    procedure SaveXMLNode(Node: TDOMNode);
     
    8484end;
    8585
    86 
    8786{ TProjectGroup }
    8887
     
    9493destructor TProjectGroup.Destroy;
    9594begin
    96   Projects.Free;
    97   inherited Destroy;
     95  FreeAndNil(Projects);
     96  inherited;
    9897end;
    9998
     
    190189destructor TProject.Destroy;
    191190begin
    192   WorkingCopy.Free;
    193   Repository.Free;
    194   inherited Destroy;
     191  FreeAndNil(WorkingCopy);
     192  FreeAndNil(Repository);
     193  inherited;
    195194end;
    196195
  • trunk/Units/VCS.pas

    r22 r23  
    1 unit UVCS;
     1unit VCS;
    22
    33interface
    44
    55uses
    6   Classes, SysUtils, LazFileUtils, Contnrs;
     6  Classes, SysUtils, LazFileUtils, Generics.Collections;
    77
    88type
     
    2121  end;
    2222
    23   TLogList = class(TObjectList)
    24 
     23  TLogList = class(TObjectList<TLogItem>)
    2524  end;
    2625
     
    4039  { TFileStatusList }
    4140
    42   TFileStatusList = class(TObjectList)
     41  TFileStatusList = class(TObjectList<TFileStatus>)
    4342    function SearchByName(Name: string): TFileStatus;
    4443  end;
     
    102101
    103102uses
    104   UFormConsole;
     103  FormConsole;
    105104
    106105function URLFromDirectory(DirName: string; Relative: Boolean): string;
     
    138137procedure TRepository.ExecuteProcess(Command: string;
    139138  Parameters: array of string);
    140 begin
    141   FormConsole.Executable := Command;
    142   FormConsole.Parameters.Clear;
    143   FormConsole.Parameters.AddStrings(Parameters);
    144   if DirectoryExistsUTF8(Path) then FormConsole.WorkingDir := Path
    145     else FormConsole.WorkingDir := '';
    146   FormConsole.ShowModal;
    147   ExecutionOutput.Assign(FormConsole.Log);
     139var
     140  FormConsole: TFormConsole;
     141begin
     142  FormConsole := TFormConsole.Create(nil);
     143  try
     144    FormConsole.Executable := Command;
     145    FormConsole.Parameters.Clear;
     146    FormConsole.Parameters.AddStrings(Parameters);
     147    if DirectoryExistsUTF8(Path) then FormConsole.WorkingDir := Path
     148      else FormConsole.WorkingDir := '';
     149    FormConsole.ShowModal;
     150    ExecutionOutput.Assign(FormConsole.Log);
     151  finally
     152    FormConsole.Free;
     153  end;
    148154end;
    149155
     
    162168begin
    163169  FreeAndNil(ExecutionOutput);
    164   inherited Destroy;
     170  inherited;
    165171end;
    166172
     
    175181destructor TLogItem.Destroy;
    176182begin
    177   Messages.Free;
    178   ChangedFiles.Free;
    179   inherited Destroy;
     183  FreeAndNil(Messages);
     184  FreeAndNil(ChangedFiles);
     185  inherited;
    180186end;
    181187
     
    191197procedure TWorkingCopy.SetRepositoryURL(AValue: string);
    192198begin
    193   if FRepositoryURL=AValue then Exit;
    194   FRepositoryURL:=AValue;
     199  if FRepositoryURL = AValue then Exit;
     200  FRepositoryURL := AValue;
    195201end;
    196202
    197203procedure TWorkingCopy.ExecuteProcess(Command: string; Parameters: array of string);
    198 begin
    199   FormConsole.Executable := Command;
    200   FormConsole.EnvironmentVariables.Assign(EnvVars);
    201   FormConsole.Parameters.Clear;
    202   FormConsole.Parameters.AddStrings(Parameters);
    203   if DirectoryExistsUTF8(Path) then FormConsole.WorkingDir := Path
    204     else FormConsole.WorkingDir := '';
    205   if SilentExecution then FormConsole.Perform
    206     else FormConsole.ShowModal;
    207   ExecutionOutput.Assign(FormConsole.Log);
     204var
     205  FormConsole: TFormConsole;
     206begin
     207  FormConsole := TFormConsole.Create(nil);
     208  try
     209    FormConsole.Executable := Command;
     210    FormConsole.EnvironmentVariables.Assign(EnvVars);
     211    FormConsole.Parameters.Clear;
     212    FormConsole.Parameters.AddStrings(Parameters);
     213    if DirectoryExistsUTF8(Path) then FormConsole.WorkingDir := Path
     214      else FormConsole.WorkingDir := '';
     215    if SilentExecution then FormConsole.Perform
     216      else FormConsole.ShowModal;
     217    ExecutionOutput.Assign(FormConsole.Log);
     218  finally
     219    FormConsole.Free;
     220  end;
    208221end;
    209222
     
    286299  FreeAndNil(EnvVars);
    287300  FreeAndNil(ExecutionOutput);
    288   inherited Destroy;
     301  inherited;
    289302end;
    290303
  • trunk/VCSCommander.lpi

    r22 r23  
    9898      </Unit0>
    9999      <Unit1>
    100         <Filename Value="Forms/UFormMain.pas"/>
     100        <Filename Value="Forms/FormMain.pas"/>
    101101        <IsPartOfProject Value="True"/>
    102102        <ComponentName Value="FormMain"/>
     
    105105      </Unit1>
    106106      <Unit2>
    107         <Filename Value="UCore.pas"/>
     107        <Filename Value="Core.pas"/>
    108108        <IsPartOfProject Value="True"/>
    109109        <ComponentName Value="Core"/>
     
    112112      </Unit2>
    113113      <Unit3>
    114         <Filename Value="Forms/UFormBrowse.pas"/>
     114        <Filename Value="Forms/FormBrowse.pas"/>
    115115        <IsPartOfProject Value="True"/>
    116116        <ComponentName Value="FormBrowse"/>
     
    119119      </Unit3>
    120120      <Unit4>
    121         <Filename Value="Units/UVCS.pas"/>
     121        <Filename Value="Units/VCS.pas"/>
    122122        <IsPartOfProject Value="True"/>
    123123      </Unit4>
    124124      <Unit5>
    125         <Filename Value="Forms/UFormFavorites.pas"/>
     125        <Filename Value="Forms/FormFavorites.pas"/>
    126126        <IsPartOfProject Value="True"/>
    127127        <ComponentName Value="FormFavorites"/>
     
    130130      </Unit5>
    131131      <Unit6>
    132         <Filename Value="Forms/UFormSettings.pas"/>
     132        <Filename Value="Forms/FormSettings.pas"/>
    133133        <IsPartOfProject Value="True"/>
    134134        <ComponentName Value="FormSettings"/>
     
    137137      </Unit6>
    138138      <Unit7>
    139         <Filename Value="Backends/Subversion/USubversion.pas"/>
     139        <Filename Value="Backends/Subversion/Subversion.pas"/>
    140140        <IsPartOfProject Value="True"/>
    141141      </Unit7>
    142142      <Unit8>
    143         <Filename Value="Units/UProject.pas"/>
     143        <Filename Value="Units/Project.pas"/>
    144144        <IsPartOfProject Value="True"/>
    145145      </Unit8>
    146146      <Unit9>
    147         <Filename Value="Forms/UFormConsole.pas"/>
     147        <Filename Value="Forms/FormConsole.pas"/>
    148148        <IsPartOfProject Value="True"/>
    149149        <ComponentName Value="FormConsole"/>
     
    152152      </Unit9>
    153153      <Unit10>
    154         <Filename Value="Forms/UFormCommit.pas"/>
     154        <Filename Value="Forms/FormCommit.pas"/>
    155155        <IsPartOfProject Value="True"/>
    156156        <ComponentName Value="FormCommit"/>
     
    159159      </Unit10>
    160160      <Unit11>
    161         <Filename Value="Forms/UFormCheckout.pas"/>
     161        <Filename Value="Forms/FormCheckout.pas"/>
    162162        <IsPartOfProject Value="True"/>
    163163        <ComponentName Value="FormCheckout"/>
     
    166166      </Unit11>
    167167      <Unit12>
    168         <Filename Value="Backends/Bazaar/UBazaar.pas"/>
     168        <Filename Value="Backends/Bazaar/Bazaar.pas"/>
    169169        <IsPartOfProject Value="True"/>
    170170      </Unit12>
    171171      <Unit13>
    172         <Filename Value="Units/UBackend.pas"/>
     172        <Filename Value="Units/Backend.pas"/>
    173173        <IsPartOfProject Value="True"/>
    174174      </Unit13>
    175175      <Unit14>
    176         <Filename Value="Backends/CVS/UCVS.pas"/>
     176        <Filename Value="Backends/CVS/CVS.pas"/>
    177177        <IsPartOfProject Value="True"/>
    178178      </Unit14>
    179179      <Unit15>
    180         <Filename Value="Forms/UFormLog.pas"/>
     180        <Filename Value="Forms/FormLog.pas"/>
    181181        <IsPartOfProject Value="True"/>
    182182        <ComponentName Value="FormLog"/>
     
    185185      </Unit15>
    186186      <Unit16>
    187         <Filename Value="Backends/Git/UGit.pas"/>
     187        <Filename Value="Backends/Git/Git.pas"/>
    188188        <IsPartOfProject Value="True"/>
    189189      </Unit16>
    190190      <Unit17>
    191         <Filename Value="Forms/UFormTest.pas"/>
     191        <Filename Value="Forms/FormTest.pas"/>
    192192        <IsPartOfProject Value="True"/>
    193193        <ComponentName Value="FormTest"/>
     
    196196      </Unit17>
    197197      <Unit18>
    198         <Filename Value="Forms/UFormProjectGroup.pas"/>
     198        <Filename Value="Forms/FormProjectGroup.pas"/>
    199199        <IsPartOfProject Value="True"/>
    200200        <ComponentName Value="FormProjectGroup"/>
     
    234234    <Linking>
    235235      <Debugging>
     236        <DebugInfoType Value="dsDwarf3"/>
    236237        <UseHeaptrc Value="True"/>
    237238        <UseExternalDbgSyms Value="True"/>
  • trunk/VCSCommander.lpr

    r21 r23  
    11program VCSCommander;
    2 
    3 {$mode objfpc}{$H+}
    42
    53uses
     
    86  {$ENDIF}
    97  Interfaces, // this includes the LCL widgetset
    10   Forms, UFormMain, UCore, Common, UFormBrowse, UVCS,
    11   UFormFavorites, UFormSettings, UFormConsole, USubversion, UProject, SysUtils,
    12   UFormCommit, UFormCheckout, UBazaar, UBackend, UFormLog, UFormTest,
    13   UFormProjectGroup
     8  Forms, FormMain, Core, Common, FormBrowse, VCS,
     9  FormFavorites, FormSettings, FormConsole, Subversion, Project, SysUtils,
     10  FormCommit, FormCheckout, Bazaar, Backend, FormLog, FormTest,
     11  FormProjectGroup
    1412  { you can add units after this };
    1513
     
    3129  RequireDerivedFormResource := True;
    3230  Application.Initialize;
    33   Application.CreateForm(TCore, Core);
    34   Application.CreateForm(TFormMain, FormMain);
    35   Application.CreateForm(TFormBrowse, FormBrowse);
    36   Application.CreateForm(TFormFavorites, FormFavorites);
    37   Application.CreateForm(TFormSettings, FormSettings);
    38   Application.CreateForm(TFormConsole, FormConsole);
    39   Application.CreateForm(TFormCommit, FormCommit);
    40   Application.CreateForm(TFormCheckout, FormCheckout);
    41   Application.CreateForm(TFormLog, FormLog);
    42   Application.CreateForm(TFormTest, FormTest);
    43   Application.CreateForm(TFormProjectGroup, FormProjectGroup);
     31  Application.CreateForm(TCore, Core.Core);
    4432  Application.Run;
    4533end.
Note: See TracChangeset for help on using the changeset viewer.