Conflicts:
	indra/newview/skins/default/xui/en-us/floater_active_speakers.xml
This commit is contained in:
Shyotl
2013-06-27 22:07:31 -05:00
336 changed files with 21315 additions and 17794 deletions

View File

@@ -615,7 +615,7 @@ void AIStateMachine::multiplex(event_type event)
// If the state is bs_multiplex we only need to run again when need_run was set again in the meantime or when this state machine isn't idle.
need_new_run = sub_state_r->need_run || !sub_state_r->idle;
// If this fails then the run state didn't change and neither idle() nor yield() was called.
llassert_always(!(need_new_run && !mYieldEngine && sub_state_r->run_state == run_state));
llassert_always(!(need_new_run && !sub_state_r->skip_idle && !mYieldEngine && sub_state_r->run_state == run_state));
}
break;
case bs_abort:

View File

@@ -20,10 +20,12 @@ if (WINDOWS)
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
)
elseif (EXISTS /etc/debian_version)
# On Debian and Ubuntu, avoid Python 2.4 if possible.
find_program(PYTHON_EXECUTABLE python2.5 python2.3 python PATHS /usr/bin)
elseif (EXISTS /etc/arch-release)
# On Archlinux, use Python 2
find_program(PYTHON_EXECUTABLE python2 PATHS /usr/bin)
if (PYTHON_EXECUTABLE)
set(PYTHONINTERP_FOUND ON)

View File

@@ -275,7 +275,7 @@ class TeeStream : public std::ostream {
};
#if CWDEBUG_LOCATION
class BackTrace {
class LL_COMMON_API BackTrace {
private:
boost::shared_array<void*> M_buffer;
int M_frames;

View File

@@ -197,6 +197,9 @@ U32 getNumHTTPQueued(void);
// Returns the number of curl requests currently added to the multi handle.
U32 getNumHTTPAdded(void);
// Return the maximum number of total allowed added curl requests.
U32 getMaxHTTPAdded(void);
// This used to be LLAppViewer::getTextureFetch()->getNumHTTPRequests().
// Returns the number of active curl easy handles (that are actually attempting to download something).
U32 getNumHTTPRunning(void);

View File

@@ -49,7 +49,7 @@ AIThreadSafeSimpleDC<AIPerService::TotalQueued> AIPerService::sTotalQueued;
namespace AICurlPrivate {
// Cached value of CurlConcurrentConnectionsPerService.
U32 CurlConcurrentConnectionsPerService;
U16 CurlConcurrentConnectionsPerService;
// Friend functions of RefCountedThreadSafePerService
@@ -72,10 +72,11 @@ using namespace AICurlPrivate;
AIPerService::AIPerService(void) :
mHTTPBandwidth(25), // 25 = 1000 ms / 40 ms.
mConcurrectConnections(CurlConcurrentConnectionsPerService),
mConcurrentConnections(CurlConcurrentConnectionsPerService),
mApprovedRequests(0),
mTotalAdded(0),
mApprovedFirst(0),
mUnapprovedFirst(0)
mUsedCT(0),
mCTInUse(0)
{
}
@@ -84,7 +85,9 @@ AIPerService::CapabilityType::CapabilityType(void) :
mQueuedCommands(0),
mAdded(0),
mFlags(0),
mMaxPipelinedRequests(CurlConcurrentConnectionsPerService)
mDownloading(0),
mMaxPipelinedRequests(CurlConcurrentConnectionsPerService),
mConcurrentConnections(CurlConcurrentConnectionsPerService)
{
}
@@ -121,6 +124,20 @@ AIPerService::AIPerService(AIPerService const&) : mHTTPBandwidth(0)
// - userinfo does not contain a '@', and if it exists, is always terminated by a '@'.
// - port does not contain a ':', and if it exists is always prepended by a ':'.
//
// This function also needs to deal with full paths, in which case it should return
// an empty string.
//
// Full paths can have the form: "/something..."
// or "C:\something..."
// and maybe even "C:/something..."
//
// The first form leads to an empty string being returned because the '/' signals the
// end of the authority and we'll return immediately.
// The second one will abort when hitting the backslash because that is an illegal
// character in an url (before the first '/' anyway).
// The third will abort because "C:" would be the hostname and a colon in the hostname
// is not legal.
//
//static
std::string AIPerService::extract_canonical_servicename(std::string const& url)
{
@@ -158,8 +175,13 @@ std::string AIPerService::extract_canonical_servicename(std::string const& url)
}
else
{
// Found slash that is not part of the "sheme://" string. Signals end of authority.
// Found a slash that is not part of the "sheme://" string. Signals end of authority.
// We're done.
if (hostname < sheme_colon)
{
// This happens when windows filenames are passed to this function of the form "C:/..."
servicename.clear();
}
break;
}
}
@@ -172,6 +194,12 @@ std::string AIPerService::extract_canonical_servicename(std::string const& url)
servicename.clear(); // Remove the "userinfo@"
}
}
else if (c == '\\')
{
// Found a backslash, which is an illegal character for an URL. This is a windows path... reject it.
servicename.clear();
break;
}
if (p >= hostname)
{
// Convert hostname to lowercase in a way that we compare two hostnames equal iff libcurl does.
@@ -252,9 +280,57 @@ void AIPerService::release(AIPerServicePtr& instance)
instance.reset();
}
bool AIPerService::throttled() const
void AIPerService::redivide_connections(void)
{
return mTotalAdded >= mConcurrectConnections;
// Priority order.
static AICapabilityType order[number_of_capability_types] = { cap_inventory, cap_texture, cap_mesh, cap_other };
// Count the number of capability types that are currently in use and store the types in an array.
AICapabilityType used_order[number_of_capability_types];
int number_of_capability_types_in_use = 0;
for (int i = 0; i < number_of_capability_types; ++i)
{
U32 const mask = CT2mask(order[i]);
if ((mCTInUse & mask))
{
used_order[number_of_capability_types_in_use++] = order[i];
}
else
{
// Give every other type (that is not in use) one connection, so they can be used (at which point they'll get more).
mCapabilityType[order[i]].mConcurrentConnections = 1;
}
}
// Keep one connection in reserve for currently unused capability types (that have been used before).
int reserve = (mUsedCT != mCTInUse) ? 1 : 0;
// Distribute (mConcurrentConnections - reserve) over number_of_capability_types_in_use.
U16 max_connections_per_CT = (mConcurrentConnections - reserve) / number_of_capability_types_in_use + 1;
// The first count CTs get max_connections_per_CT connections.
int count = (mConcurrentConnections - reserve) % number_of_capability_types_in_use;
for(int i = 1, j = 0;; --i)
{
while (j < count)
{
mCapabilityType[used_order[j++]].mConcurrentConnections = max_connections_per_CT;
}
if (i == 0)
{
break;
}
// Finish the loop till all used CTs are assigned.
count = number_of_capability_types_in_use;
// Never assign 0 as maximum.
if (max_connections_per_CT > 1)
{
// The remaining CTs get one connection less so that the sum of all assigned connections is mConcurrentConnections - reserve.
--max_connections_per_CT;
}
}
}
bool AIPerService::throttled(AICapabilityType capability_type) const
{
return mTotalAdded >= mConcurrentConnections ||
mCapabilityType[capability_type].mAdded >= mCapabilityType[capability_type].mConcurrentConnections;
}
void AIPerService::added_to_multi_handle(AICapabilityType capability_type)
@@ -263,17 +339,37 @@ void AIPerService::added_to_multi_handle(AICapabilityType capability_type)
++mTotalAdded;
}
void AIPerService::removed_from_multi_handle(AICapabilityType capability_type)
void AIPerService::removed_from_multi_handle(AICapabilityType capability_type, bool downloaded_something)
{
--mCapabilityType[capability_type].mAdded;
CapabilityType& ct(mCapabilityType[capability_type]);
llassert(mTotalAdded > 0 && ct.mAdded > 0);
bool done = --ct.mAdded == 0;
if (downloaded_something)
{
llassert(ct.mDownloading > 0);
--ct.mDownloading;
}
--mTotalAdded;
llassert(mTotalAdded >= 0 && mCapabilityType[capability_type].mAdded >= 0);
if (done && ct.pipelined_requests() == 0)
{
mark_unused(capability_type);
}
}
void AIPerService::queue(AICurlEasyRequest const& easy_request, AICapabilityType capability_type)
// Returns true if the request was queued.
bool AIPerService::queue(AICurlEasyRequest const& easy_request, AICapabilityType capability_type, bool force_queuing)
{
mCapabilityType[capability_type].mQueuedRequests.push_back(easy_request.get_ptr());
TotalQueued_wat(sTotalQueued)->count++;
CapabilityType::queued_request_type& queued_requests(mCapabilityType[capability_type].mQueuedRequests);
bool needs_queuing = force_queuing || !queued_requests.empty();
if (needs_queuing)
{
queued_requests.push_back(easy_request.get_ptr());
if (is_approved(capability_type))
{
TotalQueued_wat(sTotalQueued)->approved++;
}
}
return needs_queuing;
}
bool AIPerService::cancel(AICurlEasyRequest const& easy_request, AICapabilityType capability_type)
@@ -297,105 +393,139 @@ bool AIPerService::cancel(AICurlEasyRequest const& easy_request, AICapabilityTyp
prev = cur;
}
mCapabilityType[capability_type].mQueuedRequests.pop_back(); // if this is safe.
TotalQueued_wat total_queued_w(sTotalQueued);
total_queued_w->count--;
llassert(total_queued_w->count >= 0);
if (is_approved(capability_type))
{
TotalQueued_wat total_queued_w(sTotalQueued);
llassert(total_queued_w->approved > 0);
total_queued_w->approved--;
}
return true;
}
void AIPerService::add_queued_to(curlthread::MultiHandle* multi_handle, bool recursive)
void AIPerService::add_queued_to(curlthread::MultiHandle* multi_handle, bool only_this_service)
{
int order[number_of_capability_types];
// The first two types are approved types, they should be the first to try.
// Try the one that has the largest queue first, if they the queues have equal size, try mApprovedFirst first.
size_t s0 = mCapabilityType[0].mQueuedRequests.size();
size_t s1 = mCapabilityType[1].mQueuedRequests.size();
if (s0 == s1)
U32 success = 0; // The CTs that we successfully added a request for from the queue.
bool success_this_pass = false;
int i = 0;
// The first pass we only look at CTs with 0 requests added to the multi handle. Subsequent passes only non-zero ones.
for (int pass = 0;; ++i)
{
order[0] = mApprovedFirst;
mApprovedFirst = 1 - mApprovedFirst;
order[1] = mApprovedFirst;
}
else if (s0 > s1)
{
order[0] = 0;
order[1] = 1;
}
else
{
order[0] = 1;
order[1] = 0;
}
// The next two types are unapproved types. Here, try them alternating regardless of queue size.
int n = mUnapprovedFirst;
for (int i = 2; i < number_of_capability_types; ++i, n = (n + 1) % (number_of_capability_types - 2))
{
order[i] = 2 + n;
}
mUnapprovedFirst = (mUnapprovedFirst + 1) % (number_of_capability_types - 2);
for (int i = 0; i < number_of_capability_types; ++i)
{
CapabilityType& ct(mCapabilityType[order[i]]);
if (!ct.mQueuedRequests.empty())
if (i == number_of_capability_types)
{
if (!multi_handle->add_easy_request(ct.mQueuedRequests.front(), true))
i = 0;
// Keep trying until we couldn't add anything anymore.
if (pass++ && !success_this_pass)
{
// Throttled. If this failed then every capability type will fail: we either are using too much bandwidth, or too many total connections.
// However, it MAY be that this service was thottled for using too much bandwidth by itself. Look if other services can be added.
// Done.
break;
}
// Request was added, remove it from the queue.
ct.mQueuedRequests.pop_front();
if (ct.mQueuedRequests.empty())
{
// We obtained a request from the queue, and after that there we no more request in the queue of this service.
ct.mFlags |= ctf_empty;
}
else
{
// We obtained a request from the queue, and even after that there was at least one more request in the queue of this service.
ct.mFlags |= ctf_full;
}
TotalQueued_wat total_queued_w(sTotalQueued);
llassert(total_queued_w->count > 0);
if (!--(total_queued_w->count))
{
// We obtained a request from the queue, and after that there we no more request in any queue.
total_queued_w->empty = true;
}
else
{
// We obtained a request from the queue, and even after that there was at least one more request in some queue.
total_queued_w->full = true;
}
// We added something from a queue, so we're done.
return;
success_this_pass = false;
}
else
CapabilityType& ct(mCapabilityType[i]);
if (!pass != !ct.mAdded) // Does mAdded match what we're looking for (first mAdded == 0, then mAdded != 0)?
{
continue;
}
if (multi_handle->added_maximum())
{
// We hit the maximum number of global connections. Abort every attempt to add anything.
only_this_service = true;
break;
}
if (mTotalAdded >= mConcurrentConnections)
{
// We hit the maximum number of connections for this service. Abort any attempt to add anything to this service.
break;
}
if (ct.mAdded >= ct.mConcurrentConnections)
{
// We hit the maximum number of connections for this capability type. Try the next one.
continue;
}
U32 mask = CT2mask((AICapabilityType)i);
if (ct.mQueuedRequests.empty()) // Is there anything in the queue (left) at all?
{
// We could add a new request, but there is none in the queue!
// Note that if this service does not serve this capability type,
// then obviously this queue was empty; however, in that case
// this variable will never be looked at, so it's ok to set it.
ct.mFlags |= ctf_starvation;
ct.mFlags |= ((success & mask) ? ctf_empty : ctf_starvation);
}
if (i == number_of_capability_types - 1)
else
{
// Last entry also empty. All queues of this service were empty. Check total connections.
TotalQueued_wat total_queued_w(sTotalQueued);
if (total_queued_w->count == 0)
// Attempt to add the front of the queue.
if (!multi_handle->add_easy_request(ct.mQueuedRequests.front(), true))
{
// The queue of every service is empty!
total_queued_w->starvation = true;
return;
// If that failed then we got throttled on bandwidth because the maximum number of connections were not reached yet.
// Therefore this will keep failing for this service, we abort any additional attempt to add something for this service.
break;
}
// Request was added, remove it from the queue.
ct.mQueuedRequests.pop_front();
// Mark that at least one request of this CT was successfully added.
success |= mask;
success_this_pass = true;
// Update approved count.
if (is_approved((AICapabilityType)i))
{
TotalQueued_wat total_queued_w(sTotalQueued);
llassert(total_queued_w->approved > 0);
total_queued_w->approved--;
}
}
}
if (recursive)
size_t queuedapproved_size = 0;
for (int i = 0; i < number_of_capability_types; ++i)
{
CapabilityType& ct(mCapabilityType[i]);
U32 mask = CT2mask((AICapabilityType)i);
// Add up the size of all queues with approved requests.
if ((approved_mask & mask))
{
queuedapproved_size += ct.mQueuedRequests.size();
}
// Skip CTs that we didn't add anything for.
if (!(success & mask))
{
continue;
}
if (!ct.mQueuedRequests.empty())
{
// We obtained one or more requests from the queue, and even after that there was at least one more request in the queue of this CT.
ct.mFlags |= ctf_full;
}
}
// Update the flags of sTotalQueued.
{
TotalQueued_wat total_queued_w(sTotalQueued);
if (total_queued_w->approved == 0)
{
if ((success & approved_mask))
{
// We obtained an approved request from the queue, and after that there were no more requests in any (approved) queue.
total_queued_w->empty = true;
}
else
{
// Every queue of every approved CT is empty!
total_queued_w->starvation = true;
}
}
else if ((success & approved_mask))
{
// We obtained an approved request from the queue, and even after that there was at least one more request in some (approved) queue.
total_queued_w->full = true;
}
}
// Don't try other services if anything was added successfully.
if (success || only_this_service)
{
return;
}
// Nothing from this service could be added, try other services.
instance_map_wat instance_map_w(sInstanceMap);
for (iterator service = instance_map_w->begin(); service != instance_map_w->end(); ++service)
@@ -422,8 +552,11 @@ void AIPerService::purge(void)
{
size_t s = per_service_w->mCapabilityType[i].mQueuedRequests.size();
per_service_w->mCapabilityType[i].mQueuedRequests.clear();
total_queued_w->count -= s;
llassert(total_queued_w->count >= 0);
if (is_approved((AICapabilityType)i))
{
llassert(total_queued_w->approved >= s);
total_queued_w->approved -= s;
}
}
}
}
@@ -435,24 +568,34 @@ void AIPerService::adjust_concurrent_connections(int increment)
for (AIPerService::iterator iter = instance_map_w->begin(); iter != instance_map_w->end(); ++iter)
{
PerService_wat per_service_w(*iter->second);
U32 old_concurrent_connections = per_service_w->mConcurrectConnections;
per_service_w->mConcurrectConnections = llclamp(old_concurrent_connections + increment, (U32)1, CurlConcurrentConnectionsPerService);
increment = per_service_w->mConcurrectConnections - old_concurrent_connections;
U16 old_concurrent_connections = per_service_w->mConcurrentConnections;
int new_concurrent_connections = llclamp(old_concurrent_connections + increment, 1, (int)CurlConcurrentConnectionsPerService);
per_service_w->mConcurrentConnections = (U16)new_concurrent_connections;
increment = per_service_w->mConcurrentConnections - old_concurrent_connections;
for (int i = 0; i < number_of_capability_types; ++i)
{
per_service_w->mCapabilityType[i].mMaxPipelinedRequests = llmax(per_service_w->mCapabilityType[i].mMaxPipelinedRequests + increment, (U32)0);
per_service_w->mCapabilityType[i].mMaxPipelinedRequests = llmax(per_service_w->mCapabilityType[i].mMaxPipelinedRequests + increment, 0);
int new_concurrent_connections_per_capability_type =
llclamp((new_concurrent_connections * per_service_w->mCapabilityType[i].mConcurrentConnections + old_concurrent_connections / 2) / old_concurrent_connections, 1, new_concurrent_connections);
per_service_w->mCapabilityType[i].mConcurrentConnections = (U16)new_concurrent_connections_per_capability_type;
}
}
}
void AIPerService::ResetUsed::operator()(AIPerService::instance_map_type::value_type const& service) const
{
PerService_wat(*service.second)->resetUsedCt();
}
void AIPerService::Approvement::honored(void)
{
if (!mHonored)
{
mHonored = true;
AICurlPrivate::PerService_wat per_service_w(*mPerServicePtr);
llassert(per_service_w->mCapabilityType[mCapabilityType].mApprovedRequests > 0);
PerService_wat per_service_w(*mPerServicePtr);
llassert(per_service_w->mCapabilityType[mCapabilityType].mApprovedRequests > 0 && per_service_w->mApprovedRequests > 0);
per_service_w->mCapabilityType[mCapabilityType].mApprovedRequests--;
per_service_w->mApprovedRequests--;
}
}

View File

