Changeset 168 for trunk/Forms
- Timestamp:
- Jul 1, 2023, 8:17:50 PM (18 months ago)
- Location:
- trunk/Forms
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormExport.pas
r167 r168 36 36 Table: TTable; 37 37 RedrawPending: Boolean; 38 procedure PrepareTable;39 38 procedure UpdateFileNameExt; 40 39 procedure LoadConfig; … … 62 61 begin 63 62 TableFormat := TTableFormat(ComboBoxOutputFormat.Items.Objects[ComboBoxOutputFormat.ItemIndex]); 64 SaveStringToFile(Table.GetOutput(TableFormat), EditOutputFile.Text); 63 TVCardFile(Core.Core.DataFile).VCard.ExportToFile(EditOutputFile.Text, TableFormat, 64 CheckBoxHumanReadableHeader.Checked); 65 65 end; 66 66 … … 118 118 begin 119 119 if RedrawPending then begin 120 PrepareTable; 120 TVCardFile(Core.Core.DataFile).VCard.ExportToTable(Table, 121 CheckBoxHumanReadableHeader.Checked); 121 122 Table.GetOutputListView(ListView1); 122 123 RedrawPending := False; 123 end;124 end;125 126 procedure TFormExport.PrepareTable;127 var128 Row: TRow;129 I: Integer;130 J: Integer;131 Values: TStringList;132 Index: Integer;133 Fields: TContactFields;134 Field: TContactField;135 Columns: TStringList;136 begin137 Fields := TContact.GetFields;138 Table.Clear;139 140 Values := TStringList.Create;141 Columns := TStringList.Create;142 try143 with TVCardFile(Core.Core.DataFile), VCard do begin144 Table.Title := ExtractFileNameWithoutExt(FileName);145 146 // Get all properties types147 for I := 0 to Contacts.Count - 1 do begin148 for J := 0 to Contacts[I].Properties.Count - 1 do149 if not Contacts[I].Properties[J].Name.StartsWith('PHOTO') and150 (Table.Columns.IndexOf(Contacts[I].Properties[J].Name) = -1) then begin151 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 begin157 for I := 0 to Table.Columns.Count - 1 do begin158 Field := Fields.GetBySysName(Table.Columns[I]);159 if Assigned(Field) then Table.Columns[I] := Field.Title;160 end;161 end;162 163 for I := 0 to Contacts.Count - 1 do begin164 Values.Clear;165 for J := 0 to Columns.Count - 1 do166 Values.Add('');167 for J := 0 to Contacts[I].Properties.Count - 1 do begin168 Index := Columns.IndexOf(Contacts[I].Properties[J].Name);169 if Index <> -1 then170 Values[Index] := Contacts[I].Properties[J].Value;171 end;172 173 Row := Table.AddRow;174 for J := 0 to Values.Count - 1 do175 Row.Cells.Add(Values[J]);176 end;177 end;178 finally179 Values.Free;180 Columns.Free;181 124 end; 182 125 end; -
trunk/Forms/FormImage.lfm
r165 r168 51 51 Anchors = [akLeft, akBottom] 52 52 Caption = 'Clear' 53 OnClick = uttonClearClick53 OnClick = ButtonClearClick 54 54 TabOrder = 2 55 55 end 56 56 object EditUrl: TEdit 57 57 Left = 84 58 Height = 3359 Top = 4 2658 Height = 43 59 Top = 416 60 60 Width = 610 61 61 Anchors = [akLeft, akRight, akBottom] … … 85 85 object Label1: TLabel 86 86 Left = 16 87 Height = 2 588 Top = 43 289 Width = 3 587 Height = 26 88 Top = 431 89 Width = 38 90 90 Anchors = [akLeft, akBottom] 91 91 Caption = 'URL:' -
trunk/Forms/FormImage.pas
r162 r168 22 22 OpenPictureDialog1: TOpenPictureDialog; 23 23 SavePictureDialog1: TSavePictureDialog; 24 procedure uttonClearClick(Sender: TObject);24 procedure ButtonClearClick(Sender: TObject); 25 25 procedure ButtonLoadClick(Sender: TObject); 26 26 procedure ButtonSaveClick(Sender: TObject); … … 67 67 end; 68 68 69 procedure TFormImage. uttonClearClick(Sender: TObject);69 procedure TFormImage.ButtonClearClick(Sender: TObject); 70 70 begin 71 71 Image.Clear; -
trunk/Forms/FormImport.lfm
r167 r168 80 80 Width = 464 81 81 Anchors = [akTop, akLeft, akRight] 82 OnChange = EditInputFileChange 82 83 TabOrder = 1 83 84 end -
trunk/Forms/FormImport.pas
r167 r168 27 27 procedure ButtonImportClick(Sender: TObject); 28 28 procedure ComboBoxInputFormatChange(Sender: TObject); 29 procedure EditInputFileChange(Sender: TObject); 29 30 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 30 31 procedure FormCreate(Sender: TObject); … … 47 48 48 49 uses 49 Core, Common, RegistryEx, VCardFile ;50 Core, Common, RegistryEx, VCardFile, VCard; 50 51 51 52 { TFormImport } … … 61 62 begin 62 63 TableFormat := TTableFormat(ComboBoxInputFormat.Items.Objects[ComboBoxInputFormat.ItemIndex]); 63 T able.SetInput(TableFormat, LoadFileToStr(EditInputFile.Text));64 Table.Title := ExtractFileNameWithoutExt(EditInputFile.Text);64 TVCardFile(Core.Core.DataFile).VCard.ImportFromFile(EditInputFile.Text, TableFormat, 65 CheckBoxHumanReadableHeader.Checked); 65 66 end; 66 67 … … 68 69 begin 69 70 UpdateTableFormat; 71 end; 72 73 procedure TFormImport.EditInputFileChange(Sender: TObject); 74 begin 75 RedrawPending := True; 70 76 end; 71 77
Note:
See TracChangeset
for help on using the changeset viewer.