summaryrefslogtreecommitdiff
path: root/indra/newview/llavatarlist.cpp
diff options
context:
space:
mode:
authorGeenz <geenz@geenzo.com>2013-05-13 22:22:51 -0400
committerGeenz <geenz@geenzo.com>2013-05-13 22:22:51 -0400
commit3779e51bfc2010877960d11b463c7316514bf991 (patch)
treeab528a6e7f78f136f9d0f0f7e939264897a44ae1 /indra/newview/llavatarlist.cpp
parentb27899ee0e035ebd4072a5e6162678f2afe81053 (diff)
parent4dd245055f3417d8f8fb611a198ed5671dbce292 (diff)
Merged with https://bitbucket.org/lindenlab/viewer-beta
Diffstat (limited to 'indra/newview/llavatarlist.cpp')
-rwxr-xr-x[-rw-r--r--]indra/newview/llavatarlist.cpp61
1 files changed, 57 insertions, 4 deletions
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index 771419f60a..9f02f301a1 100644..100755
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -46,6 +46,7 @@
#include "lluuid.h"
#include "llvoiceclient.h"
#include "llviewercontrol.h" // for gSavedSettings
+#include "lltooldraganddrop.h"
static LLDefaultChildRegistry::Register<LLAvatarList> r("avatar_list");
@@ -278,7 +279,7 @@ void LLAvatarList::refresh()
LLAvatarName av_name;
have_names &= LLAvatarNameCache::get(buddy_id, &av_name);
- if (!have_filter || findInsensitive(av_name.mDisplayName, mNameFilter))
+ if (!have_filter || findInsensitive(av_name.getDisplayName(), mNameFilter))
{
if (nadded >= ADD_LIMIT)
{
@@ -296,8 +297,9 @@ void LLAvatarList::refresh()
}
else
{
+ std::string display_name = av_name.getDisplayName();
addNewItem(buddy_id,
- av_name.mDisplayName.empty() ? waiting_str : av_name.mDisplayName,
+ display_name.empty() ? waiting_str : display_name,
LLAvatarTracker::instance().isBuddyOnline(buddy_id));
}
@@ -325,7 +327,7 @@ void LLAvatarList::refresh()
const LLUUID& buddy_id = it->asUUID();
LLAvatarName av_name;
have_names &= LLAvatarNameCache::get(buddy_id, &av_name);
- if (!findInsensitive(av_name.mDisplayName, mNameFilter))
+ if (!findInsensitive(av_name.getDisplayName(), mNameFilter))
{
removeItemByUUID(buddy_id);
modified = true;
@@ -398,7 +400,7 @@ bool LLAvatarList::filterHasMatches()
// If name has not been loaded yet we consider it as a match.
// When the name will be loaded the filter will be applied again(in refresh()).
- if (have_name && !findInsensitive(av_name.mDisplayName, mNameFilter))
+ if (have_name && !findInsensitive(av_name.getDisplayName(), mNameFilter))
{
continue;
}
@@ -461,6 +463,57 @@ BOOL LLAvatarList::handleRightMouseDown(S32 x, S32 y, MASK mask)
return handled;
}
+BOOL LLAvatarList::handleMouseDown(S32 x, S32 y, MASK mask)
+{
+ gFocusMgr.setMouseCapture(this);
+
+ S32 screen_x;
+ S32 screen_y;
+ localPointToScreen(x, y, &screen_x, &screen_y);
+ LLToolDragAndDrop::getInstance()->setDragStart(screen_x, screen_y);
+
+ return LLFlatListViewEx::handleMouseDown(x, y, mask);
+}
+
+BOOL LLAvatarList::handleMouseUp( S32 x, S32 y, MASK mask )
+{
+ if(hasMouseCapture())
+ {
+ gFocusMgr.setMouseCapture(NULL);
+ }
+
+ return LLFlatListViewEx::handleMouseUp(x, y, mask);
+}
+
+BOOL LLAvatarList::handleHover(S32 x, S32 y, MASK mask)
+{
+ bool handled = hasMouseCapture();
+ if(handled)
+ {
+ S32 screen_x;
+ S32 screen_y;
+ localPointToScreen(x, y, &screen_x, &screen_y);
+
+ if(LLToolDragAndDrop::getInstance()->isOverThreshold(screen_x, screen_y))
+ {
+ // First, create the global drag and drop object
+ std::vector<EDragAndDropType> types;
+ uuid_vec_t cargo_ids;
+ getSelectedUUIDs(cargo_ids);
+ types.resize(cargo_ids.size(), DAD_PERSON);
+ LLToolDragAndDrop::ESource src = LLToolDragAndDrop::SOURCE_PEOPLE;
+ LLToolDragAndDrop::getInstance()->beginMultiDrag(types, cargo_ids, src);
+ }
+ }
+
+ if(!handled)
+ {
+ handled = LLFlatListViewEx::handleHover(x, y, mask);
+ }
+
+ return handled;
+}
+
bool LLAvatarList::isAvalineItemSelected()
{
std::vector<LLPanel*> selected_items;