summaryrefslogtreecommitdiff
path: root/indra/newview/llchiclet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llchiclet.cpp')
-rw-r--r--indra/newview/llchiclet.cpp54
1 files changed, 21 insertions, 33 deletions
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index f1de4e2982..8efa814a2e 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -36,6 +36,7 @@
#include "llagent.h"
#include "llavataractions.h"
#include "llbottomtray.h"
+#include "lleventtimer.h"
#include "llgroupactions.h"
#include "lliconctrl.h"
#include "llimfloater.h"
@@ -459,6 +460,14 @@ LLIMChiclet::LLIMChiclet(const LLIMChiclet::Params& p)
enableCounterControl(p.enable_counter);
}
+/* virtual*/
+BOOL LLIMChiclet::postBuild()
+{
+ mChicletButton = getChild<LLButton>("chiclet_button");
+ mChicletButton->setCommitCallback(boost::bind(&LLIMChiclet::onMouseDown, this));
+ mChicletButton->setDoubleClickCallback(boost::bind(&LLIMChiclet::onMouseDown, this));
+ return TRUE;
+}
void LLIMChiclet::setShowSpeaker(bool show)
{
bool needs_resize = getShowSpeaker() != show;
@@ -537,6 +546,7 @@ void LLIMChiclet::toggleSpeakerControl()
}
setRequiredWidth();
+ mSpeakerCtrl->setSpeakerId(LLUUID::null);
mSpeakerCtrl->setVisible(getShowSpeaker());
}
@@ -583,12 +593,6 @@ void LLIMChiclet::setToggleState(bool toggle)
mChicletButton->setToggleState(toggle);
}
-BOOL LLIMChiclet::handleMouseDown(S32 x, S32 y, MASK mask)
-{
- onMouseDown();
- return LLChiclet::handleMouseDown(x, y, mask);
-}
-
void LLIMChiclet::draw()
{
LLUICtrl::draw();
@@ -952,7 +956,10 @@ LLIMGroupChiclet::~LLIMGroupChiclet()
void LLIMGroupChiclet::draw()
{
- switchToCurrentSpeaker();
+ if(getShowSpeaker())
+ {
+ switchToCurrentSpeaker();
+ }
LLIMChiclet::draw();
}
@@ -1152,10 +1159,10 @@ void im_chiclet_callback(LLChicletPanel* panel, const LLSD& data){
void object_chiclet_callback(const LLSD& data)
{
- LLUUID object_id = data["object_id"];
+ LLUUID notification_id = data["notification_id"];
bool new_message = data["new_message"];
- std::list<LLChiclet*> chiclets = LLIMChiclet::sFindChicletsSignal(object_id);
+ std::list<LLChiclet*> chiclets = LLIMChiclet::sFindChicletsSignal(notification_id);
std::list<LLChiclet *>::iterator iter;
for (iter = chiclets.begin(); iter != chiclets.end(); iter++)
{
@@ -1887,12 +1894,8 @@ void LLScriptChiclet::setSessionId(const LLUUID& session_id)
setShowNewMessagesIcon( getSessionId() != session_id );
LLIMChiclet::setSessionId(session_id);
- LLUUID notification_id = LLScriptFloaterManager::getInstance()->findNotificationId(session_id);
- LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id);
- if(notification)
- {
- setToolTip(notification->getSubstitutions()["TITLE"].asString());
- }
+
+ setToolTip(LLScriptFloaterManager::getObjectName(session_id));
}
void LLScriptChiclet::setCounter(S32 counter)
@@ -1905,12 +1908,6 @@ void LLScriptChiclet::onMouseDown()
LLScriptFloaterManager::getInstance()->toggleScriptFloater(getSessionId());
}
-BOOL LLScriptChiclet::handleMouseDown(S32 x, S32 y, MASK mask)
-{
- onMouseDown();
- return LLChiclet::handleMouseDown(x, y, mask);
-}
-
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
@@ -1947,13 +1944,10 @@ void LLInvOfferChiclet::setSessionId(const LLUUID& session_id)
{
setShowNewMessagesIcon( getSessionId() != session_id );
+ setToolTip(LLScriptFloaterManager::getObjectName(session_id));
+
LLIMChiclet::setSessionId(session_id);
- LLUUID notification_id = LLScriptFloaterManager::getInstance()->findNotificationId(session_id);
- LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id);
- if(notification)
- {
- setToolTip(notification->getSubstitutions()["TITLE"].asString());
- }
+ LLNotificationPtr notification = LLNotifications::getInstance()->find(session_id);
if ( notification && notification->getName() == INVENTORY_USER_OFFER )
{
@@ -1975,10 +1969,4 @@ void LLInvOfferChiclet::onMouseDown()
LLScriptFloaterManager::instance().toggleScriptFloater(getSessionId());
}
-BOOL LLInvOfferChiclet::handleMouseDown(S32 x, S32 y, MASK mask)
-{
- onMouseDown();
- return LLChiclet::handleMouseDown(x, y, mask);
-}
-
// EOF