Add menu item to D-scan the whole project, close #167

This commit is contained in:
Basile Burg 2017-07-07 15:10:58 +02:00
parent 629413662b
commit 70537efa12
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
2 changed files with 51 additions and 1 deletions

View File

@ -3508,6 +3508,9 @@ object CEMainForm: TCEMainForm
8FFFB4A191FFB6A393FFB5A292FFB4A191FFBBA99AFFB8A696B0
}
end
object MenuItem108: TMenuItem
Action = actProjDscan
end
object MenuItem40: TMenuItem
Caption = '-'
end
@ -5327,6 +5330,13 @@ object CEMainForm: TCEMainForm
OnExecute = actFileCloseAllExecute
OnUpdate = updateDocumentBasedAction
end
object actProjDscan: TAction
Category = 'Project'
Caption = 'Verify project with Dscanner'
ImageIndex = 35
OnExecute = actProjDscanExecute
OnUpdate = updateProjectBasedAction
end
end
object imgList: TImageList
left = 64

View File

@ -109,6 +109,7 @@ type
actFileMetricsHalstead: TAction;
actFileCloseAllOthers: TAction;
actFileCloseAll: TAction;
actProjDscan: TAction;
actProjGroupCompileCustomSync: TAction;
actProjGroupClose: TAction;
actProjGroupCompileSync: TAction;
@ -159,6 +160,7 @@ type
MenuItem105: TMenuItem;
MenuItem106: TMenuItem;
MenuItem107: TMenuItem;
MenuItem108: TMenuItem;
MenuItem77: TMenuItem;
mnuOpts: TMenuItem;
mnuItemMruGroup: TMenuItem;
@ -275,6 +277,7 @@ type
procedure actFileSaveCopyAsExecute(Sender: TObject);
procedure actNewGroupExecute(Sender: TObject);
procedure actProjAddToGroupExecute(Sender: TObject);
procedure actProjDscanExecute(Sender: TObject);
procedure actProjGroupCompileCustomSyncExecute(Sender: TObject);
procedure actProjGroupCompileExecute(Sender: TObject);
procedure actProjGroupCompileSyncExecute(Sender: TObject);
@ -2934,7 +2937,7 @@ begin
processOutputToStrings(prc, lst);
while prc.Running do;
for msg in lst do
fMsgs.message(msg, fDoc, amcEdit, amkAuto);
fMsgs.message(msg, fDoc, amcEdit, amkWarn);
finally
prc.Free;
lst.Free;
@ -3510,6 +3513,43 @@ begin
dlgOkInfo(fProject.getCommandLine, 'Compilation command line');
end;
procedure TCEMainForm.actProjDscanExecute(Sender: TObject);
var
lst: TStringList;
prc: TProcess;
pth: string;
msg: string;
i: integer;
begin
if fProject = nil then
exit;
pth := exeFullName('dscanner' + exeExt);
if not pth.fileExists then
exit;
prc := TProcess.Create(nil);
lst := TStringList.Create;
try
prc.Executable:=pth;
prc.Options := [poUsePipes, poStderrToOutPut {$IFDEF WINDOWS}, poNewConsole{$ENDIF}];
prc.ShowWindow:= swoHIDE;
prc.Parameters.Add(fDoc.fileName);
prc.Parameters.Add('-S');
if not fDscanUnittests then
prc.Parameters.Add('--skipTests');
for i := 0 to fProject.sourcesCount-1 do
prc.Parameters.Add(fProject.sourceAbsolute(i));
prc.Execute;
processOutputToStrings(prc, lst);
while prc.Running do;
for msg in lst do
fMsgs.message(msg, fProject, amcProj, amkWarn);
finally
prc.Free;
lst.Free;
end;
end;
procedure TCEMainForm.actProjOpenGroupExecute(Sender: TObject);
begin
if fProjectGroup.groupModified then