Changeset 227 for trunk/Forms/FormImportSources.pas
- Timestamp:
- Jan 20, 2025, 11:38:55 AM (42 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormImportSources.pas
r221 r227 62 62 public 63 63 ImportSources: TImportSources; 64 AcronymDb: TAcronymDb; 64 65 procedure UpdateList; 65 66 procedure UpdateInterface; … … 72 73 73 74 uses 74 Core,FormMain, FormImportSource;75 FormMain, FormImportSource; 75 76 76 77 resourcestring … … 168 169 begin 169 170 UpdateList; 170 Core.Core.ScaleDPI1.ScaleControl(ToolBar1, Core.Core.ScaleDPI1.DesignDPI);171 ScaleDPI.ScaleControl(ToolBar1, ScaleDPI.DesignDPI); 171 172 end; 172 173 … … 176 177 if Assigned(Item) and (Change = ctState) then begin 177 178 TImportSource(Item.Data).Enabled := Item.Checked; 178 Core.Core.AcronymDb.Modified := True;179 AcronymDb.Modified := True; 179 180 end; 180 181 end; … … 190 191 FormImportSource := TFormImportSource.Create(Self); 191 192 try 193 FormImportSource.AcronymDb := AcronymDb; 192 194 FormImportSource.Load(NewImportSource); 193 195 if FormImportSource.ShowModal = mrOk then begin … … 198 200 // Update reverse references 199 201 for I := 0 to NewImportSource.Categories.Count - 1 do 200 if TAcronymCategory(NewImportSource.Categories.Items[I]).ImportSources.IndexOf(NewImportSource) = -1 then201 TAcronymCategory(NewImportSource.Categories.Items[I]).ImportSources.Add(NewImportSource);202 if NewImportSource.Categories.Items[I].ImportSources.IndexOf(NewImportSource) = -1 then 203 NewImportSource.Categories.Items[I].ImportSources.Add(NewImportSource); 202 204 203 205 NewImportSource := nil; 204 Core.Core.AcronymDb.Modified := True;206 AcronymDb.Modified := True; 205 207 UpdateList; 206 208 end else ShowMessage(Format(SImportSourceAlreadyExists, [NewImportSource.Name])); … … 219 221 if ListView1.Items[I].Selected then begin 220 222 TImportSource(ListView1.Items[I].Data).Enabled := False; 221 Core.Core.AcronymDb.Modified := True;223 AcronymDb.Modified := True; 222 224 end; 223 225 UpdateList; … … 231 233 if ListView1.Items[I].Selected then begin 232 234 TImportSource(ListView1.Items[I].Data).Enabled := True; 233 Core.Core.AcronymDb.Modified := True;235 AcronymDb.Modified := True; 234 236 end; 235 237 UpdateList; … … 246 248 FormImportSource := TFormImportSource.Create(Self); 247 249 try 250 FormImportSource.AcronymDb := AcronymDb; 248 251 FormImportSource.Load(NewImportSource); 249 252 if FormImportSource.ShowModal = mrOk then begin … … 252 255 if not Assigned(ImportSources.SearchByName(NewImportSource.Name)) then begin; 253 256 TImportSource(ListView1.Selected.Data).Assign(NewImportSource); 254 Core.Core.AcronymDb.Modified := True;257 AcronymDb.Modified := True; 255 258 end else ShowMessage(Format(SImportSourceAlreadyExists, [NewImportSource.Name])); 256 259 end else begin 257 260 TImportSource(ListView1.Selected.Data).Assign(NewImportSource); 258 Core.Core.AcronymDb.Modified := True;261 AcronymDb.Modified := True; 259 262 end; 260 263 … … 274 277 begin 275 278 if Assigned(ListView1.Selected) then begin 276 Core.Core.AcronymDb.AddedCount := 0;279 AcronymDb.AddedCount := 0; 277 280 JobProgressView1.AddJob(SProcessSelectedSource, ProcessImportJob); 278 281 JobProgressView1.Start; 279 282 ShowMessage(Format(SAddedCount, [TImportSource(ListView1.Selected.Data).ItemCount, 280 Core.Core.AcronymDb.AddedCount]));283 AcronymDb.AddedCount])); 281 284 end; 282 285 end;
Note:
See TracChangeset
for help on using the changeset viewer.