Merge branch 'master' of https://vcs.firestormviewer.org/phoenix-firestorm
commit
55f51f4829
|
|
@ -724,9 +724,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>4699b8389dfb754da0393ddb5d325722</string>
|
||||
<string>f283a064c30695bd7bf071f1bd481f32</string>
|
||||
<key>url</key>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/95882/856117/colladadom-2.3.569219-darwin64-569219.tar.bz2</string>
|
||||
<string>https://3p.firestormviewer.org/colladadom-2.3.222232011-darwin64-222232011.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>darwin64</string>
|
||||
|
|
@ -736,9 +736,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>e1a8e9eca2894687b3532474ffc9b326</string>
|
||||
<string>30b1a9b7637f7a1546d38430064ca582</string>
|
||||
<key>url</key>
|
||||
<string>http://3p.firestormviewer.org/colladadom-2.3.222130404-linux64-222130404.tar.bz2</string>
|
||||
<string>https://3p.firestormviewer.org/colladadom-2.3.222261253-linux64-222261253.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux64</string>
|
||||
|
|
@ -748,9 +748,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>343e46ea49a08ad6596d3dc702d5b812</string>
|
||||
<string>1c094d709a35b252bba7b6ef1871085c</string>
|
||||
<key>url</key>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/95883/856128/colladadom-2.3.569219-windows-569219.tar.bz2</string>
|
||||
<string>https://3p.firestormviewer.org/colladadom-2.3.222231850-windows-222231850.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
|
|
@ -760,9 +760,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>de5bdfb61b31db56c5fe7d0962ad11e2</string>
|
||||
<string>a7596da3696fc423ec1bc7d6764c01ab</string>
|
||||
<key>url</key>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/95884/856129/colladadom-2.3.569219-windows64-569219.tar.bz2</string>
|
||||
<string>https://3p.firestormviewer.org/colladadom-2.3.222231903-windows64-222231903.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows64</string>
|
||||
|
|
@ -1098,11 +1098,11 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>9aac95d85fd3f044da3fd9dd44ed5ca2</string>
|
||||
<string>21d50d222f005c033452ee3fad44bff1</string>
|
||||
<key>hash_algorithm</key>
|
||||
<string>md5</string>
|
||||
<key>url</key>
|
||||
<string>file:///opt/firestorm/fmodstudio-2.02.06-linux64_bionic-220911506.tar.bz2</string>
|
||||
<string>file:///opt/firestorm/fmodstudio-2.02.07-linux64_bionic-222191132.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux64</string>
|
||||
|
|
@ -2975,7 +2975,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
|||
<string>http://3p.firestormviewer.org/threejs-0.132.2-linux64-213500940.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>darwin64</string>
|
||||
<string>linux64</string>
|
||||
</map>
|
||||
<key>darwin64</key>
|
||||
<map>
|
||||
|
|
|
|||
|
|
@ -225,6 +225,7 @@ Ansariel Hiller
|
|||
MAINT-8723
|
||||
SL-10385
|
||||
SL-10891
|
||||
SL-10675
|
||||
SL-13364
|
||||
SL-13858
|
||||
SL-13697
|
||||
|
|
@ -828,6 +829,7 @@ Jonathan Yap
|
|||
Kadah Coba
|
||||
STORM-1060
|
||||
STORM-1843
|
||||
SL-10675
|
||||
Jondan Lundquist
|
||||
Joosten Briebers
|
||||
MAINT-7074
|
||||
|
|
|
|||
|
|
@ -6,8 +6,10 @@
|
|||
## 3.8 added VS_DEBUGGER_WORKING_DIRECTORY support
|
||||
cmake_minimum_required(VERSION 3.12.0 FATAL_ERROR)
|
||||
|
||||
set(ROOT_PROJECT_NAME "SecondLife" CACHE STRING
|
||||
"The root project/makefile/solution name. Defaults to SecondLife.")
|
||||
set(CMAKE_CXX_STANDARD 17) #<FS> Enable c++17 on all platforms
|
||||
|
||||
set(ROOT_PROJECT_NAME "Firestorm" CACHE STRING
|
||||
"The root project/makefile/solution name. Defaults to Firestorm.")
|
||||
project(${ROOT_PROJECT_NAME})
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
|
|
@ -21,8 +23,8 @@ if (WINDOWS)
|
|||
endif (WINDOWS)
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
|
||||
"Build type. One of: Debug Release RelWithDebInfo" FORCE)
|
||||
set(CMAKE_BUILD_TYPE Release CACHE STRING
|
||||
"Build type. One of: Release RelWithDebInfo" FORCE)
|
||||
endif (NOT CMAKE_BUILD_TYPE)
|
||||
|
||||
#<FS:AW optional opensim support>
|
||||
|
|
|
|||
|
|
@ -109,38 +109,6 @@ if (WINDOWS)
|
|||
/DNOMINMAX
|
||||
# /DDOM_DYNAMIC # For shared library colladadom
|
||||
)
|
||||
|
||||
# <FS:Ansariel> AVX/AVX2 support
|
||||
if (USE_AVX_OPTIMIZATION)
|
||||
add_compile_options(
|
||||
/GS
|
||||
/TP
|
||||
/W3
|
||||
/c
|
||||
/Zc:forScope
|
||||
/nologo
|
||||
/Oy-
|
||||
/Oi
|
||||
/Ot
|
||||
/arch:AVX
|
||||
/fp:fast
|
||||
)
|
||||
elseif (USE_AVX2_OPTIMIZATION)
|
||||
add_compile_options(
|
||||
/GS
|
||||
/TP
|
||||
/W3
|
||||
/c
|
||||
/Zc:forScope
|
||||
/nologo
|
||||
/Oy-
|
||||
/Oi
|
||||
/Ot
|
||||
/arch:AVX2
|
||||
/fp:fast
|
||||
)
|
||||
else (USE_AVX_OPTIMIZATION)
|
||||
# </FS:Ansariel> AVX/AVX2 support
|
||||
add_compile_options(
|
||||
/GS
|
||||
/TP
|
||||
|
|
@ -154,13 +122,20 @@ if (WINDOWS)
|
|||
# /arch:SSE2
|
||||
/fp:fast
|
||||
)
|
||||
# Nicky: x64 implies SSE2
|
||||
if( ADDRESS_SIZE EQUAL 32 )
|
||||
add_definitions( /arch:SSE2 )
|
||||
endif()
|
||||
|
||||
# <FS:Ansariel> AVX/AVX2 support
|
||||
if (USE_AVX_OPTIMIZATION)
|
||||
add_compile_options(/arch:AVX)
|
||||
elseif (USE_AVX2_OPTIMIZATION)
|
||||
add_compile_options(/arch:AVX2)
|
||||
else (USE_AVX_OPTIMIZATION)
|
||||
# Nicky: x64 implies SSE2
|
||||
if (ADDRESS_SIZE EQUAL 32)
|
||||
add_compile_options(/arch:SSE2)
|
||||
endif()
|
||||
endif (USE_AVX_OPTIMIZATION)
|
||||
|
||||
# </FS:Ansariel> AVX/AVX2 support
|
||||
|
||||
# Are we using the crummy Visual Studio KDU build workaround?
|
||||
if (NOT VS_DISABLE_FATAL_WARNINGS)
|
||||
add_definitions(/WX)
|
||||
|
|
@ -276,9 +251,13 @@ if (LINUX OR DARWIN)
|
|||
set(GCC_CXX_WARNINGS "$[GCC_WARNINGS] -Wno-reorder -Wno-unused-const-variable -Wno-format-extra-args -Wno-unused-private-field -Wno-unused-function -Wno-tautological-compare -Wno-empty-body -Wno-unused-variable -Wno-unused-value")
|
||||
else (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" AND DARWIN AND XCODE_VERSION GREATER 4.9)
|
||||
#elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||
set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor")
|
||||
set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor -Wno-unused-variable")
|
||||
endif ()
|
||||
|
||||
if(LINUX)
|
||||
set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor -Wno-unused-variable -Wno-unused-but-set-variable -Wno-pragmas -Wno-deprecated")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS "${GCC_WARNINGS} ${CMAKE_C_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${GCC_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}")
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ if (USESYSTEMLIBS)
|
|||
)
|
||||
else (USESYSTEMLIBS)
|
||||
if (LINUX)
|
||||
if( NOT USE_SDL2 )
|
||||
if( USE_SDL1 )
|
||||
use_prebuilt_binary(SDL)
|
||||
set (SDL_FOUND TRUE)
|
||||
|
||||
|
|
|
|||
|
|
@ -421,49 +421,6 @@ public:
|
|||
static std::string typeString(Type type); // Return human-readable type as a string
|
||||
};
|
||||
|
||||
struct llsd_select_bool : public std::unary_function<LLSD, LLSD::Boolean>
|
||||
{
|
||||
LLSD::Boolean operator()(const LLSD& sd) const
|
||||
{
|
||||
return sd.asBoolean();
|
||||
}
|
||||
};
|
||||
struct llsd_select_integer : public std::unary_function<LLSD, LLSD::Integer>
|
||||
{
|
||||
LLSD::Integer operator()(const LLSD& sd) const
|
||||
{
|
||||
return sd.asInteger();
|
||||
}
|
||||
};
|
||||
struct llsd_select_real : public std::unary_function<LLSD, LLSD::Real>
|
||||
{
|
||||
LLSD::Real operator()(const LLSD& sd) const
|
||||
{
|
||||
return sd.asReal();
|
||||
}
|
||||
};
|
||||
struct llsd_select_float : public std::unary_function<LLSD, F32>
|
||||
{
|
||||
F32 operator()(const LLSD& sd) const
|
||||
{
|
||||
return (F32)sd.asReal();
|
||||
}
|
||||
};
|
||||
struct llsd_select_uuid : public std::unary_function<LLSD, LLSD::UUID>
|
||||
{
|
||||
LLSD::UUID operator()(const LLSD& sd) const
|
||||
{
|
||||
return sd.asUUID();
|
||||
}
|
||||
};
|
||||
struct llsd_select_string : public std::unary_function<LLSD, LLSD::String>
|
||||
{
|
||||
LLSD::String operator()(const LLSD& sd) const
|
||||
{
|
||||
return sd.asString();
|
||||
}
|
||||
};
|
||||
|
||||
LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLSD& llsd);
|
||||
|
||||
namespace llsd
|
||||
|
|
|
|||
|
|
@ -40,31 +40,6 @@
|
|||
// <ND> For strcmp
|
||||
#include <string.h>
|
||||
#endif
|
||||
// Use to compare the first element only of a pair
|
||||
// e.g. typedef std::set<std::pair<int, Data*>, compare_pair<int, Data*> > some_pair_set_t;
|
||||
template <typename T1, typename T2>
|
||||
struct compare_pair_first
|
||||
{
|
||||
bool operator()(const std::pair<T1, T2>& a, const std::pair<T1, T2>& b) const
|
||||
{
|
||||
return a.first < b.first;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T1, typename T2>
|
||||
struct compare_pair_greater
|
||||
{
|
||||
bool operator()(const std::pair<T1, T2>& a, const std::pair<T1, T2>& b) const
|
||||
{
|
||||
if (!(a.first < b.first))
|
||||
return true;
|
||||
else if (!(b.first < a.first))
|
||||
return false;
|
||||
else
|
||||
return !(a.second < b.second);
|
||||
}
|
||||
};
|
||||
|
||||
// Use to compare the contents of two pointers (e.g. std::string*)
|
||||
template <typename T>
|
||||
struct compare_pointer_contents
|
||||
|
|
@ -123,58 +98,6 @@ struct DeletePairedPointerArray
|
|||
};
|
||||
|
||||
|
||||
// Alternate version of the above so that has a more cumbersome
|
||||
// syntax, but it can be used with compositional functors.
|
||||
// NOTE: The functor retuns a bool because msdev bombs during the
|
||||
// composition if you return void. Once we upgrade to a newer
|
||||
// compiler, the second unary_function template parameter can be set
|
||||
// to void.
|
||||
//
|
||||
// Here's a snippet showing how you use this object:
|
||||
//
|
||||
// typedef std::map<int, widget*> map_type;
|
||||
// map_type widget_map;
|
||||
// ... // add elements
|
||||
// // delete them all
|
||||
// for_each(widget_map.begin(),
|
||||
// widget_map.end(),
|
||||
// llcompose1(DeletePointerFunctor<widget>(),
|
||||
// llselect2nd<map_type::value_type>()));
|
||||
|
||||
template<typename T>
|
||||
struct DeletePointerFunctor : public std::unary_function<T*, bool>
|
||||
{
|
||||
bool operator()(T* ptr) const
|
||||
{
|
||||
delete ptr;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
// See notes about DeleteArray for why you should consider avoiding this.
|
||||
template<typename T>
|
||||
struct DeleteArrayFunctor : public std::unary_function<T*, bool>
|
||||
{
|
||||
bool operator()(T* ptr) const
|
||||
{
|
||||
delete[] ptr;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
// CopyNewPointer is a simple helper which accepts a pointer, and
|
||||
// returns a new pointer built with the copy constructor. Example:
|
||||
//
|
||||
// transform(in.begin(), in.end(), out.end(), CopyNewPointer());
|
||||
|
||||
struct CopyNewPointer
|
||||
{
|
||||
template<typename T> T* operator()(const T* ptr) const
|
||||
{
|
||||
return new T(*ptr);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, typename ALLOC>
|
||||
void delete_and_clear(std::list<T*, ALLOC>& list)
|
||||
{
|
||||
|
|
@ -363,161 +286,6 @@ OutputIter ll_transform_n(
|
|||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1994
|
||||
* Hewlett-Packard Company
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Hewlett-Packard Company makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1996-1998
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
|
||||
// helper to deal with the fact that MSDev does not package
|
||||
// select... with the stl. Look up usage on the sgi website.
|
||||
|
||||
template <class _Pair>
|
||||
struct _LLSelect1st : public std::unary_function<_Pair, typename _Pair::first_type> {
|
||||
const typename _Pair::first_type& operator()(const _Pair& __x) const {
|
||||
return __x.first;
|
||||
}
|
||||
};
|
||||
|
||||
template <class _Pair>
|
||||
struct _LLSelect2nd : public std::unary_function<_Pair, typename _Pair::second_type>
|
||||
{
|
||||
const typename _Pair::second_type& operator()(const _Pair& __x) const {
|
||||
return __x.second;
|
||||
}
|
||||
};
|
||||
|
||||
template <class _Pair> struct llselect1st : public _LLSelect1st<_Pair> {};
|
||||
template <class _Pair> struct llselect2nd : public _LLSelect2nd<_Pair> {};
|
||||
|
||||
// helper to deal with the fact that MSDev does not package
|
||||
// compose... with the stl. Look up usage on the sgi website.
|
||||
|
||||
template <class _Operation1, class _Operation2>
|
||||
class ll_unary_compose :
|
||||
public std::unary_function<typename _Operation2::argument_type,
|
||||
typename _Operation1::result_type>
|
||||
{
|
||||
protected:
|
||||
_Operation1 __op1;
|
||||
_Operation2 __op2;
|
||||
public:
|
||||
ll_unary_compose(const _Operation1& __x, const _Operation2& __y)
|
||||
: __op1(__x), __op2(__y) {}
|
||||
typename _Operation1::result_type
|
||||
operator()(const typename _Operation2::argument_type& __x) const {
|
||||
return __op1(__op2(__x));
|
||||
}
|
||||
};
|
||||
|
||||
template <class _Operation1, class _Operation2>
|
||||
inline ll_unary_compose<_Operation1,_Operation2>
|
||||
llcompose1(const _Operation1& __op1, const _Operation2& __op2)
|
||||
{
|
||||
return ll_unary_compose<_Operation1,_Operation2>(__op1, __op2);
|
||||
}
|
||||
|
||||
template <class _Operation1, class _Operation2, class _Operation3>
|
||||
class ll_binary_compose
|
||||
: public std::unary_function<typename _Operation2::argument_type,
|
||||
typename _Operation1::result_type> {
|
||||
protected:
|
||||
_Operation1 _M_op1;
|
||||
_Operation2 _M_op2;
|
||||
_Operation3 _M_op3;
|
||||
public:
|
||||
ll_binary_compose(const _Operation1& __x, const _Operation2& __y,
|
||||
const _Operation3& __z)
|
||||
: _M_op1(__x), _M_op2(__y), _M_op3(__z) { }
|
||||
typename _Operation1::result_type
|
||||
operator()(const typename _Operation2::argument_type& __x) const {
|
||||
return _M_op1(_M_op2(__x), _M_op3(__x));
|
||||
}
|
||||
};
|
||||
|
||||
template <class _Operation1, class _Operation2, class _Operation3>
|
||||
inline ll_binary_compose<_Operation1, _Operation2, _Operation3>
|
||||
llcompose2(const _Operation1& __op1, const _Operation2& __op2,
|
||||
const _Operation3& __op3)
|
||||
{
|
||||
return ll_binary_compose<_Operation1,_Operation2,_Operation3>
|
||||
(__op1, __op2, __op3);
|
||||
}
|
||||
|
||||
// helpers to deal with the fact that MSDev does not package
|
||||
// bind... with the stl. Again, this is from sgi.
|
||||
template <class _Operation>
|
||||
class llbinder1st :
|
||||
public std::unary_function<typename _Operation::second_argument_type,
|
||||
typename _Operation::result_type> {
|
||||
protected:
|
||||
_Operation op;
|
||||
typename _Operation::first_argument_type value;
|
||||
public:
|
||||
llbinder1st(const _Operation& __x,
|
||||
const typename _Operation::first_argument_type& __y)
|
||||
: op(__x), value(__y) {}
|
||||
typename _Operation::result_type
|
||||
operator()(const typename _Operation::second_argument_type& __x) const {
|
||||
return op(value, __x);
|
||||
}
|
||||
};
|
||||
|
||||
template <class _Operation, class _Tp>
|
||||
inline llbinder1st<_Operation>
|
||||
llbind1st(const _Operation& __oper, const _Tp& __x)
|
||||
{
|
||||
typedef typename _Operation::first_argument_type _Arg1_type;
|
||||
return llbinder1st<_Operation>(__oper, _Arg1_type(__x));
|
||||
}
|
||||
|
||||
template <class _Operation>
|
||||
class llbinder2nd
|
||||
: public std::unary_function<typename _Operation::first_argument_type,
|
||||
typename _Operation::result_type> {
|
||||
protected:
|
||||
_Operation op;
|
||||
typename _Operation::second_argument_type value;
|
||||
public:
|
||||
llbinder2nd(const _Operation& __x,
|
||||
const typename _Operation::second_argument_type& __y)
|
||||
: op(__x), value(__y) {}
|
||||
typename _Operation::result_type
|
||||
operator()(const typename _Operation::first_argument_type& __x) const {
|
||||
return op(__x, value);
|
||||
}
|
||||
};
|
||||
|
||||
template <class _Operation, class _Tp>
|
||||
inline llbinder2nd<_Operation>
|
||||
llbind2nd(const _Operation& __oper, const _Tp& __x)
|
||||
{
|
||||
typedef typename _Operation::second_argument_type _Arg2_type;
|
||||
return llbinder2nd<_Operation>(__oper, _Arg2_type(__x));
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare std::type_info* pointers a la std::less. We break this out as a
|
||||
* separate function for use in two different std::less specializations.
|
||||
|
|
@ -548,8 +316,7 @@ bool before(const std::type_info* lhs, const std::type_info* rhs)
|
|||
namespace std
|
||||
{
|
||||
template <>
|
||||
struct less<const std::type_info*>:
|
||||
public std::binary_function<const std::type_info*, const std::type_info*, bool>
|
||||
struct less<const std::type_info*>
|
||||
{
|
||||
bool operator()(const std::type_info* lhs, const std::type_info* rhs) const
|
||||
{
|
||||
|
|
@ -558,8 +325,7 @@ namespace std
|
|||
};
|
||||
|
||||
template <>
|
||||
struct less<std::type_info*>:
|
||||
public std::binary_function<std::type_info*, std::type_info*, bool>
|
||||
struct less<std::type_info*>
|
||||
{
|
||||
bool operator()(std::type_info* lhs, std::type_info* rhs) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
// [RLVa:KB] - Checked: RLVa-2.1.0
|
||||
#include <list>
|
||||
// [/RLVa:KB]
|
||||
#include <string_view>
|
||||
|
||||
#if LL_LINUX
|
||||
#include <wctype.h>
|
||||
|
|
|
|||
|
|
@ -531,7 +531,7 @@ namespace tut
|
|||
result.ensure();
|
||||
}
|
||||
|
||||
struct TestLargeMessage: public std::binary_function<size_t, size_t, bool>
|
||||
struct TestLargeMessage
|
||||
{
|
||||
TestLargeMessage(const std::string& PYTHON_, const std::string& reader_module_,
|
||||
const std::string& test_name_):
|
||||
|
|
|
|||
|
|
@ -24,9 +24,11 @@ include_directories (${CMAKE_CURRENT_SOURCE_DIR})
|
|||
include_directories(
|
||||
${LLMESSAGE_INCLUDE_DIRS}
|
||||
${LLCOMMON_INCLUDE_DIRS}
|
||||
${LLCOREHTTP_INCLUDE_DIRS}
|
||||
# ${LLCOREHTTP_INCLUDE_DIRS} <FS:ND> Make this system include directories.
|
||||
)
|
||||
|
||||
include_directories( SYSTEM ${LLCOREHTTP_INCLUDE_DIRS} )
|
||||
|
||||
set(llcorehttp_SOURCE_FILES
|
||||
bufferarray.cpp
|
||||
bufferstream.cpp
|
||||
|
|
|
|||
|
|
@ -1269,5 +1269,5 @@ U32 LLParcel::countExperienceKeyType( U32 type )
|
|||
return std::count_if(
|
||||
boost::begin(mExperienceKeys | boost::adaptors::map_values),
|
||||
boost::end(mExperienceKeys | boost::adaptors::map_values),
|
||||
std::bind2nd(std::equal_to<U32>(), type));
|
||||
[type](U32 key) { return key == type; });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,14 +141,14 @@ struct LLCalcParser : grammar<LLCalcParser>
|
|||
|
||||
power =
|
||||
unary_expr[power.value = arg1] >>
|
||||
*('^' >> assert_syntax(unary_expr[power.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&powf)(power.value, arg1)]))
|
||||
*('^' >> assert_syntax(unary_expr[power.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_pow)(self, power.value, arg1)]))
|
||||
;
|
||||
|
||||
term =
|
||||
power[term.value = arg1] >>
|
||||
*(('*' >> assert_syntax(power[term.value *= arg1])) |
|
||||
('/' >> assert_syntax(power[term.value /= arg1])) |
|
||||
('%' >> assert_syntax(power[term.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&fmodf)(term.value, arg1)]))
|
||||
('%' >> assert_syntax(power[term.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_fmod)(self, term.value, arg1)]))
|
||||
)
|
||||
;
|
||||
|
||||
|
|
@ -195,6 +195,8 @@ private:
|
|||
F32 _floor(const F32& a) const { return (F32)llfloor(a); }
|
||||
F32 _ceil(const F32& a) const { return llceil(a); }
|
||||
F32 _atan2(const F32& a,const F32& b) const { return atan2(a,b); }
|
||||
F32 _pow(const F32& a, const F32& b) const { return powf(a, b); }
|
||||
F32 _fmod(const F32&a, const F32& b) const { return fmodf(a, b); }
|
||||
|
||||
LLCalc::calc_map_t* mConstants;
|
||||
LLCalc::calc_map_t* mVariables;
|
||||
|
|
|
|||
|
|
@ -839,8 +839,6 @@ public:
|
|||
|
||||
llassert(size[0] >= gOctreeMinSize);
|
||||
|
||||
llassert(size[0] >= gOctreeMinSize);
|
||||
|
||||
//copy our children to a new branch
|
||||
oct_node* newnode = new oct_node(center, size, this);
|
||||
|
||||
|
|
|
|||
|
|
@ -443,12 +443,11 @@ LLCircuit::LLCircuit(const F32Seconds circuit_heartbeat_interval, const F32Secon
|
|||
|
||||
LLCircuit::~LLCircuit()
|
||||
{
|
||||
// delete pointers in the map.
|
||||
std::for_each(mCircuitData.begin(),
|
||||
mCircuitData.end(),
|
||||
llcompose1(
|
||||
DeletePointerFunctor<LLCircuitData>(),
|
||||
llselect2nd<circuit_data_map::value_type>()));
|
||||
// delete pointers in the map.
|
||||
for (auto circ_pair : mCircuitData)
|
||||
{
|
||||
delete circ_pair.second;
|
||||
}
|
||||
}
|
||||
|
||||
LLCircuitData *LLCircuit::addCircuitData(const LLHost &host, TPACKETID in_id)
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ void LLDispatcher::copyAllHandlerNames(keys_t& names) const
|
|||
mHandlers.begin(),
|
||||
mHandlers.end(),
|
||||
std::back_insert_iterator<keys_t>(names),
|
||||
llselect1st<dispatch_map_t::value_type>());
|
||||
[](const dispatch_map_t::value_type& pair) { return pair.first; });
|
||||
}
|
||||
|
||||
bool LLDispatcher::dispatch(
|
||||
|
|
|
|||
|
|
@ -32,18 +32,8 @@
|
|||
#include "llframetimer.h"
|
||||
|
||||
// This is used for the stl search_n function.
|
||||
#if _MSC_VER >= 1500 // VC9 has a bug in search_n
|
||||
struct eq_message_throttle_entry : public std::binary_function< LLMessageThrottleEntry, LLMessageThrottleEntry, bool >
|
||||
{
|
||||
bool operator()(const LLMessageThrottleEntry& a, const LLMessageThrottleEntry& b) const
|
||||
{
|
||||
return a.getHash() == b.getHash();
|
||||
}
|
||||
};
|
||||
#else
|
||||
bool eq_message_throttle_entry(LLMessageThrottleEntry a, LLMessageThrottleEntry b)
|
||||
{ return a.getHash() == b.getHash(); }
|
||||
#endif
|
||||
|
||||
const U64 SEC_TO_USEC = 1000000;
|
||||
|
||||
|
|
@ -118,14 +108,8 @@ BOOL LLMessageThrottle::addViewerAlert(const LLUUID& to, const std::string& mesg
|
|||
LLMessageThrottleEntry entry(hash, LLFrameTimer::getTotalTime());
|
||||
|
||||
// Check if this message is already in the list.
|
||||
#if _MSC_VER >= 1500 // VC9 has a bug in search_n
|
||||
// SJB: This *should* work but has not been tested yet *TODO: Test!
|
||||
message_list_iterator_t found = std::find_if(message_list->begin(), message_list->end(),
|
||||
std::bind2nd(eq_message_throttle_entry(), entry));
|
||||
#else
|
||||
message_list_iterator_t found = std::search_n(message_list->begin(), message_list->end(),
|
||||
1, entry, eq_message_throttle_entry);
|
||||
#endif
|
||||
if (found == message_list->end())
|
||||
{
|
||||
// This message was not found. Add it to the list.
|
||||
|
|
@ -152,14 +136,8 @@ BOOL LLMessageThrottle::addAgentAlert(const LLUUID& agent, const LLUUID& task, c
|
|||
LLMessageThrottleEntry entry(hash, LLFrameTimer::getTotalTime());
|
||||
|
||||
// Check if this message is already in the list.
|
||||
#if _MSC_VER >= 1500 // VC9 has a bug in search_n
|
||||
// SJB: This *should* work but has not been tested yet *TODO: Test!
|
||||
message_list_iterator_t found = std::find_if(message_list->begin(), message_list->end(),
|
||||
std::bind2nd(eq_message_throttle_entry(), entry));
|
||||
#else
|
||||
message_list_iterator_t found = std::search_n(message_list->begin(), message_list->end(),
|
||||
1, entry, eq_message_throttle_entry);
|
||||
#endif
|
||||
|
||||
if (found == message_list->end())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,17 +19,13 @@ include_directories(
|
|||
${LLXML_INCLUDE_DIRS}
|
||||
# ${LIBS_PREBUILT_DIR}/include/collada
|
||||
# ${LIBS_PREBUILT_DIR}/include/collada/1.4
|
||||
${COLLADA_INCLUDE_DIRS}
|
||||
${LLCHARACTER_INCLUDE_DIRS}
|
||||
)
|
||||
include_directories(SYSTEM
|
||||
${LLCOMMON_SYSTEM_INCLUDE_DIRS}
|
||||
${LLXML_SYSTEM_INCLUDE_DIRS}
|
||||
)
|
||||
include_directories(SYSTEM
|
||||
${LLCOMMON_SYSTEM_INCLUDE_DIRS}
|
||||
${LLXML_SYSTEM_INCLUDE_DIRS}
|
||||
${LLPHYSICSEXTENSIONS_INCLUDE_DIRS}
|
||||
${COLLADA_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(llprimitive_SOURCE_FILES
|
||||
|
|
|
|||
|
|
@ -166,7 +166,6 @@ void LLDockableFloater::setMinimized(BOOL minimize)
|
|||
{
|
||||
// minimizing a docked floater just hides it
|
||||
setVisible(FALSE);
|
||||
gFocusMgr.releaseFocusIfNeeded(this); // <FS:Ansariel> FIRE-31882: Release focus or main menu bar would receive it in LLViewerWindow::updateKeyboardFocus()
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ public:
|
|||
*
|
||||
* By default returns false.
|
||||
*/
|
||||
virtual bool overlapsScreenChannel() { return mOverlapsScreenChannel && getVisible() && isDocked(); }
|
||||
virtual bool overlapsScreenChannel() const { return mOverlapsScreenChannel && getVisible() && isDocked(); }
|
||||
virtual void setOverlapsScreenChannel(bool overlaps) { mOverlapsScreenChannel = overlaps; }
|
||||
|
||||
bool getUniqueDocking() { return mUniqueDocking; }
|
||||
|
|
@ -131,7 +131,7 @@ protected:
|
|||
boost::function<BOOL ()> mIsDockedStateForcedCallback;
|
||||
|
||||
//private: // <FS:Ansariel> Make mDockControl accessible from children because of FIRE-16803
|
||||
std::auto_ptr<LLDockControl> mDockControl;
|
||||
std::unique_ptr<LLDockControl> mDockControl;
|
||||
private: // <FS:Ansariel> Make mDockControl accessible from children because of FIRE-16803
|
||||
LLUIImagePtr mDockTongue;
|
||||
static LLHandle<LLFloater> sInstanceHandle;
|
||||
|
|
|
|||
|
|
@ -276,6 +276,7 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
|
|||
mMinHeight(p.min_height),
|
||||
mHeaderHeight(p.header_height),
|
||||
mLegacyHeaderHeight(p.legacy_header_height),
|
||||
mDefaultRectForGroup(true),
|
||||
mMinimized(FALSE),
|
||||
mForeground(FALSE),
|
||||
mFirstLook(TRUE),
|
||||
|
|
@ -994,7 +995,10 @@ bool LLFloater::applyRectControl()
|
|||
// </FS:Ansariel>
|
||||
|
||||
// other floaters in our group, position ourselves relative to them and don't save the rect
|
||||
mRectControl.clear();
|
||||
if (mDefaultRectForGroup)
|
||||
{
|
||||
mRectControl.clear();
|
||||
}
|
||||
mPositioning = LLFloaterEnums::POSITIONING_CASCADE_GROUP;
|
||||
}
|
||||
else
|
||||
|
|
@ -3854,8 +3858,15 @@ void LLFloater::stackWith(LLFloater& other)
|
|||
}
|
||||
next_rect.translate(floater_offset, -floater_offset);
|
||||
|
||||
next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, getRect().getWidth(), getRect().getHeight());
|
||||
|
||||
const LLRect& rect = getControlGroup()->getRect(mRectControl);
|
||||
if (rect.notEmpty() && !mDefaultRectForGroup && mResizable)
|
||||
{
|
||||
next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, llmax(mMinWidth, rect.getWidth()), llmax(mMinHeight, rect.getHeight()));
|
||||
}
|
||||
else
|
||||
{
|
||||
next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, getRect().getWidth(), getRect().getHeight());
|
||||
}
|
||||
setShape(next_rect);
|
||||
|
||||
if (!other.getHost())
|
||||
|
|
|
|||
|
|
@ -477,6 +477,7 @@ public:
|
|||
|
||||
protected:
|
||||
bool mSaveRect;
|
||||
bool mDefaultRectForGroup;
|
||||
std::string mRectControl;
|
||||
std::string mPosXControl;
|
||||
std::string mPosYControl;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
#include "llui.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "lluiimage.h"
|
||||
#include "llwindow.h"
|
||||
|
||||
static LLDefaultChildRegistry::Register<LLIconCtrl> r("icon");
|
||||
|
||||
|
|
@ -42,6 +43,7 @@ LLIconCtrl::Params::Params()
|
|||
: image("image_name"),
|
||||
color("color"),
|
||||
use_draw_context_alpha("use_draw_context_alpha", true),
|
||||
interactable("interactable", false),
|
||||
scale_image("scale_image"),
|
||||
min_width("min_width", 0),
|
||||
min_height("min_height", 0)
|
||||
|
|
@ -52,6 +54,7 @@ LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p)
|
|||
mColor(p.color()),
|
||||
mImagep(p.image),
|
||||
mUseDrawContextAlpha(p.use_draw_context_alpha),
|
||||
mInteractable(p.interactable),
|
||||
mPriority(0),
|
||||
mMinWidth(p.min_width),
|
||||
mMinHeight(p.min_height),
|
||||
|
|
@ -81,6 +84,16 @@ void LLIconCtrl::draw()
|
|||
LLUICtrl::draw();
|
||||
}
|
||||
|
||||
BOOL LLIconCtrl::handleHover(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
if (mInteractable && getEnabled())
|
||||
{
|
||||
getWindow()->setCursor(UI_CURSOR_HAND);
|
||||
return TRUE;
|
||||
}
|
||||
return LLUICtrl::handleHover(x, y, mask);
|
||||
}
|
||||
|
||||
// virtual
|
||||
// value might be a string or a UUID
|
||||
void LLIconCtrl::setValue(const LLSD& value)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ public:
|
|||
{
|
||||
Optional<LLUIImage*> image;
|
||||
Optional<LLUIColor> color;
|
||||
Optional<bool> use_draw_context_alpha;
|
||||
Optional<bool> use_draw_context_alpha,
|
||||
interactable;
|
||||
Optional<S32> min_width,
|
||||
min_height;
|
||||
Ignored scale_image;
|
||||
|
|
@ -67,6 +68,9 @@ public:
|
|||
// llview overrides
|
||||
virtual void draw();
|
||||
|
||||
// llview overrides
|
||||
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
|
||||
|
||||
// lluictrl overrides
|
||||
virtual void setValue(const LLSD& value );
|
||||
|
||||
|
|
@ -88,6 +92,7 @@ protected:
|
|||
// If set to true (default), use the draw context transparency.
|
||||
// If false, will use transparency returned by getCurrentTransparency(). See STORM-698.
|
||||
bool mUseDrawContextAlpha;
|
||||
bool mInteractable;
|
||||
|
||||
private:
|
||||
LLUIColor mColor;
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ void LLMenuButton::MenuPositions::declareValues()
|
|||
declare("topleft", MP_TOP_LEFT);
|
||||
declare("topright", MP_TOP_RIGHT);
|
||||
declare("bottomleft", MP_BOTTOM_LEFT);
|
||||
declare("bottomright", MP_BOTTOM_RIGHT);
|
||||
}
|
||||
|
||||
LLMenuButton::Params::Params()
|
||||
|
|
@ -212,6 +213,13 @@ void LLMenuButton::updateMenuOrigin()
|
|||
mY = rect.mBottom;
|
||||
break;
|
||||
}
|
||||
case MP_BOTTOM_RIGHT:
|
||||
{
|
||||
const LLRect& menu_rect = menu->getRect();
|
||||
mX = rect.mRight - menu_rect.getWidth();
|
||||
mY = rect.mBottom;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@ public:
|
|||
{
|
||||
MP_TOP_LEFT,
|
||||
MP_TOP_RIGHT,
|
||||
MP_BOTTOM_LEFT
|
||||
MP_BOTTOM_LEFT,
|
||||
MP_BOTTOM_RIGHT
|
||||
} EMenuPosition;
|
||||
|
||||
struct MenuPositions
|
||||
|
|
|
|||
|
|
@ -1545,16 +1545,18 @@ void LLMenuItemBranchDownGL::onFocusLost()
|
|||
{
|
||||
// needed for tab-based selection
|
||||
LLMenuItemBranchGL::onFocusLost();
|
||||
LLMenuGL::setKeyboardMode(FALSE);
|
||||
setHighlight(FALSE);
|
||||
// <FS:Ansariel> FIRE-31882 / FIRE-31896 / FIRE-31913 / FIRE-31920: Fix all kind of weird menu focus issues
|
||||
//LLMenuGL::setKeyboardMode(FALSE);
|
||||
//setHighlight(FALSE);
|
||||
}
|
||||
|
||||
void LLMenuItemBranchDownGL::setFocus(BOOL b)
|
||||
{
|
||||
// needed for tab-based selection
|
||||
LLMenuItemBranchGL::setFocus(b);
|
||||
LLMenuGL::setKeyboardMode(b);
|
||||
setHighlight(b);
|
||||
// <FS:Ansariel> FIRE-31882 / FIRE-31896 / FIRE-31913 / FIRE-31920: Fix all kind of weird menu focus issues
|
||||
//LLMenuGL::setKeyboardMode(b);
|
||||
//setHighlight(b);
|
||||
}
|
||||
|
||||
BOOL LLMenuItemBranchDownGL::handleKeyHere(KEY key, MASK mask)
|
||||
|
|
|
|||
|
|
@ -431,12 +431,13 @@ void LLTabContainer::draw()
|
|||
S32 cur_scroll_pos = getScrollPos();
|
||||
if (cur_scroll_pos > 0)
|
||||
{
|
||||
// S32 available_width_with_arrows = getRect().getWidth() - mRightTabBtnOffset - 2 * (LLPANEL_BORDER_WIDTH + tabcntr_arrow_btn_size + tabcntr_arrow_btn_size + 1);
|
||||
if (!mIsVertical)
|
||||
if (mIsVertical)
|
||||
{
|
||||
target_pixel_scroll = cur_scroll_pos * (BTN_HEIGHT + tabcntrv_pad);
|
||||
}
|
||||
else
|
||||
{
|
||||
// [SL:KB] - Patch: Control-TabContainer | Checked: 2014-03-17 (Catznip-3.6)
|
||||
S32 available_width_with_arrows = getRect().getWidth() - mRightTabBtnOffset - 2 * (LLPANEL_BORDER_WIDTH + tabcntr_arrow_btn_size + tabcntr_arrow_btn_size + 1);
|
||||
// [/SL:KB]
|
||||
for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter)
|
||||
{
|
||||
if (cur_scroll_pos == 0)
|
||||
|
|
@ -455,12 +456,6 @@ void LLTabContainer::draw()
|
|||
// clamp so that rightmost tab never leaves right side of screen
|
||||
target_pixel_scroll = llmin(mTotalTabWidth - available_width_with_arrows, target_pixel_scroll);
|
||||
}
|
||||
// [SL:KB] - Patch: Control-TabContainer | Checked: 2014-03-17 (Catznip-3.6)
|
||||
else
|
||||
{
|
||||
target_pixel_scroll = cur_scroll_pos * (BTN_HEIGHT + tabcntrv_pad);
|
||||
}
|
||||
// [/SL:KB]
|
||||
}
|
||||
|
||||
// [SL:KB] - Patch: Control-TabContainer | Checked: 2014-03-17 (Catznip-3.6)
|
||||
|
|
@ -1339,16 +1334,15 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
|
|||
sendChildToFront(mNextArrowBtn);
|
||||
sendChildToFront(mJumpPrevArrowBtn);
|
||||
sendChildToFront(mJumpNextArrowBtn);
|
||||
|
||||
if( select )
|
||||
{
|
||||
// [SL:KB] - Patch: Control-TabContainer | Checked: 2012-08-10 (Catznip-3.3)
|
||||
selectTabPanel(child);
|
||||
// [/SL:KB]
|
||||
// selectLastTab();
|
||||
}
|
||||
|
||||
updateMaxScrollPos();
|
||||
|
||||
if( select )
|
||||
{
|
||||
selectLastTab();
|
||||
mScrollPos = mMaxScrollPos;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void LLTabContainer::addPlaceholder(LLPanel* child, const std::string& label)
|
||||
|
|
@ -2331,9 +2325,9 @@ void LLTabContainer::updateMaxScrollPos()
|
|||
if( tab_total_height > available_height )
|
||||
{
|
||||
static LLUICachedControl<S32> tabcntrv_arrow_btn_size ("UITabCntrvArrowBtnSize", 0);
|
||||
S32 available_height_with_arrows = getRect().getHeight() - 2*(tabcntrv_arrow_btn_size + 3*tabcntrv_pad);
|
||||
S32 available_height_with_arrows = getRect().getHeight() - 2*(tabcntrv_arrow_btn_size + 3*tabcntrv_pad) - mNextArrowBtn->getRect().mBottom;
|
||||
S32 additional_needed = tab_total_height - available_height_with_arrows;
|
||||
setMaxScrollPos((S32) ceil(additional_needed / float(BTN_HEIGHT) ) );
|
||||
setMaxScrollPos((S32) ceil(additional_needed / float(BTN_HEIGHT + tabcntrv_pad) ) );
|
||||
no_scroll = FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -182,6 +182,7 @@ LLTextBase::Params::Params()
|
|||
font_shadow("font_shadow"),
|
||||
wrap("wrap"),
|
||||
trusted_content("trusted_content", true),
|
||||
always_show_icons("always_show_icons", false),
|
||||
use_ellipses("use_ellipses", false),
|
||||
// <FS:Ansariel> Optional icon position
|
||||
icon_positioning("icon_positioning", LLTextBaseEnums::RIGHT),
|
||||
|
|
@ -237,6 +238,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p)
|
|||
mClip(p.clip),
|
||||
mClipPartial(p.clip_partial && !p.allow_scroll),
|
||||
mTrustedContent(p.trusted_content),
|
||||
mAlwaysShowIcons(p.always_show_icons),
|
||||
mTrackEnd( p.track_end ),
|
||||
mScrollIndex(-1),
|
||||
mSelectionStart( 0 ),
|
||||
|
|
@ -523,8 +525,48 @@ void LLTextBase::drawHighlightsBackground(const highlight_list_t& highlights, co
|
|||
++rect_it)
|
||||
{
|
||||
LLRect selection_rect = *rect_it;
|
||||
selection_rect = *rect_it;
|
||||
selection_rect.translate(mVisibleTextRect.mLeft - content_display_rect.mLeft, mVisibleTextRect.mBottom - content_display_rect.mBottom);
|
||||
if (mScroller)
|
||||
{
|
||||
// If scroller is On content_display_rect has correct rect and safe to use as is
|
||||
// Note: we might need to account for border
|
||||
selection_rect.translate(mVisibleTextRect.mLeft - content_display_rect.mLeft, mVisibleTextRect.mBottom - content_display_rect.mBottom);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If scroller is Off content_display_rect will have rect from document, adjusted to text width, heigh and position
|
||||
// and we have to acount for offset depending on position
|
||||
S32 v_delta = 0;
|
||||
S32 h_delta = 0;
|
||||
switch (mVAlign)
|
||||
{
|
||||
case LLFontGL::TOP:
|
||||
v_delta = mVisibleTextRect.mTop - content_display_rect.mTop - mVPad;
|
||||
break;
|
||||
case LLFontGL::VCENTER:
|
||||
v_delta = (llmax(mVisibleTextRect.getHeight() - content_display_rect.mTop, -content_display_rect.mBottom) + (mVisibleTextRect.mBottom - content_display_rect.mBottom)) / 2;
|
||||
break;
|
||||
case LLFontGL::BOTTOM:
|
||||
v_delta = mVisibleTextRect.mBottom - content_display_rect.mBottom;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
switch (mHAlign)
|
||||
{
|
||||
case LLFontGL::LEFT:
|
||||
h_delta = mVisibleTextRect.mLeft - content_display_rect.mLeft + mHPad;
|
||||
break;
|
||||
case LLFontGL::HCENTER:
|
||||
h_delta = (llmax(mVisibleTextRect.getWidth() - content_display_rect.mLeft, -content_display_rect.mRight) + (mVisibleTextRect.mRight - content_display_rect.mRight)) / 2;
|
||||
break;
|
||||
case LLFontGL::RIGHT:
|
||||
h_delta = mVisibleTextRect.mRight - content_display_rect.mRight;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
selection_rect.translate(h_delta, v_delta);
|
||||
}
|
||||
gl_rect_2d(selection_rect, selection_color);
|
||||
}
|
||||
}
|
||||
|
|
@ -2285,7 +2327,7 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para
|
|||
LLUrlMatch match;
|
||||
std::string text = new_text;
|
||||
while ( LLUrlRegistry::instance().findUrl(text, match,
|
||||
boost::bind(&LLTextBase::replaceUrl, this, _1, _2, _3),isContentTrusted()))
|
||||
boost::bind(&LLTextBase::replaceUrl, this, _1, _2, _3),isContentTrusted() || mAlwaysShowIcons))
|
||||
{
|
||||
start = match.getStart();
|
||||
end = match.getEnd()+1;
|
||||
|
|
@ -2317,14 +2359,14 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para
|
|||
|
||||
// add icon before url if need
|
||||
// <FS:Ansariel> Optional icon position
|
||||
//LLTextUtil::processUrlMatch(&match, this, isContentTrusted() || match.isTrusted());
|
||||
//LLTextUtil::processUrlMatch(&match, this, isContentTrusted() || match.isTrusted() || mAlwaysShowIcons);
|
||||
//if ((isContentTrusted() || match.isTrusted()) && !match.getIcon().empty() )
|
||||
//{
|
||||
// setLastSegmentToolTip(LLTrans::getString("TooltipSLIcon"));
|
||||
//}
|
||||
if (mIconPositioning == LLTextBaseEnums::LEFT || match.isTrusted())
|
||||
if (mIconPositioning == LLTextBaseEnums::LEFT || match.isTrusted() || mAlwaysShowIcons)
|
||||
{
|
||||
LLTextUtil::processUrlMatch(&match, this, isContentTrusted() || match.isTrusted());
|
||||
LLTextUtil::processUrlMatch(&match, this, isContentTrusted() || match.isTrusted() || mAlwaysShowIcons);
|
||||
if ((isContentTrusted() || match.isTrusted()) && !match.getIcon().empty() )
|
||||
{
|
||||
setLastSegmentToolTip(LLTrans::getString("TooltipSLIcon"));
|
||||
|
|
@ -2368,7 +2410,7 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para
|
|||
}
|
||||
|
||||
// <FS:Ansariel> Optional icon position
|
||||
if (mIconPositioning == LLTextBaseEnums::RIGHT && !match.isTrusted())
|
||||
if (mIconPositioning == LLTextBaseEnums::RIGHT && !match.isTrusted() && !mAlwaysShowIcons)
|
||||
{
|
||||
LLTextUtil::processUrlMatch(&match,this,isContentTrusted());
|
||||
}
|
||||
|
|
@ -2454,6 +2496,18 @@ void LLTextBase::setFont(const LLFontGL* font)
|
|||
{
|
||||
mFont = font;
|
||||
mStyleDirty = true;
|
||||
|
||||
// <FS:Ansariel> FIRE-29425: User-selectable font and size for notecards
|
||||
for (auto segment : mSegments)
|
||||
{
|
||||
LLStyleConstSP style = segment->getStyle();
|
||||
LLStyleSP new_style(new LLStyle(*style));
|
||||
new_style->setFont(mFont);
|
||||
LLStyleConstSP sp(new_style);
|
||||
segment->setStyle(sp);
|
||||
}
|
||||
needsReflow();
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
void LLTextBase::needsReflow(S32 index)
|
||||
|
|
|
|||
|
|
@ -345,7 +345,8 @@ public:
|
|||
parse_highlights,
|
||||
clip,
|
||||
clip_partial,
|
||||
trusted_content;
|
||||
trusted_content,
|
||||
always_show_icons;
|
||||
|
||||
Optional<S32> v_pad,
|
||||
h_pad;
|
||||
|
|
@ -396,9 +397,7 @@ public:
|
|||
virtual void onFocusReceived();
|
||||
virtual void onFocusLost();
|
||||
|
||||
//<FS:KC - expose ParseHTML setting>
|
||||
void setParseHTML(bool parse_html) { mParseHTML = parse_html; }
|
||||
//</FS:KC - expose ParseHTML setting>
|
||||
void setParseHTML(bool parse_html) { mParseHTML = parse_html; }
|
||||
|
||||
// LLSpellCheckMenuHandler overrides
|
||||
/*virtual*/ bool getSpellCheck() const;
|
||||
|
|
@ -764,6 +763,8 @@ protected:
|
|||
bool mAutoIndent;
|
||||
S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes
|
||||
bool mSkipTripleClick;
|
||||
bool mAlwaysShowIcons;
|
||||
|
||||
bool mSkipLinkUnderline;
|
||||
|
||||
// support widgets
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ if (LINUX)
|
|||
libfreetype.a
|
||||
)
|
||||
|
||||
if( NOT USE_SDL2 )
|
||||
if( USE_SDL1 )
|
||||
list(APPEND viewer_SOURCE_FILES
|
||||
llkeyboardsdl.cpp
|
||||
llwindowsdl.cpp
|
||||
|
|
|
|||
|
|
@ -505,14 +505,14 @@ attributedStringInfo getSegments(NSAttributedString *str)
|
|||
// e.g. OS Window for upload something or Input Window...
|
||||
// mModifiers instance variable is for insertText: or insertText:replacementRange: (by Pell Smit)
|
||||
mModifiers = [theEvent modifierFlags];
|
||||
unichar ch = [[theEvent charactersIgnoringModifiers] characterAtIndex:0];
|
||||
bool acceptsText = mHasMarkedText ? false : callKeyDown(&eventData, keycode, mModifiers, ch);
|
||||
|
||||
bool acceptsText = mHasMarkedText ? false : callKeyDown(&eventData, keycode, mModifiers, [[theEvent characters] characterAtIndex:0]);
|
||||
unichar ch;
|
||||
if (acceptsText &&
|
||||
!mMarkedTextAllowed &&
|
||||
!(mModifiers & (NSControlKeyMask | NSCommandKeyMask)) && // commands don't invoke InputWindow
|
||||
![(LLAppDelegate*)[NSApp delegate] romanScript] &&
|
||||
(ch = [[theEvent charactersIgnoringModifiers] characterAtIndex:0]) > ' ' &&
|
||||
ch > ' ' &&
|
||||
ch != NSDeleteCharacter &&
|
||||
(ch < 0xF700 || ch > 0xF8FF)) // 0xF700-0xF8FF: reserved for function keys on the keyboard(from NSEvent.h)
|
||||
{
|
||||
|
|
@ -549,7 +549,9 @@ attributedStringInfo getSegments(NSAttributedString *str)
|
|||
if (mModifiers & mask)
|
||||
{
|
||||
eventData.mKeyEvent = NativeKeyEventData::KEYDOWN;
|
||||
callKeyDown(&eventData, [theEvent keyCode], 0, [[theEvent characters] characterAtIndex:0]);
|
||||
// <FS:Ansariel> Speculative fix for FIRE-31473
|
||||
//callKeyDown(&eventData, [theEvent keyCode], 0, [[theEvent characters] characterAtIndex:0]);
|
||||
callKeyDown(&eventData, [theEvent keyCode], 0, L'\0');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -476,14 +476,6 @@ long showAlert(std::string text, std::string title, int type)
|
|||
|
||||
unsigned int getModifiers()
|
||||
{
|
||||
// <FS:ND> Try current event of app first, otherwise we might get wrong results
|
||||
NSEvent *pEvent = [NSApp currentEvent];
|
||||
if( pEvent != nil )
|
||||
{
|
||||
return [pEvent modifierFlags];
|
||||
}
|
||||
// </FS:ND>
|
||||
|
||||
return [NSEvent modifierFlags];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -104,12 +104,8 @@ include_directories(
|
|||
${LLWINDOW_INCLUDE_DIRS}
|
||||
${LLXML_INCLUDE_DIRS}
|
||||
${LLLOGIN_INCLUDE_DIRS}
|
||||
${LIBS_PREBUILT_DIR}/include/collada
|
||||
${LIBS_PREBUILD_DIR}/include/hunspell
|
||||
${OPENAL_LIB_INCLUDE_DIRS}
|
||||
${LIBS_PREBUILT_DIR}/include/collada/1.4
|
||||
${GROWL_INCLUDE_DIRS}
|
||||
${COLLADA_INCLUDE_DIRS}
|
||||
${LLAPPEARANCE_INCLUDE_DIRS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
|
|
@ -120,6 +116,10 @@ include_directories(SYSTEM
|
|||
${LLCOMMON_SYSTEM_INCLUDE_DIRS}
|
||||
${LLXML_SYSTEM_INCLUDE_DIRS}
|
||||
${LLPHYSICSEXTENSIONS_INCLUDE_DIRS}
|
||||
${LIBS_PREBUILT_DIR}/include/collada
|
||||
${LIBS_PREBUILT_DIR}/include/collada/1.4
|
||||
${LIBS_PREBUILD_DIR}/include/hunspell
|
||||
${COLLADA_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if (USE_BUGSPLAT)
|
||||
|
|
@ -170,9 +170,9 @@ set(viewer_SOURCE_FILES
|
|||
fsfloaterim.cpp
|
||||
fsfloaterimcontainer.cpp
|
||||
fsfloaternearbychat.cpp
|
||||
fsfloaterpartialinventory.cpp
|
||||
fsfloaterplacedetails.cpp
|
||||
fsfloaterposestand.cpp
|
||||
fsfloaterprofile.cpp
|
||||
fsfloaterprotectedfolders.cpp
|
||||
fsfloaterradar.cpp
|
||||
fsfloatersearch.cpp
|
||||
|
|
@ -194,13 +194,10 @@ set(viewer_SOURCE_FILES
|
|||
fsnearbychathub.cpp
|
||||
fsnearbychatvoicemonitor.cpp
|
||||
fspanelblocklist.cpp
|
||||
fspanelclassified.cpp
|
||||
fspanelcontactsets.cpp
|
||||
fspanelimcontrolpanel.cpp
|
||||
fspanellogin.cpp
|
||||
fspanelprefs.cpp
|
||||
fspanelprofile.cpp
|
||||
fspanelprofileclassifieds.cpp
|
||||
fspanelradar.cpp
|
||||
fsparticipantlist.cpp
|
||||
fspose.cpp
|
||||
|
|
@ -346,6 +343,7 @@ set(viewer_SOURCE_FILES
|
|||
llfloatercamera.cpp
|
||||
llfloatercamerapresets.cpp
|
||||
llfloaterchatvoicevolume.cpp
|
||||
llfloaterclassified.cpp
|
||||
llfloatercolorpicker.cpp
|
||||
llfloaterconversationlog.cpp
|
||||
llfloaterconversationpreview.cpp
|
||||
|
|
@ -410,10 +408,12 @@ set(viewer_SOURCE_FILES
|
|||
fsfloaterperformance.cpp
|
||||
llfloaterperms.cpp
|
||||
llfloaterpostprocess.cpp
|
||||
llfloaterprofile.cpp
|
||||
llfloaterpreference.cpp
|
||||
# llfloaterpreferencesgraphicsadvanced.cpp
|
||||
llfloaterpreferenceviewadvanced.cpp
|
||||
llfloaterpreviewtrash.cpp
|
||||
llfloaterprofiletexture.cpp
|
||||
llfloaterproperties.cpp
|
||||
llfloaterregiondebugconsole.cpp
|
||||
llfloaterregioninfo.cpp
|
||||
|
|
@ -448,7 +448,6 @@ set(viewer_SOURCE_FILES
|
|||
llfloatervoiceeffect.cpp
|
||||
llfloatervoicevolume.cpp
|
||||
llfloaterwebcontent.cpp
|
||||
llfloaterwebprofile.cpp
|
||||
llfloaterwhitelistentry.cpp
|
||||
llfloaterwindowsize.cpp
|
||||
llfloaterworldmap.cpp
|
||||
|
|
@ -594,7 +593,6 @@ set(viewer_SOURCE_FILES
|
|||
llpanelmediasettingsgeneral.cpp
|
||||
llpanelmediasettingspermissions.cpp
|
||||
llpanelmediasettingssecurity.cpp
|
||||
llpanelme.cpp
|
||||
llpanelnearbymedia.cpp
|
||||
llpanelobject.cpp
|
||||
llpanelobjectinventory.cpp
|
||||
|
|
@ -604,8 +602,6 @@ set(viewer_SOURCE_FILES
|
|||
llpanelpeople.cpp
|
||||
llpanelpeoplemenus.cpp
|
||||
llpanelpermissions.cpp
|
||||
llpanelpick.cpp
|
||||
llpanelpicks.cpp
|
||||
llpanelplaceinfo.cpp
|
||||
llpanelplaceprofile.cpp
|
||||
llpanelplaces.cpp
|
||||
|
|
@ -614,6 +610,8 @@ set(viewer_SOURCE_FILES
|
|||
llpanelpresetspulldown.cpp
|
||||
llpanelprimmediacontrols.cpp
|
||||
llpanelprofile.cpp
|
||||
llpanelprofileclassifieds.cpp
|
||||
llpanelprofilepicks.cpp
|
||||
llpanelsnapshot.cpp
|
||||
llpanelsnapshotinventory.cpp
|
||||
llpanelsnapshotlocal.cpp
|
||||
|
|
@ -944,9 +942,9 @@ set(viewer_HEADER_FILES
|
|||
fsfloaterim.h
|
||||
fsfloaterimcontainer.h
|
||||
fsfloaternearbychat.h
|
||||
fsfloaterpartialinventory.h
|
||||
fsfloaterplacedetails.h
|
||||
fsfloaterposestand.h
|
||||
fsfloaterprofile.h
|
||||
fsfloaterprotectedfolders.h
|
||||
fsfloaterradar.h
|
||||
fsfloatersearch.h
|
||||
|
|
@ -970,12 +968,9 @@ set(viewer_HEADER_FILES
|
|||
fsnearbychatvoicemonitor.h
|
||||
fspanelblocklist.h
|
||||
fspanelcontactsets.h
|
||||
fspanelclassified.h
|
||||
fspanelimcontrolpanel.h
|
||||
fspanellogin.h
|
||||
fspanelprefs.h
|
||||
fspanelprofile.h
|
||||
fspanelprofileclassifieds.h
|
||||
fspanelradar.h
|
||||
fsparticipantlist.h
|
||||
fspose.h
|
||||
|
|
@ -1123,6 +1118,7 @@ set(viewer_HEADER_FILES
|
|||
llfloatercamerapresets.h
|
||||
llfloatercamera.h
|
||||
llfloaterchatvoicevolume.h
|
||||
llfloaterclassified.h
|
||||
llfloatercolorpicker.h
|
||||
llfloaterconversationlog.h
|
||||
llfloaterconversationpreview.h
|
||||
|
|
@ -1190,10 +1186,12 @@ set(viewer_HEADER_FILES
|
|||
fsfloaterperformance.h
|
||||
llfloaterperms.h
|
||||
llfloaterpostprocess.h
|
||||
llfloaterprofile.h
|
||||
llfloaterpreference.h
|
||||
# llfloaterpreferencesgraphicsadvanced.h
|
||||
llfloaterpreferenceviewadvanced.h
|
||||
llfloaterpreviewtrash.h
|
||||
llfloaterprofiletexture.h
|
||||
llfloaterproperties.h
|
||||
llfloaterregiondebugconsole.h
|
||||
llfloaterregioninfo.h
|
||||
|
|
@ -1228,7 +1226,6 @@ set(viewer_HEADER_FILES
|
|||
llfloatervoiceeffect.h
|
||||
llfloatervoicevolume.h
|
||||
llfloaterwebcontent.h
|
||||
llfloaterwebprofile.h
|
||||
llfloaterwhitelistentry.h
|
||||
llfloaterwindowsize.h
|
||||
llfloaterworldmap.h
|
||||
|
|
@ -1364,7 +1361,6 @@ set(viewer_HEADER_FILES
|
|||
llpanelmediasettingsgeneral.h
|
||||
llpanelmediasettingspermissions.h
|
||||
llpanelmediasettingssecurity.h
|
||||
llpanelme.h
|
||||
llpanelnearbymedia.h
|
||||
llpanelobject.h
|
||||
llpanelobjectinventory.h
|
||||
|
|
@ -1374,8 +1370,6 @@ set(viewer_HEADER_FILES
|
|||
llpanelpeople.h
|
||||
llpanelpeoplemenus.h
|
||||
llpanelpermissions.h
|
||||
llpanelpick.h
|
||||
llpanelpicks.h
|
||||
llpanelplaceinfo.h
|
||||
llpanelplaceprofile.h
|
||||
llpanelplaces.h
|
||||
|
|
@ -1384,6 +1378,8 @@ set(viewer_HEADER_FILES
|
|||
llpanelpresetspulldown.h
|
||||
llpanelprimmediacontrols.h
|
||||
llpanelprofile.h
|
||||
llpanelprofileclassifieds.h
|
||||
llpanelprofilepicks.h
|
||||
llpanelsnapshot.h
|
||||
llpanelteleporthistory.h
|
||||
llpaneltiptoast.h
|
||||
|
|
@ -2778,31 +2774,32 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE
|
|||
if (USE_BUGSPLAT)
|
||||
# BugSplat symbol-file generation
|
||||
if (WINDOWS)
|
||||
#<FS:ND> Comment this out, we do our own symbol package which also includes the exe and build_data.json
|
||||
# Just pack up a tarball containing only the .pdb file for the
|
||||
# executable. Because we intend to use cygwin tar, we must render
|
||||
# VIEWER_SYMBOL_FILE in cygwin path syntax.
|
||||
execute_process(COMMAND "cygpath" "-u" "${VIEWER_SYMBOL_FILE}"
|
||||
OUTPUT_VARIABLE VIEWER_SYMBOL_FILE_CYGWIN
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND "cygpath" "-u" "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}"
|
||||
OUTPUT_VARIABLE PARENT_DIRECTORY_CYGWIN
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}"
|
||||
# Use of 'tar ...j' here assumes VIEWER_SYMBOL_FILE endswith .tar.bz2;
|
||||
# testing a string suffix is painful enough in CMake language that
|
||||
# we'll continue assuming it until forced to generalize.
|
||||
COMMAND "tar"
|
||||
ARGS
|
||||
"cjf"
|
||||
"${VIEWER_SYMBOL_FILE_CYGWIN}"
|
||||
"-C"
|
||||
"${PARENT_DIRECTORY_CYGWIN}"
|
||||
"firestorm-bin.pdb"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/firestorm-bin.pdb"
|
||||
COMMENT "Packing viewer PDB into ${VIEWER_SYMBOL_FILE_CYGWIN}"
|
||||
)
|
||||
add_custom_target(generate_symbols DEPENDS "${VIEWER_SYMBOL_FILE}" ${VIEWER_BINARY_NAME})
|
||||
add_dependencies(generate_symbols ${VIEWER_BINARY_NAME})
|
||||
# execute_process(COMMAND "cygpath" "-u" "${VIEWER_SYMBOL_FILE}"
|
||||
# OUTPUT_VARIABLE VIEWER_SYMBOL_FILE_CYGWIN
|
||||
# OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
# execute_process(COMMAND "cygpath" "-u" "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}"
|
||||
# OUTPUT_VARIABLE PARENT_DIRECTORY_CYGWIN
|
||||
# OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
# add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}"
|
||||
# # Use of 'tar ...j' here assumes VIEWER_SYMBOL_FILE endswith .tar.bz2;
|
||||
# # testing a string suffix is painful enough in CMake language that
|
||||
# # we'll continue assuming it until forced to generalize.
|
||||
# COMMAND "tar"
|
||||
# ARGS
|
||||
# "cjf"
|
||||
# "${VIEWER_SYMBOL_FILE_CYGWIN}"
|
||||
# "-C"
|
||||
# "${PARENT_DIRECTORY_CYGWIN}"
|
||||
# "firestorm-bin.pdb"
|
||||
# DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/firestorm-bin.pdb"
|
||||
# COMMENT "Packing viewer PDB into ${VIEWER_SYMBOL_FILE_CYGWIN}"
|
||||
# )
|
||||
# add_custom_target(generate_symbols DEPENDS "${VIEWER_SYMBOL_FILE}" ${VIEWER_BINARY_NAME})
|
||||
# add_dependencies(generate_symbols ${VIEWER_BINARY_NAME})
|
||||
endif (WINDOWS)
|
||||
if (DARWIN)
|
||||
# Have to run dsymutil first, then pack up the resulting .dSYM directory
|
||||
|
|
@ -2861,7 +2858,7 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE
|
|||
endif (LINUX)
|
||||
endif (USE_BUGSPLAT)
|
||||
|
||||
if (NOT LINUX) #Linux generates symbols via viewer_manifest.py/fs_viewer_manifest.py
|
||||
if (DARWIN) #Linux/Windows generates symbols via viewer_manifest.py/fs_viewer_manifest.py
|
||||
# for both Bugsplat and Breakpad
|
||||
add_dependencies(llpackage generate_symbols)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
6.6.3
|
||||
6.6.4
|
||||
|
|
|
|||
|
|
@ -223,19 +223,18 @@ bool AOEngine::foreignAnimations()
|
|||
|
||||
LL_DEBUGS("AOEngine") << "Checking for foreign animation on seat " << seat << LL_ENDL;
|
||||
|
||||
for (LLVOAvatar::AnimSourceIterator sourceIterator = gAgentAvatarp->mAnimationSources.begin();
|
||||
sourceIterator != gAgentAvatarp->mAnimationSources.end(); ++sourceIterator)
|
||||
for (const auto&[source_id, animation_id] : gAgentAvatarp->mAnimationSources)
|
||||
{
|
||||
// skip animations run by the avatar itself
|
||||
if (sourceIterator->first != gAgentID)
|
||||
if (source_id != gAgentID)
|
||||
{
|
||||
// find the source object where the animation came from
|
||||
LLViewerObject* source = gObjectList.findObject(sourceIterator->first);
|
||||
LLViewerObject* source = gObjectList.findObject(source_id);
|
||||
|
||||
// proceed if it's not an attachment
|
||||
if (source && !source->isAttachment())
|
||||
{
|
||||
LL_DEBUGS("AOEngine") << "Source " << sourceIterator->first << " is running animation " << sourceIterator->second << LL_ENDL;
|
||||
LL_DEBUGS("AOEngine") << "Source " << source_id << " is running animation " << animation_id << LL_ENDL;
|
||||
|
||||
// get the source's root prim
|
||||
LLViewerObject* sourceRoot = dynamic_cast<LLViewerObject*>(source->getRoot());
|
||||
|
|
@ -243,7 +242,7 @@ bool AOEngine::foreignAnimations()
|
|||
// if the root prim is the same as the animation source, report back as TRUE
|
||||
if (sourceRoot && sourceRoot->getID() == seat)
|
||||
{
|
||||
LL_DEBUGS("AOEngine") << "foreign animation " << sourceIterator->second << " found on seat." << LL_ENDL;
|
||||
LL_DEBUGS("AOEngine") << "foreign animation " << animation_id << " found on seat." << LL_ENDL;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1018,12 +1017,12 @@ bool AOEngine::createAnimationLink(const AOSet* set, AOSet::AOState* state, cons
|
|||
|
||||
if (cats)
|
||||
{
|
||||
for (S32 index = 0; index < cats->size(); ++index)
|
||||
for (auto cat : *cats)
|
||||
{
|
||||
if (cats->at(index)->getName().compare(state->mName) == 0)
|
||||
if (cat->getName().compare(state->mName) == 0)
|
||||
{
|
||||
LL_DEBUGS("AOEngine") << "UUID found!" << LL_ENDL;
|
||||
newStateFolderUUID = cats->at(index)->getUUID();
|
||||
newStateFolderUUID = cat->getUUID();
|
||||
state->mInventoryUUID = newStateFolderUUID;
|
||||
break;
|
||||
}
|
||||
|
|
@ -1195,8 +1194,7 @@ bool AOEngine::removeAnimation(const AOSet* set, AOSet::AOState* state, S32 inde
|
|||
// this item was not an animation link, move it to lost and found
|
||||
if (move)
|
||||
{
|
||||
LLInventoryModel* model = &gInventory;
|
||||
model->changeItemParent(item, gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND), false);
|
||||
gInventory.changeItemParent(item, gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND), false);
|
||||
LLNotificationsUtil::add("AOForeignItemsFound", LLSD());
|
||||
update();
|
||||
return false;
|
||||
|
|
@ -1209,7 +1207,7 @@ bool AOEngine::removeAnimation(const AOSet* set, AOSet::AOState* state, S32 inde
|
|||
|
||||
state->mAnimations.erase(state->mAnimations.begin() + index);
|
||||
|
||||
if (state->mAnimations.size() == 0)
|
||||
if (state->mAnimations.empty())
|
||||
{
|
||||
LL_DEBUGS("AOEngine") << "purging folder " << state->mName << " from inventory because it's empty." << LL_ENDL;
|
||||
|
||||
|
|
@ -1219,12 +1217,18 @@ bool AOEngine::removeAnimation(const AOSet* set, AOSet::AOState* state, S32 inde
|
|||
|
||||
if (cats)
|
||||
{
|
||||
for (LLInventoryModel::cat_array_t::iterator it = cats->begin(); it != cats->end(); ++it)
|
||||
for (auto cat : *cats)
|
||||
{
|
||||
LLPointer<LLInventoryCategory> cat = (*it);
|
||||
std::vector<std::string> params;
|
||||
LLStringUtil::getTokens(cat->getName(), params, ":");
|
||||
std::string stateName = params[0];
|
||||
|
||||
if (params.empty())
|
||||
{
|
||||
LL_WARNS("AOEngine") << "Unexpected folder found in ao set folder: " << cat->getName() << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
const std::string& stateName = params[0];
|
||||
|
||||
if (state->mName.compare(stateName) == 0)
|
||||
{
|
||||
|
|
@ -1290,25 +1294,25 @@ void AOEngine::reloadStateAnimations(AOSet::AOState* state)
|
|||
|
||||
if (items)
|
||||
{
|
||||
for (S32 num = 0; num < items->size(); ++num)
|
||||
for (auto item : *items)
|
||||
{
|
||||
LL_DEBUGS("AOEngine") << "Found animation link " << items->at(num)->LLInventoryItem::getName()
|
||||
<< " desc " << items->at(num)->LLInventoryItem::getDescription()
|
||||
<< " asset " << items->at(num)->getAssetUUID() << LL_ENDL;
|
||||
LL_DEBUGS("AOEngine") << "Found animation link " << item->LLInventoryItem::getName()
|
||||
<< " desc " << item->LLInventoryItem::getDescription()
|
||||
<< " asset " << item->getAssetUUID() << LL_ENDL;
|
||||
|
||||
AOSet::AOAnimation anim;
|
||||
anim.mAssetUUID = items->at(num)->getAssetUUID();
|
||||
LLViewerInventoryItem* linkedItem = items->at(num)->getLinkedItem();
|
||||
anim.mAssetUUID = item->getAssetUUID();
|
||||
LLViewerInventoryItem* linkedItem = item->getLinkedItem();
|
||||
if (!linkedItem)
|
||||
{
|
||||
LL_WARNS("AOEngine") << "linked item for link " << items->at(num)->LLInventoryItem::getName() << " not found (broken link). Skipping." << LL_ENDL;
|
||||
LL_WARNS("AOEngine") << "linked item for link " << item->LLInventoryItem::getName() << " not found (broken link). Skipping." << LL_ENDL;
|
||||
continue;
|
||||
}
|
||||
anim.mName = linkedItem->LLInventoryItem::getName();
|
||||
anim.mInventoryUUID = items->at(num)->getUUID();
|
||||
anim.mInventoryUUID = item->getUUID();
|
||||
|
||||
S32 sortOrder;
|
||||
if (!LLStringUtil::convertToS32(items->at(num)->LLInventoryItem::getDescription(), sortOrder))
|
||||
if (!LLStringUtil::convertToS32(item->LLInventoryItem::getDescription(), sortOrder))
|
||||
{
|
||||
sortOrder = -1;
|
||||
}
|
||||
|
|
@ -1370,9 +1374,8 @@ void AOEngine::update()
|
|||
|
||||
if (categories)
|
||||
{
|
||||
for (S32 index = 0; index < categories->size(); ++index)
|
||||
for (auto currentCategory : *categories)
|
||||
{
|
||||
LLViewerInventoryCategory* currentCategory = categories->at(index);
|
||||
const std::string& setFolderName = currentCategory->getName();
|
||||
|
||||
if (setFolderName.empty())
|
||||
|
|
@ -1383,6 +1386,11 @@ void AOEngine::update()
|
|||
|
||||
std::vector<std::string> params;
|
||||
LLStringUtil::getTokens(setFolderName, params, ":");
|
||||
if (params.empty())
|
||||
{
|
||||
LL_WARNS("AOEngine") << "Unexpected folder found in ao set folder: " << currentCategory->getName() << LL_ENDL;
|
||||
continue;
|
||||
}
|
||||
|
||||
AOSet* newSet = getSetByName(params[0]);
|
||||
if (!newSet)
|
||||
|
|
@ -1440,11 +1448,16 @@ void AOEngine::update()
|
|||
gInventory.getDirectDescendentsOf(currentCategory->getUUID(), stateCategories, items);
|
||||
newSet->setComplete(true);
|
||||
|
||||
for (S32 state_index = 0; state_index < stateCategories->size(); ++state_index)
|
||||
for (auto stateCategory : *stateCategories)
|
||||
{
|
||||
std::vector<std::string> state_params;
|
||||
LLStringUtil::getTokens(stateCategories->at(state_index)->getName(), state_params, ":");
|
||||
std::string stateName = state_params[0];
|
||||
LLStringUtil::getTokens(stateCategory->getName(), state_params, ":");
|
||||
if (params.empty())
|
||||
{
|
||||
LL_WARNS("AOEngine") << "Unexpected state folder found in ao set: " << stateCategory->getName() << LL_ENDL;
|
||||
continue;
|
||||
}
|
||||
const std::string& stateName = state_params[0];
|
||||
|
||||
AOSet::AOState* state = newSet->getStateByName(stateName);
|
||||
if (!state)
|
||||
|
|
@ -1454,7 +1467,7 @@ void AOEngine::update()
|
|||
}
|
||||
LL_DEBUGS("AOEngine") << "Reading state " << stateName << LL_ENDL;
|
||||
|
||||
state->mInventoryUUID = stateCategories->at(state_index)->getUUID();
|
||||
state->mInventoryUUID = stateCategory->getUUID();
|
||||
for (U32 num = 1; num < state_params.size(); ++num)
|
||||
{
|
||||
if (state_params[num] == "CY")
|
||||
|
|
@ -1544,11 +1557,11 @@ void AOEngine::reload(bool aFromTimer)
|
|||
AOSet* AOEngine::getSetByName(const std::string& name) const
|
||||
{
|
||||
AOSet* found = nullptr;
|
||||
for (U32 index = 0; index < mSets.size(); ++index)
|
||||
for (auto set : mSets)
|
||||
{
|
||||
if (mSets[index]->getName().compare(name) == 0)
|
||||
if (set->getName().compare(name) == 0)
|
||||
{
|
||||
found = mSets[index];
|
||||
found = set;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1692,9 +1705,8 @@ void AOEngine::saveState(const AOSet::AOState* state)
|
|||
|
||||
void AOEngine::saveSettings()
|
||||
{
|
||||
for (U32 index = 0; index < mSets.size(); ++index)
|
||||
for (auto set : mSets)
|
||||
{
|
||||
AOSet* set = mSets[index];
|
||||
if (set->getDirty())
|
||||
{
|
||||
saveSet(set);
|
||||
|
|
@ -1772,9 +1784,9 @@ void AOEngine::inMouselook(bool mouselook)
|
|||
void AOEngine::setDefaultSet(AOSet* set)
|
||||
{
|
||||
mDefaultSet = set;
|
||||
for (U32 index = 0; index < mSets.size(); ++index)
|
||||
for (auto set : mSets)
|
||||
{
|
||||
mSets[index]->setDirty(true);
|
||||
set->setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1910,12 +1922,12 @@ void AOEngine::tick()
|
|||
gInventory.getDirectDescendentsOf(categoryID, categories, items);
|
||||
LL_DEBUGS("AOEngine") << "cat " << categories->size() << " items " << items->size() << LL_ENDL;
|
||||
|
||||
for (S32 index = 0; index < categories->size(); ++index)
|
||||
for (auto cat : *categories)
|
||||
{
|
||||
const std::string& catName = categories->at(index)->getName();
|
||||
const std::string& catName = cat->getName();
|
||||
if (catName.compare(ROOT_AO_FOLDER) == 0)
|
||||
{
|
||||
mAOFolder = categories->at(index)->getUUID();
|
||||
mAOFolder = cat->getUUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -179,10 +179,8 @@
|
|||
icon="Command_Picks_Icon"
|
||||
label_ref="Command_Picks_Label"
|
||||
tooltip_ref="Command_Picks_Tooltip"
|
||||
execute_function="Floater.Toggle"
|
||||
execute_parameters="picks"
|
||||
is_running_function="Floater.IsOpen"
|
||||
is_running_parameters="picks"
|
||||
execute_function="Avatar.TogglePicks"
|
||||
is_running_function="Avatar.IsPicksTabOpen"
|
||||
/>
|
||||
<command name="places"
|
||||
available_in_toybox="true"
|
||||
|
|
|
|||
|
|
@ -355,17 +355,6 @@
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>FSUseWebProfiles</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Shows web profiles instead of the v1-style profile floater</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>FSTPHistoryTZ</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -13977,7 +13966,7 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>https://jira.firestormviewer.org/secure/CreateIssueDetails!init.jspa?pid=10005&issuetype=1&priority=3&environment=[ENVIRONMENT]</string>
|
||||
<string>https://jira.firestormviewer.org/secure/CreateIssueDetails!init.jspa?pid=10003&issuetype=8&priority=3&environment=[ENVIRONMENT]</string>
|
||||
</map>
|
||||
<key>RevokePermsOnStopAnimation</key>
|
||||
<map>
|
||||
|
|
@ -14622,17 +14611,6 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>BasicUITooltips</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Show tooltips for various 2D UI elements like buttons or checkboxes, won't supress tooltips like drag'n'drop, inworld, links or media</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>ShowHoverTips</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -22113,6 +22091,17 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Value</key>
|
||||
<integer>3</integer>
|
||||
</map>
|
||||
<key>360QualitySelection</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Quality level for the 360 snapshot</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>128</integer>
|
||||
</map>
|
||||
<key>MFAHash</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -25656,6 +25645,28 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Value</key>
|
||||
<string>Scripting</string>
|
||||
</map>
|
||||
<key>FSNotecardFontName</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>The name of the font used for the notecard editor</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>SansSerif</string>
|
||||
</map>
|
||||
<key>FSNotecardFontSize</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>The size of the font used for the notecard editor</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>Medium</string>
|
||||
</map>
|
||||
<key>FSEnableRightclickOnTransparentObjects</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -26184,5 +26195,16 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Value</key>
|
||||
<integer>473405</integer>
|
||||
</map>
|
||||
<key>FSUseCoRoFor360Capture</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Use co-routine to extract 360 photos.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
</map>
|
||||
</llsd>
|
||||
|
|
|
|||
|
|
@ -243,18 +243,6 @@
|
|||
<integer>1</integer>
|
||||
</map>
|
||||
|
||||
<key>FSUseWebProfiles</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Shows web profiles instead of the v1-style profile floater</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
|
||||
<key>FSFolderViewItemHeight</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
|
|||
|
|
@ -219,18 +219,6 @@
|
|||
<integer>1</integer>
|
||||
</map>
|
||||
|
||||
<key>FSUseWebProfiles</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Shows web profiles instead of the v1-style profile floater</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
|
||||
<key>FSFolderViewItemHeight</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
|
|||
|
|
@ -231,18 +231,6 @@
|
|||
<integer>1</integer>
|
||||
</map>
|
||||
|
||||
<key>FSUseWebProfiles</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Shows web profiles instead of the v1-style profile floater</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
|
||||
<key>FSFolderViewItemHeight</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
|
|||
|
|
@ -207,18 +207,6 @@
|
|||
<integer>1</integer>
|
||||
</map>
|
||||
|
||||
<key>FSUseWebProfiles</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Shows web profiles instead of the v1-style profile floater</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
|
||||
<key>FSFolderViewItemHeight</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
|
|||
|
|
@ -254,18 +254,6 @@
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
|
||||
<key>FSUseWebProfiles</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Shows web profiles instead of the v1-style profile floater</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
|
||||
<key>FSFontChatLineSpacingPixels</key>
|
||||
<map>
|
||||
|
|
|
|||
|
|
@ -72,9 +72,9 @@ std::string cmd_line_mPackagerTargetFolderName;
|
|||
LLUUID cmd_line_mPackagerTargetFolder;
|
||||
LLUUID cmd_line_mPackagerDest;
|
||||
|
||||
LLViewerInventoryItem::item_array_t findInventoryInFolder(const std::string& ifolder)
|
||||
LLViewerInventoryItem::item_array_t findInventoryInFolder(std::string_view ifolder)
|
||||
{
|
||||
LLUUID folder = gInventory.findCategoryByName(ifolder);
|
||||
LLUUID folder = gInventory.findCategoryByName(static_cast<std::string>(ifolder));
|
||||
LLViewerInventoryCategory::cat_array_t cats;
|
||||
LLViewerInventoryItem::item_array_t items;
|
||||
gInventory.collectDescendents(folder, cats, items, FALSE);
|
||||
|
|
@ -88,14 +88,15 @@ class JCZdrop : public LLEventTimer
|
|||
public:
|
||||
BOOL mRunning;
|
||||
|
||||
JCZdrop(std::stack<LLViewerInventoryItem*> stack, LLUUID dest, std::string sFolder, std::string sUUID, bool package = false) : LLEventTimer(1.f), mRunning(FALSE)
|
||||
{
|
||||
mPackage = package;
|
||||
mStack = stack;
|
||||
mDestination = dest;
|
||||
mFolderName = sFolder;
|
||||
mDropUUID = sUUID;
|
||||
}
|
||||
JCZdrop(std::stack<LLViewerInventoryItem*> stack, LLUUID dest, std::string_view sFolder, std::string_view sUUID, bool package = false)
|
||||
: LLEventTimer(1.f),
|
||||
mRunning(FALSE),
|
||||
mPackage(package),
|
||||
mStack(stack),
|
||||
mDestination(dest),
|
||||
mFolderName(sFolder),
|
||||
mDropUUID(sUUID)
|
||||
{ }
|
||||
|
||||
~JCZdrop()
|
||||
{
|
||||
|
|
@ -129,7 +130,7 @@ public:
|
|||
LLViewerObject* objectp = gObjectList.findObject(mDestination);
|
||||
if (objectp)
|
||||
{
|
||||
report_to_nearby_chat(std::string("transferring ") + subj->getName());
|
||||
report_to_nearby_chat(std::string("Transferring ") + subj->getName());
|
||||
LLToolDragAndDrop::dropInventory(objectp, subj, LLToolDragAndDrop::SOURCE_AGENT, gAgentID);
|
||||
if (mStack.size() > 0)
|
||||
{
|
||||
|
|
@ -137,7 +138,7 @@ public:
|
|||
}
|
||||
else
|
||||
{
|
||||
return (mStack.size() == 0);
|
||||
return (mStack.empty());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -156,7 +157,7 @@ private:
|
|||
bool mPackage;
|
||||
};
|
||||
|
||||
JCZdrop* zdrop;
|
||||
JCZdrop* gZDrop{ nullptr };
|
||||
|
||||
class ZdCleanup: public LLEventTimer
|
||||
{
|
||||
|
|
@ -168,7 +169,7 @@ public:
|
|||
|
||||
BOOL tick()
|
||||
{
|
||||
zdrop = NULL;
|
||||
gZDrop = nullptr;
|
||||
return TRUE;
|
||||
}
|
||||
};
|
||||
|
|
@ -193,7 +194,7 @@ class JCZtake : public LLEventTimer
|
|||
public:
|
||||
BOOL mRunning;
|
||||
|
||||
JCZtake(const LLUUID& target, bool package = false, LLUUID destination = LLUUID::null, std::string dtarget = "", EDeRezDestination dest = DRD_TAKE_INTO_AGENT_INVENTORY, bool use_selection = true, std::vector<U32> to_take = std::vector<U32>()) :
|
||||
JCZtake(const LLUUID& target, bool package = false, const LLUUID& destination = LLUUID::null, std::string_view dtarget = "", EDeRezDestination dest = DRD_TAKE_INTO_AGENT_INVENTORY, bool use_selection = true, std::vector<U32> to_take = std::vector<U32>()) :
|
||||
LLEventTimer(0.66f),
|
||||
mTarget(target),
|
||||
mRunning(FALSE),
|
||||
|
|
@ -255,11 +256,14 @@ public:
|
|||
mToTake.push_back(localid);
|
||||
}
|
||||
}
|
||||
if (mToTake.size() > 0) mState = ZTS_TAKE;
|
||||
if (!mToTake.empty())
|
||||
{
|
||||
mState = ZTS_TAKE;
|
||||
}
|
||||
break;
|
||||
|
||||
case ZTS_TAKE:
|
||||
if (mToTake.size() > 0)
|
||||
if (!mToTake.empty())
|
||||
{
|
||||
std::vector<LLPointer<LLViewerInventoryItem> > inventory = findInventoryInFolder(mFolderName);
|
||||
mPackSize = mToTake.size() + inventory.size();
|
||||
|
|
@ -285,7 +289,7 @@ public:
|
|||
|
||||
if (mToTake.size() % 10 == 0)
|
||||
{
|
||||
if (mToTake.size() == 0)
|
||||
if (mToTake.empty())
|
||||
{
|
||||
if (mPackage)
|
||||
{
|
||||
|
|
@ -348,7 +352,8 @@ public:
|
|||
|
||||
if (itemstack.size() >= mPackSize || mCountdown == 0)
|
||||
{
|
||||
if (itemstack.size() < mPackSize) {
|
||||
if (itemstack.size() < mPackSize)
|
||||
{
|
||||
report_to_nearby_chat("Phase 1 of the packager finished, but some items mave have been missed.");
|
||||
}
|
||||
else
|
||||
|
|
@ -358,8 +363,8 @@ public:
|
|||
|
||||
report_to_nearby_chat("Do not have the destination prim selected while transfer is running to reduce the chances of \"Inventory creation on in-world object failed.\"");
|
||||
|
||||
LLUUID sdest = LLUUID(mPackageDest);
|
||||
new JCZdrop(itemstack, sdest, mFolderName.c_str(), mPackageDest.asString().c_str(), true);
|
||||
LLUUID sdest{ mPackageDest };
|
||||
gZDrop = new JCZdrop(itemstack, sdest, mFolderName.c_str(), mPackageDest.asString().c_str(), true);
|
||||
|
||||
doZtCleanup();
|
||||
mState = ZTS_DONE;
|
||||
|
|
@ -388,7 +393,7 @@ private:
|
|||
EZtakeState mState;
|
||||
};
|
||||
|
||||
JCZtake* ztake;
|
||||
JCZtake* gZTake{ nullptr };
|
||||
|
||||
class LOZtCleanup: public LLEventTimer
|
||||
{
|
||||
|
|
@ -400,9 +405,9 @@ public:
|
|||
|
||||
BOOL tick()
|
||||
{
|
||||
ztake->mRunning = TRUE;
|
||||
delete ztake;
|
||||
ztake = NULL;
|
||||
gZTake->mRunning = TRUE;
|
||||
delete gZTake;
|
||||
gZTake = nullptr;
|
||||
return TRUE;
|
||||
}
|
||||
};
|
||||
|
|
@ -470,7 +475,7 @@ public:
|
|||
{
|
||||
report_to_nearby_chat(llformat("%i...", mCountdown--));
|
||||
}
|
||||
else if (mToTake.size() > 0)
|
||||
else if (!mToTake.empty())
|
||||
{
|
||||
msg->newMessageFast(_PREHASH_DeRezObject);
|
||||
msg->nextBlockFast(_PREHASH_AgentData);
|
||||
|
|
@ -492,7 +497,7 @@ public:
|
|||
|
||||
if (mToTake.size() % 10 == 0)
|
||||
{
|
||||
if (mToTake.size() == 0)
|
||||
if (mToTake.empty())
|
||||
{
|
||||
report_to_nearby_chat("Mtake has taken all selected objects. Say \"mtake off\" to deactivate Mtake or select more objects to continue.");
|
||||
}
|
||||
|
|
@ -515,7 +520,7 @@ private:
|
|||
S32 zeroClearY;
|
||||
S32 zeroClearZ;
|
||||
};
|
||||
TMZtake* mtake;
|
||||
TMZtake* gMTake;
|
||||
|
||||
void invrepair()
|
||||
{
|
||||
|
|
@ -534,7 +539,7 @@ void key_to_name_callback(const LLUUID& id, const LLAvatarName& av_name)
|
|||
report_to_nearby_chat(llformat("%s: (%s)", id.asString().c_str(), name.c_str()));
|
||||
}
|
||||
|
||||
bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_gesture)
|
||||
bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gesture)
|
||||
{
|
||||
static LLCachedControl<bool> sFSCmdLine(gSavedSettings, "FSCmdLine");
|
||||
static LLCachedControl<std::string> sFSCmdLinePos(gSavedSettings, "FSCmdLinePos");
|
||||
|
|
@ -556,12 +561,11 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
static LLCachedControl<std::string> sFSCmdLineMusic(gSavedSettings, "FSCmdLineMusic");
|
||||
static LLCachedControl<std::string> sFSCmdLineCopyCam(gSavedSettings, "FSCmdLineCopyCam");
|
||||
static LLCachedControl<std::string> sFSCmdLineRollDice(gSavedSettings, "FSCmdLineRollDice");
|
||||
//<FS:HG> FIRE-6340, FIRE-6567 - Setting Bandwidth issues
|
||||
static LLCachedControl<std::string> sFSCmdLineBandwidth(gSavedSettings, "FSCmdLineBandWidth");
|
||||
|
||||
if (sFSCmdLine)
|
||||
{
|
||||
std::istringstream i(revised_text);
|
||||
std::istringstream i(static_cast<std::string>(revised_text));
|
||||
std::string command;
|
||||
i >> command;
|
||||
if (!command.empty())
|
||||
|
|
@ -651,7 +655,6 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
return false;
|
||||
}
|
||||
}
|
||||
//<FS:HG> FIRE-6340, FIRE-6567 - Setting Bandwidth issues
|
||||
else if (command == sFSCmdLineBandwidth())
|
||||
{
|
||||
S32 band_width;
|
||||
|
|
@ -667,7 +670,6 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
return false;
|
||||
}
|
||||
}
|
||||
//</FS:HG> FIRE-6340, FIRE-6567 - Setting Bandwidth issues
|
||||
else if (command == sFSCmdLineAO())
|
||||
{
|
||||
std::string status;
|
||||
|
|
@ -936,7 +938,7 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
}
|
||||
else
|
||||
{
|
||||
region_name = LLWeb::escapeURL(revised_text.substr(command.length() + 1));
|
||||
region_name = LLWeb::escapeURL(static_cast<std::string>(revised_text.substr(command.length() + 1)));
|
||||
LLVector3d agentPos = gAgent.getPositionGlobal();
|
||||
agent_x = ll_round((F32)agentPos.mdV[VX]);
|
||||
agent_y = ll_round((F32)agentPos.mdV[VY]);
|
||||
|
|
@ -961,7 +963,7 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
F32 result = 0.f;
|
||||
if (revised_text.length() > command.length() + 1)
|
||||
{
|
||||
std::string expr = revised_text.substr(command.length()+1);
|
||||
std::string expr = static_cast<std::string>(revised_text.substr(command.length() + 1));
|
||||
LLStringUtil::toUpper(expr);
|
||||
std::string original_expr = expr;
|
||||
|
||||
|
|
@ -1024,7 +1026,7 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
{
|
||||
if (revised_text.length() > command.length() + 1) //Typing this command with no argument was causing a crash. -Madgeek
|
||||
{
|
||||
std::string name = revised_text.substr(command.length() + 1);
|
||||
std::string_view name = revised_text.substr(command.length() + 1);
|
||||
cmdline_tp2name(name);
|
||||
}
|
||||
return false;
|
||||
|
|
@ -1047,7 +1049,7 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
{
|
||||
if (setting == "on")
|
||||
{
|
||||
if (zdrop)
|
||||
if (gZDrop)
|
||||
{
|
||||
report_to_nearby_chat("Zdrop is already active.");
|
||||
}
|
||||
|
|
@ -1083,12 +1085,11 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
report_to_nearby_chat("Verifying folder location...");
|
||||
std::stack<LLViewerInventoryItem*> inventorystack;
|
||||
std::vector<LLPointer<LLViewerInventoryItem> > inventory = findInventoryInFolder(folder);
|
||||
for (std::vector<LLPointer<LLViewerInventoryItem> >::iterator it = inventory.begin(); it != inventory.end(); ++it)
|
||||
for (const auto& item : inventory)
|
||||
{
|
||||
LLViewerInventoryItem* item = *it;
|
||||
inventorystack.push(item);
|
||||
inventorystack.emplace(item);
|
||||
}
|
||||
if (inventorystack.size())
|
||||
if (!inventorystack.empty())
|
||||
{
|
||||
report_to_nearby_chat(llformat("Found folder \"%s\".", folder.c_str()));
|
||||
report_to_nearby_chat(llformat("Found prim \"%s\".", destination.c_str()));
|
||||
|
|
@ -1097,7 +1098,7 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
report_to_nearby_chat("Do not have the prim selected while transfer is running to reduce the chances of \"Inventory creation on in-world object failed.\"");
|
||||
report_to_nearby_chat("Use \"zdrop off\" to stop the transfer");
|
||||
LLUUID sdest = LLUUID(destination);
|
||||
zdrop = new JCZdrop(inventorystack, sdest, folder.c_str(), destination.c_str());
|
||||
gZDrop = new JCZdrop(inventorystack, sdest, folder.c_str(), destination.c_str());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -1121,15 +1122,15 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
}
|
||||
else if (setting == "off")
|
||||
{
|
||||
if (!zdrop)
|
||||
if (!gZDrop)
|
||||
{
|
||||
report_to_nearby_chat("Zdrop is already deactivated.");
|
||||
}
|
||||
else
|
||||
{
|
||||
zdrop ->mRunning = TRUE;
|
||||
delete zdrop;
|
||||
zdrop = NULL;
|
||||
gZDrop->mRunning = TRUE;
|
||||
delete gZDrop;
|
||||
gZDrop = nullptr;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -1151,7 +1152,7 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
{
|
||||
if (setting == "on")
|
||||
{
|
||||
if (ztake)
|
||||
if (gZTake)
|
||||
{
|
||||
report_to_nearby_chat("Ztake is already active.");
|
||||
}
|
||||
|
|
@ -1172,7 +1173,7 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
if (folder.notNull())
|
||||
{
|
||||
report_to_nearby_chat(llformat("Found destination folder \"%s\".", folder_name.c_str()));
|
||||
ztake = new JCZtake(folder);
|
||||
gZTake = new JCZtake(folder);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1188,15 +1189,15 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
}
|
||||
else if (setting == "off")
|
||||
{
|
||||
if (!ztake)
|
||||
if (!gZTake)
|
||||
{
|
||||
report_to_nearby_chat("Ztake is already deactivated.");
|
||||
}
|
||||
else
|
||||
{
|
||||
ztake->mRunning = TRUE;
|
||||
delete ztake;
|
||||
ztake = NULL;
|
||||
gZTake->mRunning = TRUE;
|
||||
delete gZTake;
|
||||
gZTake = nullptr;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -1241,7 +1242,7 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
if (folder.notNull())
|
||||
{
|
||||
report_to_nearby_chat(llformat("Found destination folder \"%s\".", folder_name.c_str()));
|
||||
ztake = new JCZtake(folder, true, LLUUID(destination), folder_name, (command == "cpackage") ? DRD_ACQUIRE_TO_AGENT_INVENTORY : DRD_TAKE_INTO_AGENT_INVENTORY);
|
||||
gZTake = new JCZtake(folder, true, LLUUID(destination), folder_name, (command == "cpackage") ? DRD_ACQUIRE_TO_AGENT_INVENTORY : DRD_TAKE_INTO_AGENT_INVENTORY);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1307,7 +1308,7 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
U32 localid = objectp->getLocalID();
|
||||
if (std::find(to_take.begin(), to_take.end(), localid) == to_take.end())
|
||||
{
|
||||
to_take.push_back(localid);
|
||||
to_take.emplace_back(localid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1320,7 +1321,7 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
else
|
||||
{
|
||||
report_to_nearby_chat(llformat("Found destination folder \"%s\".", folder_name.c_str()));
|
||||
ztake = new JCZtake(folder, true, LLUUID(destination), folder_name, DRD_ACQUIRE_TO_AGENT_INVENTORY, false, to_take);
|
||||
gZTake = new JCZtake(folder, true, LLUUID(destination), folder_name, DRD_ACQUIRE_TO_AGENT_INVENTORY, false, to_take);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -1438,7 +1439,7 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
U32 localid = objectp->getLocalID();
|
||||
if (std::find(to_take.begin(), to_take.end(), localid) == to_take.end())
|
||||
{
|
||||
to_take.push_back(localid);
|
||||
to_take.emplace_back(localid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1451,7 +1452,7 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
else
|
||||
{
|
||||
report_to_nearby_chat(llformat("Found destination folder \"%s\".", folder_name.c_str()));
|
||||
ztake = new JCZtake(folder, true, LLUUID::null, folder_name, (command == "kcopy") ? DRD_ACQUIRE_TO_AGENT_INVENTORY : DRD_TAKE_INTO_AGENT_INVENTORY, false, to_take);
|
||||
gZTake = new JCZtake(folder, true, LLUUID::null, folder_name, (command == "kcopy") ? DRD_ACQUIRE_TO_AGENT_INVENTORY : DRD_TAKE_INTO_AGENT_INVENTORY, false, to_take);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -1474,7 +1475,7 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
{
|
||||
if (setting == "on")
|
||||
{
|
||||
if (mtake)
|
||||
if (gMTake)
|
||||
{
|
||||
report_to_nearby_chat("Mtake is already active.");
|
||||
}
|
||||
|
|
@ -1495,7 +1496,7 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
if (folder.notNull())
|
||||
{
|
||||
report_to_nearby_chat(llformat("Found destination folder \"%s\".", folder_name.c_str()));
|
||||
mtake = new TMZtake(folder);
|
||||
gMTake = new TMZtake(folder);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1511,15 +1512,15 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
}
|
||||
else if (setting == "off")
|
||||
{
|
||||
if (!mtake)
|
||||
if (!gMTake)
|
||||
{
|
||||
report_to_nearby_chat("Mtake is already deactivated.");
|
||||
}
|
||||
else
|
||||
{
|
||||
mtake->mRunning = TRUE;
|
||||
delete mtake;
|
||||
mtake = NULL;
|
||||
gMTake->mRunning = TRUE;
|
||||
delete gMTake;
|
||||
gMTake = nullptr;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -1729,29 +1730,25 @@ LLUUID cmdline_partial_name2key(std::string partial_name)
|
|||
LLStringUtil::toLower(partial_name);
|
||||
LLStringUtil::replaceString(partial_name, ".", " ");
|
||||
|
||||
FSRadar* radar = FSRadar::getInstance();
|
||||
if (radar)
|
||||
FSRadar::entry_map_t radar_list = FSRadar::getInstance()->getRadarList();
|
||||
FSRadar::entry_map_t::iterator it_end = radar_list.end();
|
||||
for (const auto& [avid, entry] : radar_list)
|
||||
{
|
||||
FSRadar::entry_map_t radar_list = radar->getRadarList();
|
||||
FSRadar::entry_map_t::iterator it_end = radar_list.end();
|
||||
for (FSRadar::entry_map_t::iterator it = radar_list.begin(); it != it_end; ++it)
|
||||
{
|
||||
FSRadarEntry* entry = it->second;
|
||||
av_name = entry->getUserName();
|
||||
av_name = entry->getUserName();
|
||||
|
||||
LLStringUtil::toLower(av_name);
|
||||
if (strstr(av_name.c_str(), partial_name.c_str()))
|
||||
{
|
||||
return entry->getId();
|
||||
}
|
||||
LLStringUtil::toLower(av_name);
|
||||
if (strstr(av_name.c_str(), partial_name.c_str()))
|
||||
{
|
||||
return entry->getId();
|
||||
}
|
||||
}
|
||||
|
||||
return LLUUID::null;
|
||||
}
|
||||
|
||||
void cmdline_tp2name(const std::string& target)
|
||||
void cmdline_tp2name(std::string_view target)
|
||||
{
|
||||
LLUUID avkey = cmdline_partial_name2key(target);
|
||||
LLUUID avkey = cmdline_partial_name2key(static_cast<std::string>(target));
|
||||
if (avkey.notNull() && avkey != gAgentID)
|
||||
{
|
||||
LLAvatarActions::teleportTo(avkey);
|
||||
|
|
@ -1822,17 +1819,17 @@ void cmdline_rezplat(bool use_saved_value, F32 visual_radius) //cmdline_rezplat(
|
|||
msg->sendReliable(gAgent.getRegionHost());
|
||||
}
|
||||
|
||||
bool cmdline_packager(const std::string& message, const LLUUID& fromID, const LLUUID& ownerID)
|
||||
bool cmdline_packager(std::string_view message, const LLUUID& fromID, const LLUUID& ownerID)
|
||||
{
|
||||
if (message.empty() || cmd_line_mPackagerDest.isNull() || fromID != cmd_line_mPackagerDest)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string cmd = message.substr(0, 12);
|
||||
std::string_view cmd = message.substr(0, 12);
|
||||
|
||||
if (cmd == "kpackageradd") {
|
||||
std::string csv = message.substr(13, -1);
|
||||
std::string_view csv = message.substr(13, -1);
|
||||
std::string::size_type start = 0;
|
||||
std::string::size_type comma = 0;
|
||||
do
|
||||
|
|
@ -1863,13 +1860,13 @@ bool cmdline_packager(const std::string& message, const LLUUID& fromID, const LL
|
|||
}
|
||||
while(comma < csv.length());
|
||||
|
||||
report_to_nearby_chat(llformat("Packager: adding objects: \"%s\"", csv.c_str()));
|
||||
report_to_nearby_chat(llformat("Packager: adding objects: \"%s\"", static_cast<std::string>(csv).c_str()));
|
||||
return true;
|
||||
}
|
||||
else if (cmd == "kpackagerend") {
|
||||
|
||||
report_to_nearby_chat("Packager: finalizing.");
|
||||
ztake = new JCZtake(cmd_line_mPackagerTargetFolder, true, cmd_line_mPackagerDest, cmd_line_mPackagerTargetFolderName, DRD_ACQUIRE_TO_AGENT_INVENTORY, false, cmd_line_mPackagerToTake);
|
||||
gZTake = new JCZtake(cmd_line_mPackagerTargetFolder, true, cmd_line_mPackagerDest, cmd_line_mPackagerTargetFolderName, DRD_ACQUIRE_TO_AGENT_INVENTORY, false, cmd_line_mPackagerToTake);
|
||||
cmd_line_mPackagerToTake.clear();
|
||||
cmd_line_mPackagerTargetFolderName = "";
|
||||
cmd_line_mPackagerTargetFolder.setNull();
|
||||
|
|
|
|||
|
|
@ -36,11 +36,11 @@
|
|||
|
||||
#include "llchat.h"
|
||||
|
||||
bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_gesture = false);
|
||||
bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gesture = false);
|
||||
void cmdline_rezplat(bool use_saved_value = true, F32 visual_radius = 30.f);
|
||||
void cmdline_tp2name(const std::string& target);
|
||||
void cmdline_tp2name(std::string_view target);
|
||||
LLUUID cmdline_partial_name2key(std::string name);
|
||||
|
||||
bool cmdline_packager(const std::string& message, const LLUUID& fromID, const LLUUID& ownerID);
|
||||
bool cmdline_packager(std::string_view message, const LLUUID& fromID, const LLUUID& ownerID);
|
||||
|
||||
#endif // CHATBAR_AS_CMDLINE_H
|
||||
|
|
|
|||
|
|
@ -3,6 +3,17 @@ import subprocess
|
|||
import tarfile
|
||||
|
||||
class FSViewerManifest:
|
||||
def fs_installer_basename(self):
|
||||
substitution_strings = {
|
||||
'version' : '.'.join(self.args['version']),
|
||||
'version_short' : '.'.join(self.args['version'][:-1]),
|
||||
'version_dashes' : '-'.join(self.args['version']),
|
||||
'app_name':self.app_name(),
|
||||
'app_name_oneword':self.app_name_oneword()
|
||||
}
|
||||
|
||||
return "Phoenix-%(app_name)s-%(version_dashes)s" % substitution_strings
|
||||
|
||||
def fs_is_opensim(self):
|
||||
return self.args['viewer_flavor'] == 'oss' #Havok would be hvk
|
||||
|
||||
|
|
@ -99,15 +110,13 @@ class FSViewerManifest:
|
|||
except:
|
||||
print("Cannot run pdbcopy, packaging private symbols")
|
||||
|
||||
# Store windows symbols we want to keep for debugging in a tar file, this will be later compressed with xz (lzma)
|
||||
# Using tat+xz gives far superior compression than zip (~half the size of the zip archive).
|
||||
# Python3 natively supports tar+xz via mode 'w:xz'. But we're stuck with Python2 for now.
|
||||
symbolTar = tarfile.TarFile("%s/Phoenix_%s_%s_%s_pdbsymbols-windows-%d.tar" % (self.args['configuration'].lower(),
|
||||
self.fs_channel_legacy_oneword(),
|
||||
'-'.join(self.args['version']),
|
||||
self.args['viewer_flavor'],
|
||||
self.address_size),
|
||||
'w')
|
||||
tarName = "%s/Phoenix_%s_%s_%s_pdbsymbols-windows-%d.tar.xz" % (self.args['configuration'].lower(),
|
||||
self.fs_channel_legacy_oneword(),
|
||||
'-'.join(self.args['version']),
|
||||
self.args['viewer_flavor'],
|
||||
self.address_size)
|
||||
# Store windows symbols we want to keep for debugging in a tar file.
|
||||
symbolTar = tarfile.open( name=tarName, mode="w:xz")
|
||||
symbolTar.add( "%s/Firestorm-bin.exe" % self.args['configuration'].lower(), "firestorm-bin.exe" )
|
||||
symbolTar.add( "%s/build_data.json" % self.args['configuration'].lower(), "build_data.json" )
|
||||
symbolTar.add( "%s/%s" % (self.args['configuration'].lower(),pdbName), pdbName )
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ extern S32 gMaxAgentGroups;
|
|||
|
||||
S32 FSCommon::sObjectAddMsg = 0;
|
||||
|
||||
void report_to_nearby_chat(const std::string& message)
|
||||
void report_to_nearby_chat(std::string_view message)
|
||||
{
|
||||
LLChat chat;
|
||||
chat.mText = message;
|
||||
|
|
@ -81,16 +81,16 @@ std::string format_string(std::string text, const LLStringUtil::format_map_t& ar
|
|||
return text;
|
||||
}
|
||||
|
||||
bool is_irc_me_prefix(const std::string& text)
|
||||
bool is_irc_me_prefix(std::string_view text)
|
||||
{
|
||||
const std::string prefix = text.substr(0, 4);
|
||||
const std::string_view prefix = text.substr(0, 4);
|
||||
return (prefix == "/me " || prefix == "/me'");
|
||||
}
|
||||
|
||||
std::string unescape_name(const std::string& name)
|
||||
std::string unescape_name(std::string_view name)
|
||||
{
|
||||
// bugfix for SL-46920: preventing filenames that break stuff.
|
||||
char * curl_str = curl_unescape(name.c_str(), name.size());
|
||||
char * curl_str = curl_unescape(name.data(), name.size()); // Calling data() should be ok here because we also pass the length
|
||||
std::string unescaped_name(curl_str);
|
||||
curl_free(curl_str);
|
||||
curl_str = NULL;
|
||||
|
|
|
|||
|
|
@ -37,10 +37,10 @@ class LLViewerParcelMgr;
|
|||
const F64 AVATAR_UNKNOWN_Z_OFFSET = -1.0; // Const value for avatars at unknown height
|
||||
const F32 AVATAR_UNKNOWN_RANGE = -1.f;
|
||||
|
||||
void report_to_nearby_chat(const std::string& message);
|
||||
void report_to_nearby_chat(std::string_view message);
|
||||
std::string format_string(std::string text, const LLStringUtil::format_map_t& args);
|
||||
bool is_irc_me_prefix(const std::string& text);
|
||||
std::string unescape_name(const std::string& name);
|
||||
bool is_irc_me_prefix(std::string_view text);
|
||||
std::string unescape_name(std::string_view name);
|
||||
|
||||
namespace FSCommon
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#ifndef FS_DISPATCHCLASSIFIEDCLICKTHROUGH_H
|
||||
#define FS_DISPATCHCLASSIFIEDCLICKTHROUGH_H
|
||||
|
||||
#include "fspanelclassified.h"
|
||||
#include "llpanelprofileclassifieds.h"
|
||||
#include "lldispatcher.h"
|
||||
|
||||
// "classifiedclickthrough"
|
||||
|
|
@ -51,7 +51,7 @@ public:
|
|||
S32 map_clicks = atoi(strings[2].c_str());
|
||||
S32 profile_clicks = atoi(strings[3].c_str());
|
||||
|
||||
FSPanelClassifiedInfo::setClickThrough(
|
||||
LLPanelProfileClassified::setClickThrough(
|
||||
classified_id, teleport_clicks, map_clicks, profile_clicks, false);
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
#include "llviewerinventory.h"
|
||||
|
||||
static LLDefaultChildRegistry::Register<FSCopyTransInventoryDropTarget> r1("fs_copytrans_inventory_drop_target");
|
||||
static LLDefaultChildRegistry::Register<FSDropTarget> r2("profile_drop_target");
|
||||
static LLDefaultChildRegistry::Register<FSEmbeddedItemDropTarget> r3("fs_embedded_item_drop_target");
|
||||
|
||||
|
||||
|
|
@ -70,29 +69,6 @@ BOOL FSCopyTransInventoryDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
FSDropTarget::FSDropTarget(const FSDropTarget::Params& p)
|
||||
: LLView(p),
|
||||
mAgentID(p.agent_id)
|
||||
{}
|
||||
|
||||
BOOL FSDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
|
||||
EDragAndDropType cargo_type,
|
||||
void* cargo_data,
|
||||
EAcceptance* accept,
|
||||
std::string& tooltip_msg)
|
||||
{
|
||||
if (getParent())
|
||||
{
|
||||
LLToolDragAndDrop::handleGiveDragAndDrop(mAgentID, LLUUID::null, drop,
|
||||
cargo_type, cargo_data, accept);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL FSEmbeddedItemDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
|
||||
EDragAndDropType cargo_type,
|
||||
void* cargo_data,
|
||||
|
|
|
|||
|
|
@ -70,37 +70,6 @@ private:
|
|||
};
|
||||
|
||||
|
||||
class FSDropTarget : public LLView
|
||||
{
|
||||
public:
|
||||
struct Params : public LLInitParam::Block<Params, LLView::Params>
|
||||
{
|
||||
Optional<LLUUID> agent_id;
|
||||
Params()
|
||||
: agent_id("agent_id")
|
||||
{
|
||||
changeDefault(mouse_opaque, false);
|
||||
changeDefault(follows.flags, FOLLOWS_ALL);
|
||||
}
|
||||
};
|
||||
|
||||
FSDropTarget(const Params&);
|
||||
~FSDropTarget() {}
|
||||
|
||||
// LLView functionality
|
||||
virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
|
||||
EDragAndDropType cargo_type,
|
||||
void* cargo_data,
|
||||
EAcceptance* accept,
|
||||
std::string& tooltip_msg);
|
||||
|
||||
void setAgentID(const LLUUID &agent_id) { mAgentID = agent_id; }
|
||||
|
||||
protected:
|
||||
LLUUID mAgentID;
|
||||
};
|
||||
|
||||
|
||||
class FSEmbeddedItemDropTarget : public LLTextBox
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,70 @@
|
|||
/**
|
||||
* @file fsfloaterpartialinventory.cpp
|
||||
* @brief Displays the inventory underneath a particular starting folder
|
||||
*
|
||||
* $LicenseInfo:firstyear=2022&license=viewerlgpl$
|
||||
* Phoenix Firestorm Viewer Source Code
|
||||
* Copyright (c) 2022 Ansariel Hiller @ Second Life
|
||||
*
|
||||
* 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 "fsfloaterpartialinventory.h"
|
||||
#include "llfiltereditor.h"
|
||||
#include "llinventorypanel.h"
|
||||
|
||||
//=========================================================================
|
||||
|
||||
//=========================================================================
|
||||
FSFloaterPartialInventory::FSFloaterPartialInventory(const LLSD& key) : LLFloater(key)
|
||||
{
|
||||
mRootFolderId = key["start_folder_id"].asUUID();
|
||||
}
|
||||
|
||||
FSFloaterPartialInventory::~FSFloaterPartialInventory()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL FSFloaterPartialInventory::postBuild()
|
||||
{
|
||||
LLInventoryPanel::Params params;
|
||||
params.start_folder.id(mRootFolderId);
|
||||
params.follows.flags(FOLLOWS_ALL);
|
||||
params.layout("topleft");
|
||||
params.name("inv_panel");
|
||||
mInventoryList = LLUICtrlFactory::create<LLInventoryPanel>(params);
|
||||
|
||||
auto wrapper_panel = getChild<LLPanel>("pnl_inv_wrap");
|
||||
wrapper_panel->addChild(mInventoryList);
|
||||
mInventoryList->reshape(wrapper_panel->getRect().getWidth(), wrapper_panel->getRect().getHeight());
|
||||
mInventoryList->setOrigin(0, 0);
|
||||
|
||||
mFilterEdit = getChild<LLFilterEditor>("flt_search");
|
||||
mFilterEdit->setCommitCallback([this](LLUICtrl*, const LLSD& param){ mInventoryList->setFilterSubString(param.asString()); });
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void FSFloaterPartialInventory::onOpen(const LLSD& key)
|
||||
{
|
||||
LLStringUtil::format_map_t args;
|
||||
args["FOLDERNAME"] = key["start_folder_name"].asString();
|
||||
setTitle(getString("title", args));
|
||||
}
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
/**
|
||||
* @file llfloaterwebprofile.h
|
||||
* @brief Avatar profile floater.
|
||||
* @file fsfloaterpartialinventory.h
|
||||
* @brief Displays the inventory underneath a particular starting folder
|
||||
*
|
||||
* $LicenseInfo:firstyear=2022&license=viewerlgpl$
|
||||
* Phoenix Firestorm Viewer Source Code
|
||||
* Copyright (c) 2022 Ansariel Hiller @ Second Life
|
||||
*
|
||||
* $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;
|
||||
|
|
@ -24,36 +24,27 @@
|
|||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLFLOATERWEBPROFILE_H
|
||||
#define LL_LLFLOATERWEBPROFILE_H
|
||||
#ifndef FS_FLOATERPARTIALINVENTORY_H
|
||||
#define FS_FLOATERPARTIALINVENTORY_H
|
||||
|
||||
#include "llfloaterwebcontent.h"
|
||||
#include "llviewermediaobserver.h"
|
||||
#include "llfloater.h"
|
||||
|
||||
#include <string>
|
||||
class LLFilterEditor;
|
||||
class LLInventoryPanel;
|
||||
|
||||
class LLMediaCtrl;
|
||||
|
||||
/**
|
||||
* Displays avatar profile web page.
|
||||
*/
|
||||
class LLFloaterWebProfile
|
||||
: public LLFloaterWebContent
|
||||
class FSFloaterPartialInventory : public LLFloater
|
||||
{
|
||||
LOG_CLASS(LLFloaterWebProfile);
|
||||
public:
|
||||
typedef LLFloaterWebContent::Params Params;
|
||||
FSFloaterPartialInventory(const LLSD& key);
|
||||
virtual ~FSFloaterPartialInventory();
|
||||
|
||||
LLFloaterWebProfile(const Params& key);
|
||||
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
/*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false);
|
||||
|
||||
static LLFloater* create(const LLSD& key);
|
||||
BOOL postBuild() override;
|
||||
void onOpen(const LLSD& key) override;
|
||||
|
||||
private:
|
||||
void applyPreferredRect();
|
||||
LLUUID mRootFolderId;
|
||||
LLInventoryPanel* mInventoryList{ nullptr };
|
||||
LLFilterEditor* mFilterEdit{ nullptr };
|
||||
};
|
||||
|
||||
#endif // LL_LLFLOATERWEBPROFILE_H
|
||||
|
||||
#endif
|
||||
|
|
@ -46,7 +46,6 @@
|
|||
#include "lllandmarkactions.h"
|
||||
#include "lllandmarklist.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llpanelpick.h"
|
||||
#include "llpanelplaceprofile.h"
|
||||
#include "llpanellandmarkinfo.h"
|
||||
#include "llparcel.h"
|
||||
|
|
@ -191,8 +190,7 @@ FSFloaterPlaceDetails::FSFloaterPlaceDetails(const LLSD& seed)
|
|||
mIsInEditMode(false),
|
||||
mIsInCreateMode(false),
|
||||
mGlobalPos(),
|
||||
mDisplayInfo(NONE),
|
||||
mPickPanel(NULL)
|
||||
mDisplayInfo(NONE)
|
||||
{
|
||||
mParcelObserver = new FSPlaceDetailsPlacesParcelObserver(this);
|
||||
mRemoteParcelObserver = new FSPlaceDetailsRemoteParcelInfoObserver(this);
|
||||
|
|
@ -566,14 +564,6 @@ void FSFloaterPlaceDetails::setItem(LLInventoryItem* item)
|
|||
}
|
||||
}
|
||||
|
||||
void FSFloaterPlaceDetails::togglePickPanel(BOOL visible)
|
||||
{
|
||||
if (mPickPanel)
|
||||
{
|
||||
mPickPanel->setVisible(visible);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void FSFloaterPlaceDetails::showPlaceDetails(const LLSD& key)
|
||||
{
|
||||
|
|
@ -785,19 +775,6 @@ void FSFloaterPlaceDetails::onOverflowMenuItemClicked(const LLSD& param)
|
|||
}
|
||||
else if (item == "pick")
|
||||
{
|
||||
if (mPickPanel == NULL)
|
||||
{
|
||||
mPickPanel = LLPanelPickEdit::create();
|
||||
addChild(mPickPanel);
|
||||
|
||||
mPickPanel->setExitCallback(boost::bind(&FSFloaterPlaceDetails::togglePickPanel, this, FALSE));
|
||||
mPickPanel->setCancelCallback(boost::bind(&FSFloaterPlaceDetails::togglePickPanel, this, FALSE));
|
||||
mPickPanel->setSaveCallback(boost::bind(&FSFloaterPlaceDetails::togglePickPanel, this, FALSE));
|
||||
}
|
||||
|
||||
togglePickPanel(TRUE);
|
||||
mPickPanel->onOpen(LLSD());
|
||||
|
||||
LLPanelPlaceInfo* panel = mPanelPlaceInfo;
|
||||
if (mDisplayInfo == LANDMARK)
|
||||
{
|
||||
|
|
@ -806,11 +783,7 @@ void FSFloaterPlaceDetails::onOverflowMenuItemClicked(const LLSD& param)
|
|||
|
||||
if (panel)
|
||||
{
|
||||
panel->createPick(mGlobalPos, mPickPanel);
|
||||
|
||||
LLRect rect = panel->getRect();
|
||||
mPickPanel->reshape(rect.getWidth(), rect.getHeight());
|
||||
mPickPanel->setRect(rect);
|
||||
panel->createPick(mGlobalPos);
|
||||
}
|
||||
}
|
||||
else if (item == "add_to_favbar")
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@
|
|||
class LLLandmark;
|
||||
class LLMenuButton;
|
||||
class LLPanelLandmarkInfo;
|
||||
class LLPanelPickEdit;
|
||||
class LLPanelPlaceProfile;
|
||||
struct LLParcelData;
|
||||
class LLToggleableMenu;
|
||||
|
|
@ -61,7 +60,6 @@ public:
|
|||
void changedGlobalPos(const LLVector3d& global_pos);
|
||||
void changedParcelSelection();
|
||||
void processParcelDetails(const LLParcelData& parcel_details);
|
||||
void togglePickPanel(BOOL visible);
|
||||
|
||||
static void showPlaceDetails(const LLSD& key);
|
||||
|
||||
|
|
@ -95,7 +93,6 @@ private:
|
|||
void setItem(LLInventoryItem* item);
|
||||
void onSLURLBuilt(std::string& slurl);
|
||||
|
||||
LLPanelPickEdit* mPickPanel;
|
||||
LLPanelLandmarkInfo* mPanelLandmarkInfo;
|
||||
LLPanelPlaceProfile* mPanelPlaceInfo;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,97 +0,0 @@
|
|||
/**
|
||||
* @file fsfloaterprofile.cpp
|
||||
* @brief Legacy Profile Floater
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=fsviewerlgpl$
|
||||
* Phoenix Firestorm Viewer Source Code
|
||||
* Copyright (C) 2012, Kadah Coba
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA
|
||||
* http://www.firestormviewer.org
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "fsfloaterprofile.h"
|
||||
|
||||
#include "fspanelprofile.h"
|
||||
#include "llagent.h" //gAgent
|
||||
|
||||
static const std::string PANEL_PROFILE_VIEW = "panel_profile_view";
|
||||
|
||||
FSFloaterProfile::FSFloaterProfile(const LLSD& key)
|
||||
: LLFloater(key),
|
||||
mAvatarId(key["id"].asUUID()),
|
||||
mNameCallbackConnection()
|
||||
{
|
||||
}
|
||||
|
||||
FSFloaterProfile::~FSFloaterProfile()
|
||||
{
|
||||
if (mNameCallbackConnection.connected())
|
||||
{
|
||||
mNameCallbackConnection.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
void FSFloaterProfile::onOpen(const LLSD& key)
|
||||
{
|
||||
FSPanelProfile* panel_profile = findChild<FSPanelProfile>(PANEL_PROFILE_VIEW);
|
||||
panel_profile->onOpen(mAvatarId);
|
||||
|
||||
if (mAvatarId == gAgentID)
|
||||
{
|
||||
getChild<LLUICtrl>("ok_btn")->setVisible(TRUE);
|
||||
getChild<LLUICtrl>("cancel_btn")->setVisible(TRUE);
|
||||
}
|
||||
|
||||
// Update the avatar name.
|
||||
mNameCallbackConnection = LLAvatarNameCache::get(mAvatarId, boost::bind(&FSFloaterProfile::onAvatarNameCache, this, _1, _2));
|
||||
}
|
||||
|
||||
BOOL FSFloaterProfile::postBuild()
|
||||
{
|
||||
childSetAction("ok_btn", boost::bind(&FSFloaterProfile::onOKBtn, this));
|
||||
childSetAction("cancel_btn", boost::bind(&FSFloaterProfile::onCancelBtn, this));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void FSFloaterProfile::onOKBtn()
|
||||
{
|
||||
if (mAvatarId == gAgentID)
|
||||
{
|
||||
FSPanelProfile* panel_profile = findChild<FSPanelProfile>(PANEL_PROFILE_VIEW);
|
||||
panel_profile->apply();
|
||||
}
|
||||
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void FSFloaterProfile::onCancelBtn()
|
||||
{
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void FSFloaterProfile::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name)
|
||||
{
|
||||
mNameCallbackConnection.disconnect();
|
||||
setTitle(av_name.getCompleteName());
|
||||
}
|
||||
|
||||
// eof
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
/**
|
||||
* @file fsfloaterprofile.h
|
||||
* @brief Legacy Profile Floater
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=fsviewerlgpl$
|
||||
* Phoenix Firestorm Viewer Source Code
|
||||
* Copyright (C) 2012, Kadah Coba
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA
|
||||
* http://www.firestormviewer.org
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef FS_FLOATERPROFILE_H
|
||||
#define FS_FLOATERPROFILE_H
|
||||
|
||||
#include "llavatarnamecache.h"
|
||||
#include "llfloater.h"
|
||||
|
||||
class FSFloaterProfile : public LLFloater
|
||||
{
|
||||
LOG_CLASS(FSFloaterProfile);
|
||||
public:
|
||||
FSFloaterProfile(const LLSD& key);
|
||||
virtual ~FSFloaterProfile();
|
||||
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
protected:
|
||||
void onOKBtn();
|
||||
void onCancelBtn();
|
||||
|
||||
private:
|
||||
LLAvatarNameCache::callback_connection_t mNameCallbackConnection;
|
||||
void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name);
|
||||
|
||||
LLUUID mAvatarId;
|
||||
};
|
||||
|
||||
#endif // FS_FLOATERPROFILE_H
|
||||
|
|
@ -31,8 +31,6 @@
|
|||
|
||||
#include "fsavatarsearchmenu.h"
|
||||
#include "fsdispatchclassifiedclickthrough.h"
|
||||
#include "fspanelclassified.h"
|
||||
#include "fspanelprofile.h"
|
||||
#include "fsscrolllistctrl.h"
|
||||
#include "lfsimfeaturehandler.h"
|
||||
#include "llagent.h"
|
||||
|
|
@ -53,7 +51,8 @@
|
|||
#include "llloadingindicator.h"
|
||||
#include "lllogininstance.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llpanelclassified.h"
|
||||
#include "llpanelprofile.h"
|
||||
#include "llpanelprofileclassifieds.h"
|
||||
#include "llparcel.h"
|
||||
#include "llproductinforequest.h"
|
||||
#include "llqueryflags.h"
|
||||
|
|
@ -183,7 +182,7 @@ public:
|
|||
LL_INFOS("Search") << "Classified stat request via capability" << LL_ENDL;
|
||||
LLSD body;
|
||||
body["classified_id"] = c_info->classified_id;
|
||||
LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost(url, body, boost::bind(&LLPanelClassifiedInfo::handleSearchStatResponse, c_info->classified_id, _1));
|
||||
LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost(url, body, boost::bind(&LLPanelProfileClassified::handleSearchStatResponse, c_info->classified_id, _1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -309,15 +308,6 @@ BOOL FSFloaterSearch::postBuild()
|
|||
mPanelClassifieds = findChild<FSPanelSearchClassifieds>("panel_ls_classifieds");
|
||||
mPanelWeb = findChild<FSPanelSearchWeb>("panel_ls_web");
|
||||
|
||||
// <KC> If skin has legacy full profile view, use it
|
||||
mPanelProfile = mPanelPeople->findChild<FSPanelProfile>("panel_profile_view");
|
||||
if (mPanelProfile)
|
||||
{
|
||||
mPanelProfile->setVisible(false);
|
||||
mPanelProfile->setEmbedded(true);
|
||||
mPanelPeople->childSetAction("people_profile_btn", boost::bind(&FSFloaterSearch::onBtnPeopleProfile, this));
|
||||
}
|
||||
|
||||
mDetailsPanel = getChild<LLPanel>("panel_ls_details");
|
||||
mDetailTitle = getChild<LLTextEditor>("title");
|
||||
mDetailDesc = getChild<LLTextEditor>("desc");
|
||||
|
|
@ -354,12 +344,7 @@ void FSFloaterSearch::onTabChange()
|
|||
mDetailsPanel->setVisible(false);
|
||||
mPanelWeb->resetFocusOnLoad();
|
||||
}
|
||||
// <KC> If on legacy people search and skin uses full profile preview, hide preview panel
|
||||
else if (active_panel == mPanelPeople && mPanelProfile)
|
||||
{
|
||||
mDetailsPanel->setVisible(false);
|
||||
}
|
||||
else
|
||||
else if (active_panel == mPanelPeople)
|
||||
{
|
||||
mDetailsPanel->setVisible(mHasSelection);
|
||||
}
|
||||
|
|
@ -402,19 +387,8 @@ void FSFloaterSearch::onSelectedItem(const LLUUID& selected_item, ESearchCategor
|
|||
switch (type)
|
||||
{
|
||||
case SC_AVATAR:
|
||||
{
|
||||
// <KC> If skin has legacy full profile view, use it
|
||||
if (mPanelProfile)
|
||||
{
|
||||
mPanelProfile->setVisible(true);
|
||||
mPanelProfile->onOpen(selected_item);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLAvatarPropertiesProcessor::getInstance()->addObserver(selected_item, mAvatarPropertiesObserver);
|
||||
LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(selected_item);
|
||||
}
|
||||
}
|
||||
LLAvatarPropertiesProcessor::getInstance()->addObserver(selected_item, mAvatarPropertiesObserver);
|
||||
LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(selected_item);
|
||||
break;
|
||||
case SC_GROUP:
|
||||
mGroupPropertiesRequest = new FSSearchGroupInfoObserver(selected_item, this);
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class LLGroupMgrObserver;
|
|||
class LLSearchEditor;
|
||||
class LLSearchComboBox;
|
||||
class FSFloaterSearch;
|
||||
class FSPanelProfile;
|
||||
class LLPanelProfile;
|
||||
class FSScrollListCtrl;
|
||||
|
||||
struct SearchQuery : public LLInitParam::Block<SearchQuery>
|
||||
|
|
@ -412,7 +412,6 @@ private:
|
|||
LLTextureCtrl* mDetailSnapshotParcel;
|
||||
LLIconCtrl* mDetailMaturity;
|
||||
LLTabContainer* mTabContainer;
|
||||
FSPanelProfile* mPanelProfile;
|
||||
};
|
||||
|
||||
#endif // FS_FLOATERSEARCH_H
|
||||
|
|
|
|||
|
|
@ -440,7 +440,7 @@ void FSPanelBlockList::showProfile()
|
|||
void FSPanelBlockList::callbackBlockPicked(const uuid_vec_t& ids, const std::vector<LLAvatarName> names)
|
||||
{
|
||||
if (names.empty() || ids.empty()) return;
|
||||
LLMute mute(ids[0], names[0].getLegacyName(), LLMute::AGENT);
|
||||
LLMute mute(ids[0], names[0].getUserName(), LLMute::AGENT);
|
||||
LLMuteList::getInstance()->add(mute);
|
||||
showPanelAndSelect(mute.mID);
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,300 +0,0 @@
|
|||
/**
|
||||
* @file fspanelclassified.h
|
||||
* @brief FSPanelClassified class definition
|
||||
*
|
||||
* $LicenseInfo:firstyear=2005&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$
|
||||
*/
|
||||
|
||||
// Display of a classified used both for the global view in the
|
||||
// Find directory, and also for each individual user's classified in their
|
||||
// profile.
|
||||
|
||||
#ifndef FS_PANELCLASSIFIED_H
|
||||
#define FS_PANELCLASSIFIED_H
|
||||
|
||||
#include "llavatarpropertiesprocessor.h"
|
||||
#include "llclassifiedinfo.h"
|
||||
#include "llfloater.h"
|
||||
#include "llpanel.h"
|
||||
#include "llrect.h"
|
||||
#include "lluuid.h"
|
||||
#include "v3dmath.h"
|
||||
|
||||
class LLScrollContainer;
|
||||
class LLTextureCtrl;
|
||||
class LLUICtrl;
|
||||
|
||||
class FSPublishClassifiedFloater : public LLFloater
|
||||
{
|
||||
public:
|
||||
FSPublishClassifiedFloater(const LLSD& key);
|
||||
virtual ~FSPublishClassifiedFloater();
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
void setPrice(S32 price);
|
||||
S32 getPrice();
|
||||
|
||||
void setPublishClickedCallback(const commit_signal_t::slot_type& cb);
|
||||
void setCancelClickedCallback(const commit_signal_t::slot_type& cb);
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
class FSPanelClassifiedInfo : public LLPanel, public LLAvatarPropertiesObserver
|
||||
{
|
||||
LOG_CLASS(FSPanelClassifiedInfo);
|
||||
public:
|
||||
|
||||
static FSPanelClassifiedInfo* create();
|
||||
|
||||
virtual ~FSPanelClassifiedInfo();
|
||||
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
void updateData();
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
|
||||
|
||||
void setAvatarId(const LLUUID& avatar_id) { mAvatarId = avatar_id; }
|
||||
|
||||
LLUUID& getAvatarId() { return mAvatarId; }
|
||||
|
||||
void setSnapshotId(const LLUUID& id);
|
||||
|
||||
LLUUID getSnapshotId();
|
||||
|
||||
void setClassifiedId(const LLUUID& id) { mClassifiedId = id; }
|
||||
|
||||
LLUUID& getClassifiedId() { return mClassifiedId; }
|
||||
|
||||
void setClassifiedName(const std::string& name);
|
||||
|
||||
std::string getClassifiedName();
|
||||
|
||||
void setDescription(const std::string& desc);
|
||||
|
||||
std::string getDescription();
|
||||
|
||||
void setClassifiedLocation(const std::string& location);
|
||||
|
||||
std::string getClassifiedLocation();
|
||||
|
||||
void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; }
|
||||
|
||||
LLVector3d& getPosGlobal() { return mPosGlobal; }
|
||||
|
||||
void setParcelId(const LLUUID& id) { mParcelId = id; }
|
||||
|
||||
LLUUID getParcelId() { return mParcelId; }
|
||||
|
||||
void setSimName(const std::string& sim_name) { mSimName = sim_name; }
|
||||
|
||||
std::string getSimName() { return mSimName; }
|
||||
|
||||
void setFromSearch(bool val) { mFromSearch = val; }
|
||||
|
||||
bool fromSearch() { return mFromSearch; }
|
||||
|
||||
bool getInfoLoaded() { return mInfoLoaded; }
|
||||
|
||||
void setInfoLoaded(bool loaded) { mInfoLoaded = loaded; }
|
||||
|
||||
static void setClickThrough(
|
||||
const LLUUID& classified_id,
|
||||
S32 teleport,
|
||||
S32 map,
|
||||
S32 profile,
|
||||
bool from_new_table);
|
||||
|
||||
static void sendClickMessage(
|
||||
const std::string& type,
|
||||
bool from_search,
|
||||
const LLUUID& classified_id,
|
||||
const LLUUID& parcel_id,
|
||||
const LLVector3d& global_pos,
|
||||
const std::string& sim_name);
|
||||
|
||||
void setExitCallback(const commit_callback_t& cb);
|
||||
|
||||
void setEditClassifiedCallback(const commit_callback_t& cb);
|
||||
|
||||
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
|
||||
|
||||
/*virtual*/ void draw();
|
||||
|
||||
protected:
|
||||
|
||||
FSPanelClassifiedInfo();
|
||||
|
||||
virtual void resetData();
|
||||
|
||||
virtual void resetControls();
|
||||
|
||||
static std::string createLocationText(
|
||||
const std::string& original_name,
|
||||
const std::string& sim_name,
|
||||
const LLVector3d& pos_global);
|
||||
|
||||
void stretchSnapshot();
|
||||
void sendClickMessage(const std::string& type);
|
||||
|
||||
LLRect getDefaultSnapshotRect();
|
||||
|
||||
void scrollToTop();
|
||||
|
||||
void onMapClick();
|
||||
void onTeleportClick();
|
||||
void onExit();
|
||||
|
||||
bool mSnapshotStreched;
|
||||
LLRect mSnapshotRect;
|
||||
LLTextureCtrl* mSnapshotCtrl;
|
||||
|
||||
private:
|
||||
|
||||
LLUUID mAvatarId;
|
||||
LLUUID mClassifiedId;
|
||||
LLVector3d mPosGlobal;
|
||||
LLUUID mParcelId;
|
||||
std::string mSimName;
|
||||
bool mFromSearch;
|
||||
bool mInfoLoaded;
|
||||
|
||||
LLScrollContainer* mScrollContainer;
|
||||
LLPanel* mScrollingPanel;
|
||||
|
||||
S32 mScrollingPanelMinHeight;
|
||||
S32 mScrollingPanelWidth;
|
||||
|
||||
// Needed for stat tracking
|
||||
S32 mTeleportClicksOld;
|
||||
S32 mMapClicksOld;
|
||||
S32 mProfileClicksOld;
|
||||
S32 mTeleportClicksNew;
|
||||
S32 mMapClicksNew;
|
||||
S32 mProfileClicksNew;
|
||||
|
||||
typedef std::list<FSPanelClassifiedInfo*> panel_list_t;
|
||||
static panel_list_t sAllPanels;
|
||||
};
|
||||
|
||||
class FSPanelClassifiedEdit : public FSPanelClassifiedInfo
|
||||
{
|
||||
LOG_CLASS(FSPanelClassifiedEdit);
|
||||
public:
|
||||
|
||||
static FSPanelClassifiedEdit* create();
|
||||
|
||||
virtual ~FSPanelClassifiedEdit();
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
void fillIn(const LLSD& key);
|
||||
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
|
||||
|
||||
/*virtual*/ BOOL isDirty() const;
|
||||
|
||||
/*virtual*/ void resetDirty();
|
||||
|
||||
void setSaveCallback(const commit_signal_t::slot_type& cb);
|
||||
|
||||
void setCancelCallback(const commit_signal_t::slot_type& cb);
|
||||
|
||||
/*virtual*/ void resetControls();
|
||||
|
||||
bool isNew() { return mIsNew; }
|
||||
|
||||
bool isNewWithErrors() { return mIsNewWithErrors; }
|
||||
|
||||
bool canClose();
|
||||
|
||||
void draw();
|
||||
|
||||
void stretchSnapshot();
|
||||
|
||||
U32 getCategory();
|
||||
|
||||
void setCategory(U32 category);
|
||||
|
||||
U32 getContentType();
|
||||
|
||||
void setContentType(U32 content_type);
|
||||
|
||||
bool getAutoRenew();
|
||||
|
||||
S32 getPriceForListing();
|
||||
|
||||
protected:
|
||||
|
||||
FSPanelClassifiedEdit();
|
||||
|
||||
void sendUpdate();
|
||||
|
||||
void enableVerbs(bool enable);
|
||||
|
||||
void enableEditing(bool enable);
|
||||
|
||||
void showEditing(bool show);
|
||||
|
||||
std::string makeClassifiedName();
|
||||
|
||||
void setPriceForListing(S32 price);
|
||||
|
||||
U8 getFlags();
|
||||
|
||||
std::string getLocationNotice();
|
||||
|
||||
bool isValidName();
|
||||
|
||||
void notifyInvalidName();
|
||||
|
||||
void onSetLocationClick();
|
||||
void onChange();
|
||||
void onSaveClick();
|
||||
|
||||
void doSave();
|
||||
|
||||
void onPublishFloaterPublishClicked();
|
||||
|
||||
void onTexturePickerMouseEnter(LLUICtrl* ctrl);
|
||||
void onTexturePickerMouseLeave(LLUICtrl* ctrl);
|
||||
|
||||
void onTextureSelected();
|
||||
|
||||
private:
|
||||
S32 getClassifiedFee(); // <FS:CR> FIRE-9814 - Don't hardcode a classified listing fee
|
||||
bool mIsNew;
|
||||
bool mIsNewWithErrors;
|
||||
bool mCanClose;
|
||||
|
||||
FSPublishClassifiedFloater* mPublishFloater;
|
||||
|
||||
commit_signal_t mSaveButtonClickedSignal;
|
||||
};
|
||||
|
||||
#endif // FS_PANELCLASSIFIED_H
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,665 +0,0 @@
|
|||
/**
|
||||
* @file fspanelprofile.h
|
||||
* @brief Legacy Profile Floater
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=fsviewerlgpl$
|
||||
* Phoenix Firestorm Viewer Source Code
|
||||
* Copyright (C) 2012, Kadah Coba
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA
|
||||
* http://www.firestormviewer.org
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef FS_PANELPROFILE_H
|
||||
#define FS_PANELPROFILE_H
|
||||
|
||||
#include "llfloater.h"
|
||||
#include "llavatarpropertiesprocessor.h"
|
||||
#include "llcallingcard.h"
|
||||
#include "llvoiceclient.h"
|
||||
#include "llmediactrl.h"
|
||||
#include "llremoteparcelrequest.h"
|
||||
#include "rlvhandler.h"
|
||||
|
||||
class LLAvatarName;
|
||||
class LLCheckBoxCtrl;
|
||||
class LLTabContainer;
|
||||
class LLTextBox;
|
||||
class LLTextureCtrl;
|
||||
class LLMediaCtrl;
|
||||
class LLGroupList;
|
||||
class LLTextBase;
|
||||
class LLMenuButton;
|
||||
class LLLineEditor;
|
||||
class LLTextEditor;
|
||||
class FSPanelClassifieds;
|
||||
|
||||
/**
|
||||
* Base class for any Profile View or My Profile Panel.
|
||||
*/
|
||||
class FSPanelProfileTab
|
||||
: public LLPanel
|
||||
, public LLAvatarPropertiesObserver
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Sets avatar ID, sets panel as observer of avatar related info replies from server.
|
||||
*/
|
||||
virtual void setAvatarId(const LLUUID& id);
|
||||
|
||||
/**
|
||||
* Sends update data request to server.
|
||||
*/
|
||||
virtual void updateData() { }
|
||||
|
||||
/**
|
||||
* Processes data received from server.
|
||||
*/
|
||||
virtual void processProperties(void* data, EAvatarProcessorType type) = 0;
|
||||
|
||||
/**
|
||||
* Returns avatar ID.
|
||||
*/
|
||||
const LLUUID& getAvatarId() { return mAvatarId; }
|
||||
|
||||
/**
|
||||
* Clears panel data if viewing avatar info for first time and sends update data request.
|
||||
*/
|
||||
virtual void onOpen(const LLSD& key);
|
||||
|
||||
/*virtual*/ ~FSPanelProfileTab();
|
||||
|
||||
void setEmbedded(bool embedded) { mEmbedded = embedded; }
|
||||
|
||||
protected:
|
||||
|
||||
FSPanelProfileTab();
|
||||
|
||||
virtual void enableControls();
|
||||
|
||||
// mLoading: false: Initial state, can request
|
||||
// true: Data requested, skip duplicate requests (happens due to LLUI's habit of repeated callbacks)
|
||||
// mLoaded: false: Initial state, show loading indicator
|
||||
// true: Data recieved, which comes in a single message, hide indicator
|
||||
bool getIsLoading() { return mLoading; }
|
||||
void setIsLoading() { mLoading = true; }
|
||||
bool getIsLoaded() { return mLoaded; }
|
||||
void resetLoading() { mLoading = false; mLoaded = false; }
|
||||
|
||||
const bool getEmbedded() const { return mEmbedded; }
|
||||
|
||||
const bool getSelfProfile() const { return mSelfProfile; }
|
||||
|
||||
void setApplyProgress(bool started);
|
||||
|
||||
private:
|
||||
|
||||
LLUUID mAvatarId;
|
||||
bool mLoading;
|
||||
bool mLoaded;
|
||||
bool mEmbedded;
|
||||
bool mSelfProfile;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Panel for displaying Avatar's second life related info.
|
||||
*/
|
||||
class FSPanelProfileSecondLife
|
||||
: public FSPanelProfileTab
|
||||
, public LLFriendObserver
|
||||
, public LLVoiceClientStatusObserver
|
||||
{
|
||||
public:
|
||||
FSPanelProfileSecondLife();
|
||||
/*virtual*/ ~FSPanelProfileSecondLife();
|
||||
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
/**
|
||||
* Saves changes.
|
||||
*/
|
||||
void apply(LLAvatarData* data);
|
||||
|
||||
/**
|
||||
* LLFriendObserver trigger
|
||||
*/
|
||||
virtual void changed(U32 mask);
|
||||
|
||||
// Implements LLVoiceClientStatusObserver::onChange() to enable the call
|
||||
// button when voice is available
|
||||
/*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
|
||||
|
||||
/*virtual*/ void setAvatarId(const LLUUID& id);
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
|
||||
|
||||
void resetData();
|
||||
|
||||
/**
|
||||
* Sends update data request to server.
|
||||
*/
|
||||
/*virtual*/ void updateData();
|
||||
|
||||
void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Process profile related data received from server.
|
||||
*/
|
||||
virtual void processProfileProperties(const LLAvatarData* avatar_data);
|
||||
|
||||
/**
|
||||
* Processes group related data received from server.
|
||||
*/
|
||||
virtual void processGroupProperties(const LLAvatarGroups* avatar_groups);
|
||||
|
||||
/**
|
||||
* Fills common for Avatar profile and My Profile fields.
|
||||
*/
|
||||
virtual void fillCommonData(const LLAvatarData* avatar_data);
|
||||
|
||||
/**
|
||||
* Fills partner data.
|
||||
*/
|
||||
virtual void fillPartnerData(const LLAvatarData* avatar_data);
|
||||
|
||||
/**
|
||||
* Fills account status.
|
||||
*/
|
||||
virtual void fillAccountStatus(const LLAvatarData* avatar_data);
|
||||
|
||||
void onMapButtonClick();
|
||||
|
||||
/**
|
||||
* Opens "Pay Resident" dialog.
|
||||
*/
|
||||
void pay();
|
||||
|
||||
/**
|
||||
* Add/remove resident to/from your block list.
|
||||
*/
|
||||
void toggleBlock();
|
||||
|
||||
void updateButtons();
|
||||
|
||||
void onAddFriendButtonClick();
|
||||
void onIMButtonClick();
|
||||
void onTeleportButtonClick();
|
||||
|
||||
void onCopyToClipboard();
|
||||
void onCopyURI();
|
||||
void onGroupInvite();
|
||||
|
||||
bool isGrantedToSeeOnlineStatus();
|
||||
|
||||
/**
|
||||
* Displays avatar's online status if possible.
|
||||
*
|
||||
* Requirements from EXT-3880:
|
||||
* For friends:
|
||||
* - Online when online and privacy settings allow to show
|
||||
* - Offline when offline and privacy settings allow to show
|
||||
* - Else: nothing
|
||||
* For other avatars:
|
||||
* - Online when online and was not set in Preferences/"Only Friends & Groups can see when I am online"
|
||||
* - Else: Offline
|
||||
*/
|
||||
void updateOnlineStatus();
|
||||
void processOnlineStatus(bool online);
|
||||
|
||||
virtual void enableControls();
|
||||
|
||||
private:
|
||||
void onClickSetName();
|
||||
void onAvatarNameCacheSetName(const LLUUID& id, const LLAvatarName& av_name);
|
||||
|
||||
private:
|
||||
typedef std::map<std::string, LLUUID> group_map_t;
|
||||
group_map_t mGroups;
|
||||
void openGroupProfile();
|
||||
|
||||
LLTextBox* mStatusText;
|
||||
LLGroupList* mGroupList;
|
||||
LLCheckBoxCtrl* mShowInSearchCheckbox;
|
||||
LLTextureCtrl* mSecondLifePic;
|
||||
LLTextBase* mDescriptionEdit;
|
||||
LLButton* mTeleportButton;
|
||||
LLButton* mShowOnMapButton;
|
||||
LLButton* mBlockButton;
|
||||
LLButton* mUnblockButton;
|
||||
LLButton* mDisplayNameButton;
|
||||
LLButton* mAddFriendButton;
|
||||
LLButton* mGroupInviteButton;
|
||||
LLButton* mPayButton;
|
||||
LLButton* mIMButton;
|
||||
LLMenuButton* mOverflowButton;
|
||||
|
||||
bool mVoiceStatus;
|
||||
|
||||
boost::signals2::connection mRlvBehaviorCallbackConnection;
|
||||
void updateRlvRestrictions(ERlvBehaviour behavior);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Panel for displaying Avatar's web profile and home page.
|
||||
*/
|
||||
class FSPanelProfileWeb
|
||||
: public FSPanelProfileTab
|
||||
, public LLViewerMediaObserver
|
||||
{
|
||||
public:
|
||||
FSPanelProfileWeb();
|
||||
/*virtual*/ ~FSPanelProfileWeb();
|
||||
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
|
||||
|
||||
void resetData();
|
||||
|
||||
/**
|
||||
* Saves changes.
|
||||
*/
|
||||
void apply(LLAvatarData* data);
|
||||
|
||||
/**
|
||||
* Loads web profile.
|
||||
*/
|
||||
/*virtual*/ void updateData();
|
||||
|
||||
/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
|
||||
|
||||
void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name);
|
||||
|
||||
virtual void enableControls();
|
||||
|
||||
protected:
|
||||
void onCommitLoad(LLUICtrl* ctrl);
|
||||
void onCommitWebProfile(LLUICtrl* ctrl);
|
||||
|
||||
private:
|
||||
std::string mURLHome;
|
||||
std::string mURLWebProfile;
|
||||
LLMediaCtrl* mWebBrowser;
|
||||
LLUICtrl* mWebProfileButton;
|
||||
LLUICtrl* mLoadButton;
|
||||
LLLineEditor* mUrlEdit;
|
||||
|
||||
LLFrameTimer mPerformanceTimer;
|
||||
bool mFirstNavigate;
|
||||
};
|
||||
|
||||
/**
|
||||
* Panel for displaying Avatar's interests.
|
||||
*/
|
||||
class FSPanelProfileInterests
|
||||
: public FSPanelProfileTab
|
||||
{
|
||||
public:
|
||||
FSPanelProfileInterests();
|
||||
/*virtual*/ ~FSPanelProfileInterests();
|
||||
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
|
||||
|
||||
void resetData();
|
||||
|
||||
/**
|
||||
* Saves changes.
|
||||
*/
|
||||
virtual void apply();
|
||||
|
||||
protected:
|
||||
virtual void enableControls();
|
||||
|
||||
private:
|
||||
LLCheckBoxCtrl* mWantChecks[8];
|
||||
LLCheckBoxCtrl* mSkillChecks[6];
|
||||
LLLineEditor* mWantToEditor;
|
||||
LLLineEditor* mSkillsEditor;
|
||||
LLLineEditor* mLanguagesEditor;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Panel for displaying Avatar's picks.
|
||||
*/
|
||||
|
||||
class FSPanelPick
|
||||
: public FSPanelProfileTab
|
||||
, public LLRemoteParcelInfoObserver
|
||||
{
|
||||
public:
|
||||
|
||||
// Creates new panel
|
||||
static FSPanelPick* create();
|
||||
|
||||
/*virtual*/ ~FSPanelPick();
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
void setAvatarId(const LLUUID& avatar_id);
|
||||
|
||||
void setPickId(const LLUUID& id) { mPickId = id; }
|
||||
virtual LLUUID& getPickId() { return mPickId; }
|
||||
|
||||
virtual void setPickName(const std::string& name);
|
||||
const std::string getPickName();
|
||||
|
||||
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
|
||||
|
||||
/**
|
||||
* Saves changes.
|
||||
*/
|
||||
virtual void apply();
|
||||
|
||||
void updateTabLabel(const std::string& title);
|
||||
|
||||
//This stuff we got from LLRemoteParcelObserver, in the last one we intentionally do nothing
|
||||
/*virtual*/ void processParcelInfo(const LLParcelData& parcel_data);
|
||||
/*virtual*/ void setParcelID(const LLUUID& parcel_id) { mParcelId = parcel_id; }
|
||||
/*virtual*/ void setErrorStatus(S32 status, const std::string& reason) {};
|
||||
|
||||
protected:
|
||||
|
||||
FSPanelPick();
|
||||
|
||||
/**
|
||||
* Sends remote parcel info request to resolve parcel name from its ID.
|
||||
*/
|
||||
void sendParcelInfoRequest();
|
||||
|
||||
/**
|
||||
* "Location text" is actually the owner name, the original
|
||||
* name that owner gave the parcel, and the location.
|
||||
*/
|
||||
static std::string createLocationText(
|
||||
const std::string& owner_name,
|
||||
const std::string& original_name,
|
||||
const std::string& sim_name,
|
||||
const LLVector3d& pos_global);
|
||||
|
||||
/**
|
||||
* Sets snapshot id.
|
||||
*
|
||||
* Will mark snapshot control as valid if id is not null.
|
||||
* Will mark snapshot control as invalid if id is null. If null id is a valid value,
|
||||
* you have to manually mark snapshot is valid.
|
||||
*/
|
||||
virtual void setSnapshotId(const LLUUID& id);
|
||||
virtual void setPickDesc(const std::string& desc);
|
||||
virtual void setPickLocation(const std::string& location);
|
||||
|
||||
virtual void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; }
|
||||
virtual LLVector3d& getPosGlobal() { return mPosGlobal; }
|
||||
|
||||
/**
|
||||
* Callback for "Map" button, opens Map
|
||||
*/
|
||||
void onClickMap();
|
||||
|
||||
/**
|
||||
* Callback for "Teleport" button, teleports user to Pick location.
|
||||
*/
|
||||
void onClickTeleport();
|
||||
|
||||
/**
|
||||
* Enables/disables "Save" button
|
||||
*/
|
||||
void enableSaveButton(BOOL enable);
|
||||
|
||||
/**
|
||||
* Called when snapshot image changes.
|
||||
*/
|
||||
void onSnapshotChanged();
|
||||
|
||||
/**
|
||||
* Callback for Pick snapshot, name and description changed event.
|
||||
*/
|
||||
void onPickChanged(LLUICtrl* ctrl);
|
||||
|
||||
/**
|
||||
* Resets panel and all cantrols to unedited state
|
||||
*/
|
||||
/*virtual*/ void resetDirty();
|
||||
|
||||
/**
|
||||
* Returns true if any of Pick properties was changed by user.
|
||||
*/
|
||||
/*virtual*/ BOOL isDirty() const;
|
||||
|
||||
/**
|
||||
* Callback for "Set Location" button click
|
||||
*/
|
||||
void onClickSetLocation();
|
||||
|
||||
/**
|
||||
* Callback for "Save" button click
|
||||
*/
|
||||
void onClickSave();
|
||||
|
||||
std::string getLocationNotice();
|
||||
|
||||
/**
|
||||
* Sends Pick properties to server.
|
||||
*/
|
||||
void sendUpdate();
|
||||
|
||||
protected:
|
||||
|
||||
LLTextureCtrl* mSnapshotCtrl;
|
||||
LLLineEditor* mPickName;
|
||||
LLTextEditor* mPickDescription;
|
||||
LLButton* mSetCurrentLocationButton;
|
||||
LLButton* mSaveButton;
|
||||
|
||||
LLVector3d mPosGlobal;
|
||||
LLUUID mParcelId;
|
||||
LLUUID mPickId;
|
||||
LLUUID mRequestedId;
|
||||
|
||||
bool mLocationChanged;
|
||||
bool mNewPick;
|
||||
bool mIsEditing;
|
||||
|
||||
std::string mCurrentPickDescription;
|
||||
|
||||
void onDescriptionFocusReceived();
|
||||
};
|
||||
|
||||
class FSPanelProfilePicks
|
||||
: public FSPanelProfileTab
|
||||
{
|
||||
public:
|
||||
FSPanelProfilePicks();
|
||||
/*virtual*/ ~FSPanelProfilePicks();
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
|
||||
|
||||
void resetData();
|
||||
|
||||
/**
|
||||
* Saves changes.
|
||||
*/
|
||||
virtual void apply();
|
||||
|
||||
/**
|
||||
* Sends update data request to server.
|
||||
*/
|
||||
/*virtual*/ void updateData();
|
||||
|
||||
private:
|
||||
void onClickNewBtn();
|
||||
void onClickDelete();
|
||||
void callbackDeletePick(const LLSD& notification, const LLSD& response);
|
||||
|
||||
boost::signals2::connection mRlvBehaviorCallbackConnection;
|
||||
void updateRlvRestrictions(ERlvBehaviour behavior, ERlvParamType type);
|
||||
|
||||
bool canAddNewPick();
|
||||
bool canDeletePick();
|
||||
|
||||
LLTabContainer* mTabContainer;
|
||||
LLUICtrl* mNoItemsLabel;
|
||||
LLButton* mNewButton;
|
||||
LLButton* mDeleteButton;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Panel for displaying Avatar's first life related info.
|
||||
*/
|
||||
class FSPanelProfileFirstLife
|
||||
: public FSPanelProfileTab
|
||||
{
|
||||
public:
|
||||
FSPanelProfileFirstLife();
|
||||
/*virtual*/ ~FSPanelProfileFirstLife();
|
||||
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
|
||||
|
||||
void resetData();
|
||||
|
||||
/**
|
||||
* Saves changes.
|
||||
*/
|
||||
void apply(LLAvatarData* data);
|
||||
|
||||
protected:
|
||||
virtual void enableControls();
|
||||
void onDescriptionFocusReceived();
|
||||
|
||||
LLTextEditor* mDescriptionEdit;
|
||||
LLTextureCtrl* mPicture;
|
||||
|
||||
bool mIsEditing;
|
||||
std::string mCurrentDescription;
|
||||
};
|
||||
|
||||
/**
|
||||
* Panel for displaying Avatar's notes and modifying friend's rights.
|
||||
*/
|
||||
class FSPanelAvatarNotes
|
||||
: public FSPanelProfileTab
|
||||
, public LLFriendObserver
|
||||
{
|
||||
public:
|
||||
FSPanelAvatarNotes();
|
||||
/*virtual*/ ~FSPanelAvatarNotes();
|
||||
|
||||
virtual void setAvatarId(const LLUUID& id);
|
||||
|
||||
/**
|
||||
* LLFriendObserver trigger
|
||||
*/
|
||||
virtual void changed(U32 mask);
|
||||
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
|
||||
|
||||
void resetData();
|
||||
|
||||
/*virtual*/ void updateData();
|
||||
|
||||
/**
|
||||
* Saves changes.
|
||||
*/
|
||||
virtual void apply();
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Fills rights data for friends.
|
||||
*/
|
||||
void fillRightsData();
|
||||
|
||||
void rightsConfirmationCallback(const LLSD& notification, const LLSD& response, S32 rights);
|
||||
void confirmModifyRights(bool grant, S32 rights);
|
||||
void onCommitRights();
|
||||
void onCommitNotes();
|
||||
void enableCheckboxes(bool enable);
|
||||
|
||||
LLCheckBoxCtrl* mOnlineStatus;
|
||||
LLCheckBoxCtrl* mMapRights;
|
||||
LLCheckBoxCtrl* mEditObjectRights;
|
||||
LLTextEditor* mNotesEditor;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Container panel for the profile tabs
|
||||
*/
|
||||
class FSPanelProfile
|
||||
: public FSPanelProfileTab
|
||||
{
|
||||
public:
|
||||
FSPanelProfile();
|
||||
/*virtual*/ ~FSPanelProfile();
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
/*virtual*/ void updateData();
|
||||
|
||||
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
|
||||
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
/**
|
||||
* Saves changes.
|
||||
*/
|
||||
void apply();
|
||||
|
||||
private:
|
||||
void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name);
|
||||
void onTabChange();
|
||||
|
||||
FSPanelProfileSecondLife* mPanelSecondlife;
|
||||
FSPanelProfileWeb* mPanelWeb;
|
||||
FSPanelProfileInterests* mPanelInterests;
|
||||
FSPanelProfilePicks* mPanelPicks;
|
||||
FSPanelClassifieds* mPanelClassifieds;
|
||||
FSPanelProfileFirstLife* mPanelFirstlife;
|
||||
FSPanelAvatarNotes* mPanelNotes;
|
||||
LLTabContainer* mTabContainer;
|
||||
|
||||
boost::signals2::connection mAvatarNameCacheConnection;
|
||||
};
|
||||
|
||||
#endif // FS_PANELPROFILE_H
|
||||
|
|
@ -1,781 +0,0 @@
|
|||
/**
|
||||
* @file fspanelprofileclassifieds.cpp
|
||||
* @brief FSPanelClassifieds and related class implementations
|
||||
*
|
||||
* $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 "fspanelprofileclassifieds.h"
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llflatlistview.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "llfloaterworldmap.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "lltrans.h"
|
||||
#include "llmenugl.h"
|
||||
#include "llviewermenu.h"
|
||||
#include "llviewergenericmessage.h"
|
||||
#include "llregistry.h"
|
||||
|
||||
#include "llavatarpropertiesprocessor.h"
|
||||
#include "fsdispatchclassifiedclickthrough.h"
|
||||
#include "fspanelprofile.h"
|
||||
#include "fspanelclassified.h"
|
||||
|
||||
static const std::string XML_BTN_NEW = "new_btn";
|
||||
static const std::string XML_BTN_DELETE = "trash_btn";
|
||||
static const std::string XML_BTN_INFO = "info_btn";
|
||||
static const std::string XML_BTN_TELEPORT = "teleport_btn";
|
||||
static const std::string XML_BTN_SHOW_ON_MAP = "show_on_map_btn";
|
||||
|
||||
static const std::string PICK_ID("pick_id");
|
||||
static const std::string PICK_CREATOR_ID("pick_creator_id");
|
||||
static const std::string PICK_NAME("pick_name");
|
||||
|
||||
static const std::string CLASSIFIED_ID("classified_id");
|
||||
static const std::string CLASSIFIED_NAME("classified_name");
|
||||
|
||||
static FSDispatchClassifiedClickThrough sClassifiedClickThrough;
|
||||
|
||||
static LLPanelInjector<FSPanelClassifieds> t_panel_fs_classifieds("panel_fs_profile_classified");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// FSPanelClassifieds
|
||||
//-----------------------------------------------------------------------------
|
||||
FSPanelClassifieds::FSPanelClassifieds()
|
||||
: FSPanelProfileTab(),
|
||||
mPopupMenu(NULL),
|
||||
mClassifiedsList(NULL),
|
||||
mPanelClassifiedInfo(NULL),
|
||||
mNoClassifieds(false),
|
||||
mRlvBehaviorCallbackConnection()
|
||||
{
|
||||
}
|
||||
|
||||
FSPanelClassifieds::~FSPanelClassifieds()
|
||||
{
|
||||
if (getAvatarId().notNull())
|
||||
{
|
||||
LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this);
|
||||
}
|
||||
|
||||
if (mRlvBehaviorCallbackConnection.connected())
|
||||
{
|
||||
mRlvBehaviorCallbackConnection.disconnect();
|
||||
}
|
||||
|
||||
gGenericDispatcher.addHandler("classifiedclickthrough", NULL);
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::updateData()
|
||||
{
|
||||
// Send Picks request only when we need to, not on every onOpen(during tab switch).
|
||||
if (isDirty())
|
||||
{
|
||||
mNoClassifieds = false;
|
||||
|
||||
mNoItemsLabel->setValue(LLTrans::getString("PicksClassifiedsLoadingText"));
|
||||
mNoItemsLabel->setVisible(TRUE);
|
||||
|
||||
mClassifiedsList->clear();
|
||||
LLAvatarPropertiesProcessor::getInstance()->sendAvatarClassifiedsRequest(getAvatarId());
|
||||
}
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::processProperties(void* data, EAvatarProcessorType type)
|
||||
{
|
||||
if (APT_CLASSIFIEDS == type)
|
||||
{
|
||||
LLAvatarClassifieds* c_info = static_cast<LLAvatarClassifieds*>(data);
|
||||
if (c_info && getAvatarId() == c_info->target_id)
|
||||
{
|
||||
// do not clear classified list in case we will receive two or more data packets.
|
||||
// list has been cleared in updateData(). (fix for EXT-6436)
|
||||
|
||||
LLAvatarClassifieds::classifieds_list_t::const_iterator it = c_info->classifieds_list.begin();
|
||||
for (; c_info->classifieds_list.end() != it; ++it)
|
||||
{
|
||||
LLAvatarClassifieds::classified_data c_data = *it;
|
||||
|
||||
FSClassifiedItem* c_item = new FSClassifiedItem(getAvatarId(), c_data.classified_id);
|
||||
c_item->childSetAction("info_chevron", boost::bind(&FSPanelClassifieds::onClickInfo, this));
|
||||
c_item->setClassifiedName(c_data.name);
|
||||
|
||||
LLSD pick_value = LLSD();
|
||||
pick_value.insert(CLASSIFIED_ID, c_data.classified_id);
|
||||
pick_value.insert(CLASSIFIED_NAME, c_data.name);
|
||||
|
||||
if (!findClassifiedById(c_data.classified_id))
|
||||
{
|
||||
mClassifiedsList->addItem(c_item, pick_value);
|
||||
}
|
||||
|
||||
c_item->setDoubleClickCallback(boost::bind(&FSPanelClassifieds::onDoubleClickClassifiedItem, this, _1));
|
||||
c_item->setRightMouseUpCallback(boost::bind(&FSPanelClassifieds::onRightMouseUpItem, this, _1, _2, _3, _4));
|
||||
c_item->setMouseUpCallback(boost::bind(&FSPanelClassifieds::updateButtons, this));
|
||||
}
|
||||
|
||||
resetDirty();
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
mNoClassifieds = !mClassifiedsList->size();
|
||||
|
||||
bool no_data = mNoClassifieds;
|
||||
mNoItemsLabel->setVisible(no_data);
|
||||
if (no_data)
|
||||
{
|
||||
if (getAvatarId() == gAgentID)
|
||||
{
|
||||
mNoItemsLabel->setValue(LLTrans::getString("NoClassifiedsText"));
|
||||
}
|
||||
else
|
||||
{
|
||||
mNoItemsLabel->setValue(LLTrans::getString("NoAvatarClassifiedsText"));
|
||||
}
|
||||
}
|
||||
|
||||
enableControls();
|
||||
}
|
||||
}
|
||||
|
||||
FSClassifiedItem* FSPanelClassifieds::getSelectedClassifiedItem()
|
||||
{
|
||||
LLPanel* selected_item = mClassifiedsList->getSelectedItem();
|
||||
if (!selected_item)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return dynamic_cast<FSClassifiedItem*>(selected_item);
|
||||
}
|
||||
|
||||
BOOL FSPanelClassifieds::postBuild()
|
||||
{
|
||||
mClassifiedsList = getChild<LLFlatListView>("classifieds_list");
|
||||
mClassifiedsList->setCommitOnSelectionChange(true);
|
||||
mClassifiedsList->setCommitCallback(boost::bind(&FSPanelClassifieds::onListCommit, this, mClassifiedsList));
|
||||
mClassifiedsList->setNoItemsCommentText(getString("no_classifieds"));
|
||||
|
||||
mNoItemsLabel = getChild<LLUICtrl>("picks_panel_text");
|
||||
|
||||
childSetAction(XML_BTN_NEW, boost::bind(&FSPanelClassifieds::createNewClassified, this));
|
||||
childSetAction(XML_BTN_DELETE, boost::bind(&FSPanelClassifieds::onClickDelete, this));
|
||||
childSetAction(XML_BTN_TELEPORT, boost::bind(&FSPanelClassifieds::onClickTeleport, this));
|
||||
childSetAction(XML_BTN_SHOW_ON_MAP, boost::bind(&FSPanelClassifieds::onClickMap, this));
|
||||
childSetAction(XML_BTN_INFO, boost::bind(&FSPanelClassifieds::onClickInfo, this));
|
||||
|
||||
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registar;
|
||||
registar.add("Classified.Info", boost::bind(&FSPanelClassifieds::onClickInfo, this));
|
||||
registar.add("Classified.Edit", boost::bind(&FSPanelClassifieds::onClickMenuEdit, this));
|
||||
registar.add("Classified.Teleport", boost::bind(&FSPanelClassifieds::onClickTeleport, this));
|
||||
registar.add("Classified.Map", boost::bind(&FSPanelClassifieds::onClickMap, this));
|
||||
registar.add("Classified.Delete", boost::bind(&FSPanelClassifieds::onClickDelete, this));
|
||||
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registar;
|
||||
enable_registar.add("Classified.Enable", boost::bind(&FSPanelClassifieds::onEnableMenuItem, this, _2));
|
||||
|
||||
mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_classifieds.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
|
||||
mRlvBehaviorCallbackConnection = gRlvHandler.setBehaviourCallback(boost::bind(&FSPanelClassifieds::updateRlvRestrictions, this, _1, _2));
|
||||
childSetEnabled(XML_BTN_NEW, !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool FSPanelClassifieds::isClassifiedPublished(FSClassifiedItem* c_item)
|
||||
{
|
||||
if (c_item)
|
||||
{
|
||||
FSPanelClassifiedEdit* panel = mEditClassifiedPanels[c_item->getClassifiedId()];
|
||||
if (panel)
|
||||
{
|
||||
return !panel->isNewWithErrors();
|
||||
}
|
||||
|
||||
// we've got this classified from server - it's published
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::onOpen(const LLSD& key)
|
||||
{
|
||||
const LLUUID id(key.asUUID());
|
||||
BOOL self = (gAgentID == id);
|
||||
|
||||
// only agent can edit her picks
|
||||
getChildView("edit_panel")->setEnabled(self);
|
||||
getChildView("edit_panel")->setVisible( self);
|
||||
|
||||
// Disable buttons when viewing profile for first time
|
||||
if (getAvatarId() != id)
|
||||
{
|
||||
getChildView(XML_BTN_INFO)->setEnabled(FALSE);
|
||||
getChildView(XML_BTN_TELEPORT)->setEnabled(FALSE);
|
||||
getChildView(XML_BTN_SHOW_ON_MAP)->setEnabled(FALSE);
|
||||
}
|
||||
|
||||
if (getAvatarId() != id)
|
||||
{
|
||||
mClassifiedsList->goToTop();
|
||||
// Set dummy value to make panel dirty and make it reload picks
|
||||
setValue(LLSD());
|
||||
}
|
||||
|
||||
FSPanelProfileTab::onOpen(key);
|
||||
|
||||
gGenericDispatcher.addHandler("classifiedclickthrough", &sClassifiedClickThrough);
|
||||
updateData();
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::onClosePanel()
|
||||
{
|
||||
if (mPanelClassifiedInfo)
|
||||
{
|
||||
onPanelClassifiedClose(mPanelClassifiedInfo);
|
||||
}
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::onListCommit(const LLFlatListView* f_list)
|
||||
{
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
//static
|
||||
void FSPanelClassifieds::onClickDelete()
|
||||
{
|
||||
LLSD value = mClassifiedsList->getSelectedValue();
|
||||
if (value.isDefined())
|
||||
{
|
||||
LLSD args;
|
||||
args["NAME"] = value[CLASSIFIED_NAME];
|
||||
LLNotificationsUtil::add("DeleteClassified", args, LLSD(), boost::bind(&FSPanelClassifieds::callbackDeleteClassified, this, _1, _2));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool FSPanelClassifieds::callbackDeleteClassified(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
LLSD value = mClassifiedsList->getSelectedValue();
|
||||
|
||||
if (0 == option)
|
||||
{
|
||||
LLAvatarPropertiesProcessor::instance().sendClassifiedDelete(value[CLASSIFIED_ID]);
|
||||
mClassifiedsList->removeItemByValue(value);
|
||||
}
|
||||
mNoItemsLabel->setVisible(!mClassifiedsList->size());
|
||||
updateButtons();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FSPanelClassifieds::callbackTeleport( const LLSD& notification, const LLSD& response )
|
||||
{
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
|
||||
if (0 == option)
|
||||
{
|
||||
onClickTeleport();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//static
|
||||
void FSPanelClassifieds::onClickTeleport()
|
||||
{
|
||||
FSClassifiedItem* c_item = getSelectedClassifiedItem();
|
||||
|
||||
LLVector3d pos;
|
||||
if (c_item)
|
||||
{
|
||||
pos = c_item->getPosGlobal();
|
||||
FSPanelClassifiedInfo::sendClickMessage("teleport", false,
|
||||
c_item->getClassifiedId(), LLUUID::null, pos, LLStringUtil::null);
|
||||
}
|
||||
|
||||
if (!pos.isExactlyZero())
|
||||
{
|
||||
gAgent.teleportViaLocation(pos);
|
||||
LLFloaterWorldMap::getInstance()->trackLocation(pos);
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void FSPanelClassifieds::onClickMap()
|
||||
{
|
||||
FSClassifiedItem* c_item = getSelectedClassifiedItem();
|
||||
|
||||
LLVector3d pos;
|
||||
if (c_item)
|
||||
{
|
||||
FSPanelClassifiedInfo::sendClickMessage("map", false,
|
||||
c_item->getClassifiedId(), LLUUID::null, pos, LLStringUtil::null);
|
||||
pos = c_item->getPosGlobal();
|
||||
}
|
||||
|
||||
LLFloaterWorldMap::getInstance()->trackLocation(pos);
|
||||
LLFloaterReg::showInstance("world_map", "center");
|
||||
}
|
||||
|
||||
|
||||
void FSPanelClassifieds::onRightMouseUpItem(LLUICtrl* item, S32 x, S32 y, MASK mask)
|
||||
{
|
||||
updateButtons();
|
||||
|
||||
if (mPopupMenu)
|
||||
{
|
||||
mPopupMenu->buildDrawLabels();
|
||||
mPopupMenu->updateParent(LLMenuGL::sMenuContainer);
|
||||
((LLContextMenu*)mPopupMenu)->show(x, y);
|
||||
LLMenuGL::showPopup(item, mPopupMenu, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::onDoubleClickClassifiedItem(LLUICtrl* item)
|
||||
{
|
||||
LLSD value = mClassifiedsList->getSelectedValue();
|
||||
if (value.isUndefined()) return;
|
||||
|
||||
LLSD args;
|
||||
args["CLASSIFIED"] = value[CLASSIFIED_NAME];
|
||||
LLNotificationsUtil::add("TeleportToClassified", args, LLSD(), boost::bind(&FSPanelClassifieds::callbackTeleport, this, _1, _2));
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::updateButtons()
|
||||
{
|
||||
bool has_selected = mClassifiedsList->numSelected() > 0;
|
||||
|
||||
if (getAvatarId() == gAgentID)
|
||||
{
|
||||
getChildView(XML_BTN_DELETE)->setEnabled(has_selected);
|
||||
}
|
||||
|
||||
getChildView(XML_BTN_INFO)->setEnabled(has_selected);
|
||||
getChildView(XML_BTN_TELEPORT)->setEnabled(has_selected);
|
||||
getChildView(XML_BTN_SHOW_ON_MAP)->setEnabled(has_selected);
|
||||
|
||||
FSClassifiedItem* c_item = dynamic_cast<FSClassifiedItem*>(mClassifiedsList->getSelectedItem());
|
||||
if (c_item)
|
||||
{
|
||||
getChildView(XML_BTN_INFO)->setEnabled(isClassifiedPublished(c_item));
|
||||
}
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::createNewClassified()
|
||||
{
|
||||
FSPanelClassifiedEdit* panel = NULL;
|
||||
createClassifiedEditPanel(&panel);
|
||||
|
||||
openPanel(panel, LLSD());
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::onClickInfo()
|
||||
{
|
||||
if (mClassifiedsList->numSelected() > 0)
|
||||
{
|
||||
openClassifiedInfo();
|
||||
}
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::openClassifiedInfo()
|
||||
{
|
||||
LLSD selected_value = mClassifiedsList->getSelectedValue();
|
||||
if (selected_value.isUndefined())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
FSClassifiedItem* c_item = getSelectedClassifiedItem();
|
||||
LLSD params;
|
||||
params["classified_id"] = c_item->getClassifiedId();
|
||||
params["classified_creator_id"] = c_item->getAvatarId();
|
||||
params["classified_snapshot_id"] = c_item->getSnapshotId();
|
||||
params["classified_name"] = c_item->getClassifiedName();
|
||||
params["classified_desc"] = c_item->getDescription();
|
||||
params["from_search"] = false;
|
||||
|
||||
openClassifiedInfo(params);
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::openClassifiedInfo(const LLSD ¶ms)
|
||||
{
|
||||
createClassifiedInfoPanel();
|
||||
openPanel(mPanelClassifiedInfo, params);
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::openClassifiedEdit(const LLSD& params)
|
||||
{
|
||||
LLUUID classified_id = params["classified_id"].asUUID();;
|
||||
LL_INFOS("FSPanelClassifieds") << "opening classified " << classified_id << " for edit" << LL_ENDL;
|
||||
editClassified(classified_id);
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::onPanelPickClose(LLPanel* panel)
|
||||
{
|
||||
closePanel(panel);
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::onPanelClassifiedSave(FSPanelClassifiedEdit* panel)
|
||||
{
|
||||
if (!panel->canClose())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (panel->isNew())
|
||||
{
|
||||
mEditClassifiedPanels[panel->getClassifiedId()] = panel;
|
||||
|
||||
FSClassifiedItem* c_item = new FSClassifiedItem(getAvatarId(), panel->getClassifiedId());
|
||||
c_item->fillIn(panel);
|
||||
|
||||
LLSD c_value;
|
||||
c_value.insert(CLASSIFIED_ID, c_item->getClassifiedId());
|
||||
c_value.insert(CLASSIFIED_NAME, c_item->getClassifiedName());
|
||||
mClassifiedsList->addItem(c_item, c_value, ADD_TOP);
|
||||
|
||||
c_item->setDoubleClickCallback(boost::bind(&FSPanelClassifieds::onDoubleClickClassifiedItem, this, _1));
|
||||
c_item->setRightMouseUpCallback(boost::bind(&FSPanelClassifieds::onRightMouseUpItem, this, _1, _2, _3, _4));
|
||||
c_item->setMouseUpCallback(boost::bind(&FSPanelClassifieds::updateButtons, this));
|
||||
c_item->childSetAction("info_chevron", boost::bind(&FSPanelClassifieds::onClickInfo, this));
|
||||
|
||||
mNoItemsLabel->setVisible(FALSE);
|
||||
}
|
||||
else if (panel->isNewWithErrors())
|
||||
{
|
||||
FSClassifiedItem* c_item = dynamic_cast<FSClassifiedItem*>(mClassifiedsList->getSelectedItem());
|
||||
llassert(c_item);
|
||||
if (c_item)
|
||||
{
|
||||
c_item->fillIn(panel);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
onPanelClassifiedClose(panel);
|
||||
return;
|
||||
}
|
||||
|
||||
onPanelPickClose(panel);
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::onPanelClassifiedClose(FSPanelClassifiedInfo* panel)
|
||||
{
|
||||
if (panel->getInfoLoaded() && !panel->isDirty())
|
||||
{
|
||||
std::vector<LLSD> values;
|
||||
mClassifiedsList->getValues(values);
|
||||
for (size_t n = 0; n < values.size(); ++n)
|
||||
{
|
||||
LLUUID c_id = values[n][CLASSIFIED_ID].asUUID();
|
||||
if (panel->getClassifiedId() == c_id)
|
||||
{
|
||||
FSClassifiedItem* c_item = dynamic_cast<FSClassifiedItem*>(mClassifiedsList->getItemByValue(values[n]));
|
||||
llassert(c_item);
|
||||
if (c_item)
|
||||
{
|
||||
c_item->setClassifiedName(panel->getClassifiedName());
|
||||
c_item->setDescription(panel->getDescription());
|
||||
c_item->setSnapshotId(panel->getSnapshotId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onPanelPickClose(panel);
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::createClassifiedInfoPanel()
|
||||
{
|
||||
mPanelClassifiedInfo = FSPanelClassifiedInfo::create();
|
||||
mPanelClassifiedInfo->setExitCallback(boost::bind(&FSPanelClassifieds::onPanelClassifiedClose, this, mPanelClassifiedInfo));
|
||||
mPanelClassifiedInfo->setEditClassifiedCallback(boost::bind(&FSPanelClassifieds::onPanelClassifiedEdit, this));
|
||||
mPanelClassifiedInfo->setVisible(FALSE);
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::createClassifiedEditPanel(FSPanelClassifiedEdit** panel)
|
||||
{
|
||||
if (panel)
|
||||
{
|
||||
FSPanelClassifiedEdit* new_panel = FSPanelClassifiedEdit::create();
|
||||
new_panel->setExitCallback(boost::bind(&FSPanelClassifieds::onPanelClassifiedClose, this, new_panel));
|
||||
new_panel->setSaveCallback(boost::bind(&FSPanelClassifieds::onPanelClassifiedSave, this, new_panel));
|
||||
new_panel->setCancelCallback(boost::bind(&FSPanelClassifieds::onPanelClassifiedClose, this, new_panel));
|
||||
new_panel->setVisible(FALSE);
|
||||
*panel = new_panel;
|
||||
}
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::onPanelClassifiedEdit()
|
||||
{
|
||||
LLSD selected_value = mClassifiedsList->getSelectedValue();
|
||||
if (selected_value.isUndefined())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
FSClassifiedItem* c_item = dynamic_cast<FSClassifiedItem*>(mClassifiedsList->getSelectedItem());
|
||||
llassert(c_item);
|
||||
if (!c_item)
|
||||
{
|
||||
return;
|
||||
}
|
||||
editClassified(c_item->getClassifiedId());
|
||||
}
|
||||
|
||||
FSClassifiedItem *FSPanelClassifieds::findClassifiedById(const LLUUID& classified_id)
|
||||
{
|
||||
// HACK - find item by classified id. Should be a better way.
|
||||
std::vector<LLPanel*> items;
|
||||
mClassifiedsList->getItems(items);
|
||||
FSClassifiedItem* c_item = NULL;
|
||||
for (std::vector<LLPanel*>::iterator it = items.begin(); it != items.end(); ++it)
|
||||
{
|
||||
FSClassifiedItem *test_item = dynamic_cast<FSClassifiedItem*>(*it);
|
||||
if (test_item && test_item->getClassifiedId() == classified_id)
|
||||
{
|
||||
c_item = test_item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return c_item;
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::editClassified(const LLUUID& classified_id)
|
||||
{
|
||||
FSClassifiedItem* c_item = findClassifiedById(classified_id);
|
||||
if (!c_item)
|
||||
{
|
||||
LL_WARNS("FSPanelClassifieds") << "item not found for classified_id " << classified_id << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
LLSD params;
|
||||
params["classified_id"] = c_item->getClassifiedId();
|
||||
params["classified_creator_id"] = c_item->getAvatarId();
|
||||
params["snapshot_id"] = c_item->getSnapshotId();
|
||||
params["name"] = c_item->getClassifiedName();
|
||||
params["desc"] = c_item->getDescription();
|
||||
params["category"] = (S32)c_item->getCategory();
|
||||
params["content_type"] = (S32)c_item->getContentType();
|
||||
params["auto_renew"] = c_item->getAutoRenew();
|
||||
params["price_for_listing"] = c_item->getPriceForListing();
|
||||
params["location_text"] = c_item->getLocationText();
|
||||
|
||||
FSPanelClassifiedEdit* panel = mEditClassifiedPanels[c_item->getClassifiedId()];
|
||||
if (!panel)
|
||||
{
|
||||
createClassifiedEditPanel(&panel);
|
||||
mEditClassifiedPanels[c_item->getClassifiedId()] = panel;
|
||||
}
|
||||
openPanel(panel, params);
|
||||
panel->setPosGlobal(c_item->getPosGlobal());
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::onClickMenuEdit()
|
||||
{
|
||||
if (getSelectedClassifiedItem())
|
||||
{
|
||||
onPanelClassifiedEdit();
|
||||
}
|
||||
}
|
||||
|
||||
bool FSPanelClassifieds::onEnableMenuItem(const LLSD& user_data)
|
||||
{
|
||||
std::string param = user_data.asString();
|
||||
|
||||
FSClassifiedItem* c_item = dynamic_cast<FSClassifiedItem*>(mClassifiedsList->getSelectedItem());
|
||||
if (c_item && "info" == param)
|
||||
{
|
||||
// dont show Info panel if classified was not created
|
||||
return isClassifiedPublished(c_item);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//hack
|
||||
void FSPanelClassifieds::openPanel(LLPanel* panel, const LLSD& params)
|
||||
{
|
||||
// Add the panel or bring it to front.
|
||||
if (panel->getParent() != this)
|
||||
{
|
||||
addChild(panel);
|
||||
}
|
||||
else
|
||||
{
|
||||
sendChildToFront(panel);
|
||||
}
|
||||
|
||||
panel->setVisible(TRUE);
|
||||
panel->setFocus(TRUE); // prevent losing focus by the floater
|
||||
panel->onOpen(params);
|
||||
|
||||
LLRect new_rect = getRect();
|
||||
panel->reshape(new_rect.getWidth(), new_rect.getHeight());
|
||||
new_rect.setLeftTopAndSize(0, new_rect.getHeight(), new_rect.getWidth(), new_rect.getHeight());
|
||||
panel->setRect(new_rect);
|
||||
}
|
||||
|
||||
//hack
|
||||
void FSPanelClassifieds::closePanel(LLPanel* panel)
|
||||
{
|
||||
panel->setVisible(FALSE);
|
||||
|
||||
if (panel->getParent() == this)
|
||||
{
|
||||
removeChild(panel);
|
||||
|
||||
// Prevent losing focus by the floater
|
||||
const child_list_t* child_list = getChildList();
|
||||
if (child_list->size() > 0)
|
||||
{
|
||||
child_list->front()->setFocus(TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS("FSPanelClassifieds") << "No underlying panel to focus." << LL_ENDL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FSPanelClassifieds::updateRlvRestrictions(ERlvBehaviour behavior, ERlvParamType type)
|
||||
{
|
||||
if (behavior == RLV_BHVR_SHOWLOC)
|
||||
{
|
||||
childSetEnabled(XML_BTN_NEW, type != RLV_TYPE_ADD);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
FSClassifiedItem::FSClassifiedItem(const LLUUID& avatar_id, const LLUUID& classified_id)
|
||||
: LLPanel()
|
||||
, mAvatarId(avatar_id)
|
||||
, mClassifiedId(classified_id)
|
||||
{
|
||||
buildFromFile("panel_classifieds_list_item.xml");
|
||||
|
||||
LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this);
|
||||
LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId());
|
||||
}
|
||||
|
||||
FSClassifiedItem::~FSClassifiedItem()
|
||||
{
|
||||
LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this);
|
||||
}
|
||||
|
||||
void FSClassifiedItem::processProperties(void* data, EAvatarProcessorType type)
|
||||
{
|
||||
if (APT_CLASSIFIED_INFO != type)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LLAvatarClassifiedInfo* c_info = static_cast<LLAvatarClassifiedInfo*>(data);
|
||||
if (!c_info || c_info->classified_id != getClassifiedId())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
setClassifiedName(c_info->name);
|
||||
setDescription(c_info->description);
|
||||
setSnapshotId(c_info->snapshot_id);
|
||||
setPosGlobal(c_info->pos_global);
|
||||
|
||||
LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this);
|
||||
}
|
||||
|
||||
void set_child_visible2(LLView* parent, const std::string& child_name, bool visible)
|
||||
{
|
||||
parent->getChildView(child_name)->setVisible(visible);
|
||||
}
|
||||
|
||||
BOOL FSClassifiedItem::postBuild()
|
||||
{
|
||||
setMouseEnterCallback(boost::bind(&set_child_visible2, this, "hovered_icon", true));
|
||||
setMouseLeaveCallback(boost::bind(&set_child_visible2, this, "hovered_icon", false));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void FSClassifiedItem::setValue(const LLSD& value)
|
||||
{
|
||||
if (!value.isMap())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!value.has("selected"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
getChildView("selected_icon")->setVisible( value["selected"]);
|
||||
}
|
||||
|
||||
void FSClassifiedItem::fillIn(FSPanelClassifiedEdit* panel)
|
||||
{
|
||||
if (!panel)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
setClassifiedName(panel->getClassifiedName());
|
||||
setDescription(panel->getDescription());
|
||||
setSnapshotId(panel->getSnapshotId());
|
||||
setCategory(panel->getCategory());
|
||||
setContentType(panel->getContentType());
|
||||
setAutoRenew(panel->getAutoRenew());
|
||||
setPriceForListing(panel->getPriceForListing());
|
||||
setPosGlobal(panel->getPosGlobal());
|
||||
setLocationText(panel->getClassifiedLocation());
|
||||
}
|
||||
|
||||
void FSClassifiedItem::setClassifiedName(const std::string& name)
|
||||
{
|
||||
getChild<LLUICtrl>("name")->setValue(name);
|
||||
}
|
||||
|
||||
void FSClassifiedItem::setDescription(const std::string& desc)
|
||||
{
|
||||
getChild<LLUICtrl>("description")->setValue(desc);
|
||||
}
|
||||
|
||||
void FSClassifiedItem::setSnapshotId(const LLUUID& snapshot_id)
|
||||
{
|
||||
getChild<LLUICtrl>("picture")->setValue(snapshot_id);
|
||||
}
|
||||
|
||||
LLUUID FSClassifiedItem::getSnapshotId()
|
||||
{
|
||||
return getChild<LLUICtrl>("picture")->getValue();
|
||||
}
|
||||
|
||||
//EOF
|
||||
|
|
@ -1,206 +0,0 @@
|
|||
/**
|
||||
* @file fspanelprofileclassifieds.h
|
||||
* @brief FSPanelClassifieds and related class definitions
|
||||
*
|
||||
* $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 FS_PANELCLASSIFIEDS_H
|
||||
#define FS_PANELCLASSIFIEDS_H
|
||||
|
||||
#include "llpanel.h"
|
||||
#include "v3dmath.h"
|
||||
#include "lluuid.h"
|
||||
#include "llavatarpropertiesprocessor.h"
|
||||
#include "fspanelprofile.h"
|
||||
#include "llregistry.h"
|
||||
|
||||
class LLMessageSystem;
|
||||
class LLVector3d;
|
||||
class FSPanelProfileTab;
|
||||
class LLAgent;
|
||||
class LLMenuGL;
|
||||
class FSClassifiedItem;
|
||||
class LLFlatListView;
|
||||
class FSPanelClassifiedInfo;
|
||||
class FSPanelClassifiedEdit;
|
||||
|
||||
// *TODO
|
||||
// Panel Picks has been consolidated with Classifieds (EXT-2095), give FSPanelClassifieds
|
||||
// and corresponding files (cpp, h, xml) a new name. (new name is TBD at the moment)
|
||||
|
||||
class FSPanelClassifieds
|
||||
: public FSPanelProfileTab
|
||||
{
|
||||
public:
|
||||
FSPanelClassifieds();
|
||||
~FSPanelClassifieds();
|
||||
|
||||
/*virtual*/ BOOL postBuild(void);
|
||||
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
/*virtual*/ void onClosePanel();
|
||||
|
||||
void processProperties(void* data, EAvatarProcessorType type);
|
||||
|
||||
void updateData();
|
||||
|
||||
// returns the selected pick item
|
||||
FSClassifiedItem* getSelectedClassifiedItem();
|
||||
FSClassifiedItem* findClassifiedById(const LLUUID& classified_id);
|
||||
|
||||
void createNewClassified();
|
||||
|
||||
protected:
|
||||
/*virtual*/void updateButtons();
|
||||
|
||||
private:
|
||||
void onClickDelete();
|
||||
void onClickTeleport();
|
||||
void onClickMap();
|
||||
|
||||
bool isClassifiedPublished(FSClassifiedItem* c_item);
|
||||
|
||||
void onListCommit(const LLFlatListView* f_list);
|
||||
|
||||
boost::signals2::connection mRlvBehaviorCallbackConnection;
|
||||
void updateRlvRestrictions(ERlvBehaviour behavior, ERlvParamType type);
|
||||
|
||||
//------------------------------------------------
|
||||
// Callbacks which require panel toggling
|
||||
//------------------------------------------------
|
||||
void onClickInfo();
|
||||
void onPanelPickClose(LLPanel* panel);
|
||||
void onPanelClassifiedSave(FSPanelClassifiedEdit* panel);
|
||||
void onPanelClassifiedClose(FSPanelClassifiedInfo* panel);
|
||||
void onPanelClassifiedEdit();
|
||||
void editClassified(const LLUUID& classified_id);
|
||||
void onClickMenuEdit();
|
||||
|
||||
bool onEnableMenuItem(const LLSD& user_data);
|
||||
|
||||
void openClassifiedInfo();
|
||||
void openClassifiedInfo(const LLSD& params);
|
||||
void openClassifiedEdit(const LLSD& params);
|
||||
|
||||
bool callbackDeleteClassified(const LLSD& notification, const LLSD& response);
|
||||
bool callbackTeleport(const LLSD& notification, const LLSD& response);
|
||||
|
||||
|
||||
virtual void onDoubleClickClassifiedItem(LLUICtrl* item);
|
||||
virtual void onRightMouseUpItem(LLUICtrl* item, S32 x, S32 y, MASK mask);
|
||||
|
||||
void createClassifiedInfoPanel();
|
||||
void createClassifiedEditPanel(FSPanelClassifiedEdit** panel);
|
||||
|
||||
void openPanel(LLPanel* panel, const LLSD& params);
|
||||
void closePanel(LLPanel* panel);
|
||||
|
||||
LLMenuGL* mPopupMenu;
|
||||
LLFlatListView* mClassifiedsList;
|
||||
FSPanelClassifiedInfo* mPanelClassifiedInfo;
|
||||
LLUICtrl* mNoItemsLabel;
|
||||
|
||||
// <classified_id, edit_panel>
|
||||
typedef std::map<LLUUID, FSPanelClassifiedEdit*> panel_classified_edit_map_t;
|
||||
|
||||
// This map is needed for newly created classifieds. The purpose of panel is to
|
||||
// sit in this map and listen to FSPanelClassifiedEdit::processProperties callback.
|
||||
panel_classified_edit_map_t mEditClassifiedPanels;
|
||||
|
||||
//true if classifieds list is empty after processing classifieds
|
||||
bool mNoClassifieds;
|
||||
};
|
||||
|
||||
class FSClassifiedItem : public LLPanel, public LLAvatarPropertiesObserver
|
||||
{
|
||||
public:
|
||||
|
||||
FSClassifiedItem(const LLUUID& avatar_id, const LLUUID& classified_id);
|
||||
|
||||
virtual ~FSClassifiedItem();
|
||||
|
||||
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
/*virtual*/ void setValue(const LLSD& value);
|
||||
|
||||
void fillIn(FSPanelClassifiedEdit* panel);
|
||||
|
||||
LLUUID getAvatarId() {return mAvatarId;}
|
||||
|
||||
void setAvatarId(const LLUUID& avatar_id) {mAvatarId = avatar_id;}
|
||||
|
||||
LLUUID getClassifiedId() {return mClassifiedId;}
|
||||
|
||||
void setClassifiedId(const LLUUID& classified_id) {mClassifiedId = classified_id;}
|
||||
|
||||
void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; }
|
||||
|
||||
const LLVector3d getPosGlobal() { return mPosGlobal; }
|
||||
|
||||
void setLocationText(const std::string location) { mLocationText = location; }
|
||||
|
||||
std::string getLocationText() { return mLocationText; }
|
||||
|
||||
void setClassifiedName (const std::string& name);
|
||||
|
||||
std::string getClassifiedName() { return getChild<LLUICtrl>("name")->getValue().asString(); }
|
||||
|
||||
void setDescription(const std::string& desc);
|
||||
|
||||
std::string getDescription() { return getChild<LLUICtrl>("description")->getValue().asString(); }
|
||||
|
||||
void setSnapshotId(const LLUUID& snapshot_id);
|
||||
|
||||
LLUUID getSnapshotId();
|
||||
|
||||
void setCategory(U32 cat) { mCategory = cat; }
|
||||
|
||||
U32 getCategory() { return mCategory; }
|
||||
|
||||
void setContentType(U32 ct) { mContentType = ct; }
|
||||
|
||||
U32 getContentType() { return mContentType; }
|
||||
|
||||
void setAutoRenew(U32 renew) { mAutoRenew = renew; }
|
||||
|
||||
bool getAutoRenew() { return mAutoRenew; }
|
||||
|
||||
void setPriceForListing(S32 price) { mPriceForListing = price; }
|
||||
|
||||
S32 getPriceForListing() { return mPriceForListing; }
|
||||
|
||||
private:
|
||||
LLUUID mAvatarId;
|
||||
LLUUID mClassifiedId;
|
||||
LLVector3d mPosGlobal;
|
||||
std::string mLocationText;
|
||||
U32 mCategory;
|
||||
U32 mContentType;
|
||||
bool mAutoRenew;
|
||||
S32 mPriceForListing;
|
||||
};
|
||||
|
||||
#endif // FS_PANELCLASSIFIEDS_H
|
||||
|
|
@ -803,10 +803,12 @@ void FSParticipantList::FSParticipantListMenu::toggleMute(const LLSD& userdata,
|
|||
LL_WARNS("Speakers") << "Speaker " << speaker_id << " not found" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*>(mParent.mAvatarList->getItemByValue(speaker_id));
|
||||
if (NULL == item) return;
|
||||
|
||||
name = item->getAvatarName();
|
||||
// We should have the name in the cache from the LLAvatarList this is used in combination with
|
||||
LLAvatarName avname;
|
||||
if (!LLAvatarNameCache::get(speaker_id, &avname)) return;
|
||||
|
||||
name = avname.getUserName();
|
||||
|
||||
LLMute::EType mute_type;
|
||||
switch (speakerp->mType)
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ namespace FSPerfStats
|
|||
U32 lastGlobalPrefChange{0};
|
||||
std::mutex bufferToggleLock{};
|
||||
|
||||
F64 cpu_hertz{0.0};
|
||||
|
||||
Tunables tunables;
|
||||
|
||||
std::atomic<int> StatsRecorder::writeBuffer{0};
|
||||
|
|
@ -136,6 +138,8 @@ namespace FSPerfStats
|
|||
// create a queue
|
||||
// create a thread to consume from the queue
|
||||
tunables.initialiseFromSettings();
|
||||
FSPerfStats::cpu_hertz = (F64)LLTrace::BlockTimer::countsPerSecond();
|
||||
|
||||
t.detach();
|
||||
}
|
||||
|
||||
|
|
@ -342,7 +346,7 @@ namespace FSPerfStats
|
|||
}
|
||||
|
||||
// The frametime budget we have based on the target FPS selected
|
||||
auto target_frame_time_raw = (U64)llround((F64)LLTrace::BlockTimer::countsPerSecond()/(tunables.userTargetFPS==0?1:tunables.userTargetFPS));
|
||||
auto target_frame_time_raw = (U64)llround(FSPerfStats::cpu_hertz/(tunables.userTargetFPS==0?1:tunables.userTargetFPS));
|
||||
// LL_INFOS() << "Effective FPS(raw):" << tot_frame_time_raw << " Target:" << target_frame_time_raw << LL_ENDL;
|
||||
auto inferredFPS{1000/(U32)std::max(raw_to_ms(tot_frame_time_raw),1.0)};
|
||||
U32 settingsChangeFrequency{inferredFPS > 25?inferredFPS:25};
|
||||
|
|
|
|||
|
|
@ -76,6 +76,8 @@ namespace FSPerfStats
|
|||
static constexpr U32 TUNE_AVATARS_ONLY{0};
|
||||
static constexpr U32 TUNE_SCENE_AND_AVATARS{1};
|
||||
|
||||
extern F64 cpu_hertz;
|
||||
|
||||
extern std::atomic<int64_t> tunedAvatars;
|
||||
extern std::atomic<U64> renderAvatarMaxART_ns;
|
||||
extern bool belowTargetFPS;
|
||||
|
|
@ -491,9 +493,9 @@ namespace FSPerfStats
|
|||
};
|
||||
|
||||
|
||||
inline double raw_to_ns(U64 raw) { return (static_cast<double>(raw) * 1000000000.0) / (F64)LLTrace::BlockTimer::countsPerSecond(); };
|
||||
inline double raw_to_us(U64 raw) { return (static_cast<double>(raw) * 1000000.0) / (F64)LLTrace::BlockTimer::countsPerSecond(); };
|
||||
inline double raw_to_ms(U64 raw) { return (static_cast<double>(raw) * 1000.0) / (F64)LLTrace::BlockTimer::countsPerSecond(); };
|
||||
inline double raw_to_ns(U64 raw) { return (static_cast<double>(raw) * 1000000000.0) / FSPerfStats::cpu_hertz; };
|
||||
inline double raw_to_us(U64 raw) { return (static_cast<double>(raw) * 1000000.0) / FSPerfStats::cpu_hertz; };
|
||||
inline double raw_to_ms(U64 raw) { return (static_cast<double>(raw) * 1000.0) / FSPerfStats::cpu_hertz; };
|
||||
|
||||
using RecordSceneTime = RecordTime<ObjType_t::OT_GENERAL>;
|
||||
using RecordAvatarTime = RecordTime<ObjType_t::OT_AVATAR>;
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ std::string LGGContactSets::getDefaultFilename()
|
|||
return path;
|
||||
}
|
||||
|
||||
LLSD LGGContactSets::exportContactSet(const std::string& set_name)
|
||||
LLSD LGGContactSets::exportContactSet(std::string_view set_name)
|
||||
{
|
||||
LLSD ret;
|
||||
|
||||
|
|
@ -113,9 +113,9 @@ LLSD LGGContactSets::exportContactSet(const std::string& set_name)
|
|||
ret["groupname"] = set->mName;
|
||||
ret["color"] = set->mColor.getValue();
|
||||
ret["notices"] = set->mNotify;
|
||||
for (uuid_set_t::iterator friend_itr = set->mFriends.begin(); friend_itr != set->mFriends.end(); ++friend_itr)
|
||||
for (const auto& friend_id : set->mFriends)
|
||||
{
|
||||
ret["friends"][(*friend_itr).asString()] = "";
|
||||
ret["friends"][friend_id.asString()] = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -176,12 +176,12 @@ void LGGContactSets::saveToDisk()
|
|||
file.close();
|
||||
}
|
||||
|
||||
bool LGGContactSets::saveContactSetToDisk(const std::string& set_name, const std::string& filename)
|
||||
bool LGGContactSets::saveContactSetToDisk(std::string_view set_name, std::string_view filename)
|
||||
{
|
||||
if (isValidSet(set_name))
|
||||
{
|
||||
llofstream file;
|
||||
file.open(filename.c_str());
|
||||
file.open(filename.data());
|
||||
LLSDSerialize::toPrettyXML(exportContactSet(set_name), file);
|
||||
file.close();
|
||||
return true;
|
||||
|
|
@ -300,7 +300,7 @@ void LGGContactSets::importFromLLSD(const LLSD& data)
|
|||
}
|
||||
}
|
||||
|
||||
LLColor4 LGGContactSets::getSetColor(const std::string& set_name)
|
||||
LLColor4 LGGContactSets::getSetColor(std::string_view set_name)
|
||||
{
|
||||
ContactSet* set = getContactSet(set_name);
|
||||
if (set)
|
||||
|
|
@ -318,7 +318,7 @@ LLColor4 LGGContactSets::colorize(const LLUUID& uuid, const LLColor4& cur_color,
|
|||
bool rlv_shownames = !RlvActions::canShowName(RlvActions::SNC_DEFAULT, uuid);
|
||||
LLColor4 color = cur_color;
|
||||
|
||||
if (uuid == gAgent.getID())
|
||||
if (uuid == gAgentID)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
|
|
@ -338,7 +338,7 @@ LLColor4 LGGContactSets::colorize(const LLUUID& uuid, const LLColor4& cur_color,
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL)
|
||||
else if (LLAvatarTracker::instance().getBuddyInfo(uuid))
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
|
|
@ -452,7 +452,7 @@ LLColor4 LGGContactSets::colorize(const LLUUID& uuid, const LLColor4& cur_color,
|
|||
return color;
|
||||
}
|
||||
|
||||
LLColor4 LGGContactSets::getFriendColor(const LLUUID& friend_id, const std::string& ignored_set_name)
|
||||
LLColor4 LGGContactSets::getFriendColor(const LLUUID& friend_id, std::string_view ignored_set_name)
|
||||
{
|
||||
LLColor4 color = getDefaultColor();
|
||||
if (ignored_set_name == CS_SET_NO_SETS)
|
||||
|
|
@ -462,9 +462,8 @@ LLColor4 LGGContactSets::getFriendColor(const LLUUID& friend_id, const std::stri
|
|||
|
||||
U32 lowest = U32_MAX;
|
||||
string_vec_t contact_sets = getFriendSets(friend_id);
|
||||
for (string_vec_t::iterator it = contact_sets.begin(); it != contact_sets.end(); ++it)
|
||||
for (const auto& set_name : contact_sets)
|
||||
{
|
||||
std::string set_name = *it;
|
||||
if (set_name != ignored_set_name)
|
||||
{
|
||||
U32 set_size = (U32)getFriendsInSet(set_name).size();
|
||||
|
|
@ -489,7 +488,7 @@ LLColor4 LGGContactSets::getFriendColor(const LLUUID& friend_id, const std::stri
|
|||
{
|
||||
if (isFriendInSet(friend_id, ignored_set_name) && !isInternalSetName(ignored_set_name))
|
||||
{
|
||||
return mContactSets[ignored_set_name]->mColor;
|
||||
return mContactSets[ignored_set_name.data()]->mColor;
|
||||
}
|
||||
}
|
||||
return color;
|
||||
|
|
@ -555,21 +554,20 @@ bool LGGContactSets::hasFriendColorThatShouldShow(const LLUUID& friend_id, ELGGC
|
|||
|
||||
string_vec_t LGGContactSets::getFriendSets(const LLUUID& friend_id)
|
||||
{
|
||||
string_vec_t sets;
|
||||
string_vec_t sets{};
|
||||
|
||||
contact_set_map_t::iterator set_itr_end = mContactSets.end();
|
||||
for (contact_set_map_t::iterator itr = mContactSets.begin(); itr != set_itr_end; ++itr)
|
||||
for (const auto& [set_name, set] : mContactSets)
|
||||
{
|
||||
ContactSet* set = itr->second;
|
||||
if (set->hasFriend(friend_id))
|
||||
{
|
||||
sets.push_back(set->mName);
|
||||
sets.emplace_back(set->mName);
|
||||
}
|
||||
}
|
||||
return sets;
|
||||
}
|
||||
|
||||
uuid_vec_t LGGContactSets::getFriendsInSet(const std::string& set_name)
|
||||
uuid_vec_t LGGContactSets::getFriendsInSet(std::string_view set_name)
|
||||
{
|
||||
uuid_vec_t friends;
|
||||
|
||||
|
|
@ -593,9 +591,9 @@ uuid_vec_t LGGContactSets::getFriendsInSet(const std::string& set_name)
|
|||
ContactSet* set = getContactSet(set_name);
|
||||
if (set)
|
||||
{
|
||||
for (uuid_set_t::iterator itr = set->mFriends.begin(); itr != set->mFriends.end(); ++itr)
|
||||
for (const auto& id : set->mFriends)
|
||||
{
|
||||
friends.push_back(*itr);
|
||||
friends.emplace_back(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -604,11 +602,11 @@ uuid_vec_t LGGContactSets::getFriendsInSet(const std::string& set_name)
|
|||
|
||||
string_vec_t LGGContactSets::getAllContactSets()
|
||||
{
|
||||
string_vec_t sets;
|
||||
string_vec_t sets{};
|
||||
|
||||
for (contact_set_map_t::iterator itr = mContactSets.begin(); itr != mContactSets.end(); ++itr)
|
||||
for (const auto& [set_name, set] : mContactSets)
|
||||
{
|
||||
sets.push_back(itr->second->mName);
|
||||
sets.push_back(set->mName);
|
||||
}
|
||||
|
||||
return sets;
|
||||
|
|
@ -616,11 +614,10 @@ string_vec_t LGGContactSets::getAllContactSets()
|
|||
|
||||
uuid_vec_t LGGContactSets::getFriendsInAnySet()
|
||||
{
|
||||
std::set<LLUUID> friendsInAnySet;
|
||||
uuid_set_t friendsInAnySet{};
|
||||
|
||||
for (contact_set_map_t::iterator set_itr = mContactSets.begin(); set_itr != mContactSets.end(); ++set_itr)
|
||||
for (const auto& [set_name, set] : mContactSets)
|
||||
{
|
||||
ContactSet* set = set_itr->second;
|
||||
for (uuid_set_t::iterator itr = set->mFriends.begin(); itr != set->mFriends.end(); ++itr)
|
||||
{
|
||||
friendsInAnySet.insert(*itr);
|
||||
|
|
@ -632,9 +629,8 @@ uuid_vec_t LGGContactSets::getFriendsInAnySet()
|
|||
|
||||
bool LGGContactSets::isFriendInSet(const LLUUID& friend_id)
|
||||
{
|
||||
for (contact_set_map_t::iterator itr = mContactSets.begin(); itr != mContactSets.end(); ++itr)
|
||||
for (const auto& [set_name, set] : mContactSets)
|
||||
{
|
||||
ContactSet* set = itr->second;
|
||||
if (set->hasFriend(friend_id))
|
||||
{
|
||||
return true;
|
||||
|
|
@ -644,7 +640,7 @@ bool LGGContactSets::isFriendInSet(const LLUUID& friend_id)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool LGGContactSets::isFriendInSet(const LLUUID& friend_id, const std::string& set_name)
|
||||
bool LGGContactSets::isFriendInSet(const LLUUID& friend_id, std::string_view set_name)
|
||||
{
|
||||
if (set_name == CS_SET_ALL_SETS)
|
||||
{
|
||||
|
|
@ -678,9 +674,9 @@ bool LGGContactSets::isFriendInSet(const LLUUID& friend_id, const std::string& s
|
|||
bool LGGContactSets::notifyForFriend(const LLUUID& friend_id)
|
||||
{
|
||||
string_vec_t sets = getFriendSets(friend_id);
|
||||
for (string_vec_t::const_iterator itr = sets.begin(); itr != sets.end(); ++itr)
|
||||
for (const auto& set_name : sets)
|
||||
{
|
||||
if (mContactSets[*itr]->mNotify)
|
||||
if (mContactSets[set_name]->mNotify)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
@ -688,7 +684,7 @@ bool LGGContactSets::notifyForFriend(const LLUUID& friend_id)
|
|||
return false;
|
||||
}
|
||||
|
||||
void LGGContactSets::addToSet(const uuid_vec_t& avatar_ids, const std::string& set_name)
|
||||
void LGGContactSets::addToSet(const uuid_vec_t& avatar_ids, std::string_view set_name)
|
||||
{
|
||||
LLAvatarTracker& tracker = LLAvatarTracker::instance();
|
||||
|
||||
|
|
@ -701,7 +697,7 @@ void LGGContactSets::addToSet(const uuid_vec_t& avatar_ids, const std::string& s
|
|||
|
||||
if (isValidSet(set_name))
|
||||
{
|
||||
mContactSets[set_name]->mFriends.insert(avatar_id);
|
||||
mContactSets[set_name.data()]->mFriends.insert(avatar_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -734,9 +730,9 @@ void LGGContactSets::removeNonFriendFromList(const LLUUID& non_friend_id, bool s
|
|||
void LGGContactSets::removeFriendFromAllSets(const LLUUID& friend_id, bool save_changes /*= true*/)
|
||||
{
|
||||
string_vec_t sets = getFriendSets(friend_id);
|
||||
for (string_vec_t::const_iterator itr = sets.begin(); itr != sets.end(); ++itr)
|
||||
for (const auto& set_name : sets)
|
||||
{
|
||||
removeFriendFromSet(friend_id, (*itr), save_changes);
|
||||
removeFriendFromSet(friend_id, set_name, save_changes);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -753,13 +749,13 @@ bool LGGContactSets::isNonFriend(const LLUUID& non_friend_id)
|
|||
uuid_vec_t LGGContactSets::getListOfNonFriends()
|
||||
{
|
||||
LLAvatarTracker& tracker = LLAvatarTracker::instance();
|
||||
uuid_vec_t nonfriends;
|
||||
uuid_vec_t nonfriends{};
|
||||
|
||||
for (const auto& friend_id : mExtraAvatars)
|
||||
{
|
||||
if (!tracker.isBuddy(friend_id))
|
||||
{
|
||||
nonfriends.push_back(friend_id);
|
||||
nonfriends.emplace_back(friend_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -768,17 +764,17 @@ uuid_vec_t LGGContactSets::getListOfNonFriends()
|
|||
|
||||
uuid_vec_t LGGContactSets::getListOfPseudonymAvs()
|
||||
{
|
||||
uuid_vec_t pseudonyms;
|
||||
uuid_vec_t pseudonyms{};
|
||||
|
||||
for (uuid_map_t::iterator itr = mPseudonyms.begin(); itr != mPseudonyms.end(); ++itr)
|
||||
for (const auto& [id, pseudonym] : mPseudonyms)
|
||||
{
|
||||
pseudonyms.push_back(itr->first);
|
||||
pseudonyms.emplace_back(pseudonym);
|
||||
}
|
||||
|
||||
return pseudonyms;
|
||||
}
|
||||
|
||||
void LGGContactSets::setPseudonym(const LLUUID& friend_id, const std::string& pseudonym)
|
||||
void LGGContactSets::setPseudonym(const LLUUID& friend_id, std::string_view pseudonym)
|
||||
{
|
||||
LLAvatarNameCache* inst = LLAvatarNameCache::getInstance();
|
||||
mPseudonyms[friend_id] = pseudonym;
|
||||
|
|
@ -863,9 +859,9 @@ bool LGGContactSets::hasPseudonym(const LLUUID& friend_id)
|
|||
bool LGGContactSets::hasPseudonym(uuid_vec_t ids)
|
||||
{
|
||||
bool has_pseudonym = false;
|
||||
for (uuid_vec_t::const_iterator id = ids.begin(); id != ids.end(); ++id)
|
||||
for (const auto& id : ids)
|
||||
{
|
||||
if (hasPseudonym(*id))
|
||||
if (hasPseudonym(id))
|
||||
{
|
||||
has_pseudonym = true;
|
||||
break;
|
||||
|
|
@ -882,9 +878,9 @@ bool LGGContactSets::hasDisplayNameRemoved(const LLUUID& friend_id)
|
|||
bool LGGContactSets::hasDisplayNameRemoved(uuid_vec_t ids)
|
||||
{
|
||||
bool has_pseudonym = false;
|
||||
for (uuid_vec_t::const_iterator id = ids.begin(); id != ids.end(); ++id)
|
||||
for (const auto& id : ids)
|
||||
{
|
||||
if (hasDisplayNameRemoved(*id))
|
||||
if (hasDisplayNameRemoved(id))
|
||||
{
|
||||
has_pseudonym = true;
|
||||
break;
|
||||
|
|
@ -903,7 +899,7 @@ void LGGContactSets::removeDisplayName(const LLUUID& friend_id)
|
|||
setPseudonym(friend_id, CS_PSEUDONYM);
|
||||
}
|
||||
|
||||
void LGGContactSets::removeFriendFromSet(const LLUUID& friend_id, const std::string& set_name, bool save_changes /*= true*/)
|
||||
void LGGContactSets::removeFriendFromSet(const LLUUID& friend_id, std::string_view set_name, bool save_changes /*= true*/)
|
||||
{
|
||||
if (set_name == CS_SET_EXTRA_AVS)
|
||||
{
|
||||
|
|
@ -926,12 +922,12 @@ void LGGContactSets::removeFriendFromSet(const LLUUID& friend_id, const std::str
|
|||
}
|
||||
}
|
||||
|
||||
bool LGGContactSets::isValidSet(const std::string& set_name)
|
||||
bool LGGContactSets::isValidSet(std::string_view set_name)
|
||||
{
|
||||
return (mContactSets.find(set_name) != mContactSets.end());
|
||||
return (mContactSets.find(set_name.data()) != mContactSets.end());
|
||||
}
|
||||
|
||||
void LGGContactSets::addSet(const std::string& set_name)
|
||||
void LGGContactSets::addSet(std::string_view set_name)
|
||||
{
|
||||
if (!isInternalSetName(set_name) && !isValidSet(set_name))
|
||||
{
|
||||
|
|
@ -939,21 +935,21 @@ void LGGContactSets::addSet(const std::string& set_name)
|
|||
set->mName = set_name;
|
||||
set->mColor = LLColor4::red;
|
||||
set->mNotify = false;
|
||||
mContactSets[set_name] = set;
|
||||
mContactSets[set_name.data()] = set;
|
||||
saveToDisk();
|
||||
mChangedSignal(UPDATED_LISTS);
|
||||
}
|
||||
}
|
||||
|
||||
bool LGGContactSets::renameSet(const std::string& set_name, const std::string& new_set_name)
|
||||
bool LGGContactSets::renameSet(std::string_view set_name, std::string_view new_set_name)
|
||||
{
|
||||
if (!isInternalSetName(set_name) && isValidSet(set_name) &&
|
||||
!isInternalSetName(new_set_name) && !isValidSet(new_set_name))
|
||||
{
|
||||
ContactSet* set = getContactSet(set_name);
|
||||
set->mName = new_set_name;
|
||||
mContactSets.erase(set_name);
|
||||
mContactSets[new_set_name] = set;
|
||||
mContactSets.erase(set_name.data());
|
||||
mContactSets[new_set_name.data()] = set;
|
||||
saveToDisk();
|
||||
mChangedSignal(UPDATED_LISTS);
|
||||
return true;
|
||||
|
|
@ -961,27 +957,27 @@ bool LGGContactSets::renameSet(const std::string& set_name, const std::string& n
|
|||
return false;
|
||||
}
|
||||
|
||||
void LGGContactSets::removeSet(const std::string& set_name)
|
||||
void LGGContactSets::removeSet(std::string_view set_name)
|
||||
{
|
||||
contact_set_map_t::iterator found = mContactSets.find(set_name);
|
||||
contact_set_map_t::iterator found = mContactSets.find(set_name.data());
|
||||
if (found != mContactSets.end())
|
||||
{
|
||||
LLAvatarTracker& tracker = LLAvatarTracker::instance();
|
||||
uuid_vec_t non_friends_for_removal;
|
||||
ContactSet* cset = found->second;
|
||||
for (uuid_set_t::iterator member_it = cset->mFriends.begin(); member_it != cset->mFriends.end(); ++member_it)
|
||||
for (const auto& friend_id : cset->mFriends)
|
||||
{
|
||||
if (!tracker.isBuddy(*member_it) &&
|
||||
getFriendSets(*member_it).size() == 1 && // Current set is only set!
|
||||
!hasPseudonym(*member_it))
|
||||
if (!tracker.isBuddy(friend_id) &&
|
||||
getFriendSets(friend_id).size() == 1 && // Current set is only set!
|
||||
!hasPseudonym(friend_id))
|
||||
{
|
||||
non_friends_for_removal.push_back(*member_it);
|
||||
non_friends_for_removal.emplace_back(friend_id);
|
||||
}
|
||||
}
|
||||
|
||||
for (uuid_vec_t::iterator nf_it = non_friends_for_removal.begin(); nf_it != non_friends_for_removal.end(); ++nf_it)
|
||||
for (const auto& non_friend_id : non_friends_for_removal)
|
||||
{
|
||||
removeNonFriendFromList(*nf_it, false);
|
||||
removeNonFriendFromList(non_friend_id, false);
|
||||
}
|
||||
|
||||
delete found->second;
|
||||
|
|
@ -991,7 +987,7 @@ void LGGContactSets::removeSet(const std::string& set_name)
|
|||
}
|
||||
}
|
||||
|
||||
void LGGContactSets::setNotifyForSet(const std::string& set_name, bool notify)
|
||||
void LGGContactSets::setNotifyForSet(std::string_view set_name, bool notify)
|
||||
{
|
||||
ContactSet* set = getContactSet(set_name);
|
||||
if (set)
|
||||
|
|
@ -1001,7 +997,7 @@ void LGGContactSets::setNotifyForSet(const std::string& set_name, bool notify)
|
|||
}
|
||||
}
|
||||
|
||||
bool LGGContactSets::getNotifyForSet(const std::string& set_name)
|
||||
bool LGGContactSets::getNotifyForSet(std::string_view set_name)
|
||||
{
|
||||
ContactSet* set = getContactSet(set_name);
|
||||
if (set)
|
||||
|
|
@ -1011,7 +1007,7 @@ bool LGGContactSets::getNotifyForSet(const std::string& set_name)
|
|||
return false;
|
||||
}
|
||||
|
||||
void LGGContactSets::setSetColor(const std::string& set_name, const LLColor4& color)
|
||||
void LGGContactSets::setSetColor(std::string_view set_name, const LLColor4& color)
|
||||
{
|
||||
ContactSet* set = getContactSet(set_name);
|
||||
if (set)
|
||||
|
|
@ -1021,7 +1017,7 @@ void LGGContactSets::setSetColor(const std::string& set_name, const LLColor4& co
|
|||
}
|
||||
}
|
||||
|
||||
bool LGGContactSets::isInternalSetName(const std::string& set_name)
|
||||
bool LGGContactSets::isInternalSetName(std::string_view set_name)
|
||||
{
|
||||
return (set_name.empty() ||
|
||||
set_name == CS_SET_EXTRA_AVS ||
|
||||
|
|
@ -1031,21 +1027,21 @@ bool LGGContactSets::isInternalSetName(const std::string& set_name)
|
|||
set_name == CS_GLOBAL_SETTINGS);
|
||||
}
|
||||
|
||||
LGGContactSets::ContactSet* LGGContactSets::getContactSet(const std::string& set_name)
|
||||
LGGContactSets::ContactSet* LGGContactSets::getContactSet(std::string_view set_name)
|
||||
{
|
||||
if (set_name.empty())
|
||||
{
|
||||
LL_WARNS("ContactSets") << "No contact set specified" << LL_ENDL;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
contact_set_map_t::iterator found = mContactSets.find(set_name);
|
||||
contact_set_map_t::iterator found = mContactSets.find(set_name.data());
|
||||
if (found != mContactSets.end())
|
||||
{
|
||||
return found->second;
|
||||
}
|
||||
LL_WARNS("ContactSets") << "No contact set named " << set_name << LL_ENDL;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool LGGContactSets::checkCustomName(const LLUUID& id, bool& dn_removed, std::string& pseudonym)
|
||||
|
|
@ -1097,7 +1093,7 @@ bool LGGContactSets::handleRemoveAvatarFromSetCallback(const LLSD& notification,
|
|||
instance.removeFriendFromSet(id, set_name, false);
|
||||
|
||||
if (!tracker.isBuddy(id) &&
|
||||
instance.getFriendSets(id).size() == 0 &&
|
||||
instance.getFriendSets(id).empty() &&
|
||||
!instance.hasPseudonym(id))
|
||||
{
|
||||
instance.removeNonFriendFromList(id, false);
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@ public:
|
|||
|
||||
void loadFromDisk();
|
||||
|
||||
void setSetColor(const std::string& set_name, const LLColor4& color);
|
||||
LLColor4 getSetColor(const std::string& set_name);
|
||||
LLColor4 getFriendColor(const LLUUID& friend_id, const std::string& ignored_set_name = "");
|
||||
void setSetColor(std::string_view set_name, const LLColor4& color);
|
||||
LLColor4 getSetColor(std::string_view set_name);
|
||||
LLColor4 getFriendColor(const LLUUID& friend_id, std::string_view ignored_set_name = "");
|
||||
LLColor4 colorize(const LLUUID& uuid, const LLColor4& cur_color, ELGGCSType type);
|
||||
|
||||
void setDefaultColor(const LLColor4& default_color) { mDefaultColor = default_color; };
|
||||
|
|
@ -77,17 +77,17 @@ public:
|
|||
string_vec_t getFriendSets(const LLUUID& friend_id);
|
||||
string_vec_t getAllContactSets();
|
||||
|
||||
void addToSet(const uuid_vec_t&, const std::string& set_name);
|
||||
void removeFriendFromSet(const LLUUID& friend_id, const std::string& set_name, bool save_changes = true);
|
||||
void addToSet(const uuid_vec_t&, std::string_view set_name);
|
||||
void removeFriendFromSet(const LLUUID& friend_id, std::string_view set_name, bool save_changes = true);
|
||||
void removeFriendFromAllSets(const LLUUID& friend_id, bool save_changes = true);
|
||||
bool isFriendInSet(const LLUUID& friend_id, const std::string& set_name);
|
||||
bool isFriendInSet(const LLUUID& friend_id, std::string_view set_name);
|
||||
bool hasFriendColorThatShouldShow(const LLUUID& friend_id, ELGGCSType type);
|
||||
bool hasFriendColorThatShouldShow(const LLUUID& friend_id, ELGGCSType type, LLColor4& color);
|
||||
|
||||
void addSet(const std::string& set_name);
|
||||
bool renameSet(const std::string& set_name, const std::string& new_set_name);
|
||||
void removeSet(const std::string& set_name);
|
||||
bool isValidSet(const std::string& set_name);
|
||||
void addSet(std::string_view set_name);
|
||||
bool renameSet(std::string_view set_name, std::string_view new_set_name);
|
||||
void removeSet(std::string_view set_name);
|
||||
bool isValidSet(std::string_view set_name);
|
||||
|
||||
void removeNonFriendFromList(const LLUUID& non_friend_id, bool save_changes = true);
|
||||
bool isNonFriend(const LLUUID& non_friend_id);
|
||||
|
|
@ -96,12 +96,12 @@ public:
|
|||
uuid_vec_t getListOfPseudonymAvs();
|
||||
|
||||
bool notifyForFriend(const LLUUID& friend_id);
|
||||
void setNotifyForSet(const std::string& set_name, bool notify);
|
||||
bool getNotifyForSet(const std::string& set_name);
|
||||
void setNotifyForSet(std::string_view set_name, bool notify);
|
||||
bool getNotifyForSet(std::string_view set_name);
|
||||
|
||||
bool callbackAliasReset(const LLSD& notification, const LLSD& response);
|
||||
|
||||
bool isInternalSetName(const std::string& set_name);
|
||||
bool isInternalSetName(std::string_view set_name);
|
||||
bool hasSets() { return !mContactSets.empty(); }
|
||||
|
||||
class ContactSet
|
||||
|
|
@ -117,7 +117,7 @@ public:
|
|||
bool mNotify;
|
||||
LLColor4 mColor;
|
||||
};
|
||||
ContactSet* getContactSet(const std::string& set_name);
|
||||
ContactSet* getContactSet(std::string_view set_name);
|
||||
|
||||
// [FS:CR] Signals for updating the various UI
|
||||
typedef enum e_contact_set_update {
|
||||
|
|
@ -140,14 +140,14 @@ public:
|
|||
|
||||
private:
|
||||
void toneDownColor(LLColor4& color) const;
|
||||
uuid_vec_t getFriendsInSet(const std::string& set_name);
|
||||
uuid_vec_t getFriendsInSet(std::string_view set_name);
|
||||
uuid_vec_t getFriendsInAnySet();
|
||||
|
||||
void setPseudonym(const LLUUID& friend_id, const std::string& pseudonym);
|
||||
void setPseudonym(const LLUUID& friend_id, std::string_view pseudonym);
|
||||
bool hasVisuallyDifferentPseudonym(const LLUUID& friend_id);
|
||||
|
||||
LLSD exportContactSet(const std::string& set_name);
|
||||
bool saveContactSetToDisk(const std::string& set_name, const std::string& filename);
|
||||
LLSD exportContactSet(std::string_view set_name);
|
||||
bool saveContactSetToDisk(std::string_view set_name, std::string_view filename);
|
||||
|
||||
std::string getFilename();
|
||||
std::string getDefaultFilename();
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ if [ ! -z "$XBROWSER" ]; then
|
|||
echo "$0: Trying some others..."
|
||||
fi
|
||||
|
||||
# Launcher the default GNOME browser.
|
||||
# Launch the default GNOME browser.
|
||||
if [ ! -z "$GNOME_DESKTOP_SESSION_ID" ] && which gnome-open >/dev/null; then
|
||||
gnome-open "$URL" &
|
||||
exit
|
||||
|
|
@ -60,6 +60,7 @@ fi
|
|||
# List of browser commands that will be tried in the order listed. x-www-browser
|
||||
# will be tried first, which is a debian alternative.
|
||||
BROWSER_COMMANDS=" \
|
||||
xdg-open \
|
||||
x-www-browser \
|
||||
firefox \
|
||||
mozilla-firefox \
|
||||
|
|
|
|||
|
|
@ -832,6 +832,9 @@ void LLAgent::moveYaw(F32 mag, bool reset_view)
|
|||
U32 mask = AGENT_CONTROL_YAW_POS | AGENT_CONTROL_YAW_NEG;
|
||||
if ((getControlFlags() & mask) == mask)
|
||||
{
|
||||
// Rotation into both directions should cancel out
|
||||
// But keep sending controls to simulator,
|
||||
// it's needed for script based controls
|
||||
gAgentCamera.setYawKey(0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,10 +74,10 @@ public:
|
|||
|
||||
void decrementNumberOfPicks() { --mNumberOfPicks; }
|
||||
|
||||
private:
|
||||
|
||||
void onServerRespond(LLAvatarPicks* picks);
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* Sets number of Picks.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ private:
|
|||
|
||||
LLUUID mCOFImageID;
|
||||
|
||||
std::auto_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
|
||||
std::unique_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
|
||||
|
||||
// Set of temp attachment UUIDs that should be removed
|
||||
typedef std::set<LLUUID> doomed_temp_attachments_t;
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
#include "llfloatergroups.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "llfloaterpay.h"
|
||||
#include "llfloaterprofile.h"
|
||||
#include "llfloatersidepanelcontainer.h"
|
||||
#include "llfloaterwebcontent.h"
|
||||
#include "llfloaterworldmap.h"
|
||||
|
|
@ -62,11 +63,14 @@
|
|||
#include "llnotificationsutil.h" // for LLNotificationsUtil
|
||||
#include "llpaneloutfitedit.h"
|
||||
#include "llpanelprofile.h"
|
||||
#include "llparcel.h"
|
||||
#include "llrecentpeople.h"
|
||||
#include "lltrans.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewerobjectlist.h"
|
||||
#include "llviewermessage.h" // for handle_lure
|
||||
#include "llviewernetwork.h" //LLGridManager
|
||||
#include "llviewerparcelmgr.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "lltrans.h"
|
||||
#include "llcallingcard.h"
|
||||
|
|
@ -83,10 +87,10 @@
|
|||
// Firestorm includes
|
||||
#include "fsfloaterim.h"
|
||||
#include "fsfloaterimcontainer.h"
|
||||
#include "fsfloaterprofile.h"
|
||||
#include "fslslbridge.h"
|
||||
#include "fsradar.h"
|
||||
#include "fsassetblacklist.h"
|
||||
#include "llagentpicksinfo.cpp"
|
||||
#include "llfloaterregioninfo.h"
|
||||
#include "llfloaterreporter.h"
|
||||
#include "llparcel.h"
|
||||
|
|
@ -103,6 +107,48 @@ const U32 KICK_FLAGS_FREEZE = 1 << 0;
|
|||
const U32 KICK_FLAGS_UNFREEZE = 1 << 1;
|
||||
|
||||
|
||||
std::string getProfileURL(const std::string& agent_name, bool feed_only)
|
||||
{
|
||||
// <FS:Ansariel> OpenSim support
|
||||
//std::string url = "[WEB_PROFILE_URL][AGENT_NAME][FEED_ONLY]";
|
||||
//LLSD subs;
|
||||
//subs["WEB_PROFILE_URL"] = LLGridManager::getInstance()->getWebProfileURL();
|
||||
//subs["AGENT_NAME"] = agent_name;
|
||||
//subs["FEED_ONLY"] = feed_only ? "/?feed_only=true" : "";
|
||||
std::string url;
|
||||
LLSD subs;
|
||||
|
||||
#ifdef OPENSIM
|
||||
if (LLGridManager::instance().isInOpenSim())
|
||||
{
|
||||
url = LLGridManager::getInstance()->getWebProfileURL();
|
||||
if (url.empty())
|
||||
{
|
||||
return LLStringUtil::null;
|
||||
}
|
||||
|
||||
std::string match = "?name=[AGENT_NAME]";
|
||||
if (url.find(match) == std::string::npos)
|
||||
{
|
||||
url += match;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
url = "[WEB_PROFILE_URL][AGENT_NAME][FEED_ONLY]";
|
||||
subs["FEED_ONLY"] = feed_only ? "/?feed_only=true" : "";
|
||||
subs["WEB_PROFILE_URL"] = LLGridManager::getInstance()->getWebProfileURL();
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
subs["AGENT_NAME"] = agent_name;
|
||||
url = LLWeb::expandURLSubstitutions(url, subs);
|
||||
LLStringUtil::toLower(url);
|
||||
return url;
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name)
|
||||
{
|
||||
|
|
@ -420,94 +466,152 @@ const LLUUID LLAvatarActions::startConference(const uuid_vec_t& ids, const LLUUI
|
|||
return session_id;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
std::string url = getProfileURL(av_name.getAccountName());
|
||||
|
||||
// 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)
|
||||
void LLAvatarActions::showProfile(const LLUUID& avatar_id)
|
||||
{
|
||||
if (id.notNull())
|
||||
if (avatar_id.notNull())
|
||||
{
|
||||
//<FS:KC legacy profiles>
|
||||
// LLAvatarNameCache::get(id, boost::bind(&on_avatar_name_show_profile, _1, _2));
|
||||
if (gSavedSettings.getBOOL("FSUseWebProfiles"))
|
||||
{
|
||||
showProfileWeb(id);
|
||||
}
|
||||
else
|
||||
{
|
||||
showProfileLegacy(id);
|
||||
}
|
||||
//</FS:KC legacy profiles>
|
||||
LLFloaterReg::showInstance("profile", LLSD().with("id", avatar_id));
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLAvatarActions::showPicks(const LLUUID& avatar_id)
|
||||
{
|
||||
if (avatar_id.notNull())
|
||||
{
|
||||
LLFloaterProfile* profilefloater = dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", avatar_id)));
|
||||
if (profilefloater)
|
||||
{
|
||||
profilefloater->showPick();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLAvatarActions::showPick(const LLUUID& avatar_id, const LLUUID& pick_id)
|
||||
{
|
||||
if (avatar_id.notNull())
|
||||
{
|
||||
LLFloaterProfile* profilefloater = dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", avatar_id)));
|
||||
if (profilefloater)
|
||||
{
|
||||
profilefloater->showPick(pick_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLAvatarActions::createPick()
|
||||
{
|
||||
// <FS:Ansariel> FIRE-7694 / BUG-932 / MAINT-1999
|
||||
if (LLAgentPicksInfo::getInstance()->isPickLimitReached())
|
||||
{
|
||||
LLNotificationsUtil::add("PickLimitReached");
|
||||
return;
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
LLFloaterProfile* profilefloater = dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", gAgent.getID())));
|
||||
LLViewerRegion* region = gAgent.getRegion();
|
||||
if (profilefloater && region)
|
||||
{
|
||||
LLPickData data;
|
||||
data.pos_global = gAgent.getPositionGlobal();
|
||||
data.sim_name = region->getName();
|
||||
|
||||
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
|
||||
if (parcel)
|
||||
{
|
||||
data.name = parcel->getName();
|
||||
data.desc = parcel->getDesc();
|
||||
data.snapshot_id = parcel->getSnapshotID();
|
||||
data.parcel_id = parcel->getID();
|
||||
}
|
||||
else
|
||||
{
|
||||
data.name = region->getName();
|
||||
}
|
||||
|
||||
profilefloater->createPick(data);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLAvatarActions::isPickTabSelected(const LLUUID& avatar_id)
|
||||
{
|
||||
if (avatar_id.notNull())
|
||||
{
|
||||
LLFloaterProfile* profilefloater = LLFloaterReg::findTypedInstance<LLFloaterProfile>("profile", LLSD().with("id", avatar_id));
|
||||
if (profilefloater)
|
||||
{
|
||||
return profilefloater->isPickTabSelected();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// static
|
||||
void LLAvatarActions::showClassifieds(const LLUUID& avatar_id)
|
||||
{
|
||||
if (avatar_id.notNull())
|
||||
{
|
||||
LLFloaterProfile* profilefloater = dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", avatar_id)));
|
||||
if (profilefloater)
|
||||
{
|
||||
profilefloater->showClassified();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLAvatarActions::showClassified(const LLUUID& avatar_id, const LLUUID& classified_id, bool edit)
|
||||
{
|
||||
if (avatar_id.notNull())
|
||||
{
|
||||
LLFloaterProfile* profilefloater = dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", avatar_id)));
|
||||
if (profilefloater)
|
||||
{
|
||||
profilefloater->showClassified(classified_id, edit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLAvatarActions::createClassified()
|
||||
{
|
||||
LLFloaterProfile* profilefloater = dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", gAgent.getID())));
|
||||
if (profilefloater)
|
||||
{
|
||||
profilefloater->createClassified();
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
bool LLAvatarActions::profileVisible(const LLUUID& id)
|
||||
bool LLAvatarActions::profileVisible(const LLUUID& avatar_id)
|
||||
{
|
||||
LLSD sd;
|
||||
sd["id"] = id;
|
||||
LLFloater* browser = getProfileFloater(id);
|
||||
return browser && browser->isShown();
|
||||
sd["id"] = avatar_id;
|
||||
LLFloater* floater = getProfileFloater(avatar_id);
|
||||
return floater && floater->isShown();
|
||||
}
|
||||
|
||||
//static
|
||||
LLFloater* LLAvatarActions::getProfileFloater(const LLUUID& id)
|
||||
LLFloater* LLAvatarActions::getProfileFloater(const LLUUID& avatar_id)
|
||||
{
|
||||
//<FS:KC legacy profiles>
|
||||
if (!gSavedSettings.getBOOL("FSUseWebProfiles"))
|
||||
{
|
||||
FSFloaterProfile* browser = LLFloaterReg::findTypedInstance<FSFloaterProfile>("fs_floater_profile", LLSD().with("id", id));
|
||||
return browser;
|
||||
}
|
||||
//</FS:KC legacy profiles>
|
||||
LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*>
|
||||
(LLFloaterReg::findInstance(get_profile_floater_name(id), LLSD().with("id", id)));
|
||||
return browser;
|
||||
LLFloaterProfile* floater = LLFloaterReg::findTypedInstance<LLFloaterProfile>("profile", LLSD().with("id", avatar_id));
|
||||
return floater;
|
||||
}
|
||||
|
||||
//<FS:KC legacy profiles>
|
||||
// static
|
||||
void LLAvatarActions::showProfileWeb(const LLUUID& id)
|
||||
{
|
||||
if (id.notNull())
|
||||
{
|
||||
LLAvatarNameCache::get(id, boost::bind(&on_avatar_name_show_profile, _1, _2));
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLAvatarActions::showProfileLegacy(const LLUUID& id)
|
||||
{
|
||||
if (id.notNull())
|
||||
{
|
||||
LLFloaterReg::showInstance("fs_floater_profile", LLSD().with("id", id));
|
||||
}
|
||||
}
|
||||
//</FS:KC legacy profiles>
|
||||
|
||||
//static
|
||||
void LLAvatarActions::hideProfile(const LLUUID& id)
|
||||
void LLAvatarActions::hideProfile(const LLUUID& avatar_id)
|
||||
{
|
||||
LLSD sd;
|
||||
sd["id"] = id;
|
||||
LLFloater* browser = getProfileFloater(id);
|
||||
if (browser)
|
||||
sd["id"] = avatar_id;
|
||||
LLFloater* floater = getProfileFloater(avatar_id);
|
||||
if (floater)
|
||||
{
|
||||
browser->closeFloater();
|
||||
floater->closeFloater();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1235,7 +1339,7 @@ bool LLAvatarActions::canShareSelectedItems(LLInventoryPanel* inv_panel /* = NUL
|
|||
}
|
||||
|
||||
// static
|
||||
void LLAvatarActions::toggleBlock(const LLUUID& id)
|
||||
bool LLAvatarActions::toggleBlock(const LLUUID& id)
|
||||
{
|
||||
LLAvatarName av_name;
|
||||
LLAvatarNameCache::get(id, &av_name);
|
||||
|
|
@ -1245,10 +1349,12 @@ void LLAvatarActions::toggleBlock(const LLUUID& id)
|
|||
if (LLMuteList::getInstance()->isMuted(mute.mID, mute.mName))
|
||||
{
|
||||
LLMuteList::getInstance()->remove(mute);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
LLMuteList::getInstance()->add(mute);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ class LLInventoryPanel;
|
|||
class LLFloater;
|
||||
class LLView;
|
||||
|
||||
std::string getProfileURL(const std::string& agent_name, bool feed_only = false);
|
||||
|
||||
/**
|
||||
* Friend-related actions (add, remove, offer teleport, etc)
|
||||
*/
|
||||
|
|
@ -97,17 +99,20 @@ public:
|
|||
static const LLUUID startConference(const uuid_vec_t& ids, const LLUUID& floater_id = LLUUID::null);
|
||||
// </FS:Ansariel>
|
||||
|
||||
/**
|
||||
* 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);
|
||||
//<FS:KC legacy profiles>
|
||||
static void showProfileWeb(const LLUUID& id);
|
||||
static void showProfileLegacy(const LLUUID& id);
|
||||
//</FS:KC legacy profiles>
|
||||
/**
|
||||
* Show avatar profile.
|
||||
*/
|
||||
static void showProfile(const LLUUID& avatar_id);
|
||||
static void showPicks(const LLUUID& avatar_id);
|
||||
static void showPick(const LLUUID& avatar_id, const LLUUID& pick_id);
|
||||
static void createPick();
|
||||
static void showClassifieds(const LLUUID& avatar_id);
|
||||
static void showClassified(const LLUUID& avatar_id, const LLUUID& classified_id, bool edit = false);
|
||||
static void createClassified();
|
||||
static void hideProfile(const LLUUID& avatar_id);
|
||||
static bool profileVisible(const LLUUID& avatar_id);
|
||||
static bool isPickTabSelected(const LLUUID& avatar_id);
|
||||
static LLFloater* getProfileFloater(const LLUUID& avatar_id);
|
||||
|
||||
/**
|
||||
* Show avatar on world map.
|
||||
|
|
@ -136,9 +141,10 @@ public:
|
|||
static void shareWithAvatars(LLView * panel);
|
||||
|
||||
/**
|
||||
* Block/unblock the avatar.
|
||||
* Block/unblock the avatar by id.
|
||||
* Returns true if blocked, returns false if unblocked
|
||||
*/
|
||||
static void toggleBlock(const LLUUID& id);
|
||||
static bool toggleBlock(const LLUUID& id);
|
||||
|
||||
/**
|
||||
* Mute/unmute avatar.
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include "llstartup.h"
|
||||
|
||||
// Linden library includes
|
||||
#include "llavataractions.h" // for getProfileUrl
|
||||
#include "lldate.h"
|
||||
#include "lltrans.h"
|
||||
#include "llui.h" // LLUI::getLanguage()
|
||||
|
|
@ -94,54 +95,98 @@ void LLAvatarPropertiesProcessor::removeObserver(const LLUUID& avatar_id, LLAvat
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void LLAvatarPropertiesProcessor::sendGenericRequest(const LLUUID& avatar_id, EAvatarProcessorType type, const std::string method)
|
||||
void LLAvatarPropertiesProcessor::sendRequest(const LLUUID& avatar_id, EAvatarProcessorType type, const std::string &method)
|
||||
{
|
||||
// this is the startup state when send_complete_agent_movement() message is sent.
|
||||
// Before this messages won't work so don't bother trying
|
||||
if (LLStartUp::getStartupState() <= STATE_AGENT_SEND)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (avatar_id.isNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Suppress duplicate requests while waiting for a response from the network
|
||||
if (isPendingRequest(avatar_id, type))
|
||||
{
|
||||
// waiting for a response, don't re-request
|
||||
return;
|
||||
}
|
||||
// indicate we're going to make a request
|
||||
addPendingRequest(avatar_id, type);
|
||||
|
||||
std::vector<std::string> strings;
|
||||
strings.push_back( avatar_id.asString() );
|
||||
send_generic_message(method, strings);
|
||||
std::string cap;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case APT_PROPERTIES:
|
||||
// indicate we're going to make a request
|
||||
sendAvatarPropertiesRequestMessage(avatar_id);
|
||||
// can use getRegionCapability("AgentProfile"), but it is heavy
|
||||
// initAgentProfileCapRequest(avatar_id, cap);
|
||||
break;
|
||||
case APT_PICKS:
|
||||
case APT_GROUPS:
|
||||
case APT_NOTES:
|
||||
if (cap.empty())
|
||||
{
|
||||
// indicate we're going to make a request
|
||||
sendGenericRequest(avatar_id, type, method);
|
||||
}
|
||||
else
|
||||
{
|
||||
initAgentProfileCapRequest(avatar_id, cap);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
sendGenericRequest(avatar_id, type, method);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void LLAvatarPropertiesProcessor::sendGenericRequest(const LLUUID& avatar_id, EAvatarProcessorType type, const std::string &method)
|
||||
{
|
||||
// indicate we're going to make a request
|
||||
addPendingRequest(avatar_id, type);
|
||||
|
||||
std::vector<std::string> strings;
|
||||
strings.push_back(avatar_id.asString());
|
||||
send_generic_message(method, strings);
|
||||
}
|
||||
|
||||
void LLAvatarPropertiesProcessor::sendAvatarPropertiesRequestMessage(const LLUUID& avatar_id)
|
||||
{
|
||||
addPendingRequest(avatar_id, APT_PROPERTIES);
|
||||
|
||||
LLMessageSystem *msg = gMessageSystem;
|
||||
|
||||
msg->newMessageFast(_PREHASH_AvatarPropertiesRequest);
|
||||
msg->nextBlockFast(_PREHASH_AgentData);
|
||||
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
|
||||
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
||||
msg->addUUIDFast(_PREHASH_AvatarID, avatar_id);
|
||||
gAgent.sendReliableMessage();
|
||||
}
|
||||
|
||||
void LLAvatarPropertiesProcessor::initAgentProfileCapRequest(const LLUUID& avatar_id, const std::string& cap_url)
|
||||
{
|
||||
addPendingRequest(avatar_id, APT_PROPERTIES);
|
||||
addPendingRequest(avatar_id, APT_PICKS);
|
||||
addPendingRequest(avatar_id, APT_GROUPS);
|
||||
addPendingRequest(avatar_id, APT_NOTES);
|
||||
LLCoros::instance().launch("requestAgentUserInfoCoro",
|
||||
boost::bind(requestAvatarPropertiesCoro, cap_url, avatar_id));
|
||||
}
|
||||
|
||||
void LLAvatarPropertiesProcessor::sendAvatarPropertiesRequest(const LLUUID& avatar_id)
|
||||
{
|
||||
// this is the startup state when send_complete_agent_movement() message is sent.
|
||||
// Before this, the AvatarPropertiesRequest message
|
||||
// won't work so don't bother trying
|
||||
if (LLStartUp::getStartupState() <= STATE_AGENT_SEND)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (isPendingRequest(avatar_id, APT_PROPERTIES))
|
||||
{
|
||||
// waiting for a response, don't re-request
|
||||
return;
|
||||
}
|
||||
// indicate we're going to make a request
|
||||
addPendingRequest(avatar_id, APT_PROPERTIES);
|
||||
|
||||
LLMessageSystem *msg = gMessageSystem;
|
||||
|
||||
msg->newMessageFast(_PREHASH_AvatarPropertiesRequest);
|
||||
msg->nextBlockFast( _PREHASH_AgentData);
|
||||
msg->addUUIDFast( _PREHASH_AgentID, gAgent.getID() );
|
||||
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
||||
msg->addUUIDFast( _PREHASH_AvatarID, avatar_id);
|
||||
gAgent.sendReliableMessage();
|
||||
sendRequest(avatar_id, APT_PROPERTIES, "AvatarPropertiesRequest");
|
||||
}
|
||||
|
||||
void LLAvatarPropertiesProcessor::sendAvatarPicksRequest(const LLUUID& avatar_id)
|
||||
{
|
||||
sendGenericRequest(avatar_id, APT_PICKS, "avatarpicksrequest");
|
||||
sendGenericRequest(avatar_id, APT_PICKS, "avatarpicksrequest");
|
||||
}
|
||||
|
||||
void LLAvatarPropertiesProcessor::sendAvatarNotesRequest(const LLUUID& avatar_id)
|
||||
|
|
@ -174,7 +219,7 @@ void LLAvatarPropertiesProcessor::sendAvatarPropertiesUpdate(const LLAvatarData*
|
|||
return;
|
||||
}
|
||||
|
||||
LL_INFOS() << "Sending avatarinfo update" << LL_ENDL;
|
||||
LL_WARNS() << "Sending avatarinfo update. This trims profile descriptions!!!" << LL_ENDL;
|
||||
|
||||
// This value is required by sendAvatarPropertiesUpdate method.
|
||||
//A profile should never be mature. (From the original code)
|
||||
|
|
@ -266,6 +311,113 @@ bool LLAvatarPropertiesProcessor::hasPaymentInfoOnFile(const LLAvatarData* avata
|
|||
return ((avatar_data->flags & AVATAR_TRANSACTED) || (avatar_data->flags & AVATAR_IDENTIFIED));
|
||||
}
|
||||
|
||||
// static
|
||||
void LLAvatarPropertiesProcessor::requestAvatarPropertiesCoro(std::string cap_url, LLUUID agent_id)
|
||||
{
|
||||
LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
|
||||
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
|
||||
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("requestAvatarPropertiesCoro", httpPolicy));
|
||||
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
|
||||
LLCore::HttpHeaders::ptr_t httpHeaders;
|
||||
|
||||
LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
|
||||
httpOpts->setFollowRedirects(true);
|
||||
|
||||
std::string finalUrl = cap_url + "/" + agent_id.asString();
|
||||
|
||||
LLSD result = httpAdapter->getAndSuspend(httpRequest, finalUrl, httpOpts, httpHeaders);
|
||||
|
||||
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
|
||||
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
|
||||
|
||||
if (!status
|
||||
|| !result.has("id")
|
||||
|| agent_id != result["id"].asUUID())
|
||||
{
|
||||
LL_WARNS("AvatarProperties") << "Failed to get agent information for id " << agent_id << LL_ENDL;
|
||||
LLAvatarPropertiesProcessor* self = getInstance();
|
||||
self->removePendingRequest(agent_id, APT_PROPERTIES);
|
||||
self->removePendingRequest(agent_id, APT_PICKS);
|
||||
self->removePendingRequest(agent_id, APT_GROUPS);
|
||||
self->removePendingRequest(agent_id, APT_NOTES);
|
||||
return;
|
||||
}
|
||||
|
||||
// Avatar Data
|
||||
|
||||
LLAvatarData avatar_data;
|
||||
std::string birth_date;
|
||||
|
||||
avatar_data.agent_id = agent_id;
|
||||
avatar_data.avatar_id = agent_id;
|
||||
avatar_data.image_id = result["sl_image_id"].asUUID();
|
||||
avatar_data.fl_image_id = result["fl_image_id"].asUUID();
|
||||
avatar_data.partner_id = result["partner_id"].asUUID();
|
||||
avatar_data.about_text = result["sl_about_text"].asString();
|
||||
avatar_data.fl_about_text = result["fl_about_text"].asString();
|
||||
avatar_data.born_on = result["member_since"].asDate();
|
||||
avatar_data.profile_url = getProfileURL(agent_id.asString());
|
||||
|
||||
avatar_data.flags = 0;
|
||||
avatar_data.caption_index = 0;
|
||||
|
||||
LLAvatarPropertiesProcessor* self = getInstance();
|
||||
// Request processed, no longer pending
|
||||
self->removePendingRequest(agent_id, APT_PROPERTIES);
|
||||
self->notifyObservers(agent_id, &avatar_data, APT_PROPERTIES);
|
||||
|
||||
// Picks
|
||||
|
||||
LLSD picks_array = result["picks"];
|
||||
LLAvatarPicks avatar_picks;
|
||||
avatar_picks.agent_id = agent_id; // Not in use?
|
||||
avatar_picks.target_id = agent_id;
|
||||
|
||||
for (LLSD::array_const_iterator it = picks_array.beginArray(); it != picks_array.endArray(); ++it)
|
||||
{
|
||||
const LLSD& pick_data = *it;
|
||||
avatar_picks.picks_list.emplace_back(pick_data["id"].asUUID(), pick_data["name"].asString());
|
||||
}
|
||||
|
||||
// Request processed, no longer pending
|
||||
self->removePendingRequest(agent_id, APT_PICKS);
|
||||
self->notifyObservers(agent_id, &avatar_picks, APT_PICKS);
|
||||
|
||||
// Groups
|
||||
|
||||
LLSD groups_array = result["groups"];
|
||||
LLAvatarGroups avatar_groups;
|
||||
avatar_groups.agent_id = agent_id; // Not in use?
|
||||
avatar_groups.avatar_id = agent_id; // target_id
|
||||
|
||||
for (LLSD::array_const_iterator it = groups_array.beginArray(); it != groups_array.endArray(); ++it)
|
||||
{
|
||||
const LLSD& group_info = *it;
|
||||
LLAvatarGroups::LLGroupData group_data;
|
||||
group_data.group_powers = 0; // Not in use?
|
||||
group_data.group_title = group_info["name"].asString(); // Missing data, not in use?
|
||||
group_data.group_id = group_info["id"].asUUID();
|
||||
group_data.group_name = group_info["name"].asString();
|
||||
group_data.group_insignia_id = group_info["image_id"].asUUID();
|
||||
|
||||
avatar_groups.group_list.push_back(group_data);
|
||||
}
|
||||
|
||||
self->removePendingRequest(agent_id, APT_GROUPS);
|
||||
self->notifyObservers(agent_id, &avatar_groups, APT_GROUPS);
|
||||
|
||||
// Notes
|
||||
LLAvatarNotes avatar_notes;
|
||||
|
||||
avatar_notes.agent_id = agent_id;
|
||||
avatar_notes.target_id = agent_id;
|
||||
avatar_notes.notes = result["notes"].asString();
|
||||
|
||||
// Request processed, no longer pending
|
||||
self->removePendingRequest(agent_id, APT_NOTES);
|
||||
self->notifyObservers(agent_id, &avatar_notes, APT_NOTES);
|
||||
}
|
||||
|
||||
void LLAvatarPropertiesProcessor::processAvatarPropertiesReply(LLMessageSystem* msg, void**)
|
||||
{
|
||||
LLAvatarData avatar_data;
|
||||
|
|
@ -312,8 +464,8 @@ void LLAvatarPropertiesProcessor::processAvatarInterestsReply(LLMessageSystem* m
|
|||
That will suppress the warnings and be compatible with old server versions.
|
||||
WARNING: LLTemplateMessageReader::decodeData: Message from 216.82.37.237:13000 with no handler function received: AvatarInterestsReply
|
||||
*/
|
||||
//<FS:KC legacy profiles>
|
||||
FSInterestsData interests_data;
|
||||
|
||||
LLInterestsData interests_data;
|
||||
|
||||
msg->getUUIDFast( _PREHASH_AgentData, _PREHASH_AgentID, interests_data.agent_id );
|
||||
msg->getUUIDFast( _PREHASH_AgentData, _PREHASH_AvatarID, interests_data.avatar_id );
|
||||
|
|
@ -326,8 +478,7 @@ void LLAvatarPropertiesProcessor::processAvatarInterestsReply(LLMessageSystem* m
|
|||
LLAvatarPropertiesProcessor* self = getInstance();
|
||||
// Request processed, no longer pending
|
||||
self->removePendingRequest(interests_data.avatar_id, APT_INTERESTS_INFO);
|
||||
self->notifyObservers(interests_data.avatar_id, &interests_data, APT_INTERESTS_INFO);
|
||||
//</FS:KC legacy profiles>
|
||||
self->notifyObservers(interests_data.avatar_id, &interests_data, APT_INTERESTS_INFO);
|
||||
}
|
||||
|
||||
void LLAvatarPropertiesProcessor::processAvatarClassifiedsReply(LLMessageSystem* msg, void**)
|
||||
|
|
@ -405,7 +556,7 @@ void LLAvatarPropertiesProcessor::processAvatarNotesReply(LLMessageSystem* msg,
|
|||
void LLAvatarPropertiesProcessor::processAvatarPicksReply(LLMessageSystem* msg, void**)
|
||||
{
|
||||
LLAvatarPicks avatar_picks;
|
||||
msg->getUUID(_PREHASH_AgentData, _PREHASH_AgentID, avatar_picks.target_id);
|
||||
msg->getUUID(_PREHASH_AgentData, _PREHASH_AgentID, avatar_picks.agent_id);
|
||||
msg->getUUID(_PREHASH_AgentData, _PREHASH_TargetID, avatar_picks.target_id);
|
||||
|
||||
S32 block_count = msg->getNumberOfBlocks(_PREHASH_Data);
|
||||
|
|
@ -571,6 +722,29 @@ void LLAvatarPropertiesProcessor::sendClassifiedDelete(const LLUUID& classified_
|
|||
gAgent.sendReliableMessage();
|
||||
}
|
||||
|
||||
void LLAvatarPropertiesProcessor::sendInterestsInfoUpdate(const LLInterestsData* interests_data)
|
||||
{
|
||||
if(!interests_data)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
|
||||
msg->newMessage(_PREHASH_AvatarInterestsUpdate);
|
||||
msg->nextBlockFast( _PREHASH_AgentData);
|
||||
msg->addUUIDFast( _PREHASH_AgentID, gAgent.getID() );
|
||||
msg->addUUIDFast( _PREHASH_SessionID, gAgent.getSessionID() );
|
||||
msg->nextBlockFast( _PREHASH_PropertiesData);
|
||||
msg->addU32Fast( _PREHASH_WantToMask, interests_data->want_to_mask);
|
||||
msg->addStringFast( _PREHASH_WantToText, interests_data->want_to_text);
|
||||
msg->addU32Fast( _PREHASH_SkillsMask, interests_data->skills_mask);
|
||||
msg->addStringFast( _PREHASH_SkillsText, interests_data->skills_text);
|
||||
msg->addString( _PREHASH_LanguagesText, interests_data->languages_text);
|
||||
|
||||
gAgent.sendReliableMessage();
|
||||
}
|
||||
|
||||
void LLAvatarPropertiesProcessor::sendPickInfoUpdate(const LLPickData* new_pick)
|
||||
{
|
||||
if (!new_pick) return;
|
||||
|
|
@ -694,28 +868,3 @@ void LLAvatarPropertiesProcessor::removePendingRequest(const LLUUID& avatar_id,
|
|||
timestamp_map_t::key_type key = std::make_pair(avatar_id, type);
|
||||
mRequestTimestamps.erase(key);
|
||||
}
|
||||
|
||||
//<FS:KC legacy profiles>
|
||||
void LLAvatarPropertiesProcessor::sendInterestsInfoUpdate(const FSInterestsData* interests_data)
|
||||
{
|
||||
if(!interests_data)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
|
||||
msg->newMessage(_PREHASH_AvatarInterestsUpdate);
|
||||
msg->nextBlockFast( _PREHASH_AgentData);
|
||||
msg->addUUIDFast( _PREHASH_AgentID, gAgent.getID() );
|
||||
msg->addUUIDFast( _PREHASH_SessionID, gAgent.getSessionID() );
|
||||
msg->nextBlockFast( _PREHASH_PropertiesData);
|
||||
msg->addU32Fast( _PREHASH_WantToMask, interests_data->want_to_mask);
|
||||
msg->addStringFast( _PREHASH_WantToText, interests_data->want_to_text);
|
||||
msg->addU32Fast( _PREHASH_SkillsMask, interests_data->skills_mask);
|
||||
msg->addStringFast( _PREHASH_SkillsText, interests_data->skills_text);
|
||||
msg->addString( _PREHASH_LanguagesText, interests_data->languages_text);
|
||||
|
||||
gAgent.sendReliableMessage();
|
||||
}
|
||||
//</FS:KC legacy profiles>
|
||||
|
|
|
|||
|
|
@ -56,15 +56,12 @@ enum EAvatarProcessorType
|
|||
APT_PICKS,
|
||||
APT_PICK_INFO,
|
||||
APT_TEXTURES,
|
||||
//<FS:KC legacy profiles>
|
||||
APT_INTERESTS_INFO,
|
||||
//</FS:KC legacy profiles>
|
||||
APT_CLASSIFIEDS,
|
||||
APT_CLASSIFIED_INFO
|
||||
};
|
||||
|
||||
//<FS:KC legacy profiles>
|
||||
struct FSInterestsData
|
||||
struct LLInterestsData
|
||||
{
|
||||
LLUUID agent_id;
|
||||
LLUUID avatar_id; //target id
|
||||
|
|
@ -74,7 +71,6 @@ struct FSInterestsData
|
|||
std::string skills_text;
|
||||
std::string languages_text;
|
||||
};
|
||||
//</FS:KC legacy profiles>
|
||||
|
||||
struct LLAvatarData
|
||||
{
|
||||
|
|
@ -239,9 +235,7 @@ public:
|
|||
|
||||
void sendClassifiedDelete(const LLUUID& classified_id);
|
||||
|
||||
//<FS:KC legacy profiles>
|
||||
void sendInterestsInfoUpdate(const FSInterestsData* interests_data);
|
||||
//</FS:KC legacy profiles>
|
||||
void sendInterestsInfoUpdate(const LLInterestsData* interests_data);
|
||||
|
||||
// Returns translated, human readable string for account type, such
|
||||
// as "Resident" or "Linden Employee". Used for profiles, inspectors.
|
||||
|
|
@ -254,6 +248,8 @@ public:
|
|||
|
||||
static bool hasPaymentInfoOnFile(const LLAvatarData* avatar_data);
|
||||
|
||||
static void requestAvatarPropertiesCoro(std::string cap_url, LLUUID agent_id);
|
||||
|
||||
static void processAvatarPropertiesReply(LLMessageSystem* msg, void**);
|
||||
|
||||
static void processAvatarInterestsReply(LLMessageSystem* msg, void**);
|
||||
|
|
@ -272,7 +268,10 @@ public:
|
|||
|
||||
protected:
|
||||
|
||||
void sendGenericRequest(const LLUUID& avatar_id, EAvatarProcessorType type, const std::string method);
|
||||
void sendRequest(const LLUUID& avatar_id, EAvatarProcessorType type, const std::string &method);
|
||||
void sendGenericRequest(const LLUUID& avatar_id, EAvatarProcessorType type, const std::string &method);
|
||||
void sendAvatarPropertiesRequestMessage(const LLUUID& avatar_id);
|
||||
void initAgentProfileCapRequest(const LLUUID& avatar_id, const std::string& cap_url);
|
||||
|
||||
void notifyObservers(const LLUUID& id,void* data, EAvatarProcessorType type);
|
||||
|
||||
|
|
|
|||
|
|
@ -713,10 +713,6 @@ void LLAvatarTracker::processChange(LLMessageSystem* msg)
|
|||
if(mBuddyInfo.find(agent_related) != mBuddyInfo.end())
|
||||
{
|
||||
(mBuddyInfo[agent_related])->setRightsTo(new_rights);
|
||||
|
||||
// I'm not totally sure why it adds the agents id to the changed list
|
||||
// nor why it doesn't add the friends's ID.
|
||||
// Add the friend's id to the changed list for contacts list -KC
|
||||
mChangedBuddyIDs.insert(agent_related);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1232,11 +1232,6 @@ bool LLFace::canRenderAsMask()
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// <FS:Beq> shortcircuit fully alpha faces
|
||||
if (getViewerObject()->isHUDAttachment()) { return false; }
|
||||
if (te->getAlpha() == 0.0f && (te->getGlow() == 0.f)) { return true; }
|
||||
// </FS:Beq>
|
||||
|
||||
LLMaterial* mat = te->getMaterialParams();
|
||||
if (mat && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND)
|
||||
|
|
|
|||
|
|
@ -1032,7 +1032,7 @@ void LLFavoritesBarCtrl::updateButtons(bool force_update)
|
|||
{
|
||||
//find last visible child to get the rightest button offset
|
||||
child_list_const_reverse_iter_t last_visible_it = std::find_if(childs->rbegin(), childs->rend(),
|
||||
std::mem_fun(&LLView::getVisible));
|
||||
[](child_list_t::value_type child){ return child->getVisible(); });
|
||||
if(last_visible_it != childs->rend())
|
||||
{
|
||||
last_right_edge = (*last_visible_it)->getRect().mRight;
|
||||
|
|
|
|||
|
|
@ -112,7 +112,8 @@ BOOL LLFloater360Capture::postBuild()
|
|||
|
||||
// UX/UI called for preview mode (always the first index/option)
|
||||
// by default each time vs restoring the last value
|
||||
mQualityRadioGroup->setSelectedIndex(0);
|
||||
// <FS:Ansariel> UX/UI has no clue what the users actually want!
|
||||
//mQualityRadioGroup->setSelectedIndex(0);
|
||||
|
||||
// Construct a URL pointing to the first page to load. Although
|
||||
// we do not use this page for anything (after some significant
|
||||
|
|
@ -319,6 +320,11 @@ const std::string LLFloater360Capture::getHTMLBaseFolder()
|
|||
// triggered when the 'capture' button in the UI is pressed
|
||||
void LLFloater360Capture::onCapture360ImagesBtn()
|
||||
{
|
||||
// <FS:Beq> FIRE-31942 Avoid CoRo that appears to never usefully yield
|
||||
// Allow option to re-enable on the off chance a low power machine can benefit
|
||||
if(gSavedSettings.getBOOL("FSUseCoRoFor360Capture"))
|
||||
{
|
||||
// </FS:Beq>
|
||||
// launch the main capture code in a coroutine so we can
|
||||
// yield/suspend at some points to give the main UI
|
||||
// thread a look-in occasionally.
|
||||
|
|
@ -326,6 +332,13 @@ void LLFloater360Capture::onCapture360ImagesBtn()
|
|||
{
|
||||
capture360Images();
|
||||
});
|
||||
// <FS:Beq> FIRE-31942 Avoid CoRo that appears to never usefully yield
|
||||
}
|
||||
else
|
||||
{
|
||||
capture360Images();
|
||||
}
|
||||
// </FS:Beq>
|
||||
}
|
||||
|
||||
// Gets the full path name for a given JavaScript file in the HTML folder. We
|
||||
|
|
@ -682,6 +695,7 @@ void LLFloater360Capture::capture360Images()
|
|||
|
||||
// allow the UI to update by suspending and waiting for the
|
||||
// main render loop to update the UI
|
||||
if(gSavedSettings.getBOOL("FSUseCoRoFor360Capture")) // <FS:Beq/> FIRE-31942 - make apparently pointless CoRo optional (just in case)
|
||||
suspendForAFrame();
|
||||
}
|
||||
|
||||
|
|
@ -892,7 +906,7 @@ const std::string LLFloater360Capture::generate_proposed_filename()
|
|||
// this looks complex but it's straightforward - removes all non-alpha chars from a string
|
||||
// which in this case is the SL region name - we use it as a proposed filename but the user is free to change
|
||||
std::string region_name = region->getName();
|
||||
std::replace_if(region_name.begin(), region_name.end(), std::not1(std::ptr_fun(isalnum)), '_');
|
||||
std::replace_if(region_name.begin(), region_name.end(), [](const auto& c) { return isalnum(c) == 0; }, '_');
|
||||
if (region_name.length() > 0)
|
||||
{
|
||||
filename << region_name;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ LLFloaterChatVoiceVolume::LLFloaterChatVoiceVolume(const LLSD& key)
|
|||
void LLFloaterChatVoiceVolume::onOpen(const LLSD& key)
|
||||
{
|
||||
LLInspect::onOpen(key);
|
||||
LLUI::getInstance()->positionViewNearMouse(this);
|
||||
LLInspect::repositionInspector(key);
|
||||
}
|
||||
|
||||
LLFloaterChatVoiceVolume::~LLFloaterChatVoiceVolume()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,71 @@
|
|||
/**
|
||||
* @file llfloaterclassified.cpp
|
||||
* @brief LLFloaterClassified for displaying classifieds.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2022&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2022, 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 "llfloaterclassified.h"
|
||||
|
||||
LLFloaterClassified::LLFloaterClassified(const LLSD& key)
|
||||
: LLFloater(key)
|
||||
{
|
||||
}
|
||||
|
||||
LLFloaterClassified::~LLFloaterClassified()
|
||||
{
|
||||
}
|
||||
|
||||
void LLFloaterClassified::onOpen(const LLSD& key)
|
||||
{
|
||||
LLPanel* panel = findChild<LLPanel>("main_panel", true);
|
||||
if (panel)
|
||||
{
|
||||
panel->onOpen(key);
|
||||
}
|
||||
if (key.has("classified_name"))
|
||||
{
|
||||
setTitle(key["classified_name"].asString());
|
||||
}
|
||||
LLFloater::onOpen(key);
|
||||
}
|
||||
|
||||
BOOL LLFloaterClassified::postBuild()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
bool LLFloaterClassified::matchesKey(const LLSD& key)
|
||||
{
|
||||
bool is_mkey_valid = mKey.has("classified_id");
|
||||
bool is_key_valid = key.has("classified_id");
|
||||
if (is_mkey_valid && is_key_valid)
|
||||
{
|
||||
return key["classified_id"].asUUID() == mKey["classified_id"].asUUID();
|
||||
}
|
||||
return is_mkey_valid == is_key_valid;
|
||||
}
|
||||
|
||||
// eof
|
||||
|
|
@ -1,50 +1,45 @@
|
|||
/**
|
||||
* @file llpanelme.h
|
||||
* @brief Side tray "Me" (My Profile) panel
|
||||
/**
|
||||
* @file llfloaterclassified.h
|
||||
* @brief LLFloaterClassified for displaying classifieds.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
|
||||
* $LicenseInfo:firstyear=2022&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* Copyright (C) 2022, 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_LLPANELMEPROFILE_H
|
||||
#define LL_LLPANELMEPROFILE_H
|
||||
#ifndef LL_LLFLOATERCLASSIFIED_H
|
||||
#define LL_LLFLOATERCLASSIFIED_H
|
||||
|
||||
#include "llpanel.h"
|
||||
#include "llpanelprofile.h"
|
||||
#include "llfloater.h"
|
||||
|
||||
/**
|
||||
* Panel for displaying Agent's Picks and Classifieds panel.
|
||||
* LLPanelMe allows user to edit his picks and classifieds.
|
||||
*/
|
||||
class LLPanelMe : public LLPanelProfile
|
||||
class LLFloaterClassified : public LLFloater
|
||||
{
|
||||
LOG_CLASS(LLPanelMe);
|
||||
|
||||
LOG_CLASS(LLFloaterClassified);
|
||||
public:
|
||||
LLFloaterClassified(const LLSD& key);
|
||||
virtual ~LLFloaterClassified();
|
||||
|
||||
LLPanelMe();
|
||||
void onOpen(const LLSD& key) override;
|
||||
BOOL postBuild() override;
|
||||
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
bool matchesKey(const LLSD& key) override;
|
||||
};
|
||||
|
||||
#endif // LL_LLPANELMEPROFILE_H
|
||||
#endif // LL_LLFLOATERCLASSIFIED_H
|
||||
|
|
@ -47,7 +47,6 @@ public:
|
|||
virtual ~LLFloaterDisplayName() { }
|
||||
/*virtual*/ BOOL postBuild();
|
||||
void onSave();
|
||||
void onReset();
|
||||
void onCancel();
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
|
|
@ -102,7 +101,6 @@ void LLFloaterDisplayName::onOpen(const LLSD& key)
|
|||
|
||||
BOOL LLFloaterDisplayName::postBuild()
|
||||
{
|
||||
getChild<LLUICtrl>("reset_btn")->setCommitCallback(boost::bind(&LLFloaterDisplayName::onReset, this));
|
||||
getChild<LLUICtrl>("cancel_btn")->setCommitCallback(boost::bind(&LLFloaterDisplayName::onCancel, this));
|
||||
getChild<LLUICtrl>("save_btn")->setCommitCallback(boost::bind(&LLFloaterDisplayName::onSave, this));
|
||||
|
||||
|
|
@ -158,21 +156,6 @@ void LLFloaterDisplayName::onCancel()
|
|||
setVisible(false);
|
||||
}
|
||||
|
||||
void LLFloaterDisplayName::onReset()
|
||||
{
|
||||
if (LLAvatarNameCache::getInstance()->hasNameLookupURL())
|
||||
{
|
||||
LLViewerDisplayName::set("",boost::bind(&LLFloaterDisplayName::onCacheSetName, this, _1, _2, _3));
|
||||
}
|
||||
else
|
||||
{
|
||||
LLNotificationsUtil::add("SetDisplayNameFailedGeneric");
|
||||
}
|
||||
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
void LLFloaterDisplayName::onSave()
|
||||
{
|
||||
std::string display_name_utf8 = getChild<LLUICtrl>("display_name_editor")->getValue().asString();
|
||||
|
|
@ -194,7 +177,7 @@ void LLFloaterDisplayName::onSave()
|
|||
return;
|
||||
}
|
||||
|
||||
if (LLAvatarNameCache::getInstance()->hasNameLookupURL())
|
||||
if (LLAvatarNameCache::getInstance()->hasNameLookupURL())
|
||||
{
|
||||
LLViewerDisplayName::set(display_name_utf8,boost::bind(&LLFloaterDisplayName::onCacheSetName, this, _1, _2, _3));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ LLFloaterGesture::LLFloaterGesture(const LLSD& key)
|
|||
mObserver = new LLFloaterGestureObserver(this);
|
||||
LLGestureMgr::instance().addObserver(mObserver);
|
||||
|
||||
mCommitCallbackRegistrar.add("Gesture.Action.ToogleActiveState", boost::bind(&LLFloaterGesture::onActivateBtnClick, this));
|
||||
mCommitCallbackRegistrar.add("Gesture.Action.ToggleActiveState", boost::bind(&LLFloaterGesture::onActivateBtnClick, this));
|
||||
mCommitCallbackRegistrar.add("Gesture.Action.ShowPreview", boost::bind(&LLFloaterGesture::onClickEdit, this));
|
||||
mCommitCallbackRegistrar.add("Gesture.Action.CopyPaste", boost::bind(&LLFloaterGesture::onCopyPasteAction, this, _2));
|
||||
mCommitCallbackRegistrar.add("Gesture.Action.SaveToCOF", boost::bind(&LLFloaterGesture::addToCurrentOutFit, this));
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@
|
|||
#include "llviewercontrol.h"
|
||||
#include "lltoolfocus.h"
|
||||
#include "lltoolmgr.h"
|
||||
#include "llwebprofile.h"
|
||||
|
||||
///----------------------------------------------------------------------------
|
||||
/// Local function declarations, constants, enums, and typedefs
|
||||
|
|
|
|||
|
|
@ -558,60 +558,59 @@ void LLFloaterPreference::processProperties( void* pData, EAvatarProcessorType t
|
|||
const LLAvatarData* pAvatarData = static_cast<const LLAvatarData*>( pData );
|
||||
if (pAvatarData && (gAgent.getID() == pAvatarData->avatar_id) && (pAvatarData->avatar_id != LLUUID::null))
|
||||
{
|
||||
storeAvatarProperties( pAvatarData );
|
||||
processProfileProperties( pAvatarData );
|
||||
mAllowPublish = (bool)(pAvatarData->flags & AVATAR_ALLOW_PUBLISH);
|
||||
mAvatarDataInitialized = true;
|
||||
getChild<LLUICtrl>("online_searchresults")->setValue(mAllowPublish);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterPreference::storeAvatarProperties( const LLAvatarData* pAvatarData )
|
||||
{
|
||||
if (gAgent.isInitialized() && (gAgent.getID() != LLUUID::null) && (LLStartUp::getStartupState() == STATE_STARTED))
|
||||
{
|
||||
mAvatarProperties.avatar_id = pAvatarData->avatar_id;
|
||||
mAvatarProperties.image_id = pAvatarData->image_id;
|
||||
mAvatarProperties.fl_image_id = pAvatarData->fl_image_id;
|
||||
mAvatarProperties.about_text = pAvatarData->about_text;
|
||||
mAvatarProperties.fl_about_text = pAvatarData->fl_about_text;
|
||||
mAvatarProperties.profile_url = pAvatarData->profile_url;
|
||||
mAvatarProperties.flags = pAvatarData->flags;
|
||||
mAvatarProperties.allow_publish = pAvatarData->flags & AVATAR_ALLOW_PUBLISH;
|
||||
|
||||
mAvatarDataInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterPreference::processProfileProperties(const LLAvatarData* pAvatarData )
|
||||
{
|
||||
getChild<LLUICtrl>("online_searchresults")->setValue( (bool)(pAvatarData->flags & AVATAR_ALLOW_PUBLISH) );
|
||||
}
|
||||
|
||||
void LLFloaterPreference::saveAvatarProperties( void )
|
||||
{
|
||||
const BOOL allowPublish = getChild<LLUICtrl>("online_searchresults")->getValue();
|
||||
const bool allowPublish = getChild<LLUICtrl>("online_searchresults")->getValue();
|
||||
|
||||
if (allowPublish)
|
||||
{
|
||||
mAvatarProperties.flags |= AVATAR_ALLOW_PUBLISH;
|
||||
}
|
||||
if ((LLStartUp::getStartupState() == STATE_STARTED)
|
||||
&& mAvatarDataInitialized
|
||||
&& (allowPublish != mAllowPublish))
|
||||
{
|
||||
std::string cap_url = gAgent.getRegionCapability("AgentProfile");
|
||||
if (!cap_url.empty())
|
||||
{
|
||||
mAllowPublish = allowPublish;
|
||||
|
||||
//
|
||||
// NOTE: We really don't want to send the avatar properties unless we absolutely
|
||||
// need to so we can avoid the accidental profile reset bug, so, if we're
|
||||
// logged in, the avatar data has been initialized and we have a state change
|
||||
// for the "allow publish" flag, then set the flag to its new value and send
|
||||
// the properties update.
|
||||
//
|
||||
// NOTE: The only reason we can not remove this update altogether is because of the
|
||||
// "allow publish" flag, the last remaining profile setting in the viewer
|
||||
// that doesn't exist in the web profile.
|
||||
//
|
||||
if ((LLStartUp::getStartupState() == STATE_STARTED) && mAvatarDataInitialized && (allowPublish != mAvatarProperties.allow_publish))
|
||||
{
|
||||
mAvatarProperties.allow_publish = allowPublish;
|
||||
LLCoros::instance().launch("requestAgentUserInfoCoro",
|
||||
boost::bind(saveAvatarPropertiesCoro, cap_url, allowPublish));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesUpdate( &mAvatarProperties );
|
||||
}
|
||||
void LLFloaterPreference::saveAvatarPropertiesCoro(const std::string cap_url, bool allow_publish)
|
||||
{
|
||||
LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
|
||||
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
|
||||
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("put_avatar_properties_coro", httpPolicy));
|
||||
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
|
||||
LLCore::HttpHeaders::ptr_t httpHeaders;
|
||||
|
||||
LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
|
||||
httpOpts->setFollowRedirects(true);
|
||||
|
||||
std::string finalUrl = cap_url + "/" + gAgentID.asString();
|
||||
LLSD data;
|
||||
data["allow_publish"] = allow_publish;
|
||||
|
||||
LLSD result = httpAdapter->putAndSuspend(httpRequest, finalUrl, data, httpOpts, httpHeaders);
|
||||
|
||||
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
|
||||
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
|
||||
|
||||
if (!status)
|
||||
{
|
||||
LL_WARNS("Preferences") << "Failed to put agent information " << data << " for id " << gAgentID << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
LL_DEBUGS("Preferences") << "Agent id: " << gAgentID << " Data: " << data << " Result: " << httpResults << LL_ENDL;
|
||||
}
|
||||
|
||||
BOOL LLFloaterPreference::postBuild()
|
||||
|
|
@ -1521,7 +1520,7 @@ void LLFloaterPreference::onBtnOK(const LLSD& userdata)
|
|||
else
|
||||
{
|
||||
// Show beep, pop up dialog, etc.
|
||||
LL_INFOS() << "Can't close preferences!" << LL_ENDL;
|
||||
LL_INFOS("Preferences") << "Can't close preferences!" << LL_ENDL;
|
||||
}
|
||||
|
||||
// <FS:Ansariel> [FS Login Panel]
|
||||
|
|
@ -2875,13 +2874,13 @@ bool LLFloaterPreference::loadFromFilename(const std::string& filename, std::map
|
|||
|
||||
if (!LLXMLNode::parseFile(filename, root, NULL))
|
||||
{
|
||||
LL_WARNS() << "Unable to parse file " << filename << LL_ENDL;
|
||||
LL_WARNS("Preferences") << "Unable to parse file " << filename << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!root->hasName("labels"))
|
||||
{
|
||||
LL_WARNS() << filename << " is not a valid definition file" << LL_ENDL;
|
||||
LL_WARNS("Preferences") << filename << " is not a valid definition file" << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -2901,7 +2900,7 @@ bool LLFloaterPreference::loadFromFilename(const std::string& filename, std::map
|
|||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << filename << " failed to load" << LL_ENDL;
|
||||
LL_WARNS("Preferences") << filename << " failed to load" << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -4159,7 +4158,7 @@ bool LLPanelPreferenceControls::addControlTableColumns(const std::string &filena
|
|||
LLScrollListCtrl::Contents contents;
|
||||
if (!LLUICtrlFactory::getLayeredXMLNode(filename, xmlNode))
|
||||
{
|
||||
LL_WARNS() << "Failed to load " << filename << LL_ENDL;
|
||||
LL_WARNS("Preferences") << "Failed to load " << filename << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
LLXUIParser parser;
|
||||
|
|
@ -4186,7 +4185,7 @@ bool LLPanelPreferenceControls::addControlTableRows(const std::string &filename)
|
|||
LLScrollListCtrl::Contents contents;
|
||||
if (!LLUICtrlFactory::getLayeredXMLNode(filename, xmlNode))
|
||||
{
|
||||
LL_WARNS() << "Failed to load " << filename << LL_ENDL;
|
||||
LL_WARNS("Preferences") << "Failed to load " << filename << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
LLXUIParser parser;
|
||||
|
|
@ -4292,7 +4291,7 @@ void LLPanelPreferenceControls::populateControlTable()
|
|||
{
|
||||
// Either unknown mode or MODE_SAVED_SETTINGS
|
||||
// It doesn't have UI or actual settings yet
|
||||
LL_WARNS() << "Unimplemented mode" << LL_ENDL;
|
||||
LL_WARNS("Preferences") << "Unimplemented mode" << LL_ENDL;
|
||||
|
||||
// Searchable columns were removed, mark searchables for an update
|
||||
LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences");
|
||||
|
|
@ -4332,7 +4331,7 @@ void LLPanelPreferenceControls::populateControlTable()
|
|||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Unimplemented mode" << LL_ENDL;
|
||||
LL_WARNS("Preferences") << "Unimplemented mode" << LL_ENDL;
|
||||
}
|
||||
|
||||
// explicit update to make sure table is ready for llsearchableui
|
||||
|
|
|
|||
|
|
@ -111,9 +111,8 @@ public:
|
|||
static void updateShowFavoritesCheckbox(bool val);
|
||||
|
||||
void processProperties( void* pData, EAvatarProcessorType type );
|
||||
void processProfileProperties(const LLAvatarData* pAvatarData );
|
||||
void storeAvatarProperties( const LLAvatarData* pAvatarData );
|
||||
void saveAvatarProperties( void );
|
||||
static void saveAvatarPropertiesCoro(const std::string url, bool allow_publish);
|
||||
void selectPrivacyPanel();
|
||||
void selectChatPanel();
|
||||
void getControlNames(std::vector<std::string>& names);
|
||||
|
|
@ -315,7 +314,7 @@ private:
|
|||
bool mOriginalHideOnlineStatus;
|
||||
std::string mDirectoryVisibility;
|
||||
|
||||
LLAvatarData mAvatarProperties;
|
||||
bool mAllowPublish; // Allow showing agent in search
|
||||
std::string mSavedGraphicsPreset;
|
||||
LOG_CLASS(LLFloaterPreference);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,170 @@
|
|||
/**
|
||||
* @file llfloaterprofile.cpp
|
||||
* @brief Avatar profile floater.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2022&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2022, 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 "llfloaterprofile.h"
|
||||
|
||||
#include "llagent.h" //gAgent
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llpanelavatar.h"
|
||||
#include "llpanelprofile.h"
|
||||
|
||||
static const std::string PANEL_PROFILE_VIEW = "panel_profile_view";
|
||||
|
||||
LLFloaterProfile::LLFloaterProfile(const LLSD& key)
|
||||
: LLFloater(key),
|
||||
mAvatarId(key["id"].asUUID()),
|
||||
mNameCallbackConnection()
|
||||
{
|
||||
mDefaultRectForGroup = false;
|
||||
}
|
||||
|
||||
LLFloaterProfile::~LLFloaterProfile()
|
||||
{
|
||||
if (mNameCallbackConnection.connected())
|
||||
{
|
||||
mNameCallbackConnection.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterProfile::onOpen(const LLSD& key)
|
||||
{
|
||||
mPanelProfile->onOpen(key);
|
||||
|
||||
// Update the avatar name.
|
||||
mNameCallbackConnection = LLAvatarNameCache::get(mAvatarId, boost::bind(&LLFloaterProfile::onAvatarNameCache, this, _1, _2));
|
||||
}
|
||||
|
||||
BOOL LLFloaterProfile::postBuild()
|
||||
{
|
||||
mPanelProfile = findChild<LLPanelProfile>(PANEL_PROFILE_VIEW);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLFloaterProfile::onClickCloseBtn(bool app_quitting)
|
||||
{
|
||||
if (!app_quitting)
|
||||
{
|
||||
if (mPanelProfile->hasUnpublishedClassifieds())
|
||||
{
|
||||
LLNotificationsUtil::add("ProfileUnpublishedClassified", LLSD(), LLSD(),
|
||||
boost::bind(&LLFloaterProfile::onUnsavedChangesCallback, this, _1, _2, false));
|
||||
}
|
||||
else if (mPanelProfile->hasUnsavedChanges())
|
||||
{
|
||||
LLNotificationsUtil::add("ProfileUnsavedChanges", LLSD(), LLSD(),
|
||||
boost::bind(&LLFloaterProfile::onUnsavedChangesCallback, this, _1, _2, true));
|
||||
}
|
||||
else
|
||||
{
|
||||
closeFloater();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
closeFloater();
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterProfile::onUnsavedChangesCallback(const LLSD& notification, const LLSD& response, bool can_save)
|
||||
{
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
if (can_save)
|
||||
{
|
||||
// savable content
|
||||
|
||||
if (option == 0) // Save
|
||||
{
|
||||
mPanelProfile->commitUnsavedChanges();
|
||||
closeFloater();
|
||||
}
|
||||
if (option == 1) // Discard
|
||||
{
|
||||
closeFloater();
|
||||
}
|
||||
// else cancel
|
||||
}
|
||||
else
|
||||
{
|
||||
// classifieds
|
||||
|
||||
if (option == 0) // Ok
|
||||
{
|
||||
closeFloater();
|
||||
}
|
||||
// else cancel
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void LLFloaterProfile::createPick(const LLPickData &data)
|
||||
{
|
||||
mPanelProfile->createPick(data);
|
||||
}
|
||||
|
||||
void LLFloaterProfile::showPick(const LLUUID& pick_id)
|
||||
{
|
||||
mPanelProfile->showPick(pick_id);
|
||||
}
|
||||
|
||||
bool LLFloaterProfile::isPickTabSelected()
|
||||
{
|
||||
return mPanelProfile->isPickTabSelected();
|
||||
}
|
||||
|
||||
void LLFloaterProfile::refreshName()
|
||||
{
|
||||
if (!mNameCallbackConnection.connected())
|
||||
{
|
||||
mNameCallbackConnection = LLAvatarNameCache::get(mAvatarId, boost::bind(&LLFloaterProfile::onAvatarNameCache, this, _1, _2));
|
||||
}
|
||||
|
||||
LLPanelProfileSecondLife *panel = findChild<LLPanelProfileSecondLife>("panel_profile_secondlife");
|
||||
if (panel)
|
||||
{
|
||||
panel->refreshName();
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterProfile::showClassified(const LLUUID& classified_id, bool edit)
|
||||
{
|
||||
mPanelProfile->showClassified(classified_id, edit);
|
||||
}
|
||||
|
||||
void LLFloaterProfile::createClassified()
|
||||
{
|
||||
mPanelProfile->createClassified();
|
||||
}
|
||||
|
||||
void LLFloaterProfile::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name)
|
||||
{
|
||||
mNameCallbackConnection.disconnect();
|
||||
setTitle(av_name.getCompleteName());
|
||||
}
|
||||
|
||||
// eof
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
/**
|
||||
* @file llfloaterprofile.h
|
||||
* @brief Avatar profile floater.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2022&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2022, 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_LLFLOATERPROFILE_H
|
||||
#define LL_LLFLOATERPROFILE_H
|
||||
|
||||
#include "llavatarnamecache.h"
|
||||
#include "llavatarpropertiesprocessor.h"
|
||||
#include "llfloater.h"
|
||||
|
||||
class LLPanelProfile;
|
||||
|
||||
class LLFloaterProfile : public LLFloater
|
||||
{
|
||||
LOG_CLASS(LLFloaterProfile);
|
||||
public:
|
||||
LLFloaterProfile(const LLSD& key);
|
||||
virtual ~LLFloaterProfile();
|
||||
|
||||
BOOL postBuild() override;
|
||||
|
||||
void onOpen(const LLSD& key) override;
|
||||
void onClickCloseBtn(bool app_quitting = false) override;
|
||||
void onUnsavedChangesCallback(const LLSD& notification, const LLSD& response, bool can_save);
|
||||
|
||||
void createPick(const LLPickData &data);
|
||||
void showPick(const LLUUID& pick_id = LLUUID::null);
|
||||
bool isPickTabSelected();
|
||||
void refreshName();
|
||||
|
||||
void showClassified(const LLUUID& classified_id = LLUUID::null, bool edit = false);
|
||||
void createClassified();
|
||||
|
||||
private:
|
||||
LLAvatarNameCache::callback_connection_t mNameCallbackConnection;
|
||||
void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name);
|
||||
|
||||
LLPanelProfile* mPanelProfile;
|
||||
|
||||
LLUUID mAvatarId;
|
||||
};
|
||||
|
||||
#endif // LL_LLFLOATERPROFILE_H
|
||||
|
|
@ -0,0 +1,241 @@
|
|||
/**
|
||||
* @file llfloaterprofiletexture.cpp
|
||||
* @brief LLFloaterProfileTexture class implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2022&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2022, 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 "llfloaterprofiletexture.h"
|
||||
|
||||
#include "llbutton.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "llpreview.h" // fors constants
|
||||
#include "lltrans.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "lltextureview.h"
|
||||
#include "llviewertexture.h"
|
||||
#include "llviewertexturelist.h"
|
||||
#include "llviewermenu.h"
|
||||
|
||||
|
||||
|
||||
LLFloaterProfileTexture::LLFloaterProfileTexture(LLView* owner)
|
||||
: LLFloater(LLSD())
|
||||
, mUpdateDimensions(TRUE)
|
||||
, mLastHeight(0)
|
||||
, mLastWidth(0)
|
||||
, mImage(NULL)
|
||||
, mImageOldBoostLevel(LLGLTexture::BOOST_NONE)
|
||||
, mOwnerHandle(owner->getHandle())
|
||||
{
|
||||
buildFromFile("floater_profile_texture.xml");
|
||||
}
|
||||
|
||||
LLFloaterProfileTexture::~LLFloaterProfileTexture()
|
||||
{
|
||||
if (mImage.notNull())
|
||||
{
|
||||
mImage->setBoostLevel(mImageOldBoostLevel);
|
||||
mImage->forceActive(); // <FS:Ansariel> Make sure it can get discarded
|
||||
mImage = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// virtual
|
||||
BOOL LLFloaterProfileTexture::postBuild()
|
||||
{
|
||||
mProfileIcon = getChild<LLIconCtrl>("profile_pic");
|
||||
|
||||
mCloseButton = getChild<LLButton>("close_btn");
|
||||
mCloseButton->setCommitCallback([this](LLUICtrl*, void*) { closeFloater(); }, nullptr);
|
||||
|
||||
// <FS:Ansariel> Add refresh function
|
||||
getChild<LLButton>("btn_refresh")->setCommitCallback([this](LLUICtrl*, void*) { refresh(); }, nullptr);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLFloaterProfileTexture::reshape(S32 width, S32 height, BOOL called_from_parent)
|
||||
{
|
||||
LLFloater::reshape(width, height, called_from_parent);
|
||||
}
|
||||
|
||||
// It takes a while until we get height and width information.
|
||||
// When we receive it, reshape the window accordingly.
|
||||
void LLFloaterProfileTexture::updateDimensions()
|
||||
{
|
||||
if (mImage.isNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ((mImage->getFullWidth() * mImage->getFullHeight()) == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
S32 img_width = mImage->getFullWidth();
|
||||
S32 img_height = mImage->getFullHeight();
|
||||
|
||||
if (mAssetStatus != LLPreview::PREVIEW_ASSET_LOADED
|
||||
|| mLastWidth != img_width
|
||||
|| mLastHeight != img_height)
|
||||
{
|
||||
mAssetStatus = LLPreview::PREVIEW_ASSET_LOADED;
|
||||
// Asset has been fully loaded
|
||||
mUpdateDimensions = TRUE;
|
||||
}
|
||||
|
||||
mLastHeight = img_height;
|
||||
mLastWidth = img_width;
|
||||
|
||||
// Reshape the floater only when required
|
||||
if (mUpdateDimensions)
|
||||
{
|
||||
mUpdateDimensions = FALSE;
|
||||
|
||||
LLRect old_floater_rect = getRect();
|
||||
LLRect old_image_rect = mProfileIcon->getRect();
|
||||
S32 width = old_floater_rect.getWidth() - old_image_rect.getWidth() + mLastWidth;
|
||||
S32 height = old_floater_rect.getHeight() - old_image_rect.getHeight() + mLastHeight;
|
||||
|
||||
const F32 MAX_DIMENTIONS = 512; // most profiles are supposed to be 256x256
|
||||
|
||||
S32 biggest_dim = llmax(width, height);
|
||||
if (biggest_dim > MAX_DIMENTIONS)
|
||||
{
|
||||
F32 scale_down = MAX_DIMENTIONS / (F32)biggest_dim;
|
||||
width *= scale_down;
|
||||
height *= scale_down;
|
||||
}
|
||||
|
||||
//reshape floater
|
||||
reshape(width, height);
|
||||
|
||||
gFloaterView->adjustToFitScreen(this, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterProfileTexture::draw()
|
||||
{
|
||||
// drawFrustum
|
||||
LLView *owner = mOwnerHandle.get();
|
||||
static LLCachedControl<F32> max_opacity(gSavedSettings, "PickerContextOpacity", 0.4f);
|
||||
drawConeToOwner(mContextConeOpacity, max_opacity, owner);
|
||||
|
||||
LLFloater::draw();
|
||||
}
|
||||
|
||||
void LLFloaterProfileTexture::onOpen(const LLSD& key)
|
||||
{
|
||||
mCloseButton->setFocus(true);
|
||||
}
|
||||
|
||||
void LLFloaterProfileTexture::resetAsset()
|
||||
{
|
||||
mProfileIcon->setValue("Generic_Person_Large");
|
||||
mImageID = LLUUID::null;
|
||||
if (mImage.notNull())
|
||||
{
|
||||
mImage->setBoostLevel(mImageOldBoostLevel);
|
||||
mImage->forceActive(); // <FS:Ansariel> Make sure it can get discarded
|
||||
mImage = NULL;
|
||||
}
|
||||
}
|
||||
void LLFloaterProfileTexture::loadAsset(const LLUUID &image_id)
|
||||
{
|
||||
if (mImageID != image_id)
|
||||
{
|
||||
if (mImage.notNull())
|
||||
{
|
||||
mImage->setBoostLevel(mImageOldBoostLevel);
|
||||
mImage->forceActive(); // <FS:Ansariel> Make sure it can get discarded
|
||||
mImage = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
mProfileIcon->setValue(image_id);
|
||||
mImageID = image_id;
|
||||
mImage = LLViewerTextureManager::getFetchedTexture(mImageID, FTT_DEFAULT, MIPMAP_TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
|
||||
mImageOldBoostLevel = mImage->getBoostLevel();
|
||||
|
||||
if ((mImage->getFullWidth() * mImage->getFullHeight()) == 0)
|
||||
{
|
||||
mImage->setLoadedCallback(LLFloaterProfileTexture::onTextureLoaded,
|
||||
0, TRUE, FALSE, new LLHandle<LLFloater>(getHandle()), &mCallbackTextureList);
|
||||
|
||||
mImage->setBoostLevel(LLGLTexture::BOOST_PREVIEW);
|
||||
mAssetStatus = LLPreview::PREVIEW_ASSET_LOADING;
|
||||
}
|
||||
else
|
||||
{
|
||||
mAssetStatus = LLPreview::PREVIEW_ASSET_LOADED;
|
||||
}
|
||||
|
||||
mUpdateDimensions = TRUE;
|
||||
updateDimensions();
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloaterProfileTexture::onTextureLoaded(
|
||||
BOOL success,
|
||||
LLViewerFetchedTexture *src_vi,
|
||||
LLImageRaw* src,
|
||||
LLImageRaw* aux_src,
|
||||
S32 discard_level,
|
||||
BOOL final,
|
||||
void* userdata)
|
||||
{
|
||||
LLHandle<LLFloater>* handle = (LLHandle<LLFloater>*)userdata;
|
||||
|
||||
if (!handle->isDead())
|
||||
{
|
||||
LLFloaterProfileTexture* floater = static_cast<LLFloaterProfileTexture*>(handle->get());
|
||||
if (floater && success)
|
||||
{
|
||||
floater->mUpdateDimensions = TRUE;
|
||||
floater->updateDimensions();
|
||||
}
|
||||
}
|
||||
|
||||
if (final || !success)
|
||||
{
|
||||
delete handle;
|
||||
}
|
||||
}
|
||||
|
||||
// <FS:Ansariel> Add refresh function
|
||||
void LLFloaterProfileTexture::refresh()
|
||||
{
|
||||
if (mImageID.notNull() && mImage.notNull())
|
||||
{
|
||||
destroy_texture(mImageID);
|
||||
mImage->forceToRefetchTexture();
|
||||
}
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
/**
|
||||
* @file llfloaterprofiletexture.h
|
||||
* @brief LLFloaterProfileTexture class definition
|
||||
*
|
||||
* $LicenseInfo:firstyear=2022&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2022, 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_LLFLOATERPROFILETEXTURE_H
|
||||
#define LL_LLFLOATERPROFILETEXTURE_H
|
||||
|
||||
#include "llfloater.h"
|
||||
#include "llviewertexture.h"
|
||||
|
||||
class LLButton;
|
||||
class LLImageRaw;
|
||||
class LLIconCtrl;
|
||||
|
||||
class LLFloaterProfileTexture : public LLFloater
|
||||
{
|
||||
public:
|
||||
LLFloaterProfileTexture(LLView* owner);
|
||||
~LLFloaterProfileTexture();
|
||||
|
||||
void draw() override;
|
||||
void onOpen(const LLSD& key) override;
|
||||
|
||||
void resetAsset();
|
||||
void loadAsset(const LLUUID &image_id);
|
||||
|
||||
// <FS:Ansariel> Add refresh function
|
||||
void refresh();
|
||||
|
||||
|
||||
static void onTextureLoaded(
|
||||
BOOL success,
|
||||
LLViewerFetchedTexture *src_vi,
|
||||
LLImageRaw* src,
|
||||
LLImageRaw* aux_src,
|
||||
S32 discard_level,
|
||||
BOOL final,
|
||||
void* userdata);
|
||||
|
||||
void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override;
|
||||
protected:
|
||||
BOOL postBuild() override;
|
||||
|
||||
private:
|
||||
void updateDimensions();
|
||||
|
||||
LLUUID mImageID;
|
||||
LLPointer<LLViewerFetchedTexture> mImage;
|
||||
S32 mImageOldBoostLevel;
|
||||
S32 mAssetStatus;
|
||||
F32 mContextConeOpacity;
|
||||
S32 mLastHeight;
|
||||
S32 mLastWidth;
|
||||
BOOL mUpdateDimensions;
|
||||
|
||||
LLHandle<LLView> mOwnerHandle;
|
||||
LLIconCtrl* mProfileIcon;
|
||||
LLButton* mCloseButton;
|
||||
|
||||
LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList;
|
||||
};
|
||||
#endif // LL_LLFLOATERPROFILETEXTURE_H
|
||||
|
|
@ -572,9 +572,9 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
|
|||
}
|
||||
msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_EstateID, estate_id);
|
||||
|
||||
panel->getChild<LLLineEditor>("estate_id")->setValue(LLSD((F32) estate_id));
|
||||
panel->getChild<LLLineEditor>("grid_position_x")->setValue(LLSD((F32) grid_pos_x));
|
||||
panel->getChild<LLLineEditor>("grid_position_y")->setValue(LLSD((F32) grid_pos_y));
|
||||
panel->getChild<LLLineEditor>("estate_id")->setValue(LLSD::Integer(estate_id));
|
||||
panel->getChild<LLLineEditor>("grid_position_x")->setValue(LLSD::Integer(grid_pos_x));
|
||||
panel->getChild<LLLineEditor>("grid_position_y")->setValue(LLSD::Integer(grid_pos_y));
|
||||
// </FS:Zi>
|
||||
|
||||
// DEBUG PANEL
|
||||
|
|
@ -720,9 +720,7 @@ void LLFloaterRegionInfo::refreshFromRegion(LLViewerRegion* region)
|
|||
std::for_each(
|
||||
mInfoPanels.begin(),
|
||||
mInfoPanels.end(),
|
||||
llbind2nd(
|
||||
std::mem_fun(&LLPanelRegionInfo::refreshFromRegion),
|
||||
region));
|
||||
[region](info_panels_t::value_type panel) { panel->refreshFromRegion(region); });
|
||||
mEnvironmentPanel->refreshFromRegion(region);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -659,14 +659,33 @@ void LLFloaterTools::refresh()
|
|||
LLViewerObject* selected_object = mObjectSelection->getFirstObject();
|
||||
if (selected_object)
|
||||
{
|
||||
// Select a parcel at the currently selected object's position.
|
||||
LLViewerParcelMgr::getInstance()->selectParcelAt(selected_object->getPositionGlobal());
|
||||
// <FS:Ansariel> FIRE-20387: Editing HUD attachment shows [CAPACITY_STRING] in tools floater
|
||||
//LLViewerParcelMgr::getInstance()->selectParcelAt(selected_object->getPositionGlobal());
|
||||
if (!selected_object->isAttachment())
|
||||
{
|
||||
LLViewerParcelMgr::getInstance()->selectParcelAt(selected_object->getPositionGlobal());
|
||||
}
|
||||
else
|
||||
{
|
||||
const LLStringExplicit empty_str("");
|
||||
childSetTextArg("more info label", "[CAPACITY_STRING]", empty_str);
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Failed to get selected object" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
// <FS:Ansariel> Bring back remaining capacity info
|
||||
else
|
||||
{
|
||||
// Selection crosses parcel bounds.
|
||||
// We don't display remaining land capacity in this case.
|
||||
const LLStringExplicit empty_str("");
|
||||
childSetTextArg("more info label", "[CAPACITY_STRING]", empty_str);
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
// <FS:Ansariel> We got this already
|
||||
//if (object_count == 1)
|
||||
|
|
@ -1071,8 +1090,9 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
|
|||
// <FS>
|
||||
getChildView("more info label")->setVisible(!land_visible && have_selection);
|
||||
getChildView("selection_count")->setVisible(!land_visible && have_selection);
|
||||
getChildView("selection_faces")->setVisible(LLToolFace::getInstance() == LLToolMgr::getInstance()->getCurrentTool()
|
||||
&& LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1);
|
||||
// <FS:Ansariel> We got this already
|
||||
//getChildView("selection_faces")->setVisible(LLToolFace::getInstance() == LLToolMgr::getInstance()->getCurrentTool()
|
||||
// && LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1);
|
||||
getChildView("selection_empty")->setVisible(!land_visible && !have_selection);
|
||||
|
||||
//mTab->setVisible(!land_visible);
|
||||
|
|
@ -1485,6 +1505,27 @@ void LLFloaterTools::updateLandImpacts()
|
|||
return;
|
||||
}
|
||||
|
||||
// <FS:Ansariel> Bring back remaining capacity info
|
||||
S32 rezzed_prims = parcel->getSimWidePrimCount();
|
||||
S32 total_capacity = parcel->getSimWideMaxPrimCapacity();
|
||||
LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
|
||||
if (region)
|
||||
{
|
||||
S32 max_tasks_per_region = (S32)region->getMaxTasks();
|
||||
total_capacity = llmin(total_capacity, max_tasks_per_region);
|
||||
}
|
||||
std::string remaining_capacity_str = "";
|
||||
|
||||
if (gMeshRepo.meshRezEnabled())
|
||||
{
|
||||
LLStringUtil::format_map_t remaining_capacity_args;
|
||||
remaining_capacity_args["LAND_CAPACITY"] = llformat("%d", total_capacity - rezzed_prims);
|
||||
remaining_capacity_str = getString("status_remaining_capacity", remaining_capacity_args);
|
||||
}
|
||||
|
||||
childSetTextArg("more info label", "[CAPACITY_STRING]", remaining_capacity_str);
|
||||
// </FS:Ansariel>
|
||||
|
||||
// Update land impacts info in the weights floater
|
||||
LLFloaterObjectWeights* object_weights_floater = LLFloaterReg::findTypedInstance<LLFloaterObjectWeights>("object_weights");
|
||||
if(object_weights_floater)
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ void LLFloaterVoiceVolume::onOpen(const LLSD& data)
|
|||
// Extract appropriate avatar id
|
||||
mAvatarID = data["avatar_id"];
|
||||
|
||||
LLUI::getInstance()->positionViewNearMouse(this);
|
||||
LLInspect::repositionInspector(data);
|
||||
|
||||
getChild<LLUICtrl>("avatar_name")->setValue("");
|
||||
updateVolumeControls();
|
||||
|
|
|
|||
|
|
@ -1,81 +0,0 @@
|
|||
/**
|
||||
* @file llfloaterwebprofile.cpp
|
||||
* @brief Avatar profile floater.
|
||||
*
|
||||
* $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 "llfloaterwebprofile.h"
|
||||
|
||||
#include "llviewercontrol.h"
|
||||
|
||||
LLFloaterWebProfile::LLFloaterWebProfile(const Params& key) :
|
||||
LLFloaterWebContent(key)
|
||||
{
|
||||
}
|
||||
|
||||
void LLFloaterWebProfile::onOpen(const LLSD& key)
|
||||
{
|
||||
Params p(key);
|
||||
p.show_chrome(true);
|
||||
p.window_class("profile");
|
||||
p.allow_address_entry(false);
|
||||
p.trusted_content(true);
|
||||
LLFloaterWebContent::onOpen(p);
|
||||
applyPreferredRect();
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLFloaterWebProfile::handleReshape(const LLRect& new_rect, bool by_user)
|
||||
{
|
||||
LL_DEBUGS() << "handleReshape: " << new_rect << LL_ENDL;
|
||||
|
||||
if (by_user && !isMinimized())
|
||||
{
|
||||
LL_DEBUGS() << "Storing new rect" << LL_ENDL;
|
||||
gSavedSettings.setRect("WebProfileFloaterRect", new_rect);
|
||||
}
|
||||
|
||||
LLFloaterWebContent::handleReshape(new_rect, by_user);
|
||||
}
|
||||
|
||||
LLFloater* LLFloaterWebProfile::create(const LLSD& key)
|
||||
{
|
||||
LLFloaterWebContent::Params p(key);
|
||||
preCreate(p);
|
||||
return new LLFloaterWebProfile(p);
|
||||
}
|
||||
|
||||
void LLFloaterWebProfile::applyPreferredRect()
|
||||
{
|
||||
const LLRect preferred_rect = gSavedSettings.getRect("WebProfileFloaterRect");
|
||||
LL_DEBUGS() << "Applying preferred rect: " << preferred_rect << LL_ENDL;
|
||||
|
||||
// Don't override position that may have been set by floater stacking code.
|
||||
LLRect new_rect = getRect();
|
||||
new_rect.setLeftTopAndSize(
|
||||
new_rect.mLeft, new_rect.mTop,
|
||||
preferred_rect.getWidth(), preferred_rect.getHeight());
|
||||
setShape(new_rect);
|
||||
}
|
||||
|
|
@ -773,7 +773,7 @@ S32 LLGestureMgr::getPlayingCount() const
|
|||
}
|
||||
|
||||
|
||||
struct IsGesturePlaying : public std::unary_function<LLMultiGesture*, bool>
|
||||
struct IsGesturePlaying
|
||||
{
|
||||
bool operator()(const LLMultiGesture* gesture) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@
|
|||
#include "llurlaction.h"
|
||||
|
||||
static LLDefaultChildRegistry::Register<LLGroupList> r("group_list");
|
||||
S32 LLGroupListItem::sIconWidth = 0;
|
||||
|
||||
class LLGroupComparator : public LLFlatListView::ItemComparator
|
||||
{
|
||||
|
|
@ -70,8 +69,35 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
//static const LLGroupComparator GROUP_COMPARATOR;
|
||||
static LLGroupComparator GROUP_COMPARATOR; // <ND/> const makes GCC >= 4.6 very angry about not user defined default ctor.
|
||||
class LLSharedGroupComparator : public LLFlatListView::ItemComparator
|
||||
{
|
||||
public:
|
||||
LLSharedGroupComparator() {};
|
||||
|
||||
/*virtual*/ bool compare(const LLPanel* item1, const LLPanel* item2) const
|
||||
{
|
||||
const LLGroupListItem* group_item1 = static_cast<const LLGroupListItem*>(item1);
|
||||
std::string name1 = group_item1->getGroupName();
|
||||
bool item1_shared = gAgent.isInGroup(group_item1->getGroupID(), true);
|
||||
|
||||
const LLGroupListItem* group_item2 = static_cast<const LLGroupListItem*>(item2);
|
||||
std::string name2 = group_item2->getGroupName();
|
||||
bool item2_shared = gAgent.isInGroup(group_item2->getGroupID(), true);
|
||||
|
||||
if (item2_shared != item1_shared)
|
||||
{
|
||||
return item1_shared;
|
||||
}
|
||||
|
||||
LLStringUtil::toUpper(name1);
|
||||
LLStringUtil::toUpper(name2);
|
||||
|
||||
return name1 < name2;
|
||||
}
|
||||
};
|
||||
|
||||
static LLGroupComparator GROUP_COMPARATOR;
|
||||
static LLSharedGroupComparator SHARED_GROUP_COMPARATOR;
|
||||
|
||||
LLGroupList::Params::Params()
|
||||
: for_agent("for_agent", true)
|
||||
|
|
@ -80,7 +106,7 @@ LLGroupList::Params::Params()
|
|||
|
||||
LLGroupList::LLGroupList(const Params& p)
|
||||
: LLFlatListViewEx(p)
|
||||
, mForAgent(p.for_agent)
|
||||
, mForAgent(p.for_agent)
|
||||
, mDirty(true) // to force initial update
|
||||
, mShowIcons(false)
|
||||
, mShowNone(true)
|
||||
|
|
@ -88,7 +114,15 @@ LLGroupList::LLGroupList(const Params& p)
|
|||
setCommitOnSelectionChange(true);
|
||||
|
||||
// Set default sort order.
|
||||
setComparator(&GROUP_COMPARATOR);
|
||||
if (mForAgent)
|
||||
{
|
||||
setComparator(&GROUP_COMPARATOR);
|
||||
}
|
||||
else
|
||||
{
|
||||
// shared groups first
|
||||
setComparator(&SHARED_GROUP_COMPARATOR);
|
||||
}
|
||||
|
||||
if (mForAgent)
|
||||
{
|
||||
|
|
@ -98,18 +132,18 @@ LLGroupList::LLGroupList(const Params& p)
|
|||
|
||||
LLGroupList::~LLGroupList()
|
||||
{
|
||||
if (mForAgent) gAgent.removeListener(this);
|
||||
if (mContextMenuHandle.get()) mContextMenuHandle.get()->die();
|
||||
if (mForAgent) gAgent.removeListener(this);
|
||||
if (mContextMenuHandle.get()) mContextMenuHandle.get()->die();
|
||||
}
|
||||
|
||||
void LLGroupList::enableForAgent(bool show_icons)
|
||||
{
|
||||
mForAgent = true;
|
||||
|
||||
mShowIcons = mForAgent && gSavedSettings.getBOOL("GroupListShowIcons") && show_icons;
|
||||
mShowIcons = mForAgent && gSavedSettings.getBOOL("GroupListShowIcons") && show_icons;
|
||||
|
||||
// Listen for agent group changes.
|
||||
gAgent.addListener(this, "new group");
|
||||
// Listen for agent group changes.
|
||||
gAgent.addListener(this, "new group");
|
||||
|
||||
// Set up context menu.
|
||||
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
|
||||
|
|
@ -138,15 +172,15 @@ BOOL LLGroupList::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
|||
{
|
||||
BOOL handled = LLUICtrl::handleRightMouseDown(x, y, mask);
|
||||
|
||||
if (mForAgent)
|
||||
{
|
||||
LLToggleableMenu* context_menu = mContextMenuHandle.get();
|
||||
if (context_menu && size() > 0)
|
||||
{
|
||||
context_menu->buildDrawLabels();
|
||||
context_menu->updateParent(LLMenuGL::sMenuContainer);
|
||||
LLMenuGL::showPopup(this, context_menu, x, y);
|
||||
}
|
||||
if (mForAgent)
|
||||
{
|
||||
LLToggleableMenu* context_menu = mContextMenuHandle.get();
|
||||
if (context_menu && size() > 0)
|
||||
{
|
||||
context_menu->buildDrawLabels();
|
||||
context_menu->updateParent(LLMenuGL::sMenuContainer);
|
||||
LLMenuGL::showPopup(this, context_menu, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
return handled;
|
||||
|
|
@ -159,7 +193,7 @@ BOOL LLGroupList::handleDoubleClick(S32 x, S32 y, MASK mask)
|
|||
// Handle double click only for the selected item in the list, skip clicks on empty space.
|
||||
if (handled)
|
||||
{
|
||||
if (mDoubleClickSignal)
|
||||
if (mDoubleClickSignal && getItemsRect().pointInRect(x, y))
|
||||
{
|
||||
(*mDoubleClickSignal)(this, x, y, mask);
|
||||
}
|
||||
|
|
@ -191,51 +225,49 @@ static bool findInsensitive(std::string haystack, const std::string& needle_uppe
|
|||
|
||||
void LLGroupList::refresh()
|
||||
{
|
||||
if (mForAgent)
|
||||
{
|
||||
const LLUUID& highlight_id = gAgent.getGroupID();
|
||||
S32 count = gAgent.mGroups.size();
|
||||
LLUUID id;
|
||||
bool have_filter = !mNameFilter.empty();
|
||||
if (mForAgent)
|
||||
{
|
||||
const LLUUID& highlight_id = gAgent.getGroupID();
|
||||
S32 count = gAgent.mGroups.size();
|
||||
LLUUID id;
|
||||
bool have_filter = !mNameFilter.empty();
|
||||
|
||||
clear();
|
||||
clear();
|
||||
|
||||
for(S32 i = 0; i < count; ++i)
|
||||
{
|
||||
id = gAgent.mGroups.at(i).mID;
|
||||
const LLGroupData& group_data = gAgent.mGroups.at(i);
|
||||
if (have_filter && !findInsensitive(group_data.mName, mNameFilter))
|
||||
continue;
|
||||
// <FS:Ansariel> Mark groups hidden in profile
|
||||
//addNewItem(id, group_data.mName, group_data.mInsigniaID, ADD_BOTTOM);
|
||||
addNewItem(id, group_data.mName, group_data.mInsigniaID, ADD_BOTTOM, group_data.mListInProfile);
|
||||
}
|
||||
for(S32 i = 0; i < count; ++i)
|
||||
{
|
||||
id = gAgent.mGroups.at(i).mID;
|
||||
const LLGroupData& group_data = gAgent.mGroups.at(i);
|
||||
if (have_filter && !findInsensitive(group_data.mName, mNameFilter))
|
||||
continue;
|
||||
addNewItem(id, group_data.mName, group_data.mInsigniaID, ADD_BOTTOM, group_data.mListInProfile);
|
||||
}
|
||||
|
||||
// Sort the list.
|
||||
sort();
|
||||
// Sort the list.
|
||||
sort();
|
||||
|
||||
// Add "none" to list at top if filter not set (what's the point of filtering "none"?).
|
||||
// but only if some real groups exists. EXT-4838
|
||||
if (!have_filter && count > 0 && mShowNone)
|
||||
{
|
||||
std::string loc_none = LLTrans::getString("GroupsNone");
|
||||
addNewItem(LLUUID::null, loc_none, LLUUID::null, ADD_TOP);
|
||||
}
|
||||
// Add "none" to list at top if filter not set (what's the point of filtering "none"?).
|
||||
// but only if some real groups exists. EXT-4838
|
||||
if (!have_filter && count > 0 && mShowNone)
|
||||
{
|
||||
std::string loc_none = LLTrans::getString("GroupsNone");
|
||||
addNewItem(LLUUID::null, loc_none, LLUUID::null, ADD_TOP);
|
||||
}
|
||||
|
||||
selectItemByUUID(highlight_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
clear();
|
||||
selectItemByUUID(highlight_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
clear();
|
||||
|
||||
for (group_map_t::iterator it = mGroups.begin(); it != mGroups.end(); ++it)
|
||||
{
|
||||
addNewItem(it->second, it->first, LLUUID::null, ADD_BOTTOM);
|
||||
}
|
||||
for (group_map_t::iterator it = mGroups.begin(); it != mGroups.end(); ++it)
|
||||
{
|
||||
addNewItem(it->second, it->first, LLUUID::null, ADD_BOTTOM);
|
||||
}
|
||||
|
||||
// Sort the list.
|
||||
sort();
|
||||
}
|
||||
// Sort the list.
|
||||
sort();
|
||||
}
|
||||
|
||||
setDirty(false);
|
||||
onCommit();
|
||||
|
|
@ -258,19 +290,17 @@ void LLGroupList::toggleIcons()
|
|||
|
||||
void LLGroupList::setGroups(const std::map< std::string,LLUUID> group_list)
|
||||
{
|
||||
mGroups = group_list;
|
||||
setDirty(true);
|
||||
mGroups = group_list;
|
||||
setDirty(true);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// PRIVATE Section
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// <FS:Ansariel> Mark groups hidden in profile
|
||||
//void LLGroupList::addNewItem(const LLUUID& id, const std::string& name, const LLUUID& icon_id, EAddPosition pos)
|
||||
void LLGroupList::addNewItem(const LLUUID& id, const std::string& name, const LLUUID& icon_id, EAddPosition pos, bool visible_in_profile)
|
||||
{
|
||||
LLGroupListItem* item = new LLGroupListItem(mForAgent && mShowIcons);
|
||||
LLGroupListItem* item = new LLGroupListItem(mForAgent, mShowIcons);
|
||||
|
||||
item->setGroupID(id);
|
||||
item->setName(name, mNameFilter);
|
||||
|
|
@ -279,7 +309,10 @@ void LLGroupList::addNewItem(const LLUUID& id, const std::string& name, const LL
|
|||
item->getChildView("info_btn")->setVisible( false);
|
||||
item->getChildView("profile_btn")->setVisible( false);
|
||||
item->setGroupIconVisible(mShowIcons);
|
||||
|
||||
if (!mShowIcons)
|
||||
{
|
||||
item->setVisibleInProfile(visible_in_profile);
|
||||
}
|
||||
// <FS:Ansariel> Mark groups hidden in profile
|
||||
item->setVisibleInProfile(visible_in_profile);
|
||||
// </FS:Ansariel> Mark groups hidden in profile
|
||||
|
|
@ -299,30 +332,28 @@ bool LLGroupList::handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD&
|
|||
return true;
|
||||
}
|
||||
|
||||
// <FS:Ansariel> Mark groups hidden in profile
|
||||
if (event->desc() == "value_changed")
|
||||
{
|
||||
LLSD data = event->getValue();
|
||||
if (data.has("group_id") && data.has("visible"))
|
||||
{
|
||||
LLUUID group_id = data["group_id"].asUUID();
|
||||
bool visible = data["visible"].asBoolean();
|
||||
if (event->desc() == "value_changed")
|
||||
{
|
||||
LLSD data = event->getValue();
|
||||
if (data.has("group_id") && data.has("visible"))
|
||||
{
|
||||
LLUUID group_id = data["group_id"].asUUID();
|
||||
bool visible = data["visible"].asBoolean();
|
||||
|
||||
std::vector<LLPanel*> items;
|
||||
getItems(items);
|
||||
for (std::vector<LLPanel*>::iterator it = items.begin(); it != items.end(); ++it)
|
||||
{
|
||||
LLGroupListItem* item = dynamic_cast<LLGroupListItem*>(*it);
|
||||
if (item && item->getGroupID() == group_id)
|
||||
{
|
||||
item->setVisibleInProfile(visible);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
std::vector<LLPanel*> items;
|
||||
getItems(items);
|
||||
for (std::vector<LLPanel*>::iterator it = items.begin(); it != items.end(); ++it)
|
||||
{
|
||||
LLGroupListItem* item = dynamic_cast<LLGroupListItem*>(*it);
|
||||
if (item && item->getGroupID() == group_id)
|
||||
{
|
||||
item->setVisibleInProfile(visible);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -387,24 +418,25 @@ bool LLGroupList::onContextMenuItemEnable(const LLSD& userdata)
|
|||
/* LLGroupListItem implementation */
|
||||
/************************************************************************/
|
||||
|
||||
LLGroupListItem::LLGroupListItem(bool for_agent)
|
||||
LLGroupListItem::LLGroupListItem(bool for_agent, bool show_icons)
|
||||
: LLPanel(),
|
||||
mGroupIcon(NULL),
|
||||
mGroupNameBox(NULL),
|
||||
mInfoBtn(NULL),
|
||||
mGroupID(LLUUID::null)
|
||||
mProfileBtn(NULL),
|
||||
mVisibilityHideBtn(NULL),
|
||||
mVisibilityShowBtn(NULL),
|
||||
mGroupID(LLUUID::null),
|
||||
mForAgent(for_agent)
|
||||
{
|
||||
if (for_agent)
|
||||
buildFromFile( "panel_group_list_item.xml");
|
||||
else
|
||||
buildFromFile( "panel_group_list_item_short.xml");
|
||||
|
||||
// Remember group icon width including its padding from the name text box,
|
||||
// so that we can hide and show the icon again later.
|
||||
if (!sIconWidth)
|
||||
{
|
||||
sIconWidth = mGroupNameBox->getRect().mLeft - mGroupIcon->getRect().mLeft;
|
||||
}
|
||||
if (show_icons)
|
||||
{
|
||||
buildFromFile( "panel_group_list_item.xml");
|
||||
}
|
||||
else
|
||||
{
|
||||
buildFromFile( "panel_group_list_item_short.xml");
|
||||
}
|
||||
}
|
||||
|
||||
LLGroupListItem::~LLGroupListItem()
|
||||
|
|
@ -421,7 +453,25 @@ BOOL LLGroupListItem::postBuild()
|
|||
mInfoBtn = getChild<LLButton>("info_btn");
|
||||
mInfoBtn->setClickedCallback(boost::bind(&LLGroupListItem::onInfoBtnClick, this));
|
||||
|
||||
childSetAction("profile_btn", boost::bind(&LLGroupListItem::onProfileBtnClick, this));
|
||||
mProfileBtn = getChild<LLButton>("profile_btn");
|
||||
mProfileBtn->setClickedCallback([this](LLUICtrl *, const LLSD &) { onProfileBtnClick(); });
|
||||
|
||||
mVisibilityHideBtn = findChild<LLButton>("visibility_hide_btn");
|
||||
if (mVisibilityHideBtn)
|
||||
{
|
||||
mVisibilityHideBtn->setClickedCallback([this](LLUICtrl *, const LLSD &) { onVisibilityBtnClick(false); });
|
||||
}
|
||||
mVisibilityShowBtn = findChild<LLButton>("visibility_show_btn");
|
||||
if (mVisibilityShowBtn)
|
||||
{
|
||||
mVisibilityShowBtn->setClickedCallback([this](LLUICtrl *, const LLSD &) { onVisibilityBtnClick(true); });
|
||||
}
|
||||
|
||||
// Remember group icon width including its padding from the name text box,
|
||||
// so that we can hide and show the icon again later.
|
||||
// Also note that panel_group_list_item and panel_group_list_item_short
|
||||
// have icons of different sizes so we need to figure it per file.
|
||||
mIconWidth = mGroupNameBox->getRect().mLeft - mGroupIcon->getRect().mLeft;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -440,7 +490,16 @@ void LLGroupListItem::onMouseEnter(S32 x, S32 y, MASK mask)
|
|||
if (mGroupID.notNull()) // don't show the info button for the "none" group
|
||||
{
|
||||
mInfoBtn->setVisible(true);
|
||||
getChildView("profile_btn")->setVisible( true);
|
||||
mProfileBtn->setVisible(true);
|
||||
if (mForAgent && mVisibilityHideBtn)
|
||||
{
|
||||
LLGroupData agent_gdatap;
|
||||
if (gAgent.getGroupData(mGroupID, agent_gdatap))
|
||||
{
|
||||
mVisibilityHideBtn->setVisible(agent_gdatap.mListInProfile);
|
||||
mVisibilityShowBtn->setVisible(!agent_gdatap.mListInProfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LLPanel::onMouseEnter(x, y, mask);
|
||||
|
|
@ -450,7 +509,12 @@ void LLGroupListItem::onMouseLeave(S32 x, S32 y, MASK mask)
|
|||
{
|
||||
getChildView("hovered_icon")->setVisible( false);
|
||||
mInfoBtn->setVisible(false);
|
||||
getChildView("profile_btn")->setVisible( false);
|
||||
mProfileBtn->setVisible(false);
|
||||
if (mVisibilityHideBtn)
|
||||
{
|
||||
mVisibilityHideBtn->setVisible(false);
|
||||
mVisibilityShowBtn->setVisible(false);
|
||||
}
|
||||
|
||||
LLPanel::onMouseLeave(x, y, mask);
|
||||
}
|
||||
|
|
@ -468,7 +532,17 @@ void LLGroupListItem::setGroupID(const LLUUID& group_id)
|
|||
|
||||
mID = group_id;
|
||||
mGroupID = group_id;
|
||||
setActive(group_id == gAgent.getGroupID());
|
||||
|
||||
if (mForAgent)
|
||||
{
|
||||
// Active group should be bold.
|
||||
setBold(group_id == gAgent.getGroupID());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Groups shared with the agent should be bold
|
||||
setBold(gAgent.isInGroup(group_id, true));
|
||||
}
|
||||
|
||||
LLGroupMgr::getInstance()->addObserver(this);
|
||||
}
|
||||
|
|
@ -489,31 +563,28 @@ void LLGroupListItem::setGroupIconVisible(bool visible)
|
|||
|
||||
// Move the group name horizontally by icon size + its distance from the group name.
|
||||
LLRect name_rect = mGroupNameBox->getRect();
|
||||
name_rect.mLeft += visible ? sIconWidth : -sIconWidth;
|
||||
name_rect.mLeft += visible ? mIconWidth : -mIconWidth;
|
||||
mGroupNameBox->setRect(name_rect);
|
||||
}
|
||||
|
||||
// <FS:Ansariel> Mark groups hidden in profile
|
||||
void LLGroupListItem::setVisibleInProfile(bool visible)
|
||||
{
|
||||
mGroupNameBox->setColor(LLUIColorTable::instance().getColor((visible ? "GroupVisibleInProfile" : "GroupHiddenInProfile"), LLColor4::red).get());
|
||||
mGroupNameBox->setColor(LLUIColorTable::instance().getColor((visible ? "GroupVisibleInProfile" : "GroupHiddenInProfile"), LLColor4::red).get());
|
||||
}
|
||||
// </FS:Ansariel> Mark groups hidden in profile
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Private Section
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void LLGroupListItem::setActive(bool active)
|
||||
void LLGroupListItem::setBold(bool bold)
|
||||
{
|
||||
// *BUG: setName() overrides the style params.
|
||||
|
||||
// Active group should be bold.
|
||||
LLFontDescriptor new_desc(mGroupNameBox->getFont()->getFontDesc());
|
||||
|
||||
// *NOTE dzaporozhan
|
||||
// On Windows LLFontGL::NORMAL will not remove LLFontGL::BOLD if font
|
||||
// is predefined as bold (SansSerifSmallBold, for example)
|
||||
new_desc.setStyle(active ? LLFontGL::BOLD : LLFontGL::NORMAL);
|
||||
new_desc.setStyle(bold ? LLFontGL::BOLD : LLFontGL::NORMAL);
|
||||
LLFontGL* new_font = LLFontGL::getFont(new_desc);
|
||||
mGroupNameStyle.font = new_font;
|
||||
|
||||
|
|
@ -533,14 +604,25 @@ void LLGroupListItem::onProfileBtnClick()
|
|||
LLGroupActions::show(mGroupID);
|
||||
}
|
||||
|
||||
void LLGroupListItem::onVisibilityBtnClick(bool new_visibility)
|
||||
{
|
||||
LLGroupData agent_gdatap;
|
||||
if (gAgent.getGroupData(mGroupID, agent_gdatap))
|
||||
{
|
||||
gAgent.setUserGroupFlags(mGroupID, agent_gdatap.mAcceptNotices, new_visibility);
|
||||
setVisibleInProfile(new_visibility);
|
||||
mVisibilityHideBtn->setVisible(new_visibility);
|
||||
mVisibilityShowBtn->setVisible(!new_visibility);
|
||||
}
|
||||
}
|
||||
|
||||
void LLGroupListItem::changed(LLGroupChange gc)
|
||||
{
|
||||
LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(mID);
|
||||
// <FS:Ansariel> FIRE-22148: Only update group icon if the received group data actually contains group icon info
|
||||
//if (group_data)
|
||||
if ((gc == GC_ALL || gc == GC_PROPERTIES) && group_data)
|
||||
// </FS:Ansariel>
|
||||
setGroupIconID(group_data->mInsigniaID);
|
||||
{
|
||||
setGroupIconID(group_data->mInsigniaID);
|
||||
}
|
||||
}
|
||||
|
||||
//EOF
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue