Changeset 129 for trunk/Forms


Ignore:
Timestamp:
Apr 9, 2022, 11:52:13 AM (3 years ago)
Author:
chronos
Message:
  • Added: TVCard as TComponent descendant.
  • Modified: TContactsFile renamed to TVCardFile and moved into separate file.
Location:
trunk/Forms
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormCompare.pas

    r127 r129  
    55uses
    66  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
    7   UContact, Diff, LCLType, LCLIntf, ComCtrls, Buttons, Menus, ActnList, SynEdit,
     7  UVCard, Diff, LCLType, LCLIntf, ComCtrls, Buttons, Menus, ActnList, SynEdit,
    88  SynEditMiscClasses, SynHighlighterPosition, SynEditHighlighter, UCommon,
    99  USynEditEx;
     
    8383
    8484uses
    85   UCore;
     85  UCore, UVCardFile;
    8686
    8787{ TFormCompare }
     
    334334  Ext := ExtractFileExt(AFileName);
    335335  if Ext = VCardFileExt then begin
    336     with TContactsFile.Create do
     336    with TVCardFile.Create do
    337337    try
    338338      LoadFromFile(AFileName);
    339       Result := AsString;
     339      Result := VCard.AsString;
    340340    finally
    341341      Free;
  • trunk/Forms/UFormContact.pas

    r127 r129  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    7   ComCtrls, ActnList, Menus, ExtCtrls, ExtDlgs, Buttons, UContact, LCLIntf,
     7  ComCtrls, ActnList, Menus, ExtCtrls, ExtDlgs, Buttons, UVCard, LCLIntf,
    88  UFormProperties, DateUtils, {$IFDEF LCLGTK2}Gtk2Globals, {$ENDIF}UContactImage,
    99  ubarcodes;
  • trunk/Forms/UFormContacts.pas

    r128 r129  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    7   Menus, ActnList, UContact, UListViewSort, LazUTF8, Clipbrd,
     7  Menus, ActnList, UVCard, UListViewSort, LazUTF8, Clipbrd,
    88  Generics.Collections;
    99
     
    102102
    103103uses
    104   UFormContact, UCore;
     104  UFormContact, UCore, UVCardFile;
    105105
    106106resourcestring
     
    304304      ListView1.Columns.Delete(ListView1.Columns.Count - 1);
    305305    for I := 0 to ListView1.Columns.Count - 1 do begin
    306       if Assigned(Contacts) and Assigned(Contacts.ContactsFile) then begin
     306      if Assigned(Contacts) and Assigned(Contacts.ParentVCard) then begin
    307307        Field := TContact.GetFields.GetByIndex(ListViewColumns[I]);
    308308        if Assigned(Field) then
     
    334334    Contact := TContact.Create;
    335335    try
    336       Contact.ContactsFile := Contacts.ContactsFile;
     336      Contact.ParentVCard := Contacts.ParentVCard;
    337337      FormContact.Contact := Contact;
    338338      FormContact.OnGetPrevious := GetPreviousContact;
     
    364364    Contact := TContact.Create;
    365365    try
    366       Contact.ContactsFile := Contacts.ContactsFile;
     366      Contact.ParentVCard := Contacts.ParentVCard;
    367367      Contact.Assign(TContact(ListView1.Selected.Data));
    368368      FormContact.Contact := Contact;
     
    436436procedure TFormContacts.ALoadFromFileExecute(Sender: TObject);
    437437var
    438   TempFile: TContactsFile;
     438  TempFile: TVCardFile;
    439439begin
    440440  if Assigned(ListView1.Selected) then begin
    441     TempFile := TContactsFile.Create;
     441    TempFile := TVCardFile.Create;
    442442    try
    443443      OpenDialog1.Filter := TempFile.GetFileFilter;
     
    465465    Contact := TContact.Create;
    466466    try
    467       Contact.ContactsFile := Contacts.ContactsFile;
     467      Contact.ParentVCard := Contacts.ParentVCard;
    468468      Contact.Assign(TContact(ListView1.Selected.Data));
    469469      FormContact.Contact := Contact;
     
    486486procedure TFormContacts.APasteExecute(Sender: TObject);
    487487var
    488   PasteContacts: TContactsFile;
     488  PasteContacts: TVCardFile;
    489489  Lines: TStringList;
    490490begin
    491   PasteContacts := TContactsFile.Create;
     491  PasteContacts := TVCardFile.Create;
    492492  Lines := TStringList.Create;
    493493  try
    494494    Lines.Text := Clipboard.AsText;
    495     PasteContacts.LoadFromStrings(Lines);
    496     if PasteContacts.Contacts.Count > 0 then begin
     495    PasteContacts.VCard.LoadFromStrings(Lines);
     496    if PasteContacts.VCard.Contacts.Count > 0 then begin
    497497      if Assigned(ListView1.Selected) then begin
    498498        Contacts.InsertContacts(Contacts.IndexOf(ListView1.Selected.Data),
    499           PasteContacts.Contacts);
    500       end else Contacts.AddContacts(PasteContacts.Contacts);
     499          PasteContacts.VCard.Contacts);
     500      end else Contacts.AddContacts(PasteContacts.VCard.Contacts);
    501501      Core.DataFile.Modified := True;
    502502      ReloadList;
     
    528528procedure TFormContacts.ASaveToFileExecute(Sender: TObject);
    529529var
    530   TempFile: TContactsFile;
     530  TempFile: TVCardFile;
    531531begin
    532532  if Assigned(ListView1.Selected) then begin
    533     TempFile := TContactsFile.Create;
     533    TempFile := TVCardFile.Create;
    534534    try
    535535      SaveDialog1.Filter := TempFile.GetFileFilter;
  • trunk/Forms/UFormFind.pas

    r128 r129  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    7   ExtCtrls, StdCtrls, ActnList, Menus, UContact, UFormContacts;
     7  ExtCtrls, StdCtrls, ActnList, Menus, UVCard, UFormContacts;
    88
    99type
  • trunk/Forms/UFormFindDuplicity.pas

    r128 r129  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    7   ExtCtrls, StdCtrls, ActnList, Menus, UContact, Generics.Collections,
     7  ExtCtrls, StdCtrls, ActnList, Menus, UVCard, Generics.Collections,
    88  Generics.Defaults;
    99
     
    6565
    6666uses
    67   UCore, UFormContacts;
     67  UCore, UFormContacts, UVCardFile;
    6868
    6969{ TFoundItems }
     
    191191    Form := TFormContacts.Create(nil);
    192192    Form.Contacts := TContacts.Create(False);
    193     Form.Contacts.ContactsFile := Contacts.ContactsFile;
     193    Form.Contacts.ParentVCard := Contacts.ParentVCard;
    194194    with TFoundItem(ListView1.Selected.Data) do
    195195      for I := 0 to Contacts.Count - 1 do
     
    202202          Form.Contacts.Remove(Contacts[I]);
    203203          Self.Contacts.Remove(Contacts[I]);
    204           Self.Contacts.ContactsFile.Modified := True;
     204          Self.Contacts.ParentVCard.Modified := True;
    205205        end;
    206206
     
    210210          Form.Contacts.Add(Form.Contacts[I]);
    211211          Self.Contacts.Add(Form.Contacts[I]);
    212           Self.Contacts.ContactsFile.Modified := True;
     212          Self.Contacts.ParentVCard.Modified := True;
    213213        end;
    214214    end;
     
    221221procedure TFormFindDuplicity.ButtonMergeClick(Sender: TObject);
    222222var
    223   TempContacts: TContactsFile;
    224   I: Integer;
    225 begin
    226   TempContacts := TContactsFile.Create;
     223  TempContacts: TVCardFile;
     224  I: Integer;
     225begin
     226  TempContacts := TVCardFile.Create;
    227227  try
    228228    for I := 0 to Contacts.Count - 1 do
    229       TempContacts.Contacts.Merge(Contacts[I], TContactField(ComboBoxField.Items.Objects[ComboBoxField.ItemIndex]).Index);
    230     Contacts.Assign(TempContacts.Contacts);
     229      TempContacts.VCard.Contacts.Merge(Contacts[I], TContactField(ComboBoxField.Items.Objects[ComboBoxField.ItemIndex]).Index);
     230    Contacts.Assign(TempContacts.VCard.Contacts);
    231231    Find;
    232232  finally
  • trunk/Forms/UFormGenerate.pas

    r127 r129  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    7   Spin, UContact;
     7  Spin, UVCard;
    88
    99type
  • trunk/Forms/UFormMain.pas

    r127 r129  
    7676
    7777uses
    78   UCore, UFormContacts, UContact;
     78  UCore, UFormContacts, UVCard, UVCardFile;
    7979
    8080resourcestring
     
    121121    CoolBar1.AutosizeBands;
    122122
    123     FormContacts.Contacts := TContactsFile(Core.DataFile).Contacts;
     123    FormContacts.Contacts := TVCardFile(Core.DataFile).VCard.Contacts;
    124124    FormContacts.ManualDock(Self, nil, alClient);
    125125    FormContacts.Align := alClient;
  • trunk/Forms/UFormProperties.pas

    r128 r129  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    7   Menus, ActnList, UContact, UDataFile, UListViewSort, LazUTF8,
     7  Menus, ActnList, UVCard, UDataFile, UListViewSort, LazUTF8,
    88  Generics.Collections;
    99
  • trunk/Forms/UFormProperty.pas

    r127 r129  
    44
    55uses
    6   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, UContact;
     6  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, UVCard;
    77
    88type
  • trunk/Forms/UFormSource.pas

    r127 r129  
    5151
    5252uses
    53   UCore, UTheme, UContact;
     53  UCore, UTheme, UVCard;
    5454
    5555{ TFormSource }
  • trunk/Forms/UFormTest.pas

    r128 r129  
    4949
    5050uses
    51   UCore, UFormTestCase, UContact;
     51  UCore, UFormTestCase, UVCard;
    5252
    5353{ TFormTest }
Note: See TracChangeset for help on using the changeset viewer.