Check-in [4646c6ea91]

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

Overview
Comment:Show a console icon for the console menu item.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4646c6ea91673774b99bb20d64d68e6a009fd0b6
User & Date: tinus 2015-11-29 13:18:36
Context
2015-12-08
08:00
Updated todo. check-in: a39f256989 user: tinus tags: trunk
2015-11-29
13:18
Show a console icon for the console menu item. check-in: 4646c6ea91 user: tinus tags: trunk
13:08
Show the repository's root path as hint for the branch button. check-in: 9b77047e22 user: tinus tags: trunk
Changes

Changes to src/VCSInfoMenuWzrd.pas.

29
30
31
32
33
34
35

36
37
38
39
40
41
42
...
514
515
516
517
518
519
520

521
522
523
524
525
526
527
...
705
706
707
708
709
710
711
712
713


714
715
716
717
718


719
720
721
722
723
724
725

      FButtonSync: TToolButton;
      FButtonStatus: TToolButton;
      FButtonBranch: TToolButton;
      FMenuBranches: TPopupMenu;

      FImgIcon: Integer;

      FImgMercurial: Integer;
      FImgFossil: Integer;
      FImgUnknown: integer;
      FImgSyncNone: integer;
      FImgSyncPull: integer;
      FImgSyncPush: integer;
      FImgSyncBoth: integer;
................................................................................
    end;
  end;

  LogMessage('Creating images...');
  FImgIcon      := Services.ImageList.AddIcon(Application.Icon);
  FImgMercurial := AddExeIcon('hg.exe');
  FImgFossil    := AddExeIcon('fossil.exe');

  FImgUnknown   := AddButtonImage(clBtnShadow);
  FImgSyncNone  := AddButtonImage(clGreen);
  FImgSyncPull  := AddButtonImage(clRed);
  FImgSyncPush  := AddButtonImage(clYellow);
  FImgSyncBoth  := AddButtonImage(clWebOrange);
  FImgClean     := AddButtonImage(clLime);
  FImgPending   := AddButtonImage(clBlue);
................................................................................
    if Menu.Owner is TToolButton then begin
      Item := Menu.Items.Items[Menu.Items.Count - 1];
      Button := TToolButton(Menu.Owner);
      Item.ImageIndex := Button.ImageIndex;
      case Button.Action.Tag of
        0: begin // hg
          ExecuteCmd('thg version', Output);
          if Output <> '' then
            Item.Caption := Output.Split([#13#10, #10, #13], 1, TStringSplitOptions.ExcludeEmpty)[0];


        end;
        1: begin // fossil
          ExecuteCmd('fossil version', Output);
          if Output <> '' then
            Item.Caption := Output.Replace('This is f', 'F').TrimRight;


        end;
        else begin
          Item.Caption := GetCurrentVersion;
        end;
      end;
    end;
  except







>







 







>







 







|

>
>



|

>
>







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
...
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
...
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731

      FButtonSync: TToolButton;
      FButtonStatus: TToolButton;
      FButtonBranch: TToolButton;
      FMenuBranches: TPopupMenu;

      FImgIcon: Integer;
      FImgConsole: Integer;
      FImgMercurial: Integer;
      FImgFossil: Integer;
      FImgUnknown: integer;
      FImgSyncNone: integer;
      FImgSyncPull: integer;
      FImgSyncPush: integer;
      FImgSyncBoth: integer;
................................................................................
    end;
  end;

  LogMessage('Creating images...');
  FImgIcon      := Services.ImageList.AddIcon(Application.Icon);
  FImgMercurial := AddExeIcon('hg.exe');
  FImgFossil    := AddExeIcon('fossil.exe');
  FImgConsole   := AddExeIcon('cmd.exe');
  FImgUnknown   := AddButtonImage(clBtnShadow);
  FImgSyncNone  := AddButtonImage(clGreen);
  FImgSyncPull  := AddButtonImage(clRed);
  FImgSyncPush  := AddButtonImage(clYellow);
  FImgSyncBoth  := AddButtonImage(clWebOrange);
  FImgClean     := AddButtonImage(clLime);
  FImgPending   := AddButtonImage(clBlue);
................................................................................
    if Menu.Owner is TToolButton then begin
      Item := Menu.Items.Items[Menu.Items.Count - 1];
      Button := TToolButton(Menu.Owner);
      Item.ImageIndex := Button.ImageIndex;
      case Button.Action.Tag of
        0: begin // hg
          ExecuteCmd('thg version', Output);
          if Output <> '' then begin
            Item.Caption := Output.Split([#13#10, #10, #13], 1, TStringSplitOptions.ExcludeEmpty)[0];
            Item.ImageIndex := FImgConsole;
          end;
        end;
        1: begin // fossil
          ExecuteCmd('fossil version', Output);
          if Output <> '' then begin
            Item.Caption := Output.Replace('This is f', 'F').TrimRight;
            Item.ImageIndex := FImgConsole;
          end;
        end;
        else begin
          Item.Caption := GetCurrentVersion;
        end;
      end;
    end;
  except