Changeset 167


Ignore:
Timestamp:
Jul 1, 2023, 11:54:02 AM (17 months ago)
Author:
chronos
Message:
  • Added: Import form preparation.
Location:
trunk
Files:
5 added
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Core.lfm

    r162 r167  
    384384      ImageIndex = 19
    385385      OnExecute = AFileExportExecute
     386    end
     387    object AFileImport: TAction
     388      Category = 'File'
     389      Caption = 'Import...'
     390      OnExecute = AFileImportExecute
    386391    end
    387392  end
  • trunk/Core.lrj

    r164 r167  
    2121{"hash":154699365,"name":"tcore.anormalize.caption","sourcebytes":[78,111,114,109,97,108,105,122,101],"value":"Normalize"},
    2222{"hash":124337662,"name":"tcore.afileexport.caption","sourcebytes":[69,120,112,111,114,116,46,46,46],"value":"Export..."},
     23{"hash":124338510,"name":"tcore.afileimport.caption","sourcebytes":[73,109,112,111,114,116,46,46,46],"value":"Import..."},
    2324{"hash":190444780,"name":"tcore.applicationinfo1.description","sourcebytes":[118,67,97,114,100,32,102,105,108,101,115,32,109,97,110,97,103,101,109,101,110,116,32,116,111,111,108],"value":"vCard files management tool"},
    2425{"hash":51995065,"name":"tcore.selectdirectorydialog1.title","sourcebytes":[83,101,108,101,99,116,32,100,105,114,101,99,116,111,114,121],"value":"Select directory"}
  • trunk/Core.pas

    r165 r167  
    1515  TCore = class(TDataModule)
    1616    AAbout: TAction;
     17    AFileImport: TAction;
    1718    AFileExport: TAction;
    1819    ANormalize: TAction;
     
    5152    procedure AFileCompareExecute(Sender: TObject);
    5253    procedure AFileExportExecute(Sender: TObject);
     54    procedure AFileImportExecute(Sender: TObject);
    5355    procedure AFileNewExecute(Sender: TObject);
    5456    procedure AFileOpenExecute(Sender: TObject);
     
    132134  FormSettings, FormFindDuplicity, FormCompare, TestCase, FormNormalize,
    133135  FormGenerate, FormError, FormFind, FormSource, TestCases, FormExport, FormEx,
    134   FormAbout, FormTests;
     136  FormAbout, FormTests, FormImport;
    135137
    136138resourcestring
     
    210212  finally
    211213    FormExport.Free;
     214  end;
     215end;
     216
     217procedure TCore.AFileImportExecute(Sender: TObject);
     218var
     219  FormImport: TFormImport;
     220begin
     221  FormImport := TFormImport.Create(nil);
     222  try
     223    FormImport.ShowModal;
     224  finally
     225    FormImport.Free;
    212226  end;
    213227end;
  • trunk/Forms/FormContacts.lfm

    r162 r167  
    11object FormContacts: TFormContacts
    2   Left = 400
     2  Left = 675
    33  Height = 908
    4   Top = 212
     4  Top = 266
    55  Width = 1210
    66  Caption = 'Contacts'
     
    255255  end
    256256  object SaveDialog1: TSaveDialog
    257     Title = 'Uložit soubor jako'
    258257    Left = 720
    259258    Top = 408
    260259  end
    261260  object OpenDialog1: TOpenDialog
    262     Title = 'Otevřít existující soubor'
    263261    Left = 720
    264262    Top = 480
  • trunk/Forms/FormContacts.lrj

    r162 r167  
    1919{"hash":19140,"name":"tformcontacts.acut.caption","sourcebytes":[67,117,116],"value":"Cut"},
    2020{"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"}
    2422]}
  • trunk/Forms/FormExport.lfm

    r162 r167  
    11object FormExport: TFormExport
    2   Left = 566
     2  Left = 859
    33  Height = 679
    4   Top = 461
     4  Top = 380
    55  Width = 842
    66  Caption = 'Export'
     
    9494    object ListView1: TListView
    9595      Left = 19
    96       Height = 433
    97       Top = 149
     96      Height = 409
     97      Top = 173
    9898      Width = 775
    9999      Anchors = [akTop, akLeft, akRight, akBottom]
     
    103103      ViewStyle = vsReport
    104104    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
    105114  end
    106115  object SaveDialog1: TSaveDialog
    107     Title = 'Uložit soubor jako'
    108116    Left = 350
    109117    Top = 163
    110118  end
     119  object TimerRedraw: TTimer
     120    Interval = 200
     121    OnTimer = TimerRedrawTimer
     122    Left = 205
     123    Top = 277
     124  end
    111125end
  • trunk/Forms/FormExport.lrj

    r162 r167  
    66{"hash":50353482,"name":"tformexport.label2.caption","sourcebytes":[79,117,116,112,117,116,32,102,105,108,101,58],"value":"Output file:"},
    77{"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"}
    99]}
  • trunk/Forms/FormExport.pas

    r162 r167  
    55uses
    66  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls,
    7   Table, LazFileUtils, FormEx;
     7  ExtCtrls, Table, LazFileUtils, FormEx;
    88
    99type
     
    1515    ButtonCancel: TButton;
    1616    ButtonExport: TButton;
     17    CheckBoxHumanReadableHeader: TCheckBox;
    1718    ComboBoxOutputFormat: TComboBox;
    1819    EditOutputFile: TEdit;
     
    2223    SaveDialog1: TSaveDialog;
    2324    ScrollBox1: TScrollBox;
     25    TimerRedraw: TTimer;
    2426    procedure ButtonBrowseClick(Sender: TObject);
    2527    procedure ButtonExportClick(Sender: TObject);
     28    procedure CheckBoxHumanReadableHeaderChange(Sender: TObject);
    2629    procedure ComboBoxOutputFormatChange(Sender: TObject);
    2730    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     
    2932    procedure FormDestroy(Sender: TObject);
    3033    procedure FormShow(Sender: TObject);
     34    procedure TimerRedrawTimer(Sender: TObject);
    3135  private
    3236    Table: TTable;
     37    RedrawPending: Boolean;
    3338    procedure PrepareTable;
    3439    procedure UpdateFileNameExt;
     
    4348
    4449uses
    45   Core, Common, RegistryEx, VCardFile;
     50  Core, Common, RegistryEx, VCardFile, VCard;
    4651
    4752{ TFormExport }
     
    5863  TableFormat := TTableFormat(ComboBoxOutputFormat.Items.Objects[ComboBoxOutputFormat.ItemIndex]);
    5964  SaveStringToFile(Table.GetOutput(TableFormat), EditOutputFile.Text);
     65end;
     66
     67procedure TFormExport.CheckBoxHumanReadableHeaderChange(Sender: TObject);
     68begin
     69  RedrawPending := True;
    6070end;
    6171
     
    102112procedure TFormExport.FormShow(Sender: TObject);
    103113begin
    104   PrepareTable;
    105   Table.GetOutputListView(ListView1);
     114  RedrawPending := True;
     115end;
     116
     117procedure TFormExport.TimerRedrawTimer(Sender: TObject);
     118begin
     119  if RedrawPending then begin
     120    PrepareTable;
     121    Table.GetOutputListView(ListView1);
     122    RedrawPending := False;
     123  end;
    106124end;
    107125
     
    113131  Values: TStringList;
    114132  Index: Integer;
    115 begin
     133  Fields: TContactFields;
     134  Field: TContactField;
     135  Columns: TStringList;
     136begin
     137  Fields := TContact.GetFields;
     138  Table.Clear;
     139
    116140  Values := TStringList.Create;
     141  Columns := TStringList.Create;
    117142  try
    118143    with TVCardFile(Core.Core.DataFile), VCard do begin
     
    123148        for J := 0 to Contacts[I].Properties.Count - 1 do
    124149        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;
    127161      end;
    128162
    129163      for I := 0 to Contacts.Count - 1 do begin
    130164        Values.Clear;
    131         for J := 0 to Table.Columns.Count - 1 do
     165        for J := 0 to Columns.Count - 1 do
    132166          Values.Add('');
    133167        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);
    135169          if Index <> -1 then
    136170            Values[Index] := Contacts[I].Properties[J].Value;
     
    144178  finally
    145179    Values.Free;
     180    Columns.Free;
    146181  end;
    147182end;
     
    163198  try
    164199    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);
    167203    ComboBoxOutputFormat.ItemIndex := ComboBoxOutputFormat.Items.IndexOfObject(TObject(TableFormat));
    168204  finally
     
    176212  try
    177213    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);
    180217  finally
    181218    Free;
  • trunk/Forms/FormMain.lfm

    r165 r167  
    11object FormMain: TFormMain
    2   Left = 510
    3   Height = 822
    4   Top = 272
    5   Width = 1254
     2  Left = 534
     3  Height = 993
     4  Top = 223
     5  Width = 1491
    66  AllowDropFiles = True
    77  Caption = 'vCard Studio'
    8   ClientHeight = 792
    9   ClientWidth = 1254
     8  ClientHeight = 959
     9  ClientWidth = 1491
    1010  DesignTimePPI = 144
    1111  Menu = MainMenu1
     
    1919  OnShow = FormShow
    2020  LCLVersion = '2.2.6.0'
    21   WindowState = wsMaximized
    2221  object CoolBar1: TCoolBar
    2322    Left = 0
    2423    Height = 43
    2524    Top = 0
    26     Width = 1254
     25    Width = 1491
    2726    AutoSize = True
    2827    Bands = <   
     
    149148        Caption = '-'
    150149      end
     150      object MenuItem12: TMenuItem
     151        Action = Core.AFileCompare
     152      end
     153      object Separator1: TMenuItem
     154        Caption = '-'
     155      end
    151156      object MenuItem3: TMenuItem
    152157        Action = Core.AFileCombine
     
    155160        Action = Core.AFileSplit
    156161      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
    159167      end
    160168      object MenuItem15: TMenuItem
  • trunk/Forms/FormMain.pas

    r165 r167  
    2121    MenuItem14: TMenuItem;
    2222    MenuItem15: TMenuItem;
     23    MenuItem16: TMenuItem;
    2324    MenuItemColumns: TMenuItem;
    2425    MenuItem3: TMenuItem;
     
    4647    MenuItemFile: TMenuItem;
    4748    PopupMenuOpenRecent: TPopupMenu;
     49    Separator1: TMenuItem;
     50    Separator2: TMenuItem;
    4851    ToolBarOther: TToolBar;
    4952    ToolBarFile: TToolBar;
  • trunk/Forms/FormProperties.lfm

    r162 r167  
    11object FormProperties: TFormProperties
    2   Left = 400
     2  Left = 675
    33  Height = 908
    4   Top = 212
     4  Top = 266
    55  Width = 1210
    66  Caption = 'Contacts'
     
    192192  end
    193193  object SaveDialog1: TSaveDialog
    194     Title = 'Uložit soubor jako'
    195194    Left = 760
    196195    Top = 448
    197196  end
    198197  object OpenDialog1: TOpenDialog
    199     Title = 'Otevřít existující soubor'
    200198    Left = 760
    201199    Top = 520
  • trunk/Forms/FormProperties.lrj

    r162 r167  
    1010{"hash":4863557,"name":"tformproperties.aclone.caption","sourcebytes":[67,108,111,110,101],"value":"Clone"},
    1111{"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..."}
    1513]}
  • trunk/Languages/vCardStudio.cs.po

    r164 r167  
    191191msgstr "Exportovat..."
    192192
     193#: tcore.afileimport.caption
     194msgid "Import..."
     195msgstr "Importovat..."
     196
    193197#: tcore.afilenew.caption
    194198msgid "New"
     
    944948msgstr "Pracovní telefon"
    945949
    946 #: tformcontacts.opendialog1.title
    947 msgctxt "tformcontacts.opendialog1.title"
    948 msgid "Otevřít existující soubor"
    949 msgstr ""
    950 
    951 #: tformcontacts.savedialog1.title
    952 msgctxt "tformcontacts.savedialog1.title"
    953 msgid "Uložit soubor jako"
    954 msgstr ""
    955 
    956950#: tformerror.caption
    957951msgid "Load errors"
     
    971965msgctxt "tformexport.buttonexport.caption"
    972966msgid "Export"
    973 msgstr "Export"
     967msgstr "Exportovat"
    974968
    975969#: tformexport.caption
     
    978972msgstr "Export"
    979973
     974#: tformexport.checkboxhumanreadableheader.caption
     975msgctxt "tformexport.checkboxhumanreadableheader.caption"
     976msgid "Human readable header"
     977msgstr ""
     978
    980979#: tformexport.label1.caption
    981980msgid "Output format:"
     
    985984msgid "Output file:"
    986985msgstr "Výstupní soubor:"
    987 
    988 #: tformexport.savedialog1.title
    989 msgctxt "tformexport.savedialog1.title"
    990 msgid "Uložit soubor jako"
    991 msgstr ""
    992986
    993987#: tformfind.buttonfind.caption
     
    10841078msgstr "URL:"
    10851079
     1080#: tformimport.buttonbrowse.caption
     1081msgctxt "tformimport.buttonbrowse.caption"
     1082msgid "Browse"
     1083msgstr "Procházet"
     1084
     1085#: tformimport.buttoncancel.caption
     1086msgctxt "tformimport.buttoncancel.caption"
     1087msgid "Cancel"
     1088msgstr "Zrušit"
     1089
     1090#: tformimport.buttonimport.caption
     1091msgctxt "tformimport.buttonimport.caption"
     1092msgid "Import"
     1093msgstr "Importovat"
     1094
     1095#: tformimport.caption
     1096msgctxt "tformimport.caption"
     1097msgid "Import"
     1098msgstr "Import"
     1099
     1100#: tformimport.checkboxhumanreadableheader.caption
     1101msgctxt "tformimport.checkboxhumanreadableheader.caption"
     1102msgid "Human readable header"
     1103msgstr ""
     1104
     1105#: tformimport.label1.caption
     1106msgid "Input format:"
     1107msgstr "Vstupní formát:"
     1108
     1109#: tformimport.label2.caption
     1110msgid "Input file:"
     1111msgstr "Vstupní soubor:"
     1112
    10861113#: tformmain.caption
    10871114msgid "vCard Studio"
     
    12451272msgstr "Hodnoty"
    12461273
    1247 #: tformproperties.opendialog1.title
    1248 msgctxt "tformproperties.opendialog1.title"
    1249 msgid "Otevřít existující soubor"
    1250 msgstr ""
    1251 
    1252 #: tformproperties.savedialog1.title
    1253 msgctxt "tformproperties.savedialog1.title"
    1254 msgid "Uložit soubor jako"
    1255 msgstr ""
    1256 
    12571274#: tformproperty.buttoncancel.caption
    12581275msgctxt "tformproperty.buttoncancel.caption"
  • trunk/Languages/vCardStudio.pot

    r164 r167  
    181181msgstr ""
    182182
     183#: tcore.afileimport.caption
     184msgid "Import..."
     185msgstr ""
     186
    183187#: tcore.afilenew.caption
    184188msgid "New"
     
    934938msgstr ""
    935939
    936 #: tformcontacts.opendialog1.title
    937 msgctxt "tformcontacts.opendialog1.title"
    938 msgid "Otevřít existující soubor"
    939 msgstr ""
    940 
    941 #: tformcontacts.savedialog1.title
    942 msgctxt "tformcontacts.savedialog1.title"
    943 msgid "Uložit soubor jako"
    944 msgstr ""
    945 
    946940#: tformerror.caption
    947941msgid "Load errors"
     
    968962msgstr ""
    969963
     964#: tformexport.checkboxhumanreadableheader.caption
     965msgctxt "tformexport.checkboxhumanreadableheader.caption"
     966msgid "Human readable header"
     967msgstr ""
     968
    970969#: tformexport.label1.caption
    971970msgid "Output format:"
     
    974973#: tformexport.label2.caption
    975974msgid "Output file:"
    976 msgstr ""
    977 
    978 #: tformexport.savedialog1.title
    979 msgctxt "tformexport.savedialog1.title"
    980 msgid "Uložit soubor jako"
    981975msgstr ""
    982976
     
    10741068msgstr ""
    10751069
     1070#: tformimport.buttonbrowse.caption
     1071msgctxt "tformimport.buttonbrowse.caption"
     1072msgid "Browse"
     1073msgstr ""
     1074
     1075#: tformimport.buttoncancel.caption
     1076msgctxt "tformimport.buttoncancel.caption"
     1077msgid "Cancel"
     1078msgstr ""
     1079
     1080#: tformimport.buttonimport.caption
     1081msgctxt "tformimport.buttonimport.caption"
     1082msgid "Import"
     1083msgstr ""
     1084
     1085#: tformimport.caption
     1086msgctxt "tformimport.caption"
     1087msgid "Import"
     1088msgstr ""
     1089
     1090#: tformimport.checkboxhumanreadableheader.caption
     1091msgctxt "tformimport.checkboxhumanreadableheader.caption"
     1092msgid "Human readable header"
     1093msgstr ""
     1094
     1095#: tformimport.label1.caption
     1096msgid "Input format:"
     1097msgstr ""
     1098
     1099#: tformimport.label2.caption
     1100msgid "Input file:"
     1101msgstr ""
     1102
    10761103#: tformmain.caption
    10771104msgid "vCard Studio"
     
    12351262msgstr ""
    12361263
    1237 #: tformproperties.opendialog1.title
    1238 msgctxt "tformproperties.opendialog1.title"
    1239 msgid "Otevřít existující soubor"
    1240 msgstr ""
    1241 
    1242 #: tformproperties.savedialog1.title
    1243 msgctxt "tformproperties.savedialog1.title"
    1244 msgid "Uložit soubor jako"
    1245 msgstr ""
    1246 
    12471264#: tformproperty.buttoncancel.caption
    12481265msgctxt "tformproperty.buttoncancel.caption"
  • trunk/Languages/vCardStudio.sv.po

    r164 r167  
    192192msgstr ""
    193193
     194#: tcore.afileimport.caption
     195msgid "Import..."
     196msgstr ""
     197
    194198#: tcore.afilenew.caption
    195199msgid "New"
     
    950954msgid "Work phone"
    951955msgstr "Jobb telefon"
    952 
    953 #: tformcontacts.opendialog1.title
    954 msgctxt "tformcontacts.opendialog1.title"
    955 msgid "Otevřít existující soubor"
    956 msgstr ""
    957 
    958 #: tformcontacts.savedialog1.title
    959 msgctxt "tformcontacts.savedialog1.title"
    960 msgid "Uložit soubor jako"
    961 msgstr ""
    962956
    963957#: tformerror.caption
     
    986980msgstr ""
    987981
     982#: tformexport.checkboxhumanreadableheader.caption
     983msgctxt "tformexport.checkboxhumanreadableheader.caption"
     984msgid "Human readable header"
     985msgstr ""
     986
    988987#: tformexport.label1.caption
    989988msgid "Output format:"
     
    992991#: tformexport.label2.caption
    993992msgid "Output file:"
    994 msgstr ""
    995 
    996 #: tformexport.savedialog1.title
    997 msgctxt "tformexport.savedialog1.title"
    998 msgid "Uložit soubor jako"
    999993msgstr ""
    1000994
     
    10921086msgstr ""
    10931087
     1088#: tformimport.buttonbrowse.caption
     1089msgctxt "tformimport.buttonbrowse.caption"
     1090msgid "Browse"
     1091msgstr ""
     1092
     1093#: tformimport.buttoncancel.caption
     1094#, fuzzy
     1095msgctxt "tformimport.buttoncancel.caption"
     1096msgid "Cancel"
     1097msgstr "Avbryt"
     1098
     1099#: tformimport.buttonimport.caption
     1100msgctxt "tformimport.buttonimport.caption"
     1101msgid "Import"
     1102msgstr ""
     1103
     1104#: tformimport.caption
     1105msgctxt "tformimport.caption"
     1106msgid "Import"
     1107msgstr ""
     1108
     1109#: tformimport.checkboxhumanreadableheader.caption
     1110msgctxt "tformimport.checkboxhumanreadableheader.caption"
     1111msgid "Human readable header"
     1112msgstr ""
     1113
     1114#: tformimport.label1.caption
     1115msgid "Input format:"
     1116msgstr ""
     1117
     1118#: tformimport.label2.caption
     1119msgid "Input file:"
     1120msgstr ""
     1121
    10941122#: tformmain.caption
    10951123msgid "vCard Studio"
     
    12551283msgstr ""
    12561284
    1257 #: tformproperties.opendialog1.title
    1258 msgctxt "tformproperties.opendialog1.title"
    1259 msgid "Otevřít existující soubor"
    1260 msgstr ""
    1261 
    1262 #: tformproperties.savedialog1.title
    1263 msgctxt "tformproperties.savedialog1.title"
    1264 msgid "Uložit soubor jako"
    1265 msgstr ""
    1266 
    12671285#: tformproperty.buttoncancel.caption
    12681286msgctxt "tformproperty.buttoncancel.caption"
  • trunk/Packages/Common/Table.pas

    r158 r167  
    3939    procedure GetOutputListView(ListView: TListView);
    4040    function GetOutput(OutputFormat: TTableFormat): string;
     41    procedure SetInputTabs(Text: string);
     42    procedure SetInputPlain(Text: string);
     43    procedure SetInputCsv(Text: string);
     44    procedure SetInputXml(Text: string);
     45    procedure SetInputHtml(Text: string);
     46    procedure SetInputMediaWiki(Text: string);
     47    procedure SetInput(OutputFormat: TTableFormat; Text: string);
    4148    constructor Create;
    4249    destructor Destroy; override;
     
    5562  Common;
    5663
     64resourcestring
     65  SUnsupportedFormat = 'Unsupported format';
     66
    5767{ TTable }
    5868
     
    7484procedure TTable.Clear;
    7585begin
     86  Columns.Clear;
    7687  Rows.Clear;
    7788end;
     
    138149begin
    139150  Result := '<?xml version="1.0" encoding="UTF-8"?>' + LineEnding +
    140     '<vcard>' + LineEnding +
     151    '<table>' + LineEnding +
    141152    '  <title>' + Title + '</title>' + LineEnding +
    142     '  <contacts>' + LineEnding;
     153    '  <rows>' + LineEnding;
    143154  for I := 0 to Rows.Count - 1 do begin
    144     Result := Result + '    <contact>' + LineEnding;
     155    Result := Result + '    <row>' + LineEnding;
    145156    for J := 0 to Rows[I].Cells.Count - 1 do
    146157      if Rows[I].Cells[J] <> '' then
    147         Result := Result + '      <property name="' + Columns[J] + '">' + ReplaceXmlEntities(Rows[I].Cells[J]) + '</property>' + LineEnding;
    148     Result := Result + '    </contact>' + LineEnding;
    149   end;
    150   Result := Result + '  </contacts>' + LineEnding +
    151     '</vcard>';
     158        Result := Result + '      <cell name="' + Columns[J] + '">' + ReplaceXmlEntities(Rows[I].Cells[J]) + '</cell>' + LineEnding;
     159    Result := Result + '    </row>' + LineEnding;
     160  end;
     161  Result := Result + '  </rows>' + LineEnding +
     162    '</table>';
    152163end;
    153164
     
    255266    tfMediaWiki: Result := GetOutputMediaWiki;
    256267    tfXml: Result := GetOutputXml;
    257     else Result := '';
     268    else raise Exception.Create(SUnsupportedFormat);
     269  end;
     270end;
     271
     272procedure TTable.SetInputTabs(Text: string);
     273begin
     274
     275end;
     276
     277procedure TTable.SetInputPlain(Text: string);
     278begin
     279
     280end;
     281
     282procedure TTable.SetInputCsv(Text: string);
     283begin
     284
     285end;
     286
     287procedure TTable.SetInputXml(Text: string);
     288begin
     289
     290end;
     291
     292procedure TTable.SetInputHtml(Text: string);
     293begin
     294
     295end;
     296
     297procedure TTable.SetInputMediaWiki(Text: string);
     298begin
     299
     300end;
     301
     302procedure TTable.SetInput(OutputFormat: TTableFormat; Text: string);
     303begin
     304  case OutputFormat of
     305    tfExcel: SetInputTabs(Text);
     306    tfPlain: SetInputPlain(Text);
     307    tfCsv: SetInputCsv(Text);
     308    tfHtml: SetInputHtml(Text);
     309    tfMediaWiki: SetInputMediaWiki(Text);
     310    tfXml: SetInputXml(Text);
     311    else raise Exception.Create(SUnsupportedFormat);
    258312  end;
    259313end;
  • trunk/vCardStudio.lpi

    r162 r167  
    123123      </Item7>
    124124    </RequiredPackages>
    125     <Units Count="25">
     125    <Units Count="26">
    126126      <Unit0>
    127127        <Filename Value="vCardStudio.lpr"/>
     
    281281        <ResourceBaseClass Value="Form"/>
    282282      </Unit24>
     283      <Unit25>
     284        <Filename Value="Forms\FormImport.pas"/>
     285        <IsPartOfProject Value="True"/>
     286        <ComponentName Value="FormImport"/>
     287        <HasResources Value="True"/>
     288        <ResourceBaseClass Value="Form"/>
     289      </Unit25>
    283290    </Units>
    284291  </ProjectOptions>
  • trunk/vCardStudio.lpr

    r158 r167  
    77  Interfaces, // this includes the LCL widgetset
    88  Forms, FormMain, Core, Diff, SysUtils, FormCompareSideBySide, TestCases,
    9   VCardFile, FormColumns, FormCompare, FormNormalize, FormExport;
     9  VCardFile, FormColumns, FormCompare, FormNormalize, FormExport, FormImport;
    1010
    1111{$R *.res}
Note: See TracChangeset for help on using the changeset viewer.