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?
This commit is contained in:
Inusaito Sayori
2014-07-22 05:48:30 -04:00
parent 88794d0288
commit 5ca2a3b0f7
3 changed files with 22 additions and 1 deletions

View File

@@ -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<LLPanelDirBrowser>(name);
panel->getChild<LLUICtrl>("name")->setValue(search_text);

View File

@@ -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();

View File

@@ -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);