summaryrefslogtreecommitdiff
path: root/indra/newview/llfavoritesbar.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2021-06-25 01:02:04 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2021-06-25 01:02:04 +0300
commit0ca16a1f95a56066ad07f85985ba3310c57dbf3b (patch)
treea5037fca626a4b5d9aaaf424596f43fbef07d43a /indra/newview/llfavoritesbar.cpp
parent1639e1ceb40fcbc9120857a75cb91fa509b13614 (diff)
parent467d8339c970c253dada2cf0e1eed45be66593ac (diff)
Merge branch 'master' into DRTVWR-527-maint
# Conflicts: # indra/newview/llinventorypanel.cpp
Diffstat (limited to 'indra/newview/llfavoritesbar.cpp')
-rw-r--r--indra/newview/llfavoritesbar.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 23188ca7de..3fdf7d8aa0 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"
@@ -403,6 +404,8 @@ LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p)
mMoreTextBox = LLUICtrlFactory::create<LLTextBox> (more_button_params);
mMoreTextBox->setClickedCallback(boost::bind(&LLFavoritesBarCtrl::onMoreTextBoxClicked, this));
addChild(mMoreTextBox);
+ LLRect rect = mMoreTextBox->getRect();
+ mMoreTextBox->setRect(LLRect(rect.mLeft - rect.getWidth(), rect.mTop, rect.mRight, rect.mBottom));
mDropDownItemsCount = 0;
@@ -1202,6 +1205,10 @@ bool LLFavoritesBarCtrl::enableSelected(const LLSD& userdata)
{
return isClipboardPasteable();
}
+ else if (param == "create_pick")
+ {
+ return !LLAgentPicksInfo::getInstance()->isPickLimitReached();
+ }
return false;
}
@@ -1250,6 +1257,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")
{
}
@@ -1265,6 +1279,20 @@ 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));
+ }
+ 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.
@@ -1277,6 +1305,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<LLViewerInventoryItem> 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())