Changeset 8 for trunk/UCore.pas


Ignore:
Timestamp:
May 18, 2015, 12:15:30 AM (10 years ago)
Author:
chronos
Message:
  • Added: Checkout form and ability to checkout new working copy.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r7 r8  
    1717    ACommandUpdate: TAction;
    1818    ACommandCleanup: TAction;
    19     ACommandCheckout: TAction;
    2019    ACommandCommit: TAction;
    2120    ACommandStatus: TAction;
    22     Action1: TAction;
     21    AProjectCheckout: TAction;
    2322    AProjectClose: TAction;
    2423    ActionList1: TActionList;
     
    3029    ImageList1: TImageList;
    3130    LastOpenedList1: TLastOpenedList;
     31    LastOpenedListNewDir: TLastOpenedList;
     32    LastOpenedListRepoURL: TLastOpenedList;
    3233    OpenDialog1: TOpenDialog;
    3334    XMLConfig1: TXMLConfig;
     
    3637    procedure ACommandCommitExecute(Sender: TObject);
    3738    procedure ACommandUpdateExecute(Sender: TObject);
     39    procedure AProjectCheckoutExecute(Sender: TObject);
    3840    procedure AProjectCloseExecute(Sender: TObject);
    3941    procedure AProjectOpenExecute(Sender: TObject);
     
    6264
    6365uses
    64   UFormMain, UFormBrowse, UFormSettings, UFormCommit;
     66  UFormMain, UFormBrowse, UFormSettings, UFormCommit, UFormCheckout;
    6567
    6668{ TCore }
     
    100102begin
    101103  LastOpenedList1.LoadFromXMLConfig(XMLConfig1, 'LastOpenedProjects');
     104  LastOpenedListRepoURL.LoadFromXMLConfig(XMLConfig1, 'LastOpenedRepoURL');
     105  LastOpenedListNewDir.LoadFromXMLConfig(XMLConfig1, 'LastOpenedNewDir');
    102106end;
    103107
     
    105109begin
    106110  LastOpenedList1.SaveToXMLConfig(XMLConfig1, 'LastOpenedProjects');
     111  LastOpenedListRepoURL.SaveToXMLConfig(XMLConfig1, 'LastOpenedRepoURL');
     112  LastOpenedListNewDir.SaveToXMLConfig(XMLConfig1, 'LastOpenedNewDir');
    107113end;
    108114
     
    146152begin
    147153  FreeAndNil(Project);
     154  FormBrowse.Directory := '';
     155  FormBrowse.ReloadList;
    148156  UpdateInterface;
    149157end;
     
    154162end;
    155163
     164procedure TCore.AProjectCheckoutExecute(Sender: TObject);
     165var
     166  TempProject: TProject;
     167begin
     168  if LastOpenedListRepoURL.Items.Count > 0 then
     169    FormCheckout.EditURL.Text := LastOpenedListRepoURL.Items[0];
     170  if LastOpenedListNewDir.Items.Count > 0 then
     171    FormCheckout.EditDir.Text := LastOpenedListNewDir.Items[0];
     172  if FormCheckout.ShowModal = mrOk then begin
     173    LastOpenedListRepoURL.AddItem(FormCheckout.EditURL.Text);
     174    LastOpenedListNewDir.AddItem(FormCheckout.EditDir.Text);
     175    TempProject := TProject.Create;
     176    try
     177      TempProject.VCSType := vtSubversion;
     178      TempProject.Directory := FormCheckout.EditDir.Text;
     179      TempProject.RepositoryURL := FormCheckout.EditURL.Text;
     180      TempProject.WorkingCopy.Checkout;
     181    finally
     182      TempProject.Free;
     183    end;
     184    ProjectOpen(FormCheckout.EditDir.Text);
     185  end;
     186end;
     187
    156188procedure TCore.ACommandCleanupExecute(Sender: TObject);
    157189begin
    158   Project.WorkingCopy.CleanUp;
     190  Project.WorkingCopy.Cleanup;
    159191end;
    160192
    161193procedure TCore.ACommandCheckoutExecute(Sender: TObject);
    162194begin
    163   Project.WorkingCopy.Checkout;
     195
    164196end;
    165197
Note: See TracChangeset for help on using the changeset viewer.