summaryrefslogtreecommitdiff
path: root/indra/newview/llchiclet.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-08-26 20:47:27 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-08-26 20:47:27 +0000
commitaf98aad98d43ec8b128ecac3089426d6ae6edc3f (patch)
tree5971f87afc04580df470a003793dcc8c974e29a7 /indra/newview/llchiclet.cpp
parent6a364e6f32c12c1ab2c0f33e8ef07d885a8765a2 (diff)
svn merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1471 https://svn.aws.productengine.com/secondlife/pe/stable-1@1476 -> viewer-2.0.0-3
EXT-65 EXT-270 EXT-359 EXT-361 EXT-367 EXT-367 EXT-368 EXT-455 EXT-468 EXT-530 EXT-539 EXT-540 EXT-542 EXT-545 EXT-555 EXT-557 EXT-558 EXT-559 EXT-559 EXT-560 EXT-561 EXT-562 EXT-563 EXT-564 EXT-566 EXT-568 EXT-569 EXT-570 EXT-571 EXT-581 EXT-590 EXT-594 EXT-596 EXT-597 EXT-601 EXT-602 EXT-603 EXT-613 EXT-620 EXT-624 EXT-628 EXT-630 EXT-631 EXT-632 EXT-639 EXT-640 EXT-641 EXT-642 EXT-662 EXT-671 EXT-672 EXT-676 EXT-682 EXT-692 EXT-703 EXT-717
Diffstat (limited to 'indra/newview/llchiclet.cpp')
-rw-r--r--indra/newview/llchiclet.cpp94
1 files changed, 53 insertions, 41 deletions
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index c844d70d89..6b4dfa73a4 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -55,6 +55,10 @@ static LLDefaultChildRegistry::Register<LLTalkButton> t2("chiclet_talk");
static LLDefaultChildRegistry::Register<LLNotificationChiclet> t3("chiclet_notification");
static LLDefaultChildRegistry::Register<LLIMChiclet> t4("chiclet_im");
+S32 LLNotificationChiclet::mUreadSystemNotifications = 0;
+S32 LLNotificationChiclet::mUreadIMNotifications = 0;
+
+
boost::signals2::signal<LLChiclet* (const LLUUID&),
LLIMChiclet::CollectChicletCombiner<std::list<LLChiclet*> > >
LLIMChiclet::sFindChicletsSignal;
@@ -115,6 +119,12 @@ boost::signals2::connection LLNotificationChiclet::setClickCallback(
return mButton->setClickedCallback(cb);
}
+void LLNotificationChiclet::updateUreadIMNotifications()
+{
+ mUreadIMNotifications = gIMMgr->getNumberOfUnreadIM();
+ setCounter(mUreadSystemNotifications + mUreadIMNotifications);
+}
+
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
@@ -269,6 +279,12 @@ void LLIMChiclet::setCounter(S32 counter)
}
}
+void LLIMChiclet::onMouseDown()
+{
+ LLIMFloater::toggle(getSessionId());
+ setCounter(0);
+}
+
LLRect LLIMChiclet::getRequiredRect()
{
LLRect rect(0, 0, mAvatarCtrl->getRect().getWidth(), 0);
@@ -296,6 +312,38 @@ void LLIMChiclet::setShowCounter(bool show)
}
}
+
+void LLIMChiclet::setSessionId(const LLUUID& session_id)
+{
+ LLChiclet::setSessionId(session_id);
+
+ //for a group chat session_id = group_id
+ LLFloaterIMPanel* im = LLIMMgr::getInstance()->findFloaterBySession(session_id);
+ if (!im) return; //should never happen
+
+ EInstantMessage type = im->getDialogType();
+ if (type == IM_SESSION_INVITE || type == IM_SESSION_GROUP_START)
+ {
+ if (!gAgent.isInGroup(session_id)) return;
+
+ if (mGroupInsignia) {
+ LLGroupMgr* grp_mgr = LLGroupMgr::getInstance();
+ LLGroupMgrGroupData* group_data = grp_mgr->getGroupData(session_id);
+ if (group_data && group_data->mInsigniaID.notNull())
+ {
+ mGroupInsignia->setVisible(TRUE);
+ mGroupInsignia->setValue(group_data->mInsigniaID);
+ }
+ else
+ {
+ mID = session_id; //needed for LLGroupMgrObserver
+ grp_mgr->addObserver(this);
+ grp_mgr->sendGroupPropertiesRequest(session_id);
+ }
+ }
+ }
+}
+
void LLIMChiclet::setIMSessionName(const std::string& name)
{
setToolTip(name);
@@ -311,48 +359,13 @@ void LLIMChiclet::setOtherParticipantId(const LLUUID& other_participant_id)
//all alive sessions have alive floater, haven't they?
llassert(floater);
- //in case participant id is being replaced with different id for a group chat
- if (mOtherParticipantId.notNull() && mOtherParticipantId != other_participant_id &&
- mID.notNull() && mGroupInsignia->getValue().isUUID())
- {
- LLGroupMgr::getInstance()->removeObserver(this);
- }
-
mOtherParticipantId = other_participant_id;
- switch (floater->getDialogType())
+ if (mAvatarCtrl && floater->getDialogType() == IM_NOTHING_SPECIAL)
{
- case IM_NOTHING_SPECIAL:
- if (mAvatarCtrl) {
- mAvatarCtrl->setVisible(TRUE);
- mAvatarCtrl->setValue(other_participant_id);
- }
- break;
- case IM_SESSION_GROUP_START:
- {
- if (mGroupInsignia) {
- LLGroupMgr* grp_mgr = LLGroupMgr::getInstance();
- LLGroupMgrGroupData* group_data = grp_mgr->getGroupData(other_participant_id);
- if (group_data && group_data->mInsigniaID.notNull())
- {
- mGroupInsignia->setVisible(TRUE);
- mGroupInsignia->setValue(group_data->mInsigniaID);
- }
- else
- {
- mID = mOtherParticipantId; //needed for LLGroupMgrObserver
- grp_mgr->addObserver(this);
- grp_mgr->sendGroupPropertiesRequest(mOtherParticipantId);
- }
- }
- }
-
- break;
- default:
- llwarning("Unsupported dialog type", 0);
- break;
+ mAvatarCtrl->setVisible(TRUE);
+ mAvatarCtrl->setValue(other_participant_id);
}
-
}
@@ -363,7 +376,7 @@ void LLIMChiclet::changed(LLGroupChange gc)
if (GC_PROPERTIES == gc)
{
- LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(mOtherParticipantId);
+ LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(getSessionId());
if (group_data && group_data->mInsigniaID.notNull())
{
mGroupInsignia->setVisible(TRUE);
@@ -395,8 +408,7 @@ void LLIMChiclet::updateMenuItems()
BOOL LLIMChiclet::handleMouseDown(S32 x, S32 y, MASK mask)
{
- LLIMFloater::toggle(getSessionId());
- setCounter(0);
+ onMouseDown();
return LLChiclet::handleMouseDown(x, y, mask);
}