From 52c27b99b839cccab09b61c5b02ced2e9df0a04b Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Fri, 20 Nov 2009 17:52:17 -0500 Subject: EXT-829 share button in people panel is inactive First pass at getting share buttons in the three places we need them: person's profile IM window people panel Only UI changes so far, functionality in a future checkin. Will be reviewed before pushing. --HG-- branch : avatar-pipeline --- indra/newview/llavataractions.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 0844cca766..a2beb6af93 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -324,6 +324,12 @@ void LLAvatarActions::pay(const LLUUID& id) } } +//static +void LLAvatarActions::share(const LLUUID& id) +{ + // TODO: share items with selected avatar +} + // static void LLAvatarActions::toggleBlock(const LLUUID& id) { -- cgit v1.2.3 From 24dbd81763254178bfcdb15d1ee3e4be48032b4b Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 23 Nov 2009 13:23:54 -0500 Subject: EXT-829 share button in profile inactive refactored share code to all call LLAvatarActions::share. Function opens an IM window if one doesn't already exist and prints an appropriate message, as well as opening the inventory sidepanel. Verified working in IM window, people tab, and individual's profile. Will be post-reviewed before push. --HG-- branch : avatar-pipeline --- indra/newview/llavataractions.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index a2beb6af93..89a774fd2b 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -327,7 +327,22 @@ void LLAvatarActions::pay(const LLUUID& id) //static void LLAvatarActions::share(const LLUUID& id) { - // TODO: share items with selected avatar + LLSD key; + LLSideTray::getInstance()->showPanel("sidepanel_inventory", key); + + + LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL,id); + + if (!gIMMgr->hasSession(session_id)) + { + startIM(id); + } + + if (gIMMgr->hasSession(session_id)) + { + // we should always get here, but check to verify anyways + LLIMModel::getInstance()->addMessage(session_id, SYSTEM_FROM, LLUUID::null, LLTrans::getString("share_alert"), false); + } } // static -- cgit v1.2.3 From cbc0783cd19f096b454cabe47174c97d3d42842b Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 25 Nov 2009 01:15:50 -0800 Subject: Created lightweight LLNotificationsUtil::add(), switched most alerts to use it Cuts number of includes of llnotifications.h from 300+ to 40. --- indra/newview/llavataractions.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index a133bd6fe6..43b8fd8adb 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -38,6 +38,7 @@ #include "llsd.h" #include "lldarray.h" #include "llnotifications.h" +#include "llnotificationsutil.h" #include "roles_constants.h" // for GP_MEMBER_INVITE @@ -69,7 +70,7 @@ void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::strin { if(id == gAgentID) { - LLNotifications::instance().add("AddSelfFriend"); + LLNotificationsUtil::add("AddSelfFriend"); return; } @@ -83,11 +84,11 @@ void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::strin { // Old and busted server version, doesn't support friend // requests with messages. - LLNotifications::instance().add("AddFriend", args, payload, &callbackAddFriend); + LLNotificationsUtil::add("AddFriend", args, payload, &callbackAddFriend); } else { - LLNotifications::instance().add("AddFriendWithMessage", args, payload, &callbackAddFriendWithMessage); + LLNotificationsUtil::add("AddFriendWithMessage", args, payload, &callbackAddFriendWithMessage); } // add friend to recent people list @@ -149,7 +150,7 @@ void LLAvatarActions::removeFriendsDialog(const std::vector& ids) payload["ids"].append(*it); } - LLNotifications::instance().add(msgType, + LLNotificationsUtil::add(msgType, args, payload, &handleRemove); @@ -359,7 +360,7 @@ void LLAvatarActions::inviteToGroup(const LLUUID& id) // static bool LLAvatarActions::handleRemove(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); const LLSD& ids = notification["payload"]["ids"]; for (LLSD::array_const_iterator itr = ids.beginArray(); itr != ids.endArray(); ++itr) @@ -393,7 +394,7 @@ bool LLAvatarActions::handleRemove(const LLSD& notification, const LLSD& respons // static bool LLAvatarActions::handlePay(const LLSD& notification, const LLSD& response, LLUUID avatar_id) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { gAgent.clearBusy(); @@ -416,7 +417,7 @@ void LLAvatarActions::callback_invite_to_group(LLUUID group_id, LLUUID id) // static bool LLAvatarActions::callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { requestFriendship(notification["payload"]["id"].asUUID(), @@ -429,7 +430,7 @@ bool LLAvatarActions::callbackAddFriendWithMessage(const LLSD& notification, con // static bool LLAvatarActions::callbackAddFriend(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { // Servers older than 1.25 require the text of the message to be the -- cgit v1.2.3