Changeset 15 for trunk/Forms
- Timestamp:
- Jul 13, 2015, 11:44:23 AM (9 years ago)
- Location:
- trunk/Forms
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormBrowse.lfm
r13 r15 1 1 object FormBrowse: TFormBrowse 2 Left = 9523 Height = 5 264 Top = 2 875 Width = 7222 Left = 479 3 Height = 538 4 Top = 279 5 Width = 964 6 6 Caption = 'Browse' 7 ClientHeight = 526 8 ClientWidth = 722 7 ClientHeight = 538 8 ClientWidth = 964 9 Menu = MainMenu1 9 10 OnCreate = FormCreate 10 11 OnDestroy = FormDestroy … … 13 14 object TreeView1: TTreeView 14 15 Left = 0 15 Height = 5 2616 Height = 538 16 17 Top = 0 17 18 Width = 241 18 19 Align = alLeft 19 DefaultItemHeight = 2 820 DefaultItemHeight = 24 20 21 TabOrder = 0 21 22 end 22 23 object Splitter1: TSplitter 23 24 Left = 241 24 Height = 5 2625 Height = 538 25 26 Top = 0 26 27 Width = 5 … … 28 29 object ListView1: TListView 29 30 Left = 246 30 Height = 5 2631 Height = 538 31 32 Top = 0 32 Width = 47633 Width = 718 33 34 Align = alClient 34 35 Columns = < … … 121 122 end 122 123 end 124 object MainMenu1: TMainMenu 125 left = 429 126 top = 516 127 end 123 128 end -
trunk/Forms/UFormBrowse.pas
r11 r15 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 9 ExtCtrls, Menus, ActnList, UFindFile, UVCS ;9 ExtCtrls, Menus, ActnList, UFindFile, UVCS, Contnrs; 10 10 11 11 type … … 23 23 ActionList1: TActionList; 24 24 ListView1: TListView; 25 MainMenu1: TMainMenu; 25 26 MenuItem1: TMenuItem; 26 27 MenuItem2: TMenuItem; … … 46 47 Selected: Boolean); 47 48 private 48 FileList: T StringList;49 FileList: TObjectList; 49 50 public 50 51 Directory: string; … … 67 68 procedure TFormBrowse.ListView1Data(Sender: TObject; Item: TListItem); 68 69 begin 69 if (Item.Index >= 0) and (Item.Index < FileList.Count) then begin 70 Item.Caption := ExtractFileName(FileList[Item.Index]); 70 if (Item.Index >= 0) and (Item.Index < FileList.Count) then 71 with TFileStatus(FileList[Item.Index]) do begin 72 Item.Caption := ExtractFileName(FileName); 73 if State <> fssNonVersioned then begin 74 Item.SubItems.Add(Version); 75 Item.SubItems.Add(DateToStr(Time)); 76 Item.SubItems.Add(Author); 77 Item.SubItems.Add(FileStatusStateText[State]); 78 end; 71 79 end; 72 80 end; … … 124 132 procedure TFormBrowse.FormCreate(Sender: TObject); 125 133 begin 126 FileList := T StringList.Create;134 FileList := TObjectList.Create; 127 135 end; 128 136 … … 142 150 FoundFileList: TStrings; 143 151 I: Integer; 144 begin 152 FileStatusList: TFileStatusList; 153 NewFileItem: TFileStatus; 154 FS: TFileStatus; 155 RelativeName: string; 156 begin 157 FileList.Clear; 158 if Assigned(Core.Project) then begin 159 FileStatusList := TFileStatusList.Create; 160 try 161 Core.Project.WorkingCopy.GetStatus(Directory, FileStatusList); 162 145 163 if DirectoryExistsUTF8(Directory) then begin 146 164 FindFile := TFindFile.Create(nil); … … 150 168 FindFile.InSubFolders := False; 151 169 FoundFileList := FindFile.SearchForFiles; 152 FileList.Assign(FoundFileList); 170 //FoundFileList.Sort; 171 for I := 0 to FoundFileList.Count - 1 do begin 172 NewFileItem := TFileStatus.Create; 173 NewFileItem.FileName := FoundFileList[I]; 174 RelativeName := NewFileItem.FileName; 175 if Copy(RelativeName, 1, Length(Core.Project.WorkingCopy.Path)) = Core.Project.WorkingCopy.Path then 176 Delete(RelativeName, 1, Length(Core.Project.WorkingCopy.Path)); 177 if Copy(RelativeName, 1, 1) = DirectorySeparator then 178 Delete(RelativeName, 1, Length(DirectorySeparator)); 179 FS := FileStatusList.SearchByName(RelativeName); 180 if Assigned(FS) then begin 181 NewFileItem.Assign(FS); 182 end; 183 FileList.Add(NewFileItem); 184 end; 153 185 for I := FileList.Count - 1 downto 0 do 154 if ExtractFileName(FileList[I]) = '.' then FileList.Delete(I); 155 FileList.Sort; 186 if ExtractFileName(TFileStatus(FileList[I]).FileName) = '.' then FileList.Delete(I); 156 187 ListView1.Items.Count := FileList.Count; 157 188 finally … … 159 190 end; 160 191 end else ListView1.Items.Count := 0; 192 finally 193 FileStatusList.Free; 194 end; 195 end; 161 196 ListView1.Refresh; 162 197 end;
Note:
See TracChangeset
for help on using the changeset viewer.