~chronoscz/vcard-studio/trunk

« back to all changes in this revision

Viewing changes to Core.pas

  • Committer: chronos
  • Date: 2023-06-06 15:05:18 UTC
  • Revision ID: svn-v4:b2f690cb-8b89-471c-b043-dbd4632e1e77:trunk:152
* Added: VCardProcessor class for processing contacts available from VCard package.
* Added: Normalize menu action for normalization of contact property values.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
  TCore = class(TDataModule)
16
16
    AAbout: TAction;
17
17
    AboutDialog1: TAboutDialog;
 
18
    ANormalize: TAction;
18
19
    ARemoveExactDuplicates: TAction;
19
20
    AFileCompare: TAction;
20
21
    AViewSource: TAction;
59
60
    procedure AFindExecute(Sender: TObject);
60
61
    procedure AGenerateExecute(Sender: TObject);
61
62
    procedure AHomePageExecute(Sender: TObject);
 
63
    procedure ANormalizeExecute(Sender: TObject);
62
64
    procedure ARemoveExactDuplicatesExecute(Sender: TObject);
63
65
    procedure ASettingsExecute(Sender: TObject);
64
66
    procedure ATestExecute(Sender: TObject);
101
103
    GenerateCount: Integer;
102
104
    ToolbarVisible: Boolean;
103
105
    DefaultVcardVersion: string;
104
 
    DefaultPhoneCountryPrefix: string;
 
106
    DefaultPhoneCountryCode: string;
 
107
    DefaultInternationalCallPrefix: string;
105
108
    CompareTool: string;
106
109
    function GetProfileImage: TImage;
107
110
    function GetTempDir: string;
125
128
{$R *.lfm}
126
129
 
127
130
uses
128
 
  FormMain, FormSettings, FormFindDuplicity, FormCompare, TestCase,
 
131
  FormMain, FormSettings, FormFindDuplicity, FormCompare, TestCase, FormNormalize,
129
132
  FormGenerate, FormError, FormFind, FormTest, FormSource, FormCompareSideBySide,
130
133
  TestCases;
131
134
 
284
287
  OpenWebPage(ApplicationInfo1.HomePage);
285
288
end;
286
289
 
 
290
procedure TCore.ANormalizeExecute(Sender: TObject);
 
291
var
 
292
  FormNormalize: TFormNormalize;
 
293
begin
 
294
  FormNormalize := TFormNormalize.Create(nil);
 
295
  try
 
296
    FormNormalize.ShowModal;
 
297
  finally
 
298
    FreeAndNil(FormNormalize);
 
299
  end;
 
300
end;
 
301
 
287
302
procedure TCore.ARemoveExactDuplicatesExecute(Sender: TObject);
288
303
var
289
304
  RemovedCount: Integer;
539
554
    LastPhotoFileName := ReadStringWithDefault('LastPhotoFileName', '');
540
555
    LastQrCodeFileName := ReadStringWithDefault('LastQrCodeFileName', '');
541
556
    CompareTool := ReadStringWithDefault('CompareTool', GetDefaultCompareTool);
542
 
    DefaultPhoneCountryPrefix := ReadStringWithDefault('DefaultPhoneCountryPrefix', DefaultPhoneCountryPrefix);
 
557
    DefaultPhoneCountryCode := ReadStringWithDefault('DefaultPhoneCountryPrefix', DefaultPhoneCountryCode);
 
558
    DefaultInternationalCallPrefix := ReadStringWithDefault('DefaultInternationalCallPrefix', DefaultInternationalCallPrefix);
543
559
  finally
544
560
    Free;
545
561
  end;
567
583
    WriteString('LastPhotoFileName', LastPhotoFileName);
568
584
    WriteString('LastQrCodeFileName', LastQrCodeFileName);
569
585
    WriteString('CompareTool', CompareTool);
570
 
    WriteString('DefaultPhoneCountryPrefix', DefaultPhoneCountryPrefix);
 
586
    WriteString('DefaultPhoneCountryPrefix', DefaultPhoneCountryCode);
 
587
    WriteString('DefaultInternationalCallPrefix', DefaultInternationalCallPrefix);
571
588
  finally
572
589
    Free;
573
590
  end;