From b80be075d7dfea50329829865534b0354ca69f57 Mon Sep 17 00:00:00 2001 From: bittenbythedark Date: Fri, 1 Mar 2019 09:29:16 +0100 Subject: [PATCH] Add support for Partner URL on OpenSim Grids --- README.md | 1 + indra/newview/hippogridmanager.cpp | 11 +++++++++++ indra/newview/hippogridmanager.h | 5 ++++- indra/newview/hippopanelgrids.cpp | 10 ++++++++++ indra/newview/llpanelavatar.cpp | 12 ++++++++++-- .../xui/en-us/panel_preferences_grids.xml | 16 ++++++++++++++++ 6 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 000000000..30f944d4d --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# singuosfork \ No newline at end of file diff --git a/indra/newview/hippogridmanager.cpp b/indra/newview/hippogridmanager.cpp index 0ba0d92c4..00047a103 100644 --- a/indra/newview/hippogridmanager.cpp +++ b/indra/newview/hippogridmanager.cpp @@ -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(); diff --git a/indra/newview/hippogridmanager.h b/indra/newview/hippogridmanager.h index 73eeca2d7..73f8b45db 100644 --- a/indra/newview/hippogridmanager.h +++ b/indra/newview/hippogridmanager.h @@ -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; diff --git a/indra/newview/hippopanelgrids.cpp b/indra/newview/hippopanelgrids.cpp index d5570e84a..2b1024c33 100644 --- a/indra/newview/hippopanelgrids.cpp +++ b/indra/newview/hippopanelgrids.cpp @@ -131,6 +131,7 @@ BOOL HippoPanelGridsImpl::postBuild() requires("support"); requires("register"); requires("password"); + requires("partner"); requires("search"); requires("btn_delete"); requires("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", diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index d1a431917..1f4d5ea53 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -70,6 +70,10 @@ #include #include +//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; } diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_grids.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_grids.xml index ea53548f7..59f38f138 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_grids.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_grids.xml @@ -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" /> + + + Partner URL: + +