Changeset 219 for trunk/Forms/FormImport.pas
- Timestamp:
- Jan 17, 2025, 9:05:54 PM (4 days ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormImport.pas
r218 r219 1 unit UFormImport; 2 3 {$mode delphi}{$H+} 1 unit FormImport; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 UAcronym;7 Acronym, FormEx; 10 8 11 9 type … … 13 11 { TFormImport } 14 12 15 TFormImport = class(TForm )13 TFormImport = class(TFormEx) 16 14 ButtonLoadFromFile: TButton; 17 15 ButtonProcess: TButton; … … 22 20 procedure ButtonProcessClick(Sender: TObject); 23 21 procedure ButtonLoadFromFileClick(Sender: TObject); 24 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);25 procedure FormCreate(Sender: TObject);26 procedure FormShow(Sender: TObject);27 22 private 28 23 procedure ImportMediaWiki; 29 24 procedure ImportCSV; 30 public31 { public declarations }32 25 end; 33 26 34 var35 FormImport: TFormImport;36 27 37 28 implementation … … 40 31 41 32 uses 42 UCore;33 Core; 43 34 44 35 resourcestring 45 36 SImportedNewAcronyms = 'Imported %d new acronyms.'; 46 47 37 48 38 { TFormImport } … … 60 50 if OpenDialog1.Execute then 61 51 Memo1.Lines.LoadFromFile(OpenDialog1.FileName); 62 end;63 64 procedure TFormImport.FormClose(Sender: TObject; var CloseAction: TCloseAction);65 begin66 Core.PersistentForm1.Save(Self);67 end;68 69 procedure TFormImport.FormCreate(Sender: TObject);70 begin71 Core.Translator.TranslateComponentRecursive(Self);72 Core.ThemeManager.UseTheme(Self);73 end;74 75 procedure TFormImport.FormShow(Sender: TObject);76 begin77 Core.PersistentForm1.Load(Self);78 52 end; 79 53 … … 101 75 AcronymMeaning := Trim(Copy(Line, 2, Length(Line))); 102 76 if (AcronymName <> '') and (AcronymMeaning <> '') then begin 103 Acronym := Core. AcronymDb.Acronyms.SearchByName(AcronymName);77 Acronym := Core.Core.AcronymDb.Acronyms.SearchByName(AcronymName); 104 78 if not Assigned(Acronym) then begin 105 79 Acronym := TAcronym.Create; 106 80 Acronym.Name := AcronymName; 107 Core. AcronymDb.Acronyms.Add(Acronym);81 Core.Core.AcronymDb.Acronyms.Add(Acronym); 108 82 end; 109 83 Meaning := Acronym.Meanings.SearchByName(AcronymMeaning); … … 118 92 end; 119 93 end; 120 if AddedCount > 0 then Core. AcronymDb.Modified := True;94 if AddedCount > 0 then Core.Core.AcronymDb.Modified := True; 121 95 ShowMessage(Format(SImportedNewAcronyms, [AddedCount])); 122 96 end; … … 147 121 else AcronymDescription := ''; 148 122 if (AcronymName <> '') and (AcronymDescription <> '') then begin 149 Acronym := Core. AcronymDb.Acronyms.SearchByName(AcronymName);123 Acronym := Core.Core.AcronymDb.Acronyms.SearchByName(AcronymName); 150 124 if not Assigned(Acronym) then begin 151 125 Acronym := TAcronym.Create; 152 126 Acronym.Name := AcronymName; 153 Core. AcronymDb.Acronyms.Add(Acronym);127 Core.Core.AcronymDb.Acronyms.Add(Acronym); 154 128 end; 155 129 Meaning := Acronym.Meanings.SearchByName(AcronymDescription); … … 165 139 end; 166 140 Columns.Free; 167 if AddedCount > 0 then Core. AcronymDb.Modified := True;141 if AddedCount > 0 then Core.Core.AcronymDb.Modified := True; 168 142 ShowMessage(Format(SImportedNewAcronyms, [AddedCount])); 169 143 end;
Note:
See TracChangeset
for help on using the changeset viewer.