diff -r 4d9106153407 indra/newview/llinventorybridge.h --- a/indra/newview/llinventorybridge.h Thu Jun 21 16:44:04 2012 -0400 +++ b/indra/newview/llinventorybridge.h Wed Jul 11 18:58:32 2012 -0400 @@ -197,6 +197,8 @@ const LLUUID& uuid) : LLInvFVBridge(inventory, root, uuid) {} + typedef boost::function slurl_callback_t; + virtual void performAction(LLInventoryModel* model, std::string action); virtual void selectItem(); virtual void restoreItem(); @@ -214,7 +216,6 @@ virtual BOOL isItemCopyable() const; virtual BOOL hasChildren() const { return FALSE; } virtual BOOL isUpToDate() const { return TRUE; } - /*virtual*/ void clearDisplayName() { mDisplayName.clear(); } LLViewerInventoryItem* getItem() const; diff -r 4d9106153407 indra/newview/llinventorybridge.cpp --- a/indra/newview/llinventorybridge.cpp Thu Jun 21 16:44:04 2012 -0400 +++ b/indra/newview/llinventorybridge.cpp Wed Jul 11 18:58:32 2012 -0400 @@ -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 @@ -1396,6 +1399,29 @@ 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(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, ©_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() @@ -4397,6 +4423,7 @@ } items.push_back(std::string("Landmark Separator")); + items.push_back(std::string("url_copy")); items.push_back(std::string("About Landmark")); } @@ -4405,6 +4432,7 @@ // 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")); } diff -r 4d9106153407 indra/newview/skins/default/xui/en/menu_inventory.xml --- a/indra/newview/skins/default/xui/en/menu_inventory.xml Thu Jun 21 16:44:04 2012 -0400 +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml Wed Jul 11 18:58:32 2012 -0400 @@ -537,6 +537,14 @@ layout="topleft" name="Landmark Separator" /> + + +