Changeset 149 for trunk/Forms


Ignore:
Timestamp:
Jun 5, 2023, 8:45:38 PM (19 months ago)
Author:
chronos
Message:
  • Modified: Remove U prefix from unit names.
Location:
trunk/Forms
Files:
51 moved

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormColumns.pas

    r148 r149  
    1 unit UFormColumns;
     1unit FormColumns;
    22
    33interface
     
    4040  end;
    4141
    42 var
    43   FormColumns: TFormColumns;
    44 
    4542
    4643implementation
     
    4946
    5047uses
    51   UCore;
     48  Core;
    5249
    5350{ TFormColumns }
     
    5552procedure TFormColumns.FormShow(Sender: TObject);
    5653begin
    57   Core.PersistentForm1.Load(Self);
     54  Core.Core.PersistentForm1.Load(Self);
    5855
    5956  ListBoxActive.Items.Assign(ActiveColumns);
     
    9390  );
    9491begin
    95   Core.PersistentForm1.Save(Self);
     92  Core.Core.PersistentForm1.Save(Self);
    9693end;
    9794
     
    139136procedure TFormColumns.FormCreate(Sender: TObject);
    140137begin
    141   Core.Translator.TranslateComponentRecursive(Self);
    142   Core.ThemeManager1.UseTheme(Self);
     138  Core.Core.Translator.TranslateComponentRecursive(Self);
     139  Core.Core.ThemeManager1.UseTheme(Self);
    143140  ActiveColumns := TStringList.Create;
    144141  AvailableColumns := TStringList.Create;
  • trunk/Forms/FormCompare.pas

    r148 r149  
    1 unit UFormCompare;
     1unit FormCompare;
    22
    33interface
     
    7474  end;
    7575
    76 var
    77   FormCompare: TFormCompare;
    78 
    7976
    8077implementation
     
    8380
    8481uses
    85   UCore, UVCardFile;
     82  Core, VCardFile;
    8683
    8784{ TFormCompare }
     
    9087  );
    9188begin
    92   Core.PersistentForm1.Save(Self);
     89  Core.Core.PersistentForm1.Save(Self);
    9390end;
    9491
     
    146143procedure TFormCompare.FormCreate(Sender: TObject);
    147144begin
    148   Core.Translator.TranslateComponentRecursive(Self);
    149   Core.ThemeManager1.UseTheme(Self);
     145  Core.Core.Translator.TranslateComponentRecursive(Self);
     146  Core.Core.ThemeManager1.UseTheme(Self);
    150147  Diff := TDiff.Create(Self);
    151148
     
    199196procedure TFormCompare.FormShow(Sender: TObject);
    200197begin
    201   Core.PersistentForm1.Load(Self);
     198  Core.Core.PersistentForm1.Load(Self);
    202199  UpdateInterface;
    203200  ReloadContent;
  • trunk/Forms/FormContact.pas

    r148 r149  
    1 unit UFormContact;
     1unit FormContact;
    22
    33interface
     
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    77  ComCtrls, ActnList, Menus, ExtCtrls, ExtDlgs, Buttons, VCard, LCLIntf,
    8   UFormProperties, DateUtils, {$IFDEF LCLGTK2}Gtk2Globals, {$ENDIF}ContactImage,
     8  FormProperties, DateUtils, {$IFDEF LCLGTK2}Gtk2Globals, {$ENDIF}ContactImage,
    99  ubarcodes;
    1010
     
    248248  end;
    249249
    250 var
    251   FormContact: TFormContact;
    252 
    253250
    254251implementation
     
    257254
    258255uses
    259   UCore, Common, UFormImage, UFormNameDetails, DataFile;
     256  Core, Common, FormImage, FormNameDetails, DataFile;
    260257
    261258resourcestring
     
    328325  if Visible then LastMouse.WinControl := PageControlContact.ActivePage;
    329326  {$ENDIF}
    330   Core.PersistentForm1.Load(Self);
     327  Core.Core.PersistentForm1.Load(Self);
    331328  PhotoChange(nil);
    332329
     
    363360  SavePictureDialog1.FilterIndex := 2;
    364361  SavePictureDialog1.DefaultExt := '.png';
    365   if Core.LastQrCodeFileName = '' then
    366     Core.LastQrCodeFileName := 'QR code.png';
    367   SavePictureDialog1.InitialDir := ExtractFileDir(Core.LastQrCodeFileName);
    368   SavePictureDialog1.FileName := ExtractFileName(Core.LastQrCodeFileName);
     362  if Core.Core.LastQrCodeFileName = '' then
     363    Core.Core.LastQrCodeFileName := 'QR code.png';
     364  SavePictureDialog1.InitialDir := ExtractFileDir(Core.Core.LastQrCodeFileName);
     365  SavePictureDialog1.FileName := ExtractFileName(Core.Core.LastQrCodeFileName);
    369366  if SavePictureDialog1.Execute then begin
    370367    F := LowerCase(ExtractFileExt(SavePictureDialog1.FileName));
     
    377374    else if (F = '.eps') or (F = '.ps') then BarcodeQR1.SaveToEpsFile(SavePictureDialog1.FileName)
    378375    else raise Exception.Create(SImageTypeNotSupported);
    379     Core.LastQrCodeFileName := SavePictureDialog1.FileName;
     376    Core.Core.LastQrCodeFileName := SavePictureDialog1.FileName;
    380377  end;
    381378end;
     
    674671  if FPhoto.Used and (FPhoto.Url = '') then
    675672    ImagePhoto.Picture.Bitmap.Assign(FPhoto.Bitmap)
    676     else ImagePhoto.Picture.Assign(Core.GetProfileImage.Picture);
     673    else ImagePhoto.Picture.Assign(Core.Core.GetProfileImage.Picture);
    677674  UpdateInterface;
    678675end;
     
    697694  PageControlContact.ActivePage.Hide;
    698695
    699   Core.LastContactTabIndex := PageControlContact.TabIndex;
    700   Core.PersistentForm1.Save(Self);
     696  Core.Core.LastContactTabIndex := PageControlContact.TabIndex;
     697  Core.Core.PersistentForm1.Save(Self);
    701698end;
    702699
     
    709706procedure TFormContact.APhotoLoadExecute(Sender: TObject);
    710707begin
    711   OpenPictureDialog1.InitialDir := ExtractFileDir(Core.LastPhotoFileName);
    712   OpenPictureDialog1.FileName := ExtractFileName(Core.LastPhotoFileName);
     708  OpenPictureDialog1.InitialDir := ExtractFileDir(Core.Core.LastPhotoFileName);
     709  OpenPictureDialog1.FileName := ExtractFileName(Core.Core.LastPhotoFileName);
    713710  if OpenPictureDialog1.Execute then begin
    714711    FPhoto.LoadFromFile(OpenPictureDialog1.FileName);
    715     Core.LastPhotoFileName := OpenPictureDialog1.FileName;
     712    Core.Core.LastPhotoFileName := OpenPictureDialog1.FileName;
    716713  end;
    717714end;
     
    724721procedure TFormContact.APhotoSaveExecute(Sender: TObject);
    725722begin
    726   SavePictureDialog1.InitialDir := ExtractFileDir(Core.LastPhotoFileName);
    727   SavePictureDialog1.FileName := ExtractFileName(Core.LastPhotoFileName);
     723  SavePictureDialog1.InitialDir := ExtractFileDir(Core.Core.LastPhotoFileName);
     724  SavePictureDialog1.FileName := ExtractFileName(Core.Core.LastPhotoFileName);
    728725  if SavePictureDialog1.Execute then begin
    729726    ImagePhoto.Picture.SaveToFile(SavePictureDialog1.FileName);
    730     Core.LastPhotoFileName := SavePictureDialog1.FileName;
     727    Core.Core.LastPhotoFileName := SavePictureDialog1.FileName;
    731728  end;
    732729end;
     
    762759  if EditHomeAddressCountry.Text <> '' then Address := Address + ' ' + EditHomeAddressCountry.Text;
    763760  if Trim(Address) <> '' then
    764     OpenURL(Core.MapUrl + URLEncode(Trim(Address)));
     761    OpenURL(Core.Core.MapUrl + URLEncode(Trim(Address)));
    765762end;
    766763
     
    814811  if EditWorkAddressCountry.Text <> '' then Address := Address + ' ' + EditWorkAddressCountry.Text;
    815812  if Trim(Address) <> '' then
    816     OpenURL(Core.MapUrl + URLEncode(Trim(Address)));
     813    OpenURL(Core.Core.MapUrl + URLEncode(Trim(Address)));
    817814end;
    818815
     
    840837procedure TFormContact.FormCreate(Sender: TObject);
    841838begin
    842   Core.Translator.TranslateComponentRecursive(Self);
    843   Core.ThemeManager1.UseTheme(Self);
     839  Core.Core.Translator.TranslateComponentRecursive(Self);
     840  Core.Core.ThemeManager1.UseTheme(Self);
    844841  FContact := nil;
    845842  FormProperties := TFormProperties.Create(nil);
     
    852849  BarcodeQR1.PopupMenu := PopupMenuQrCode;
    853850
    854   PageControlContact.TabIndex := Core.LastContactTabIndex;
     851  PageControlContact.TabIndex := Core.Core.LastContactTabIndex;
    855852end;
    856853
  • trunk/Forms/FormContacts.pas

    r148 r149  
    1 unit UFormContacts;
     1unit FormContacts;
    22
    33interface
     
    100100  end;
    101101
    102 var
    103   FormContacts: TFormContacts;
    104 
    105102
    106103implementation
     
    109106
    110107uses
    111   UFormContact, UCore, UVCardFile, UFormColumns;
     108  FormContact, Core, VCardFile, FormColumns;
    112109
    113110resourcestring
     
    386383procedure TFormContacts.FormShow(Sender: TObject);
    387384begin
    388   Core.Translator.TranslateComponentRecursive(Self);
    389   Core.ThemeManager1.UseTheme(Self);
    390   Core.PersistentForm1.Load(Self);
     385  Core.Core.Translator.TranslateComponentRecursive(Self);
     386  Core.Core.ThemeManager1.UseTheme(Self);
     387  Core.Core.PersistentForm1.Load(Self);
    391388  LoadFromRegistry(Context);
    392389  ReloadList;
     
    408405      FormContact.OnGetPrevious := GetPreviousContact;
    409406      FormContact.OnGetNext := GetNextContact;
    410       Contact.Properties.AddNew('VERSION', Core.DefaultVcardVersion);
     407      Contact.Properties.AddNew('VERSION', Core.Core.DefaultVcardVersion);
    411408      if FormContact.ShowModal = mrOK then begin
    412409        Contacts.Add(Contact);
    413         Core.DataFile.Modified := True;
     410        Core.Core.DataFile.Modified := True;
    414411        ReloadList;
    415412        UpdateInterface;
     
    442439        Contacts.Add(Contact);
    443440        Contact := nil;
    444         Core.DataFile.Modified := True;
     441        Core.Core.DataFile.Modified := True;
    445442        ReloadList;
    446443        UpdateInterface;
     
    548545      TempFile.Free;
    549546    end;
    550     OpenDialog1.InitialDir := ExtractFileDir(Core.LastContactFileName);
    551     OpenDialog1.FileName := ExtractFileName(Core.LastContactFileName);
     547    OpenDialog1.InitialDir := ExtractFileDir(Core.Core.LastContactFileName);
     548    OpenDialog1.FileName := ExtractFileName(Core.Core.LastContactFileName);
    552549    if OpenDialog1.Execute then begin
    553550      TContact(ListView1.Selected.Data).LoadFromFile(OpenDialog1.FileName);
    554       Core.LastContactFileName := OpenDialog1.FileName;
     551      Core.Core.LastContactFileName := OpenDialog1.FileName;
    555552      ReloadList;
    556553    end;
     
    574571      if FormContact.ShowModal = mrOK then begin
    575572        if not TContact(ListView1.Selected.Data).CompareTo(Contact) then
    576           Core.DataFile.Modified := True;
     573          Core.Core.DataFile.Modified := True;
    577574        TContact(ListView1.Selected.Data).Assign(Contact);
    578575        ReloadList;
     
    602599          PasteContacts.VCard.Contacts);
    603600      end else Contacts.AddContacts(PasteContacts.VCard.Contacts);
    604       Core.DataFile.Modified := True;
     601      Core.Core.DataFile.Modified := True;
    605602      ReloadList;
    606603      UpdateInterface;
     
    623620        Contacts.Delete(Contacts.IndexOf(ListView1.Items[I].Data));
    624621      end;
    625     Core.DataFile.Modified := True;
     622    Core.Core.DataFile.Modified := True;
    626623    ReloadList;
    627624    UpdateInterface;
     
    641638      TempFile.Free;
    642639    end;
    643     SaveDialog1.InitialDir := ExtractFileDir(Core.LastContactFileName);
     640    SaveDialog1.InitialDir := ExtractFileDir(Core.Core.LastContactFileName);
    644641    SaveDialog1.FileName := TContact(ListView1.Selected.Data).FullNameToFileName +
    645642      VCardFileExt;
    646643    if SaveDialog1.Execute then begin
    647644      TContact(ListView1.Selected.Data).SaveToFile(SaveDialog1.FileName);
    648       Core.LastContactFileName := SaveDialog1.FileName;
     645      Core.Core.LastContactFileName := SaveDialog1.FileName;
    649646    end;
    650647  end;
     
    674671begin
    675672  SaveToRegistry(Context);
    676   Core.PersistentForm1.Save(Self);
     673  Core.Core.PersistentForm1.Save(Self);
    677674end;
    678675
  • trunk/Forms/FormError.pas

    r148 r149  
    1 unit UFormError;
     1unit FormError;
    22
    33interface
     
    1717  end;
    1818
    19 var
    20   FormError: TFormError;
    21 
    2219
    2320implementation
     
    2623
    2724uses
    28   UCore;
     25  Core;
    2926
    3027{ TFormError }
     
    3229procedure TFormError.FormCreate(Sender: TObject);
    3330begin
    34   Core.Translator.TranslateComponentRecursive(Self);
    35   Core.ThemeManager1.UseTheme(Self);
     31  Core.Core.Translator.TranslateComponentRecursive(Self);
     32  Core.Core.ThemeManager1.UseTheme(Self);
    3633end;
    3734
    3835procedure TFormError.FormShow(Sender: TObject);
    3936begin
    40   Core.PersistentForm1.Load(Self);
     37  Core.Core.PersistentForm1.Load(Self);
    4138end;
    4239
    4340procedure TFormError.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    4441begin
    45   Core.PersistentForm1.Save(Self);
     42  Core.Core.PersistentForm1.Save(Self);
    4643end;
    4744
  • trunk/Forms/FormFind.pas

    r148 r149  
    1 unit UFormFind;
     1unit FormFind;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    7   ExtCtrls, StdCtrls, ActnList, Menus, VCard, UFormContacts;
     7  ExtCtrls, StdCtrls, ActnList, Menus, VCard, FormContacts;
    88
    99type
     
    3434  end;
    3535
    36 var
    37   FormFind: TFormFind;
    38 
    3936
    4037implementation
     
    4340
    4441uses
    45   UCore;
     42  Core;
    4643
    4744resourcestring
     
    9693procedure TFormFind.FormCreate(Sender: TObject);
    9794begin
    98   Core.Translator.TranslateComponentRecursive(Self);
    99   Core.ThemeManager1.UseTheme(Self);
     95  Core.Core.Translator.TranslateComponentRecursive(Self);
     96  Core.Core.ThemeManager1.UseTheme(Self);
    10097
    10198  ContactFieldIndex := cfNone;
     
    131128  var CloseAction: TCloseAction);
    132129begin
    133   Core.PersistentForm1.Save(Self);
     130  Core.Core.PersistentForm1.Save(Self);
    134131end;
    135132
     
    141138procedure TFormFind.FormShow(Sender: TObject);
    142139begin
    143   Core.PersistentForm1.Load(Self);
     140  Core.Core.PersistentForm1.Load(Self);
    144141
    145142  FormContacts.ManualDock(Self, nil, alClient);
  • trunk/Forms/FormFindDuplicity.pas

    r148 r149  
    1 unit UFormFindDuplicity;
     1unit FormFindDuplicity;
    22
    33interface
     
    5656  end;
    5757
    58 var
    59   FormFindDuplicity: TFormFindDuplicity;
    60 
    6158
    6259implementation
     
    6562
    6663uses
    67   UCore, UFormContacts, UVCardFile;
     64  Core, FormContacts, VCardFile;
    6865
    6966{ TFoundItems }
     
    168165procedure TFormFindDuplicity.FormCreate(Sender: TObject);
    169166begin
    170   Core.Translator.TranslateComponentRecursive(Self);
    171   Core.ThemeManager1.UseTheme(Self);
     167  Core.Core.Translator.TranslateComponentRecursive(Self);
     168  Core.Core.ThemeManager1.UseTheme(Self);
    172169
    173170  FoundItems := TFoundItems.Create;
     
    238235  var CloseAction: TCloseAction);
    239236begin
    240   Core.PersistentForm1.Save(Self);
     237  Core.Core.PersistentForm1.Save(Self);
    241238end;
    242239
     
    248245procedure TFormFindDuplicity.FormShow(Sender: TObject);
    249246begin
    250   Core.PersistentForm1.Load(Self);
     247  Core.Core.PersistentForm1.Load(Self);
    251248  Find;
    252249end;
  • trunk/Forms/FormGenerate.pas

    r148 r149  
    1 unit UFormGenerate;
     1unit FormGenerate;
    22
    33interface
     
    2424  end;
    2525
    26 var
    27   FormGenerate: TFormGenerate;
    28 
    2926
    3027implementation
     
    3330
    3431uses
    35   UCore;
     32  Core;
    3633
    3734{ TFormGenerate }
     
    4542    Contact := Contacts.AddNew;
    4643    with Contact do begin
    47       Fields[cfVersion] := Core.DefaultVcardVersion;
     44      Fields[cfVersion] := Core.Core.DefaultVcardVersion;
    4845      Fields[cfFirstName] := 'First ' + IntToStr(Random(10000));
    4946      Fields[cfLastName] := 'Last ' + IntToStr(Random(10000));
     
    6865  );
    6966begin
    70   Core.GenerateCount := SpinEditCount.Value;
    71   Core.PersistentForm1.Save(Self);
     67  Core.Core.GenerateCount := SpinEditCount.Value;
     68  Core.Core.PersistentForm1.Save(Self);
    7269end;
    7370
    7471procedure TFormGenerate.FormCreate(Sender: TObject);
    7572begin
    76   Core.Translator.TranslateComponentRecursive(Self);
    77   Core.ThemeManager1.UseTheme(Self);
     73  Core.Core.Translator.TranslateComponentRecursive(Self);
     74  Core.Core.ThemeManager1.UseTheme(Self);
    7875end;
    7976
    8077procedure TFormGenerate.FormShow(Sender: TObject);
    8178begin
    82   Core.PersistentForm1.Load(Self);
    83   SpinEditCount.Value := Core.GenerateCount;
     79  Core.Core.PersistentForm1.Load(Self);
     80  SpinEditCount.Value := Core.Core.GenerateCount;
    8481  UpdateInterface;
    8582end;
  • trunk/Forms/FormImage.pas

    r148 r149  
    1 unit UFormImage;
     1unit FormImage;
    22
    33interface
     
    3737  end;
    3838
    39 var
    40   FormImage: TFormImage;
    41 
    4239
    4340implementation
     
    4643
    4744uses
    48   UCore;
     45  Core;
    4946
    5047{ TFormImage }
     
    5249procedure TFormImage.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    5350begin
    54   Core.PersistentForm1.Save(Self);
     51  Core.Core.PersistentForm1.Save(Self);
    5552end;
    5653
    5754procedure TFormImage.FormCreate(Sender: TObject);
    5855begin
    59   Core.Translator.TranslateComponentRecursive(Self);
    60   Core.ThemeManager1.UseTheme(Self);
     56  Core.Core.Translator.TranslateComponentRecursive(Self);
     57  Core.Core.ThemeManager1.UseTheme(Self);
    6158
    6259  Image := TContactImage.Create(nil);
     
    7168procedure TFormImage.ButtonLoadClick(Sender: TObject);
    7269begin
    73   OpenPictureDialog1.InitialDir := ExtractFileDir(Core.LastPhotoFileName);
    74   OpenPictureDialog1.FileName := ExtractFileName(Core.LastPhotoFileName);
     70  OpenPictureDialog1.InitialDir := ExtractFileDir(Core.Core.LastPhotoFileName);
     71  OpenPictureDialog1.FileName := ExtractFileName(Core.Core.LastPhotoFileName);
    7572  if OpenPictureDialog1.Execute then begin
    7673    Image.LoadFromFile(OpenPictureDialog1.FileName);
    77     Core.LastPhotoFileName := OpenPictureDialog1.FileName;
     74    Core.Core.LastPhotoFileName := OpenPictureDialog1.FileName;
    7875  end;
    7976end;
     
    8683procedure TFormImage.ButtonSaveClick(Sender: TObject);
    8784begin
    88   SavePictureDialog1.InitialDir := ExtractFileDir(Core.LastPhotoFileName);
    89   SavePictureDialog1.FileName := ExtractFileName(Core.LastPhotoFileName);
     85  SavePictureDialog1.InitialDir := ExtractFileDir(Core.Core.LastPhotoFileName);
     86  SavePictureDialog1.FileName := ExtractFileName(Core.Core.LastPhotoFileName);
    9087  if SavePictureDialog1.Execute then begin
    9188    Image.SaveToFile(SavePictureDialog1.FileName);
    92     Core.LastPhotoFileName := SavePictureDialog1.FileName;
     89    Core.Core.LastPhotoFileName := SavePictureDialog1.FileName;
    9390  end;
    9491end;
     
    10198procedure TFormImage.FormShow(Sender: TObject);
    10299begin
    103   Core.PersistentForm1.Load(Self);
     100  Core.Core.PersistentForm1.Load(Self);
    104101
    105102  ImageChange(nil);
     
    109106begin
    110107  if Image.Used and (Image.Url = '') then ImagePhoto.Picture.Bitmap.Assign(Image.Bitmap)
    111     else ImagePhoto.Picture.Assign(Core.GetProfileImage.Picture);
     108    else ImagePhoto.Picture.Assign(Core.Core.GetProfileImage.Picture);
    112109  EditUrl.Text := Image.Url;
    113110  UpdateInterface;
  • trunk/Forms/FormMain.pas

    r148 r149  
    1 unit UFormMain;
     1unit FormMain;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, LazFileUtils, Forms, Controls, Graphics, Dialogs, Menus,
    7   ComCtrls;
     7  ComCtrls, FormContacts;
    88
    99type
     
    6565    procedure SetToolbarHints;
    6666    procedure UpdateFormTitle;
     67    procedure DataFileChangeExecute(Sender: TObject);
     68    procedure LastOpenedFileChangeExecute(Sender: TObject);
     69    procedure LoadConfig;
     70    procedure SaveConfig;
    6771  public
     72    FormContacts: TFormContacts;
    6873    procedure UpdateInterface;
    6974  end;
    7075
    71 var
    72   FormMain: TFormMain;
    73 
    7476
    7577implementation
     
    7880
    7981uses
    80   UCore, UFormContacts, VCard, UVCardFile, RegistryEx;
     82  Core, VCard, VCardFile, RegistryEx;
    8183
    8284resourcestring
     
    8890begin
    8991  FormContacts.Close;
    90   Core.PersistentForm1.Save(Self);
     92  Core.Core.PersistentForm1.Save(Self);
     93  Application.Terminate;
    9194end;
    9295
    9396procedure TFormMain.FormCloseQuery(Sender: TObject; var CanClose: boolean);
    9497begin
    95   Core.AFileClose.Execute;
    96   CanClose := Core.FileClosed;
     98  Core.Core.AFileClose.Execute;
     99  CanClose := Core.Core.FileClosed;
    97100end;
    98101
    99102procedure TFormMain.FormCreate(Sender: TObject);
    100103begin
     104  Core.Core.Translator.TranslateComponentRecursive(Self);
     105  Core.Core.ThemeManager1.UseTheme(Self);
     106
    101107  FormContacts := TFormContacts.Create(nil);
     108  Core.Core.OnDataFileChange := DataFileChangeExecute;
     109  Core.Core.OnLastOpenedListChange := LastOpenedFileChangeExecute;
    102110end;
    103111
     
    117125  try
    118126    SetToolbarHints;
    119     Core.Initialize;
    120     Core.ThemeManager1.UseTheme(Self);
    121     Core.PersistentForm1.Load(Self);
    122     Core.ScaleDPI1.ScaleControl(CoolBar1, Core.ScaleDPI1.DesignDPI);
     127    Core.Core.Initialize;
     128    Core.Core.ThemeManager1.UseTheme(Self);
     129    Core.Core.PersistentForm1.Load(Self);
     130    Core.Core.ScaleDPI1.ScaleControl(CoolBar1, Core.Core.ScaleDPI1.DesignDPI);
    123131    CoolBar1.AutosizeBands;
    124132
    125     FormContacts.Context := TRegistryContext.Create(Core.ApplicationInfo1.RegistryRoot,
    126       Core.ApplicationInfo1.RegistryKey + '\ContactsColumns');
    127     FormContacts.Contacts := TVCardFile(Core.DataFile).VCard.Contacts;
     133    FormContacts.Context := TRegistryContext.Create(Core.Core.ApplicationInfo1.RegistryRoot,
     134      Core.Core.ApplicationInfo1.RegistryKey + '\ContactsColumns');
     135    FormContacts.Contacts := TVCardFile(Core.Core.DataFile).VCard.Contacts;
    128136    FormContacts.ManualDock(Self, nil, alClient);
    129137    FormContacts.Align := alClient;
     
    166174begin
    167175  Title := '';
    168   if Assigned(Core.DataFile) and
    169   (ExtractFileNameWithoutExt(ExtractFileName(Core.DataFile.FileName)) <> '') then
    170     Title := Title + ExtractFileNameWithoutExt(ExtractFileName(Core.DataFile.FileName));
    171   if Assigned(Core.DataFile) and Core.DataFile.Modified then
     176  if Assigned(Core.Core.DataFile) and
     177  (ExtractFileNameWithoutExt(ExtractFileName(Core.Core.DataFile.FileName)) <> '') then
     178    Title := Title + ExtractFileNameWithoutExt(ExtractFileName(Core.Core.DataFile.FileName));
     179  if Assigned(Core.Core.DataFile) and Core.Core.DataFile.Modified then
    172180    Title := Title + ' (' + SModified + ')';
    173181  if Title <> '' then Title := Title + ' - ';
    174   Title := Title + Core.ApplicationInfo1.AppName;
     182  Title := Title + Core.Core.ApplicationInfo1.AppName;
    175183  //Application.Title := Title;
    176184  Caption := Title;
    177185end;
    178186
     187procedure TFormMain.DataFileChangeExecute(Sender: TObject);
     188begin
     189  if Assigned(FormContacts) then begin
     190    if Assigned(Core.Core.DataFile) then
     191      FormContacts.Contacts := TVCardFile(Core.Core.DataFile).VCard.Contacts
     192      else FormContacts.Contacts := nil;
     193  end;
     194
     195  FormContacts.ReloadList;
     196  FormContacts.UpdateInterface;
     197  UpdateInterface;
     198end;
     199
     200procedure TFormMain.LastOpenedFileChangeExecute(Sender: TObject);
     201begin
     202  Core.Core.LastOpenedList1.LoadToMenuItem(MenuItemFileOpenRecent, Core.Core.AFileOpenRecentExecute);
     203  Core.Core.LastOpenedList1.LoadToMenuItem(PopupMenuOpenRecent.Items, Core.Core.AFileOpenRecentExecute);
     204end;
     205
     206procedure TFormMain.LoadConfig;
     207begin
     208  with TRegistryEx.Create do
     209  try
     210    CurrentContext := Core.Core.ApplicationInfo1.GetRegistryContext;
     211    MenuItemToolbar.Checked := ReadBoolWithDefault('ToolBarVisible', True);
     212  finally
     213    Free;
     214  end;
     215end;
     216
     217procedure TFormMain.SaveConfig;
     218begin
     219  with TRegistryEx.Create do
     220  try
     221    CurrentContext := Core.Core.ApplicationInfo1.GetRegistryContext;
     222    WriteBool('ToolBarVisible', MenuItemToolbar.Checked);
     223  finally
     224    Free;
     225  end;
     226end;
     227
    179228procedure TFormMain.UpdateInterface;
    180229begin
  • trunk/Forms/FormNameDetails.pas

    r148 r149  
    1 unit UFormNameDetails;
     1unit FormNameDetails;
    22
    33interface
     
    2828  end;
    2929
    30 var
    31   FormNameDetails: TFormNameDetails;
    32 
    3330
    3431implementation
     
    3734
    3835uses
    39   UCore;
     36  Core;
    4037
    4138{ TFormNameDetails }
     
    4441  var CloseAction: TCloseAction);
    4542begin
    46   Core.PersistentForm1.Save(Self);
     43  Core.Core.PersistentForm1.Save(Self);
    4744end;
    4845
    4946procedure TFormNameDetails.FormCreate(Sender: TObject);
    5047begin
    51   Core.Translator.TranslateComponentRecursive(Self);
    52   Core.ThemeManager1.UseTheme(Self);
     48  Core.Core.Translator.TranslateComponentRecursive(Self);
     49  Core.Core.ThemeManager1.UseTheme(Self);
    5350end;
    5451
    5552procedure TFormNameDetails.FormShow(Sender: TObject);
    5653begin
    57   Core.PersistentForm1.Load(Self);
     54  Core.Core.PersistentForm1.Load(Self);
    5855end;
    5956
  • trunk/Forms/FormProperties.pas

    r148 r149  
    1 unit UFormProperties;
     1unit FormProperties;
    22
    33interface
     
    7676  end;
    7777
    78 var
    79   FormProperties: TFormProperties;
    80 
    8178
    8279implementation
     
    8582
    8683uses
    87   UFormProperty, UCore, Common;
     84  FormProperty, Core, Common;
    8885
    8986resourcestring
     
    207204procedure TFormProperties.FormShow(Sender: TObject);
    208205begin
    209   Core.PersistentForm1.Load(Self);
     206  Core.Core.PersistentForm1.Load(Self);
    210207  ReloadList;
    211208  UpdateInterface;
     
    269266    OpenDialog1.Filter := STextFiles + '|*' + TextFileExt + '|' + SAllFiles + '|*.*';
    270267    OpenDialog1.DefaultExt := TextFileExt;
    271     OpenDialog1.InitialDir := ExtractFileDir(Core.LastPropertyValueFileName);
    272     OpenDialog1.FileName := ExtractFileName(Core.LastPropertyValueFileName);
     268    OpenDialog1.InitialDir := ExtractFileDir(Core.Core.LastPropertyValueFileName);
     269    OpenDialog1.FileName := ExtractFileName(Core.Core.LastPropertyValueFileName);
    273270    if OpenDialog1.Execute then begin
    274271      TContactProperty(ListView1.Selected.Data).Value := LoadFileToStr(OpenDialog1.FileName);
    275       Core.LastPropertyValueFileName := OpenDialog1.FileName;
     272      Core.Core.LastPropertyValueFileName := OpenDialog1.FileName;
    276273      ReloadList;
    277274    end;
     
    324321    SaveDialog1.Filter := STextFiles + '|*' + TextFileExt + '|' + SAllFiles + '|*.*';
    325322    SaveDialog1.DefaultExt := TextFileExt;
    326     SaveDialog1.InitialDir := ExtractFileDir(Core.LastPropertyValueFileName);
     323    SaveDialog1.InitialDir := ExtractFileDir(Core.Core.LastPropertyValueFileName);
    327324    SaveDialog1.FileName := SValue + TextFileExt;
    328325    if SaveDialog1.Execute then begin
    329326      SaveStringToFile(TContactProperty(ListView1.Selected.Data).Value, SaveDialog1.FileName);
    330       Core.LastPropertyValueFileName := SaveDialog1.FileName;
     327      Core.Core.LastPropertyValueFileName := SaveDialog1.FileName;
    331328    end;
    332329  end;
     
    342339  );
    343340begin
    344   Core.PersistentForm1.Save(Self);
     341  Core.Core.PersistentForm1.Save(Self);
    345342end;
    346343
     
    349346  I: Integer;
    350347begin
    351   Core.Translator.TranslateComponentRecursive(Self);
    352   Core.ThemeManager1.UseTheme(Self);
     348  Core.Core.Translator.TranslateComponentRecursive(Self);
     349  Core.Core.ThemeManager1.UseTheme(Self);
    353350
    354351  FProperties := nil;
  • trunk/Forms/FormProperty.pas

    r148 r149  
    1 unit UFormProperty;
     1unit FormProperty;
    22
    33interface
     
    3838  end;
    3939
    40 var
    41   FormProperty: TFormProperty;
    42 
    4340
    4441implementation
     
    4744
    4845uses
    49   UCore;
     46  Core;
    5047
    5148{ TFormProperty }
     
    9390procedure TFormProperty.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    9491begin
    95   Core.PersistentForm1.Save(Self);
     92  Core.Core.PersistentForm1.Save(Self);
    9693end;
    9794
    9895procedure TFormProperty.FormCreate(Sender: TObject);
    9996begin
    100   Core.Translator.TranslateComponentRecursive(Self);
    101   Core.ThemeManager1.UseTheme(Self);
     97  Core.Core.Translator.TranslateComponentRecursive(Self);
     98  Core.Core.ThemeManager1.UseTheme(Self);
    10299
    103100  FContactProperty := nil;
     
    107104procedure TFormProperty.FormShow(Sender: TObject);
    108105begin
    109   Core.PersistentForm1.Load(Self);
     106  Core.Core.PersistentForm1.Load(Self);
    110107end;
    111108
  • trunk/Forms/FormSettings.pas

    r148 r149  
    1 unit UFormSettings;
     1unit FormSettings;
    22
    33interface
     
    4040  end;
    4141
    42 var
    43   FormSettings: TFormSettings;
    44 
    4542
    4643implementation
     
    4946
    5047uses
    51   UCore, Theme;
     48  Core, Theme;
    5249
    5350{ TFormSettings }
     
    5552procedure TFormSettings.FormShow(Sender: TObject);
    5653begin
    57   Core.PersistentForm1.Load(Self);
     54  Core.Core.PersistentForm1.Load(Self);
    5855
    59   Core.Translator.LanguageListToStrings(ComboBoxLanguage.Items);
    60   ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Translator.Language);
     56  Core.Core.Translator.LanguageListToStrings(ComboBoxLanguage.Items);
     57  ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Core.Translator.Language);
    6158  if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0;
    6259
    63   Core.ThemeManager1.Themes.LoadToStrings(ComboBoxTheme.Items);
    64   ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core.ThemeManager1.Theme);
     60  Core.Core.ThemeManager1.Themes.LoadToStrings(ComboBoxTheme.Items);
     61  ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core.Core.ThemeManager1.Theme);
    6562  if ComboBoxTheme.ItemIndex = -1 then ComboBoxTheme.ItemIndex := 0;
    6663end;
     
    6966begin
    7067  if ComboBoxLanguage.ItemIndex <> -1 then
    71     Core.Translator.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);
     68    Core.Core.Translator.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);
    7269  if ComboBoxTheme.ItemIndex <> -1 then
    73     Core.ThemeManager1.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]);
     70    Core.Core.ThemeManager1.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]);
    7471end;
    7572
     
    8784  );
    8885begin
    89   Core.PersistentForm1.Save(Self);
     86  Core.Core.PersistentForm1.Save(Self);
    9087end;
    9188
    9289procedure TFormSettings.FormCreate(Sender: TObject);
    9390begin
    94   Core.Translator.TranslateComponentRecursive(Self);
    95   Core.ThemeManager1.UseTheme(Self);
     91  Core.Core.Translator.TranslateComponentRecursive(Self);
     92  Core.Core.ThemeManager1.UseTheme(Self);
    9693end;
    9794
    9895procedure TFormSettings.LoadData;
    9996begin
    100   CheckBoxAutomaticDPI.Checked := Core.ScaleDPI1.AutoDetect;
    101   SpinEditDPI.Value := Core.ScaleDPI1.DPI.X;
    102   CheckBoxReopenLastFileOnStart.Checked := Core.ReopenLastFileOnStart;
    103   EditDefaultVcardVersion.Text := Core.DefaultVcardVersion;
    104   EditMapUrl.Text := Core.MapUrl;
     97  with Core.Core do begin
     98    CheckBoxAutomaticDPI.Checked := ScaleDPI1.AutoDetect;
     99    SpinEditDPI.Value := ScaleDPI1.DPI.X;
     100    CheckBoxReopenLastFileOnStart.Checked := ReopenLastFileOnStart;
     101    EditDefaultVcardVersion.Text := DefaultVcardVersion;
     102    EditMapUrl.Text := MapUrl;
     103  end;
    105104  UpdateInterface;
    106105end;
     
    108107procedure TFormSettings.SaveData;
    109108begin
    110   Core.ScaleDPI1.AutoDetect := CheckBoxAutomaticDPI.Checked;
    111   Core.ScaleDPI1.DPI := Point(SpinEditDPI.Value, SpinEditDPI.Value);
    112   Core.ReopenLastFileOnStart := CheckBoxReopenLastFileOnStart.Checked;
    113   Core.DefaultVcardVersion := EditDefaultVcardVersion.Text;
    114   Core.MapUrl := EditMapUrl.Text;
     109  with Core.Core do begin
     110    ScaleDPI1.AutoDetect := CheckBoxAutomaticDPI.Checked;
     111    ScaleDPI1.DPI := Point(SpinEditDPI.Value, SpinEditDPI.Value);
     112    ReopenLastFileOnStart := CheckBoxReopenLastFileOnStart.Checked;
     113    DefaultVcardVersion := EditDefaultVcardVersion.Text;
     114    MapUrl := EditMapUrl.Text;
     115  end;
    115116end;
    116117
  • trunk/Forms/FormSource.pas

    r148 r149  
    1 unit UFormSource;
     1unit FormSource;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ActnList, Menus,
    7   StdCtrls, SynEdit, SynHighlighterAny, UVCardHighlighter, Common;
     7  StdCtrls, SynEdit, SynHighlighterAny, VCardHighlighter, Common;
    88
    99type
     
    4242  end;
    4343
    44 var
    45   FormSource: TFormSource;
    46 
    4744
    4845implementation
     
    5148
    5249uses
    53   UCore, Theme, VCard;
     50  Core, Theme, VCard;
    5451
    5552{ TFormSource }
     
    5754procedure TFormSource.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    5855begin
    59   Core.PersistentForm1.Save(Self);
     56  Core.Core.PersistentForm1.Save(Self);
    6057end;
    6158
     
    8582  I: Integer;
    8683begin
    87   Core.Translator.TranslateComponentRecursive(Self);
    88   Core.ThemeManager1.UseTheme(Self);
     84  Core.Core.Translator.TranslateComponentRecursive(Self);
     85  Core.Core.ThemeManager1.UseTheme(Self);
    8986
    9087  VCardHighlighter := TSynVCardHighlighter.Create(nil);
     
    105102procedure TFormSource.FormShow(Sender: TObject);
    106103begin
    107   Core.PersistentForm1.Load(Self);
     104  Core.Core.PersistentForm1.Load(Self);
    108105  UpdateTheme;
    109106end;
     
    123120  C: TColor;
    124121begin
    125   if Core.ThemeManager1.Theme.Name = ThemeNameDark then begin
     122  if Core.Core.ThemeManager1.Theme.Name = ThemeNameDark then begin
    126123    SynEditSource.Color := clBlack;
    127124    VCardHighlighter.IdentAttri.Foreground := clWhite;
     
    130127    VCardHighlighter.PropertyAttri.Foreground := clLightRed;
    131128  end else
    132   if Core.ThemeManager1.Theme.Name = ThemeNameLight then begin
     129  if Core.Core.ThemeManager1.Theme.Name = ThemeNameLight then begin
    133130    SynEditSource.Color := clWhite;
    134131    VCardHighlighter.IdentAttri.Foreground := clBlack;
  • trunk/Forms/FormTest.pas

    r148 r149  
    1 unit UFormTest;
     1unit FormTest;
    22
    33interface
     
    3939  end;
    4040
    41 var
    42   FormTest: TFormTest;
    43 
    4441
    4542implementation
     
    4845
    4946uses
    50   UCore, UFormTestCase, VCard;
     47  Core, FormTestCase, VCard;
    5148
    5249{ TFormTest }
     
    107104procedure TFormTest.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    108105begin
    109   Core.PersistentForm1.Save(Self);
     106  Core.Core.PersistentForm1.Save(Self);
    110107end;
    111108
     
    143140procedure TFormTest.FormCreate(Sender: TObject);
    144141begin
    145   Core.Translator.TranslateComponentRecursive(Self);
    146   Core.ThemeManager1.UseTheme(Self);
     142  Core.Core.Translator.TranslateComponentRecursive(Self);
     143  Core.Core.ThemeManager1.UseTheme(Self);
    147144end;
    148145
    149146procedure TFormTest.FormShow(Sender: TObject);
    150147begin
    151   Core.PersistentForm1.Load(Self);
     148  Core.Core.PersistentForm1.Load(Self);
    152149  ReloadList;
    153150  UpdateInterface;
  • trunk/Forms/FormTestCase.lfm

    r148 r149  
    11object FormTestCase: TFormTestCase
    22  Left = 579
    3   Height = 543
     3  Height = 521
    44  Top = 468
    5   Width = 901
     5  Width = 865
    66  Caption = 'Test case'
    7   ClientHeight = 543
    8   ClientWidth = 901
    9   DesignTimePPI = 150
     7  ClientHeight = 521
     8  ClientWidth = 865
     9  DesignTimePPI = 144
    1010  OnClose = FormClose
    1111  OnCreate = FormCreate
    1212  OnShow = FormShow
    13   LCLVersion = '2.2.0.4'
     13  LCLVersion = '2.2.6.0'
    1414  object MemoLog: TMemo
    1515    Left = 8
    16     Height = 527
     16    Height = 505
    1717    Top = 8
    18     Width = 885
     18    Width = 849
    1919    Align = alClient
    2020    BorderSpacing.Around = 8
  • trunk/Forms/FormTestCase.pas

    r148 r149  
    1 unit UFormTestCase;
     1unit FormTestCase;
    22
    33interface
     
    1515    procedure FormCreate(Sender: TObject);
    1616    procedure FormShow(Sender: TObject);
    17   private
    18 
    19   public
    20 
    2117  end;
    22 
    23 var
    24   FormTestCase: TFormTestCase;
    2518
    2619
     
    3023
    3124uses
    32   UCore;
     25  Core;
    3326
    3427{ TFormTestCase }
     
    3730  );
    3831begin
    39   Core.PersistentForm1.Save(Self);
     32  Core.Core.PersistentForm1.Save(Self);
    4033end;
    4134
    4235procedure TFormTestCase.FormCreate(Sender: TObject);
    4336begin
    44   Core.Translator.TranslateComponentRecursive(Self);
    45   Core.ThemeManager1.UseTheme(Self);
     37  Core.Core.Translator.TranslateComponentRecursive(Self);
     38  Core.Core.ThemeManager1.UseTheme(Self);
    4639end;
    4740
    4841procedure TFormTestCase.FormShow(Sender: TObject);
    4942begin
    50   Core.PersistentForm1.Load(Self);
     43  Core.Core.PersistentForm1.Load(Self);
    5144end;
    5245
Note: See TracChangeset for help on using the changeset viewer.