Changeset 18


Ignore:
Timestamp:
Feb 28, 2018, 1:43:45 PM (6 years ago)
Author:
chronos
Message:
  • Added: From Find duplicities form it is possible to open the list of duplicit contacts for further modification/addition/removal.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormFindDuplicity.lfm

    r16 r18  
    3434      end>
    3535    OwnerData = True
     36    PopupMenu = PopupMenu1
    3637    ReadOnly = True
    3738    RowSelect = True
     
    3940    ViewStyle = vsReport
    4041    OnData = ListView1Data
     42    OnDblClick = AShowContactsExecute
    4143  end
    4244  object Panel1: TPanel
     
    6971    end
    7072  end
     73  object ActionList1: TActionList
     74    left = 218
     75    top = 128
     76    object AShowContacts: TAction
     77      Caption = 'Show contacts'
     78      OnExecute = AShowContactsExecute
     79    end
     80  end
     81  object PopupMenu1: TPopupMenu
     82    left = 75
     83    top = 124
     84    object MenuItem1: TMenuItem
     85      Action = AShowContacts
     86    end
     87  end
    7188end
  • trunk/Forms/UFormFindDuplicity.pas

    r16 r18  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    9   ExtCtrls, StdCtrls, Contnrs, UContact;
     9  ExtCtrls, StdCtrls, ActnList, Menus, Contnrs, UContact;
    1010
    1111type
     
    2929
    3030  TFormFindDuplicity = class(TForm)
     31    AShowContacts: TAction;
     32    ActionList1: TActionList;
    3133    ComboBoxField: TComboBox;
    3234    Label1: TLabel;
    3335    ListView1: TListView;
     36    MenuItem1: TMenuItem;
    3437    Panel1: TPanel;
     38    PopupMenu1: TPopupMenu;
     39    procedure AShowContactsExecute(Sender: TObject);
    3540    procedure ComboBoxFieldChange(Sender: TObject);
    3641    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     
    5964
    6065uses
    61   UCore;
     66  UCore, UFormContacts;
    6267
    6368{ TFoundItems }
     
    95100  with TFoundItem(FoundItems[Item.Index]) do begin
    96101    Item.Caption := Field;
     102    Item.Data := FoundItems[Item.Index];
    97103    Item.SubItems.Add(Contacts.ToString);
    98104    Item.SubItems.Add(IntToStr(Contacts.Count));
     
    156162end;
    157163
     164procedure TFormFindDuplicity.AShowContactsExecute(Sender: TObject);
     165var
     166  Form: TFormContacts;
     167  I: Integer;
     168begin
     169  if Assigned(ListView1.Selected) then begin
     170    Form := TFormContacts.Create(nil);
     171    Form.Contacts := TContacts.Create(False);
     172    Form.Contacts.ContactsFile := Contacts.ContactsFile;
     173    with TFoundItem(ListView1.Selected.Data) do
     174      for I := 0 to Contacts.Count - 1 do
     175        Form.Contacts.Add(Contacts[I]);
     176    Form.ShowModal;
     177    with TFoundItem(ListView1.Selected.Data) do begin
     178      // Remove all deleted
     179      for I := 0 to Contacts.Count - 1 do
     180        if Form.Contacts.IndexOf(Contacts[I]) = -1 then begin
     181          Form.Contacts.Remove(Contacts[I]);
     182          Self.Contacts.Remove(Contacts[I]);
     183          Self.Contacts.ContactsFile.Modified := True;
     184        end;
     185
     186      // Add newly added
     187      for I := 0 to Form.Contacts.Count - 1 do
     188        if Contacts.IndexOf(Form.Contacts[I]) = -1 then begin
     189          Form.Contacts.Add(Form.Contacts[I]);
     190          Self.Contacts.Add(Form.Contacts[I]);
     191          Self.Contacts.ContactsFile.Modified := True;
     192        end;
     193    end;
     194    Form.Contacts.Free;
     195    Form.Free;
     196    Find;
     197  end;
     198end;
     199
    158200procedure TFormFindDuplicity.FormClose(Sender: TObject;
    159201  var CloseAction: TCloseAction);
  • trunk/Forms/UFormGenerate.pas

    r17 r18  
    4949    Contact.FirstName := 'First ' + IntToStr(Random(10000));
    5050    Contact.LastName := 'Last ' + IntToStr(Random(10000));
    51     Contact.FullName := Contact.FirstName + ' ' + Contact.LastName;
     51    Contact.FullName := 'FullName ' + IntToStr(Random(100));
    5252    Contact.TelCell := IntToStr(Random(1000000000));
    5353    Contact.TelHome := IntToStr(Random(1000000000));
  • trunk/Languages/vCardStudio.cs.po

    r17 r18  
    5858msgctxt "tcore.agenerate.caption"
    5959msgid "Generate contacts"
    60 msgstr ""
     60msgstr "Generovat kontakty"
    6161
    6262#: tcore.ahomepage.caption
     
    262262#: tformcontacts.listview1.columns[4].caption
    263263msgid "Cell phone"
    264 msgstr ""
     264msgstr "Mobilní telefon"
    265265
    266266#: tformcontacts.listview1.columns[5].caption
    267267msgid "Home phone"
    268 msgstr ""
     268msgstr "Domácí telefon"
     269
     270#: tformfindduplicity.ashowcontacts.caption
     271msgid "Show contacts"
     272msgstr "Ukázat kontakty"
    269273
    270274#: tformfindduplicity.caption
     
    292296#: tformgenerate.buttongenerate.caption
    293297msgid "Generate"
    294 msgstr ""
     298msgstr "Generovat"
    295299
    296300#: tformgenerate.caption
    297301msgctxt "tformgenerate.caption"
    298302msgid "Generate contacts"
    299 msgstr ""
     303msgstr "Generovat kontakty"
    300304
    301305#: tformgenerate.label1.caption
    302 #, fuzzy
    303306msgctxt "tformgenerate.label1.caption"
    304307msgid "Count:"
     
    450453msgid "vCard file"
    451454msgstr "Soubor vCard"
    452 
  • trunk/Languages/vCardStudio.po

    r17 r18  
    258258msgstr ""
    259259
     260#: tformfindduplicity.ashowcontacts.caption
     261msgid "Show contacts"
     262msgstr ""
     263
    260264#: tformfindduplicity.caption
    261265msgctxt "tformfindduplicity.caption"
  • trunk/UCore.pas

    r17 r18  
    181181    Contacts := TContactsFile(DataFile).Contacts;
    182182    ShowModal;
     183    FormContacts.ReloadList;
     184    FormMain.UpdateInterface;
    183185    Free;
    184186  end;
Note: See TracChangeset for help on using the changeset viewer.