IDE: fixed GetPossibleOwnersOfUnit finding units in project directory

git-svn-id: trunk@35160 -
This commit is contained in:
mattias 2012-02-05 14:22:35 +00:00
parent 7f5a352702
commit dce2a00f90
8 changed files with 179 additions and 78 deletions

View File

@ -922,7 +922,6 @@ var
// it's a unit without package // it's a unit without package
if FLastHideOtherProjects then begin if FLastHideOtherProjects then begin
// check if unit is in unit path of current owner // check if unit is in unit path of current owner
debugln(['AddItems AAA1 CurUnitPath="',CurUnitPath,'" Dir=',ExtractFilePath(Item.DUnit.Filename)]);
if CurUnitPath='' then continue; if CurUnitPath='' then continue;
Dir:=ExtractFilePath(Item.DUnit.Filename); Dir:=ExtractFilePath(Item.DUnit.Filename);
if (Dir<>'') if (Dir<>'')
@ -1482,18 +1481,14 @@ begin
CurOwner:=nil; CurOwner:=nil;
CurUnitPath:=''; CurUnitPath:='';
if CurMainFilename='' then exit; if CurMainFilename='' then exit;
debugln(['TCodyIdentifiersDlg.UpdateCurOwnerOfUnit CurMainFilename=',CurMainFilename]);
GetBest(PackageEditingInterface.GetOwnersOfUnit(CurMainFilename)); GetBest(PackageEditingInterface.GetOwnersOfUnit(CurMainFilename));
if CurOwner=nil then if CurOwner=nil then
GetBest(PackageEditingInterface.GetPossibleOwnersOfUnit(CurMainFilename, GetBest(PackageEditingInterface.GetPossibleOwnersOfUnit(CurMainFilename,
[piosfExcludeOwned,piosfIncludeSourceDirectories])); [piosfExcludeOwned,piosfIncludeSourceDirectories]));
debugln(['TCodyIdentifiersDlg.UpdateCurOwnerOfUnit CurOwner=',DbgSName(CurOwner)]);
if CurOwner<>nil then begin if CurOwner<>nil then begin
CompOpts:=GetCurOwnerCompilerOptions; CompOpts:=GetCurOwnerCompilerOptions;
debugln(['TCodyIdentifiersDlg.UpdateCurOwnerOfUnit CompOpts=',DbgSName(CompOpts)]);
if CompOpts<>nil then if CompOpts<>nil then
CurUnitPath:=CompOpts.GetUnitPath(false); CurUnitPath:=CompOpts.GetUnitPath(false);
debugln(['TCodyIdentifiersDlg.UpdateCurOwnerOfUnit CurUnitPath="',CurUnitPath,'"']);
end; end;
end; end;

View File

