Changeset 63


Ignore:
Timestamp:
Dec 9, 2021, 11:17:22 PM (2 years ago)
Author:
chronos
Message:
  • Fixed: Open directory with saved split contact files in default file manager under Linux.
  • Fixed: Don't use forbidden characters in saved contact file name.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormContacts.pas

    r61 r63  
    414414    end;
    415415    SaveDialog1.InitialDir := ExtractFileDir(Core.LastContactFileName);
    416     SaveDialog1.FileName := TContact(ListView1.Selected.Data).Fields[cfFullName] +
     416    SaveDialog1.FileName := TContact(ListView1.Selected.Data).FullNameToFileName +
    417417      VCardFileExt;
    418418    if SaveDialog1.Execute then begin
  • trunk/UContact.pas

    r61 r63  
    110110    Properties: TContactProperties;
    111111    Parent: TContactsFile;
     112    function FullNameToFileName: string;
    112113    function GetProperty(Field: TContactField): TContactProperty; overload;
    113114    function GetProperty(FieldIndex: TContactFieldIndex): TContactProperty; overload;
     
    728729end;
    729730
     731function TContact.FullNameToFileName: string;
     732var
     733  I: Integer;
     734begin
     735  Result := Fields[cfFullName];
     736  for I := 1 to Length(Result) do begin
     737    if Result[I] in [':', '/', '\', '.', '"', '*', '|', '?', '<', '>'] then
     738      Result[I] := '_';
     739  end;
     740end;
     741
    730742function TContact.GetProperty(Field: TContactField): TContactProperty;
    731743var
  • trunk/UCore.lfm

    r62 r63  
    506506    AppName = 'vCard Studio'
    507507    Description = 'vCard files management tool'
    508     ReleaseDate = 44524
     508    ReleaseDate = 44539
    509509    RegistryKey = '\Software\Chronosoft\vCard Studio'
    510510    RegistryRoot = rrKeyCurrentUser
  • trunk/UCore.pas

    r62 r63  
    198198      if Items[I].Fields[cfFullName] <> '' then begin
    199199        FileName := SelectDirectoryDialog1.FileName + DirectorySeparator +
    200           Items[I].Fields[cfFullName] + VCardFileExt;
     200          Items[I].FullNameToFileName + VCardFileExt;
    201201        Items[I].SaveToFile(FileName);
    202202        Inc(C);
     
    209209      {$IFDEF WINDOWS}
    210210      ExecuteProgram('explorer.exe', ['"' + SelectDirectoryDialog1.FileName + '"']);
     211      {$ENDIF}
     212      {$IFDEF LINUX}
     213      ExecuteProgram('/usr/bin/xdg-open', [SelectDirectoryDialog1.FileName]);
    211214      {$ENDIF}
    212215    end;
     
    525528  AFileSplit.Enabled := Assigned(DataFile);
    526529  AFileMerge.Enabled := Assigned(DataFile);
     530  AFindDuplicate.Enabled := Assigned(DataFile);
     531  AGenerate.Enabled := Assigned(DataFile);
    527532end;
    528533
Note: See TracChangeset for help on using the changeset viewer.