Ignore:
Timestamp:
Aug 8, 2016, 1:41:25 PM (8 years ago)
Author:
chronos
Message:
  • Modified: Non-visual code moved from FormMain to Core data module.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormAcronyms.pas

    r85 r86  
    6363
    6464uses
    65   UFormMain, UFormAcronym;
     65  UCore, UFormMain, UFormAcronym;
    6666
    6767resourcestring
     
    126126  if FormAcronym.ShowModal = mrOk then begin
    127127    FormAcronym.Save(TempEntry);
    128     Meaning := FormMain.AcronymDb.AddAcronym(TempEntry.Name, TempEntry.Meaning);
     128    Meaning := Core.AcronymDb.AddAcronym(TempEntry.Name, TempEntry.Meaning);
    129129    Meaning.Description := TempEntry.Description;
    130130    Meaning.Categories.AssignFromStrings(TempEntry.Categories);
     
    161161      not FormMain.CompareStrings(TempEntry.Categories, TempCategories) then begin
    162162        // TODO: Update item inplace if possible
    163         FormMain.AcronymDb.RemoveMeaning(TAcronymMeaning(ListViewAcronyms.Selected.Data));
    164         Meaning := FormMain.AcronymDb.AddAcronym(TempEntry.Name, TempEntry.Meaning);
     163        Core.AcronymDb.RemoveMeaning(TAcronymMeaning(ListViewAcronyms.Selected.Data));
     164        Meaning := Core.AcronymDb.AddAcronym(TempEntry.Name, TempEntry.Meaning);
    165165        Meaning.Description := TempEntry.Description;
    166166        Meaning.Categories.AssignFromStrings(TempEntry.Categories);
     
    186186        if ListViewAcronyms.Items[I].Selected then begin
    187187          ListViewAcronyms.Items[I].Selected := False;
    188           FormMain.AcronymDb.RemoveMeaning(TAcronymMeaning(ListViewAcronyms.Items[I].Data));
     188          Core.AcronymDb.RemoveMeaning(TAcronymMeaning(ListViewAcronyms.Items[I].Data));
    189189        end;
    190190      UpdateAcronymsList;
     
    231231procedure TFormAcronyms.ListViewSort1Filter(ListViewSort: TListViewSort);
    232232begin
    233   FormMain.AcronymDb.Acronyms.Sort(AcronymComparer);
    234   FormMain.AcronymDb.AssignToList(ListViewSort1.List);
     233  Core.AcronymDb.Acronyms.Sort(AcronymComparer);
     234  Core.AcronymDb.AssignToList(ListViewSort1.List);
    235235  MeaningCount := ListViewSort1.List.Count;
    236236  FilterList(ListViewSort1.List);
     
    276276procedure TFormAcronyms.UpdateInterface;
    277277begin
    278   ARemove.Enabled := Assigned(FormMain.AcronymDb) and Assigned(ListViewAcronyms.Selected);
    279   AModify.Enabled := Assigned(FormMain.AcronymDb) and Assigned(ListViewAcronyms.Selected);
    280   AAdd.Enabled := Assigned(FormMain.AcronymDb);
     278  ARemove.Enabled := Assigned(Core.AcronymDb) and Assigned(ListViewAcronyms.Selected);
     279  AModify.Enabled := Assigned(Core.AcronymDb) and Assigned(ListViewAcronyms.Selected);
     280  AAdd.Enabled := Assigned(Core.AcronymDb);
    281281  ASelectAll.Enabled := True;
    282282end;
Note: See TracChangeset for help on using the changeset viewer.