[OpenSim] Support create event & partner help URLs
Merges branch 'master' of https://github.com/bittenbythedark/singuosfork
This commit is contained in:
@@ -48,6 +48,7 @@ HippoGridInfo::HippoGridInfo(const std::string& gridName) :
|
||||
mWebSite(LLStringUtil::null),
|
||||
mSupportUrl(LLStringUtil::null),
|
||||
mRegisterUrl(LLStringUtil::null),
|
||||
mPartnerUrl(LLStringUtil::null),
|
||||
mPasswordUrl(LLStringUtil::null),
|
||||
mSearchUrl(LLStringUtil::null),
|
||||
mGridMessage(""),
|
||||
@@ -215,6 +216,11 @@ void HippoGridInfo::setRegisterUrl(const std::string& url)
|
||||
mRegisterUrl = url;
|
||||
}
|
||||
|
||||
void HippoGridInfo::setPartnerUrl(const std::string& url)
|
||||
{
|
||||
mPartnerUrl = url;
|
||||
}
|
||||
|
||||
void HippoGridInfo::setPasswordUrl(const std::string& url)
|
||||
{
|
||||
mPasswordUrl = url;
|
||||
@@ -277,6 +283,8 @@ void HippoGridInfo::onXmlElementStart(void* userData, const XML_Char* name, cons
|
||||
self->mXmlState = XML_SUPPORT;
|
||||
else if ((strcasecmp(name, "register") == 0) || (strcasecmp(name, "account") == 0))
|
||||
self->mXmlState = XML_REGISTER;
|
||||
else if (strcasecmp(name, "partner") == 0)
|
||||
self->mXmlState = XML_PARTNER;
|
||||
else if (strcasecmp(name, "password") == 0)
|
||||
self->mXmlState = XML_PASSWORD;
|
||||
else if (strcasecmp(name, "search") == 0)
|
||||
@@ -347,6 +355,7 @@ void HippoGridInfo::onXmlCharacterData(void* userData, const XML_Char* s, int le
|
||||
case XML_WEBSITE: self->mWebSite.assign(s, len); break;
|
||||
case XML_SUPPORT: self->mSupportUrl.assign(s, len); break;
|
||||
case XML_REGISTER: self->mRegisterUrl.assign(s, len); break;
|
||||
case XML_PARTNER: self->mPartnerUrl.assign(s, len); break;
|
||||
case XML_PASSWORD: self->mPasswordUrl.assign(s, len); break;
|
||||
case XML_MESSAGE: self->mGridMessage.assign(s, len); break;
|
||||
|
||||
@@ -893,6 +902,7 @@ void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
|
||||
if (gridMap.has("website")) grid->setWebSite(gridMap["website"]);
|
||||
if (gridMap.has("support")) grid->setSupportUrl(gridMap["support"]);
|
||||
if (gridMap.has("register")) grid->setRegisterUrl(gridMap["register"]);
|
||||
if (gridMap.has("partner")) grid->setPartnerUrl(gridMap["partner"]);
|
||||
if (gridMap.has("password")) grid->setPasswordUrl(gridMap["password"]);
|
||||
if (gridMap.has("search")) grid->setSearchUrl(gridMap["search"]);
|
||||
if (gridMap.has("render_compat")) grid->setRenderCompat(gridMap["render_compat"]);
|
||||
@@ -928,6 +938,7 @@ void HippoGridManager::saveFile()
|
||||
gridInfo[i]["website"] = grid->getWebSite();
|
||||
gridInfo[i]["support"] = grid->getSupportUrl();
|
||||
gridInfo[i]["register"] = grid->getRegisterUrl();
|
||||
gridInfo[i]["partner"] = grid->getPartnerUrl();
|
||||
gridInfo[i]["password"] = grid->getPasswordUrl();
|
||||
|
||||
gridInfo[i]["search"] = grid->getSearchUrl();
|
||||
|
||||
@@ -48,6 +48,7 @@ public:
|
||||
const std::string& getWebSite() const { return mWebSite; }
|
||||
const std::string& getSupportUrl() const { return mSupportUrl; }
|
||||
const std::string& getRegisterUrl() const { return mRegisterUrl; }
|
||||
const std::string& getPartnerUrl() const { return mPartnerUrl; }
|
||||
const std::string& getPasswordUrl() const { return mPasswordUrl; }
|
||||
// Returns the url base used for the Web Search tab
|
||||
const std::string& getSearchUrl() const { return mSearchUrl; }
|
||||
@@ -75,6 +76,7 @@ public:
|
||||
void setWebSite (const std::string& website);
|
||||
void setSupportUrl(const std::string& url);
|
||||
void setRegisterUrl(const std::string& url);
|
||||
void setPartnerUrl(const std::string& url);
|
||||
void setPasswordUrl(const std::string& url);
|
||||
// sets the url base used for the Web Search tab
|
||||
void setSearchUrl(const std::string& url);
|
||||
@@ -111,6 +113,7 @@ private:
|
||||
std::string mWebSite;
|
||||
std::string mSupportUrl;
|
||||
std::string mRegisterUrl;
|
||||
std::string mPartnerUrl;
|
||||
std::string mPasswordUrl;
|
||||
std::string mSearchUrl;
|
||||
std::string mVoiceConnector;
|
||||
@@ -134,7 +137,7 @@ private:
|
||||
{
|
||||
XML_VOID, XML_PLATFORM, XML_GRIDNAME, XML_GRIDNICK,
|
||||
XML_LOGINURI, XML_LOGINPAGE, XML_HELPERURI,
|
||||
XML_WEBSITE, XML_SUPPORT, XML_REGISTER, XML_PASSWORD, XML_SEARCH, XML_MESSAGE
|
||||
XML_WEBSITE, XML_SUPPORT, XML_REGISTER, XML_PARTNER, XML_PASSWORD, XML_SEARCH, XML_MESSAGE
|
||||
};
|
||||
XmlState mXmlState;
|
||||
|
||||
|
||||
@@ -130,6 +130,7 @@ BOOL HippoPanelGridsImpl::postBuild()
|
||||
requires<LLLineEditor>("website");
|
||||
requires<LLLineEditor>("support");
|
||||
requires<LLLineEditor>("register");
|
||||
requires<LLLineEditor>("partner");
|
||||
requires<LLLineEditor>("password");
|
||||
requires<LLLineEditor>("search");
|
||||
requires<LLButton>("btn_delete");
|
||||
@@ -244,6 +245,7 @@ void HippoPanelGridsImpl::loadCurGrid()
|
||||
childSetText("support", gridInfo->getSupportUrl());
|
||||
childSetText("search", gridInfo->getSearchUrl());
|
||||
childSetText("register", gridInfo->getRegisterUrl());
|
||||
childSetText("partner", gridInfo->getPartnerUrl());
|
||||
childSetText("password", gridInfo->getPasswordUrl());
|
||||
childSetValue("render_compat", gridInfo->isRenderCompat());
|
||||
enableEditing(!gridInfo->getLocked());
|
||||
@@ -259,6 +261,7 @@ void HippoPanelGridsImpl::loadCurGrid()
|
||||
childSetText("support", empty);
|
||||
childSetText("search", empty);
|
||||
childSetText("register", empty);
|
||||
childSetText("partner", empty);
|
||||
childSetText("password", empty);
|
||||
childSetValue("render_compat", true);
|
||||
enableEditing(true);
|
||||
@@ -361,6 +364,7 @@ bool HippoPanelGridsImpl::saveCurGrid()
|
||||
gridInfo->setWebSite(childGetValue("website"));
|
||||
gridInfo->setSupportUrl(childGetValue("support"));
|
||||
gridInfo->setRegisterUrl(childGetValue("register"));
|
||||
gridInfo->setPartnerUrl(childGetValue("partner"));
|
||||
gridInfo->setPasswordUrl(childGetValue("password"));
|
||||
gridInfo->setSearchUrl(childGetValue("search"));
|
||||
gridInfo->setRenderCompat(childGetValue("render_compat"));
|
||||
@@ -419,6 +423,7 @@ void HippoPanelGridsImpl::retrieveGridInfo()
|
||||
if (grid->getWebSite() != "") childSetText("website", grid->getWebSite());
|
||||
if (grid->getSupportUrl() != "") childSetText("support", grid->getSupportUrl());
|
||||
if (grid->getRegisterUrl() != "") childSetText("register", grid->getRegisterUrl());
|
||||
if (grid->getPartnerUrl() != "") childSetText("partner", grid->getPartnerUrl());
|
||||
if (grid->getPasswordUrl() != "") childSetText("password", grid->getPasswordUrl());
|
||||
if (grid->getSearchUrl() != "") childSetText("search", grid->getSearchUrl());
|
||||
if (grid->getGridMessage() != "") childSetText("gridmessage", grid->getGridMessage());
|
||||
@@ -532,6 +537,8 @@ void HippoPanelGridsImpl::onClickAdvanced(void *data)
|
||||
self->childSetVisible("support", false);
|
||||
self->childSetVisible("register_label", false);
|
||||
self->childSetVisible("register", false);
|
||||
self->childSetVisible("partner_label", false);
|
||||
self->childSetVisible("partner", false);
|
||||
self->childSetVisible("password_label", false);
|
||||
self->childSetVisible("password", false);
|
||||
self->childSetVisible("search_label", false);
|
||||
@@ -551,6 +558,8 @@ void HippoPanelGridsImpl::onClickAdvanced(void *data)
|
||||
self->childSetVisible("support", true);
|
||||
self->childSetVisible("register_label", true);
|
||||
self->childSetVisible("register", true);
|
||||
self->childSetVisible("partner_label", true);
|
||||
self->childSetVisible("partner", true);
|
||||
self->childSetVisible("password_label", true);
|
||||
self->childSetVisible("password", true);
|
||||
self->childSetVisible("search_label", true);
|
||||
@@ -578,6 +587,7 @@ void HippoPanelGridsImpl::enableEditing(bool b)
|
||||
"website",
|
||||
"support",
|
||||
"register",
|
||||
"partner",
|
||||
"password",
|
||||
"search",
|
||||
"btn_delete",
|
||||
|
||||
@@ -92,6 +92,7 @@ void LFSimFeatureHandler::setSupportedFeatures()
|
||||
mGridName = gHippoGridManager->getConnectedGrid()->getGridName() != grid_name ? grid_name : LLStringUtil::null;
|
||||
}
|
||||
}
|
||||
has_feature_or_default(mEventsURL, extras, "EventsURL");
|
||||
has_feature_or_default(mSayRange, extras, "say-range");
|
||||
has_feature_or_default(mShoutRange, extras, "shout-range");
|
||||
has_feature_or_default(mWhisperRange, extras, "whisper-range");
|
||||
@@ -105,6 +106,7 @@ void LFSimFeatureHandler::setSupportedFeatures()
|
||||
mMapServerURL = LLStringUtil::null;
|
||||
mSearchURL.reset();
|
||||
mGridName.reset();
|
||||
mEventsURL.reset();
|
||||
}
|
||||
mSayRange.reset();
|
||||
mShoutRange.reset();
|
||||
|
||||
@@ -65,6 +65,7 @@ public:
|
||||
boost::signals2::connection setSupportsExportCallback(const SignaledType<bool>::slot_t& slot) { return mSupportsExport.connect(slot); }
|
||||
boost::signals2::connection setDestinationGuideURLCallback(const SignaledType<std::string>::slot_t& slot) { return mDestinationGuideURL.connect(slot); }
|
||||
boost::signals2::connection setSearchURLCallback(const SignaledType<std::string>::slot_t& slot) { return mSearchURL.connect(slot); }
|
||||
boost::signals2::connection setEventsURLCallback(const SignaledType<std::string>::slot_t& slot) { return mEventsURL.connect(slot); }
|
||||
boost::signals2::connection setSayRangeCallback(const SignaledType<U32>::slot_t& slot) { return mSayRange.connect(slot); }
|
||||
boost::signals2::connection setShoutRangeCallback(const SignaledType<U32>::slot_t& slot) { return mShoutRange.connect(slot); }
|
||||
boost::signals2::connection setWhisperRangeCallback(const SignaledType<U32>::slot_t& slot) { return mWhisperRange.connect(slot); }
|
||||
@@ -74,6 +75,7 @@ public:
|
||||
std::string destinationGuideURL() const { return mDestinationGuideURL; }
|
||||
std::string mapServerURL() const { return mMapServerURL; }
|
||||
std::string searchURL() const { return mSearchURL; }
|
||||
const std::string& getEventsURL() const { return mEventsURL.ref(); }
|
||||
const std::string& gridName() const { return mGridName.ref(); }
|
||||
U32 sayRange() const { return mSayRange; }
|
||||
U32 shoutRange() const { return mShoutRange; }
|
||||
@@ -87,6 +89,7 @@ private:
|
||||
std::string mMapServerURL;
|
||||
SignaledType<std::string> mSearchURL;
|
||||
SignaledType<std::string> mGridName;
|
||||
SignaledType<std::string> mEventsURL;
|
||||
SignaledType<U32> mSayRange;
|
||||
SignaledType<U32> mShoutRange;
|
||||
SignaledType<U32> mWhisperRange;
|
||||
|
||||
@@ -70,6 +70,9 @@
|
||||
#include <iosfwd>
|
||||
#include <boost/date_time.hpp>
|
||||
|
||||
|
||||
#include "hippogridmanager.h" // Include Gridmanager for OpenSim Support in profiles, provides ability for the helpbutton to redirect to GRID Websites Help page
|
||||
|
||||
// [RLVa:KB]
|
||||
#include "rlvhandler.h"
|
||||
// [/RLVa:KB]
|
||||
@@ -299,11 +302,15 @@ void LLPanelAvatarSecondLife::onDoubleClickGroup()
|
||||
LLGroupActions::show(item->getUUID());
|
||||
}
|
||||
|
||||
// static
|
||||
// static - Not anymore :P
|
||||
bool LLPanelAvatarSecondLife::onClickPartnerHelpLoadURL(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
if (!LLNotification::getSelectedOption(notification, response))
|
||||
LLWeb::loadURL("http://secondlife.com/partner");
|
||||
{
|
||||
const auto& grid = *gHippoGridManager->getConnectedGrid();
|
||||
const std::string url = grid.isSecondLife() ? "http://secondlife.com/partner" : grid.getPartnerUrl();
|
||||
if (!url.empty()) LLWeb::loadURL(url);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,8 @@
|
||||
#include "llweb.h"
|
||||
#include "llworldmap.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "hippogridmanager.h"
|
||||
#include "lfsimfeaturehandler.h"
|
||||
|
||||
//static
|
||||
std::list<LLPanelEvent*> LLPanelEvent::sAllPanels;
|
||||
@@ -69,6 +71,10 @@ LLPanelEvent::~LLPanelEvent()
|
||||
sAllPanels.remove(this);
|
||||
}
|
||||
|
||||
void enable_create(const std::string& url, LLView* btn)
|
||||
{
|
||||
btn->setEnabled(!url.empty());
|
||||
}
|
||||
|
||||
BOOL LLPanelEvent::postBuild()
|
||||
{
|
||||
@@ -97,8 +103,15 @@ BOOL LLPanelEvent::postBuild()
|
||||
mNotifyBtn = getChild<LLButton>( "notify_btn");
|
||||
mNotifyBtn->setClickedCallback(boost::bind(&LLPanelEvent::onClickNotify,this));
|
||||
|
||||
mCreateEventBtn = getChild<LLButton>( "create_event_btn");
|
||||
mCreateEventBtn->setClickedCallback(boost::bind(&LLPanelEvent::onClickCreateEvent,this));
|
||||
mCreateEventBtn = getChild<LLButton>("create_event_btn");
|
||||
mCreateEventBtn->setClickedCallback(boost::bind(&LLPanelEvent::onClickCreateEvent, this));
|
||||
if (!gHippoGridManager->getConnectedGrid()->isSecondLife())
|
||||
{
|
||||
auto& inst(LFSimFeatureHandler::instance());
|
||||
mCreateEventBtn->setEnabled(!inst.getEventsURL().empty());
|
||||
inst.setEventsURLCallback(boost::bind(enable_create, _1, mCreateEventBtn));
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -286,8 +299,8 @@ bool LLPanelEvent::callbackCreateEventWebPage(const LLSD& notification, const LL
|
||||
if (0 == option)
|
||||
{
|
||||
LL_INFOS() << "Loading events page " << EVENTS_URL << LL_ENDL;
|
||||
|
||||
LLWeb::loadURL(EVENTS_URL);
|
||||
const std::string& opensim_events = LFSimFeatureHandler::instance().getEventsURL();
|
||||
LLWeb::loadURL(opensim_events.empty() ? EVENTS_URL : opensim_events);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -211,6 +211,9 @@
|
||||
font="SansSerifSmall"
|
||||
follows="left|top|right" border_visible="false" mouse_opaque="false"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false" />
|
||||
<!-- Partner URL -->
|
||||
<text name="partner_label" height="10" width="100" left="12" bottom_delta="-20" follows="left|top">Partner URL:</text>
|
||||
<line_editor max_length="254" name="partner" handle_edit_keys_directly="true" height="18" left="120" right="-12" bottom_delta="-4" font="SansSerifSmall" follows="left|top|right"/>
|
||||
<!-- Search URL -->
|
||||
<text type="string" length="1" enabled="true" name="search_label"
|
||||
height="10" width="100" left="12" bottom_delta="-20" visible="false"
|
||||
|
||||
Reference in New Issue
Block a user