Changeset 167 for trunk/Forms
- Timestamp:
- Jul 1, 2023, 11:54:02 AM (18 months ago)
- Location:
- trunk/Forms
- Files:
-
- 3 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormContacts.lfm
r162 r167 1 1 object FormContacts: TFormContacts 2 Left = 4002 Left = 675 3 3 Height = 908 4 Top = 2 124 Top = 266 5 5 Width = 1210 6 6 Caption = 'Contacts' … … 255 255 end 256 256 object SaveDialog1: TSaveDialog 257 Title = 'Uložit soubor jako'258 257 Left = 720 259 258 Top = 408 260 259 end 261 260 object OpenDialog1: TOpenDialog 262 Title = 'Otevřít existující soubor'263 261 Left = 720 264 262 Top = 480 -
trunk/Forms/FormContacts.lrj
r162 r167 19 19 {"hash":19140,"name":"tformcontacts.acut.caption","sourcebytes":[67,117,116],"value":"Cut"}, 20 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"}, 22 {"hash":201423615,"name":"tformcontacts.savedialog1.title","sourcebytes":[85,108,111,197,190,105,116,32,115,111,117,98,111,114,32,106,97,107,111],"value":"Ulo\u017Eit soubor jako"}, 23 {"hash":45680018,"name":"tformcontacts.opendialog1.title","sourcebytes":[79,116,101,118,197,153,195,173,116,32,101,120,105,115,116,117,106,195,173,99,195,173,32,115,111,117,98,111,114],"value":"Otev\u0159\u00EDt existuj\u00EDc\u00ED soubor"} 21 {"hash":174310419,"name":"tformcontacts.acolumns.caption","sourcebytes":[67,111,108,117,109,110,115],"value":"Columns"} 24 22 ]} -
trunk/Forms/FormExport.lfm
r162 r167 1 1 object FormExport: TFormExport 2 Left = 5662 Left = 859 3 3 Height = 679 4 Top = 4614 Top = 380 5 5 Width = 842 6 6 Caption = 'Export' … … 94 94 object ListView1: TListView 95 95 Left = 19 96 Height = 4 3397 Top = 1 4996 Height = 409 97 Top = 173 98 98 Width = 775 99 99 Anchors = [akTop, akLeft, akRight, akBottom] … … 103 103 ViewStyle = vsReport 104 104 end 105 object CheckBoxHumanReadableHeader: TCheckBox 106 Left = 16 107 Height = 30 108 Top = 128 109 Width = 231 110 Caption = 'Human readable header' 111 OnChange = CheckBoxHumanReadableHeaderChange 112 TabOrder = 4 113 end 105 114 end 106 115 object SaveDialog1: TSaveDialog 107 Title = 'Uložit soubor jako'108 116 Left = 350 109 117 Top = 163 110 118 end 119 object TimerRedraw: TTimer 120 Interval = 200 121 OnTimer = TimerRedrawTimer 122 Left = 205 123 Top = 277 124 end 111 125 end -
trunk/Forms/FormExport.lrj
r162 r167 6 6 {"hash":50353482,"name":"tformexport.label2.caption","sourcebytes":[79,117,116,112,117,116,32,102,105,108,101,58],"value":"Output file:"}, 7 7 {"hash":77164181,"name":"tformexport.buttonbrowse.caption","sourcebytes":[66,114,111,119,115,101],"value":"Browse"}, 8 {"hash": 201423615,"name":"tformexport.savedialog1.title","sourcebytes":[85,108,111,197,190,105,116,32,115,111,117,98,111,114,32,106,97,107,111],"value":"Ulo\u017Eit soubor jako"}8 {"hash":46972866,"name":"tformexport.checkboxhumanreadableheader.caption","sourcebytes":[72,117,109,97,110,32,114,101,97,100,97,98,108,101,32,104,101,97,100,101,114],"value":"Human readable header"} 9 9 ]} -
trunk/Forms/FormExport.pas
r162 r167 5 5 uses 6 6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls, 7 Table, LazFileUtils, FormEx;7 ExtCtrls, Table, LazFileUtils, FormEx; 8 8 9 9 type … … 15 15 ButtonCancel: TButton; 16 16 ButtonExport: TButton; 17 CheckBoxHumanReadableHeader: TCheckBox; 17 18 ComboBoxOutputFormat: TComboBox; 18 19 EditOutputFile: TEdit; … … 22 23 SaveDialog1: TSaveDialog; 23 24 ScrollBox1: TScrollBox; 25 TimerRedraw: TTimer; 24 26 procedure ButtonBrowseClick(Sender: TObject); 25 27 procedure ButtonExportClick(Sender: TObject); 28 procedure CheckBoxHumanReadableHeaderChange(Sender: TObject); 26 29 procedure ComboBoxOutputFormatChange(Sender: TObject); 27 30 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); … … 29 32 procedure FormDestroy(Sender: TObject); 30 33 procedure FormShow(Sender: TObject); 34 procedure TimerRedrawTimer(Sender: TObject); 31 35 private 32 36 Table: TTable; 37 RedrawPending: Boolean; 33 38 procedure PrepareTable; 34 39 procedure UpdateFileNameExt; … … 43 48 44 49 uses 45 Core, Common, RegistryEx, VCardFile ;50 Core, Common, RegistryEx, VCardFile, VCard; 46 51 47 52 { TFormExport } … … 58 63 TableFormat := TTableFormat(ComboBoxOutputFormat.Items.Objects[ComboBoxOutputFormat.ItemIndex]); 59 64 SaveStringToFile(Table.GetOutput(TableFormat), EditOutputFile.Text); 65 end; 66 67 procedure TFormExport.CheckBoxHumanReadableHeaderChange(Sender: TObject); 68 begin 69 RedrawPending := True; 60 70 end; 61 71 … … 102 112 procedure TFormExport.FormShow(Sender: TObject); 103 113 begin 104 PrepareTable; 105 Table.GetOutputListView(ListView1); 114 RedrawPending := True; 115 end; 116 117 procedure TFormExport.TimerRedrawTimer(Sender: TObject); 118 begin 119 if RedrawPending then begin 120 PrepareTable; 121 Table.GetOutputListView(ListView1); 122 RedrawPending := False; 123 end; 106 124 end; 107 125 … … 113 131 Values: TStringList; 114 132 Index: Integer; 115 begin 133 Fields: TContactFields; 134 Field: TContactField; 135 Columns: TStringList; 136 begin 137 Fields := TContact.GetFields; 138 Table.Clear; 139 116 140 Values := TStringList.Create; 141 Columns := TStringList.Create; 117 142 try 118 143 with TVCardFile(Core.Core.DataFile), VCard do begin … … 123 148 for J := 0 to Contacts[I].Properties.Count - 1 do 124 149 if not Contacts[I].Properties[J].Name.StartsWith('PHOTO') and 125 (Table.Columns.IndexOf(Contacts[I].Properties[J].Name) = -1) then 126 Table.Columns.Add(Contacts[I].Properties[J].Name); 150 (Table.Columns.IndexOf(Contacts[I].Properties[J].Name) = -1) then begin 151 Table.Columns.Add(Contacts[I].Properties[J].Name); 152 Columns.Add(Contacts[I].Properties[J].Name); 153 end; 154 end; 155 156 if CheckBoxHumanReadableHeader.Checked then begin 157 for I := 0 to Table.Columns.Count - 1 do begin 158 Field := Fields.GetBySysName(Table.Columns[I]); 159 if Assigned(Field) then Table.Columns[I] := Field.Title; 160 end; 127 161 end; 128 162 129 163 for I := 0 to Contacts.Count - 1 do begin 130 164 Values.Clear; 131 for J := 0 to Table.Columns.Count - 1 do165 for J := 0 to Columns.Count - 1 do 132 166 Values.Add(''); 133 167 for J := 0 to Contacts[I].Properties.Count - 1 do begin 134 Index := Table.Columns.IndexOf(Contacts[I].Properties[J].Name);168 Index := Columns.IndexOf(Contacts[I].Properties[J].Name); 135 169 if Index <> -1 then 136 170 Values[Index] := Contacts[I].Properties[J].Value; … … 144 178 finally 145 179 Values.Free; 180 Columns.Free; 146 181 end; 147 182 end; … … 163 198 try 164 199 CurrentContext := Core.Core.ApplicationInfo1.GetRegistryContext; 165 EditOutputFile.Text := ReadStringWithDefault('LastExportFileName', 'Export.txt'); 166 TableFormat := TTableFormat(ReadIntegerWithDefault('TableFormat', Integer(tfCsv))); 200 EditOutputFile.Text := ReadStringWithDefault('ExportFileName', 'Export.txt'); 201 TableFormat := TTableFormat(ReadIntegerWithDefault('ExportTableFormat', Integer(tfCsv))); 202 CheckBoxHumanReadableHeader.Checked := ReadBoolWithDefault('ExportHumanReadableColumns', CheckBoxHumanReadableHeader.Checked); 167 203 ComboBoxOutputFormat.ItemIndex := ComboBoxOutputFormat.Items.IndexOfObject(TObject(TableFormat)); 168 204 finally … … 176 212 try 177 213 CurrentContext := Core.Core.ApplicationInfo1.GetRegistryContext; 178 WriteString('LastExportFileName', EditOutputFile.Text); 179 WriteInteger('TableFormat', Integer(ComboBoxOutputFormat.Items.Objects[ComboBoxOutputFormat.ItemIndex])); 214 WriteString('ExportFileName', EditOutputFile.Text); 215 WriteInteger('ExportTableFormat', Integer(ComboBoxOutputFormat.Items.Objects[ComboBoxOutputFormat.ItemIndex])); 216 WriteBool('ExportHumanReadableColumns', CheckBoxHumanReadableHeader.Checked); 180 217 finally 181 218 Free; -
trunk/Forms/FormMain.lfm
r165 r167 1 1 object FormMain: TFormMain 2 Left = 5 103 Height = 8224 Top = 2 725 Width = 1 2542 Left = 534 3 Height = 993 4 Top = 223 5 Width = 1491 6 6 AllowDropFiles = True 7 7 Caption = 'vCard Studio' 8 ClientHeight = 7929 ClientWidth = 1 2548 ClientHeight = 959 9 ClientWidth = 1491 10 10 DesignTimePPI = 144 11 11 Menu = MainMenu1 … … 19 19 OnShow = FormShow 20 20 LCLVersion = '2.2.6.0' 21 WindowState = wsMaximized22 21 object CoolBar1: TCoolBar 23 22 Left = 0 24 23 Height = 43 25 24 Top = 0 26 Width = 1 25425 Width = 1491 27 26 AutoSize = True 28 27 Bands = < … … 149 148 Caption = '-' 150 149 end 150 object MenuItem12: TMenuItem 151 Action = Core.AFileCompare 152 end 153 object Separator1: TMenuItem 154 Caption = '-' 155 end 151 156 object MenuItem3: TMenuItem 152 157 Action = Core.AFileCombine … … 155 160 Action = Core.AFileSplit 156 161 end 157 object MenuItem12: TMenuItem 158 Action = Core.AFileCompare 162 object Separator2: TMenuItem 163 Caption = '-' 164 end 165 object MenuItem16: TMenuItem 166 Action = Core.AFileImport 159 167 end 160 168 object MenuItem15: TMenuItem -
trunk/Forms/FormMain.pas
r165 r167 21 21 MenuItem14: TMenuItem; 22 22 MenuItem15: TMenuItem; 23 MenuItem16: TMenuItem; 23 24 MenuItemColumns: TMenuItem; 24 25 MenuItem3: TMenuItem; … … 46 47 MenuItemFile: TMenuItem; 47 48 PopupMenuOpenRecent: TPopupMenu; 49 Separator1: TMenuItem; 50 Separator2: TMenuItem; 48 51 ToolBarOther: TToolBar; 49 52 ToolBarFile: TToolBar; -
trunk/Forms/FormProperties.lfm
r162 r167 1 1 object FormProperties: TFormProperties 2 Left = 4002 Left = 675 3 3 Height = 908 4 Top = 2 124 Top = 266 5 5 Width = 1210 6 6 Caption = 'Contacts' … … 192 192 end 193 193 object SaveDialog1: TSaveDialog 194 Title = 'Uložit soubor jako'195 194 Left = 760 196 195 Top = 448 197 196 end 198 197 object OpenDialog1: TOpenDialog 199 Title = 'Otevřít existující soubor'200 198 Left = 760 201 199 Top = 520 -
trunk/Forms/FormProperties.lrj
r162 r167 10 10 {"hash":4863557,"name":"tformproperties.aclone.caption","sourcebytes":[67,108,111,110,101],"value":"Clone"}, 11 11 {"hash":201478110,"name":"tformproperties.asavevaluetofile.caption","sourcebytes":[83,97,118,101,32,118,97,108,117,101,32,116,111,32,102,105,108,101,46,46,46],"value":"Save value to file..."}, 12 {"hash":231494782,"name":"tformproperties.aloadvaluefromfile.caption","sourcebytes":[76,111,97,100,32,118,97,108,117,101,32,102,114,111,109,32,102,105,108,101,46,46,46],"value":"Load value from file..."}, 13 {"hash":201423615,"name":"tformproperties.savedialog1.title","sourcebytes":[85,108,111,197,190,105,116,32,115,111,117,98,111,114,32,106,97,107,111],"value":"Ulo\u017Eit soubor jako"}, 14 {"hash":45680018,"name":"tformproperties.opendialog1.title","sourcebytes":[79,116,101,118,197,153,195,173,116,32,101,120,105,115,116,117,106,195,173,99,195,173,32,115,111,117,98,111,114],"value":"Otev\u0159\u00EDt existuj\u00EDc\u00ED soubor"} 12 {"hash":231494782,"name":"tformproperties.aloadvaluefromfile.caption","sourcebytes":[76,111,97,100,32,118,97,108,117,101,32,102,114,111,109,32,102,105,108,101,46,46,46],"value":"Load value from file..."} 15 13 ]}
Note:
See TracChangeset
for help on using the changeset viewer.