@ -1,30 +1,30 @@
object EditIDEMsgHelpDialog: TEditIDEMsgHelpDialog object EditIDEMsgHelpDialog: TEditIDEMsgHelpDialog
Left = 330 Left = 330
Height = 460 Height = 522
Top = 280 Top = 280
Width = 622 Width = 649
Caption = 'EditIDEMsgHelpDialog' Caption = 'EditIDEMsgHelpDialog'
ClientHeight = 460 ClientHeight = 522
ClientWidth = 622 ClientWidth = 649
OnCreate = FormCreate OnCreate = FormCreate
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '0.9.31' LCLVersion = '0.9.31'
object CurMsgGroupBox: TGroupBox object CurMsgGroupBox: TGroupBox
Left = 6 Left = 6
Height = 105 Height = 105
Top = 6 Top = 94
Width = 610 Width = 637
Align = alTop Align = alTop
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'CurMsgGroupBox' Caption = 'CurMsgGroupBox'
ClientHeight = 89 ClientHeight = 89
ClientWidth = 606 ClientWidth = 633
TabOrder = 0 TabOrder = 0
object CurMsgMemo: TMemo object CurMsgMemo: TMemo
Left = 0 Left = 0
Height = 89 Height = 89
Top = 0 Top = 0
Width = 606 Width = 633
Align = alClient Align = alClient
Lines.Strings = ( Lines.Strings = (
'CurMsgMemo' 'CurMsgMemo'
@ -37,8 +37,8 @@ object EditIDEMsgHelpDialog: TEditIDEMsgHelpDialog
object ButtonPanel1: TButtonPanel object ButtonPanel1: TButtonPanel
Left = 6 Left = 6
Height = 42 Height = 42
Top = 412 Top = 474
Width = 610 Width = 637
OKButton.Name = 'OKButton' OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True OKButton.DefaultCaption = True
HelpButton.Name = 'HelpButton' HelpButton.Name = 'HelpButton'
@ -52,18 +52,18 @@ object EditIDEMsgHelpDialog: TEditIDEMsgHelpDialog
end end
object AllGroupBox: TGroupBox object AllGroupBox: TGroupBox
Left = 6 Left = 6
Height = 289 Height = 263
Top = 117 Top = 205
Width = 277 Width = 277
Align = alLeft Align = alLeft
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'AllGroupBox' Caption = 'AllGroupBox'
ClientHeight = 273 ClientHeight = 247
ClientWidth = 273 ClientWidth = 273
TabOrder = 2 TabOrder = 2
object URLsListBox: TListBox object URLsListBox: TListBox
Left = 0 Left = 0
Height = 247 Height = 221
Top = 0 Top = 0
Width = 273 Width = 273
Align = alClient Align = alClient
@ -75,7 +75,7 @@ object EditIDEMsgHelpDialog: TEditIDEMsgHelpDialog
object AddButton: TButton object AddButton: TButton
Left = 0 Left = 0
Height = 26 Height = 26
Top = 247 Top = 221
Width = 273 Width = 273
Align = alBottom Align = alBottom
AutoSize = True AutoSize = True
@ -85,14 +85,14 @@ object EditIDEMsgHelpDialog: TEditIDEMsgHelpDialog
end end
object CurGroupBox: TGroupBox object CurGroupBox: TGroupBox
Left = 300 Left = 300
Height = 289 Height = 263
Top = 117 Top = 205
Width = 316 Width = 343
Align = alClient Align = alClient
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'CurGroupBox' Caption = 'CurGroupBox'
ClientHeight = 273 ClientHeight = 247
ClientWidth = 312 ClientWidth = 339
TabOrder = 3 TabOrder = 3
object DeleteButton: TButton object DeleteButton: TButton
AnchorSideLeft.Control = CurGroupBox AnchorSideLeft.Control = CurGroupBox
@ -128,7 +128,7 @@ object EditIDEMsgHelpDialog: TEditIDEMsgHelpDialog
Left = 76 Left = 76
Height = 24 Height = 24
Top = 6 Top = 6
Width = 230 Width = 257
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 6 BorderSpacing.Around = 6
TabOrder = 1 TabOrder = 1
@ -143,7 +143,7 @@ object EditIDEMsgHelpDialog: TEditIDEMsgHelpDialog
Left = 6 Left = 6
Height = 15 Height = 15
Top = 126 Top = 126
Width = 300 Width = 327
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Top = 6 BorderSpacing.Top = 6
@ -161,7 +161,7 @@ object EditIDEMsgHelpDialog: TEditIDEMsgHelpDialog
Left = 6 Left = 6
Height = 24 Height = 24
Top = 141 Top = 141
Width = 300 Width = 327
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Right = 6 BorderSpacing.Right = 6
@ -178,7 +178,7 @@ object EditIDEMsgHelpDialog: TEditIDEMsgHelpDialog
Left = 6 Left = 6
Height = 15 Height = 15
Top = 36 Top = 36
Width = 300 Width = 327
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Top = 6 BorderSpacing.Top = 6
@ -196,7 +196,7 @@ object EditIDEMsgHelpDialog: TEditIDEMsgHelpDialog
Left = 6 Left = 6
Height = 24 Height = 24
Top = 51 Top = 51
Width = 300 Width = 327
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Right = 6 BorderSpacing.Right = 6
@ -213,7 +213,7 @@ object EditIDEMsgHelpDialog: TEditIDEMsgHelpDialog
Left = 6 Left = 6
Height = 15 Height = 15
Top = 81 Top = 81
Width = 300 Width = 327
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Top = 6 BorderSpacing.Top = 6
@ -231,7 +231,7 @@ object EditIDEMsgHelpDialog: TEditIDEMsgHelpDialog
Left = 6 Left = 6
Height = 24 Height = 24
Top = 96 Top = 96
Width = 300 Width = 327
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Right = 6 BorderSpacing.Right = 6
@ -242,8 +242,70 @@ object EditIDEMsgHelpDialog: TEditIDEMsgHelpDialog
end end
object Splitter1: TSplitter object Splitter1: TSplitter
Left = 289 Left = 289
Height = 289 Height = 263
Top = 117 Top = 205
Width = 5 Width = 5
end end
object GlobalOptionsGroupBox: TGroupBox
Left = 6
Height = 82
Top = 6
Width = 637
Align = alTop
AutoSize = True
BorderSpacing.Around = 6
Caption = 'GlobalOptionsGroupBox'
ClientHeight = 66
ClientWidth = 633
TabOrder = 5
object FPCMsgFileLabel: TLabel
AnchorSideLeft.Control = GlobalOptionsGroupBox
AnchorSideTop.Control = FPCMsgFileEdit
AnchorSideTop.Side = asrCenter
Left = 6
Height = 15
Top = 11
Width = 92
BorderSpacing.Left = 6
Caption = 'FPCMsgFileLabel'
ParentColor = False
end
object FPCMsgFileEdit: TEdit
AnchorSideLeft.Control = FPCMsgFileLabel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = GlobalOptionsGroupBox
Left = 104
Height = 24
Top = 6
Width = 283
BorderSpacing.Around = 6
TabOrder = 0
Text = 'FPCMsgFileEdit'
end
object AdditionsFileLabel: TLabel
AnchorSideLeft.Control = GlobalOptionsGroupBox
AnchorSideTop.Control = AdditionsFileEdit
AnchorSideTop.Side = asrCenter
Left = 6
Height = 15
Top = 41
Width = 100
BorderSpacing.Around = 6
Caption = 'AdditionsFileLabel'
ParentColor = False
end
object AdditionsFileEdit: TEdit
AnchorSideLeft.Control = AdditionsFileLabel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = FPCMsgFileEdit
AnchorSideTop.Side = asrBottom
Left = 112
Height = 24
Top = 36
Width = 280
BorderSpacing.Around = 6
TabOrder = 1
Text = 'AdditionsFileEdit'
end
end
end end

View File

@ -62,7 +62,8 @@ type
private private
fAdditions: TMessageHelpAdditions; fAdditions: TMessageHelpAdditions;
FAdditionsChangeStep: integer; FAdditionsChangeStep: integer;
FAdditionsFilename: string; FAdditionsFile: string;
FDefaultAdditionsFile: string;
FFPCTranslationFile: string; FFPCTranslationFile: string;
FDefaultNode: THelpNode; FDefaultNode: THelpNode;
FFoundComment: string; FFoundComment: string;
@ -71,7 +72,7 @@ type
FMsgFileChangeStep: integer; FMsgFileChangeStep: integer;
FMsgFilename: string; FMsgFilename: string;
function GetAdditions(Index: integer): TMessageHelpAddition; function GetAdditions(Index: integer): TMessageHelpAddition;
procedure SetAdditionsFilename(AValue: string); procedure SetAdditionsFile(AValue: string);
procedure SetFPCTranslationFile(const AValue: string); procedure SetFPCTranslationFile(const AValue: string);
procedure SetFoundComment(const AValue: string); procedure SetFoundComment(const AValue: string);
procedure SetLastMessage(const AValue: string); procedure SetLastMessage(const AValue: string);
@ -89,15 +90,20 @@ type
property DefaultNode: THelpNode read FDefaultNode; property DefaultNode: THelpNode read FDefaultNode;
property LastMessage: string read FLastMessage write SetLastMessage; property LastMessage: string read FLastMessage write SetLastMessage;
property FoundComment: string read FFoundComment write SetFoundComment; property FoundComment: string read FFoundComment write SetFoundComment;
// the FPC message file
function GetMsgFile: TFPCMsgFile; function GetMsgFile: TFPCMsgFile;
property MsgFile: TFPCMsgFile read FMsgFile; property MsgFile: TFPCMsgFile read FMsgFile;
property MsgFilename: string read FMsgFilename; property MsgFilename: string read FMsgFilename;
property MsgFileChangeStep: integer read FMsgFileChangeStep; property MsgFileChangeStep: integer read FMsgFileChangeStep;
// additional help for messages (they add an URL to the FPC comments)
function AdditionsCount: integer; function AdditionsCount: integer;
property Additions[Index: integer]: TMessageHelpAddition read GetAdditions; property Additions[Index: integer]: TMessageHelpAddition read GetAdditions;
property AdditionsFilename: string read FAdditionsFilename write SetAdditionsFilename;
property AdditionsChangeStep: integer read FAdditionsChangeStep; property AdditionsChangeStep: integer read FAdditionsChangeStep;
property DefaultAdditionsFile: string read FDefaultAdditionsFile;
published published
property AdditionsFile: string read FAdditionsFile write SetAdditionsFile;
property FPCTranslationFile: string read FFPCTranslationFile property FPCTranslationFile: string read FFPCTranslationFile
write SetFPCTranslationFile; write SetFPCTranslationFile;
end; end;
@ -106,11 +112,16 @@ type
TEditIDEMsgHelpDialog = class(TForm) TEditIDEMsgHelpDialog = class(TForm)
AddButton: TButton; AddButton: TButton;
AdditionsFileEdit: TEdit;
AdditionsFileLabel: TLabel;
ButtonPanel1: TButtonPanel; ButtonPanel1: TButtonPanel;
CurGroupBox: TGroupBox; CurGroupBox: TGroupBox;
CurMsgGroupBox: TGroupBox; CurMsgGroupBox: TGroupBox;
CurMsgMemo: TMemo; CurMsgMemo: TMemo;
DeleteButton: TButton; DeleteButton: TButton;
FPCMsgFileEdit: TEdit;
FPCMsgFileLabel: TLabel;
GlobalOptionsGroupBox: TGroupBox;
NameEdit: TEdit; NameEdit: TEdit;
NameLabel: TLabel; NameLabel: TLabel;
OnlyFPCMsgIDsLabel: TLabel; OnlyFPCMsgIDsLabel: TLabel;
@ -126,12 +137,26 @@ type
public public
end; end;
function ShowMessageHelpEditor: TModalResult;
procedure CreateFPCMessagesHelpDB; procedure CreateFPCMessagesHelpDB;
function AddFPCMessageHelpItem(const Title, URL, RegularExpression: string function AddFPCMessageHelpItem(const Title, URL, RegularExpression: string
): THelpDBIRegExprMessage; ): THelpDBIRegExprMessage;
implementation implementation
function ShowMessageHelpEditor: TModalResult;
var
Editor: TEditIDEMsgHelpDialog;
begin
Editor:=TEditIDEMsgHelpDialog.Create(nil);
try
Result:=Editor.ShowModal;
finally
Editor.Free;
end;
end;
procedure CreateFPCMessagesHelpDB; procedure CreateFPCMessagesHelpDB;
var var
FPCHelp: TFPCMessagesHelpDatabase; FPCHelp: TFPCMessagesHelpDatabase;
@ -207,10 +232,10 @@ begin
Result:=fAdditions[Index]; Result:=fAdditions[Index];
end; end;
procedure TFPCMessagesHelpDatabase.SetAdditionsFilename(AValue: string); procedure TFPCMessagesHelpDatabase.SetAdditionsFile(AValue: string);
begin begin
if FAdditionsFilename=AValue then Exit; if FAdditionsFile=AValue then Exit;
FAdditionsFilename:=AValue; FAdditionsFile:=AValue;
FAdditionsChangeStep:=CTInvalidChangeStamp; FAdditionsChangeStep:=CTInvalidChangeStamp;
end; end;
@ -223,8 +248,10 @@ end;
constructor TFPCMessagesHelpDatabase.Create(TheOwner: TComponent); constructor TFPCMessagesHelpDatabase.Create(TheOwner: TComponent);
begin begin
inherited Create(TheOwner); inherited Create(TheOwner);
FDefaultAdditionsFile:='$(LazarusDir)/docs/additionalmsghelp.xml';
fAdditions:=TMessageHelpAdditions.Create; fAdditions:=TMessageHelpAdditions.Create;
FAdditionsChangeStep:=CTInvalidChangeStamp; FAdditionsChangeStep:=CTInvalidChangeStamp;
FAdditionsFile:=DefaultAdditionsFile;
FMsgFileChangeStep:=CTInvalidChangeStamp; FMsgFileChangeStep:=CTInvalidChangeStamp;
FDefaultNode:=THelpNode.CreateURL(Self,'FPC messages: Appendix', FDefaultNode:=THelpNode.CreateURL(Self,'FPC messages: Appendix',
'http://lazarus-ccr.sourceforge.net/fpcdoc/user/userap3.html#x81-168000C'); 'http://lazarus-ccr.sourceforge.net/fpcdoc/user/userap3.html#x81-168000C');
@ -281,12 +308,14 @@ procedure TFPCMessagesHelpDatabase.Load(Storage: TConfigStorage);
begin begin
inherited Load(Storage); inherited Load(Storage);
FPCTranslationFile:=Storage.GetValue('FPCTranslationFile/Value',''); FPCTranslationFile:=Storage.GetValue('FPCTranslationFile/Value','');
AdditionsFile:=Storage.GetValue('Additions/Filename',DefaultAdditionsFile);
end; end;
procedure TFPCMessagesHelpDatabase.Save(Storage: TConfigStorage); procedure TFPCMessagesHelpDatabase.Save(Storage: TConfigStorage);
begin begin
inherited Save(Storage); inherited Save(Storage);
Storage.SetDeleteValue('FPCTranslationFile/Value',FPCTranslationFile,''); Storage.SetDeleteValue('FPCTranslationFile/Value',FPCTranslationFile,'');
Storage.SetDeleteValue('Additions/Filename',AdditionsFile,DefaultAdditionsFile);
end; end;
function TFPCMessagesHelpDatabase.GetMsgFile: TFPCMsgFile; function TFPCMessagesHelpDatabase.GetMsgFile: TFPCMsgFile;

View File

@ -168,11 +168,14 @@ type
{ TIDEHelpManager } { TIDEHelpManager }
TIDEHelpManager = class(TBaseHelpManager) TIDEHelpManager = class(TBaseHelpManager)
procedure mnuSearchInFPDocFilesClick(Sender: TObject);
// help menu of the IDE menu bar // help menu of the IDE menu bar
procedure mnuHelpAboutLazarusClicked(Sender: TObject); procedure mnuHelpAboutLazarusClicked(Sender: TObject);
procedure mnuHelpOnlineHelpClicked(Sender: TObject); procedure mnuHelpOnlineHelpClicked(Sender: TObject);
procedure mnuHelpReportBugClicked(Sender: TObject); procedure mnuHelpReportBugClicked(Sender: TObject);
// fpdoc
procedure mnuSearchInFPDocFilesClick(Sender: TObject);
// messages
procedure mnuEditMessageHelpClick(Sender: TObject);
private private
FFCLHelpDBPath: THelpBaseURLObject; FFCLHelpDBPath: THelpBaseURLObject;
FMainHelpDB: THelpDatabase; FMainHelpDB: THelpDatabase;
@ -1115,6 +1118,11 @@ begin
ShowFPDocFileSearch; ShowFPDocFileSearch;
end; end;
procedure TIDEHelpManager.mnuEditMessageHelpClick(Sender: TObject);
begin
end;
procedure TIDEHelpManager.mnuHelpAboutLazarusClicked(Sender: TObject); procedure TIDEHelpManager.mnuHelpAboutLazarusClicked(Sender: TObject);
begin begin
ShowAboutForm; ShowAboutForm;
@ -1301,6 +1309,8 @@ begin
{$IFDEF EnableFPDocSearch} {$IFDEF EnableFPDocSearch}
itmSearchInFPDocFiles.OnClick:=@mnuSearchInFPDocFilesClick; itmSearchInFPDocFiles.OnClick:=@mnuSearchInFPDocFilesClick;
{$ENDIF} {$ENDIF}
end; end;
end; end;

View File

@ -284,6 +284,7 @@ resourcestring
lisExpandAll = 'Expand All (*)'; lisExpandAll = 'Expand All (*)';
lisCollapseAll = 'Collapse All (/)'; lisCollapseAll = 'Collapse All (/)';
lisSaveAllMessagesToFile = 'Save All Messages to File'; lisSaveAllMessagesToFile = 'Save All Messages to File';
lisEditHelp = 'Edit help';
lisMenuViewSearchResults = 'Search Results'; lisMenuViewSearchResults = 'Search Results';
lisMenuViewAnchorEditor = 'Anchor Editor'; lisMenuViewAnchorEditor = 'Anchor Editor';
lisMenuViewTabOrder = 'Tab Order'; lisMenuViewTabOrder = 'Tab Order';

View File

@ -93,6 +93,7 @@ type
procedure CopyAllMenuItemClick(Sender: TObject); procedure CopyAllMenuItemClick(Sender: TObject);
procedure CopyAllAndHiddenMenuItemClick(Sender: TObject); procedure CopyAllAndHiddenMenuItemClick(Sender: TObject);
procedure CopyMenuItemClick(Sender: TObject); procedure CopyMenuItemClick(Sender: TObject);
procedure EditHelpMenuItemClick(Sender: TObject);
procedure FormDeactivate(Sender: TObject); procedure FormDeactivate(Sender: TObject);
procedure HelpMenuItemClick(Sender: TObject); procedure HelpMenuItemClick(Sender: TObject);
procedure ClearMenuItemClick(Sender: TObject); procedure ClearMenuItemClick(Sender: TObject);
@ -193,13 +194,14 @@ type
var var
MessagesView: TMessagesView = nil; MessagesView: TMessagesView = nil;
MsgQuickFixIDEMenuSection: TIDEMenuSection; MsgQuickFixMenuSection: TIDEMenuSection;
MsgClearIDEMenuCommand: TIDEMenuCommand; MsgClearMenuItem: TIDEMenuCommand;
MsgCopyIDEMenuCommand: TIDEMenuCommand; MsgCopyMenuItem: TIDEMenuCommand;
MsgCopyAllIDEMenuCommand: TIDEMenuCommand; MsgCopyAllMenuItem: TIDEMenuCommand;
MsgCopyAllAndHiddenIDEMenuCommand: TIDEMenuCommand; MsgCopyAllAndHiddenMenuItem: TIDEMenuCommand;
MsgHelpIDEMenuCommand: TIDEMenuCommand; MsgHelpMenuItem: TIDEMenuCommand;
MsgSaveAllToFileIDEMenuCommand: TIDEMenuCommand; MsgEditHelpMenuItem: TIDEMenuCommand;
MsgSaveAllToFileMenuItem: TIDEMenuCommand;
const const
MessagesMenuRootName = 'Messages'; MessagesMenuRootName = 'Messages';
@ -262,21 +264,16 @@ var
begin begin
MessagesMenuRoot := RegisterIDEMenuRoot(MessagesMenuRootName); MessagesMenuRoot := RegisterIDEMenuRoot(MessagesMenuRootName);
Path := MessagesMenuRoot.Name; Path := MessagesMenuRoot.Name;
MsgQuickFixIDEMenuSection := RegisterIDEMenuSection(Path, 'Quick Fix'); MsgQuickFixMenuSection := RegisterIDEMenuSection(Path, 'Quick Fix');
MsgClearIDEMenuCommand := MsgClearMenuItem := RegisterIDEMenuCommand(Path, 'Clear', lisUIDClear);
RegisterIDEMenuCommand(Path, 'Clear', lisUIDClear); MsgCopyMenuItem := RegisterIDEMenuCommand(Path, 'Copy selected',lisCopySelectedMessagesToClipboard);
MsgCopyIDEMenuCommand := RegisterIDEMenuCommand(Path, 'Copy selected', MsgCopyAllMenuItem := RegisterIDEMenuCommand(Path, 'Copy all',lisCopyAllShownMessagesToClipboard);
lisCopySelectedMessagesToClipboard); MsgCopyAllAndHiddenMenuItem := RegisterIDEMenuCommand(Path,
MsgCopyAllIDEMenuCommand := RegisterIDEMenuCommand(Path, 'Copy all', 'Copy all, including hidden messages',lisCopyAllShownAndHiddenMessagesToClipboard);
lisCopyAllShownMessagesToClipboard); MsgHelpMenuItem := RegisterIDEMenuCommand(Path, 'Help for message',lisPckEditHelp);
MsgCopyAllAndHiddenIDEMenuCommand := RegisterIDEMenuCommand(Path, MsgEditHelpMenuItem := RegisterIDEMenuCommand(Path, 'Edit help for messages',lisEditHelp);
'Copy all, including hidden messages', MsgSaveAllToFileMenuItem :=
lisCopyAllShownAndHiddenMessagesToClipboard); RegisterIDEMenuCommand(Path, 'Copy selected',lisSaveAllMessagesToFile);
MsgHelpIDEMenuCommand := RegisterIDEMenuCommand(Path, 'Help',
lisPckEditHelp);
MsgSaveAllToFileIDEMenuCommand :=
RegisterIDEMenuCommand(Path, 'Copy selected',
lisSaveAllMessagesToFile);
end; end;
function MessageLinesAsText(ListOfTLazMessageLine: TFPList): string; function MessageLinesAsText(ListOfTLazMessageLine: TFPList): string;
@ -343,12 +340,13 @@ begin
MessagesMenuRoot.MenuItem := MainPopupMenu.Items; MessagesMenuRoot.MenuItem := MainPopupMenu.Items;
//MainPopupMenu.Items.WriteDebugReport('TMessagesView.Create '); //MainPopupMenu.Items.WriteDebugReport('TMessagesView.Create ');
MsgHelpIDEMenuCommand.OnClick := @HelpMenuItemClick; MsgHelpMenuItem.OnClick := @HelpMenuItemClick;
MsgClearIDEMenuCommand.OnClick := @ClearMenuItemClick; MsgEditHelpMenuItem.OnClick:=@EditHelpMenuItemClick;
MsgCopyIDEMenuCommand.OnClick := @CopyMenuItemClick; MsgClearMenuItem.OnClick := @ClearMenuItemClick;
MsgCopyAllIDEMenuCommand.OnClick := @CopyAllMenuItemClick; MsgCopyMenuItem.OnClick := @CopyMenuItemClick;
MsgCopyAllAndHiddenIDEMenuCommand.OnClick := @CopyAllAndHiddenMenuItemClick; MsgCopyAllMenuItem.OnClick := @CopyAllMenuItemClick;
MsgSaveAllToFileIDEMenuCommand.OnClick := @SaveAllToFileMenuItemClick; MsgCopyAllAndHiddenMenuItem.OnClick := @CopyAllAndHiddenMenuItemClick;
MsgSaveAllToFileMenuItem.OnClick := @SaveAllToFileMenuItemClick;
FMarklings:=TMessageViewMarklings.Create(Self); FMarklings:=TMessageViewMarklings.Create(Self);
SourceEditorManagerIntf.RegisterMarklingProducer(FMarklings); SourceEditorManagerIntf.RegisterMarklingProducer(FMarklings);
@ -944,6 +942,11 @@ begin
Clipboard.AsText := GetSelectedMessagesAsText; Clipboard.AsText := GetSelectedMessagesAsText;
end; end;
procedure TMessagesView.EditHelpMenuItemClick(Sender: TObject);
begin
// ShowMessageHelpEditor;
end;
procedure TMessagesView.FormDeactivate(Sender: TObject); procedure TMessagesView.FormDeactivate(Sender: TObject);
begin begin
FLastSelectedIndex:=-1; FLastSelectedIndex:=-1;
@ -979,7 +982,7 @@ var
QuickFixItem: TIDEMsgQuickFixItem; QuickFixItem: TIDEMsgQuickFixItem;
Msg: TLazMessageLine; Msg: TLazMessageLine;
begin begin
MsgQuickFixIDEMenuSection.Clear; MsgQuickFixMenuSection.Clear;
Msg:=GetMessageLine; Msg:=GetMessageLine;
FQuickFixItems.Clear; FQuickFixItems.Clear;
if Msg<>nil then begin if Msg<>nil then begin
@ -993,7 +996,7 @@ begin
end; end;
for i:=0 to FQuickFixItems.Count-1 do begin for i:=0 to FQuickFixItems.Count-1 do begin
QuickFixItem:=TIDEMsgQuickFixItem(FQuickFixItems[i]); QuickFixItem:=TIDEMsgQuickFixItem(FQuickFixItems[i]);
RegisterIDEMenuCommand(MsgQuickFixIDEMenuSection, RegisterIDEMenuCommand(MsgQuickFixMenuSection,
QuickFixItem.Name, QuickFixItem.Name,
QuickFixItem.Caption, QuickFixItem.Caption,
@OnQuickFixClick); @OnQuickFixClick);

View File

@ -21,7 +21,7 @@ unit MacroIntf;
interface interface
uses uses
Classes, SysUtils, FileUtil; Classes, SysUtils, LazFileUtils;
type type
{ TIDEMacros - macros for paths and compiler settings } { TIDEMacros - macros for paths and compiler settings }
@ -133,7 +133,7 @@ begin
BaseDir:=BaseDirectory; BaseDir:=BaseDirectory;
if not SubstituteMacros(BaseDir) then exit(false); if not SubstituteMacros(BaseDir) then exit(false);
Result:=SubstituteMacros(SearchPath); Result:=SubstituteMacros(SearchPath);
SearchPath:=FileUtil.CreateAbsoluteSearchPath(SearchPath,BaseDir); SearchPath:=MinimizeSearchPath(LazFileUtils.CreateAbsoluteSearchPath(SearchPath,BaseDir));
end; end;
end. end.

View File

@ -3131,11 +3131,12 @@ var
and (BaseDir<>'') then begin and (BaseDir<>'') then begin
// search in project source directories // search in project source directories
ProjectDirs:=AProject.LazCompilerOptions.OtherUnitFiles+';.'; ProjectDirs:=AProject.LazCompilerOptions.OtherUnitFiles+';.';
if not IDEMacros.CreateAbsoluteSearchPath(ProjectDirs,BaseDir) then exit; if IDEMacros.CreateAbsoluteSearchPath(ProjectDirs,BaseDir) then begin
if FindPathInSearchPath(PChar(SrcDir),length(SrcDir), if FindPathInSearchPath(PChar(SrcDir),length(SrcDir),
PChar(ProjectDirs),length(ProjectDirs))<>nil PChar(ProjectDirs),length(ProjectDirs))<>nil
then then
Add:=true; Add:=true;
end;
end; end;
if Add then if Add then