@@ -43,12 +43,15 @@
#include <string>
#include <deque>
#include <map>
#include <iterator>
#include <algorithm>
#include <boost/intrusive_ptr.hpp>
#include "aithreadsafe.h"
#include "aiaverage.h"
class AICurlEasyRequest;
class AIPerService;
class AIServiceBar;
namespace AICurlPrivate {
namespace curlthread { class MultiHandle; }
@@ -59,6 +62,8 @@ class ThreadSafeBufferedCurlEasyRequest;
// Forward declaration of BufferedCurlEasyRequestPtr (see aicurlprivate.h).
typedef boost::intrusive_ptr<ThreadSafeBufferedCurlEasyRequest> BufferedCurlEasyRequestPtr;
} // namespace AICurlPrivate
// AIPerService objects are created by the curl thread and destructed by the main thread.
// We need locking.
typedef AIThreadSafeSimpleDC<AIPerService> threadsafe_PerService;
@@ -66,8 +71,6 @@ typedef AIAccessConst<AIPerService> PerService_crat;
typedef AIAccess<AIPerService> PerService_rat;
typedef AIAccess<AIPerService> PerService_wat;
} // namespace AICurlPrivate
// We can't put threadsafe_PerService in a std::map because you can't copy a mutex.
// Therefore, use an intrusive pointer for the threadsafe type.
typedef boost::intrusive_ptr<AICurlPrivate::RefCountedThreadSafePerService> AIPerServicePtr;
@@ -84,6 +87,8 @@ enum AICapabilityType { // {Capabilities} [Responders]
number_of_capability_types = 4
};
static U32 const approved_mask = 3; // The mask of cap_texture OR-ed with the mask of cap_inventory.
//-----------------------------------------------------------------------------
// AIPerService
@@ -93,13 +98,14 @@ enum AICapabilityType { // {Capabilities} [Responders]
// for that service already have been reached. And to keep track of the bandwidth usage, and the
// number of queued requests in the pipeline, for this service.
class AIPerService {
private:
public:
typedef std::map<std::string, AIPerServicePtr> instance_map_type;
typedef AIThreadSafeSimpleDC<instance_map_type> threadsafe_instance_map_type;
typedef AIAccess<instance_map_type> instance_map_rat;
typedef AIAccess<instance_map_type> instance_map_wat;
static threadsafe_instance_map_type sInstanceMap; // Map of AIPerService instances with the hostname as key.
private:
static threadsafe_instance_map_type sInstanceMap; // Map of AIPerService instances with the canonical hostname:port as key.
friend class AIThreadSafeSimpleDC<AIPerService>; // threadsafe_PerService
AIPerService(void);
@@ -111,7 +117,7 @@ class AIPerService {
// Utility function; extract canonical (lowercase) hostname and port from url.
static std::string extract_canonical_servicename(std::string const& url);
// Return (possibly create) a unique instance for the given hostname.
// Return (possibly create) a unique instance for the given hostname:port combination.
static AIPerServicePtr instance(std::string const& servicename);
// Release instance (object will be deleted if this was the last instance).
@@ -120,6 +126,10 @@ class AIPerService {
// Remove everything. Called upon viewer exit.
static void purge(void);
// Make a copy of the instanceMap and then run 'action(per_service)' on each AIPerService object.
template<class Action>
static void copy_forEach(Action const& action);
private:
static U16 const ctf_empty = 1;
static U16 const ctf_full = 2;
@@ -129,13 +139,15 @@ class AIPerService {
typedef std::deque<AICurlPrivate::BufferedCurlEasyRequestPtr> queued_request_type;
queued_request_type mQueuedRequests; // Waiting (throttled) requests.
U16 mApprovedRequests; // The number of approved requests by approveHTTPRequestFor that were not added to the command queue yet.
U16 mApprovedRequests; // The number of approved requests for this CT by approveHTTPRequestFor that were not added to the command queue yet.
U16 mQueuedCommands; // Number of add commands (minus remove commands), for this service, in the command queue.
U16 mAdded; // Number of active easy handles with this service.
U16 mFlags; // ctf_empty: Set to true when the queue becomes precisely empty.
// ctf_full : Set to true when the queue is popped and then still isn't empty;
// ctf_starvation: Set to true when the queue was about to be popped but was already empty.
U32 mMaxPipelinedRequests; // The maximum number of accepted requests for this service and (approved) capability type, that didn't finish yet.
U32 mDownloading; // The number of active easy handles with this service for which data was received.
U16 mMaxPipelinedRequests; // The maximum number of accepted requests for this service and (approved) capability type, that didn't finish yet.
U16 mConcurrentConnections; // The maximum number of allowed concurrent connections to the service of this capability type.
// Declare, not define, constructor and destructor - in order to avoid instantiation of queued_request_type from header.
CapabilityType(void);
@@ -144,45 +156,88 @@ class AIPerService {
S32 pipelined_requests(void) const { return mApprovedRequests + mQueuedCommands + mQueuedRequests.size() + mAdded; }
};
friend class AIServiceBar;
CapabilityType mCapabilityType[number_of_capability_types];
AIAverage mHTTPBandwidth; // Keeps track on number of bytes received for this service in the past second.
int mConcurrectConnections; // The maximum number of allowed concurrent connections to this service.
int mTotalAdded; // Number of active easy handles with this host.
int mApprovedFirst; // First capability type to try.
int mUnapprovedFirst; // First capability type to try after all approved types were tried.
int mConcurrentConnections; // The maximum number of allowed concurrent connections to this service.
int mApprovedRequests; // The number of approved requests for this service by approveHTTPRequestFor that were not added to the command queue yet.
int mTotalAdded; // Number of active easy handles with this service.
U32 mUsedCT; // Bit mask with one bit per capability type. A '1' means the capability was in use since the last resetUsedCT().
U32 mCTInUse; // Bit mask with one bit per capability type. A '1' means the capability is in use right now.
// Helper struct, used in the static resetUsed.
struct ResetUsed { void operator()(instance_map_type::value_type const& service) const; };
void redivide_connections(void);
void mark_inuse(AICapabilityType capability_type)
{
U32 bit = CT2mask(capability_type);
if ((mCTInUse & bit) == 0) // If this CT went from unused to used
{
mCTInUse |= bit;
mUsedCT |= bit;
if (mUsedCT != bit) // and more than one CT use this service.
{
redivide_connections();
}
}
}
void mark_unused(AICapabilityType capability_type)
{
U32 bit = CT2mask(capability_type);
if ((mCTInUse & bit) != 0) // If this CT went from used to unused
{
mCTInUse &= ~bit;
if (mCTInUse && mUsedCT != bit) // and more than one CT use this service, and at least one is in use.
{
redivide_connections();
}
}
}
public:
static bool is_approved(AICapabilityType capability_type) { return (((U32)1 << capability_type) & approved_mask); }
static U32 CT2mask(AICapabilityType capability_type) { return (U32)1 << capability_type; }
void resetUsedCt(void) { mUsedCT = mCTInUse; }
bool is_used(AICapabilityType capability_type) const { return (mUsedCT & CT2mask(capability_type)); }
bool is_inuse(AICapabilityType capability_type) const { return (mCTInUse & CT2mask(capability_type)); }
static void resetUsed(void) { copy_forEach(ResetUsed()); }
U32 is_used(void) const { return mUsedCT; } // Non-zero if this service was used for any capability type.
U32 is_inuse(void) const { return mCTInUse; } // Non-zero if this service is in use for any capability type.
// Global administration of the total number of queued requests of all services combined.
private:
struct TotalQueued {
S32 count; // The sum of mQueuedRequests.size() of all AIPerService objects together.
bool empty; // Set to true when count becomes precisely zero as the result of popping any queue.
bool full; // Set to true when count is still larger than zero after popping any queue.
bool starvation; // Set to true when any queue was about to be popped when count was already zero.
TotalQueued(void) : count(0), empty(false), full(false), starvation(false) { }
S32 approved; // The sum of mQueuedRequests.size() of all AIPerService::CapabilityType objects of approved types.
bool empty; // Set to true when approved becomes precisely zero as the result of popping any queue.
bool full; // Set to true when approved is still larger than zero after popping any queue.
bool starvation; // Set to true when any queue was about to be popped when approved was already zero.
TotalQueued(void) : approved(0), empty(false), full(false), starvation(false) { }
};
static AIThreadSafeSimpleDC<TotalQueued> sTotalQueued;
typedef AIAccessConst<TotalQueued> TotalQueued_crat;
typedef AIAccess<TotalQueued> TotalQueued_rat;
typedef AIAccess<TotalQueued> TotalQueued_wat;
public:
static S32 total_queued_size(void) { return TotalQueued_rat(sTotalQueued)->count; }
static S32 total_approved_queue_size(void) { return TotalQueued_rat(sTotalQueued)->approved; }
// Global administration of the maximum number of pipelined requests of all services combined.
private:
struct MaxPipelinedRequests {
S32 count; // The maximum total number of accepted requests that didn't finish yet.
S32 threshold; // The maximum total number of accepted requests that didn't finish yet.
U64 last_increment; // Last time that sMaxPipelinedRequests was incremented.
U64 last_decrement; // Last time that sMaxPipelinedRequests was decremented.
MaxPipelinedRequests(void) : count(32), last_increment(0), last_decrement(0) { }
MaxPipelinedRequests(void) : threshold(32), last_increment(0), last_decrement(0) { }
};
static AIThreadSafeSimpleDC<MaxPipelinedRequests> sMaxPipelinedRequests;
typedef AIAccessConst<MaxPipelinedRequests> MaxPipelinedRequests_crat;
typedef AIAccess<MaxPipelinedRequests> MaxPipelinedRequests_rat;
typedef AIAccess<MaxPipelinedRequests> MaxPipelinedRequests_wat;
public:
static void setMaxPipelinedRequests(S32 count) { MaxPipelinedRequests_wat(sMaxPipelinedRequests)->count = count; }
static void incrementMaxPipelinedRequests(S32 increment) { MaxPipelinedRequests_wat(sMaxPipelinedRequests)->count += increment; }
static void setMaxPipelinedRequests(S32 threshold) { MaxPipelinedRequests_wat(sMaxPipelinedRequests)->threshold = threshold; }
static void incrementMaxPipelinedRequests(S32 increment) { MaxPipelinedRequests_wat(sMaxPipelinedRequests)->threshold += increment; }
// Global administration of throttle fraction (which is the same for all services).
private:
@@ -201,16 +256,18 @@ class AIPerService {
static bool sNoHTTPBandwidthThrottling; // Global override to disable bandwidth throttling.
public:
void added_to_command_queue(AICapabilityType capability_type) { ++mCapabilityType[capability_type].mQueuedCommands; }
void added_to_command_queue(AICapabilityType capability_type) { ++mCapabilityType[capability_type].mQueuedCommands; mark_inuse(capability_type); }
void removed_from_command_queue(AICapabilityType capability_type) { --mCapabilityType[capability_type].mQueuedCommands; llassert(mCapabilityType[capability_type].mQueuedCommands >= 0); }
void added_to_multi_handle(AICapabilityType capability_type); // Called when an easy handle for this host has been added to the multi handle.
void removed_from_multi_handle(AICapabilityType capability_type); // Called when an easy handle for this host is removed again from the multi handle.
bool throttled(void) const; // Returns true if the maximum number of allowed requests for this host have been added to the multi handle.
void added_to_multi_handle(AICapabilityType capability_type); // Called when an easy handle for this service has been added to the multi handle.
void removed_from_multi_handle(AICapabilityType capability_type, bool downloaded_something); // Called when an easy handle for this service is removed again from the multi handle.
void download_started(AICapabilityType capability_type) { ++mCapabilityType[capability_type].mDownloading; }
bool throttled(AICapabilityType capability_type) const; // Returns true if the maximum number of allowed requests for this service/capability type have been added to the multi handle.
bool nothing_added(AICapabilityType capability_type) const { return mCapabilityType[capability_type].mAdded == 0; }
void queue(AICurlEasyRequest const& easy_request, AICapabilityType capability_type); // Add easy_request to the queue.
bool cancel(AICurlEasyRequest const& easy_request, AICapabilityType capability_type); // Remove easy_request from the queue (if it's there).
bool queue(AICurlEasyRequest const& easy_request, AICapabilityType capability_type, bool force_queuing = true); // Add easy_request to the queue if queue is empty or force_queuing.
bool cancel(AICurlEasyRequest const& easy_request, AICapabilityType capability_type); // Remove easy_request from the queue (if it's there).
void add_queued_to(AICurlPrivate::curlthread::MultiHandle* mh, bool recursive = false);
void add_queued_to(AICurlPrivate::curlthread::MultiHandle* mh, bool only_this_service = false);
// Add queued easy handle (if any) to the multi handle. The request is removed from the queue,
// followed by either a call to added_to_multi_handle() or to queue() to add it back.
@@ -222,6 +279,7 @@ class AIPerService {
static void setNoHTTPBandwidthThrottling(bool nb) { sNoHTTPBandwidthThrottling = nb; }
static void setHTTPThrottleBandwidth(F32 max_kbps) { sHTTPThrottleBandwidth125 = 125.f * max_kbps; }
static size_t getHTTPThrottleBandwidth125(void) { return sHTTPThrottleBandwidth125; }
static F32 throttleFraction(void) { return ThrottleFraction_wat(sThrottleFraction)->fraction / 1024.f; }
// Called when CurlConcurrentConnectionsPerService changes.
static void adjust_concurrent_connections(int increment);
@@ -244,7 +302,7 @@ class AIPerService {
// the AIPerService object locked for the whole duration of the call.
// The functions only lock it when access is required.
// Returns approvement if curl can handle another request for this host.
// Returns approvement if curl can handle another request for this service.
// Should return NULL if the maximum allowed HTTP bandwidth is reached, or when
// the latency between request and actual delivery becomes too large.
static Approvement* approveHTTPRequestFor(AIPerServicePtr const& per_service, AICapabilityType capability_type);
@@ -271,8 +329,21 @@ class RefCountedThreadSafePerService : public threadsafe_PerService {
friend void intrusive_ptr_release(RefCountedThreadSafePerService* p);
};
extern U32 CurlConcurrentConnectionsPerService;
extern U16 CurlConcurrentConnectionsPerService;
} // namespace AICurlPrivate
template<class Action>
void AIPerService::copy_forEach(Action const& action)
{
// Make a copy so we don't need to keep the lock on sInstanceMap for too long.
std::vector<std::pair<instance_map_type::key_type, instance_map_type::mapped_type> > current_services;
{
instance_map_rat instance_map_r(sInstanceMap);
std::copy(instance_map_r->begin(), instance_map_r->end(), std::back_inserter(current_services));
}
// Apply the functor on each of the services.
std::for_each(current_services.begin(), current_services.end(), action);
}
#endif // AICURLPERSERVICE_H

View File

@@ -463,6 +463,9 @@ class BufferedCurlEasyRequest : public CurlEasyRequest {
// Return the capability type of this request.
AICapabilityType capability_type(void) const { llassert(mCapabilityType != number_of_capability_types); return mCapabilityType; }
// Return true if any data was received.
bool received_data(void) const { return mTotalRawBytes > 0; }
};
inline ThreadSafeBufferedCurlEasyRequest* CurlEasyRequest::get_lockobj(void)

View File

@@ -1710,7 +1710,7 @@ CURLMsg const* MultiHandle::info_read(int* msgs_in_queue) const
return ret;
}
static U32 curl_max_total_concurrent_connections = 32; // Initialized on start up by startCurlThread().
U32 curl_max_total_concurrent_connections = 32; // Initialized on start up by startCurlThread().
bool MultiHandle::add_easy_request(AICurlEasyRequest const& easy_request, bool from_queue)
{
@@ -1721,10 +1721,32 @@ bool MultiHandle::add_easy_request(AICurlEasyRequest const& easy_request, bool f
AICurlEasyRequest_wat curl_easy_request_w(*easy_request);
capability_type = curl_easy_request_w->capability_type();
per_service = curl_easy_request_w->getPerServicePtr();
// Never throttle on bandwidth if there are no handles running (sTotalAdded == 1, the long poll connection).
bool too_much_bandwidth = sTotalAdded > 1 && !curl_easy_request_w->approved() && AIPerService::checkBandwidthUsage(per_service, get_clock_count() * HTTPTimeout::sClockWidth_40ms);
if (!from_queue)
{
// Add the request to the back of a non-empty queue.
PerService_wat per_service_w(*per_service);
if (per_service_w->queue(easy_request, capability_type, false))
{
// The queue was not empty, therefore the request was queued.
#ifdef SHOW_ASSERT
// Not active yet, but it's no longer an error if next we try to remove the request.
curl_easy_request_w->mRemovedPerCommand = false;
#endif
// This is a fail-safe. Normally, if there is anything in the queue then things should
// be running (normally an attempt is made to add from the queue whenever a request
// finishes). However, it CAN happen on occassion that things get 'stuck' with
// nothing running, so nothing will ever finish and therefore the queue would never
// be checked. Only do this when there is indeed nothing running (added) though.
if (per_service_w->nothing_added(capability_type))
{
per_service_w->add_queued_to(this);
}
return true;
}
}
bool too_much_bandwidth = !curl_easy_request_w->approved() && AIPerService::checkBandwidthUsage(per_service, get_clock_count() * HTTPTimeout::sClockWidth_40ms);
PerService_wat per_service_w(*per_service);
if (!too_much_bandwidth && sTotalAdded < curl_max_total_concurrent_connections && !per_service_w->throttled())
if (!too_much_bandwidth && sTotalAdded < curl_max_total_concurrent_connections && !per_service_w->throttled(capability_type))
{
curl_easy_request_w->set_timeout_opts();
if (curl_easy_request_w->add_handle_to_multi(curl_easy_request_w, mMultiHandle) == CURLM_OK)
@@ -1791,10 +1813,11 @@ CURLMcode MultiHandle::remove_easy_request(addedEasyRequests_type::iterator cons
AIPerServicePtr per_service;
{
AICurlEasyRequest_wat curl_easy_request_w(**iter);
bool downloaded_something = curl_easy_request_w->received_data();
res = curl_easy_request_w->remove_handle_from_multi(curl_easy_request_w, mMultiHandle);
capability_type = curl_easy_request_w->capability_type();
per_service = curl_easy_request_w->getPerServicePtr();
PerService_wat(*per_service)->removed_from_multi_handle(capability_type); // (About to be) removed from mAddedEasyRequests.
PerService_wat(*per_service)->removed_from_multi_handle(capability_type, downloaded_something); // (About to be) removed from mAddedEasyRequests.
#ifdef SHOW_ASSERT
curl_easy_request_w->mRemovedPerCommand = as_per_command;
#endif
@@ -2137,6 +2160,12 @@ void BufferedCurlEasyRequest::update_body_bandwidth(void)
getinfo(CURLINFO_SIZE_DOWNLOAD, &size_download);
size_t total_raw_bytes = size_download;
size_t raw_bytes = total_raw_bytes - mTotalRawBytes;
if (mTotalRawBytes == 0 && total_raw_bytes > 0)
{
// Update service/capability type administration for the HTTP Debug Console.
PerService_wat per_service_w(*mPerServicePtr);
per_service_w->download_started(mCapabilityType);
}
mTotalRawBytes = total_raw_bytes;
// Note that in some cases (like HTTP_PARTIAL_CONTENT), the output of CURLINFO_SIZE_DOWNLOAD lags
// behind and will return 0 the first time, and the value of the previous chunk the next time.
@@ -2190,6 +2219,7 @@ size_t BufferedCurlEasyRequest::curlHeaderCallback(char* data, size_t size, size
return header_len;
}
std::string header(header_line, header_len);
bool being_redirected = false;
bool done = false;
if (!LLStringUtil::_isASCII(header))
{
@@ -2234,7 +2264,7 @@ size_t BufferedCurlEasyRequest::curlHeaderCallback(char* data, size_t size, size
if (status >= 300 && status < 400)
{
// Timeout administration needs to know if we're being redirected.
self_w->httptimeout()->being_redirected();
being_redirected = true;
}
}
// Update HTTP bandwidth.
@@ -2248,6 +2278,14 @@ size_t BufferedCurlEasyRequest::curlHeaderCallback(char* data, size_t size, size
// Transfer timed out. Return 0 which will abort with error CURLE_WRITE_ERROR.
return 0;
}
if (being_redirected)
{
// Call this after data_received(), because that might reset mBeingRedirected if it causes a late- upload_finished!
// Ie, when the upload finished was not detected and this is a redirect header then the call to data_received()
// will call upload_finished() which sets HTTPTimeout::mUploadFinished (and resets HTTPTimeout::mBeingRedirected),
// after which we set HTTPTimeout::mBeingRedirected here because we ARE being redirected.
self_w->httptimeout()->being_redirected();
}
if (done)
{
return header_len;
@@ -2533,7 +2571,7 @@ void startCurlThread(LLControlGroup* control_group)
// Cache Debug Settings.
sConfigGroup = control_group;
curl_max_total_concurrent_connections = sConfigGroup->getU32("CurlMaxTotalConcurrentConnections");
CurlConcurrentConnectionsPerService = sConfigGroup->getU32("CurlConcurrentConnectionsPerService");
CurlConcurrentConnectionsPerService = (U16)sConfigGroup->getU32("CurlConcurrentConnectionsPerService");
gNoVerifySSLCert = sConfigGroup->getBOOL("NoVerifySSLCert");
AIPerService::setMaxPipelinedRequests(curl_max_total_concurrent_connections);
AIPerService::setHTTPThrottleBandwidth(sConfigGroup->getF32("HTTPThrottleBandwidth"));
@@ -2558,10 +2596,19 @@ bool handleCurlConcurrentConnectionsPerService(LLSD const& newvalue)
{
using namespace AICurlPrivate;
U32 new_concurrent_connections = newvalue.asInteger();
AIPerService::adjust_concurrent_connections(new_concurrent_connections - CurlConcurrentConnectionsPerService);
CurlConcurrentConnectionsPerService = new_concurrent_connections;
llinfos << "CurlConcurrentConnectionsPerService set to " << CurlConcurrentConnectionsPerService << llendl;
U16 new_concurrent_connections = (U16)newvalue.asInteger();
U16 const maxCurlConcurrentConnectionsPerService = 32;
if (new_concurrent_connections < 1 || new_concurrent_connections > maxCurlConcurrentConnectionsPerService)
{
sConfigGroup->setU32("CurlConcurrentConnectionsPerService", static_cast<U32>((new_concurrent_connections < 1) ? 1 : maxCurlConcurrentConnectionsPerService));
}
else
{
int increment = new_concurrent_connections - CurlConcurrentConnectionsPerService;
CurlConcurrentConnectionsPerService = new_concurrent_connections;
AIPerService::adjust_concurrent_connections(increment);
llinfos << "CurlConcurrentConnectionsPerService set to " << CurlConcurrentConnectionsPerService << llendl;
}
return true;
}
@@ -2581,7 +2628,7 @@ U32 getNumHTTPCommands(void)
U32 getNumHTTPQueued(void)
{
return AIPerService::total_queued_size();
return AIPerService::total_approved_queue_size();
}
U32 getNumHTTPAdded(void)
@@ -2589,6 +2636,11 @@ U32 getNumHTTPAdded(void)
return AICurlPrivate::curlthread::MultiHandle::total_added_size();
}
U32 getMaxHTTPAdded(void)
{
return AICurlPrivate::curlthread::curl_max_total_concurrent_connections;
}
size_t getHTTPBandwidth(void)
{
using namespace AICurlPrivate;
@@ -2605,29 +2657,69 @@ AIThreadSafeSimpleDC<AIPerService::ThrottleFraction> AIPerService::sThrottleFrac
LLAtomicU32 AIPerService::sHTTPThrottleBandwidth125(250000);
bool AIPerService::sNoHTTPBandwidthThrottling;
// Return true if we want at least one more HTTP request for this host.
// Return Approvement if we want at least one more HTTP request for this service.
//
// It's OK if this function is a bit fuzzy, but we don't want it to return
// true a hundred times on a row when it is called fast in a loop.
// approvement a hundred times on a row when it is called in a tight loop.
// Hence the following consideration:
//
// This function is called only from LLTextureFetchWorker::doWork, and when it returns true
// then doWork will call LLHTTPClient::request with a NULL default engine (signaling that
// it is OK to run in any thread).
//
// At the end, LLHTTPClient::request calls AIStateMachine::run, which in turn calls
// AIStateMachine::reset at the end. Because NULL is passed as default_engine, reset will
// call AIStateMachine::multiplex to immediately start running the state machine. This
// causes it to go through the states bs_reset, bs_initialize and then bs_multiplex with
// run state AICurlEasyRequestStateMachine_addRequest. Finally, in this state, multiplex
// calls AICurlEasyRequestStateMachine::multiplex_impl which then calls AICurlEasyRequest::addRequest
// which causes an increment of command_queue_w->size and AIPerService::mQueuedCommands.
// If this function returns non-NULL, a Approvement object was created and
// the corresponding AIPerService::CapabilityType::mApprovedRequests was
// incremented. The Approvement object is passed to LLHTTPClient::request,
// and once the request is added to the command queue, used to update the counters.
//
// It is therefore guaranteed that in one loop of LLTextureFetchWorker::doWork,
// this size is incremented; stopping this function from returning true once we reached the
// threshold of "pipelines" requests (the sum of requests in the command queue, the ones
// throttled and queued in AIPerService::mQueuedRequests and the already
// running requests (in MultiHandle::mAddedEasyRequests)).
// or LLInventoryModelBackgroundFetch::bulkFetch (the two functions currently
// calling this function) this function will stop returning aprovement once we
// reached the threshold of "pipelined" requests (the sum of approved requests,
// requests in the command queue, the ones throttled and queued in
// AIPerService::mQueuedRequests and the already running requests
// (in MultiHandle::mAddedEasyRequests)).
//
// A request has two types of reasons why it can be throttled:
// 1) The number of connections.
// 2) Bandwidth usage.
// And three levels where each can occur:
// a) Global
// b) Service
// c) Capability Type (CT)
// Currently, not all of those are in use. The ones that are used are:
//
// | Global | Service | CT
// +--------+---------+--------
// 1) The number of connections | X | X | X
// 2) Bandwidth usage | X | |
//
// Pre-approved requests have the bandwidth tested here, and the
// connections tested in the curl thread, right before they are
// added to the multi handle.
//
// The "pipeline" is as follows:
//
// <approvement> // If the number of requests in the pipeline is less than a threshold
// | // and the global bandwidth usage is not too large.
// V
// <command queue>
// |
// V
// <CT queue>
// |
// V
// <added to multi handle> // If the number of connections at all three levels allow it.
// |
// V
// <removed from multi handle>
//
// Every time this function is called, but not more often than once every 40 ms, the state
// of the CT queue is checked to be starvation, empty or full. If it is starvation
// then the threshold for allowed number of connections is incremented by one,
// if it is empty then nother is done and when it is full then the threshold is
// decremented by one.
//
// Starvation means that we could add a request from the queue to the multi handle,
// but the queue was empty. Empty means that after adding one or more requests to the
// multi handle the queue became empty, and full means that after adding one of more
// requests to the multi handle the queue still wasn't empty (see AIPerService::add_queued_to).
//
//static
AIPerService::Approvement* AIPerService::approveHTTPRequestFor(AIPerServicePtr const& per_service, AICapabilityType capability_type)
@@ -2640,13 +2732,13 @@ AIPerService::Approvement* AIPerService::approveHTTPRequestFor(AIPerServicePtr c
// Cache all sTotalQueued info.
bool starvation, decrement_threshold;
S32 total_queued_or_added = MultiHandle::total_added_size();
S32 total_approved_queuedapproved_or_added = MultiHandle::total_added_size();
{
TotalQueued_wat total_queued_w(sTotalQueued);
total_queued_or_added += total_queued_w->count;
total_approved_queuedapproved_or_added += total_queued_w->approved;
starvation = total_queued_w->starvation;
decrement_threshold = total_queued_w->full && !total_queued_w->empty;
total_queued_w->empty = total_queued_w->full = false; // Reset flags.
total_queued_w->starvation = total_queued_w->empty = total_queued_w->full = false; // Reset flags.
}
// Whether or not we're going to approve a new request, decrement the global threshold first, when appropriate.
@@ -2654,13 +2746,13 @@ AIPerService::Approvement* AIPerService::approveHTTPRequestFor(AIPerServicePtr c
if (decrement_threshold)
{
MaxPipelinedRequests_wat max_pipelined_requests_w(sMaxPipelinedRequests);
if (max_pipelined_requests_w->count > (S32)curl_max_total_concurrent_connections &&
if (max_pipelined_requests_w->threshold > (S32)curl_max_total_concurrent_connections &&
sTime_40ms > max_pipelined_requests_w->last_decrement)
{
// Decrement the threshold because since the last call to this function at least one curl request finished
// and was replaced with another request from the queue, but the queue never ran empty: we have too many
// queued requests.
max_pipelined_requests_w->count--;
max_pipelined_requests_w->threshold--;
// Do this at most once every 40 ms.
max_pipelined_requests_w->last_decrement = sTime_40ms;
}
@@ -2670,7 +2762,7 @@ AIPerService::Approvement* AIPerService::approveHTTPRequestFor(AIPerServicePtr c
bool reject, equal, increment_threshold;
{
PerService_wat per_service_w(*per_service);
PerService_wat per_service_w(*per_service); // Keep this lock for the duration of accesses to ct.
CapabilityType& ct(per_service_w->mCapabilityType[capability_type]);
S32 const pipelined_requests_per_capability_type = ct.pipelined_requests();
reject = pipelined_requests_per_capability_type >= (S32)ct.mMaxPipelinedRequests;
@@ -2680,14 +2772,14 @@ AIPerService::Approvement* AIPerService::approveHTTPRequestFor(AIPerServicePtr c
ct.mFlags = 0;
if (decrement_threshold)
{
if ((int)ct.mMaxPipelinedRequests > per_service_w->mConcurrectConnections)
if ((int)ct.mMaxPipelinedRequests > ct.mConcurrentConnections)
{
ct.mMaxPipelinedRequests--;
}
}
else if (increment_threshold && reject)
{
if ((int)ct.mMaxPipelinedRequests < 2 * per_service_w->mConcurrectConnections)
if ((int)ct.mMaxPipelinedRequests < 2 * ct.mConcurrentConnections)
{
ct.mMaxPipelinedRequests++;
// Immediately take the new threshold into account.
@@ -2699,7 +2791,9 @@ AIPerService::Approvement* AIPerService::approveHTTPRequestFor(AIPerServicePtr c
// Before releasing the lock on per_service, stop other threads from getting a
// too small value from pipelined_requests() and approving too many requests.
ct.mApprovedRequests++;
per_service_w->mApprovedRequests++;
}
total_approved_queuedapproved_or_added += per_service_w->mApprovedRequests;
}
if (reject)
{
@@ -2711,13 +2805,15 @@ AIPerService::Approvement* AIPerService::approveHTTPRequestFor(AIPerServicePtr c
if (checkBandwidthUsage(per_service, sTime_40ms))
{
// Too much bandwidth is being used, either in total or for this service.
PerService_wat(*per_service)->mCapabilityType[capability_type].mApprovedRequests--; // Not approved after all.
PerService_wat per_service_w(*per_service);
per_service_w->mCapabilityType[capability_type].mApprovedRequests--; // Not approved after all.
per_service_w->mApprovedRequests--;
return NULL;
}
// Check if it's ok to get a new request based on the total number of requests and increment the threshold if appropriate.
S32 const pipelined_requests = command_queue_rat(command_queue)->size + total_queued_or_added;
S32 const pipelined_requests = command_queue_rat(command_queue)->size + total_approved_queuedapproved_or_added;
// We can't take the command being processed (command_being_processed) into account without
// introducing relatively long waiting times for some mutex (namely between when the command
// is moved from command_queue to command_being_processed, till it's actually being added to
@@ -2726,18 +2822,19 @@ AIPerService::Approvement* AIPerService::approveHTTPRequestFor(AIPerServicePtr c
// here instead.
// The maximum number of requests that may be queued in command_queue is equal to the total number of requests
// that may exist in the pipeline minus the number of requests queued in AIPerService objects, minus
// the number of already running requests.
// that may exist in the pipeline minus the number approved requests not yet added to the command queue, minus the
// number of requests queued in AIPerService objects, minus the number of already running requests
// (excluding non-approved requests queued in their CT queue).
MaxPipelinedRequests_wat max_pipelined_requests_w(sMaxPipelinedRequests);
reject = pipelined_requests >= max_pipelined_requests_w->count;
equal = pipelined_requests == max_pipelined_requests_w->count;
reject = pipelined_requests >= max_pipelined_requests_w->threshold;
equal = pipelined_requests == max_pipelined_requests_w->threshold;
increment_threshold = starvation;
if (increment_threshold && reject)
{
if (max_pipelined_requests_w->count < 2 * (S32)curl_max_total_concurrent_connections &&
if (max_pipelined_requests_w->threshold < 2 * (S32)curl_max_total_concurrent_connections &&
sTime_40ms > max_pipelined_requests_w->last_increment)
{
max_pipelined_requests_w->count++;
max_pipelined_requests_w->threshold++;
max_pipelined_requests_w->last_increment = sTime_40ms;
// Immediately take the new threshold into account.
reject = !equal;
@@ -2745,7 +2842,9 @@ AIPerService::Approvement* AIPerService::approveHTTPRequestFor(AIPerServicePtr c
}
if (reject)
{
PerService_wat(*per_service)->mCapabilityType[capability_type].mApprovedRequests--; // Not approved after all.
PerService_wat per_service_w(*per_service);
per_service_w->mCapabilityType[capability_type].mApprovedRequests--; // Not approved after all.
per_service_w->mApprovedRequests--;
return NULL;
}
return new Approvement(per_service, capability_type);

View File

@@ -39,6 +39,8 @@
namespace AICurlPrivate {
namespace curlthread {
extern U32 curl_max_total_concurrent_connections;
class PollSet;
// For ordering a std::set with AICurlEasyRequest objects.
@@ -100,6 +102,9 @@ class MultiHandle : public CurlMultiHandle
// Return the total number of added curl requests.
static U32 total_added_size(void) { return sTotalAdded; }
// Return true if we reached the global maximum number of connections.
static bool added_maximum(void) { return sTotalAdded >= curl_max_total_concurrent_connections; }
public:
//-----------------------------------------------------------------------------
// Curl socket administration:

View File

@@ -157,7 +157,10 @@ void HTTPTimeout::upload_starting(void)
// |
void HTTPTimeout::upload_finished(void)
{
// Disable this assert when there isn't enough debug output to do anything with it.
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
llassert(!mUploadFinished); // If we get here twice, then the 'upload finished' detection failed.
#endif
mUploadFinished = true;
// Only accept a call to upload_starting() if being_redirected() is called after this point.
mBeingRedirected = false;

View File

@@ -925,9 +925,7 @@ P(meshLODResponder);
P(meshPhysicsShapeResponder);
P(meshSkinInfoResponder);
P(mimeDiscoveryResponder);
P(moderationModeResponder);
P(muteTextResponder);
P(muteVoiceResponder);
P(moderationResponder);
P(navMeshRebakeResponder);
P(navMeshResponder);
P(navMeshStatusResponder);
@@ -955,9 +953,9 @@ P(viewerChatterBoxInvitationAcceptResponder);
P(viewerMediaOpenIDResponder);
P(viewerMediaWebProfileResponder);
P(viewerStatsResponder);
P(viewerVoiceAccountProvisionResponder);
P(vivoxVoiceAccountProvisionResponder);
P(vivoxVoiceClientCapResponder);
P(voiceCallCapResponder);
P(voiceClientCapResponder);
P(webProfileResponders);
P(wholeModelFeeResponder);
P(wholeModelUploadResponder);

View File

@@ -37,13 +37,11 @@
#pragma warning (disable : 4263)
#pragma warning (disable : 4264)
#endif
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
#include "dae.h"
#include "dae/daeErrorHandler.h"
#include "dom/domConstants.h"
#include "dom/domMesh.h"
#pragma GCC diagnostic pop
#if LL_MSVC
#pragma warning (pop)
#endif

View File

@@ -208,7 +208,6 @@ protected:
LLColor4 mListColor;
private:
S32 mButtonPadding;
BOOL mAllowTextEntry;
S32 mMaxChars;
BOOL mTextEntryTentative;

View File

@@ -51,6 +51,7 @@ LLContainerView::LLContainerView(const LLContainerView::Params& p)
{
mCollapsible = TRUE;
mScrollContainer = NULL;
mRectAlpha = 0.25;
}
LLContainerView::~LLContainerView()
@@ -100,7 +101,7 @@ void LLContainerView::draw()
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4(0.f, 0.f, 0.f, 0.25f));
gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4(0.f, 0.f, 0.f, mRectAlpha));
}
// Draw the label

View File

@@ -75,17 +75,17 @@ public:
void setDisplayChildren(const BOOL displayChildren);
BOOL getDisplayChildren() { return mDisplayChildren; }
void setScrollContainer(LLScrollContainer* scroll);
void setRectAlpha(F32 alpha) { mRectAlpha = alpha; }
private:
LLScrollContainer* mScrollContainer;
void arrange(S32 width, S32 height, BOOL called_from_parent = TRUE);
BOOL mShowLabel;
F32 mRectAlpha;
protected:
BOOL mDisplayChildren;
std::string mLabel;
public:
BOOL mCollapsible;
};
#endif // LL_CONTAINERVIEW_

View File

@@ -1075,7 +1075,8 @@ void LLFloater::setForeground(BOOL front)
releaseFocus();
}
setBackgroundOpaque( front );
if (front || !LLUI::sConfigGroup->getBOOL("FloaterUnfocusedBackgroundOpaque")) // Singu Note: This can be removed when InactiveFloaterTransparency is added
setBackgroundOpaque( front );
}
}

View File

@@ -367,7 +367,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
return;
}
S32 text_len = wtext.size() + 1;
S32 text_len = wtext.size();
seg_list->push_back( new LLTextSegment( LLColor3(defaultColor), 0, text_len ) );
@@ -584,6 +584,7 @@ void LLKeywords::insertSegment(std::vector<LLTextSegmentPtr>& seg_list, LLTextSe
{
LLTextSegmentPtr last = seg_list.back();
S32 new_seg_end = new_segment->getEnd();
llassert(new_seg_end <= text_len);
if( new_segment->getStart() == last->getStart() )
{

View File

@@ -3750,9 +3750,9 @@ void LLPieMenu::draw()
F32 center_y = height/2;
S32 steps = 100;
gGL.pushMatrix();
gGL.pushUIMatrix();
{
gGL.translatef(center_x, center_y, 0.f);
gGL.translateUI(center_x, center_y, 0.f);
F32 line_width = LLUI::sConfigGroup->getF32("PieMenuLineWidth");
LLColor4 line_color = LLUI::sColorsGroup->getColor("PieMenuLineColor");
@@ -3800,7 +3800,7 @@ void LLPieMenu::draw()
LLUI::setLineWidth(1.0f);
}
gGL.popMatrix();
gGL.popUIMatrix();
mHoverThisFrame = FALSE;
@@ -3816,9 +3816,9 @@ void LLPieMenu::drawBackground(LLMenuItemGL* itemp, LLColor4& color)
S32 steps = 100;
gGL.color4fv( color.mV );
gGL.pushMatrix();
gGL.pushUIMatrix();
{
gGL.translatef(center_x - itemp->getRect().mLeft, center_y - itemp->getRect().mBottom, 0.f);
gGL.translateUI(center_x - itemp->getRect().mLeft, center_y - itemp->getRect().mBottom, 0.f);
item_list_t::iterator item_iter;
S32 i = 0;
@@ -3838,7 +3838,7 @@ void LLPieMenu::drawBackground(LLMenuItemGL* itemp, LLColor4& color)
i++;
}
}
gGL.popMatrix();
gGL.popUIMatrix();
}
// virtual

View File

@@ -291,9 +291,8 @@ void LLMultiSliderCtrl::onEditorCommit(const LLSD& value)
val = (F32) atof( text.c_str() );
if( mMultiSlider->getMinValue() <= val && val <= mMultiSlider->getMaxValue() )
{
setCurSliderValue( val );
if( (!mValidateCallback || mValidateCallback( this, mCallbackUserData )) &&
(!mValidateSignal || (*(mValidateSignal))(this, val)))
setCurSliderValue( val ); // set the value temporarily so that the callback can retrieve it.
if( !mValidateSignal || (*(mValidateSignal))( this, val ) )
{
success = TRUE;
}
@@ -322,8 +321,7 @@ void LLMultiSliderCtrl::onSliderCommit(const LLSD& value)
F32 new_val = mMultiSlider->getCurSliderValue();
mCurValue = new_val; // set the value temporarily so that the callback can retrieve it.
if( (!mValidateCallback || mValidateCallback( this, mCallbackUserData )) &&
(!mValidateSignal || (*mValidateSignal)(this, new_val ) ))
if( !mValidateSignal || (*(mValidateSignal))( this, new_val ) )
{
success = TRUE;
}

View File

@@ -773,34 +773,28 @@ BOOL LLPanel::childHasFocus(const std::string& id)
}
}
void LLPanel::childSetCommitCallback(const std::string& id, void (*cb)(LLUICtrl*, void*), void *userdata )
// *TODO: Deprecate; for backwards compatability only:
// Prefer getChild<LLUICtrl>("foo")->setCommitCallback(boost:bind(...)),
// which takes a generic slot. Or use mCommitCallbackRegistrar.add() with
// a named callback and reference it in XML.
void LLPanel::childSetCommitCallback(const std::string& id, boost::function<void (LLUICtrl*,void*)> cb, void* data)
{
LLUICtrl* child = getChild<LLUICtrl>(id, true);
LLUICtrl* child = findChild<LLUICtrl>(id);
if (child)
{
child->setCommitCallback(cb);
child->setCallbackUserData(userdata);
child->setCommitCallback(boost::bind(cb, child, data));
}
}
void LLPanel::childSetValidate(const std::string& id, BOOL (*cb)(LLUICtrl*, void*))
void LLPanel::childSetValidate(const std::string& id, boost::function<bool (const LLSD& data)> cb)
{
LLUICtrl* child = getChild<LLUICtrl>(id, true);
LLUICtrl* child = findChild<LLUICtrl>(id);
if (child)
{
child->setValidateBeforeCommit(cb);
}
}
void LLPanel::childSetUserData(const std::string& id, void* userdata)
{
LLUICtrl* child = getChild<LLUICtrl>(id, true);
if (child)
{
child->setCallbackUserData(userdata);
}
}
void LLPanel::childSetColor(const std::string& id, const LLColor4& color)
{
LLUICtrl* child = getChild<LLUICtrl>(id, true);

View File

@@ -172,9 +172,13 @@ public:
void childSetFocus(const std::string& id, BOOL focus = TRUE);
BOOL childHasFocus(const std::string& id);
void childSetCommitCallback(const std::string& id, void (*cb)(LLUICtrl*, void*), void* userdata = NULL );
void childSetValidate(const std::string& id, BOOL (*cb)(LLUICtrl*, void*) );
void childSetUserData(const std::string& id, void* userdata);
// *TODO: Deprecate; for backwards compatability only:
// Prefer getChild<LLUICtrl>("foo")->setCommitCallback(boost:bind(...)),
// which takes a generic slot. Or use mCommitCallbackRegistrar.add() with
// a named callback and reference it in XML.
void childSetCommitCallback(const std::string& id, boost::function<void (LLUICtrl*,void*)> cb, void* data = NULL);
void childSetValidate(const std::string& id, boost::function<bool (const LLSD& data)> cb );
void childSetColor(const std::string& id, const LLColor4& color);
void childSetAlpha(const std::string& id, F32 alpha);

View File

@@ -3866,16 +3866,14 @@ LLScrollColumnHeader::LLScrollColumnHeader(const std::string& label, const LLRec
mHasResizableElement(FALSE)
{
mListPosition = LLComboBox::ABOVE;
setCommitCallback(onSelectSort);
setCallbackUserData(this);
setCommitCallback(boost::bind(&LLScrollColumnHeader::onSelectSort, this));
mButton->setTabStop(FALSE);
// require at least two frames between mouse down and mouse up event to capture intentional "hold" not just bad framerate
mButton->setHeldDownDelay(LLUI::sConfigGroup->getF32("ColumnHeaderDropDownDelay"), 2);
mButton->setHeldDownCallback(boost::bind(&LLScrollColumnHeader::onHeldDown, this));
mButton->setHeldDownCallback(boost::bind(&LLScrollColumnHeader::showList, this));
mButton->setClickedCallback(boost::bind(&LLScrollColumnHeader::onClick, this));
mButton->setMouseDownCallback(boost::bind(&LLScrollColumnHeader::onMouseDown, this));
mButton->setCallbackUserData(this);
mButton->setToolTip(label);
mAscendingText = std::string("[LOW]...[HIGH](Ascending)"); // *TODO: Translate
@@ -4034,7 +4032,7 @@ BOOL LLScrollColumnHeader::handleDoubleClick(S32 x, S32 y, MASK mask)
}
else
{
onClick(this);
onClick();
}
return TRUE;
}
@@ -4062,42 +4060,29 @@ void LLScrollColumnHeader::setImageOverlay(const std::string &image_name, LLFont
}
}
//static
void LLScrollColumnHeader::onClick(void* user_data)
void LLScrollColumnHeader::onClick()
{
LLScrollColumnHeader* headerp = (LLScrollColumnHeader*)user_data;
if (!headerp) return;
if (!mColumn) return;
LLScrollListColumn* column = headerp->mColumn;
if (!column) return;
if (headerp->mList->getVisible())
if (mList->getVisible())
{
headerp->hideList();
hideList();
}
LLScrollListCtrl::onClickColumn(column);
LLScrollListCtrl::onClickColumn(mColumn);
// propagate new sort order to sort order list
headerp->mList->selectNthItem(column->mParentCtrl->getSortAscending() ? 0 : 1);
mList->selectNthItem(mColumn->mParentCtrl->getSortAscending() ? 0 : 1);
headerp->mList->setFocus(TRUE);
mList->setFocus(TRUE);
}
//static
void LLScrollColumnHeader::onMouseDown(void* user_data)
void LLScrollColumnHeader::onMouseDown()
{
// for now, do nothing but block the normal showList() behavior
return;
}
//static
void LLScrollColumnHeader::onHeldDown(void* user_data)
{
LLScrollColumnHeader* headerp = (LLScrollColumnHeader*)user_data;
headerp->showList();
}
void LLScrollColumnHeader::showList()
{
if (mShowSortOptions)
@@ -4180,30 +4165,25 @@ void LLScrollColumnHeader::showList()
}
}
//static
void LLScrollColumnHeader::onSelectSort(LLUICtrl* ctrl, void* user_data)
void LLScrollColumnHeader::onSelectSort()
{
LLScrollColumnHeader* headerp = (LLScrollColumnHeader*)user_data;
if (!headerp) return;
LLScrollListColumn* column = headerp->mColumn;
if (!column) return;
LLScrollListCtrl *parent = column->mParentCtrl;
if (!mColumn) return;
LLScrollListCtrl* parent = mColumn->mParentCtrl;
if (!parent) return;
if (headerp->getCurrentIndex() == 0)
if (getCurrentIndex() == 0)
{
// ascending
parent->sortByColumn(column->mSortingColumn, TRUE);
parent->sortByColumn(mColumn->mSortingColumn, TRUE);
}
else
{
// descending
parent->sortByColumn(column->mSortingColumn, FALSE);
parent->sortByColumn(mColumn->mSortingColumn, FALSE);
}
// restore original column header
headerp->setLabel(headerp->mOrigLabel);
setLabel(mOrigLabel);
}
LLView* LLScrollColumnHeader::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding)

View File

@@ -241,10 +241,9 @@ public:
void enableResizeBar(BOOL enable);
std::string getLabel() { return mOrigLabel; }
static void onSelectSort(LLUICtrl* ctrl, void* user_data);
static void onClick(void* user_data);
static void onMouseDown(void* user_data);
static void onHeldDown(void* user_data);
void onSelectSort();
void onClick();
void onMouseDown();
private:
LLScrollListColumn* mColumn;

View File

@@ -227,9 +227,8 @@ void LLSliderCtrl::onEditorCommit( LLUICtrl* ctrl, const LLSD& userdata )
val = (F32) atof( text.c_str() );
if( self->mSlider->getMinValue() <= val && val <= self->mSlider->getMaxValue() )
{
self->setValue( val );
if( (!self->mValidateCallback || self->mValidateCallback( self, self->mCallbackUserData )) &&
(!self->mValidateSignal || (*(self->mValidateSignal))( self, val )))
self->setValue( val ); // set the value temporarily so that the callback can retrieve it.
if( !self->mValidateSignal || (*(self->mValidateSignal))( self, val ) )
{
success = TRUE;
}
@@ -263,8 +262,7 @@ void LLSliderCtrl::onSliderCommit( LLUICtrl* ctrl, const LLSD& userdata )
F32 new_val = self->mSlider->getValueF32();
self->mValue = new_val; // set the value temporarily so that the callback can retrieve it.
if( (!self->mValidateCallback || self->mValidateCallback( self, self->mCallbackUserData )) &&
(!self->mValidateSignal || (*(self->mValidateSignal))( self, new_val )))
if( !self->mValidateSignal || (*(self->mValidateSignal))( self, new_val ) )
{
success = TRUE;
}

View File

@@ -198,8 +198,7 @@ void LLSpinCtrl::onUpBtn( const LLSD& data )
F32 saved_val = (F32)getValue().asReal();
setValue(val);
if( (mValidateCallback && !mValidateCallback( this, mCallbackUserData ) ) ||
(mValidateSignal && !(*mValidateSignal)( this, val ) ))
if( mValidateSignal && !(*mValidateSignal)( this, val ) )
{
setValue( saved_val );
reportInvalidData();
@@ -227,8 +226,7 @@ void LLSpinCtrl::onDownBtn( const LLSD& data )
F32 saved_val = (F32)getValue().asReal();
setValue(val);
if( (mValidateCallback && !mValidateCallback( this, mCallbackUserData ) ) ||
(mValidateSignal && !(*mValidateSignal)( this, val ) ))
if( mValidateSignal && !(*mValidateSignal)( this, val ) )
{
setValue( saved_val );
reportInvalidData();
@@ -317,9 +315,7 @@ void LLSpinCtrl::onEditorCommit( const LLSD& data )
F32 saved_val = mValue;
mValue = val;
if( (!mValidateCallback || mValidateCallback( this, mCallbackUserData )) &&
(!mValidateSignal || (*mValidateSignal)(this, val) ))
if( !mValidateSignal || (*mValidateSignal)( this, val ) )
{
success = TRUE;
onCommit();

View File

@@ -140,7 +140,6 @@ private:
std::vector<S32> mLineLengthList;
callback_t mClickedCallback;
void* mCallbackUserData;
};
#endif

View File

@@ -45,9 +45,6 @@ LLUICtrl::LLUICtrl() :
mViewModel(LLViewModelPtr(new LLViewModel)),
mCommitSignal(NULL),
mValidateSignal(NULL),
mCommitCallback(NULL),
mValidateCallback(NULL),
mCallbackUserData(NULL),
mMouseEnterSignal(NULL),
mMouseLeaveSignal(NULL),
mTentative(FALSE),
@@ -64,10 +61,7 @@ LLUICtrl::LLUICtrl(const std::string& name, const LLRect rect, BOOL mouse_opaque
LLView( name, rect, mouse_opaque, reshape ),
mCommitSignal(NULL),
mValidateSignal(NULL),
mCommitCallback(NULL),
mViewModel(LLViewModelPtr(new LLViewModel)),
mValidateCallback( NULL ),
mCallbackUserData( NULL ),
mMouseEnterSignal(NULL),
mMouseLeaveSignal(NULL),
mTentative( FALSE ),
@@ -113,10 +107,6 @@ void LLUICtrl::onMouseLeave(S32 x, S32 y, MASK mask)
void LLUICtrl::onCommit()
{
if( mCommitCallback )
{
mCommitCallback( this, mCallbackUserData );
}
if (mCommitSignal)
(*mCommitSignal)(this, getValue());
}
@@ -641,4 +631,4 @@ boost::signals2::connection LLUICtrl::setMouseLeaveCallback( const commit_signal
{
if (!mMouseLeaveSignal) mMouseLeaveSignal = new commit_signal_t();
return mMouseLeaveSignal->connect(cb);
}
}

View File

@@ -52,9 +52,6 @@ public:
typedef boost::function<bool (LLUICtrl* ctrl, const LLSD& param)> enable_callback_t;
typedef boost::signals2::signal<bool (LLUICtrl* ctrl, const LLSD& param), boost_boolean_combiner> enable_signal_t;
typedef void (*LLUICtrlCallback)(LLUICtrl* ctrl, void* userdata);
typedef BOOL (*LLUICtrlValidate)(LLUICtrl* ctrl, void* userdata);
LLUICtrl();
LLUICtrl( const std::string& name, const LLRect rect = LLRect(), BOOL mouse_opaque = TRUE,
commit_callback_t commit_callback = NULL,
@@ -133,13 +130,6 @@ public:
boost::signals2::connection setMouseEnterCallback( const commit_signal_t::slot_type& cb );
boost::signals2::connection setMouseLeaveCallback( const commit_signal_t::slot_type& cb );
// *TODO: Deprecate; for backwards compatability only:
//Keeping userdata around with legacy setCommitCallback because it's used ALL OVER THE PLACE.
void* getCallbackUserData() const { return mCallbackUserData; }
void setCallbackUserData( void* data ) { mCallbackUserData = data; }
void setCommitCallback( void (*cb)(LLUICtrl*, void*) ) { mCommitCallback = cb; }
void setValidateBeforeCommit( BOOL(*cb)(LLUICtrl*, void*) ) { mValidateCallback = cb; }
// *TODO: Deprecate; for backwards compatability only:
boost::signals2::connection setCommitCallback( boost::function<void (LLUICtrl*,void*)> cb, void* data);
boost::signals2::connection setValidateBeforeCommit( boost::function<bool (const LLSD& data)> cb );
@@ -171,10 +161,6 @@ protected:
commit_signal_t* mMouseLeaveSignal;
LLViewModelPtr mViewModel;
void (*mCommitCallback)( LLUICtrl* ctrl, void* userdata );
BOOL (*mValidateCallback)( LLUICtrl* ctrl, void* userdata );
void* mCallbackUserData;
private:

View File

@@ -2105,7 +2105,7 @@ void LLWindowSDL::initCursors()
mSDLCursors[UI_CURSOR_SIZEWE] = makeSDLCursorFromBMP("sizewe.BMP",16,14);
mSDLCursors[UI_CURSOR_SIZENS] = makeSDLCursorFromBMP("sizens.BMP",17,16);
mSDLCursors[UI_CURSOR_NO] = makeSDLCursorFromBMP("llno.BMP",8,8);
mSDLCursors[UI_CURSOR_WORKING] = makeSDLCursorFromBMP("working.BMP",12,15);
mSDLCursors[UI_CURSOR_WORKING] = makeSDLCursorFromBMP("working.BMP",0,0);
mSDLCursors[UI_CURSOR_TOOLGRAB] = makeSDLCursorFromBMP("lltoolgrab.BMP",2,13);
mSDLCursors[UI_CURSOR_TOOLLAND] = makeSDLCursorFromBMP("lltoolland.BMP",1,6);
mSDLCursors[UI_CURSOR_TOOLFOCUS] = makeSDLCursorFromBMP("lltoolfocus.BMP",8,5);

View File

@@ -79,6 +79,7 @@ include_directories(
set(viewer_SOURCE_FILES
NACLantispam.cpp
aihttpview.cpp
aoremotectrl.cpp
ascentfloatercontactgroups.cpp
ascentkeyword.cpp
@@ -91,6 +92,7 @@ set(viewer_SOURCE_FILES
floatervoicelicense.cpp
generichandlers.cpp
hbfloatergrouptitles.cpp
groupchatlistener.cpp
hippofloaterxml.cpp
hippogridmanager.cpp
hippolimits.cpp
@@ -113,11 +115,11 @@ set(viewer_SOURCE_FILES
llanimstatelabels.cpp
llappearancemgr.cpp
llappviewer.cpp
llassetconverter.cpp
llassetuploadqueue.cpp
llassetuploadresponders.cpp
llattachmentsmgr.cpp
llaudiosourcevo.cpp
llavataractions.cpp
llavatarpropertiesprocessor.cpp
llbox.cpp
llcallbacklist.cpp
@@ -169,7 +171,6 @@ set(viewer_SOURCE_FILES
llflexibleobject.cpp
llfloaterabout.cpp
llfloateractivespeakers.cpp
llfloateranimpreview.cpp
llfloaterauction.cpp
llfloateravatarinfo.cpp
llfloateravatarlist.cpp
@@ -258,7 +259,7 @@ set(viewer_SOURCE_FILES
llfloatertos.cpp
llfloaterurldisplay.cpp
llfloaterurlentry.cpp
llfloatervoicedevicesettings.cpp
llfloatervoiceeffect.cpp
llfloaterwater.cpp
llfloaterwebcontent.cpp
llfloaterwhitelistentry.cpp
@@ -273,6 +274,7 @@ set(viewer_SOURCE_FILES
llgiveinventory.cpp
llgivemoney.cpp
llglsandbox.cpp
llgroupactions.cpp
llgroupmgr.cpp
llgroupnotify.cpp
llhomelocationresponder.cpp
@@ -303,7 +305,6 @@ set(viewer_SOURCE_FILES
llinventorypanel.cpp
lljoystickbutton.cpp
lllandmarklist.cpp
lllocalinventory.cpp
lllogchat.cpp
llloginhandler.cpp
llmainlooprepeater.cpp
@@ -382,9 +383,12 @@ set(viewer_SOURCE_FILES
llpanelprimmediacontrols.cpp
llpanelprofile.cpp
llpanelskins.cpp
llpanelvoicedevicesettings.cpp
llpanelvoiceeffect.cpp
llpanelvolume.cpp
llpanelweb.cpp
llparcelselection.cpp
llparticipantlist.cpp
llpatchvertexarray.cpp
llpathfindingcharacter.cpp
llpathfindingcharacterlist.cpp
@@ -421,6 +425,7 @@ set(viewer_SOURCE_FILES
llsky.cpp
llslurl.cpp
llspatialpartition.cpp
llspeakers.cpp
llsprite.cpp
llstartup.cpp
llstatusbar.cpp
@@ -521,9 +526,12 @@ set(viewer_SOURCE_FILES
llvoclouds.cpp
llvograss.cpp
llvoground.cpp
llvoicecallhandler.cpp
llvoicechannel.cpp
llvoiceclient.cpp
llvoiceremotectrl.cpp
llvoicevisualizer.cpp
llvoicevivox.cpp
llvoinventorylistener.cpp
llvopartgroup.cpp
llvosky.cpp
@@ -580,6 +588,7 @@ set(viewer_HEADER_FILES
ViewerInstall.cmake
NACLantispam.h
aihttpview.h
aoremotectrl.h
ascentfloatercontactgroups.h
ascentkeyword.h
@@ -591,6 +600,7 @@ set(viewer_HEADER_FILES
floaterlocalassetbrowse.h
floatervoicelicense.h
generichandlers.h
groupchatlistener.h
hbfloatergrouptitles.h
hippofloaterxml.h
hippogridmanager.h
@@ -615,11 +625,11 @@ set(viewer_HEADER_FILES
llappearance.h
llappearancemgr.h
llappviewer.h
llassetconverter.h
llassetuploadqueue.h
llassetuploadresponders.h
llattachmentsmgr.h
llaudiosourcevo.h
llavataractions.h
llavatarpropertiesprocessor.h
llbox.h
llcallbacklist.h
@@ -671,7 +681,6 @@ set(viewer_HEADER_FILES
llflexibleobject.h
llfloaterabout.h
llfloateractivespeakers.h
llfloateranimpreview.h
llfloaterauction.h
llfloateravatarinfo.h
llfloateravatarlist.h
@@ -760,7 +769,7 @@ set(viewer_HEADER_FILES
llfloatertos.h
llfloaterurldisplay.h
llfloaterurlentry.h
llfloatervoicedevicesettings.h
llfloatervoiceeffect.h
llfloaterwater.h
llfloaterwebcontent.h
llfloaterwhitelistentry.h
@@ -775,6 +784,7 @@ set(viewer_HEADER_FILES
llgesturemgr.h
llgiveinventory.h
llgivemoney.h
llgroupactions.h
llgroupmgr.h
llgroupnotify.h
llhomelocationresponder.h
@@ -805,7 +815,6 @@ set(viewer_HEADER_FILES
lljoystickbutton.h
lllandmarklist.h
lllightconstants.h
lllocalinventory.h
lllogchat.h
llloginhandler.h
llmainlooprepeater.h
@@ -884,9 +893,12 @@ set(viewer_HEADER_FILES
llpanelprimmediacontrols.h
llpanelprofile.h
llpanelskins.h
llpanelvoicedevicesettings.h
llpanelvoiceeffect.h
llpanelvolume.h
llpanelweb.h
llparcelselection.h
llparticipantlist.h
llpatchvertexarray.h
llpathfindingcharacter.h
llpathfindingcharacterlist.h
@@ -925,6 +937,7 @@ set(viewer_HEADER_FILES
llsky.h
llslurl.h
llspatialpartition.h
llspeakers.h
llsprite.h
llstartup.h
llstatusbar.h
@@ -1028,9 +1041,11 @@ set(viewer_HEADER_FILES
llvoclouds.h
llvograss.h
llvoground.h
llvoicechannel.h
llvoiceclient.h
llvoiceremotectrl.h
llvoicevisualizer.h
llvoicevivox.h
llvoinventorylistener.h
llvopartgroup.h
llvosky.h
@@ -1064,7 +1079,6 @@ set(viewer_HEADER_FILES
noise.h
pipeline.h
qtoolalign.h
randgauss.h
rlvcommon.h
rlvdefines.h
rlvextensions.h

View File

@@ -0,0 +1,348 @@
/**
* @file aihttpview.cpp
* @brief Definition of class AIHTTPView.
*
* Copyright (c) 2013, Aleric Inglewood.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution.
*
* CHANGELOG
* and additional copyright holders.
*
* 28/05/2013
* Initial version, written by Aleric Inglewood @ SL
*/
#include "llviewerprecompiledheaders.h"
#include "aihttpview.h"
#include "llrect.h"
#include "llerror.h"
#include "aicurlperservice.h"
#include "llviewerstats.h"
#include "llfontgl.h"
#include "aihttptimeout.h"
AIHTTPView* gHttpView = NULL;
static S32 sLineHeight;
// Forward declaration.
namespace AICurlInterface {
size_t getHTTPBandwidth(void);
U32 getNumHTTPAdded(void);
U32 getMaxHTTPAdded(void);
} // namespace AICurlInterface
//=============================================================================
//PerService_crat per_service_r(*service.second);
class AIServiceBar : public LLView
{
private:
AIHTTPView* mHTTPView;
std::string mName;
AIPerServicePtr mPerService;
public:
AIServiceBar(AIHTTPView* httpview, AIPerService::instance_map_type::value_type const& service)
: LLView("aiservice bar", LLRect(), FALSE), mHTTPView(httpview), mName(service.first), mPerService(service.second) { }
/*virtual*/ void draw(void);
/*virtual*/ LLRect getRequiredRect(void);
};
int const mc_col = number_of_capability_types; // Maximum connections column.
int const bw_col = number_of_capability_types + 1; // Bandwidth column.
void AIServiceBar::draw()
{
LLColor4 text_color = LLColor4::white;
F32 height = getRect().getHeight();
U32 start = 4;
LLFontGL::getFontMonospace()->renderUTF8(mName, 0, start, height, text_color, LLFontGL::LEFT, LLFontGL::TOP);
start += LLFontGL::getFontMonospace()->getWidth(mName);
std::string text;
AIPerService::CapabilityType const* cts;
U32 is_used;
U32 is_inuse;
int total_added;
int concurrent_connections;
size_t bandwidth;
{
PerService_rat per_service_r(*mPerService);
is_used = per_service_r->is_used();
is_inuse = per_service_r->is_inuse();
total_added = per_service_r->mTotalAdded;
concurrent_connections = per_service_r->mConcurrentConnections;
bandwidth = per_service_r->bandwidth().truncateData(AIHTTPView::getTime_40ms());
cts = per_service_r->mCapabilityType; // Not thread-safe, but we're only reading from it and only using the results to show in a debug console.
}
for (int col = 0; col < number_of_capability_types; ++col)
{
AICapabilityType capability_type = static_cast<AICapabilityType>(col);
AIPerService::CapabilityType const& ct(cts[capability_type]);
start = mHTTPView->updateColumn(col, start);
U32 mask = AIPerService::CT2mask(capability_type);
if (!(is_used & mask))
{
text = " | ";
}
else if (col < 2)
{
text = llformat(" | %hu-%hu-%lu,{%hu/%hu,%u}/%u", ct.mApprovedRequests, ct.mQueuedCommands, ct.mQueuedRequests.size(), ct.mAdded, ct.mConcurrentConnections, ct.mDownloading, ct.mMaxPipelinedRequests);
}
else
{
text = llformat(" | --%hu-%lu,{%hu/%hu,%u}", ct.mQueuedCommands, ct.mQueuedRequests.size(), ct.mAdded, ct.mConcurrentConnections, ct.mDownloading);
}
LLFontGL::getFontMonospace()->renderUTF8(text, 0, start, height, ((is_inuse & mask) == 0) ? LLColor4::grey2 : text_color, LLFontGL::LEFT, LLFontGL::TOP);
start += LLFontGL::getFontMonospace()->getWidth(text);
}
start = mHTTPView->updateColumn(mc_col, start);
text = llformat(" | %d/%d", total_added, concurrent_connections);
LLFontGL::getFontMonospace()->renderUTF8(text, 0, start, height, text_color, LLFontGL::LEFT, LLFontGL::TOP);
start += LLFontGL::getFontMonospace()->getWidth(text);
start = mHTTPView->updateColumn(bw_col, start);
size_t max_bandwidth = mHTTPView->mMaxBandwidthPerService;
text = " | ";
LLFontGL::getFontMonospace()->renderUTF8(text, 0, start, height, text_color, LLFontGL::LEFT, LLFontGL::TOP);
start += LLFontGL::getFontMonospace()->getWidth(text);
text = llformat("%lu", bandwidth / 125);
if (bandwidth == 0)
{
text_color = LLColor4::grey2;
}
LLColor4 color = (bandwidth > max_bandwidth) ? LLColor4::red : ((bandwidth > max_bandwidth * .75f) ? LLColor4::yellow : text_color);
LLFontGL::getFontMonospace()->renderUTF8(text, 0, start, height, color, LLFontGL::LEFT, LLFontGL::TOP);
start += LLFontGL::getFontMonospace()->getWidth(text);
text = llformat("/%lu", max_bandwidth / 125);
LLFontGL::getFontMonospace()->renderUTF8(text, 0, start, height, text_color, LLFontGL::LEFT, LLFontGL::TOP);
}
LLRect AIServiceBar::getRequiredRect(void)
{
LLRect rect;
rect.mTop = sLineHeight;
return rect;
}
//=============================================================================
static int const number_of_header_lines = 2;
class AIGLHTTPHeaderBar : public LLView
{
public:
AIGLHTTPHeaderBar(std::string const& name, AIHTTPView* httpview) :
LLView(name, FALSE), mHTTPView(httpview)
{
sLineHeight = llround(LLFontGL::getFontMonospace()->getLineHeight());
setRect(LLRect(0, 0, 200, sLineHeight * number_of_header_lines));
}
/*virtual*/ void draw(void);
/*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
/*virtual*/ LLRect getRequiredRect(void);
private:
AIHTTPView* mHTTPView;
};
void AIGLHTTPHeaderBar::draw(void)
{
S32 const v_offset = -1; // Offset from the bottom. Move header one pixel down.
S32 const h_offset = 4;
LLGLSUIDefault gls_ui;
LLColor4 text_color(1.f, 1.f, 1.f, 0.75f);
std::string text;
// First header line.
F32 height = v_offset + sLineHeight * number_of_header_lines;
text = "HTTP console -- [approved]-commandQ-curlQ,{added/max,downloading}[/max]";
LLFontGL::getFontMonospace()->renderUTF8(text, 0, h_offset, height, text_color, LLFontGL::LEFT, LLFontGL::TOP);
text = " | Added/Max";
U32 start = mHTTPView->updateColumn(mc_col, 100);
LLFontGL::getFontMonospace()->renderUTF8(text, 0, start, height, LLColor4::green, LLFontGL::LEFT, LLFontGL::TOP);
start += LLFontGL::getFontMonospace()->getWidth(text);
text = " | Tot/Max BW (kbit/s)";
start = mHTTPView->updateColumn(bw_col, start);
LLFontGL::getFontMonospace()->renderUTF8(text, 0, start, height, LLColor4::green, LLFontGL::LEFT, LLFontGL::TOP);
mHTTPView->setWidth(start + LLFontGL::getFontMonospace()->getWidth(text) + h_offset);
// Second header line.
height -= sLineHeight;
start = h_offset;
text = "Service (host:port)";
static char const* caption[number_of_capability_types] = {
" | Textures", " | Inventory", " | Mesh", " | Other"
};
LLFontGL::getFontMonospace()->renderUTF8(text, 0, start, height, LLColor4::green, LLFontGL::LEFT, LLFontGL::TOP);
start += LLFontGL::getFontMonospace()->getWidth(text);
for (int col = 0; col < number_of_capability_types; ++col)
{
start = mHTTPView->updateColumn(col, start);
text = caption[col];
LLFontGL::getFontMonospace()->renderUTF8(text, 0, start, height, LLColor4::green, LLFontGL::LEFT, LLFontGL::TOP);
start += LLFontGL::getFontMonospace()->getWidth(text);
}
start = mHTTPView->updateColumn(mc_col, start);
text = llformat(" | %u/%u", AICurlInterface::getNumHTTPAdded(), AICurlInterface::getMaxHTTPAdded());
LLFontGL::getFontMonospace()->renderUTF8(text, 0, start, height, text_color, LLFontGL::LEFT, LLFontGL::TOP);
start += LLFontGL::getFontMonospace()->getWidth(text);
// This bandwidth is averaged over 1 seconds (in bytes/s).
size_t const bandwidth = AICurlInterface::getHTTPBandwidth();
size_t const max_bandwidth = AIPerService::getHTTPThrottleBandwidth125();
mHTTPView->mMaxBandwidthPerService = max_bandwidth * AIPerService::throttleFraction();
LLColor4 color = (bandwidth > max_bandwidth) ? LLColor4::red : ((bandwidth > max_bandwidth * .75f) ? LLColor4::yellow : text_color);
color[VALPHA] = text_color[VALPHA];
start = mHTTPView->updateColumn(bw_col, start);
text = " | ";
LLFontGL::getFontMonospace()->renderUTF8(text, 0, start, height, LLColor4::green, LLFontGL::LEFT, LLFontGL::TOP);
start += LLFontGL::getFontMonospace()->getWidth(text);
text = llformat("%lu", bandwidth / 125);
LLFontGL::getFontMonospace()->renderUTF8(text, 0, start, height, color, LLFontGL::LEFT, LLFontGL::TOP);
start += LLFontGL::getFontMonospace()->getWidth(text);
text = llformat("/%lu", max_bandwidth / 125);
LLFontGL::getFontMonospace()->renderUTF8(text, 0, start, height, text_color, LLFontGL::LEFT, LLFontGL::TOP);
}
BOOL AIGLHTTPHeaderBar::handleMouseDown(S32 x, S32 y, MASK mask)
{
return FALSE;
}
LLRect AIGLHTTPHeaderBar::getRequiredRect()
{
LLRect rect;
rect.mTop = sLineHeight * number_of_header_lines;
return rect;
}
//=============================================================================
AIHTTPView::AIHTTPView(AIHTTPView::Params const& p) :
LLContainerView(p), mGLHTTPHeaderBar(NULL), mWidth(200)
{
setVisible(FALSE);
setRectAlpha(0.5);
}
AIHTTPView::~AIHTTPView()
{
delete mGLHTTPHeaderBar;
mGLHTTPHeaderBar = NULL;
}
U32 AIHTTPView::updateColumn(int col, U32 start)
{
llassert(col <= mStartColumn.size());
if (col == mStartColumn.size())
{
mStartColumn.push_back(start);
}
else if (mStartColumn[col] < start)
{
mStartColumn[col] = start;
}
return mStartColumn[col];
}
//static
void AIHTTPView::toggle_visibility(void* user_data)
{
LLView* viewp = (LLView*)user_data;
bool visible = !viewp->getVisible();
if (visible)
{
AIPerService::resetUsed();
}
viewp->setVisible(visible);
}
U64 AIHTTPView::sTime_40ms;
struct KillView
{
void operator()(LLView* viewp)
{
viewp->getParent()->removeChild(viewp);
viewp->die();
}
};
struct CreateServiceBar
{
AIHTTPView* mHTTPView;
CreateServiceBar(AIHTTPView* httpview) : mHTTPView(httpview) { }
void operator()(AIPerService::instance_map_type::value_type const& service)
{
if (!PerService_rat(*service.second)->is_used())
return;
AIServiceBar* service_bar = new AIServiceBar(mHTTPView, service);
mHTTPView->addChild(service_bar);
mHTTPView->mServiceBars.push_back(service_bar);
}
};
void AIHTTPView::draw()
{
for_each(mServiceBars.begin(), mServiceBars.end(), KillView());
mServiceBars.clear();
if (mGLHTTPHeaderBar)
{
removeChild(mGLHTTPHeaderBar);
mGLHTTPHeaderBar->die();
}
CreateServiceBar functor(this);
AIPerService::copy_forEach(functor);
sTime_40ms = get_clock_count() * AICurlPrivate::curlthread::HTTPTimeout::sClockWidth_40ms;
mGLHTTPHeaderBar = new AIGLHTTPHeaderBar("gl httpheader bar", this);
addChild(mGLHTTPHeaderBar);
reshape(mWidth, getRect().getHeight(), TRUE);
for (child_list_const_iter_t child_iter = getChildList()->begin(); child_iter != getChildList()->end(); ++child_iter)
{
LLView* viewp = *child_iter;
if (viewp->getRect().mBottom < 0)
{
viewp->setVisible(FALSE);
}
}
LLContainerView::draw();
}
BOOL AIHTTPView::handleMouseUp(S32 x, S32 y, MASK mask)
{
return FALSE;
}
BOOL AIHTTPView::handleKey(KEY key, MASK mask, BOOL called_from_parent)
{
return FALSE;
}

View File

@@ -0,0 +1,74 @@
/**
* @file aihttpview.h
* @brief Declaration for AIHTTPView.
*
* Copyright (c) 2013, Aleric Inglewood.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution.
*
* CHANGELOG
* and additional copyright holders.
*
* 28/05/2013
* Initial version, written by Aleric Inglewood @ SL
*/
#ifndef AIHTTPVIEW_H
#define AIHTTPVIEW_H
#include "llcontainerview.h"
#include <vector>
class AIGLHTTPHeaderBar;
class AIServiceBar;
struct CreateServiceBar;
class AIHTTPView : public LLContainerView
{
friend class AIGLHTTPHeaderBar;
friend class AIServiceBar;
friend struct CreateServiceBar;
public:
AIHTTPView(AIHTTPView::Params const& p);
~AIHTTPView();
/*virtual*/ void draw(void);
/*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
/*virtual*/ BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent);
U32 updateColumn(int col, U32 start);
void setWidth(S32 width) { mWidth = width; }
private:
AIGLHTTPHeaderBar* mGLHTTPHeaderBar;
std::vector<AIServiceBar*> mServiceBars;
std::vector<U32> mStartColumn;
size_t mMaxBandwidthPerService;
S32 mWidth;
static U64 sTime_40ms;
public:
static U64 getTime_40ms(void) { return sTime_40ms; }
static void toggle_visibility(void* user_data);
};
extern AIHTTPView *gHttpView;
#endif // AIHTTPVIEW_H

View File

@@ -696,6 +696,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>LiruLegacyOutfitStoreObjChanges</key>
<map>
<key>Comment</key>
<string>While true, automatic detach is performed upon all copyable attachments just before legacy outfit creation to preserve any modifications to them. As a last resort, setting this false allows creating a legacy outfit that won't save changes made to copyable attachments since wearing them or login.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>LiruNoTransactionClutter</key>
<map>
<key>Comment</key>
@@ -707,6 +718,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>LiruScriptErrorsStealFocus</key>
<map>
<key>Comment</key>
<string>When false, scripts that have errors won't steal focus once they've been failed to compile</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>LiruSensibleARC</key>
<map>
<key>Comment</key>
@@ -741,6 +763,17 @@ Found in Advanced->Rendering->Info Displays</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>FloaterUnfocusedBackgroundOpaque</key>
<map>
<key>Comment</key>
<string>Disables floaters going transparent when not in focus, may conflict with some skins, though.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>InstantMessageLogPathAnyAccount</key>
<map>
<key>Comment</key>
@@ -1141,7 +1174,7 @@ This should be as low as possible, but too low may break functionality</string>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
<integer>0</integer>
</map>
<key>WoLfVerticalIMTabs</key>
<map>
@@ -7428,6 +7461,22 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<integer>-1</integer>
</map>
<key>FloaterVoiceEffectRect</key>
<map>
<key>Comment</key>
<string>Rectangle for voice morpher floater</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Rect</string>
<key>Value</key>
<array>
<integer>0</integer>
<integer>300</integer>
<integer>360</integer>
<integer>0</integer>
</array>
</map>
<key>FloaterWorldMapRect2</key>
<map>
<key>Comment</key>
@@ -14386,6 +14435,17 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ShowVoiceVisualizersInCalls</key>
<map>
<key>Comment</key>
<string>Enables in-world voice visualizers, voice gestures and lip-sync while in group or P2P calls.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ShowVolumeSettingsPopup</key>
<map>
<key>Comment</key>
@@ -15677,6 +15737,28 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>SpeakerParticipantDefaultOrder</key>
<map>
<key>Comment</key>
<string>Order for displaying speakers in voice controls. 0 = alphabetical. 1 = recent.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>U32</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>SpeakerParticipantRemoveDelay</key>
<map>
<key>Comment</key>
<string>Timeout to remove participants who is not in channel before removed from list of active speakers (text/voice chat)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>10.0</real>
</map>
<key>UseNewWalkRun</key>
<map>
<key>Comment</key>
@@ -15907,6 +15989,50 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>VoiceCallsRejectGroup</key>
<map>
<key>Comment</key>
<string>Silently reject all incoming group voice calls.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>VoiceDisableMic</key>
<map>
<key>Comment</key>
<string>Completely disable the ability to open the mic.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>VoiceEffectExpiryWarningTime</key>
<map>
<key>Comment</key>
<string>How much notice to give of Voice Morph subscriptions expiry, in seconds.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>259200</integer>
</map>
<key>VoiceMorphingEnabled</key>
<map>
<key>Comment</key>
<string>Whether or not to enable Voice Morphs and show the UI.</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>AutoDisengageMic</key>
<map>
<key>Comment</key>
@@ -15918,6 +16044,17 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>ShowDeviceSettings</key>
<map>
<key>Comment</key>
<string>Show device settings</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>VoiceEarLocation</key>
<map>
<key>Comment</key>
@@ -16028,6 +16165,17 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<string>Default</string>
</map>
<key>VoiceLogFile</key>
<map>
<key>Comment</key>
<string>Log file to use when launching the voice daemon</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string></string>
</map>
<key>VoiceOutputAudioDevice</key>
<map>
<key>Comment</key>
@@ -16061,6 +16209,17 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>VoiceServerType</key>
<map>
<key>Comment</key>
<string>The type of voice server to connect to.</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>vivox</string>
</map>
<key>WLSkyDetail</key>
<map>
<key>Comment</key>

View File

@@ -235,28 +235,6 @@
<key>Value</key>
<real>0.0</real>
</map>
<key>AscentUseSystemFolder</key>
<map>
<key>Comment</key>
<string>Enables the System folder for setting and non-permanent asset storage.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>AscentSystemTemporary</key>
<map>
<key>Comment</key>
<string>When enabled, temporary uploads are put in the System Asset folder (if System Folder exists).</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>AscentShowFriendsTag</key>
<map>
<key>Comment</key>
@@ -620,5 +598,16 @@
<key>Value</key>
<string>/away</string>
</map>
<key>SinguCompleteNameProfiles</key>
<map>
<key>Comment</key>
<string>Use the complete name "Display Name (legacy.name)" in profiles, instead of following the choice set by PhoenixNameSystem.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<boolean>0</boolean>
</map>
</map>
</llsd>

View File

@@ -31,7 +31,7 @@
<key>Type</key>
<string>U32</string>
<key>Value</key>
<integer>16</integer>
<integer>8</integer>
</map>
<key>NoVerifySSLCert</key>
<map>

View File

@@ -573,6 +573,17 @@
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>VoiceEffectDefault</key>
<map>
<key>Comment</key>
<string>Selected Voice Morph</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>00000000-0000-0000-0000-000000000000</string>
</map>
<key>LogFileNamewithDate</key>
<map>

View File

@@ -51,14 +51,14 @@ LLPrefsAscentChat::LLPrefsAscentChat()
{
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_chat.xml");
childSetCommitCallback("SpellBase", onSpellBaseComboBoxCommit, this);
childSetAction("EmSpell_EditCustom", onSpellEditCustom, this);
childSetAction("EmSpell_GetMore", onSpellGetMore, this);
childSetAction("EmSpell_Add", onSpellAdd, this);
childSetAction("EmSpell_Remove", onSpellRemove, this);
getChild<LLUICtrl>("SpellBase")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onSpellBaseComboBoxCommit, this, _2));
getChild<LLUICtrl>("EmSpell_EditCustom")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onSpellEditCustom, this));
getChild<LLUICtrl>("EmSpell_GetMore")->setCommitCallback(boost::bind(&lggHunSpell_Wrapper::getMoreButton, glggHunSpell, this));
getChild<LLUICtrl>("EmSpell_Add")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onSpellAdd, this));
getChild<LLUICtrl>("EmSpell_Remove")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onSpellRemove, this));
childSetCommitCallback("time_format_combobox", onCommitTimeDate, this);
childSetCommitCallback("date_format_combobox", onCommitTimeDate, this);
getChild<LLUICtrl>("time_format_combobox")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitTimeDate, this, _1));
getChild<LLUICtrl>("date_format_combobox")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitTimeDate, this, _1));
bool started = (LLStartUp::getStartupState() == STATE_STARTED);
if (!started) // Disable autoresponse when not logged in
@@ -87,19 +87,19 @@ LLPrefsAscentChat::LLPrefsAscentChat()
childSetValue("BusyModeResponseShow", gSavedPerAccountSettings.getBOOL("BusyModeResponseShow"));
childSetEnabled("reset_antispam", started);
childSetCommitCallback("reset_antispam", onCommitResetAS, this);
childSetCommitCallback("enable_as", onCommitEnableAS, this);
childSetCommitCallback("antispam_checkbox", onCommitDialogBlock, this);
childSetCommitCallback("Group Invites", onCommitDialogBlock, this);
getChild<LLUICtrl>("reset_antispam")->setCommitCallback(boost::bind(NACLAntiSpamRegistry::purgeAllQueues));
getChild<LLUICtrl>("enable_as")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitEnableAS, this, _2));
getChild<LLUICtrl>("antispam_checkbox")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitDialogBlock, this, _1, _2));
getChild<LLUICtrl>("Group Invites")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitDialogBlock, this, _1, _2));
childSetCommitCallback("KeywordsOn", onCommitKeywords, this);
childSetCommitCallback("KeywordsList", onCommitKeywords, this);
childSetCommitCallback("KeywordsSound", onCommitKeywords, this);
childSetCommitCallback("KeywordsInChat", onCommitKeywords, this);
childSetCommitCallback("KeywordsInIM", onCommitKeywords, this);
childSetCommitCallback("KeywordsChangeColor", onCommitKeywords, this);
childSetCommitCallback("KeywordsColor", onCommitKeywords, this);
childSetCommitCallback("KeywordsPlaySound", onCommitKeywords, this);
getChild<LLUICtrl>("KeywordsOn")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1));
getChild<LLUICtrl>("KeywordsList")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1));
getChild<LLUICtrl>("KeywordsSound")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1));
getChild<LLUICtrl>("KeywordsInChat")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1));
getChild<LLUICtrl>("KeywordsInIM")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1));
getChild<LLUICtrl>("KeywordsChangeColor")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1));
getChild<LLUICtrl>("KeywordsColor")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1));
getChild<LLUICtrl>("KeywordsPlaySound")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1));
refreshValues();
refresh();
@@ -109,73 +109,43 @@ LLPrefsAscentChat::~LLPrefsAscentChat()
{
}
//static
void LLPrefsAscentChat::onSpellAdd(void* data)
void LLPrefsAscentChat::onSpellAdd()
{
LLPrefsAscentChat* self = (LLPrefsAscentChat*)data;
if(self)
{
glggHunSpell->addButton(self->childGetValue("EmSpell_Avail").asString());
}
self->refresh();
glggHunSpell->addButton(childGetValue("EmSpell_Avail").asString());
refresh();
}
//static
void LLPrefsAscentChat::onSpellRemove(void* data)
void LLPrefsAscentChat::onSpellRemove()
{
LLPrefsAscentChat* self = (LLPrefsAscentChat*)data;
if(self)
{
glggHunSpell->removeButton(self->childGetValue("EmSpell_Installed").asString());
}
self->refresh();
glggHunSpell->removeButton(childGetValue("EmSpell_Installed").asString());
refresh();
}
//static
void LLPrefsAscentChat::onSpellGetMore(void* data)
void LLPrefsAscentChat::onSpellEditCustom()
{
glggHunSpell->getMoreButton(data);
glggHunSpell->editCustomButton();
}
//static
void LLPrefsAscentChat::onSpellEditCustom(void* data)
void LLPrefsAscentChat::onSpellBaseComboBoxCommit(const LLSD& value)
{
glggHunSpell->editCustomButton();
glggHunSpell->newDictSelection(value.asString());
}
//static
void LLPrefsAscentChat::onSpellBaseComboBoxCommit(LLUICtrl* ctrl, void* userdata)
void LLPrefsAscentChat::onCommitTimeDate(LLUICtrl* ctrl)
{
LLComboBox* box = (LLComboBox*)ctrl;
if (box)
{
glggHunSpell->newDictSelection(box->getValue().asString());
}
}
//static
void LLPrefsAscentChat::onCommitTimeDate(LLUICtrl* ctrl, void* userdata)
{
LLPrefsAscentChat* self = (LLPrefsAscentChat*)userdata;
LLComboBox* combo = (LLComboBox*)ctrl;
LLComboBox* combo = static_cast<LLComboBox*>(ctrl);
if (ctrl->getName() == "time_format_combobox")
{
self->tempTimeFormat = combo->getCurrentIndex();
tempTimeFormat = combo->getCurrentIndex();
}
else if (ctrl->getName() == "date_format_combobox")
{
self->tempDateFormat = combo->getCurrentIndex();
tempDateFormat = combo->getCurrentIndex();
}
std::string short_date, long_date, short_time, long_time, timestamp;
if (self->tempTimeFormat == 0)
if (tempTimeFormat == 0)
{
short_time = "%H:%M";
long_time = "%H:%M:%S";
@@ -188,13 +158,13 @@ void LLPrefsAscentChat::onCommitTimeDate(LLUICtrl* ctrl, void* userdata)
timestamp = " %I:%M %p";
}
if (self->tempDateFormat == 0)
if (tempDateFormat == 0)
{
short_date = "%Y-%m-%d";
long_date = "%A %d %B %Y";
timestamp = "%a %d %b %Y" + timestamp;
}
else if (self->tempDateFormat == 1)
else if (tempDateFormat == 1)
{
short_date = "%d/%m/%Y";
long_date = "%A %d %B %Y";
@@ -214,70 +184,57 @@ void LLPrefsAscentChat::onCommitTimeDate(LLUICtrl* ctrl, void* userdata)
gSavedSettings.setString("TimestampFormat", timestamp);
}
//static
void LLPrefsAscentChat::onCommitResetAS(LLUICtrl*, void*)
void LLPrefsAscentChat::onCommitEnableAS(const LLSD& value)
{
NACLAntiSpamRegistry::purgeAllQueues();
bool enabled = value.asBoolean();
childSetEnabled("spammsg_checkbox", enabled);
childSetEnabled("antispamtime", enabled);
childSetEnabled("antispamamount", enabled);
childSetEnabled("antispamsoundmulti", enabled);
childSetEnabled("antispamsoundpreloadmulti", enabled);
childSetEnabled("antispamnewlines", enabled);
childSetEnabled("Notify On Spam", enabled);
}
//static
void LLPrefsAscentChat::onCommitEnableAS(LLUICtrl* ctrl, void* user_data)
void LLPrefsAscentChat::onCommitDialogBlock(LLUICtrl* ctrl, const LLSD& value)
{
LLPrefsAscentChat* self = (LLPrefsAscentChat*)user_data;
bool enabled = ctrl->getValue().asBoolean();
self->childSetEnabled("spammsg_checkbox", enabled);
self->childSetEnabled("antispamtime", enabled);
self->childSetEnabled("antispamamount", enabled);
self->childSetEnabled("antispamsoundmulti", enabled);
self->childSetEnabled("antispamsoundpreloadmulti", enabled);
self->childSetEnabled("antispamnewlines", enabled);
self->childSetEnabled("Notify On Spam", enabled);
}
//static
void LLPrefsAscentChat::onCommitDialogBlock(LLUICtrl* ctrl, void* user_data)
{
LLPrefsAscentChat* self = (LLPrefsAscentChat*)user_data;
self->childSetEnabled("Group Fee Invites", !self->childGetValue("antispam_checkbox").asBoolean() && !self->childGetValue("Group Invites").asBoolean());
bool enabled = ctrl->getValue().asBoolean();
childSetEnabled("Group Fee Invites", !childGetValue("antispam_checkbox").asBoolean() && !childGetValue("Group Invites").asBoolean());
bool enabled = value.asBoolean();
if (ctrl->getName() == "antispam_checkbox")
{
self->childSetEnabled("Block All Dialogs From", !enabled);
self->childSetEnabled("Alerts", !enabled);
self->childSetEnabled("Friendship Offers", !enabled);
self->childSetEnabled("Group Invites", !enabled);
self->childSetEnabled("Group Notices", !enabled);
self->childSetEnabled("Item Offers", !enabled);
self->childSetEnabled("Scripts", !enabled);
self->childSetEnabled("Teleport Offers", !enabled);
childSetEnabled("Block All Dialogs From", !enabled);
childSetEnabled("Alerts", !enabled);
childSetEnabled("Friendship Offers", !enabled);
childSetEnabled("Group Invites", !enabled);
childSetEnabled("Group Notices", !enabled);
childSetEnabled("Item Offers", !enabled);
childSetEnabled("Scripts", !enabled);
childSetEnabled("Teleport Offers", !enabled);
}
}
//static
void LLPrefsAscentChat::onCommitKeywords(LLUICtrl* ctrl, void* user_data)
void LLPrefsAscentChat::onCommitKeywords(LLUICtrl* ctrl)
{
LLPrefsAscentChat* self = (LLPrefsAscentChat*)user_data;
if (ctrl->getName() == "KeywordsOn")
{
bool enabled = self->childGetValue("KeywordsOn").asBoolean();
self->childSetEnabled("KeywordsList", enabled);
self->childSetEnabled("KeywordsInChat", enabled);
self->childSetEnabled("KeywordsInIM", enabled);
self->childSetEnabled("KeywordsChangeColor", enabled);
self->childSetEnabled("KeywordsColor", enabled);
self->childSetEnabled("KeywordsPlaySound", enabled);
self->childSetEnabled("KeywordsSound", enabled);
bool enabled = childGetValue("KeywordsOn").asBoolean();
childSetEnabled("KeywordsList", enabled);
childSetEnabled("KeywordsInChat", enabled);
childSetEnabled("KeywordsInIM", enabled);
childSetEnabled("KeywordsChangeColor", enabled);
childSetEnabled("KeywordsColor", enabled);
childSetEnabled("KeywordsPlaySound", enabled);
childSetEnabled("KeywordsSound", enabled);
}
gSavedPerAccountSettings.setBOOL("KeywordsOn", self->childGetValue("KeywordsOn"));
gSavedPerAccountSettings.setString("KeywordsList", self->childGetValue("KeywordsList"));
gSavedPerAccountSettings.setBOOL("KeywordsInChat", self->childGetValue("KeywordsInChat"));
gSavedPerAccountSettings.setBOOL("KeywordsInIM", self->childGetValue("KeywordsInIM"));
gSavedPerAccountSettings.setBOOL("KeywordsChangeColor", self->childGetValue("KeywordsChangeColor"));
gSavedPerAccountSettings.setColor4("KeywordsColor", self->childGetValue("KeywordsColor"));
gSavedPerAccountSettings.setBOOL("KeywordsPlaySound", self->childGetValue("KeywordsPlaySound"));
gSavedPerAccountSettings.setString("KeywordsSound", self->childGetValue("KeywordsSound"));
gSavedPerAccountSettings.setBOOL("KeywordsOn", childGetValue("KeywordsOn"));
gSavedPerAccountSettings.setString("KeywordsList", childGetValue("KeywordsList"));
gSavedPerAccountSettings.setBOOL("KeywordsInChat", childGetValue("KeywordsInChat"));
gSavedPerAccountSettings.setBOOL("KeywordsInIM", childGetValue("KeywordsInIM"));
gSavedPerAccountSettings.setBOOL("KeywordsChangeColor", childGetValue("KeywordsChangeColor"));
gSavedPerAccountSettings.setColor4("KeywordsColor", childGetValue("KeywordsColor"));
gSavedPerAccountSettings.setBOOL("KeywordsPlaySound", childGetValue("KeywordsPlaySound"));
gSavedPerAccountSettings.setString("KeywordsSound", childGetValue("KeywordsSound"));
}
// Store current settings for cancel

View File

@@ -47,16 +47,14 @@ public:
void refreshValues();
protected:
static void onSpellAdd(void* data);
static void onSpellRemove(void* data);
static void onSpellGetMore(void* data);
static void onSpellEditCustom(void* data);
static void onSpellBaseComboBoxCommit(LLUICtrl* ctrl, void* userdata);
static void onCommitTimeDate(LLUICtrl* ctrl, void *userdata);
static void onCommitResetAS(LLUICtrl*,void*);
static void onCommitEnableAS(LLUICtrl*, void*);
static void onCommitDialogBlock(LLUICtrl*, void*);
static void onCommitKeywords(LLUICtrl* ctrl, void* user_data);
void onSpellAdd();
void onSpellRemove();
void onSpellEditCustom();
void onSpellBaseComboBoxCommit(const LLSD& value);
void onCommitTimeDate(LLUICtrl* ctrl);
void onCommitEnableAS(const LLSD& value);
void onCommitDialogBlock(LLUICtrl* ctrl, const LLSD& value);
void onCommitKeywords(LLUICtrl* ctrl);
//Chat/IM -----------------------------------------------------------------------------
BOOL mIMAnnounceIncoming;

View File

@@ -51,41 +51,41 @@ LLPrefsAscentSys::LLPrefsAscentSys()
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_system.xml");
//General -----------------------------------------------------------------------------
childSetCommitCallback("speed_rez_check", onCommitCheckBox, this);
childSetCommitCallback("double_click_teleport_check", onCommitCheckBox, this);
childSetCommitCallback("system_folder_check", onCommitCheckBox, this);
childSetCommitCallback("show_look_at_check", onCommitCheckBox, this);
childSetCommitCallback("enable_clouds", onCommitCheckBox, this);
childSetCommitCallback("power_user_check", onCommitCheckBox, this);
childSetCommitCallback("power_user_confirm_check", onCommitCheckBox, this);
getChild<LLUICtrl>("speed_rez_check")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2));
getChild<LLUICtrl>("double_click_teleport_check")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2));
getChild<LLUICtrl>("system_folder_check")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2));
getChild<LLUICtrl>("show_look_at_check")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2));
getChild<LLUICtrl>("enable_clouds")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2));
getChild<LLUICtrl>("power_user_check")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2));
getChild<LLUICtrl>("power_user_confirm_check")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2));
//Command Line ------------------------------------------------------------------------
childSetCommitCallback("chat_cmd_toggle", onCommitCmdLine, this);
childSetCommitCallback("AscentCmdLinePos", onCommitCmdLine, this);
childSetCommitCallback("AscentCmdLineGround", onCommitCmdLine, this);
childSetCommitCallback("AscentCmdLineHeight", onCommitCmdLine, this);
childSetCommitCallback("AscentCmdLineTeleportHome", onCommitCmdLine, this);
childSetCommitCallback("AscentCmdLineRezPlatform", onCommitCmdLine, this);
childSetCommitCallback("AscentCmdLineCalc", onCommitCmdLine, this);
childSetCommitCallback("AscentCmdLineClearChat", onCommitCmdLine, this);
childSetCommitCallback("AscentCmdLineDrawDistance", onCommitCmdLine, this);
childSetCommitCallback("AscentCmdTeleportToCam", onCommitCmdLine, this);
childSetCommitCallback("AscentCmdLineKeyToName", onCommitCmdLine, this);
childSetCommitCallback("AscentCmdLineOfferTp", onCommitCmdLine, this);
childSetCommitCallback("AscentCmdLineMapTo", onCommitCmdLine, this);
childSetCommitCallback("AscentCmdLineTP2", onCommitCmdLine, this);
childSetCommitCallback("SinguCmdLineAway", onCommitCmdLine, this);
getChild<LLUICtrl>("chat_cmd_toggle")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
getChild<LLUICtrl>("AscentCmdLinePos")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
getChild<LLUICtrl>("AscentCmdLineGround")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
getChild<LLUICtrl>("AscentCmdLineHeight")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
getChild<LLUICtrl>("AscentCmdLineTeleportHome")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
getChild<LLUICtrl>("AscentCmdLineRezPlatform")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
getChild<LLUICtrl>("AscentCmdLineCalc")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
getChild<LLUICtrl>("AscentCmdLineClearChat")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
getChild<LLUICtrl>("AscentCmdLineDrawDistance")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
getChild<LLUICtrl>("AscentCmdTeleportToCam")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
getChild<LLUICtrl>("AscentCmdLineKeyToName")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
getChild<LLUICtrl>("AscentCmdLineOfferTp")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
getChild<LLUICtrl>("AscentCmdLineMapTo")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
getChild<LLUICtrl>("AscentCmdLineTP2")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
getChild<LLUICtrl>("SinguCmdLineAway")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
//Security ----------------------------------------------------------------------------
childSetCommitCallback("disable_click_sit_check", onCommitCheckBox, this);
getChild<LLUICtrl>("disable_click_sit_check")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2));
//Build -------------------------------------------------------------------------------
childSetCommitCallback("next_owner_copy", onCommitCheckBox, this);
getChild<LLUICtrl>("next_owner_copy")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2));
childSetEnabled("next_owner_transfer", gSavedSettings.getBOOL("NextOwnerCopy"));
childSetCommitCallback("material", onCommitComboBox, this);
childSetCommitCallback("combobox shininess", onCommitComboBox, this);
getChild<LLUICtrl>("material")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitComboBox, this, _1, _2));
getChild<LLUICtrl>("combobox shininess")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitComboBox, this, _1, _2));
getChild<LLTextureCtrl>("texture control")->setDefaultImageAssetID(LLUUID(gSavedSettings.getString("EmeraldBuildPrefs_Texture")));
childSetCommitCallback("texture control", onCommitTexturePicker, this);
getChild<LLUICtrl>("texture control")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitTexturePicker, this, _1));
refreshValues();
refresh();
@@ -95,37 +95,34 @@ LLPrefsAscentSys::~LLPrefsAscentSys()
{
}
//static
void LLPrefsAscentSys::onCommitCheckBox(LLUICtrl* ctrl, void* user_data)
void LLPrefsAscentSys::onCommitCheckBox(LLUICtrl* ctrl, const LLSD& value)
{
LLPrefsAscentSys* self = static_cast<LLPrefsAscentSys*>(user_data);
// llinfos << "Change to " << ctrl->getControlName() << " aka " << ctrl->getName() << llendl;
const std::string name = ctrl->getName();
bool enabled = ctrl->getValue().asBoolean();
bool enabled = value.asBoolean();
if (name == "speed_rez_check")
{
self->childSetEnabled("speed_rez_interval", enabled);
self->childSetEnabled("speed_rez_seconds", enabled);
childSetEnabled("speed_rez_interval", enabled);
childSetEnabled("speed_rez_seconds", enabled);
}
else if (name == "double_click_teleport_check")
{
self->childSetEnabled("center_after_teleport_check", enabled);
self->childSetEnabled("offset_teleport_check", enabled);
childSetEnabled("center_after_teleport_check", enabled);
childSetEnabled("offset_teleport_check", enabled);
}
else if (name == "system_folder_check")
{
self->childSetEnabled("temp_in_system_check", enabled);
childSetEnabled("temp_in_system_check", enabled);
}
else if (name == "enable_clouds")
{
self->childSetEnabled("enable_classic_clouds", enabled);
childSetEnabled("enable_classic_clouds", enabled);
}
else if (name == "power_user_check")
{
self->childSetEnabled("power_user_confirm_check", enabled);
self->childSetValue("power_user_confirm_check", false);
childSetEnabled("power_user_confirm_check", enabled);
childSetValue("power_user_confirm_check", false);
}
else if (name == "power_user_confirm_check")
{
@@ -143,79 +140,65 @@ void LLPrefsAscentSys::onCommitCheckBox(LLUICtrl* ctrl, void* user_data)
}
else if (name == "disable_click_sit_check")
{
self->childSetEnabled("disable_click_sit_own_check", !enabled);
childSetEnabled("disable_click_sit_own_check", !enabled);
}
else if (name == "next_owner_copy")
{
if (!enabled) gSavedSettings.setBOOL("NextOwnerTransfer", true);
self->childSetEnabled("next_owner_transfer", enabled);
childSetEnabled("next_owner_transfer", enabled);
}
}
//static
void LLPrefsAscentSys::onCommitCmdLine(LLUICtrl* ctrl, void* user_data)
void LLPrefsAscentSys::onCommitCmdLine(LLUICtrl* ctrl, const LLSD& value)
{
LLPrefsAscentSys* self = (LLPrefsAscentSys*)user_data;
if (ctrl->getName() == "chat_cmd_toggle")
const std::string& name = ctrl->getName();
if (name == "chat_cmd_toggle")
{
bool enabled = self->childGetValue("chat_cmd_toggle").asBoolean();
self->childSetEnabled("cmd_line_text_2", enabled);
self->childSetEnabled("cmd_line_text_3", enabled);
self->childSetEnabled("cmd_line_text_4", enabled);
self->childSetEnabled("cmd_line_text_5", enabled);
self->childSetEnabled("cmd_line_text_6", enabled);
self->childSetEnabled("cmd_line_text_7", enabled);
self->childSetEnabled("cmd_line_text_8", enabled);
self->childSetEnabled("cmd_line_text_9", enabled);
self->childSetEnabled("cmd_line_text_10", enabled);
self->childSetEnabled("cmd_line_text_11", enabled);
self->childSetEnabled("cmd_line_text_12", enabled);
self->childSetEnabled("cmd_line_text_13", enabled);
self->childSetEnabled("cmd_line_text_15", enabled);
self->childSetEnabled("AscentCmdLinePos", enabled);
self->childSetEnabled("AscentCmdLineGround", enabled);
self->childSetEnabled("AscentCmdLineHeight", enabled);
self->childSetEnabled("AscentCmdLineTeleportHome", enabled);
self->childSetEnabled("AscentCmdLineRezPlatform", enabled);
self->childSetEnabled("AscentPlatformSize", enabled);
self->childSetEnabled("AscentCmdLineCalc", enabled);
self->childSetEnabled("AscentCmdLineClearChat", enabled);
self->childSetEnabled("AscentCmdLineDrawDistance", enabled);
self->childSetEnabled("AscentCmdTeleportToCam", enabled);
self->childSetEnabled("AscentCmdLineKeyToName", enabled);
self->childSetEnabled("AscentCmdLineOfferTp", enabled);
self->childSetEnabled("AscentCmdLineMapTo", enabled);
self->childSetEnabled("map_to_keep_pos", enabled);
self->childSetEnabled("AscentCmdLineTP2", enabled);
self->childSetEnabled("SinguCmdLineAway", enabled);
bool enabled = value.asBoolean();
childSetEnabled("cmd_line_text_2", enabled);
childSetEnabled("cmd_line_text_3", enabled);
childSetEnabled("cmd_line_text_4", enabled);
childSetEnabled("cmd_line_text_5", enabled);
childSetEnabled("cmd_line_text_6", enabled);
childSetEnabled("cmd_line_text_7", enabled);
childSetEnabled("cmd_line_text_8", enabled);
childSetEnabled("cmd_line_text_9", enabled);
childSetEnabled("cmd_line_text_10", enabled);
childSetEnabled("cmd_line_text_11", enabled);
childSetEnabled("cmd_line_text_12", enabled);
childSetEnabled("cmd_line_text_13", enabled);
childSetEnabled("cmd_line_text_15", enabled);
childSetEnabled("AscentCmdLinePos", enabled);
childSetEnabled("AscentCmdLineGround", enabled);
childSetEnabled("AscentCmdLineHeight", enabled);
childSetEnabled("AscentCmdLineTeleportHome", enabled);
childSetEnabled("AscentCmdLineRezPlatform", enabled);
childSetEnabled("AscentPlatformSize", enabled);
childSetEnabled("AscentCmdLineCalc", enabled);
childSetEnabled("AscentCmdLineClearChat", enabled);
childSetEnabled("AscentCmdLineDrawDistance", enabled);
childSetEnabled("AscentCmdTeleportToCam", enabled);
childSetEnabled("AscentCmdLineKeyToName", enabled);
childSetEnabled("AscentCmdLineOfferTp", enabled);
childSetEnabled("AscentCmdLineMapTo", enabled);
childSetEnabled("map_to_keep_pos", enabled);
childSetEnabled("AscentCmdLineTP2", enabled);
childSetEnabled("SinguCmdLineAway", enabled);
}
gSavedSettings.setString("AscentCmdLinePos", self->childGetValue("AscentCmdLinePos"));
gSavedSettings.setString("AscentCmdLineGround", self->childGetValue("AscentCmdLineGround"));
gSavedSettings.setString("AscentCmdLineHeight", self->childGetValue("AscentCmdLineHeight"));
gSavedSettings.setString("AscentCmdLineTeleportHome", self->childGetValue("AscentCmdLineTeleportHome"));
gSavedSettings.setString("AscentCmdLineRezPlatform", self->childGetValue("AscentCmdLineRezPlatform"));
gSavedSettings.setString("AscentCmdLineCalc", self->childGetValue("AscentCmdLineCalc"));
gSavedSettings.setString("AscentCmdLineClearChat", self->childGetValue("AscentCmdLineClearChat"));
gSavedSettings.setString("AscentCmdLineDrawDistance", self->childGetValue("AscentCmdLineDrawDistance"));
gSavedSettings.setString("AscentCmdTeleportToCam", self->childGetValue("AscentCmdTeleportToCam"));
gSavedSettings.setString("AscentCmdLineKeyToName", self->childGetValue("AscentCmdLineKeyToName"));
gSavedSettings.setString("AscentCmdLineOfferTp", self->childGetValue("AscentCmdLineOfferTp"));
gSavedSettings.setString("AscentCmdLineMapTo", self->childGetValue("AscentCmdLineMapTo"));
gSavedSettings.setString("AscentCmdLineTP2", self->childGetValue("AscentCmdLineTP2"));
gSavedSettings.setString("SinguCmdLineAway", self->childGetValue("SinguCmdLineAway"));
else
{
gSavedSettings.setString(name, value); // Singu Note: Keep commandline settings using the same name as their settings
}
}
void LLPrefsAscentSys::onCommitComboBox(LLUICtrl* ctrl, void* userdata)
void LLPrefsAscentSys::onCommitComboBox(LLUICtrl* ctrl, const LLSD& value)
{
LLComboBox* box = (LLComboBox*)ctrl;
if(box) gSavedSettings.setString(box->getControlName(), box->getValue().asString());
gSavedSettings.setString(ctrl->getControlName(), value.asString());
}
void LLPrefsAscentSys::onCommitTexturePicker(LLUICtrl* ctrl, void* userdata)
void LLPrefsAscentSys::onCommitTexturePicker(LLUICtrl* ctrl)
{
LLTextureCtrl* image_ctrl = (LLTextureCtrl*)ctrl;
LLTextureCtrl* image_ctrl = static_cast<LLTextureCtrl*>(ctrl);
if(image_ctrl) gSavedSettings.setString("EmeraldBuildPrefs_Texture", image_ctrl->getImageAssetID().asString());
}
@@ -235,8 +218,6 @@ void LLPrefsAscentSys::refreshValues()
mAlwaysShowFly = gSavedSettings.getBOOL("AscentFlyAlwaysEnabled");
mDisableMinZoom = gSavedSettings.getBOOL("AscentDisableMinZoomDist");
mPowerUser = gSavedSettings.getBOOL("AscentPowerfulWizard");
mUseSystemFolder = gSavedSettings.getBOOL("AscentUseSystemFolder");
mUploadToSystem = gSavedSettings.getBOOL("AscentSystemTemporary");
mFetchInventoryOnLogin = gSavedSettings.getBOOL("FetchInventoryOnLogin");
mEnableLLWind = gSavedSettings.getBOOL("WindEnabled");
mEnableClouds = gSavedSettings.getBOOL("CloudsEnabled");
@@ -303,7 +284,6 @@ void LLPrefsAscentSys::refresh()
childSetEnabled("offset_teleport_check", mDoubleClickTeleport);
childSetValue("power_user_check", mPowerUser);
childSetValue("power_user_confirm_check", mPowerUser);
childSetEnabled("temp_in_system_check", mUseSystemFolder);
childSetEnabled("speed_rez_interval", mSpeedRez);
childSetEnabled("speed_rez_seconds", mSpeedRez);
@@ -388,8 +368,6 @@ void LLPrefsAscentSys::cancel()
gSavedSettings.setBOOL("AscentBuildAlwaysEnabled", mBuildAlwaysEnabled);
gSavedSettings.setBOOL("AscentFlyAlwaysEnabled", mAlwaysShowFly);
gSavedSettings.setBOOL("AscentDisableMinZoomDist", mDisableMinZoom);
gSavedSettings.setBOOL("AscentUseSystemFolder", mUseSystemFolder);
gSavedSettings.setBOOL("AscentSystemTemporary", mUploadToSystem);
gSavedSettings.setBOOL("FetchInventoryOnLogin", mFetchInventoryOnLogin);
gSavedSettings.setBOOL("WindEnabled", mEnableLLWind);
gSavedSettings.setBOOL("CloudsEnabled", mEnableClouds);

