From b484a2736524dc52ef81dd3e3d25ee0970674fd4 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 4 Nov 2020 18:53:56 +0200 Subject: [PATCH 1/2] SL-13826 Open a new inventory floater for "Find original" and "Show original" result --- indra/newview/llinventorybridge.cpp | 20 +++++--------------- indra/newview/llinventoryfunctions.cpp | 18 +++++++++++------- indra/newview/llinventorypanel.cpp | 26 ++++++++++++++++++++++++++ indra/newview/llinventorypanel.h | 5 ++++- indra/newview/llpanelmaininventory.cpp | 15 ++++++++++++--- indra/newview/llpanelmaininventory.h | 3 ++- 6 files changed, 60 insertions(+), 27 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 03123689c5..67d65547b6 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1881,6 +1881,7 @@ void LLItemBridge::gotoItem() if (active_panel) { active_panel->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO); + active_panel->setFocus(TRUE); } } @@ -7229,24 +7230,13 @@ void LLLinkFolderBridge::performAction(LLInventoryModel* model, std::string acti } LLItemBridge::performAction(model,action); } + void LLLinkFolderBridge::gotoItem() { - const LLUUID &cat_uuid = getFolderID(); - if (!cat_uuid.isNull()) - { - LLFolderViewItem *base_folder = mInventoryPanel.get()->getItemByID(cat_uuid); - if (base_folder) - { - if (LLInventoryModel* model = getInventoryModel()) - { - model->fetchDescendentsOf(cat_uuid); - } - base_folder->setOpen(TRUE); - mRoot->setSelection(base_folder,TRUE); - mRoot->scrollToShowSelection(); - } - } + LLItemBridge::gotoItem(); + LLInventoryPanel::getActiveInventoryPanel()->openFolderByID(getFolderID()); } + const LLUUID &LLLinkFolderBridge::getFolderID() const { if (LLViewerInventoryItem *link_item = getItem()) diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 646d92b9e1..9eb84ed259 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -737,9 +737,8 @@ void show_item_original(const LLUUID& item_uuid) } //sidetray inventory panel - LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("inventory"); + LLSidepanelInventory *sidepanel_inventory = LLPanelMainInventory::newWindow()->LLFloaterSidePanelContainer::getPanel("inventory"); - bool do_reset_inventory_filter = !floater_inventory->isInVisibleChain(); LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(); if (!active_panel) @@ -758,11 +757,7 @@ void show_item_original(const LLUUID& item_uuid) return; } active_panel->setSelection(gInventory.getLinkedItemID(item_uuid), TAKE_FOCUS_YES); - - if(do_reset_inventory_filter) - { - reset_inventory_filter(); - } + active_panel->setFocus(TRUE); } @@ -2446,6 +2441,15 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root } else { + if (action == "goto") + { + LLSidepanelInventory *sidepanel_inventory = LLPanelMainInventory::newWindow()->LLFloaterSidePanelContainer::getPanel("inventory"); + if (sidepanel_inventory && sidepanel_inventory->getMainInventoryPanel()) + { + model = sidepanel_inventory->getMainInventoryPanel()->getActivePanel()->getModel(); + } + } + std::set::iterator set_iter; for (set_iter = selected_items.begin(); set_iter != selected_items.end(); ++set_iter) { diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index c65998cf90..740c27ae8b 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -339,6 +339,7 @@ void LLInventoryPanel::draw() { // Select the desired item (in case it wasn't loaded when the selection was requested) updateSelection(); + updateFolderState(); LLPanel::draw(); } @@ -1146,6 +1147,7 @@ void LLInventoryPanel::setSelectCallback(const boost::functiongetViewModelItem()) + { + itemp->setOpen(TRUE); + mOpenFolderID.setNull(); + return; + } + else + { + // save the desired folder to be open later (if/when ready) + mOpenFolderID = folder_id; + } +} + +void LLInventoryPanel::updateFolderState() +{ + if (mOpenFolderID.notNull()) + { + openFolderByID(mOpenFolderID); + } +} + void LLInventoryPanel::doToSelected(const LLSD& userdata) { if (("purge" == userdata.asString())) diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 7cb52dc1f3..e51281b4b3 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -244,7 +244,9 @@ public: LLFolderViewItem* getItemByID(const LLUUID& id); LLFolderViewFolder* getFolderByID(const LLUUID& id); void setSelectionByID(const LLUUID& obj_id, BOOL take_keyboard_focus); + void openFolderByID(const LLUUID& folder_id); void updateSelection(); + void updateFolderState(); void setSuppressOpenItemAction(bool supress_open_item) { mSuppressOpenItemAction = supress_open_item; } @@ -260,7 +262,8 @@ protected: void openStartFolderOrMyInventory(); // open the first level of inventory void onItemsCompletion(); // called when selected items are complete - LLUUID mSelectThisID; + LLUUID mSelectThisID; + LLUUID mOpenFolderID; LLInventoryModel* mInventory; LLInventoryObserver* mInventoryObserver; LLInvPanelComplObserver* mCompletionObserver; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 4691ee3849..813a5b3c20 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -383,15 +383,16 @@ void LLPanelMainInventory::closeAllFolders() getPanel()->getRootFolder()->closeAllFolders(); } -void LLPanelMainInventory::newWindow() +LLFloaterSidePanelContainer* LLPanelMainInventory::newWindow() { static S32 instance_num = 0; instance_num = (instance_num + 1) % S32_MAX; if (!gAgentCamera.cameraMouselook()) { - LLFloaterReg::showTypedInstance("inventory", LLSD(instance_num)); + return LLFloaterReg::showTypedInstance("inventory", LLSD(instance_num)); } + return NULL; } void LLPanelMainInventory::doCreate(const LLSD& userdata) @@ -1343,7 +1344,15 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) { return; } - static_cast(current_item->getViewModelItem())->performAction(getActivePanel()->getModel(), "goto"); + LLSidepanelInventory *sidepanel_inventory = newWindow()->LLFloaterSidePanelContainer::getPanel("inventory"); + if (sidepanel_inventory) + { + LLPanelMainInventory* new_inventory = sidepanel_inventory->getMainInventoryPanel(); + if (new_inventory) + { + static_cast(current_item->getViewModelItem())->performAction(new_inventory->getActivePanel()->getModel(), "goto"); + } + } } if (command_name == "find_links") diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 903b33bdbf..40f04da6e9 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -46,6 +46,7 @@ class LLMenuButton; class LLMenuGL; class LLToggleableMenu; class LLFloater; +class LLFloaterSidePanelContainer; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLPanelMainInventory @@ -90,7 +91,7 @@ public: void setFocusFilterEditor(); - static void newWindow(); + static LLFloaterSidePanelContainer* newWindow(); void toggleFindOptions(); From 8aa41b9e1c18f3b108c2e219e72b6e40762c4652 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 6 Nov 2020 19:41:21 +0200 Subject: [PATCH 2/2] SL-14203 add menu items to open Linden Homes and Premium Membership web pages --- indra/newview/llfloaterlandholdings.cpp | 30 +++++++++++++++---- indra/newview/llfloaterlandholdings.h | 2 ++ indra/newview/llstartup.cpp | 10 +++++++ indra/newview/llviewermenu.cpp | 25 ++++++++++++++++ .../skins/default/xui/en/menu_viewer.xml | 21 +++++++++++-- .../newview/skins/default/xui/en/strings.xml | 7 +++++ 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("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/" /> + + + + @@ -524,12 +533,18 @@ parameter="region_info" /> + label="My Linden Home..." + name="Linden Home"> + + + - + 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]. https://secondlife.com/destination/voice-island https://secondlife.com/destination/voice-morphing-premium + https://secondlife.com/land/lindenhomes/member.php + https://land.secondlife.com/en-Us/lindenhomes/my-home.php + https://secondlife.com/my/account/membership.php + [NAME] paid you L$[AMOUNT] [REASON]. [NAME] paid you L$[AMOUNT]: [REASON] @@ -3959,6 +3963,9 @@ Please check http://status.secondlifegrid.net to see if there is a known problem Premium Plus Internal + Upgrade to Premium + My Premium membership + Delete selected items? Delete selected item?