From 36e0f729d33a2e87809f8185cb73016e54ba76a5 Mon Sep 17 00:00:00 2001 From: Dmitry Oleshko Date: Thu, 12 Nov 2009 12:59:04 +0200 Subject: final fix for (EXT-989) IM chiclets should expand to show active voice indicator (EXT-988) Change indication of unread messges in chiclets fixed chiclets' behavior in the Message Well Window --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 44 +++++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) (limited to 'indra/newview/llchiclet.cpp') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index b919195fb2..e416151748 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -54,10 +54,12 @@ static LLDefaultChildRegistry::Register t1("chiclet_panel"); static LLDefaultChildRegistry::Register t2("chiclet_notification"); static LLDefaultChildRegistry::Register t3("chiclet_im_p2p"); static LLDefaultChildRegistry::Register t4("chiclet_im_group"); +static LLDefaultChildRegistry::Register t5("chiclet_im_adhoc"); static const LLRect CHICLET_RECT(0, 25, 25, 0); -static const LLRect CHICLET_ICON_RECT(0, 24, 24, 0); +static const LLRect CHICLET_ICON_RECT(0, 22, 22, 0); static const LLRect VOICE_INDICATOR_RECT(25, 25, 45, 0); +static const S32 OVERLAY_ICON_SHIFT = 2; // used for shifting of an overlay icon for new massages in a chiclet // static const S32 LLChicletPanel::s_scroll_ratio = 10; @@ -217,13 +219,15 @@ LLIMChiclet::LLIMChiclet(const LLIMChiclet::Params& p) icon_params.visible = false; icon_params.image = LLUI::getUIImage(p.new_messages_icon_name); mNewMessagesIcon = LLUICtrlFactory::create(icon_params); + addChild(mNewMessagesIcon); + // adjust size and position of an icon LLRect chiclet_rect = p.rect; - LLRect overlay_icon_rect = LLRect(chiclet_rect.getWidth()/2, chiclet_rect.mTop, chiclet_rect.mRight, chiclet_rect.getHeight()/2); - // shift an icon a little bit to the right and up corner of a chiclet - overlay_icon_rect.translate(overlay_icon_rect.getWidth()/5, overlay_icon_rect.getHeight()/5); + LLRect overlay_icon_rect = LLRect(chiclet_rect.getWidth()/2, chiclet_rect.getHeight(), chiclet_rect.getWidth(), chiclet_rect.getHeight()/2); mNewMessagesIcon->setRect(overlay_icon_rect); - addChild(mNewMessagesIcon); + + // shift an icon a little bit to the right and up corner of a chiclet + overlay_icon_rect.translate(OVERLAY_ICON_SHIFT, OVERLAY_ICON_SHIFT); setShowCounter(false); } @@ -602,6 +606,9 @@ BOOL LLAdHocChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask) LLIMGroupChiclet::Params::Params() : group_icon("group_icon") +, unread_notifications("unread_notifications") +, speaker("speaker") +, show_speaker("show_speaker") { rect(CHICLET_RECT); @@ -880,19 +887,34 @@ BOOL LLChicletPanel::postBuild() void LLChicletPanel::onCurrentVoiceChannelChanged(const LLUUID& session_id) { - for(chiclet_list_t::iterator it = mChicletList.begin(); it != mChicletList.end(); ++it) + static LLUUID s_previous_active_voice_session_id; + + std::list chiclets = LLIMChiclet::sFindChicletsSignal(session_id); + + for(std::list::iterator it = chiclets.begin(); it != chiclets.end(); ++it) { LLIMChiclet* chiclet = dynamic_cast(*it); if(chiclet) { - if(chiclet->getSessionId() == session_id) + chiclet->setShowSpeaker(true); + } + } + + if(!s_previous_active_voice_session_id.isNull() && s_previous_active_voice_session_id != session_id) + { + chiclets = LLIMChiclet::sFindChicletsSignal(s_previous_active_voice_session_id); + + for(std::list::iterator it = chiclets.begin(); it != chiclets.end(); ++it) + { + LLIMChiclet* chiclet = dynamic_cast(*it); + if(chiclet) { - chiclet->setShowSpeaker(true); - continue; + chiclet->setShowSpeaker(false); } - chiclet->setShowSpeaker(false); - } + } } + + s_previous_active_voice_session_id = session_id; } S32 LLChicletPanel::calcChickletPanleWidth() -- cgit v1.2.3 From 2e01e2bfbd52aa599e8faa5f65b8861f989bee85 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Thu, 12 Nov 2009 15:24:58 +0200 Subject: no ticket, fixed IM message counting and firing new message balloon --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview/llchiclet.cpp') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index b919195fb2..b5119790c0 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -830,8 +830,13 @@ LLChicletPanel::~LLChicletPanel() void im_chiclet_callback(LLChicletPanel* panel, const LLSD& data){ LLUUID session_id = data["session_id"].asUUID(); - S32 unread = data["num_unread"].asInteger(); + LLUUID from_id = data["from_id"].asUUID(); + const std::string from = data["from"].asString(); + + //we do not show balloon (indicator of new messages) for system messages and our own messages + if (from_id.isNull() || from_id == gAgentID || SYSTEM_FROM == from) return; + S32 unread = data["num_unread"].asInteger(); LLIMFloater* im_floater = LLIMFloater::findInstance(session_id); if (im_floater && im_floater->getVisible()) { -- cgit v1.2.3 From 86c63e36b59d502f48acc935874050bbe361caf0 Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Thu, 12 Nov 2009 17:36:17 +0200 Subject: Fixed major bug EXT-2400-Viewer crashes on right button click upon IM P2P chiclet. Removed call to non-existing child --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llchiclet.cpp') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 12bbc29858..fd86192650 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -427,7 +427,6 @@ void LLIMP2PChiclet::updateMenuItems() bool is_friend = LLAvatarActions::isFriend(getOtherParticipantId()); mPopupMenu->getChild("Add Friend")->setEnabled(!is_friend); - mPopupMenu->getChild("Remove Friend")->setEnabled(is_friend); } BOOL LLIMP2PChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask) -- cgit v1.2.3 From 03a0b86335216ec22192c353b7bd4d9ee58dc732 Mon Sep 17 00:00:00 2001 From: Dmitry Oleshko Date: Fri, 13 Nov 2009 14:50:52 +0200 Subject: fixed normal bug (EXT-2454) "Unread message" indicator isn't reset for chiclet in the Message Well after opening IM window added a check, whether a new message came, in order to prevent unwanted return from function, that makes impossible updating chiclets' states --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra/newview/llchiclet.cpp') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index fd86192650..9e290c8c04 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -838,11 +838,15 @@ void im_chiclet_callback(LLChicletPanel* panel, const LLSD& data){ LLUUID session_id = data["session_id"].asUUID(); LLUUID from_id = data["from_id"].asUUID(); const std::string from = data["from"].asString(); + S32 unread = data["num_unread"].asInteger(); - //we do not show balloon (indicator of new messages) for system messages and our own messages - if (from_id.isNull() || from_id == gAgentID || SYSTEM_FROM == from) return; + // if new message came + if(unread != 0) + { + //we do not show balloon (indicator of new messages) for system messages and our own messages + if (from_id.isNull() || from_id == gAgentID || SYSTEM_FROM == from) return; + } - S32 unread = data["num_unread"].asInteger(); LLIMFloater* im_floater = LLIMFloater::findInstance(session_id); if (im_floater && im_floater->getVisible()) { @@ -862,7 +866,6 @@ void im_chiclet_callback(LLChicletPanel* panel, const LLSD& data){ llwarns << "Unable to set counter for chiclet " << session_id << llendl; } } - } -- cgit v1.2.3