mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 23:38:02 +02:00
project groups: copy file name action
git-svn-id: trunk@50398 -
This commit is contained in:
parent
933b0120fb
commit
4cf9502f8f
@ -192,7 +192,8 @@ var
|
||||
cmdTargetOpen,
|
||||
cmdTargetRun,
|
||||
cmdTargetProperties,
|
||||
cmdTargetUninstall: TIDEMenuCommand;
|
||||
cmdTargetUninstall,
|
||||
cmdTargetCopyFilename: TIDEMenuCommand;
|
||||
|
||||
OpenRecentProjectGroupSubMenu: TIDEMenuSection;
|
||||
|
||||
|
@ -970,16 +970,58 @@ object ProjectGroupEditorForm: TProjectGroupEditorForm
|
||||
OnExecute = ATargetOpenExecute
|
||||
OnUpdate = ATargetOpenUpdate
|
||||
end
|
||||
object ATargetCopyFilename: TAction
|
||||
Category = 'TargetAction'
|
||||
Caption = 'Copy Filename'
|
||||
OnExecute = ATargetCopyFilenameExecute
|
||||
OnUpdate = ATargetCopyFilenameUpdate
|
||||
end
|
||||
end
|
||||
object PopupMenuTree: TPopupMenu
|
||||
Images = ImageListMain
|
||||
left = 208
|
||||
top = 152
|
||||
object PMICopyFilenameMenuItem: TMenuItem
|
||||
Caption = 'Copy Filename'
|
||||
Action = ATargetCopyFilename
|
||||
end
|
||||
object PMIRunMenuItem: TMenuItem
|
||||
Action = ATargetRun
|
||||
Bitmap.Data = {
|
||||
36040000424D3604000000000000360000002800000010000000100000000100
|
||||
2000000000000004000064000000640000000000000000000000000000000000
|
||||
000004733AFF21824FFF638272FF000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000004733AFF7ACFA4FF2C8C5AFF3D7659FFAEAEAEFF00000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000004733AFF82D8ACFF76D6A6FF3C9D6AFF27744CFFACAEADFF000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000009773FFF83DBAEFF1FC671FF72DEA7FF4BB27FFF177445FFA8ADAAFF0000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000004733AFF83DCAFFF11C369FF1ACC73FF69DFA3FF5AC28DFF137643FF9EA7
|
||||
A3FF000000000000000000000000000000000000000000000000000000000000
|
||||
000004733AFFA9DCC1FF10BD65FF11C167FF13C269FF59D395FF67C998FF167C
|
||||
47FF889C92FF0000000000000000000000000000000000000000000000000000
|
||||
000004733AFFA9DCC1FF0DB35EFF0EB660FF0EB660FF0DB45FFF47C484FF70CA
|
||||
9CFF1D824DFF678C79FF00000000000000000000000000000000000000000000
|
||||
000004733AFFA9DCC1FF0CAA58FF12AE5EFF15AF60FF16AD61FF13AA5DFF3AB6
|
||||
77FF75C79DFF288957FF4E8367FF000000000000000000000000000000000000
|
||||
000004733AFFA9DCC1FF2EAD6BFF2BAD6AFF27AB68FF22A964FF1CA55FFF41B2
|
||||
78FF78C69FFF298858FF678C79FF000000000000000000000000000000000000
|
||||
000004733AFFA9DCC1FF36AD70FF32AC6DFF2DAA6AFF28A866FF58BC89FF78C5
|
||||
9DFF1F804EFF839A8EFF00000000000000000000000000000000000000000000
|
||||
000004733AFFA9DCC1FF3EB176FF3AAF73FF36AE70FF6FC598FF71BF97FF187B
|
||||
49FFA6B0ABFF0000000000000000000000000000000000000000000000000000
|
||||
000004733AFFA9DCC1FF45B47BFF47B47CFF82CCA6FF67B68CFF177745FFC1C5
|
||||
C3FF000000000000000000000000000000000000000000000000000000000000
|
||||
000004733AFFA5DABFFF57BB87FF90D2B0FF5BAB82FF23774CFFD4D5D4FF0000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000004733AFFA9DCC1FF9BD5B7FF4C9F73FF3D7D5CFF00000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000004733AFFA4D9BEFF3D9366FF5F8873FF0000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000004733AFF2D8859FF859C90FF000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000
|
||||
}
|
||||
end
|
||||
object PMICompile: TMenuItem
|
||||
Action = ATargetCompile
|
||||
|
@ -14,9 +14,9 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, Menus,
|
||||
ActnList, LCLProc, LazIDEIntf, PackageIntf, ProjectIntf, ProjectGroupIntf,
|
||||
MenuIntf, IDEDialogs, IDEWindowIntf, LazFileUtils, LazLogger,
|
||||
ProjectGroupStrConst, ProjectGroup;
|
||||
ActnList, LCLProc, Clipbrd, LazIDEIntf, PackageIntf, ProjectIntf,
|
||||
ProjectGroupIntf, MenuIntf, IDEDialogs, IDEWindowIntf, LazFileUtils,
|
||||
LazLogger, ProjectGroupStrConst, ProjectGroup;
|
||||
|
||||
type
|
||||
TNodeType = (ntUnknown,
|
||||
@ -45,6 +45,7 @@ type
|
||||
{ TProjectGroupEditorForm }
|
||||
|
||||
TProjectGroupEditorForm = class(TForm)
|
||||
ATargetCopyFilename: TAction;
|
||||
AProjectGroupAddExisting: TAction;
|
||||
ATargetCompile: TAction;
|
||||
ATargetCompileClean: TAction;
|
||||
@ -99,6 +100,8 @@ type
|
||||
procedure ATargetCompileUpdate(Sender: TObject);
|
||||
procedure AProjectGroupDeleteExecute(Sender: TObject);
|
||||
procedure AProjectGroupDeleteUpdate(Sender: TObject);
|
||||
procedure ATargetCopyFilenameExecute(Sender: TObject);
|
||||
procedure ATargetCopyFilenameUpdate(Sender: TObject);
|
||||
procedure ATargetInstallExecute(Sender: TObject);
|
||||
procedure ATargetInstallUpdate(Sender: TObject);
|
||||
procedure ATargetOpenExecute(Sender: TObject);
|
||||
@ -499,6 +502,7 @@ begin
|
||||
SetItem(cmdTargetUnInstall,@ATargetUnInstallExecute);
|
||||
SetItem(cmdTargetLater,@ATargetLaterExecute);
|
||||
SetItem(cmdTargetEarlier,@ATargetEarlierExecute);
|
||||
SetItem(cmdTargetCopyFilename,@ATargetCopyFilenameExecute);
|
||||
end;
|
||||
|
||||
procedure TProjectGroupEditorForm.FormDestroy(Sender: TObject);
|
||||
@ -718,8 +722,8 @@ procedure TProjectGroupEditorForm.AProjectGroupDeleteExecute(Sender: TObject);
|
||||
Var
|
||||
T: TPGCompileTarget;
|
||||
begin
|
||||
if FProjectGroup=nil then exit;
|
||||
T:=SelectedTarget;
|
||||
if T=nil then exit;
|
||||
FProjectGroup.RemoveTarget(T);
|
||||
end;
|
||||
|
||||
@ -727,12 +731,36 @@ procedure TProjectGroupEditorForm.AProjectGroupDeleteUpdate(Sender: TObject);
|
||||
Var
|
||||
T: TPGCompileTarget;
|
||||
begin
|
||||
if FProjectGroup=nil then exit;
|
||||
T:=SelectedTarget;
|
||||
(Sender as TAction).Enabled:=(T<>Nil) and (T<>ProjectGroup.CompileTarget) and Not T.Removed;
|
||||
UpdateIDEMenuCommandFromAction(Sender,cmdTargetRemove);
|
||||
end;
|
||||
|
||||
procedure TProjectGroupEditorForm.ATargetCopyFilenameExecute(Sender: TObject);
|
||||
var
|
||||
ND: TNodeData;
|
||||
aFilename: String;
|
||||
begin
|
||||
ND:=SelectedNodeData;
|
||||
if ND=nil then exit;
|
||||
if ND.Target<>nil then
|
||||
aFilename:=ND.Target.Filename
|
||||
else if ND.NodeType=ntFile then
|
||||
aFilename:=ND.Value
|
||||
else
|
||||
exit;
|
||||
Clipboard.AsText:=aFilename;
|
||||
end;
|
||||
|
||||
procedure TProjectGroupEditorForm.ATargetCopyFilenameUpdate(Sender: TObject);
|
||||
var
|
||||
ND: TNodeData;
|
||||
begin
|
||||
ND:=SelectedNodeData;
|
||||
(Sender as TAction).Enabled:=(ND<>nil) and (ND.NodeType in [ntTarget,ntProjectGroup,ntFile]);
|
||||
UpdateIDEMenuCommandFromAction(Sender,cmdTargetCopyFilename);
|
||||
end;
|
||||
|
||||
procedure TProjectGroupEditorForm.ATargetInstallExecute(Sender: TObject);
|
||||
begin
|
||||
Perform(taInstall);
|
||||
@ -740,7 +768,7 @@ end;
|
||||
|
||||
procedure TProjectGroupEditorForm.ATargetInstallUpdate(Sender: TObject);
|
||||
begin
|
||||
AllowPerform(taInstall,Sender as Taction);
|
||||
AllowPerform(taInstall,Sender as TAction);
|
||||
UpdateIDEMenuCommandFromAction(Sender,cmdTargetInstall);
|
||||
end;
|
||||
|
||||
@ -793,7 +821,7 @@ begin
|
||||
For I:=0 to TVPG.Items.Count-1 do
|
||||
begin
|
||||
N:=TVPG.Items[I];
|
||||
TNodeData(N.Data).Free; // Would be nide to have a FreeAndNilData method in TTreeNode.
|
||||
TNodeData(N.Data).Free; // Would be nice to have a FreeAndNilData method in TTreeNode.
|
||||
N.Data:=Nil;
|
||||
end;
|
||||
end;
|
||||
|
@ -34,12 +34,11 @@ begin
|
||||
cmdTargetCompileClean:=RegisterIDEMenuCommand(Section,'TargetCompileClean',lisTargetCompileClean);// ToDo
|
||||
// ToDo: clean ... -> clean up dialog
|
||||
// ToDo: compile all from here
|
||||
// ToDo: compile all clean from here
|
||||
// ToDo: set build mode of all projects
|
||||
|
||||
Section:=RegisterIDEMenuSection(Root,'AddRemove');
|
||||
PGEditMenuSectionAddRemove:=Section;
|
||||
cmdTargetAdd:=RegisterIDEMenuCommand(Section,'TargetAdd',lisTargetAdd);// ToDo
|
||||
cmdTargetAdd:=RegisterIDEMenuCommand(Section,'TargetAdd',lisTargetAdd);
|
||||
cmdTargetRemove:=RegisterIDEMenuCommand(Section,'TargetRemove',lisTargetRemove);// ToDo
|
||||
|
||||
Section:=RegisterIDEMenuSection(Root,'Use');
|
||||
@ -48,17 +47,17 @@ begin
|
||||
cmdTargetUninstall:=RegisterIDEMenuCommand(Section,'TargetUninstall',lisTargetUninstall);// ToDo
|
||||
cmdTargetEarlier:=RegisterIDEMenuCommand(Section,'TargetEarlier',lisTargetEarlier);// ToDo: Ctrl+Up
|
||||
cmdTargetLater:=RegisterIDEMenuCommand(Section,'TargetLater',lisTargetLater);// ToDo: Ctrl+Down
|
||||
cmdTargetActivate:=RegisterIDEMenuCommand(Section,'TargetActivate',lisTargetActivate);// ToDo
|
||||
cmdTargetOpen:=RegisterIDEMenuCommand(Section,'TargetOpen',lisTargetOpen);// ToDo
|
||||
cmdTargetActivate:=RegisterIDEMenuCommand(Section,'TargetActivate',lisTargetActivate);
|
||||
cmdTargetOpen:=RegisterIDEMenuCommand(Section,'TargetOpen',lisTargetOpen);
|
||||
// ToDo: Save
|
||||
// ToDo: Close (package editor)
|
||||
cmdTargetRun:=RegisterIDEMenuCommand(Section,'TargetRun',lisTargetRun);// ToDo
|
||||
cmdTargetRun:=RegisterIDEMenuCommand(Section,'TargetRun',lisTargetRun);
|
||||
cmdTargetProperties:=RegisterIDEMenuCommand(Section,'TargetProperties',lisTargetProperties);// ToDo
|
||||
|
||||
Section:=RegisterIDEMenuSection(Root,'Misc');
|
||||
PGEditMenuSectionMisc:=Section;
|
||||
|
||||
// ToDo: Copy filename
|
||||
cmdTargetCopyFilename:=RegisterIDEMenuCommand(Section,'CopyFilename',lisTargetCopyFilename);
|
||||
// ToDo: View source (project)
|
||||
|
||||
// ToDo: find in files
|
||||
|
Loading…
Reference in New Issue
Block a user