Changeset 17 for trunk


Ignore:
Timestamp:
Feb 28, 2018, 12:56:11 PM (7 years ago)
Author:
chronos
Message:
  • Added: New Generate contacts Tools menu action to generate multiple random contacts.
Location:
trunk
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormContacts.lfm

    r14 r17  
    77  ClientHeight = 605
    88  ClientWidth = 807
     9  DesignTimePPI = 120
    910  OnClose = FormClose
    1011  OnCreate = FormCreate
    1112  OnShow = FormShow
    12   LCLVersion = '1.8.0.4'
     13  LCLVersion = '1.8.0.6'
    1314  object ListView1: TListView
    1415    Left = 0
     
    3233      item
    3334        Caption = 'Last Name'
    34         Width = 387
     35        Width = 100
     36      end   
     37      item
     38        Caption = 'Cell phone'
     39        Width = 100
     40      end   
     41      item
     42        Caption = 'Home phone'
     43        Width = 100
    3544      end>
    3645    MultiSelect = True
     
    5968    end
    6069    object ToolButton2: TToolButton
    61       Left = 30
     70      Left = 24
    6271      Top = 2
    6372      Action = AModify
    6473    end
    6574    object ToolButton3: TToolButton
    66       Left = 59
     75      Left = 47
    6776      Top = 2
    6877      Action = ARemove
  • trunk/Forms/UFormContacts.pas

    r15 r17  
    7575    Item.SubItems.Add(MiddleName);
    7676    Item.SubItems.Add(LastName);
     77    Item.SubItems.Add(TelCell);
     78    Item.SubItems.Add(TelHome);
    7779    Item.Data := Contacts[Item.Index];
    7880  end;
  • trunk/Forms/UFormMain.lfm

    r16 r17  
    167167        Action = Core.AFindDuplicate
    168168      end
     169      object MenuItem5: TMenuItem
     170        Action = Core.AGenerate
     171      end
    169172    end
    170173    object MenuItemHelp: TMenuItem
  • trunk/Forms/UFormMain.pas

    r16 r17  
    1919    MenuItem3: TMenuItem;
    2020    MenuItem4: TMenuItem;
     21    MenuItem5: TMenuItem;
    2122    MenuItemToolbar: TMenuItem;
    2223    MenuItemView: TMenuItem;
     
    111112  Control: TControl;
    112113begin
    113  for J := 0 to CoolBar1.ControlCount - 1 do begin
     114  for J := 0 to CoolBar1.ControlCount - 1 do begin
    114115    Control := CoolBar1.Controls[J];
    115116    if Control is TToolBar then begin
  • trunk/Languages/vCardStudio.cs.po

    r16 r17  
    5555msgstr "Najít duplikáty"
    5656
     57#: tcore.agenerate.caption
     58msgctxt "tcore.agenerate.caption"
     59msgid "Generate contacts"
     60msgstr ""
     61
    5762#: tcore.ahomepage.caption
    5863msgctxt "tcore.ahomepage.caption"
     
    255260msgstr "Příjimení"
    256261
     262#: tformcontacts.listview1.columns[4].caption
     263msgid "Cell phone"
     264msgstr ""
     265
     266#: tformcontacts.listview1.columns[5].caption
     267msgid "Home phone"
     268msgstr ""
     269
    257270#: tformfindduplicity.caption
    258271msgctxt "tformfindduplicity.caption"
     
    277290msgstr "Počet"
    278291
     292#: tformgenerate.buttongenerate.caption
     293msgid "Generate"
     294msgstr ""
     295
     296#: tformgenerate.caption
     297msgctxt "tformgenerate.caption"
     298msgid "Generate contacts"
     299msgstr ""
     300
     301#: tformgenerate.label1.caption
     302#, fuzzy
     303msgctxt "tformgenerate.label1.caption"
     304msgid "Count:"
     305msgstr "Počet:"
     306
    279307#: tformmain.caption
    280308msgid "vCard Studio"
     
    410438
    411439#: uformmain.scount
     440msgctxt "uformmain.scount"
    412441msgid "Count:"
    413442msgstr "Počet:"
     
    421450msgid "vCard file"
    422451msgstr "Soubor vCard"
     452
  • trunk/Languages/vCardStudio.po

    r16 r17  
    4545msgstr ""
    4646
     47#: tcore.agenerate.caption
     48msgctxt "tcore.agenerate.caption"
     49msgid "Generate contacts"
     50msgstr ""
     51
    4752#: tcore.ahomepage.caption
    4853msgctxt "tcore.ahomepage.caption"
     
    245250msgstr ""
    246251
     252#: tformcontacts.listview1.columns[4].caption
     253msgid "Cell phone"
     254msgstr ""
     255
     256#: tformcontacts.listview1.columns[5].caption
     257msgid "Home phone"
     258msgstr ""
     259
    247260#: tformfindduplicity.caption
    248261msgctxt "tformfindduplicity.caption"
     
    267280msgstr ""
    268281
     282#: tformgenerate.buttongenerate.caption
     283msgid "Generate"
     284msgstr ""
     285
     286#: tformgenerate.caption
     287msgctxt "tformgenerate.caption"
     288msgid "Generate contacts"
     289msgstr ""
     290
     291#: tformgenerate.label1.caption
     292msgctxt "tformgenerate.label1.caption"
     293msgid "Count:"
     294msgstr ""
     295
    269296#: tformmain.caption
    270297msgid "vCard Studio"
     
    398425
    399426#: uformmain.scount
     427msgctxt "uformmain.scount"
    400428msgid "Count:"
    401429msgstr ""
  • trunk/UContact.pas

    r16 r17  
    8888  TContacts = class(TObjectList)
    8989    ContactsFile: TContactsFile;
     90    function AddNew: TContact;
    9091    function Search(FullName: string): TContact;
    9192    function ToString: ansistring; override;
     
    121122
    122123{ TContacts }
     124
     125function TContacts.AddNew: TContact;
     126begin
     127  Result := TContact.Create;
     128  Result.Parent := ContactsFile;
     129  Add(Result);
     130end;
    123131
    124132function TContacts.Search(FullName: string): TContact;
  • trunk/UCore.lfm

    r16 r17  
    471471      OnExecute = AFindDuplicateExecute
    472472    end
     473    object AGenerate: TAction
     474      Caption = 'Generate contacts'
     475      OnExecute = AGenerateExecute
     476    end
    473477  end
    474478  object LastOpenedList1: TLastOpenedList
  • trunk/UCore.pas

    r16 r17  
    2626  TCore = class(TDataModule)
    2727    AAbout: TAction;
     28    AGenerate: TAction;
    2829    AFindDuplicate: TAction;
    2930    AFileMerge: TAction;
     
    5758    procedure AFileCloseExecute(Sender: TObject);
    5859    procedure AFindDuplicateExecute(Sender: TObject);
     60    procedure AGenerateExecute(Sender: TObject);
    5961    procedure AHomePageExecute(Sender: TObject);
    6062    procedure ASettingsExecute(Sender: TObject);
     
    9395
    9496uses
    95   UFormMain, UFormAbout, UFormSettings, UContact, UFormContacts, UFormFindDuplicity;
     97  UFormMain, UFormAbout, UFormSettings, UContact, UFormContacts, UFormFindDuplicity,
     98  UFormGenerate;
    9699
    97100resourcestring
     
    178181    Contacts := TContactsFile(DataFile).Contacts;
    179182    ShowModal;
     183    Free;
     184  end;
     185end;
     186
     187procedure TCore.AGenerateExecute(Sender: TObject);
     188begin
     189  FormGenerate := TFormGenerate.Create(nil);
     190  with FormGenerate do begin
     191    Contacts := TContactsFile(DataFile).Contacts;
     192    ShowModal;
     193    FormContacts.ReloadList;
     194    FormContacts.UpdateInterface;
     195    DataFile.Modified := True;
     196    FormMain.UpdateInterface;
    180197    Free;
    181198  end;
  • trunk/vCardStudio.lpi

    r16 r17  
    101101      </Item4>
    102102    </RequiredPackages>
    103     <Units Count="10">
     103    <Units Count="11">
    104104      <Unit0>
    105105        <Filename Value="vCardStudio.lpr"/>
     
    163163        <ResourceBaseClass Value="Form"/>
    164164      </Unit9>
     165      <Unit10>
     166        <Filename Value="Forms\UFormGenerate.pas"/>
     167        <IsPartOfProject Value="True"/>
     168        <ComponentName Value="FormGenerate"/>
     169        <ResourceBaseClass Value="Form"/>
     170      </Unit10>
    165171    </Units>
    166172  </ProjectOptions>
  • trunk/vCardStudio.lpr

    r16 r17  
    88  {$ENDIF}{$ENDIF}
    99  Interfaces, // this includes the LCL widgetset
    10   Forms, UFormMain, UCore, Common, CoolTranslator, UDataFile,
    11   TemplateGenerics, SysUtils, UFormContacts, UFormContact, UFormFindDuplicity
     10  Forms, UFormMain, UCore, Common, CoolTranslator, UDataFile, TemplateGenerics,
     11  SysUtils, UFormContacts, UFormContact, UFormFindDuplicity, UFormGenerate
    1212  { you can add units after this };
    1313
Note: See TracChangeset for help on using the changeset viewer.