From 53343bc708339b95f18804e11d6a130b542e0c5b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 17 Feb 2021 01:20:24 +0200 Subject: SL-14797 Normalize right-click - favorites panel, part #4 --- indra/newview/llfavoritesbar.cpp | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'indra/newview/llfavoritesbar.cpp') diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 347997a69a..2394a763ee 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -38,6 +38,7 @@ #include "lltooltip.h" #include "llagent.h" +#include "llagentpicksinfo.h" #include "llavatarnamecache.h" #include "llclipboard.h" #include "llinventorybridge.h" @@ -1194,6 +1195,10 @@ bool LLFavoritesBarCtrl::enableSelected(const LLSD& userdata) { return isClipboardPasteable(); } + else if (param == "create_pick") + { + return !LLAgentPicksInfo::getInstance()->isPickLimitReached(); + } return false; } @@ -1242,6 +1247,13 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) LLFloaterReg::showInstance("world_map", "center"); } } + else if (action == "create_pick") + { + LLSD args; + args["type"] = "create_pick"; + args["item_id"] = item->getUUID(); + LLFloaterSidePanelContainer::showPanel("places", args); + } else if (action == "cut") { } @@ -1257,6 +1269,16 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) { gInventory.removeItem(mSelectedItemID); } + else if (action == "rename") + { + LLSD args; + args["NAME"] = item->getName(); + + LLSD payload; + payload["id"] = mSelectedItemID; + + LLNotificationsUtil::add("RenameLandmark", args, payload, boost::bind(onRenameCommit, _1, _2)); + } // Pop-up the overflow menu again (it gets hidden whenever the user clicks a context menu item). // See EXT-4217 and STORM-207. @@ -1269,6 +1291,28 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) } } +bool LLFavoritesBarCtrl::onRenameCommit(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (0 == option) + { + LLUUID id = notification["payload"]["id"].asUUID(); + LLInventoryItem *item = gInventory.getItem(id); + std::string landmark_name = response["new_name"].asString(); + LLStringUtil::trim(landmark_name); + + if (!landmark_name.empty() && item && item->getName() != landmark_name) + { + LLPointer new_item = new LLViewerInventoryItem(item); + new_item->rename(landmark_name); + new_item->updateServer(FALSE); + gInventory.updateItem(new_item); + } + } + + return false; +} + BOOL LLFavoritesBarCtrl::isClipboardPasteable() const { if (!LLClipboard::instance().hasContents()) -- cgit v1.2.3 From c1139ed9b58025684c6ba7f5779e7e3245bd9a40 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 25 Feb 2021 20:35:07 +0200 Subject: SL-14901 Add a button on the Landmarks bar to open the Places floater --- indra/newview/llfavoritesbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfavoritesbar.cpp') diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 2394a763ee..3bebe6fc59 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -838,7 +838,7 @@ void LLFavoritesBarCtrl::updateButtons() int j = first_changed_item_index; for (; j < mItems.size(); j++) { - last_new_button = createButton(mItems[j], button_params, last_right_edge); + last_new_button = createButton(mItems[j], button_params, j == 0? last_right_edge + 4 : last_right_edge); if (!last_new_button) { break; -- cgit v1.2.3 From 446253df44dd82a7c5e711b9a69369cbbeb2acb7 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 10 Mar 2021 17:54:44 +0200 Subject: SL-14901 Updated button according to new spec --- indra/newview/llfavoritesbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfavoritesbar.cpp') diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 3bebe6fc59..2394a763ee 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -838,7 +838,7 @@ void LLFavoritesBarCtrl::updateButtons() int j = first_changed_item_index; for (; j < mItems.size(); j++) { - last_new_button = createButton(mItems[j], button_params, j == 0? last_right_edge + 4 : last_right_edge); + last_new_button = createButton(mItems[j], button_params, last_right_edge); if (!last_new_button) { break; -- cgit v1.2.3 From 38db12920c92b00e11aa533980790e8572ba6908 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 18 Mar 2021 20:18:23 +0200 Subject: SL-14901 adjusted 'More' button --- indra/newview/llfavoritesbar.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfavoritesbar.cpp') diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 2394a763ee..8791f605e9 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -402,6 +402,8 @@ LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p) mMoreTextBox = LLUICtrlFactory::create (more_button_params); mMoreTextBox->setClickedCallback(boost::bind(&LLFavoritesBarCtrl::showDropDownMenu, this)); addChild(mMoreTextBox); + LLRect rect = mMoreTextBox->getRect(); + mMoreTextBox->setRect(LLRect(rect.mLeft - rect.getWidth(), rect.mTop, rect.mRight, rect.mBottom)); mDropDownItemsCount = 0; -- cgit v1.2.3 From 89b4611fc00a17d923c06d510da6842002113199 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 30 Mar 2021 15:53:22 +0300 Subject: SL-15036 Add actions to move landmarks between tabs in the Places floater --- indra/newview/llfavoritesbar.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llfavoritesbar.cpp') diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 8791f605e9..4a40a74dec 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -1281,6 +1281,10 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) LLNotificationsUtil::add("RenameLandmark", args, payload, boost::bind(onRenameCommit, _1, _2)); } + else if (action == "move_to_landmarks") + { + change_item_parent(mSelectedItemID, gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK)); + } // Pop-up the overflow menu again (it gets hidden whenever the user clicks a context menu item). // See EXT-4217 and STORM-207. -- cgit v1.2.3