mirror of https://gitlab.com/basile.b/dexed.git
fix #53 - project, git branches, last commit message in a tooltip
This commit is contained in:
parent
843e5faa79
commit
87218256b6
|
@ -1,3 +1,9 @@
|
||||||
|
# v3.9.7-dev
|
||||||
|
|
||||||
|
## Enhancements
|
||||||
|
|
||||||
|
- Project menu, git: add the last commit as additional infor attached to the list of branches. (#53)
|
||||||
|
|
||||||
# v3.9.6
|
# v3.9.6
|
||||||
|
|
||||||
## Enhancements
|
## Enhancements
|
||||||
|
|
|
@ -11,7 +11,6 @@ object MainForm: TMainForm
|
||||||
OnDropFiles = FormDropFiles
|
OnDropFiles = FormDropFiles
|
||||||
OnResize = FormResize
|
OnResize = FormResize
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
LCLVersion = '2.0.8.0'
|
|
||||||
object mainMenu: TMainMenu
|
object mainMenu: TMainMenu
|
||||||
top = 1
|
top = 1
|
||||||
object MenuItem1: TMenuItem
|
object MenuItem1: TMenuItem
|
||||||
|
|
|
@ -2803,6 +2803,17 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{procedure TMainForm.ActionsExecute(AAction: TBasicAction; var Handled: Boolean);
|
||||||
|
var
|
||||||
|
HintAction: TCustomHintAction absolute AAction;
|
||||||
|
begin
|
||||||
|
if (AAction is TCustomHintAction) and
|
||||||
|
string(HintAction.Hint).StartsWith(<magic string>) then
|
||||||
|
begin
|
||||||
|
// here attempt to show TMenuItem.Hint can be detected
|
||||||
|
end;
|
||||||
|
end;}
|
||||||
|
|
||||||
procedure TMainForm.actLayoutResetExecute(Sender: TObject);
|
procedure TMainForm.actLayoutResetExecute(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
InitDocking(true);
|
InitDocking(true);
|
||||||
|
@ -4162,6 +4173,7 @@ procedure TMainForm.actProjGitBranchesUpdExecute(Sender: TObject);
|
||||||
var
|
var
|
||||||
p: TProcess;
|
p: TProcess;
|
||||||
r: TStringList;
|
r: TStringList;
|
||||||
|
c: TStringList;
|
||||||
i: integer;
|
i: integer;
|
||||||
m: TMenuItem;
|
m: TMenuItem;
|
||||||
a: boolean;
|
a: boolean;
|
||||||
|
@ -4176,6 +4188,7 @@ begin
|
||||||
exit;
|
exit;
|
||||||
p := TProcess.Create(nil);
|
p := TProcess.Create(nil);
|
||||||
r := TStringList.Create;
|
r := TStringList.Create;
|
||||||
|
c := TStringList.create;
|
||||||
try
|
try
|
||||||
p.Executable := exeFullName('git' + exeExt);
|
p.Executable := exeFullName('git' + exeExt);
|
||||||
if p.Executable.fileExists then
|
if p.Executable.fileExists then
|
||||||
|
@ -4195,6 +4208,11 @@ begin
|
||||||
mnuGitBranch.Add(m);
|
mnuGitBranch.Add(m);
|
||||||
mnuGitBranch.AddSeparator;
|
mnuGitBranch.AddSeparator;
|
||||||
end;
|
end;
|
||||||
|
c.LoadFromStream(p.Stderr);
|
||||||
|
for i := 0 to c.Count-1 do
|
||||||
|
fMsgs.message(c[i], fProj, amcProj, amkAuto);
|
||||||
|
p.Parameters.Clear();
|
||||||
|
p.Parameters.AddStrings(['log', '--format=%B', '-n', '1', '<branch...>']);
|
||||||
for i:= 0 to r.Count-1 do
|
for i:= 0 to r.Count-1 do
|
||||||
begin
|
begin
|
||||||
m := TMenuItem.Create(mnuGitBranch);
|
m := TMenuItem.Create(mnuGitBranch);
|
||||||
|
@ -4208,16 +4226,21 @@ begin
|
||||||
m.Checked:= true;
|
m.Checked:= true;
|
||||||
end
|
end
|
||||||
else m.Caption:= Trim(r[i][1..r[i].length]);
|
else m.Caption:= Trim(r[i][1..r[i].length]);
|
||||||
|
c.Clear;
|
||||||
|
p.Parameters.Delete(4);
|
||||||
|
p.Parameters.AddStrings(m.Caption);
|
||||||
|
p.Execute();
|
||||||
|
processOutputToStrings(p, c);
|
||||||
|
while p.Running do ;
|
||||||
|
if not c.Count.equals(0) then
|
||||||
|
m.caption := m.caption + ' [last commit: ' + c[0] + ' ]';
|
||||||
mnuGitBranch.Add(m);
|
mnuGitBranch.Add(m);
|
||||||
end;
|
end;
|
||||||
r.Clear;
|
|
||||||
r.LoadFromStream(p.Stderr);
|
|
||||||
for i := 0 to r.Count-1 do
|
|
||||||
fMsgs.message(r[i], fProj, amcProj, amkAuto);
|
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
p.Free;
|
p.Free;
|
||||||
r.Free;
|
r.Free;
|
||||||
|
c.Free;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue