mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-28 03:23:00 +02:00
projectgroups: menu item Options, switch show target filenames
git-svn-id: trunk@61510 -
This commit is contained in:
parent
61add3f64e
commit
05fe93aa61
@ -175,6 +175,10 @@ msgstr "Projektgruppe öffnen ..."
|
||||
msgid "Open Recent Project Group"
|
||||
msgstr "Aktuelle Projektgruppe öffnen"
|
||||
|
||||
#: projectgroupstrconst.lisoptions
|
||||
msgid "Options"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisotherproject
|
||||
msgid "Other Project"
|
||||
msgstr "Anderes Projekt"
|
||||
|
@ -170,6 +170,10 @@ msgstr "Ouvrir le groupe de projets..."
|
||||
msgid "Open Recent Project Group"
|
||||
msgstr "Ouvrir un groupe de projets récent"
|
||||
|
||||
#: projectgroupstrconst.lisoptions
|
||||
msgid "Options"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisotherproject
|
||||
msgid "Other Project"
|
||||
msgstr "Autre projet"
|
||||
|
@ -174,6 +174,10 @@ msgstr "Projektcsoport megnyitása ..."
|
||||
msgid "Open Recent Project Group"
|
||||
msgstr "Legutóbbi projektcsoport megnyitása"
|
||||
|
||||
#: projectgroupstrconst.lisoptions
|
||||
msgid "Options"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisotherproject
|
||||
msgid "Other Project"
|
||||
msgstr "Projekt megnyitása"
|
||||
|
@ -170,6 +170,10 @@ msgstr "Apri gruppo di progetti ..."
|
||||
msgid "Open Recent Project Group"
|
||||
msgstr "Apri gruppo di progetti recente"
|
||||
|
||||
#: projectgroupstrconst.lisoptions
|
||||
msgid "Options"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisotherproject
|
||||
msgid "Other Project"
|
||||
msgstr "Altro progetto"
|
||||
|
@ -175,6 +175,10 @@ msgstr "Atverti projekto grupę…"
|
||||
msgid "Open Recent Project Group"
|
||||
msgstr "Atverti paskiausiai naudotą projekto grupę"
|
||||
|
||||
#: projectgroupstrconst.lisoptions
|
||||
msgid "Options"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisotherproject
|
||||
msgid "Other Project"
|
||||
msgstr "Kitas projektas"
|
||||
|
@ -157,6 +157,10 @@ msgstr ""
|
||||
msgid "Open Recent Project Group"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisoptions
|
||||
msgid "Options"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisotherproject
|
||||
msgid "Other Project"
|
||||
msgstr ""
|
||||
|
@ -170,6 +170,10 @@ msgstr "Abrir Grupo Projeto ..."
|
||||
msgid "Open Recent Project Group"
|
||||
msgstr "Abrir Grupo Projeto Recente"
|
||||
|
||||
#: projectgroupstrconst.lisoptions
|
||||
msgid "Options"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisotherproject
|
||||
msgid "Other Project"
|
||||
msgstr "Outro Projeto"
|
||||
|
@ -170,6 +170,10 @@ msgstr "Открыть группу проектов ..."
|
||||
msgid "Open Recent Project Group"
|
||||
msgstr "Открыть недавнюю группу проектов"
|
||||
|
||||
#: projectgroupstrconst.lisoptions
|
||||
msgid "Options"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisotherproject
|
||||
msgid "Other Project"
|
||||
msgstr "Другой проект"
|
||||
|
@ -171,6 +171,10 @@ msgstr "Відкрити групу проектів ..."
|
||||
msgid "Open Recent Project Group"
|
||||
msgstr "Відкрити нещодавню групу проектів"
|
||||
|
||||
#: projectgroupstrconst.lisoptions
|
||||
msgid "Options"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisotherproject
|
||||
msgid "Other Project"
|
||||
msgstr "Інший проект"
|
||||
|
@ -175,6 +175,10 @@ msgstr "打开工程组..."
|
||||
msgid "Open Recent Project Group"
|
||||
msgstr "打开最近工程组"
|
||||
|
||||
#: projectgroupstrconst.lisoptions
|
||||
msgid "Options"
|
||||
msgstr ""
|
||||
|
||||
#: projectgroupstrconst.lisotherproject
|
||||
msgid "Other Project"
|
||||
msgstr "其他工程"
|
||||
|
@ -13,7 +13,7 @@ uses
|
||||
// LCL
|
||||
Forms, StdCtrls, Dialogs,
|
||||
// LazUtils
|
||||
LazFileCache, LazFileUtils,
|
||||
LazFileCache, LazFileUtils, LazLoggerBase,
|
||||
// IdeIntf
|
||||
IDEOptionsIntf, IDEOptEditorIntf, ProjectGroup;
|
||||
|
||||
@ -61,10 +61,10 @@ var
|
||||
begin
|
||||
Opts:=IDEProjectGroupManager.Options;
|
||||
|
||||
OpenLastGroupOnStartCheckBox.Checked:=Opts.OpenLastGroupOnStart;
|
||||
FLastOpenLastGroupOnStart:=Opts.OpenLastGroupOnStart;
|
||||
ShowTargetPathsCheckBox.Checked:=Opts.ShowTargetPaths;
|
||||
OpenLastGroupOnStartCheckBox.Checked:=FLastOpenLastGroupOnStart;
|
||||
FLastShowTargetPaths:=Opts.ShowTargetPaths;
|
||||
ShowTargetPathsCheckBox.Checked:=FLastShowTargetPaths;
|
||||
end;
|
||||
|
||||
procedure TProjGrpOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
|
||||
@ -77,8 +77,8 @@ begin
|
||||
|
||||
if Opts.Modified then begin
|
||||
Opts.SaveSafe;
|
||||
if IDEProjectGroupManager.Editor<>nil then
|
||||
IDEProjectGroupManager.Editor.Invalidate;
|
||||
if IDEProjectGroupManager.OnEditorOptionsChanged<>nil then
|
||||
IDEProjectGroupManager.OnEditorOptionsChanged(true,true);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -199,11 +199,14 @@ type
|
||||
destructor Destroy; override;
|
||||
end;
|
||||
|
||||
TEditorOptionsChangedEvent = procedure(Colors, NodeTexts: boolean) of object;
|
||||
|
||||
{ TIDEProjectGroupManager }
|
||||
|
||||
TIDEProjectGroupManager = Class(TProjectGroupManager)
|
||||
private
|
||||
FIdleConnected: boolean;
|
||||
FOnEditorOptionsChanged: TEditorOptionsChangedEvent;
|
||||
FUndoList: TObjectList; // list of TPGUndoItem
|
||||
FRedoList: TObjectList; // list of TPGUndoItem
|
||||
FOptions: TIDEProjectGroupOptions;
|
||||
@ -240,6 +243,7 @@ type
|
||||
public
|
||||
property Options: TIDEProjectGroupOptions read FOptions;
|
||||
property IdleConnected: boolean read FIdleConnected write SetIdleConnected;
|
||||
property OnEditorOptionsChanged: TEditorOptionsChangedEvent read FOnEditorOptionsChanged write FOnEditorOptionsChanged;
|
||||
end;
|
||||
|
||||
TEditProjectGroupHandler = procedure(Sender: TObject; AProjectGroup: TProjectGroup);
|
||||
@ -295,6 +299,7 @@ var
|
||||
MnuCmdTargetCopyFilename: TIDEMenuCommand;
|
||||
MnuCmdProjGrpUndo: TIDEMenuCommand;
|
||||
MnuCmdProjGrpRedo: TIDEMenuCommand;
|
||||
MnuCmdProjGrpOptions: TIDEMenuCommand;
|
||||
|
||||
function LoadXML(aFilename: string; Quiet: boolean): TXMLConfig;
|
||||
function CreateXML(aFilename: string; Quiet: boolean): TXMLConfig;
|
||||
|
@ -977,6 +977,9 @@ object ProjectGroupEditorForm: TProjectGroupEditorForm
|
||||
object PMIRedo: TMenuItem
|
||||
Action = AProjectGroupRedo
|
||||
end
|
||||
object PMIOptions: TMenuItem
|
||||
Action = AProjectGroupOptions
|
||||
end
|
||||
end
|
||||
object ActionListMain: TActionList
|
||||
Images = ImageListMain
|
||||
@ -1111,6 +1114,11 @@ object ProjectGroupEditorForm: TProjectGroupEditorForm
|
||||
OnExecute = AProjectGroupRedoExecute
|
||||
OnUpdate = AProjectGroupRedoUpdate
|
||||
end
|
||||
object AProjectGroupOptions: TAction
|
||||
Category = 'ProjectGroupActions'
|
||||
Caption = 'Options'
|
||||
OnExecute = AProjectGroupOptionsExecute
|
||||
end
|
||||
end
|
||||
object PopupMenuTree: TPopupMenu
|
||||
Images = ImageListMain
|
||||
|
@ -22,7 +22,7 @@ uses
|
||||
LazIDEIntf, PackageIntf, ProjectIntf, ProjectGroupIntf, MenuIntf, IDEWindowIntf,
|
||||
IDEDialogs,
|
||||
// ProjectGroups
|
||||
ProjectGroupStrConst, ProjectGroup;
|
||||
ProjectGroupStrConst, ProjectGroup, PrjGrpOptionsFrm;
|
||||
|
||||
type
|
||||
TNodeType = (
|
||||
@ -47,6 +47,7 @@ type
|
||||
{ TProjectGroupEditorForm }
|
||||
|
||||
TProjectGroupEditorForm = class(TForm)
|
||||
AProjectGroupOptions: TAction;
|
||||
AProjectGroupRedo: TAction;
|
||||
AProjectGroupUndo: TAction;
|
||||
AProjectGroupReload: TAction;
|
||||
@ -69,6 +70,7 @@ type
|
||||
AProjectGroupSave: TAction;
|
||||
ActionListMain: TActionList;
|
||||
ImageListMain: TImageList;
|
||||
PMIOptions: TMenuItem;
|
||||
PMIRedo: TMenuItem;
|
||||
PMIUndo: TMenuItem;
|
||||
PMICompileFromHere: TMenuItem;
|
||||
@ -104,6 +106,7 @@ type
|
||||
procedure AProjectGroupAddExistingExecute(Sender: TObject);
|
||||
procedure AProjectGroupDeleteExecute(Sender: TObject);
|
||||
procedure AProjectGroupDeleteUpdate(Sender: TObject);
|
||||
procedure AProjectGroupOptionsExecute(Sender: TObject);
|
||||
procedure AProjectGroupRedoExecute(Sender: TObject);
|
||||
procedure AProjectGroupRedoUpdate(Sender: TObject);
|
||||
procedure AProjectGroupReloadExecute(Sender: TObject);
|
||||
@ -154,6 +157,8 @@ type
|
||||
FProjectGroupTVNode: TTreeNode;
|
||||
FActiveTarget: TPGCompileTarget;
|
||||
// Project group callbacks
|
||||
procedure IDEProjectGroupManagerEditorOptionsChanged(Colors,
|
||||
NodeTexts: boolean);
|
||||
procedure InitTVNode(Node: TTreeNode; Const ACaption: String;
|
||||
ANodeData: TNodeData);
|
||||
procedure OnApplicationActivate(Sender: TObject);
|
||||
@ -206,6 +211,7 @@ type
|
||||
public
|
||||
property ProjectGroup: TProjectGroup Read FProjectGroup Write SetProjectGroup;
|
||||
property ActiveTarget: TPGCompileTarget Read GetActiveTarget;
|
||||
procedure UpdateNodeTexts;
|
||||
end;
|
||||
|
||||
var
|
||||
@ -518,7 +524,9 @@ procedure TProjectGroupEditorForm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
if ProjectGroupEditorForm=nil then
|
||||
ProjectGroupEditorForm:=Self;
|
||||
ProjectGroupManager.Editor:=Self;
|
||||
IDEProjectGroupManager.Editor:=Self;
|
||||
IDEProjectGroupManager.OnEditorOptionsChanged:=@IDEProjectGroupManagerEditorOptionsChanged;
|
||||
|
||||
PGEditMenuSectionMisc.MenuItem:=PopupMenuMore.Items;
|
||||
SetItem(MnuCmdTargetAdd,@AProjectGroupAddExistingExecute);
|
||||
SetItem(MnuCmdTargetRemove,@AProjectGroupDeleteExecute);
|
||||
@ -532,6 +540,7 @@ begin
|
||||
SetItem(MnuCmdTargetCopyFilename,@ATargetCopyFilenameExecute);
|
||||
SetItem(MnuCmdProjGrpUndo,@AProjectGroupUndoExecute);
|
||||
SetItem(MnuCmdProjGrpRedo,@AProjectGroupRedoExecute);
|
||||
SetItem(MnuCmdProjGrpOptions,@AProjectGroupOptionsExecute);
|
||||
|
||||
LazarusIDE.AddHandlerOnIDEClose(@OnIDEClose);
|
||||
Application.AddOnActivateHandler(@OnApplicationActivate);
|
||||
@ -946,6 +955,11 @@ begin
|
||||
UpdateIDEMenuCommandFromAction(Sender,MnuCmdTargetRemove);
|
||||
end;
|
||||
|
||||
procedure TProjectGroupEditorForm.AProjectGroupOptionsExecute(Sender: TObject);
|
||||
begin
|
||||
LazarusIDE.DoOpenIDEOptions(TProjGrpOptionsFrame);
|
||||
end;
|
||||
|
||||
procedure TProjectGroupEditorForm.AProjectGroupRedoExecute(Sender: TObject);
|
||||
begin
|
||||
// ToDo
|
||||
@ -1174,6 +1188,13 @@ begin
|
||||
Node.StateIndex:=-1;
|
||||
end;
|
||||
|
||||
procedure TProjectGroupEditorForm.IDEProjectGroupManagerEditorOptionsChanged(
|
||||
Colors, NodeTexts: boolean);
|
||||
begin
|
||||
if Colors then Invalidate;
|
||||
if NodeTexts then UpdateNodeTexts;
|
||||
end;
|
||||
|
||||
procedure TProjectGroupEditorForm.OnApplicationActivate(Sender: TObject);
|
||||
begin
|
||||
if ProjectGroup<>nil then
|
||||
@ -1331,29 +1352,9 @@ begin
|
||||
end;
|
||||
|
||||
function TProjectGroupEditorForm.DisplayFileName(NodeData: TNodeData): string;
|
||||
var
|
||||
BaseDir: String;
|
||||
begin
|
||||
if (NodeData.Target<>nil)
|
||||
and (not IDEProjectGroupManager.Options.ShowTargetPaths) then
|
||||
begin
|
||||
if NodeData.Target.TargetType in [ttProject,ttPackage,ttProjectGroup] then
|
||||
Result:=ExtractFileNameOnly(NodeData.Target.Filename)
|
||||
else
|
||||
Result:=ExtractFileName(NodeData.Target.Filename);
|
||||
end else begin
|
||||
Result:='';
|
||||
if NodeData.ParentTarget<>nil then
|
||||
BaseDir:=ExtractFilePath(NodeData.ParentTarget.Filename)
|
||||
else
|
||||
BaseDir:='';
|
||||
if NodeData.Target<>nil then
|
||||
Result:=NodeData.Target.Filename;
|
||||
if Result='' then
|
||||
Result:='?'
|
||||
else
|
||||
Result:=CreateRelativePath(Result,BaseDir);
|
||||
end;
|
||||
if NodeData=nil then exit('');
|
||||
Result:=DisplayFileName(NodeData.Target);
|
||||
end;
|
||||
|
||||
procedure TProjectGroupEditorForm.ShowFileName;
|
||||
@ -1455,6 +1456,20 @@ begin
|
||||
Localize;
|
||||
end;
|
||||
|
||||
procedure TProjectGroupEditorForm.UpdateNodeTexts;
|
||||
var
|
||||
TVNode: TTreeNode;
|
||||
begin
|
||||
TVPG.BeginUpdate;
|
||||
try
|
||||
for TVNode in TVPG.Items do begin
|
||||
TVNode.Text:=DisplayFileName(TVNode);
|
||||
end;
|
||||
finally
|
||||
TVPG.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TProjectGroupEditorForm.FillProjectGroupNode(TVNode: TTreeNode;
|
||||
AProjectGroup: TProjectGroup);
|
||||
Const
|
||||
|
@ -29,6 +29,7 @@ Resourcestring
|
||||
lisTargetRemove = 'Remove target';
|
||||
lisUndo = 'Undo';
|
||||
lisRedo = 'Redo';
|
||||
lisOptions = 'Options';
|
||||
lisTargetCompile = 'Compile';
|
||||
lisProjectGroups = 'Project Groups';
|
||||
lisTargetCompileClean = 'Compile clean';
|
||||
|
@ -70,6 +70,7 @@ begin
|
||||
RegisterMenuCmd(MnuCmdTargetCopyFilename,MnuSection,'CopyFilename',lisTargetCopyFilename);
|
||||
RegisterMenuCmd(MnuCmdProjGrpUndo, MnuSection, 'Undo', lisUndo);
|
||||
RegisterMenuCmd(MnuCmdProjGrpRedo, MnuSection, 'Redo', lisRedo);
|
||||
RegisterMenuCmd(MnuCmdProjGrpOptions, MnuSection, 'Options', lisOptions);
|
||||
// ToDo: View source (project)
|
||||
|
||||
// ToDo: find in files
|
||||
|
Loading…
Reference in New Issue
Block a user