Changeset 23 for trunk/Forms


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

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.