From 24b1f278247315efcc317394c200651ea7ab11d2 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Sat, 19 Dec 2009 19:55:04 +0200 Subject: Added "Group Call" verb button to the group list so that you can start a call without opening group chat first (EXT-3596). --HG-- branch : product-engine --- indra/newview/llgroupactions.cpp | 30 ++++++++++++++++++++++ indra/newview/llgroupactions.h | 5 ++++ indra/newview/llpanelpeople.cpp | 8 ++++++ indra/newview/llpanelpeople.h | 1 + .../newview/skins/default/xui/en/panel_people.xml | 10 ++++++++ 5 files changed, 54 insertions(+) (limited to 'indra') diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index ff75d461df..22658b4d65 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -118,6 +118,36 @@ void LLGroupActions::search() LLFloaterReg::showInstance("search", LLSD().with("category", "groups")); } +// static +void LLGroupActions::startCall(const LLUUID& group_id) +{ + // create a new group voice session + LLGroupData gdata; + + if (!gAgent.getGroupData(group_id, gdata)) + { + llwarns << "Error getting group data" << llendl; + return; + } + + LLUUID session_id = gIMMgr->addSession(gdata.mName, IM_SESSION_GROUP_START, group_id, true); + if (session_id == LLUUID::null) + { + llwarns << "Error adding session" << llendl; + return; + } + + // start the call + // *TODO: move this to LLIMMgr? + LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(session_id); + if (session && session->mSessionInitialized) + gIMMgr->startCall(session_id); + else + gIMMgr->autoStartCallOnStartup(session_id); + + make_ui_sound("UISndStartIM"); +} + // static void LLGroupActions::join(const LLUUID& group_id) { diff --git a/indra/newview/llgroupactions.h b/indra/newview/llgroupactions.h index 9750b3e3cb..e99df86cd9 100644 --- a/indra/newview/llgroupactions.h +++ b/indra/newview/llgroupactions.h @@ -98,6 +98,11 @@ public: /// Returns if the current user is a member of the group static bool isInGroup(const LLUUID& group_id); + /** + * Start a group voice call. + */ + static void startCall(const LLUUID& group_id); + /** * Returns true if avatar is in group. * diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index e134840153..e5846c7318 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -564,6 +564,7 @@ BOOL LLPanelPeople::postBuild() buttonSetAction("chat_btn", boost::bind(&LLPanelPeople::onChatButtonClicked, this)); buttonSetAction("im_btn", boost::bind(&LLPanelPeople::onImButtonClicked, this)); buttonSetAction("call_btn", boost::bind(&LLPanelPeople::onCallButtonClicked, this)); + buttonSetAction("group_call_btn", boost::bind(&LLPanelPeople::onGroupCallButtonClicked, this)); buttonSetAction("teleport_btn", boost::bind(&LLPanelPeople::onTeleportButtonClicked, this)); buttonSetAction("share_btn", boost::bind(&LLPanelPeople::onShareButtonClicked, this)); @@ -733,6 +734,7 @@ void LLPanelPeople::updateButtons() buttonSetVisible("view_profile_btn", !group_tab_active); buttonSetVisible("im_btn", !group_tab_active); buttonSetVisible("call_btn", !group_tab_active); + buttonSetVisible("group_call_btn", group_tab_active); buttonSetVisible("teleport_btn", friends_tab_active); buttonSetVisible("share_btn", nearby_tab_active || friends_tab_active); @@ -781,6 +783,7 @@ void LLPanelPeople::updateButtons() bool none_group_selected = item_selected && selected_id.isNull(); buttonSetEnabled("group_info_btn", !none_group_selected); + buttonSetEnabled("group_call_btn", !none_group_selected); buttonSetEnabled("chat_btn", !none_group_selected); } @@ -1272,6 +1275,11 @@ void LLPanelPeople::onCallButtonClicked() } } +void LLPanelPeople::onGroupCallButtonClicked() +{ + LLGroupActions::startCall(getCurrentItemID()); +} + void LLPanelPeople::onTeleportButtonClicked() { LLAvatarActions::offerTeleport(getCurrentItemID()); diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index f5cdc0935c..0d2bae1baf 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -100,6 +100,7 @@ private: void onChatButtonClicked(); void onImButtonClicked(); void onCallButtonClicked(); + void onGroupCallButtonClicked(); void onTeleportButtonClicked(); void onShareButtonClicked(); void onMoreButtonClicked(); diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 8883c27c47..08a10553a8 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -411,5 +411,15 @@ background_visible="true" name="chat_btn" tool_tip="Open chat session" width="110" /> +