All search on SL looks awful, let's just use the Web tab instead now.

This commit is contained in:
Lirusaito
2016-02-06 10:52:56 -05:00
parent 710b75b3a9
commit 0e349736b7
12 changed files with 119 additions and 125 deletions

View File

@@ -204,7 +204,6 @@ LLFloaterDirectory::LLFloaterDirectory(const std::string& name)
{
sInstance = this;
mFindAllPanel = NULL;
mClassifiedPanel = NULL;
mEventsPanel = NULL;
mLandPanel = NULL;
@@ -228,7 +227,6 @@ LLFloaterDirectory::LLFloaterDirectory(const std::string& name)
factory_map["people_panel"] = LLCallbackMap(createPeople, this);
factory_map["groups_panel"] = LLCallbackMap(createGroups, this);
factory_map[market_panel] = LLCallbackMap(LLPanelDirMarket::create, this);
factory_map["find_all_panel"] = LLCallbackMap(createFindAll, this);
factory_map["showcase_panel"] = LLCallbackMap(createShowcase, this);
if (secondlife)
{
@@ -236,6 +234,7 @@ LLFloaterDirectory::LLFloaterDirectory(const std::string& name)
}
else
{
factory_map["find_all_panel"] = LLCallbackMap(createFindAll, this);
factory_map["find_all_old_panel"] = LLCallbackMap(createFindAllOld, this);
}
@@ -260,7 +259,9 @@ LLFloaterDirectory::LLFloaterDirectory(const std::string& name)
LLTabContainer* container = getChild<LLTabContainer>("Directory Tabs");
if (secondlife)
{
container->removeTabPanel(getChild<LLPanel>("find_all_old_panel")); // Not used
// Remove unused tabs
container->removeTabPanel(getChild<LLPanel>("find_all_panel"));
container->removeTabPanel(getChild<LLPanel>("find_all_old_panel"));
}
else
{
@@ -305,9 +306,7 @@ LLFloaterDirectory::~LLFloaterDirectory()
// static
void *LLFloaterDirectory::createFindAll(void* userdata)
{
LLFloaterDirectory *self = (LLFloaterDirectory*)userdata;
self->mFindAllPanel = LLPanelDirFindAllInterface::create(self);
return self->mFindAllPanel;
return LLPanelDirFindAllInterface::create(static_cast<LLFloaterDirectory*>(userdata));
}
// static
@@ -452,24 +451,43 @@ void LLFloaterDirectory::requestClassifieds()
}
}
void LLFloaterDirectory::searchInAll(const std::string& search_text)
void LLFloaterDirectory::search(const LLFloaterSearch::SearchQuery& search)
{
start();
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);
const std::string category(search.category());
const std::string search_text(search.query);
if (category.empty())
{
LLPanelDirFindAllInterface::search(sInstance, search);
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);
}
else if (category == "all")
LLPanelDirFindAllInterface::search(sInstance, search, true);
else if (category == "people")
showPeople(search.query);
else if (category == "places")
showPlaces(search.query);
else if (category == "events")
showEvents(search.query);
else if (category == "groups")
showGroups(search.query);
/* Singu TODO: Wiki tab in secondlife legacy search floater?
else if (category == "wiki")
LLFloaterDirectory::showWiki(search.query);*/
else if (category == "destinations")
showDestinations();
else if (category == "classifieds")
showClassified(search.query);
else if (gHippoGridManager->getConnectedGrid()->isSecondLife())
LLPanelDirFindAllInterface::search(sInstance, search, true);
else
LLNotificationsUtil::add("UnsupportedCommandSLURL"); // Singu Note: Perhaps we should use a special notification here?
}
void LLFloaterDirectory::showFindAll(const std::string& search_text)
{
showPanel(LFSimFeatureHandler::instance().searchURL().empty() ? "find_all_old_panel" : "find_all_panel");
LLPanelDirFindAllInterface::search(sInstance->mFindAllPanel, search_text);
}
void LLFloaterDirectory::showClassified(const LLUUID& classified_id)
{
showPanel("classified_panel");
@@ -598,7 +616,7 @@ void LLFloaterDirectory::start()
void LLFloaterDirectory::showPanel(const std::string& tabname)
{
start();
sInstance->childShowTab("Directory Tabs", tabname);
sInstance->findChild<LLTabContainer>("Directory Tabs")->selectTabByName(tabname);
sInstance->focusCurrentPanel();
}
@@ -616,7 +634,7 @@ void LLFloaterDirectory::toggleFind(void*)
|| (inst.destinationGuideURL().empty() && panel == "showcase_panel"))
panel = "find_all_old_panel";
}
else if (panel == "find_all_old_panel") panel = "find_all_panel";
else if (panel == "find_all_panel" || panel == "find_all_old_panel") panel = "web_panel";
showPanel(panel);

