Group Feature Request: Option to Copy SLURL for an avatar's profile

Added to avatar list menus and instant message drop down menu.
This commit is contained in:
Inusaito Sayori
2014-02-02 16:27:20 -05:00
parent 31b3ae584e
commit 31aa30e3d0
7 changed files with 37 additions and 5 deletions

View File

@@ -964,6 +964,8 @@ void LLFloaterIMPanel::addDynamics(LLComboBox* flyout)
//flyout->add(LLAvatarActions::isBlocked(mOtherParticipantUUID) ? getString("unmute") : getString("mute"), 9);
}
void copy_profile_uri(const LLUUID& id, bool group = false);
void LLFloaterIMPanel::onFlyoutCommit(LLComboBox* flyout, const LLSD& value)
{
if (value.isUndefined())
@@ -978,6 +980,7 @@ void LLFloaterIMPanel::onFlyoutCommit(LLComboBox* flyout, const LLSD& value)
else if (option == 3) LLAvatarActions::teleportRequest(mOtherParticipantUUID);
else if (option == 4) LLAvatarActions::pay(mOtherParticipantUUID);
else if (option == 5) LLAvatarActions::inviteToGroup(mOtherParticipantUUID);
else if (option == -1) copy_profile_uri(mOtherParticipantUUID);
else if (option >= 6) // Options that use dynamic items
{
// First remove them all

View File

@@ -129,10 +129,7 @@ void LLPanelGroupTab::handleClickHelp()
}
}
static void copy_group_profile_uri(const LLUUID& id)
{
gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring("secondlife:///app/group/"+id.asString()+"/about"));
}
void copy_profile_uri(const LLUUID& id, bool group);
LLPanelGroup::LLPanelGroup(const LLUUID& group_id)
: LLPanel("PanelGroup", LLRect(), FALSE),
@@ -163,7 +160,7 @@ LLPanelGroup::LLPanelGroup(const LLUUID& group_id)
LLGroupMgr::getInstance()->addObserver(this);
mCommitCallbackRegistrar.add("Group.CopyURI", boost::bind(copy_group_profile_uri, boost::ref(mID)));
mCommitCallbackRegistrar.add("Group.CopyURI", boost::bind(copy_profile_uri, boost::ref(mID), true));
// Pass on construction of this panel to the control factory.
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_group.xml", &getFactoryMap());
}

View File

@@ -9325,6 +9325,18 @@ const uuid_vec_t get_focused_list_ids_selected()
return uuid_vec_t();
}
const LLWString get_slurl_for(const LLUUID& id, bool group)
{
std::string str("secondlife:///app/");
str += group ? "group/" : "agent/";
return utf8str_to_wstring(str + id.asString() + "/about");
}
void copy_profile_uri(const LLUUID& id, bool group)
{
gViewerWindow->getWindow()->copyTextToClipboard(get_slurl_for(id, group));
}
class ListEnableAnySelected : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -9412,6 +9424,15 @@ class ListVisibleWebProfile : public view_listener_t
}
};
class ListCopySLURL : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
copy_profile_uri(get_focused_list_id_selected(), false);
return true;
}
};
class ListCopyUUIDs : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -9939,6 +9960,7 @@ void initialize_menus()
addMenu(new ListEnableMute(), "List.EnableMute");
addMenu(new ListEnableOfferTeleport(), "List.EnableOfferTeleport");
addMenu(new ListVisibleWebProfile(), "List.VisibleWebProfile");
addMenu(new ListCopySLURL(), "List.CopySLURL");
addMenu(new ListCopyUUIDs(), "List.CopyUUIDs");
addMenu(new ListInviteToGroup(), "List.InviteToGroup");
addMenu(new ListOfferTeleport(), "List.OfferTeleport");

View File

@@ -14,6 +14,7 @@
<flyout_button bottom="-37" height="20" label="Profile" left="5" name="instant_message_flyout" width="80" list_position="below">
<flyout_button_item label="Request Teleport" name="request_teleport_item" value="3"/>
<flyout_button_item label="Invite To Group" name="group_invite_item" value="5"/>
<flyout_button_item label="Copy SLURL" name="copy_slurl_item" value="-1"/>
</flyout_button>
<string name="ding on" value="Ding on new messages (On)"/>
<string name="ding off" value="Ding on new messages (Off)"/>

View File

@@ -17,6 +17,7 @@
<flyout_button_item label="Request Teleport" name="request_teleport_item" value="3"/>
<flyout_button_item label="Pay" name="pay_item" value="4"/>
<flyout_button_item label="Invite To Group" name="group_invite_item" value="5"/>
<flyout_button_item label="Copy SLURL" name="copy_slurl_item" value="-1"/>
</flyout_button>
<string name="ding on" value="Ding on new messages (On)"/>
<string name="ding off" value="Ding on new messages (Off)"/>

View File

@@ -66,4 +66,8 @@
<on_click function="List.CopyUUIDs"/>
<on_enable function="List.EnableAnySelected"/>
</menu_item_call>
<menu_item_call label="Copy SLURL" name="Copy SLURL">
<on_click function="List.CopySLURL"/>
<on_visible function="List.EnableSingleSelected"/>
</menu_item_call>
</menu>

View File

@@ -65,6 +65,10 @@
<on_click function="List.CopyUUIDs"/>
<on_enable function="List.EnableAnySelected"/>
</menu_item_call>
<menu_item_call label="Copy SLURL" name="Copy SLURL">
<on_click function="List.CopySLURL"/>
<on_visible function="List.EnableSingleSelected"/>
</menu_item_call>
</menu>
<menu label="Focusing" name="Focusing" create_jump_keys="true">
<menu_item_call label="Focus" name="Focus" shortcut="Enter">