Changeset 72


Ignore:
Timestamp:
Dec 13, 2021, 8:47:20 PM (2 years ago)
Author:
chronos
Message:
  • Fixed: Properties with just BASE64 instead of ENCODING=BASE64 was not decoded using Base64 and so contact photos were not loaded correctly.
  • Added: Allow to save from file and load to file contact property values in All fields tab.
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormContacts.lfm

    r61 r72  
    1414  object ListView1: TListView
    1515    Left = 0
    16     Height = 810
     16    Height = 801
    1717    Top = 0
    1818    Width = 1210
     
    6666    Left = 0
    6767    Height = 39
    68     Top = 842
     68    Top = 833
    6969    Width = 1210
    7070    Align = alBottom
     
    114114    Left = 0
    115115    Height = 32
    116     Top = 810
     116    Top = 801
    117117    Width = 1210
    118118    OnChange = ListViewFilter1Change
     
    121121  object StatusBar1: TStatusBar
    122122    Left = 0
    123     Height = 27
    124     Top = 881
     123    Height = 36
     124    Top = 872
    125125    Width = 1210
    126126    Panels = <   
  • trunk/Forms/UFormContacts.pas

    r63 r72  
    473473begin
    474474  if FUpdateCount = 0 then DoUpdateInterface;
    475   ALoadFromFile.Enabled := Assigned(ListView1.Selected);
    476   ASaveToFile.Enabled := Assigned(ListView1.Selected);
    477   AModify.Enabled := Assigned(ListView1.Selected);
    478   AClone.Enabled := Assigned(ListView1.Selected);
    479   ARemove.Enabled := Assigned(ListView1.Selected);
     475  AAdd.Enabled := Assigned(Contacts);
     476  AModify.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected);
     477  AClone.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected);
     478  ARemove.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected);
    480479  ASelectAll.Enabled := ListView1.Items.Count > 0;
     480  ALoadFromFile.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected);
     481  ASaveToFile.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected);
    481482end;
    482483
  • trunk/Forms/UFormProperties.lfm

    r62 r72  
    7474      Action = AClone
    7575    end
     76    object ToolButton5: TToolButton
     77      Left = 141
     78      Height = 33
     79      Top = 2
     80      Style = tbsSeparator
     81    end
     82    object ToolButton6: TToolButton
     83      Left = 149
     84      Top = 2
     85      Action = ALoadValueFromFile
     86    end
     87    object ToolButton7: TToolButton
     88      Left = 184
     89      Top = 2
     90      Action = ASaveValueToFile
     91    end
    7692  end
    7793  object ListViewFilter1: TListViewFilter
     
    112128    object MenuItem4: TMenuItem
    113129      Action = ASelectAll
     130    end
     131    object MenuItem6: TMenuItem
     132      Caption = '-'
     133    end
     134    object MenuItem7: TMenuItem
     135      Action = ALoadValueFromFile
     136    end
     137    object MenuItem8: TMenuItem
     138      Action = ASaveValueToFile
    114139    end
    115140  end
     
    146171      OnExecute = ACloneExecute
    147172    end
     173    object ASaveValueToFile: TAction
     174      Caption = 'Save value to file...'
     175      ImageIndex = 7
     176      OnExecute = ASaveValueToFileExecute
     177    end
     178    object ALoadValueFromFile: TAction
     179      Caption = 'Load value from file...'
     180      ImageIndex = 5
     181      OnExecute = ALoadValueFromFileExecute
     182    end
    148183  end
    149184  object ListViewSort1: TListViewSort
     
    157192    Top = 428
    158193  end
     194  object SaveDialog1: TSaveDialog
     195    Left = 760
     196    Top = 448
     197  end
     198  object OpenDialog1: TOpenDialog
     199    Left = 760
     200    Top = 520
     201  end
    159202end
  • trunk/Forms/UFormProperties.lrj

    r62 r72  
    88{"hash":93079237,"name":"tformproperties.aremove.caption","sourcebytes":[82,101,109,111,118,101],"value":"Remove"},
    99{"hash":195296268,"name":"tformproperties.aselectall.caption","sourcebytes":[83,101,108,101,99,116,32,97,108,108],"value":"Select all"},
    10 {"hash":4863557,"name":"tformproperties.aclone.caption","sourcebytes":[67,108,111,110,101],"value":"Clone"}
     10{"hash":4863557,"name":"tformproperties.aclone.caption","sourcebytes":[67,108,111,110,101],"value":"Clone"},
     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..."}
    1113]}
  • trunk/Forms/UFormProperties.pas

    r54 r72  
    1616    AAdd: TAction;
    1717    AClone: TAction;
     18    ASaveValueToFile: TAction;
     19    ALoadValueFromFile: TAction;
    1820    ASelectAll: TAction;
    1921    ARemove: TAction;
     
    2830    MenuItem4: TMenuItem;
    2931    MenuItem5: TMenuItem;
     32    MenuItem6: TMenuItem;
     33    MenuItem7: TMenuItem;
     34    MenuItem8: TMenuItem;
     35    OpenDialog1: TOpenDialog;
    3036    PopupMenuField: TPopupMenu;
     37    SaveDialog1: TSaveDialog;
    3138    StatusBar1: TStatusBar;
    3239    ToolBar1: TToolBar;
     
    3542    ToolButton3: TToolButton;
    3643    ToolButton4: TToolButton;
     44    ToolButton5: TToolButton;
     45    ToolButton6: TToolButton;
     46    ToolButton7: TToolButton;
    3747    procedure AAddExecute(Sender: TObject);
    3848    procedure ACloneExecute(Sender: TObject);
     49    procedure ALoadValueFromFileExecute(Sender: TObject);
    3950    procedure AModifyExecute(Sender: TObject);
    4051    procedure ARemoveExecute(Sender: TObject);
     52    procedure ASaveValueToFileExecute(Sender: TObject);
    4153    procedure ASelectAllExecute(Sender: TObject);
    4254    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     
    7082
    7183uses
    72   UFormProperty, UCore;
     84  UFormProperty, UCore, UCommon;
    7385
    7486resourcestring
     
    7890  SFiltered = 'Filtered';
    7991  SSelected = 'Selected';
     92  SAllFiles = 'All files';
     93  STextFiles = 'Text files';
     94  SValue = 'Value';
     95
     96const
     97  TextFileExt = '.txt';
    8098
    8199{ TFormProperties }
     
    247265end;
    248266
     267procedure TFormProperties.ALoadValueFromFileExecute(Sender: TObject);
     268begin
     269  if Assigned(ListView1.Selected) then begin
     270    OpenDialog1.Filter := STextFiles + '|*' + TextFileExt + '|' + SAllFiles + '|*.*';
     271    OpenDialog1.DefaultExt := TextFileExt;
     272    OpenDialog1.InitialDir := ExtractFileDir(Core.LastPropertyValueFileName);
     273    OpenDialog1.FileName := ExtractFileName(Core.LastPropertyValueFileName);
     274    if OpenDialog1.Execute then begin
     275      TContactProperty(ListView1.Selected.Data).Value := LoadFileToStr(OpenDialog1.FileName);
     276      Core.LastPropertyValueFileName := OpenDialog1.FileName;
     277      ReloadList;
     278    end;
     279  end;
     280end;
     281
    249282procedure TFormProperties.AModifyExecute(Sender: TObject);
    250283var
     
    289322end;
    290323
     324procedure TFormProperties.ASaveValueToFileExecute(Sender: TObject);
     325begin
     326  if Assigned(ListView1.Selected) then begin
     327    SaveDialog1.Filter := STextFiles + '|*' + TextFileExt + '|' + SAllFiles + '|*.*';
     328    SaveDialog1.DefaultExt := TextFileExt;
     329    SaveDialog1.InitialDir := ExtractFileDir(Core.LastPropertyValueFileName);
     330    SaveDialog1.FileName := SValue + TextFileExt;
     331    if SaveDialog1.Execute then begin
     332      SaveStringToFile(TContactProperty(ListView1.Selected.Data).Value, SaveDialog1.FileName);
     333      Core.LastPropertyValueFileName := SaveDialog1.FileName;
     334    end;
     335  end;
     336end;
     337
    291338procedure TFormProperties.ASelectAllExecute(Sender: TObject);
    292339begin
     
    324371  AAdd.Enabled := Assigned(Properties);
    325372  AModify.Enabled := Assigned(Properties) and Assigned(ListView1.Selected);
     373  AClone.Enabled := Assigned(Properties) and Assigned(ListView1.Selected);;
    326374  ARemove.Enabled := Assigned(Properties) and Assigned(ListView1.Selected);
     375  ALoadValueFromFile.Enabled := Assigned(Properties) and Assigned(ListView1.Selected);
     376  ASaveValueToFile.Enabled := Assigned(Properties) and Assigned(ListView1.Selected);
     377  ASelectAll.Enabled := ListView1.Items.Count > 0;
    327378
    328379  Text := '';
  • trunk/Languages/vCardStudio.cs.po

    r71 r72  
    629629msgstr "Klonovat"
    630630
     631#: tformproperties.aloadvaluefromfile.caption
     632msgid "Load value from file..."
     633msgstr "Načíst hodnotu ze souboru..."
     634
    631635#: tformproperties.amodify.caption
    632636msgctxt "tformproperties.amodify.caption"
     
    639643msgstr "Odstranit"
    640644
     645#: tformproperties.asavevaluetofile.caption
     646msgid "Save value to file..."
     647msgstr "Uložit hodnotu do souboru..."
     648
    641649#: tformproperties.aselectall.caption
    642650msgctxt "tformproperties.aselectall.caption"
     
    11101118
    11111119#: udatafile.sallfiles
     1120msgctxt "udatafile.sallfiles"
    11121121msgid "All files"
    11131122msgstr "Všechny soubory"
     
    11491158msgstr "Upraveno"
    11501159
     1160#: uformproperties.sallfiles
     1161msgctxt "uformproperties.sallfiles"
     1162msgid "All files"
     1163msgstr "Všechny soubory"
     1164
    11511165#: uformproperties.sfiltered
    11521166msgctxt "uformproperties.sfiltered"
     
    11671181msgstr "Vybraných"
    11681182
     1183#: uformproperties.stextfiles
     1184msgid "Text files"
     1185msgstr "Textové soubory"
     1186
    11691187#: uformproperties.stotal
    11701188msgctxt "uformproperties.stotal"
     
    11721190msgstr "Celkem"
    11731191
     1192#: uformproperties.svalue
     1193msgid "Value"
     1194msgstr "Hodnota"
     1195
    11741196#: uquotedprintable.slinelengtherr
    11751197msgid "Invalid line length for encoded text"
    11761198msgstr "Neplatná délka řádky kódovaného textu"
     1199
  • trunk/Languages/vCardStudio.po

    r71 r72  
    617617msgstr ""
    618618
     619#: tformproperties.aloadvaluefromfile.caption
     620msgid "Load value from file..."
     621msgstr ""
     622
    619623#: tformproperties.amodify.caption
    620624msgctxt "tformproperties.amodify.caption"
     
    627631msgstr ""
    628632
     633#: tformproperties.asavevaluetofile.caption
     634msgid "Save value to file..."
     635msgstr ""
     636
    629637#: tformproperties.aselectall.caption
    630638msgctxt "tformproperties.aselectall.caption"
     
    10981106
    10991107#: udatafile.sallfiles
     1108msgctxt "udatafile.sallfiles"
    11001109msgid "All files"
    11011110msgstr ""
     
    11371146msgstr ""
    11381147
     1148#: uformproperties.sallfiles
     1149msgctxt "uformproperties.sallfiles"
     1150msgid "All files"
     1151msgstr ""
     1152
    11391153#: uformproperties.sfiltered
    11401154msgctxt "uformproperties.sfiltered"
     
    11551169msgstr ""
    11561170
     1171#: uformproperties.stextfiles
     1172msgid "Text files"
     1173msgstr ""
     1174
    11571175#: uformproperties.stotal
    11581176msgctxt "uformproperties.stotal"
     
    11601178msgstr ""
    11611179
     1180#: uformproperties.svalue
     1181msgid "Value"
     1182msgstr ""
     1183
    11621184#: uquotedprintable.slinelengtherr
    11631185msgid "Invalid line length for encoded text"
  • trunk/UContact.pas

    r71 r72  
    481481  I: Integer;
    482482begin
    483   if Attributes.IndexOf('BASE64') <> -1 then
    484     Encoding := 'BASE64'
    485   else
     483  if Attributes.IndexOf('BASE64') <> -1 then begin
     484    Encoding := 'BASE64';
     485    Value := GetDecodedValue;
     486  end else
    486487  if Attributes.IndexOfName('ENCODING') <> -1 then begin
    487488    Encoding := Attributes.Values['ENCODING'];
  • trunk/UCore.pas

    r69 r72  
    8888    LastContactTabIndex: Integer;
    8989    LastContactFileName: string;
     90    LastPropertyValueFileName: string;
    9091    GenerateCount: Integer;
    9192    ToolbarVisible: Boolean;
     
    485486    LastContactFileName := ReadStringWithDefault('LastContactFileName', '');
    486487    LastSplitDir := ReadStringWithDefault('LastSplitDir', '');
     488    LastPropertyValueFileName := ReadStringWithDefault('LastPropertyValueFileName', '');
    487489    GenerateCount := ReadIntegerWithDefault('GenerateCount', 1);
    488490  finally
     
    510512    WriteString('LastContactFileName', LastContactFileName);
    511513    WriteString('LastSplitDir', LastSplitDir);
     514    WriteString('LastPropertyValueFileName', LastPropertyValueFileName);
    512515    WriteInteger('GenerateCount', GenerateCount);
    513516  finally
Note: See TracChangeset for help on using the changeset viewer.