mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 16:56:01 +02:00
projectgroups: option to redirect Compile+Build to pg editor target
git-svn-id: trunk@61550 -
This commit is contained in:
parent
34266f2bc2
commit
d863ee5f46
@ -52,6 +52,10 @@ msgstr "Erstellmodus nicht gefunden"
|
||||
msgid "Build mode \"%s\" not found."
|
||||
msgstr "Erstellmodus \"%s\" nicht gefunden."
|
||||
|
||||
#: projectgroupstrconst.liscompileandbuildcompiletarget
|
||||
msgid "\"Compile\" and \"Build\" compile target"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.liscompilepackage
|
||||
#, object-pascal-format
|
||||
msgid "Compile Package %s"
|
||||
@ -98,6 +102,10 @@ msgstr "Fehler beim Lesen der Projektgruppen-Datei \"%s\"%s%s"
|
||||
msgid "Target does not exist. Remove?"
|
||||
msgstr "Das Ziel existiert nicht. Entfernen?"
|
||||
|
||||
#: projectgroupstrconst.lisidecommandscompileandbuildinvokecompilebuildselect
|
||||
msgid "IDE commands \"Compile\" and \"Build\" invoke compile/build selected target in project group editor"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisinvalidcycleaprojectgroupcannothaveitselfastarget
|
||||
msgid "Invalid cycle. A project group cannot have itself as target."
|
||||
msgstr ""
|
||||
|
@ -51,6 +51,10 @@ msgstr "Mode de construction introuvable"
|
||||
msgid "Build mode \"%s\" not found."
|
||||
msgstr "Le mode de construction \"%s\" est introuvable."
|
||||
|
||||
#: projectgroupstrconst.liscompileandbuildcompiletarget
|
||||
msgid "\"Compile\" and \"Build\" compile target"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.liscompilepackage
|
||||
#, object-pascal-format
|
||||
msgid "Compile Package %s"
|
||||
@ -93,6 +97,10 @@ msgstr "Erreur de lecture du fichier de groupe de projets \"%s\"%s%s"
|
||||
msgid "Target does not exist. Remove?"
|
||||
msgstr "La cible n'existe pas. Faut-il la retirer ?"
|
||||
|
||||
#: projectgroupstrconst.lisidecommandscompileandbuildinvokecompilebuildselect
|
||||
msgid "IDE commands \"Compile\" and \"Build\" invoke compile/build selected target in project group editor"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisinvalidcycleaprojectgroupcannothaveitselfastarget
|
||||
msgid "Invalid cycle. A project group cannot have itself as target."
|
||||
msgstr "Référence circulaire. Un groupe de projets ne peut avoir lui-même comme cible."
|
||||
|
@ -51,6 +51,10 @@ msgstr "Építési mód nem található."
|
||||
msgid "Build mode \"%s\" not found."
|
||||
msgstr "A(z) \"%s\" építési mód nem található."
|
||||
|
||||
#: projectgroupstrconst.liscompileandbuildcompiletarget
|
||||
msgid "\"Compile\" and \"Build\" compile target"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.liscompilepackage
|
||||
#, object-pascal-format
|
||||
msgid "Compile Package %s"
|
||||
@ -97,6 +101,10 @@ msgstr "Hiba a projektcsoport fájljának olvasása közben: \"%s\"%s%s"
|
||||
msgid "Target does not exist. Remove?"
|
||||
msgstr "A cél nem létezik. Eltávolítás?"
|
||||
|
||||
#: projectgroupstrconst.lisidecommandscompileandbuildinvokecompilebuildselect
|
||||
msgid "IDE commands \"Compile\" and \"Build\" invoke compile/build selected target in project group editor"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisinvalidcycleaprojectgroupcannothaveitselfastarget
|
||||
msgid "Invalid cycle. A project group cannot have itself as target."
|
||||
msgstr "Érvénytelen kör. A projektcsoport nem lehet a saját célja."
|
||||
|
@ -41,6 +41,10 @@ msgstr "Modalità di costruzione non trovata"
|
||||
msgid "Build mode \"%s\" not found."
|
||||
msgstr "Modalità di costruzione \"%s\" non trovata."
|
||||
|
||||
#: projectgroupstrconst.liscompileandbuildcompiletarget
|
||||
msgid "\"Compile\" and \"Build\" compile target"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.liscompilepackage
|
||||
#, object-pascal-format
|
||||
msgid "Compile Package %s"
|
||||
@ -87,6 +91,10 @@ msgstr "Errore durante la lettura del file gruppo di progetti \"%s\"%s%s"
|
||||
msgid "Target does not exist. Remove?"
|
||||
msgstr "La destinazione non esiste. Rimuoverla?"
|
||||
|
||||
#: projectgroupstrconst.lisidecommandscompileandbuildinvokecompilebuildselect
|
||||
msgid "IDE commands \"Compile\" and \"Build\" invoke compile/build selected target in project group editor"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisinvalidcycleaprojectgroupcannothaveitselfastarget
|
||||
msgid "Invalid cycle. A project group cannot have itself as target."
|
||||
msgstr "Ciclo non valido. Un gruppo di progetti non può avere se stesso come destinazione."
|
||||
|
@ -52,6 +52,10 @@ msgstr "Nerastas darymo rėžimas"
|
||||
msgid "Build mode \"%s\" not found."
|
||||
msgstr "Nerastas darymo rėžimas „%s“."
|
||||
|
||||
#: projectgroupstrconst.liscompileandbuildcompiletarget
|
||||
msgid "\"Compile\" and \"Build\" compile target"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.liscompilepackage
|
||||
#, object-pascal-format
|
||||
msgid "Compile Package %s"
|
||||
@ -98,6 +102,10 @@ msgstr "Skaitant projekto grupės failą „%s“ įvyko klaida%s%s"
|
||||
msgid "Target does not exist. Remove?"
|
||||
msgstr "Tikslas neegzistuoja. Pašalinti?"
|
||||
|
||||
#: projectgroupstrconst.lisidecommandscompileandbuildinvokecompilebuildselect
|
||||
msgid "IDE commands \"Compile\" and \"Build\" invoke compile/build selected target in project group editor"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisinvalidcycleaprojectgroupcannothaveitselfastarget
|
||||
msgid "Invalid cycle. A project group cannot have itself as target."
|
||||
msgstr "Klaidingas ciklas. Projekto grupės tikslas negali būti ji pati."
|
||||
|
@ -41,6 +41,10 @@ msgstr ""
|
||||
msgid "Build mode \"%s\" not found."
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.liscompileandbuildcompiletarget
|
||||
msgid "\"Compile\" and \"Build\" compile target"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.liscompilepackage
|
||||
#, object-pascal-format
|
||||
msgid "Compile Package %s"
|
||||
@ -80,6 +84,10 @@ msgstr ""
|
||||
msgid "Target does not exist. Remove?"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisidecommandscompileandbuildinvokecompilebuildselect
|
||||
msgid "IDE commands \"Compile\" and \"Build\" invoke compile/build selected target in project group editor"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisinvalidcycleaprojectgroupcannothaveitselfastarget
|
||||
msgid "Invalid cycle. A project group cannot have itself as target."
|
||||
msgstr ""
|
||||
|
@ -51,6 +51,10 @@ msgstr "Modo de construção não encontrado"
|
||||
msgid "Build mode \"%s\" not found."
|
||||
msgstr "Modo construção \"%s\" não encontrado."
|
||||
|
||||
#: projectgroupstrconst.liscompileandbuildcompiletarget
|
||||
msgid "\"Compile\" and \"Build\" compile target"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.liscompilepackage
|
||||
#, object-pascal-format
|
||||
msgid "Compile Package %s"
|
||||
@ -93,6 +97,10 @@ msgstr "Erro ao ler arquivo de grupo de projeto \"%s\"%s%s"
|
||||
msgid "Target does not exist. Remove?"
|
||||
msgstr "Alvo não existe. Remover?"
|
||||
|
||||
#: projectgroupstrconst.lisidecommandscompileandbuildinvokecompilebuildselect
|
||||
msgid "IDE commands \"Compile\" and \"Build\" invoke compile/build selected target in project group editor"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisinvalidcycleaprojectgroupcannothaveitselfastarget
|
||||
msgid "Invalid cycle. A project group cannot have itself as target."
|
||||
msgstr "Ciclo inválido. Um grupo de projeto não pode ter a si mesmo como alvo."
|
||||
|
@ -51,6 +51,10 @@ msgstr "Режим сборки не найден"
|
||||
msgid "Build mode \"%s\" not found."
|
||||
msgstr "Режим сборки \"%s\" не найден."
|
||||
|
||||
#: projectgroupstrconst.liscompileandbuildcompiletarget
|
||||
msgid "\"Compile\" and \"Build\" compile target"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.liscompilepackage
|
||||
#, object-pascal-format
|
||||
msgid "Compile Package %s"
|
||||
@ -93,6 +97,10 @@ msgstr "Ошибка чтения файла группы проектов \"%s\
|
||||
msgid "Target does not exist. Remove?"
|
||||
msgstr "Цель не существует. Удалить?"
|
||||
|
||||
#: projectgroupstrconst.lisidecommandscompileandbuildinvokecompilebuildselect
|
||||
msgid "IDE commands \"Compile\" and \"Build\" invoke compile/build selected target in project group editor"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisinvalidcycleaprojectgroupcannothaveitselfastarget
|
||||
msgid "Invalid cycle. A project group cannot have itself as target."
|
||||
msgstr "Обнаружен порочный круг. Группа проектов не может содержать саму себя в качестве цели."
|
||||
|
@ -52,6 +52,10 @@ msgstr "Режим збирання не знайдено"
|
||||
msgid "Build mode \"%s\" not found."
|
||||
msgstr "Режим збирання \"%s\" не знайдено."
|
||||
|
||||
#: projectgroupstrconst.liscompileandbuildcompiletarget
|
||||
msgid "\"Compile\" and \"Build\" compile target"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.liscompilepackage
|
||||
#, object-pascal-format
|
||||
msgid "Compile Package %s"
|
||||
@ -94,6 +98,10 @@ msgstr "Помилка читання файлу групи проектів \"%
|
||||
msgid "Target does not exist. Remove?"
|
||||
msgstr "Ціль не існує. Вилучити?"
|
||||
|
||||
#: projectgroupstrconst.lisidecommandscompileandbuildinvokecompilebuildselect
|
||||
msgid "IDE commands \"Compile\" and \"Build\" invoke compile/build selected target in project group editor"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisinvalidcycleaprojectgroupcannothaveitselfastarget
|
||||
msgid "Invalid cycle. A project group cannot have itself as target."
|
||||
msgstr "Виявлено хибне коло. Група проектів не може мати саму себе ціллю."
|
||||
|
@ -52,6 +52,10 @@ msgstr "构建模式未找到"
|
||||
msgid "Build mode \"%s\" not found."
|
||||
msgstr "构建模式\"%s\"未找到"
|
||||
|
||||
#: projectgroupstrconst.liscompileandbuildcompiletarget
|
||||
msgid "\"Compile\" and \"Build\" compile target"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.liscompilepackage
|
||||
#, object-pascal-format
|
||||
msgid "Compile Package %s"
|
||||
@ -98,6 +102,10 @@ msgstr "错误 读取工程组文件\"%s\"%s%s"
|
||||
msgid "Target does not exist. Remove?"
|
||||
msgstr "目标(Target)不存在.移除?"
|
||||
|
||||
#: projectgroupstrconst.lisidecommandscompileandbuildinvokecompilebuildselect
|
||||
msgid "IDE commands \"Compile\" and \"Build\" invoke compile/build selected target in project group editor"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisinvalidcycleaprojectgroupcannothaveitselfastarget
|
||||
msgid "Invalid cycle. A project group cannot have itself as target."
|
||||
msgstr "无效循环.一个工程组不能由它自身作为目标(target)组成."
|
||||
|
@ -28,4 +28,14 @@ object ProjGrpOptionsFrame: TProjGrpOptionsFrame
|
||||
ShowHint = True
|
||||
TabOrder = 1
|
||||
end
|
||||
object BuildCommandToCompileTargetCheckBox: TCheckBox
|
||||
Left = 8
|
||||
Height = 24
|
||||
Top = 70
|
||||
Width = 153
|
||||
Caption = '"Build" compiles target'
|
||||
ParentShowHint = False
|
||||
ShowHint = True
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
|
@ -22,10 +22,13 @@ type
|
||||
{ TProjGrpOptionsFrame }
|
||||
|
||||
TProjGrpOptionsFrame = class(TAbstractIDEOptionsEditor)
|
||||
BuildCommandToCompileTargetCheckBox: TCheckBox;
|
||||
OpenLastGroupOnStartCheckBox: TCheckBox;
|
||||
ShowTargetPathsCheckBox: TCheckBox;
|
||||
private
|
||||
FLastOpenLastGroupOnStart, FLastShowTargetPaths: Boolean;
|
||||
FLastOpenLastGroupOnStart: Boolean;
|
||||
FLastShowTargetPaths: Boolean;
|
||||
FLastBuildCommandToCompileTarget: Boolean;
|
||||
public
|
||||
function GetTitle: String; override;
|
||||
procedure Setup({%H-}ADialog: TAbstractOptionsEditorDialog); override;
|
||||
@ -53,6 +56,10 @@ begin
|
||||
|
||||
ShowTargetPathsCheckBox.Caption:=lisShowTargetPaths;
|
||||
ShowTargetPathsCheckBox.Hint:=lisEnableToShowTargetFilenamesWithPaths;
|
||||
|
||||
BuildCommandToCompileTargetCheckBox.Caption:=lisCompileAndBuildCompileTarget;
|
||||
BuildCommandToCompileTargetCheckBox.Hint:=
|
||||
lisIDECommandsCompileAndBuildInvokeCompileBuildSelect;
|
||||
end;
|
||||
|
||||
procedure TProjGrpOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||
@ -65,6 +72,8 @@ begin
|
||||
OpenLastGroupOnStartCheckBox.Checked:=FLastOpenLastGroupOnStart;
|
||||
FLastShowTargetPaths:=Opts.ShowTargetPaths;
|
||||
ShowTargetPathsCheckBox.Checked:=FLastShowTargetPaths;
|
||||
FLastBuildCommandToCompileTarget:=Opts.BuildCommandToCompileTarget;
|
||||
BuildCommandToCompileTargetCheckBox.Checked:=FLastBuildCommandToCompileTarget;
|
||||
end;
|
||||
|
||||
procedure TProjGrpOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
|
||||
@ -74,6 +83,7 @@ begin
|
||||
Opts:=IDEProjectGroupManager.Options;
|
||||
Opts.OpenLastGroupOnStart:=OpenLastGroupOnStartCheckBox.Checked;
|
||||
Opts.ShowTargetPaths:=ShowTargetPathsCheckBox.Checked;
|
||||
Opts.BuildCommandToCompileTarget:=BuildCommandToCompileTargetCheckBox.Checked;
|
||||
|
||||
if Opts.Modified then begin
|
||||
Opts.SaveSafe;
|
||||
|
@ -153,6 +153,7 @@ type
|
||||
|
||||
TIDEProjectGroupOptions = class
|
||||
private
|
||||
FBuildCommandToCompileTarget: Boolean;
|
||||
FChangeStamp: integer;
|
||||
FLastGroupFile: string;
|
||||
FLastSavedChangeStamp: integer;
|
||||
@ -160,6 +161,7 @@ type
|
||||
FRecentProjectGroups: TStringList;
|
||||
FShowTargetPaths: boolean;
|
||||
function GetModified: boolean;
|
||||
procedure SetBuildCommandToCompileTarget(const AValue: Boolean);
|
||||
procedure SetLastGroupFile(const AValue: string);
|
||||
procedure SetModified(AValue: boolean);
|
||||
procedure SetOpenLastGroupOnStart(const AValue: Boolean);
|
||||
@ -182,6 +184,7 @@ type
|
||||
property LastGroupFile: string read FLastGroupFile write SetLastGroupFile;
|
||||
property OpenLastGroupOnStart: Boolean read FOpenLastGroupOnStart write SetOpenLastGroupOnStart;
|
||||
property ShowTargetPaths: boolean read FShowTargetPaths write SetShowTargetPaths;
|
||||
property BuildCommandToCompileTarget: Boolean read FBuildCommandToCompileTarget write SetBuildCommandToCompileTarget;
|
||||
end;
|
||||
|
||||
{ TPGUndoItem }
|
||||
@ -380,6 +383,14 @@ begin
|
||||
Result:=FLastSavedChangeStamp<>FChangeStamp
|
||||
end;
|
||||
|
||||
procedure TIDEProjectGroupOptions.SetBuildCommandToCompileTarget(
|
||||
const AValue: Boolean);
|
||||
begin
|
||||
if FBuildCommandToCompileTarget=AValue then Exit;
|
||||
FBuildCommandToCompileTarget:=AValue;
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
procedure TIDEProjectGroupOptions.SetLastGroupFile(const AValue: string);
|
||||
begin
|
||||
if FLastGroupFile=AValue then Exit;
|
||||
@ -454,6 +465,7 @@ begin
|
||||
Cfg.SetDeleteValue('OpenLastGroupOnStart/Value',OpenLastGroupOnStart,true);
|
||||
Cfg.SetDeleteValue('LastGroupFile/Value',LastGroupFile,'');
|
||||
Cfg.SetDeleteValue('ShowTargetPaths/Value',ShowTargetPaths,false);
|
||||
Cfg.SetDeleteValue('BuildCommandToCompileTarget/Value',BuildCommandToCompileTarget,false);
|
||||
finally
|
||||
Cfg.Free;
|
||||
end;
|
||||
@ -469,6 +481,7 @@ begin
|
||||
OpenLastGroupOnStart:=Cfg.GetValue('OpenLastGroupOnStart/Value',true);
|
||||
LastGroupFile:=Cfg.GetValue('LastGroupFile/Value','');
|
||||
ShowTargetPaths:=Cfg.GetValue('ShowTargetPaths/Value',false);
|
||||
BuildCommandToCompileTarget:=Cfg.GetValue('BuildCommandToCompileTarget/Value',false);
|
||||
finally
|
||||
Cfg.Free;
|
||||
end;
|
||||
@ -673,25 +686,24 @@ end;
|
||||
|
||||
function TIDEProjectGroupManager.GetNewFileName: Boolean;
|
||||
var
|
||||
F: TSaveDialog;
|
||||
Dlg: TSaveDialog;
|
||||
begin
|
||||
Result:=False;
|
||||
F:=TSaveDialog.Create(Nil);
|
||||
With F do
|
||||
try
|
||||
FileName:=FProjectGroup.FileName;
|
||||
InitIDEFileDialog(F);
|
||||
F.Options:=[ofOverwritePrompt,ofPathMustExist,ofEnableSizing];
|
||||
F.Filter:=lisLazarusProjectGroupsLpg+'|*.lpg|'+lisAllFiles+'|'+AllFilesMask;
|
||||
F.DefaultExt:='.lpg';
|
||||
Result:=F.Execute;
|
||||
if Result then begin
|
||||
FProjectGroup.FileName:=TrimAndExpandFilename(FileName);
|
||||
end;
|
||||
StoreIDEFileDialog(F);
|
||||
finally
|
||||
F.Free;
|
||||
Dlg:=IDESaveDialogClass.Create(nil);
|
||||
try
|
||||
Dlg.FileName:=FProjectGroup.FileName;
|
||||
InitIDEFileDialog(Dlg);
|
||||
Dlg.Options:=[ofOverwritePrompt,ofPathMustExist,ofEnableSizing];
|
||||
Dlg.Filter:=lisLazarusProjectGroupsLpg+'|*.lpg|'+lisAllFiles+'|'+AllFilesMask;
|
||||
Dlg.DefaultExt:='.lpg';
|
||||
Result:=Dlg.Execute;
|
||||
if Result then begin
|
||||
FProjectGroup.FileName:=TrimAndExpandFilename(Dlg.FileName);
|
||||
end;
|
||||
finally
|
||||
StoreIDEFileDialog(Dlg);
|
||||
Dlg.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TIDEProjectGroupManager.OnIdle(Sender: TObject; var Done: Boolean);
|
||||
|
@ -1160,9 +1160,4 @@ object ProjectGroupEditorForm: TProjectGroupEditorForm
|
||||
left = 48
|
||||
top = 96
|
||||
end
|
||||
object SaveDialogPG: TSaveDialog
|
||||
Options = [ofPathMustExist, ofEnableSizing, ofViewDetail]
|
||||
left = 128
|
||||
top = 120
|
||||
end
|
||||
end
|
||||
|
@ -20,7 +20,7 @@ uses
|
||||
LazFileUtils, LazLoggerBase, LazFileCache,
|
||||
// IdeIntf
|
||||
LazIDEIntf, PackageIntf, ProjectIntf, ProjectGroupIntf, MenuIntf, IDEWindowIntf,
|
||||
IDEDialogs,
|
||||
IDEDialogs, IDECommands,
|
||||
// ProjectGroups
|
||||
ProjectGroupStrConst, ProjectGroup, PrjGrpOptionsFrm;
|
||||
|
||||
@ -87,7 +87,6 @@ type
|
||||
OpenDialogTarget: TOpenDialog;
|
||||
PopupMenuMore: TPopupMenu;
|
||||
PopupMenuTree: TPopupMenu;
|
||||
SaveDialogPG: TSaveDialog;
|
||||
SBPG: TStatusBar;
|
||||
TBProjectGroup: TToolBar;
|
||||
TBSave: TToolButton;
|
||||
@ -153,15 +152,22 @@ type
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
procedure TVPGSelectionChanged(Sender: TObject);
|
||||
private
|
||||
FBuildCommandRedirected: boolean;
|
||||
FProjectGroup: TProjectGroup;
|
||||
FProjectGroupTVNode: TTreeNode;
|
||||
FActiveTarget: TPGCompileTarget;
|
||||
FLastShowTargetPaths: boolean;
|
||||
FOldBuildExecute, FOldBuildUpdate: TNotifyEvent;
|
||||
FOldCompileExecute, FOldCompileUpdate: TNotifyEvent;
|
||||
// Project group callbacks
|
||||
procedure IDEProjectGroupManagerEditorOptionsChanged(Sender: TObject);
|
||||
procedure InitTVNode(Node: TTreeNode; Const ACaption: String;
|
||||
ANodeData: TNodeData);
|
||||
procedure OnApplicationActivate(Sender: TObject);
|
||||
procedure OnBuildExecute(Sender: TObject);
|
||||
procedure OnBuildUpdate(Sender: TObject);
|
||||
procedure OnCompileExecute(Sender: TObject);
|
||||
procedure OnCompileUpdate(Sender: TObject);
|
||||
procedure OnIDEClose(Sender: TObject);
|
||||
procedure OnProjectGroupDestroy(Sender: TObject);
|
||||
procedure OnProjectGroupFileNameChanged(Sender: TObject);
|
||||
@ -171,6 +177,7 @@ type
|
||||
procedure OnTargetExchanged(Sender: TObject; Target1, Target2: TPGCompileTarget);
|
||||
function AllowPerform(ATargetAction: TPGTargetAction; AAction: TAction= Nil): Boolean;
|
||||
procedure ClearEventCallBacks(AProjectGroup: TProjectGroup);
|
||||
procedure SetBuildCommandRedirected(const AValue: boolean);
|
||||
procedure SetEventCallBacks(AProjectGroup: TProjectGroup);
|
||||
// Some helpers
|
||||
procedure SetProjectGroup(AValue: TProjectGroup);
|
||||
@ -212,6 +219,7 @@ type
|
||||
property ProjectGroup: TProjectGroup Read FProjectGroup Write SetProjectGroup;
|
||||
property ActiveTarget: TPGCompileTarget Read GetActiveTarget;
|
||||
procedure UpdateNodeTexts;
|
||||
property BuildCommandRedirected: boolean read FBuildCommandRedirected write SetBuildCommandRedirected;
|
||||
end;
|
||||
|
||||
var
|
||||
@ -324,6 +332,36 @@ begin
|
||||
PG.OnTargetsExchanged:=Nil;
|
||||
end;
|
||||
|
||||
procedure TProjectGroupEditorForm.SetBuildCommandRedirected(
|
||||
const AValue: boolean);
|
||||
var
|
||||
CompileCmd, BuildCmd: TIDECommand;
|
||||
begin
|
||||
if FBuildCommandRedirected=AValue then Exit;
|
||||
FBuildCommandRedirected:=AValue;
|
||||
BuildCmd:=IDECommandList.FindIDECommand(ecBuild);
|
||||
CompileCmd:=IDECommandList.FindIDECommand(ecCompile);
|
||||
if FBuildCommandRedirected then begin
|
||||
// ecBuild
|
||||
FOldBuildExecute:=BuildCmd.OnExecute;
|
||||
FOldBuildUpdate:=BuildCmd.OnUpdate;
|
||||
BuildCmd.OnExecute:=@OnBuildExecute;
|
||||
BuildCmd.OnUpdate:=@OnBuildUpdate;
|
||||
// ecCompile
|
||||
FOldCompileExecute:=CompileCmd.OnExecute;
|
||||
FOldCompileUpdate:=CompileCmd.OnUpdate;
|
||||
CompileCmd.OnExecute:=@OnCompileExecute;
|
||||
CompileCmd.OnUpdate:=@OnCompileUpdate;
|
||||
end else begin
|
||||
// build
|
||||
BuildCmd.OnExecute:=FOldBuildExecute;
|
||||
BuildCmd.OnUpdate:=FOldBuildUpdate;
|
||||
// compile
|
||||
CompileCmd.OnExecute:=FOldCompileExecute;
|
||||
CompileCmd.OnUpdate:=FOldCompileUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TProjectGroupEditorForm.SetEventCallBacks(AProjectGroup: TProjectGroup);
|
||||
Var
|
||||
PG: TIDEProjectGroup;
|
||||
@ -547,11 +585,15 @@ begin
|
||||
|
||||
LazarusIDE.AddHandlerOnIDEClose(@OnIDEClose);
|
||||
Application.AddOnActivateHandler(@OnApplicationActivate);
|
||||
|
||||
if IDEProjectGroupManager.Options.BuildCommandToCompileTarget then
|
||||
BuildCommandRedirected:=true;
|
||||
end;
|
||||
|
||||
procedure TProjectGroupEditorForm.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
//debugln(['TProjectGroupEditorForm.FormDestroy START ',ProjectGroup<>nil]);
|
||||
BuildCommandRedirected:=false;
|
||||
ProjectGroup:=nil;
|
||||
if ProjectGroupEditorForm=Self then
|
||||
ProjectGroupEditorForm:=nil;
|
||||
@ -1198,6 +1240,8 @@ var
|
||||
begin
|
||||
Invalidate;
|
||||
Opts:=IDEProjectGroupManager.Options;
|
||||
if Opts.BuildCommandToCompileTarget then
|
||||
BuildCommandRedirected:=true;
|
||||
if FLastShowTargetPaths<>Opts.ShowTargetPaths then
|
||||
UpdateNodeTexts;
|
||||
end;
|
||||
@ -1208,6 +1252,50 @@ begin
|
||||
ProjectGroup.UpdateMissing;
|
||||
end;
|
||||
|
||||
procedure TProjectGroupEditorForm.OnBuildExecute(Sender: TObject);
|
||||
var
|
||||
ND: TNodeData;
|
||||
begin
|
||||
if BuildCommandRedirected then begin
|
||||
ND:=SelectedNodeData;
|
||||
if (ND<>nil) and (ND.Target<>nil) then begin
|
||||
Perform(taCompileClean);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
if Assigned(FOldBuildExecute) then
|
||||
FOldBuildExecute(Sender);
|
||||
end;
|
||||
|
||||
procedure TProjectGroupEditorForm.OnBuildUpdate(Sender: TObject);
|
||||
begin
|
||||
if Assigned(FOldBuildUpdate) then
|
||||
FOldBuildUpdate(Sender);
|
||||
end;
|
||||
|
||||
procedure TProjectGroupEditorForm.OnCompileExecute(Sender: TObject);
|
||||
var
|
||||
ND: TNodeData;
|
||||
begin
|
||||
if BuildCommandRedirected then begin
|
||||
ND:=SelectedNodeData;
|
||||
if (ND<>nil) and (ND.Target<>nil) then begin
|
||||
Perform(taCompile);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
// execute IDE's compile action
|
||||
if Assigned(FOldCompileExecute) then
|
||||
FOldCompileExecute(Sender);
|
||||
end;
|
||||
|
||||
procedure TProjectGroupEditorForm.OnCompileUpdate(Sender: TObject);
|
||||
begin
|
||||
//debugln(['TProjectGroupEditorForm.OnCompileUpdate ',DbgSName(Sender)]);
|
||||
if Assigned(FOldCompileUpdate) then
|
||||
FOldCompileUpdate(Sender);
|
||||
end;
|
||||
|
||||
procedure TProjectGroupEditorForm.OnIDEClose(Sender: TObject);
|
||||
var
|
||||
Opts: TIDEProjectGroupOptions;
|
||||
|
@ -130,6 +130,10 @@ Resourcestring
|
||||
lisShowTargetPaths = 'Show target paths';
|
||||
lisEnableToShowTargetFilenamesWithPaths = 'Enable to show target filenames '
|
||||
+'with paths.';
|
||||
lisCompileAndBuildCompileTarget = '"Compile" and "Build" compile target';
|
||||
lisIDECommandsCompileAndBuildInvokeCompileBuildSelect = 'IDE commands "'
|
||||
+'Compile" and "Build" invoke compile/build selected target in project '
|
||||
+'group editor';
|
||||
|
||||
|
||||
implementation
|
||||
|
Loading…
Reference in New Issue
Block a user