View File

@@ -47,10 +47,10 @@ public:
void refreshValues();
protected:
static void onCommitCheckBox(LLUICtrl* ctrl, void* user_data);
static void onCommitCmdLine(LLUICtrl* ctrl, void* user_data);
static void onCommitComboBox(LLUICtrl* ctrl, void* user_data);
static void onCommitTexturePicker(LLUICtrl* ctrl, void* user_data);
void onCommitCheckBox(LLUICtrl* ctrl, const LLSD& value);
void onCommitCmdLine(LLUICtrl* ctrl, const LLSD& value);
void onCommitComboBox(LLUICtrl* ctrl, const LLSD& value);
void onCommitTexturePicker(LLUICtrl* ctrl);
//General -----------------------------------------------------------------------------
BOOL mDoubleClickTeleport;
@@ -66,8 +66,6 @@ protected:
BOOL mAlwaysShowFly;
BOOL mDisableMinZoom;
BOOL mPowerUser;
BOOL mUseSystemFolder;
BOOL mUploadToSystem;
BOOL mFetchInventoryOnLogin;
BOOL mEnableLLWind;
BOOL mEnableClouds;

View File

@@ -59,22 +59,18 @@ LLPrefsAscentVan::LLPrefsAscentVan()
childSetVisible("announce_stream_metadata", gAudiop && gAudiop->getStreamingAudioImpl() && gAudiop->getStreamingAudioImpl()->supportsMetaData());
childSetCommitCallback("tag_spoofing_combobox", onCommitClientTag, this);
getChild<LLUICtrl>("tag_spoofing_combobox")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitClientTag, this, _1));
childSetCommitCallback("show_my_tag_check", onCommitCheckBox, this);
childSetCommitCallback("show_self_tag_check", onCommitCheckBox, this);
childSetCommitCallback("show_self_tag_color_check", onCommitCheckBox, this);
childSetCommitCallback("customize_own_tag_check", onCommitCheckBox, this);
childSetCommitCallback("show_friend_tag_check", onCommitCheckBox, this);
childSetCommitCallback("use_status_check", onCommitCheckBox, this);
getChild<LLUICtrl>("show_my_tag_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2));
getChild<LLUICtrl>("show_self_tag_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2));
getChild<LLUICtrl>("show_self_tag_color_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2));
getChild<LLUICtrl>("customize_own_tag_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2));
getChild<LLUICtrl>("show_friend_tag_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2));
getChild<LLUICtrl>("use_status_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2));
childSetCommitCallback("custom_tag_label_box", onCommitTextModified, this);
getChild<LLUICtrl>("custom_tag_label_box")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitTextModified, this, _1, _2));
childSetCommitCallback("X Modifier", onCommitUpdateAvatarOffsets);
childSetCommitCallback("Y Modifier", onCommitUpdateAvatarOffsets);
childSetCommitCallback("Z Modifier", onCommitUpdateAvatarOffsets);
childSetAction("update_clientdefs", onManualClientUpdate, this);
getChild<LLUICtrl>("update_clientdefs")->setCommitCallback(boost::bind(LLPrefsAscentVan::onManualClientUpdate));
refreshValues();
refresh();
@@ -84,57 +80,40 @@ LLPrefsAscentVan::~LLPrefsAscentVan()
{
}
//static
void LLPrefsAscentVan::onCommitClientTag(LLUICtrl* ctrl, void* userdata)
void LLPrefsAscentVan::onCommitClientTag(LLUICtrl* ctrl)
{
std::string client_uuid;
U32 client_index;
LLPrefsAscentVan* self = (LLPrefsAscentVan*)userdata;
LLComboBox* combo = (LLComboBox*)ctrl;
LLComboBox* combo = static_cast<LLComboBox*>(ctrl);
if (combo)
{
client_index = combo->getCurrentIndex();
//Don't rebake if it's not neccesary.
if (client_index != self->mSelectedClient)
{
client_uuid = combo->getSelectedValue().asString();
gSavedSettings.setString("AscentReportClientUUID", client_uuid);
gSavedSettings.setU32("AscentReportClientIndex", client_index);
client_index = combo->getCurrentIndex();
//Don't rebake if it's not neccesary.
if (client_index != mSelectedClient)
{
client_uuid = combo->getSelectedValue().asString();
gSavedSettings.setString("AscentReportClientUUID", client_uuid);
gSavedSettings.setU32("AscentReportClientIndex", client_index);
if (gAgentAvatarp)
{
// Slam pending upload count to "unstick" things
bool slam_for_debug = true;
gAgentAvatarp->forceBakeAllTextures(slam_for_debug);
}
}
}
if (gAgentAvatarp)
{
// Slam pending upload count to "unstick" things
bool slam_for_debug = true;
gAgentAvatarp->forceBakeAllTextures(slam_for_debug);
}
}
}
//static
void LLPrefsAscentVan::onCommitUpdateAvatarOffsets(LLUICtrl* ctrl, void* userdata)
void LLPrefsAscentVan::onCommitTextModified(LLUICtrl* ctrl, const LLSD& value)
{
//if (!gAgent.getID().isNull())
//{
// gAgent.sendAgentSetAppearance();
//}
}
//static
void LLPrefsAscentVan::onCommitTextModified(LLUICtrl* ctrl, void* userdata)
{
LLPrefsAscentVan* self = (LLPrefsAscentVan*)userdata;
if (ctrl->getName() == "custom_tag_label_box")
{
gSavedSettings.setString("AscentCustomTagLabel", self->childGetValue("custom_tag_label_box"));
gSavedSettings.setString("AscentCustomTagLabel", value);
}
}
//static
void LLPrefsAscentVan::onManualClientUpdate(void* data)
void LLPrefsAscentVan::onManualClientUpdate()
{
LLChat chat("Definitions already up-to-date.");
chat.mSourceType = CHAT_SOURCE_SYSTEM;
@@ -148,33 +127,26 @@ void LLPrefsAscentVan::onManualClientUpdate(void* data)
LLFloaterChat::addChat(chat);
}
//static
void LLPrefsAscentVan::onCommitCheckBox(LLUICtrl* ctrl, void* user_data)
void LLPrefsAscentVan::onCommitCheckBox(LLUICtrl* ctrl, const LLSD& value)
{
LLPrefsAscentVan* self = (LLPrefsAscentVan*)user_data;
// llinfos << "Control named " << ctrl->getControlName() << llendl;
if (ctrl->getName() == "use_status_check")
{
bool showCustomColors = gSavedSettings.getBOOL("AscentUseStatusColors");
self->childSetEnabled("friends_color_textbox", showCustomColors);
bool frColors = gSavedSettings.getBOOL("ColorFriendChat");
self->childSetEnabled("friend_color_swatch", showCustomColors || frColors);
bool eoColors = gSavedSettings.getBOOL("ColorEstateOwnerChat");
self->childSetEnabled("estate_owner_color_swatch", showCustomColors || eoColors);
bool lindColors = gSavedSettings.getBOOL("ColorLindenChat");
self->childSetEnabled("linden_color_swatch", showCustomColors || lindColors);
bool muteColors = gSavedSettings.getBOOL("ColorMutedChat");
self->childSetEnabled("muted_color_swatch", showCustomColors || muteColors);
bool showCustomColors = value.asBoolean();
childSetEnabled("friends_color_textbox", showCustomColors);
childSetEnabled("friend_color_swatch", showCustomColors || gSavedSettings.getBOOL("ColorFriendChat"));
childSetEnabled("estate_owner_color_swatch", showCustomColors || gSavedSettings.getBOOL("ColorEstateOwnerChat"));
childSetEnabled("linden_color_swatch", showCustomColors || gSavedSettings.getBOOL("ColorLindenChat"));
childSetEnabled("muted_color_swatch", showCustomColors || gSavedSettings.getBOOL("ColorMutedChat"));
}
else if (ctrl->getName() == "customize_own_tag_check")
{
BOOL showCustomOptions = gSavedSettings.getBOOL("AscentUseCustomTag");
self->childSetEnabled("custom_tag_label_text", showCustomOptions);
self->childSetEnabled("custom_tag_label_box", showCustomOptions);
self->childSetEnabled("custom_tag_color_text", showCustomOptions);
self->childSetEnabled("custom_tag_color_swatch", showCustomOptions);
bool showCustomOptions = value.asBoolean();
childSetEnabled("custom_tag_label_text", showCustomOptions);
childSetEnabled("custom_tag_label_box", showCustomOptions);
childSetEnabled("custom_tag_color_text", showCustomOptions);
childSetEnabled("custom_tag_color_swatch", showCustomOptions);
}
}
@@ -191,6 +163,9 @@ void LLPrefsAscentVan::refreshValues()
mTurnAround = gSavedSettings.getBOOL("TurnAroundWhenWalkingBackwards");
mAnnounceSnapshots = gSavedSettings.getBOOL("AnnounceSnapshots");
mAnnounceStreamMetadata = gSavedSettings.getBOOL("AnnounceStreamMetadata");
mUnfocusedFloatersOpaque = gSavedSettings.getBOOL("FloaterUnfocusedBackgroundOpaque");
mCompleteNameProfiles = gSavedSettings.getBOOL("SinguCompleteNameProfiles");
mScriptErrorsStealFocus = gSavedSettings.getBOOL("LiruScriptErrorsStealFocus");
//Tags\Colors ----------------------------------------------------------------------------
mAscentBroadcastTag = gSavedSettings.getBOOL("AscentBroadcastTag");
@@ -259,6 +234,9 @@ void LLPrefsAscentVan::cancel()
gSavedSettings.setBOOL("TurnAroundWhenWalkingBackwards", mTurnAround);
gSavedSettings.setBOOL("AnnounceSnapshots", mAnnounceSnapshots);
gSavedSettings.setBOOL("AnnounceStreamMetadata", mAnnounceStreamMetadata);
gSavedSettings.setBOOL("FloaterUnfocusedBackgroundOpaque", mUnfocusedFloatersOpaque);
gSavedSettings.setBOOL("SinguCompleteNameProfiles", mCompleteNameProfiles);
gSavedSettings.setBOOL("LiruScriptErrorsStealFocus", mScriptErrorsStealFocus);
//Tags\Colors ----------------------------------------------------------------------------
gSavedSettings.setBOOL("AscentBroadcastTag", mAscentBroadcastTag);

View File

@@ -47,11 +47,10 @@ public:
void refreshValues();
protected:
static void onCommitClientTag(LLUICtrl* ctrl, void* userdata);
static void onCommitUpdateAvatarOffsets(LLUICtrl* ctrl, void* userdata);
static void onCommitCheckBox(LLUICtrl* ctrl, void* user_data);
static void onCommitTextModified(LLUICtrl* ctrl, void* userdata);
static void onManualClientUpdate(void* data);
void onCommitClientTag(LLUICtrl* ctrl);
void onCommitCheckBox(LLUICtrl* ctrl, const LLSD& value);
void onCommitTextModified(LLUICtrl* ctrl, const LLSD& value);
static void onManualClientUpdate();
//Main
BOOL mUseAccountSettings;
BOOL mShowTPScreen;
@@ -62,6 +61,9 @@ protected:
bool mTurnAround;
bool mAnnounceSnapshots;
bool mAnnounceStreamMetadata;
bool mUnfocusedFloatersOpaque;
bool mCompleteNameProfiles;
bool mScriptErrorsStealFocus;
//Tags\Colors
BOOL mAscentBroadcastTag;
std::string mReportClientUUID;

View File

@@ -0,0 +1,81 @@
/**
* @file groupchatlistener.cpp
* @author Nat Goodspeed
* @date 2011-04-11
* @brief Implementation for groupchatlistener.
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
// Precompiled header
#include "llviewerprecompiledheaders.h"
// associated header
#include "groupchatlistener.h"
// STL headers
// std headers
// external library headers
// other Linden headers
#include "llgroupactions.h"
//#include "llimview.h"
namespace {
void startIm_wrapper(LLSD const & event)
{
LLUUID session_id = LLGroupActions::startIM(event["id"].asUUID());
sendReply(LLSDMap("session_id", LLSD(session_id)), event);
}
/* Singu TODO
void send_message_wrapper(const std::string& text, const LLUUID& session_id, const LLUUID& group_id)
{
LLIMModel::sendMessage(text, session_id, group_id, IM_SESSION_GROUP_START);
}
*/
}
GroupChatListener::GroupChatListener():
LLEventAPI("GroupChat",
"API to enter, leave, send and intercept group chat messages")
{
add("startIM",
"Enter a group chat in group with UUID [\"id\"]\n"
"Assumes the logged-in agent is already a member of this group.",
&startIm_wrapper);
add("endIM",
"Leave a group chat in group with UUID [\"id\"]\n"
"Assumes a prior successful startIM request.",
&LLGroupActions::endIM,
LLSDArray("id"));
/* Singu TODO
add("sendIM",
"send a groupchat IM",
&send_message_wrapper,
LLSDArray("text")("session_id")("group_id"));
*/
}
/*
static void sendMessage(const std::string& utf8_text, const LLUUID& im_session_id,
const LLUUID& other_participant_id, EInstantMessage dialog);
*/

View File

@@ -0,0 +1,41 @@
/**
* @file groupchatlistener.h
* @author Nat Goodspeed
* @date 2011-04-11
* @brief
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#if ! defined(LL_GROUPCHATLISTENER_H)
#define LL_GROUPCHATLISTENER_H
#include "lleventapi.h"
class GroupChatListener: public LLEventAPI
{
public:
GroupChatListener();
};
#endif /* ! defined(LL_GROUPCHATLISTENER_H) */

View File

@@ -40,6 +40,7 @@
#include "hbfloatergrouptitles.h"
#include "llagent.h"
#include "llgroupactions.h"
#include "lluictrlfactory.h"
#include "llviewercontrol.h"
@@ -145,13 +146,7 @@ void HBFloaterGroupTitles::onActivate(void* userdata)
LLUUID group_id = item->getColumn(LIST_GROUP_ID)->getValue().asUUID();
if (group_id != old_group_id)
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ActivateGroup);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addUUIDFast(_PREHASH_GroupID, group_id);
gAgent.sendReliableMessage();
LLGroupActions::activate(group_id);
}
// Set the title

View File

@@ -363,18 +363,24 @@ bool HippoFloaterXmlImpl::execute(LLFloater *floater, LLUICtrl *ctrl,
if (HippoFloaterXmlImpl *floaterp = dynamic_cast<HippoFloaterXmlImpl*>(ctrl)) {
floaterp->mIsNotifyOnClose = set;
} else {
if (set)
ctrl->setCommitCallback(boost::bind(&notifyCallback, _1, floater), ctrl);
else
ctrl->setCommitCallback(0);
HippoFloaterXmlImpl *thisFloater = static_cast<HippoFloaterXmlImpl*>(floater);
if (set) {
notice_ptr_t connptr(new notice_connection_t(ctrl->setCommitCallback(boost::bind(&notifyCallback, _1, floater), ctrl)));
thisFloater->mNotices[ctrl] = connptr;
} else {
thisFloater->mNotices.erase(ctrl);
}
}
} else if (key == "picker") {
bool set = (value != "0");
if (!dynamic_cast<HippoFloaterXmlImpl*>(ctrl)) {
if (set)
ctrl->setCommitCallback(boost::bind(&pickerCallback, _1, floater), ctrl);
else
ctrl->setCommitCallback(0);
HippoFloaterXmlImpl *thisFloater = static_cast<HippoFloaterXmlImpl*>(floater);
if (set) {
notice_ptr_t connptr(new notice_connection_t(ctrl->setCommitCallback(boost::bind(&pickerCallback, _1, floater), ctrl)));
thisFloater->mNotices[ctrl] = connptr;
} else {
thisFloater->mNotices.erase(ctrl);
}
}
}
}

