summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index b86c453d61..fce0b7c9c9 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -71,6 +71,9 @@
#include "llviewerwindow.h"
#include "llvoavatarself.h"
#include "llwearablelist.h"
+#include "lllandmarkactions.h"
+
+void copy_slurl_to_clipboard_callback_inv(const std::string& slurl);
// Marketplace outbox current disabled
#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU 1
@@ -1355,7 +1358,10 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action)
else if ("cut" == action)
{
cutToClipboard();
+ // MAINT-1197: This is temp code to work around a deselection/reselection bug. Please discard when merging CHUI.
+ LLFolderViewItem* item_to_select = mRoot->getNextUnselectedItem();
LLFolderView::removeCutItems();
+ mRoot->setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, false);
return;
}
else if ("copy" == action)
@@ -1396,6 +1402,29 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action)
const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
copy_item_to_outbox(itemp, outbox_id, LLUUID::null, LLToolDragAndDrop::getOperationId());
}
+ else if ("copy_slurl" == action)
+ {
+ LLViewerInventoryItem* item = static_cast<LLViewerInventoryItem*>(getItem());
+ if(item)
+ {
+ LLUUID asset_id = item->getAssetUUID();
+ LLLandmark* landmark = gLandmarkList.getAsset(asset_id);
+ if (landmark)
+ {
+ LLVector3d global_pos;
+ landmark->getGlobalPos(global_pos);
+ LLLandmarkActions::getSLURLfromPosGlobal(global_pos, &copy_slurl_to_clipboard_callback_inv, true);
+ }
+ }
+ }
+}
+
+void copy_slurl_to_clipboard_callback_inv(const std::string& slurl)
+{
+ gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(slurl));
+ LLSD args;
+ args["SLURL"] = slurl;
+ LLNotificationsUtil::add("CopySLURL", args);
}
void LLItemBridge::selectItem()
@@ -2743,7 +2772,10 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
else if ("cut" == action)
{
cutToClipboard();
+ // MAINT-1197: This is temp code to work around a deselection/reselection bug. Please discard when merging CHUI.
+ LLFolderViewItem* item_to_select = mRoot->getNextUnselectedItem();
LLFolderView::removeCutItems();
+ mRoot->setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, false);
return;
}
else if ("copy" == action)
@@ -4397,6 +4429,7 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
}
items.push_back(std::string("Landmark Separator"));
+ items.push_back(std::string("url_copy"));
items.push_back(std::string("About Landmark"));
}
@@ -4405,6 +4438,7 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
// info panel can be shown at a time.
if ((flags & FIRST_SELECTED_ITEM) == 0)
{
+ disabled_items.push_back(std::string("url_copy"));
disabled_items.push_back(std::string("About Landmark"));
}