Changeset 75
- Timestamp:
- Aug 2, 2016, 1:15:57 PM (8 years ago)
- Location:
- trunk/Forms
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r74 r75 124 124 ProjectClosed: Boolean; 125 125 ImportTotalItemCount: Integer; 126 function FindFirstNonOption: string; 126 127 procedure ProjectOpen(FileName: string); 127 128 procedure Initialize; … … 442 443 end; 443 444 445 function TFormMain.FindFirstNonOption: string; 446 var 447 S: string; 448 I: Integer; 449 begin 450 Result := ''; 451 for I := 1 to Application.ParamCount do begin 452 S := Application.Params[I]; 453 if S[1] = Application.OptionChar then Continue; 454 Result := S; 455 Break; 456 end; 457 end; 458 444 459 procedure TFormMain.ProjectOpen(FileName: string); 445 460 begin … … 458 473 459 474 procedure TFormMain.Initialize; 475 var 476 FileNameOption: string; 460 477 begin 461 478 if not Initialized then begin … … 463 480 LoadConfig; 464 481 465 if StartMinimizedToTray then Visible := False; 466 467 if ParamCount > 0 then begin 482 {$IFDEF 0} 483 if Application.HasOption('h', 'help') then begin 484 WriteLn('AcronymDecoder <project file>'); 485 WriteLn(' -t --tray Start minimized in system tray'); 486 WriteLn(' -h --help Show this help'); 487 Application.Terminate; 488 Exit; 489 end; 490 {$ENDIF} 491 if Application.HasOption('t', 'tray') then begin 492 Visible := False; 493 end; 494 495 FileNameOption := FindFirstNonOption; 496 if FileNameOption <> '' then begin 468 497 // Open file specified as command line parameter 469 AcronymDB.LoadFromFile( ParamStr(1));498 AcronymDB.LoadFromFile(FileNameOption); 470 499 LastOpenedList1.AddItem(OpenDialog1.FileName); 471 500 end else … … 640 669 RootKey := HKEY_CURRENT_USER; 641 670 OpenKey(RegistryRunKey, True); 642 if StartOnLogon then WriteString('Acronym Decoder', Application.ExeName) 643 else DeleteValue('Acronym Decoder'); 671 if StartOnLogon then begin 672 if StartMinimizedToTray then WriteString('Acronym Decoder', Application.ExeName + ' /t') 673 else WriteString('Acronym Decoder', Application.ExeName) 674 end else DeleteValue('Acronym Decoder'); 644 675 finally 645 676 Free; -
trunk/Forms/UFormSettings.lfm
r70 r75 62 62 Width = 150 63 63 Caption = 'Start on user logon' 64 OnChange = CheckBoxStartOnLogonChange 64 65 TabOrder = 4 65 66 end 66 67 object CheckBoxStartMinimizedToTray: TCheckBox 67 Left = 1668 Left = 48 68 69 Height = 24 69 70 Top = 128 -
trunk/Forms/UFormSettings.pas
r70 r75 22 22 Label1: TLabel; 23 23 procedure ButtonOkClick(Sender: TObject); 24 procedure CheckBoxStartOnLogonChange(Sender: TObject); 24 25 procedure FormShow(Sender: TObject); 25 26 private … … 28 29 procedure Load; 29 30 procedure Save; 31 procedure UpdateInterface; 30 32 end; 31 33 … … 55 57 end; 56 58 59 procedure TFormSettings.CheckBoxStartOnLogonChange(Sender: TObject); 60 begin 61 UpdateInterface; 62 end; 63 57 64 procedure TFormSettings.Load; 58 65 begin … … 60 67 CheckBoxStartOnLogon.Checked := FormMain.StartOnLogon; 61 68 CheckBoxStartMinimizedToTray.Checked := FormMain.StartMinimizedToTray; 69 UpdateInterface; 62 70 end; 63 71 … … 69 77 end; 70 78 79 procedure TFormSettings.UpdateInterface; 80 begin 81 CheckBoxStartMinimizedToTray.Enabled := CheckBoxStartOnLogon.Checked; 82 end; 83 71 84 end. 72 85
Note:
See TracChangeset
for help on using the changeset viewer.