View File

@@ -43,6 +43,7 @@
#include "llfirstuse.h"
#include "llfloatercamera.h"
#include "llfloatertools.h"
#include "llgroupactions.h"
#include "llgroupmgr.h"
#include "llhomelocationresponder.h"
#include "llhudmanager.h"
@@ -58,6 +59,7 @@
#include "llsky.h"
#include "llslurl.h"
#include "llsmoothstep.h"
#include "llspeakers.h"
#include "llstartup.h"
#include "llstatusbar.h"
#include "lltool.h"
@@ -78,6 +80,7 @@
#include "llviewerstats.h"
#include "llviewerwindow.h"
#include "llvoavatarself.h"
#include "llvoiceclient.h"
#include "llworld.h"
#include "llworldmap.h"
#include "llworldmapmessage.h"
@@ -86,11 +89,9 @@
#include "llurldispatcher.h"
#include "llimview.h" //For gIMMgr
//Floaters
#include "llfloateractivespeakers.h"
#include "llfloateravatarinfo.h"
#include "llfloaterchat.h"
#include "llfloaterdirectory.h"
#include "llfloatergroupinfo.h"
#include "llfloatergroups.h"
#include "llfloaterland.h"
#include "llfloatermap.h"
@@ -262,6 +263,56 @@ void LLAgent::parcelChangedCallback()
gAgent.mCanEditParcel = can_edit;
}
// static
bool LLAgent::isActionAllowed(const LLSD& sdname)
{
bool retval = false;
const std::string& param = sdname.asString();
if (param == "speak")
{
if ( gAgent.isVoiceConnected() &&
LLViewerParcelMgr::getInstance()->allowAgentVoice() &&
! LLVoiceClient::getInstance()->inTuningMode() )
{
retval = true;
}
else
{
retval = false;
}
}
return retval;
}
// static
void LLAgent::pressMicrophone(const LLSD& name)
{
//LLFirstUse::speak(false);
LLVoiceClient::getInstance()->inputUserControlState(true);
}
// static
void LLAgent::releaseMicrophone(const LLSD& name)
{
LLVoiceClient::getInstance()->inputUserControlState(false);
}
// static
void LLAgent::toggleMicrophone(const LLSD& name)
{
LLVoiceClient::getInstance()->toggleUserPTTState();
}
// static
bool LLAgent::isMicrophoneOn(const LLSD& sdname)
{
return LLVoiceClient::getInstance()->getUserPTTState();
}
// ************************************************************
// Enabled this definition to compile a 'hacked' viewer that
// locally believes the end user has godlike powers.
@@ -3235,7 +3286,7 @@ BOOL LLAgent::downGrabbed() const
void update_group_floaters(const LLUUID& group_id)
{
LLFloaterGroupInfo::refreshGroup(group_id);
LLGroupActions::refresh(group_id);
// update avatar info
LLFloaterAvatarInfo* fa = LLFloaterAvatarInfo::getInstance(gAgent.getID());
@@ -3288,7 +3339,7 @@ void LLAgent::processAgentDropGroup(LLMessageSystem *msg, void **)
LLGroupMgr::getInstance()->clearGroupData(group_id);
// close the floater for this group, if any.
LLFloaterGroupInfo::closeGroup(group_id);
LLGroupActions::closeGroup(group_id);
// refresh the group panel of the search window, if necessary.
LLFloaterDirectory::refreshGroup(group_id);
}
@@ -3367,7 +3418,7 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode
LLGroupMgr::getInstance()->clearGroupData(group_id);
// close the floater for this group, if any.
LLFloaterGroupInfo::closeGroup(group_id);
LLGroupActions::closeGroup(group_id);
// refresh the group panel of the search window,
//if necessary.
LLFloaterDirectory::refreshGroup(group_id);
@@ -3896,7 +3947,7 @@ bool LLAgent::teleportCore(bool is_local)
// MBW -- Let the voice client know a teleport has begun so it can leave the existing channel.
// This was breaking the case of teleporting within a single sim. Backing it out for now.
// gVoiceClient->leaveChannel();
// LLVoiceClient::getInstance()->leaveChannel();
return true;
}

View File

@@ -312,6 +312,22 @@ public:
static bool enableFlying();
BOOL canFly(); // Does this parcel allow you to fly?
//--------------------------------------------------------------------
// Voice
//--------------------------------------------------------------------
public:
bool isVoiceConnected() const { return mVoiceConnected; }
void setVoiceConnected(const bool b) { mVoiceConnected = b; }
static void pressMicrophone(const LLSD& name);
static void releaseMicrophone(const LLSD& name);
static void toggleMicrophone(const LLSD& name);
static bool isMicrophoneOn(const LLSD& sdname);
static bool isActionAllowed(const LLSD& sdname);
private:
bool mVoiceConnected;
//--------------------------------------------------------------------
// Chat
//--------------------------------------------------------------------

View File

