Changeset 209 for trunk/Forms


Ignore:
Timestamp:
Sep 20, 2021, 12:25:22 PM (3 years ago)
Author:
chronos
Message:
  • Fixed: Correctly detect data application directories for Linux installation.
  • Modified: Use registry key and root from application info component.
Location:
trunk/Forms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormCheck.pas

    r207 r209  
    724724  with TRegistryEx.Create do
    725725  try
    726     RootKey := HKEY_CURRENT_USER;
    727     OpenKey(DefaultRegKey, True);
     726    RootKey := RegistryRootHKEY[Core.ApplicationInfo1.RegistryRoot];
     727    OpenKey(Core.ApplicationInfo1.RegistryKey, True);
    728728    EditSummaryStart.Text := ReadStringWithDefault('SummaryStart', 'ACRONYMS AND ABBREVIATIONS');
    729729    EditSummaryEnd.Text := ReadStringWithDefault('SummaryEnd', 'Appendix');
     
    739739  with TRegistryEx.Create do
    740740  try
    741     RootKey := HKEY_CURRENT_USER;
    742     OpenKey(DefaultRegKey, True);
     741    RootKey := RegistryRootHKEY[Core.ApplicationInfo1.RegistryRoot];
     742    OpenKey(Core.ApplicationInfo1.RegistryKey, True);
    743743    WriteString('SummaryStart', EditSummaryStart.Text);
    744744    WriteString('SummaryEnd', EditSummaryEnd.Text);
  • trunk/Forms/UFormMain.pas

    r208 r209  
    735735  if Title <> '' then Title := Title + ' - ';
    736736  Title := Title + Core.ApplicationInfo1.AppName;
     737  {$IFDEF WINDOWS}
     738  // Under Linux title would affect reg.xml path for storing registry settings
    737739  Application.Title := Title;
     740  {$ENDIF}
    738741  Caption := Title;
    739742  if Assigned(Core.AcronymDb) then begin
     
    750753procedure TFormMain.LoadConfig;
    751754begin
    752   RegistryContext := TRegistryContext.Create(HKEY_CURRENT_USER, DefaultRegKey);
    753   Core.PersistentForm1.RegistryContext := RegistryContext;
    754   RegistryContext := TRegistryContext.Create(HKEY_CURRENT_USER, DefaultRegKey + '\RecentFiles');
     755  Core.PersistentForm1.RegistryContext := Core.ApplicationInfo1.GetRegistryContext;
     756  RegistryContext := TRegistryContext.Create(Core.ApplicationInfo1.RegistryRoot,
     757    Core.ApplicationInfo1.RegistryKey + '\RecentFiles');
    755758  LastOpenedList1.LoadFromRegistry(RegistryContext);
    756759
     
    763766  with TRegistryEx.Create do
    764767  try
    765     RootKey := HKEY_CURRENT_USER;
    766     OpenKey(DefaultRegKey, True);
     768    RootKey := RegistryRootHKEY[Core.ApplicationInfo1.RegistryRoot];
     769    OpenKey(Core.ApplicationInfo1.RegistryKey, True);
    767770    AFilterSameLength.Checked := ReadBoolWithDefault('SameLength', False);
    768771    AFilterSameLetterCase.Checked := ReadBoolWithDefault('SameLetterCase', False);
     
    789792procedure TFormMain.SaveConfig;
    790793begin
    791   RegistryContext := TRegistryContext.Create(HKEY_CURRENT_USER, DefaultRegKey + '\RecentFiles');
     794  RegistryContext := TRegistryContext.Create(Core.ApplicationInfo1.RegistryRoot,
     795    Core.ApplicationInfo1.RegistryKey + '\RecentFiles');
    792796  LastOpenedList1.SaveToRegistry(RegistryContext);
    793797
    794798  with TRegistryEx.Create do
    795799  try
    796     RootKey := HKEY_CURRENT_USER;
    797     OpenKey(DefaultRegKey, True);
     800    RootKey := RegistryRootHKEY[Core.ApplicationInfo1.RegistryRoot];
     801    OpenKey(Core.ApplicationInfo1.RegistryKey, True);
    798802    WriteBool('SameLength', AFilterSameLength.Checked);
    799803    WriteBool('SameLetterCase', AFilterSameLetterCase.Checked);
Note: See TracChangeset for help on using the changeset viewer.