From 5ca2a3b0f7bc3d75c35110d95124084ec9b74347 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Tue, 22 Jul 2014 05:48:30 -0400 Subject: [PATCH] Feature request: Change status bar search to search in all (applicable) tabs Opens up to last tab selected now, but puts query text and triggers searches in all tabs. Singu TODO: Have it search marketplace? --- indra/newview/llfloaterdirectory.cpp | 17 +++++++++++++++++ indra/newview/llfloaterdirectory.h | 2 ++ indra/newview/llfloatersearch.cpp | 4 +++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloaterdirectory.cpp b/indra/newview/llfloaterdirectory.cpp index a0244eb18..3bd2932d9 100644 --- a/indra/newview/llfloaterdirectory.cpp +++ b/indra/newview/llfloaterdirectory.cpp @@ -439,6 +439,17 @@ void LLFloaterDirectory::requestClassifieds() } } +void LLFloaterDirectory::searchInAll(const std::string& search_text) +{ + LLPanelDirFindAllInterface::search(sInstance->mFindAllPanel, search_text); + performQueryOn2("classified_panel", search_text); + performQueryOn2("events_panel", search_text); + performQueryOn2("groups_panel", search_text); + performQueryOn2("people_panel", search_text); + performQueryOn2("places_panel", search_text); + sInstance->open(); +} + void LLFloaterDirectory::showFindAll(const std::string& search_text) { showPanel("find_all_panel"); @@ -524,6 +535,12 @@ void LLFloaterDirectory::showPlaces(const std::string& search_text) void LLFloaterDirectory::performQueryOn(const std::string& name, const std::string& search_text) { showPanel(name); + performQueryOn2(name, search_text); +} + +//static +void LLFloaterDirectory::performQueryOn2(const std::string& name, const std::string& search_text) +{ if (search_text.empty()) return; // We're done here. LLPanelDirBrowser* panel = sInstance->getChild(name); panel->getChild("name")->setValue(search_text); diff --git a/indra/newview/llfloaterdirectory.h b/indra/newview/llfloaterdirectory.h index a1bce3efc..0f5f1b501 100644 --- a/indra/newview/llfloaterdirectory.h +++ b/indra/newview/llfloaterdirectory.h @@ -71,6 +71,7 @@ public: // Outside UI widgets can spawn this floater with various tabs // selected. + static void searchInAll(const std::string& search_text); static void showFindAll(const std::string& search_text); static void showClassified(const LLUUID& classified_id); static void showClassified(const std::string& search_text = ""); @@ -92,6 +93,7 @@ public: private: static void performQueryOn(const std::string& name, const std::string& search_text); + static void performQueryOn2(const std::string& name, const std::string& search_text); static void showPanel(const std::string& tabname); /*virtual*/ void onClose(bool app_quitting); void focusCurrentPanel(); diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index b9cf179d2..5d51959d3 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -160,7 +160,9 @@ void LLFloaterSearch::showInstance(const SearchQuery& search, bool web) else { const std::string category(search.category()); - if (category.empty() || category == "all") + if (category.empty()) + LLFloaterDirectory::searchInAll(search.query); + else if (category == "all") LLFloaterDirectory::showFindAll(search.query); else if (category == "people") LLFloaterDirectory::showPeople(search.query);