Check-in [8de4dda01a]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:ToolbarModified triggered an access violation in XE7. Apparently is wasn't necessary.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8de4dda01a0f533958ecc1bdb670dd0453a4f764
User & Date: tinus 2015-11-20 09:22:07.501
Context
2015-11-20
21:06
Refactored switch to a revision. Expanded sync statuses. check-in: 3838d01da0 user: tinus tags: trunk
09:22
ToolbarModified triggered an access violation in XE7. Apparently is wasn't necessary. check-in: 8de4dda01a user: tinus tags: trunk
2015-11-19
23:28
Implemented quick & dirty support for Fossil. check-in: baee1bf67c user: tinus tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/VCSInfoMenuWzrd.pas.
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
  FImgSyncBoth  := AddButtonImage(clWebOrange);
  FImgClean     := AddButtonImage(clLime);
  FImgPending   := AddButtonImage(clBlue);
  FImgExtra     := AddButtonImage(clFuchsia, 0);

  Toolbar := nil;
  Services.ReadToolbar(Application.MainForm, Application.MainForm.FindChildControl('Controlbar1') as TWinControl, scToolbarName, Toolbar);
  if not Assigned(Toolbar) then begin
    FToolbar := Services.NewToolbar(scToolbarName, 'Repository');
    FToolbar.AutoSize := True;
    Services.WriteToolbar(FToolbar);
  end else begin
    FToolbar := Toolbar as TToolBar;
    // Remove any automatically created buttons
    for i := FToolbar.ButtonCount - 1 downto 0 do begin







|







412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
  FImgSyncBoth  := AddButtonImage(clWebOrange);
  FImgClean     := AddButtonImage(clLime);
  FImgPending   := AddButtonImage(clBlue);
  FImgExtra     := AddButtonImage(clFuchsia, 0);

  Toolbar := nil;
  Services.ReadToolbar(Application.MainForm, Application.MainForm.FindChildControl('Controlbar1') as TWinControl, scToolbarName, Toolbar);
  if not (Toolbar is TToolBar) then begin
    FToolbar := Services.NewToolbar(scToolbarName, 'Repository');
    FToolbar.AutoSize := True;
    Services.WriteToolbar(FToolbar);
  end else begin
    FToolbar := Toolbar as TToolBar;
    // Remove any automatically created buttons
    for i := FToolbar.ButtonCount - 1 downto 0 do begin
455
456
457
458
459
460
461
462

463
464
465
466
467
468
469
  FButtonBranch.DropdownMenu.OnPopup := actBranchMenuPopup;
  FButtonBranch.DropdownMenu.AutoPopup := True;

  if not Assigned(Toolbar) then begin
    FToolbar.Left := Application.MainForm.Width - FToolbar.Width;
    FToolbar.Visible := True;
  end;
  Services.ToolbarModified(FToolbar);

end {TVCSInfoWizard.Create};
{ ------------------------------------------------------------------------------------------------ }
destructor TVCSInfoWizard.Destroy;
var
  Services: INTAServices;
  Button: TToolButton;
  i: Integer;







|
>







455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
  FButtonBranch.DropdownMenu.OnPopup := actBranchMenuPopup;
  FButtonBranch.DropdownMenu.AutoPopup := True;

  if not Assigned(Toolbar) then begin
    FToolbar.Left := Application.MainForm.Width - FToolbar.Width;
    FToolbar.Visible := True;
  end;
//  Services.ToolbarModified(FToolbar);
  FToolbar.Invalidate;
end {TVCSInfoWizard.Create};
{ ------------------------------------------------------------------------------------------------ }
destructor TVCSInfoWizard.Destroy;
var
  Services: INTAServices;
  Button: TToolButton;
  i: Integer;
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
procedure TVCSInfoWizard.actBranchUpdate(Sender: TObject);
var
  actBranch: TAction;
  Repo: TRepoInfo;
  NewImageIndex: Integer;
  NewCaption, NewHint: string;
  NewEnabled: boolean;
  Services: INTAServices;
begin
  actBranch := TAction(Sender);

  Repo := GetActiveFileRepo;
  NewEnabled := Repo.IsRepo;
  if Repo.IsRepo then begin
    NewCaption := Repo.Branch;







<







484
485
486
487
488
489
490

491
492
493
494
495
496
497
procedure TVCSInfoWizard.actBranchUpdate(Sender: TObject);
var
  actBranch: TAction;
  Repo: TRepoInfo;
  NewImageIndex: Integer;
  NewCaption, NewHint: string;
  NewEnabled: boolean;