@@ -3664,6 +3664,7 @@ public:
if (!LLApp::isRunning() || mFailed)
return;
/* Singu Note: This wasn't working when we detached copyable attachments early, changeOutfit instead
LLInventoryModel::item_array_t body_items, wear_items, obj_items, gest_items;
for(std::set<LLUUID>::const_iterator it = mWearItems.begin(); it != mWearItems.end(); ++it)
{
@@ -3692,6 +3693,8 @@ public:
if(!body_items.empty() || !wear_items.empty() || !obj_items.empty() || !gest_items.empty())
LLAppearanceMgr::instance().updateCOF(body_items, wear_items, obj_items, gest_items, false);
*/
LLAppearanceMgr::instance().changeOutfit(true, mFolderID, false);
}
private:
class LLCreateBase : public LLInventoryCallback
@@ -3880,6 +3883,7 @@ LLUUID LLAppearanceMgr::makeNewOutfitLegacy(const std::string& new_folder_name,
LLInventoryModel::item_array_t remove_items;
LLPointer<LLCreateLegacyOutfit> cb = new LLCreateLegacyOutfit(folder_id,boost::bind(&scroll_to_folder,folder_id),boost::bind(&show_created_outfit,folder_id,true));
uuid_vec_t obj_ids; // Collect the uuids of copyable objects, in order to keep any changes made in the copies
for (LLInventoryModel::item_array_t::const_iterator iter = items.begin();
iter != items.end();
@@ -3888,8 +3892,9 @@ LLUUID LLAppearanceMgr::makeNewOutfitLegacy(const std::string& new_folder_name,
LLViewerInventoryItem* item = (*iter);
LLViewerInventoryItem* base_item = item->getLinkedItem() ? item->getLinkedItem() : item;
bool is_copy = base_item->getPermissions().allowCopyBy(gAgent.getID());
bool is_obj = base_item->getInventoryType() == LLInventoryType::IT_OBJECT;
//Just treat 'object' type as modifiable... permission slam screws them up pretty well.
bool is_mod = base_item->getInventoryType() == LLInventoryType::IT_OBJECT || base_item->getPermissions().allowModifyBy(gAgent.getID());
bool is_mod = is_obj || base_item->getPermissions().allowModifyBy(gAgent.getID());
//If it's multi-worn we want to create a copy of the item if possible AND create a new link to that new copy with the same desc as the old link.
bool is_multi = base_item->isWearableType() && gAgentWearables.getWearableCount(base_item->getWearableType()) > 1 ;
@@ -3899,9 +3904,12 @@ LLUUID LLAppearanceMgr::makeNewOutfitLegacy(const std::string& new_folder_name,
}
else if( is_copy )
{
if (is_obj) obj_ids.push_back(base_item->getUUID()); // If it's a copyable object, store it for later
cb->makeCopy(item,is_multi && use_links);
}
}
if (gSavedSettings.getBOOL("LiruLegacyOutfitStoreObjChanges")) // As a last resort, someone may create a legacy outfit to undo attachment changes
LLAppearanceMgr::instance().removeItemsFromAvatar(obj_ids); // The avatar will have to go without these for now
cb->dispatch();
return folder_id;

View File

@@ -79,7 +79,7 @@
#include "llfirstuse.h"
#include "llrender.h"
#include "llvector4a.h"
#include "llimpanel.h" // For LLVoiceClient and LLVoiceChannel
#include "llvoicechannel.h"
#include "llvoavatarself.h"
#include "llurlmatch.h"
#include "llprogressview.h"
@@ -266,12 +266,6 @@ LLTimer gLogoutTimer;
static const F32 LOGOUT_REQUEST_TIME = 6.f; // this will be cut short by the LogoutReply msg.
F32 gLogoutMaxTime = LOGOUT_REQUEST_TIME;
// <edit>
LLUUID gSystemFolderRoot;
LLUUID gSystemFolderSettings;
LLUUID gSystemFolderAssets;
// </edit>
BOOL gDisconnected = FALSE;
// used to restore texture state after a mode switch
@@ -650,7 +644,7 @@ bool LLAppViewer::init()
AIHTTPTimeoutPolicy policy_tmp(
"CurlTimeout* Debug Settings",
gSavedSettings.getU32("CurlTimeoutDNSLookup"),
gSavedSettings.getU32("CurlTimeoutConnect"),
/*gSavedSettings.getU32("CurlTimeoutConnect") Temporary HACK: 30 is the current max*/ 30,
gSavedSettings.getU32("CurlTimeoutReplyDelay"),
gSavedSettings.getU32("CurlTimeoutLowSpeedTime"),
gSavedSettings.getU32("CurlTimeoutLowSpeedLimit"),
@@ -1102,7 +1096,7 @@ bool LLAppViewer::mainLoop()
// Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be instantiated.
LLVoiceChannel::initClass();
LLVoiceClient::init(gServicePump);
LLVoiceClient::getInstance()->init(gServicePump);
LLTimer frameTimer,idleTimer,periodicRenderingTimer;
LLTimer debugTime;
@@ -1459,7 +1453,7 @@ bool LLAppViewer::cleanup()
// to ensure shutdown order
LLMortician::setZealous(TRUE);
LLVoiceClient::terminate();
LLVoiceClient::getInstance()->terminate();
disconnectViewer();
@@ -4255,8 +4249,10 @@ void LLAppViewer::sendLogoutRequest()
gLogoutMaxTime = LOGOUT_REQUEST_TIME;
mLogoutRequestSent = TRUE;
if(gVoiceClient)
gVoiceClient->leaveChannel();
if(LLVoiceClient::instanceExists())
{
LLVoiceClient::getInstance()->leaveChannel();
}
//Set internal status variables and marker files
gLogoutInProgress = TRUE;

View File

@@ -321,12 +321,6 @@ extern LLTimer gLogoutTimer;
extern F32 gSimLastTime;
extern F32 gSimFrames;
// <edit>
extern LLUUID gSystemFolderRoot;
extern LLUUID gSystemFolderSettings;
extern LLUUID gSystemFolderAssets;
// </edit>
extern BOOL gDisconnected;
extern LLFrameTimer gRestoreGLTimer;

View File

@@ -1,112 +0,0 @@
// <edit>
#include "llviewerprecompiledheaders.h"
#include "llvfs.h"
#include "llapr.h"
#include "llvfile.h"
#include "llassetconverter.h"
#include "llviewertexturelist.h"
#include "llvorbisencode.h"
#include "llwearable.h"
#include "llbvhloader.h"
#include <boost/bind.hpp>
struct conversion_s
{
std::string extension;
LLAssetType::EType type;
boost::function<bool(const std::string&, const std::string&)> conv_fn;
}conversion_list[] =
{
{ "bmp", LLAssetType::AT_TEXTURE, boost::bind(&LLViewerTextureList::createUploadFile,_1,_2,IMG_CODEC_BMP) },
{ "tga", LLAssetType::AT_TEXTURE, boost::bind(&LLViewerTextureList::createUploadFile,_1,_2,IMG_CODEC_TGA) },
{ "jpg", LLAssetType::AT_TEXTURE, boost::bind(&LLViewerTextureList::createUploadFile,_1,_2,IMG_CODEC_JPEG)},
{ "jpeg", LLAssetType::AT_TEXTURE, boost::bind(&LLViewerTextureList::createUploadFile,_1,_2,IMG_CODEC_JPEG)},
{ "png", LLAssetType::AT_TEXTURE, boost::bind(&LLViewerTextureList::createUploadFile,_1,_2,IMG_CODEC_PNG) },
{ "jp2", LLAssetType::AT_TEXTURE, &LLAssetConverter::copyFile },
{ "j2k", LLAssetType::AT_TEXTURE, &LLAssetConverter::copyFile },
{ "j2c", LLAssetType::AT_TEXTURE, &LLAssetConverter::copyFile },
{ "wav", LLAssetType::AT_SOUND, &encode_vorbis_file },
{ "ogg", LLAssetType::AT_SOUND, &LLAssetConverter::copyFile },
{ "bvh", LLAssetType::AT_ANIMATION, &LLAssetConverter::copyBVH },
{ "animatn", LLAssetType::AT_ANIMATION, &LLAssetConverter::copyFile },
{ "gesture", LLAssetType::AT_GESTURE, &LLAssetConverter::copyFile },
{ "notecard", LLAssetType::AT_NOTECARD, &LLAssetConverter::copyFile },
{ "lsl", LLAssetType::AT_LSL_TEXT, &LLAssetConverter::copyFile },
//tmp ?
};
// static
extern std::string STATUS[];
LLAssetType::EType LLAssetConverter::convert(const std::string &src_filename, const std::string &filename)
{
std::string exten = gDirUtilp->getExtension(src_filename);
for(U32 i = 0;i < sizeof(conversion_list) / sizeof(conversion_list[0]); ++i)
{
if(conversion_list[i].extension == exten)
{
return conversion_list[i].conv_fn(src_filename, filename) ?
conversion_list[i].type : LLAssetType::AT_NONE;
}
}
LLWearableType::EType wear_type = LLWearableType::typeNameToType(exten);
if(wear_type != LLWearableType::WT_NONE && copyFile(src_filename, filename))
{
return LLWearableType::getAssetType(wear_type);
}
llwarns << "Unhandled extension" << llendl;
return LLAssetType::AT_NONE;
}
bool LLAssetConverter::copyFile(const std::string &src_filename, const std::string &dst_filename)
{
S32 src_size;
LLAPRFile src_fp(src_filename, LL_APR_RB, &src_size);
if(!src_fp.getFileHandle()) return false;
LLAPRFile dst_fp(dst_filename, LL_APR_WB);
if(!dst_fp.getFileHandle()) return false;
std::vector<char> buffer(src_size + 1);
src_fp.read(&buffer[0], src_size);
dst_fp.write(&buffer[0], src_size);
return true;
}
bool LLAssetConverter::copyBVH(const std::string &src_filename, const std::string &dst_filename)
{
S32 file_size;
LLAPRFile fp(src_filename, LL_APR_RB, &file_size);
if(!fp.getFileHandle()) return false;
std::vector<char> buffer(file_size + 1);
ELoadStatus load_status = E_ST_OK;
S32 line_number = 0;
LLBVHLoader* loaderp = new LLBVHLoader(&buffer[0], load_status, line_number);
if(load_status == E_ST_NO_XLT_FILE)
{
llwarns << "NOTE: No translation table found." << llendl;
}
else if(load_status != E_ST_OK)
{
llwarns << "ERROR: [line: " << line_number << "] " << STATUS[load_status].c_str() << llendl;
}
buffer.resize(loaderp->getOutputSize());
LLDataPackerBinaryBuffer dp((U8*)&buffer[0], buffer.size());
loaderp->serialize(dp);
delete loaderp;
LLAPRFile apr_file(dst_filename, LL_APR_RB, &file_size);
if(!apr_file.getFileHandle()) return false;
apr_file.write(&buffer[0], buffer.size());
return true;
}
// </edit>

View File

@@ -1,16 +0,0 @@
// <edit>
#ifndef LL_LLASSETCONVERTER_H
#define LL_LLASSETCONVERTER_H
#include "llcommon.h"
#include "llassettype.h"
class LLAssetConverter
{
public:
static LLAssetType::EType convert(const std::string &src_filename, const std::string &filename);
static bool copyFile(const std::string &src_filename, const std::string &dest_filename);
static bool copyBVH(const std::string &src_filename, const std::string &dst_filename);
};
#endif
// </edit>

View File

@@ -0,0 +1,760 @@
/**
* @file llavataractions.cpp
* @brief Friend-related actions (add, remove, offer teleport, etc)
*
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
#include "llavataractions.h"
#include "llavatarnamecache.h" // IDEVO
#include "llnotifications.h"
#include "llnotificationsutil.h" // for LLNotificationsUtil
#include "roles_constants.h" // for GP_MEMBER_INVITE
#include "llagent.h"
#include "llcallingcard.h" // LLAvatarTracker
#include "llfloateravatarinfo.h"
#include "llfloatergroupinvite.h"
#include "llfloatergroups.h"
#include "llfloaterworldmap.h"
#include "llgivemoney.h"
#include "llimview.h" // for gIMMgr
#include "llinventoryobserver.h"
#include "llmutelist.h"
#include "lltrans.h"
#include "llvoiceclient.h"
#include "llweb.h"
#include "llslurl.h" // IDEVO
// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h
#include "rlvhandler.h"
// [/RLVa:KB]
extern const S32 TRANS_GIFT;
void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_group = FALSE, S32 trx_type = TRANS_GIFT, const std::string& desc = LLStringUtil::null);
void handle_lure(const uuid_vec_t& ids);
void send_improved_im(const LLUUID& to_id, const std::string& name, const std::string& message, U8 offline, EInstantMessage dialog, const LLUUID& id, U32 timestamp = NO_TIMESTAMP, const U8* binary_bucket = (U8*)EMPTY_BINARY_BUCKET, S32 binary_bucket_size = EMPTY_BINARY_BUCKET_SIZE);
// static
void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name)
{
if(id == gAgentID)
{
LLNotificationsUtil::add("AddSelfFriend");
return;
}
LLSD args;
args["NAME"] = name;
LLSD payload;
payload["id"] = id;
payload["name"] = name;
LLNotificationsUtil::add("AddFriendWithMessage", args, payload, &callbackAddFriendWithMessage);
}
void on_avatar_name_friendship(const LLUUID& id, const LLAvatarName av_name)
{
LLAvatarActions::requestFriendshipDialog(id, av_name.getCompleteName());
}
// static
void LLAvatarActions::requestFriendshipDialog(const LLUUID& id)
{
if(id.isNull())
{
return;
}
LLAvatarNameCache::get(id, boost::bind(&on_avatar_name_friendship, _1, _2));
}
// static
void LLAvatarActions::removeFriendDialog(const LLUUID& id)
{
if (id.isNull())
return;
uuid_vec_t ids;
ids.push_back(id);
removeFriendsDialog(ids);
}
// static
void LLAvatarActions::removeFriendsDialog(const uuid_vec_t& ids)
{
if(ids.size() == 0)
return;
LLSD args;
std::string msgType;
if(ids.size() == 1)
{
LLUUID agent_id = ids[0];
std::string av_name;
if(LLAvatarNameCache::getPNSName(agent_id, av_name))
{
args["NAME"] = av_name;
}
msgType = "RemoveFromFriends";
}
else
{
msgType = "RemoveMultipleFromFriends";
}
LLSD payload;
for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
{
payload["ids"].append(*it);
}
LLNotificationsUtil::add(msgType,
args,
payload,
&handleRemove);
}
// static
void LLAvatarActions::offerTeleport(const LLUUID& invitee)
{
if (invitee.isNull())
return;
LLDynamicArray<LLUUID> ids;
ids.push_back(invitee);
offerTeleport(ids);
}
// static
void LLAvatarActions::offerTeleport(const uuid_vec_t& ids)
{
if (ids.size() == 0)
return;
handle_lure(ids);
}
static void on_avatar_name_cache_start_im(const LLUUID& agent_id, const LLAvatarName& av_name)
{
static LLCachedControl<bool> tear_off("OtherChatsTornOff");
if (!tear_off) gIMMgr->setFloaterOpen(true);
gIMMgr->addSession(LLCacheName::cleanFullName(av_name.getLegacyName()), IM_NOTHING_SPECIAL, agent_id);
make_ui_sound("UISndStartIM");
}
// static
void LLAvatarActions::startIM(const LLUUID& id)
{
if (id.isNull() || gAgentID == id)
return;
// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h
if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canStartIM(id)) )
{
LLUUID idSession = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL, id);
if ( (idSession.notNull()) && (!gIMMgr->hasSession(idSession)) )
{
make_ui_sound("UISndInvalidOp");
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("agent", id, "completename").getSLURLString()));
return;
}
}
// [/RLVa:KB]
LLAvatarName av_name;
if (LLAvatarNameCache::get(id, &av_name)) // Bypass expiration, open NOW!
on_avatar_name_cache_start_im(id, av_name);
else
LLAvatarNameCache::get(id, boost::bind(&on_avatar_name_cache_start_im, _1, _2));
}
// static
void LLAvatarActions::endIM(const LLUUID& id)
{
if (id.isNull())
return;
LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL, id);
if (session_id.notNull())
{
gIMMgr->removeSession(session_id);
}
}
static void on_avatar_name_cache_start_call(const LLUUID& agent_id,
const LLAvatarName& av_name)
{
LLUUID session_id = gIMMgr->addSession(LLCacheName::cleanFullName(av_name.getLegacyName()), IM_NOTHING_SPECIAL, agent_id);
if (session_id.notNull())
{
gIMMgr->startCall(session_id);
}
make_ui_sound("UISndStartIM");
}
// static
void LLAvatarActions::startCall(const LLUUID& id)
{
if (id.isNull())
{
return;
}
// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h
if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canStartIM(id)) )
{
LLUUID idSession = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL, id);
if ( (idSession.notNull()) && (!gIMMgr->hasSession(idSession)) )
{
make_ui_sound("UISndInvalidOp");
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("agent", id, "completename").getSLURLString()));
return;
}
}
// [/RLVa:KB]
LLAvatarNameCache::get(id,
boost::bind(&on_avatar_name_cache_start_call, _1, _2));
}
// static
void LLAvatarActions::startAdhocCall(const uuid_vec_t& ids)
{
if (ids.size() == 0)
{
return;
}
// convert vector into LLDynamicArray for addSession
LLDynamicArray<LLUUID> id_array;
for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
{
// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h
const LLUUID& idAgent = *it;
if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canStartIM(idAgent)) )
{
make_ui_sound("UISndInvalidOp");
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTCONF, LLSD().with("RECIPIENT", LLSLURL("agent", idAgent, "completename").getSLURLString()));
return;
}
id_array.push_back(idAgent);
// [/RLVa:KB]
// id_array.push_back(*it);
}
// create the new ad hoc voice session
const std::string title = LLTrans::getString("conference-title");
LLUUID session_id = gIMMgr->addSession(title, IM_SESSION_CONFERENCE_START,
ids[0], id_array);
if (session_id.isNull())
{
return;
}
gIMMgr->autoStartCallOnStartup(session_id);
make_ui_sound("UISndStartIM");
}
/* AD *TODO: Is this function needed any more?
I fixed it a bit(added check for canCall), but it appears that it is not used
anywhere. Maybe it should be removed?
// static
bool LLAvatarActions::isCalling(const LLUUID &id)
{
if (id.isNull() || !canCall())
{
return false;
}
LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL, id);
return (LLIMModel::getInstance()->findIMSession(session_id) != NULL);
}*/
//static
bool LLAvatarActions::canCall()
{
return LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking();
}
// static
void LLAvatarActions::startConference(const uuid_vec_t& ids)
{
for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
{
// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h
const LLUUID& idAgent = *it;
if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canStartIM(idAgent)) )
{
make_ui_sound("UISndInvalidOp");
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTCONF, LLSD().with("RECIPIENT", LLSLURL("agent", idAgent, "completename").getSLURLString()));
return;
}
// [/RLVa:KB]
}
static LLCachedControl<bool> tear_off("OtherChatsTornOff");
if (!tear_off) gIMMgr->setFloaterOpen(true);
const std::string title = LLTrans::getString("conference-title");
gIMMgr->addSession(title, IM_SESSION_CONFERENCE_START, ids[0], ids);
make_ui_sound("UISndStartIM");
}
/* Singu TODO: Web Profiles
static const char* get_profile_floater_name(const LLUUID& avatar_id)
{
// Use different floater XML for our profile to be able to save its rect.
return avatar_id == gAgentID ? "my_profile" : "profile";
}
*/
static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarName& av_name)
{
//if (!gSavedSettings.getBOOL("UseWebProfiles")
//{
LLFloaterAvatarInfo* floater = LLFloaterAvatarInfo::getInstance(agent_id);
if(!floater)
{
floater = new LLFloaterAvatarInfo(av_name.getCompleteName()+" - "+LLTrans::getString("Command_Profile_Label"), agent_id);
floater->center();
}
// ...bring that window to front
floater->open(); /*Flawfinder: ignore*/
//}
/*
else
{
std::string username = av_name.mUsername;
if (username.empty())
{
username = LLCacheName::buildUsername(av_name.mDisplayName);
}
llinfos << "opening web profile for " << username << llendl;
std::string url = getProfileURL(username);
// PROFILES: open in webkit window
LLFloaterWebContent::Params p;
p.url(url).
id(agent_id.asString());
LLFloaterReg::showInstance(get_profile_floater_name(agent_id), p);
}
*/
}
// static
void LLAvatarActions::showProfile(const LLUUID& id)
{
if (id.notNull())
{
LLAvatarName av_name;
if (LLAvatarNameCache::get(id, &av_name)) // Bypass expiration, open NOW!
on_avatar_name_show_profile(id, av_name);
else
LLAvatarNameCache::get(id, boost::bind(&on_avatar_name_show_profile, _1, _2));
}
}
//static
bool LLAvatarActions::profileVisible(const LLUUID& id)
{
LLFloater* browser = getProfileFloater(id);
return browser && browser->getVisible();
}
//static
LLFloater* LLAvatarActions::getProfileFloater(const LLUUID& id)
{
LLFloater* browser;
//if (!gSavedSettings.getBOOL("UseWebProfiles")
browser = LLFloaterAvatarInfo::getInstance(id);
/*else
browser = dynamic_cast<LLFloaterWebContent*>
(LLFloaterReg::findInstance(get_profile_floater_name(id), LLSD().with("id", id)));
*/
return browser;
}
//static
void LLAvatarActions::hideProfile(const LLUUID& id)
{
LLFloater* browser = getProfileFloater(id);
if (browser)
{
browser->close();
}
}
// static
void LLAvatarActions::showOnMap(const LLUUID& id)
{
std::string av_name;
if (!LLAvatarNameCache::getPNSName(id, av_name))
{
LLAvatarNameCache::get(id, boost::bind(&LLAvatarActions::showOnMap, id));
return;
}
gFloaterWorldMap->trackAvatar(id, av_name);
LLFloaterWorldMap::show(true);
}
// static
void LLAvatarActions::pay(const LLUUID& id)
{
LLNotification::Params params("BusyModePay");
params.functor(boost::bind(&LLAvatarActions::handlePay, _1, _2, id));
if (gAgent.getBusy())
{
// warn users of being in busy mode during a transaction
LLNotifications::instance().add(params);
}
else
{
LLNotifications::instance().forceResponse(params, 1);
}
}
// static
void LLAvatarActions::kick(const LLUUID& id)
{
LLSD payload;
payload["avatar_id"] = id;
LLNotifications::instance().add("KickUser", LLSD(), payload, handleKick);
}
// static
void LLAvatarActions::freeze(const LLUUID& id)
{
LLSD payload;
payload["avatar_id"] = id;
LLNotifications::instance().add("FreezeUser", LLSD(), payload, handleFreeze);
}
// static
void LLAvatarActions::unfreeze(const LLUUID& id)
{
LLSD payload;
payload["avatar_id"] = id;
LLNotifications::instance().add("UnFreezeUser", LLSD(), payload, handleUnfreeze);
}
//static
void LLAvatarActions::csr(const LLUUID& id)
{
std::string name;
if (!gCacheName->getFullName(id, name)) return;
std::string url = "http://csr.lindenlab.com/agent/";
// slow and stupid, but it's late
S32 len = name.length();
for (S32 i = 0; i < len; i++)
{
if (name[i] == ' ')
{
url += "%20";
}
else
{
url += name[i];
}
}
LLWeb::loadURL(url);
}
// Singu TODO: Share inventory code block should live here
// static
void LLAvatarActions::toggleBlock(const LLUUID& id)
{
std::string name;
gCacheName->getFullName(id, name); // needed for mute
LLMute mute(id, name, LLMute::AGENT);
if (LLMuteList::getInstance()->isMuted(mute.mID, mute.mName))
{
LLMuteList::getInstance()->remove(mute);
}
else
{
LLMuteList::getInstance()->add(mute);
}
}
// static
void LLAvatarActions::toggleMuteVoice(const LLUUID& id)
{
std::string name;
gCacheName->getFullName(id, name); // needed for mute
LLMuteList* mute_list = LLMuteList::getInstance();
bool is_muted = mute_list->isMuted(id, LLMute::flagVoiceChat);
LLMute mute(id, name, LLMute::AGENT);
if (!is_muted)
{
mute_list->add(mute, LLMute::flagVoiceChat);
}
else
{
mute_list->remove(mute, LLMute::flagVoiceChat);
}
}
// static
bool LLAvatarActions::canOfferTeleport(const LLUUID& id)
{
// First use LLAvatarTracker::isBuddy()
// If LLAvatarTracker::instance().isBuddyOnline function only is used
// then for avatars that are online and not a friend it will return false.
// But we should give an ability to offer a teleport for such avatars.
if(LLAvatarTracker::instance().isBuddy(id))
{
return LLAvatarTracker::instance().isBuddyOnline(id);
}
return true;
}
// static
bool LLAvatarActions::canOfferTeleport(const uuid_vec_t& ids)
{
// We can't send more than 250 lures in a single message, so disable this
// button when there are too many id's selected.
if(ids.size() > 250) return false;
bool result = true;
for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
{
if(!canOfferTeleport(*it))
{
result = false;
break;
}
}
return result;
}
void LLAvatarActions::inviteToGroup(const LLUUID& id)
{
LLFloaterGroupPicker* widget = LLFloaterGroupPicker::showInstance(LLSD(id));
if (widget)
{
widget->center();
widget->setPowersMask(GP_MEMBER_INVITE);
//widget->removeNoneOption();
widget->setSelectCallback(callback_invite_to_group, (void*)&id);
}
}
//== private methods ========================================================================================
// static
bool LLAvatarActions::handleRemove(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
const LLSD& ids = notification["payload"]["ids"];
for (LLSD::array_const_iterator itr = ids.beginArray(); itr != ids.endArray(); ++itr)
{
LLUUID id = itr->asUUID();
const LLRelationship* ip = LLAvatarTracker::instance().getBuddyInfo(id);
if (ip)
{
switch (option)
{
case 0: // YES
if( ip->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS))
{
LLAvatarTracker::instance().empower(id, FALSE);
LLAvatarTracker::instance().notifyObservers();
}
LLAvatarTracker::instance().terminateBuddy(id);
LLAvatarTracker::instance().notifyObservers();
gInventory.addChangedMask(LLInventoryObserver::LABEL | LLInventoryObserver::CALLING_CARD, LLUUID::null);
gInventory.notifyObservers();
break;
case 1: // NO
default:
llinfos << "No removal performed." << llendl;
break;
}
}
}
return false;
}
// static
bool LLAvatarActions::handlePay(const LLSD& notification, const LLSD& response, LLUUID avatar_id)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option == 0)
{
gAgent.clearBusy();
}
LLFloaterPay::payDirectly(&give_money, avatar_id, /*is_group=*/false);
return false;
}
// static
void LLAvatarActions::callback_invite_to_group(LLUUID group_id, void* id)
{
uuid_vec_t agent_ids;
agent_ids.push_back(*static_cast<const LLUUID*>(id));
LLFloaterGroupInvite::showForGroup(group_id, &agent_ids);
}
// static
bool LLAvatarActions::callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option == 0)
{
requestFriendship(notification["payload"]["id"].asUUID(),
notification["payload"]["name"].asString(),
response["message"].asString());
}
return false;
}
// static
bool LLAvatarActions::handleKick(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
if (option == 0)
{
LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID();
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_GodKickUser);
msg->nextBlockFast(_PREHASH_UserInfo);
msg->addUUIDFast(_PREHASH_GodID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_GodSessionID, gAgent.getSessionID());
msg->addUUIDFast(_PREHASH_AgentID, avatar_id );
msg->addU32("KickFlags", KICK_FLAGS_DEFAULT );
msg->addStringFast(_PREHASH_Reason, response["message"].asString() );
gAgent.sendReliableMessage();
}
return false;
}
bool LLAvatarActions::handleFreeze(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
if (option == 0)
{
LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID();
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_GodKickUser);
msg->nextBlockFast(_PREHASH_UserInfo);
msg->addUUIDFast(_PREHASH_GodID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_GodSessionID, gAgent.getSessionID());
msg->addUUIDFast(_PREHASH_AgentID, avatar_id );
msg->addU32("KickFlags", KICK_FLAGS_FREEZE );
msg->addStringFast(_PREHASH_Reason, response["message"].asString() );
gAgent.sendReliableMessage();
}
return false;
}
bool LLAvatarActions::handleUnfreeze(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
std::string text = response["message"].asString();
if (option == 0)
{
LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID();
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_GodKickUser);
msg->nextBlockFast(_PREHASH_UserInfo);
msg->addUUIDFast(_PREHASH_GodID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_GodSessionID, gAgent.getSessionID());
msg->addUUIDFast(_PREHASH_AgentID, avatar_id );
msg->addU32("KickFlags", KICK_FLAGS_UNFREEZE );
msg->addStringFast(_PREHASH_Reason, text );
gAgent.sendReliableMessage();
}
return false;
}
// static
void LLAvatarActions::requestFriendship(const LLUUID& target_id, const std::string& target_name, const std::string& message)
{
const LLUUID calling_card_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD);
send_improved_im(target_id,
target_name,
message,
IM_ONLINE,
IM_FRIENDSHIP_OFFERED,
calling_card_folder_id);
LLSD args;
args["TO_NAME"] = target_name;
LLSD payload;
payload["from_id"] = target_id;
//payload["SUPPRESS_TOAST"] = true;
LLNotificationsUtil::add("FriendshipOffered", args, payload);
}
//static
bool LLAvatarActions::isFriend(const LLUUID& id)
{
return ( NULL != LLAvatarTracker::instance().getBuddyInfo(id) );
}
// static
bool LLAvatarActions::isBlocked(const LLUUID& id)
{
return LLMuteList::getInstance()->isMuted(id);
}
// static
bool LLAvatarActions::isVoiceMuted(const LLUUID& id)
{
return LLMuteList::getInstance()->isMuted(id, LLMute::flagVoiceChat);
}
// static
bool LLAvatarActions::canBlock(const LLUUID& id)
{
bool is_linden = LLMuteList::getInstance()->isLinden(id);
bool is_self = id == gAgentID;
return !is_self && !is_linden;
}

View File

@@ -0,0 +1,197 @@
/**
* @file llavataractions.h
* @brief Friend-related actions (add, remove, offer teleport, etc)
*
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LL_LLAVATARACTIONS_H
#define LL_LLAVATARACTIONS_H
class LLFloater;
/**
* Friend-related actions (add, remove, offer teleport, etc)
*/
class LLAvatarActions
{
public:
/**
* Show a dialog explaining what friendship entails, then request friendship.
*/
static void requestFriendshipDialog(const LLUUID& id, const std::string& name);
/**
* Show a dialog explaining what friendship entails, then request friendship.
*/
static void requestFriendshipDialog(const LLUUID& id);
/**
* Show a friend removal dialog.
*/
static void removeFriendDialog(const LLUUID& id);
static void removeFriendsDialog(const uuid_vec_t& ids);
/**
* Show teleport offer dialog.
*/
static void offerTeleport(const LLUUID& invitee);
static void offerTeleport(const uuid_vec_t& ids);
/**
* Start instant messaging session.
*/
static void startIM(const LLUUID& id);
/**
* End instant messaging session.
*/
static void endIM(const LLUUID& id);
/**
* Start an avatar-to-avatar voice call with another user
*/
static void startCall(const LLUUID& id);
/**
* Start an ad-hoc conference voice call with multiple users
*/
static void startAdhocCall(const uuid_vec_t& ids);
/**
* Start conference chat with the given avatars.
*/
static void startConference(const uuid_vec_t& ids);
/**
* Show avatar profile.
*/
static void showProfile(const LLUUID& id);
static void hideProfile(const LLUUID& id);
static bool profileVisible(const LLUUID& id);
static LLFloater* getProfileFloater(const LLUUID& id);
/**
* Show avatar on world map.
*/
static void showOnMap(const LLUUID& id);
/**
* Give money to the avatar.
*/
static void pay(const LLUUID& id);
/**
* Block/unblock the avatar.
*/
static void toggleBlock(const LLUUID& id);
/**
* Block/unblock the avatar voice.
*/
static void toggleMuteVoice(const LLUUID& id);
/**
* Return true if avatar with "id" is a friend
*/
static bool isFriend(const LLUUID& id);
/**
* @return true if the avatar is blocked
*/
static bool isBlocked(const LLUUID& id);
/**
* @return true if the avatar voice is blocked
*/
static bool isVoiceMuted(const LLUUID& id);
/**
* @return true if you can block the avatar
*/
static bool canBlock(const LLUUID& id);
/**
* Return true if the avatar is in a P2P voice call with a given user
*/
/* AD *TODO: Is this function needed any more?
I fixed it a bit(added check for canCall), but it appears that it is not used
anywhere. Maybe it should be removed?
static bool isCalling(const LLUUID &id);*/
/**
* @return true if call to the resident can be made
*/
static bool canCall();
/**
* Invite avatar to a group.
*/
static void inviteToGroup(const LLUUID& id);
/**
* Kick avatar off grid
*/
static void kick(const LLUUID& id);
/**
* Freeze avatar
*/
static void freeze(const LLUUID& id);
/**
* Unfreeze avatar
*/
static void unfreeze(const LLUUID& id);
/**
* Open csr page for avatar
*/
static void csr(const LLUUID& id);
/**
* Checks whether we can offer a teleport to the avatar, only offline friends
* cannot be offered a teleport.
*
* @return false if avatar is a friend and not visibly online
*/
static bool canOfferTeleport(const LLUUID& id);
/**
* @return false if any one of the specified avatars a friend and not visibly online
*/
static bool canOfferTeleport(const uuid_vec_t& ids);
private:
static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response);
static bool handleRemove(const LLSD& notification, const LLSD& response);
static bool handlePay(const LLSD& notification, const LLSD& response, LLUUID avatar_id);
static bool handleKick(const LLSD& notification, const LLSD& response);
static bool handleFreeze(const LLSD& notification, const LLSD& response);
static bool handleUnfreeze(const LLSD& notification, const LLSD& response);
static void callback_invite_to_group(LLUUID group_id, void* id);
public:
// Just request friendship, no dialog.
static void requestFriendship(const LLUUID& target_id, const std::string& target_name, const std::string& message);
};
#endif // LL_LLAVATARACTIONS_H

View File

