Changeset 58


Ignore:
Timestamp:
Dec 8, 2021, 10:00:45 PM (3 years ago)
Author:
chronos
Message:
  • Added: Social tab in contact form.
  • Added: Allow to specify alternative property name for contact field definition to support various non-standard properties.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormContact.lfm

    r57 r58  
    1818    Top = 8
    1919    Width = 969
    20     ActivePage = TabSheetChat
     20    ActivePage = TabSheetSocial
    2121    Anchors = [akTop, akLeft, akRight, akBottom]
    2222    ParentFont = False
    23     TabIndex = 3
     23    TabIndex = 4
    2424    TabOrder = 0
    2525    object TabSheetGeneral: TTabSheet
     
    295295        ParentFont = False
    296296        TabOrder = 14
     297      end
     298      object Label49: TLabel
     299        Left = 432
     300        Height = 24
     301        Top = 332
     302        Width = 67
     303        Caption = 'Gender:'
     304        ParentColor = False
     305        ParentFont = False
     306      end
     307      object EditGender: TEdit
     308        Left = 575
     309        Height = 42
     310        Top = 328
     311        Width = 254
     312        ParentFont = False
     313        TabOrder = 15
    297314      end
    298315    end
     
    850867      end
    851868      object LabelOrganization2: TLabel
    852         Left = 451
    853         Height = 24
    854         Top = 24
     869        Left = 10
     870        Height = 24
     871        Top = 256
    855872        Width = 55
    856873        Caption = 'Skype:'
     
    859876      end
    860877      object EditSkype: TEdit
    861         Left = 608
    862         Height = 42
    863         Top = 20
     878        Left = 173
     879        Height = 42
     880        Top = 256
    864881        Width = 254
    865882        ParentFont = False
     
    10011018        ParentFont = False
    10021019        TabOrder = 9
     1020      end
     1021      object Label55: TLabel
     1022        Left = 451
     1023        Height = 24
     1024        Top = 24
     1025        Width = 59
     1026        Caption = 'Matrix:'
     1027        ParentColor = False
     1028        ParentFont = False
     1029      end
     1030      object EditMatrix: TEdit
     1031        Left = 608
     1032        Height = 42
     1033        Top = 20
     1034        Width = 254
     1035        ParentFont = False
     1036        TabOrder = 10
     1037      end
     1038    end
     1039    object TabSheetSocial: TTabSheet
     1040      Caption = 'Social'
     1041      ClientHeight = 628
     1042      ClientWidth = 959
     1043      OnHide = TabSheetSocialHide
     1044      OnShow = TabSheetSocialShow
     1045      object Label50: TLabel
     1046        Left = 451
     1047        Height = 24
     1048        Top = 164
     1049        Width = 79
     1050        Caption = 'Myspace:'
     1051        ParentColor = False
     1052        ParentFont = False
     1053      end
     1054      object EditMySpace: TEdit
     1055        Left = 608
     1056        Height = 42
     1057        Top = 160
     1058        Width = 254
     1059        ParentFont = False
     1060        TabOrder = 0
     1061      end
     1062      object EditTwitter: TEdit
     1063        Left = 173
     1064        Height = 42
     1065        Top = 64
     1066        Width = 254
     1067        ParentFont = False
     1068        TabOrder = 1
     1069      end
     1070      object Label51: TLabel
     1071        Left = 10
     1072        Height = 24
     1073        Top = 68
     1074        Width = 63
     1075        Caption = 'Twitter:'
     1076        ParentColor = False
     1077        ParentFont = False
     1078      end
     1079      object Label52: TLabel
     1080        Left = 10
     1081        Height = 24
     1082        Top = 116
     1083        Width = 92
     1084        Caption = 'Instagram:'
     1085        ParentColor = False
     1086        ParentFont = False
     1087      end
     1088      object Label53: TLabel
     1089        Left = 10
     1090        Height = 24
     1091        Top = 164
     1092        Width = 78
     1093        Caption = 'LinkedIn:'
     1094        ParentColor = False
     1095        ParentFont = False
     1096      end
     1097      object Label54: TLabel
     1098        Left = 10
     1099        Height = 24
     1100        Top = 212
     1101        Width = 83
     1102        Caption = 'Snapchat:'
     1103        ParentColor = False
     1104        ParentFont = False
     1105      end
     1106      object EditSnapchat: TEdit
     1107        Left = 173
     1108        Height = 42
     1109        Top = 208
     1110        Width = 254
     1111        ParentFont = False
     1112        TabOrder = 2
     1113      end
     1114      object EditLinkedIn: TEdit
     1115        Left = 173
     1116        Height = 42
     1117        Top = 160
     1118        Width = 254
     1119        ParentFont = False
     1120        TabOrder = 3
     1121      end
     1122      object EditInstagram: TEdit
     1123        Left = 173
     1124        Height = 42
     1125        Top = 112
     1126        Width = 254
     1127        ParentFont = False
     1128        TabOrder = 4
     1129      end
     1130      object LabelOrganization7: TLabel
     1131        Left = 451
     1132        Height = 24
     1133        Top = 20
     1134        Width = 84
     1135        Caption = 'PeerTube:'
     1136        ParentColor = False
     1137        ParentFont = False
     1138      end
     1139      object LabelOrganization8: TLabel
     1140        Left = 451
     1141        Height = 24
     1142        Top = 120
     1143        Width = 77
     1144        Caption = 'YouTube:'
     1145        ParentColor = False
     1146        ParentFont = False
     1147      end
     1148      object EditMastodon: TEdit
     1149        Left = 171
     1150        Height = 42
     1151        Top = 16
     1152        Width = 254
     1153        ParentFont = False
     1154        TabOrder = 5
     1155      end
     1156      object LabelOrganization9: TLabel
     1157        Left = 10
     1158        Height = 24
     1159        Top = 24
     1160        Width = 90
     1161        Caption = 'Mastodon:'
     1162        ParentColor = False
     1163        ParentFont = False
     1164      end
     1165      object LabelOrganization10: TLabel
     1166        Left = 451
     1167        Height = 24
     1168        Top = 216
     1169        Width = 59
     1170        Caption = 'Reddit:'
     1171        ParentColor = False
     1172        ParentFont = False
     1173      end
     1174      object EditReddit: TEdit
     1175        Left = 608
     1176        Height = 42
     1177        Top = 212
     1178        Width = 254
     1179        ParentFont = False
     1180        TabOrder = 6
     1181      end
     1182      object EditPeerTube: TEdit
     1183        Left = 608
     1184        Height = 42
     1185        Top = 16
     1186        Width = 254
     1187        ParentFont = False
     1188        TabOrder = 7
     1189      end
     1190      object EditYouTube: TEdit
     1191        Left = 608
     1192        Height = 42
     1193        Top = 116
     1194        Width = 254
     1195        ParentFont = False
     1196        TabOrder = 8
     1197      end
     1198      object EditFacebook: TEdit
     1199        Left = 608
     1200        Height = 42
     1201        Top = 68
     1202        Width = 254
     1203        ParentFont = False
     1204        TabOrder = 9
     1205      end
     1206      object LabelOrganization11: TLabel
     1207        Left = 451
     1208        Height = 24
     1209        Top = 72
     1210        Width = 86
     1211        Caption = 'Facebook:'
     1212        ParentColor = False
     1213        ParentFont = False
    10031214      end
    10041215    end
  • trunk/Forms/UFormContact.lrj

    r57 r58  
    1717{"hash":90692698,"name":"tformcontact.label10.caption","sourcebytes":[80,97,103,101,114,58],"value":"Pager:"},
    1818{"hash":258182170,"name":"tformcontact.label46.caption","sourcebytes":[87,101,98,32,97,100,100,114,101,115,115,58],"value":"Web address:"},
     19{"hash":230992922,"name":"tformcontact.label49.caption","sourcebytes":[71,101,110,100,101,114,58],"value":"Gender:"},
    1920{"hash":325173,"name":"tformcontact.tabsheethome.caption","sourcebytes":[72,111,109,101],"value":"Home"},
    2021{"hash":138641338,"name":"tformcontact.label7.caption","sourcebytes":[69,45,109,97,105,108,58],"value":"E-mail:"},
     
    6162{"hash":190298682,"name":"tformcontact.label48.caption","sourcebytes":[87,105,110,100,111,119,115,32,76,105,118,101,58],"value":"Windows Live:"},
    6263{"hash":22090,"name":"tformcontact.labelorganization6.caption","sourcebytes":[81,81,58],"value":"QQ:"},
     64{"hash":59478250,"name":"tformcontact.label55.caption","sourcebytes":[77,97,116,114,105,120,58],"value":"Matrix:"},
     65{"hash":94740348,"name":"tformcontact.tabsheetsocial.caption","sourcebytes":[83,111,99,105,97,108],"value":"Social"},
     66{"hash":10910938,"name":"tformcontact.label50.caption","sourcebytes":[77,121,115,112,97,99,101,58],"value":"Myspace:"},
     67{"hash":235645418,"name":"tformcontact.label51.caption","sourcebytes":[84,119,105,116,116,101,114,58],"value":"Twitter:"},
     68{"hash":175866794,"name":"tformcontact.label52.caption","sourcebytes":[73,110,115,116,97,103,114,97,109,58],"value":"Instagram:"},
     69{"hash":85712154,"name":"tformcontact.label53.caption","sourcebytes":[76,105,110,107,101,100,73,110,58],"value":"LinkedIn:"},
     70{"hash":141144634,"name":"tformcontact.label54.caption","sourcebytes":[83,110,97,112,99,104,97,116,58],"value":"Snapchat:"},
     71{"hash":209448506,"name":"tformcontact.labelorganization7.caption","sourcebytes":[80,101,101,114,84,117,98,101,58],"value":"PeerTube:"},
     72{"hash":111918730,"name":"tformcontact.labelorganization8.caption","sourcebytes":[89,111,117,84,117,98,101,58],"value":"YouTube:"},
     73{"hash":179701658,"name":"tformcontact.labelorganization9.caption","sourcebytes":[77,97,115,116,111,100,111,110,58],"value":"Mastodon:"},
     74{"hash":146452522,"name":"tformcontact.labelorganization10.caption","sourcebytes":[82,101,100,100,105,116,58],"value":"Reddit:"},
     75{"hash":163129754,"name":"tformcontact.labelorganization11.caption","sourcebytes":[70,97,99,101,98,111,111,107,58],"value":"Facebook:"},
    6376{"hash":90893459,"name":"tformcontact.tabsheetothers.caption","sourcebytes":[79,116,104,101,114,115],"value":"Others"},
    6477{"hash":89566314,"name":"tformcontact.label6.caption","sourcebytes":[78,111,116,101,115,58],"value":"Notes:"},
  • trunk/Forms/UFormContact.pas

    r57 r58  
    2323    ButtonPrevious: TButton;
    2424    EditAim: TEdit;
     25    EditMatrix: TEdit;
     26    EditYouTube: TEdit;
     27    EditGender: TEdit;
     28    EditLinkedIn: TEdit;
     29    EditFacebook: TEdit;
     30    EditInstagram: TEdit;
     31    EditMySpace: TEdit;
     32    EditTwitter: TEdit;
     33    EditReddit: TEdit;
     34    EditMastodon: TEdit;
    2535    EditWindowsLive: TEdit;
     36    EditSnapchat: TEdit;
    2637    EditYahoo: TEdit;
    2738    EditGoogleTalk: TEdit;
     
    7687    EditWorkPhone: TEdit;
    7788    EditQq: TEdit;
     89    EditPeerTube: TEdit;
    7890    GroupBox1: TGroupBox;
    7991    GroupBox2: TGroupBox;
     
    122134    Label47: TLabel;
    123135    Label48: TLabel;
     136    Label49: TLabel;
    124137    Label5: TLabel;
     138    Label50: TLabel;
     139    Label51: TLabel;
     140    Label52: TLabel;
     141    Label53: TLabel;
     142    Label54: TLabel;
     143    Label55: TLabel;
    125144    Label6: TLabel;
    126145    Label7: TLabel;
     
    129148    LabelOrganization: TLabel;
    130149    LabelOrganization1: TLabel;
     150    LabelOrganization10: TLabel;
     151    LabelOrganization11: TLabel;
    131152    LabelOrganization2: TLabel;
    132153    LabelOrganization3: TLabel;
     
    134155    LabelOrganization5: TLabel;
    135156    LabelOrganization6: TLabel;
     157    LabelOrganization7: TLabel;
     158    LabelOrganization8: TLabel;
     159    LabelOrganization9: TLabel;
    136160    MemoNotes: TMemo;
    137161    MenuItem1: TMenuItem;
     
    142166    PopupMenuPhoto: TPopupMenu;
    143167    SavePictureDialog1: TSavePictureDialog;
     168    TabSheetSocial: TTabSheet;
    144169    TabSheetChat: TTabSheet;
    145170    TabSheetOthers: TTabSheet;
     
    166191    procedure TabSheetOthersHide(Sender: TObject);
    167192    procedure TabSheetOthersShow(Sender: TObject);
     193    procedure TabSheetSocialHide(Sender: TObject);
     194    procedure TabSheetSocialShow(Sender: TObject);
    168195    procedure TabSheetWorkHide(Sender: TObject);
    169196    procedure TabSheetWorkShow(Sender: TObject);
     
    225252procedure TFormContact.TabSheetChatHide(Sender: TObject);
    226253begin
     254  Contact.Fields[cfMatrix] := EditMatrix.Text;
    227255  Contact.Fields[cfJabber] := EditJabber.Text;
    228256  Contact.Fields[cfIcq] := EditIcq.Text;
     
    234262  Contact.Fields[cfYahoo] := EditYahoo.Text;
    235263  Contact.Fields[cfAim] := EditAim.Text;
    236   Contact.Fields[cfIrc] := EditIrc.Text
     264  Contact.Fields[cfIrc] := EditIrc.Text;
     265
     266  ReloadAllPropertiesTab;
    237267end;
    238268
    239269procedure TFormContact.TabSheetChatShow(Sender: TObject);
    240270begin
     271  EditMatrix.Text := Contact.Fields[cfMatrix];
    241272  EditJabber.Text := Contact.Fields[cfJabber];
    242273  EditIcq.Text := Contact.Fields[cfIcq];
     
    274305  Contact.Fields[cfAnniversary] := EditAniversary.Text;
    275306  Contact.Fields[cfUrl] := EditWeb.Text;
     307  Contact.Fields[cfGender] := EditGender.Text;
    276308
    277309  // Photo
     
    358390  EditAniversary.Text := Contact.Fields[cfAnniversary];
    359391  EditWeb.Text := Contact.Fields[cfUrl];
     392  EditGender.Text := Contact.Fields[cfGender];
    360393
    361394  // Photo
     
    466499end;
    467500
     501procedure TFormContact.TabSheetSocialHide(Sender: TObject);
     502begin
     503  Contact.Fields[cfFacebook] := EditFacebook.Text;
     504  Contact.Fields[cfTwitter] := EditTwitter.Text;
     505  Contact.Fields[cfInstagram] := EditInstagram.Text;
     506  Contact.Fields[cfYouTube] := EditYouTube.Text;
     507  Contact.Fields[cfPeerTube] := EditPeerTube.Text;
     508  Contact.Fields[cfMastodon] := EditMastodon.Text;
     509  Contact.Fields[cfLinkedIn] := EditLinkedIn.Text;
     510  Contact.Fields[cfSnapchat] := EditSnapchat.Text;
     511  Contact.Fields[cfReddit] := EditReddit.Text;
     512  Contact.Fields[cfMySpace] := EditMySpace.Text;
     513
     514  ReloadAllPropertiesTab;
     515end;
     516
     517procedure TFormContact.TabSheetSocialShow(Sender: TObject);
     518begin
     519  EditFacebook.Text := Contact.Fields[cfFacebook];
     520  EditTwitter.Text := Contact.Fields[cfTwitter];
     521  EditInstagram.Text := Contact.Fields[cfInstagram];
     522  EditYouTube.Text := Contact.Fields[cfYouTube];
     523  EditPeerTube.Text := Contact.Fields[cfPeerTube];
     524  EditMastodon.Text := Contact.Fields[cfMastodon];
     525  EditLinkedIn.Text := Contact.Fields[cfLinkedIn];
     526  EditSnapchat.Text := Contact.Fields[cfSnapchat];
     527  EditReddit.Text := Contact.Fields[cfReddit];
     528  EditMySpace.Text := Contact.Fields[cfMySpace];
     529end;
     530
    468531procedure TFormContact.TabSheetWorkHide(Sender: TObject);
    469532begin
  • trunk/Languages/vCardStudio.cs.po

    r57 r58  
    319319msgstr "Windows Live:"
    320320
     321#: tformcontact.label49.caption
     322msgid "Gender:"
     323msgstr "Pohlaví:"
     324
    321325#: tformcontact.label5.caption
    322326msgid "Last name"
    323327msgstr "Příjmení"
     328
     329#: tformcontact.label50.caption
     330msgid "Myspace:"
     331msgstr "MySpace:"
     332
     333#: tformcontact.label51.caption
     334msgid "Twitter:"
     335msgstr "Twitter:"
     336
     337#: tformcontact.label52.caption
     338msgid "Instagram:"
     339msgstr "Instagram:"
     340
     341#: tformcontact.label53.caption
     342msgid "LinkedIn:"
     343msgstr "LinkedIn:"
     344
     345#: tformcontact.label54.caption
     346msgid "Snapchat:"
     347msgstr "Snapchat:"
     348
     349#: tformcontact.label55.caption
     350msgid "Matrix:"
     351msgstr "Matrix:"
    324352
    325353#: tformcontact.label6.caption
     
    350378msgstr "Oddělení:"
    351379
     380#: tformcontact.labelorganization10.caption
     381msgid "Reddit:"
     382msgstr "Reddit:"
     383
     384#: tformcontact.labelorganization11.caption
     385msgid "Facebook:"
     386msgstr "Facebook:"
     387
    352388#: tformcontact.labelorganization2.caption
    353389msgid "Skype:"
     
    370406msgstr "QQ:"
    371407
     408#: tformcontact.labelorganization7.caption
     409msgid "PeerTube:"
     410msgstr "PeerTube:"
     411
     412#: tformcontact.labelorganization8.caption
     413msgid "YouTube:"
     414msgstr "YouTube:"
     415
     416#: tformcontact.labelorganization9.caption
     417msgid "Mastodon:"
     418msgstr "Mastodon:"
     419
    372420#: tformcontact.tabsheetall.caption
    373421msgid "All fields"
     
    389437msgid "Others"
    390438msgstr "Ostatní"
     439
     440#: tformcontact.tabsheetsocial.caption
     441msgid "Social"
     442msgstr "Sociální"
    391443
    392444#: tformcontact.tabsheetwork.caption
     
    690742msgstr "Očekáván začátek vCard"
    691743
     744#: ucontact.sfacebook
     745msgid "Facebook"
     746msgstr "Facebook"
     747
    692748#: ucontact.sfax
    693749msgid "Fax"
     
    715771msgstr "Celé jméno"
    716772
     773#: ucontact.sgender
     774msgid "Gender"
     775msgstr "Pohlaví"
     776
    717777#: ucontact.sgoogletalk
    718778msgid "Google Talk"
     
    776836msgstr "ICQ"
    777837
     838#: ucontact.sinstagram
     839msgid "Instagram"
     840msgstr "Instagram"
     841
    778842#: ucontact.sinternetemail
    779843msgid "Internet E-mail"
     
    797861msgstr "Naposledy kontaktováno"
    798862
     863#: ucontact.slinkedin
     864msgid "LinkedIn"
     865msgstr "LinkedIn"
     866
    799867#: ucontact.smainphone
    800868msgid "Main phone"
    801869msgstr "Hlavní telefon"
    802870
     871#: ucontact.smastodon
     872msgid "Mastodon"
     873msgstr "Mastodon"
     874
     875#: ucontact.smatrix
     876msgid "Matrix"
     877msgstr "Matrix"
     878
    803879#: ucontact.smiddlename
    804880msgid "Middle Name"
     
    813889msgstr "MSN"
    814890
     891#: ucontact.smyspace
     892msgid "MySpace"
     893msgstr "MySpace"
     894
    815895#: ucontact.snickname
    816896msgid "Nick name"
     
    829909msgstr "Pager"
    830910
     911#: ucontact.speertube
     912msgid "PeerTube"
     913msgstr "PeerTube"
     914
    831915#: ucontact.sphoto
    832916msgid "Photo"
     
    837921msgstr "QQ"
    838922
     923#: ucontact.sreddit
     924msgid "Reddit"
     925msgstr "Reddit"
     926
    839927#: ucontact.srevision
    840928msgid "Revision"
     
    849937msgstr "Skype"
    850938
     939#: ucontact.ssnapchat
     940msgid "Snapchat"
     941msgstr "Snapchat"
     942
    851943#: ucontact.stelephone
    852944msgid "Telephone"
     
    868960msgid "Title Before"
    869961msgstr "Titul před"
     962
     963#: ucontact.stwitter
     964msgid "Twitter"
     965msgstr "Twitter"
    870966
    871967#: ucontact.suniqueidentifier
     
    9501046msgstr "Yahoo!"
    9511047
     1048#: ucontact.syoutube
     1049msgid "YouTube"
     1050msgstr "YouTube"
     1051
    9521052#: ucore.sappexit
    9531053msgid "Application exit"
  • trunk/Languages/vCardStudio.po

    r57 r58  
    309309msgstr ""
    310310
     311#: tformcontact.label49.caption
     312msgid "Gender:"
     313msgstr ""
     314
    311315#: tformcontact.label5.caption
    312316msgid "Last name"
     317msgstr ""
     318
     319#: tformcontact.label50.caption
     320msgid "Myspace:"
     321msgstr ""
     322
     323#: tformcontact.label51.caption
     324msgid "Twitter:"
     325msgstr ""
     326
     327#: tformcontact.label52.caption
     328msgid "Instagram:"
     329msgstr ""
     330
     331#: tformcontact.label53.caption
     332msgid "LinkedIn:"
     333msgstr ""
     334
     335#: tformcontact.label54.caption
     336msgid "Snapchat:"
     337msgstr ""
     338
     339#: tformcontact.label55.caption
     340msgid "Matrix:"
    313341msgstr ""
    314342
     
    340368msgstr ""
    341369
     370#: tformcontact.labelorganization10.caption
     371msgid "Reddit:"
     372msgstr ""
     373
     374#: tformcontact.labelorganization11.caption
     375msgid "Facebook:"
     376msgstr ""
     377
    342378#: tformcontact.labelorganization2.caption
    343379msgid "Skype:"
     
    360396msgstr ""
    361397
     398#: tformcontact.labelorganization7.caption
     399msgid "PeerTube:"
     400msgstr ""
     401
     402#: tformcontact.labelorganization8.caption
     403msgid "YouTube:"
     404msgstr ""
     405
     406#: tformcontact.labelorganization9.caption
     407msgid "Mastodon:"
     408msgstr ""
     409
    362410#: tformcontact.tabsheetall.caption
    363411msgid "All fields"
     
    378426#: tformcontact.tabsheetothers.caption
    379427msgid "Others"
     428msgstr ""
     429
     430#: tformcontact.tabsheetsocial.caption
     431msgid "Social"
    380432msgstr ""
    381433
     
    678730msgstr ""
    679731
     732#: ucontact.sfacebook
     733msgid "Facebook"
     734msgstr ""
     735
    680736#: ucontact.sfax
    681737msgid "Fax"
     
    703759msgstr ""
    704760
     761#: ucontact.sgender
     762msgid "Gender"
     763msgstr ""
     764
    705765#: ucontact.sgoogletalk
    706766msgid "Google Talk"
     
    764824msgstr ""
    765825
     826#: ucontact.sinstagram
     827msgid "Instagram"
     828msgstr ""
     829
    766830#: ucontact.sinternetemail
    767831msgid "Internet E-mail"
     
    785849msgstr ""
    786850
     851#: ucontact.slinkedin
     852msgid "LinkedIn"
     853msgstr ""
     854
    787855#: ucontact.smainphone
    788856msgid "Main phone"
    789857msgstr ""
    790858
     859#: ucontact.smastodon
     860msgid "Mastodon"
     861msgstr ""
     862
     863#: ucontact.smatrix
     864msgid "Matrix"
     865msgstr ""
     866
    791867#: ucontact.smiddlename
    792868msgid "Middle Name"
     
    801877msgstr ""
    802878
     879#: ucontact.smyspace
     880msgid "MySpace"
     881msgstr ""
     882
    803883#: ucontact.snickname
    804884msgid "Nick name"
     
    817897msgstr ""
    818898
     899#: ucontact.speertube
     900msgid "PeerTube"
     901msgstr ""
     902
    819903#: ucontact.sphoto
    820904msgid "Photo"
     
    825909msgstr ""
    826910
     911#: ucontact.sreddit
     912msgid "Reddit"
     913msgstr ""
     914
    827915#: ucontact.srevision
    828916msgid "Revision"
     
    837925msgstr ""
    838926
     927#: ucontact.ssnapchat
     928msgid "Snapchat"
     929msgstr ""
     930
    839931#: ucontact.stelephone
    840932msgid "Telephone"
     
    855947#: ucontact.stitlebefore
    856948msgid "Title Before"
     949msgstr ""
     950
     951#: ucontact.stwitter
     952msgid "Twitter"
    857953msgstr ""
    858954
     
    9381034msgstr ""
    9391035
     1036#: ucontact.syoutube
     1037msgid "YouTube"
     1038msgstr ""
     1039
    9401040#: ucore.sappexit
    9411041msgid "Application exit"
  • trunk/UContact.pas

    r57 r58  
    1313  TErrorEvent = procedure (Text: string; Line: Integer) of object;
    1414
    15   TDataType = (dtString, dtInteger, dtDate, dtDateTime, dtImage, dtStringList);
     15  TDataType = (dtNone, dtString, dtInteger, dtDate, dtDateTime, dtImage, dtStringList);
    1616
    1717  TContactFieldIndex = (cfFirstName, cfMiddleName, cfLastName, cfTitleBefore,
     
    2828    cfWorkAddressPostalCode, cfWorkAddressRegion, cfWorkAddressPostOfficeBox,
    2929    cfXTimesContacted, cfXLastTimeContacted, cfPhoto, cfDayOfBirth, cfRevision,
    30     cfVersion, cfAnniversary,
     30    cfVersion, cfAnniversary, cfGender,
    3131    cfJabber, cfIcq, cfWindowsLive, cfGoogleTalk, cfAim, cfQq, cfYahoo, cfIrc,
    32     cfSkype, cfMsn);
     32    cfSkype, cfMsn,
     33    cfTwitter, cfFacebook, cfInstagram, cfSnapchat, cfMatrix, cfYoutube,
     34    cfPeerTube, cfLinkedIn, cfMastodon, cfMySpace, cfReddit);
     35
     36  TContactFields = class;
    3337
    3438  { TContactField }
     
    4246    ValueIndex: Integer;
    4347    DataType: TDataType;
     48    Alternatives: TContactFields;
     49    function AddAlternative(Name: string; Groups: array of string; NoGroups:
     50      array of string): TContactField;
    4451    function GroupsContain(Name: string): Boolean;
    4552    function Match(ASysName: string; AGroups: TStringArray): Boolean;
     53    constructor Create;
     54    destructor Destroy; override;
    4655  end;
    4756
     
    5160    function AddNew(Name: string; Groups: array of string; NoGroups: array of string;
    5261      Title: string; Index: TContactFieldIndex; DataType:
    53       TDataType; ValueIndex: Integer = -1): TContactField;
     62      TDataType = dtNone; ValueIndex: Integer = -1): TContactField;
    5463    function GetBySysName(SysName: string): TContactField;
    5564    function GetBySysNameGroups(SysName: string; Groups: TStringArray): TContactField;
     
    101110    Properties: TContactProperties;
    102111    Parent: TContactsFile;
    103     function GetProperty(Index: TContactFieldIndex): TContactProperty;
     112    function GetProperty(Field: TContactField): TContactProperty; overload;
     113    function GetProperty(FieldIndex: TContactFieldIndex): TContactProperty; overload;
    104114    procedure Assign(Source: TContact);
    105115    function UpdateFrom(Source: TContact): Boolean;
     
    222232  SWebAddressHome = 'Web address home';
    223233  SWebAddressWork = 'Web address work';
     234  SGender = 'Gender';
     235  // Chat
    224236  SMsn = 'MSN';
    225237  SGoogleTalk = 'Google Talk';
     
    231243  SYahoo = 'Yahoo!';
    232244  SSkype = 'Skype';
     245  SMatrix = 'Matrix';
     246  // Social
     247  STwitter = 'Twitter';
     248  SFacebook = 'Facebook';
     249  SInstagram = 'Instagram';
     250  SMastodon = 'Mastodon';
     251  SSnapchat = 'Snapchat';
     252  SLinkedIn = 'LinkedIn';
     253  SYouTube = 'YouTube';
     254  SPeerTube = 'PeerTube';
     255  SReddit = 'Reddit';
     256  SMySpace = 'MySpace';
    233257
    234258function GetNext(var Text: string; Separator: string): string;
     
    256280
    257281{ TContactField }
     282
     283function TContactField.AddAlternative(Name: string; Groups: array of string;
     284  NoGroups: array of string): TContactField;
     285begin
     286  Result := Alternatives.AddNew(Name, Groups, NoGroups, Title, Index, DataType, ValueIndex);
     287end;
    258288
    259289function TContactField.GroupsContain(Name: string): Boolean;
     
    282312    end;
    283313  end;
     314end;
     315
     316constructor TContactField.Create;
     317begin
     318  Alternatives := TContactFields.Create;
     319end;
     320
     321destructor TContactField.Destroy;
     322begin
     323  FreeAndNil(Alternatives);
     324  inherited;
    284325end;
    285326
     
    520561function TContactFields.AddNew(Name: string; Groups: array of string;
    521562  NoGroups: array of string; Title: string; Index: TContactFieldIndex;
    522   DataType: TDataType; ValueIndex: Integer = -1): TContactField;
     563  DataType: TDataType = dtNone; ValueIndex: Integer = -1): TContactField;
    523564var
    524565  I: Integer;
     
    567608var
    568609  I: Integer;
    569   C: Integer;
    570 begin
    571   C := Count;
     610begin
    572611  I := 0;
    573612  while (I < Count) and (Items[I].Index <> Index) do Inc(I);
     
    594633begin
    595634  if not Assigned(Parent) then raise Exception.Create(SContactHasNoParent);
    596   Prop := GetProperty(Index);
    597   if Assigned(Prop) then begin
    598     Field := Parent.Fields.GetByIndex(Index);
    599     if Field.ValueIndex <> -1 then begin
    600       Result := Prop.ValueItem[Field.ValueIndex]
    601     end else Result := Prop.Value;
    602   end else Result := '';
     635  Field := Parent.Fields.GetByIndex(Index);
     636  if Assigned(Field) then begin
     637    Prop := GetProperty(Field);
     638    if Assigned(Prop) then begin
     639      Field := Parent.Fields.GetByIndex(Index);
     640      if Field.ValueIndex <> -1 then begin
     641        Result := Prop.ValueItem[Field.ValueIndex]
     642      end else Result := Prop.Value;
     643    end else Result := '';
     644  end else raise Exception.Create(SFieldIndexNotDefined);
    603645end;
    604646
     
    612654  Field := Parent.Fields.GetByIndex(Index);
    613655  if Assigned(Field) then begin
    614     Prop := Properties.GetByNameGroups(Field.SysName, Field.Groups, Field.NoGroups);
     656    Prop := GetProperty(Field);
    615657    if (not Assigned(Prop)) and (AValue <> '') then begin
    616658      Prop := TContactProperty.Create;
     
    633675end;
    634676
    635 function TContact.GetProperty(Index: TContactFieldIndex): TContactProperty;
     677function TContact.GetProperty(Field: TContactField): TContactProperty;
     678var
     679  I: Integer;
     680begin
     681  Result := Properties.GetByNameGroups(Field.SysName, Field.Groups, Field.NoGroups);
     682  I := 0;
     683  while (not Assigned(Result)) and (I < Field.Alternatives.Count) do begin
     684    Result := Properties.GetByNameGroups(Field.Alternatives[I].SysName,
     685      Field.Alternatives[I].Groups, Field.Alternatives[I].NoGroups);
     686    if Assigned(Result) then Break;
     687    Inc(I);
     688  end;
     689end;
     690
     691function TContact.GetProperty(FieldIndex: TContactFieldIndex): TContactProperty;
    636692var
    637693  Field: TContactField;
    638694begin
    639695  if not Assigned(Parent) then raise Exception.Create(SContactHasNoParent);
    640   Field := Parent.Fields.GetByIndex(Index);
     696  Field := Parent.Fields.GetByIndex(FieldIndex);
    641697  if Assigned(Field) then begin
    642     Result := Properties.GetByNameGroups(Field.SysName, Field.Groups, Field.NoGroups);
    643   end else raise Exception.Create(SFieldIndexNotDefined);
     698    Result := GetProperty(Field);
     699  end else Result := nil;
    644700end;
    645701
     
    872928    AddNew('EMAIL', ['WORK'], [], SWorkEmail, cfEmailWork, dtString);
    873929    AddNew('EMAIL', ['INTERNET'], [], SInternetEmail, cfEmailInternet, dtString);
    874     AddNew('NICKNAME', [], [], SNickName, cfNickName, dtString);
     930    with AddNew('NICKNAME', [], [], SNickName, cfNickName, dtString) do
     931      AddAlternative('X-NICKNAME', [], []);
    875932    AddNew('NOTE', [], [], SNote, cfNote, dtString);
    876933    AddNew('ROLE', [], [], SRole, cfRole, dtString);
     
    903960    AddNew('URL', ['HOME'], [], SWebAddressHome, cfUrlHome, dtString);
    904961    AddNew('URL', ['WORK'], [], SWebAddressWork, cfUrlWork, dtString);
     962    with AddNew('GENDER', [], [], SGender, cfGender, dtString) do
     963      AddAlternative('X-CENTRUM-CZ-SEX', [], []);
     964    // Chat
     965    AddNew('X-MATRIX', [], [], SMatrix, cfMatrix, dtString);
    905966    AddNew('X-JABBER', [], [], SJabber, cfJabber, dtString);
    906967    AddNew('X-AIM', [], [], SAim, cfAim, dtString);
    907968    AddNew('X-Windows Live', [], [], SWindowsLive, cfWindowsLive, dtString);
    908969    AddNew('X-YAHOO', [], [], SYahoo, cfYahoo, dtString);
    909     AddNew('X-SKYPE-USERNAME', [], [], SSkype, cfSkype, dtString);
     970    with AddNew('X-SKYPE-USERNAME', [], [], SSkype, cfSkype, dtString) do begin
     971      AddAlternative('X-SKYPE', [], []);
     972      AddAlternative('X-CENTRUM-CZ-SKYPE', [], []);
     973    end;
    910974    AddNew('X-QQ', [], [], SQq, cfQq, dtString);
    911975    AddNew('X-GOOGLE-TALK', [], [], SGoogleTalk, cfGoogleTalk, dtString);
    912     AddNew('X-ICQ', [], [], SIcq, cfIcq, dtString);
     976    with AddNew('X-ICQ', [], [], SIcq, cfIcq, dtString) do
     977      AddAlternative('X-CENTRUM-CZ-ICQ', [], []);
    913978    AddNew('X-IRC', [], [], SIrc, cfIrc, dtString);
    914     AddNew('X-MSN', [], [], SMsn, cfMsn, dtString);
     979    with AddNew('X-MSN', [], [], SMsn, cfMsn, dtString) do
     980      AddAlternative('X-CENTRUM-CZ-MSN', [], []);
     981    // Social
     982    with AddNew('X-TWITTER', [], [], STwitter, cfTwitter, dtString) do
     983      AddAlternative('X-SOCIALPROFILE', ['TWITTER'], []);
     984    with AddNew('X-FACEBOOK', [], [], SFacebook, cfFacebook, dtString) do
     985      AddAlternative('X-SOCIALPROFILE', ['FACEBOOK'], []);
     986    with AddNew('X-MASTODON', [], [], SMastodon, cfMastodon, dtString) do
     987      AddAlternative('X-SOCIALPROFILE', ['MASTODON'], []);
     988    with AddNew('X-YOUTUBE', [], [], SYouTube, cfYouTube, dtString) do
     989      AddAlternative('X-SOCIALPROFILE', ['YOUTUBE'], []);
     990    with AddNew('X-PEERTUBE', [], [], SPeerTube, cfPeerTube, dtString) do
     991      AddAlternative('X-SOCIALPROFILE', ['PEERTUBE'], []);
     992    with AddNew('X-LINKEDIN', [], [], SLinkedIn, cfLinkedIn, dtString) do
     993      AddAlternative('X-SOCIALPROFILE', ['LINKEDIN'], []);
     994    with AddNew('X-SNAPCHAT', [], [], SSnapchat, cfSnapchat, dtString) do
     995      AddAlternative('X-SOCIALPROFILE', ['SNAPCHAT'], []);
     996    with AddNew('X-INSTAGRAM', [], [], SInstagram, cfInstagram, dtString) do
     997      AddAlternative('X-SOCIALPROFILE', ['INSTAGRAM'], []);
     998    with AddNew('X-REDDIT', [], [], SReddit, cfReddit, dtString) do
     999      AddAlternative('X-SOCIALPROFILE', ['REDDIT'], []);
     1000    with AddNew('X-MYSPACE', [], [], SMySpace, cfMySpace, dtString) do
     1001      AddAlternative('X-SOCIALPROFILE', ['MYSPACE'], []);
    9151002  end;
    9161003end;
Note: See TracChangeset for help on using the changeset viewer.