IDE: if the search directory for find in files does not exist, give a warning and don't start the search (issue #12338)

git-svn-id: trunk@19660 -
This commit is contained in:
vincents 2009-04-28 09:01:26 +00:00
parent 30adabcb7b
commit ec34f43aae
2 changed files with 16 additions and 1 deletions

View File

@ -50,6 +50,7 @@ type
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure HelpButtonClick(Sender: TObject);
procedure OKButtonClick(Sender : TObject);
procedure ReplaceCheckBoxChange(Sender: TObject);
procedure WhereRadioGroupClick(Sender: TObject);
private
@ -144,6 +145,7 @@ begin
IncludeSubDirsCheckBox.Caption := lisFindFileIncludeSubDirectories;
ButtonPanel1.OkButton.Caption := lisLazBuildOk;
ButtonPanel1.OKButton.OnClick:= @OKButtonClick;
ButtonPanel1.CancelButton.Caption := dlgCancel;
ButtonPanel1.HelpButton.OnClick:=@HelpButtonClick;
@ -160,6 +162,18 @@ begin
ShowContextHelpForIDE(Self);
end;
procedure TLazFindInFilesDialog.OKButtonClick(Sender : TObject);
begin
if (WhereRadioGroup.ItemIndex=2) and
(not DirectoryExistsUTF8(DirectoryComboBox.Text)) then
begin
MessageDlg(lisEnvOptDlgDirectoryNotFound,
Format(dlgSeachDirectoryNotFound,[DirectoryComboBox.Text]),
mtWarning, [mbOk],0);
ModalResult:=mrNone;
end
end;
procedure TLazFindInFilesDialog.ReplaceCheckBoxChange(Sender: TObject);
begin
UpdateReplaceCheck;

View File

@ -874,10 +874,11 @@ resourcestring
// Search dialog
dlgSearchCaption = 'Searching...';
dlgSearchAbort = 'Search terminated by user.';
dlgSeachDirectoryNotFound = 'Search directory "%s" not found.';
lissMatches = 'Matches';
lissSearching = 'Searching';
lissSearchText = 'Search text';
dlgDesktop = 'Desktop';
dlgWindow = 'Window';
dlgFrmEditor = 'Form Editor';