@@ -3,10 +3,9 @@
* @brief LLColorSwatch class implementation
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Second Life Viewer Source Code
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
@@ -277,11 +276,11 @@ void LLColorSwatchCtrl::onColorChanged ( void* data, EColorPickOp pick_op )
if (pick_op == COLOR_CANCEL && subject->mOnCancelCallback)
{
subject->mOnCancelCallback(subject, subject->mCallbackUserData);
subject->mOnCancelCallback(subject, LLSD());
}
else if (pick_op == COLOR_SELECT && subject->mOnSelectCallback)
{
subject->mOnSelectCallback(subject, subject->mCallbackUserData);
subject->mOnSelectCallback(subject, LLSD());
}
else
{

View File

@@ -3,10 +3,9 @@
* @brief LLColorSwatch class definition
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Second Life Viewer Source Code
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
@@ -70,8 +69,8 @@ public:
void setValid(BOOL valid);
void setLabel(const std::string& label);
void setCanApplyImmediately(BOOL apply) { mCanApplyImmediately = apply; }
void setOnCancelCallback(LLUICtrlCallback cb) { mOnCancelCallback = cb; }
void setOnSelectCallback(LLUICtrlCallback cb) { mOnSelectCallback = cb; }
void setOnCancelCallback(commit_callback_t cb) { mOnCancelCallback = cb; }
void setOnSelectCallback(commit_callback_t cb) { mOnSelectCallback = cb; }
void setFallbackImageName(const std::string& name) { mFallbackImageName = name; }
void showPicker(BOOL take_focus);
@@ -96,8 +95,8 @@ protected:
LLHandle<LLFloater> mPickerHandle;
LLViewBorder* mBorder;
BOOL mCanApplyImmediately;
LLUICtrlCallback mOnCancelCallback;
LLUICtrlCallback mOnSelectCallback;
commit_callback_t mOnCancelCallback;
commit_callback_t mOnSelectCallback;
LLPointer<LLUIImage> mAlphaGradientImage;
std::string mFallbackImageName;

View File

@@ -39,6 +39,7 @@
#include "llfasttimerview.h"
#include "llconsole.h"
#include "lltextureview.h"
#include "aihttpview.h"
#include "llresmgr.h"
#include "imageids.h"
#include "llvelocitybar.h"
@@ -93,6 +94,16 @@ LLDebugView::LLDebugView(const std::string& name, const LLRect &rect)
addChild(gTextureView);
//gTextureView->reshape(r.getWidth(), r.getHeight(), TRUE);
r.set(150, rect.getHeight() - 50, 870, 100);
AIHTTPView::Params hvp;
hvp.name("gHttpView");
hvp.rect(r);
hvp.visible(false);
gHttpView = LLUICtrlFactory::create<AIHTTPView>(hvp);
//gHttpView->setFollowsBottom();
//gHttpView->setFollowsLeft();
addChild(gHttpView);
if(gAuditTexture)
{
r.set(150, rect.getHeight() - 50, 900 + LLImageGL::sTextureLoadedCounter.size() * 30, 100);
@@ -129,6 +140,7 @@ LLDebugView::~LLDebugView()
// These have already been deleted. Fix the globals appropriately.
gDebugView = NULL;
gTextureView = NULL;
gHttpView = NULL;
gTextureSizeView = NULL;
gTextureCategoryView = NULL;
}

View File

@@ -9,31 +9,27 @@
* Altered to support a callback so it can return the item
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Pulled into its own file for more widespread use
* Rewritten by Liru Færs to act as its own ui element and use a control
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* $LicenseInfo:firstyear=2004&license=viewergpl$
*
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (c) 2004-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/

View File

@@ -9,31 +9,27 @@
* Altered to support a callback so it can return the item
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Pulled into its own file for more widespread use
* Rewritten by Liru Færs to act as its own ui element and use a control
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* $LicenseInfo:firstyear=2004&license=viewergpl$
*
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (c) 2004-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/

File diff suppressed because it is too large Load Diff

View File

@@ -3,10 +3,9 @@
* @brief Management interface for muting and controlling volume of residents currently speaking
*
* $LicenseInfo:firstyear=2005&license=viewergpl$
*
* Second Life Viewer Source Code
* Copyright (c) 2005-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
@@ -33,156 +32,10 @@
#ifndef LL_LLFLOATERACTIVESPEAKERS_H
#define LL_LLFLOATERACTIVESPEAKERS_H
#include "llavatarnamecache.h"
#include "llfloater.h"
#include "llmemory.h"
#include "llvoiceclient.h"
#include "llframetimer.h"
#include "llevent.h"
#include "lllayoutstack.h"
#include <list>
#include <boost/signals2.hpp>
class LLScrollListCtrl;
class LLButton;
class LLPanelActiveSpeakers;
class LLSpeakerMgr;
class LLVoiceChannel;
class LLSlider;
class LLTextBox;
class LLCheckBoxCtrl;
// data for a given participant in a voice channel
class LLSpeaker : public LLRefCount, public LLOldEvents::LLObservable, public LLHandleProvider<LLSpeaker>, public boost::signals2::trackable
{
public:
typedef enum e_speaker_type
{
SPEAKER_AGENT,
SPEAKER_OBJECT,
SPEAKER_EXTERNAL // Speaker that doesn't map to an avatar or object (i.e. PSTN caller in a group)
} ESpeakerType;
typedef enum e_speaker_status
{
STATUS_SPEAKING,
STATUS_HAS_SPOKEN,
STATUS_VOICE_ACTIVE,
STATUS_TEXT_ONLY,
STATUS_NOT_IN_CHANNEL,
STATUS_MUTED
} ESpeakerStatus;
LLSpeaker(const LLUUID& id, const std::string& name = LLStringUtil::null, const ESpeakerType type = SPEAKER_AGENT);
~LLSpeaker() {};
void lookupName();
void onNameCache(const LLAvatarName& avatar_name);
ESpeakerStatus mStatus; // current activity status in speech group
F32 mLastSpokeTime; // timestamp when this speaker last spoke
F32 mSpeechVolume; // current speech amplitude (timea average rms amplitude?)
std::string mDisplayName; // cache user name for this speaker
LLFrameTimer mActivityTimer; // time out speakers when they are not part of current voice channel
BOOL mHasSpoken; // has this speaker said anything this session?
LLColor4 mDotColor;
LLUUID mID;
BOOL mTyping;
S32 mSortIndex;
ESpeakerType mType;
BOOL mIsModerator;
BOOL mModeratorMutedVoice;
BOOL mModeratorMutedText;
std::string mLegacyName;
bool mNameRequested;
};
class LLSpeakerTextModerationEvent : public LLOldEvents::LLEvent
{
public:
LLSpeakerTextModerationEvent(LLSpeaker* source);
/*virtual*/ LLSD getValue();
};
class LLSpeakerVoiceModerationEvent : public LLOldEvents::LLEvent
{
public:
LLSpeakerVoiceModerationEvent(LLSpeaker* source);
/*virtual*/ LLSD getValue();
};
class LLSpeakerListChangeEvent : public LLOldEvents::LLEvent
{
public:
LLSpeakerListChangeEvent(LLSpeakerMgr* source, const LLUUID& speaker_id);
/*virtual*/ LLSD getValue();
private:
const LLUUID& mSpeakerID;
};
class LLSpeakerMgr : public LLOldEvents::LLObservable
{
public:
LLSpeakerMgr(LLVoiceChannel* channelp);
virtual ~LLSpeakerMgr();
const LLPointer<LLSpeaker> findSpeaker(const LLUUID& avatar_id);
void update(BOOL resort_ok);
void setSpeakerTyping(const LLUUID& speaker_id, BOOL typing);
void speakerChatted(const LLUUID& speaker_id);
LLPointer<LLSpeaker> setSpeaker(const LLUUID& id,
const std::string& name = LLStringUtil::null,
LLSpeaker::ESpeakerStatus status = LLSpeaker::STATUS_TEXT_ONLY,
LLSpeaker::ESpeakerType = LLSpeaker::SPEAKER_AGENT);
BOOL isVoiceActive();
typedef std::vector<LLPointer<LLSpeaker> > speaker_list_t;
void getSpeakerList(speaker_list_t* speaker_list, BOOL include_text);
const LLUUID getSessionID();
protected:
virtual void updateSpeakerList();
typedef std::map<LLUUID, LLPointer<LLSpeaker> > speaker_map_t;
speaker_map_t mSpeakers;
speaker_list_t mSpeakersSorted;
LLFrameTimer mSpeechTimer;
LLVoiceChannel* mVoiceChannel;
};
class LLIMSpeakerMgr : public LLSpeakerMgr
{
public:
LLIMSpeakerMgr(LLVoiceChannel* channel);
void updateSpeakers(const LLSD& update);
void setSpeakers(const LLSD& speakers);
protected:
virtual void updateSpeakerList();
};
class LLActiveSpeakerMgr : public LLSpeakerMgr, public LLSingleton<LLActiveSpeakerMgr>
{
public:
LLActiveSpeakerMgr();
protected:
virtual void updateSpeakerList();
};
class LLLocalSpeakerMgr : public LLSpeakerMgr, public LLSingleton<LLLocalSpeakerMgr>
{
public:
LLLocalSpeakerMgr();
~LLLocalSpeakerMgr ();
protected:
virtual void updateSpeakerList();
};
class LLParticipantList;
class LLFloaterActiveSpeakers :
public LLFloaterSingleton<LLFloaterActiveSpeakers>,
@@ -200,107 +53,14 @@ public:
/*virtual*/ void onClose(bool app_quitting);
/*virtual*/ void draw();
/*virtual*/ void onChange();
/*virtual*/ void onParticipantsChanged();
static void* createSpeakersPanel(void* data);
protected:
LLFloaterActiveSpeakers(const LLSD& seed);
LLPanelActiveSpeakers* mPanel;
LLParticipantList* mPanel;
};
class LLPanelActiveSpeakers : public LLLayoutPanel
{
public:
LLPanelActiveSpeakers(LLSpeakerMgr* data_source, BOOL show_text_chatters);
/*virtual*/ BOOL postBuild();
void handleSpeakerSelect();
void refreshSpeakers();
void setSpeaker(const LLUUID& id,
const std::string& name = LLStringUtil::null,
LLSpeaker::ESpeakerStatus status = LLSpeaker::STATUS_TEXT_ONLY,
LLSpeaker::ESpeakerType = LLSpeaker::SPEAKER_AGENT);
void setVoiceModerationCtrlMode(const BOOL& moderated_voice);
static void onClickMuteVoiceCommit(LLUICtrl* ctrl, void* user_data);
static void onClickMuteTextCommit(LLUICtrl* ctrl, void* user_data);
static void onVolumeChange(LLUICtrl* source, void* user_data);
static void onClickProfile(void* user_data);
static void onDoubleClickSpeaker(void* user_data);
static void onSortChanged(void* user_data);
static void onModeratorMuteVoice(LLUICtrl* ctrl, void* user_data);
static void onModeratorMuteText(LLUICtrl* ctrl, void* user_data);
static void onChangeModerationMode(LLUICtrl* ctrl, void* user_data);
protected:
class SpeakerMuteListener : public LLOldEvents::LLSimpleListener
{
public:
SpeakerMuteListener(LLPanelActiveSpeakers* panel) : mPanel(panel) {}
/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
LLPanelActiveSpeakers* mPanel;
};
friend class SpeakerAddListener;
class SpeakerAddListener : public LLOldEvents::LLSimpleListener
{
public:
SpeakerAddListener(LLPanelActiveSpeakers* panel) : mPanel(panel) {}
/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
LLPanelActiveSpeakers* mPanel;
};
friend class SpeakerRemoveListener;
class SpeakerRemoveListener : public LLOldEvents::LLSimpleListener
{
public:
SpeakerRemoveListener(LLPanelActiveSpeakers* panel) : mPanel(panel) {}
/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
LLPanelActiveSpeakers* mPanel;
};
friend class SpeakerClearListener;
class SpeakerClearListener : public LLOldEvents::LLSimpleListener
{
public:
SpeakerClearListener(LLPanelActiveSpeakers* panel) : mPanel(panel) {}
/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
LLPanelActiveSpeakers* mPanel;
};
void addSpeaker(const LLUUID& id);
void removeSpeaker(const LLUUID& id);
LLScrollListCtrl* mSpeakerList;
LLUICtrl* mMuteVoiceCtrl;
LLUICtrl* mMuteTextCtrl;
LLTextBox* mNameText;
LLButton* mProfileBtn;
BOOL mShowTextChatters;
LLSpeakerMgr* mSpeakerMgr;
LLFrameTimer mIconAnimationTimer;
LLPointer<SpeakerMuteListener> mSpeakerMuteListener;
LLPointer<SpeakerAddListener> mSpeakerAddListener;
LLPointer<SpeakerRemoveListener> mSpeakerRemoveListener;
LLPointer<SpeakerClearListener> mSpeakerClearListener;
CachedUICtrl<LLUICtrl> mVolumeSlider;
};
#endif // LL_LLFLOATERACTIVESPEAKERS_H

View File

@@ -1,46 +0,0 @@
/**
* @file llfloateranimpreview.cpp
* @brief LLFloaterAnimPreview class implementation
*
* Copyright (c) 2012, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
#include "llfloateranimpreview.h"
LLFloaterAnimPreview::LLFloaterAnimPreview(LLSD const& filename) : LLFloaterNameDesc(filename)
{
}
BOOL LLFloaterAnimPreview::postBuild()
{
if (!LLFloaterNameDesc::postBuild())
{
return FALSE;
}
getChild<LLUICtrl>("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this));
return TRUE;
}

View File

@@ -1,42 +0,0 @@
/**
* @file llfloateranimpreview.h
* @brief LLFloaterAnimPreview class definition
*
* Copyright (c) 2012, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#ifndef LL_LLFLOATERANIMPREVIEW_H
#define LL_LLFLOATERANIMPREVIEW_H
#include "llfloaternamedesc.h"
class LLFloaterAnimPreview : public LLFloaterNameDesc {
public:
LLFloaterAnimPreview(LLSD const& filename);
virtual BOOL postBuild(void);
};
#endif // LL_LLFLOATERANIMPREVIEW_H

View File

@@ -35,168 +35,27 @@
#include "llviewerprecompiledheaders.h"
#include "llfloateravatarinfo.h"
#include "llavatarnamecache.h"
// viewer project includes
#include "llagentdata.h"
#include "llcommandhandler.h"
#include "llimview.h"
#include "llfloaterfriends.h"
#include "llfloatermute.h"
#include "llmenucommands.h"
#include "llpanelavatar.h"
#include "llviewermessage.h"
#include "lluictrlfactory.h"
#include "llweb.h"
// linden library includes
#include "llinventory.h"
#include "lluuid.h"
#include "message.h"
const char FLOATER_TITLE[] = "Profile";
const LLRect FAI_RECT(0, 530, 420, 0);
//-----------------------------------------------------------------------------
// Globals
//-----------------------------------------------------------------------------
class LLAgentHandler : public LLCommandHandler
{
public:
void verbCallback(const std::string& verb, LLUUID agent_id, const LLAvatarName& avatar_name)
{
if (verb == "im")
{
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession( avatar_name.getCompleteName(), IM_NOTHING_SPECIAL, agent_id);
return;
}
if (verb == "requestfriend")
{
LLPanelFriends::requestFriendshipDialog( agent_id, avatar_name.getCompleteName() );
return;
}
if (verb == "mute")
{
LLFloaterMute::getInstance()->open();
LLMute mute(agent_id, avatar_name.getCompleteName(), LLMute::AGENT);
LLMuteList::getInstance()->add(mute);
return;
}
if (verb == "unmute")
{
LLMute mute(agent_id, avatar_name.getCompleteName(), LLMute::AGENT);
LLMuteList::getInstance()->remove(mute);
return;
}
}
// requires trusted browser to trigger
LLAgentHandler() : LLCommandHandler("agent", UNTRUSTED_THROTTLE) { }
bool handle(const LLSD& params, const LLSD& query_map,
LLMediaCtrl* web)
{
if (params.size() < 2)
{
return false;
}
LLUUID agent_id;
if (!agent_id.set(params[0], FALSE))
{
return false;
}
const std::string verb = params[1].asString();
if (verb == "about")
{
LLFloaterAvatarInfo::show(agent_id);
return true;
}
if (verb == "pay")
{
handle_pay_by_id(agent_id);
return true;
}
if (verb == "offerteleport")
{
handle_lure(agent_id);
return true;
}
if ((verb == "im") || (verb == "requestfriend") || (verb == "unmute"))
{
LLAvatarNameCache::get(agent_id, boost::bind(&LLAgentHandler::verbCallback, this, verb, _1, _2));
return true;
}
if (verb == "mute")
{
if (LLMuteList::getInstance()->isMuted(agent_id))
{
LLFloaterMute::getInstance()->open();
LLFloaterMute::getInstance()->selectMute(agent_id);
}
else
{
LLAvatarNameCache::get(agent_id, boost::bind(&LLAgentHandler::verbCallback, this, verb, _1, _2));
}
return true;
}
return false;
}
};
LLAgentHandler gAgentHandler;
//-----------------------------------------------------------------------------
// Member functions
//-----------------------------------------------------------------------------
//----------------------------------------------------------------------------
void* LLFloaterAvatarInfo::createPanelAvatar(void* data)
{
LLFloaterAvatarInfo* self = (LLFloaterAvatarInfo*)data;
self->mPanelAvatarp = new LLPanelAvatar("PanelAv", LLRect(), TRUE); // allow edit self
self->mPanelAvatarp->setAvatarID(self->mAvatarID);
return self->mPanelAvatarp;
}
//----------------------------------------------------------------------------
BOOL LLFloaterAvatarInfo::postBuild()
LLFloaterAvatarInfo::LLFloaterAvatarInfo(const std::string& name, const LLUUID &avatar_id)
: LLFloater(name), LLInstanceTracker<LLFloaterAvatarInfo, LLUUID>(avatar_id),
mAvatarID(avatar_id)
{
return TRUE;
}
LLFloaterAvatarInfo::LLFloaterAvatarInfo(const std::string& name, const LLRect &rect, const LLUUID &avatar_id)
: LLPreview(name, rect, FLOATER_TITLE, LLUUID::null, LLUUID::null), LLInstanceTracker<LLFloaterAvatarInfo, LLUUID>(avatar_id),
mAvatarID( avatar_id ),
mSuggestedOnlineStatus(ONLINE_STATUS_NO)
{
setAutoFocus(TRUE);
setAutoFocus(true);
LLCallbackMap::map_t factory_map;
factory_map["Panel Avatar"] = LLCallbackMap(createPanelAvatar, this);
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_profile.xml", &factory_map);
if(mPanelAvatarp)
{
mPanelAvatarp->selectTab(0);
}
//gCacheName->get(avatar_id, FALSE, callbackLoadAvatarName);
LLAvatarNameCache::get(avatar_id, boost::bind(&LLFloaterAvatarInfo::callbackLoadAvatarName, this, _1, _2));
setTitle(name);
}
// virtual
@@ -206,131 +65,11 @@ LLFloaterAvatarInfo::~LLFloaterAvatarInfo()
void LLFloaterAvatarInfo::resetGroupList()
{
// only get these updates asynchronously via the group floater, which works on the agent only
if (mAvatarID != gAgentID)
{
return;
}
mPanelAvatarp->resetGroupList();
}
// static
LLFloaterAvatarInfo* LLFloaterAvatarInfo::show(const LLUUID &avatar_id)
{
if (avatar_id.isNull())
{
return NULL;
}
LLFloaterAvatarInfo *floater = LLFloaterAvatarInfo::getInstance(avatar_id);
if(!floater)
{
floater = new LLFloaterAvatarInfo("avatarinfo", FAI_RECT, avatar_id );
floater->center();
}
// ...bring that window to front
floater->open(); /*Flawfinder: ignore*/
return floater;
}
// Open profile to a certain tab.
// static
void LLFloaterAvatarInfo::showFromObject(const LLUUID& avatar_id,std::string tab_name)
{
LLFloaterAvatarInfo *floater = show(avatar_id);
if (floater)
{
floater->mPanelAvatarp->setAvatarID(avatar_id, LLStringUtil::null, ONLINE_STATUS_NO);
floater->mPanelAvatarp->selectTabByName(tab_name);
}
}
// static
void LLFloaterAvatarInfo::showFromDirectory(const LLUUID &avatar_id)
{
LLFloaterAvatarInfo *floater = show(avatar_id);
if (floater)
{
floater->mPanelAvatarp->setAvatarID(avatar_id, LLStringUtil::null, ONLINE_STATUS_NO);
}
}
// static
void LLFloaterAvatarInfo::showFromFriend(const LLUUID& agent_id, BOOL online)
{
LLFloaterAvatarInfo *floater = show(agent_id);
if (floater)
{
floater->mSuggestedOnlineStatus = online ? ONLINE_STATUS_YES : ONLINE_STATUS_NO;
}
}
// static
void LLFloaterAvatarInfo::showFromProfile(const LLUUID &avatar_id, LLRect rect)
{
if (avatar_id.isNull())
{
return;
}
LLFloaterAvatarInfo *floater = LLFloaterAvatarInfo::getInstance(avatar_id);
if(!floater)
{
floater = new LLFloaterAvatarInfo("avatarinfo", FAI_RECT, avatar_id);
floater->translate(rect.mLeft - floater->getRect().mLeft + 16,
rect.mTop - floater->getRect().mTop - 16);
floater->mPanelAvatarp->setAvatarID(avatar_id, LLStringUtil::null, ONLINE_STATUS_NO);
}
floater->open();
}
void LLFloaterAvatarInfo::showProfileCallback(S32 option, void *userdata)
{
if (option == 0)
{
showFromObject(gAgentID);
}
}
void LLFloaterAvatarInfo::callbackLoadAvatarName(const LLUUID& id, const LLAvatarName& av_name)
{
// Build a new title including the avatar name.
std::ostringstream title;
//title << first << " " << last << " - " << floater->getTitle();
title << av_name.getCompleteName()<< " - " << getTitle();
setTitle(title.str());
}
//// virtual
void LLFloaterAvatarInfo::draw()
{
// skip LLPreview::draw()
LLFloater::draw();
}
// virtual
BOOL LLFloaterAvatarInfo::canClose()
{
return mPanelAvatarp && mPanelAvatarp->canClose();
}
void LLFloaterAvatarInfo::loadAsset()
{
if (mPanelAvatarp) {
mPanelAvatarp->setAvatarID(mAvatarID, LLStringUtil::null, mSuggestedOnlineStatus);
mAssetStatus = PREVIEW_ASSET_LOADING;
}
}
LLPreview::EAssetStatus LLFloaterAvatarInfo::getAssetStatus()
{
if (mPanelAvatarp && mPanelAvatarp->haveData())
{
mAssetStatus = PREVIEW_ASSET_LOADED;
}
return mAssetStatus;
}

View File

@@ -40,66 +40,24 @@
#define LL_LLFLOATERAVATARINFO_H
#include "llfloater.h"
#include "llpreview.h"
#include "lluuid.h"
#include "llpanelavatar.h"
#include "llinstancetracker.h"
class LLAvatarName;
class LLButton;
class LLCheckBoxCtrl;
class LLInventoryItem;
class LLLineEditor;
class LLMessageSystem;
class LLScrollListCtrl;
class LLTabContainer;
class LLTextBox;
class LLTextEditor;
class LLTextureCtrl;
class LLUICtrl;
class LLViewerTexture;
class LLViewerObject;
class LLPanelAvatar;
class LLFloaterAvatarInfo
: public LLPreview, public LLInstanceTracker<LLFloaterAvatarInfo,LLUUID>
: public LLFloater, public LLInstanceTracker<LLFloaterAvatarInfo,LLUUID>
{
public:
static void* createPanelAvatar(void* data);
virtual BOOL postBuild();
LLFloaterAvatarInfo(const std::string& name, const LLRect &rect, const LLUUID &avatar_id );
LLFloaterAvatarInfo(const std::string& name, const LLUUID &avatar_id);
/*virtual*/ ~LLFloaterAvatarInfo();
/*virtual*/ void draw();
/*virtual*/ BOOL canClose();
/*virtual*/ void loadAsset();
/*virtual*/ EAssetStatus getAssetStatus();
static LLFloaterAvatarInfo* show(const LLUUID& avatar_id);
// Core method, doesn't do anything funny with online status or
// tab selection.
static void showFromObject(const LLUUID &avatar_id, std::string tab_name = std::string());
static void showFromDirectory(const LLUUID &avatar_id);
static void showFromFriend(const LLUUID &agent_id, BOOL online);
static void showFromProfile(const LLUUID &avatar_id, LLRect rect);
static void showProfileCallback(S32 option, void *userdata);
void callbackLoadAvatarName(const LLUUID& agent_id, const LLAvatarName& av_name);
void resetGroupList();
private:
LLUUID mAvatarID; // for which avatar is this window?
LLPanelAvatar* mPanelAvatarp;
EOnlineStatus mSuggestedOnlineStatus;
};
std::string getProfileURL(const std::string& agent_name);
#endif

View File

@@ -25,21 +25,17 @@
#include "llwindow.h"
#include "llscrolllistctrl.h"
#include "llradiogroup.h"
#include "llviewercontrol.h"
#include "llnotificationsutil.h"
#include "llvoavatar.h"
#include "llimview.h"
#include "llfloateravatarinfo.h"
#include "llregionflags.h"
#include "llfloaterreporter.h"
#include "llagent.h"
#include "llagentcamera.h"
#include "llavataractions.h"
#include "llfloaterregioninfo.h"
#include "llviewerregion.h"
#include "lltracker.h"
#include "llviewerstats.h"
#include "llerror.h"
#include "llchat.h"
#include "llfloaterchat.h"
#include "llviewermessage.h"
@@ -882,7 +878,7 @@ void LLFloaterAvatarList::refreshAvatarList()
name_color = ascent_estate_owner_color;
}
//without these dots, SL would suck.
else if(is_agent_friend(av_id))
else if(LLAvatarActions::isFriend(av_id))
{
static const LLCachedControl<LLColor4> ascent_friend_color("AscentFriendColor",LLColor4(1.f,1.f,0.f,1.f));
name_color = ascent_friend_color;
@@ -1142,22 +1138,12 @@ void LLFloaterAvatarList::onClickIM()
if (ids.size() == 1)
{
// Single avatar
LLUUID agent_id = ids[0];
std::string avatar_name;
if (gCacheName->getFullName(agent_id, avatar_name))
{
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession(avatar_name,IM_NOTHING_SPECIAL,agent_id);
}
LLAvatarActions::startIM(ids[0]);
}
else
{
// Group IM
LLUUID session_id;
session_id.generate();
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession("Avatars Conference", IM_SESSION_CONFERENCE_START, ids[0], ids);
LLAvatarActions::startConference(ids);
}
}
}
@@ -1265,30 +1251,7 @@ BOOL LLFloaterAvatarList::handleKeyHere(KEY key, MASK mask)
if (( KEY_RETURN == key ) && (MASK_SHIFT == mask))
{
uuid_vec_t ids = mAvatarList->getSelectedIDs();
if (ids.size() > 0)
{
if (ids.size() == 1)
{
// Single avatar
LLUUID agent_id = ids[0];
std::string avatar_name;
if (gCacheName->getFullName(agent_id, avatar_name))
{
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession(avatar_name,IM_NOTHING_SPECIAL,agent_id);
}
}
else
{
// Group IM
LLUUID session_id;
session_id.generate();
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession("Avatars Conference", IM_SESSION_CONFERENCE_START, ids[0], ids);
}
}
onClickIM();
}
return LLPanel::handleKeyHere(key, mask);
}
@@ -1553,7 +1516,7 @@ static void cmd_append_names(const LLAvatarListEntry* entry, std::string &str, s
{ if(!str.empty())str.append(sep);str.append(entry->getName()); }
static void cmd_toggle_mark(LLAvatarListEntry* entry) { entry->toggleMark(); }
static void cmd_ar(const LLAvatarListEntry* entry) { LLFloaterReporter::showFromObject(entry->getID()); }
static void cmd_profile(const LLAvatarListEntry* entry) { LLFloaterAvatarInfo::showFromDirectory(entry->getID()); }
static void cmd_profile(const LLAvatarListEntry* entry) { LLAvatarActions::showProfile(entry->getID()); }
static void cmd_teleport(const LLAvatarListEntry* entry) { gAgent.teleportViaLocation(entry->getPosition()); }
static void cmd_freeze(const LLAvatarListEntry* entry) { send_freeze(entry->getID(), true); }
static void cmd_unfreeze(const LLAvatarListEntry* entry) { send_freeze(entry->getID(), false); }

View File

@@ -557,7 +557,10 @@ BOOL LLFloaterAvatarPicker::handleDragAndDrop(S32 x, S32 y, MASK mask,
std::string avatar_name = selection->getColumn(0)->getValue().asString();
if (dest_agent_id.notNull() && dest_agent_id != gAgentID)
{
if (drop)
// if (drop)
// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h
if ( (drop) && ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.canStartIM(dest_agent_id)) ) )
// [/RLVa:KB]
{
// Start up IM before give the item
session_id = gIMMgr->addSession(avatar_name, IM_NOTHING_SPECIAL, dest_agent_id);

File diff suppressed because it is too large Load Diff

View File

@@ -3,10 +3,9 @@
* @brief LLFloaterBvhPreview class definition
*
* $LicenseInfo:firstyear=2004&license=viewergpl$
*
* Second Life Viewer Source Code
* Copyright (c) 2004-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
@@ -92,22 +91,21 @@ public:
void onBtnPlay();
void onBtnStop();
static void setUploadAmount(S32 amount) { sUploadAmount = amount; }
static void onSliderMove(LLUICtrl*, void*);
static void onCommitBaseAnim(LLUICtrl*, void*);
static void onCommitLoop(LLUICtrl*, void*);
static void onCommitLoopIn(LLUICtrl*, void*);
static void onCommitLoopOut(LLUICtrl*, void*);
static BOOL validateLoopIn(LLUICtrl*, void*);
static BOOL validateLoopOut(LLUICtrl*, void*);
static void onCommitName(LLUICtrl*, void*);
static void onCommitHandPose(LLUICtrl*, void*);
static void onCommitEmote(LLUICtrl*, void*);
static void onCommitPriority(LLUICtrl*, void*);
static void onCommitEaseIn(LLUICtrl*, void*);
static void onCommitEaseOut(LLUICtrl*, void*);
static BOOL validateEaseIn(LLUICtrl*, void*);
static BOOL validateEaseOut(LLUICtrl*, void*);
void onSliderMove();
void onCommitBaseAnim();
void onCommitLoop();
void onCommitLoopIn();
void onCommitLoopOut();
bool validateLoopIn(const LLSD& data);
bool validateLoopOut(const LLSD& data);
void onCommitName();
void onCommitHandPose();
void onCommitEmote();
void onCommitPriority();
void onCommitEaseIn();
void onCommitEaseOut();
bool validateEaseIn(const LLSD& data);
bool validateEaseOut(const LLSD& data);
static void onBtnOK(void*);
static void onSaveComplete(const LLUUID& asset_uuid,
LLAssetType::EType type,
@@ -129,14 +127,10 @@ protected:
LLRectf mPreviewImageRect;
LLAssetID mMotionID;
LLTransactionID mTransactionID;
BOOL mEnabled;
BOOL mInWorld;
LLAnimPauseRequest mPauseRequest;
std::map<std::string, LLUUID> mIDList;
static S32 sUploadAmount;
//<edit>
void* mItem;
//</edit>

View File

@@ -52,12 +52,13 @@
#include "llagent.h"
#include "llchatbar.h"
#include "llconsole.h"
#include "llfloateractivespeakers.h"
#include "llfloaterchatterbox.h"
#include "llfloatermute.h"
#include "llfloaterscriptdebug.h"
#include "lllogchat.h"
#include "llmutelist.h"
#include "llparticipantlist.h"
#include "llspeakers.h"
#include "llstylemap.h"
#include "lluictrlfactory.h"
#include "llviewermessage.h"
@@ -126,7 +127,7 @@ void LLFloaterChat::draw()
BOOL LLFloaterChat::postBuild()
{
mPanel = (LLPanelActiveSpeakers*)getChild<LLPanel>("active_speakers_panel");
mPanel = getChild<LLParticipantList>("active_speakers_panel");
LLChatBar* chat_barp = getChild<LLChatBar>("chat_panel", TRUE);
if (chat_barp)
@@ -324,7 +325,7 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
// add objects as transient speakers that can be muted
if (chat.mSourceType == CHAT_SOURCE_OBJECT)
{
chat_floater->mPanel->setSpeaker(chat.mFromID, chat.mFromName, LLSpeaker::STATUS_NOT_IN_CHANNEL, LLSpeaker::SPEAKER_OBJECT);
LLLocalSpeakerMgr::getInstance()->setSpeaker(chat.mFromID, chat.mFromName, LLSpeaker::STATUS_NOT_IN_CHANNEL, LLSpeaker::SPEAKER_OBJECT);
}
// start tab flashing on incoming text from other users (ignoring system text, etc)
@@ -627,7 +628,7 @@ void LLFloaterChat::chatFromLogFile(LLLogChat::ELogLineType type , std::string l
//static
void* LLFloaterChat::createSpeakersPanel(void* data)
{
return new LLPanelActiveSpeakers(LLLocalSpeakerMgr::getInstance(), TRUE);
return new LLParticipantList(LLLocalSpeakerMgr::getInstance(), true);
}
//static

View File

@@ -48,7 +48,7 @@ class LLViewerTextEditor;
class LLMessageSystem;
class LLUUID;
class LLCheckBoxCtrl;
class LLPanelActiveSpeakers;
class LLParticipantList;
class LLLogChat;
class LLChatBar;
@@ -95,7 +95,7 @@ public:
static void show(LLFloater* instance, const LLSD& key);
static void hide(LLFloater* instance, const LLSD& key);
LLPanelActiveSpeakers* mPanel;
LLParticipantList* mPanel;
BOOL mScrolledToEnd;
BOOL focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE );

View File

@@ -40,7 +40,7 @@
#include "llfloaterchat.h"
#include "llfloaterfriends.h"
#include "llfloatergroups.h"
#include "llviewercontrol.h"
#include "llvoicechannel.h"
#include "llimview.h"
#include "llimpanel.h"
#include "llstring.h"
@@ -315,7 +315,7 @@ void LLFloaterChatterBox::addFloater(LLFloater* floaterp,
//static
LLFloater* LLFloaterChatterBox::getCurrentVoiceFloater()
{
if (!LLVoiceClient::voiceEnabled())
if (!LLVoiceClient::getInstance()->voiceEnabled())
{
return NULL;
}

View File

@@ -76,8 +76,6 @@ const F32 CONTEXT_FADE_TIME = 0.08f;
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// default ctor
LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show_apply_immediate )
: LLFloater (std::string("Color Picker Floater")),
mComponents ( 3 ),
@@ -113,6 +111,10 @@ LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show
mCanApplyImmediately ( show_apply_immediate ),
mContextConeOpacity ( 0.f )
{
// build the majority of the gui using the factory builder
LLUICtrlFactory::getInstance()->buildFloater ( this, "floater_color_picker.xml" );
setVisible ( FALSE );
// create user interface for this picker
createUI ();
@@ -133,10 +135,6 @@ LLFloaterColorPicker::~LLFloaterColorPicker()
//
void LLFloaterColorPicker::createUI ()
{
// build the majority of the gui using the factory builder
LLUICtrlFactory::getInstance()->buildFloater ( this, "floater_color_picker.xml" );
setVisible ( FALSE );
// create RGB type area (not really RGB but it's got R,G & B in it.,..
LLPointer<LLImageRaw> raw = new LLImageRaw ( mRGBViewerImageWidth, mRGBViewerImageHeight, mComponents );
@@ -184,7 +182,6 @@ void LLFloaterColorPicker::showUI ()
setVisible ( TRUE );
setFocus ( TRUE );
// HACK: if system color picker is required - close the SL one we made and use default system dialog
if ( gSavedSettings.getBOOL ( "UseDefaultColorPicker" ) )
{
@@ -237,7 +234,7 @@ BOOL LLFloaterColorPicker::postBuild()
childSetCommitCallback("hspin", onTextCommit, (void*)this );
childSetCommitCallback("sspin", onTextCommit, (void*)this );
childSetCommitCallback("lspin", onTextCommit, (void*)this );
childSetCommitCallback("hexval", onHexCommit, (void*)this );
getChild<LLUICtrl>("hexval")->setCommitCallback(boost::bind(&LLFloaterColorPicker::onHexCommit, this, _2) );
LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterColorPicker::onColorSelect, this, _1));
@@ -248,9 +245,6 @@ BOOL LLFloaterColorPicker::postBuild()
//
void LLFloaterColorPicker::initUI ( F32 rValIn, F32 gValIn, F32 bValIn )
{
// start catching lose-focus events from entry widgets
enableTextCallbacks ( TRUE );
// under some circumstances, we get rogue values that can be calmed by clamping...
rValIn = llclamp ( rValIn, 0.0f, 1.0f );
gValIn = llclamp ( gValIn, 0.0f, 1.0f );
@@ -360,12 +354,8 @@ void LLFloaterColorPicker::setCurRgb ( F32 curRIn, F32 curGIn, F32 curBIn )
// update corresponding HSL values and
LLColor3(curRIn, curGIn, curBIn).calcHSL(&curH, &curS, &curL);
// color changed so update text fields (fixes SL-16968)
// HACK: turn off the call back wilst we update the text or we recurse ourselves into oblivion
// CP: this was required when I first wrote the code but this may not be necessary anymore - leaving it there just in case
enableTextCallbacks( FALSE );
// color changed so update text fields
updateTextEntry();
enableTextCallbacks( TRUE );
}
//////////////////////////////////////////////////////////////////////////////
@@ -497,7 +487,7 @@ void LLFloaterColorPicker::draw()
mSwatch->localRectToOtherView(mSwatch->getLocalRect(), &swatch_rect, this);
// draw context cone connecting color picker with color swatch in parent floater
LLRect local_rect = getLocalRect();
if (gFocusMgr.childHasKeyboardFocus(this) && mSwatch->isInVisibleChain() && mContextConeOpacity > 0.001f)
if (hasFocus() && mSwatch->isInVisibleChain() && mContextConeOpacity > 0.001f)
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
LLGLEnable(GL_CULL_FACE);
@@ -716,77 +706,36 @@ std::string RGBToHex(int rNum, int gNum, int bNum)
}
//Called when a hex value is entered into the Hex field - Convert and set values.
void LLFloaterColorPicker::onHexCommit ( LLUICtrl* ctrl, void* data )
void LLFloaterColorPicker::onHexCommit(const LLSD& value)
{
if ( data )
{
LLFloaterColorPicker* self = ( LLFloaterColorPicker* )data;
if ( self )
{
char* pStop;
int num = strtol(ctrl->getValue().asString().c_str(), &pStop, 16);
int r = (num & 0xFF0000) >> 16;
int g = (num & 0xFF00) >> 8;
int b = num & 0xFF;
self->setCurRgb (r / 255.0f, g / 255.0f, b / 255.0f);
char* pStop;
int num = strtol(value.asString().c_str(), &pStop, 16);
int r = (num & 0xFF0000) >> 16;
int g = (num & 0xFF00) >> 8;
int b = num & 0xFF;
setCurRgb (r / 255.0f, g / 255.0f, b / 255.0f);
// HACK: turn off the call back wilst we update the text or we recurse ourselves into oblivion
self->enableTextCallbacks ( FALSE );
self->updateTextEntry ();
self->enableTextCallbacks ( TRUE );
if (self->mApplyImmediateCheck->get())
{
LLColorSwatchCtrl::onColorChanged ( self->getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE );
}
}
updateTextEntry();
if (mApplyImmediateCheck->get())
{
LLColorSwatchCtrl::onColorChanged(getSwatch(), LLColorSwatchCtrl::COLOR_CHANGE);
}
}
//////////////////////////////////////////////////////////////////////////////
// update text entry values for RGB/HSL (can't be done in ::draw () since this overwrites input
void
LLFloaterColorPicker::
updateTextEntry ()
void LLFloaterColorPicker::updateTextEntry ()
{
// set values in spinners
childSetValue("rspin", ( getCurR () * 255.0f ) );
childSetValue("gspin", ( getCurG () * 255.0f ) );
childSetValue("bspin", ( getCurB () * 255.0f ) );
childSetValue("hspin", ( getCurH () * 360.0f ) );
childSetValue("sspin", ( getCurS () * 100.0f ) );
childSetValue("lspin", ( getCurL () * 100.0f ) );
childSetValue("hexval", RGBToHex(getCurR() * 255, getCurG() * 255, getCurB() * 255));
getChild<LLUICtrl>("rspin")->setValue(( getCurR () * 255.0f ) );
getChild<LLUICtrl>("gspin")->setValue(( getCurG () * 255.0f ) );
getChild<LLUICtrl>("bspin")->setValue(( getCurB () * 255.0f ) );
getChild<LLUICtrl>("hspin")->setValue(( getCurH () * 360.0f ) );
getChild<LLUICtrl>("sspin")->setValue(( getCurS () * 100.0f ) );
getChild<LLUICtrl>("lspin")->setValue(( getCurL () * 100.0f ) );
getChild<LLUICtrl>("hexval")->setValue(RGBToHex(getCurR() * 255, getCurG() * 255, getCurB() * 255));
}
//////////////////////////////////////////////////////////////////////////////
// turns on or off text entry commit call backs
void
LLFloaterColorPicker::
enableTextCallbacks ( BOOL stateIn )
{
if ( stateIn )
{
childSetCommitCallback("rspin", onTextCommit, (void*)this );
childSetCommitCallback("gspin", onTextCommit, (void*)this );
childSetCommitCallback("bspin", onTextCommit, (void*)this );
childSetCommitCallback("hspin", onTextCommit, (void*)this );
childSetCommitCallback("sspin", onTextCommit, (void*)this );
childSetCommitCallback("lspin", onTextCommit, (void*)this );
childSetCommitCallback("hexval", onHexCommit, (void*)this );
}
else
{
childSetCommitCallback("rspin", 0, (void*)this );
childSetCommitCallback("gspin", 0, (void*)this );
childSetCommitCallback("bspin", 0, (void*)this );
childSetCommitCallback("hspin", 0, (void*)this );
childSetCommitCallback("sspin", 0, (void*)this );
childSetCommitCallback("lspin", 0, (void*)this );
childSetCommitCallback("hexval", 0, (void*)this );
}
}
//////////////////////////////////////////////////////////////////////////////
//
void LLFloaterColorPicker::onTextEntryChanged ( LLUICtrl* ctrl )
@@ -818,10 +767,7 @@ void LLFloaterColorPicker::onTextEntryChanged ( LLUICtrl* ctrl )
// update current RGB (and implicitly HSL)
setCurRgb ( rVal, gVal, bVal );
// HACK: turn off the call back wilst we update the text or we recurse ourselves into oblivion
enableTextCallbacks ( FALSE );
updateTextEntry ();
enableTextCallbacks ( TRUE );
}
else
// value in HSL boxes changed
@@ -844,10 +790,7 @@ void LLFloaterColorPicker::onTextEntryChanged ( LLUICtrl* ctrl )
// update current HSL (and implicitly RGB)
setCurHsl ( hVal, sVal, lVal );
// HACK: turn off the call back wilst we update the text or we recurse ourselves into oblivion
enableTextCallbacks ( FALSE );
updateTextEntry ();
enableTextCallbacks ( TRUE );
}
if (mApplyImmediateCheck->get())
@@ -980,10 +923,7 @@ BOOL LLFloaterColorPicker::handleMouseDown ( S32 x, S32 y, MASK mask )
LLColorSwatchCtrl::onColorChanged ( getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE );
}
// HACK: turn off the call back wilst we update the text or we recurse ourselves into oblivion
enableTextCallbacks ( FALSE );
updateTextEntry ();
enableTextCallbacks ( TRUE );
}
return TRUE;
@@ -1152,9 +1092,6 @@ void LLFloaterColorPicker::cancelSelection ()
// restore the previous color selection
setCurRgb ( getOrigR (), getOrigG (), getOrigB () );
// we're going away and when we do and the entry widgets lose focus, they do bad things so turn them off
enableTextCallbacks ( FALSE );
// update in world item with original color via current swatch
LLColorSwatchCtrl::onColorChanged( getSwatch(), LLColorSwatchCtrl::COLOR_CANCEL );

View File

@@ -126,12 +126,9 @@ class LLFloaterColorPicker
void onClickPipette ( );
static void onTextCommit ( LLUICtrl* ctrl, void* data );
static void onImmediateCheck ( LLUICtrl* ctrl, void* data );
static void onHexCommit ( LLUICtrl* ctrl, void* data );
void onHexCommit(const LLSD& value);
void onColorSelect( const LLTextureEntry& te );
private:
// turns on or off text entry commit call backs
void enableTextCallbacks ( BOOL stateIn );
// draws color selection palette
void drawPalette ();

View File

@@ -391,10 +391,8 @@ void* LLFloaterDirectory::createEventDetail(void* userdata)
void* LLFloaterDirectory::createGroupDetail(void* userdata)
{
LLFloaterDirectory *self = (LLFloaterDirectory*)userdata;
self->mPanelGroupp = new LLPanelGroup("panel_group.xml",
"PanelGroup",
gAgent.getGroupID());
self->mPanelGroupp->setAllowEdit(FALSE || gAgent.isGodlike()); // Gods can always edit panels
self->mPanelGroupp = new LLPanelGroup(gAgent.getGroupID());
self->mPanelGroupp->setAllowEdit(false); // Singu Note: This setting actually just tells the panel whether or not it is in search
self->mPanelGroupp->setVisible(FALSE);
return self->mPanelGroupp;
}

View File

@@ -6,7 +6,6 @@
#include "llscrolllistctrl.h"
#include "llfloaterbvhpreview.h"
#include "llvoavatar.h"
#include "lllocalinventory.h"
#include "llviewercamera.h"
#include "llviewerwindow.h"
#include "lltoolmgr.h"

View File

@@ -37,46 +37,31 @@
#include "llfloaterfriends.h"
#include <sstream>
#include "lldir.h"
#include "llagent.h"
#include "llappviewer.h" // for gLastVersionChannel
#include "llavataractions.h"
#include "llavatarnamecache.h"
#include "llfloateravatarpicker.h"
#include "llviewerwindow.h"
#include "llbutton.h"
#include "lldir.h"
#include "lleventtimer.h"
#include "llfiltereditor.h"
#include "llfloateravatarinfo.h"
#include "llinventorymodel.h"
#include "llfloateravatarpicker.h"
#include "llnamelistctrl.h"
#include "llnotificationsutil.h"
#include "llresmgr.h"
#include "llimview.h"
#include "lluictrlfactory.h"
#include "llmenucommands.h"
#include "llviewercontrol.h"
#include "llviewermessage.h"
#include "lleventtimer.h"
#include "llsdserialize.h"
#include "lltextbox.h"
#include "lluictrlfactory.h"
#include "llviewerwindow.h"
#include "llvoiceclient.h"
#include "llsdserialize.h"
#include "statemachine/aifilepicker.h"
#include "llviewermenufile.h"
#include "llviewermenu.h"
#include "llviewernetwork.h"
#include "hippogridmanager.h"
#include "llchat.h"
#include "llfloaterchat.h"
// <dogmode> stuff for Contact groups
//#include "ascentfloatercontactgroups.h"
//#include "llchat.h"
//#include "llfloaterchat.h"
#define DEFAULT_PERIOD 5.0
#define RIGHTS_CHANGE_TIMEOUT 5.0
@@ -399,10 +384,10 @@ BOOL LLPanelFriends::postBuild()
//childSetAction("assign_btn", onClickAssign, this);
childSetAction("expand_collapse_btn", onClickExpand, this);
childSetAction("profile_btn", onClickProfile, this);
childSetAction("offer_teleport_btn", onClickOfferTeleport, this);
getChild<LLUICtrl>("offer_teleport_btn")->setCommitCallback(boost::bind(static_cast<void(*)(const uuid_vec_t&)>(LLAvatarActions::offerTeleport), boost::bind(&LLScrollListCtrl::getSelectedIDs, mFriendsList)));
childSetAction("pay_btn", onClickPay, this);
childSetAction("add_btn", onClickAddFriend, this);
childSetAction("remove_btn", onClickRemove, this);
getChild<LLUICtrl>("remove_btn")->setCommitCallback(boost::bind(LLAvatarActions::removeFriendsDialog, boost::bind(&LLScrollListCtrl::getSelectedIDs, mFriendsList)));
//childSetAction("export_btn", onClickExport, this); Making Dummy View -HgB
//childSetAction("import_btn", onClickImport, this); Making Dummy View -HgB
@@ -685,7 +670,6 @@ BOOL LLPanelFriends::refreshNamesSync(const LLAvatarTracker::buddy_map_t & all_b
BOOL LLPanelFriends::refreshNamesPresence(const LLAvatarTracker::buddy_map_t & all_buddies)
{
std::vector<LLScrollListItem*> items = mFriendsList->getAllData();
std::sort(items.begin(), items.end(), SortFriendsByID());
@@ -784,10 +768,7 @@ void LLPanelFriends::onClickProfile(void* user_data)
const uuid_vec_t ids = panelp->mFriendsList->getSelectedIDs();
if(!ids.empty())
{
LLUUID agent_id = ids[0];
BOOL online;
online = LLAvatarTracker::instance().isBuddyOnline(agent_id);
LLFloaterAvatarInfo::showFromFriend(agent_id, online);
LLAvatarActions::showProfile(ids[0]);
}
}
@@ -851,103 +832,24 @@ void LLPanelFriends::onClickIM(void* user_data)
const uuid_vec_t ids = panelp->mFriendsList->getSelectedIDs();
if(!ids.empty())
{
static LLCachedControl<bool> tear_off("OtherChatsTornOff");
if(!tear_off) gIMMgr->setFloaterOpen(TRUE);
if(ids.size() == 1)
{
LLUUID agent_id = ids[0];
const LLRelationship* info = LLAvatarTracker::instance().getBuddyInfo(agent_id);
std::string fullname;
if(info && gCacheName->getFullName(agent_id, fullname))
{
gIMMgr->addSession(fullname, IM_NOTHING_SPECIAL, agent_id);
}
LLAvatarActions::startIM(ids[0]);
}
else
{
gIMMgr->addSession("Friends Conference", IM_SESSION_CONFERENCE_START, ids[0], ids);
LLAvatarActions::startConference(ids);
}
make_ui_sound("UISndStartIM");
}
}
// static
void LLPanelFriends::requestFriendship(const LLUUID& target_id, const std::string& target_name, const std::string& message)
{
LLUUID calling_card_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD);
send_improved_im(target_id,
target_name,
message,
IM_ONLINE,
IM_FRIENDSHIP_OFFERED,
calling_card_folder_id);
}
// static
bool LLPanelFriends::callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option == 0)
{
requestFriendship(notification["payload"]["id"].asUUID(),
notification["payload"]["name"].asString(),
response["message"].asString());
}
return false;
}
bool LLPanelFriends::callbackAddFriend(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
if (option == 0)
{
// Servers older than 1.25 require the text of the message to be the
// calling card folder ID for the offering user. JC
LLUUID calling_card_folder_id =
gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD);
std::string message = calling_card_folder_id.asString();
requestFriendship(notification["payload"]["id"].asUUID(),
notification["payload"]["name"].asString(),
message);
}
return false;
}
// static
void LLPanelFriends::onPickAvatar( const uuid_vec_t& ids,
const std::vector<LLAvatarName>& names )
{
if (names.empty()) return;
if (ids.empty()) return;
requestFriendshipDialog(ids[0], names[0].getCompleteName());
}
// static
void LLPanelFriends::requestFriendshipDialog(const LLUUID& id,
const std::string& name)
{
if(id == gAgentID)
{
LLNotificationsUtil::add("AddSelfFriend");
return;
}
LLSD args;
args["NAME"] = name;
LLSD payload;
payload["id"] = id;
payload["name"] = name;
// Look for server versions like: Second Life Server 1.24.4.95600
if (gLastVersionChannel.find(" 1.24.") != std::string::npos)
{
// Old and busted server version, doesn't support friend
// requests with messages.
LLNotificationsUtil::add("AddFriend", args, payload, &callbackAddFriend);
}
else
{
LLNotificationsUtil::add("AddFriendWithMessage", args, payload, &callbackAddFriendWithMessage);
}
LLAvatarActions::requestFriendshipDialog(ids[0], names[0].getCompleteName());
}
// static
@@ -962,44 +864,6 @@ void LLPanelFriends::onClickAddFriend(void* user_data)
}
}
// static
void LLPanelFriends::onClickRemove(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
//llinfos << "LLPanelFriends::onClickRemove()" << llendl;
const uuid_vec_t ids = panelp->mFriendsList->getSelectedIDs();
LLSD args;
if(!ids.empty())
{
std::string msgType = "RemoveFromFriends";
if(ids.size() == 1)
{
LLUUID agent_id = ids[0];
std::string fullname;
if (LLAvatarNameCache::getPNSName(agent_id, fullname))
args["NAME"] = fullname;
}
else
{
msgType = "RemoveMultipleFromFriends";
}
LLSD payload;
for (uuid_vec_t::const_iterator it = ids.begin();
it != ids.end();
++it)
{
payload["ids"].append(*it);
}
LLNotifications::instance().add(msgType,
args,
payload,
&handleRemove);
}
}
void LLPanelFriends::onClickExport(void* user_data)
{
std::string agn;
@@ -1050,7 +914,6 @@ void LLPanelFriends::onClickExport_continued(void* user_data, AIFilePicker* file
export_file.close();
}
bool LLPanelFriends::merging;
void LLPanelFriends::onClickImport(void* user_data)
{
@@ -1091,6 +954,7 @@ void LLPanelFriends::onClickImport_filepicker_continued(AIFilePicker* filepicker
LLSD importstatellsd;
LLSDSerialize::fromXMLDocument(importstatellsd, stateload);
static bool merging;
//LLMessageSystem* msg = gMessageSystem;
LLSD newdata;
@@ -1108,10 +972,10 @@ void LLPanelFriends::onClickImport_filepicker_continued(AIFilePicker* filepicker
if(merging && importstatellsd.has(agent_id.asString()))continue;//dont need to request what we've already requested from another list import and have not got a reply yet
std::string agent_name = content["name"];
if(!is_agent_friend(agent_id))//dont need to request what we have
if(!LLAvatarActions::isFriend(agent_id))//dont need to request what we have
{
if(merging)importstatellsd[agent_id.asString()] = content;//MERGEEEE
requestFriendship(agent_id, agent_name, "Imported from "+file);
LLAvatarActions::requestFriendship(agent_id, agent_name, "Imported from "+file);
newdata[iter->first] = iter->second;
}else
{
@@ -1155,7 +1019,7 @@ void LLPanelFriends::FriendImportState(LLUUID id, bool accepted)
if(can_map)rights |= LLRelationship::GRANT_MAP_LOCATION;
if(can_mod)rights |= LLRelationship::GRANT_MODIFY_OBJECTS;
if(see_online)rights |= LLRelationship::GRANT_ONLINE_STATUS;
if(is_agent_friend(id))//is this legit shit yo
if(LLAvatarActions::isFriend(id))//is this legit shit yo
{
const LLRelationship* friend_status = LLAvatarTracker::instance().getBuddyInfo(id);
if(friend_status)
@@ -1185,18 +1049,6 @@ void LLPanelFriends::FriendImportState(LLUUID id, bool accepted)
}
}
// static
void LLPanelFriends::onClickOfferTeleport(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
const uuid_vec_t ids = panelp->mFriendsList->getSelectedIDs();
if(!ids.empty())
{
handle_lure(ids);
}
}
// static
void LLPanelFriends::onClickPay(void* user_data)
{
@@ -1205,58 +1057,56 @@ void LLPanelFriends::onClickPay(void* user_data)
const uuid_vec_t ids = panelp->mFriendsList->getSelectedIDs();
if(!ids.empty())
{
handle_pay_by_id(ids[0]);
LLAvatarActions::pay(ids[0]);
}
}
void LLPanelFriends::confirmModifyRights(rights_map_t& ids, EGrantRevoke command)
void LLPanelFriends::confirmModifyRights(rights_map_t& rights, EGrantRevoke command)
{
if (ids.empty()) return;
LLSD args;
if(!ids.empty())
if (rights.empty()) return;
// Make a copy on the heap: rights is allocated on the stack.
// This copy will be deleted in LLPanelFriends::modifyRightsConfirmation.
rights_map_t* heap_rights = new rights_map_t(rights);
// for single friend, show their name
if (rights.size() == 1)
{
rights_map_t* rights = new rights_map_t(ids);
LLSD args;
std::string fullname;
if (LLAvatarNameCache::getPNSName(rights.begin()->first, fullname))
args["NAME"] = fullname;
// for single friend, show their name
if(ids.size() == 1)
if (command == GRANT)
{
LLUUID agent_id = ids.begin()->first;
std::string fullname;
if (LLAvatarNameCache::getPNSName(agent_id, fullname))
args["NAME"] = fullname;
if (command == GRANT)
{
LLNotificationsUtil::add("GrantModifyRights",
args,
LLSD(),
boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
}
else
{
LLNotificationsUtil::add("RevokeModifyRights",
args,
LLSD(),
boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
}
LLNotificationsUtil::add("GrantModifyRights",
args,
LLSD(),
boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights));
}
else
{
if (command == GRANT)
{
LLNotificationsUtil::add("GrantModifyRightsMultiple",
args,
LLSD(),
boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
}
else
{
LLNotificationsUtil::add("RevokeModifyRightsMultiple",
args,
LLSD(),
boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
}
LLNotificationsUtil::add("RevokeModifyRights",
args,
LLSD(),
boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights));
}
}
else
{
if (command == GRANT)
{
LLNotificationsUtil::add("GrantModifyRightsMultiple",
LLSD(),
LLSD(),
boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights));
}
else
{
LLNotificationsUtil::add("RevokeModifyRightsMultiple",
LLSD(),
LLSD(),
boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights));
}
}
}
@@ -1403,42 +1253,3 @@ void LLPanelFriends::sendRightsGrant(rights_map_t& ids)
mNumRightsChanged = ids.size();
gAgent.sendReliableMessage();
}
// static
bool LLPanelFriends::handleRemove(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
const LLSD& ids = notification["payload"]["ids"];
for(LLSD::array_const_iterator itr = ids.beginArray(); itr != ids.endArray(); ++itr)
{
LLUUID id = itr->asUUID();
const LLRelationship* ip = LLAvatarTracker::instance().getBuddyInfo(id);
if(ip)
{
switch(option)
{
case 0: // YES
if( ip->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS))
{
LLAvatarTracker::instance().empower(id, FALSE);
LLAvatarTracker::instance().notifyObservers();
}
LLAvatarTracker::instance().terminateBuddy(id);
LLAvatarTracker::instance().notifyObservers();
gInventory.addChangedMask(LLInventoryObserver::LABEL | LLInventoryObserver::CALLING_CARD, LLUUID::null);
gInventory.notifyObservers();
break;
case 1: // NO
default:
llinfos << "No removal performed." << llendl;
break;
}
}
}
return false;
}

View File

@@ -76,15 +76,6 @@ public:
virtual BOOL postBuild();
// Show a dialog explaining what friendship entails, then request
// friendship. JC
static void requestFriendshipDialog(const LLUUID& target_id,
const std::string& target_name);
// Just request friendship, no dialog.
static void requestFriendship(const LLUUID& target_id,
const std::string& target_name, const std::string& message);
void populateContactGroupSelect();
private:
@@ -130,8 +121,6 @@ private:
// callback methods
static void onSelectName(LLUICtrl* ctrl, void* user_data);
static void onChangeContactGroup(LLUICtrl* ctrl, void* user_data);
static bool callbackAddFriend(const LLSD& notification, const LLSD& response);
static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response);
static void onPickAvatar(const uuid_vec_t& ids, const std::vector<LLAvatarName>& names );
void onContactFilterEdit(const std::string& search_string);
static void onClickIM(void* user_data);
@@ -140,7 +129,6 @@ private:
static void updateColumns(void* user_data);
static void onClickProfile(void* user_data);
static void onClickAddFriend(void* user_data);
static void onClickRemove(void* user_data);
static void onClickExport(void* user_data);
static void onClickExport_continued(void* user_data, AIFilePicker* filepicker);
static void onClickImport(void* user_data);
@@ -148,12 +136,9 @@ private:
public:
static void FriendImportState(LLUUID id, bool accepted);
private:
static void onClickOfferTeleport(void* user_data);
static void onClickPay(void* user_data);
static void onClickModifyStatus(LLUICtrl* ctrl, void* user_data);
static bool handleRemove(const LLSD& notification, const LLSD& response);
bool modifyRightsConfirmation(const LLSD& notification, const LLSD& response, rights_map_t* rights);
private:
@@ -168,7 +153,6 @@ private:
S32 mNumRightsChanged;
S32 mNumOnline;
std::string mLastContactSearch;
static bool merging;
};

