Changeset 219 for trunk/Forms/FormImportSources.pas
- Timestamp:
- Jan 17, 2025, 9:05:54 PM (4 days ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormImportSources.pas
r218 r219 1 unit UFormImportSources; 2 3 {$mode delphi} 1 unit FormImportSources; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 9 ActnList, Menus, UAcronym, UJobProgressView, UListViewSort, LazUTF8, fgl; 7 ActnList, Menus, Acronym, JobProgressView, ListViewSort, LazUTF8, 8 Generics.Collections; 10 9 11 10 type … … 44 43 procedure AProcessExecute(Sender: TObject); 45 44 procedure ARemoveExecute(Sender: TObject); 46 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);47 45 procedure FormCreate(Sender: TObject); 48 46 procedure FormShow(Sender: TObject); 49 47 procedure ListView1Change(Sender: TObject; Item: TListItem; 50 48 Change: TItemChange); 51 procedure ListView1Click(Sender: TObject);52 49 procedure ListView1Data(Sender: TObject; Item: TListItem); 53 50 procedure ListView1DblClick(Sender: TObject); … … 62 59 private 63 60 procedure ProcessImportJob(Job: TJob); 64 procedure FilterList(List: T FPGObjectList<TObject>);61 procedure FilterList(List: TObjectList<TObject>); 65 62 public 66 63 ImportSources: TImportSources; … … 69 66 end; 70 67 71 var72 FormImportSources: TFormImportSources;73 68 74 69 implementation … … 77 72 78 73 uses 79 UCore, UFormMain, UFormImportSource;74 Core, FormMain, FormImportSource; 80 75 81 76 resourcestring … … 172 167 procedure TFormImportSources.FormShow(Sender: TObject); 173 168 begin 174 Core.PersistentForm1.Load(Self);175 169 UpdateList; 176 Core. ScaleDPI1.ScaleControl(ToolBar1,Core.ScaleDPI1.DesignDPI);170 Core.Core.ScaleDPI1.ScaleControl(ToolBar1, Core.Core.ScaleDPI1.DesignDPI); 177 171 end; 178 172 … … 182 176 if Assigned(Item) and (Change = ctState) then begin 183 177 TImportSource(Item.Data).Enabled := Item.Checked; 184 Core.AcronymDb.Modified := True; 185 end; 186 end; 187 188 procedure TFormImportSources.ListView1Click(Sender: TObject); 189 begin 190 178 Core.Core.AcronymDb.Modified := True; 179 end; 191 180 end; 192 181 … … 194 183 var 195 184 NewImportSource: TImportSource; 185 FormImportSource: TFormImportSource; 196 186 I: Integer; 197 187 begin … … 212 202 213 203 NewImportSource := nil; 214 Core. AcronymDb.Modified := True;204 Core.Core.AcronymDb.Modified := True; 215 205 UpdateList; 216 206 end else ShowMessage(Format(SImportSourceAlreadyExists, [NewImportSource.Name])); … … 229 219 if ListView1.Items[I].Selected then begin 230 220 TImportSource(ListView1.Items[I].Data).Enabled := False; 231 Core. AcronymDb.Modified := True;221 Core.Core.AcronymDb.Modified := True; 232 222 end; 233 223 UpdateList; … … 241 231 if ListView1.Items[I].Selected then begin 242 232 TImportSource(ListView1.Items[I].Data).Enabled := True; 243 Core. AcronymDb.Modified := True;233 Core.Core.AcronymDb.Modified := True; 244 234 end; 245 235 UpdateList; … … 249 239 var 250 240 NewImportSource: TImportSource; 241 FormImportSource: TFormImportSource; 251 242 begin 252 243 if Assigned(ListView1.Selected) then begin … … 261 252 if not Assigned(ImportSources.SearchByName(NewImportSource.Name)) then begin; 262 253 TImportSource(ListView1.Selected.Data).Assign(NewImportSource); 263 Core. AcronymDb.Modified := True;254 Core.Core.AcronymDb.Modified := True; 264 255 end else ShowMessage(Format(SImportSourceAlreadyExists, [NewImportSource.Name])); 265 256 end else begin 266 257 TImportSource(ListView1.Selected.Data).Assign(NewImportSource); 267 Core. AcronymDb.Modified := True;258 Core.Core.AcronymDb.Modified := True; 268 259 end; 269 260 … … 283 274 begin 284 275 if Assigned(ListView1.Selected) then begin 285 Core. AcronymDb.AddedCount := 0;276 Core.Core.AcronymDb.AddedCount := 0; 286 277 JobProgressView1.AddJob(SProcessSelectedSource, ProcessImportJob); 287 278 JobProgressView1.Start; 288 279 ShowMessage(Format(SAddedCount, [TImportSource(ListView1.Selected.Data).ItemCount, 289 Core. AcronymDb.AddedCount]));280 Core.Core.AcronymDb.AddedCount])); 290 281 end; 291 282 end; … … 296 287 end; 297 288 298 procedure TFormImportSources.FilterList(List: T FPGObjectList<TObject>);289 procedure TFormImportSources.FilterList(List: TObjectList<TObject>); 299 290 var 300 291 I: Integer; … … 344 335 end; 345 336 346 procedure TFormImportSources.FormClose(Sender: TObject;347 var CloseAction: TCloseAction);348 begin349 Core.PersistentForm1.Save(Self);350 end;351 352 337 procedure TFormImportSources.FormCreate(Sender: TObject); 353 338 var 354 339 I: Integer; 355 340 begin 356 Core.Translator.TranslateComponentRecursive(Self);357 Core.ThemeManager.UseTheme(Self);358 341 for I := 0 to ToolBar1.ButtonCount - 1 do 359 342 ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption;
Note:
See TracChangeset
for help on using the changeset viewer.