Changeset 39 for trunk/Forms/UFormMain.pas
- Timestamp:
- Jul 13, 2016, 4:42:12 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r33 r39 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus, 9 9 ComCtrls, StdCtrls, ExtCtrls, ActnList, UAcronym, UPersistentForm, URegistry, 10 ULastOpenedList, UListViewSort, U CoolTranslator, Registry,10 ULastOpenedList, UListViewSort, UJobProgressView, UCoolTranslator, Registry, 11 11 SpecializedList, LazUTF8; 12 12 … … 35 35 CoolTranslator1: TCoolTranslator; 36 36 ImageList1: TImageList; 37 JobProgressView1: TJobProgressView; 37 38 LastOpenedList1: TLastOpenedList; 38 39 ListViewAcronyms: TListView; … … 80 81 ToolButton7: TToolButton; 81 82 ToolButton8: TToolButton; 83 ToolButton9: TToolButton; 82 84 TrayIcon1: TTrayIcon; 83 85 procedure AExitExecute(Sender: TObject); … … 116 118 RegistryContext: TRegistryContext; 117 119 ProjectClosed: Boolean; 120 ImportTotalItemCount: Integer; 121 procedure ProcessImportsJob(Job: TJob); 118 122 procedure SetAlwaysOnTop(AValue: Boolean); 119 123 procedure FilterList(List: TListObject); … … 267 271 268 272 procedure TFormMain.AProcessImportsExecute(Sender: TObject); 273 begin 274 ImportTotalItemCount := 0; 275 JobProgressView1.AddJob('Process import sources', ProcessImportsJob); 276 JobProgressView1.Start; 277 ShowMessage(Format(SAddedCount, [ImportTotalItemCount])); 278 UpdateAcronymsList; 279 UpdateInterface; 280 end; 281 282 procedure TFormMain.ProcessImportsJob(Job: TJob); 269 283 var 270 284 I: Integer; 271 TotalItemCount: Integer; 272 begin 273 TotalItemCount := 0; 285 begin 274 286 for I := 0 to AcronymDb.ImportSources.Count - 1 do 275 287 with TImportSource(AcronymDb.ImportSources[I]) do 276 288 if Enabled then begin 277 289 Process; 278 TotalItemCount :=TotalItemCount + ItemCount;279 end;280 ShowMessage(Format(SAddedCount, [TotalItemCount]));281 UpdateAcronymsList;282 UpdateInterface;290 ImportTotalItemCount := ImportTotalItemCount + ItemCount; 291 Job.Progress.Max := AcronymDb.ImportSources.Count; 292 Job.Progress.Value := I; 293 if Job.Terminate then Break; 294 end; 283 295 end; 284 296
Note:
See TracChangeset
for help on using the changeset viewer.