Update to LLAvatarNameCache and consumers.
This commit is contained in:
@@ -820,6 +820,7 @@ P(accountingCostResponder);
|
|||||||
P(agentStateResponder);
|
P(agentStateResponder);
|
||||||
P(assetUploadResponder);
|
P(assetUploadResponder);
|
||||||
P(asyncConsoleResponder);
|
P(asyncConsoleResponder);
|
||||||
|
P(avatarPickerResponder);
|
||||||
P(authHandler);
|
P(authHandler);
|
||||||
P(avatarNameResponder);
|
P(avatarNameResponder);
|
||||||
P2(baseCapabilitiesComplete, transfer_18s);
|
P2(baseCapabilitiesComplete, transfer_18s);
|
||||||
|
|||||||
@@ -93,6 +93,9 @@ namespace LLAvatarNameCache
|
|||||||
/// Time when unrefreshed cached names were checked last
|
/// Time when unrefreshed cached names were checked last
|
||||||
static F64 sLastExpireCheck;
|
static F64 sLastExpireCheck;
|
||||||
|
|
||||||
|
/// Time-to-live for a temp cache entry.
|
||||||
|
const F64 TEMP_CACHE_ENTRY_LIFETIME = 60.0;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
// Internal methods
|
// Internal methods
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
@@ -291,13 +294,14 @@ void LLAvatarNameCache::handleAgentError(const LLUUID& agent_id)
|
|||||||
// Clear this agent from the pending list
|
// Clear this agent from the pending list
|
||||||
LLAvatarNameCache::sPendingQueue.erase(agent_id);
|
LLAvatarNameCache::sPendingQueue.erase(agent_id);
|
||||||
|
|
||||||
const LLAvatarName& av_name = existing->second;
|
LLAvatarName& av_name = existing->second;
|
||||||
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache use cache for agent "
|
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache use cache for agent "
|
||||||
<< agent_id
|
<< agent_id
|
||||||
<< "user '" << av_name.mUsername << "' "
|
<< "user '" << av_name.mUsername << "' "
|
||||||
<< "display '" << av_name.mDisplayName << "' "
|
<< "display '" << av_name.mDisplayName << "' "
|
||||||
<< "expires in " << av_name.mExpires - LLFrameTimer::getTotalSeconds() << " seconds"
|
<< "expires in " << av_name.mExpires - LLFrameTimer::getTotalSeconds() << " seconds"
|
||||||
<< LL_ENDL;
|
<< LL_ENDL;
|
||||||
|
av_name.mExpires = LLFrameTimer::getTotalSeconds() + TEMP_CACHE_ENTRY_LIFETIME; // reset expiry time so we don't constantly rerequest.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -342,19 +346,23 @@ void LLAvatarNameCache::requestNamesViaCapability()
|
|||||||
// http://pdp60.lindenlab.com:8000/agents/?ids=3941037e-78ab-45f0-b421-bd6e77c1804d&ids=0012809d-7d2d-4c24-9609-af1230a37715&ids=0019aaba-24af-4f0a-aa72-6457953cf7f0
|
// http://pdp60.lindenlab.com:8000/agents/?ids=3941037e-78ab-45f0-b421-bd6e77c1804d&ids=0012809d-7d2d-4c24-9609-af1230a37715&ids=0019aaba-24af-4f0a-aa72-6457953cf7f0
|
||||||
//
|
//
|
||||||
// Apache can handle URLs of 4096 chars, but let's be conservative
|
// Apache can handle URLs of 4096 chars, but let's be conservative
|
||||||
const U32 NAME_URL_MAX = 4096;
|
static const U32 NAME_URL_MAX = 4096;
|
||||||
const U32 NAME_URL_SEND_THRESHOLD = 3000;
|
static const U32 NAME_URL_SEND_THRESHOLD = 3500;
|
||||||
|
|
||||||
std::string url;
|
std::string url;
|
||||||
url.reserve(NAME_URL_MAX);
|
url.reserve(NAME_URL_MAX);
|
||||||
|
|
||||||
std::vector<LLUUID> agent_ids;
|
std::vector<LLUUID> agent_ids;
|
||||||
agent_ids.reserve(128);
|
agent_ids.reserve(128);
|
||||||
|
|
||||||
|
U32 id_total = sAskQueue.size();
|
||||||
U32 ids = 0;
|
U32 ids = 0;
|
||||||
ask_queue_t::const_iterator it = sAskQueue.begin();
|
ask_queue_t::const_iterator it;
|
||||||
for ( ; it != sAskQueue.end(); ++it)
|
while(!sAskQueue.empty())
|
||||||
{
|
{
|
||||||
|
it = sAskQueue.begin();
|
||||||
const LLUUID& agent_id = *it;
|
const LLUUID& agent_id = *it;
|
||||||
|
sAskQueue.erase(it);
|
||||||
|
|
||||||
if (url.empty())
|
if (url.empty())
|
||||||
{
|
{
|
||||||
@@ -377,27 +385,17 @@ void LLAvatarNameCache::requestNamesViaCapability()
|
|||||||
|
|
||||||
if (url.size() > NAME_URL_SEND_THRESHOLD)
|
if (url.size() > NAME_URL_SEND_THRESHOLD)
|
||||||
{
|
{
|
||||||
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaCapability first "
|
break;
|
||||||
<< ids << " ids"
|
|
||||||
<< LL_ENDL;
|
|
||||||
LLHTTPClient::get(url, new LLAvatarNameResponder(agent_ids));
|
|
||||||
url.clear();
|
|
||||||
agent_ids.clear();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!url.empty())
|
if (!url.empty())
|
||||||
{
|
{
|
||||||
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaCapability all "
|
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaCapability requested "
|
||||||
<< ids << " ids"
|
<< ids << "/" << id_total << "ids "
|
||||||
<< LL_ENDL;
|
<< LL_ENDL;
|
||||||
LLHTTPClient::get(url, new LLAvatarNameResponder(agent_ids));
|
LLHTTPClient::get(url, new LLAvatarNameResponder(agent_ids));
|
||||||
url.clear();
|
|
||||||
agent_ids.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// We've moved all asks to the pending request queue
|
|
||||||
sAskQueue.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLAvatarNameCache::legacyNameCallback(const LLUUID& agent_id,
|
void LLAvatarNameCache::legacyNameCallback(const LLUUID& agent_id,
|
||||||
@@ -414,20 +412,25 @@ void LLAvatarNameCache::legacyNameCallback(const LLUUID& agent_id,
|
|||||||
<< LL_ENDL;
|
<< LL_ENDL;
|
||||||
buildLegacyName(full_name, &av_name);
|
buildLegacyName(full_name, &av_name);
|
||||||
|
|
||||||
// Don't add to cache, the data already exists in the legacy name system
|
// Add to cache, because if we don't we'll keep rerequesting the
|
||||||
// cache and we don't want or need duplicate storage, because keeping the
|
// same record forever. buildLegacyName should always guarantee
|
||||||
// two copies in sync is complex.
|
// that these records expire reasonably soon
|
||||||
processName(agent_id, av_name, false);
|
// (in TEMP_CACHE_ENTRY_LIFETIME seconds), so if the failure was due
|
||||||
|
// to something temporary we will eventually request and get the right data.
|
||||||
|
processName(agent_id, av_name, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLAvatarNameCache::requestNamesViaLegacy()
|
void LLAvatarNameCache::requestNamesViaLegacy()
|
||||||
{
|
{
|
||||||
|
static const S32 MAX_REQUESTS = 100;
|
||||||
F64 now = LLFrameTimer::getTotalSeconds();
|
F64 now = LLFrameTimer::getTotalSeconds();
|
||||||
std::string full_name;
|
std::string full_name;
|
||||||
ask_queue_t::const_iterator it = sAskQueue.begin();
|
ask_queue_t::const_iterator it;
|
||||||
for (; it != sAskQueue.end(); ++it)
|
for (S32 requests = 0; !sAskQueue.empty() && requests < MAX_REQUESTS; ++requests)
|
||||||
{
|
{
|
||||||
|
it = sAskQueue.begin();
|
||||||
const LLUUID& agent_id = *it;
|
const LLUUID& agent_id = *it;
|
||||||
|
sAskQueue.erase(it);
|
||||||
|
|
||||||
// Mark as pending first, just in case the callback is immediately
|
// Mark as pending first, just in case the callback is immediately
|
||||||
// invoked below. This should never happen in practice.
|
// invoked below. This should never happen in practice.
|
||||||
@@ -439,10 +442,6 @@ void LLAvatarNameCache::requestNamesViaLegacy()
|
|||||||
boost::bind(&LLAvatarNameCache::legacyNameCallback,
|
boost::bind(&LLAvatarNameCache::legacyNameCallback,
|
||||||
_1, _2, _3));
|
_1, _2, _3));
|
||||||
}
|
}
|
||||||
|
|
||||||
// We've either answered immediately or moved all asks to the
|
|
||||||
// pending queue
|
|
||||||
sAskQueue.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLAvatarNameCache::initClass(bool running)
|
void LLAvatarNameCache::initClass(bool running)
|
||||||
@@ -519,11 +518,11 @@ void LLAvatarNameCache::idle()
|
|||||||
// *TODO: Possibly re-enabled this based on People API load measurements
|
// *TODO: Possibly re-enabled this based on People API load measurements
|
||||||
// 100 ms is the threshold for "user speed" operations, so we can
|
// 100 ms is the threshold for "user speed" operations, so we can
|
||||||
// stall for about that long to batch up requests.
|
// stall for about that long to batch up requests.
|
||||||
//const F32 SECS_BETWEEN_REQUESTS = 0.1f;
|
const F32 SECS_BETWEEN_REQUESTS = 0.1f;
|
||||||
//if (!sRequestTimer.checkExpirationAndReset(SECS_BETWEEN_REQUESTS))
|
if (!sRequestTimer.hasExpired())
|
||||||
//{
|
{
|
||||||
// return;
|
return;
|
||||||
//}
|
}
|
||||||
|
|
||||||
if (!sAskQueue.empty())
|
if (!sAskQueue.empty())
|
||||||
{
|
{
|
||||||
@@ -538,6 +537,12 @@ void LLAvatarNameCache::idle()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sAskQueue.empty())
|
||||||
|
{
|
||||||
|
// cleared the list, reset the request timer.
|
||||||
|
sRequestTimer.reset(SECS_BETWEEN_REQUESTS);
|
||||||
|
}
|
||||||
|
|
||||||
// erase anything that has not been refreshed for more than MAX_UNREFRESHED_TIME
|
// erase anything that has not been refreshed for more than MAX_UNREFRESHED_TIME
|
||||||
eraseUnrefreshed();
|
eraseUnrefreshed();
|
||||||
}
|
}
|
||||||
@@ -595,7 +600,7 @@ void LLAvatarNameCache::buildLegacyName(const std::string& full_name,
|
|||||||
av_name->mDisplayName = full_name;
|
av_name->mDisplayName = full_name;
|
||||||
av_name->mIsDisplayNameDefault = true;
|
av_name->mIsDisplayNameDefault = true;
|
||||||
av_name->mIsTemporaryName = true;
|
av_name->mIsTemporaryName = true;
|
||||||
av_name->mExpires = F64_MAX; // not used because these are not cached
|
av_name->mExpires = LLFrameTimer::getTotalSeconds() + TEMP_CACHE_ENTRY_LIFETIME;
|
||||||
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::buildLegacyName "
|
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::buildLegacyName "
|
||||||
<< full_name
|
<< full_name
|
||||||
<< LL_ENDL;
|
<< LL_ENDL;
|
||||||
@@ -673,8 +678,10 @@ void LLAvatarNameCache::fireSignal(const LLUUID& agent_id,
|
|||||||
signal(agent_id, av_name);
|
signal(agent_id, av_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot)
|
LLAvatarNameCache::callback_connection_t LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot)
|
||||||
{
|
{
|
||||||
|
callback_connection_t connection;
|
||||||
|
|
||||||
if (sRunning)
|
if (sRunning)
|
||||||
{
|
{
|
||||||
// ...only do immediate lookups when cache is running
|
// ...only do immediate lookups when cache is running
|
||||||
@@ -690,7 +697,7 @@ void LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot)
|
|||||||
{
|
{
|
||||||
// ...name already exists in cache, fire callback now
|
// ...name already exists in cache, fire callback now
|
||||||
fireSignal(agent_id, slot, av_name);
|
fireSignal(agent_id, slot, av_name);
|
||||||
return;
|
return connection;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -703,7 +710,7 @@ void LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot)
|
|||||||
LLAvatarName av_name;
|
LLAvatarName av_name;
|
||||||
buildLegacyName(full_name, &av_name);
|
buildLegacyName(full_name, &av_name);
|
||||||
fireSignal(agent_id, slot, av_name);
|
fireSignal(agent_id, slot, av_name);
|
||||||
return;
|
return connection;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -720,15 +727,17 @@ void LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot)
|
|||||||
{
|
{
|
||||||
// ...new callback for this id
|
// ...new callback for this id
|
||||||
callback_signal_t* signal = new callback_signal_t();
|
callback_signal_t* signal = new callback_signal_t();
|
||||||
signal->connect(slot);
|
connection = signal->connect(slot);
|
||||||
sSignalMap[agent_id] = signal;
|
sSignalMap[agent_id] = signal;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// ...existing callback, bind additional slot
|
// ...existing callback, bind additional slot
|
||||||
callback_signal_t* signal = sig_it->second;
|
callback_signal_t* signal = sig_it->second;
|
||||||
signal->connect(slot);
|
connection = signal->connect(slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c
|
// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c
|
||||||
@@ -774,12 +783,6 @@ void LLAvatarNameCache::erase(const LLUUID& agent_id)
|
|||||||
sCache.erase(agent_id);
|
sCache.erase(agent_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLAvatarNameCache::fetch(const LLUUID& agent_id)
|
|
||||||
{
|
|
||||||
// re-request, even if request is already pending
|
|
||||||
sAskQueue.insert(agent_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLAvatarNameCache::insert(const LLUUID& agent_id, const LLAvatarName& av_name)
|
void LLAvatarNameCache::insert(const LLUUID& agent_id, const LLAvatarName& av_name)
|
||||||
{
|
{
|
||||||
// *TODO: update timestamp if zero?
|
// *TODO: update timestamp if zero?
|
||||||
@@ -788,26 +791,35 @@ void LLAvatarNameCache::insert(const LLUUID& agent_id, const LLAvatarName& av_na
|
|||||||
|
|
||||||
F64 LLAvatarNameCache::nameExpirationFromHeaders(AIHTTPReceivedHeaders const& headers)
|
F64 LLAvatarNameCache::nameExpirationFromHeaders(AIHTTPReceivedHeaders const& headers)
|
||||||
{
|
{
|
||||||
F64 expires;
|
F64 expires = 0.0;
|
||||||
expirationFromCacheControl(headers, &expires);
|
if (expirationFromCacheControl(headers, &expires))
|
||||||
return expires;
|
{
|
||||||
|
return expires;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// With no expiration info, default to an hour
|
||||||
|
const F64 DEFAULT_EXPIRES = 60.0 * 60.0;
|
||||||
|
F64 now = LLFrameTimer::getTotalSeconds();
|
||||||
|
return now + DEFAULT_EXPIRES;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LLAvatarNameCache::expirationFromCacheControl(AIHTTPReceivedHeaders const& headers, F64* expires)
|
bool LLAvatarNameCache::expirationFromCacheControl(AIHTTPReceivedHeaders const& headers, F64* expires)
|
||||||
{
|
{
|
||||||
bool fromCacheControl = false;
|
bool fromCacheControl = false;
|
||||||
S32 max_age = 3600; // With no expiration info, default to an hour.
|
|
||||||
F64 now = LLFrameTimer::getTotalSeconds();
|
F64 now = LLFrameTimer::getTotalSeconds();
|
||||||
// Allow the header to override the default
|
// Allow the header to override the default
|
||||||
std::string cache_control;
|
std::string cache_control;
|
||||||
if (headers.getFirstValue("cache-control", cache_control))
|
if (headers.getFirstValue("cache-control", cache_control))
|
||||||
{
|
{
|
||||||
|
S32 max_age = 0;
|
||||||
if (max_age_from_cache_control(cache_control, &max_age))
|
if (max_age_from_cache_control(cache_control, &max_age))
|
||||||
{
|
{
|
||||||
|
*expires = now + (F64)max_age;
|
||||||
fromCacheControl = true;
|
fromCacheControl = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*expires = now + (F64)max_age;
|
|
||||||
LL_DEBUGS("AvNameCache")
|
LL_DEBUGS("AvNameCache")
|
||||||
<< ( fromCacheControl ? "expires based on cache control " : "default expiration " )
|
<< ( fromCacheControl ? "expires based on cache control " : "default expiration " )
|
||||||
<< "in " << *expires - now << " seconds"
|
<< "in " << *expires - now << " seconds"
|
||||||
|
|||||||
@@ -71,10 +71,11 @@ namespace LLAvatarNameCache
|
|||||||
void (const LLUUID& agent_id, const LLAvatarName& av_name)>
|
void (const LLUUID& agent_id, const LLAvatarName& av_name)>
|
||||||
callback_signal_t;
|
callback_signal_t;
|
||||||
typedef callback_signal_t::slot_type callback_slot_t;
|
typedef callback_signal_t::slot_type callback_slot_t;
|
||||||
|
typedef boost::signals2::connection callback_connection_t;
|
||||||
|
|
||||||
// Fetches name information and calls callback.
|
// Fetches name information and calls callback.
|
||||||
// If name information is in cache, callback will be called immediately.
|
// If name information is in cache, callback will be called immediately.
|
||||||
void get(const LLUUID& agent_id, callback_slot_t slot);
|
callback_connection_t get(const LLUUID& agent_id, callback_slot_t slot);
|
||||||
|
|
||||||
// Allow display names to be explicitly disabled for testing.
|
// Allow display names to be explicitly disabled for testing.
|
||||||
void setUseDisplayNames(bool use);
|
void setUseDisplayNames(bool use);
|
||||||
@@ -90,10 +91,6 @@ namespace LLAvatarNameCache
|
|||||||
/// Provide some fallback for agents that return errors
|
/// Provide some fallback for agents that return errors
|
||||||
void handleAgentError(const LLUUID& agent_id);
|
void handleAgentError(const LLUUID& agent_id);
|
||||||
|
|
||||||
// Force a re-fetch of the most recent data, but keep the current
|
|
||||||
// data in cache
|
|
||||||
void fetch(const LLUUID& agent_id);
|
|
||||||
|
|
||||||
void insert(const LLUUID& agent_id, const LLAvatarName& av_name);
|
void insert(const LLUUID& agent_id, const LLAvatarName& av_name);
|
||||||
|
|
||||||
// Compute name expiration time from HTTP Cache-Control header,
|
// Compute name expiration time from HTTP Cache-Control header,
|
||||||
|
|||||||
@@ -37,17 +37,20 @@
|
|||||||
|
|
||||||
#include "llagent.h"
|
#include "llagent.h"
|
||||||
#include "llbutton.h"
|
#include "llbutton.h"
|
||||||
|
#include "llcachename.h"
|
||||||
#include "llfocusmgr.h"
|
#include "llfocusmgr.h"
|
||||||
#include "llfoldervieweventlistener.h"
|
#include "llfoldervieweventlistener.h"
|
||||||
#include "llinventorypanel.h"
|
#include "llinventorypanel.h"
|
||||||
#include "llinventorymodel.h"
|
#include "llinventorymodel.h"
|
||||||
#include "llinventoryfunctions.h"
|
#include "llinventoryfunctions.h"
|
||||||
|
#include "llavatarnamecache.h" // IDEVO
|
||||||
#include "lllineeditor.h"
|
#include "lllineeditor.h"
|
||||||
#include "llscrolllistctrl.h"
|
#include "llscrolllistctrl.h"
|
||||||
#include "lltextbox.h"
|
#include "lltextbox.h"
|
||||||
#include "lluictrlfactory.h"
|
#include "lluictrlfactory.h"
|
||||||
#include "llviewercontrol.h"
|
#include "llviewercontrol.h"
|
||||||
#include "llworld.h"
|
#include "llworld.h"
|
||||||
|
#include "llviewerregion.h"
|
||||||
|
|
||||||
// [RLVa:KB]
|
// [RLVa:KB]
|
||||||
#include "rlvhandler.h"
|
#include "rlvhandler.h"
|
||||||
@@ -60,45 +63,36 @@ const std::string FLOATER_TITLE = "Choose Resident";
|
|||||||
|
|
||||||
// static
|
// static
|
||||||
LLFloaterAvatarPicker* LLFloaterAvatarPicker::sInstance = NULL;
|
LLFloaterAvatarPicker* LLFloaterAvatarPicker::sInstance = NULL;
|
||||||
|
static std::map<LLUUID, LLAvatarName> sAvatarNameMap;
|
||||||
|
|
||||||
|
LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback,
|
||||||
LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(callback_t callback,
|
|
||||||
void* userdata,
|
|
||||||
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: This class should not be a singleton as it's used in multiple places
|
||||||
// and therefore can't be used simultaneously. -MG
|
// and therefore can't be used simultaneously. -MG
|
||||||
if (!sInstance)
|
|
||||||
{
|
|
||||||
sInstance = new LLFloaterAvatarPicker();
|
|
||||||
sInstance->mCallback = callback;
|
|
||||||
sInstance->mCallbackUserdata = userdata;
|
|
||||||
sInstance->mCloseOnSelect = FALSE;
|
|
||||||
|
|
||||||
sInstance->open(); /* Flawfinder: ignore */
|
LLFloaterAvatarPicker* floater = sInstance ? sInstance : new LLFloaterAvatarPicker();
|
||||||
sInstance->center();
|
floater->open(); /* Flawfinder: ignore */
|
||||||
sInstance->setAllowMultiple(allow_multiple);
|
if(!sInstance)
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
sInstance->open(); /*Flawfinder: ignore*/
|
sInstance = floater;
|
||||||
sInstance->mCallback = callback;
|
floater->center();
|
||||||
sInstance->mCallbackUserdata = userdata;
|
|
||||||
sInstance->setAllowMultiple(allow_multiple);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sInstance->mNearMeListComplete = FALSE;
|
floater->mSelectionCallback = callback;
|
||||||
sInstance->mCloseOnSelect = closeOnSelect;
|
floater->setAllowMultiple(allow_multiple);
|
||||||
return sInstance;
|
floater->mNearMeListComplete = FALSE;
|
||||||
|
floater->mCloseOnSelect = closeOnSelect;
|
||||||
|
return floater;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default constructor
|
// Default constructor
|
||||||
LLFloaterAvatarPicker::LLFloaterAvatarPicker() :
|
LLFloaterAvatarPicker::LLFloaterAvatarPicker() :
|
||||||
LLFloater(std::string("avatarpicker"), FLOATER_RECT, FLOATER_TITLE, TRUE, MIN_WIDTH, MIN_HEIGHT),
|
LLFloater(std::string("avatarpicker"), FLOATER_RECT, FLOATER_TITLE, TRUE, MIN_WIDTH, MIN_HEIGHT),
|
||||||
mResultsReturned(FALSE),
|
mNumResultsReturned(0),
|
||||||
mCallback(NULL),
|
mNearMeListComplete(FALSE),
|
||||||
mCallbackUserdata(NULL)
|
mCloseOnSelect(FALSE)
|
||||||
{
|
{
|
||||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_avatar_picker.xml", NULL);
|
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_avatar_picker.xml", NULL);
|
||||||
}
|
}
|
||||||
@@ -111,16 +105,16 @@ BOOL LLFloaterAvatarPicker::postBuild()
|
|||||||
childSetAction("Find", boost::bind(&LLFloaterAvatarPicker::onBtnFind, this));
|
childSetAction("Find", boost::bind(&LLFloaterAvatarPicker::onBtnFind, this));
|
||||||
getChildView("Find")->setEnabled(FALSE);
|
getChildView("Find")->setEnabled(FALSE);
|
||||||
childSetAction("Refresh", boost::bind(&LLFloaterAvatarPicker::onBtnRefresh, this));
|
childSetAction("Refresh", boost::bind(&LLFloaterAvatarPicker::onBtnRefresh, this));
|
||||||
getChild<LLUICtrl>("near_me_range")->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onRangeAdjust, _1, this));
|
getChild<LLUICtrl>("near_me_range")->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onRangeAdjust, this));
|
||||||
|
|
||||||
LLScrollListCtrl* searchresults = getChild<LLScrollListCtrl>("SearchResults");
|
LLScrollListCtrl* searchresults = getChild<LLScrollListCtrl>("SearchResults");
|
||||||
searchresults->setDoubleClickCallback( boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
|
searchresults->setDoubleClickCallback( boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
|
||||||
searchresults->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, _1, this));
|
searchresults->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, this));
|
||||||
getChildView("SearchResults")->setEnabled(FALSE);
|
getChildView("SearchResults")->setEnabled(FALSE);
|
||||||
|
|
||||||
LLScrollListCtrl* nearme = getChild<LLScrollListCtrl>("NearMe");
|
LLScrollListCtrl* nearme = getChild<LLScrollListCtrl>("NearMe");
|
||||||
nearme->setDoubleClickCallback(boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
|
nearme->setDoubleClickCallback(boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
|
||||||
nearme->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, _1, this));
|
nearme->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, this));
|
||||||
|
|
||||||
childSetAction("Select", boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
|
childSetAction("Select", boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
|
||||||
getChildView("Select")->setEnabled(FALSE);
|
getChildView("Select")->setEnabled(FALSE);
|
||||||
@@ -135,16 +129,17 @@ BOOL LLFloaterAvatarPicker::postBuild()
|
|||||||
search_panel->setDefaultBtn("Find");
|
search_panel->setDefaultBtn("Find");
|
||||||
}
|
}
|
||||||
|
|
||||||
getChild<LLScrollListCtrl>("SearchResults")->addCommentText(getString("no_results"));
|
getChild<LLScrollListCtrl>("SearchResults")->setCommentText(getString("no_results"));
|
||||||
|
|
||||||
LLInventoryPanel* inventory_panel = getChild<LLInventoryPanel>("InventoryPanel");
|
LLInventoryPanel* inventory_panel = getChild<LLInventoryPanel>("InventoryPanel");
|
||||||
inventory_panel->setFilterTypes(0x1 << LLInventoryType::IT_CALLINGCARD);
|
inventory_panel->setFilterTypes(0x1 << LLInventoryType::IT_CALLINGCARD);
|
||||||
inventory_panel->setFollowsAll();
|
inventory_panel->setFollowsAll();
|
||||||
inventory_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
|
inventory_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
|
||||||
inventory_panel->openDefaultFolderForType(LLAssetType::AT_CALLINGCARD);
|
inventory_panel->openDefaultFolderForType(LLAssetType::AT_CALLINGCARD);
|
||||||
inventory_panel->setSelectCallback(boost::bind(&LLFloaterAvatarPicker::onCallingCardSelectionChange, _1, _2, (void*)this));
|
inventory_panel->setSelectCallback(boost::bind(&LLFloaterAvatarPicker::onCallingCardSelectionChange, this, _1, _2));
|
||||||
|
|
||||||
getChild<LLTabContainer>("ResidentChooserTabs")->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onTabChanged,this));
|
getChild<LLTabContainer>("ResidentChooserTabs")->setCommitCallback(
|
||||||
|
boost::bind(&LLFloaterAvatarPicker::onTabChanged,this));
|
||||||
|
|
||||||
setAllowMultiple(FALSE);
|
setAllowMultiple(FALSE);
|
||||||
|
|
||||||
@@ -169,7 +164,7 @@ void LLFloaterAvatarPicker::onBtnFind()
|
|||||||
find();
|
find();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void getSelectedAvatarData(const LLScrollListCtrl* from, std::vector<std::string>& avatar_names, std::vector<LLUUID>& avatar_ids)
|
static void getSelectedAvatarData(const LLScrollListCtrl* from, uuid_vec_t& avatar_ids, std::vector<LLAvatarName>& avatar_names)
|
||||||
{
|
{
|
||||||
std::vector<LLScrollListItem*> items = from->getAllSelected();
|
std::vector<LLScrollListItem*> items = from->getAllSelected();
|
||||||
for (std::vector<LLScrollListItem*>::iterator iter = items.begin(); iter != items.end(); ++iter)
|
for (std::vector<LLScrollListItem*>::iterator iter = items.begin(); iter != items.end(); ++iter)
|
||||||
@@ -177,105 +172,141 @@ static void getSelectedAvatarData(const LLScrollListCtrl* from, std::vector<std:
|
|||||||
LLScrollListItem* item = *iter;
|
LLScrollListItem* item = *iter;
|
||||||
if (item->getUUID().notNull())
|
if (item->getUUID().notNull())
|
||||||
{
|
{
|
||||||
avatar_names.push_back(item->getColumn(0)->getValue().asString());
|
|
||||||
avatar_ids.push_back(item->getUUID());
|
avatar_ids.push_back(item->getUUID());
|
||||||
|
|
||||||
|
std::map<LLUUID, LLAvatarName>::iterator iter = sAvatarNameMap.find(item->getUUID());
|
||||||
|
if (iter != sAvatarNameMap.end())
|
||||||
|
{
|
||||||
|
avatar_names.push_back(iter->second);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// the only case where it isn't in the name map is friends
|
||||||
|
// but it should be in the name cache
|
||||||
|
LLAvatarName av_name;
|
||||||
|
LLAvatarNameCache::get(item->getUUID(), &av_name);
|
||||||
|
avatar_names.push_back(av_name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLFloaterAvatarPicker::onBtnSelect(void* userdata)
|
void LLFloaterAvatarPicker::onBtnSelect()
|
||||||
{
|
{
|
||||||
LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata;
|
|
||||||
|
|
||||||
if(self->mCallback)
|
// If select btn not enabled then do not callback
|
||||||
|
if (!visibleItemsSelected())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(mSelectionCallback)
|
||||||
{
|
{
|
||||||
LLPanel* active_panel = self->childGetVisibleTab("ResidentChooserTabs");
|
std::vector<LLAvatarName> avatar_names;
|
||||||
|
std::vector<LLUUID> avatar_ids;
|
||||||
if(active_panel == self->getChild<LLPanel>("CallingCardsPanel"))
|
std::string active_panel_name;
|
||||||
|
LLScrollListCtrl* list = NULL;
|
||||||
|
LLPanel* active_panel = childGetVisibleTab("ResidentChooserTabs");
|
||||||
|
if(active_panel)
|
||||||
{
|
{
|
||||||
self->mCallback(self->mSelectedInventoryAvatarNames, self->mSelectedInventoryAvatarIDs, self->mCallbackUserdata);
|
active_panel_name = active_panel->getName();
|
||||||
}
|
}
|
||||||
else if(active_panel == self->getChild<LLPanel>("SearchPanel"))
|
if(active_panel_name == "CallingCardsPanel")
|
||||||
{
|
{
|
||||||
std::vector<std::string> avatar_names;
|
avatar_ids = mSelectedInventoryAvatarIDs;
|
||||||
std::vector<LLUUID> avatar_ids;
|
for(std::vector<std::string>::size_type i = 0; i < avatar_ids.size(); ++i)
|
||||||
getSelectedAvatarData(self->getChild<LLScrollListCtrl>("SearchResults"), avatar_names, avatar_ids);
|
{
|
||||||
self->mCallback(avatar_names, avatar_ids, self->mCallbackUserdata);
|
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 == self->getChild<LLPanel>("NearMePanel"))
|
else if(active_panel_name == "SearchPanel")
|
||||||
{
|
{
|
||||||
std::vector<std::string> avatar_names;
|
list = getChild<LLScrollListCtrl>("SearchResults");
|
||||||
std::vector<LLUUID> avatar_ids;
|
|
||||||
getSelectedAvatarData(self->getChild<LLScrollListCtrl>("NearMe"), avatar_names, avatar_ids);
|
|
||||||
self->mCallback(avatar_names, avatar_ids, self->mCallbackUserdata);
|
|
||||||
}
|
}
|
||||||
else if(active_panel == self->getChild<LLPanel>("KeyPanel"))
|
else if(active_panel_name == "NearMePanel")
|
||||||
{
|
{
|
||||||
LLUUID specified = self->getChild<LLLineEditor>("EditUUID")->getValue().asUUID();
|
list = getChild<LLScrollListCtrl>("NearMe");
|
||||||
|
}
|
||||||
|
else if(active_panel_name == "KeyPanel")
|
||||||
|
{
|
||||||
|
LLUUID specified = getChild<LLLineEditor>("EditUUID")->getValue().asUUID();
|
||||||
if(specified.isNull())
|
if(specified.isNull())
|
||||||
return;
|
return;
|
||||||
std::vector<std::string> avatar_names;
|
|
||||||
std::vector<LLUUID> avatar_ids;
|
|
||||||
avatar_ids.push_back(specified);
|
avatar_ids.push_back(specified);
|
||||||
avatar_names.push_back(specified.asString());
|
|
||||||
self->mCallback(avatar_names, avatar_ids, self->mCallbackUserdata);
|
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)
|
||||||
|
{
|
||||||
|
getSelectedAvatarData(list, avatar_ids, avatar_names);
|
||||||
|
}
|
||||||
|
if(!avatar_names.empty() && !avatar_ids.empty())
|
||||||
|
{
|
||||||
|
mSelectionCallback(avatar_ids, avatar_names);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self->getChild<LLInventoryPanel>("InventoryPanel")->setSelection(LLUUID::null, FALSE);
|
getChild<LLInventoryPanel>("InventoryPanel")->setSelection(LLUUID::null, FALSE);
|
||||||
self->getChild<LLScrollListCtrl>("SearchResults")->deselectAllItems(TRUE);
|
getChild<LLScrollListCtrl>("SearchResults")->deselectAllItems(TRUE);
|
||||||
self->getChild<LLScrollListCtrl>("NearMe")->deselectAllItems(TRUE);
|
getChild<LLScrollListCtrl>("NearMe")->deselectAllItems(TRUE);
|
||||||
if(self->mCloseOnSelect)
|
if(mCloseOnSelect)
|
||||||
{
|
{
|
||||||
self->mCloseOnSelect = FALSE;
|
mCloseOnSelect = FALSE;
|
||||||
self->close();
|
close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLFloaterAvatarPicker::onBtnRefresh(void* userdata)
|
void LLFloaterAvatarPicker::onBtnRefresh()
|
||||||
{
|
{
|
||||||
LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata;
|
getChild<LLScrollListCtrl>("NearMe")->deleteAllItems();
|
||||||
if (!self)
|
getChild<LLScrollListCtrl>("NearMe")->setCommentText(getString("searching"));
|
||||||
{
|
mNearMeListComplete = FALSE;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
self->getChild<LLScrollListCtrl>("NearMe")->deleteAllItems();
|
|
||||||
self->getChild<LLScrollListCtrl>("NearMe")->addCommentText(self->getString("searching"));
|
|
||||||
self->mNearMeListComplete = FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLFloaterAvatarPicker::onBtnClose(void* userdata)
|
void LLFloaterAvatarPicker::onBtnClose()
|
||||||
{
|
{
|
||||||
LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata;
|
close();
|
||||||
if(self) self->close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLFloaterAvatarPicker::onRangeAdjust(LLUICtrl* source, void* data)
|
void LLFloaterAvatarPicker::onRangeAdjust()
|
||||||
{
|
{
|
||||||
LLFloaterAvatarPicker::onBtnRefresh(data);
|
onBtnRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLFloaterAvatarPicker::onList(LLUICtrl* ctrl, void* userdata)
|
void LLFloaterAvatarPicker::onList()
|
||||||
{
|
{
|
||||||
LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata;
|
getChildView("Select")->setEnabled(visibleItemsSelected());
|
||||||
if (self)
|
|
||||||
{
|
|
||||||
self->childSetEnabled("Select", self->visibleItemsSelected());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// static callback for inventory picker (select from calling cards)
|
|
||||||
void LLFloaterAvatarPicker::onCallingCardSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data)
|
|
||||||
{
|
|
||||||
LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)data;
|
|
||||||
if (self)
|
|
||||||
{
|
|
||||||
self->doCallingCardSelectionChange( items, user_action, data );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Callback for inventory picker (select from calling cards)
|
// Callback for inventory picker (select from calling cards)
|
||||||
void LLFloaterAvatarPicker::doCallingCardSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data)
|
void LLFloaterAvatarPicker::onCallingCardSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action)
|
||||||
{
|
{
|
||||||
bool panel_active = (childGetVisibleTab("ResidentChooserTabs") == getChild<LLPanel>("CallingCardsPanel"));
|
bool panel_active = (childGetVisibleTab("ResidentChooserTabs") == getChild<LLPanel>("CallingCardsPanel"));
|
||||||
|
|
||||||
@@ -315,7 +346,7 @@ void LLFloaterAvatarPicker::populateNearMe()
|
|||||||
LLScrollListCtrl* near_me_scroller = getChild<LLScrollListCtrl>("NearMe");
|
LLScrollListCtrl* near_me_scroller = getChild<LLScrollListCtrl>("NearMe");
|
||||||
near_me_scroller->deleteAllItems();
|
near_me_scroller->deleteAllItems();
|
||||||
|
|
||||||
std::vector<LLUUID> avatar_ids;
|
uuid_vec_t avatar_ids;
|
||||||
LLWorld::getInstance()->getAvatars(&avatar_ids, NULL, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange"));
|
LLWorld::getInstance()->getAvatars(&avatar_ids, NULL, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange"));
|
||||||
for(U32 i=0; i<avatar_ids.size(); i++)
|
for(U32 i=0; i<avatar_ids.size(); i++)
|
||||||
{
|
{
|
||||||
@@ -323,15 +354,22 @@ void LLFloaterAvatarPicker::populateNearMe()
|
|||||||
if(av == gAgent.getID()) continue;
|
if(av == gAgent.getID()) continue;
|
||||||
LLSD element;
|
LLSD element;
|
||||||
element["id"] = av; // value
|
element["id"] = av; // value
|
||||||
std::string fullname;
|
LLAvatarName av_name;
|
||||||
if(!gCacheName->getFullName(av, fullname))
|
|
||||||
|
if (!LLAvatarNameCache::get(av, &av_name))
|
||||||
{
|
{
|
||||||
|
element["columns"][0]["column"] = "name";
|
||||||
element["columns"][0]["value"] = LLCacheName::getDefaultName();
|
element["columns"][0]["value"] = LLCacheName::getDefaultName();
|
||||||
all_loaded = FALSE;
|
all_loaded = FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
element["columns"][0]["value"] = fullname;
|
element["columns"][0]["column"] = "name";
|
||||||
|
element["columns"][0]["value"] = av_name.mDisplayName;
|
||||||
|
element["columns"][1]["column"] = "username";
|
||||||
|
element["columns"][1]["value"] = av_name.mUsername;
|
||||||
|
|
||||||
|
sAvatarNameMap[av] = av_name;
|
||||||
}
|
}
|
||||||
near_me_scroller->addElement(element);
|
near_me_scroller->addElement(element);
|
||||||
empty = FALSE;
|
empty = FALSE;
|
||||||
@@ -339,16 +377,16 @@ void LLFloaterAvatarPicker::populateNearMe()
|
|||||||
|
|
||||||
if (empty)
|
if (empty)
|
||||||
{
|
{
|
||||||
childDisable("NearMe");
|
getChildView("NearMe")->setEnabled(FALSE);
|
||||||
childDisable("Select");
|
getChildView("Select")->setEnabled(FALSE);
|
||||||
near_me_scroller->addCommentText(getString("no_one_near"));
|
near_me_scroller->setCommentText(getString("no_one_near"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
childEnable("NearMe");
|
getChildView("NearMe")->setEnabled(TRUE);
|
||||||
childEnable("Select");
|
getChildView("Select")->setEnabled(TRUE);
|
||||||
near_me_scroller->selectFirstItem();
|
near_me_scroller->selectFirstItem();
|
||||||
onList(near_me_scroller, this);
|
onList();
|
||||||
near_me_scroller->setFocus(TRUE);
|
near_me_scroller->setFocus(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,38 +439,103 @@ BOOL LLFloaterAvatarPicker::visibleItemsSelected() const
|
|||||||
}
|
}
|
||||||
else if(active_panel == getChild<LLPanel>("CallingCardsPanel"))
|
else if(active_panel == getChild<LLPanel>("CallingCardsPanel"))
|
||||||
{
|
{
|
||||||
return mSelectedInventoryAvatarIDs.size() > 0;
|
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>("KeyPanel"))
|
||||||
|
{
|
||||||
|
LLUUID specified = getChild<LLLineEditor>("EditUUID")->getValue().asUUID();
|
||||||
|
return !specified.isNull();
|
||||||
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern AIHTTPTimeoutPolicy avatarPickerResponder_timeout;
|
||||||
|
class LLAvatarPickerResponder : public LLHTTPClient::ResponderWithCompleted
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLUUID mQueryID;
|
||||||
|
|
||||||
|
LLAvatarPickerResponder(const LLUUID& id) : mQueryID(id) { }
|
||||||
|
|
||||||
|
/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
|
||||||
|
{
|
||||||
|
//std::ostringstream ss;
|
||||||
|
//LLSDSerialize::toPrettyXML(content, ss);
|
||||||
|
//llinfos << ss.str() << llendl;
|
||||||
|
|
||||||
|
// in case of invalid characters, the avatar picker returns a 400
|
||||||
|
// just set it to process so it displays 'not found'
|
||||||
|
if ((200 <= status && status < 300) || status == 400)
|
||||||
|
{
|
||||||
|
LLFloaterAvatarPicker* floater = LLFloaterAvatarPicker::sInstance;
|
||||||
|
if (floater)
|
||||||
|
{
|
||||||
|
floater->processResponse(mQueryID, content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
llinfos << "avatar picker failed " << status
|
||||||
|
<< " reason " << reason << llendl;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const AIHTTPTimeoutPolicy &getHTTPTimeoutPolicy(void) const { return avatarPickerResponder_timeout; }
|
||||||
|
};
|
||||||
|
|
||||||
void LLFloaterAvatarPicker::find()
|
void LLFloaterAvatarPicker::find()
|
||||||
{
|
{
|
||||||
|
//clear our stored LLAvatarNames
|
||||||
|
sAvatarNameMap.clear();
|
||||||
|
|
||||||
const std::string& text = childGetValue("Edit").asString();
|
const std::string& text = childGetValue("Edit").asString();
|
||||||
|
|
||||||
mQueryID.generate();
|
mQueryID.generate();
|
||||||
|
|
||||||
LLMessageSystem* msg = gMessageSystem;
|
std::string url;
|
||||||
|
url.reserve(128); // avoid a memory allocation or two
|
||||||
|
|
||||||
msg->newMessage("AvatarPickerRequest");
|
LLViewerRegion* region = gAgent.getRegion();
|
||||||
msg->nextBlock("AgentData");
|
url = region->getCapability("AvatarPickerSearch");
|
||||||
msg->addUUID("AgentID", gAgent.getID());
|
// Prefer use of capabilities to search on both SLID and display name
|
||||||
msg->addUUID("SessionID", gAgent.getSessionID());
|
// but allow display name search to be manually turned off for test
|
||||||
msg->addUUID("QueryID", mQueryID); // not used right now
|
if (!url.empty()
|
||||||
msg->nextBlock("Data");
|
&& LLAvatarNameCache::useDisplayNames())
|
||||||
msg->addString("Name", text);
|
{
|
||||||
|
// capability urls don't end in '/', but we need one to parse
|
||||||
gAgent.sendReliableMessage();
|
// query parameters correctly
|
||||||
|
if (url.size() > 0 && url[url.size()-1] != '/')
|
||||||
|
{
|
||||||
|
url += "/";
|
||||||
|
}
|
||||||
|
url += "?page_size=100&names=";
|
||||||
|
url += LLURI::escape(text);
|
||||||
|
llinfos << "avatar picker " << url << llendl;
|
||||||
|
LLHTTPClient::get(url, new LLAvatarPickerResponder(mQueryID));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LLMessageSystem* msg = gMessageSystem;
|
||||||
|
msg->newMessage("AvatarPickerRequest");
|
||||||
|
msg->nextBlock("AgentData");
|
||||||
|
msg->addUUID("AgentID", gAgent.getID());
|
||||||
|
msg->addUUID("SessionID", gAgent.getSessionID());
|
||||||
|
msg->addUUID("QueryID", mQueryID); // not used right now
|
||||||
|
msg->nextBlock("Data");
|
||||||
|
msg->addString("Name", text);
|
||||||
|
gAgent.sendReliableMessage();
|
||||||
|
}
|
||||||
|
|
||||||
getChild<LLScrollListCtrl>("SearchResults")->deleteAllItems();
|
getChild<LLScrollListCtrl>("SearchResults")->deleteAllItems();
|
||||||
getChild<LLScrollListCtrl>("SearchResults")->addCommentText(getString("searching"));
|
getChild<LLScrollListCtrl>("SearchResults")->setCommentText(getString("searching"));
|
||||||
|
|
||||||
childSetEnabled("Select", FALSE);
|
childSetEnabled("Select", FALSE);
|
||||||
mResultsReturned = FALSE;
|
mNumResultsReturned = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLFloaterAvatarPicker::setAllowMultiple(BOOL allow_multiple)
|
void LLFloaterAvatarPicker::setAllowMultiple(BOOL allow_multiple)
|
||||||
@@ -458,21 +561,21 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void*
|
|||||||
if (agent_id != gAgent.getID()) return;
|
if (agent_id != gAgent.getID()) return;
|
||||||
|
|
||||||
// Dialog already closed
|
// Dialog already closed
|
||||||
LLFloaterAvatarPicker *self = sInstance;
|
LLFloaterAvatarPicker *floater = sInstance;
|
||||||
if (!self) return;
|
|
||||||
|
|
||||||
// these are not results from our last request
|
// floater is closed or these are not results from our last request
|
||||||
if (query_id != self->mQueryID)
|
if (NULL == floater || query_id != floater->mQueryID)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLScrollListCtrl* search_results = self->getChild<LLScrollListCtrl>("SearchResults");
|
LLScrollListCtrl* search_results = floater->getChild<LLScrollListCtrl>("SearchResults");
|
||||||
|
|
||||||
// clear "Searching" label on first results
|
// clear "Searching" label on first results
|
||||||
search_results->deleteAllItems();
|
if (floater->mNumResultsReturned++ == 0)
|
||||||
|
{
|
||||||
self->mResultsReturned = TRUE;
|
search_results->deleteAllItems();
|
||||||
|
}
|
||||||
|
|
||||||
BOOL found_one = FALSE;
|
BOOL found_one = FALSE;
|
||||||
S32 num_new_rows = msg->getNumberOfBlocks("Data");
|
S32 num_new_rows = msg->getNumberOfBlocks("Data");
|
||||||
@@ -486,16 +589,24 @@ 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]"] = self->childGetText("Edit");
|
map["[TEXT]"] = floater->childGetText("Edit");
|
||||||
avatar_name = self->getString("not_found", map);
|
avatar_name = floater->getString("not_found", map);
|
||||||
search_results->setEnabled(FALSE);
|
search_results->setEnabled(FALSE);
|
||||||
self->childDisable("Select");
|
floater->getChildView("Select")->setEnabled(FALSE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
avatar_name = first_name + " " + last_name;
|
avatar_name = LLCacheName::buildFullName(first_name, last_name);
|
||||||
search_results->setEnabled(TRUE);
|
search_results->setEnabled(TRUE);
|
||||||
found_one = TRUE;
|
found_one = TRUE;
|
||||||
|
|
||||||
|
LLAvatarName av_name;
|
||||||
|
av_name.mLegacyFirstName = first_name;
|
||||||
|
av_name.mLegacyLastName = last_name;
|
||||||
|
av_name.mDisplayName = avatar_name;
|
||||||
|
const LLUUID& agent_id = avatar_id;
|
||||||
|
sAvatarNameMap[agent_id] = av_name;
|
||||||
|
|
||||||
}
|
}
|
||||||
LLSD element;
|
LLSD element;
|
||||||
element["id"] = avatar_id; // value
|
element["id"] = avatar_id; // value
|
||||||
@@ -506,13 +617,64 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void*
|
|||||||
|
|
||||||
if (found_one)
|
if (found_one)
|
||||||
{
|
{
|
||||||
self->childEnable("Select");
|
floater->getChildView("Select")->setEnabled(TRUE);
|
||||||
search_results->selectFirstItem();
|
search_results->selectFirstItem();
|
||||||
self->onList(search_results, self);
|
floater->onList();
|
||||||
search_results->setFocus(TRUE);
|
search_results->setFocus(TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& content)
|
||||||
|
{
|
||||||
|
// Check for out-of-date query
|
||||||
|
if (query_id != mQueryID) return;
|
||||||
|
|
||||||
|
LLScrollListCtrl* search_results = getChild<LLScrollListCtrl>("SearchResults");
|
||||||
|
|
||||||
|
LLSD agents = content["agents"];
|
||||||
|
if (agents.size() == 0)
|
||||||
|
{
|
||||||
|
LLStringUtil::format_map_t map;
|
||||||
|
map["[TEXT]"] = childGetText("Edit");
|
||||||
|
LLSD item;
|
||||||
|
item["id"] = LLUUID::null;
|
||||||
|
item["columns"][0]["column"] = "name";
|
||||||
|
item["columns"][0]["value"] = getString("not_found", map);
|
||||||
|
search_results->addElement(item);
|
||||||
|
search_results->setEnabled(false);
|
||||||
|
getChildView("Select")->setEnabled(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// clear "Searching" label on first results
|
||||||
|
search_results->deleteAllItems();
|
||||||
|
|
||||||
|
LLSD item;
|
||||||
|
LLSD::array_const_iterator it = agents.beginArray();
|
||||||
|
for ( ; it != agents.endArray(); ++it)
|
||||||
|
{
|
||||||
|
const LLSD& row = *it;
|
||||||
|
item["id"] = row["id"];
|
||||||
|
LLSD& columns = item["columns"];
|
||||||
|
columns[0]["column"] = "name";
|
||||||
|
columns[0]["value"] = row["display_name"];
|
||||||
|
columns[1]["column"] = "username";
|
||||||
|
columns[1]["value"] = row["username"];
|
||||||
|
search_results->addElement(item);
|
||||||
|
|
||||||
|
// add the avatar name to our list
|
||||||
|
LLAvatarName avatar_name;
|
||||||
|
avatar_name.fromLLSD(row);
|
||||||
|
sAvatarNameMap[row["id"].asUUID()] = avatar_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
getChildView("Select")->setEnabled(true);
|
||||||
|
search_results->setEnabled(true);
|
||||||
|
search_results->selectFirstItem();
|
||||||
|
onList();
|
||||||
|
search_results->setFocus(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
//static
|
//static
|
||||||
void LLFloaterAvatarPicker::editKeystroke(LLLineEditor* caller, void* user_data)
|
void LLFloaterAvatarPicker::editKeystroke(LLLineEditor* caller, void* user_data)
|
||||||
{
|
{
|
||||||
@@ -532,13 +694,13 @@ BOOL LLFloaterAvatarPicker::handleKeyHere(KEY key, MASK mask)
|
|||||||
{
|
{
|
||||||
if (key == KEY_RETURN && mask == MASK_NONE)
|
if (key == KEY_RETURN && mask == MASK_NONE)
|
||||||
{
|
{
|
||||||
if (childHasFocus("Edit"))
|
if (getChild<LLUICtrl>("Edit")->hasFocus())
|
||||||
{
|
{
|
||||||
onBtnFind(this);
|
onBtnFind();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
onBtnSelect(this);
|
onBtnSelect();
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,35 +37,40 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
class LLAvatarName;
|
||||||
|
class LLScrollListCtrl;
|
||||||
|
|
||||||
class LLFloaterAvatarPicker : public LLFloater
|
class LLFloaterAvatarPicker : public LLFloater
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Call this to select an avatar.
|
typedef boost::signals2::signal<bool(const uuid_vec_t&), boost_boolean_combiner> validate_signal_t;
|
||||||
|
typedef validate_signal_t::slot_type validate_callback_t;
|
||||||
|
|
||||||
// The callback function will be called with an avatar name and UUID.
|
// The callback function will be called with an avatar name and UUID.
|
||||||
typedef void(*callback_t)(const std::vector<std::string>&, const std::vector<LLUUID>&, void*);
|
typedef boost::function<void (const uuid_vec_t&, const std::vector<LLAvatarName>&)> select_callback_t;
|
||||||
static LLFloaterAvatarPicker* show(callback_t callback,
|
// Call this to select an avatar.
|
||||||
void* userdata,
|
static LLFloaterAvatarPicker* show(select_callback_t callback,
|
||||||
BOOL allow_multiple = FALSE,
|
BOOL allow_multiple = FALSE,
|
||||||
BOOL closeOnSelect = FALSE);
|
BOOL closeOnSelect = FALSE);
|
||||||
virtual BOOL postBuild();
|
virtual BOOL postBuild();
|
||||||
|
|
||||||
static void processAvatarPickerReply(class LLMessageSystem* msg, void**);
|
static void processAvatarPickerReply(class LLMessageSystem* msg, void**);
|
||||||
|
void processResponse(const LLUUID& query_id, const LLSD& content);
|
||||||
|
|
||||||
|
static LLFloaterAvatarPicker* sInstance;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
static void editKeystroke(class LLLineEditor* caller, void* user_data);
|
static void editKeystroke(class LLLineEditor* caller, void* user_data);
|
||||||
|
|
||||||
void onBtnFind();
|
void onBtnFind();
|
||||||
static void onBtnSelect(void* userdata);
|
void onBtnSelect();
|
||||||
static void onBtnRefresh(void* userdata);
|
void onBtnRefresh();
|
||||||
static void onRangeAdjust(LLUICtrl* source, void* data);
|
void onRangeAdjust();
|
||||||
static void onBtnClose(void* userdata);
|
void onBtnClose();
|
||||||
static void onList(class LLUICtrl* ctrl, void* userdata);
|
void onList();
|
||||||
void onTabChanged();
|
void onTabChanged();
|
||||||
|
|
||||||
void doCallingCardSelectionChange(const std::deque<class LLFolderViewItem*> &items, BOOL user_action, void* data);
|
void onCallingCardSelectionChange(const std::deque<class LLFolderViewItem*> &items, BOOL user_action);
|
||||||
static void onCallingCardSelectionChange(const std::deque<class LLFolderViewItem*> &items, BOOL user_action, void* data);
|
|
||||||
|
|
||||||
void populateNearMe();
|
void populateNearMe();
|
||||||
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.
|
||||||
@@ -79,14 +84,11 @@ private:
|
|||||||
std::vector<LLUUID> mSelectedInventoryAvatarIDs;
|
std::vector<LLUUID> mSelectedInventoryAvatarIDs;
|
||||||
std::vector<std::string> mSelectedInventoryAvatarNames;
|
std::vector<std::string> mSelectedInventoryAvatarNames;
|
||||||
LLUUID mQueryID;
|
LLUUID mQueryID;
|
||||||
BOOL mResultsReturned;
|
int mNumResultsReturned;
|
||||||
BOOL mNearMeListComplete;
|
BOOL mNearMeListComplete;
|
||||||
BOOL mCloseOnSelect;
|
BOOL mCloseOnSelect;
|
||||||
|
|
||||||
void (*mCallback)(const std::vector<std::string>& name, const std::vector<LLUUID>& id, void* userdata);
|
select_callback_t mSelectionCallback;
|
||||||
void* mCallbackUserdata;
|
|
||||||
|
|
||||||
static LLFloaterAvatarPicker* sInstance;
|
|
||||||
|
|
||||||
// do not call these directly
|
// do not call these directly
|
||||||
LLFloaterAvatarPicker();
|
LLFloaterAvatarPicker();
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
|
|
||||||
#include "llagent.h"
|
#include "llagent.h"
|
||||||
#include "llalertdialog.h"
|
#include "llalertdialog.h"
|
||||||
|
#include "llavatarnamecache.h"
|
||||||
#include "llbutton.h"
|
#include "llbutton.h"
|
||||||
#include "llcheckboxctrl.h"
|
#include "llcheckboxctrl.h"
|
||||||
#include "llcombobox.h"
|
#include "llcombobox.h"
|
||||||
@@ -1264,7 +1265,7 @@ void LLPanelObjectTools::onClickSet(void* data)
|
|||||||
{
|
{
|
||||||
LLPanelObjectTools* panelp = (LLPanelObjectTools*) data;
|
LLPanelObjectTools* panelp = (LLPanelObjectTools*) data;
|
||||||
// grandparent is a floater, which can have a dependent
|
// grandparent is a floater, which can have a dependent
|
||||||
gFloaterView->getParentFloater(panelp)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarID, data));
|
gFloaterView->getParentFloater(panelp)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelObjectTools::callbackAvatarID, panelp, _1, _2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLPanelObjectTools::onClickSetBySelection(void* data)
|
void LLPanelObjectTools::onClickSetBySelection(void* data)
|
||||||
@@ -1288,14 +1289,12 @@ void LLPanelObjectTools::onClickSetBySelection(void* data)
|
|||||||
panelp->childSetValue("target_avatar_name", name);
|
panelp->childSetValue("target_avatar_name", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
void LLPanelObjectTools::callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName>& names)
|
||||||
void LLPanelObjectTools::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data)
|
|
||||||
{
|
{
|
||||||
LLPanelObjectTools* object_tools = (LLPanelObjectTools*) data;
|
|
||||||
if (ids.empty() || names.empty()) return;
|
if (ids.empty() || names.empty()) return;
|
||||||
object_tools->mTargetAvatar = ids[0];
|
mTargetAvatar = ids[0];
|
||||||
object_tools->childSetValue("target_avatar_name", names[0]);
|
childSetValue("target_avatar_name", names[0].getCompleteName());
|
||||||
object_tools->refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
#include "llpanel.h"
|
#include "llpanel.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
class LLAvatarName;
|
||||||
class LLButton;
|
class LLButton;
|
||||||
class LLCheckBoxCtrl;
|
class LLCheckBoxCtrl;
|
||||||
class LLComboBox;
|
class LLComboBox;
|
||||||
@@ -237,7 +238,7 @@ public:
|
|||||||
static void onChangeAnything(LLUICtrl* ctrl, void* data);
|
static void onChangeAnything(LLUICtrl* ctrl, void* data);
|
||||||
static void onApplyChanges(void* data);
|
static void onApplyChanges(void* data);
|
||||||
static void onClickSet(void* data);
|
static void onClickSet(void* data);
|
||||||
static void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data);
|
void callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName>& names);
|
||||||
static void onClickDeletePublicOwnedBy(void* data);
|
static void onClickDeletePublicOwnedBy(void* data);
|
||||||
static void onClickDeleteAllScriptedOwnedBy(void* data);
|
static void onClickDeleteAllScriptedOwnedBy(void* data);
|
||||||
static void onClickDeleteAllOwnedBy(void* data);
|
static void onClickDeleteAllOwnedBy(void* data);
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
|
|
||||||
#include "llfloaterland.h"
|
#include "llfloaterland.h"
|
||||||
|
|
||||||
|
#include "llavatarnamecache.h"
|
||||||
#include "llcachename.h"
|
#include "llcachename.h"
|
||||||
#include "llfocusmgr.h"
|
#include "llfocusmgr.h"
|
||||||
#include "llnotificationsutil.h"
|
#include "llnotificationsutil.h"
|
||||||
@@ -653,20 +654,26 @@ void LLPanelLandGeneral::refresh()
|
|||||||
S32 area;
|
S32 area;
|
||||||
S32 claim_price;
|
S32 claim_price;
|
||||||
S32 rent_price;
|
S32 rent_price;
|
||||||
F32 dwell;
|
F32 dwell = DWELL_NAN;
|
||||||
LLViewerParcelMgr::getInstance()->getDisplayInfo(&area,
|
LLViewerParcelMgr::getInstance()->getDisplayInfo(&area,
|
||||||
&claim_price,
|
&claim_price,
|
||||||
&rent_price,
|
&rent_price,
|
||||||
&for_sale,
|
&for_sale,
|
||||||
&dwell);
|
&dwell);
|
||||||
|
|
||||||
// Area
|
// Area
|
||||||
LLUIString price = getString("area_size_text");
|
LLUIString price = getString("area_size_text");
|
||||||
price.setArg("[AREA]", llformat("%d",area));
|
price.setArg("[AREA]", llformat("%d",area));
|
||||||
mTextPriceLabel->setText(getString("area_text"));
|
mTextPriceLabel->setText(getString("area_text"));
|
||||||
mTextPrice->setText(price.getString());
|
mTextPrice->setText(price.getString());
|
||||||
|
|
||||||
mTextDwell->setText(llformat("%.0f", dwell));
|
if (dwell == DWELL_NAN)
|
||||||
|
{
|
||||||
|
mTextDwell->setText(LLTrans::getString("LoadingData"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mTextDwell->setText(llformat("%.0f", dwell));
|
||||||
|
}
|
||||||
|
|
||||||
if (for_sale)
|
if (for_sale)
|
||||||
{
|
{
|
||||||
@@ -2814,23 +2821,21 @@ void LLPanelLandAccess::onClickAddAccess(void* data)
|
|||||||
LLPanelLandAccess* panelp = (LLPanelLandAccess*)data;
|
LLPanelLandAccess* panelp = (LLPanelLandAccess*)data;
|
||||||
if (panelp)
|
if (panelp)
|
||||||
{
|
{
|
||||||
gFloaterView->getParentFloater(panelp)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarCBAccess, data) );
|
gFloaterView->getParentFloater(panelp)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBAccess, panelp, _1)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
void LLPanelLandAccess::callbackAvatarCBAccess(const uuid_vec_t& ids)
|
||||||
void LLPanelLandAccess::callbackAvatarCBAccess(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata)
|
|
||||||
{
|
{
|
||||||
LLPanelLandAccess* panelp = (LLPanelLandAccess*)userdata;
|
if (!ids.empty())
|
||||||
if (!names.empty() && !ids.empty())
|
|
||||||
{
|
{
|
||||||
LLUUID id = ids[0];
|
LLUUID id = ids[0];
|
||||||
LLParcel* parcel = panelp->mParcel->getParcel();
|
LLParcel* parcel = mParcel->getParcel();
|
||||||
if (parcel)
|
if (parcel)
|
||||||
{
|
{
|
||||||
parcel->addToAccessList(id, 0);
|
parcel->addToAccessList(id, 0);
|
||||||
LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_ACCESS);
|
LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_ACCESS);
|
||||||
panelp->refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2862,22 +2867,20 @@ void LLPanelLandAccess::onClickRemoveAccess(void* data)
|
|||||||
void LLPanelLandAccess::onClickAddBanned(void* data)
|
void LLPanelLandAccess::onClickAddBanned(void* data)
|
||||||
{
|
{
|
||||||
LLPanelLandAccess* panelp = (LLPanelLandAccess*)data;
|
LLPanelLandAccess* panelp = (LLPanelLandAccess*)data;
|
||||||
gFloaterView->getParentFloater(panelp)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarCBBanned, data) );
|
gFloaterView->getParentFloater(panelp)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBBanned, panelp, _1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
void LLPanelLandAccess::callbackAvatarCBBanned(const uuid_vec_t& ids)
|
||||||
void LLPanelLandAccess::callbackAvatarCBBanned(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata)
|
|
||||||
{
|
{
|
||||||
LLPanelLandAccess* panelp = (LLPanelLandAccess*)userdata;
|
if (!ids.empty())
|
||||||
if (!names.empty() && !ids.empty())
|
|
||||||
{
|
{
|
||||||
LLUUID id = ids[0];
|
LLUUID id = ids[0];
|
||||||
LLParcel* parcel = panelp->mParcel->getParcel();
|
LLParcel* parcel = mParcel->getParcel();
|
||||||
if (parcel)
|
if (parcel)
|
||||||
{
|
{
|
||||||
parcel->addToBanList(id, 0);
|
parcel->addToBanList(id, 0);
|
||||||
LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_BAN);
|
LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_BAN);
|
||||||
panelp->refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -383,10 +383,10 @@ public:
|
|||||||
static void onCommitPublicAccess(LLUICtrl* ctrl, void *userdata);
|
static void onCommitPublicAccess(LLUICtrl* ctrl, void *userdata);
|
||||||
static void onCommitAny(LLUICtrl* ctrl, void *userdata);
|
static void onCommitAny(LLUICtrl* ctrl, void *userdata);
|
||||||
static void onClickAddAccess(void*);
|
static void onClickAddAccess(void*);
|
||||||
static void callbackAvatarCBAccess(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata);
|
void callbackAvatarCBAccess(const uuid_vec_t& ids);
|
||||||
static void onClickRemoveAccess(void*);
|
static void onClickRemoveAccess(void*);
|
||||||
static void onClickAddBanned(void*);
|
static void onClickAddBanned(void*);
|
||||||
static void callbackAvatarCBBanned(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata);
|
void callbackAvatarCBBanned(const uuid_vec_t& ids);
|
||||||
static void onClickRemoveBanned(void*);
|
static void onClickRemoveBanned(void*);
|
||||||
|
|
||||||
virtual BOOL postBuild();
|
virtual BOOL postBuild();
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
|
|
||||||
// project include
|
// project include
|
||||||
#include "llagent.h"
|
#include "llagent.h"
|
||||||
|
#include "llavatarnamecache.h"
|
||||||
#include "llfloateravatarpicker.h"
|
#include "llfloateravatarpicker.h"
|
||||||
#include "llbutton.h"
|
#include "llbutton.h"
|
||||||
#include "lllineeditor.h"
|
#include "lllineeditor.h"
|
||||||
@@ -314,22 +315,20 @@ void LLFloaterMute::onClickPick(void *data)
|
|||||||
LLFloaterMute* floaterp = (LLFloaterMute*)data;
|
LLFloaterMute* floaterp = (LLFloaterMute*)data;
|
||||||
const BOOL allow_multiple = FALSE;
|
const BOOL allow_multiple = FALSE;
|
||||||
const BOOL close_on_select = TRUE;
|
const BOOL close_on_select = TRUE;
|
||||||
LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(onPickUser, data, allow_multiple, close_on_select);
|
LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterMute::onPickUser, floaterp, _1, _2), allow_multiple, close_on_select);
|
||||||
floaterp->addDependentFloater(picker);
|
floaterp->addDependentFloater(picker);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// onPickUser()
|
// onPickUser()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void LLFloaterMute::onPickUser(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* user_data)
|
void LLFloaterMute::onPickUser(const uuid_vec_t& ids, const std::vector<LLAvatarName>& names)
|
||||||
{
|
{
|
||||||
LLFloaterMute* floaterp = (LLFloaterMute*)user_data;
|
|
||||||
if (!floaterp) return;
|
|
||||||
if (names.empty() || ids.empty()) return;
|
if (names.empty() || ids.empty()) return;
|
||||||
|
|
||||||
LLMute mute(ids[0], names[0], LLMute::AGENT);
|
LLMute mute(ids[0], names[0].getLegacyName(), LLMute::AGENT);
|
||||||
LLMuteList::getInstance()->add(mute);
|
LLMuteList::getInstance()->add(mute);
|
||||||
floaterp->updateButtons();
|
updateButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
#include "llmutelist.h"
|
#include "llmutelist.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
class LLAvatarName;
|
||||||
class LLButton;
|
class LLButton;
|
||||||
class LLLineEditor;
|
class LLLineEditor;
|
||||||
class LLMessageSystem;
|
class LLMessageSystem;
|
||||||
@@ -68,7 +69,7 @@ private:
|
|||||||
static void onClickRemove(void *data);
|
static void onClickRemove(void *data);
|
||||||
static void onClickPick(void *data);
|
static void onClickPick(void *data);
|
||||||
static void onSelectName(LLUICtrl* caller, void *data);
|
static void onSelectName(LLUICtrl* caller, void *data);
|
||||||
static void onPickUser(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* user_data);
|
void onPickUser(const uuid_vec_t& ids, const std::vector<LLAvatarName>& names);
|
||||||
static void onClickMuteByName(void*);
|
static void onClickMuteByName(void*);
|
||||||
static void callbackMuteByName(const std::string& text, void*);
|
static void callbackMuteByName(const std::string& text, void*);
|
||||||
|
|
||||||
|
|||||||
@@ -258,7 +258,8 @@ void LLFloaterRegionInfo::requestRegionInfo()
|
|||||||
void LLFloaterRegionInfo::processEstateOwnerRequest(LLMessageSystem* msg,void**)
|
void LLFloaterRegionInfo::processEstateOwnerRequest(LLMessageSystem* msg,void**)
|
||||||
{
|
{
|
||||||
static LLDispatcher dispatch;
|
static LLDispatcher dispatch;
|
||||||
if(!findInstance())
|
LLFloaterRegionInfo* floater = findInstance();
|
||||||
|
if(!floater)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -268,7 +269,7 @@ void LLFloaterRegionInfo::processEstateOwnerRequest(LLMessageSystem* msg,void**)
|
|||||||
LLPanelEstateInfo::initDispatch(dispatch);
|
LLPanelEstateInfo::initDispatch(dispatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
LLTabContainer* tab = findInstance()->getChild<LLTabContainer>("region_panels");
|
LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels");
|
||||||
LLPanelEstateInfo* panel = (LLPanelEstateInfo*)tab->getChild<LLPanel>("Estate");
|
LLPanelEstateInfo* panel = (LLPanelEstateInfo*)tab->getChild<LLPanel>("Estate");
|
||||||
|
|
||||||
// unpack the message
|
// unpack the message
|
||||||
@@ -285,8 +286,7 @@ void LLFloaterRegionInfo::processEstateOwnerRequest(LLMessageSystem* msg,void**)
|
|||||||
//dispatch the message
|
//dispatch the message
|
||||||
dispatch.dispatch(request, invoice, strings);
|
dispatch.dispatch(request, invoice, strings);
|
||||||
|
|
||||||
LLViewerRegion* region = gAgent.getRegion();
|
panel->updateControls(gAgent.getRegion());
|
||||||
panel->updateControls(region);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -296,12 +296,18 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
|
|||||||
LLPanel* panel;
|
LLPanel* panel;
|
||||||
|
|
||||||
llinfos << "LLFloaterRegionInfo::processRegionInfo" << llendl;
|
llinfos << "LLFloaterRegionInfo::processRegionInfo" << llendl;
|
||||||
if(!findInstance())
|
LLFloaterRegionInfo* floater = findInstance();
|
||||||
|
if(!floater)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// We need to re-request environment setting here,
|
||||||
|
// otherwise after we apply (send) updated region settings we won't get them back,
|
||||||
|
// so our environment won't be updated.
|
||||||
|
// This is also the way to know about externally changed region environment.
|
||||||
|
LLEnvManagerNew::instance().requestRegionSettings();
|
||||||
|
|
||||||
LLTabContainer* tab = findInstance()->getChild<LLTabContainer>("region_panels");
|
LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels");
|
||||||
|
|
||||||
LLViewerRegion* region = gAgent.getRegion();
|
LLViewerRegion* region = gAgent.getRegion();
|
||||||
BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate());
|
BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate());
|
||||||
@@ -389,7 +395,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
|
|||||||
panel->childSetEnabled("sun_hour_slider", allow_modify && !use_estate_sun);
|
panel->childSetEnabled("sun_hour_slider", allow_modify && !use_estate_sun);
|
||||||
panel->setCtrlsEnabled(allow_modify);
|
panel->setCtrlsEnabled(allow_modify);
|
||||||
|
|
||||||
getInstance()->refreshFromRegion( gAgent.getRegion() );
|
floater->refreshFromRegion( gAgent.getRegion() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
@@ -414,6 +420,11 @@ LLPanelEstateCovenant* LLFloaterRegionInfo::getPanelCovenant()
|
|||||||
|
|
||||||
void LLFloaterRegionInfo::refreshFromRegion(LLViewerRegion* region)
|
void LLFloaterRegionInfo::refreshFromRegion(LLViewerRegion* region)
|
||||||
{
|
{
|
||||||
|
if (!region)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// call refresh from region on all panels
|
// call refresh from region on all panels
|
||||||
std::for_each(
|
std::for_each(
|
||||||
mInfoPanels.begin(),
|
mInfoPanels.begin(),
|
||||||
@@ -632,18 +643,18 @@ void LLPanelRegionGeneralInfo::onClickKick(void* userdata)
|
|||||||
// this depends on the grandparent view being a floater
|
// this depends on the grandparent view being a floater
|
||||||
// in order to set up floater dependency
|
// in order to set up floater dependency
|
||||||
LLFloater* parent_floater = gFloaterView->getParentFloater(panelp);
|
LLFloater* parent_floater = gFloaterView->getParentFloater(panelp);
|
||||||
LLFloater* child_floater = LLFloaterAvatarPicker::show(onKickCommit, userdata, FALSE, TRUE);
|
LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelRegionGeneralInfo::onKickCommit, panelp, _1), FALSE, TRUE);
|
||||||
parent_floater->addDependentFloater(child_floater);
|
if (child_floater)
|
||||||
|
{
|
||||||
|
parent_floater->addDependentFloater(child_floater);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
void LLPanelRegionGeneralInfo::onKickCommit(const uuid_vec_t& ids)
|
||||||
void LLPanelRegionGeneralInfo::onKickCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata)
|
|
||||||
{
|
{
|
||||||
if (names.empty() || ids.empty()) return;
|
if (ids.empty()) return;
|
||||||
if(ids[0].notNull())
|
if(ids[0].notNull())
|
||||||
{
|
{
|
||||||
LLPanelRegionGeneralInfo* self = (LLPanelRegionGeneralInfo*)userdata;
|
|
||||||
if(!self) return;
|
|
||||||
strings_t strings;
|
strings_t strings;
|
||||||
// [0] = our agent id
|
// [0] = our agent id
|
||||||
// [1] = target agent id
|
// [1] = target agent id
|
||||||
@@ -655,7 +666,7 @@ void LLPanelRegionGeneralInfo::onKickCommit(const std::vector<std::string>& name
|
|||||||
strings.push_back(strings_t::value_type(buffer));
|
strings.push_back(strings_t::value_type(buffer));
|
||||||
|
|
||||||
LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
|
LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
|
||||||
self->sendEstateOwnerMessage(gMessageSystem, "teleporthomeuser", invoice, strings);
|
sendEstateOwnerMessage(gMessageSystem, "teleporthomeuser", invoice, strings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -886,17 +897,15 @@ BOOL LLPanelRegionDebugInfo::sendUpdate()
|
|||||||
|
|
||||||
void LLPanelRegionDebugInfo::onClickChooseAvatar(void* data)
|
void LLPanelRegionDebugInfo::onClickChooseAvatar(void* data)
|
||||||
{
|
{
|
||||||
LLFloaterAvatarPicker::show(callbackAvatarID, data, FALSE, TRUE);
|
LLFloaterAvatarPicker::show(boost::bind(&LLPanelRegionDebugInfo::callbackAvatarID, (LLPanelRegionDebugInfo*)data, _1, _2), FALSE, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
void LLPanelRegionDebugInfo::callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName>& names)
|
||||||
void LLPanelRegionDebugInfo::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data)
|
|
||||||
{
|
{
|
||||||
LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*) data;
|
|
||||||
if (ids.empty() || names.empty()) return;
|
if (ids.empty() || names.empty()) return;
|
||||||
self->mTargetAvatar = ids[0];
|
mTargetAvatar = ids[0];
|
||||||
self->childSetValue("target_avatar_name", LLSD(names[0]));
|
childSetValue("target_avatar_name", LLSD(names[0].getCompleteName()));
|
||||||
self->refreshFromRegion( gAgent.getRegion() );
|
refreshFromRegion( gAgent.getRegion() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
@@ -1615,35 +1624,35 @@ void LLPanelEstateInfo::onClickKickUser(void *user_data)
|
|||||||
// this depends on the grandparent view being a floater
|
// this depends on the grandparent view being a floater
|
||||||
// in order to set up floater dependency
|
// in order to set up floater dependency
|
||||||
LLFloater* parent_floater = gFloaterView->getParentFloater(panelp);
|
LLFloater* parent_floater = gFloaterView->getParentFloater(panelp);
|
||||||
LLFloater* child_floater = LLFloaterAvatarPicker::show(LLPanelEstateInfo::onKickUserCommit, user_data, FALSE, TRUE);
|
LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::onKickUserCommit, panelp, _1, _2), FALSE, TRUE);
|
||||||
|
if (child_floater)
|
||||||
|
{
|
||||||
|
parent_floater->addDependentFloater(child_floater);
|
||||||
|
}
|
||||||
parent_floater->addDependentFloater(child_floater);
|
parent_floater->addDependentFloater(child_floater);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLPanelEstateInfo::onKickUserCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata)
|
void LLPanelEstateInfo::onKickUserCommit(const uuid_vec_t& ids, const std::vector<LLAvatarName>& names)
|
||||||
{
|
{
|
||||||
if (names.empty() || ids.empty()) return;
|
if (names.empty() || ids.empty()) return;
|
||||||
|
|
||||||
//check to make sure there is one valid user and id
|
//check to make sure there is one valid user and id
|
||||||
if( (ids[0].isNull()) ||
|
if( ids[0].isNull() )
|
||||||
(names[0].length() == 0) )
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLPanelEstateInfo* self = (LLPanelEstateInfo*)userdata;
|
|
||||||
if(!self) return;
|
|
||||||
|
|
||||||
//keep track of what user they want to kick and other misc info
|
//keep track of what user they want to kick and other misc info
|
||||||
LLKickFromEstateInfo *kick_info = new LLKickFromEstateInfo();
|
LLKickFromEstateInfo *kick_info = new LLKickFromEstateInfo();
|
||||||
kick_info->mEstatePanelp = self;
|
kick_info->mEstatePanelp = this;
|
||||||
kick_info->mAgentID = ids[0];
|
kick_info->mAgentID = ids[0];
|
||||||
|
|
||||||
//Bring up a confirmation dialog
|
//Bring up a confirmation dialog
|
||||||
LLSD args;
|
LLSD args;
|
||||||
args["EVIL_USER"] = names[0];
|
args["EVIL_USER"] = names[0].getCompleteName();
|
||||||
LLSD payload;
|
LLSD payload;
|
||||||
payload["agent_id"] = ids[0];
|
payload["agent_id"] = ids[0];
|
||||||
LLNotificationsUtil::add("EstateKickUser", args, payload, boost::bind(&LLPanelEstateInfo::kickUserConfirm, self, _1, _2));
|
LLNotificationsUtil::add("EstateKickUser", args, payload, boost::bind(&LLPanelEstateInfo::kickUserConfirm, this, _1, _2));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1808,14 +1817,13 @@ bool LLPanelEstateInfo::accessAddCore2(const LLSD& notification, const LLSD& res
|
|||||||
|
|
||||||
LLEstateAccessChangeInfo* change_info = new LLEstateAccessChangeInfo(notification["payload"]);
|
LLEstateAccessChangeInfo* change_info = new LLEstateAccessChangeInfo(notification["payload"]);
|
||||||
// avatar picker yes multi-select, yes close-on-select
|
// avatar picker yes multi-select, yes close-on-select
|
||||||
LLFloaterAvatarPicker::show(accessAddCore3, (void*)change_info, TRUE, TRUE);
|
LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::accessAddCore3, _1, change_info), TRUE, TRUE);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void LLPanelEstateInfo::accessAddCore3(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data)
|
void LLPanelEstateInfo::accessAddCore3(const uuid_vec_t& ids, LLEstateAccessChangeInfo* change_info)
|
||||||
{
|
{
|
||||||
LLEstateAccessChangeInfo* change_info = (LLEstateAccessChangeInfo*)data;
|
|
||||||
if (!change_info) return;
|
if (!change_info) return;
|
||||||
if (ids.empty())
|
if (ids.empty())
|
||||||
{
|
{
|
||||||
@@ -2063,7 +2071,6 @@ void LLPanelEstateInfo::updateControls(LLViewerRegion* region)
|
|||||||
BOOL owner = (region && (region->getOwner() == gAgent.getID()));
|
BOOL owner = (region && (region->getOwner() == gAgent.getID()));
|
||||||
BOOL manager = (region && region->isEstateManager());
|
BOOL manager = (region && region->isEstateManager());
|
||||||
setCtrlsEnabled(god || owner || manager);
|
setCtrlsEnabled(god || owner || manager);
|
||||||
|
|
||||||
childDisable("apply_btn");
|
childDisable("apply_btn");
|
||||||
childSetEnabled("add_allowed_avatar_btn", god || owner || manager);
|
childSetEnabled("add_allowed_avatar_btn", god || owner || manager);
|
||||||
childSetEnabled("remove_allowed_avatar_btn", god || owner || manager);
|
childSetEnabled("remove_allowed_avatar_btn", god || owner || manager);
|
||||||
@@ -2313,13 +2320,20 @@ void LLPanelEstateInfo::getEstateOwner()
|
|||||||
class LLEstateChangeInfoResponder : public LLHTTPClient::ResponderWithResult
|
class LLEstateChangeInfoResponder : public LLHTTPClient::ResponderWithResult
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LLEstateChangeInfoResponder(void* userdata) : mpPanel((LLPanelEstateInfo*)userdata) {};
|
LLEstateChangeInfoResponder(LLPanelEstateInfo* panel)
|
||||||
|
{
|
||||||
|
mpPanel = panel->getHandle();
|
||||||
|
}
|
||||||
|
|
||||||
// if we get a normal response, handle it here
|
// if we get a normal response, handle it here
|
||||||
virtual void result(const LLSD& content)
|
virtual void result(const LLSD& content)
|
||||||
{
|
{
|
||||||
|
LL_INFOS("Windlight") << "Successfully committed estate info" << llendl;
|
||||||
|
|
||||||
// refresh the panel from the database
|
// refresh the panel from the database
|
||||||
mpPanel->refresh();
|
LLPanelEstateInfo* panel = dynamic_cast<LLPanelEstateInfo*>(mpPanel.get());
|
||||||
|
if (panel)
|
||||||
|
panel->refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we get an error response
|
// if we get an error response
|
||||||
@@ -2332,7 +2346,7 @@ public:
|
|||||||
virtual AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return estateChangeInfoResponder_timeout; }
|
virtual AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return estateChangeInfoResponder_timeout; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LLPanelEstateInfo* mpPanel;
|
LLHandle<LLPanel> mpPanel;
|
||||||
};
|
};
|
||||||
|
|
||||||
// tries to send estate info using a cap; returns true if it succeeded
|
// tries to send estate info using a cap; returns true if it succeeded
|
||||||
@@ -2370,7 +2384,7 @@ bool LLPanelEstateInfo::commitEstateInfoCaps()
|
|||||||
body["owner_abuse_email"] = childGetValue("abuse_email_address").asString();
|
body["owner_abuse_email"] = childGetValue("abuse_email_address").asString();
|
||||||
|
|
||||||
// we use a responder so that we can re-get the data after committing to the database
|
// we use a responder so that we can re-get the data after committing to the database
|
||||||
LLHTTPClient::post(url, body, new LLEstateChangeInfoResponder((void*)this));
|
LLHTTPClient::post(url, body, new LLEstateChangeInfoResponder(this));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,8 @@
|
|||||||
#include "llfloater.h"
|
#include "llfloater.h"
|
||||||
#include "llpanel.h"
|
#include "llpanel.h"
|
||||||
|
|
||||||
|
class LLAvatarName;
|
||||||
|
struct LLEstateAccessChangeInfo;
|
||||||
class LLLineEditor;
|
class LLLineEditor;
|
||||||
class LLMessageSystem;
|
class LLMessageSystem;
|
||||||
class LLPanelRegionInfo;
|
class LLPanelRegionInfo;
|
||||||
@@ -164,7 +166,7 @@ protected:
|
|||||||
virtual BOOL sendUpdate();
|
virtual BOOL sendUpdate();
|
||||||
|
|
||||||
static void onClickKick(void* userdata);
|
static void onClickKick(void* userdata);
|
||||||
static void onKickCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata);
|
void onKickCommit(const uuid_vec_t& ids);
|
||||||
static void onClickKickAll(void* userdata);
|
static void onClickKickAll(void* userdata);
|
||||||
bool onKickAllCommit(const LLSD& notification, const LLSD& response);
|
bool onKickAllCommit(const LLSD& notification, const LLSD& response);
|
||||||
static void onClickMessage(void* userdata);
|
static void onClickMessage(void* userdata);
|
||||||
@@ -189,7 +191,7 @@ protected:
|
|||||||
virtual BOOL sendUpdate();
|
virtual BOOL sendUpdate();
|
||||||
|
|
||||||
static void onClickChooseAvatar(void*);
|
static void onClickChooseAvatar(void*);
|
||||||
static void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data);
|
void callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName>& names);
|
||||||
static void onClickReturn(void *);
|
static void onClickReturn(void *);
|
||||||
bool callbackReturn(const LLSD& notification, const LLSD& response);
|
bool callbackReturn(const LLSD& notification, const LLSD& response);
|
||||||
static void onClickTopColliders(void*);
|
static void onClickTopColliders(void*);
|
||||||
@@ -282,7 +284,7 @@ public:
|
|||||||
// Core methods for all above add/remove button clicks
|
// Core methods for all above add/remove button clicks
|
||||||
static void accessAddCore(U32 operation_flag, const std::string& dialog_name);
|
static void accessAddCore(U32 operation_flag, const std::string& dialog_name);
|
||||||
static bool accessAddCore2(const LLSD& notification, const LLSD& response);
|
static bool accessAddCore2(const LLSD& notification, const LLSD& response);
|
||||||
static void accessAddCore3(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data);
|
static void accessAddCore3(const uuid_vec_t& ids, LLEstateAccessChangeInfo* change_info);
|
||||||
|
|
||||||
static void accessRemoveCore(U32 operation_flag, const std::string& dialog_name, const std::string& list_ctrl_name);
|
static void accessRemoveCore(U32 operation_flag, const std::string& dialog_name, const std::string& list_ctrl_name);
|
||||||
static bool accessRemoveCore2(const LLSD& notification, const LLSD& response);
|
static bool accessRemoveCore2(const LLSD& notification, const LLSD& response);
|
||||||
@@ -294,7 +296,7 @@ public:
|
|||||||
// Send the actual EstateOwnerRequest "estateaccessdelta" message
|
// Send the actual EstateOwnerRequest "estateaccessdelta" message
|
||||||
static void sendEstateAccessDelta(U32 flags, const LLUUID& agent_id);
|
static void sendEstateAccessDelta(U32 flags, const LLUUID& agent_id);
|
||||||
|
|
||||||
static void onKickUserCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata);
|
void onKickUserCommit(const uuid_vec_t& ids, const std::vector<LLAvatarName>& names);
|
||||||
static void onClickMessageEstate(void* data);
|
static void onClickMessageEstate(void* data);
|
||||||
bool onMessageCommit(const LLSD& notification, const LLSD& response);
|
bool onMessageCommit(const LLSD& notification, const LLSD& response);
|
||||||
|
|
||||||
|
|||||||
@@ -378,24 +378,21 @@ void LLFloaterReporter::onClickSelectAbuser(void *userdata)
|
|||||||
{
|
{
|
||||||
LLFloaterReporter *self = (LLFloaterReporter *)userdata;
|
LLFloaterReporter *self = (LLFloaterReporter *)userdata;
|
||||||
|
|
||||||
gFloaterView->getParentFloater(self)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarID, userdata, FALSE, TRUE ));
|
gFloaterView->getParentFloater(self)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLFloaterReporter::callbackAvatarID, self, _1, _2), FALSE, TRUE ));
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
void LLFloaterReporter::callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName>& names)
|
||||||
void LLFloaterReporter::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data)
|
|
||||||
{
|
{
|
||||||
LLFloaterReporter* self = (LLFloaterReporter*) data;
|
|
||||||
|
|
||||||
if (ids.empty() || names.empty()) return;
|
if (ids.empty() || names.empty()) return;
|
||||||
|
|
||||||
// this should never be called in a bug report but here for safety.
|
// this should never be called in a bug report but here for safety.
|
||||||
if ( self->mReportType != BUG_REPORT )
|
if ( mReportType != BUG_REPORT )
|
||||||
{
|
{
|
||||||
self->childSetText("abuser_name_edit", names[0] );
|
childSetText("abuser_name_edit", names[0].getCompleteName() );
|
||||||
|
|
||||||
self->mAbuserID = ids[0];
|
mAbuserID = ids[0];
|
||||||
|
|
||||||
self->refresh();
|
refresh();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
#include "lluuid.h"
|
#include "lluuid.h"
|
||||||
#include "v3math.h"
|
#include "v3math.h"
|
||||||
|
|
||||||
|
class LLAvatarName;
|
||||||
class LLMessageSystem;
|
class LLMessageSystem;
|
||||||
class LLViewerTexture;
|
class LLViewerTexture;
|
||||||
class LLInventoryItem;
|
class LLInventoryItem;
|
||||||
@@ -126,7 +127,7 @@ private:
|
|||||||
void setPosBox(const LLVector3d &pos);
|
void setPosBox(const LLVector3d &pos);
|
||||||
void enableControls(BOOL own_avatar);
|
void enableControls(BOOL own_avatar);
|
||||||
void getObjectInfo(const LLUUID& object_id);
|
void getObjectInfo(const LLUUID& object_id);
|
||||||
static void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data);
|
void callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName>& names);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EReportType mReportType;
|
EReportType mReportType;
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include "llfloatersellland.h"
|
#include "llfloatersellland.h"
|
||||||
|
|
||||||
|
#include "llavatarnamecache.h"
|
||||||
#include "llfloateravatarpicker.h"
|
#include "llfloateravatarpicker.h"
|
||||||
#include "llfloater.h"
|
#include "llfloater.h"
|
||||||
#include "llfloaterland.h"
|
#include "llfloaterland.h"
|
||||||
@@ -88,7 +89,7 @@ private:
|
|||||||
static void doShowObjects(void *userdata);
|
static void doShowObjects(void *userdata);
|
||||||
static bool callbackHighlightTransferable(const LLSD& notification, const LLSD& response);
|
static bool callbackHighlightTransferable(const LLSD& notification, const LLSD& response);
|
||||||
|
|
||||||
static void callbackAvatarPick(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data);
|
void callbackAvatarPick(const uuid_vec_t& ids, const std::vector<LLAvatarName>& names);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual BOOL postBuild();
|
virtual BOOL postBuild();
|
||||||
@@ -413,25 +414,23 @@ void LLFloaterSellLandUI::doSelectAgent(void *userdata)
|
|||||||
{
|
{
|
||||||
LLFloaterSellLandUI* floaterp = (LLFloaterSellLandUI*)userdata;
|
LLFloaterSellLandUI* floaterp = (LLFloaterSellLandUI*)userdata;
|
||||||
// grandparent is a floater, in order to set up dependency
|
// grandparent is a floater, in order to set up dependency
|
||||||
floaterp->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarPick, floaterp, FALSE, TRUE));
|
floaterp->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLFloaterSellLandUI::callbackAvatarPick, floaterp, _1, _2), FALSE, TRUE));
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
void LLFloaterSellLandUI::callbackAvatarPick(const uuid_vec_t& ids, const std::vector<LLAvatarName>& names)
|
||||||
void LLFloaterSellLandUI::callbackAvatarPick(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data)
|
|
||||||
{
|
{
|
||||||
LLFloaterSellLandUI* floaterp = (LLFloaterSellLandUI*)data;
|
LLParcel* parcel = mParcelSelection->getParcel();
|
||||||
LLParcel* parcel = floaterp->mParcelSelection->getParcel();
|
|
||||||
|
|
||||||
if (names.empty() || ids.empty()) return;
|
if (names.empty() || ids.empty()) return;
|
||||||
|
|
||||||
LLUUID id = ids[0];
|
LLUUID id = ids[0];
|
||||||
parcel->setAuthorizedBuyerID(id);
|
parcel->setAuthorizedBuyerID(id);
|
||||||
|
|
||||||
floaterp->mAuthorizedBuyer = ids[0];
|
mAuthorizedBuyer = ids[0];
|
||||||
|
|
||||||
floaterp->childSetText("sell_to_agent", names[0]);
|
childSetText("sell_to_agent", names[0].getCompleteName());
|
||||||
|
|
||||||
floaterp->refreshUI();
|
refreshUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
|||||||
@@ -34,8 +34,10 @@
|
|||||||
#include "llpanelgroupinvite.h"
|
#include "llpanelgroupinvite.h"
|
||||||
|
|
||||||
#include "llagent.h"
|
#include "llagent.h"
|
||||||
|
#include "llavatarnamecache.h"
|
||||||
#include "llfloateravatarpicker.h"
|
#include "llfloateravatarpicker.h"
|
||||||
#include "llbutton.h"
|
#include "llbutton.h"
|
||||||
|
#include "llcallingcard.h"
|
||||||
#include "llcombobox.h"
|
#include "llcombobox.h"
|
||||||
#include "llgroupmgr.h"
|
#include "llgroupmgr.h"
|
||||||
#include "llnamelistctrl.h"
|
#include "llnamelistctrl.h"
|
||||||
@@ -54,7 +56,7 @@ public:
|
|||||||
~impl();
|
~impl();
|
||||||
|
|
||||||
void addUsers(const std::vector<std::string>& names,
|
void addUsers(const std::vector<std::string>& names,
|
||||||
const std::vector<LLUUID>& agent_ids);
|
const uuid_vec_t& agent_ids);
|
||||||
void submitInvitations();
|
void submitInvitations();
|
||||||
void addRoleNames(LLGroupMgrGroupData* gdatap);
|
void addRoleNames(LLGroupMgrGroupData* gdatap);
|
||||||
void handleRemove();
|
void handleRemove();
|
||||||
@@ -65,9 +67,13 @@ 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 std::vector<std::string>& names,
|
static void callbackAddUsers(const uuid_vec_t& agent_ids,
|
||||||
const std::vector<LLUUID>& agent_ids,
|
|
||||||
void* user_data);
|
void* user_data);
|
||||||
|
|
||||||
|
static void onAvatarNameCache(const LLUUID& agent_id,
|
||||||
|
const LLAvatarName& av_name,
|
||||||
|
void* user_data);
|
||||||
|
|
||||||
bool inviteOwnerCallback(const LLSD& notification, const LLSD& response);
|
bool inviteOwnerCallback(const LLSD& notification, const LLSD& response);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -80,6 +86,8 @@ public:
|
|||||||
LLButton *mRemoveButton;
|
LLButton *mRemoveButton;
|
||||||
LLTextBox *mGroupName;
|
LLTextBox *mGroupName;
|
||||||
std::string mOwnerWarning;
|
std::string mOwnerWarning;
|
||||||
|
std::string mAlreadyInGroup;
|
||||||
|
std::string mTooManySelected;
|
||||||
bool mConfirmedOwnerInvite;
|
bool mConfirmedOwnerInvite;
|
||||||
|
|
||||||
void (*mCloseCallback)(void* data);
|
void (*mCloseCallback)(void* data);
|
||||||
@@ -107,7 +115,7 @@ LLPanelGroupInvite::impl::~impl()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LLPanelGroupInvite::impl::addUsers(const std::vector<std::string>& names,
|
void LLPanelGroupInvite::impl::addUsers(const std::vector<std::string>& names,
|
||||||
const std::vector<LLUUID>& agent_ids)
|
const uuid_vec_t& agent_ids)
|
||||||
{
|
{
|
||||||
std::string name;
|
std::string name;
|
||||||
LLUUID id;
|
LLUUID id;
|
||||||
@@ -168,24 +176,48 @@ void LLPanelGroupInvite::impl::submitInvitations()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool already_in_group = false;
|
||||||
//loop over the users
|
//loop over the users
|
||||||
std::vector<LLScrollListItem*> items = mInvitees->getAllData();
|
std::vector<LLScrollListItem*> items = mInvitees->getAllData();
|
||||||
for (std::vector<LLScrollListItem*>::iterator iter = items.begin();
|
for (std::vector<LLScrollListItem*>::iterator iter = items.begin();
|
||||||
iter != items.end(); ++iter)
|
iter != items.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLScrollListItem* item = *iter;
|
LLScrollListItem* item = *iter;
|
||||||
|
if(gdatap->mMembers.find(item->getUUID()) != gdatap->mMembers.end())
|
||||||
|
{
|
||||||
|
already_in_group = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
role_member_pairs[item->getUUID()] = role_id;
|
role_member_pairs[item->getUUID()] = role_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const S32 MAX_GROUP_INVITES = 100; // Max invites per request. 100 to match server cap.
|
||||||
|
if (role_member_pairs.size() > MAX_GROUP_INVITES)
|
||||||
|
{
|
||||||
|
// Fail!
|
||||||
|
LLSD msg;
|
||||||
|
msg["MESSAGE"] = mTooManySelected;
|
||||||
|
LLNotificationsUtil::add("GenericAlert", msg);
|
||||||
|
(*mCloseCallback)(mCloseCallbackUserData);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LLGroupMgr::getInstance()->sendGroupMemberInvites(mGroupID, role_member_pairs);
|
LLGroupMgr::getInstance()->sendGroupMemberInvites(mGroupID, role_member_pairs);
|
||||||
|
|
||||||
|
if(already_in_group)
|
||||||
|
{
|
||||||
|
LLSD msg;
|
||||||
|
msg["MESSAGE"] = mAlreadyInGroup;
|
||||||
|
LLNotificationsUtil::add("GenericAlert", msg);
|
||||||
|
}
|
||||||
|
|
||||||
//then close
|
//then close
|
||||||
(*mCloseCallback)(mCloseCallbackUserData);
|
(*mCloseCallback)(mCloseCallbackUserData);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LLPanelGroupInvite::impl::inviteOwnerCallback(const LLSD& notification, const LLSD& response)
|
bool LLPanelGroupInvite::impl::inviteOwnerCallback(const LLSD& notification, const LLSD& response)
|
||||||
{
|
{
|
||||||
S32 option = LLNotification::getSelectedOption(notification, response);
|
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||||
|
|
||||||
switch(option)
|
switch(option)
|
||||||
{
|
{
|
||||||
@@ -274,12 +306,12 @@ void LLPanelGroupInvite::impl::callbackClickAdd(void* userdata)
|
|||||||
//Soon the avatar picker will be embedded into this panel
|
//Soon the avatar picker will be embedded into this panel
|
||||||
//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
|
||||||
LLFloater* parentp;
|
LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(
|
||||||
|
boost::bind(impl::callbackAddUsers, _1, panelp->mImplementation), TRUE);
|
||||||
parentp = gFloaterView->getParentFloater(panelp);
|
if (picker)
|
||||||
parentp->addDependentFloater(LLFloaterAvatarPicker::show(callbackAddUsers,
|
{
|
||||||
panelp->mImplementation,
|
gFloaterView->getParentFloater(panelp)->addDependentFloater(picker);
|
||||||
TRUE));
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,26 +375,43 @@ void LLPanelGroupInvite::impl::callbackClickOK(void* userdata)
|
|||||||
if ( selfp ) selfp->submitInvitations();
|
if ( selfp ) selfp->submitInvitations();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//static
|
//static
|
||||||
void LLPanelGroupInvite::impl::callbackAddUsers(const std::vector<std::string>& names,
|
void LLPanelGroupInvite::impl::callbackAddUsers(const uuid_vec_t& agent_ids, void* user_data)
|
||||||
const std::vector<LLUUID>& ids,
|
{
|
||||||
void* user_data)
|
std::vector<std::string> names;
|
||||||
|
for (S32 i = 0; i < (S32)agent_ids.size(); i++)
|
||||||
|
{
|
||||||
|
LLAvatarNameCache::get(agent_ids[i],
|
||||||
|
boost::bind(&LLPanelGroupInvite::impl::onAvatarNameCache, _1, _2, user_data));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLPanelGroupInvite::impl::onAvatarNameCache(const LLUUID& agent_id,
|
||||||
|
const LLAvatarName& av_name,
|
||||||
|
void* user_data)
|
||||||
{
|
{
|
||||||
impl* selfp = (impl*) user_data;
|
impl* selfp = (impl*) user_data;
|
||||||
|
|
||||||
if ( selfp) selfp->addUsers(names, ids);
|
if (selfp)
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LLPanelGroupInvite::LLPanelGroupInvite(const std::string& name,
|
LLPanelGroupInvite::LLPanelGroupInvite(const std::string& name,
|
||||||
const LLUUID& group_id)
|
const LLUUID& group_id)
|
||||||
: LLPanel(name)
|
: LLPanel(name),
|
||||||
|
mImplementation(new impl(group_id)),
|
||||||
|
mPendingUpdate(FALSE)
|
||||||
{
|
{
|
||||||
mImplementation = new impl(group_id);
|
|
||||||
mPendingUpdate = FALSE;
|
|
||||||
mStoreSelected = LLUUID::null;
|
|
||||||
|
|
||||||
std::string panel_def_file;
|
|
||||||
|
|
||||||
// Pass on construction of this panel to the control factory.
|
// Pass on construction of this panel to the control factory.
|
||||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_group_invite.xml", &getFactoryMap());
|
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_group_invite.xml", &getFactoryMap());
|
||||||
}
|
}
|
||||||
@@ -388,18 +437,72 @@ void LLPanelGroupInvite::clear()
|
|||||||
mImplementation->mOKButton->setEnabled(FALSE);
|
mImplementation->mOKButton->setEnabled(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLPanelGroupInvite::addUsers(std::vector<LLUUID>& agent_ids)
|
void LLPanelGroupInvite::addUsers(uuid_vec_t& agent_ids)
|
||||||
{
|
{
|
||||||
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++)
|
||||||
{
|
{
|
||||||
std::string name;
|
std::string fullname;
|
||||||
if(gCacheName->getFullName(agent_ids[i], name))
|
LLUUID agent_id = agent_ids[i];
|
||||||
names.push_back(name);
|
LLViewerObject* dest = gObjectList.findObject(agent_id);
|
||||||
|
if(dest && dest->isAvatar())
|
||||||
|
{
|
||||||
|
LLNameValue* nvfirst = dest->getNVPair("FirstName");
|
||||||
|
LLNameValue* nvlast = dest->getNVPair("LastName");
|
||||||
|
if(nvfirst && nvlast)
|
||||||
|
{
|
||||||
|
fullname = LLCacheName::buildFullName(
|
||||||
|
nvfirst->getString(), nvlast->getString());
|
||||||
|
|
||||||
|
}
|
||||||
|
if (!fullname.empty())
|
||||||
|
{
|
||||||
|
names.push_back(fullname);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
llwarns << "llPanelGroupInvite: Selected avatar has no name: " << dest->getID() << llendl;
|
||||||
|
names.push_back("(Unknown)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//looks like user try to invite offline friend
|
||||||
|
//for offline avatar_id gObjectList.findObject() will return null
|
||||||
|
//so we need to do this additional search in avatar tracker, see EXT-4732
|
||||||
|
if (LLAvatarTracker::instance().isBuddy(agent_id))
|
||||||
|
{
|
||||||
|
LLAvatarName av_name;
|
||||||
|
if (!LLAvatarNameCache::get(agent_id, &av_name))
|
||||||
|
{
|
||||||
|
// actually it should happen, just in case
|
||||||
|
LLAvatarNameCache::get(LLUUID(agent_id), boost::bind(
|
||||||
|
&LLPanelGroupInvite::addUserCallback, this, _1, _2));
|
||||||
|
// for this special case!
|
||||||
|
//when there is no cached name we should remove resident from agent_ids list to avoid breaking of sequence
|
||||||
|
// removed id will be added in callback
|
||||||
|
agent_ids.erase(agent_ids.begin() + i);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
names.push_back(av_name.getLegacyName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mImplementation->addUsers(names, agent_ids);
|
mImplementation->addUsers(names, agent_ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLPanelGroupInvite::addUserCallback(const LLUUID& id, const LLAvatarName& av_name)
|
||||||
|
{
|
||||||
|
std::vector<std::string> names;
|
||||||
|
uuid_vec_t agent_ids;
|
||||||
|
agent_ids.push_back(id);
|
||||||
|
names.push_back(av_name.getLegacyName());
|
||||||
|
|
||||||
|
mImplementation->addUsers(names, agent_ids);
|
||||||
|
}
|
||||||
|
|
||||||
void LLPanelGroupInvite::draw()
|
void LLPanelGroupInvite::draw()
|
||||||
{
|
{
|
||||||
LLPanel::draw();
|
LLPanel::draw();
|
||||||
@@ -500,9 +603,8 @@ BOOL LLPanelGroupInvite::postBuild()
|
|||||||
getChild<LLNameListCtrl>("invitee_list", recurse);
|
getChild<LLNameListCtrl>("invitee_list", recurse);
|
||||||
if ( mImplementation->mInvitees )
|
if ( mImplementation->mInvitees )
|
||||||
{
|
{
|
||||||
mImplementation->mInvitees->setCallbackUserData(mImplementation);
|
|
||||||
mImplementation->mInvitees->setCommitOnSelectionChange(TRUE);
|
mImplementation->mInvitees->setCommitOnSelectionChange(TRUE);
|
||||||
mImplementation->mInvitees->setCommitCallback(impl::callbackSelect);
|
mImplementation->mInvitees->setCommitCallback(impl::callbackSelect, mImplementation);
|
||||||
}
|
}
|
||||||
|
|
||||||
LLButton* button = getChild<LLButton>("add_button", recurse);
|
LLButton* button = getChild<LLButton>("add_button", recurse);
|
||||||
@@ -510,14 +612,14 @@ BOOL LLPanelGroupInvite::postBuild()
|
|||||||
{
|
{
|
||||||
// default to opening avatarpicker automatically
|
// default to opening avatarpicker automatically
|
||||||
// (*impl::callbackClickAdd)((void*)this);
|
// (*impl::callbackClickAdd)((void*)this);
|
||||||
button->setClickedCallback(boost::bind(&impl::callbackClickAdd, this));
|
button->setClickedCallback(impl::callbackClickAdd, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
mImplementation->mRemoveButton =
|
mImplementation->mRemoveButton =
|
||||||
getChild<LLButton>("remove_button", recurse);
|
getChild<LLButton>("remove_button", recurse);
|
||||||
if ( mImplementation->mRemoveButton )
|
if ( mImplementation->mRemoveButton )
|
||||||
{
|
{
|
||||||
mImplementation->mRemoveButton->setClickedCallback(boost::bind(&impl::callbackClickRemove, mImplementation));
|
mImplementation->mRemoveButton->setClickedCallback(impl::callbackClickRemove, mImplementation);
|
||||||
mImplementation->mRemoveButton->setEnabled(FALSE);
|
mImplementation->mRemoveButton->setEnabled(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -525,17 +627,19 @@ BOOL LLPanelGroupInvite::postBuild()
|
|||||||
getChild<LLButton>("ok_button", recurse);
|
getChild<LLButton>("ok_button", recurse);
|
||||||
if ( mImplementation->mOKButton )
|
if ( mImplementation->mOKButton )
|
||||||
{
|
{
|
||||||
mImplementation->mOKButton->setClickedCallback(boost::bind(&impl::callbackClickOK, mImplementation));
|
mImplementation->mOKButton->setClickedCallback(impl::callbackClickOK, mImplementation);
|
||||||
mImplementation->mOKButton->setEnabled(FALSE);
|
mImplementation->mOKButton->setEnabled(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
button = getChild<LLButton>("cancel_button", recurse);
|
button = getChild<LLButton>("cancel_button", recurse);
|
||||||
if ( button )
|
if ( button )
|
||||||
{
|
{
|
||||||
button->setClickedCallback(boost::bind(&impl::callbackClickCancel,mImplementation));
|
button->setClickedCallback(impl::callbackClickCancel, mImplementation);
|
||||||
}
|
}
|
||||||
|
|
||||||
mImplementation->mOwnerWarning = getString("confirm_invite_owner_str");
|
mImplementation->mOwnerWarning = getString("confirm_invite_owner_str");
|
||||||
|
mImplementation->mAlreadyInGroup = getString("already_in_group");
|
||||||
|
mImplementation->mTooManySelected = getString("invite_selection_too_large");
|
||||||
|
|
||||||
update();
|
update();
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
#include "llpanel.h"
|
#include "llpanel.h"
|
||||||
#include "lluuid.h"
|
#include "lluuid.h"
|
||||||
|
|
||||||
|
class LLAvatarName;
|
||||||
class LLPanelGroupInvite
|
class LLPanelGroupInvite
|
||||||
: public LLPanel
|
: public LLPanel
|
||||||
{
|
{
|
||||||
@@ -42,7 +43,11 @@ public:
|
|||||||
LLPanelGroupInvite(const std::string& name, const LLUUID& group_id);
|
LLPanelGroupInvite(const std::string& name, const LLUUID& group_id);
|
||||||
~LLPanelGroupInvite();
|
~LLPanelGroupInvite();
|
||||||
|
|
||||||
void addUsers(std::vector<LLUUID>& agent_ids);
|
void addUsers(uuid_vec_t& agent_ids);
|
||||||
|
/**
|
||||||
|
* this callback is being used to add a user whose fullname isn't been loaded before invoking of addUsers().
|
||||||
|
*/
|
||||||
|
void addUserCallback(const LLUUID& id, const LLAvatarName& av_name);
|
||||||
void clear();
|
void clear();
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ LLViewerParcelMgr::LLViewerParcelMgr()
|
|||||||
mRequestResult(0),
|
mRequestResult(0),
|
||||||
mWestSouth(),
|
mWestSouth(),
|
||||||
mEastNorth(),
|
mEastNorth(),
|
||||||
mSelectedDwell(0.f),
|
mSelectedDwell(DWELL_NAN),
|
||||||
mAgentParcelSequenceID(-1),
|
mAgentParcelSequenceID(-1),
|
||||||
mHoverRequestResult(0),
|
mHoverRequestResult(0),
|
||||||
mHoverWestSouth(),
|
mHoverWestSouth(),
|
||||||
@@ -244,7 +244,7 @@ void LLViewerParcelMgr::getDisplayInfo(S32* area_out, S32* claim_out,
|
|||||||
S32 price = 0;
|
S32 price = 0;
|
||||||
S32 rent = 0;
|
S32 rent = 0;
|
||||||
BOOL for_sale = FALSE;
|
BOOL for_sale = FALSE;
|
||||||
F32 dwell = 0.f;
|
F32 dwell = DWELL_NAN;
|
||||||
|
|
||||||
if (mSelected)
|
if (mSelected)
|
||||||
{
|
{
|
||||||
@@ -590,7 +590,7 @@ void LLViewerParcelMgr::deselectLand()
|
|||||||
mCurrentParcel->mBanList.clear();
|
mCurrentParcel->mBanList.clear();
|
||||||
//mCurrentParcel->mRenterList.reset();
|
//mCurrentParcel->mRenterList.reset();
|
||||||
|
|
||||||
mSelectedDwell = 0.f;
|
mSelectedDwell = DWELL_NAN;
|
||||||
|
|
||||||
// invalidate parcel selection so that existing users of this selection can clean up
|
// invalidate parcel selection so that existing users of this selection can clean up
|
||||||
mCurrentParcelSelection->setParcel(NULL);
|
mCurrentParcelSelection->setParcel(NULL);
|
||||||
@@ -1679,7 +1679,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
|
|||||||
parcel_mgr.sendParcelAccessListRequest(AL_ACCESS | AL_BAN);
|
parcel_mgr.sendParcelAccessListRequest(AL_ACCESS | AL_BAN);
|
||||||
|
|
||||||
// Request dwell for this land, if it's not public land.
|
// Request dwell for this land, if it's not public land.
|
||||||
parcel_mgr.mSelectedDwell = 0.f;
|
parcel_mgr.mSelectedDwell = DWELL_NAN;
|
||||||
if (0 != local_id)
|
if (0 != local_id)
|
||||||
{
|
{
|
||||||
parcel_mgr.sendParcelDwellRequest();
|
parcel_mgr.sendParcelDwellRequest();
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ class LLParcel;
|
|||||||
class LLViewerTexture;
|
class LLViewerTexture;
|
||||||
class LLViewerRegion;
|
class LLViewerRegion;
|
||||||
|
|
||||||
|
const F32 DWELL_NAN = -1.0f; // A dwell having this value will be displayed as Loading...
|
||||||
|
|
||||||
// Constants for sendLandOwner
|
// Constants for sendLandOwner
|
||||||
//const U32 NO_NEIGHBOR_JOIN = 0x0;
|
//const U32 NO_NEIGHBOR_JOIN = 0x0;
|
||||||
//const U32 ALL_NEIGHBOR_JOIN = U32( NORTH_MASK
|
//const U32 ALL_NEIGHBOR_JOIN = U32( NORTH_MASK
|
||||||
|
|||||||
@@ -32,6 +32,12 @@ Resident Chooser' to start.
|
|||||||
<string name="confirm_invite_owner_str">
|
<string name="confirm_invite_owner_str">
|
||||||
Are you sure you want to invite new owner(s)? This action is permanent!
|
Are you sure you want to invite new owner(s)? This action is permanent!
|
||||||
</string>
|
</string>
|
||||||
|
<string name="already_in_group">
|
||||||
|
Some Residents you chose are already in the group, and so were not sent an invitation.
|
||||||
|
<string>
|
||||||
|
<string name="invite_selection_too_large">
|
||||||
|
Group Invitations not sent: too many Residents selected. Group Invitations are limited to 100 per request.
|
||||||
|
<string>
|
||||||
<!--button bottom="25" font="SansSerifSmall" halign="center" height="20"
|
<!--button bottom="25" font="SansSerifSmall" halign="center" height="20"
|
||||||
label="Send Invitations" left="65" name="ok_button" width="140" />
|
label="Send Invitations" left="65" name="ok_button" width="140" />
|
||||||
<button bottom_delta="-22" font="SansSerifSmall" halign="center" height="20"
|
<button bottom_delta="-22" font="SansSerifSmall" halign="center" height="20"
|
||||||
|
|||||||
Reference in New Issue
Block a user