Changeset 70 for trunk/Forms/UFormMain.pas
- Timestamp:
- Aug 1, 2016, 1:10:13 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r69 r70 136 136 public 137 137 AcronymDb: TAcronymDb; 138 StartOnLogon: Boolean; 139 StartMinimizedToTray: Boolean; 138 140 function CompareStrings(Strings1, Strings2: TStrings): Boolean; 139 141 property AlwaysOnTop: Boolean read FAlwaysOnTop write SetAlwaysOnTop; … … 165 167 DefaultFileName = 'Acronyms' + ProjectExt; 166 168 DefaultRegKey = '\Software\Acronym Decoder'; 169 RegistryRunKey = '\Software\Microsoft\Windows\CurrentVersion\Run'; 170 ExampleFile = 'Example acronyms.adp'; 167 171 168 172 { TFormMain } … … 305 309 begin 306 310 FormSettings.Load; 307 if FormSettings.ShowModal = mrOk then 311 if FormSettings.ShowModal = mrOk then begin 308 312 FormSettings.Save; 313 SaveConfig; 314 end; 309 315 end; 310 316 … … 456 462 LoadConfig; 457 463 464 if StartMinimizedToTray then Visible := False; 465 458 466 if ParamCount > 0 then begin 459 467 // Open file specified as command line parameter … … 466 474 end else begin 467 475 // Open default database with examples if no item is in recent openned history 468 ProjectOpen(ExtractFileDir(Application.ExeName) + DirectorySeparator + 'Example Acronyms.adp');476 ProjectOpen(ExtractFileDir(Application.ExeName) + DirectorySeparator + ExampleFile); 469 477 end; 470 478 UpdateAcronymsList; … … 590 598 else CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(''); 591 599 AlwaysOnTop := ReadBoolWithDefault('AlwaysOnTop', False); 600 StartMinimizedToTray := ReadBoolWithDefault('StartMinimizedToTray', False); 592 601 CheckBoxExactMath.Checked := ReadBoolWithDefault('ExactMatch', False); 593 602 MenuItemToolbar.Checked := ReadBoolWithDefault('ToolBarVisible', True); 603 finally 604 Free; 605 end; 606 607 with TRegistryEx.Create do 608 try 609 RootKey := HKEY_CURRENT_USER; 610 OpenKey(RegistryRunKey, True); 611 StartOnLogon := ValueExists('Acronym Decoder'); 594 612 finally 595 613 Free; … … 610 628 else DeleteValue('LanguageCode'); 611 629 WriteBool('AlwaysOnTop', AlwaysOnTop); 630 WriteBool('StartMinimizedToTray', StartMinimizedToTray); 612 631 WriteBool('ExactMatch', CheckBoxExactMath.Checked); 613 632 WriteBool('ToolBarVisible', MenuItemToolbar.Checked); … … 615 634 Free; 616 635 end; 636 637 with TRegistryEx.Create do 638 try 639 RootKey := HKEY_CURRENT_USER; 640 OpenKey(RegistryRunKey, True); 641 if StartOnLogon then WriteString('Acronym Decoder', Application.ExeName) 642 else DeleteValue('Acronym Decoder'); 643 finally 644 Free; 645 end; 617 646 end; 618 647
Note:
See TracChangeset
for help on using the changeset viewer.