View File

@@ -33,7 +33,7 @@
#ifndef LL_LLFLOATERDIRECTORY_H
#define LL_LLFLOATERDIRECTORY_H
#include "llfloater.h"
#include "llfloatersearch.h"
#include "lltabcontainer.h"
class LLDirectoryCore;
@@ -71,8 +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 search(const LLFloaterSearch::SearchQuery& search);
static void showClassified(const LLUUID& classified_id);
static void showClassified(const std::string& search_text = "");
static void showEvents(S32 event_id);
@@ -102,7 +101,6 @@ private:
private:
// Some special "showByID" functions use these cached pointers.
// They could be replaced by getPanelByName(), perhaps. JC
LLPanelDirFindAll* mFindAllPanel;
LLPanelDirClassified* mClassifiedPanel;
LLPanelDirEvents* mEventsPanel;
LLPanelDirLand* mLandPanel;

View File

@@ -113,20 +113,8 @@ LLFloaterSearch::_Params::_Params()
}
LLFloaterSearch::LLFloaterSearch(const Params& key) :
LLFloaterWebContent(key),
mSearchGodLevel(0)
LLFloaterWebContent(key)
{
// declare a map that transforms a category name into
// the URL suffix that is used to search that category
mCategoryPaths = LLSD::emptyMap();
mCategoryPaths["all"] = "search";
mCategoryPaths["people"] = "search/people";
mCategoryPaths["places"] = "search/places";
mCategoryPaths["events"] = "search/events";
mCategoryPaths["groups"] = "search/groups";
mCategoryPaths["wiki"] = "search/wiki";
mCategoryPaths["destinations"] = "destinations";
mCategoryPaths["classifieds"] = "classifieds";
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_web_content.xml");
}
@@ -143,8 +131,8 @@ BOOL LLFloaterSearch::postBuild()
getChildView("popexternal")->setEnabled(false);
setRectControl("FloaterSearchRect");
applyRectControl();
search(SearchQuery());
gSavedSettings.getControl("SearchURL")->getSignal()->connect(boost::bind(&LLFloaterSearch::search, this, SearchQuery()));
search(SearchQuery(), mWebBrowser);
gSavedSettings.getControl("SearchURL")->getSignal()->connect(boost::bind(LLFloaterSearch::search, SearchQuery(), mWebBrowser));
return TRUE;
}
@@ -156,32 +144,11 @@ void LLFloaterSearch::showInstance(const SearchQuery& search, bool web)
{
LLFloaterSearch* floater = getInstance();
floater->open(); // May not be open
floater->search(search);
floater->search(search, floater->mWebBrowser);
}
else
{
const std::string category(search.category());
if (category.empty())
LLFloaterDirectory::searchInAll(search.query);
else if (category == "all")
LLFloaterDirectory::showFindAll(search.query);
else if (category == "people")
LLFloaterDirectory::showPeople(search.query);
else if (category == "places")
LLFloaterDirectory::showPlaces(search.query);
else if (category == "events")
LLFloaterDirectory::showEvents(search.query);
else if (category == "groups")
LLFloaterDirectory::showGroups(search.query);
/* Singu TODO: Wiki tab in secondlife legacy search floater?
else if (category == "wiki")
LLFloaterDirectory::showWiki(search.query);*/
else if (category == "destinations")
LLFloaterDirectory::showDestinations();
else if (category == "classifieds")
LLFloaterDirectory::showClassified(search.query);
else
LLNotificationsUtil::add("UnsupportedCommandSLURL"); // Singu Note: Perhaps we should use a special notification here?
LLFloaterDirectory::search(search);
}
}
@@ -192,7 +159,7 @@ void LLFloaterSearch::showInstance(const SearchQuery& search, bool web)
p.allow_address_entry = false;
LLFloaterWebContent::onOpen(p);
search(p.search);
search(p.search, mWebBrowser);
}*/
void LLFloaterSearch::onClose(bool app_quitting)
@@ -208,31 +175,30 @@ void LLFloaterSearch::onClose(bool app_quitting)
destroy();
}
void LLFloaterSearch::godLevelChanged(U8 godlevel)
{
// search results can change based upon god level - if the user
// changes god level, then give them a warning (we don't refresh
// the search as this might undo any page navigation or
// AJAX-driven changes since the last search).
//FIXME: set status bar text
//getChildView("refresh_search")->setVisible( (godlevel != mSearchGodLevel));
}
void LLFloaterSearch::search(const SearchQuery &p)
// static
void LLFloaterSearch::search(const SearchQuery &p, LLMediaCtrl* mWebBrowser)
{
if (! mWebBrowser || !p.validateBlock())
{
return;
}
// reset the god level warning as we're sending the latest state
//getChildView("refresh_search")->setVisible(FALSE);
mSearchGodLevel = gAgent.getGodLevel();
// work out the subdir to use based on the requested category
LLSD subs;
// declare a map that transforms a category name into
// the URL suffix that is used to search that category
static LLSD mCategoryPaths = LLSD::emptyMap();
if (mCategoryPaths.size() == 0)
{
mCategoryPaths["all"] = "search";
mCategoryPaths["people"] = "search/people";
mCategoryPaths["places"] = "search/places";
mCategoryPaths["events"] = "search/events";
mCategoryPaths["groups"] = "search/groups";
mCategoryPaths["wiki"] = "search/wiki";
mCategoryPaths["destinations"] = "destinations";
mCategoryPaths["classifieds"] = "classifieds";
}
if (mCategoryPaths.has(p.category))
{
subs["CATEGORY"] = mCategoryPaths[p.category].asString();

View File

@@ -79,18 +79,10 @@ public:
/// - "id": specifies the text phrase to search for
/// - "category": one of "all" (default), "people", "places",
/// "events", "groups", "wiki", "destinations", "classifieds"
void search(const SearchQuery &query);
/// changing godmode can affect the search results that are
/// returned by the search website - use this method to tell the
/// search floater that the user has changed god level.
void godLevelChanged(U8 godlevel);
static void search(const SearchQuery& query, LLMediaCtrl* mWebBrowser);
private:
/*virtual*/ BOOL postBuild();
LLSD mCategoryPaths;
U8 mSearchGodLevel;
};
#endif // LL_LLFLOATERSEARCH_H

View File

@@ -598,6 +598,7 @@ void LLPanelDirFind::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent even
// LLPanelDirFindAllInterface
//---------------------------------------------------------------------------
static LLPanelDirFindAll* sFindAll = NULL;
// static
LLPanelDirFindAll* LLPanelDirFindAllInterface::create(LLFloaterDirectory* floater)
{
@@ -606,12 +607,29 @@ LLPanelDirFindAll* LLPanelDirFindAllInterface::create(LLFloaterDirectory* floate
static LLPanelDirFindAllOld* sFindAllOld = NULL;
// static
void LLPanelDirFindAllInterface::search(LLPanelDirFindAll* panel,
const std::string& search_text)
void LLPanelDirFindAllInterface::search(LLFloaterDirectory* inst,
const LLFloaterSearch::SearchQuery& search, bool show)
{
bool secondlife(gHippoGridManager->getConnectedGrid()->isSecondLife());
if (secondlife || !getSearchUrl().empty()) panel->search(search_text);
if (!secondlife && sFindAllOld) sFindAllOld->search(search_text);
LLPanelDirFind* find_panel(secondlife ? inst->findChild<LLPanelDirFind>("web_panel") : sFindAll);
LLPanel* panel(find_panel);
if (secondlife)
LLFloaterSearch::search(search, find_panel->mWebBrowser);
else
{
bool has_url(!getSearchUrl().empty());
if (has_url) find_panel->search(search.query);
if (sFindAllOld)
{
sFindAllOld->search(search.query);
if (!has_url) panel = sFindAllOld;
}
}
if (show && panel)
{
inst->findChild<LLTabContainer>("Directory Tabs")->selectTabPanel(panel);
panel->setFocus(true);
}
}
// static

View File

@@ -34,10 +34,8 @@
#define LL_LLPANELDIRFIND_H
#include "llpaneldirbrowser.h"
#include "llmediactrl.h"
#include "llfloatersearch.h"
class LLUICtrl;
class LLLineEditor;
class LLPanelDirFindAll;
class LLFloaterDirectory;
@@ -76,6 +74,7 @@ private:
/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
protected:
friend class LLPanelDirFindAllInterface;
LLMediaCtrl* mWebBrowser;
std::string mBrowserName;
};
@@ -84,7 +83,7 @@ class LLPanelDirFindAllInterface
{
public:
static LLPanelDirFindAll* create(LLFloaterDirectory* floater);
static void search(LLPanelDirFindAll* panel, const std::string& search_text);
static void search(LLFloaterDirectory* inst, const LLFloaterSearch::SearchQuery& search, bool show = false);
static void focus(LLPanelDirFindAll* panel);
};

View File

@@ -54,6 +54,12 @@
<string name="done_text">Fertig</string>
<string name="redirect_404_url">http://secondlife.com/app/search/notfound.html</string>
<string name="default_search_page">"http://secondlife.com/app/search/index.php?"</string>
</panel>
<panel label="Alle" name="web_panel">
<button label="Öffne Web Search Dialog" name="web_search_floater_btn"/>
<web_browser name="web_search_browser" trusted_content="true"/>
<string name="loading_text">Wird geladen...</string>
<string name="done_text">Fertig</string>
</panel>
<panel label="Anzeigen" name="classified_panel">
<string name="searching_text">Suchen...</string>
@@ -282,12 +288,6 @@ Um direkt zu kaufen, klicken Sie auf dem betreffenden Land in der Titelleiste au
<button tool_tip="Zurücksetzen" name="reset_btn"/>
<web_browser name="market_browser" trusted_content="true"/>
<string name="loading_text">Wird geladen...</string>
<string name="done_text">Fertig</string>
</panel>
<panel label="Web" name="web_panel">
<button label="Öffne Web Search Dialog" name="web_search_floater_btn"/>
<web_browser name="web_search_browser" trusted_content="true"/>
<string name="loading_text">Wird geladen...</string>
<string name="done_text">Fertig</string>
</panel>

View File

@@ -145,6 +145,20 @@
http://secondlife.com/app/search/notfound.html
</string>
<string name="default_search_page">"http://secondlife.com/app/search/index.php?"</string>
</panel>
<panel bottom="-549" follows="all" height="533" label="All" left="1" mouse_opaque="false" name="web_panel" width="778">
<button bottom="-30" follows="top|left" height="25" label="" left="10" name="back_btn" width="25" image_overlay="go-previous.png"/>
<button bottom_delta="0" follows="top|left" height="25" label="" left_delta="27" name="forward_btn" width="25" image_overlay="go-next.png" />
<button bottom_delta="0" follows="top|left" height="25" label="" left_delta="27" name="reload_btn" width="25" image_overlay="go-reload.png"/>
<button bottom_delta="0" follows="top|left" height="25" left_delta="27" width="200" label="Open Web Search Floater" name="web_search_floater_btn">
<button.commit_callback function="Search.WebFloater"/>
</button>
<web_browser name="web_search_browser" start_url="http://search.secondlife.com/" trusted_content="true" bottom="25" follows="all" left="10" right="-10" top="-40"/>
<text bottom="5" follows="bottom|left" left="10" height="16" name="status_text"/>
<string name="loading_text">Loading...</string>
<string name="done_text">Done</string>
<string name="redirect_404_url">[APP_SITE]/404</string>
<string name="default_search_page">http://search.secondlife.com/</string>
</panel>
<panel border="true" bottom="-549" follows="left|top|right|bottom" height="533"
label="Classifieds" left="1" left_delta="68" mouse_opaque="false"
@@ -756,20 +770,6 @@ To buy direct, visit the land and click on the place name in the title bar.
<string name="done_text">Done</string>
<string name="redirect_404_url">[APP_SITE]/404</string>
<string name="default_search_page">https://marketplace.secondlife.com/</string>
</panel>
<panel bottom="-549" follows="all" height="533" label="Web" left="1" mouse_opaque="false" name="web_panel" width="778">
<button bottom="-30" follows="top|left" height="25" label="" left="10" name="back_btn" width="25" image_overlay="go-previous.png"/>
<button bottom_delta="0" follows="top|left" height="25" label="" left_delta="27" name="forward_btn" width="25" image_overlay="go-next.png" />
<button bottom_delta="0" follows="top|left" height="25" label="" left_delta="27" name="reload_btn" width="25" image_overlay="go-reload.png"/>
<button bottom_delta="0" follows="top|left" height="25" left_delta="27" width="200" label="Open Web Search Floater" name="web_search_floater_btn">
<button.commit_callback function="Search.WebFloater"/>
</button>
<web_browser name="web_search_browser" start_url="http://search.secondlife.com/" trusted_content="true" bottom="25" follows="all" left="10" right="-10" top="-40"/>
<text bottom="5" follows="bottom|left" left="10" height="16" name="status_text"/>
<string name="loading_text">Loading...</string>
<string name="done_text">Done</string>
<string name="redirect_404_url">[APP_SITE]/404</string>
<string name="default_search_page">http://search.secondlife.com/</string>
</panel>
</tab_container>
<panel bottom="-560" follows="right|top" height="470" left="340"

View File

@@ -86,6 +86,12 @@
</string>
</panel>
<!-- ======================== -->
<panel label="Todos" name="web_panel">
<button left_delta="27" width="200" label="Abrir Búsqueda en Navegador Web" name="web_search_floater_btn"/>
<string name="loading_text">Cargando...</string>
<string name="done_text">Hecho</string>
</panel>
<!-- ======================== -->
<panel label="Clasificados" name="classified_panel">
<string name="searching_text">
Buscando...
@@ -472,12 +478,6 @@
<string name="redirect_404_url">[APP_SITE]/404</string>
<string name="default_search_page">https://marketplace.secondlife.com/?lang=es-ES</string>
</panel>
<!-- ======================== -->
<panel label="Web" name="web_panel">
<button left_delta="27" width="200" label="Abrir Búsqueda en Navegador Web" name="web_search_floater_btn"/>
<string name="loading_text">Cargando...</string>
<string name="done_text">Hecho</string>
</panel>
</tab_container>
<panel name="classified_details_panel"/>
<panel name="Panel Avatar"/>

View File

@@ -50,6 +50,7 @@
http://secondlife.com/app/search/index.php?
</string>
</panel>
<panel label="Tout" name="web_panel"/>
<panel label="Petites annonces" name="classified_panel">
<string name="searching_text">
Recherche en cours...

View File

@@ -52,6 +52,7 @@
&quot;http://secondlife.com/app/search/index.php?&quot;
</string>
</panel>
<panel label="Tutto" name="web_panel"/>
<panel label="Inserzioni" name="classified_panel">
<string name="searching_text">
Ricerca in corso...

View File

@@ -44,6 +44,7 @@
Feito
</string>
</panel>
<panel label="Todos" name="web_panel"/>
<panel label="Classificados" name="classified_panel">
<string name="searching_text">
Buscando...