fix(developer): F7 to compile all in project view

This commit is contained in:
Marc Durdin 2019-12-11 06:12:09 +11:00
parent b740c8b09d
commit 831758a6ff
2 changed files with 30 additions and 16 deletions

View file

@ -146,6 +146,7 @@ uses
Keyman.Developer.System.Project.kpsProjectFile,
Keyman.Developer.System.Project.ProjectFile,
Keyman.Developer.UI.Project.ProjectFileUI,
Keyman.Developer.UI.Project.UfrmProject,
UframeTextEditor,
UfrmKeymanWizard,
UfrmDebug,
@ -441,13 +442,18 @@ begin
else if ActivePackageEditor <> nil then
begin
(ActivePackageProjectFile.UI as TProjectFileUI).DoAction(pfaCompile, False);
end;
end
else if frmKeymanDeveloper.ActiveChild is TfrmProject then
(frmKeymanDeveloper.ActiveChild as TfrmProject).CompileAll;
end;
procedure TmodActionsKeyboardEditor.actKeyboardCompileUpdate(Sender: TObject);
begin
// TODO: Split Keyboard menu and package editor functions
actKeyboardCompile.Enabled := (ActiveEditor <> nil) or (ActivePackageEditor <> nil);
actKeyboardCompile.Enabled :=
(ActiveEditor <> nil) or
(ActivePackageEditor <> nil) or
(frmKeymanDeveloper.ActiveChild is TfrmProject);
frmKeymanDeveloper.mnuKeyboard.Visible := actKeyboardCompile.Enabled;
frmKeymanDeveloper.mnuDebug.Visible := ActiveEditor <> nil;
end;

View file

@ -93,6 +93,7 @@ type
procedure SetFocus; override;
procedure SetGlobalProject;
procedure StartClose; override;
procedure CompileAll;
end;
implementation
@ -265,6 +266,26 @@ begin
frmMessages.Clear;
end;
procedure TfrmProject.CompileAll;
var
i: Integer;
begin
ClearMessages;
for i := 0 to FGlobalProject.Files.Count - 1 do
begin
if (FGlobalProject.Files[i] is TkmnProjectFile) or
(FGlobalProject.Files[i] is TmodelTsProjectFile) then
begin
if not (FGlobalProject.Files[i].UI as TProjectFileUI).DoAction(pfaCompile, False) then Exit; // I4687
end;
end;
for i := 0 to FGlobalProject.Files.Count - 1 do
begin
if FGlobalProject.Files[i] is TkpsProjectFile then
if not (FGlobalProject.Files[i].UI as TProjectFileUI).DoAction(pfaCompile, False) then Exit; // I4687
end;
end;
function TfrmProject.ShouldHandleNavigation(URL: string): Boolean;
begin
Result := False;
@ -489,20 +510,7 @@ begin
end
else if Command = 'compileall' then // I4686
begin
ClearMessages;
for i := 0 to FGlobalProject.Files.Count - 1 do
begin
if (FGlobalProject.Files[i] is TkmnProjectFile) or
(FGlobalProject.Files[i] is TmodelTsProjectFile) then
begin
if not (FGlobalProject.Files[i].UI as TProjectFileUI).DoAction(pfaCompile, False) then Exit; // I4687
end;
end;
for i := 0 to FGlobalProject.Files.Count - 1 do
begin
if FGlobalProject.Files[i] is TkpsProjectFile then
if not (FGlobalProject.Files[i].UI as TProjectFileUI).DoAction(pfaCompile, False) then Exit; // I4687
end;
CompileAll;
end
else if Command = 'cleanall' then // I4692
begin