View File

@@ -36,101 +36,30 @@
#include "llfloatergroupinfo.h"
#include "llagent.h"
#include "llcommandhandler.h"
#include "llfloaterchatterbox.h"
#include "llpanelgroup.h"
#include "llviewermessage.h" // for inventory_offer_callback
//#include "llviewerwindow.h"
#include "llnotifications.h"
#include "llcachename.h"
#include "llpanelgroup.h"
const char FLOATER_TITLE[] = "Group Information";
const LLRect FGI_RECT(0, 530, 420, 0);
//
// Globals
//
std::map<LLUUID, LLFloaterGroupInfo*> LLFloaterGroupInfo::sInstances;
//moved to llgroupactions.cpp in v2
class LLGroupHandler : public LLCommandHandler
{
public:
// requires trusted browser to trigger
LLGroupHandler() : LLCommandHandler("group", UNTRUSTED_THROTTLE) { }
bool handle(const LLSD& tokens, const LLSD& query_map,
LLMediaCtrl* web)
{
if (tokens.size() < 1)
{
return false;
}
if (tokens[0].asString() == "create")
{
LLFloaterGroupInfo::showCreateGroup(NULL);
return true;
}
if (tokens.size() < 2)
{
return false;
}
if (tokens[0].asString() == "list")
{
if (tokens[1].asString() == "show")
{
// CP_TODO: get the value we pass in via the XUI name
// of the tab instead of using a literal like this
LLFloaterMyFriends::showInstance( 1 );
return true;
}
return false;
}
LLUUID group_id;
if (!group_id.set(tokens[0], FALSE))
{
return false;
}
if ((tokens[1].asString() == "about") || (tokens[1].asString() == "inspect"))
{
LLFloaterGroupInfo::showFromUUID(group_id);
return true;
}
return false;
}
};
LLGroupHandler gGroupHandler;
//-----------------------------------------------------------------------------
// Implementation
//-----------------------------------------------------------------------------
LLFloaterGroupInfo::LLFloaterGroupInfo(const std::string& name, const LLRect &rect, const std::string& title, const LLUUID& group_id, const std::string& tab_name)
: LLFloater(name, rect, title),
mGroupID( group_id )
LLFloaterGroupInfo::LLFloaterGroupInfo(const LLUUID& group_id)
: LLFloater(FLOATER_TITLE, LLRect(0, 530, 420, 0), FLOATER_TITLE), LLInstanceTracker<LLFloaterGroupInfo, LLUUID>(group_id)
{
llinfos << name << " : " << title << llendl;
llinfos << rect << llendl;
llinfos << getRect() << llendl;
llinfos << getLocalRect() << llendl;
// Construct the filename of the group panel xml definition file.
mPanelGroupp = new LLPanelGroup("panel_group.xml",
"PanelGroup",
group_id,
tab_name);
mPanelGroupp = new LLPanelGroup(group_id);
addChild(mPanelGroupp);
if (group_id.notNull())
{
// Look up the group name. The callback will insert it into the title.
gCacheName->get(group_id, true, boost::bind(&LLFloaterGroupInfo::callbackLoadGroupName, this, _2));
}
}
// virtual
LLFloaterGroupInfo::~LLFloaterGroupInfo()
{
sInstances.erase(mGroupID);
}
BOOL LLFloaterGroupInfo::canClose()
@@ -148,125 +77,11 @@ void LLFloaterGroupInfo::selectTabByName(std::string tab_name)
mPanelGroupp->selectTab(tab_name);
}
// static
void LLFloaterGroupInfo::showMyGroupInfo(void *)
void LLFloaterGroupInfo::callbackLoadGroupName(const std::string& full_name)
{
showFromUUID( gAgent.getGroupID() );
// Build a new title including the group name.
std::ostringstream title;
title << full_name << " - " << FLOATER_TITLE;
setTitle(title.str());
}
// static
void LLFloaterGroupInfo::showCreateGroup(void *)
{
showFromUUID(LLUUID::null, "general_tab");
}
// static
void LLFloaterGroupInfo::closeGroup(const LLUUID& group_id)
{
LLFloaterGroupInfo *fgi = get_if_there(sInstances, group_id, (LLFloaterGroupInfo*)NULL);
if (fgi)
{
if (fgi->mPanelGroupp)
{
fgi->mPanelGroupp->close();
}
}
}
// static
void LLFloaterGroupInfo::closeCreateGroup()
{
closeGroup(LLUUID::null);
}
// static
void LLFloaterGroupInfo::refreshGroup(const LLUUID& group_id)
{
LLFloaterGroupInfo *fgi = get_if_there(sInstances, group_id, (LLFloaterGroupInfo*)NULL);
if (fgi)
{
if (fgi->mPanelGroupp)
{
fgi->mPanelGroupp->refreshData();
}
}
}
// static
void LLFloaterGroupInfo::callbackLoadGroupName(const LLUUID& id, const std::string& full_name, bool is_group)
{
LLFloaterGroupInfo *fgi = get_if_there(sInstances, id, (LLFloaterGroupInfo*)NULL);
if (fgi)
{
// Build a new title including the group name.
std::ostringstream title;
title << full_name << " - " << FLOATER_TITLE;
fgi->setTitle(title.str());
}
}
// static
void LLFloaterGroupInfo::showFromUUID(const LLUUID& group_id,
const std::string& tab_name)
{
// If we don't have a floater for this group, create one.
LLFloaterGroupInfo *fgi = get_if_there(sInstances, group_id, (LLFloaterGroupInfo*)NULL);
if (!fgi)
{
fgi = new LLFloaterGroupInfo("groupinfo",
FGI_RECT,
FLOATER_TITLE,
group_id,
tab_name);
sInstances[group_id] = fgi;
if (group_id.notNull())
{
// Look up the group name.
// The callback will insert it into the title.
gCacheName->get(group_id, true, boost::bind(&callbackLoadGroupName, _1, _2, _3));
}
}
fgi->selectTabByName(tab_name);
fgi->center();
fgi->open(); /*Flawfinder: ignore*/
}
// static
void LLFloaterGroupInfo::showNotice(const std::string& subject,
const std::string& message,
const LLUUID& group_id,
const bool& has_inventory,
const std::string& inventory_name,
LLOfferInfo* inventory_offer)
{
llinfos << "LLFloaterGroupInfo::showNotice : " << subject << llendl;
if (group_id.isNull())
{
// We need to clean up that inventory offer.
if (inventory_offer)
{
inventory_offer->forceResponse(IOR_DECLINE);
}
return;
}
// If we don't have a floater for this group, drop this packet on the floor.
LLFloaterGroupInfo *fgi = get_if_there(sInstances, group_id, (LLFloaterGroupInfo*)NULL);
if (!fgi)
{
// We need to clean up that inventory offer.
if (inventory_offer)
{
inventory_offer->forceResponse(IOR_DECLINE);
}
return;
}
fgi->mPanelGroupp->showNotice(subject,message,has_inventory,inventory_name,inventory_offer);
}

View File

@@ -39,48 +39,29 @@
#define LL_LLFLOATERGROUPINFO_H
#include "llfloater.h"
#include "lluuid.h"
#include "llinstancetracker.h"
class LLPanelGroup;
struct LLOfferInfo;
class LLFloaterGroupInfo
: public LLFloater
: public LLFloater, public LLInstanceTracker<LLFloaterGroupInfo, LLUUID>
{
public:
LLFloaterGroupInfo(const LLUUID& group_id);
virtual ~LLFloaterGroupInfo();
static void showCreateGroup(void *);
static void showMyGroupInfo(void *);
static void showFromUUID(const LLUUID &group_id,
const std::string& tab_name = std::string());
static void closeCreateGroup();
static void closeGroup(const LLUUID& group_id);
static void refreshGroup(const LLUUID& group_id);
static void showNotice(const std::string& subject,
const std::string& message,
const LLUUID& group_id,
const bool& has_inventory,
const std::string& inventory_name,
LLOfferInfo* inventory_offer);
LLUUID getGroupID() { return mGroupID;}
void selectTabByName(std::string tab_name);
// This allow us to block the user from closing the floater
// if there is information that needs to be applied.
// This allows us to block the user from closing the floater if there is information that needs to be applied.
virtual BOOL canClose();
protected:
LLFloaterGroupInfo(const std::string& name, const LLRect &rect, const std::string& title, const LLUUID& group_id = LLUUID::null, const std::string& tab_name = std::string());
friend class LLGroupActions;
LLPanelGroup* mPanelGroupp;
private:
static void callbackLoadGroupName(const LLUUID& id, const std::string& full_name, bool is_group);
static std::map<LLUUID, LLFloaterGroupInfo*> sInstances;
LLUUID mGroupID;
LLPanelGroup* mPanelGroupp;
void callbackLoadGroupName(const std::string& full_name);
};
#endif

View File

@@ -51,6 +51,7 @@
#include "llfloatergroupinfo.h"
#include "llfloaterdirectory.h"
#include "llfocusmgr.h"
#include "llgroupactions.h"
#include "llselectmgr.h"
#include "llscrolllistctrl.h"
#include "llnotificationsutil.h"
@@ -218,23 +219,23 @@ BOOL LLPanelGroups::postBuild()
init_group_list(group_list, gAgent.getGroupID(), none_text);
group_list->setCommitCallback(boost::bind(&LLPanelGroups::onGroupList,this));
group_list->setSortChangedCallback(boost::bind(&LLPanelGroups::onGroupSortChanged,this)); //Force 'none' to always be first entry.
group_list->setDoubleClickCallback(boost::bind(&LLPanelGroups::onBtnIM,this));
group_list->setDoubleClickCallback(boost::bind(LLGroupActions::startIM, boost::bind(&LLScrollListCtrl::getCurrentID, group_list)));
childSetAction("Activate", onBtnActivate, this);
getChild<LLUICtrl>("Activate")->setCommitCallback(boost::bind(LLGroupActions::activate, boost::bind(&LLScrollListCtrl::getCurrentID, group_list)));
childSetAction("Info", onBtnInfo, this);
getChild<LLUICtrl>("Info")->setCommitCallback(boost::bind(LLGroupActions::show, boost::bind(&LLScrollListCtrl::getCurrentID, group_list)));
childSetAction("IM", onBtnIM, this);
getChild<LLUICtrl>("IM")->setCommitCallback(boost::bind(LLGroupActions::startIM, boost::bind(&LLScrollListCtrl::getCurrentID, group_list)));
childSetAction("Leave", onBtnLeave, this);
getChild<LLUICtrl>("Leave")->setCommitCallback(boost::bind(LLGroupActions::leave, boost::bind(&LLScrollListCtrl::getCurrentID, group_list)));
childSetAction("Create", onBtnCreate, this);
getChild<LLUICtrl>("Create")->setCommitCallback(boost::bind(LLGroupActions::createGroup));
childSetAction("Search...", onBtnSearch, this);
getChild<LLUICtrl>("Search...")->setCommitCallback(boost::bind(LLGroupActions::search));
childSetAction("Invite...", onBtnInvite, this);
childSetAction("Titles...", onBtnTitles, this);
getChild<LLUICtrl>("Titles...")->setCommitCallback(boost::bind(HBFloaterGroupTitles::toggle));
setDefaultBtn("IM");
@@ -291,148 +292,12 @@ void LLPanelGroups::enableButtons()
}
void LLPanelGroups::onBtnCreate(void* userdata)
{
LLPanelGroups* self = (LLPanelGroups*)userdata;
if(self) self->create();
}
void LLPanelGroups::onBtnInvite(void* userdata)
{
LLPanelGroups* self = (LLPanelGroups*)userdata;
if(self) self->invite();
}
void LLPanelGroups::onBtnActivate(void* userdata)
{
LLPanelGroups* self = (LLPanelGroups*)userdata;
if(self) self->activate();
}
void LLPanelGroups::onBtnInfo(void* userdata)
{
LLPanelGroups* self = (LLPanelGroups*)userdata;
if(self) self->info();
}
void LLPanelGroups::onBtnIM(void* userdata)
{
LLPanelGroups* self = (LLPanelGroups*)userdata;
if(self) self->startIM();
}
void LLPanelGroups::onBtnLeave(void* userdata)
{
LLPanelGroups* self = (LLPanelGroups*)userdata;
if(self) self->leave();
}
void LLPanelGroups::onBtnSearch(void* userdata)
{
LLPanelGroups* self = (LLPanelGroups*)userdata;
if(self) self->search();
}
void LLPanelGroups::onBtnTitles(void* userdata)
{
LLPanelGroups* self = (LLPanelGroups*)userdata;
if(self) self->titles();
}
void LLPanelGroups::create()
{
llinfos << "LLPanelGroups::create" << llendl;
LLFloaterGroupInfo::showCreateGroup(NULL);
}
void LLPanelGroups::activate()
{
llinfos << "LLPanelGroups::activate" << llendl;
LLCtrlListInterface *group_list = childGetListInterface("group list");
LLUUID group_id;
if (group_list)
{
group_id = group_list->getCurrentID();
}
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ActivateGroup);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addUUIDFast(_PREHASH_GroupID, group_id);
gAgent.sendReliableMessage();
}
void LLPanelGroups::info()
{
llinfos << "LLPanelGroups::info" << llendl;
LLCtrlListInterface *group_list = childGetListInterface("group list");
LLUUID group_id;
if (group_list && (group_id = group_list->getCurrentID()).notNull())
{
LLFloaterGroupInfo::showFromUUID(group_id);
}
}
void LLPanelGroups::startIM()
{
//llinfos << "LLPanelFriends::onClickIM()" << llendl;
LLCtrlListInterface *group_list = childGetListInterface("group list");
LLUUID group_id;
if (group_list && (group_id = group_list->getCurrentID()).notNull())
{
LLGroupData group_data;
if (gAgent.getGroupData(group_id, group_data))
{
static LLCachedControl<bool> tear_off("OtherChatsTornOff");
if (!tear_off)
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession(
group_data.mName,
IM_SESSION_GROUP_START,
group_id);
make_ui_sound("UISndStartIM");
}
else
{
// this should never happen, as starting a group IM session
// relies on you belonging to the group and hence having the group data
make_ui_sound("UISndInvalidOp");
}
}
}
void LLPanelGroups::leave()
{
llinfos << "LLPanelGroups::leave" << llendl;
LLCtrlListInterface *group_list = childGetListInterface("group list");
LLUUID group_id;
if (group_list && (group_id = group_list->getCurrentID()).notNull())
{
S32 count = gAgent.mGroups.count();
S32 i;
for(i = 0; i < count; ++i)
{
if(gAgent.mGroups.get(i).mID == group_id)
break;
}
if(i < count)
{
LLSD args;
args["GROUP"] = gAgent.mGroups.get(i).mName;
LLSD payload;
payload["group_id"] = group_id;
LLNotificationsUtil::add("GroupLeaveConfirmMember", args, payload, callbackLeaveGroup);
}
}
}
void LLPanelGroups::search()
{
LLFloaterDirectory::showGroups();
}
void LLPanelGroups::invite()
{
LLCtrlListInterface *group_list = childGetListInterface("group list");
@@ -448,31 +313,6 @@ void LLPanelGroups::invite()
LLFloaterGroupInvite::showForGroup(group_id);
}
void LLPanelGroups::titles()
{
HBFloaterGroupTitles::toggle();
}
// static
bool LLPanelGroups::callbackLeaveGroup(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
LLUUID group_id = notification["payload"]["group_id"].asUUID();
if(option == 0)
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_LeaveGroupRequest);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_GroupData);
msg->addUUIDFast(_PREHASH_GroupID, group_id);
gAgent.sendReliableMessage();
}
return false;
}
void LLPanelGroups::onGroupSortChanged()
{
LLScrollListCtrl *group_list = getChild<LLScrollListCtrl>("group list");

View File

@@ -52,7 +52,6 @@ class LLUICtrl;
class LLTextBox;
class LLScrollListCtrl;
class LLButton;
class LLFloaterGroupPicker;
class LLFloaterGroupPicker : public LLFloater, public LLUIFactory<LLFloaterGroupPicker, LLFloaterGroupPicker, VisibilityPolicy<LLFloater> >
{
@@ -105,29 +104,8 @@ protected:
void onGroupSortChanged();
void onGroupList();
static void onBtnCreate(void* userdata);
static void onBtnActivate(void* userdata);
static void onBtnInfo(void* userdata);
static void onBtnIM(void* userdata);
static void onBtnLeave(void* userdata);
static void onBtnSearch(void* userdata);
static void onBtnVote(void* userdata);
static void onBtnInvite(void* userdata);
static void onBtnTitles(void* userdata);
static void onDoubleClickGroup(void* userdata);
void create();
void activate();
void info();
void startIM();
void leave();
void search();
void callVote();
void invite();
void titles();
static bool callbackLeaveGroup(const LLSD& notification, const LLSD& response);
};

View File

@@ -3,10 +3,9 @@
* @brief LLFloaterImagePreview class implementation
*
* $LicenseInfo:firstyear=2004&license=viewergpl$
*
* Second Life Viewer Source Code
* Copyright (c) 2004-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
@@ -60,15 +59,9 @@
#include "llviewershadermgr.h"
#include "llviewertexturelist.h"
#include "llstring.h"
// <edit>
#include "llviewercontrol.h"
// </edit>
#include "hippogridmanager.h"
//static
S32 LLFloaterImagePreview::sUploadAmount = 10;
const S32 PREVIEW_BORDER_WIDTH = 2;
const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH;
const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE;
@@ -79,20 +72,11 @@ const S32 PREVIEW_TEXTURE_HEIGHT = 300;
//-----------------------------------------------------------------------------
// LLFloaterImagePreview()
//-----------------------------------------------------------------------------
LLFloaterImagePreview::LLFloaterImagePreview(const std::string& filename) :
LLFloaterNameDesc(filename),
mAvatarPreview(NULL),
mSculptedPreview(NULL),
mLastMouseX(0),
mLastMouseY(0),
mImagep(NULL)
{
loadImage(mFilenameAndPath);
}
// <edit>
LLFloaterImagePreview::LLFloaterImagePreview(const std::string& filename, void* item) :
LLFloaterNameDesc(filename, item),
// </edit>
mAvatarPreview(NULL),
mSculptedPreview(NULL),
mLastMouseX(0),
@@ -101,7 +85,6 @@ LLFloaterImagePreview::LLFloaterImagePreview(const std::string& filename, void*
{
loadImage(mFilenameAndPath);
}
// </edit>
//-----------------------------------------------------------------------------
// postBuild()
@@ -114,7 +97,6 @@ BOOL LLFloaterImagePreview::postBuild()
}
childSetLabelArg("ok_btn", "[UPLOADFEE]", gHippoGridManager->getConnectedGrid()->getUploadFee());
childSetAction("ok_btn", onBtnOK, this);
LLCtrlSelectionInterface* iface = childGetSelectionInterface("clothing_type_combo");
if (iface)
@@ -129,7 +111,7 @@ BOOL LLFloaterImagePreview::postBuild()
PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f);
childHide("bad_image_text");
getChildView("bad_image_text")->setVisible(FALSE);
if (mRawImagep.notNull() && gAgent.getRegion() != NULL)
{
@@ -140,7 +122,7 @@ BOOL LLFloaterImagePreview::postBuild()
mSculptedPreview->setPreviewTarget(mRawImagep, 2.0f);
if (mRawImagep->getWidth() * mRawImagep->getHeight () <= LL_IMAGE_REZ_LOSSLESS_CUTOFF * LL_IMAGE_REZ_LOSSLESS_CUTOFF)
childEnable("lossless_check");
getChildView("lossless_check")->setEnabled(TRUE);
// <edit>
gSavedSettings.setBOOL("TemporaryUpload",FALSE);
@@ -151,11 +133,13 @@ BOOL LLFloaterImagePreview::postBuild()
{
mAvatarPreview = NULL;
mSculptedPreview = NULL;
childShow("bad_image_text");
childDisable("clothing_type_combo");
childDisable("ok_btn");
getChildView("bad_image_text")->setVisible(TRUE);
getChildView("clothing_type_combo")->setEnabled(FALSE);
getChildView("ok_btn")->setEnabled(FALSE);
}
getChild<LLUICtrl>("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this));
return TRUE;
}
@@ -169,7 +153,6 @@ LLFloaterImagePreview::~LLFloaterImagePreview()
mRawImagep = NULL;
mAvatarPreview = NULL;
mSculptedPreview = NULL;
mImagep = NULL ;
}
@@ -352,7 +335,6 @@ void LLFloaterImagePreview::draw()
bool LLFloaterImagePreview::loadImage(const std::string& src_filename)
{
std::string exten = gDirUtilp->getExtension(src_filename);
U32 codec = LLImageBase::getCodecFromExtension(exten);
LLPointer<LLImageRaw> raw_image = new LLImageRaw;
@@ -771,7 +753,6 @@ BOOL LLImagePreviewAvatar::render()
LLVertexBuffer::unbind();
avatarp->updateLOD();
if (avatarp->mDrawable.notNull())
{
LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE);
@@ -918,7 +899,6 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance)
BOOL LLImagePreviewSculpted::render()
{
mNeedsUpdate = FALSE;
LLGLSUIDefault def;
LLGLDisable no_blend(GL_BLEND);
LLGLEnable cull(GL_CULL_FACE);

View File

@@ -3,10 +3,9 @@
* @brief LLFloaterImagePreview class definition
*
* $LicenseInfo:firstyear=2004&license=viewergpl$
*
* Second Life Viewer Source Code
* Copyright (c) 2004-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
@@ -115,9 +114,8 @@ protected:
class LLFloaterImagePreview : public LLFloaterNameDesc
{
public:
LLFloaterImagePreview(const std::string& filename);
// <edit>
LLFloaterImagePreview(const std::string& filename, void* item);
LLFloaterImagePreview(const std::string& filename, void* item = NULL);
// </edit>
virtual ~LLFloaterImagePreview();
@@ -129,7 +127,6 @@ public:
BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
static void onMouseCaptureLostImagePreview(LLMouseHandler*);
static void setUploadAmount(S32 amount) { sUploadAmount = amount; }
void clearAllPreviewTextures();
@@ -146,8 +143,6 @@ protected:
LLRect mPreviewRect;
LLRectf mPreviewImageRect;
LLPointer<LLViewerTexture> mImagep ;
static S32 sUploadAmount;
};
#endif // LL_LLFLOATERIMAGEPREVIEW_H

View File

@@ -31,7 +31,8 @@
*/
#include "llviewerprecompiledheaders.h"
#include "llfloateravatarinfo.h"
#include "llavataractions.h"
#include "llfloaterinspect.h"
#include "llfloatertools.h"
#include "llcachename.h"
@@ -39,7 +40,6 @@
#include "llselectmgr.h"
#include "lltoolcomp.h"
#include "lltoolmgr.h"
#include "llviewercontrol.h"
#include "llviewerobject.h"
#include "lluictrlfactory.h"
@@ -123,7 +123,7 @@ void LLFloaterInspect::onClickCreatorProfile(void* ctrl)
LLSelectNode* node = sInstance->mObjectSelection->getFirstNode(&func);
if(node)
{
LLFloaterAvatarInfo::showFromDirectory(node->mPermissions->getCreator());
LLAvatarActions::showProfile(node->mPermissions->getCreator());
}
}
}
@@ -153,10 +153,10 @@ void LLFloaterInspect::onClickOwnerProfile(void* ctrl)
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
LLFloaterAvatarInfo::showFromDirectory(owner_id);
LLAvatarActions::showProfile(owner_id);
}
// [/RLVa:KB]
// LLFloaterAvatarInfo::showFromDirectory(owner_id);
// LLAvatarActions::showProfile(owner_id);
}
}
}

