Changeset 7


Ignore:
Timestamp:
May 17, 2015, 10:51:50 PM (10 years ago)
Author:
chronos
Message:
  • Added: Commit form.
Location:
trunk
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormBrowse.lfm

    r6 r7  
    1414    Width = 241
    1515    Align = alLeft
    16     DefaultItemHeight = 24
     16    DefaultItemHeight = 28
    1717    TabOrder = 0
    1818  end
     
    5151      end>
    5252    OwnerData = True
     53    PopupMenu = PopupMenu1
    5354    ReadOnly = True
    5455    RowSelect = True
     56    SmallImages = Core.ImageList1
    5557    TabOrder = 2
    5658    ViewStyle = vsReport
    5759    OnData = ListView1Data
     60    OnDblClick = AOpenExecute
     61  end
     62  object PopupMenu1: TPopupMenu
     63    Images = Core.ImageList1
     64    left = 353
     65    top = 131
     66    object MenuItem1: TMenuItem
     67      Action = AAdd
     68    end
     69    object MenuItem2: TMenuItem
     70      Action = ADelete
     71    end
     72    object MenuItem3: TMenuItem
     73      Action = ARename
     74    end
     75    object MenuItem4: TMenuItem
     76      Action = AUpdate
     77    end
     78    object MenuItem5: TMenuItem
     79      Action = AProperties
     80    end
     81    object MenuItem6: TMenuItem
     82      Action = AOpen
     83    end
     84  end
     85  object ActionList1: TActionList
     86    Images = Core.ImageList1
     87    left = 352
     88    top = 208
     89    object AAdd: TAction
     90      Caption = 'Add'
     91    end
     92    object ADelete: TAction
     93      Caption = 'Delete'
     94      OnExecute = ADeleteExecute
     95    end
     96    object ARename: TAction
     97      Caption = 'Rename'
     98    end
     99    object AUpdate: TAction
     100      Caption = 'Update'
     101    end
     102    object AProperties: TAction
     103      Caption = 'Properties'
     104    end
     105    object AOpen: TAction
     106      Caption = 'Open'
     107      OnExecute = AOpenExecute
     108    end
    58109  end
    59110end
  • trunk/Forms/UFormBrowse.pas

    r6 r7  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    9   ExtCtrls, UFindFile;
     9  ExtCtrls, Menus, ActnList, UFindFile;
    1010
    1111type
     
    1414
    1515  TFormBrowse = class(TForm)
     16    AAdd: TAction;
     17    AOpen: TAction;
     18    AProperties: TAction;
     19    AUpdate: TAction;
     20    ARename: TAction;
     21    ADelete: TAction;
     22    ActionList1: TActionList;
    1623    ListView1: TListView;
     24    MenuItem1: TMenuItem;
     25    MenuItem2: TMenuItem;
     26    MenuItem3: TMenuItem;
     27    MenuItem4: TMenuItem;
     28    MenuItem5: TMenuItem;
     29    MenuItem6: TMenuItem;
     30    PopupMenu1: TPopupMenu;
    1731    Splitter1: TSplitter;
    1832    TreeView1: TTreeView;
     33    procedure ADeleteExecute(Sender: TObject);
     34    procedure AOpenExecute(Sender: TObject);
    1935    procedure ListView1Data(Sender: TObject; Item: TListItem);
     36    procedure ListView1DblClick(Sender: TObject);
    2037  private
    2138    FileList: TStringList;
     
    4158end;
    4259
     60procedure TFormBrowse.ListView1DblClick(Sender: TObject);
     61begin
     62
     63end;
     64
     65procedure TFormBrowse.ADeleteExecute(Sender: TObject);
     66begin
     67
     68end;
     69
     70procedure TFormBrowse.AOpenExecute(Sender: TObject);
     71begin
     72  if Assigned(ListView1.Selected) then
     73  with ListView1.Selected do begin
     74    if Caption = '..' then begin
     75      Directory := ExtractFileDir(Directory);
     76      ReloadList;
     77    end else
     78    if DirectoryExistsUTF8(Directory + DirectorySeparator + Caption) then begin
     79      Directory := Directory + DirectorySeparator + ListView1.Selected.Caption;
     80      ReloadList;
     81    end;
     82  end;
     83end;
     84
    4385procedure TFormBrowse.ReloadList;
    4486var
     
    4890  FindFile := TFindFile.Create(nil);
    4991  FindFile.Path := Directory;
    50   FindFile.FileMask := '*.*';
     92  FindFile.FileMask := AllFilesMask;
    5193  FindFile.InSubFolders := False;
    5294  FileList := FindFile.SearchForFiles;
    5395  for I := FileList.Count - 1 downto 0 do
    5496    if ExtractFileName(FileList[I]) = '.' then FileList.Delete(I);
     97  FileList.Sort;
    5598  ListView1.Items.Count := FileList.Count;
    5699  ListView1.Refresh;
  • trunk/Forms/UFormSettings.lfm

    r3 r7  
    77  ClientHeight = 497
    88  ClientWidth = 686
    9   LCLVersion = '1.1'
    10   object Button1: TButton
     9  LCLVersion = '1.5'
     10  object ButtonCancel: TButton
    1111    Left = 592
    1212    Height = 25
    1313    Top = 464
    1414    Width = 75
    15     Caption = 'Button1'
     15    Caption = 'Cancel'
     16    ModalResult = 2
    1617    TabOrder = 0
    1718  end
    18   object Button2: TButton
     19  object ButtonOk: TButton
    1920    Left = 496
    2021    Height = 25
    2122    Top = 464
    2223    Width = 75
    23     Caption = 'Button2'
     24    Caption = 'Ok'
     25    ModalResult = 1
    2426    TabOrder = 1
    2527  end
  • trunk/Forms/UFormSettings.pas

    r3 r7  
    1313
    1414  TFormSettings = class(TForm)
    15     Button1: TButton;
    16     Button2: TButton;
     15    ButtonCancel: TButton;
     16    ButtonOk: TButton;
    1717  private
    1818    { private declarations }
  • trunk/UCore.lfm

    r6 r7  
    1717    object ASettings: TAction
    1818      Caption = 'Settings'
     19      OnExecute = ASettingsExecute
    1920    end
    2021    object AAbout: TAction
     
    5556      Caption = 'Status'
    5657    end
     58    object Action1: TAction
     59      Caption = 'Action1'
     60    end
    5761  end
    5862  object ImageList1: TImageList
  • trunk/UCore.pas

    r6 r7  
    2020    ACommandCommit: TAction;
    2121    ACommandStatus: TAction;
     22    Action1: TAction;
    2223    AProjectClose: TAction;
    2324    ActionList1: TActionList;
     
    3839    procedure AProjectOpenExecute(Sender: TObject);
    3940    procedure AQuitExecute(Sender: TObject);
     41    procedure ASettingsExecute(Sender: TObject);
    4042    procedure DataModuleCreate(Sender: TObject);
    4143    procedure DataModuleDestroy(Sender: TObject);
     
    6062
    6163uses
    62   UFormMain, UFormBrowse;
     64  UFormMain, UFormBrowse, UFormSettings, UFormCommit;
    6365
    6466{ TCore }
     
    6769begin
    6870  Application.Terminate;
     71end;
     72
     73procedure TCore.ASettingsExecute(Sender: TObject);
     74begin
     75  FormSettings.ShowModal;
    6976end;
    7077
     
    159166procedure TCore.ACommandCommitExecute(Sender: TObject);
    160167begin
    161   Project.WorkingCopy.Commit;
     168  if FormCommit.ShowModal = mrOk then begin
     169    Project.WorkingCopy.Commit(FormCommit.MemoMessage.Lines);
     170  end;
    162171end;
    163172
  • trunk/Units/USubversion.pas

    r6 r7  
    1919    procedure Update; override;
    2020    procedure CleanUp; override;
    21     procedure Commit; override;
     21    procedure Commit(Message: TStrings); override;
    2222    procedure Move; override;
    2323    procedure Merge; override;
     
    5656end;
    5757
    58 procedure TSubversion.Commit;
     58procedure TSubversion.Commit(Message: TStrings);
    5959begin
    60   Execute(['commit']);
     60  Execute(['commit', '-m "' + Message.Text + '"']);
    6161end;
    6262
  • trunk/Units/UVCS.pas

    r6 r7  
    2222    procedure Update; virtual;
    2323    procedure CleanUp; virtual;
    24     procedure Commit; virtual;
     24    procedure Commit(Message: TStrings); virtual;
    2525    procedure Move; virtual;
    2626    procedure Merge; virtual;
     
    7171end;
    7272
    73 procedure TWorkingCopy.Commit;
     73procedure TWorkingCopy.Commit(Message: TStrings);
    7474begin
    7575
  • trunk/VCSCommander.lpi

    r6 r7  
    8383      </Item4>
    8484    </RequiredPackages>
    85     <Units Count="10">
     85    <Units Count="11">
    8686      <Unit0>
    8787        <Filename Value="VCSCommander.lpr"/>
     
    9494        <HasResources Value="True"/>
    9595        <ResourceBaseClass Value="Form"/>
    96         <UnitName Value="UFormMain"/>
    9796      </Unit1>
    9897      <Unit2>
     
    102101        <HasResources Value="True"/>
    103102        <ResourceBaseClass Value="DataModule"/>
    104         <UnitName Value="UCore"/>
    105103      </Unit2>
    106104      <Unit3>
     
    110108        <HasResources Value="True"/>
    111109        <ResourceBaseClass Value="Form"/>
    112         <UnitName Value="UFormBrowse"/>
    113110      </Unit3>
    114111      <Unit4>
    115112        <Filename Value="Units/UVCS.pas"/>
    116113        <IsPartOfProject Value="True"/>
    117         <UnitName Value="UVCS"/>
    118114      </Unit4>
    119115      <Unit5>
     
    123119        <HasResources Value="True"/>
    124120        <ResourceBaseClass Value="Form"/>
    125         <UnitName Value="UFormFavorites"/>
    126121      </Unit5>
    127122      <Unit6>
     
    131126        <HasResources Value="True"/>
    132127        <ResourceBaseClass Value="Form"/>
    133         <UnitName Value="UFormSettings"/>
    134128      </Unit6>
    135129      <Unit7>
    136130        <Filename Value="Units/USubversion.pas"/>
    137131        <IsPartOfProject Value="True"/>
    138         <UnitName Value="USubversion"/>
    139132      </Unit7>
    140133      <Unit8>
    141134        <Filename Value="Units/UProject.pas"/>
    142135        <IsPartOfProject Value="True"/>
    143         <UnitName Value="UProject"/>
    144136      </Unit8>
    145137      <Unit9>
     
    149141        <HasResources Value="True"/>
    150142        <ResourceBaseClass Value="Form"/>
    151         <UnitName Value="UFormConsole"/>
    152143      </Unit9>
     144      <Unit10>
     145        <Filename Value="Forms/UFormCommit.pas"/>
     146        <IsPartOfProject Value="True"/>
     147        <ComponentName Value="FormCommit"/>
     148        <HasResources Value="True"/>
     149        <ResourceBaseClass Value="Form"/>
     150      </Unit10>
    153151    </Units>
    154152  </ProjectOptions>
  • trunk/VCSCommander.lpr

    r6 r7  
    99  Interfaces, // this includes the LCL widgetset
    1010  Forms, UFormMain, UCore, Common, TemplateGenerics, UFormBrowse, UVCS,
    11   UFormFavorites, UFormSettings, UFormConsole, USubversion, UProject
     11  UFormFavorites, UFormSettings, UFormConsole, USubversion, UProject,
     12UFormCommit
    1213  { you can add units after this };
    1314
     
    2324  Application.CreateForm(TFormSettings, FormSettings);
    2425  Application.CreateForm(TFormConsole, FormConsole);
     26  Application.CreateForm(TFormCommit, FormCommit);
    2527  Application.Run;
    2628end.
Note: See TracChangeset for help on using the changeset viewer.