summaryrefslogtreecommitdiff
path: root/indra/newview/llimfloatercontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llimfloatercontainer.cpp')
-rw-r--r--indra/newview/llimfloatercontainer.cpp71
1 files changed, 63 insertions, 8 deletions
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index 6cc985aef4..2f248f3596 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -35,23 +35,25 @@
#include "llimfloatercontainer.h"
#include "llfloaterreg.h"
+#include "llimview.h"
+#include "llavatariconctrl.h"
+#include "llgroupiconctrl.h"
+#include "llagent.h"
//
// LLIMFloaterContainer
//
LLIMFloaterContainer::LLIMFloaterContainer(const LLSD& seed)
-: LLMultiFloater(seed),
- mActiveVoiceFloater(NULL)
+: LLMultiFloater(seed)
{
mAutoResize = FALSE;
}
-LLIMFloaterContainer::~LLIMFloaterContainer()
-{
-}
+LLIMFloaterContainer::~LLIMFloaterContainer(){}
BOOL LLIMFloaterContainer::postBuild()
{
+ LLIMModel::instance().mNewMsgSignal.connect(boost::bind(&LLIMFloaterContainer::onNewMessageReceived, this, _1));
// Do not call base postBuild to not connect to mCloseSignal to not close all floaters via Close button
// mTabContainer will be initialized in LLMultiFloater::addChild()
return TRUE;
@@ -87,10 +89,49 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
LLMultiFloater::addFloater(floaterp, select_added_floater, insertion_point);
- // make sure active voice icon shows up for new tab
- if (floaterp == mActiveVoiceFloater)
+ LLUUID session_id = floaterp->getKey();
+
+ LLIconCtrl* icon = 0;
+
+ if(gAgent.isInGroup(session_id, TRUE))
{
- mTabContainer->setTabImage(floaterp, "active_voice_tab.tga");
+ LLGroupIconCtrl::Params icon_params = LLUICtrlFactory::instance().getDefaultParams<LLGroupIconCtrl>();
+ icon_params.group_id = session_id;
+ icon = LLUICtrlFactory::instance().createWidget<LLGroupIconCtrl>(icon_params);
+
+ mSessions[session_id] = floaterp;
+ floaterp->mCloseSignal.connect(boost::bind(&LLIMFloaterContainer::onCloseFloater, this, session_id));
+ }
+ else
+ {
+ LLUUID avatar_id = LLIMModel::getInstance()->getOtherParticipantID(session_id);
+
+ LLAvatarIconCtrl::Params icon_params = LLUICtrlFactory::instance().getDefaultParams<LLAvatarIconCtrl>();
+ icon_params.avatar_id = avatar_id;
+ icon = LLUICtrlFactory::instance().createWidget<LLAvatarIconCtrl>(icon_params);
+
+ mSessions[session_id] = floaterp;
+ floaterp->mCloseSignal.connect(boost::bind(&LLIMFloaterContainer::onCloseFloater, this, session_id));
+ }
+ mTabContainer->setTabImage(floaterp, icon);
+}
+
+void LLIMFloaterContainer::onCloseFloater(LLUUID& id)
+{
+ mSessions.erase(id);
+}
+
+void LLIMFloaterContainer::onNewMessageReceived(const LLSD& data)
+{
+ LLUUID session_id = data["session_id"].asUUID();
+ LLFloater* floaterp = get_ptr_in_map(mSessions, session_id);
+ LLFloater* current_floater = LLMultiFloater::getActiveFloater();
+
+ if(floaterp && current_floater && floaterp != current_floater)
+ {
+ if(LLMultiFloater::isFloaterFlashing(floaterp))
+ LLMultiFloater::setFloaterFlashing(floaterp, FALSE);
+ LLMultiFloater::setFloaterFlashing(floaterp, TRUE);
}
}
@@ -104,4 +145,18 @@ LLIMFloaterContainer* LLIMFloaterContainer::getInstance()
return LLFloaterReg::getTypedInstance<LLIMFloaterContainer>("im_container");
}
+void LLIMFloaterContainer::setMinimized(BOOL b)
+{
+ if (isMinimized() == b) return;
+
+ LLMultiFloater::setMinimized(b);
+
+ if (isMinimized()) return;
+
+ if (getActiveFloater())
+ {
+ getActiveFloater()->setVisible(TRUE);
+ }
+}
+
// EOF