On 2016-01-12 17:17, Martin Schreiber wrote:
> git master dde49c7b0839928697eae55a642f8c959392b297 has a 'Search in project 
> dir' option.

Many thanks Martin, and that function works as expected, but still
doesn't solve my initial problem fully. As far as I understand "In
Project Dir" takes the path where the .prj file is located. But
sometimes I have source code laid out in a slight different directory
structure. Here is a simple example:


   project1/
      |
      +- Common/
      |   +- ...many common units...
      |
      +- Server/
      |   |
      |   +- project_server.prj
      |   +- ...many more files...
      |
      +- GUI/
      |   +- project_gui.prj
      |   +- ...many more files...
      |
      +- UnitTests/
          +- project_tests.prj
          +- ...many more files...

So if I was working in the GUI project, the current behaviour would only
search the GUI directory. But I might want to search "Common", or even
all project1 related directories.

My idea was that the Find In Files dialog would inject the initial path
of the .prj file in the Directory edit widget, but then I can click the
"..." button and fine tune the path if needed.

Attached is a patch that achieves this. If you select "In Project Dir"
and then "In Directory" the dir.value gets assigned the path of the .prj
file - I can then tweak it via the "..." button.

Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
>From a93a800c4d8dcb15590d52fb02ba3d63fe13f29c Mon Sep 17 00:00:00 2001
From: Graeme Geldenhuys <grae...@gmail.com>
Date: Wed, 13 Jan 2016 10:37:09 +0000
Subject: [PATCH] Find In Files: Click "in project dir" then "in directory"
 assigns project path.

This then allows you to tweak the project path further if needed before
a search.
---
 apps/ide/findinfiledialogform.pas | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/apps/ide/findinfiledialogform.pas b/apps/ide/findinfiledialogform.pas
index 6d8ecd4..d1811e0 100644
--- a/apps/ide/findinfiledialogform.pas
+++ b/apps/ide/findinfiledialogform.pas
@@ -65,7 +65,7 @@ function findinfiledialogexecute(var info: findinfileinfoty;
 
 implementation
 uses
- msebits,findinfiledialogform_mfm,projectoptionsform;
+ msebits,findinfiledialogform_mfm,projectoptionsform,main,msefileutils;
 
 function findinfiledialogexecute(var info: findinfileinfoty;
                                          const useinfo: boolean): boolean;
@@ -222,6 +222,8 @@ procedure tfindinfiledialogfo.dirsetval(const sender: TObject;
 begin
  if avalue then begin
   inopenfiles.value:= false;
+  if inprojectdir.value then
+    dir.value := filedir(mainfo.projectname);
  end;
 end;
 
-- 
2.6.4

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to