Changeset 13


Ignore:
Timestamp:
Apr 28, 2016, 10:09:02 PM (9 years ago)
Author:
chronos
Message:
  • Modified: Acronym meaning context items renamed to categories.
  • Added: Ability to select categories for meanings.
Location:
trunk
Files:
4 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/AcronymDecoder.lpi

    r10 r13  
    3030          <SearchPaths>
    3131            <IncludeFiles Value="$(ProjOutDir)"/>
     32            <OtherUnitFiles Value="Forms"/>
    3233            <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
    3334          </SearchPaths>
     
    9192      </Item5>
    9293    </RequiredPackages>
    93     <Units Count="6">
     94    <Units Count="7">
    9495      <Unit0>
    9596        <Filename Value="AcronymDecoder.lpr"/>
     
    128129        <ResourceBaseClass Value="Form"/>
    129130      </Unit5>
     131      <Unit6>
     132        <Filename Value="Forms\UFormCategorySelect.pas"/>
     133        <IsPartOfProject Value="True"/>
     134        <ComponentName Value="FormCategorySelect"/>
     135        <ResourceBaseClass Value="Form"/>
     136      </Unit6>
    130137    </Units>
    131138  </ProjectOptions>
     
    138145    <SearchPaths>
    139146      <IncludeFiles Value="$(ProjOutDir)"/>
     147      <OtherUnitFiles Value="Forms"/>
    140148      <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
    141149    </SearchPaths>
  • trunk/AcronymDecoder.lpr

    r10 r13  
    99  Interfaces, // this includes the LCL widgetset
    1010  Forms, UFormMain, UAcronym, synapse, UFormImport, Common, SysUtils, TemplateGenerics,
    11   UFormAcronym, CoolTranslator, UFormSettings
     11  UFormAcronym, CoolTranslator, UFormSettings, UFormCategorySelect
    1212  { you can add units after this };
    1313
     
    3434  Application.CreateForm(TFormAcronym, FormAcronym);
    3535  Application.CreateForm(TFormSettings, FormSettings);
     36  Application.CreateForm(TFormCategorySelect, FormCategorySelect);
    3637  Application.Run;
    3738end.
  • trunk/Languages/AcronymDecoder.cs.po

    r12 r13  
    1010"Content-Transfer-Encoding: 8bit\n"
    1111"Language: cs\n"
    12 "X-Generator: Poedit 1.8.4\n"
     12"X-Generator: Poedit 1.8.7.1\n"
     13
     14#: tformacronym.acategoryadd.caption
     15msgctxt "tformacronym.acategoryadd.caption"
     16msgid "Add"
     17msgstr "Přidat"
     18
     19#: tformacronym.acategoryremove.caption
     20msgctxt "tformacronym.acategoryremove.caption"
     21msgid "Remove"
     22msgstr "Odebrat"
    1323
    1424#: tformacronym.buttoncancel.caption
     
    3848msgstr "Popis:"
    3949
     50#: tformacronym.label4.caption
     51msgid "Categories:"
     52msgstr "Kategorie:"
     53
     54#: tformcategoryselect.buttoncancel.caption
     55msgctxt "tformcategoryselect.buttoncancel.caption"
     56msgid "Cancel"
     57msgstr "Zrušit"
     58
     59#: tformcategoryselect.buttonok.caption
     60msgid "Select"
     61msgstr "Vybrat"
     62
     63#: tformcategoryselect.caption
     64msgid "Select categories"
     65msgstr "Vybrat kategories"
     66
    4067#: tformimport.buttonimport.caption
    4168msgid "Process"
     
    4774
    4875#: tformimport.caption
    49 #, fuzzy
    5076msgctxt "tformimport.caption"
    5177msgid "Import"
     
    6187
    6288#: tformmain.aacronymadd.caption
     89msgctxt "tformmain.aacronymadd.caption"
    6390msgid "Add"
    6491msgstr "Přidat"
     
    6996
    7097#: tformmain.aacronymremove.caption
     98msgctxt "tformmain.aacronymremove.caption"
    7199msgid "Remove"
    72100msgstr "Odebrat"
     
    103131msgctxt "tformmain.aimport.caption"
    104132msgid "Import"
    105 msgstr "Improtovat"
     133msgstr "Importovat"
    106134
    107135#: tformmain.asettings.caption
     
    169197msgstr "Jazyk:"
    170198
     199#: uformacronym.scategory
     200msgid "Category"
     201msgstr "Kategorie"
     202
     203#: uformacronym.sremovecategory
     204msgid "Remove categories"
     205msgstr "Odebrat kategorie"
     206
     207#: uformacronym.sremovecategoryquery
     208msgid "Do you really want to remove selected categories?"
     209msgstr "Opravdu chcete odebrat vybrané kategorie?"
     210
    171211#: uformimport.simportednewacronyms
    172212msgid "Imported %d new acronyms."
  • trunk/Languages/AcronymDecoder.po

    r12 r13  
    11msgid ""
    22msgstr "Content-Type: text/plain; charset=UTF-8"
     3
     4#: tformacronym.acategoryadd.caption
     5msgctxt "TFORMACRONYM.ACATEGORYADD.CAPTION"
     6msgid "Add"
     7msgstr ""
     8
     9#: tformacronym.acategoryremove.caption
     10msgctxt "TFORMACRONYM.ACATEGORYREMOVE.CAPTION"
     11msgid "Remove"
     12msgstr ""
    313
    414#: tformacronym.buttoncancel.caption
     
    2838msgstr ""
    2939
     40#: tformacronym.label4.caption
     41msgid "Categories:"
     42msgstr ""
     43
     44#: tformcategoryselect.buttoncancel.caption
     45msgctxt "TFORMCATEGORYSELECT.BUTTONCANCEL.CAPTION"
     46msgid "Cancel"
     47msgstr ""
     48
     49#: tformcategoryselect.buttonok.caption
     50msgid "Select"
     51msgstr ""
     52
     53#: tformcategoryselect.caption
     54msgid "Select categories"
     55msgstr ""
     56
    3057#: tformimport.buttonimport.caption
    3158msgid "Process"
     
    5077
    5178#: tformmain.aacronymadd.caption
     79msgctxt "tformmain.aacronymadd.caption"
    5280msgid "Add"
    5381msgstr ""
     
    5886
    5987#: tformmain.aacronymremove.caption
     88msgctxt "tformmain.aacronymremove.caption"
    6089msgid "Remove"
    6190msgstr ""
     
    158187msgstr ""
    159188
     189#: uformacronym.scategory
     190msgid "Category"
     191msgstr ""
     192
     193#: uformacronym.sremovecategory
     194msgid "Remove categories"
     195msgstr ""
     196
     197#: uformacronym.sremovecategoryquery
     198msgid "Do you really want to remove selected categories?"
     199msgstr ""
     200
    160201#: uformimport.simportednewacronyms
    161202msgid "Imported %d new acronyms."
  • trunk/UAcronym.pas

    r8 r13  
    99
    1010type
    11   TAcronymContexts = class;
     11  TAcronymCategories = class;
    1212  TAcronymMeanings = class;
    1313
     
    3333    Language: string;
    3434    Acronym: TAcronym;
    35     Contexts: TAcronymContexts;
     35    Categories: TAcronymCategories;
    3636    Source: TAcronymSource;
    3737    constructor Create;
     
    5353  end;
    5454
    55   { TAcronymContext }
    56 
    57   TAcronymContext = class
     55  { TAcronymCategory }
     56
     57  TAcronymCategory = class
    5858    Name: string;
    5959    Acronyms: TObjectList; // TObjectList<TAcronym>
     
    6262  end;
    6363
    64   { TAcronymContexts }
    65 
    66   TAcronymContexts = class(TObjectList)
    67     function SearchByName(Name: string): TAcronymContext;
    68     function AddContext(Name: string): TAcronymContext;
    69   end;
     64  { TAcronymCategories }
     65
     66  TAcronymCategories = class(TObjectList)
     67    function SearchByName(Name: string): TAcronymCategory;
     68    function AddContext(Name: string): TAcronymCategory;
     69    procedure AssignToStrings(Strings: TStrings);
     70    procedure AssignFromStrings(Strings: TStrings);
     71  end;
     72
     73  { TAcronymEntry }
    7074
    7175  TAcronymEntry = class
     
    7377    Meaning: string;
    7478    Description: string;
     79    Categories: TStringList;
     80    constructor Create;
     81    destructor Destroy; override;
    7582  end;
    7683
     
    8188    Sources: TObjectList; // TObjectList<TAcronymSource>
    8289    Acronyms: TAcronyms;
    83     Contexts: TAcronymContexts;
     90    Categories: TAcronymCategories;
    8491    Modified: Boolean;
    8592    constructor Create;
     
    101108end;
    102109
     110{ TAcronymEntry }
     111
     112constructor TAcronymEntry.Create;
     113begin
     114  Categories := TStringList.Create;
     115end;
     116
     117destructor TAcronymEntry.Destroy;
     118begin
     119  Categories.Free;
     120  inherited Destroy;
     121end;
     122
    103123{ TAcronymMeanings }
    104124
     
    124144constructor TAcronymMeaning.Create;
    125145begin
    126   Contexts := TAcronymContexts.Create(False);
     146  Categories := TAcronymCategories.Create(False);
    127147end;
    128148
    129149destructor TAcronymMeaning.Destroy;
    130150begin
    131   FreeAndNil(Contexts);
     151  FreeAndNil(Categories);
    132152  inherited Destroy;
    133153end;
     
    152172end;
    153173
    154 { TAcronymContexts }
    155 
    156 function TAcronymContexts.SearchByName(Name: string): TAcronymContext;
     174{ TAcronymCategories }
     175
     176function TAcronymCategories.SearchByName(Name: string): TAcronymCategory;
    157177var
    158178  I: Integer;
    159179begin
    160180  I := 0;
    161   while (I < Count) and (TAcronymContext(Items[I]).Name <> Name) do Inc(I);
    162   if I < Count then Result := TAcronymContext(Items[I])
     181  while (I < Count) and (TAcronymCategory(Items[I]).Name <> Name) do Inc(I);
     182  if I < Count then Result := TAcronymCategory(Items[I])
    163183    else Result := nil;
    164184end;
    165185
    166 function TAcronymContexts.AddContext(Name: string): TAcronymContext;
    167 begin
    168   Result := TAcronymContext.Create;
     186function TAcronymCategories.AddContext(Name: string): TAcronymCategory;
     187begin
     188  Result := TAcronymCategory.Create;
    169189  Result.Name := Name;
    170190  Add(Result);
    171191end;
    172192
     193procedure TAcronymCategories.AssignToStrings(Strings: TStrings);
     194var
     195  I: Integer;
     196begin
     197  Strings.Clear;
     198  for I := 0 to Count - 1 do
     199    Strings.AddObject(TAcronymCategory(Items[I]).Name, Items[I]);
     200end;
     201
     202procedure TAcronymCategories.AssignFromStrings(Strings: TStrings);
     203var
     204  I: Integer;
     205begin
     206  Clear;
     207  for I := 0 to Strings.Count - 1 do
     208    Add(TAcronymCategory(Strings.Objects[I]));
     209end;
     210
    173211
    174212{ TAcronym }
     
    185223end;
    186224
    187 { TAcronymContext }
    188 
    189 constructor TAcronymContext.Create;
     225{ TAcronymCategory }
     226
     227constructor TAcronymCategory.Create;
    190228begin
    191229  Acronyms := TObjectList.Create(False);
    192230end;
    193231
    194 destructor TAcronymContext.Destroy;
     232destructor TAcronymCategory.Destroy;
    195233begin
    196234  FreeAndNil(Acronyms);
     
    204242  Sources := TObjectList.Create;
    205243  Acronyms := TAcronyms.Create;
    206   Contexts := TAcronymContexts.Create;
     244  Categories := TAcronymCategories.Create;
     245  TAcronymCategory(Categories[Categories.Add(TAcronymCategory.Create)]).Name := 'Internet';
     246  TAcronymCategory(Categories[Categories.Add(TAcronymCategory.Create)]).Name := 'Software';
     247  TAcronymCategory(Categories[Categories.Add(TAcronymCategory.Create)]).Name := 'Chat';
    207248end;
    208249
     
    211252  FreeAndNil(Sources);
    212253  FreeAndNil(Acronyms);
    213   FreeAndNil(Contexts);
     254  FreeAndNil(Categories);
    214255  inherited Destroy;
    215256end;
     
    224265  I: Integer;
    225266  J: Integer;
    226   AcronymContext: TAcronymContext;
     267  AcronymContext: TAcronymCategory;
    227268begin
    228269  Self.FileName := FileName;
     
    252293      Context.DelimitedText := Line[2];
    253294      for J := 0 to Context.Count - 1 do begin
    254         AcronymContext := Contexts.SearchByName(Context[J]);
     295        AcronymContext := Categories.SearchByName(Context[J]);
    255296        if not Assigned(AcronymContext) then begin
    256           AcronymContext := TAcronymContext.Create;
     297          AcronymContext := TAcronymCategory.Create;
    257298          AcronymContext.Name := Context[J];
    258           Contexts.Add(AcronymContext);
     299          Categories.Add(AcronymContext);
    259300        end;
    260         NewMeaning.Contexts.Add(AcronymContext);
     301        NewMeaning.Categories.Add(AcronymContext);
    261302      end;
    262303    end;
     
    294335        Line.Add(Name);
    295336        Context.Clear;
    296         for J := 0 to Contexts.Count - 1 do
    297           Context.Add(TAcronymContext(Contexts[J]).Name);
     337        for J := 0 to Categories.Count - 1 do
     338          Context.Add(TAcronymCategory(Categories[J]).Name);
    298339        Line.Add(Context.DelimitedText);
    299340        F.Add(Line.CommaText);
  • trunk/UFormAcronym.lfm

    r12 r13  
    11object FormAcronym: TFormAcronym
    2   Left = 555
    3   Height = 296
    4   Top = 411
    5   Width = 420
     2  Left = 845
     3  Height = 448
     4  Top = 528
     5  Width = 509
    66  Caption = 'Acronym'
    7   ClientHeight = 296
    8   ClientWidth = 420
     7  ClientHeight = 448
     8  ClientWidth = 509
    99  OnClose = FormClose
    1010  OnKeyUp = FormKeyUp
    1111  OnShow = FormShow
    12   LCLVersion = '1.6.0.4'
     12  LCLVersion = '1.7'
    1313  object Label1: TLabel
    1414    Left = 8
    15     Height = 20
     15    Height = 24
    1616    Top = 16
    17     Width = 43
     17    Width = 56
    1818    Caption = 'Name:'
    1919    ParentColor = False
     
    2121  object EditAcronym: TEdit
    2222    Left = 136
    23     Height = 28
     23    Height = 34
    2424    Top = 15
    25     Width = 272
     25    Width = 361
    2626    Anchors = [akTop, akLeft, akRight]
    2727    OnKeyUp = FormKeyUp
     
    3030  object Label2: TLabel
    3131    Left = 8
    32     Height = 20
     32    Height = 24
    3333    Top = 49
    34     Width = 61
     34    Width = 79
    3535    Caption = 'Meaning:'
    3636    ParentColor = False
     
    3838  object EditMeaning: TEdit
    3939    Left = 136
    40     Height = 28
     40    Height = 34
    4141    Top = 49
    42     Width = 272
     42    Width = 361
    4343    Anchors = [akTop, akLeft, akRight]
    4444    OnKeyUp = FormKeyUp
     
    4646  end
    4747  object ButtonOk: TButton
    48     Left = 320
     48    Left = 409
    4949    Height = 25
    50     Top = 256
     50    Top = 408
    5151    Width = 75
    5252    Anchors = [akRight, akBottom]
     
    5757  end
    5858  object ButtonCancel: TButton
    59     Left = 224
     59    Left = 313
    6060    Height = 25
    61     Top = 256
     61    Top = 408
    6262    Width = 75
    6363    Anchors = [akRight, akBottom]
     
    6969  object Label3: TLabel
    7070    Left = 8
    71     Height = 20
     71    Height = 24
    7272    Top = 88
    73     Width = 79
     73    Width = 103
    7474    Caption = 'Description:'
    7575    ParentColor = False
     
    7979    Height = 114
    8080    Top = 88
    81     Width = 272
     81    Width = 361
    8282    Anchors = [akTop, akLeft, akRight]
    8383    ScrollBars = ssAutoBoth
    8484    TabOrder = 4
    8585  end
     86  object Label4: TLabel
     87    Left = 12
     88    Height = 24
     89    Top = 208
     90    Width = 96
     91    Caption = 'Categories:'
     92    ParentColor = False
     93  end
     94  object ListBox1: TListBox
     95    Left = 136
     96    Height = 141
     97    Top = 208
     98    Width = 360
     99    Anchors = [akTop, akLeft, akRight]
     100    ItemHeight = 0
     101    MultiSelect = True
     102    OnSelectionChange = ListBox1SelectionChange
     103    PopupMenu = PopupMenuCategory
     104    ScrollWidth = 358
     105    TabOrder = 5
     106    TopIndex = -1
     107  end
     108  object Button1: TButton
     109    Left = 136
     110    Height = 25
     111    Top = 360
     112    Width = 75
     113    Action = ACategoryAdd
     114    TabOrder = 6
     115  end
     116  object Button2: TButton
     117    Left = 232
     118    Height = 25
     119    Top = 360
     120    Width = 75
     121    Action = ACategoryRemove
     122    TabOrder = 7
     123  end
     124  object ActionList1: TActionList
     125    left = 361
     126    top = 240
     127    object ACategoryRemove: TAction
     128      Caption = 'Remove'
     129      OnExecute = ACategoryRemoveExecute
     130    end
     131    object ACategoryAdd: TAction
     132      Caption = 'Add'
     133      OnExecute = ACategoryAddExecute
     134    end
     135  end
     136  object PopupMenuCategory: TPopupMenu
     137    left = 192
     138    top = 244
     139  end
    86140end
  • trunk/UFormAcronym.lrt

    r12 r13  
    55TFORMACRONYM.BUTTONCANCEL.CAPTION=Cancel
    66TFORMACRONYM.LABEL3.CAPTION=Description:
     7TFORMACRONYM.LABEL4.CAPTION=Categories:
     8TFORMACRONYM.ACATEGORYREMOVE.CAPTION=Remove
     9TFORMACRONYM.ACATEGORYADD.CAPTION=Add
  • trunk/UFormAcronym.pas

    r8 r13  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
    9   StdCtrls, UAcronym;
     9  StdCtrls, ActnList, UAcronym;
    1010
    1111type
     
    1414
    1515  TFormAcronym = class(TForm)
     16    ACategoryRemove: TAction;
     17    ACategoryAdd: TAction;
     18    ActionList1: TActionList;
     19    Button1: TButton;
     20    Button2: TButton;
    1621    ButtonOk: TButton;
    1722    ButtonCancel: TButton;
     
    2126    Label2: TLabel;
    2227    Label3: TLabel;
     28    Label4: TLabel;
     29    ListBox1: TListBox;
    2330    MemoDescription: TMemo;
     31    PopupMenuCategory: TPopupMenu;
     32    procedure ACategoryAddExecute(Sender: TObject);
     33    procedure ACategoryRemoveExecute(Sender: TObject);
    2434    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    2535    procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
    2636    procedure FormShow(Sender: TObject);
     37    procedure ListBox1SelectionChange(Sender: TObject; User: boolean);
    2738  private
    28     { private declarations }
     39    procedure UpdateInterface;
    2940  public
    3041    procedure Load(Entry: TAcronymEntry);
     
    4051
    4152uses
    42   UFormMain;
     53  UFormMain, UFormCategorySelect;
     54
     55resourcestring
     56  SCategory = 'Category';
     57  SRemoveCategory = 'Remove categories';
     58  SRemoveCategoryQuery = 'Do you really want to remove selected categories?';
    4359
    4460{ TFormAcronym }
     
    5773end;
    5874
     75procedure TFormAcronym.ACategoryAddExecute(Sender: TObject);
     76var
     77  I: Integer;
     78begin
     79  FormCategorySelect.Load(ListBox1.Items);
     80  if FormCategorySelect.ShowModal = mrOk then begin
     81    for I := 0 to FormCategorySelect.ListBox1.Count - 1 do
     82      if FormCategorySelect.ListBox1.Selected[I] then begin
     83        ListBox1.Items.AddObject(FormCategorySelect.ListBox1.Items[I], FormCategorySelect.ListBox1.Items.Objects[I]);
     84      end;
     85  end;
     86end;
     87
     88procedure TFormAcronym.ACategoryRemoveExecute(Sender: TObject);
     89var
     90  I: Integer;
     91begin
     92  if MessageDlg(SRemoveCategory, SRemoveCategoryQuery,
     93  TMsgDlgType.mtConfirmation, [mbCancel, mbOk], 0) = mrOk then begin
     94    for I := ListBox1.Items.Count - 1 downto 0 do
     95    if ListBox1.Selected[I] then
     96      ListBox1.Items.Delete(I);
     97    UpdateInterface;
     98  end;
     99end;
     100
    59101procedure TFormAcronym.FormShow(Sender: TObject);
    60102begin
    61103  FormMain.PersistentForm1.Load(Self);
     104  UpdateInterface;
     105end;
     106
     107procedure TFormAcronym.ListBox1SelectionChange(Sender: TObject; User: boolean);
     108begin
     109  UpdateInterface;
     110end;
     111
     112procedure TFormAcronym.UpdateInterface;
     113begin
     114  ACategoryRemove.Enabled := ListBox1.ItemIndex <> -1;
    62115end;
    63116
     
    67120  EditMeaning.Text := Entry.Meaning;
    68121  MemoDescription.Text := Entry.Description;
     122  ListBox1.Items.Assign(Entry.Categories);
    69123end;
    70124
     
    74128  Entry.Meaning := EditMeaning.Text;
    75129  Entry.Description := MemoDescription.Text;
     130  Entry.Categories.Assign(ListBox1.Items);
    76131end;
    77132
  • trunk/UFormMain.lfm

    r12 r13  
    55  Width = 631
    66  Caption = 'Acronym Decoder'
    7   ClientHeight = 421
     7  ClientHeight = 414
    88  ClientWidth = 631
    99  Menu = MainMenu1
     
    1313  OnDestroy = FormDestroy
    1414  OnShow = FormShow
    15   LCLVersion = '1.6.0.4'
     15  LCLVersion = '1.7'
    1616  object ListViewAcronyms: TListView
    1717    Left = 8
    18     Height = 372
     18    Height = 365
    1919    Top = 40
    2020    Width = 613
     
    4646  object EditSearch: TEdit
    4747    Left = 8
    48     Height = 28
     48    Height = 34
    4949    Top = 8
    5050    Width = 611
  • trunk/UFormMain.pas

    r12 r13  
    8888  private
    8989    FAlwaysOnTop: Boolean;
     90    function CompareStrings(Strings1, Strings2: TStrings): Boolean;
    9091    procedure SetAlwaysOnTop(AValue: Boolean);
    9192  private
     
    227228var
    228229  TempEntry: TAcronymEntry;
     230  TempCategories: TStringList;
    229231  Meaning: TAcronymMeaning;
    230232begin
     
    235237    TempEntry.Meaning := Name;
    236238    TempEntry.Description := Description;
     239    Categories.AssignToStrings(TempEntry.Categories);
     240    TempCategories := TStringList.Create;
     241    TempCategories.Assign(TempEntry.Categories);
    237242    FormAcronym.Load(TempEntry);
    238243    if FormAcronym.ShowModal = mrOk then begin
     
    240245      if (TempEntry.Name <> Acronym.Name) or
    241246      (TempEntry.Meaning <> Name) or
    242       (TempEntry.Description <> Description) then begin
     247      (TempEntry.Description <> Description) or
     248      not CompareStrings(TempEntry.Categories, TempCategories) then begin
    243249        // TODO: Update item inplace if possible
    244250        AcronymDb.RemoveAcronym(Acronym.Name, Name);
    245251        Meaning := AcronymDb.AddAcronym(TempEntry.Name, TempEntry.Meaning);
    246252        Meaning.Description := TempEntry.Description;
     253        Meaning.Categories.AssignFromStrings(TempEntry.Categories);
    247254        UpdateAcronymsList;
    248255        UpdateInterface;
    249256      end;
    250257    end;
     258    TempEntry.Free;
     259    TempCategories.Free;
    251260  end;
    252261end;
     
    290299    Meaning := AcronymDb.AddAcronym(TempEntry.Name, TempEntry.Meaning);
    291300    Meaning.Description := TempEntry.Description;
     301    Meaning.Categories.AssignFromStrings(TempEntry.Categories);
    292302    UpdateAcronymsList;
    293303    UpdateInterface;
    294   end else TempEntry.Free;
     304  end;
     305  TempEntry.Free;
    295306end;
    296307
     
    347358    Item.Data := TAcronymMeaning(FoundAcronyms[Item.Index]);
    348359    ContextCombined := '';
    349     for I := 0 to Contexts.Count - 1 do
    350       ContextCombined := ContextCombined + TAcronymContext(Contexts[I]).Name + ',';
     360    for I := 0 to Categories.Count - 1 do
     361      ContextCombined := ContextCombined + TAcronymCategory(Categories[I]).Name + ',';
    351362    Delete(ContextCombined, Length(ContextCombined), 1);
    352363    Item.SubItems.Add(ContextCombined);
     
    372383begin
    373384  Visible := not Visible;
     385end;
     386
     387function TFormMain.CompareStrings(Strings1, Strings2: TStrings): Boolean;
     388var
     389  I: Integer;
     390begin
     391  Result := Strings1.Count = Strings2.Count;
     392  if not Result then Exit;
     393  for I := 0 to Strings1.Count - 1 do
     394    if (Strings1[I] <> Strings2[I]) or (Strings1.Objects[I] <> Strings2.Objects[I]) then begin
     395      Result := False;
     396      Exit;
     397    end;
    374398end;
    375399
Note: See TracChangeset for help on using the changeset viewer.