- Timestamp:
- Aug 23, 2022, 10:06:54 AM (2 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContacts.lfm
r128 r138 13 13 OnResize = FormResize 14 14 OnShow = FormShow 15 LCLVersion = '2.2. 0.4'15 LCLVersion = '2.2.2.0' 16 16 object ListView1: TListView 17 17 Left = 0 18 Height = 8 1018 Height = 809 19 19 Top = 0 20 20 Width = 1210 … … 68 68 Left = 0 69 69 Height = 39 70 Top = 84 270 Top = 841 71 71 Width = 1210 72 72 Align = alBottom … … 116 116 Left = 0 117 117 Height = 32 118 Top = 8 10118 Top = 809 119 119 Width = 1210 120 120 OnChange = ListViewFilter1Change … … 123 123 object StatusBar1: TStatusBar 124 124 Left = 0 125 Height = 2 7126 Top = 88 1125 Height = 28 126 Top = 880 127 127 Width = 1210 128 128 Panels = < … … 171 171 object MenuItem8: TMenuItem 172 172 Action = ASaveToFile 173 end 174 object Separator1: TMenuItem 175 Caption = '-' 176 end 177 object MenuItemColumns: TMenuItem 178 Action = AColumns 173 179 end 174 180 end … … 233 239 ShortCut = 16470 234 240 end 241 object AColumns: TAction 242 Caption = 'Columns' 243 OnExecute = AColumnsExecute 244 end 235 245 end 236 246 object ListViewSort1: TListViewSort -
trunk/Forms/UFormContacts.lrj
r82 r138 18 18 {"hash":304761,"name":"tformcontacts.acopy.caption","sourcebytes":[67,111,112,121],"value":"Copy"}, 19 19 {"hash":19140,"name":"tformcontacts.acut.caption","sourcebytes":[67,117,116],"value":"Cut"}, 20 {"hash":5671589,"name":"tformcontacts.apaste.caption","sourcebytes":[80,97,115,116,101],"value":"Paste"} 20 {"hash":5671589,"name":"tformcontacts.apaste.caption","sourcebytes":[80,97,115,116,101],"value":"Paste"}, 21 {"hash":174310419,"name":"tformcontacts.acolumns.caption","sourcebytes":[67,111,108,117,109,110,115],"value":"Columns"} 21 22 ]} -
trunk/Forms/UFormContacts.pas
r134 r138 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 7 Menus, ActnList, UVCard, UListViewSort, LazUTF8, Clipbrd, 8 Generics.Collections ;7 Menus, ActnList, UVCard, UListViewSort, LazUTF8, Clipbrd, URegistry, 8 Generics.Collections, Types; 9 9 10 10 type … … 16 16 AClone: TAction; 17 17 ACopy: TAction; 18 AColumns: TAction; 18 19 ACut: TAction; 19 20 APaste: TAction; … … 31 32 MenuItem11: TMenuItem; 32 33 MenuItem12: TMenuItem; 34 Separator1: TMenuItem; 35 MenuItemColumns: TMenuItem; 33 36 MenuItem2: TMenuItem; 34 37 MenuItem3: TMenuItem; … … 53 56 procedure AAddExecute(Sender: TObject); 54 57 procedure ACloneExecute(Sender: TObject); 58 procedure AColumnsExecute(Sender: TObject); 55 59 procedure ACopyExecute(Sender: TObject); 56 60 procedure ACutExecute(Sender: TObject); … … 83 87 procedure DoUpdateInterface; 84 88 procedure UpdateColumns; 89 procedure LoadFromRegistry(Context: TRegistryContext); 90 procedure SaveToRegistry(Context: TRegistryContext); 85 91 public 86 92 ListViewColumns: TContactFieldIndexes; 87 93 FilterItems: TContactFilterItems; 88 property Contacts: TContacts read FContacts write SetContacts;94 Context: TRegistryContext; 89 95 procedure ReloadList; 90 96 procedure BeginUpdate; 91 97 procedure EndUpdate; 92 98 procedure UpdateInterface; 99 property Contacts: TContacts read FContacts write SetContacts; 93 100 end; 94 101 … … 102 109 103 110 uses 104 UFormContact, UCore, UVCardFile ;111 UFormContact, UCore, UVCardFile, UFormColumns; 105 112 106 113 resourcestring … … 315 322 end; 316 323 324 procedure TFormContacts.LoadFromRegistry(Context: TRegistryContext); 325 var 326 I: Integer; 327 Registry: TRegistryEx; 328 ContactFieldIndex: TContactFieldIndex; 329 begin 330 Registry := TRegistryEx.Create; 331 with Registry do 332 try 333 RootKey := Context.RootKey; 334 OpenKey(Context.Key, True); 335 ListViewColumns.Clear; 336 I := 0; 337 while ValueExists('Column' + IntToStr(I)) do begin 338 ContactFieldIndex := TContactFieldIndex(ReadIntegerWithDefault('Column' + IntToStr(I), -1)); 339 ListViewColumns.Add(ContactFieldIndex); 340 Inc(I); 341 end; 342 343 if ListViewColumns.Count = 0 then begin 344 with ListViewColumns do begin 345 Add(cfFullName); 346 Add(cfFirstName); 347 Add(cfMiddleName); 348 Add(cfLastName); 349 Add(cfTel); 350 Add(cfTelCell); 351 Add(cfTelHome); 352 Add(cfTelWork); 353 Add(cfEmailWork); 354 Add(cfOrganization); 355 end; 356 end; 357 finally 358 Free; 359 end; 360 end; 361 362 procedure TFormContacts.SaveToRegistry(Context: TRegistryContext); 363 var 364 I: Integer; 365 Registry: TRegistryEx; 366 begin 367 Registry := TRegistryEx.Create; 368 with Registry do 369 try 370 RootKey := Context.RootKey; 371 OpenKey(Context.Key, True); 372 for I := 0 to ListViewColumns.Count - 1 do 373 WriteInteger('Column' + IntToStr(I), Integer(ListViewColumns[I])); 374 375 // Remove old columns 376 I := ListViewColumns.Count; 377 while ValueExists('Column' + IntToStr(I)) do begin 378 DeleteValue('Column' + IntToStr(I)); 379 Inc(I); 380 end; 381 finally 382 Free; 383 end; 384 end; 385 317 386 procedure TFormContacts.FormShow(Sender: TObject); 318 387 begin … … 320 389 Core.ThemeManager1.UseTheme(Self); 321 390 Core.PersistentForm1.Load(Self); 391 LoadFromRegistry(Context); 322 392 ReloadList; 323 393 UpdateInterface; … … 385 455 end; 386 456 457 procedure TFormContacts.AColumnsExecute(Sender: TObject); 458 var 459 FormColumns: TFormColumns; 460 I: Integer; 461 Field: TContactField; 462 begin 463 FormColumns := TFormColumns.Create(nil); 464 with FormColumns do 465 try 466 for I := 0 to ListViewColumns.Count - 1 do begin 467 Field := TContact.GetFields.GetByIndex(ListViewColumns[I]); 468 if Assigned(Field) then 469 ActiveColumns.AddObject(Field.Title, Field); 470 end; 471 for I := 0 to TContact.GetFields.Count - 1 do begin 472 Field := TContact.GetFields[I]; 473 if ListViewColumns.IndexOf(Field.Index) = -1 then 474 AvailableColumns.AddObject(Field.Title, Field); 475 end; 476 if ShowModal = mrOK then begin 477 ListViewColumns.Clear; 478 for I := 0 to ActiveColumns.Count - 1 do begin 479 ListViewColumns.Add(TContactField(ActiveColumns.Objects[I]).Index); 480 end; 481 UpdateColumns; 482 ReloadList; 483 end; 484 finally 485 Free; 486 end; 487 end; 488 387 489 procedure TFormContacts.ACopyExecute(Sender: TObject); 388 490 var … … 571 673 ); 572 674 begin 675 SaveToRegistry(Context); 573 676 Core.PersistentForm1.Save(Self); 574 677 end; … … 579 682 begin 580 683 FilterItems := TContactFilterItems.Create; 581 582 684 ListViewColumns := TContactFieldIndexes.Create; 583 with ListViewColumns do begin584 Add(cfFullName);585 Add(cfFirstName);586 Add(cfMiddleName);587 Add(cfLastName);588 Add(cfTel);589 Add(cfTelCell);590 Add(cfTelHome);591 Add(cfTelWork);592 Add(cfEmailWork);593 end;594 685 595 686 FContacts := nil; -
trunk/Forms/UFormMain.lfm
r126 r138 15 15 OnResize = FormResize 16 16 OnShow = FormShow 17 LCLVersion = '2.2. 0.4'17 LCLVersion = '2.2.2.0' 18 18 object CoolBar1: TCoolBar 19 19 Left = 0 … … 177 177 OnClick = MenuItemToolbarClick 178 178 end 179 object MenuItemColumns: TMenuItem 180 Caption = 'Columns' 181 OnClick = MenuItemColumnsClick 182 end 179 183 end 180 184 object MenuItemTools: TMenuItem -
trunk/Forms/UFormMain.lrj
r81 r138 6 6 {"hash":380871,"name":"tformmain.menuitemview.caption","sourcebytes":[86,105,101,119],"value":"View"}, 7 7 {"hash":8267778,"name":"tformmain.menuitemtoolbar.caption","sourcebytes":[77,97,105,110,32,116,111,111,108,98,97,114],"value":"Main toolbar"}, 8 {"hash":174310419,"name":"tformmain.menuitemcolumns.caption","sourcebytes":[67,111,108,117,109,110,115],"value":"Columns"}, 8 9 {"hash":5989939,"name":"tformmain.menuitemtools.caption","sourcebytes":[84,111,111,108,115],"value":"Tools"}, 9 10 {"hash":322608,"name":"tformmain.menuitemhelp.caption","sourcebytes":[72,101,108,112],"value":"Help"} -
trunk/Forms/UFormMain.pas
r129 r138 19 19 MenuItem12: TMenuItem; 20 20 MenuItem13: TMenuItem; 21 MenuItemColumns: TMenuItem; 21 22 MenuItem3: TMenuItem; 22 23 MenuItem4: TMenuItem; … … 59 60 procedure FormResize(Sender: TObject); 60 61 procedure FormShow(Sender: TObject); 62 procedure MenuItemColumnsClick(Sender: TObject); 61 63 procedure MenuItemToolbarClick(Sender: TObject); 62 64 private … … 76 78 77 79 uses 78 UCore, UFormContacts, UVCard, UVCardFile ;80 UCore, UFormContacts, UVCard, UVCardFile, URegistry; 79 81 80 82 resourcestring … … 121 123 CoolBar1.AutosizeBands; 122 124 125 FormContacts.Context := TRegistryContext.Create(Core.ApplicationInfo1.RegistryRoot, 126 Core.ApplicationInfo1.RegistryKey + '\ContactsColumns'); 123 127 FormContacts.Contacts := TVCardFile(Core.DataFile).VCard.Contacts; 124 128 FormContacts.ManualDock(Self, nil, alClient); … … 128 132 FormContacts.EndUpdate; 129 133 end; 134 end; 135 136 procedure TFormMain.MenuItemColumnsClick(Sender: TObject); 137 begin 138 FormContacts.AColumns.Execute; 130 139 end; 131 140 -
trunk/Languages/vCardStudio.cs.po
r134 r138 1 1 msgid "" 2 2 msgstr "" 3 "Content-Type: text/plain; charset=UTF-8\n"4 3 "Project-Id-Version: \n" 5 4 "POT-Creation-Date: \n" … … 7 6 "Last-Translator: Chronos <robie@centrum.cz>\n" 8 7 "Language-Team: \n" 8 "Language: cs\n" 9 9 "MIME-Version: 1.0\n" 10 "Content-Type: text/plain; charset=UTF-8\n" 10 11 "Content-Transfer-Encoding: 8bit\n" 11 "Language: cs\n" 12 "X-Generator: Poedit 3.0\n" 12 "X-Generator: Poedit 3.0.1\n" 13 13 14 14 #: tcore.aabout.caption … … 113 113 msgstr "Vybrat adresář" 114 114 115 #: tformcolumns.buttoncancel.caption 116 msgctxt "tformcolumns.buttoncancel.caption" 117 msgid "Cancel" 118 msgstr "Zrušit" 119 120 #: tformcolumns.buttondown.caption 121 msgid "Move down" 122 msgstr "Posunout dolů" 123 124 #: tformcolumns.buttonok.caption 125 msgctxt "tformcolumns.buttonok.caption" 126 msgid "OK" 127 msgstr "OK" 128 129 #: tformcolumns.buttontoleft.caption 130 msgid "<<" 131 msgstr "<<" 132 133 #: tformcolumns.buttontoright.caption 134 msgid ">>" 135 msgstr ">>" 136 137 #: tformcolumns.buttonup.caption 138 msgid "Move up" 139 msgstr "Posunout nahoru" 140 141 #: tformcolumns.caption 142 msgid "Columns settings" 143 msgstr "Nastavení sloupců" 144 145 #: tformcolumns.label1.caption 146 msgid "Active:" 147 msgstr "Aktivní:" 148 149 #: tformcolumns.label2.caption 150 msgid "Available:" 151 msgstr "Dostupné:" 152 115 153 #: tformcompare.afileopenleft.caption 116 154 msgid "Open left file" … … 622 660 msgstr "Klonovat" 623 661 662 #: tformcontacts.acolumns.caption 663 msgctxt "tformcontacts.acolumns.caption" 664 msgid "Columns" 665 msgstr "Sloupce" 666 624 667 #: tformcontacts.acopy.caption 625 668 msgctxt "tformcontacts.acopy.caption" … … 817 860 msgid "Find" 818 861 msgstr "Hledat" 862 863 #: tformmain.menuitemcolumns.caption 864 #, fuzzy 865 msgctxt "tformmain.menuitemcolumns.caption" 866 msgid "Columns" 867 msgstr "Sloupce" 819 868 820 869 #: tformmain.menuitemfile.caption -
trunk/Languages/vCardStudio.pot
r134 r138 103 103 msgstr "" 104 104 105 #: tformcolumns.buttoncancel.caption 106 msgctxt "tformcolumns.buttoncancel.caption" 107 msgid "Cancel" 108 msgstr "" 109 110 #: tformcolumns.buttondown.caption 111 msgid "Move down" 112 msgstr "" 113 114 #: tformcolumns.buttonok.caption 115 msgctxt "tformcolumns.buttonok.caption" 116 msgid "OK" 117 msgstr "" 118 119 #: tformcolumns.buttontoleft.caption 120 msgid "<<" 121 msgstr "" 122 123 #: tformcolumns.buttontoright.caption 124 msgid ">>" 125 msgstr "" 126 127 #: tformcolumns.buttonup.caption 128 msgid "Move up" 129 msgstr "" 130 131 #: tformcolumns.caption 132 msgid "Columns settings" 133 msgstr "" 134 135 #: tformcolumns.label1.caption 136 msgid "Active:" 137 msgstr "" 138 139 #: tformcolumns.label2.caption 140 msgid "Available:" 141 msgstr "" 142 105 143 #: tformcompare.afileopenleft.caption 106 144 msgid "Open left file" … … 612 650 msgstr "" 613 651 652 #: tformcontacts.acolumns.caption 653 msgctxt "tformcontacts.acolumns.caption" 654 msgid "Columns" 655 msgstr "" 656 614 657 #: tformcontacts.acopy.caption 615 658 msgctxt "tformcontacts.acopy.caption" … … 799 842 msgstr "" 800 843 844 #: tformmain.menuitemcolumns.caption 845 msgctxt "tformmain.menuitemcolumns.caption" 846 msgid "Columns" 847 msgstr "" 848 801 849 #: tformmain.menuitemfile.caption 802 850 msgctxt "tformmain.menuitemfile.caption" -
trunk/Languages/vCardStudio.sv.po
r134 r138 114 114 msgstr "Välj en katalog" 115 115 116 #: tformcolumns.buttoncancel.caption 117 #, fuzzy 118 msgctxt "tformcolumns.buttoncancel.caption" 119 msgid "Cancel" 120 msgstr "Avbryt" 121 122 #: tformcolumns.buttondown.caption 123 msgid "Move down" 124 msgstr "" 125 126 #: tformcolumns.buttonok.caption 127 #, fuzzy 128 msgctxt "tformcolumns.buttonok.caption" 129 msgid "OK" 130 msgstr "Ok" 131 132 #: tformcolumns.buttontoleft.caption 133 msgid "<<" 134 msgstr "" 135 136 #: tformcolumns.buttontoright.caption 137 msgid ">>" 138 msgstr "" 139 140 #: tformcolumns.buttonup.caption 141 msgid "Move up" 142 msgstr "" 143 144 #: tformcolumns.caption 145 msgid "Columns settings" 146 msgstr "" 147 148 #: tformcolumns.label1.caption 149 msgid "Active:" 150 msgstr "" 151 152 #: tformcolumns.label2.caption 153 msgid "Available:" 154 msgstr "" 155 116 156 #: tformcompare.afileopenleft.caption 117 157 msgid "Open left file" … … 626 666 msgstr "Klona" 627 667 668 #: tformcontacts.acolumns.caption 669 msgctxt "tformcontacts.acolumns.caption" 670 msgid "Columns" 671 msgstr "" 672 628 673 #: tformcontacts.acopy.caption 629 674 msgctxt "tformcontacts.acopy.caption" … … 821 866 msgid "Find" 822 867 msgstr "Hitta" 868 869 #: tformmain.menuitemcolumns.caption 870 msgctxt "tformmain.menuitemcolumns.caption" 871 msgid "Columns" 872 msgstr "" 823 873 824 874 #: tformmain.menuitemfile.caption -
trunk/UTest.pas
r134 r138 73 73 procedure Translate; 74 74 begin 75 ResultText[trNone] := SNone;76 ResultText[trPassed] := SPassed;77 ResultText[trFailed] := SFailed;75 ResultText[trNone] := SNone; 76 ResultText[trPassed] := SPassed; 77 ResultText[trFailed] := SFailed; 78 78 end; 79 79 -
trunk/vCardStudio.lpi
r134 r138 123 123 </Item7> 124 124 </RequiredPackages> 125 <Units Count="2 3">125 <Units Count="24"> 126 126 <Unit0> 127 127 <Filename Value="vCardStudio.lpr"/> … … 267 267 <IsPartOfProject Value="True"/> 268 268 </Unit22> 269 <Unit23> 270 <Filename Value="Forms\UFormColumns.pas"/> 271 <IsPartOfProject Value="True"/> 272 <ComponentName Value="FormColumns"/> 273 <ResourceBaseClass Value="Form"/> 274 </Unit23> 269 275 </Units> 270 276 </ProjectOptions> -
trunk/vCardStudio.lpr
r134 r138 7 7 Interfaces, // this includes the LCL widgetset 8 8 Forms, UFormMain, UCore, Diff, SysUtils, UFormCompare, UTestCases, 9 UVCardFile ;9 UVCardFile, UFormColumns; 10 10 11 11 {$R *.res}
Note:
See TracChangeset
for help on using the changeset viewer.