View File

@@ -47,17 +47,18 @@
#include "llagent.h"
#include "llagentaccess.h"
#include "llavataractions.h"
#include "llavatarconstants.h" //For new Online check - HgB
#include "llbutton.h"
#include "llcheckboxctrl.h"
#include "llradiogroup.h"
#include "llcombobox.h"
#include "llfloaterauction.h"
#include "llfloateravatarinfo.h"
#include "llfloateravatarpicker.h"
#include "llfloatergroups.h"
#include "llfloatergroupinfo.h"
#include "llfloaterscriptlimits.h"
#include "llgroupactions.h"
#include "lllineeditor.h"
#include "llnamelistctrl.h"
#include "llnotify.h"
@@ -848,8 +849,7 @@ void LLPanelLandGeneral::onClickInfoGroup(void* userdata)
LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)userdata;
LLParcel* parcel = panelp->mParcel->getParcel();
if (!parcel) return;
LLUUID id = parcel->getGroupID();
if(id.notNull())LLFloaterGroupInfo::showFromUUID(parcel->getGroupID());
LLGroupActions::show(parcel->getGroupID());
}
void LLPanelLandGeneral::onClickProfile()
@@ -859,13 +859,11 @@ void LLPanelLandGeneral::onClickProfile()
if (parcel->getIsGroupOwned())
{
const LLUUID& group_id = parcel->getGroupID();
LLFloaterGroupInfo::showFromUUID(group_id);
LLGroupActions::show(parcel->getGroupID());
}
else
{
const LLUUID& avatar_id = parcel->getOwnerID();
LLFloaterAvatarInfo::showFromObject(avatar_id);
LLAvatarActions::showProfile(parcel->getOwnerID());
}
}
@@ -1179,11 +1177,11 @@ void LLPanelLandObjects::onDoubleClickOwner(void *userdata)
BOOL is_group = cell->getValue().asString() == OWNER_GROUP;
if (is_group)
{
LLFloaterGroupInfo::showFromUUID(owner_id);
LLGroupActions::show(owner_id);
}
else
{
LLFloaterAvatarInfo::showFromDirectory(owner_id);
LLAvatarActions::showProfile(owner_id);
}
}
}
@@ -2102,7 +2100,6 @@ void LLPanelLandOptions::refresh()
}
mSeeAvatarsCtrl->set(parcel->getSeeAVs());
mSeeAvatarsCtrl->setLabel(getString("see_avs_text"));
mSeeAvatarsCtrl->setEnabled(can_change_options && parcel->getHaveNewParcelLimitData());
BOOL can_change_landing_point = LLViewerParcelMgr::isParcelModifiableByAgent(parcel,

View File

@@ -42,8 +42,8 @@
#include "llagent.h"
#include "llbutton.h"
#include "llfloatergroupinfo.h"
#include "llfloaterworldmap.h"
#include "llgroupactions.h"
#include "llproductinforequest.h"
#include "llscrolllistctrl.h"
#include "llstatusbar.h"
@@ -103,7 +103,7 @@ BOOL LLFloaterLandHoldings::postBuild()
LLScrollListCtrl *grant_list = getChild<LLScrollListCtrl>("grant list");
// Grant list
grant_list->setDoubleClickCallback(boost::bind(&LLFloaterLandHoldings::onGrantList,this));
grant_list->setDoubleClickCallback(boost::bind(LLGroupActions::show, boost::bind(&LLScrollListCtrl::getCurrentID, grant_list)));
LLCtrlListInterface *list = grant_list->getListInterface();
if (!list) return TRUE;
@@ -323,19 +323,6 @@ void LLFloaterLandHoldings::onClickMap(void* data)
self->buttonCore(1);
}
// static
void LLFloaterLandHoldings::onGrantList(void* data)
{
LLFloaterLandHoldings* self = (LLFloaterLandHoldings*)data;
LLCtrlSelectionInterface *list = self->childGetSelectionInterface("grant list");
if (!list) return;
LLUUID group_id = list->getCurrentID();
if (group_id.notNull())
{
LLFloaterGroupInfo::showFromUUID(group_id);
}
}
void LLFloaterLandHoldings::refreshAggregates()
{
S32 allowed_area = gStatusBar->getSquareMetersCredit();

View File

@@ -60,8 +60,6 @@ public:
static void onClickMap(void*);
static void onClickLandmark(void*);
static void onGrantList(void* data);
protected:
LLFloaterLandHoldings();
virtual ~LLFloaterLandHoldings();

View File

@@ -39,7 +39,6 @@
#pragma warning (disable : 4263)
#pragma warning (disable : 4264)
#endif
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
#include "dae.h"
//#include "dom.h"
@@ -62,7 +61,6 @@
#include "dom/domScale.h"
#include "dom/domTranslate.h"
#include "dom/domVisual_scene.h"
#pragma GCC diagnostic pop
#if LL_MSVC
#pragma warning (pop)
#endif

View File

@@ -3,10 +3,9 @@
* @brief LLFloaterNameDesc class implementation
*
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
* Second Life Viewer Source Code
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
@@ -70,31 +69,16 @@ const S32 PREF_BUTTON_HEIGHT = 16;
//-----------------------------------------------------------------------------
// LLFloaterNameDesc()
//-----------------------------------------------------------------------------
LLFloaterNameDesc::LLFloaterNameDesc(const std::string& filename )
: LLFloater(std::string("Name/Description Floater"))
{
LLFloaterNameDesc::LLFloaterNameDesc(const LLSD& filename, void* item )
: LLFloater(std::string("Name/Description Floater")),
// <edit>
mItem = NULL;
mItem(item),
// </edit>
mFilenameAndPath = filename;
mFilename = gDirUtilp->getBaseFileName(filename, false);
// SL-5521 Maintain capitalization of filename when making the inventory item. JC
//LLStringUtil::toLower(mFilename);
mIsAudio = FALSE;
}
// <edit>
LLFloaterNameDesc::LLFloaterNameDesc(const std::string& filename, void* item )
: LLFloater(std::string("Name/Description Floater"))
mIsAudio(FALSE)
{
mItem = item;
mFilenameAndPath = filename;
mFilename = gDirUtilp->getBaseFileName(filename, false);
// SL-5521 Maintain capitalization of filename when making the inventory item. JC
//LLStringUtil::toLower(mFilename);
mIsAudio = FALSE;
mFilenameAndPath = filename.asString();
mFilename = gDirUtilp->getBaseFileName(mFilenameAndPath, false);
}
// </edit>
//-----------------------------------------------------------------------------
// postBuild()
@@ -109,11 +93,6 @@ BOOL LLFloaterNameDesc::postBuild()
LLStringUtil::stripNonprintable(asset_name);
LLStringUtil::trim(asset_name);
std::string exten = gDirUtilp->getExtension(asset_name);
if (exten == "wav")
{
mIsAudio = TRUE;
}
asset_name = gDirUtilp->getBaseFileName(asset_name, true); // no extsntion
setTitle(mFilename);
@@ -128,8 +107,8 @@ BOOL LLFloaterNameDesc::postBuild()
r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT );
childSetCommitCallback("name_form", doCommit, this);
childSetValue("name_form", LLSD(asset_name));
getChild<LLUICtrl>("name_form")->setCommitCallback(boost::bind(&LLFloaterNameDesc::doCommit, this));
getChild<LLUICtrl>("name_form")->setValue(LLSD(asset_name));
LLLineEditor *NameEditor = getChild<LLLineEditor>("name_form");
if (NameEditor)
@@ -142,7 +121,7 @@ BOOL LLFloaterNameDesc::postBuild()
y -= PREVIEW_LINE_HEIGHT;
r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT );
childSetCommitCallback("description_form", doCommit, this);
getChild<LLUICtrl>("description_form")->setCommitCallback(boost::bind(&LLFloaterNameDesc::doCommit, this));
LLLineEditor *DescEditor = getChild<LLLineEditor>("description_form");
if (DescEditor)
{
@@ -153,14 +132,10 @@ BOOL LLFloaterNameDesc::postBuild()
y -= llfloor(PREVIEW_LINE_HEIGHT * 1.2f);
// Cancel button
childSetAction("cancel_btn", onBtnCancel, this);
getChild<LLUICtrl>("cancel_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnCancel, this));
getChild<LLUICtrl>("ok_btn")->setLabelArg("[UPLOADFEE]", llformat("%s%d", gHippoGridManager->getConnectedGrid()->getCurrencySymbol().c_str(), LLGlobalEconomy::Singleton::getInstance()->getPriceUpload()));
// OK button
childSetLabelArg("ok_btn", "[UPLOADFEE]", gHippoGridManager->getConnectedGrid()->getUploadFee());
if (exten == "wav")
{
childSetAction("ok_btn", onBtnOK, this);
}
setDefaultBtn("ok_btn");
return TRUE;
@@ -182,45 +157,99 @@ void LLFloaterNameDesc::onCommit()
{
}
// static
//-----------------------------------------------------------------------------
// onCommit()
//-----------------------------------------------------------------------------
void LLFloaterNameDesc::doCommit( class LLUICtrl *, void* userdata )
void LLFloaterNameDesc::doCommit()
{
LLFloaterNameDesc* self = (LLFloaterNameDesc*) userdata;
self->onCommit();
onCommit();
}
// static
//-----------------------------------------------------------------------------
// onBtnOK()
//-----------------------------------------------------------------------------
void LLFloaterNameDesc::onBtnOK( void* userdata )
void LLFloaterNameDesc::onBtnOK()
{
LLFloaterNameDesc *fp =(LLFloaterNameDesc *)userdata;
fp->childDisable("ok_btn"); // don't allow inadvertent extra uploads
getChildView("ok_btn")->setEnabled(FALSE); // don't allow inadvertent extra uploads
LLAssetStorage::LLStoreAssetCallback callback = NULL;
S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); // kinda hack - assumes that unsubclassed LLFloaterNameDesc is only used for uploading chargeable assets, which it is right now (it's only used unsubclassed for the sound upload dialog, and THAT should be a subclass).
void *nruserdata = NULL;
std::string display_name = LLStringUtil::null;
upload_new_resource(fp->mFilenameAndPath, // file
fp->childGetValue("name_form").asString(),
fp->childGetValue("description_form").asString(),
upload_new_resource(mFilenameAndPath, // file
getChild<LLUICtrl>("name_form")->getValue().asString(),
getChild<LLUICtrl>("description_form")->getValue().asString(),
0, LLFolderType::FT_NONE, LLInventoryType::IT_NONE,
LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
display_name, callback, expected_upload_cost, nruserdata);
fp->close(false);
close(false);
}
// static
//-----------------------------------------------------------------------------
// onBtnCancel()
//-----------------------------------------------------------------------------
void LLFloaterNameDesc::onBtnCancel( void* userdata )
void LLFloaterNameDesc::onBtnCancel()
{
LLFloaterNameDesc *fp =(LLFloaterNameDesc *)userdata;
fp->close(false);
close(false);
}
//-----------------------------------------------------------------------------
// LLFloaterSoundPreview()
//-----------------------------------------------------------------------------
LLFloaterSoundPreview::LLFloaterSoundPreview(const LLSD& filename, void* item )
: LLFloaterNameDesc(filename, item)
{
mIsAudio = TRUE;
}
BOOL LLFloaterSoundPreview::postBuild()
{
if (!LLFloaterNameDesc::postBuild())
{
return FALSE;
}
getChild<LLUICtrl>("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this));
return TRUE;
}
//-----------------------------------------------------------------------------
// LLFloaterAnimPreview()
//-----------------------------------------------------------------------------
LLFloaterAnimPreview::LLFloaterAnimPreview(const LLSD& filename, void* item )
: LLFloaterNameDesc(filename, item)
{
}
BOOL LLFloaterAnimPreview::postBuild()
{
if (!LLFloaterNameDesc::postBuild())
{
return FALSE;
}
getChild<LLUICtrl>("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this));
return TRUE;
}
//-----------------------------------------------------------------------------
// LLFloaterScriptPreview()
//-----------------------------------------------------------------------------
LLFloaterScriptPreview::LLFloaterScriptPreview(const LLSD& filename, void* item )
: LLFloaterNameDesc(filename, item)
{
mIsText = TRUE;
}
BOOL LLFloaterScriptPreview::postBuild()
{
if (!LLFloaterNameDesc::postBuild())
{
return FALSE;
}
getChild<LLUICtrl>("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this));
return TRUE;
}

View File

@@ -3,10 +3,9 @@
* @brief LLFloaterNameDesc class definition
*
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
* Second Life Viewer Source Code
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
@@ -44,29 +43,49 @@ class LLRadioGroup;
class LLFloaterNameDesc : public LLFloater
{
public:
LLFloaterNameDesc(const std::string& filename);
// <edit>
LLFloaterNameDesc(const std::string& filename, void* item);
LLFloaterNameDesc(const LLSD& filename, void* item = NULL);
// </edit>
virtual ~LLFloaterNameDesc();
virtual BOOL postBuild();
static void doCommit(class LLUICtrl *, void* userdata);
void onBtnOK();
void onBtnCancel();
void doCommit();
protected:
virtual void onCommit();
protected:
BOOL mIsAudio;
bool mIsText;
std::string mFilenameAndPath;
std::string mFilename;
// <edit>
void* mItem;
// </edit>
};
static void onBtnOK(void*);
static void onBtnCancel(void*);
class LLFloaterSoundPreview : public LLFloaterNameDesc
{
public:
LLFloaterSoundPreview(const LLSD& filename, void* item = NULL );
virtual BOOL postBuild();
};
class LLFloaterAnimPreview : public LLFloaterNameDesc
{
public:
LLFloaterAnimPreview(const LLSD& filename, void* item = NULL );
virtual BOOL postBuild();
};
class LLFloaterScriptPreview : public LLFloaterNameDesc
{
public:
LLFloaterScriptPreview(const LLSD& filename, void* item = NULL );
virtual BOOL postBuild();
};
#endif // LL_LLFLOATERNAMEDESC_H

View File

@@ -264,8 +264,7 @@ BOOL LLFloaterNotification::postBuild()
return TRUE;
}
responses_combo->setCommitCallback(onCommitResponse);
responses_combo->setCallbackUserData(this);
responses_combo->setCommitCallback(boost::bind(&LLFloaterNotification::respond, this));
LLSD form_sd = form->asLLSD();

View File

@@ -73,7 +73,6 @@ public:
void onClose(bool app_quitting) { setVisible(FALSE); }
private:
static void onCommitResponse(LLUICtrl* ctrl, void* data) { ((LLFloaterNotification*)data)->respond(); }
LLNotification* mNote;
};
#endif

View File

@@ -35,12 +35,12 @@
#include "llfloaterobjectiminfo.h"
#include "llagentdata.h"
#include "llavataractions.h"
#include "llcachename.h"
#include "llcommandhandler.h"
#include "llfloater.h"
#include "llfloateravatarinfo.h"
#include "llfloatergroupinfo.h"
#include "llfloatermute.h"
#include "llgroupactions.h"
#include "llmutelist.h"
#include "llslurl.h"
#include "lltrans.h"
@@ -126,14 +126,14 @@ void LLFloaterObjectIMInfo::onClickOwner(void* data)
LLFloaterObjectIMInfo* self = (LLFloaterObjectIMInfo*)data;
if (self->mGroupOwned)
{
LLFloaterGroupInfo::showFromUUID(self->mOwnerID);
LLGroupActions::show(self->mOwnerID);
}
// else
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g
else if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (!RlvUtil::isNearbyAgent(self->mOwnerID)) )
// [/RLVa:KB]
{
LLFloaterAvatarInfo::showFromObject(self->mOwnerID);
LLAvatarActions::showProfile(self->mOwnerID);
}
}

View File

@@ -75,8 +75,8 @@ LLFloaterPostProcess::LLFloaterPostProcess() : LLFloater(std::string("Post-Proce
//Hacky, but for now checkboxes and sliders are assumed to link to shader uniforms.
if(dynamic_cast<LLSliderCtrl*>(*child_it) || dynamic_cast<LLCheckBoxCtrl*>(*child_it))
{
LLUICtrl *ctrl = dynamic_cast<LLUICtrl*>(*child_it);
ctrl->setCommitCallback(boost::bind(&LLFloaterPostProcess::onControlChanged, _1, (void*)ctrl->getName().c_str()));
LLUICtrl* ctrl = static_cast<LLUICtrl*>(*child_it);
ctrl->setCommitCallback(boost::bind(&LLFloaterPostProcess::onControlChanged, _1, _2));
}
}
}
@@ -84,14 +84,13 @@ LLFloaterPostProcess::LLFloaterPostProcess() : LLFloater(std::string("Post-Proce
// Effect loading and saving.
LLComboBox* comboBox = getChild<LLComboBox>("PPEffectsCombo");
childSetAction("PPLoadEffect", &LLFloaterPostProcess::onLoadEffect, comboBox);
comboBox->setCommitCallback(onChangeEffectName);
getChild<LLUICtrl>("PPLoadEffect")->setCommitCallback(boost::bind(&LLFloaterPostProcess::onLoadEffect, this, comboBox));
comboBox->setCommitCallback(boost::bind(&LLFloaterPostProcess::onChangeEffectName, this, _1));
LLLineEditor* editBox = getChild<LLLineEditor>("PPEffectNameEditor");
childSetAction("PPSaveEffect", &LLFloaterPostProcess::onSaveEffect, editBox);
getChild<LLUICtrl>("PPSaveEffect")->setCommitCallback(boost::bind(&LLFloaterPostProcess::onSaveEffect, this, editBox));
syncMenu();
}
LLFloaterPostProcess::~LLFloaterPostProcess()
@@ -113,47 +112,42 @@ LLFloaterPostProcess* LLFloaterPostProcess::instance()
}
void LLFloaterPostProcess::onControlChanged(LLUICtrl* ctrl, void* userData)
void LLFloaterPostProcess::onControlChanged(LLUICtrl* ctrl, const LLSD& v)
{
LLSD v = ctrl->getValue();
LLPostProcess::getInstance()->setSelectedEffectValue((char const *)userData, v);
LLPostProcess::getInstance()->setSelectedEffectValue(ctrl->getName(), v);
}
void LLFloaterPostProcess::onLoadEffect(void* userData)
void LLFloaterPostProcess::onLoadEffect(LLComboBox* comboBox)
{
LLComboBox* comboBox = static_cast<LLComboBox*>(userData);
LLSD::String effectName(comboBox->getSelectedValue().asString());
LLPostProcess::getInstance()->setSelectedEffect(effectName);
sPostProcess->syncMenu();
syncMenu();
}
void LLFloaterPostProcess::onSaveEffect(void* userData)
void LLFloaterPostProcess::onSaveEffect(LLLineEditor* editBox)
{
LLLineEditor* editBox = static_cast<LLLineEditor*>(userData);
std::string effectName(editBox->getValue().asString());
if (LLPostProcess::getInstance()->getAllEffectInfo().has(effectName))
{
LLSD payload;
payload["effect_name"] = effectName;
LLNotificationsUtil::add("PPSaveEffectAlert", LLSD(), payload, &LLFloaterPostProcess::saveAlertCallback);
LLNotificationsUtil::add("PPSaveEffectAlert", LLSD(), payload, boost::bind(&LLFloaterPostProcess::saveAlertCallback, this, _1, _2));
}
else
{
LLPostProcess::getInstance()->saveEffectAs(effectName);
sPostProcess->syncMenu();
syncMenu();
}
}
void LLFloaterPostProcess::onChangeEffectName(LLUICtrl* ctrl, void * userData)
void LLFloaterPostProcess::onChangeEffectName(LLUICtrl* ctrl)
{
// get the combo box and name
LLComboBox * comboBox = static_cast<LLComboBox*>(ctrl);
LLLineEditor* editBox = sPostProcess->getChild<LLLineEditor>("PPEffectNameEditor");
LLLineEditor* editBox = getChild<LLLineEditor>("PPEffectNameEditor");
// set the parameter's new name
editBox->setValue(comboBox->getSelectedValue());
@@ -168,7 +162,7 @@ bool LLFloaterPostProcess::saveAlertCallback(const LLSD& notification, const LLS
{
LLPostProcess::getInstance()->saveEffectAs(notification["payload"]["effect_name"].asString());
sPostProcess->syncMenu();
syncMenu();
}
return false;
}

View File

@@ -36,6 +36,8 @@
#include "llfloater.h"
class LLButton;
class LLComboBox;
class LLLineEditor;
class LLSliderCtrl;
class LLTabContainer;
class LLPanelPermissions;
@@ -58,13 +60,13 @@ public:
static LLFloaterPostProcess* instance();
/// post process callbacks
static void onControlChanged(LLUICtrl* ctrl, void* userData);
static void onLoadEffect(void* userData);
static void onSaveEffect(void* userData);
static void onChangeEffectName(LLUICtrl* ctrl, void * userData);
static void onControlChanged(LLUICtrl* ctrl, const LLSD& v);
void onLoadEffect(LLComboBox* comboBox);
void onSaveEffect(LLLineEditor* editBox);
void onChangeEffectName(LLUICtrl* ctrl);
/// prompts a user when overwriting an effect
static bool saveAlertCallback(const LLSD& notification, const LLSD& response);
bool saveAlertCallback(const LLSD& notification, const LLSD& response);
/// show off our menu
static void show();

View File

@@ -41,18 +41,19 @@
#include "llinventorydefines.h"
#include "llagent.h"
#include "llavataractions.h"
#include "llbutton.h"
#include "llcheckboxctrl.h"
#include "llfloateravatarinfo.h"
#include "llfloatergroupinfo.h"
#include "llgroupactions.h"
#include "llinventorymodel.h"
#include "llinventoryobserver.h"
#include "lllineeditor.h"
#include "llradiogroup.h"
#include "llresmgr.h"
#include "roles_constants.h"
#include "llselectmgr.h"
#include "lltextbox.h"
#include "lluiconstants.h"
#include "lltrans.h"
#include "llviewerinventory.h"
#include "llviewerobjectlist.h"
#include "llviewerregion.h"
@@ -593,10 +594,7 @@ void LLFloaterProperties::onClickCreator()
{
LLInventoryItem* item = findItem();
if(!item) return;
if(!item->getCreatorUUID().isNull())
{
LLFloaterAvatarInfo::showFromObject(item->getCreatorUUID());
}
LLAvatarActions::showProfile(item->getCreatorUUID());
}
// static
@@ -606,16 +604,15 @@ void LLFloaterProperties::onClickOwner()
if(!item) return;
if(item->getPermissions().isGroupOwned())
{
LLFloaterGroupInfo::showFromUUID(item->getPermissions().getGroup());
LLGroupActions::show(item->getPermissions().getGroup());
}
else
{
// if(!item->getPermissions().getOwner().isNull())
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
if ( (!item->getPermissions().getOwner().isNull()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) )
if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
// [/RLVa:KB]
{
LLFloaterAvatarInfo::showFromObject(item->getPermissions().getOwner());
LLAvatarActions::showProfile(item->getPermissions().getOwner());
}
}
}
@@ -970,7 +967,7 @@ void LLFloaterProperties::dirtyAll()
/// LLMultiProperties
///----------------------------------------------------------------------------
LLMultiProperties::LLMultiProperties(const LLRect &rect) : LLMultiFloater(std::string("Properties"), rect)
LLMultiProperties::LLMultiProperties(const LLRect &rect) : LLMultiFloater(LLTrans::getString("MultiPropertiesTitle"), rect)
{
}

View File

@@ -38,9 +38,9 @@
#include "llfontgl.h"
#include "llagent.h"
#include "llavataractions.h"
#include "llbutton.h"
#include "llfloatergodtools.h"
#include "llfloateravatarinfo.h"
#include "llnotificationsutil.h"
#include "llparcel.h"
#include "llscrolllistctrl.h"
@@ -126,16 +126,14 @@ BOOL LLFloaterTopObjects::postBuild()
if (line_editor)
{
line_editor->setCommitOnFocusLost(FALSE);
line_editor->setCommitCallback(onGetByOwnerName);
line_editor->setCallbackUserData(this);
line_editor->setCommitCallback(onGetByOwnerName, this);
}
line_editor = getChild<LLLineEditor>("object_name_editor");
if (line_editor)
{
line_editor->setCommitOnFocusLost(FALSE);
line_editor->setCommitCallback(onGetByObjectName);
line_editor->setCallbackUserData(this);
line_editor->setCommitCallback(onGetByObjectName, this);
}*/
mCurrentMode = STAT_REPORT_TOP_SCRIPTS;
@@ -481,8 +479,7 @@ void LLFloaterTopObjects::onProfile(void* data)
if (!list) return;
LLScrollListItem* first_selected = list->getFirstSelected();
if (!first_selected) return;
LLUUID taskid = first_selected->getUUID();
LLFloaterAvatarInfo::showFromDirectory(taskid);
LLAvatarActions::showProfile(first_selected->getUUID());
}
void LLFloaterTopObjects::onKickBtn(void* data)

View File

@@ -1,348 +0,0 @@
/**
* @file llfloatervoicedevicesettings.cpp
* @author Richard Nelson
* @brief Voice communication set-up
*
* $LicenseInfo:firstyear=2007&license=viewergpl$
*
* Copyright (c) 2007-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
#include "llfloatervoicedevicesettings.h"
// Viewer includes
#include "llagent.h"
#include "llbutton.h"
#include "llcombobox.h"
#include "llfocusmgr.h"
#include "lliconctrl.h"
#include "llprefsvoice.h"
#include "llsliderctrl.h"
#include "llviewercontrol.h"
#include "llvoiceclient.h"
#include "llimpanel.h"
// Library includes (after viewer)
#include "lluictrlfactory.h"
LLPanelVoiceDeviceSettings::LLPanelVoiceDeviceSettings()
{
mCtrlInputDevices = NULL;
mCtrlOutputDevices = NULL;
mInputDevice = gSavedSettings.getString("VoiceInputAudioDevice");
mOutputDevice = gSavedSettings.getString("VoiceOutputAudioDevice");
mDevicesUpdated = FALSE;
// grab "live" mic volume level
mMicVolume = gSavedSettings.getF32("AudioLevelMic");
// ask for new device enumeration
// now do this in onOpen() instead...
//gVoiceClient->refreshDeviceLists();
}
LLPanelVoiceDeviceSettings::~LLPanelVoiceDeviceSettings()
{
}
BOOL LLPanelVoiceDeviceSettings::postBuild()
{
LLSlider* volume_slider = getChild<LLSlider>("mic_volume_slider");
// set mic volume tuning slider based on last mic volume setting
volume_slider->setValue(mMicVolume);
childSetCommitCallback("voice_input_device", onCommitInputDevice, this);
childSetCommitCallback("voice_output_device", onCommitOutputDevice, this);
return TRUE;
}
void LLPanelVoiceDeviceSettings::draw()
{
// let user know that volume indicator is not yet available
bool is_in_tuning_mode = gVoiceClient->inTuningMode();
childSetVisible("wait_text", !is_in_tuning_mode);
LLPanel::draw();
F32 voice_power = gVoiceClient->tuningGetEnergy();
S32 discrete_power = 0;
if (!is_in_tuning_mode)
{
discrete_power = 0;
}
else
{
discrete_power = llmin(4, llfloor((voice_power / LLVoiceClient::OVERDRIVEN_POWER_LEVEL) * 4.f));
}
if (is_in_tuning_mode)
{
for(S32 power_bar_idx = 0; power_bar_idx < 5; power_bar_idx++)
{
std::string view_name = llformat("%s%d", "bar", power_bar_idx);
LLView* bar_view = getChild<LLView>(view_name);
if (bar_view)
{
if (power_bar_idx < discrete_power)
{
LLColor4 color = (power_bar_idx >= 3) ? gSavedSettings.getColor4("OverdrivenColor") : gSavedSettings.getColor4("SpeakingColor");
gl_rect_2d(bar_view->getRect(), color, TRUE);
}
gl_rect_2d(bar_view->getRect(), LLColor4::grey, FALSE);
}
}
}
}
void LLPanelVoiceDeviceSettings::apply()
{
std::string s;
if(mCtrlInputDevices)
{
s = mCtrlInputDevices->getSimple();
gSavedSettings.setString("VoiceInputAudioDevice", s);
mInputDevice = s;
}
if(mCtrlOutputDevices)
{
s = mCtrlOutputDevices->getSimple();
gSavedSettings.setString("VoiceOutputAudioDevice", s);
mOutputDevice = s;
}
// assume we are being destroyed by closing our embedding window
LLSlider* volume_slider = getChild<LLSlider>("mic_volume_slider");
if(volume_slider)
{
F32 slider_value = (F32)volume_slider->getValue().asReal();
gSavedSettings.setF32("AudioLevelMic", slider_value);
mMicVolume = slider_value;
}
}
void LLPanelVoiceDeviceSettings::cancel()
{
gSavedSettings.setString("VoiceInputAudioDevice", mInputDevice);
gSavedSettings.setString("VoiceOutputAudioDevice", mOutputDevice);
if(mCtrlInputDevices)
mCtrlInputDevices->setSimple(mInputDevice);
if(mCtrlOutputDevices)
mCtrlOutputDevices->setSimple(mOutputDevice);
gSavedSettings.setF32("AudioLevelMic", mMicVolume);
LLSlider* volume_slider = getChild<LLSlider>("mic_volume_slider");
if(volume_slider)
{
volume_slider->setValue(mMicVolume);
}
}
void LLPanelVoiceDeviceSettings::refresh()
{
//grab current volume
LLSlider* volume_slider = getChild<LLSlider>("mic_volume_slider");
// set mic volume tuning slider based on last mic volume setting
F32 current_volume = (F32)volume_slider->getValue().asReal();
gVoiceClient->tuningSetMicVolume(current_volume);
// Fill in popup menus
mCtrlInputDevices = getChild<LLComboBox>("voice_input_device");
mCtrlOutputDevices = getChild<LLComboBox>("voice_output_device");
if(!gVoiceClient->deviceSettingsAvailable())
{
// The combo boxes are disabled, since we can't get the device settings from the daemon just now.
// Put the currently set default (ONLY) in the box, and select it.
if(mCtrlInputDevices)
{
mCtrlInputDevices->removeall();
mCtrlInputDevices->add( mInputDevice, ADD_BOTTOM );
mCtrlInputDevices->setSimple(mInputDevice);
}
if(mCtrlOutputDevices)
{
mCtrlOutputDevices->removeall();
mCtrlOutputDevices->add( mOutputDevice, ADD_BOTTOM );
mCtrlOutputDevices->setSimple(mOutputDevice);
}
}
else if (!mDevicesUpdated)
{
LLVoiceClient::deviceList *devices;
LLVoiceClient::deviceList::iterator iter;
if(mCtrlInputDevices)
{
mCtrlInputDevices->removeall();
mCtrlInputDevices->add( getString("default_text"), ADD_BOTTOM );
devices = gVoiceClient->getCaptureDevices();
for(iter=devices->begin(); iter != devices->end(); iter++)
{
mCtrlInputDevices->add( *iter, ADD_BOTTOM );
}
if(!mCtrlInputDevices->setSimple(mInputDevice))
{
mCtrlInputDevices->setSimple(getString("default_text"));
}
}
if(mCtrlOutputDevices)
{
mCtrlOutputDevices->removeall();
mCtrlOutputDevices->add( getString("default_text"), ADD_BOTTOM );
devices = gVoiceClient->getRenderDevices();
for(iter=devices->begin(); iter != devices->end(); iter++)
{
mCtrlOutputDevices->add( *iter, ADD_BOTTOM );
}
if(!mCtrlOutputDevices->setSimple(mOutputDevice))
{
mCtrlOutputDevices->setSimple(getString("default_text"));
}
}
mDevicesUpdated = TRUE;
}
}
void LLPanelVoiceDeviceSettings::onOpen()
{
mInputDevice = gSavedSettings.getString("VoiceInputAudioDevice");
mOutputDevice = gSavedSettings.getString("VoiceOutputAudioDevice");
mMicVolume = gSavedSettings.getF32("AudioLevelMic");
mDevicesUpdated = FALSE;
// ask for new device enumeration
gVoiceClient->refreshDeviceLists();
// put voice client in "tuning" mode
gVoiceClient->tuningStart();
LLVoiceChannel::suspend();
}
void LLPanelVoiceDeviceSettings::onClose(bool app_quitting)
{
gVoiceClient->tuningStop();
LLVoiceChannel::resume();
}
// static
void LLPanelVoiceDeviceSettings::onCommitInputDevice(LLUICtrl* ctrl, void* user_data)
{
if(gVoiceClient)
{
gVoiceClient->setCaptureDevice(ctrl->getValue().asString());
}
}
// static
void LLPanelVoiceDeviceSettings::onCommitOutputDevice(LLUICtrl* ctrl, void* user_data)
{
if(gVoiceClient)
{
gVoiceClient->setRenderDevice(ctrl->getValue().asString());
}
}
//
// LLFloaterVoiceDeviceSettings
//
LLFloaterVoiceDeviceSettings::LLFloaterVoiceDeviceSettings(const LLSD& seed)
: LLFloater(std::string("floater_device_settings")),
mDevicePanel(NULL)
{
mFactoryMap["device_settings"] = LLCallbackMap(createPanelVoiceDeviceSettings, this);
// do not automatically open singleton floaters (as result of getInstance())
BOOL no_open = FALSE;
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_device_settings.xml", &mFactoryMap, no_open);
center();
}
void LLFloaterVoiceDeviceSettings::onOpen()
{
if(mDevicePanel)
{
mDevicePanel->onOpen();
}
LLFloater::onOpen();
}
void LLFloaterVoiceDeviceSettings::onClose(bool app_quitting)
{
if(mDevicePanel)
{
mDevicePanel->onClose(app_quitting);
}
setVisible(FALSE);
}
void LLFloaterVoiceDeviceSettings::apply()
{
if (mDevicePanel)
{
mDevicePanel->apply();
}
}
void LLFloaterVoiceDeviceSettings::cancel()
{
if (mDevicePanel)
{
mDevicePanel->cancel();
}
}
void LLFloaterVoiceDeviceSettings::draw()
{
if (mDevicePanel)
{
mDevicePanel->refresh();
}
LLFloater::draw();
}
// static
void* LLFloaterVoiceDeviceSettings::createPanelVoiceDeviceSettings(void* user_data)
{
LLFloaterVoiceDeviceSettings* floaterp = (LLFloaterVoiceDeviceSettings*)user_data;
floaterp->mDevicePanel = new LLPanelVoiceDeviceSettings();
return floaterp->mDevicePanel;
}

Some files were not shown because too many files have changed in this diff Show More