Merge remote-tracking branch 'shyotl/sunshine'
This commit is contained in:
@@ -57,8 +57,6 @@ const LLRect FAI_RECT(0, 530, 420, 0);
|
|||||||
// Globals
|
// Globals
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
LLMap< const LLUUID, LLFloaterAvatarInfo* > gAvatarInfoInstances;
|
|
||||||
|
|
||||||
class LLAgentHandler : public LLCommandHandler
|
class LLAgentHandler : public LLCommandHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -107,7 +105,7 @@ BOOL LLFloaterAvatarInfo::postBuild()
|
|||||||
}
|
}
|
||||||
|
|
||||||
LLFloaterAvatarInfo::LLFloaterAvatarInfo(const std::string& name, const LLRect &rect, const LLUUID &avatar_id)
|
LLFloaterAvatarInfo::LLFloaterAvatarInfo(const std::string& name, const LLRect &rect, const LLUUID &avatar_id)
|
||||||
: LLPreview(name, rect, FLOATER_TITLE, LLUUID::null, LLUUID::null),
|
: LLPreview(name, rect, FLOATER_TITLE, LLUUID::null, LLUUID::null), LLInstanceTracker(avatar_id),
|
||||||
mAvatarID( avatar_id ),
|
mAvatarID( avatar_id ),
|
||||||
mSuggestedOnlineStatus(ONLINE_STATUS_NO)
|
mSuggestedOnlineStatus(ONLINE_STATUS_NO)
|
||||||
{
|
{
|
||||||
@@ -124,16 +122,13 @@ LLFloaterAvatarInfo::LLFloaterAvatarInfo(const std::string& name, const LLRect &
|
|||||||
mPanelAvatarp->selectTab(0);
|
mPanelAvatarp->selectTab(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
gAvatarInfoInstances.addData(avatar_id, this); // must be done before callback below is called.
|
|
||||||
//gCacheName->get(avatar_id, FALSE, callbackLoadAvatarName);
|
//gCacheName->get(avatar_id, FALSE, callbackLoadAvatarName);
|
||||||
LLAvatarNameCache::get(avatar_id, boost::bind(&LLFloaterAvatarInfo::callbackLoadAvatarName, _1, _2));
|
LLAvatarNameCache::get(avatar_id, boost::bind(&LLFloaterAvatarInfo::callbackLoadAvatarName, this, _1, _2));
|
||||||
}
|
}
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
LLFloaterAvatarInfo::~LLFloaterAvatarInfo()
|
LLFloaterAvatarInfo::~LLFloaterAvatarInfo()
|
||||||
{
|
{
|
||||||
// child views automatically deleted
|
|
||||||
gAvatarInfoInstances.removeData(mAvatarID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLFloaterAvatarInfo::resetGroupList()
|
void LLFloaterAvatarInfo::resetGroupList()
|
||||||
@@ -155,28 +150,21 @@ LLFloaterAvatarInfo* LLFloaterAvatarInfo::show(const LLUUID &avatar_id)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLFloaterAvatarInfo *floater;
|
LLFloaterAvatarInfo *floater = LLFloaterAvatarInfo::getInstance(avatar_id);
|
||||||
if (gAvatarInfoInstances.checkData(avatar_id))
|
if(!floater)
|
||||||
{
|
{
|
||||||
// ...bring that window to front
|
floater = new LLFloaterAvatarInfo("avatarinfo", FAI_RECT, avatar_id );
|
||||||
floater = gAvatarInfoInstances.getData(avatar_id);
|
|
||||||
floater->open(); /*Flawfinder: ignore*/
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
floater = new LLFloaterAvatarInfo("avatarinfo", FAI_RECT,
|
|
||||||
avatar_id );
|
|
||||||
floater->center();
|
floater->center();
|
||||||
floater->open(); /*Flawfinder: ignore*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ...bring that window to front
|
||||||
|
floater->open(); /*Flawfinder: ignore*/
|
||||||
return floater;
|
return floater;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open profile to a certain tab.
|
// Open profile to a certain tab.
|
||||||
// static
|
// static
|
||||||
void LLFloaterAvatarInfo::showFromObject(
|
void LLFloaterAvatarInfo::showFromObject(const LLUUID& avatar_id,std::string tab_name)
|
||||||
const LLUUID& avatar_id,
|
|
||||||
std::string tab_name)
|
|
||||||
{
|
{
|
||||||
LLFloaterAvatarInfo *floater = show(avatar_id);
|
LLFloaterAvatarInfo *floater = show(avatar_id);
|
||||||
if (floater)
|
if (floater)
|
||||||
@@ -216,24 +204,15 @@ void LLFloaterAvatarInfo::showFromProfile(const LLUUID &avatar_id, LLRect rect)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLFloaterAvatarInfo *floater;
|
LLFloaterAvatarInfo *floater = LLFloaterAvatarInfo::getInstance(avatar_id);
|
||||||
if (gAvatarInfoInstances.checkData(avatar_id))
|
if(!floater)
|
||||||
{
|
{
|
||||||
// ...bring that window to front
|
floater = new LLFloaterAvatarInfo("avatarinfo", FAI_RECT, avatar_id);
|
||||||
floater = gAvatarInfoInstances.getData(avatar_id);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
floater = new LLFloaterAvatarInfo("avatarinfo", FAI_RECT,
|
|
||||||
avatar_id);
|
|
||||||
floater->translate(rect.mLeft - floater->getRect().mLeft + 16,
|
floater->translate(rect.mLeft - floater->getRect().mLeft + 16,
|
||||||
rect.mTop - floater->getRect().mTop - 16);
|
rect.mTop - floater->getRect().mTop - 16);
|
||||||
floater->mPanelAvatarp->setAvatarID(avatar_id, LLStringUtil::null, ONLINE_STATUS_NO);
|
floater->mPanelAvatarp->setAvatarID(avatar_id, LLStringUtil::null, ONLINE_STATUS_NO);
|
||||||
}
|
}
|
||||||
if (floater)
|
floater->open();
|
||||||
{
|
|
||||||
floater->open();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLFloaterAvatarInfo::showProfileCallback(S32 option, void *userdata)
|
void LLFloaterAvatarInfo::showProfileCallback(S32 option, void *userdata)
|
||||||
@@ -244,20 +223,13 @@ void LLFloaterAvatarInfo::showProfileCallback(S32 option, void *userdata)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
void LLFloaterAvatarInfo::callbackLoadAvatarName(const LLUUID& id, const LLAvatarName& av_name)
|
||||||
void LLFloaterAvatarInfo::callbackLoadAvatarName(const LLUUID& id,
|
|
||||||
const LLAvatarName& av_name)
|
|
||||||
{
|
{
|
||||||
LLFloaterAvatarInfo *floater = gAvatarInfoInstances.getIfThere(id);
|
// Build a new title including the avatar name.
|
||||||
|
std::ostringstream title;
|
||||||
if (floater)
|
//title << first << " " << last << " - " << floater->getTitle();
|
||||||
{
|
title << av_name.getCompleteName()<< " - " << getTitle();
|
||||||
// Build a new title including the avatar name.
|
setTitle(title.str());
|
||||||
std::ostringstream title;
|
|
||||||
//title << first << " " << last << " - " << floater->getTitle();
|
|
||||||
title << av_name.getCompleteName()<< " - " << floater->getTitle();
|
|
||||||
floater->setTitle(title.str());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//// virtual
|
//// virtual
|
||||||
@@ -273,11 +245,6 @@ BOOL LLFloaterAvatarInfo::canClose()
|
|||||||
return mPanelAvatarp && mPanelAvatarp->canClose();
|
return mPanelAvatarp && mPanelAvatarp->canClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
LLFloaterAvatarInfo* LLFloaterAvatarInfo::getInstance(const LLUUID &id)
|
|
||||||
{
|
|
||||||
return gAvatarInfoInstances.getIfThere(gAgentID);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLFloaterAvatarInfo::loadAsset()
|
void LLFloaterAvatarInfo::loadAsset()
|
||||||
{
|
{
|
||||||
if (mPanelAvatarp) {
|
if (mPanelAvatarp) {
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
#include "llpreview.h"
|
#include "llpreview.h"
|
||||||
#include "lluuid.h"
|
#include "lluuid.h"
|
||||||
#include "llpanelavatar.h"
|
#include "llpanelavatar.h"
|
||||||
|
#include "llinstancetracker.h"
|
||||||
|
|
||||||
class LLAvatarName;
|
class LLAvatarName;
|
||||||
class LLButton;
|
class LLButton;
|
||||||
@@ -60,7 +61,7 @@ class LLViewerTexture;
|
|||||||
class LLViewerObject;
|
class LLViewerObject;
|
||||||
|
|
||||||
class LLFloaterAvatarInfo
|
class LLFloaterAvatarInfo
|
||||||
: public LLPreview
|
: public LLPreview, public LLInstanceTracker<LLFloaterAvatarInfo,LLUUID>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void* createPanelAvatar(void* data);
|
static void* createPanelAvatar(void* data);
|
||||||
@@ -89,9 +90,8 @@ public:
|
|||||||
|
|
||||||
static void showFromProfile(const LLUUID &avatar_id, LLRect rect);
|
static void showFromProfile(const LLUUID &avatar_id, LLRect rect);
|
||||||
|
|
||||||
static LLFloaterAvatarInfo* getInstance(const LLUUID &id);
|
|
||||||
static void showProfileCallback(S32 option, void *userdata);
|
static void showProfileCallback(S32 option, void *userdata);
|
||||||
static void callbackLoadAvatarName(const LLUUID& agent_id, const LLAvatarName& av_name);
|
void callbackLoadAvatarName(const LLUUID& agent_id, const LLAvatarName& av_name);
|
||||||
void resetGroupList();
|
void resetGroupList();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -1,31 +1,25 @@
|
|||||||
/**
|
/**
|
||||||
* @file llfloateravatarpicker.cpp
|
* @file llfloateravatarpicker.cpp
|
||||||
*
|
*
|
||||||
* $LicenseInfo:firstyear=2003&license=viewergpl$
|
* $LicenseInfo:firstyear=2003&license=viewerlgpl$
|
||||||
*
|
|
||||||
* Copyright (c) 2003-2009, Linden Research, Inc.
|
|
||||||
*
|
|
||||||
* Second Life Viewer Source Code
|
* Second Life Viewer Source Code
|
||||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
* Copyright (C) 2010, Linden Research, Inc.
|
||||||
* to you under the terms of the GNU General Public License, version 2.0
|
|
||||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
|
||||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
|
||||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
|
||||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
|
||||||
*
|
*
|
||||||
* There are special exceptions to the terms and conditions of the GPL as
|
* This library is free software; you can redistribute it and/or
|
||||||
* it is applied to this Source Code. View the full text of the exception
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
* License as published by the Free Software Foundation;
|
||||||
* online at
|
* version 2.1 of the License only.
|
||||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
|
||||||
*
|
*
|
||||||
* By copying, modifying or distributing this software, you acknowledge
|
* This library is distributed in the hope that it will be useful,
|
||||||
* that you have read and understood your obligations described above,
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* and agree to abide by those obligations.
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
* License along with this library; if not, write to the Free Software
|
||||||
* COMPLETENESS OR PERFORMANCE.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*
|
||||||
|
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||||
* $/LicenseInfo$
|
* $/LicenseInfo$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -35,13 +29,12 @@
|
|||||||
|
|
||||||
// Viewer includes
|
// Viewer includes
|
||||||
#include "llagent.h"
|
#include "llagent.h"
|
||||||
|
#include "llcallingcard.h"
|
||||||
#include "llfocusmgr.h"
|
#include "llfocusmgr.h"
|
||||||
#include "llfoldervieweventlistener.h"
|
#include "llimview.h" // for gIMMgr
|
||||||
#include "llinventoryfunctions.h"
|
#include "lltooldraganddrop.h" // for LLToolDragAndDrop
|
||||||
#include "llinventorymodel.h"
|
|
||||||
#include "llinventorypanel.h"
|
|
||||||
#include "llviewercontrol.h"
|
#include "llviewercontrol.h"
|
||||||
#include "llviewerregion.h"
|
#include "llviewerregion.h" // getCapability()
|
||||||
#include "llworld.h"
|
#include "llworld.h"
|
||||||
|
|
||||||
// Linden libraries
|
// Linden libraries
|
||||||
@@ -50,7 +43,7 @@
|
|||||||
#include "llcachename.h"
|
#include "llcachename.h"
|
||||||
#include "lllineeditor.h"
|
#include "lllineeditor.h"
|
||||||
#include "llscrolllistctrl.h"
|
#include "llscrolllistctrl.h"
|
||||||
#include "lltextbox.h"
|
#include "lltabcontainer.h"
|
||||||
#include "lluictrlfactory.h"
|
#include "lluictrlfactory.h"
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
|
|
||||||
@@ -58,40 +51,38 @@
|
|||||||
#include "rlvhandler.h"
|
#include "rlvhandler.h"
|
||||||
// [/RLVa:KB]
|
// [/RLVa:KB]
|
||||||
|
|
||||||
const S32 MIN_WIDTH = 200;
|
//put it back as a member once the legacy path is out?
|
||||||
const S32 MIN_HEIGHT = 340;
|
|
||||||
const LLRect FLOATER_RECT(0, 380, 240, 0);
|
|
||||||
const std::string FLOATER_TITLE = "Choose Resident";
|
|
||||||
|
|
||||||
// static
|
|
||||||
LLFloaterAvatarPicker* LLFloaterAvatarPicker::sInstance = NULL;
|
|
||||||
static std::map<LLUUID, LLAvatarName> sAvatarNameMap;
|
static std::map<LLUUID, LLAvatarName> sAvatarNameMap;
|
||||||
|
|
||||||
LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback,
|
LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback,
|
||||||
BOOL allow_multiple,
|
BOOL allow_multiple,
|
||||||
BOOL closeOnSelect)
|
BOOL closeOnSelect)
|
||||||
{
|
{
|
||||||
// TODO: This class should not be a singleton as it's used in multiple places
|
// *TODO: Use a key to allow this not to be an effective singleton
|
||||||
// and therefore can't be used simultaneously. -MG
|
|
||||||
|
LLFloaterAvatarPicker* floater = getInstance();
|
||||||
LLFloaterAvatarPicker* floater = sInstance ? sInstance : new LLFloaterAvatarPicker();
|
floater->open();
|
||||||
floater->open(); /* Flawfinder: ignore */
|
|
||||||
if(!sInstance)
|
|
||||||
{
|
|
||||||
sInstance = floater;
|
|
||||||
floater->center();
|
|
||||||
}
|
|
||||||
|
|
||||||
floater->mSelectionCallback = callback;
|
floater->mSelectionCallback = callback;
|
||||||
floater->setAllowMultiple(allow_multiple);
|
floater->setAllowMultiple(allow_multiple);
|
||||||
floater->mNearMeListComplete = FALSE;
|
floater->mNearMeListComplete = FALSE;
|
||||||
floater->mCloseOnSelect = closeOnSelect;
|
floater->mCloseOnSelect = closeOnSelect;
|
||||||
|
|
||||||
|
if (!closeOnSelect)
|
||||||
|
{
|
||||||
|
// Use Select/Close
|
||||||
|
std::string select_string = floater->getString("Select");
|
||||||
|
std::string close_string = floater->getString("Close");
|
||||||
|
floater->getChild<LLButton>("ok_btn")->setLabel(select_string);
|
||||||
|
floater->getChild<LLButton>("cancel_btn")->setLabel(close_string);
|
||||||
|
}
|
||||||
|
|
||||||
return floater;
|
return floater;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default constructor
|
// Default constructor
|
||||||
LLFloaterAvatarPicker::LLFloaterAvatarPicker() :
|
LLFloaterAvatarPicker::LLFloaterAvatarPicker() :
|
||||||
LLFloater(std::string("avatarpicker"), FLOATER_RECT, FLOATER_TITLE, TRUE, MIN_WIDTH, MIN_HEIGHT),
|
LLFloater(),
|
||||||
mNumResultsReturned(0),
|
mNumResultsReturned(0),
|
||||||
mNearMeListComplete(FALSE),
|
mNearMeListComplete(FALSE),
|
||||||
mCloseOnSelect(FALSE)
|
mCloseOnSelect(FALSE)
|
||||||
@@ -101,8 +92,8 @@ LLFloaterAvatarPicker::LLFloaterAvatarPicker() :
|
|||||||
|
|
||||||
BOOL LLFloaterAvatarPicker::postBuild()
|
BOOL LLFloaterAvatarPicker::postBuild()
|
||||||
{
|
{
|
||||||
childSetKeystrokeCallback("Edit", editKeystroke, this);
|
childSetKeystrokeCallback("Edit", &LLFloaterAvatarPicker::editKeystroke, (void*)this);
|
||||||
childSetKeystrokeCallback("EditUUID", editKeystroke, this);
|
childSetKeystrokeCallback("EditUUID", &LLFloaterAvatarPicker::editKeystroke, (void*)this);
|
||||||
|
|
||||||
childSetAction("Find", boost::bind(&LLFloaterAvatarPicker::onBtnFind, this));
|
childSetAction("Find", boost::bind(&LLFloaterAvatarPicker::onBtnFind, this));
|
||||||
getChildView("Find")->setEnabled(FALSE);
|
getChildView("Find")->setEnabled(FALSE);
|
||||||
@@ -118,9 +109,14 @@ BOOL LLFloaterAvatarPicker::postBuild()
|
|||||||
nearme->setDoubleClickCallback(boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
|
nearme->setDoubleClickCallback(boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
|
||||||
nearme->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, this));
|
nearme->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, this));
|
||||||
|
|
||||||
childSetAction("Select", boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
|
LLScrollListCtrl* friends = getChild<LLScrollListCtrl>("Friends");
|
||||||
getChildView("Select")->setEnabled(FALSE);
|
friends->setDoubleClickCallback(boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
|
||||||
childSetAction("Cancel", boost::bind(&LLFloaterAvatarPicker::onBtnClose, this));
|
childSetAction("RefreshFriends", boost::bind(&LLFloaterAvatarPicker::populateFriend, this));
|
||||||
|
getChild<LLUICtrl>("Friends")->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, this));
|
||||||
|
|
||||||
|
childSetAction("ok_btn", boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
|
||||||
|
getChildView("ok_btn")->setEnabled(FALSE);
|
||||||
|
childSetAction("cancel_btn", boost::bind(&LLFloaterAvatarPicker::onBtnClose, this));
|
||||||
|
|
||||||
getChild<LLUICtrl>("Edit")->setFocus(TRUE);
|
getChild<LLUICtrl>("Edit")->setFocus(TRUE);
|
||||||
|
|
||||||
@@ -133,32 +129,32 @@ BOOL LLFloaterAvatarPicker::postBuild()
|
|||||||
|
|
||||||
getChild<LLScrollListCtrl>("SearchResults")->setCommentText(getString("no_results"));
|
getChild<LLScrollListCtrl>("SearchResults")->setCommentText(getString("no_results"));
|
||||||
|
|
||||||
LLInventoryPanel* inventory_panel = getChild<LLInventoryPanel>("InventoryPanel");
|
|
||||||
inventory_panel->setFilterTypes(0x1 << LLInventoryType::IT_CALLINGCARD);
|
|
||||||
inventory_panel->setFollowsAll();
|
|
||||||
inventory_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
|
|
||||||
inventory_panel->openDefaultFolderForType(LLAssetType::AT_CALLINGCARD);
|
|
||||||
inventory_panel->setSelectCallback(boost::bind(&LLFloaterAvatarPicker::onCallingCardSelectionChange, this, _1, _2));
|
|
||||||
|
|
||||||
getChild<LLTabContainer>("ResidentChooserTabs")->setCommitCallback(
|
getChild<LLTabContainer>("ResidentChooserTabs")->setCommitCallback(
|
||||||
boost::bind(&LLFloaterAvatarPicker::onTabChanged,this));
|
boost::bind(&LLFloaterAvatarPicker::onTabChanged,this));
|
||||||
|
|
||||||
setAllowMultiple(FALSE);
|
setAllowMultiple(FALSE);
|
||||||
|
|
||||||
|
center();
|
||||||
|
|
||||||
|
populateFriend();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLFloaterAvatarPicker::setOkBtnEnableCb(validate_callback_t cb)
|
||||||
|
{
|
||||||
|
mOkButtonValidateSignal.connect(cb);
|
||||||
|
}
|
||||||
|
|
||||||
void LLFloaterAvatarPicker::onTabChanged()
|
void LLFloaterAvatarPicker::onTabChanged()
|
||||||
{
|
{
|
||||||
childSetEnabled("Select", visibleItemsSelected());
|
getChildView("ok_btn")->setEnabled(isSelectBtnEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Destroys the object
|
// Destroys the object
|
||||||
LLFloaterAvatarPicker::~LLFloaterAvatarPicker()
|
LLFloaterAvatarPicker::~LLFloaterAvatarPicker()
|
||||||
{
|
{
|
||||||
gFocusMgr.releaseFocusIfNeeded( this );
|
gFocusMgr.releaseFocusIfNeeded( this );
|
||||||
|
|
||||||
sInstance = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLFloaterAvatarPicker::onBtnFind()
|
void LLFloaterAvatarPicker::onBtnFind()
|
||||||
@@ -166,79 +162,61 @@ void LLFloaterAvatarPicker::onBtnFind()
|
|||||||
find();
|
find();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void getSelectedAvatarData(const LLScrollListCtrl* from, uuid_vec_t& avatar_ids, std::vector<LLAvatarName>& avatar_names)
|
static void addAvatarUUID(const LLUUID av_id, uuid_vec_t& avatar_ids, std::vector<LLAvatarName>& avatar_names)
|
||||||
{
|
{
|
||||||
std::vector<LLScrollListItem*> items = from->getAllSelected();
|
if (av_id.notNull())
|
||||||
for (std::vector<LLScrollListItem*>::iterator iter = items.begin(); iter != items.end(); ++iter)
|
|
||||||
{
|
{
|
||||||
LLScrollListItem* item = *iter;
|
avatar_ids.push_back(av_id);
|
||||||
if (item->getUUID().notNull())
|
|
||||||
{
|
|
||||||
avatar_ids.push_back(item->getUUID());
|
|
||||||
|
|
||||||
std::map<LLUUID, LLAvatarName>::iterator iter = sAvatarNameMap.find(item->getUUID());
|
std::map<LLUUID, LLAvatarName>::iterator iter = sAvatarNameMap.find(av_id);
|
||||||
if (iter != sAvatarNameMap.end())
|
if (iter != sAvatarNameMap.end())
|
||||||
{
|
{
|
||||||
avatar_names.push_back(iter->second);
|
avatar_names.push_back(iter->second);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// the only case where it isn't in the name map is friends
|
// the only case where it isn't in the name map is friends
|
||||||
// but it should be in the name cache
|
// but it should be in the name cache
|
||||||
LLAvatarName av_name;
|
LLAvatarName av_name;
|
||||||
LLAvatarNameCache::get(item->getUUID(), &av_name);
|
LLAvatarNameCache::get(av_id, &av_name);
|
||||||
avatar_names.push_back(av_name);
|
avatar_names.push_back(av_name);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void getSelectedAvatarData(const LLUICtrl* from, uuid_vec_t& avatar_ids, std::vector<LLAvatarName>& avatar_names)
|
||||||
|
{
|
||||||
|
const LLScrollListCtrl* list = dynamic_cast<const LLScrollListCtrl*>(from);
|
||||||
|
if(list)
|
||||||
|
{
|
||||||
|
std::vector<LLScrollListItem*> items = list->getAllSelected();
|
||||||
|
for (std::vector<LLScrollListItem*>::iterator iter = items.begin(); iter != items.end(); ++iter)
|
||||||
|
{
|
||||||
|
addAvatarUUID((*iter)->getUUID(), avatar_ids, avatar_names);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
addAvatarUUID(from->getValue().asUUID(), avatar_ids, avatar_names);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void LLFloaterAvatarPicker::onBtnSelect()
|
void LLFloaterAvatarPicker::onBtnSelect()
|
||||||
{
|
{
|
||||||
|
|
||||||
// If select btn not enabled then do not callback
|
// If select btn not enabled then do not callback
|
||||||
if (!visibleItemsSelected())
|
if (!isSelectBtnEnabled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(mSelectionCallback)
|
if(mSelectionCallback)
|
||||||
{
|
{
|
||||||
std::vector<LLAvatarName> avatar_names;
|
|
||||||
std::vector<LLUUID> avatar_ids;
|
|
||||||
std::string active_panel_name;
|
std::string active_panel_name;
|
||||||
LLScrollListCtrl* list = NULL;
|
LLUICtrl* list = NULL;
|
||||||
LLPanel* active_panel = childGetVisibleTab("ResidentChooserTabs");
|
LLPanel* active_panel = getChild<LLTabContainer>("ResidentChooserTabs")->getCurrentPanel();
|
||||||
if(active_panel)
|
if(active_panel)
|
||||||
{
|
{
|
||||||
active_panel_name = active_panel->getName();
|
active_panel_name = active_panel->getName();
|
||||||
}
|
}
|
||||||
if(active_panel_name == "CallingCardsPanel")
|
if(active_panel_name == "SearchPanel")
|
||||||
{
|
|
||||||
avatar_ids = mSelectedInventoryAvatarIDs;
|
|
||||||
for(std::vector<std::string>::size_type i = 0; i < avatar_ids.size(); ++i)
|
|
||||||
{
|
|
||||||
std::map<LLUUID, LLAvatarName>::iterator iter = sAvatarNameMap.find(avatar_ids[i]);
|
|
||||||
LLAvatarName av_name;
|
|
||||||
if (iter != sAvatarNameMap.end())
|
|
||||||
{
|
|
||||||
avatar_names.push_back(iter->second);
|
|
||||||
}
|
|
||||||
else if(LLAvatarNameCache::get(avatar_ids[i], &av_name))
|
|
||||||
{
|
|
||||||
avatar_names.push_back(av_name);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::string name = gCacheName->buildLegacyName(mSelectedInventoryAvatarNames[i]);
|
|
||||||
std::string::size_type pos = name.find(' ');
|
|
||||||
av_name.mLegacyFirstName = name.substr(pos);
|
|
||||||
av_name.mLegacyLastName = pos!=std::string::npos ? name.substr(pos+1) : "Resident";
|
|
||||||
av_name.mDisplayName = name;
|
|
||||||
av_name.mUsername = "";
|
|
||||||
avatar_names.push_back(av_name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(active_panel_name == "SearchPanel")
|
|
||||||
{
|
{
|
||||||
list = getChild<LLScrollListCtrl>("SearchResults");
|
list = getChild<LLScrollListCtrl>("SearchResults");
|
||||||
}
|
}
|
||||||
@@ -246,38 +224,26 @@ void LLFloaterAvatarPicker::onBtnSelect()
|
|||||||
{
|
{
|
||||||
list = getChild<LLScrollListCtrl>("NearMe");
|
list = getChild<LLScrollListCtrl>("NearMe");
|
||||||
}
|
}
|
||||||
|
else if (active_panel_name == "FriendsPanel")
|
||||||
|
{
|
||||||
|
list = getChild<LLScrollListCtrl>("Friends");
|
||||||
|
}
|
||||||
else if(active_panel_name == "KeyPanel")
|
else if(active_panel_name == "KeyPanel")
|
||||||
{
|
{
|
||||||
LLUUID specified = getChild<LLLineEditor>("EditUUID")->getValue().asUUID();
|
list = getChild<LLLineEditor>("EditUUID");
|
||||||
if(specified.isNull())
|
|
||||||
return;
|
|
||||||
avatar_ids.push_back(specified);
|
|
||||||
|
|
||||||
std::map<LLUUID, LLAvatarName>::iterator iter = sAvatarNameMap.find(specified);
|
|
||||||
if (iter != sAvatarNameMap.end())
|
|
||||||
{
|
|
||||||
avatar_names.push_back(iter->second);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LLAvatarName av_name;
|
|
||||||
LLAvatarNameCache::get(specified, &av_name);
|
|
||||||
avatar_names.push_back(av_name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(list)
|
if(list)
|
||||||
{
|
{
|
||||||
|
uuid_vec_t avatar_ids;
|
||||||
|
std::vector<LLAvatarName> avatar_names;
|
||||||
getSelectedAvatarData(list, avatar_ids, avatar_names);
|
getSelectedAvatarData(list, avatar_ids, avatar_names);
|
||||||
}
|
|
||||||
if(!avatar_names.empty() && !avatar_ids.empty())
|
|
||||||
{
|
|
||||||
mSelectionCallback(avatar_ids, avatar_names);
|
mSelectionCallback(avatar_ids, avatar_names);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getChild<LLInventoryPanel>("InventoryPanel")->setSelection(LLUUID::null, FALSE);
|
|
||||||
getChild<LLScrollListCtrl>("SearchResults")->deselectAllItems(TRUE);
|
getChild<LLScrollListCtrl>("SearchResults")->deselectAllItems(TRUE);
|
||||||
getChild<LLScrollListCtrl>("NearMe")->deselectAllItems(TRUE);
|
getChild<LLScrollListCtrl>("NearMe")->deselectAllItems(TRUE);
|
||||||
|
getChild<LLScrollListCtrl>("Friends")->deselectAllItems(TRUE);
|
||||||
if(mCloseOnSelect)
|
if(mCloseOnSelect)
|
||||||
{
|
{
|
||||||
mCloseOnSelect = FALSE;
|
mCloseOnSelect = FALSE;
|
||||||
@@ -304,41 +270,7 @@ void LLFloaterAvatarPicker::onRangeAdjust()
|
|||||||
|
|
||||||
void LLFloaterAvatarPicker::onList()
|
void LLFloaterAvatarPicker::onList()
|
||||||
{
|
{
|
||||||
getChildView("Select")->setEnabled(visibleItemsSelected());
|
getChildView("ok_btn")->setEnabled(isSelectBtnEnabled());
|
||||||
}
|
|
||||||
|
|
||||||
// Callback for inventory picker (select from calling cards)
|
|
||||||
void LLFloaterAvatarPicker::onCallingCardSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action)
|
|
||||||
{
|
|
||||||
bool panel_active = (childGetVisibleTab("ResidentChooserTabs") == getChild<LLPanel>("CallingCardsPanel"));
|
|
||||||
|
|
||||||
mSelectedInventoryAvatarIDs.clear();
|
|
||||||
mSelectedInventoryAvatarNames.clear();
|
|
||||||
|
|
||||||
if (panel_active)
|
|
||||||
{
|
|
||||||
childSetEnabled("Select", FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::deque<LLFolderViewItem*>::const_iterator item_it;
|
|
||||||
for (item_it = items.begin(); item_it != items.end(); ++item_it)
|
|
||||||
{
|
|
||||||
LLFolderViewEventListener* listenerp = (*item_it)->getListener();
|
|
||||||
if (listenerp->getInventoryType() == LLInventoryType::IT_CALLINGCARD)
|
|
||||||
{
|
|
||||||
LLInventoryItem* item = gInventory.getItem(listenerp->getUUID());
|
|
||||||
if (item)
|
|
||||||
{
|
|
||||||
mSelectedInventoryAvatarIDs.push_back(item->getCreatorUUID());
|
|
||||||
mSelectedInventoryAvatarNames.push_back(listenerp->getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (panel_active)
|
|
||||||
{
|
|
||||||
childSetEnabled("Select", visibleItemsSelected());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLFloaterAvatarPicker::populateNearMe()
|
void LLFloaterAvatarPicker::populateNearMe()
|
||||||
@@ -380,13 +312,13 @@ void LLFloaterAvatarPicker::populateNearMe()
|
|||||||
if (empty)
|
if (empty)
|
||||||
{
|
{
|
||||||
getChildView("NearMe")->setEnabled(FALSE);
|
getChildView("NearMe")->setEnabled(FALSE);
|
||||||
getChildView("Select")->setEnabled(FALSE);
|
getChildView("ok_btn")->setEnabled(FALSE);
|
||||||
near_me_scroller->setCommentText(getString("no_one_near"));
|
near_me_scroller->setCommentText(getString("no_one_near"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
getChildView("NearMe")->setEnabled(TRUE);
|
getChildView("NearMe")->setEnabled(TRUE);
|
||||||
getChildView("Select")->setEnabled(TRUE);
|
getChildView("ok_btn")->setEnabled(TRUE);
|
||||||
near_me_scroller->selectFirstItem();
|
near_me_scroller->selectFirstItem();
|
||||||
onList();
|
onList();
|
||||||
near_me_scroller->setFocus(TRUE);
|
near_me_scroller->setFocus(TRUE);
|
||||||
@@ -398,8 +330,39 @@ void LLFloaterAvatarPicker::populateNearMe()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLFloaterAvatarPicker::populateFriend()
|
||||||
|
{
|
||||||
|
LLScrollListCtrl* friends_scroller = getChild<LLScrollListCtrl>("Friends");
|
||||||
|
friends_scroller->deleteAllItems();
|
||||||
|
LLCollectAllBuddies collector;
|
||||||
|
LLAvatarTracker::instance().applyFunctor(collector);
|
||||||
|
LLCollectAllBuddies::buddy_map_t::iterator it;
|
||||||
|
|
||||||
|
for(it = collector.mOnline.begin(); it!=collector.mOnline.end(); it++)
|
||||||
|
{
|
||||||
|
friends_scroller->addStringUUIDItem(it->first, it->second);
|
||||||
|
}
|
||||||
|
for(it = collector.mOffline.begin(); it!=collector.mOffline.end(); it++)
|
||||||
|
{
|
||||||
|
friends_scroller->addStringUUIDItem(it->first, it->second);
|
||||||
|
}
|
||||||
|
friends_scroller->sortByColumnIndex(0, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
void LLFloaterAvatarPicker::draw()
|
void LLFloaterAvatarPicker::draw()
|
||||||
{
|
{
|
||||||
|
// sometimes it is hard to determine when Select/Ok button should be disabled (see LLAvatarActions::shareWithAvatars).
|
||||||
|
// lets check this via mOkButtonValidateSignal callback periodically.
|
||||||
|
static LLFrameTimer timer;
|
||||||
|
if (timer.hasExpired())
|
||||||
|
{
|
||||||
|
timer.setTimerExpirySec(0.33f); // three times per second should be enough.
|
||||||
|
|
||||||
|
// simulate list changes.
|
||||||
|
onList();
|
||||||
|
timer.start();
|
||||||
|
}
|
||||||
|
|
||||||
LLFloater::draw();
|
LLFloater::draw();
|
||||||
|
|
||||||
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-1.0.0e
|
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-1.0.0e
|
||||||
@@ -425,7 +388,7 @@ void LLFloaterAvatarPicker::draw()
|
|||||||
}
|
}
|
||||||
// [/RLVa:KB]
|
// [/RLVa:KB]
|
||||||
|
|
||||||
if (!mNearMeListComplete && childGetVisibleTab("ResidentChooserTabs") == getChild<LLPanel>("NearMePanel"))
|
if (!mNearMeListComplete && getChild<LLTabContainer>("ResidentChooserTabs")->getCurrentPanel() == getChild<LLPanel>("NearMePanel"))
|
||||||
{
|
{
|
||||||
populateNearMe();
|
populateNearMe();
|
||||||
}
|
}
|
||||||
@@ -433,20 +396,20 @@ void LLFloaterAvatarPicker::draw()
|
|||||||
|
|
||||||
BOOL LLFloaterAvatarPicker::visibleItemsSelected() const
|
BOOL LLFloaterAvatarPicker::visibleItemsSelected() const
|
||||||
{
|
{
|
||||||
LLPanel* active_panel = childGetVisibleTab("ResidentChooserTabs");
|
LLPanel* active_panel = getChild<LLTabContainer>("ResidentChooserTabs")->getCurrentPanel();
|
||||||
|
|
||||||
if(active_panel == getChild<LLPanel>("SearchPanel"))
|
if(active_panel == getChild<LLPanel>("SearchPanel"))
|
||||||
{
|
{
|
||||||
return getChild<LLScrollListCtrl>("SearchResults")->getFirstSelectedIndex() >= 0;
|
return getChild<LLScrollListCtrl>("SearchResults")->getFirstSelectedIndex() >= 0;
|
||||||
}
|
}
|
||||||
else if(active_panel == getChild<LLPanel>("CallingCardsPanel"))
|
|
||||||
{
|
|
||||||
return !mSelectedInventoryAvatarIDs.empty();
|
|
||||||
}
|
|
||||||
else if(active_panel == getChild<LLPanel>("NearMePanel"))
|
else if(active_panel == getChild<LLPanel>("NearMePanel"))
|
||||||
{
|
{
|
||||||
return getChild<LLScrollListCtrl>("NearMe")->getFirstSelectedIndex() >= 0;
|
return getChild<LLScrollListCtrl>("NearMe")->getFirstSelectedIndex() >= 0;
|
||||||
}
|
}
|
||||||
|
else if(active_panel == getChild<LLPanel>("FriendsPanel"))
|
||||||
|
{
|
||||||
|
return getChild<LLScrollListCtrl>("Friends")->getFirstSelectedIndex() >= 0;
|
||||||
|
}
|
||||||
else if(active_panel == getChild<LLPanel>("KeyPanel"))
|
else if(active_panel == getChild<LLPanel>("KeyPanel"))
|
||||||
{
|
{
|
||||||
LLUUID specified = getChild<LLLineEditor>("EditUUID")->getValue().asUUID();
|
LLUUID specified = getChild<LLLineEditor>("EditUUID")->getValue().asUUID();
|
||||||
@@ -473,10 +436,9 @@ public:
|
|||||||
// just set it to process so it displays 'not found'
|
// just set it to process so it displays 'not found'
|
||||||
if ((200 <= status && status < 300) || status == 400)
|
if ((200 <= status && status < 300) || status == 400)
|
||||||
{
|
{
|
||||||
LLFloaterAvatarPicker* floater = LLFloaterAvatarPicker::sInstance;
|
if (LLFloaterAvatarPicker::instanceExists())
|
||||||
if (floater)
|
|
||||||
{
|
{
|
||||||
floater->processResponse(mQueryID, content);
|
LLFloaterAvatarPicker::getInstance()->processResponse(mQueryID, content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -496,7 +458,7 @@ void LLFloaterAvatarPicker::find()
|
|||||||
//clear our stored LLAvatarNames
|
//clear our stored LLAvatarNames
|
||||||
sAvatarNameMap.clear();
|
sAvatarNameMap.clear();
|
||||||
|
|
||||||
const std::string& text = childGetValue("Edit").asString();
|
std::string text = getChild<LLUICtrl>("Edit")->getValue().asString();
|
||||||
|
|
||||||
mQueryID.generate();
|
mQueryID.generate();
|
||||||
|
|
||||||
@@ -537,15 +499,90 @@ void LLFloaterAvatarPicker::find()
|
|||||||
getChild<LLScrollListCtrl>("SearchResults")->deleteAllItems();
|
getChild<LLScrollListCtrl>("SearchResults")->deleteAllItems();
|
||||||
getChild<LLScrollListCtrl>("SearchResults")->setCommentText(getString("searching"));
|
getChild<LLScrollListCtrl>("SearchResults")->setCommentText(getString("searching"));
|
||||||
|
|
||||||
childSetEnabled("Select", FALSE);
|
getChildView("ok_btn")->setEnabled(FALSE);
|
||||||
mNumResultsReturned = 0;
|
mNumResultsReturned = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLFloaterAvatarPicker::setAllowMultiple(BOOL allow_multiple)
|
void LLFloaterAvatarPicker::setAllowMultiple(BOOL allow_multiple)
|
||||||
{
|
{
|
||||||
getChild<LLScrollListCtrl>("SearchResults")->setAllowMultipleSelection(allow_multiple);
|
getChild<LLScrollListCtrl>("SearchResults")->setAllowMultipleSelection(allow_multiple);
|
||||||
getChild<LLInventoryPanel>("InventoryPanel")->setAllowMultiSelect(allow_multiple);
|
|
||||||
getChild<LLScrollListCtrl>("NearMe")->setAllowMultipleSelection(allow_multiple);
|
getChild<LLScrollListCtrl>("NearMe")->setAllowMultipleSelection(allow_multiple);
|
||||||
|
getChild<LLScrollListCtrl>("Friends")->setAllowMultipleSelection(allow_multiple);
|
||||||
|
}
|
||||||
|
|
||||||
|
LLScrollListCtrl* LLFloaterAvatarPicker::getActiveList()
|
||||||
|
{
|
||||||
|
std::string acvtive_panel_name;
|
||||||
|
LLScrollListCtrl* list = NULL;
|
||||||
|
LLPanel* active_panel = getChild<LLTabContainer>("ResidentChooserTabs")->getCurrentPanel();
|
||||||
|
if(active_panel)
|
||||||
|
{
|
||||||
|
acvtive_panel_name = active_panel->getName();
|
||||||
|
}
|
||||||
|
if(acvtive_panel_name == "SearchPanel")
|
||||||
|
{
|
||||||
|
list = getChild<LLScrollListCtrl>("SearchResults");
|
||||||
|
}
|
||||||
|
else if(acvtive_panel_name == "NearMePanel")
|
||||||
|
{
|
||||||
|
list = getChild<LLScrollListCtrl>("NearMe");
|
||||||
|
}
|
||||||
|
else if (acvtive_panel_name == "FriendsPanel")
|
||||||
|
{
|
||||||
|
list = getChild<LLScrollListCtrl>("Friends");
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL LLFloaterAvatarPicker::handleDragAndDrop(S32 x, S32 y, MASK mask,
|
||||||
|
BOOL drop, EDragAndDropType cargo_type,
|
||||||
|
void *cargo_data, EAcceptance *accept,
|
||||||
|
std::string& tooltip_msg)
|
||||||
|
{
|
||||||
|
LLScrollListCtrl* list = getActiveList();
|
||||||
|
if(list)
|
||||||
|
{
|
||||||
|
LLRect rc_list;
|
||||||
|
LLRect rc_point(x,y,x,y);
|
||||||
|
if (localRectToOtherView(rc_point, &rc_list, list))
|
||||||
|
{
|
||||||
|
// Keep selected only one item
|
||||||
|
list->deselectAllItems(TRUE);
|
||||||
|
list->selectItemAt(rc_list.mLeft, rc_list.mBottom, mask);
|
||||||
|
LLScrollListItem* selection = list->getFirstSelected();
|
||||||
|
if (selection)
|
||||||
|
{
|
||||||
|
LLUUID session_id = LLUUID::null;
|
||||||
|
LLUUID dest_agent_id = selection->getUUID();
|
||||||
|
std::string avatar_name = selection->getColumn(0)->getValue().asString();
|
||||||
|
if (dest_agent_id.notNull() && dest_agent_id != gAgentID)
|
||||||
|
{
|
||||||
|
if (drop)
|
||||||
|
{
|
||||||
|
// Start up IM before give the item
|
||||||
|
session_id = gIMMgr->addSession(avatar_name, IM_NOTHING_SPECIAL, dest_agent_id);
|
||||||
|
}
|
||||||
|
return LLToolDragAndDrop::handleGiveDragAndDrop(dest_agent_id, session_id, drop,
|
||||||
|
cargo_type, cargo_data, accept);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*accept = ACCEPT_NO;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LLFloaterAvatarPicker::openFriendsTab()
|
||||||
|
{
|
||||||
|
LLTabContainer* tab_container = getChild<LLTabContainer>("ResidentChooserTabs");
|
||||||
|
if (tab_container == NULL)
|
||||||
|
{
|
||||||
|
llassert(tab_container != NULL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
tab_container->selectTabByName("FriendsPanel");
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
@@ -563,8 +600,9 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void*
|
|||||||
// Not for us
|
// Not for us
|
||||||
if (agent_id != gAgent.getID()) return;
|
if (agent_id != gAgent.getID()) return;
|
||||||
|
|
||||||
// Dialog already closed
|
if(!instanceExists())
|
||||||
LLFloaterAvatarPicker *floater = sInstance;
|
return;
|
||||||
|
LLFloaterAvatarPicker *floater = getInstance();
|
||||||
|
|
||||||
// floater is closed or these are not results from our last request
|
// floater is closed or these are not results from our last request
|
||||||
if (NULL == floater || query_id != floater->mQueryID)
|
if (NULL == floater || query_id != floater->mQueryID)
|
||||||
@@ -592,10 +630,10 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void*
|
|||||||
if (avatar_id.isNull())
|
if (avatar_id.isNull())
|
||||||
{
|
{
|
||||||
LLStringUtil::format_map_t map;
|
LLStringUtil::format_map_t map;
|
||||||
map["[TEXT]"] = floater->childGetText("Edit");
|
map["[TEXT]"] = floater->getChild<LLUICtrl>("Edit")->getValue().asString();
|
||||||
avatar_name = floater->getString("not_found", map);
|
avatar_name = floater->getString("not_found", map);
|
||||||
search_results->setEnabled(FALSE);
|
search_results->setEnabled(FALSE);
|
||||||
floater->getChildView("Select")->setEnabled(FALSE);
|
floater->getChildView("ok_btn")->setEnabled(FALSE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -620,7 +658,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void*
|
|||||||
|
|
||||||
if (found_one)
|
if (found_one)
|
||||||
{
|
{
|
||||||
floater->getChildView("Select")->setEnabled(TRUE);
|
floater->getChildView("ok_btn")->setEnabled(TRUE);
|
||||||
search_results->selectFirstItem();
|
search_results->selectFirstItem();
|
||||||
floater->onList();
|
floater->onList();
|
||||||
search_results->setFocus(TRUE);
|
search_results->setFocus(TRUE);
|
||||||
@@ -645,7 +683,7 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD&
|
|||||||
item["columns"][0]["value"] = getString("not_found", map);
|
item["columns"][0]["value"] = getString("not_found", map);
|
||||||
search_results->addElement(item);
|
search_results->addElement(item);
|
||||||
search_results->setEnabled(false);
|
search_results->setEnabled(false);
|
||||||
getChildView("Select")->setEnabled(false);
|
getChildView("ok_btn")->setEnabled(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -671,7 +709,7 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD&
|
|||||||
sAvatarNameMap[row["id"].asUUID()] = avatar_name;
|
sAvatarNameMap[row["id"].asUUID()] = avatar_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
getChildView("Select")->setEnabled(true);
|
getChildView("ok_btn")->setEnabled(true);
|
||||||
search_results->setEnabled(true);
|
search_results->setEnabled(true);
|
||||||
search_results->selectFirstItem();
|
search_results->selectFirstItem();
|
||||||
onList();
|
onList();
|
||||||
@@ -682,14 +720,10 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD&
|
|||||||
void LLFloaterAvatarPicker::editKeystroke(LLLineEditor* caller, void* user_data)
|
void LLFloaterAvatarPicker::editKeystroke(LLLineEditor* caller, void* user_data)
|
||||||
{
|
{
|
||||||
LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)user_data;
|
LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)user_data;
|
||||||
LLPanel* active_panel = self->childGetVisibleTab("ResidentChooserTabs");
|
if(caller->getName() == "Edit")
|
||||||
if(active_panel == self->getChild<LLPanel>("SearchPanel"))
|
self->getChildView("Find")->setEnabled(caller->getText().size() >= 3);
|
||||||
self->childSetEnabled("Find", caller->getText().size() >= 3);
|
else
|
||||||
else if(active_panel == self->getChild<LLPanel>("KeyPanel"))
|
self->childSetEnabled("Select", caller->getValue().asUUID().notNull());
|
||||||
{
|
|
||||||
LLUUID specified = self->getChild<LLLineEditor>("EditUUID")->getValue().asUUID();
|
|
||||||
self->childSetEnabled("Select", specified.notNull());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
@@ -715,3 +749,45 @@ BOOL LLFloaterAvatarPicker::handleKeyHere(KEY key, MASK mask)
|
|||||||
|
|
||||||
return LLFloater::handleKeyHere(key, mask);
|
return LLFloater::handleKeyHere(key, mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool LLFloaterAvatarPicker::isSelectBtnEnabled()
|
||||||
|
{
|
||||||
|
bool ret_val = visibleItemsSelected();
|
||||||
|
|
||||||
|
if ( ret_val && mOkButtonValidateSignal.num_slots() )
|
||||||
|
{
|
||||||
|
std::string active_panel_name;
|
||||||
|
LLUICtrl* list = NULL;
|
||||||
|
LLPanel* active_panel = getChild<LLTabContainer>("ResidentChooserTabs")->getCurrentPanel();
|
||||||
|
if(active_panel)
|
||||||
|
{
|
||||||
|
active_panel_name = active_panel->getName();
|
||||||
|
}
|
||||||
|
if(active_panel_name == "SearchPanel")
|
||||||
|
{
|
||||||
|
list = getChild<LLScrollListCtrl>("SearchResults");
|
||||||
|
}
|
||||||
|
else if(active_panel_name == "NearMePanel")
|
||||||
|
{
|
||||||
|
list = getChild<LLScrollListCtrl>("NearMe");
|
||||||
|
}
|
||||||
|
else if (active_panel_name == "FriendsPanel")
|
||||||
|
{
|
||||||
|
list = getChild<LLScrollListCtrl>("Friends");
|
||||||
|
}
|
||||||
|
else if(active_panel_name == "KeyPanel")
|
||||||
|
{
|
||||||
|
list = getChild<LLLineEditor>("EditUUID");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(list)
|
||||||
|
{
|
||||||
|
uuid_vec_t avatar_ids;
|
||||||
|
std::vector<LLAvatarName> avatar_names;
|
||||||
|
getSelectedAvatarData(list, avatar_ids, avatar_names);
|
||||||
|
return mOkButtonValidateSignal(avatar_ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret_val;
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,31 +2,25 @@
|
|||||||
* @file llfloateravatarpicker.h
|
* @file llfloateravatarpicker.h
|
||||||
* @brief was llavatarpicker.h
|
* @brief was llavatarpicker.h
|
||||||
*
|
*
|
||||||
* $LicenseInfo:firstyear=2003&license=viewergpl$
|
* $LicenseInfo:firstyear=2003&license=viewerlgpl$
|
||||||
*
|
|
||||||
* Copyright (c) 2003-2009, Linden Research, Inc.
|
|
||||||
*
|
|
||||||
* Second Life Viewer Source Code
|
* Second Life Viewer Source Code
|
||||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
* Copyright (C) 2010, Linden Research, Inc.
|
||||||
* to you under the terms of the GNU General Public License, version 2.0
|
|
||||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
|
||||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
|
||||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
|
||||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
|
||||||
*
|
*
|
||||||
* There are special exceptions to the terms and conditions of the GPL as
|
* This library is free software; you can redistribute it and/or
|
||||||
* it is applied to this Source Code. View the full text of the exception
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
* License as published by the Free Software Foundation;
|
||||||
* online at
|
* version 2.1 of the License only.
|
||||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
|
||||||
*
|
*
|
||||||
* By copying, modifying or distributing this software, you acknowledge
|
* This library is distributed in the hope that it will be useful,
|
||||||
* that you have read and understood your obligations described above,
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* and agree to abide by those obligations.
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
* License along with this library; if not, write to the Free Software
|
||||||
* COMPLETENESS OR PERFORMANCE.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*
|
||||||
|
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||||
* $/LicenseInfo$
|
* $/LicenseInfo$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -40,7 +34,7 @@
|
|||||||
class LLAvatarName;
|
class LLAvatarName;
|
||||||
class LLScrollListCtrl;
|
class LLScrollListCtrl;
|
||||||
|
|
||||||
class LLFloaterAvatarPicker : public LLFloater
|
class LLFloaterAvatarPicker : public LLFloater, public LLSingleton<LLFloaterAvatarPicker>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef boost::signals2::signal<bool(const uuid_vec_t&), boost_boolean_combiner> validate_signal_t;
|
typedef boost::signals2::signal<bool(const uuid_vec_t&), boost_boolean_combiner> validate_signal_t;
|
||||||
@@ -52,14 +46,25 @@ public:
|
|||||||
static LLFloaterAvatarPicker* show(select_callback_t callback,
|
static LLFloaterAvatarPicker* show(select_callback_t callback,
|
||||||
BOOL allow_multiple = FALSE,
|
BOOL allow_multiple = FALSE,
|
||||||
BOOL closeOnSelect = FALSE);
|
BOOL closeOnSelect = FALSE);
|
||||||
|
|
||||||
|
// do not call these directly
|
||||||
|
LLFloaterAvatarPicker();
|
||||||
|
virtual ~LLFloaterAvatarPicker();
|
||||||
virtual BOOL postBuild();
|
virtual BOOL postBuild();
|
||||||
|
|
||||||
|
void setOkBtnEnableCb(validate_callback_t cb);
|
||||||
|
|
||||||
static void processAvatarPickerReply(class LLMessageSystem* msg, void**);
|
static void processAvatarPickerReply(class LLMessageSystem* msg, void**);
|
||||||
void processResponse(const LLUUID& query_id, const LLSD& content);
|
void processResponse(const LLUUID& query_id, const LLSD& content);
|
||||||
|
|
||||||
static LLFloaterAvatarPicker* sInstance;
|
BOOL handleDragAndDrop(S32 x, S32 y, MASK mask,
|
||||||
private:
|
BOOL drop, EDragAndDropType cargo_type,
|
||||||
|
void *cargo_data, EAcceptance *accept,
|
||||||
|
std::string& tooltip_msg);
|
||||||
|
|
||||||
|
void openFriendsTab();
|
||||||
|
|
||||||
|
private:
|
||||||
static void editKeystroke(class LLLineEditor* caller, void* user_data);
|
static void editKeystroke(class LLLineEditor* caller, void* user_data);
|
||||||
|
|
||||||
void onBtnFind();
|
void onBtnFind();
|
||||||
@@ -69,30 +74,26 @@ private:
|
|||||||
void onBtnClose();
|
void onBtnClose();
|
||||||
void onList();
|
void onList();
|
||||||
void onTabChanged();
|
void onTabChanged();
|
||||||
|
bool isSelectBtnEnabled();
|
||||||
void onCallingCardSelectionChange(const std::deque<class LLFolderViewItem*> &items, BOOL user_action);
|
|
||||||
|
|
||||||
void populateNearMe();
|
void populateNearMe();
|
||||||
|
void populateFriend();
|
||||||
BOOL visibleItemsSelected() const; // Returns true if any items in the current tab are selected.
|
BOOL visibleItemsSelected() const; // Returns true if any items in the current tab are selected.
|
||||||
|
|
||||||
void find();
|
void find();
|
||||||
void setAllowMultiple(BOOL allow_multiple);
|
void setAllowMultiple(BOOL allow_multiple);
|
||||||
|
LLScrollListCtrl* getActiveList();
|
||||||
|
|
||||||
virtual void draw();
|
virtual void draw();
|
||||||
virtual BOOL handleKeyHere(KEY key, MASK mask);
|
virtual BOOL handleKeyHere(KEY key, MASK mask);
|
||||||
|
|
||||||
std::vector<LLUUID> mSelectedInventoryAvatarIDs;
|
|
||||||
std::vector<std::string> mSelectedInventoryAvatarNames;
|
|
||||||
LLUUID mQueryID;
|
LLUUID mQueryID;
|
||||||
int mNumResultsReturned;
|
int mNumResultsReturned;
|
||||||
BOOL mNearMeListComplete;
|
BOOL mNearMeListComplete;
|
||||||
BOOL mCloseOnSelect;
|
BOOL mCloseOnSelect;
|
||||||
|
|
||||||
|
validate_signal_t mOkButtonValidateSignal;
|
||||||
select_callback_t mSelectionCallback;
|
select_callback_t mSelectionCallback;
|
||||||
|
|
||||||
// do not call these directly
|
|
||||||
LLFloaterAvatarPicker();
|
|
||||||
virtual ~LLFloaterAvatarPicker();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -112,8 +112,6 @@ LLVoiceChannel* LLVoiceChannel::sSuspendedVoiceChannel = NULL;
|
|||||||
|
|
||||||
BOOL LLVoiceChannel::sSuspended = FALSE;
|
BOOL LLVoiceChannel::sSuspended = FALSE;
|
||||||
|
|
||||||
std::set<LLFloaterIMPanel*> LLFloaterIMPanel::sFloaterIMPanels;
|
|
||||||
|
|
||||||
void session_starter_helper(
|
void session_starter_helper(
|
||||||
const LLUUID& temp_session_id,
|
const LLUUID& temp_session_id,
|
||||||
const LLUUID& other_participant_id,
|
const LLUUID& other_participant_id,
|
||||||
@@ -1126,10 +1124,6 @@ LLFloaterIMPanel::LLFloaterIMPanel(
|
|||||||
llwarns << "Other participant is NULL" << llendl;
|
llwarns << "Other participant is NULL" << llendl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// [Ansariel: Display name support]
|
|
||||||
sFloaterIMPanels.insert(this);
|
|
||||||
// [/Ansariel: Display name support]
|
|
||||||
|
|
||||||
init(session_label);
|
init(session_label);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1166,10 +1160,6 @@ LLFloaterIMPanel::LLFloaterIMPanel(
|
|||||||
{
|
{
|
||||||
llwarns << "Other participant is NULL" << llendl;
|
llwarns << "Other participant is NULL" << llendl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// [Ansariel: Display name support]
|
|
||||||
sFloaterIMPanels.insert(this);
|
|
||||||
// [/Ansariel: Display name support]
|
|
||||||
|
|
||||||
mSessionInitialTargetIDs = ids;
|
mSessionInitialTargetIDs = ids;
|
||||||
init(session_label);
|
init(session_label);
|
||||||
@@ -1304,28 +1294,18 @@ void LLFloaterIMPanel::init(const std::string& session_label)
|
|||||||
|
|
||||||
void LLFloaterIMPanel::lookupName()
|
void LLFloaterIMPanel::lookupName()
|
||||||
{
|
{
|
||||||
LLAvatarNameCache::get(mOtherParticipantUUID, boost::bind(&LLFloaterIMPanel::onAvatarNameLookup, _1, _2, this));
|
LLAvatarNameCache::get(mOtherParticipantUUID, boost::bind(&LLFloaterIMPanel::onAvatarNameLookup, this, _1, _2));
|
||||||
}
|
}
|
||||||
|
|
||||||
//static
|
void LLFloaterIMPanel::onAvatarNameLookup(const LLUUID&, const LLAvatarName& avatar_name)
|
||||||
void LLFloaterIMPanel::onAvatarNameLookup(const LLUUID&, const LLAvatarName& avatar_name, void* data)
|
|
||||||
{
|
{
|
||||||
LLFloaterIMPanel* self = (LLFloaterIMPanel*)data;
|
std::string title;
|
||||||
|
LLAvatarNameCache::getPNSName(avatar_name, title);
|
||||||
if (self && sFloaterIMPanels.count(self) != 0)
|
setTitle(title);
|
||||||
{
|
|
||||||
std::string title;
|
|
||||||
LLAvatarNameCache::getPNSName(avatar_name, title);
|
|
||||||
self->setTitle(title);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LLFloaterIMPanel::~LLFloaterIMPanel()
|
LLFloaterIMPanel::~LLFloaterIMPanel()
|
||||||
{
|
{
|
||||||
// [Ansariel: Display name support]
|
|
||||||
sFloaterIMPanels.erase(this);
|
|
||||||
// [/Ansariel: Display name support]
|
|
||||||
|
|
||||||
delete mSpeakers;
|
delete mSpeakers;
|
||||||
mSpeakers = NULL;
|
mSpeakers = NULL;
|
||||||
|
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ public:
|
|||||||
virtual ~LLFloaterIMPanel();
|
virtual ~LLFloaterIMPanel();
|
||||||
|
|
||||||
void lookupName();
|
void lookupName();
|
||||||
static void onAvatarNameLookup(const LLUUID&, const LLAvatarName& avatar_name, void* data);
|
void onAvatarNameLookup(const LLUUID&, const LLAvatarName& avatar_name);
|
||||||
|
|
||||||
/*virtual*/ BOOL postBuild();
|
/*virtual*/ BOOL postBuild();
|
||||||
|
|
||||||
|
|||||||
@@ -1585,10 +1585,9 @@ void LLPanelAvatar::setOnlineStatus(EOnlineStatus online_status)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLPanelAvatar::on_avatar_name_response(const LLUUID& agent_id, const LLAvatarName& av_name, void *userdata){
|
void LLPanelAvatar::onAvatarNameResponse(const LLUUID& agent_id, const LLAvatarName& av_name){
|
||||||
LLPanelAvatar* self = (LLPanelAvatar*)userdata;
|
LLLineEditor* dnname_edit = getChild<LLLineEditor>("dnname");
|
||||||
LLLineEditor* dnname_edit = self->getChild<LLLineEditor>("dnname");
|
if(LLAvatarNameCache::useDisplayNames() && agent_id==mAvatarID) dnname_edit->setText(av_name.getCompleteName());
|
||||||
if(LLAvatarNameCache::useDisplayNames() && agent_id==self->mAvatarID) dnname_edit->setText(av_name.getCompleteName());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name,
|
void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name,
|
||||||
@@ -1663,7 +1662,7 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
dnname_edit->setText(name_edit->getText());
|
dnname_edit->setText(name_edit->getText());
|
||||||
LLAvatarNameCache::get(avatar_id, boost::bind(&LLPanelAvatar::on_avatar_name_response, _1, _2, this));
|
LLAvatarNameCache::get(avatar_id, boost::bind(&LLPanelAvatar::onAvatarNameResponse, this, _1, _2));
|
||||||
}
|
}
|
||||||
childSetVisible("dnname",TRUE);
|
childSetVisible("dnname",TRUE);
|
||||||
childSetVisible("name",FALSE);
|
childSetVisible("name",FALSE);
|
||||||
|
|||||||
@@ -299,6 +299,8 @@ public:
|
|||||||
|
|
||||||
void setAvatar(LLViewerObject *avatarp);
|
void setAvatar(LLViewerObject *avatarp);
|
||||||
|
|
||||||
|
void onAvatarNameResponse(const LLUUID& agent_id, const LLAvatarName& av_name);
|
||||||
|
|
||||||
// Fill in the avatar ID and handle some field fill-in, as well as
|
// Fill in the avatar ID and handle some field fill-in, as well as
|
||||||
// button enablement.
|
// button enablement.
|
||||||
// Pass one of the ONLINE_STATUS_foo constants above.
|
// Pass one of the ONLINE_STATUS_foo constants above.
|
||||||
@@ -350,7 +352,6 @@ private:
|
|||||||
static bool finishUnfreeze(const LLSD& notification, const LLSD& response);
|
static bool finishUnfreeze(const LLSD& notification, const LLSD& response);
|
||||||
|
|
||||||
static void showProfileCallback(S32 option, void *userdata);
|
static void showProfileCallback(S32 option, void *userdata);
|
||||||
static void on_avatar_name_response(const LLUUID& agent_id, const LLAvatarName& av_name, void *userdata);
|
|
||||||
static void* createPanelAvatar(void* data);
|
static void* createPanelAvatar(void* data);
|
||||||
static void* createFloaterAvatarInfo(void* data);
|
static void* createFloaterAvatarInfo(void* data);
|
||||||
static void* createPanelAvatarSecondLife(void* data);
|
static void* createPanelAvatarSecondLife(void* data);
|
||||||
|
|||||||
@@ -49,7 +49,9 @@
|
|||||||
#include "lluictrlfactory.h"
|
#include "lluictrlfactory.h"
|
||||||
#include "llviewerwindow.h"
|
#include "llviewerwindow.h"
|
||||||
|
|
||||||
class LLPanelGroupInvite::impl
|
#include <boost/signals2.hpp>
|
||||||
|
|
||||||
|
class LLPanelGroupInvite::impl : public boost::signals2::trackable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
impl(const LLUUID& group_id);
|
impl(const LLUUID& group_id);
|
||||||
@@ -67,12 +69,10 @@ public:
|
|||||||
static void callbackClickAdd(void* userdata);
|
static void callbackClickAdd(void* userdata);
|
||||||
static void callbackClickRemove(void* userdata);
|
static void callbackClickRemove(void* userdata);
|
||||||
static void callbackSelect(LLUICtrl* ctrl, void* userdata);
|
static void callbackSelect(LLUICtrl* ctrl, void* userdata);
|
||||||
static void callbackAddUsers(const uuid_vec_t& agent_ids,
|
void callbackAddUsers(const uuid_vec_t& agent_idsa);
|
||||||
void* user_data);
|
|
||||||
|
|
||||||
static void onAvatarNameCache(const LLUUID& agent_id,
|
void onAvatarNameCache(const LLUUID& agent_id,
|
||||||
const LLAvatarName& av_name,
|
const LLAvatarName& av_name);
|
||||||
void* user_data);
|
|
||||||
|
|
||||||
bool inviteOwnerCallback(const LLSD& notification, const LLSD& response);
|
bool inviteOwnerCallback(const LLSD& notification, const LLSD& response);
|
||||||
|
|
||||||
@@ -307,7 +307,7 @@ void LLPanelGroupInvite::impl::callbackClickAdd(void* userdata)
|
|||||||
//instead of being it's own separate floater. But that is next week.
|
//instead of being it's own separate floater. But that is next week.
|
||||||
//This will do for now. -jwolk May 10, 2006
|
//This will do for now. -jwolk May 10, 2006
|
||||||
LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(
|
LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(
|
||||||
boost::bind(impl::callbackAddUsers, _1, panelp->mImplementation), TRUE);
|
boost::bind(&impl::callbackAddUsers, panelp->mImplementation, _1), TRUE);
|
||||||
if (picker)
|
if (picker)
|
||||||
{
|
{
|
||||||
gFloaterView->getParentFloater(panelp)->addDependentFloater(picker);
|
gFloaterView->getParentFloater(panelp)->addDependentFloater(picker);
|
||||||
@@ -376,34 +376,25 @@ void LLPanelGroupInvite::impl::callbackClickOK(void* userdata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LLPanelGroupInvite::impl::callbackAddUsers(const uuid_vec_t& agent_ids)
|
||||||
//static
|
|
||||||
void LLPanelGroupInvite::impl::callbackAddUsers(const uuid_vec_t& agent_ids, void* user_data)
|
|
||||||
{
|
{
|
||||||
std::vector<std::string> names;
|
std::vector<std::string> names;
|
||||||
for (S32 i = 0; i < (S32)agent_ids.size(); i++)
|
for (S32 i = 0; i < (S32)agent_ids.size(); i++)
|
||||||
{
|
{
|
||||||
LLAvatarNameCache::get(agent_ids[i],
|
LLAvatarNameCache::get(agent_ids[i],
|
||||||
boost::bind(&LLPanelGroupInvite::impl::onAvatarNameCache, _1, _2, user_data));
|
boost::bind(&LLPanelGroupInvite::impl::onAvatarNameCache, this, _1, _2));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLPanelGroupInvite::impl::onAvatarNameCache(const LLUUID& agent_id,
|
void LLPanelGroupInvite::impl::onAvatarNameCache(const LLUUID& agent_id,
|
||||||
const LLAvatarName& av_name,
|
const LLAvatarName& av_name)
|
||||||
void* user_data)
|
|
||||||
{
|
{
|
||||||
impl* selfp = (impl*) user_data;
|
std::vector<std::string> names;
|
||||||
|
uuid_vec_t agent_ids;
|
||||||
if (selfp)
|
agent_ids.push_back(agent_id);
|
||||||
{
|
names.push_back(av_name.getCompleteName());
|
||||||
std::vector<std::string> names;
|
|
||||||
uuid_vec_t agent_ids;
|
|
||||||
agent_ids.push_back(agent_id);
|
|
||||||
names.push_back(av_name.getCompleteName());
|
|
||||||
|
|
||||||
selfp->addUsers(names, agent_ids);
|
addUsers(names, agent_ids);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LLPanelGroupInvite::LLPanelGroupInvite(const std::string& name,
|
LLPanelGroupInvite::LLPanelGroupInvite(const std::string& name,
|
||||||
|
|||||||
@@ -191,7 +191,6 @@ extern AIHTTPTimeoutPolicy authHandler_timeout;
|
|||||||
|
|
||||||
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
|
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
|
||||||
#include "llfloateravatarinfo.h"
|
#include "llfloateravatarinfo.h"
|
||||||
extern LLMap< const LLUUID, LLFloaterAvatarInfo* > gAvatarInfoInstances; // Only defined in llfloateravatarinfo.cpp
|
|
||||||
// [/RLVa:KB]
|
// [/RLVa:KB]
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -2692,7 +2691,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
|
|||||||
{
|
{
|
||||||
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b
|
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b
|
||||||
bool fRlvObfuscate = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
|
bool fRlvObfuscate = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
|
||||||
(RlvUtil::isNearbyAgent(from_id)) && (!gAvatarInfoInstances.checkData(from_id));
|
(RlvUtil::isNearbyAgent(from_id)) && (!LLFloaterAvatarInfo::getInstance(from_id));
|
||||||
args["NAME"] = (!fRlvObfuscate) ? name : RlvStrings::getAnonym(name);
|
args["NAME"] = (!fRlvObfuscate) ? name : RlvStrings::getAnonym(name);
|
||||||
// [/RLVa:KB]
|
// [/RLVa:KB]
|
||||||
//args["NAME"] = name;
|
//args["NAME"] = name;
|
||||||
@@ -2703,7 +2702,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
|
|||||||
{
|
{
|
||||||
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b
|
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b
|
||||||
bool fRlvObfuscate = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
|
bool fRlvObfuscate = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
|
||||||
(RlvUtil::isNearbyAgent(from_id)) && (!gAvatarInfoInstances.checkData(from_id));
|
(RlvUtil::isNearbyAgent(from_id)) && (!LLFloaterAvatarInfo::getInstance(from_id));
|
||||||
args["NAME"] = (!fRlvObfuscate) ? name : RlvStrings::getAnonym(name);
|
args["NAME"] = (!fRlvObfuscate) ? name : RlvStrings::getAnonym(name);
|
||||||
// [/RLVa:KB]
|
// [/RLVa:KB]
|
||||||
//args["NAME"] = name;
|
//args["NAME"] = name;
|
||||||
|
|||||||
@@ -6784,7 +6784,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield, b
|
|||||||
NULL,
|
NULL,
|
||||||
&focus_point);
|
&focus_point);
|
||||||
}
|
}
|
||||||
else
|
else if(gAgent.getRegion())
|
||||||
{
|
{
|
||||||
//focus on alt-zoom target
|
//focus on alt-zoom target
|
||||||
focus_point = LLVector3(gAgentCamera.getFocusGlobal()-gAgent.getRegion()->getOriginGlobal());
|
focus_point = LLVector3(gAgentCamera.getFocusGlobal()-gAgent.getRegion()->getOriginGlobal());
|
||||||
|
|||||||
@@ -1,7 +1,29 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||||
<floater bottom="-380" can_close="true" can_drag_on_left="false" can_minimize="true"
|
<floater bottom="-380" can_close="true" can_drag_on_left="false" can_minimize="true"
|
||||||
can_resize="true" height="350" left="400" min_height="200" min_width="375"
|
can_resize="true" height="350" left="400" min_height="200" min_width="340"
|
||||||
mouse_opaque="true" name="avatarpicker" title="Choose Resident" width="375">
|
mouse_opaque="true" name="avatarpicker" title="Choose Resident" width="375">
|
||||||
|
<string
|
||||||
|
name="not_found">
|
||||||
|
'[TEXT]' not found
|
||||||
|
</string>
|
||||||
|
<string
|
||||||
|
name="no_one_near">
|
||||||
|
No one near
|
||||||
|
</string>
|
||||||
|
<string
|
||||||
|
name="no_results">
|
||||||
|
No results
|
||||||
|
</string>
|
||||||
|
<string
|
||||||
|
name="searching">
|
||||||
|
Searching...
|
||||||
|
</string>
|
||||||
|
<!-- For multiple person selection, use "Select" and "Close"
|
||||||
|
instead of "OK" and "Cancel" because "Cancel" still keeps the ones
|
||||||
|
you have already selected. The code will show the appropriate
|
||||||
|
set of buttons. -->
|
||||||
|
<string name="Select">Select</string>
|
||||||
|
<string name="Close">Close</string>
|
||||||
|
|
||||||
<tab_container bottom="30" follows="left|right|top|bottom" height="300" left="4"
|
<tab_container bottom="30" follows="left|right|top|bottom" height="300" left="4"
|
||||||
name="ResidentChooserTabs" tab_position="top" tab_width="65" width="365">
|
name="ResidentChooserTabs" tab_position="top" tab_width="65" width="365">
|
||||||
@@ -29,19 +51,23 @@
|
|||||||
multi_select="false" name="SearchResults" width="115" />
|
multi_select="false" name="SearchResults" width="115" />
|
||||||
</panel>
|
</panel>
|
||||||
|
|
||||||
<panel name="CallingCardsPanel" label="Calling Cards"
|
<panel name="FriendsPanel" label="Friends"
|
||||||
border="true" bottom="0" height="150" left="0" width="135"
|
border="true" bottom="0" height="150" left="0" width="135"
|
||||||
mouse_opaque="true">
|
mouse_opaque="true">
|
||||||
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||||
bottom="-24" drop_shadow_visible="true" follows="left|top"
|
bottom="-24" drop_shadow_visible="true" follows="left|top"
|
||||||
font="SansSerifSmall" h_pad="0" halign="left" height="16" left="10"
|
font="SansSerifSmall" h_pad="0" halign="left" height="16" left="10"
|
||||||
mouse_opaque="true" name="InstructSelectCallingCard" v_pad="0"
|
mouse_opaque="true" name="InstructSelectFriend" v_pad="0"
|
||||||
width="220">
|
width="220">
|
||||||
Select a calling card:
|
Select a person:
|
||||||
</text>
|
</text>
|
||||||
<inventory_panel allow_multi_select="false" border="true" bottom_delta="-117"
|
<button bottom_delta="-3" left_delta="25" width="90" height="20" follows="top|right"
|
||||||
|
label="Refresh List" label_selected="Refresh List" halign="center"
|
||||||
|
font="SansSerif" mouse_opaque="true" name="RefreshFriends" scale_image="TRUE" />
|
||||||
|
<scroll_list background_visible="true" bottom_delta="-115" column_padding="5"
|
||||||
|
draw_border="true" draw_heading="false" draw_stripes="true"
|
||||||
follows="left|top|right|bottom" height="110" left="10" mouse_opaque="true"
|
follows="left|top|right|bottom" height="110" left="10" mouse_opaque="true"
|
||||||
name="InventoryPanel" sort_order="AvatarPickerSortOrder" width="115" />
|
multi_select="false" name="Friends" width="115" />
|
||||||
</panel>
|
</panel>
|
||||||
|
|
||||||
<panel name="NearMePanel" label="Near Me"
|
<panel name="NearMePanel" label="Near Me"
|
||||||
@@ -88,23 +114,11 @@
|
|||||||
</panel>
|
</panel>
|
||||||
</tab_container>
|
</tab_container>
|
||||||
|
|
||||||
<button bottom="6" left="10" follows="left|bottom" font="SansSerif" halign="center"
|
<button bottom="6" left="10" follows="left|bottom" font="SansSerif" halign="center"
|
||||||
width="95" height="20" label="Select" label_selected="Select" mouse_opaque="true"
|
width="95" height="20" label="OK" label_selected="OK" mouse_opaque="true"
|
||||||
name="Select" scale_image="TRUE" />
|
name="ok_btn" scale_image="TRUE" />
|
||||||
<button bottom_delta="0" right="240" follows="left|bottom" font="SansSerif" halign="center"
|
<button bottom_delta="0" right="240" follows="left|bottom" font="SansSerif" halign="center"
|
||||||
width="95" height="20" label="Cancel" label_selected="Cancel" mouse_opaque="true"
|
width="95" height="20" label="Cancel" label_selected="Cancel" mouse_opaque="true"
|
||||||
name="Cancel" scale_image="TRUE" />
|
name="cancel_btn" scale_image="TRUE" />
|
||||||
|
|
||||||
<string name="not_found">
|
|
||||||
'[TEXT]' not found
|
|
||||||
</string>
|
|
||||||
<string name="no_one_near">
|
|
||||||
No-one near
|
|
||||||
</string>
|
|
||||||
<string name="no_results">
|
|
||||||
No results
|
|
||||||
</string>
|
|
||||||
<string name="searching">
|
|
||||||
Searching...
|
|
||||||
</string>
|
|
||||||
</floater>
|
</floater>
|
||||||
|
|||||||
@@ -1,5 +1,23 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||||
<floater name="avatarpicker" title="Elegir a un Residente">
|
<floater name="avatarpicker" title="Elegir a un Residente">
|
||||||
|
<string name="not_found">
|
||||||
|
No se ha encontrado a '[TEXT]'
|
||||||
|
</string>
|
||||||
|
<string name="no_one_near">
|
||||||
|
Nadie Cercano
|
||||||
|
</string>
|
||||||
|
<string name="no_results">
|
||||||
|
Sin resultados
|
||||||
|
</string>
|
||||||
|
<string name="searching">
|
||||||
|
Buscando...
|
||||||
|
</string>
|
||||||
|
<string label="Elegir" label_selected="Elegir" name="Select">
|
||||||
|
Seleccionar
|
||||||
|
</string>
|
||||||
|
<string name="Close">
|
||||||
|
Cerrar
|
||||||
|
</string>
|
||||||
<tab_container name="ResidentChooserTabs">
|
<tab_container name="ResidentChooserTabs">
|
||||||
<panel name="SearchPanel" label="Buscar">
|
<panel name="SearchPanel" label="Buscar">
|
||||||
<text name="InstructSearchResidentName">
|
<text name="InstructSearchResidentName">
|
||||||
@@ -7,10 +25,11 @@
|
|||||||
</text>
|
</text>
|
||||||
<button label="Buscar" label_selected="Buscar" name="Find"/>
|
<button label="Buscar" label_selected="Buscar" name="Find"/>
|
||||||
</panel>
|
</panel>
|
||||||
<panel name="CallingCardsPanel" label="Tarjeta de Llamada">
|
<panel name="FriendsPanel" label="Amigos">
|
||||||
<text name="InstructSelectCallingCard">
|
<text name="InstructSelectFriend">
|
||||||
Elige una Tarjeta de Llamada:
|
Elige a una persona:
|
||||||
</text>
|
</text>
|
||||||
|
<button label="Actualizar Lista" label_selected="Actualizar Lista" name="RefreshFriends"/>
|
||||||
</panel>
|
</panel>
|
||||||
<panel name="NearMePanel" label="Cercanos">
|
<panel name="NearMePanel" label="Cercanos">
|
||||||
<text name="InstructSelectResident">
|
<text name="InstructSelectResident">
|
||||||
@@ -29,18 +48,6 @@
|
|||||||
</text>
|
</text>
|
||||||
</panel>
|
</panel>
|
||||||
</tab_container>
|
</tab_container>
|
||||||
<button label="Elegir" label_selected="Elegir" name="Select"/>
|
<button label="OK" label_selected="OK" name="Select"/>
|
||||||
<button label="Cancelar" label_selected="Cancelar" name="Cancel"/>
|
<button label="Cancelar" label_selected="Cancelar" name="Cancel"/>
|
||||||
<string name="not_found">
|
|
||||||
No se ha encontrado a '[TEXT]'
|
|
||||||
</string>
|
|
||||||
<string name="no_one_near">
|
|
||||||
Nadie Cercano
|
|
||||||
</string>
|
|
||||||
<string name="no_results">
|
|
||||||
Sin resultados
|
|
||||||
</string>
|
|
||||||
<string name="searching">
|
|
||||||
Buscando...
|
|
||||||
</string>
|
|
||||||
</floater>
|
</floater>
|
||||||
|
|||||||
@@ -1,5 +1,23 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||||
<floater name="avatarpicker" title="Choisir le résident">
|
<floater name="avatarpicker" title="Choisir le résident">
|
||||||
|
<string name="not_found">
|
||||||
|
'[TEXT]' introuvable
|
||||||
|
</string>
|
||||||
|
<string name="no_one_near">
|
||||||
|
Il n'y a personne près de vous
|
||||||
|
</string>
|
||||||
|
<string name="no_results">
|
||||||
|
Aucun résultat
|
||||||
|
</string>
|
||||||
|
<string name="searching">
|
||||||
|
Recherche...
|
||||||
|
</string>
|
||||||
|
<string label="OK" label_selected="OK" name="Select">
|
||||||
|
Sélectionner
|
||||||
|
</string>
|
||||||
|
<string name="Close">
|
||||||
|
Fermer
|
||||||
|
</string>
|
||||||
<tab_container name="ResidentChooserTabs">
|
<tab_container name="ResidentChooserTabs">
|
||||||
<panel label="Rechercher" name="SearchPanel">
|
<panel label="Rechercher" name="SearchPanel">
|
||||||
<text name="InstructSearchResidentName">
|
<text name="InstructSearchResidentName">
|
||||||
@@ -7,10 +25,11 @@
|
|||||||
</text>
|
</text>
|
||||||
<button label="Trouver" label_selected="Trouver" name="Find"/>
|
<button label="Trouver" label_selected="Trouver" name="Find"/>
|
||||||
</panel>
|
</panel>
|
||||||
<panel name="CallingCardsPanel" label="Cartes de visite">
|
<panel name="FriendsPanel" label="Amis">
|
||||||
<text name="InstructSelectCallingCard">
|
<text name="InstructSelectFriend">
|
||||||
Sélectionner une carte de visite:
|
Sélectionner une personne:
|
||||||
</text>
|
</text>
|
||||||
|
<button font="SansSerifSmall" label="Rafraîchir la liste" label_selected="Rafraîchir la liste" name="RefreshFriends" left_delta="10" width="105"/>
|
||||||
</panel>
|
</panel>
|
||||||
<panel name="NearMePanel" label="Près de moi">
|
<panel name="NearMePanel" label="Près de moi">
|
||||||
<text name="InstructSelectResident">
|
<text name="InstructSelectResident">
|
||||||
@@ -29,18 +48,6 @@
|
|||||||
</text>
|
</text>
|
||||||
</panel>
|
</panel>
|
||||||
</tab_container>
|
</tab_container>
|
||||||
<button label="Sélectionner" label_selected="Sélectionner" name="Select"/>
|
<button label="OK" label_selected="OK" name="ok_btn"/>
|
||||||
<button label="Annuler" label_selected="Annuler" name="Cancel"/>
|
<button label="Annuler" label_selected="Annuler" name="cancel_btn"/>
|
||||||
<string name="not_found">
|
|
||||||
'[TEXT]' introuvable
|
|
||||||
</string>
|
|
||||||
<string name="no_one_near">
|
|
||||||
Il n'y a personne près de vous
|
|
||||||
</string>
|
|
||||||
<string name="no_results">
|
|
||||||
Aucun résultat
|
|
||||||
</string>
|
|
||||||
<string name="searching">
|
|
||||||
Recherche...
|
|
||||||
</string>
|
|
||||||
</floater>
|
</floater>
|
||||||
|
|||||||
Reference in New Issue
Block a user