Login Response support for destination_guide_url, OpenSimExtras support (properly) search-server-url, and support the new destination-guide-url from OpenSimExtras
Expands SignaledType's callback to accept const Type& as argument. typedefs Signal::slot_type to slot_t so that SignaledType can be altered without needing to update all lines setting slots. Merges floater_directory.xml with floater_directory(2|3).xml Condenses translations down to one xml(, finally the nightmare is over). Better ui code support for classic find all panel Not like anyone cares, but ShowcaseURLDefault no longer persists value changes between sessions. Moves SearchType and getSearchUrl(SearchType ty, bool is_web) from HippoGridInfo into a namespace in llpaneldirfind.cpp, the only place where it is used; so that it may wrap the sim feature lookup. Thanks to Shyotl for the help in dynamically maintaining tab positions for dynamic tabs.
This commit is contained in:
@@ -53,12 +53,26 @@
|
||||
#include "lluictrlfactory.h"
|
||||
|
||||
#include "hippogridmanager.h"
|
||||
#include "lfsimfeaturehandler.h"
|
||||
#include "llenvmanager.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llviewerregion.h"
|
||||
|
||||
const char* market_panel = "market_panel";
|
||||
|
||||
void set_tab_visible(LLTabContainer* container, LLPanel* tab, bool visible, LLPanel* prev_tab)
|
||||
{
|
||||
if (visible)
|
||||
{
|
||||
if (prev_tab)
|
||||
container->lockTabs(container->getIndexForPanel(prev_tab) + 1);
|
||||
container->addTabPanel(tab, tab->getLabel(), false, 0, false, LLTabContainer::START);
|
||||
if (prev_tab)
|
||||
container->unlockTabs();
|
||||
}
|
||||
else container->removeTabPanel(tab);
|
||||
}
|
||||
|
||||
class LLPanelDirMarket : public LLPanelDirFind
|
||||
{
|
||||
public:
|
||||
@@ -205,10 +219,7 @@ LLFloaterDirectory::LLFloaterDirectory(const std::string& name)
|
||||
mPanelClassifiedp = NULL;
|
||||
|
||||
// Build the floater with our tab panel classes
|
||||
|
||||
bool enableWebSearch = gHippoGridManager->getConnectedGrid()->isSecondLife() ||
|
||||
!gHippoGridManager->getConnectedGrid()->getSearchUrl().empty();
|
||||
bool enableClassicAllSearch = !gHippoGridManager->getConnectedGrid()->isSecondLife();
|
||||
bool secondlife = gHippoGridManager->getConnectedGrid()->isSecondLife();
|
||||
|
||||
LLCallbackMap::map_t factory_map;
|
||||
factory_map["classified_panel"] = LLCallbackMap(createClassified, this);
|
||||
@@ -218,15 +229,13 @@ 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);
|
||||
if (enableWebSearch)
|
||||
factory_map["find_all_panel"] = LLCallbackMap(createFindAll, this);
|
||||
factory_map["showcase_panel"] = LLCallbackMap(createShowcase, this);
|
||||
if (secondlife)
|
||||
{
|
||||
// web search and showcase only for SecondLife
|
||||
factory_map["find_all_panel"] = LLCallbackMap(createFindAll, this);
|
||||
factory_map["showcase_panel"] = LLCallbackMap(createShowcase, this);
|
||||
if (!enableClassicAllSearch) factory_map["web_panel"] = LLCallbackMap(createWebPanel, this);
|
||||
factory_map["web_panel"] = LLCallbackMap(createWebPanel, this);
|
||||
}
|
||||
|
||||
if (enableClassicAllSearch)
|
||||
else
|
||||
{
|
||||
factory_map["find_all_old_panel"] = LLCallbackMap(createFindAllOld, this);
|
||||
}
|
||||
@@ -240,28 +249,33 @@ LLFloaterDirectory::LLFloaterDirectory(const std::string& name)
|
||||
|
||||
factory_map["Panel Avatar"] = LLCallbackMap(createPanelAvatar, this);
|
||||
|
||||
if (enableWebSearch)
|
||||
{
|
||||
mCommitCallbackRegistrar.add("Search.WebFloater", boost::bind(&LLFloaterSearch::open, boost::bind(LLFloaterSearch::getInstance)));
|
||||
if (enableClassicAllSearch)
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_directory3.xml", &factory_map);
|
||||
else
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_directory.xml", &factory_map);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_directory2.xml", &factory_map);
|
||||
}
|
||||
mCommitCallbackRegistrar.add("Search.WebFloater", boost::bind(&LLFloaterSearch::open, boost::bind(LLFloaterSearch::getInstance)));
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_directory.xml", &factory_map);
|
||||
moveResizeHandlesToFront();
|
||||
|
||||
if(mPanelAvatarp)
|
||||
if (mPanelAvatarp)
|
||||
{
|
||||
mPanelAvatarp->selectTab(0);
|
||||
}
|
||||
|
||||
LLTabContainer* container = getChild<LLTabContainer>("Directory Tabs");
|
||||
if (enableClassicAllSearch)
|
||||
if (secondlife)
|
||||
{
|
||||
container->removeTabPanel(getChild<LLPanel>("find_all_old_panel")); // Not used
|
||||
}
|
||||
else
|
||||
{
|
||||
container->removeTabPanel(getChild<LLPanel>("web_panel")); // Not needed
|
||||
LLPanel* panel(getChild<LLPanel>("find_all_panel"));
|
||||
LLPanel* prev_tab(getChild<LLPanel>("find_all_old_panel"));
|
||||
LFSimFeatureHandler& inst(LFSimFeatureHandler::instance());
|
||||
set_tab_visible(container, panel, !inst.searchURL().empty(), prev_tab);
|
||||
inst.setSearchURLCallback(boost::bind(set_tab_visible, container, panel, !boost::bind(&std::string::empty, _1), prev_tab));
|
||||
panel = getChild<LLPanel>("showcase_panel");
|
||||
prev_tab = getChild<LLPanel>("events_panel");
|
||||
set_tab_visible(container, panel, !inst.destinationGuideURL().empty(), prev_tab);
|
||||
inst.setDestinationGuideURLCallback(boost::bind(set_tab_visible, container, panel, !boost::bind(&std::string::empty, _1), prev_tab));
|
||||
|
||||
LLPanelDirMarket* marketp = static_cast<LLPanelDirMarket*>(container->getPanelByName(market_panel));
|
||||
container->removeTabPanel(marketp); // Until we get a MarketPlace URL, tab is removed.
|
||||
marketp->handleRegionChange(container);
|
||||
@@ -452,7 +466,7 @@ void LLFloaterDirectory::searchInAll(const std::string& search_text)
|
||||
|
||||
void LLFloaterDirectory::showFindAll(const std::string& search_text)
|
||||
{
|
||||
showPanel("find_all_panel");
|
||||
showPanel(LFSimFeatureHandler::instance().searchURL().empty() ? "find_all_old_panel" : "find_all_panel");
|
||||
LLPanelDirFindAllInterface::search(sInstance->mFindAllPanel, search_text);
|
||||
}
|
||||
|
||||
@@ -589,12 +603,16 @@ void LLFloaterDirectory::toggleFind(void*)
|
||||
if (!sInstance)
|
||||
{
|
||||
std::string panel = gSavedSettings.getString("LastFindPanel");
|
||||
bool hasWebSearch = gHippoGridManager->getConnectedGrid()->isSecondLife() ||
|
||||
!gHippoGridManager->getConnectedGrid()->getSearchUrl().empty();
|
||||
if (hasWebSearch && (panel == "find_all_panel" || panel == "showcase_panel"))
|
||||
if (!gHippoGridManager->getConnectedGrid()->isSecondLife())
|
||||
{
|
||||
panel = "find_all_old_panel";
|
||||
LFSimFeatureHandler& inst(LFSimFeatureHandler::instance());
|
||||
if (panel == "web_panel"
|
||||
|| (inst.searchURL().empty() && panel == "find_all_panel")
|
||||
|| (inst.destinationGuideURL().empty() && panel == "showcase_panel"))
|
||||
panel = "find_all_old_panel";
|
||||
}
|
||||
else if (panel == "find_all_old_panel") panel = "find_all_panel";
|
||||
|
||||
showPanel(panel);
|
||||
|
||||
// HACK: force query for today's events
|
||||
|
||||
Reference in New Issue
Block a user