Add support for Partner URL on OpenSim Grids
This commit is contained in:
@@ -49,6 +49,7 @@ HippoGridInfo::HippoGridInfo(const std::string& gridName) :
|
||||
mSupportUrl(LLStringUtil::null),
|
||||
mRegisterUrl(LLStringUtil::null),
|
||||
mPasswordUrl(LLStringUtil::null),
|
||||
mPartnerUrl(LLStringUtil::null),
|
||||
mSearchUrl(LLStringUtil::null),
|
||||
mGridMessage(""),
|
||||
mXmlState(XML_VOID),
|
||||
@@ -220,6 +221,11 @@ void HippoGridInfo::setPasswordUrl(const std::string& url)
|
||||
mPasswordUrl = url;
|
||||
}
|
||||
|
||||
void HippoGridInfo::setPartnerUrl(const std::string& url)
|
||||
{
|
||||
mPartnerUrl = url;
|
||||
}
|
||||
|
||||
void HippoGridInfo::setSearchUrl(const std::string& url)
|
||||
{
|
||||
mSearchUrl = url;
|
||||
@@ -279,6 +285,8 @@ void HippoGridInfo::onXmlElementStart(void* userData, const XML_Char* name, cons
|
||||
self->mXmlState = XML_REGISTER;
|
||||
else if (strcasecmp(name, "password") == 0)
|
||||
self->mXmlState = XML_PASSWORD;
|
||||
else if (strcasecmp(name, "partner") == 0)
|
||||
self->mXmlState = XML_PARTNER;
|
||||
else if (strcasecmp(name, "search") == 0)
|
||||
self->mXmlState = XML_SEARCH;
|
||||
else if (strcasecmp(name, "message") == 0)
|
||||
@@ -348,6 +356,7 @@ void HippoGridInfo::onXmlCharacterData(void* userData, const XML_Char* s, int le
|
||||
case XML_SUPPORT: self->mSupportUrl.assign(s, len); break;
|
||||
case XML_REGISTER: self->mRegisterUrl.assign(s, len); break;
|
||||
case XML_PASSWORD: self->mPasswordUrl.assign(s, len); break;
|
||||
case XML_PARTNER: self->mPartnerUrl.assign(s, len); break;
|
||||
case XML_MESSAGE: self->mGridMessage.assign(s, len); break;
|
||||
|
||||
case XML_VOID: break;
|
||||
@@ -894,6 +903,7 @@ void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
|
||||
if (gridMap.has("support")) grid->setSupportUrl(gridMap["support"]);
|
||||
if (gridMap.has("register")) grid->setRegisterUrl(gridMap["register"]);
|
||||
if (gridMap.has("password")) grid->setPasswordUrl(gridMap["password"]);
|
||||
if (gridMap.has("partner")) grid->setPartnerUrl(gridMap["partner"]);
|
||||
if (gridMap.has("search")) grid->setSearchUrl(gridMap["search"]);
|
||||
if (gridMap.has("render_compat")) grid->setRenderCompat(gridMap["render_compat"]);
|
||||
if (gridMap.has("auto_update")) grid->mAutoUpdate = gridMap["auto_update"];
|
||||
@@ -929,6 +939,7 @@ void HippoGridManager::saveFile()
|
||||
gridInfo[i]["support"] = grid->getSupportUrl();
|
||||
gridInfo[i]["register"] = grid->getRegisterUrl();
|
||||
gridInfo[i]["password"] = grid->getPasswordUrl();
|
||||
gridInfo[i]["partner"] = grid->getPartnerUrl();
|
||||
|
||||
gridInfo[i]["search"] = grid->getSearchUrl();
|
||||
gridInfo[i]["render_compat"] = grid->isRenderCompat();
|
||||
|
||||
@@ -49,6 +49,7 @@ public:
|
||||
const std::string& getSupportUrl() const { return mSupportUrl; }
|
||||
const std::string& getRegisterUrl() const { return mRegisterUrl; }
|
||||
const std::string& getPasswordUrl() const { return mPasswordUrl; }
|
||||
const std::string& getPartnerUrl() const { return mPartnerUrl; }
|
||||
// Returns the url base used for the Web Search tab
|
||||
const std::string& getSearchUrl() const { return mSearchUrl; }
|
||||
const std::string& getGridMessage() const { return mGridMessage; }
|
||||
@@ -76,6 +77,7 @@ public:
|
||||
void setSupportUrl(const std::string& url);
|
||||
void setRegisterUrl(const std::string& url);
|
||||
void setPasswordUrl(const std::string& url);
|
||||
void setPartnerUrl(const std::string& url);
|
||||
// sets the url base used for the Web Search tab
|
||||
void setSearchUrl(const std::string& url);
|
||||
void setGridMessage(const std::string& message);
|
||||
@@ -112,6 +114,7 @@ private:
|
||||
std::string mSupportUrl;
|
||||
std::string mRegisterUrl;
|
||||
std::string mPasswordUrl;
|
||||
std::string mPartnerUrl;
|
||||
std::string mSearchUrl;
|
||||
std::string mVoiceConnector;
|
||||
bool mIsInProductionGrid;
|
||||
@@ -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_PASSWORD, XML_PARTNER, XML_SEARCH, XML_MESSAGE
|
||||
};
|
||||
XmlState mXmlState;
|
||||
|
||||
|
||||
@@ -131,6 +131,7 @@ BOOL HippoPanelGridsImpl::postBuild()
|
||||
requires<LLLineEditor>("support");
|
||||
requires<LLLineEditor>("register");
|
||||
requires<LLLineEditor>("password");
|
||||
requires<LLLineEditor>("partner");
|
||||
requires<LLLineEditor>("search");
|
||||
requires<LLButton>("btn_delete");
|
||||
requires<LLButton>("btn_add");
|
||||
@@ -245,6 +246,7 @@ void HippoPanelGridsImpl::loadCurGrid()
|
||||
childSetText("search", gridInfo->getSearchUrl());
|
||||
childSetText("register", gridInfo->getRegisterUrl());
|
||||
childSetText("password", gridInfo->getPasswordUrl());
|
||||
childSetText("partner", gridInfo->getPartnerUrl());
|
||||
childSetValue("render_compat", gridInfo->isRenderCompat());
|
||||
enableEditing(!gridInfo->getLocked());
|
||||
} else {
|
||||
@@ -260,6 +262,7 @@ void HippoPanelGridsImpl::loadCurGrid()
|
||||
childSetText("search", empty);
|
||||
childSetText("register", empty);
|
||||
childSetText("password", empty);
|
||||
childSetText("partner", empty);
|
||||
childSetValue("render_compat", true);
|
||||
enableEditing(true);
|
||||
}
|
||||
@@ -362,6 +365,7 @@ bool HippoPanelGridsImpl::saveCurGrid()
|
||||
gridInfo->setSupportUrl(childGetValue("support"));
|
||||
gridInfo->setRegisterUrl(childGetValue("register"));
|
||||
gridInfo->setPasswordUrl(childGetValue("password"));
|
||||
gridInfo->setPartnerUrl(childGetValue("partner"));
|
||||
gridInfo->setSearchUrl(childGetValue("search"));
|
||||
gridInfo->setRenderCompat(childGetValue("render_compat"));
|
||||
|
||||
@@ -420,6 +424,7 @@ void HippoPanelGridsImpl::retrieveGridInfo()
|
||||
if (grid->getSupportUrl() != "") childSetText("support", grid->getSupportUrl());
|
||||
if (grid->getRegisterUrl() != "") childSetText("register", grid->getRegisterUrl());
|
||||
if (grid->getPasswordUrl() != "") childSetText("password", grid->getPasswordUrl());
|
||||
if (grid->getPartnerUrl() != "") childSetText("partner", grid->getPartnerUrl());
|
||||
if (grid->getSearchUrl() != "") childSetText("search", grid->getSearchUrl());
|
||||
if (grid->getGridMessage() != "") childSetText("gridmessage", grid->getGridMessage());
|
||||
}
|
||||
@@ -534,6 +539,8 @@ void HippoPanelGridsImpl::onClickAdvanced(void *data)
|
||||
self->childSetVisible("register", false);
|
||||
self->childSetVisible("password_label", false);
|
||||
self->childSetVisible("password", false);
|
||||
self->childSetVisible("partner_label", false);
|
||||
self->childSetVisible("partner", false);
|
||||
self->childSetVisible("search_label", false);
|
||||
self->childSetVisible("search", false);
|
||||
self->childSetVisible("render_compat", false);
|
||||
@@ -553,6 +560,8 @@ void HippoPanelGridsImpl::onClickAdvanced(void *data)
|
||||
self->childSetVisible("register", true);
|
||||
self->childSetVisible("password_label", true);
|
||||
self->childSetVisible("password", true);
|
||||
self->childSetVisible("partner_label", true);
|
||||
self->childSetVisible("partner", true);
|
||||
self->childSetVisible("search_label", true);
|
||||
self->childSetVisible("search", true);
|
||||
self->childSetVisible("render_compat", true);
|
||||
@@ -579,6 +588,7 @@ void HippoPanelGridsImpl::enableEditing(bool b)
|
||||
"support",
|
||||
"register",
|
||||
"password",
|
||||
"partner",
|
||||
"search",
|
||||
"btn_delete",
|
||||
"btn_gridinfo",
|
||||
|
||||
@@ -70,6 +70,10 @@
|
||||
#include <iosfwd>
|
||||
#include <boost/date_time.hpp>
|
||||
|
||||
//Include Gridmanager for Profile
|
||||
#include "hippogridmanager.h"
|
||||
#include "hippopanelgrids.h"
|
||||
|
||||
// [RLVa:KB]
|
||||
#include "rlvhandler.h"
|
||||
// [/RLVa:KB]
|
||||
@@ -299,11 +303,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -210,6 +210,22 @@
|
||||
halign="right"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top|right" border_visible="false" mouse_opaque="false"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false" />
|
||||
<!-- Password URL -->
|
||||
<text type="string" length="1" enabled="true" name="partner_label"
|
||||
height="10" width="100" left="12" bottom_delta="-20" visible="false"
|
||||
h_pad="0" v_pad="0" halign="left"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top" bg_visible="false" border_visible="false" mouse_opaque="true"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false">
|
||||
Partner URL:
|
||||
</text>
|
||||
<line_editor max_length="254" enabled="true" name="partner"
|
||||
handle_edit_keys_directly="true" visible="false"
|
||||
height="18" left="120" right="-12" bottom_delta="-4"
|
||||
halign="right"
|
||||
font="SansSerifSmall"
|
||||
follows="left|top|right" border_visible="false" mouse_opaque="false"
|
||||
drop_shadow_visible="true" border_drop_shadow_visible="false" />
|
||||
<!-- Search URL -->
|
||||
<text type="string" length="1" enabled="true" name="search_label"
|
||||
|
||||
Reference in New Issue
Block a user