Changeset 148 for trunk/Forms
- Timestamp:
- Feb 6, 2017, 12:59:59 PM (8 years ago)
- Location:
- trunk/Forms
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormAcronyms.pas
r146 r148 156 156 TAcronymCategory(Meaning.Categories.Items[I]).AcronymMeanings.Add(Meaning); 157 157 158 Core.AcronymDb.Update; 158 159 UpdateAcronymsList; 159 160 UpdateInterface; … … 201 202 if TAcronymCategory(Meaning.Categories.Items[I]).AcronymMeanings.IndexOf(Meaning) = -1 then 202 203 TAcronymCategory(Meaning.Categories.Items[I]).AcronymMeanings.Add(Meaning); 203 204 Core.AcronymDb.Update; 204 205 UpdateAcronymsList; 205 206 UpdateInterface; … … 221 222 if MessageDlg(SRemoveAcronym, SRemoveAcronymQuery, 222 223 TMsgDlgType.mtConfirmation, [mbCancel, mbOk], 0) = mrOk then begin 224 Core.AcronymDb.BeginUpdate; 223 225 for I := ListViewAcronyms.Items.Count - 1 downto 0 do 224 226 if ListViewAcronyms.Items[I].Selected then begin … … 228 230 UpdateAcronymsList; 229 231 UpdateInterface; 232 Core.AcronymDb.EndUpdate; 230 233 end; 231 234 end; -
trunk/Forms/UFormCategories.pas
r145 r148 105 105 TAcronymCategory(Core.AcronymDb.Categories[Core.AcronymDb.Categories.Add(TAcronymCategory.Create)]).Name := S; 106 106 Core.AcronymDb.Modified := True; 107 Core.AcronymDb.Update; 107 108 UpdateList; 108 109 end else ShowMessage(Format(SCategoryAlreadyExists, [S])); … … 144 145 TAcronymCategory(ListViewCategories.Selected.Data).Name := S; 145 146 Core.AcronymDb.Modified := True; 147 Core.AcronymDb.Update; 146 148 UpdateList; 147 149 end else ShowMessage(Format(SCategoryAlreadyExists, [S])); … … 157 159 if MessageDlg(SRemoveCategory, SRemoveCategoryQuery, 158 160 TMsgDlgType.mtConfirmation, [mbCancel, mbOk], 0) = mrOk then begin 161 Categories.Db.BeginUpdate; 159 162 for I := ListViewCategories.Items.Count - 1 downto 0 do 160 163 if ListViewCategories.Items[I].Selected then 161 164 Categories.Remove(ListViewCategories.Items[I].Data); 165 Categories.Db.EndUpdate; 162 166 UpdateList; 163 167 end; -
trunk/Forms/UFormMain.pas
r147 r148 134 134 ProjectClosed: Boolean; 135 135 ImportTotalItemCount: Integer; 136 procedure AcronymDbUpdate(Sender: TObject); 136 137 function FilterCell(Text1, Text2: string): Boolean; 137 138 procedure ProcessImportsJob(Job: TJob); … … 258 259 begin 259 260 AFileClose.Execute; 260 if ProjectClosedthen begin261 if not Assigned(Core.AcronymDb) then begin 261 262 Core.AcronymDb := TAcronymDb.Create; 262 263 Core.AcronymDb.FileName := DefaultFileName; 263 264 Core.AcronymDb.Acronyms.Clear; 265 Core.AcronymDb.OnUpdate.Add(AcronymDbUpdate); 264 266 UpdateAcronymsList; 265 267 UpdateInterface; … … 533 535 end; 534 536 537 procedure TFormMain.AcronymDbUpdate(Sender: TObject); 538 begin 539 UpdateAcronymsList; 540 end; 541 535 542 function TFormMain.FilterCell(Text1, Text2: string): Boolean; 536 543 begin … … 547 554 begin 548 555 AFileClose.Execute; 549 if ProjectClosedthen begin556 if not Assigned(Core.AcronymDb) then begin 550 557 try 551 558 AFileNew.Execute; … … 604 611 begin 605 612 AFileClose.Execute; 606 if ProjectClosedthen begin613 if not Assigned(Core.AcronymDb) then begin 607 614 AFileNew.Execute; 608 615 Core.AcronymDb.LoadFromFile(TMenuItem(Sender).Caption);
Note:
See TracChangeset
for help on using the changeset viewer.