From 4b9c365b442acfd662086a8ce23209f8f7a7afc2 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Fri, 18 Dec 2009 14:00:00 +0200 Subject: Renamed method to reflect what it does --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 5 +++-- indra/newview/llcallfloater.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 7ca49928da..1acdb96da6 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -162,6 +162,7 @@ void LLCallFloater::onChange() if (NULL == mPaticipants) return; mPaticipants->refreshVoiceState(); + } @@ -243,7 +244,7 @@ void LLCallFloater::updateSession() childSetVisible("leave_call_btn", !is_local_chat); refreshPartisipantList(); - updateModeratorState(); + updateAgentModeratorState(); //show floater for voice calls if (!is_local_chat) @@ -366,7 +367,7 @@ void LLCallFloater::setModeratorMutedVoice(bool moderator_muted) mSpeakingIndicator->setIsMuted(moderator_muted); } -void LLCallFloater::updateModeratorState() +void LLCallFloater::updateAgentModeratorState() { std::string name; gCacheName->getFullName(gAgentID, name); diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index f9c9149085..ac45e283eb 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -101,7 +101,7 @@ private: void updateTitle(); void initAgentData(); void setModeratorMutedVoice(bool moderator_muted); - void updateModeratorState(); + void updateAgentModeratorState(); private: LLSpeakerMgr* mSpeakerManager; -- cgit v1.2.3 From dc8cd05082e4d82a578d4a20278725cdf5e0450f Mon Sep 17 00:00:00 2001 From: Andrew Polunin Date: Sat, 19 Dec 2009 18:35:38 +0200 Subject: implemented minor task EXT-3455 Code Improvements: Improve LLAvatarListItem not to calculate constant values in each constructing --HG-- branch : product-engine --- indra/newview/llavatarlistitem.cpp | 19 +++++++++++++++---- indra/newview/llavatarlistitem.h | 10 ++++++---- 2 files changed, 21 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 072eebdf2d..08b359d26e 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -43,6 +43,12 @@ #include "lltextutil.h" #include "llbutton.h" +bool LLAvatarListItem::mStaticInitialized = false; +S32 LLAvatarListItem::mIconWidth = 0; +S32 LLAvatarListItem::mInfoBtnWidth = 0; +S32 LLAvatarListItem::mProfileBtnWidth = 0; +S32 LLAvatarListItem::mSpeakingIndicatorWidth = 0; + LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/) : LLPanel(), mAvatarIcon(NULL), @@ -88,10 +94,15 @@ BOOL LLAvatarListItem::postBuild() // Remember avatar icon width including its padding from the name text box, // so that we can hide and show the icon again later. - mIconWidth = mAvatarName->getRect().mLeft - mAvatarIcon->getRect().mLeft; - mInfoBtnWidth = mInfoBtn->getRect().mRight - mSpeakingIndicator->getRect().mRight; - mProfileBtnWidth = mProfileBtn->getRect().mRight - mInfoBtn->getRect().mRight; - mSpeakingIndicatorWidth = mSpeakingIndicator->getRect().mRight - mAvatarName->getRect().mRight; + if (!mStaticInitialized) + { + mIconWidth = mAvatarName->getRect().mLeft - mAvatarIcon->getRect().mLeft; + mInfoBtnWidth = mInfoBtn->getRect().mRight - mSpeakingIndicator->getRect().mRight; + mProfileBtnWidth = mProfileBtn->getRect().mRight - mInfoBtn->getRect().mRight; + mSpeakingIndicatorWidth = mSpeakingIndicator->getRect().mRight - mAvatarName->getRect().mRight; + + mStaticInitialized = true; + } /* if(!p.buttons.profile) diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index aa1b7593f5..1272bdf7a9 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -135,10 +135,12 @@ private: //Speaker indicator and avatar name coords are translated accordingly bool mShowInfoBtn; bool mShowProfileBtn; - S32 mIconWidth; // icon width + padding - S32 mInfoBtnWidth; //info btn width + padding - S32 mProfileBtnWidth; //profile btn width + padding - S32 mSpeakingIndicatorWidth; //speaking indicator width + padding + + static bool mStaticInitialized; // this variable is introduced to improve code readability + static S32 mIconWidth; // icon width + padding + static S32 mInfoBtnWidth; //info btn width + padding + static S32 mProfileBtnWidth; //profile btn width + padding + static S32 mSpeakingIndicatorWidth; //speaking indicator width + padding }; #endif //LL_LLAVATARLISTITEM_H -- cgit v1.2.3 From 368c75ccd367320c650dbfdb62fdb3334e888f8a Mon Sep 17 00:00:00 2001 From: Andrew Polunin Date: Sat, 19 Dec 2009 18:52:14 +0200 Subject: no ticket. static variables renamed according to convention. --HG-- branch : product-engine --- indra/newview/llavatarlistitem.cpp | 38 +++++++++++++++++++------------------- indra/newview/llavatarlistitem.h | 10 +++++----- 2 files changed, 24 insertions(+), 24 deletions(-) (limited to 'indra') diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 08b359d26e..bbe5cdcc4a 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -43,11 +43,11 @@ #include "lltextutil.h" #include "llbutton.h" -bool LLAvatarListItem::mStaticInitialized = false; -S32 LLAvatarListItem::mIconWidth = 0; -S32 LLAvatarListItem::mInfoBtnWidth = 0; -S32 LLAvatarListItem::mProfileBtnWidth = 0; -S32 LLAvatarListItem::mSpeakingIndicatorWidth = 0; +bool LLAvatarListItem::sStaticInitialized = false; +S32 LLAvatarListItem::sIconWidth = 0; +S32 LLAvatarListItem::sInfoBtnWidth = 0; +S32 LLAvatarListItem::sProfileBtnWidth = 0; +S32 LLAvatarListItem::sSpeakingIndicatorWidth = 0; LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/) : LLPanel(), @@ -94,14 +94,14 @@ BOOL LLAvatarListItem::postBuild() // Remember avatar icon width including its padding from the name text box, // so that we can hide and show the icon again later. - if (!mStaticInitialized) + if (!sStaticInitialized) { - mIconWidth = mAvatarName->getRect().mLeft - mAvatarIcon->getRect().mLeft; - mInfoBtnWidth = mInfoBtn->getRect().mRight - mSpeakingIndicator->getRect().mRight; - mProfileBtnWidth = mProfileBtn->getRect().mRight - mInfoBtn->getRect().mRight; - mSpeakingIndicatorWidth = mSpeakingIndicator->getRect().mRight - mAvatarName->getRect().mRight; + sIconWidth = mAvatarName->getRect().mLeft - mAvatarIcon->getRect().mLeft; + sInfoBtnWidth = mInfoBtn->getRect().mRight - mSpeakingIndicator->getRect().mRight; + sProfileBtnWidth = mProfileBtn->getRect().mRight - mInfoBtn->getRect().mRight; + sSpeakingIndicatorWidth = mSpeakingIndicator->getRect().mRight - mAvatarName->getRect().mRight; - mStaticInitialized = true; + sStaticInitialized = true; } /* @@ -225,7 +225,7 @@ void LLAvatarListItem::setShowInfoBtn(bool show) if(mShowInfoBtn == show) return; mShowInfoBtn = show; - S32 width_delta = show ? - mInfoBtnWidth : mInfoBtnWidth; + S32 width_delta = show ? - sInfoBtnWidth : sInfoBtnWidth; //Translating speaking indicator mSpeakingIndicator->translate(width_delta, 0); @@ -239,7 +239,7 @@ void LLAvatarListItem::setShowProfileBtn(bool show) if(mShowProfileBtn == show) return; mShowProfileBtn = show; - S32 width_delta = show ? - mProfileBtnWidth : mProfileBtnWidth; + S32 width_delta = show ? - sProfileBtnWidth : sProfileBtnWidth; //Translating speaking indicator mSpeakingIndicator->translate(width_delta, 0); @@ -253,7 +253,7 @@ void LLAvatarListItem::setSpeakingIndicatorVisible(bool visible) if (mSpeakingIndicator->getVisible() == (BOOL)visible) return; mSpeakingIndicator->setVisible(visible); - S32 width_delta = visible ? - mSpeakingIndicatorWidth : mSpeakingIndicatorWidth; + S32 width_delta = visible ? - sSpeakingIndicatorWidth : sSpeakingIndicatorWidth; //Reshaping avatar name mAvatarName->reshape(mAvatarName->getRect().getWidth() + width_delta, mAvatarName->getRect().getHeight()); @@ -270,7 +270,7 @@ void LLAvatarListItem::setAvatarIconVisible(bool visible) // Move the avatar name horizontally by icon size + its distance from the avatar name. LLRect name_rect = mAvatarName->getRect(); - name_rect.mLeft += visible ? mIconWidth : -mIconWidth; + name_rect.mLeft += visible ? sIconWidth : -sIconWidth; mAvatarName->setRect(name_rect); } @@ -338,10 +338,10 @@ void LLAvatarListItem::onNameCache(const std::string& first_name, const std::str void LLAvatarListItem::reshapeAvatarName() { S32 width_delta = 0; - width_delta += mShowProfileBtn ? mProfileBtnWidth : 0; - width_delta += mSpeakingIndicator->getVisible() ? mSpeakingIndicatorWidth : 0; - width_delta += mAvatarIcon->getVisible() ? mIconWidth : 0; - width_delta += mShowInfoBtn ? mInfoBtnWidth : 0; + width_delta += mShowProfileBtn ? sProfileBtnWidth : 0; + width_delta += mSpeakingIndicator->getVisible() ? sSpeakingIndicatorWidth : 0; + width_delta += mAvatarIcon->getVisible() ? sIconWidth : 0; + width_delta += mShowInfoBtn ? sInfoBtnWidth : 0; width_delta += mLastInteractionTime->getVisible() ? mLastInteractionTime->getRect().getWidth() : 0; S32 height = mAvatarName->getRect().getHeight(); diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 1272bdf7a9..df8b04126e 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -136,11 +136,11 @@ private: bool mShowInfoBtn; bool mShowProfileBtn; - static bool mStaticInitialized; // this variable is introduced to improve code readability - static S32 mIconWidth; // icon width + padding - static S32 mInfoBtnWidth; //info btn width + padding - static S32 mProfileBtnWidth; //profile btn width + padding - static S32 mSpeakingIndicatorWidth; //speaking indicator width + padding + static bool sStaticInitialized; // this variable is introduced to improve code readability + static S32 sIconWidth; // icon width + padding + static S32 sInfoBtnWidth; //info btn width + padding + static S32 sProfileBtnWidth; //profile btn width + padding + static S32 sSpeakingIndicatorWidth; //speaking indicator width + padding }; #endif //LL_LLAVATARLISTITEM_H -- cgit v1.2.3 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" /> +