From: Rejean Loyer Date: Fri, 16 Sep 2011 16:49:09 +0000 (-0400) Subject: explorer: started using the new FileSystemSearch class. this will search for .txt... X-Git-Url: http://ecere.com/cgi-bin/gitweb.cgi?p=ede;a=commitdiff_plain;h=225729869d1c8dd55e2fd80b48720840ededb0d2 explorer: started using the new FileSystemSearch class. this will search for .txt files. --- diff --git a/explorer/src/ExplorerWindow.ec b/explorer/src/ExplorerWindow.ec index fa7bf4c..b8cb03d 100644 --- a/explorer/src/ExplorerWindow.ec +++ b/explorer/src/ExplorerWindow.ec @@ -169,15 +169,22 @@ class ExplorerWindow : Window //search.visible = button.checked; tree.visible = false; //!button.checked; split.visible = false; //!button.checked; - if(false/*button.checked*/) + if(button.checked) { - split.rightPane = view; - view.anchor = { top = 0, bottom = 0, right = 0 }; + /*split.rightPane = view; + view.anchor = { top = 0, bottom = 0, right = 0 };*/ + split.rightPane = null; + view.anchor = { left = 0, top = 0, bottom = 0, right = 0 }; + + SearchStart(); } else { split.rightPane = null; view.anchor = { left = 0, top = 0, bottom = 0, right = 0 }; + + SearchStop(); + view.path = addressBar.path; } panels.size = { panels.size.w, panels.size.h }; // TOFIX : another Stacker fix needed break; @@ -382,6 +389,66 @@ class ExplorerWindow : Window } }; + FileSystemSearch searchThread + { + owner = this, fsb = view/*, searchPanel = this*/; + + bool Window::NotifyUpdateSearchLocation(FileSystemSearch search, char * location) + { + char text[2048]; + sprintf(text, "Search Results (Searching %s)", location); + PrintLn(text); //view.results.text = text; + return true; + } + }; + + void SearchStart() + { + char text[2048]; + + searchThread.active = true; + + searchThread.optionSubdirs = true; //options.subdirs.checked; + searchThread.optionTree = view.treeBranches; //(options.subdirs.checked && options.tree.checked); + searchThread.optionBrowser = false; //(options.subdirs.checked && options.browser.checked); + searchThread.optionNameMatchCase = false; //findName.optionMatchCase.checked; + searchThread.optionNameMatchWord = false; //findName.optionMatchWord.checked; + searchThread.optionContentMatchCase = false; //findTextContent.optionMatchCase.checked; + searchThread.optionContentMatchWord = false; //findTextContent.optionMatchWord.checked; + + strcpy(searchThread.location, view.path/*location.GetText()*/); + strcpy(searchThread.nameSearch, ".txt"/*findName.GetText()*/); + strcpy(searchThread.contentSearch, ""/*findTextContent.GetText()*/); + + //actions.startStop.text = "Stop Search"; + //actions.clear.disabled = false; + //view.results.Clear(); + //view.results.hasHeader = !searchThread.optionTree; + //view.results.treeBranches = searchThread.optionTree; + //view.browser.Clear(); + //ToggleBrowserDisplay(searchThread.optionBrowser); + + //view.browser.text = "Browser"; + //sprintf(text, "Search Results (Searching %s)", location.GetText()); + PrintLn("Search Results (Searching ", view.path, ")"); + //view.results.text = text; + + searchThread.Create(); + } + + bool SearchStop() + { + if(searchThread.active) + { + searchThread.terminate = true; + app.Unlock(); + searchThread.Wait(); + app.Lock(); + return true; + } + return false; + } + /*ExplorerSearch search { deep, this;