begin
  actBranch := TAction(Sender);

  Repo := GetActiveFileRepo;
  NewEnabled := Repo.IsRepo;
  if Repo.IsRepo then begin
    NewCaption := Repo.Branch;
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
      or (actBranch.Hint <> NewHint)
      or (actBranch.Enabled <> NewEnabled) then begin
    actBranch.Enabled := NewEnabled;
    actBranch.ImageIndex := NewImageIndex;
    actBranch.Caption := NewCaption;
    actBranch.Hint := NewHint;

    Supports(ToolsAPI.BorlandIDEServices, INTAServices, {out}Services);
    Services.ToolbarModified(FToolbar);
    LogMessage('actBranchUpdate: IsRepo=%d, In=%d, Out=%d; Img=%d, Caption="%s", Hint="%s"',
                [Ord(Repo.IsRepo), Repo.Incoming, Repo.Outgoing, NewImageIndex, NewCaption, NewHint]);
  end;
end;

procedure TVCSInfoWizard.actBranchExecute(Sender: TObject);
var







<
|







524
525
526
527
528
529
530

531
532
533
534
535
536
537
538
      or (actBranch.Hint <> NewHint)
      or (actBranch.Enabled <> NewEnabled) then begin
    actBranch.Enabled := NewEnabled;
    actBranch.ImageIndex := NewImageIndex;
    actBranch.Caption := NewCaption;
    actBranch.Hint := NewHint;


    FToolbar.Invalidate;
    LogMessage('actBranchUpdate: IsRepo=%d, In=%d, Out=%d; Img=%d, Caption="%s", Hint="%s"',
                [Ord(Repo.IsRepo), Repo.Incoming, Repo.Outgoing, NewImageIndex, NewCaption, NewHint]);
  end;
end;

procedure TVCSInfoWizard.actBranchExecute(Sender: TObject);
var
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
procedure TVCSInfoWizard.actSyncUpdate(Sender: TObject);
var
  actSync: TAction;
  Repo: TRepoInfo;
  NewImageIndex: Integer;
  NewCaption: string;
  NewEnabled: boolean;
  Services: INTAServices;
begin
  actSync := Sender as TAction;
  Repo := GetActiveFileRepo;
  NewEnabled := Repo.IsRepo;
  if Repo.IsRepo then begin
    if (Repo.Incoming < 0) and (Repo.Outgoing < 0) then begin
      NewImageIndex := FImgUnknown;







<







674
675
676
677
678
679
680

681
682
683
684
685
686
687
procedure TVCSInfoWizard.actSyncUpdate(Sender: TObject);
var
  actSync: TAction;
  Repo: TRepoInfo;
  NewImageIndex: Integer;
  NewCaption: string;
  NewEnabled: boolean;

begin
  actSync := Sender as TAction;
  Repo := GetActiveFileRepo;
  NewEnabled := Repo.IsRepo;
  if Repo.IsRepo then begin
    if (Repo.Incoming < 0) and (Repo.Outgoing < 0) then begin
      NewImageIndex := FImgUnknown;
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725

  if (NewImageIndex <> actSync.ImageIndex) or (NewCaption <> actSync.Caption) or (NewEnabled <> actSync.Enabled) then begin
    actSync.ImageIndex := NewImageIndex;
    actSync.Caption := NewCaption;
    actSync.Hint := actSync.Caption;
    actSync.Enabled := NewEnabled;

    Supports(ToolsAPI.BorlandIDEServices, INTAServices, {out}Services);
    Services.ToolbarModified(FToolbar);
    LogMessage('actSyncUpdate: IsRepo=%d, In=%d, Out=%d; Caption="%s", Img=%d',
                [Ord(Repo.IsRepo), Repo.Incoming, Repo.Outgoing, NewCaption, NewImageIndex]);
  end;
end {TVCSInfoWizard.actSyncUpdate};

{ ------------------------------------------------------------------------------------------------ }
function TVCSInfoWizard.GetMenuText: string;







<
|







708
709
710
711
712
713
714

715
716
717
718
719
720
721
722

  if (NewImageIndex <> actSync.ImageIndex) or (NewCaption <> actSync.Caption) or (NewEnabled <> actSync.Enabled) then begin
    actSync.ImageIndex := NewImageIndex;
    actSync.Caption := NewCaption;
    actSync.Hint := actSync.Caption;
    actSync.Enabled := NewEnabled;


    FToolbar.Invalidate;
    LogMessage('actSyncUpdate: IsRepo=%d, In=%d, Out=%d; Caption="%s", Img=%d',
                [Ord(Repo.IsRepo), Repo.Incoming, Repo.Outgoing, NewCaption, NewImageIndex]);
  end;
end {TVCSInfoWizard.actSyncUpdate};

{ ------------------------------------------------------------------------------------------------ }
function TVCSInfoWizard.GetMenuText: string;