mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 12:12:47 +02:00
* Display some messages
This commit is contained in:
parent
2729166fd2
commit
3727f6e166
@ -19,7 +19,6 @@ Type
|
|||||||
FCustomStartDir: string;
|
FCustomStartDir: string;
|
||||||
FDirectoriesBeforeFiles: Boolean;
|
FDirectoriesBeforeFiles: Boolean;
|
||||||
FLastOpenedDir: string;
|
FLastOpenedDir: string;
|
||||||
FMatchOnlyFileName: Boolean;
|
|
||||||
FRoot: TFileSystemEntry;
|
FRoot: TFileSystemEntry;
|
||||||
FSearchOptions: TFileSearchOptions;
|
FSearchOptions: TFileSearchOptions;
|
||||||
FStartDir: TStartDir;
|
FStartDir: TStartDir;
|
||||||
@ -45,11 +44,13 @@ Type
|
|||||||
procedure SetFilesInTree(AValue: Boolean);
|
procedure SetFilesInTree(AValue: Boolean);
|
||||||
procedure SetLastOpenedDir(AValue: string);
|
procedure SetLastOpenedDir(AValue: string);
|
||||||
procedure SetRootDir(AValue: TRootDir);
|
procedure SetRootDir(AValue: TRootDir);
|
||||||
|
procedure SetSearchOptions(AValue: TFileSearchOptions);
|
||||||
procedure SetSplitterPos(AValue: integer);
|
procedure SetSplitterPos(AValue: integer);
|
||||||
procedure SetStartDir(AValue: TStartDir);
|
procedure SetStartDir(AValue: TStartDir);
|
||||||
procedure SetSyncCurrentEditor(AValue: Boolean);
|
procedure SetSyncCurrentEditor(AValue: Boolean);
|
||||||
procedure OnFormClose(Sender: TObject; var {%H-}CloseAction: TCloseAction);
|
procedure OnFormClose(Sender: TObject; var {%H-}CloseAction: TCloseAction);
|
||||||
procedure TreeFillDone(Sender: TThread; aTree: TDirectoryEntry);
|
procedure TreeFillDone(Sender: TThread; aTree: TDirectoryEntry);
|
||||||
|
procedure TreeFillError(Sender: TThread; const aError: String);
|
||||||
protected
|
protected
|
||||||
{ Called by file browser window }
|
{ Called by file browser window }
|
||||||
procedure DoOpenFile(Sender: TObject; const AFileName: string); virtual;
|
procedure DoOpenFile(Sender: TObject; const AFileName: string); virtual;
|
||||||
@ -80,16 +81,23 @@ Type
|
|||||||
Property FilesInTree : Boolean Read FFilesInTree Write SetFilesInTree;
|
Property FilesInTree : Boolean Read FFilesInTree Write SetFilesInTree;
|
||||||
Property DirectoriesBeforeFiles : Boolean Read FDirectoriesBeforeFiles Write SetDirectoriesBeforeFiles;
|
Property DirectoriesBeforeFiles : Boolean Read FDirectoriesBeforeFiles Write SetDirectoriesBeforeFiles;
|
||||||
Property ConfigFrame : TAbstractIDEOptionsEditorClass Read FConfigFrame Write FConfigFrame;
|
Property ConfigFrame : TAbstractIDEOptionsEditorClass Read FConfigFrame Write FConfigFrame;
|
||||||
property SearchOptions : TFileSearchOptions Read FSearchOptions Write FSearchOptions;
|
property SearchOptions : TFileSearchOptions Read FSearchOptions Write SetSearchOptions;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses StrUtils, LazConfigStorage;
|
uses Controls, StrUtils, IDEMsgIntf, IDEExternToolIntf, LazConfigStorage;
|
||||||
|
|
||||||
{ TFileBrowserController }
|
{ TFileBrowserController }
|
||||||
|
|
||||||
|
|
||||||
|
procedure TFileBrowserController.TreeFillError(Sender: TThread; const aError : String);
|
||||||
|
|
||||||
|
begin
|
||||||
|
AddIDEMessage(mluError,Format(SErrSearching,[GetResolvedRootDir,aError]),'',0,0,SViewFilebrowser);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TFileBrowserController.TreeFillDone(Sender: TThread; aTree: TDirectoryEntry);
|
procedure TFileBrowserController.TreeFillDone(Sender: TThread; aTree: TDirectoryEntry);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -98,6 +106,7 @@ begin
|
|||||||
FreeAndNil(FRoot);
|
FreeAndNil(FRoot);
|
||||||
FRoot:=aTree;
|
FRoot:=aTree;
|
||||||
CreateFileList(fsoAbsolutePaths in SearchOptions);
|
CreateFileList(fsoAbsolutePaths in SearchOptions);
|
||||||
|
AddIDEMessage(mluProgress,Format(SFilesFound,[FFileList.Count,GetResolvedRootDir]),'',0,0,SViewFilebrowser);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFileBrowserController.AddFileNodes(List : TStrings; aNode : TFileSystemEntry; aDir : String);
|
procedure TFileBrowserController.AddFileNodes(List : TStrings; aNode : TFileSystemEntry; aDir : String);
|
||||||
@ -216,6 +225,13 @@ begin
|
|||||||
FNeedSave:=True;
|
FNeedSave:=True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TFileBrowserController.SetSearchOptions(AValue: TFileSearchOptions);
|
||||||
|
begin
|
||||||
|
if FSearchOptions=AValue then Exit;
|
||||||
|
FSearchOptions:=AValue;
|
||||||
|
FNeedSave:=True;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TFileBrowserController.SetSplitterPos(AValue: integer);
|
procedure TFileBrowserController.SetSplitterPos(AValue: integer);
|
||||||
begin
|
begin
|
||||||
if FSplitterPos=AValue then Exit;
|
if FSplitterPos=AValue then Exit;
|
||||||
@ -270,18 +286,22 @@ end;
|
|||||||
|
|
||||||
procedure TFileBrowserController.IndexRootDir;
|
procedure TFileBrowserController.IndexRootDir;
|
||||||
|
|
||||||
|
var
|
||||||
|
lDir : String;
|
||||||
begin
|
begin
|
||||||
if FillingTree then
|
if FillingTree then
|
||||||
Exit;
|
Exit;
|
||||||
|
lDir:=GetResolvedRootDir;
|
||||||
// Do not recurse, thread handles it, it needs to react to terminate...
|
// Do not recurse, thread handles it, it needs to react to terminate...
|
||||||
FTreeFiller:=TTreeCreatorThread.Create(GetResolvedRootDir,[],@TreeFillDone);
|
FTreeFiller:=TTreeCreatorThread.Create(lDir,[],@TreeFillDone,@TreeFillError);
|
||||||
|
AddIDEMessage(mluVerbose,Format(SSearchingFiles,[lDir]),'',0,0,SViewFilebrowser);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFileBrowserController.FindFiles(aPattern: String; aList: TStrings; aMatchOnlyFileName: boolean; aMask: TMaskList
|
function TFileBrowserController.FindFiles(aPattern: String; aList: TStrings; aMatchOnlyFileName: boolean; aMask: TMaskList
|
||||||
): Integer;
|
): Integer;
|
||||||
|
|
||||||
var
|
var
|
||||||
s,fn,ptrn : String;
|
s,ptrn : String;
|
||||||
i,ps : integer;
|
i,ps : integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -387,6 +407,7 @@ var
|
|||||||
aPath : String;
|
aPath : String;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Result:=mrOK;
|
||||||
if Assigned(FileBrowserForm) then
|
if Assigned(FileBrowserForm) then
|
||||||
begin
|
begin
|
||||||
APath:=ExcludeTrailingPathDelimiter(ExtractFilePath(aProject.ProjectInfoFile));
|
APath:=ExcludeTrailingPathDelimiter(ExtractFilePath(aProject.ProjectInfoFile));
|
||||||
|
Loading…
Reference in New Issue
Block a user