diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index a76a000b767263160acd280eaa65a45a8e4e8c9e..93a8e5722ba81aac1acf45080f055d62432a1c41 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -2121,6 +2121,7 @@ BOOL LLScrollListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask) registrar.add("Url.Execute", boost::bind(&LLScrollListCtrl::showNameDetails, id, is_group)); registrar.add("Url.CopyLabel", boost::bind(&LLScrollListCtrl::copyNameToClipboard, id, is_group)); registrar.add("Url.CopyUrl", boost::bind(&LLScrollListCtrl::copySLURLToClipboard, id, is_group)); + registrar.add("Url.CopyUUID", boost::bind(&LLScrollListCtrl::copyUUIDToClipboard, id)); // create the context menu from the XUI file and display it std::string menu_name = is_group ? "menu_url_group.xml" : "menu_url_agent.xml"; @@ -2229,6 +2230,12 @@ void LLScrollListCtrl::copySLURLToClipboard(std::string id, bool is_group) LLUrlAction::copyURLToClipboard(slurl); } +void LLScrollListCtrl::copyUUIDToClipboard(std::string id) +{ + // copy a UUID for the avatar or group to the clipboard + LLUrlAction::copyURLToClipboard(id); +} + BOOL LLScrollListCtrl::handleDoubleClick(S32 x, S32 y, MASK mask) { //BOOL handled = FALSE; diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 07b7cea41655262b408af8e49098d65b0bf7bafc..7b02318025c5fa5738ba9b90ef6a1fc9ea851372 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -499,6 +499,7 @@ class LLScrollListCtrl : public LLUICtrl, public LLEditMenuHandler, static void showNameDetails(std::string id, bool is_group); static void copyNameToClipboard(std::string id, bool is_group); static void copySLURLToClipboard(std::string id, bool is_group); + static void copyUUIDToClipboard(std::string id); S32 mLineHeight; // the max height of a single line S32 mScrollLines; // how many lines we've scrolled down diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index e8cf5ad7c452c0cbfd6fc7dc150f8f4aa2a8e9c1..a15de1c461280c27b4f1f6372977b726b8661d5b 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2165,6 +2165,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) registrar.add("Url.ShowOnMap", boost::bind(&LLUrlAction::showLocationOnMap, url)); registrar.add("Url.CopyLabel", boost::bind(&LLUrlAction::copyLabelToClipboard, url)); registrar.add("Url.CopyUrl", boost::bind(&LLUrlAction::copyURLToClipboard, url)); + registrar.add("Url.CopyUUID", boost::bind(&LLUrlAction::copyUUIDToClipboard, url)); // create and return the context menu from the XUI file diff --git a/indra/llui/llurlaction.cpp b/indra/llui/llurlaction.cpp index 8216046174668d162ca1b415e26cd29a3fa19e96..52487c3b6f86d13f9345d006144f3319676d7937 100644 --- a/indra/llui/llurlaction.cpp +++ b/indra/llui/llurlaction.cpp @@ -133,6 +133,15 @@ void LLUrlAction::copyURLToClipboard(std::string url) LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(url)); } +void LLUrlAction::copyUUIDToClipboard(std::string url) +{ + std::string id_str = getUserID(url); + if (LLUUID::validate(id_str)) + { + LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(id_str)); + } +} + void LLUrlAction::copyLabelToClipboard(std::string url) { LLUrlMatch match; diff --git a/indra/llui/llurlaction.h b/indra/llui/llurlaction.h index c2c576254dc638055e43a0ab4216bc06a80aa958..5486333e21bf42e2537aee96d9e611299262a116 100644 --- a/indra/llui/llurlaction.h +++ b/indra/llui/llurlaction.h @@ -74,6 +74,9 @@ class LLUrlAction /// copy a Url to the clipboard static void copyURLToClipboard(std::string url); + /// copy a UUID to the clipboard + static void copyUUIDToClipboard(std::string url); + /// if the Url specifies an SL command in the form like 'app/{cmd}/{id}/*', show its profile static void showProfile(std::string url); static std::string getUserID(std::string url); diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index 659607ae80167805ad4eccf08abdb36c02bcec87..52beba93112e1af8069e1e400866ce331f2e8d9f 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -29,17 +29,20 @@ #include "llgrouplist.h" // libs +#include "llclipboard.h" #include "llbutton.h" #include "llgroupiconctrl.h" #include "llmenugl.h" #include "lltextbox.h" #include "lltextutil.h" #include "lltrans.h" +#include "llwindow.h" // newview #include "llagent.h" #include "llgroupactions.h" #include "llfloaterreg.h" +#include "llslurl.h" #include "llviewercontrol.h" // for gSavedSettings #include "llviewermenu.h" // for gMenuHolder #include "llvoiceclient.h" @@ -377,6 +380,24 @@ bool LLGroupList::onContextMenuItemClick(const LLSD& userdata) { LLGroupActions::leave(selected_group); } + else if (action == "copy_label") + { + std::string group_name; + gCacheName->getGroupName(LLUUID(selected_group), group_name); + LLWString wstr = utf8str_to_wstring(group_name); + LLClipboard::instance().copyToClipboard(wstr, 0, wstr.size()); + } + else if (action == "copy_slurl") + { + std::string slurl = LLSLURL("group", selected_group, "about").getSLURLString(); + LLWString wstr = utf8str_to_wstring(slurl); + LLClipboard::instance().copyToClipboard(wstr, 0, wstr.size()); + } + else if (action == "copy_uuid") + { + LLWString wstr = utf8str_to_wstring(selected_group.asString()); + LLClipboard::instance().copyToClipboard(wstr, 0, wstr.size()); + } return true; } diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 0a5b8142ca4466f08f4cdac9f7a99ea3d53c39e4..fc7c3ed2c85825e6756aa8bca761310c9e3d84ac 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -1436,6 +1436,11 @@ void LLPanelProfileSecondLife::onCommitMenu(const LLSD& userdata) { LLAvatarActions::toggleBlock(agent_id); } + else if (item_name == "copy_user_slurl") + { + LLWString wstr = utf8str_to_wstring(LLSLURL("agent", getAvatarId(), "about").getSLURLString()); + LLClipboard::instance().copyToClipboard(wstr, 0, wstr.size()); + } else if (item_name == "copy_user_id") { LLWString wstr = utf8str_to_wstring(getAvatarId().asString()); diff --git a/indra/newview/skins/default/xui/en/menu_attachment_other.xml b/indra/newview/skins/default/xui/en/menu_attachment_other.xml index 6afa27c3f3388a0169fa4cafa978d6986b5bd397..491535e798853b18419465f58904a6aaa40dfff5 100644 --- a/indra/newview/skins/default/xui/en/menu_attachment_other.xml +++ b/indra/newview/skins/default/xui/en/menu_attachment_other.xml @@ -165,8 +165,8 @@ function="RLV.CanShowName" /> </menu_item_call> <menu_item_call - label="Copy ID" - name="Copy ID"> + label="Copy Agent UUID" + name="Copy Agent ID"> <menu_item_call.on_click function="Avatar.CopyData" parameter="id"/> @@ -284,4 +284,10 @@ function="Floater.ShowOrBringToFront" parameter="inspect" /> </menu_item_call> + <menu_item_call + label="Copy Object UUID" + name="Copy Object ID"> + <menu_item_call.on_click + function="Object.CopyID" /> + </menu_item_call> </context_menu> diff --git a/indra/newview/skins/default/xui/en/menu_attachment_self.xml b/indra/newview/skins/default/xui/en/menu_attachment_self.xml index 0d7aa6677921c3f573e483e301e92c5e903adca7..5815c5300c812f0c8897e566f4d1fce1d6565461 100644 --- a/indra/newview/skins/default/xui/en/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/en/menu_attachment_self.xml @@ -63,6 +63,12 @@ function="Floater.ShowOrBringToFront" parameter="inspect" /> </menu_item_call> + <menu_item_call + label="Copy Object UUID" + name="Copy Object ID"> + <menu_item_call.on_click + function="Object.CopyID" /> + </menu_item_call> <menu_item_separator layout="topleft" /> <menu_item_call diff --git a/indra/newview/skins/default/xui/en/menu_avatar_icon.xml b/indra/newview/skins/default/xui/en/menu_avatar_icon.xml index 2cef9c1de8b86bbdece669187c5d317689fa26db..7ae9ad6562e17b3ebe2286203b88782b0f82acbb 100644 --- a/indra/newview/skins/default/xui/en/menu_avatar_icon.xml +++ b/indra/newview/skins/default/xui/en/menu_avatar_icon.xml @@ -195,7 +195,7 @@ parameter="slurl"/> </menu_item_call> <menu_item_call - label="Copy ID" + label="Copy UUID" name="Copy ID"> <menu_item_call.on_click function="AvatarIcon.CopyData" diff --git a/indra/newview/skins/default/xui/en/menu_avatar_other.xml b/indra/newview/skins/default/xui/en/menu_avatar_other.xml index 8145b465c1d07e505532a81ed51eaf0f0a61e28a..f83d036fd150b6714d4c79e66f0330febd7f6397 100644 --- a/indra/newview/skins/default/xui/en/menu_avatar_other.xml +++ b/indra/newview/skins/default/xui/en/menu_avatar_other.xml @@ -167,7 +167,7 @@ function="RLV.CanShowName" /> </menu_item_call> <menu_item_call - label="Copy ID" + label="Copy UUID" name="Copy ID"> <menu_item_call.on_click function="Avatar.CopyData" diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml index cadc32c24a986348d89b72a2dfe5d85f37719d27..a3ec370e1a20a2483494449ab192c8a29d14dd37 100644 --- a/indra/newview/skins/default/xui/en/menu_conversation.xml +++ b/indra/newview/skins/default/xui/en/menu_conversation.xml @@ -268,7 +268,7 @@ parameter="copy_slurl"/> </menu_item_call> <menu_item_call - label="Copy ID" + label="Copy UUID" name="copy_uuid"> <menu_item_call.on_click function="Avatar.DoToSelected" diff --git a/indra/newview/skins/default/xui/en/menu_gesture_gear.xml b/indra/newview/skins/default/xui/en/menu_gesture_gear.xml index 359c093eff9fd9584318b2518b8033f2af9de82d..359df63634d08607379a77905e43e96432ca680e 100644 --- a/indra/newview/skins/default/xui/en/menu_gesture_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_gesture_gear.xml @@ -44,7 +44,7 @@ parameter="paste" /> </menu_item_call> <menu_item_call - label="Copy UUID" + label="Copy Asset UUID" layout="topleft" name="copy_uuid"> <on_click diff --git a/indra/newview/skins/default/xui/en/menu_im_conversation.xml b/indra/newview/skins/default/xui/en/menu_im_conversation.xml index 9f8002ab3c2998d1732c45b6ad4b19cf2050389d..464c684beefff394c1049c6388be3c6f73d93035 100644 --- a/indra/newview/skins/default/xui/en/menu_im_conversation.xml +++ b/indra/newview/skins/default/xui/en/menu_im_conversation.xml @@ -141,7 +141,7 @@ parameter="copy_slurl"/> </menu_item_call> <menu_item_call - label="Copy ID" + label="Copy UUID" name="copy_uuid"> <menu_item_call.on_click function="Avatar.GearDoToSelected" diff --git a/indra/newview/skins/default/xui/en/menu_object.xml b/indra/newview/skins/default/xui/en/menu_object.xml index 51d68c2273217db1f797bf7f9851ea63f9070fec..fd5543bfb57063853636021373ba4e19c95008c3 100644 --- a/indra/newview/skins/default/xui/en/menu_object.xml +++ b/indra/newview/skins/default/xui/en/menu_object.xml @@ -371,7 +371,7 @@ function="Avatar.EnableResetSkeleton"/> </menu_item_call> <menu_item_call - label="Copy ID" + label="Copy Object UUID" name="Copy ID"> <menu_item_call.on_click function="Object.CopyID" /> diff --git a/indra/newview/skins/default/xui/en/menu_people_groups.xml b/indra/newview/skins/default/xui/en/menu_people_groups.xml index 1e0364b84eb658635cb4ff8aae7558c1a82c3b7d..c82f834fccca9d5970d5977010dd82e0c52d0b53 100644 --- a/indra/newview/skins/default/xui/en/menu_people_groups.xml +++ b/indra/newview/skins/default/xui/en/menu_people_groups.xml @@ -42,6 +42,40 @@ function="People.Groups.Enable" parameter="call" /> </menu_item_call> + <menu_item_separator /> + <menu_item_call + label="Copy Name" + layout="topleft" + name="copy_label"> + <menu_item_call.on_click + function="People.Groups.Action" + parameter="copy_label" /> + <menu_item_call.on_enable + function="People.Groups.Enable" + parameter="copy_label" /> + </menu_item_call> + <menu_item_call + label="Copy SLurl" + layout="topleft" + name="copy_slurl"> + <menu_item_call.on_click + function="People.Groups.Action" + parameter="copy_slurl" /> + <menu_item_call.on_enable + function="People.Groups.Enable" + parameter="copy_slurl" /> + </menu_item_call> + <menu_item_call + label="Copy UUID" + layout="topleft" + name="copy_uuid"> + <menu_item_call.on_click + function="People.Groups.Action" + parameter="copy_uuid" /> + <menu_item_call.on_enable + function="People.Groups.Enable" + parameter="copy_uuid" /> + </menu_item_call> <menu_item_separator /> <menu_item_call label="Leave" diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby.xml b/indra/newview/skins/default/xui/en/menu_people_nearby.xml index ef4b0e00e893d862b22dd2b52977eb9c715ceaab..dfc51eb4c954f806ed4afd914d59bd557e485bd6 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml @@ -244,7 +244,7 @@ parameter="slurl"/> </menu_item_call> <menu_item_call - label="Copy ID" + label="Copy UUID" name="copy_uuid"> <menu_item_call.on_click function="Avatar.CopyData" diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml b/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml index 6c366fea7825ad0e02f62c27a7b511dbaec5f83d..044377f2cc3e543140b0e1b2f8ff360dba2542de 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml @@ -151,7 +151,7 @@ parameter="slurl"/> </menu_item_call> <menu_item_call - label="Copy ID" + label="Copy UUID" name="copy_uuid"> <menu_item_call.on_click function="Avatar.CopyData" diff --git a/indra/newview/skins/default/xui/en/menu_profile_legacy.xml b/indra/newview/skins/default/xui/en/menu_profile_legacy.xml index eb84af1aee03e927a3b8007dd0baecc2af8cc67c..93724bbca1a0e59e67f2f1151d08045ddfd660c1 100644 --- a/indra/newview/skins/default/xui/en/menu_profile_legacy.xml +++ b/indra/newview/skins/default/xui/en/menu_profile_legacy.xml @@ -126,7 +126,7 @@ function="RLV.CanShowName" /> </menu_item_call> <menu_item_call - label="Copy ID" + label="Copy UUID" name="Copy ID"> <menu_item_call.on_click function="Avatar.CopyData" diff --git a/indra/newview/skins/default/xui/en/menu_profile_other.xml b/indra/newview/skins/default/xui/en/menu_profile_other.xml index 4db4d0922bff01021eaa54012c72ebbafc3b0f1a..b6c7ed943610d0aa9b232c89113b695a7ecd72f8 100644 --- a/indra/newview/skins/default/xui/en/menu_profile_other.xml +++ b/indra/newview/skins/default/xui/en/menu_profile_other.xml @@ -161,7 +161,15 @@ parameter="copy_username"/> </menu_item_call> <menu_item_call - label="Copy Agent Id" + label="Copy SLurl" + layout="topleft" + name="copy_slurl"> + <menu_item_call.on_click + function="Profile.Commit" + parameter="copy_user_slurl"/> + </menu_item_call> + <menu_item_call + label="Copy UUID" layout="topleft" name="copy_id"> <menu_item_call.on_click diff --git a/indra/newview/skins/default/xui/en/menu_profile_self.xml b/indra/newview/skins/default/xui/en/menu_profile_self.xml index d0bd4000f853d56eb0d5c266fab2d8155958416a..83ef3ae4833ccc2bbd616dab77e1c449b68029f7 100644 --- a/indra/newview/skins/default/xui/en/menu_profile_self.xml +++ b/indra/newview/skins/default/xui/en/menu_profile_self.xml @@ -75,7 +75,15 @@ parameter="copy_username"/> </menu_item_call> <menu_item_call - label="Copy Agent Id" + label="Copy SLurl" + layout="topleft" + name="copy_slurl"> + <menu_item_call.on_click + function="Profile.Commit" + parameter="copy_user_slurl"/> + </menu_item_call> + <menu_item_call + label="Copy UUID" layout="topleft" name="copy_id"> <menu_item_call.on_click diff --git a/indra/newview/skins/default/xui/en/menu_settings_gear.xml b/indra/newview/skins/default/xui/en/menu_settings_gear.xml index ea8e328407d99cfbe02c1f8e09368be123afb426..93aa47abe6e8415f652512090b35960f089729d0 100644 --- a/indra/newview/skins/default/xui/en/menu_settings_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_settings_gear.xml @@ -73,7 +73,7 @@ parameter="paste" /> </menu_item_call> <menu_item_call - label="Copy UUID" + label="Copy Asset UUID" layout="topleft" name="copy_uuid"> <on_click diff --git a/indra/newview/skins/default/xui/en/menu_url_agent.xml b/indra/newview/skins/default/xui/en/menu_url_agent.xml index 5ca8be212306c345e2bb55a712db966810e0eca3..255e6bbf2d63a6eb7982180c4e4fedd0923c923f 100644 --- a/indra/newview/skins/default/xui/en/menu_url_agent.xml +++ b/indra/newview/skins/default/xui/en/menu_url_agent.xml @@ -53,4 +53,11 @@ <menu_item_call.on_click function="Url.CopyUrl" /> </menu_item_call> + <menu_item_call + label="Copy UUID to clipboard" + layout="topleft" + name="url_copy_uuid"> + <menu_item_call.on_click + function="Url.CopyUUID" /> + </menu_item_call> </context_menu> diff --git a/indra/newview/skins/default/xui/en/menu_url_group.xml b/indra/newview/skins/default/xui/en/menu_url_group.xml index 2cb125ce09465a3f074bb227cf7a7ffb5178347a..792c2581a72d17e1343ac8a41b62ac707ce1527a 100644 --- a/indra/newview/skins/default/xui/en/menu_url_group.xml +++ b/indra/newview/skins/default/xui/en/menu_url_group.xml @@ -25,4 +25,11 @@ <menu_item_call.on_click function="Url.CopyUrl" /> </menu_item_call> + <menu_item_call + label="Copy UUID to clipboard" + layout="topleft" + name="url_copy_uuid"> + <menu_item_call.on_click + function="Url.CopyUUID" /> + </menu_item_call> </context_menu> diff --git a/indra/newview/skins/default/xui/en/menu_url_objectim.xml b/indra/newview/skins/default/xui/en/menu_url_objectim.xml index 41d40b389a6a65e4fbae62606569f702ffecff82..00ff524ed48cc89724f90edd9eb08eee8fd9486b 100644 --- a/indra/newview/skins/default/xui/en/menu_url_objectim.xml +++ b/indra/newview/skins/default/xui/en/menu_url_objectim.xml @@ -55,4 +55,11 @@ <menu_item_call.on_click function="Url.CopyUrl" /> </menu_item_call> + <menu_item_call + label="Copy UUID to clipboard" + layout="topleft" + name="url_copy_uuid"> + <menu_item_call.on_click + function="Url.CopyUUID" /> + </menu_item_call> </context_menu>