summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2020-11-06 19:41:21 +0200
committerMnikolenko Productengine <mnikolenko@productengine.com>2020-11-06 19:41:21 +0200
commit8aa41b9e1c18f3b108c2e219e72b6e40762c4652 (patch)
tree01a74942c2987bdacbf7ca794df52e4bb25c0630
parentb484a2736524dc52ef81dd3e3d25ee0970674fd4 (diff)
SL-14203 add menu items to open Linden Homes and Premium Membership web pages
-rw-r--r--indra/newview/llfloaterlandholdings.cpp30
-rw-r--r--indra/newview/llfloaterlandholdings.h2
-rw-r--r--indra/newview/llstartup.cpp10
-rw-r--r--indra/newview/llviewermenu.cpp25
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml21
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml7
6 files changed, 86 insertions, 9 deletions
diff --git a/indra/newview/llfloaterlandholdings.cpp b/indra/newview/llfloaterlandholdings.cpp
index f34760a6bf..749a3d2686 100644
--- a/indra/newview/llfloaterlandholdings.cpp
+++ b/indra/newview/llfloaterlandholdings.cpp
@@ -51,6 +51,9 @@
#include "llgroupactions.h"
+const std::string LINDEN_HOMES_SKU = "131";
+bool LLFloaterLandHoldings::sHasLindenHome = false;
+
// protected
LLFloaterLandHoldings::LLFloaterLandHoldings(const LLSD& key)
: LLFloater(key),
@@ -148,10 +151,24 @@ void LLFloaterLandHoldings::refresh()
void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**)
{
LLFloaterLandHoldings* self = LLFloaterReg::findTypedInstance<LLFloaterLandHoldings>("land_holdings");
-
- // Is this packet from an old, closed window?
+ S32 count = msg->getNumberOfBlocks("QueryData");
+ std::string land_sku;
+ sHasLindenHome = false;
if (!self)
{
+ for (S32 i = 0; i < count; i++)
+ {
+ if ( msg->getSizeFast(_PREHASH_QueryData, i, _PREHASH_ProductSKU) > 0 )
+ {
+ msg->getStringFast( _PREHASH_QueryData, _PREHASH_ProductSKU, land_sku, i);
+
+ if (LINDEN_HOMES_SKU == land_sku)
+ {
+ sHasLindenHome = true;
+ return;
+ }
+ }
+ }
return;
}
@@ -174,12 +191,9 @@ void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**)
F32 global_x;
F32 global_y;
std::string sim_name;
- std::string land_sku;
std::string land_type;
- S32 i;
- S32 count = msg->getNumberOfBlocks("QueryData");
- for (i = 0; i < count; i++)
+ for (S32 i = 0; i < count; i++)
{
msg->getUUID("QueryData", "OwnerID", owner_id, i);
msg->getString("QueryData", "Name", name, i);
@@ -196,6 +210,10 @@ void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**)
msg->getStringFast( _PREHASH_QueryData, _PREHASH_ProductSKU, land_sku, i);
LL_INFOS() << "Land sku: " << land_sku << LL_ENDL;
land_type = LLProductInfoRequestManager::instance().getDescriptionForSku(land_sku);
+ if (LINDEN_HOMES_SKU == land_sku)
+ {
+ sHasLindenHome = true;
+ }
}
else
{
diff --git a/indra/newview/llfloaterlandholdings.h b/indra/newview/llfloaterlandholdings.h
index d1d510bb40..90e75b1062 100644
--- a/indra/newview/llfloaterlandholdings.h
+++ b/indra/newview/llfloaterlandholdings.h
@@ -57,6 +57,8 @@ public:
static void onGrantList(void* data);
+ static bool sHasLindenHome;
+
protected:
void refreshAggregates();
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 3ef2d47d37..f307daa198 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -128,10 +128,12 @@
#include "llpanelpick.h"
#include "llpanelgrouplandmoney.h"
#include "llpanelgroupnotices.h"
+#include "llparcel.h"
#include "llpreview.h"
#include "llpreviewscript.h"
#include "llproxy.h"
#include "llproductinforequest.h"
+#include "llqueryflags.h"
#include "llselectmgr.h"
#include "llsky.h"
#include "llstatview.h"
@@ -2258,6 +2260,14 @@ bool idle_startup()
gAgentAvatarp->sendHoverHeight();
+ // look for parcels we own
+ send_places_query(LLUUID::null,
+ LLUUID::null,
+ "",
+ DFQ_AGENT_OWNED,
+ LLParcel::C_ANY,
+ "");
+
return TRUE;
}
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 2d8757b673..3f0b744d94 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -64,6 +64,7 @@
#include "llfloaterimcontainer.h"
#include "llfloaterland.h"
#include "llfloaterimnearbychat.h"
+#include "llfloaterlandholdings.h"
#include "llfloaterpathfindingcharacters.h"
#include "llfloaterpathfindinglinksets.h"
#include "llfloaterpay.h"
@@ -5886,6 +5887,16 @@ class LLWorldSetHomeLocation : public view_listener_t
}
};
+class LLWorldLindenHome : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ std::string url = LLFloaterLandHoldings::sHasLindenHome ? LLTrans::getString("lindenhomes_my_home_url") : LLTrans::getString("lindenhomes_get_home_url");
+ LLWeb::loadURL(url);
+ return true;
+ }
+};
+
class LLWorldTeleportHome : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
@@ -8735,6 +8746,17 @@ public:
}
};
+class LLUpdateMembershipLabel : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ const std::string label_str = LLAgentBenefitsMgr::isCurrent("Base") ? LLTrans::getString("MembershipUpgradeText") : LLTrans::getString("MembershipPremiumText");
+ gMenuHolder->childSetLabelArg("Membership", "[Membership]", label_str);
+
+ return true;
+ }
+};
+
void handle_voice_morphing_subscribe()
{
LLWeb::loadURL(LLTrans::getString("voice_morphing_url"));
@@ -8884,6 +8906,8 @@ void initialize_menus()
view_listener_t::addEnable(new LLUploadCostCalculator(), "Upload.CalculateCosts");
+ view_listener_t::addEnable(new LLUpdateMembershipLabel(), "Membership.UpdateLabel");
+
enable.add("Conversation.IsConversationLoggingAllowed", boost::bind(&LLFloaterIMContainer::isConversationLoggingAllowed));
// Agent
@@ -8960,6 +8984,7 @@ void initialize_menus()
view_listener_t::addMenu(new LLWorldTeleportHome(), "World.TeleportHome");
view_listener_t::addMenu(new LLWorldSetAway(), "World.SetAway");
view_listener_t::addMenu(new LLWorldSetDoNotDisturb(), "World.SetDoNotDisturb");
+ view_listener_t::addMenu(new LLWorldLindenHome(), "World.LindenHome");
view_listener_t::addMenu(new LLWorldEnableCreateLandmark(), "World.EnableCreateLandmark");
view_listener_t::addMenu(new LLWorldEnableSetHomeLocation(), "World.EnableSetHomeLocation");
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 5fa1847d1b..01c2b7f1d9 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -213,6 +213,15 @@
name="ManageMyAccount_url"
parameter="WebLaunchJoinNow,http://secondlife.com/account/" />
</menu_item_call>
+ <menu_item_call
+ label="[Membership]"
+ name="Membership">
+ <menu_item_call.on_click
+ function="Advanced.ShowURL"
+ parameter="https://secondlife.com/my/account/membership.php"/>
+ <menu_item_call.on_visible
+ function="Membership.UpdateLabel"/>
+ </menu_item_call>
<menu_item_separator/>
@@ -524,12 +533,18 @@
parameter="region_info" />
</menu_item_call>
<menu_item_call
- label="My land holdings..."
- name="My Land">
+ label="My Linden Home..."
+ name="Linden Home">
+ <menu_item_call.on_click
+ function="World.LindenHome"/>
+ </menu_item_call>
+ <menu_item_call
+ label="My land holdings..."
+ name="My Land">
<menu_item_call.on_click
function="Floater.Show"
parameter="land_holdings" />
- </menu_item_call>
+ </menu_item_call>
<menu_item_call
label="Buy this land"
name="Buy Land">
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 7398e457f0..0b95b43f39 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3768,6 +3768,10 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
<string name="voice_morphing_url">https://secondlife.com/destination/voice-island</string>
<string name="premium_voice_morphing_url">https://secondlife.com/destination/voice-morphing-premium</string>
+ <string name="lindenhomes_get_home_url">https://secondlife.com/land/lindenhomes/member.php</string>
+ <string name="lindenhomes_my_home_url">https://land.secondlife.com/en-Us/lindenhomes/my-home.php</string>
+ <string name="membership_url">https://secondlife.com/my/account/membership.php</string>
+
<!-- Financial operations strings -->
<string name="paid_you_ldollars">[NAME] paid you L$[AMOUNT] [REASON].</string>
<string name="paid_you_ldollars_gift">[NAME] paid you L$[AMOUNT]: [REASON]</string>
@@ -3959,6 +3963,9 @@ Please check http://status.secondlifegrid.net to see if there is a known problem
<string name="Premium PlusMembership">Premium Plus</string>
<string name="InternalMembership">Internal</string> <!-- No need to translate -->
+ <string name="MembershipUpgradeText">Upgrade to Premium</string>
+ <string name="MembershipPremiumText">My Premium membership</string>
+
<!-- Question strings for delete items notifications -->
<string name="DeleteItems">Delete selected items?</string>
<string name="DeleteItem">Delete selected item?</string>