summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2012-11-06 17:56:47 -0800
committerGilbert Gonzales <gilbert@lindenlab.com>2012-11-06 17:56:47 -0800
commit8d9aec9278f2113e239a32e393aeca7eefd64fbf (patch)
treec50dfd9859aa0fad2f7aff6574c32587dcce3045 /indra/newview
parent50615ba69c94441c99f21f861cf0290972162998 (diff)
parent0a21efc7abc62511d1ea789bdb47309a6ed1d72e (diff)
merging in latest changes
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llavatariconctrl.cpp29
-rw-r--r--indra/newview/llavatariconctrl.h18
-rw-r--r--indra/newview/llavatarlistitem.cpp34
-rw-r--r--indra/newview/llavatarlistitem.h5
-rw-r--r--indra/newview/llchathistory.cpp80
-rw-r--r--indra/newview/llimconversation.cpp1
-rw-r--r--indra/newview/llimfloatercontainer.cpp1
-rw-r--r--indra/newview/llviewerfloaterreg.cpp1
-rw-r--r--indra/newview/llviewerobjectlist.cpp15
-rw-r--r--indra/newview/llviewerobjectlist.h1
-rwxr-xr-xindra/newview/llviewerwindow.cpp3
11 files changed, 137 insertions, 51 deletions
diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp
index 62c6c6763b..6355f0db56 100755
--- a/indra/newview/llavatariconctrl.cpp
+++ b/indra/newview/llavatariconctrl.cpp
@@ -28,6 +28,8 @@
#include "llavatariconctrl.h"
+#include <boost/signals2.hpp>
+
// viewer includes
#include "llagent.h"
#include "llavatarconstants.h"
@@ -148,9 +150,13 @@ LLAvatarIconCtrl::Params::Params()
LLAvatarIconCtrl::LLAvatarIconCtrl(const LLAvatarIconCtrl::Params& p)
-: LLIconCtrl(p),
+ : LLIconCtrl(p),
+ LLAvatarPropertiesObserver(),
+ mAvatarId(),
+ mFullName(),
mDrawTooltip(p.draw_tooltip),
- mDefaultIconName(p.default_icon_name)
+ mDefaultIconName(p.default_icon_name),
+ mAvatarNameCacheConnection()
{
mPriority = LLViewerFetchedTexture::BOOST_ICON;
@@ -203,6 +209,11 @@ LLAvatarIconCtrl::~LLAvatarIconCtrl()
LLAvatarPropertiesProcessor::getInstance()->removeObserver(mAvatarId, this);
// Name callbacks will be automatically disconnected since LLUICtrl is trackable
}
+
+ if (mAvatarNameCacheConnection.connected())
+ {
+ mAvatarNameCacheConnection.disconnect();
+ }
}
//virtual
@@ -245,9 +256,19 @@ void LLAvatarIconCtrl::setValue(const LLSD& value)
LLIconCtrl::setValue(value);
}
- if (mAvatarId != LLUUID::null)
+ fetchAvatarName();
+}
+
+void LLAvatarIconCtrl::fetchAvatarName()
+{
+ if (mAvatarNameCacheConnection.connected())
+ {
+ mAvatarNameCacheConnection.disconnect();
+ }
+
+ if (mAvatarId.notNull())
{
- LLAvatarNameCache::get(mAvatarId, boost::bind(&LLAvatarIconCtrl::onAvatarNameCache, this, _1, _2));
+ mAvatarNameCacheConnection = LLAvatarNameCache::get(mAvatarId, boost::bind(&LLAvatarIconCtrl::onAvatarNameCache, this, _1, _2));
}
}
diff --git a/indra/newview/llavatariconctrl.h b/indra/newview/llavatariconctrl.h
index 7f568fc5b8..f55967926a 100644
--- a/indra/newview/llavatariconctrl.h
+++ b/indra/newview/llavatariconctrl.h
@@ -27,6 +27,8 @@
#ifndef LL_LLAVATARICONCTRL_H
#define LL_LLAVATARICONCTRL_H
+#include <boost/signals2.hpp>
+
#include "lliconctrl.h"
#include "llavatarpropertiesprocessor.h"
#include "llviewermenu.h"
@@ -86,20 +88,24 @@ public:
// LLAvatarPropertiesProcessor observer trigger
virtual void processProperties(void* data, EAvatarProcessorType type);
- void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name);
-
const LLUUID& getAvatarId() const { return mAvatarId; }
const std::string& getFullName() const { return mFullName; }
void setDrawTooltip(bool value) { mDrawTooltip = value;}
protected:
- LLUUID mAvatarId;
- std::string mFullName;
- bool mDrawTooltip;
- std::string mDefaultIconName;
+ LLUUID mAvatarId;
+ std::string mFullName;
+ bool mDrawTooltip;
+ std::string mDefaultIconName;
bool updateFromCache();
+
+private:
+ void fetchAvatarName();
+ void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name);
+
+ boost::signals2::connection mAvatarNameCacheConnection;
};
#endif // LL_LLAVATARICONCTRL_H
diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp
index 7b5229b5e6..7ff1b39573 100644
--- a/indra/newview/llavatarlistitem.cpp
+++ b/indra/newview/llavatarlistitem.cpp
@@ -27,6 +27,8 @@
#include "llviewerprecompiledheaders.h"
+#include <boost/signals2.hpp>
+
#include "llavataractions.h"
#include "llavatarlistitem.h"
@@ -59,7 +61,8 @@ LLAvatarListItem::Params::Params()
LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/)
-: LLPanel(),
+ : LLPanel(),
+ LLFriendObserver(),
mAvatarIcon(NULL),
mAvatarName(NULL),
mLastInteractionTime(NULL),
@@ -74,7 +77,8 @@ LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/)
mShowInfoBtn(true),
mShowProfileBtn(true),
mShowPermissions(false),
- mHovered(false)
+ mHovered(false),
+ mAvatarNameCacheConnection()
{
if (not_from_ui_factory)
{
@@ -87,7 +91,14 @@ LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/)
LLAvatarListItem::~LLAvatarListItem()
{
if (mAvatarId.notNull())
+ {
LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarId, this);
+ }
+
+ if (mAvatarNameCacheConnection.connected())
+ {
+ mAvatarNameCacheConnection.disconnect();
+ }
}
BOOL LLAvatarListItem::postBuild()
@@ -130,6 +141,19 @@ BOOL LLAvatarListItem::postBuild()
return TRUE;
}
+void LLAvatarListItem::fetchAvatarName()
+{
+ if (mAvatarNameCacheConnection.connected())
+ {
+ mAvatarNameCacheConnection.disconnect();
+ }
+
+ if (mAvatarId.notNull())
+ {
+ mAvatarNameCacheConnection = LLAvatarNameCache::get(getAvatarId(), boost::bind(&LLAvatarListItem::onAvatarNameCache, this, _2));
+ }
+}
+
S32 LLAvatarListItem::notifyParent(const LLSD& info)
{
if (info.has("visibility_changed"))
@@ -260,8 +284,7 @@ void LLAvatarListItem::setAvatarId(const LLUUID& id, const LLUUID& session_id, b
mAvatarIcon->setValue(id);
// Set avatar name.
- LLAvatarNameCache::get(id,
- boost::bind(&LLAvatarListItem::onAvatarNameCache, this, _2));
+ fetchAvatarName();
}
}
@@ -414,8 +437,7 @@ std::string LLAvatarListItem::getAvatarToolTip() const
void LLAvatarListItem::updateAvatarName()
{
- LLAvatarNameCache::get(getAvatarId(),
- boost::bind(&LLAvatarListItem::onAvatarNameCache, this, _2));
+ fetchAvatarName();
}
//== PRIVATE SECITON ==========================================================
diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h
index 28a50870d4..41853b6b51 100644
--- a/indra/newview/llavatarlistitem.h
+++ b/indra/newview/llavatarlistitem.h
@@ -27,6 +27,8 @@
#ifndef LL_LLAVATARLISTITEM_H
#define LL_LLAVATARLISTITEM_H
+#include <boost/signals2.hpp>
+
#include "llpanel.h"
#include "lloutputmonitorctrl.h"
#include "llbutton.h"
@@ -217,6 +219,9 @@ private:
/// true when the mouse pointer is hovering over this item
bool mHovered;
+
+ void fetchAvatarName();
+ boost::signals2::connection mAvatarNameCacheConnection;
static bool sStaticInitialized; // this variable is introduced to improve code readability
static S32 sLeftPadding; // padding to first left visible child (icon or name)
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index c61a8c8562..605e3ece51 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -28,6 +28,8 @@
#include "llchathistory.h"
+#include <boost/signals2.hpp>
+
#include "llavatarnamecache.h"
#include "llinstantmessage.h"
@@ -110,7 +112,8 @@ public:
mFrom(),
mSessionID(),
mMinUserNameWidth(0),
- mUserNameFont(NULL)
+ mUserNameFont(NULL),
+ mAvatarNameCacheConnection()
{}
static LLChatHistoryHeader* createInstance(const std::string& file_name)
@@ -124,6 +127,11 @@ public:
{
// Detach the info button so that it doesn't get destroyed (EXT-8463).
hideInfoCtrl();
+
+ if (mAvatarNameCacheConnection.connected())
+ {
+ mAvatarNameCacheConnection.disconnect();
+ }
}
BOOL handleMouseUp(S32 x, S32 y, MASK mask)
@@ -283,8 +291,7 @@ public:
// Start with blank so sample data from XUI XML doesn't
// flash on the screen
user_name->setValue( LLSD() );
- LLAvatarNameCache::get(mAvatarID,
- boost::bind(&LLChatHistoryHeader::onAvatarNameCache, this, _1, _2));
+ fetchAvatarName();
}
else if (chat.mChatStyle == CHAT_STYLE_HISTORY ||
mSourceType == CHAT_SOURCE_AGENT)
@@ -416,31 +423,6 @@ public:
}
}
- void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name)
- {
- mFrom = av_name.mDisplayName;
-
- LLTextBox* user_name = getChild<LLTextBox>("user_name");
- user_name->setValue( LLSD(av_name.mDisplayName ) );
- user_name->setToolTip( av_name.mUsername );
-
- if (gSavedSettings.getBOOL("NameTagShowUsernames") &&
- LLAvatarNameCache::useDisplayNames() &&
- !av_name.mIsDisplayNameDefault)
- {
- LLStyle::Params style_params_name;
- LLColor4 userNameColor = LLUIColorTable::instance().getColor("EmphasisColor");
- style_params_name.color(userNameColor);
- style_params_name.font.name("SansSerifSmall");
- style_params_name.font.style("NORMAL");
- style_params_name.readonly_color(userNameColor);
- user_name->appendText(" - " + av_name.mUsername, FALSE, style_params_name);
- }
- setToolTip( av_name.mUsername );
- // name might have changed, update width
- updateMinUserNameWidth();
- }
-
protected:
static const S32 PADDING = 20;
@@ -555,6 +537,45 @@ private:
user_name->reshape(user_rect.getWidth() + delta_pos_x, user_rect.getHeight());
}
+ void fetchAvatarName()
+ {
+ if (mAvatarNameCacheConnection.connected())
+ {
+ mAvatarNameCacheConnection.disconnect();
+ }
+
+ if (mAvatarID.notNull())
+ {
+ mAvatarNameCacheConnection = LLAvatarNameCache::get(mAvatarID,
+ boost::bind(&LLChatHistoryHeader::onAvatarNameCache, this, _1, _2));
+ }
+ }
+
+ void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name)
+ {
+ mFrom = av_name.mDisplayName;
+
+ LLTextBox* user_name = getChild<LLTextBox>("user_name");
+ user_name->setValue( LLSD(av_name.mDisplayName ) );
+ user_name->setToolTip( av_name.mUsername );
+
+ if (gSavedSettings.getBOOL("NameTagShowUsernames") &&
+ LLAvatarNameCache::useDisplayNames() &&
+ !av_name.mIsDisplayNameDefault)
+ {
+ LLStyle::Params style_params_name;
+ LLColor4 userNameColor = LLUIColorTable::instance().getColor("EmphasisColor");
+ style_params_name.color(userNameColor);
+ style_params_name.font.name("SansSerifSmall");
+ style_params_name.font.style("NORMAL");
+ style_params_name.readonly_color(userNameColor);
+ user_name->appendText(" - " + av_name.mUsername, FALSE, style_params_name);
+ }
+ setToolTip( av_name.mUsername );
+ // name might have changed, update width
+ updateMinUserNameWidth();
+ }
+
protected:
LLHandle<LLView> mPopupMenuHandleAvatar;
LLHandle<LLView> mPopupMenuHandleObject;
@@ -569,6 +590,9 @@ protected:
S32 mMinUserNameWidth;
const LLFontGL* mUserNameFont;
+
+private:
+ boost::signals2::connection mAvatarNameCacheConnection;
};
LLUICtrl* LLChatHistoryHeader::sInfoCtrl = NULL;
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp
index b687e18cae..833feff3c4 100644
--- a/indra/newview/llimconversation.cpp
+++ b/indra/newview/llimconversation.cpp
@@ -54,6 +54,7 @@ LLIMConversation::LLIMConversation(const LLSD& session_id)
, mInputEditor(NULL)
, mInputEditorTopPad(0)
, mRefreshTimer(new LLTimer())
+ , mIsHostAttached(false)
{
mSession = LLIMModel::getInstance()->findIMSession(mSessionID);
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index f85aa9a353..52deae445b 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -331,6 +331,7 @@ void LLIMFloaterContainer::onExpandCollapseButtonClicked()
{
collapseConversationsPane(!mConversationsPane->isCollapsed());
}
+ selectConversation(mSelectedSession);
}
LLIMFloaterContainer* LLIMFloaterContainer::findInstance()
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index c751550523..a4d45e1fb8 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -322,7 +322,6 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("upload_script", "floater_script_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterScriptPreview>, "upload");
LLFloaterReg::add("upload_sound", "floater_sound_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSoundPreview>, "upload");
- LLFloaterReg::add("voice_controls", "floater_voice_controls.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLCallFloater>);
LLFloaterReg::add("voice_effect", "floater_voice_effect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterVoiceEffect>);
LLFloaterReg::add("web_content", "floater_web_content.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create);
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index e399b45cba..9e5c3f14f8 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -948,7 +948,7 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
std::vector<LLViewerObject*>::iterator idle_end = idle_list.begin()+idle_count;
if (gSavedSettings.getBOOL("FreezeTime"))
- {
+ {
for (std::vector<LLViewerObject*>::iterator iter = idle_list.begin();
iter != idle_end; iter++)
@@ -969,14 +969,14 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
llassert(objectp->isActive());
objectp->idleUpdate(agent, world, frame_time);
- }
+ }
//update flexible objects
LLVolumeImplFlexible::updateClass();
//update animated textures
LLViewerTextureAnim::updateClass();
- }
+ }
@@ -1401,9 +1401,9 @@ void LLViewerObjectList::removeFromActiveList(LLViewerObject* objectp)
mActiveObjects[idx]->setListIndex(idx);
}
- mActiveObjects.pop_back();
+ mActiveObjects.pop_back();
+ }
}
-}
void LLViewerObjectList::updateActive(LLViewerObject *objectp)
{
@@ -1446,8 +1446,11 @@ void LLViewerObjectList::updateActive(LLViewerObject *objectp)
}
}
- llassert(objectp->isActive() || objectp->getListIndex() == -1);
+ //post condition: if object is active, it must be on the active list
+ llassert(!active || std::find(mActiveObjects.begin(), mActiveObjects.end(), objectp) != mActiveObjects.end());
+ //post condition: if object is not active, it must not be on the active list
+ llassert(active || std::find(mActiveObjects.begin(), mActiveObjects.end(), objectp) == mActiveObjects.end());
}
void LLViewerObjectList::updateObjectCost(LLViewerObject* object)
diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h
index 9936432a71..449a4633ff 100644
--- a/indra/newview/llviewerobjectlist.h
+++ b/indra/newview/llviewerobjectlist.h
@@ -129,6 +129,7 @@ public:
LLViewerObject *getSelectedObject(const U32 object_id);
inline S32 getNumObjects() { return (S32) mObjects.size(); }
+ inline S32 getNumActiveObjects() { return (S32) mActiveObjects.size(); }
void addToMap(LLViewerObject *objectp);
void removeFromMap(LLViewerObject *objectp);
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 4e37a9043d..3b2292c04d 100755
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -563,6 +563,9 @@ public:
addText(xpos, ypos, llformat("%d Render Calls", gPipeline.mBatchCount));
ypos += y_inc;
+ addText(xpos, ypos, llformat("%d/%d Objects Active", gObjectList.getNumActiveObjects(), gObjectList.getNumObjects()));
+ ypos += y_inc;
+
addText(xpos, ypos, llformat("%d Matrix Ops", gPipeline.mMatrixOpCount));
ypos += y_inc;