Changeset 153


Ignore:
Timestamp:
Jun 6, 2023, 9:46:08 PM (18 months ago)
Author:
chronos
Message:
  • Added: Accept dropped files onto the application form.
  • Fixed: Report error if compare tool was not found.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Core.pas

    r152 r153  
    8383    procedure FileModified(Sender: TObject);
    8484    function FindFirstNonOption: string;
    85     procedure UpdateFile;
    8685    procedure LoadConfig;
    8786    procedure SaveConfig;
     
    107106    DefaultInternationalCallPrefix: string;
    108107    CompareTool: string;
     108    procedure UpdateFile;
    109109    function GetProfileImage: TImage;
    110110    function GetTempDir: string;
     
    130130uses
    131131  FormMain, FormSettings, FormFindDuplicity, FormCompare, TestCase, FormNormalize,
    132   FormGenerate, FormError, FormFind, FormTest, FormSource, FormCompareSideBySide,
    133   TestCases;
     132  FormGenerate, FormError, FormFind, FormTest, FormSource, TestCases;
    134133
    135134resourcestring
  • trunk/Forms/FormCompare.pas

    r152 r153  
    4444uses
    4545  Core, FormCompareSideBySide, VCardProcessor;
     46
     47resourcestring
     48  SCompareToolNotFound = 'Compare tool ''%s'' not found. Select valid compare tool in the application settings.';
    4649
    4750{ TFormCompare }
     
    150153  SaveStringToFile(TextLeft, TempFileLeft);
    151154  SaveStringToFile(TextRight, TempFileRight);
    152   ExecuteProgram(Core.Core.CompareTool, [TempFileLeft, TempFileRight]);
     155  if FileExists(Core.Core.CompareTool) then
     156    ExecuteProgram(Core.Core.CompareTool, [TempFileLeft, TempFileRight])
     157    else ShowMessage(Format(SCompareToolNotFound, [Core.Core.CompareTool]));
    153158end;
    154159
    155160procedure TFormCompare.CompareExternal;
    156161begin
    157   CompareText(LeftVCard.VCard.AsString, RightVCard.Vcard.AsString,
     162  CompareText(LeftVCard.VCard.AsString, RightVCard.VCard.AsString,
    158163    ExtractFileName(LeftVCard.FileName), ExtractFileName(EditAnotherFile.Text));
    159164end;
  • trunk/Forms/FormMain.lfm

    r152 r153  
    44  Top = 401
    55  Width = 1178
     6  AllowDropFiles = True
    67  Caption = 'vCard Studio'
    78  ClientHeight = 762
     
    1314  OnCreate = FormCreate
    1415  OnDestroy = FormDestroy
     16  OnDropFiles = FormDropFiles
    1517  OnResize = FormResize
    1618  OnShow = FormShow
  • trunk/Forms/FormMain.pas

    r152 r153  
    5959    procedure FormCreate(Sender: TObject);
    6060    procedure FormDestroy(Sender: TObject);
     61    procedure FormDropFiles(Sender: TObject; const FileNames: array of string);
    6162    procedure FormResize(Sender: TObject);
    6263    procedure FormShow(Sender: TObject);
     
    8586resourcestring
    8687  SModified = 'Modified';
     88  SOnlyOneFileCanBeDropped = 'Only one file can be dropped at once.';
    8789
    8890{ TFormMain }
     
    111113begin
    112114  FreeAndNil(FormContacts);
     115end;
     116
     117procedure TFormMain.FormDropFiles(Sender: TObject;
     118  const FileNames: array of string);
     119begin
     120  if Length(FileNames) <> 1 then ShowMessage(SOnlyOneFileCanBeDropped)
     121    else begin
     122      Core.Core.FileOpen(FileNames[0]);
     123      Core.Core.UpdateFile;
     124    end;
    113125end;
    114126
  • trunk/Languages/vCardStudio.cs.po

    r152 r153  
    5757msgstr "Odstraněno %d duplikátů."
    5858
     59#: formcompare.scomparetoolnotfound
     60#, object-pascal-format
     61msgid "Compare tool '%s' not found. Select valid compare tool in the application settings."
     62msgstr "Nástroj porovnání '%s' nebyl nalezen. Vyberte platný nástroj porovnání v nastavení aplikace."
     63
    5964#: formcontact.scontact
    6065msgctxt "formcontact.scontact"
     
    117122msgstr "Upraveno"
    118123
     124#: formmain.sonlyonefilecanbedropped
     125msgid "Only one file can be dropped at once."
     126msgstr "Pouze jeden soubor může být položen najednou."
     127
    119128#: formproperties.sendupdatetoolow
    120129msgctxt "formproperties.sendupdatetoolow"
  • trunk/Languages/vCardStudio.pot

    r152 r153  
    4747msgstr ""
    4848
     49#: formcompare.scomparetoolnotfound
     50#, object-pascal-format
     51msgid "Compare tool '%s' not found. Select valid compare tool in the application settings."
     52msgstr ""
     53
    4954#: formcontact.scontact
    5055msgctxt "formcontact.scontact"
     
    107112msgstr ""
    108113
     114#: formmain.sonlyonefilecanbedropped
     115msgid "Only one file can be dropped at once."
     116msgstr ""
     117
    109118#: formproperties.sendupdatetoolow
    110119msgctxt "formproperties.sendupdatetoolow"
  • trunk/Languages/vCardStudio.sv.po

    r152 r153  
    5858msgstr ""
    5959
     60#: formcompare.scomparetoolnotfound
     61#, object-pascal-format
     62msgid "Compare tool '%s' not found. Select valid compare tool in the application settings."
     63msgstr ""
     64
    6065#: formcontact.scontact
    6166msgctxt "formcontact.scontact"
     
    118123msgstr "Redigerade"
    119124
     125#: formmain.sonlyonefilecanbedropped
     126msgid "Only one file can be dropped at once."
     127msgstr ""
     128
    120129#: formproperties.sendupdatetoolow
    121130msgctxt "formproperties.sendupdatetoolow"
Note: See TracChangeset for help on using the changeset viewer.