DEV-50202 IM toast notification shows SLID and flashing info icon

Fixed to use Display Name (Username), fixed icon placement,
also fixed notifications system well names.  Reviewed with Leyla.
meow-7.2.2
James Cook 2010-05-28 15:15:33 -07:00
parent 3e7f5e571e
commit ae91c0e7c6
6 changed files with 45 additions and 15 deletions

View File

@ -109,6 +109,20 @@ BOOL LLSessionTimeoutTimer::tick()
return TRUE;
}
static void on_avatar_name_cache_toast(const LLUUID& agent_id,
const LLAvatarName& av_name,
LLSD msg)
{
LLSD args;
args["MESSAGE"] = msg["message"];
args["TIME"] = msg["time"];
// *TODO: Can this ever be an object name or group name?
args["FROM"] = av_name.getCompleteName();
args["FROM_ID"] = msg["from_id"];
args["SESSION_ID"] = msg["session_id"];
LLNotificationsUtil::add("IMToast", args, LLSD(), boost::bind(&LLIMFloater::show, msg["session_id"].asUUID()));
}
void toast_callback(const LLSD& msg){
// do not show toast in busy mode or it goes from agent
if (gAgent.getBusy() || gAgent.getID() == msg["from_id"])
@ -136,14 +150,9 @@ void toast_callback(const LLSD& msg){
return;
}
LLSD args;
args["MESSAGE"] = msg["message"];
args["TIME"] = msg["time"];
args["FROM"] = msg["from"];
args["FROM_ID"] = msg["from_id"];
args["SESSION_ID"] = msg["session_id"];
LLNotificationsUtil::add("IMToast", args, LLSD(), boost::bind(&LLIMFloater::show, msg["session_id"].asUUID()));
LLAvatarNameCache::get(msg["from_id"].asUUID(),
boost::bind(&on_avatar_name_cache_toast,
_1, _2, msg));
}
void LLIMModel::setActiveSessionID(const LLUUID& session_id)

View File

@ -32,14 +32,15 @@
#include "llviewerprecompiledheaders.h" // must be first include
#include "llsyswellwindow.h"
#include "llagent.h"
#include "llavatarnamecache.h"
#include "llflatlistview.h"
#include "llfloaterreg.h"
#include "llnotifications.h"
#include "llsyswellwindow.h"
#include "llbottomtray.h"
#include "llscriptfloater.h"
#include "llviewercontrol.h"
@ -284,13 +285,30 @@ LLIMWellWindow::RowPanel::RowPanel(const LLSysWellWindow* parent, const LLUUID&
mChiclet->setOtherParticipantId(otherParticipantId);
mChiclet->setVisible(true);
LLTextBox* contactName = getChild<LLTextBox>("contact_name");
contactName->setValue(name);
if (im_chiclet_type == LLIMChiclet::TYPE_IM)
{
LLAvatarNameCache::get(otherParticipantId,
boost::bind(&LLIMWellWindow::RowPanel::onAvatarNameCache,
this, _1, _2));
}
else
{
LLTextBox* contactName = getChild<LLTextBox>("contact_name");
contactName->setValue(name);
}
mCloseBtn = getChild<LLButton>("hide_btn");
mCloseBtn->setCommitCallback(boost::bind(&LLIMWellWindow::RowPanel::onClosePanel, this));
}
//---------------------------------------------------------------------------------
void LLIMWellWindow::RowPanel::onAvatarNameCache(const LLUUID& agent_id,
const LLAvatarName& av_name)
{
LLTextBox* contactName = getChild<LLTextBox>("contact_name");
contactName->setValue( av_name.getCompleteName() );
}
//---------------------------------------------------------------------------------
void LLIMWellWindow::RowPanel::onChicletSizeChanged(LLChiclet* ctrl, const LLSD& param)
{

View File

@ -43,6 +43,7 @@
#include "boost/shared_ptr.hpp"
class LLAvatarName;
class LLFlatListView;
class LLChiclet;
class LLIMChiclet;
@ -208,6 +209,7 @@ private:
private:
static const S32 CHICLET_HPAD = 10;
void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name);
void onChicletSizeChanged(LLChiclet* ctrl, const LLSD& param);
void onClosePanel();
public:

View File

@ -147,7 +147,8 @@ void LLToastIMPanel::spawnNameToolTip()
{
// Spawn at right side of the name textbox.
LLRect sticky_rect = mAvatarName->calcScreenRect();
S32 icon_x = llmin(sticky_rect.mLeft + mAvatarName->getTextPixelWidth() + 3, sticky_rect.mRight - 16);
S32 icon_x =
llmin(sticky_rect.mLeft + mAvatarName->getTextPixelWidth() + 3, sticky_rect.mRight);
LLCoordGL pos(icon_x, sticky_rect.mTop);
LLToolTip::Params params;

View File

@ -71,7 +71,7 @@
top="10"
left_pad="10"
height="14"
width="255"
width="250"
length="1"
follows="right|left"
use_ellipses="true"

View File

@ -67,7 +67,7 @@
top="8"
use_ellipses="true"
value="Erica Vader"
width="212" />
width="205" />
<!-- TIME STAMP -->
<text
font="SansSerifSmall"