Changeset 227 for trunk/Forms
- Timestamp:
- Jan 20, 2025, 11:38:55 AM (44 hours ago)
- Location:
- trunk/Forms
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormAcronym.pas
r221 r227 41 41 procedure UpdateInterface; 42 42 public 43 AcronymDb: TAcronymDb; 43 44 procedure Load(Entry: TAcronymEntry); 44 45 procedure Save(Entry: TAcronymEntry); … … 62 63 FormCategorySelect := TFormCategorySelect.Create(Self); 63 64 try 65 FormCategorySelect.AcronymDb := AcronymDb; 64 66 FormCategorySelect.Load(ListBoxCategories.Items); 65 67 if FormCategorySelect.ShowModal = mrOk then begin -
trunk/Forms/FormAcronyms.pas
r219 r227 50 50 FAcronyms: TAcronyms; 51 51 MeaningCount: Integer; 52 function CompareStrings(Strings1, Strings2: TStrings): Boolean; 52 53 function AcronymComparer(constref Item1, Item2: TAcronym): Integer; 53 54 procedure FilterList(List: TObjectList<TObject>); … … 55 56 procedure UpdateAcronymsList; 56 57 public 58 AcronymDb: TAcronymDb; 57 59 FocusAcronym: TAcronymMeaning; 58 60 property Acronyms: TAcronyms read FAcronyms write SetAcronyms; … … 66 68 67 69 uses 68 Core,FormAcronym;70 FormAcronym; 69 71 70 72 resourcestring … … 116 118 ListViewFilter1.UpdateFromListView(ListViewAcronyms); 117 119 UpdateAcronymsList; 118 Core.Core.ScaleDPI1.ScaleControl(ToolBar1, Core.Core.ScaleDPI1.DesignDPI);120 ScaleDPI.ScaleControl(ToolBar1, ScaleDPI.DesignDPI); 119 121 120 122 // Focus line with acronym … … 131 133 end; 132 134 135 function TFormAcronyms.CompareStrings(Strings1, Strings2: TStrings): Boolean; 136 var 137 I: Integer; 138 begin 139 Result := Strings1.Count = Strings2.Count; 140 if not Result then Exit; 141 for I := 0 to Strings1.Count - 1 do 142 if (Strings1[I] <> Strings2[I]) or (Strings1.Objects[I] <> Strings2.Objects[I]) then begin 143 Result := False; 144 Exit; 145 end; 146 end; 147 133 148 procedure TFormAcronyms.AAddExecute(Sender: TObject); 134 149 var … … 144 159 FormAcronym := TFormAcronym.Create(Self); 145 160 try 161 FormAcronym.AcronymDb := AcronymDb; 146 162 FormAcronym.Load(TempEntry); 147 163 if FormAcronym.ShowModal = mrOk then begin … … 186 202 FormAcronym := TFormAcronym.Create(Self); 187 203 try 204 FormAcronym.AcronymDb := AcronymDb; 188 205 FormAcronym.Load(TempEntry); 189 206 if FormAcronym.ShowModal = mrOk then begin … … 192 209 (TempEntry.Meaning <> Name) or 193 210 (TempEntry.Description <> Description) or 194 not Co re.Core.CompareStrings(TempEntry.Categories, TempCategories) then begin211 not CompareStrings(TempEntry.Categories, TempCategories) then begin 195 212 // TODO: Update item inplace if possible 196 213 Acronyms.Db.RemoveMeaning(TAcronymMeaning(ListViewAcronyms.Selected.Data)); … … 201 218 // Update reverse references 202 219 for I := 0 to Meaning.Categories.Count - 1 do 203 if TAcronymCategory(Meaning.Categories.Items[I]).AcronymMeanings.IndexOf(Meaning) = -1 then204 TAcronymCategory(Meaning.Categories.Items[I]).AcronymMeanings.Add(Meaning);220 if Meaning.Categories.Items[I].AcronymMeanings.IndexOf(Meaning) = -1 then 221 Meaning.Categories.Items[I].AcronymMeanings.Add(Meaning); 205 222 Acronyms.Db.Update; 206 223 UpdateAcronymsList; -
trunk/Forms/FormCategories.pas
r219 r227 51 51 procedure ListViewSort1Filter(ListViewSort: TListViewSort); 52 52 public 53 AcronymDb: TAcronymDb; 53 54 Categories: TAcronymCategories; 54 55 procedure UpdateList; … … 60 61 61 62 {$R *.lfm} 62 63 uses64 Core;65 63 66 64 resourcestring … … 76 74 begin 77 75 UpdateList; 78 Core.Core.ScaleDPI1.ScaleControl(ToolBar1, Core.Core.ScaleDPI1.DesignDPI);76 ScaleDPI.ScaleControl(ToolBar1, ScaleDPI.DesignDPI); 79 77 end; 80 78 … … 84 82 if Assigned(Item) and (Change = ctState) then begin 85 83 TAcronymCategory(Item.Data).Enabled := Item.Checked; 86 Core.Core.AcronymDb.Modified := True;84 AcronymDb.Modified := True; 87 85 end; 88 86 end; … … 94 92 S := InputBox(SCategory, SCategoryQuery, ''); 95 93 if S <> '' then begin 96 if not Assigned( Core.Core.AcronymDb.Categories.SearchByName(S)) then begin;97 TAcronymCategory( Core.Core.AcronymDb.Categories[Core.Core.AcronymDb.Categories.Add(TAcronymCategory.Create)]).Name := S;98 Core.Core.AcronymDb.Modified := True;99 Core.Core.AcronymDb.Update;94 if not Assigned(AcronymDb.Categories.SearchByName(S)) then begin; 95 TAcronymCategory(AcronymDb.Categories[AcronymDb.Categories.Add(TAcronymCategory.Create)]).Name := S; 96 AcronymDb.Modified := True; 97 AcronymDb.Update; 100 98 UpdateList; 101 99 end else ShowMessage(Format(SCategoryAlreadyExists, [S])); … … 110 108 if ListViewCategories.Items[I].Selected then begin 111 109 TAcronymCategory(ListViewCategories.Items[I].Data).Enabled := False; 112 Core.Core.AcronymDb.Modified := True;110 AcronymDb.Modified := True; 113 111 end; 114 112 UpdateList; … … 122 120 if ListViewCategories.Items[I].Selected then begin 123 121 TAcronymCategory(ListViewCategories.Items[I].Data).Enabled := True; 124 Core.Core.AcronymDb.Modified := True;122 AcronymDb.Modified := True; 125 123 end; 126 124 UpdateList; … … 134 132 S := InputBox(SCategory, SCategoryQuery, ListViewCategories.Selected.Caption); 135 133 if S <> ListViewCategories.Selected.Caption then begin 136 if not Assigned( Core.Core.AcronymDb.Categories.SearchByName(S)) then begin;134 if not Assigned(AcronymDb.Categories.SearchByName(S)) then begin; 137 135 TAcronymCategory(ListViewCategories.Selected.Data).Name := S; 138 Core.Core.AcronymDb.Modified := True;139 Core.Core.AcronymDb.Update;136 AcronymDb.Modified := True; 137 AcronymDb.Update; 140 138 UpdateList; 141 139 end else ShowMessage(Format(SCategoryAlreadyExists, [S])); … … 221 219 procedure TFormCategories.ListViewSort1Filter(ListViewSort: TListViewSort); 222 220 begin 223 Core.Core.AcronymDb.Categories.AssignToList(ListViewSort1.List);221 AcronymDb.Categories.AssignToList(ListViewSort1.List); 224 222 end; 225 223 … … 227 225 begin 228 226 ListViewSort1.Refresh; 229 ListViewCategories.Items.Count := Core.Core.AcronymDb.Categories.Count;227 ListViewCategories.Items.Count := AcronymDb.Categories.Count; 230 228 ListViewCategories.Refresh; 231 229 UpdateInterface; -
trunk/Forms/FormCategorySelect.pas
r221 r227 18 18 procedure ListBox1KeyPress(Sender: TObject; var Key: char); 19 19 public 20 AcronymDb: TAcronymDb; 20 21 procedure Load(RemoveItems: TStrings); 21 22 end; … … 30 31 31 32 {$R *.lfm} 32 33 uses34 Core;35 33 36 34 { TFormCategorySelect } … … 51 49 I: Integer; 52 50 begin 53 with Core.Core.AcronymDb do begin51 with AcronymDb do begin 54 52 ListBox1.Sorted := False; 55 53 while ListBox1.Items.Count < Categories.Count do -
trunk/Forms/FormCheck.lfm
r221 r227 223 223 object MenuItemGoTo: TMenuItem 224 224 Action = AGoToLocation 225 OnClick = MenuItemGoToClick226 225 end 227 226 object MenuItem1: TMenuItem -
trunk/Forms/FormCheck.pas
r221 r227 67 67 procedure FormShow(Sender: TObject); 68 68 procedure ListViewReportData(Sender: TObject; Item: TListItem); 69 procedure MenuItemGoToClick(Sender: TObject);70 69 private 71 70 AcronymDbSummary: TAcronymDb; … … 89 88 procedure ReloadReport; 90 89 public 90 AcronymDb: TAcronymDb; 91 91 ReportItems: TReportItems; 92 92 procedure UpdateInterface; 93 procedure LoadConfig ;94 procedure SaveConfig ;93 procedure LoadConfig(RegistryContext: TRegistryContext); 94 procedure SaveConfig(RegistryContext: TRegistryContext); 95 95 end; 96 96 … … 104 104 105 105 uses 106 FormAcronyms , Core;106 FormAcronyms; 107 107 108 108 resourcestring … … 227 227 end; 228 228 229 procedure TFormCheck.MenuItemGoToClick(Sender: TObject);230 begin231 232 end;233 234 229 procedure TFormCheck.ButtonAcronymsContentClick(Sender: TObject); 235 230 var … … 238 233 FormAcronyms := TFormAcronyms.Create(Self); 239 234 try 235 FormAcronyms.AcronymDb := AcronymDb; 240 236 FormAcronyms.Acronyms := AcronymDbContent.Acronyms; 241 237 FormAcronyms.Caption := SContentAcronyms; … … 252 248 FormAcronyms := TFormAcronyms.Create(Self); 253 249 try 250 FormAcronyms.AcronymDb := AcronymDb; 254 251 FormAcronyms.Acronyms := AcronymDbSummary.Acronyms; 255 252 FormAcronyms.Caption := SSummaryAcronyms; … … 706 703 end; 707 704 708 procedure TFormCheck.LoadConfig ;705 procedure TFormCheck.LoadConfig(RegistryContext: TRegistryContext); 709 706 begin 710 707 with TRegistryEx.Create do 711 708 try 712 RootKey := Registry RootHKEY[Core.Core.ApplicationInfo1.RegistryRoot];713 OpenKey( Core.Core.ApplicationInfo1.RegistryKey, True);709 RootKey := RegistryContext.RootKey; 710 OpenKey(RegistryContext.Key, True); 714 711 EditSummaryStart.Text := ReadStringWithDefault('SummaryStart', 'ACRONYMS AND ABBREVIATIONS'); 715 712 EditSummaryEnd.Text := ReadStringWithDefault('SummaryEnd', 'Appendix'); … … 721 718 end; 722 719 723 procedure TFormCheck.SaveConfig ;720 procedure TFormCheck.SaveConfig(RegistryContext: TRegistryContext); 724 721 begin 725 722 with TRegistryEx.Create do 726 723 try 727 RootKey := Registry RootHKEY[Core.Core.ApplicationInfo1.RegistryRoot];728 OpenKey( Core.Core.ApplicationInfo1.RegistryKey, True);724 RootKey := RegistryContext.RootKey; 725 OpenKey(RegistryContext.Key, True); 729 726 WriteString('SummaryStart', EditSummaryStart.Text); 730 727 WriteString('SummaryEnd', EditSummaryEnd.Text); -
trunk/Forms/FormExport.lfm
r221 r227 67 67 Top = 149 68 68 end 69 object JobProgressView1: TJobProgressView 70 OwnerDraw = False 71 ShowDelay = 0 72 AutoClose = True 73 Left = 472 74 Top = 256 75 end 69 76 end -
trunk/Forms/FormExport.pas
r221 r227 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 7 JobProgressView, FormEx ;7 JobProgressView, FormEx, Acronym; 8 8 9 9 type … … 15 15 ButtonSaveToFile: TButton; 16 16 ComboBoxDataFormat: TComboBox; 17 JobProgressView1: TJobProgressView; 17 18 Label1: TLabel; 18 19 Memo1: TMemo; … … 26 27 procedure JobExportMediaWiki(Job: TJob); 27 28 procedure JobExportMediaWikiTable(Job: TJob); 29 public 30 AcronymDb: TAcronymDb; 28 31 end; 29 32 … … 32 35 33 36 {$R *.lfm} 34 35 uses36 Core, Acronym;37 37 38 38 resourcestring … … 57 57 J: Integer; 58 58 begin 59 Job.Progress.Max := Core.Core.AcronymDb.Acronyms.Count;59 Job.Progress.Max := AcronymDb.Acronyms.Count; 60 60 ItemCount := 0; 61 61 Content := ''; 62 for I := 0 to Core.Core.AcronymDb.Acronyms.Count - 1 do63 with Core.Core.AcronymDb.Acronyms[I] do begin62 for I := 0 to AcronymDb.Acronyms.Count - 1 do 63 with AcronymDb.Acronyms[I] do begin 64 64 for J := 0 to Meanings.Count - 1 do 65 65 with Meanings[J] do begin … … 77 77 J: Integer; 78 78 begin 79 Job.Progress.Max := Core.Core.AcronymDb.Acronyms.Count;79 Job.Progress.Max := AcronymDb.Acronyms.Count; 80 80 ItemCount := 0; 81 81 Content := ''; 82 for I := 0 to Core.Core.AcronymDb.Acronyms.Count - 1 do83 with Core.Core.AcronymDb.Acronyms[I] do begin82 for I := 0 to AcronymDb.Acronyms.Count - 1 do 83 with AcronymDb.Acronyms[I] do begin 84 84 Content := Content + '; ' + Name + LineEnding; 85 85 for J := 0 to Meanings.Count - 1 do … … 98 98 J: Integer; 99 99 begin 100 Job.Progress.Max := Core.Core.AcronymDb.Acronyms.Count;100 Job.Progress.Max := AcronymDb.Acronyms.Count; 101 101 ItemCount := 0; 102 102 Content := '{| class="wikitable sortable"' + LineEnding + 103 103 '! Name !! Meaning !! Description !! Categories' + LineEnding; 104 for I := 0 to Core.Core.AcronymDb.Acronyms.Count - 1 do105 with Core.Core.AcronymDb.Acronyms[I] do begin104 for I := 0 to AcronymDb.Acronyms.Count - 1 do 105 with AcronymDb.Acronyms[I] do begin 106 106 for J := 0 to Meanings.Count - 1 do 107 107 with Meanings[J] do begin … … 120 120 begin 121 121 if ComboBoxDataFormat.ItemIndex = 0 then 122 Core.Core.JobProgressView1.AddJob(SExporting, JobExportCSV);122 JobProgressView1.AddJob(SExporting, JobExportCSV); 123 123 if ComboBoxDataFormat.ItemIndex = 1 then 124 Core.Core.JobProgressView1.AddJob(SExporting, JobExportMediaWiki);124 JobProgressView1.AddJob(SExporting, JobExportMediaWiki); 125 125 if ComboBoxDataFormat.ItemIndex = 2 then 126 Core.Core.JobProgressView1.AddJob(SExporting, JobExportMediaWikiTable);127 Core.Core.JobProgressView1.Start;126 JobProgressView1.AddJob(SExporting, JobExportMediaWikiTable); 127 JobProgressView1.Start; 128 128 Memo1.Lines.Text := Content; 129 129 ShowMessage(Format(SExportedAcronyms, [ItemCount])); -
trunk/Forms/FormImport.pas
r219 r227 23 23 procedure ImportMediaWiki; 24 24 procedure ImportCSV; 25 public 26 AcronymDb: TAcronymDb; 25 27 end; 26 28 … … 29 31 30 32 {$R *.lfm} 31 32 uses33 Core;34 33 35 34 resourcestring … … 75 74 AcronymMeaning := Trim(Copy(Line, 2, Length(Line))); 76 75 if (AcronymName <> '') and (AcronymMeaning <> '') then begin 77 Acronym := Core.Core.AcronymDb.Acronyms.SearchByName(AcronymName);76 Acronym := AcronymDb.Acronyms.SearchByName(AcronymName); 78 77 if not Assigned(Acronym) then begin 79 78 Acronym := TAcronym.Create; 80 79 Acronym.Name := AcronymName; 81 Core.Core.AcronymDb.Acronyms.Add(Acronym);80 AcronymDb.Acronyms.Add(Acronym); 82 81 end; 83 82 Meaning := Acronym.Meanings.SearchByName(AcronymMeaning); … … 92 91 end; 93 92 end; 94 if AddedCount > 0 then Core.Core.AcronymDb.Modified := True;93 if AddedCount > 0 then AcronymDb.Modified := True; 95 94 ShowMessage(Format(SImportedNewAcronyms, [AddedCount])); 96 95 end; … … 121 120 else AcronymDescription := ''; 122 121 if (AcronymName <> '') and (AcronymDescription <> '') then begin 123 Acronym := Core.Core.AcronymDb.Acronyms.SearchByName(AcronymName);122 Acronym := AcronymDb.Acronyms.SearchByName(AcronymName); 124 123 if not Assigned(Acronym) then begin 125 124 Acronym := TAcronym.Create; 126 125 Acronym.Name := AcronymName; 127 Core.Core.AcronymDb.Acronyms.Add(Acronym);126 AcronymDb.Acronyms.Add(Acronym); 128 127 end; 129 128 Meaning := Acronym.Meanings.SearchByName(AcronymDescription); … … 139 138 end; 140 139 Columns.Free; 141 if AddedCount > 0 then Core.Core.AcronymDb.Modified := True;140 if AddedCount > 0 then AcronymDb.Modified := True; 142 141 ShowMessage(Format(SImportedNewAcronyms, [AddedCount])); 143 142 end; -
trunk/Forms/FormImportFormat.pas
r221 r227 60 60 61 61 uses 62 Core,FormImportPattern;62 FormImportPattern; 63 63 64 64 {$R *.lfm} -
trunk/Forms/FormImportFormats.pas
r219 r227 36 36 Selected: Boolean); 37 37 public 38 AcronymDb: TAcronymDb; 38 39 ImportFormats: TImportFormats; 39 40 procedure UpdateList; … … 47 48 48 49 uses 49 Core,FormImportFormat;50 FormImportFormat; 50 51 51 52 resourcestring … … 98 99 begin 99 100 UpdateList; 100 Core.Core.ScaleDPI1.ScaleControl(ToolBar1, Core.Core.ScaleDPI1.DesignDPI);101 ScaleDPI.ScaleControl(ToolBar1, ScaleDPI.DesignDPI); 101 102 end; 102 103 … … 116 117 ImportFormats.Add(NewImportFormat); 117 118 NewImportFormat := nil; 118 Core.Core.AcronymDb.Modified := True;119 AcronymDb.Modified := True; 119 120 UpdateList; 120 121 end else ShowMessage(Format(SImportFormatAlreadyExists, [NewImportFormat.Name])); … … 142 143 if not Assigned(ImportFormats.SearchByName(NewImportFormat.Name)) then begin; 143 144 TImportFormat(ListView1.Selected.Data).Assign(NewImportFormat); 144 Core.Core.AcronymDb.Modified := True;145 AcronymDb.Modified := True; 145 146 UpdateList; 146 147 end else ShowMessage(Format(SImportFormatAlreadyExists, [NewImportFormat.Name])); 147 148 end else begin 148 149 TImportFormat(ListView1.Selected.Data).Assign(NewImportFormat); 149 Core.Core.AcronymDb.Modified := True;150 AcronymDb.Modified := True; 150 151 UpdateList; 151 152 end; -
trunk/Forms/FormImportSource.pas
r221 r227 44 44 procedure FormShow(Sender: TObject); 45 45 public 46 AcronymDb: TAcronymDb; 46 47 procedure UpdateInterface; 47 48 procedure Load(ImportSource: TImportSource); … … 55 56 56 57 uses 57 Core,FormImportFormat, FormCategorySelect;58 FormImportFormat, FormCategorySelect; 58 59 59 60 { TFormImportSource } … … 73 74 FormImportFormat.Save(NewImportFormat); 74 75 TImportFormat(ComboBox1.Items.Objects[ComboBox1.ItemIndex]).Assign(NewImportFormat); 75 Core.Core.AcronymDb.Modified := True;76 AcronymDb.Modified := True; 76 77 ComboBox1.Items.Strings[ComboBox1.ItemIndex] := NewImportFormat.Name; 77 78 end; … … 100 101 FormCategorySelect := TFormCategorySelect.Create(Self); 101 102 try 103 FormCategorySelect.AcronymDb := AcronymDb; 102 104 FormCategorySelect.Load(ListBox1.Items); 103 105 if FormCategorySelect.ShowModal = mrOk then begin … … 136 138 EditName.Text := ImportSource.Name; 137 139 EditURL.Text := ImportSource.URL; 138 while ComboBox1.Items.Count > Core.Core.AcronymDb.ImportFormats.Count do140 while ComboBox1.Items.Count > AcronymDb.ImportFormats.Count do 139 141 ComboBox1.Items.Delete(ComboBox1.Items.Count - 1); 140 while ComboBox1.Items.Count < Core.Core.AcronymDb.ImportFormats.Count do142 while ComboBox1.Items.Count < AcronymDb.ImportFormats.Count do 141 143 ComboBox1.Items.Add(''); 142 for I := 0 to Core.Core.AcronymDb.ImportFormats.Count - 1 do begin143 ComboBox1.Items[I] := TImportFormat( Core.Core.AcronymDb.ImportFormats[I]).Name;144 ComboBox1.Items.Objects[I] := Core.Core.AcronymDb.ImportFormats[I];144 for I := 0 to AcronymDb.ImportFormats.Count - 1 do begin 145 ComboBox1.Items[I] := TImportFormat(AcronymDb.ImportFormats[I]).Name; 146 ComboBox1.Items.Objects[I] := AcronymDb.ImportFormats[I]; 145 147 end; 146 148 ComboBox1.ItemIndex := ComboBox1.Items.IndexOfObject(ImportSource.Format); -
trunk/Forms/FormImportSources.lfm
r221 r227 163 163 OwnerDraw = False 164 164 ShowDelay = 0 165 AutoClose = False165 AutoClose = True 166 166 Left = 359 167 167 Top = 143 -
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; -
trunk/Forms/FormMain.lfm
r220 r227 1 1 object FormMain: TFormMain 2 2 Left = 417 3 Height = 6 793 Height = 645 4 4 Top = 453 5 5 Width = 1106 6 6 Caption = 'Acronym Decoder' 7 ClientHeight = 6 797 ClientHeight = 645 8 8 ClientWidth = 1106 9 9 DesignTimePPI = 144 … … 19 19 object PanelMain: TPanel 20 20 Left = 0 21 Height = 5 7021 Height = 536 22 22 Top = 81 23 23 Width = 1106 24 24 Align = alClient 25 25 BevelOuter = bvNone 26 ClientHeight = 5 7026 ClientHeight = 536 27 27 ClientWidth = 1106 28 28 ParentFont = False … … 38 38 object ListViewAcronyms: TListView 39 39 Left = 5 40 Height = 51440 Height = 480 41 41 Top = 50 42 42 Width = 1095 … … 318 318 Left = 0 319 319 Height = 28 320 Top = 6 51320 Top = 617 321 321 Width = 1106 322 322 Panels = < … … 640 640 end 641 641 end 642 object JobProgressView1: TJobProgressView 643 OwnerDraw = False 644 ShowDelay = 0 645 AutoClose = True 646 Left = 708 647 Top = 464 648 end 642 649 end -
trunk/Forms/FormMain.pas
r225 r227 46 46 CheckBoxCaseSensitive: TCheckBox; 47 47 CoolBar1: TCoolBar; 48 JobProgressView1: TJobProgressView; 48 49 LastOpenedList1: TLastOpenedList; 49 50 ListViewAcronyms: TListView; … … 272 273 FormCheck := TFormCheck.Create(Self); 273 274 try 274 FormCheck.LoadConfig; 275 FormCheck.LoadConfig(TRegistryContext.Create(Core.Core.ApplicationInfo1.RegistryRoot, 276 Core.Core.ApplicationInfo1.RegistryKey)); 275 277 FormCheck.ShowModal; 276 FormCheck.SaveConfig; 278 FormCheck.SaveConfig(TRegistryContext.Create(Core.Core.ApplicationInfo1.RegistryRoot, 279 Core.Core.ApplicationInfo1.RegistryKey)); 277 280 finally 278 281 FreeAndNil(FormCheck); … … 286 289 FormExport := TFormExport.Create(Self); 287 290 try 291 FormExport.AcronymDb := Core.Core.AcronymDb; 288 292 FormExport.ShowModal; 289 293 finally … … 322 326 begin 323 327 AFileClose.Execute; 324 if not Assigned(Core.Core.AcronymDb) 328 if not Assigned(Core.Core.AcronymDb) then begin 325 329 Core.Core.AcronymDb := TAcronymDb.Create; 326 330 Core.Core.AcronymDb.FileName := DefaultFileName; … … 406 410 FormImport := TFormImport.Create(Self); 407 411 try 412 FormImport.AcronymDb := Core.Core.AcronymDb; 408 413 FormImport.ShowModal; 409 414 UpdateAcronymsList; … … 422 427 if Assigned(ListViewAcronyms.Selected) then 423 428 FormAcronyms.FocusAcronym := ListViewAcronyms.Selected.Data; 429 FormAcronyms.AcronymDb := Core.Core.AcronymDb; 424 430 FormAcronyms.Acronyms := Core.Core.AcronymDb.Acronyms; 425 431 FormAcronyms.ShowModal; … … 435 441 ImportTotalItemCount := 0; 436 442 Core.Core.AcronymDb.AddedCount := 0; 437 Core.Core.JobProgressView1.AddJob(SProcessImportSources, ProcessImportsJob);438 Core.Core.JobProgressView1.Start;443 JobProgressView1.AddJob(SProcessImportSources, ProcessImportsJob); 444 JobProgressView1.Start; 439 445 ShowMessage(Format(SAddedCount, [ImportTotalItemCount, Core.Core.AcronymDb.AddedCount])); 440 446 UpdateAcronymsList; … … 493 499 FormAcronyms := TFormAcronyms.Create(Self); 494 500 try 501 FormAcronyms.AcronymDb := Core.Core.AcronymDb; 495 502 FormAcronyms.Acronyms := Core.Core.AcronymDb.Acronyms; 496 503 FormAcronyms.ShowModal; … … 508 515 FormCategories := TFormCategories.Create(Self); 509 516 try 517 FormCategories.AcronymDb := Core.Core.AcronymDb; 510 518 FormCategories.Categories := Core.Core.AcronymDb.Categories; 511 519 FormCategories.ShowModal; … … 529 537 FormImportFormats := TFormImportFormats.Create(Self); 530 538 try 539 FormImportFormats.AcronymDb := Core.Core.AcronymDb; 531 540 FormImportFormats.ImportFormats := Core.Core.AcronymDb.ImportFormats; 532 541 FormImportFormats.ShowModal; … … 544 553 try 545 554 FormImportSources.ImportSources := Core.Core.AcronymDb.ImportSources; 555 FormImportSources.AcronymDb := Core.Core.AcronymDb; 546 556 FormImportSources.ShowModal; 547 557 UpdateAcronymsList;
Note:
See TracChangeset
for help on using the changeset viewer.