From 4abb983e8d05dbbe356db4c7ad68699782a74962 Mon Sep 17 00:00:00 2001 From: Rejean Loyer Date: Wed, 12 Jun 2013 11:02:12 -0400 Subject: [PATCH] ide: FindInFilesDialog: add checkboxes similar to 'include subdirectories' for in/ex-cluding 'obj' dirs and '.git' dirs. --- ide/src/dialogs/FindInFilesDialog.ec | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/ide/src/dialogs/FindInFilesDialog.ec b/ide/src/dialogs/FindInFilesDialog.ec index 1191717..ef5c900 100644 --- a/ide/src/dialogs/FindInFilesDialog.ec +++ b/ide/src/dialogs/FindInFilesDialog.ec @@ -12,7 +12,7 @@ class FindInFilesDialog : Window maxClientSize = { 640, 208 }; hasClose = true; tabCycle = true; - size = { 440, 208 }; + size = { 640, 208 }; autoCreate = false; public: @@ -246,6 +246,7 @@ private: findWhere.disabled = !inDir; findWherePrjNode.visible = inPrj; subDirs.disabled = inWrk; + objDirs.disabled = gitDirs.disabled = !inDir; llfindWhere.size = { llfindWhere.size.w, llfindWhere.size.h }; if(row) @@ -332,6 +333,14 @@ private: { llsubDirs, this, $"Include Subdirectories", altU, isCheckbox = true, checked = true; }; + Button objDirs + { + llsubDirs, this, $"Include 'obj' directories", altO, isCheckbox = true, checked = false; + }; + Button gitDirs + { + llsubDirs, this, $"Include '.git' directories", altG, isCheckbox = true, checked = false; + }; Label lfilter { llfilter, this, size.w = 72, labeledWindow = filterDrop }; DropBox filterDrop @@ -512,6 +521,8 @@ private: searchThread.project = null; searchThread.projectNode = null; searchThread.subDirs = subDirs.checked; + searchThread.objDirs = objDirs.checked; + searchThread.gitDirs = gitDirs.checked; if(findIn.currentRow == inDirectoryRow) { @@ -607,7 +618,7 @@ static define stackSize = 1024; class SearchThread : Thread { public: - bool active, subDirs/*, nameMatchCase, nameWholeWord*/, contentMatchCase, contentWholeWord; + bool active, subDirs, objDirs, gitDirs/*, nameMatchCase, nameWholeWord*/, contentMatchCase, contentWholeWord; char dir[MAX_DIRECTORY], contentCriteria[1024], contentReplace[1024], nameCriteria[1024]; FileFilter filter; FindInFilesDialog findDialog; @@ -786,7 +797,9 @@ private: app.Unlock(); } - if(subDirs && stack[frame].fileList.stats.attribs.isDirectory && strcmp(stack[frame].fileList.name, ".git")) + if(subDirs && stack[frame].fileList.stats.attribs.isDirectory && + (objDirs || strcmp(stack[frame].fileList.name, "obj")) && + (gitDirs || strcmp(stack[frame].fileList.name, ".git"))) { int lastFrame = frame; /*double thisTime = GetTime(); -- 1.8.3.1