diff --git a/indra/aistatemachine/aistatemachine.cpp b/indra/aistatemachine/aistatemachine.cpp index 134461e09..6afac951c 100644 --- a/indra/aistatemachine/aistatemachine.cpp +++ b/indra/aistatemachine/aistatemachine.cpp @@ -407,7 +407,7 @@ void AIEngine::setMaxCount(F32 StateMachineMaxTime) sMaxCount = calc_clock_frequency() * StateMachineMaxTime / 1000; } -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG char const* AIStateMachine::event_str(event_type event) { switch(event) diff --git a/indra/aistatemachine/aistatemachine.h b/indra/aistatemachine/aistatemachine.h index be73dec96..f60430ed9 100644 --- a/indra/aistatemachine/aistatemachine.h +++ b/indra/aistatemachine/aistatemachine.h @@ -330,7 +330,7 @@ public: bool mDebugAdvanceStatePending; // True while advance_state() was called by not handled yet. bool mDebugRefCalled; // True when ref() is called (or will be called within the critial area of mMultiplexMutex). #endif -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG protected: bool mSMDebug; // Print debug output only when true. #endif @@ -343,7 +343,7 @@ public: mThreadId(AIThreadID::none), mDebugLastState(bs_killed), mDebugShouldRun(false), mDebugAborted(false), mDebugContPending(false), mDebugSetStatePending(false), mDebugAdvanceStatePending(false), mDebugRefCalled(false), #endif -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG mSMDebug(debug), #endif mRuntime(0) @@ -428,7 +428,7 @@ public: // Return stringified state, for debugging purposes. char const* state_str(base_state_type state); -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG char const* event_str(event_type event); #endif diff --git a/indra/aistatemachine/aistatemachinethread.h b/indra/aistatemachine/aistatemachinethread.h index 58b1e812a..193c2e0d4 100644 --- a/indra/aistatemachine/aistatemachinethread.h +++ b/indra/aistatemachine/aistatemachinethread.h @@ -182,7 +182,7 @@ class AIStateMachineThreadBase : public AIStateMachine { protected: AIStateMachineThreadBase(CWD_ONLY(bool debug)) -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG : AIStateMachine(debug) #endif { } @@ -222,7 +222,7 @@ class AIStateMachineThread : public AIStateMachineThreadBase { public: // Constructor. AIStateMachineThread(CWD_ONLY(bool debug)) -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG : AIStateMachineThreadBase(debug) #endif { diff --git a/indra/aistatemachine/aitimer.h b/indra/aistatemachine/aitimer.h index f3623c1d9..97f3b297e 100644 --- a/indra/aistatemachine/aitimer.h +++ b/indra/aistatemachine/aitimer.h @@ -77,7 +77,7 @@ class AITimer : public AIStateMachine { public: AITimer(CWD_ONLY(bool debug = false)) : -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG AIStateMachine(debug), #endif mInterval(0) { DoutEntering(dc::statemachine(mSMDebug), "AITimer(void) [" << (void*)this << "]"); } diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index fffe868fd..51532054c 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -16,6 +16,8 @@ else (STANDALONE OR USE_SYSTEM_OPENSSL) set(OPENSSL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) endif (STANDALONE OR USE_SYSTEM_OPENSSL) -if (LINUX OR DARWIN) +if (LINUX) + set(CRYPTO_LIBRARIES crypto dl) +elseif (DARWIN) set(CRYPTO_LIBRARIES crypto) -endif (LINUX OR DARWIN) +endif (LINUX) diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake index 011b87f64..565c22cec 100644 --- a/indra/cmake/PNG.cmake +++ b/indra/cmake/PNG.cmake @@ -13,7 +13,25 @@ else (STANDALONE) elseif(DARWIN) set(PNG_LIBRARIES png15) else(LINUX) - set(PNG_LIBRARIES png15) + if (CMAKE_SIZEOF_VOID_P EQUAL 4) # Singu TODO: update png + set(PNG_LIBRARIES png15) + else () + # + # When we have updated static libraries in competition with older + # shared libraries and we want the former to win, we need to do some + # extra work. The *_PRELOAD_ARCHIVES settings are invoked early + # and will pull in the entire archive to the binary giving it + # priority in symbol resolution. Beware of cmake moving the + # achive load itself to another place on the link command line. If + # that happens, you can try something like -Wl,-lpng16 here to hide + # the archive. Also be aware that the linker will not tolerate a + # second whole-archive load of the archive. See viewer's + # CMakeLists.txt for more information. + # + set(PNG_PRELOAD_ARCHIVES -Wl,--whole-archive png16 -Wl,--no-whole-archive) + set(PNG_LIBRARIES png16) + set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng16) + endif () endif() set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/) endif (STANDALONE) diff --git a/indra/cmake/WebKitLibPlugin.cmake b/indra/cmake/WebKitLibPlugin.cmake index 5d1036c6f..7a6305f22 100644 --- a/indra/cmake/WebKitLibPlugin.cmake +++ b/indra/cmake/WebKitLibPlugin.cmake @@ -50,7 +50,6 @@ elseif (LINUX) ssl # qgif # qjpeg - jscore jpeg fontconfig X11 @@ -58,5 +57,8 @@ elseif (LINUX) Xext GL ) + if (CMAKE_SIZEOF_VOID_P EQUAL 4) # Singu TODO: update webkit + set(WEBKIT_PLUGIN_LIBRARIES ${WEBKIT_PLUGIN_LIBRARIES} jscore) + endif (CMAKE_SIZEOF_VOID_P EQUAL 4) endif (STANDALONE) endif (WINDOWS) diff --git a/indra/cwdebug/debug.h b/indra/cwdebug/debug.h index 58e0c6ac9..93a037c92 100644 --- a/indra/cwdebug/debug.h +++ b/indra/cwdebug/debug.h @@ -28,97 +28,16 @@ #ifndef CWDEBUG #ifdef DEBUG_CURLIO - -// If CWDEBUG is not defined, but DEBUG_CURLIO is, then replace -// some of the cwd macro's with something that generates viewer -// specific debug output. Note that this generates a LOT of -// output and should not normally be defined. - -#include -#include "llpreprocessor.h" - -namespace debug { -namespace libcwd { - -struct buf2str { - buf2str(char const* buf, int size) : mBuf(buf), mSize(size) { } - char const* mBuf; - int mSize; -}; - -struct libcwd_do_type { - void on() const { } -}; -extern LL_COMMON_API libcwd_do_type const libcw_do; - -} // namespace libcwd - -enum print_thread_id_t { print_thread_id }; -inline void init() { } -struct Indent { - int M_indent; - static ll_thread_local int S_indentation; - enum LL_COMMON_API print_nt { print }; - LL_COMMON_API Indent(int indent); - LL_COMMON_API ~Indent(); -}; - -extern LL_COMMON_API std::ostream& operator<<(std::ostream& os, libcwd::buf2str const& b2s); -extern LL_COMMON_API std::ostream& operator<<(std::ostream& os, Indent::print_nt); -extern LL_COMMON_API std::ostream& operator<<(std::ostream& os, print_thread_id_t); - -namespace dc { - -struct fake_channel { - int mOn; - char const* mLabel; - fake_channel(int on, char const* label) : mOn(on), mLabel(label) { } - fake_channel(void) : mOn(0) { } - fake_channel& operator()(bool) { return *this; } - fake_channel const& operator()(bool) const { return *this; } - bool is_on() const { return !!mOn; } - bool is_off() const { return !mOn; } - void on() const { } - void off() const { } -}; -extern LL_COMMON_API fake_channel const warning; -extern LL_COMMON_API fake_channel const curl; -extern LL_COMMON_API fake_channel const curlio; -extern LL_COMMON_API fake_channel const curltr; -extern LL_COMMON_API fake_channel const statemachine; -extern LL_COMMON_API fake_channel const notice; -extern LL_COMMON_API fake_channel const snapshot; - -} // namespace dc -} // namespace debug - -#define LIBCWD_DEBUG_CHANNELS debug -#define LibcwDoutScopeBegin(a, b, c) do { using namespace debug; using namespace debug::libcwd; llinfos_nf << print_thread_id << (c).mLabel << ": " << Indent::print; -#define LibcwDoutStream llcont -#define LibcwDoutScopeEnd llcont << llendl; } while(0) - -#define Debug(x) do { using namespace debug; using namespace debug::libcwd; x; } while(0) -#define Dout(a, b) do { using namespace debug; using namespace debug::libcwd; if ((a).mOn) { llinfos_nf << print_thread_id << (a).mLabel << ": " << Indent::print << b << llendl; } } while(0) -#define DoutEntering(a, b) \ - int __slviewer_debug_indentation = 2; \ - { \ - using namespace debug; \ - using namespace debug::libcwd; \ - if ((a).mOn) \ - llinfos_nf << print_thread_id << (a).mLabel << ": " << Indent::print << "Entering " << b << llendl; \ - else \ - __slviewer_debug_indentation = 0; \ - } \ - debug::Indent __slviewer_debug_indent(__slviewer_debug_indentation); - -#else // !DEBUG_CURLIO +#error DEBUG_CURLIO is not supported without libcwd. +// In order to use DEBUG_CURLIO you must install and use libcwd. +// Download libcwd: +// git clone https://github.com/CarloWood/libcwd.git +#endif #define Debug(x) #define Dout(a, b) #define DoutEntering(a, b) -#endif // !DEBUG_CURLIO - #ifndef DOXYGEN // No need to document this. See http://libcwd.sourceforge.net/ for more info. #include diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 3d3420961..d26b45208 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -182,9 +182,6 @@ LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) : } mIsBuilt = FALSE; - - mNumCollisionVolumes = 0; - mCollisionVolumes = NULL; } // virtual @@ -294,7 +291,7 @@ LLAvatarAppearance::~LLAvatarAppearance() mJointMap.clear(); clearSkeleton(); - deleteAndClearArray(mCollisionVolumes); + clearCollisionVolumes(); std::for_each(mPolyMeshes.begin(), mPolyMeshes.end(), DeletePairedPointer()); mPolyMeshes.clear(); @@ -575,12 +572,12 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent } else // collision volume { - if (volume_num >= (S32)mNumCollisionVolumes) + if (volume_num >= (S32)mCollisionVolumes.size()) { llwarns << "Too many bones" << llendl; return FALSE; } - joint = (&mCollisionVolumes[volume_num]); + joint = (mCollisionVolumes[volume_num]); joint->setName( info->mName ); } @@ -1250,12 +1247,12 @@ LLVector3 LLAvatarAppearance::getVolumePos(S32 joint_index, LLVector3& volume_of return LLVector3::zero; } - if (joint_index > mNumCollisionVolumes) + if (joint_index > (S32)mCollisionVolumes.size()) { return LLVector3::zero; } - return mCollisionVolumes[joint_index].getVolumePos(volume_offset); + return mCollisionVolumes[joint_index]->getVolumePos(volume_offset); } //----------------------------------------------------------------------------- @@ -1266,12 +1263,12 @@ LLJoint* LLAvatarAppearance::findCollisionVolume(U32 volume_id) //SNOW-488: As mNumCollisionVolumes is a S32 and we are casting from a U32 to a S32 //to compare we also need to be sure of the wrap around case producing (S32) <0 //or in terms of the U32 an out of bounds index in the array. - if ((S32)volume_id > mNumCollisionVolumes || (S32)volume_id<0) + if ((S32)volume_id > (S32)mCollisionVolumes.size() || (S32)volume_id<0) { return NULL; } - return &mCollisionVolumes[volume_id]; + return mCollisionVolumes[volume_id]; } //----------------------------------------------------------------------------- @@ -1279,9 +1276,9 @@ LLJoint* LLAvatarAppearance::findCollisionVolume(U32 volume_id) //----------------------------------------------------------------------------- S32 LLAvatarAppearance::getCollisionVolumeID(std::string &name) { - for (S32 i = 0; i < mNumCollisionVolumes; i++) + for (S32 i = 0; i < (S32)mCollisionVolumes.size(); i++) { - if (mCollisionVolumes[i].getName() == name) + if (mCollisionVolumes[i]->getName() == name) { return i; } @@ -1530,21 +1527,34 @@ LLTexLayerSet* LLAvatarAppearance::getAvatarLayerSet(EBakedTextureIndex baked_in return mBakedTextureDatas[baked_index].mTexLayerSet; } +void LLAvatarAppearance::clearCollisionVolumes() +{ + std::for_each(mCollisionVolumes.begin(), mCollisionVolumes.end(), + DeletePointer()); + mCollisionVolumes.clear(); +} + //----------------------------------------------------------------------------- // allocateCollisionVolumes() //----------------------------------------------------------------------------- BOOL LLAvatarAppearance::allocateCollisionVolumes( U32 num ) { - deleteAndClearArray(mCollisionVolumes); - mNumCollisionVolumes = 0; + mCollisionVolumes.reserve(num); - mCollisionVolumes = new LLAvatarJointCollisionVolume[num]; - if (!mCollisionVolumes) + LLAvatarJointCollisionVolume* cv; + for (U32 i = 0; i < num; ++i) { - return FALSE; + cv = new LLAvatarJointCollisionVolume(); + if (cv) + { + mCollisionVolumes.push_back(cv); + } + else + { + clearCollisionVolumes(); + return false; + } } - - mNumCollisionVolumes = num; return TRUE; } diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index b3a02e410..da4e09b42 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -337,9 +337,9 @@ protected: // Collision volumes //-------------------------------------------------------------------- public: - S32 mNumCollisionVolumes; - LLAvatarJointCollisionVolume* mCollisionVolumes; + std::vector mCollisionVolumes; protected: + void clearCollisionVolumes(); BOOL allocateCollisionVolumes(U32 num); /** Physics diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp index aeaf79f33..669c2e5fb 100644 --- a/indra/llappearance/llpolymorph.cpp +++ b/indra/llappearance/llpolymorph.cpp @@ -647,11 +647,11 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info) for (iter = getInfo()->mVolumeInfoList.begin(); iter != getInfo()->mVolumeInfoList.end(); iter++) { LLPolyVolumeMorphInfo *volume_info = &(*iter); - for (S32 i = 0; i < avatarp->mNumCollisionVolumes; i++) + for (S32 i = 0; i < (S32)avatarp->mCollisionVolumes.size(); i++) { - if (avatarp->mCollisionVolumes[i].getName() == volume_info->mName) + if (avatarp->mCollisionVolumes[i]->getName() == volume_info->mName) { - mVolumeMorphs.push_back(LLPolyVolumeMorph(&avatarp->mCollisionVolumes[i], + mVolumeMorphs.push_back(LLPolyVolumeMorph(avatarp->mCollisionVolumes[i], volume_info->mScale, volume_info->mPos)); break; diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index 8ae5141a1..4b6059f86 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -386,12 +386,12 @@ void LLApp::setupErrorHandling() // installing the handler. installHandler = true; } - #endif if(installHandler && (mExceptionHandler == 0)) { mExceptionHandler = new google_breakpad::ExceptionHandler(mDumpPath, clear_CrashLoggerReserve_callback, &unix_post_minidump_callback, 0, true, 0); } + #endif #elif LL_LINUX if(installHandler && (mExceptionHandler == 0)) { diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index a7d2eac67..e39fa373d 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -206,6 +206,7 @@ namespace return "Unknown"; } +#if LL_LINUX std::string compute_CPUFamilyName(const char* cpu_vendor, int composed_family) { const char* intel_string = "GenuineIntel"; @@ -221,6 +222,7 @@ namespace return "Unknown"; } +#else std::string compute_CPUFamilyName(const char* cpu_vendor, int family, int ext_family) { const char* intel_string = "GenuineIntel"; @@ -239,6 +241,7 @@ namespace } return "Unknown"; } +#endif } // end unnamed namespace diff --git a/indra/llcommon/llregistry.h b/indra/llcommon/llregistry.h index ca6d76a98..bb0d60247 100644 --- a/indra/llcommon/llregistry.h +++ b/indra/llcommon/llregistry.h @@ -307,8 +307,10 @@ public: virtual ~StaticRegistrar() {} StaticRegistrar(ref_const_key_t key, ref_const_value_t value) { - if(!singleton_t::instance().mStaticScope) - mStaticScope = new ScopedRegistrar(); + if (singleton_t::instance().exists(key)) + { + llerrs << "Duplicate registry entry under key \"" << key << "\"" << llendl; + } singleton_t::instance().mStaticScope->add(key, value); } }; @@ -338,7 +340,7 @@ protected: virtual void initSingleton() { - //mStaticScope = new ScopedRegistrar(); + mStaticScope = new ScopedRegistrar(); } virtual ~LLRegistrySingleton() diff --git a/indra/llcommon/llsingleton.cpp b/indra/llcommon/llsingleton.cpp index eb8e2c945..3d32d4771 100644 --- a/indra/llcommon/llsingleton.cpp +++ b/indra/llcommon/llsingleton.cpp @@ -28,5 +28,5 @@ #include "llsingleton.h" -std::map * LLSingletonRegistry::sSingletonMap = NULL; +std::map* LLSingletonRegistry::sSingletonMap = NULL; diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h index aa8efb1e0..b1e17fc13 100644 --- a/indra/llcommon/llsingleton.h +++ b/indra/llcommon/llsingleton.h @@ -33,34 +33,25 @@ /// @brief A global registry of all singletons to prevent duplicate allocations /// across shared library boundaries -class LLSingletonRegistry { - private: - typedef std::map TypeMap; - static LL_COMMON_API TypeMap * sSingletonMap; +class LL_COMMON_API LLSingletonRegistry +{ + typedef std::map TypeMap; + static TypeMap* sSingletonMap; - static void checkInit() - { - if(sSingletonMap == NULL) - { - sSingletonMap = new TypeMap(); - } - } +public: + template static void * & get() + { + std::string name(typeid(T).name()); + if (!sSingletonMap) sSingletonMap = new TypeMap(); - public: - template static void * & get() - { - std::string name(typeid(T).name()); + // the first entry of the pair returned by insert will be either the existing + // iterator matching our key, or the newly inserted NULL initialized entry + // see "Insert element" in http://www.sgi.com/tech/stl/UniqueAssociativeContainer.html + TypeMap::iterator result = + sSingletonMap->insert(std::make_pair(name, (void*)NULL)).first; - checkInit(); - - // the first entry of the pair returned by insert will be either the existing - // iterator matching our key, or the newly inserted NULL initialized entry - // see "Insert element" in http://www.sgi.com/tech/stl/UniqueAssociativeContainer.html - TypeMap::iterator result = - sSingletonMap->insert(std::make_pair(name, (void*)NULL)).first; - - return result->second; - } + return result->second; + } }; // LLSingleton implements the getInstance() method part of the Singleton @@ -90,7 +81,7 @@ class LLSingletonRegistry { template class LLSingleton : private boost::noncopyable { - + private: typedef enum e_init_state { @@ -100,34 +91,46 @@ private: INITIALIZED, DELETED } EInitState; - - // stores pointer to singleton instance - // and tracks initialization state of singleton - struct SingletonInstanceData - { - EInitState mInitState; - DERIVED_TYPE* mSingletonInstance; - - SingletonInstanceData() - : mSingletonInstance(NULL), - mInitState(UNINITIALIZED) - {} - ~SingletonInstanceData() + static DERIVED_TYPE* constructSingleton() + { + return new DERIVED_TYPE(); + } + + struct SingletonData; + + // stores pointer to singleton instance + struct SingletonLifetimeManager + { + SingletonLifetimeManager() { - if (mInitState != DELETED) + construct(); + } + + static void construct() + { + SingletonData& sData(getData()); + sData.mInitState = CONSTRUCTING; + sData.mInstance = constructSingleton(); + sData.mInitState = INITIALIZING; + } + + ~SingletonLifetimeManager() + { + SingletonData& sData(getData()); + if (sData.mInitState != DELETED) { deleteSingleton(); } } }; - + public: virtual ~LLSingleton() { - SingletonInstanceData& data = getData(); - data.mSingletonInstance = NULL; - data.mInitState = DELETED; + SingletonData& sData(getData()); + sData.mInstance = NULL; + sData.mInitState = DELETED; } /** @@ -152,37 +155,66 @@ public: */ static void deleteSingleton() { - DERIVED_TYPE* instance = getData().mSingletonInstance; - getData().mInitState = DELETED; - getData().mSingletonInstance = NULL; - delete instance; + SingletonData& sData(getData()); + delete sData.mInstance; + sData.mInstance = NULL; + sData.mInitState = DELETED; } - static SingletonInstanceData& getData() + static SingletonData& getData() { // this is static to cache the lookup results static void * & registry = LLSingletonRegistry::get(); // *TODO - look into making this threadsafe - if(NULL == registry) + if (!registry) { - static SingletonInstanceData data; + static SingletonData data; registry = &data; } - return *static_cast(registry); + return *static_cast(registry); } static DERIVED_TYPE* getInstance() { - SingletonInstanceData& data = getData(); + static SingletonLifetimeManager sLifeTimeMgr; + SingletonData& sData(getData()); - if (data.mInitState != INITIALIZED) + switch (sData.mInitState) { - createInstance(data); + case UNINITIALIZED: + // should never be uninitialized at this point + llassert(false); + return NULL; + case CONSTRUCTING: + llerrs << "Tried to access singleton " << typeid(DERIVED_TYPE).name() << " from singleton constructor!" << LL_ENDL; + return NULL; + case INITIALIZING: + // go ahead and flag ourselves as initialized so we can be reentrant during initialization + sData.mInitState = INITIALIZED; + // initialize singleton after constructing it so that it can reference other singletons which in turn depend on it, + // thus breaking cyclic dependencies + sData.mInstance->initSingleton(); + return sData.mInstance; + case INITIALIZED: + return sData.mInstance; + case DELETED: + llwarns << "Trying to access deleted singleton " << typeid(DERIVED_TYPE).name() << " creating new instance" << LL_ENDL; + SingletonLifetimeManager::construct(); + // same as first time construction + sData.mInitState = INITIALIZED; + sData.mInstance->initSingleton(); + return sData.mInstance; } - return data.mSingletonInstance; + return NULL; + } + + static DERIVED_TYPE* getIfExists() + { + SingletonData& sData(getData()); + return sData.mInstance; } // Reference version of getInstance() @@ -191,51 +223,34 @@ public: { return *getInstance(); } - + // Has this singleton been created uet? // Use this to avoid accessing singletons before the can safely be constructed static bool instanceExists() { - return getData().mInitState == INITIALIZED; + SingletonData& sData(getData()); + return sData.mInitState == INITIALIZED; } - + // Has this singleton already been deleted? // Use this to avoid accessing singletons from a static object's destructor static bool destroyed() { - return getData().mInitState == DELETED; + SingletonData& sData(getData()); + return sData.mInitState == DELETED; } private: - static void createInstance(SingletonInstanceData& data); + virtual void initSingleton() {} + + struct SingletonData + { + // explicitly has a default constructor so that member variables are zero initialized in BSS + // and only changed by singleton logic, not constructor running during startup + EInitState mInitState; + DERIVED_TYPE* mInstance; + }; }; -// Moved this here cause it's too big to be inlined --Aleric. -template -void LLSingleton::createInstance(SingletonInstanceData& data) -{ - if (data.mInitState == CONSTRUCTING) - { - llerrs << "Tried to access singleton " << typeid(DERIVED_TYPE).name() << " from singleton constructor!" << llendl; - } - - if (data.mInitState == DELETED) - { - llwarns << "Trying to access deleted singleton " << typeid(DERIVED_TYPE).name() << " creating new instance" << llendl; - } - - if (data.mInitState == INITIALIZING) - { - llerrs << "Tried to access singleton " << typeid(DERIVED_TYPE).name() << " from initSingleton(), using half-initialized object" << llendl; - return; - } - - data.mInitState = CONSTRUCTING; - data.mSingletonInstance = new DERIVED_TYPE(); - data.mInitState = INITIALIZING; - data.mSingletonInstance->initSingleton(); - data.mInitState = INITIALIZED; -} - #endif diff --git a/indra/llcommon/llversionviewer.h.in b/indra/llcommon/llversionviewer.h.in index 68949cee3..76d53b926 100644 --- a/indra/llcommon/llversionviewer.h.in +++ b/indra/llcommon/llversionviewer.h.in @@ -35,7 +35,7 @@ const S32 LL_VERSION_MAJOR = 1; const S32 LL_VERSION_MINOR = 8; -const S32 LL_VERSION_PATCH = 5; +const S32 LL_VERSION_PATCH = 6; const S32 LL_VERSION_BUILD = ${vBUILD}; const char * const LL_CHANNEL = "${VIEWER_CHANNEL}"; diff --git a/indra/llimage/llimagepng.cpp b/indra/llimage/llimagepng.cpp index 34f553ffc..294f68b12 100644 --- a/indra/llimage/llimagepng.cpp +++ b/indra/llimage/llimagepng.cpp @@ -122,53 +122,27 @@ BOOL LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time) // Image logical size setSize(raw_image->getWidth(), raw_image->getHeight(), raw_image->getComponents()); + // Temporary buffer to hold the encoded image. Note: the final image + // size should be much smaller due to compression. U32 bufferSize = getWidth() * getHeight() * getComponents() + 1024; - - //New implementation - allocateData(bufferSize); //Set to largest possible size. - if(isBufferInvalid()) //Checking - { - setLastError("LLImagePNG::encode failed allocateData"); - return FALSE; - } - - // Delegate actual encoding work to wrapper - LLPngWrapper pngWrapper; - if (! pngWrapper.writePng(raw_image, getData())) - { - setLastError(pngWrapper.getErrorMessage()); - deleteData(); - return FALSE; - } - - // Resize internal buffer. - if(!reallocateData(pngWrapper.getFinalSize())) //Shrink. Returns NULL on failure. - { - setLastError("LLImagePNG::encode failed reallocateData"); - deleteData(); - return FALSE; - } - return TRUE; - - - /*U8* mTmpWriteBuffer = new U8[ bufferSize ]; + U8* tmpWriteBuffer = new U8[ bufferSize ]; // Delegate actual encoding work to wrapper LLPngWrapper pngWrapper; - if (! pngWrapper.writePng(raw_image, mTmpWriteBuffer)) + if (! pngWrapper.writePng(raw_image, tmpWriteBuffer)) { setLastError(pngWrapper.getErrorMessage()); - delete[] mTmpWriteBuffer; + delete[] tmpWriteBuffer; return FALSE; } // Resize internal buffer and copy from temp U32 encodedSize = pngWrapper.getFinalSize(); allocateData(encodedSize); - memcpy(getData(), mTmpWriteBuffer, encodedSize); + memcpy(getData(), tmpWriteBuffer, encodedSize); - delete[] mTmpWriteBuffer; + delete[] tmpWriteBuffer; - return TRUE;*/ + return TRUE; } diff --git a/indra/llimage/llpngwrapper.cpp b/indra/llimage/llpngwrapper.cpp index 0776e2ebd..d33aa94fd 100644 --- a/indra/llimage/llpngwrapper.cpp +++ b/indra/llimage/llpngwrapper.cpp @@ -252,6 +252,7 @@ void LLPngWrapper::normalizeImage() // Read out the image meta-data void LLPngWrapper::updateMetaData() { + png_set_interlace_handling(mReadPngPtr); // png_read_update_info(mReadPngPtr, mReadInfoPtr); mWidth = png_get_image_width(mReadPngPtr, mReadInfoPtr); mHeight = png_get_image_height(mReadPngPtr, mReadInfoPtr); diff --git a/indra/llimage/llpngwrapper.h b/indra/llimage/llpngwrapper.h index 5f3ad0d5a..397d316d0 100644 --- a/indra/llimage/llpngwrapper.h +++ b/indra/llimage/llpngwrapper.h @@ -26,7 +26,7 @@ #ifndef LL_LLPNGWRAPPER_H #define LL_LLPNGWRAPPER_H -#ifdef LL_STANDALONE +#if LL_STANDALONE || (LL_LINUX && defined(__x86_64__)) #include #else // Workaround for wrongly packaged prebuilt. diff --git a/indra/llmessage/aicurl.cpp b/indra/llmessage/aicurl.cpp index 68328c394..06efd3cb4 100644 --- a/indra/llmessage/aicurl.cpp +++ b/indra/llmessage/aicurl.cpp @@ -366,7 +366,7 @@ void initCurl(void) if (ssl_version.find("OpenSSL") != std::string::npos) gSSLlib = ssl_openssl; // See http://www.openssl.org/docs/crypto/threads.html#DESCRIPTION else if (ssl_version.find("GnuTLS") != std::string::npos) - gSSLlib = ssl_gnutls; // See http://www.gnu.org/software/gnutls/manual/html_node/Thread-safety.html + gSSLlib = ssl_gnutls; // See http://www.gnutls.org/manual/html_node/Thread-safety.html#Thread-safety else if (ssl_version.find("NSS") != std::string::npos) gSSLlib = ssl_nss; // Supposedly thread-safe without any requirements. @@ -387,10 +387,10 @@ void initCurl(void) } case ssl_gnutls: { - // I don't think we ever get here, do we? --Aleric - llassert_always(gSSLlib != ssl_gnutls); - // If we do, then didn't curl_global_init already call gnutls_global_init? - // It seems there is nothing to do for us here. + // Prior to GnuTLS version 3.3.0 mutex locks are setup by calling gnutls_global_init, + // however curl_global_init already called that for us. + // There is nothing to do for us here. + break; } case ssl_nss: { @@ -527,7 +527,7 @@ namespace AICurlPrivate { using AICurlInterface::Stats; -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG // CURLOPT_DEBUGFUNCTION function. extern int debug_callback(CURL*, curl_infotype infotype, char* buf, size_t size, void* user_ptr); #endif @@ -1087,7 +1087,10 @@ void CurlEasyRequest::applyDefaultOptions(void) { CertificateAuthority_rat CertificateAuthority_r(gCertificateAuthority); setoptString(CURLOPT_CAINFO, CertificateAuthority_r->file); - setSSLCtxCallback(&curlCtxCallback, NULL); + if (gSSLlib == ssl_openssl) + { + setSSLCtxCallback(&curlCtxCallback, NULL); + } setopt(CURLOPT_NOSIGNAL, 1); // Cache DNS look ups an hour. If we set it smaller we risk frequent connect timeouts in cases where DNS look ups are slow. setopt(CURLOPT_DNS_CACHE_TIMEOUT, 3600); @@ -1181,7 +1184,7 @@ void CurlEasyRequest::set_timeout_opts(void) void CurlEasyRequest::create_timeout_object(void) { ThreadSafeBufferedCurlEasyRequest* lockobj = NULL; -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG lockobj = static_cast(this)->get_lockobj(); #endif mTimeout = new curlthread::HTTPTimeout(mTimeoutPolicy, lockobj); @@ -1352,7 +1355,7 @@ void BufferedCurlEasyRequest::aborted(U32 http_status, std::string const& reason } } -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG static AIPerServicePtr sConnections[64]; void BufferedCurlEasyRequest::connection_established(int connectionnr) @@ -1510,7 +1513,7 @@ CurlMultiHandle::~CurlMultiHandle() } // namespace AICurlPrivate -#if LL_LINUX +#if LL_LINUX && !defined(__x86_64__) extern "C" { // Keep linker happy. diff --git a/indra/llmessage/aicurleasyrequeststatemachine.cpp b/indra/llmessage/aicurleasyrequeststatemachine.cpp index 2642bb92c..6b7bcf654 100644 --- a/indra/llmessage/aicurleasyrequeststatemachine.cpp +++ b/indra/llmessage/aicurleasyrequeststatemachine.cpp @@ -250,7 +250,7 @@ void AICurlEasyRequestStateMachine::finish_impl(void) } AICurlEasyRequestStateMachine::AICurlEasyRequestStateMachine(CWD_ONLY(bool debug)) : -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG AIStateMachine(debug), #endif mTotalDelayTimeout(AIHTTPTimeoutPolicy::getDebugSettingsCurlTimeout().getTotalDelay()) diff --git a/indra/llmessage/aicurlprivate.h b/indra/llmessage/aicurlprivate.h index 9af27a567..fe1ab864c 100644 --- a/indra/llmessage/aicurlprivate.h +++ b/indra/llmessage/aicurlprivate.h @@ -320,7 +320,7 @@ class CurlEasyRequest : public CurlEasyHandle { LLPointer mTimeout;// Timeout administration object associated with last created CurlSocketInfo. bool mTimeoutIsOrphan; // Set to true when mTimeout is not (yet) associated with a CurlSocketInfo. bool mIsHttps; // Set if the url starts with "https:". -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG public: bool mDebugIsHeadOrGetMethod; #endif @@ -342,7 +342,7 @@ class CurlEasyRequest : public CurlEasyHandle { // This class may only be created as base class of BufferedCurlEasyRequest. // Throws AICurlNoEasyHandle. CurlEasyRequest(void) : mHeaders(NULL), mHandleEventsTarget(NULL), mContentLength(0), mResult(CURLE_FAILED_INIT), mTimeoutPolicy(NULL), mTimeoutIsOrphan(false) -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG , mDebugIsHeadOrGetMethod(false) #endif { applyDefaultOptions(); } @@ -475,7 +475,7 @@ class BufferedCurlEasyRequest : public CurlEasyRequest { // Return true if any data was received. bool received_data(void) const { return mTotalRawBytes > 0; } -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG // Connection accounting for debug purposes. void connection_established(int connectionnr); void connection_closed(int connectionnr); diff --git a/indra/llmessage/aicurlthread.cpp b/indra/llmessage/aicurlthread.cpp index b7057fe11..8bc56d6f0 100644 --- a/indra/llmessage/aicurlthread.cpp +++ b/indra/llmessage/aicurlthread.cpp @@ -730,7 +730,7 @@ bool MergeIterator::next(curl_socket_t& fd_out, int& ev_bitmask_out) //----------------------------------------------------------------------------- // CurlSocketInfo -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG #undef AI_CASE_RETURN #define AI_CASE_RETURN(x) case x: return #x; static char const* action_str(int action) @@ -2373,7 +2373,7 @@ int BufferedCurlEasyRequest::curlProgressCallback(void* user_data, double dltota return 0; } -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG int debug_callback(CURL* handle, curl_infotype infotype, char* buf, size_t size, void* user_ptr) { BufferedCurlEasyRequest* request = (BufferedCurlEasyRequest*)user_ptr; @@ -2441,7 +2441,6 @@ int debug_callback(CURL* handle, curl_infotype infotype, char* buf, size_t size, } #endif -#ifdef CWDEBUG using namespace ::libcwd; std::ostringstream marker; marker << (void*)request->get_lockobj() << ' '; @@ -2450,14 +2449,6 @@ int debug_callback(CURL* handle, curl_infotype infotype, char* buf, size_t size, if (!debug::channels::dc::curlio.is_on()) debug::channels::dc::curlio.on(); LibcwDoutScopeBegin(LIBCWD_DEBUGCHANNELS, libcw_do, dc::curlio|cond_nonewline_cf(infotype == CURLINFO_TEXT)) -#else - if (infotype == CURLINFO_TEXT) - { - while (size > 0 && (buf[size - 1] == '\r' || buf[size - 1] == '\n')) - --size; - } - LibcwDoutScopeBegin(LIBCWD_DEBUGCHANNELS, libcw_do, dc::curlio) -#endif switch (infotype) { case CURLINFO_TEXT: @@ -2535,12 +2526,10 @@ int debug_callback(CURL* handle, curl_infotype infotype, char* buf, size_t size, else LibcwDoutStream << size << " bytes"; LibcwDoutScopeEnd; -#ifdef CWDEBUG libcw_do.pop_marker(); -#endif return 0; } -#endif // defined(CWDEBUG) || defined(DEBUG_CURLIO) +#endif // CWDEBUG } // namespace AICurlPrivate diff --git a/indra/llmessage/aihttptimeout.cpp b/indra/llmessage/aihttptimeout.cpp index f79e2a450..c41dc6575 100644 --- a/indra/llmessage/aihttptimeout.cpp +++ b/indra/llmessage/aihttptimeout.cpp @@ -86,7 +86,7 @@ public: #include "aihttptimeout.h" // If this is set, treat dc::curlio as off in the assertion below. -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG bool gCurlIo; #endif @@ -180,7 +180,7 @@ void HTTPTimeout::upload_finished(void) // ^ ^ ^ ^ ^ ^ ^ ^ // | | | | | | | | bool HTTPTimeout::data_received(size_t n/*,*/ -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG ASSERT_ONLY_COMMA(bool upload_error_status) #else ASSERT_ONLY_COMMA(bool) diff --git a/indra/llmessage/aihttptimeout.h b/indra/llmessage/aihttptimeout.h index 1af96c9c7..9d894d16b 100644 --- a/indra/llmessage/aihttptimeout.h +++ b/indra/llmessage/aihttptimeout.h @@ -91,14 +91,14 @@ class HTTPTimeout : public LLRefCount { static F64 const sClockWidth_10ms; // Time between two clock ticks in 10 ms units. static F64 const sClockWidth_40ms; // Time between two clock ticks in 40 ms units. static U64 sTime_10ms; // Time since the epoch in 10 ms units. -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG ThreadSafeBufferedCurlEasyRequest* mLockObj; #endif public: HTTPTimeout(AIHTTPTimeoutPolicy const* policy, ThreadSafeBufferedCurlEasyRequest* lock_obj) : mPolicy(policy), mNothingReceivedYet(true), mLowSpeedOn(false), mLastBytesSent(false), mBeingRedirected(false), mUploadFinished(false), mStalled((U64)-1) -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG , mLockObj(lock_obj) #endif { } @@ -127,7 +127,7 @@ class HTTPTimeout : public LLRefCount { // Called from BufferedCurlEasyRequest::processOutput if a timeout occurred. void print_diagnostics(CurlEasyRequest const* curl_easy_request, char const* eff_url); -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG void* get_lockobj(void) const { return mLockObj; } #endif @@ -146,7 +146,7 @@ class HTTPTimeout : public LLRefCount { } // namespace curlthread } // namespace AICurlPrivate -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG extern bool gCurlIo; #endif diff --git a/indra/llmessage/aihttptimeoutpolicy.cpp b/indra/llmessage/aihttptimeoutpolicy.cpp index a37a9f916..fbd143c30 100644 --- a/indra/llmessage/aihttptimeoutpolicy.cpp +++ b/indra/llmessage/aihttptimeoutpolicy.cpp @@ -905,28 +905,18 @@ AIHTTPTimeoutPolicy const* AIHTTPTimeoutPolicy::getTimeoutPolicyByName(std::stri #define P2(n, b) AIHTTPTimeoutPolicy n##_timeout(#n, b) // Policy name Policy -//P(accountingCostResponder); -P(agentStateResponder); -P(appearanceChangeMetricsResponder); -P(assetUploadResponder); P(assetReportHandler); -P(asyncConsoleResponder); -P(avatarPickerResponder); P(authHandler); P(avatarNameResponder); P2(baseCapabilitiesComplete, transfer_18s_connect_5s); P(blockingLLSDPost); P(blockingLLSDGet); P(blockingRawGet); -P(charactersResponder); -P(checkAgentAppearanceServiceResponder); P(classifiedStatsResponder); -P(consoleResponder); P(createInventoryCategoryResponder); P(emeraldDicDownloader); P(environmentApplyResponder); P(environmentRequestResponder); -P(estateChangeInfoResponder); P2(eventPollResponder, reply_60s); P(fetchInventoryResponder); P(fetchScriptLimitsAttachmentInfoResponder); @@ -960,12 +950,7 @@ P2(meshPhysicsShapeResponder, connect_30s); P2(meshSkinInfoResponder, connect_30s); P(mimeDiscoveryResponder); P(moderationResponder); -P(navMeshRebakeResponder); -P(navMeshResponder); -P(navMeshStatusResponder); -P(newAgentInventoryVariablePriceResponder); P(objectCostResponder); -P(objectLinksetsResponder); P(physicsFlagsResponder); P(productInfoRequestResponder); P(regionResponder); @@ -977,7 +962,6 @@ P(setDisplayNameResponder); P2(simulatorFeaturesReceived, transfer_22s_connect_10s); P(startConferenceChatResponder); P2(startGroupVoteResponder, transfer_300s); -P(terrainLinksetsResponder); P(translationReceiver); P(uploadModelPremissionsResponder); P(userReportResponder); diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp index c592fccfb..544966479 100644 --- a/indra/llui/llradiogroup.cpp +++ b/indra/llui/llradiogroup.cpp @@ -46,16 +46,36 @@ static LLRegisterWidget r("radio_group"); +/* + * A checkbox control with use_radio_style == true. + */ +class LLRadioCtrl : public LLCheckBoxCtrl +{ +public: + LLRadioCtrl(const std::string& name, const LLRect& rect, const std::string& label, const std::string& value = "", const LLFontGL* font = NULL, commit_callback_t commit_callback = NULL); + /*virtual*/ ~LLRadioCtrl(); + + virtual LLXMLNodePtr getXML(bool save_children = true) const; + /*virtual*/ void setValue(const LLSD& value); + + LLSD getPayload() { return mPayload; } +protected: + friend class LLUICtrlFactory; + + LLSD mPayload; // stores data that this item represents in the radio group +}; + LLRadioGroup::LLRadioGroup(const std::string& name, const LLRect& rect, S32 initial_index, commit_callback_t commit_callback, - BOOL border) : + bool border, bool allow_deselect) : LLUICtrl(name, rect, TRUE, commit_callback, FOLLOWS_LEFT | FOLLOWS_TOP), - mSelectedIndex(initial_index) + mSelectedIndex(initial_index), + mAllowDeselect(allow_deselect) { init(border); } -void LLRadioGroup::init(BOOL border) +void LLRadioGroup::init(bool border) { if (border) { @@ -67,12 +87,19 @@ void LLRadioGroup::init(BOOL border) } - - LLRadioGroup::~LLRadioGroup() { } +// virtual +BOOL LLRadioGroup::postBuild() +{ + if (!mRadioButtons.empty()) + { + mRadioButtons[0]->setTabStop(true); + } + return TRUE; +} // virtual void LLRadioGroup::setEnabled(BOOL enabled) @@ -133,16 +160,39 @@ void LLRadioGroup::setIndexEnabled(S32 index, BOOL enabled) BOOL LLRadioGroup::setSelectedIndex(S32 index, BOOL from_event) { - if (index < 0 || index >= (S32)mRadioButtons.size()) + if ((S32)mRadioButtons.size() <= index ) { return FALSE; } + if (mSelectedIndex >= 0) + { + LLRadioCtrl* old_radio_item = mRadioButtons[mSelectedIndex]; + old_radio_item->setTabStop(false); + old_radio_item->setValue( FALSE ); + } + else + { + mRadioButtons[0]->setTabStop(false); + } + mSelectedIndex = index; + if (mSelectedIndex >= 0) + { + LLRadioCtrl* radio_item = mRadioButtons[mSelectedIndex]; + radio_item->setTabStop(true); + radio_item->setValue( TRUE ); + + if (hasFocus()) + { + radio_item->focusFirstItem(FALSE, FALSE); + } + } + if (!from_event) { - setControlValue(getSelectedIndex()); + setControlValue(getValue()); } return TRUE; @@ -207,41 +257,23 @@ BOOL LLRadioGroup::handleKeyHere(KEY key, MASK mask) return handled; } -void LLRadioGroup::draw() +BOOL LLRadioGroup::handleMouseDown(S32 x, S32 y, MASK mask) { - S32 current_button = 0; - - BOOL take_focus = FALSE; - if (gFocusMgr.childHasKeyboardFocus(this)) + // grab focus preemptively, before child button takes mousecapture + // + if (hasTabStop()) { - take_focus = TRUE; + focusFirstItem(FALSE, FALSE); } - for (button_list_t::iterator iter = mRadioButtons.begin(); - iter != mRadioButtons.end(); ++iter) - { - LLRadioCtrl* radio = *iter; - BOOL selected = (current_button == mSelectedIndex); - radio->setValue( selected ); - if (take_focus && selected && !gFocusMgr.childHasKeyboardFocus(radio)) - { - // don't flash keyboard focus when navigating via keyboard - BOOL DONT_FLASH = FALSE; - radio->focusFirstItem(FALSE, DONT_FLASH); - } - current_button++; - } - - LLView::draw(); + return LLUICtrl::handleMouseDown(x, y, mask); } - // When adding a button, we need to ensure that the radio // group gets a message when the button is clicked. -LLRadioCtrl* LLRadioGroup::addRadioButton(const std::string& name, const std::string& label, const LLRect& rect, const LLFontGL* font ) +LLRadioCtrl* LLRadioGroup::addRadioButton(const std::string& name, const std::string& label, const LLRect& rect, const LLFontGL* font, const std::string& payload) { - // Highlight will get fixed in draw method above - LLRadioCtrl* radio = new LLRadioCtrl(name, rect, label, font, boost::bind(&LLRadioGroup::onClickButton, this, _1)); + LLRadioCtrl* radio = new LLRadioCtrl(name, rect, label, payload, font, boost::bind(&LLRadioGroup::onClickButton, this, _1)); addChild(radio); mRadioButtons.push_back(radio); return radio; @@ -252,7 +284,7 @@ LLRadioCtrl* LLRadioGroup::addRadioButton(const std::string& name, const std::st void LLRadioGroup::onClickButton(LLUICtrl* ctrl) { - // llinfos << "LLRadioGroup::onClickButton" << llendl; + // LL_INFOS() << "LLRadioGroup::onClickButton" << LL_ENDL; LLRadioCtrl* clicked_radio = dynamic_cast(ctrl); if (!clicked_radio) return; @@ -263,9 +295,15 @@ void LLRadioGroup::onClickButton(LLUICtrl* ctrl) LLRadioCtrl* radio = *iter; if (radio == clicked_radio) { - // llinfos << "clicked button " << counter << llendl; - setSelectedIndex(index); - setControlValue(index); + if (index == mSelectedIndex && mAllowDeselect) + { + // don't select anything + setSelectedIndex(-1); + } + else + { + setSelectedIndex(index); + } // BUG: Calls click callback even if button didn't actually change onCommit(); @@ -281,13 +319,12 @@ void LLRadioGroup::onClickButton(LLUICtrl* ctrl) void LLRadioGroup::setValue( const LLSD& value ) { - std::string value_name = value.asString(); int idx = 0; for (button_list_t::const_iterator iter = mRadioButtons.begin(); iter != mRadioButtons.end(); ++iter) { LLRadioCtrl* radio = *iter; - if (radio->getName() == value_name) + if (radio->getPayload().asString() == value.asString()) { setSelectedIndex(idx); idx = -1; @@ -304,8 +341,7 @@ void LLRadioGroup::setValue( const LLSD& value ) } else { - llwarns << "LLRadioGroup::setValue: radio_item with name=\"" << value_name << "\" not found, radio_group values are set by radio_item name not value. Falling back on LLUICtrl::setValue." << llendl; - LLUICtrl::setValue(value); + setSelectedIndex(-1, TRUE); } } } @@ -317,7 +353,7 @@ LLSD LLRadioGroup::getValue() const for (button_list_t::const_iterator iter = mRadioButtons.begin(); iter != mRadioButtons.end(); ++iter) { - if (idx == index) return LLSD((*iter)->getName()); + if (idx == index) return LLSD((*iter)->getPayload()); ++idx; } return LLSD(); @@ -333,6 +369,7 @@ LLXMLNodePtr LLRadioGroup::getXML(bool save_children) const // Attributes node->createChild("draw_border", TRUE)->setBoolValue(mHasBorder); + node->createChild("allow_deselect", TRUE)->setBoolValue(mAllowDeselect); // Contents @@ -355,17 +392,21 @@ LLView* LLRadioGroup::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory U32 initial_value = 0; node->getAttributeU32("initial_value", initial_value); - BOOL draw_border = TRUE; - node->getAttributeBOOL("draw_border", draw_border); + bool draw_border = true; + node->getAttribute_bool("draw_border", draw_border); + + bool allow_deselect = false; + node->getAttribute_bool("allow_deselect", allow_deselect); LLRect rect; createRect(node, rect, parent, LLRect()); - LLRadioGroup* radio_group = new LLRadioGroup("radio_group", + LLRadioGroup* radio_group = new LLRadioGroup("radio_group", rect, initial_value, NULL, - draw_border); + draw_border, + allow_deselect); const std::string& contents = node->getValue(); @@ -406,7 +447,13 @@ LLView* LLRadioGroup::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory createRect(child, item_rect, radio_group, rect); std::string item_label = child->getTextContents(); - LLRadioCtrl* radio = radio_group->addRadioButton("radio", item_label, item_rect, font); + child->getAttributeString("label", item_label); + std::string item_name("radio"); + child->getAttributeString("name", item_name); + std::string payload(item_name); // Support old-style name as payload + child->getAttributeString("value", payload); + child->getAttributeString("initial_value", payload); // Synonym + LLRadioCtrl* radio = radio_group->addRadioButton(item_name, item_label, item_rect, font, payload); radio->initFromXML(child, radio_group); } @@ -432,11 +479,10 @@ LLUUID LLRadioGroup::getCurrentID() const BOOL LLRadioGroup::setSelectedByValue(const LLSD& value, BOOL selected) { S32 idx = 0; - std::string value_string = value.asString(); for (button_list_t::const_iterator iter = mRadioButtons.begin(); iter != mRadioButtons.end(); ++iter) { - if((*iter)->getName() == value_string) + if((*iter)->getPayload().asString() == value.asString()) { setSelectedIndex(idx); return TRUE; @@ -455,11 +501,10 @@ LLSD LLRadioGroup::getSelectedValue() BOOL LLRadioGroup::isSelected(const LLSD& value) const { S32 idx = 0; - std::string value_string = value.asString(); for (button_list_t::const_iterator iter = mRadioButtons.begin(); iter != mRadioButtons.end(); ++iter) { - if((*iter)->getName() == value_string) + if((*iter)->getPayload().asString() == value.asString()) { if (idx == mSelectedIndex) { @@ -481,6 +526,17 @@ BOOL LLRadioGroup::operateOnAll(EOperation op) return FALSE; } +LLRadioCtrl::LLRadioCtrl(const std::string& name, const LLRect& rect, const std::string& label, const std::string& value, const LLFontGL* font, commit_callback_t commit_callback) +: LLCheckBoxCtrl(name, rect, label, font, commit_callback, FALSE, RADIO_STYLE), + mPayload(value) +{ + setTabStop(FALSE); + // use name as default "Value" for backwards compatibility + if (value.empty()) + { + mPayload = name; + } +} LLRadioCtrl::~LLRadioCtrl() { @@ -499,7 +555,7 @@ LLXMLNodePtr LLRadioCtrl::getXML(bool save_children) const node->setName(LL_RADIO_ITEM_TAG); - node->setStringValue(getLabel()); + node->createChild("value", TRUE)->setStringValue(mPayload); return node; } diff --git a/indra/llui/llradiogroup.h b/indra/llui/llradiogroup.h index 3cc042217..e21c7bc1f 100644 --- a/indra/llui/llradiogroup.h +++ b/indra/llui/llradiogroup.h @@ -37,26 +37,6 @@ #include "llcheckboxctrl.h" #include "llctrlselectioninterface.h" - -/* - * A checkbox control with use_radio_style == true. - */ -class LLRadioCtrl : public LLCheckBoxCtrl -{ -public: - LLRadioCtrl(const std::string& name, const LLRect& rect, const std::string& label, const LLFontGL* font = NULL, - commit_callback_t commit_callback = NULL) : - LLCheckBoxCtrl(name, rect, label, font, commit_callback, FALSE, RADIO_STYLE) - { - setTabStop(FALSE); - } - /*virtual*/ ~LLRadioCtrl(); - - virtual LLXMLNodePtr getXML(bool save_children = true) const; - /*virtual*/ void setValue(const LLSD& value); -}; - - /* * An invisible view containing multiple mutually exclusive toggling * buttons (usually radio buttons). Automatically handles the mutex @@ -66,25 +46,32 @@ class LLRadioGroup : public LLUICtrl, public LLCtrlSelectionInterface { public: - // Radio group constructor. Doesn't rely on - // needing a control + + // Radio group constructor. Doesn't rely on needing a control LLRadioGroup(const std::string& name, const LLRect& rect, S32 initial_index, commit_callback_t commit_callback, - BOOL border = TRUE); + bool border = true, bool allow_deselect = false); + +protected: + friend class LLUICtrlFactory; + +public: virtual ~LLRadioGroup(); + virtual BOOL postBuild(); + + virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); + virtual BOOL handleKeyHere(KEY key, MASK mask); virtual void setEnabled(BOOL enabled); virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); void setIndexEnabled(S32 index, BOOL enabled); - // return the index value of the selected item S32 getSelectedIndex() const { return mSelectedIndex; } - // set the index value programatically BOOL setSelectedIndex(S32 index, BOOL from_event = FALSE); @@ -92,14 +79,10 @@ public: virtual void setValue(const LLSD& value ); virtual LLSD getValue() const; - // Draw the group, but also fix the highlighting based on the control. - void draw(); - // You must use this method to add buttons to a radio group. // Don't use addChild -- it won't set the callback function // correctly. - LLRadioCtrl* addRadioButton(const std::string& name, const std::string& label, const LLRect& rect, const LLFontGL* font); - LLRadioCtrl* getRadioButton(const S32& index) { return mRadioButtons[index]; } + class LLRadioCtrl* addRadioButton(const std::string& name, const std::string& label, const LLRect& rect, const LLFontGL* font, const std::string& payload = ""); // Update the control as needed. Userdata must be a pointer to the button. void onClickButton(LLUICtrl* clicked_radio); @@ -123,14 +106,15 @@ public: private: // protected function shared by the two constructors. - void init(BOOL border); + void init(bool border); S32 mSelectedIndex; - typedef std::vector button_list_t; + + typedef std::vector button_list_t; button_list_t mRadioButtons; - BOOL mHasBorder; + bool mHasBorder; + bool mAllowDeselect; // user can click on an already selected option to deselect it }; - #endif diff --git a/indra/llvfs/lldir_mac.cpp b/indra/llvfs/lldir_mac.cpp index 114dc0c47..b6ba5e308 100644 --- a/indra/llvfs/lldir_mac.cpp +++ b/indra/llvfs/lldir_mac.cpp @@ -150,7 +150,7 @@ LLDir_Mac::LLDir_Mac() CFURLRef resourcesURLRef = CFBundleCopyResourcesDirectoryURL(mainBundleRef); CFURLRefToLLString(resourcesURLRef, mAppRODataDir, true); - U32 build_dir_pos = mExecutableDir.rfind("/indra/build-darwin-"); + size_t build_dir_pos = mExecutableDir.rfind("/indra/build-darwin-"); if (build_dir_pos != std::string::npos) { // ...we're in a dev checkout diff --git a/indra/llwindow/llkeyboard.h b/indra/llwindow/llkeyboard.h index 80ac3acfc..c2def259b 100644 --- a/indra/llwindow/llkeyboard.h +++ b/indra/llwindow/llkeyboard.h @@ -28,6 +28,7 @@ #define LL_LLKEYBOARD_H #include +#include #include "string_table.h" #include "lltimer.h" @@ -40,7 +41,7 @@ enum EKeystate KEYSTATE_UP }; -typedef void (*LLKeyFunc)(EKeystate keystate); +typedef boost::function LLKeyFunc; enum EKeyboardInsertMode { diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index c1151f8e1..f2db11f26 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -172,7 +172,7 @@ LLWinImm LLWinImm::sTheInstance; LLWinImm::LLWinImm() : mHImmDll(NULL) { // Check system metrics - if ( !GetSystemMetrics( SM_DBCSENABLED ) ) + if ( !GetSystemMetrics( SM_IMMENABLED ) ) return; mHImmDll = LoadLibraryA("Imm32"); @@ -671,7 +671,7 @@ LLWindowWin32::~LLWindowWin32() delete [] mSupportedResolutions; mSupportedResolutions = NULL; - delete mWindowClassName; + delete [] mWindowClassName; mWindowClassName = NULL; } @@ -760,7 +760,7 @@ void LLWindowWin32::close() LL_DEBUGS("Window") << "Destroying Window" << LL_ENDL; // Don't process events in our mainWindowProc any longer. - SetWindowLongPtr(mWindowHandle, GWLP_USERDATA, NULL); + SetWindowLongPtr(mWindowHandle, GWLP_USERDATA, NULL); // // Make sure we don't leave a blank toolbar button. ShowWindow(mWindowHandle, SW_HIDE); @@ -1886,7 +1886,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ // This is to avoid triggering double click teleport after returning focus (see MAINT-3786). static bool sHandleDoubleClick = true; - LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr(h_wnd, GWLP_USERDATA); + LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr(h_wnd, GWLP_USERDATA); // if (NULL != window_imp) @@ -2291,7 +2291,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ if (!sHandleDoubleClick) { sHandleDoubleClick = true; - break; + //break; // Broke first double click every session. } // Because we move the cursor position in the app, we need to query @@ -3282,7 +3282,6 @@ void LLWindowWin32::spawnWebBrowser(const std::string& escaped_url, bool async) { sei.fMask = SEE_MASK_ASYNCOK; } - else { sei.fMask = SEE_MASK_FLAG_DDEWAIT; diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index cbe0737ae..56bdc9219 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -444,6 +444,7 @@ set(viewer_SOURCE_FILES llscrollingpanelparam.cpp llscrollingpanelparambase.cpp llselectmgr.cpp + llshareavatarhandler.cpp llsky.cpp llslurl.cpp llspatialpartition.cpp @@ -1457,7 +1458,7 @@ if (!DISABLE_TEMPLATE_CHECK) endif (!DISABLE_TEMPLATE_CHECK) set(PACKAGE OFF CACHE BOOL - "Add a package target that builds an installer package.") + "Add a package_viewer target that builds an installer package.") if (WINDOWS) set(release_flags "/MAPRelease/${VIEWER_BINARY_NAME}.map") @@ -1583,7 +1584,7 @@ if (WINDOWS) add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit basic_plugin_filepicker winmm_shim) if (PACKAGE) - add_custom_target(package ALL DEPENDS ${CMAKE_CFG_INTDIR}/touched.bat) + add_custom_target(package_viewer ALL DEPENDS ${CMAKE_CFG_INTDIR}/touched.bat) endif (PACKAGE) endif (WINDOWS) @@ -1711,8 +1712,8 @@ if (LINUX) add_custom_target(copy_l_viewer_manifest ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.copy_touched) if (PACKAGE) - add_custom_target(package ALL DEPENDS ${product}.tar.bz2) - add_dependencies(package copy_l_viewer_manifest) + add_custom_target(package_viewer ALL DEPENDS ${product}.tar.bz2) + add_dependencies(package_viewer copy_l_viewer_manifest) endif (PACKAGE) endif (LINUX) @@ -1761,10 +1762,10 @@ if (DARWIN) endif (FMODEX) if (PACKAGE) - add_custom_target(package ALL DEPENDS ${VIEWER_BINARY_NAME}) + add_custom_target(package_viewer ALL DEPENDS ${VIEWER_BINARY_NAME}) add_custom_command( - TARGET package POST_BUILD + TARGET package_viewer POST_BUILD COMMAND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py @@ -1778,7 +1779,7 @@ if (DARWIN) --grid=${GRID} --login_channel=${VIEWER_LOGIN_CHANNEL} --source=${CMAKE_CURRENT_SOURCE_DIR} - --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${Product}.touched + --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ) @@ -1790,7 +1791,6 @@ if (INSTALL) endif (INSTALL) if (PACKAGE) - set(SYMBOL_SEARCH_DIRS "") if (WINDOWS) list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") @@ -1843,7 +1843,7 @@ if (PACKAGE) add_custom_target(generate_breakpad_symbols DEPENDS "${VIEWER_SYMBOL_FILE}") add_dependencies(generate_breakpad_symbols "${VIEWER_BINARY_NAME}" "${VIEWER_COPY_MANIFEST}") - add_dependencies(package generate_breakpad_symbols) + add_dependencies(package_viewer generate_breakpad_symbols) endif(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) endif (PACKAGE) diff --git a/indra/newview/aihttpview.cpp b/indra/newview/aihttpview.cpp index d3de57171..7e97f9768 100644 --- a/indra/newview/aihttpview.cpp +++ b/indra/newview/aihttpview.cpp @@ -149,7 +149,7 @@ void AIServiceBar::draw() start += LLFontGL::getFontMonospace()->getWidth(text); } start = mHTTPView->updateColumn(mc_col, start); -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG text = llformat(" | %d,%d,%d/%d", total_added, event_polls, established_connections, concurrent_connections); #else text = llformat(" | %d/%d", total_added, concurrent_connections); diff --git a/indra/newview/aixmllindengenepool.cpp b/indra/newview/aixmllindengenepool.cpp index b02d4b60d..cbb6659d9 100644 --- a/indra/newview/aixmllindengenepool.cpp +++ b/indra/newview/aixmllindengenepool.cpp @@ -171,7 +171,9 @@ void AIArchetype::toXML(std::ostream& os, int indentation) const { tag.attribute("name", LLWearableType::getTypeName(mType)); } - if (!mMetaData.mPath.empty()) + // mMetaData.mPath can be empty even exporting from the Appearance editor: + // when the asset is in the "My Inventory" root. + if (!mMetaData.mPath.empty() || !mMetaData.mName.empty()) // Is this not an old-style linden_genepool? { tag.child(mMetaData); } diff --git a/indra/newview/app_settings/keys.ini b/indra/newview/app_settings/keys.ini index eebb5dc33..c21bf9ef8 100644 --- a/indra/newview/app_settings/keys.ini +++ b/indra/newview/app_settings/keys.ini @@ -182,16 +182,22 @@ THIRD_PERSON A CTL_ALT_SHIFT pan_left THIRD_PERSON D CTL_ALT_SHIFT pan_right THIRD_PERSON W CTL_ALT_SHIFT pan_up THIRD_PERSON S CTL_ALT_SHIFT pan_down +THIRD_PERSON E CTL_ALT_SHIFT pan_in +THIRD_PERSON C CTL_ALT_SHIFT pan_out THIRD_PERSON LEFT CTL_ALT_SHIFT pan_left THIRD_PERSON RIGHT CTL_ALT_SHIFT pan_right THIRD_PERSON UP CTL_ALT_SHIFT pan_up THIRD_PERSON DOWN CTL_ALT_SHIFT pan_down +THIRD_PERSON PGUP CTL_ALT_SHIFT pan_in +THIRD_PERSON PGDN CTL_ALT_SHIFT pan_out THIRD_PERSON PAD_LEFT CTL_ALT_SHIFT pan_left THIRD_PERSON PAD_RIGHT CTL_ALT_SHIFT pan_right THIRD_PERSON PAD_UP CTL_ALT_SHIFT pan_up THIRD_PERSON PAD_DOWN CTL_ALT_SHIFT pan_down +THIRD_PERSON PAD_PGUP CTL_ALT_SHIFT pan_in +THIRD_PERSON PAD_PGDN CTL_ALT_SHIFT pan_out THIRD_PERSON PAD_ENTER CTL_ALT_SHIFT start_chat THIRD_PERSON PAD_DIVIDE CTL_ALT_SHIFT start_gesture @@ -319,16 +325,22 @@ SITTING A CTL_ALT_SHIFT pan_left SITTING D CTL_ALT_SHIFT pan_right SITTING W CTL_ALT_SHIFT pan_up SITTING S CTL_ALT_SHIFT pan_down +SITTING E CTL_ALT_SHIFT pan_in +SITTING C CTL_ALT_SHIFT pan_out SITTING LEFT CTL_ALT_SHIFT pan_left SITTING RIGHT CTL_ALT_SHIFT pan_right SITTING UP CTL_ALT_SHIFT pan_up SITTING DOWN CTL_ALT_SHIFT pan_down +SITTING PGUP CTL_ALT_SHIFT pan_in +SITTING PGDN CTL_ALT_SHIFT pan_out SITTING PAD_LEFT CTL_ALT_SHIFT pan_left SITTING PAD_RIGHT CTL_ALT_SHIFT pan_right SITTING PAD_UP CTL_ALT_SHIFT pan_up SITTING PAD_DOWN CTL_ALT_SHIFT pan_down +SITTING PAD_PGUP CTL_ALT_SHIFT pan_in +SITTING PAD_PGDN CTL_ALT_SHIFT pan_out SITTING PAD_ENTER CTL_ALT_SHIFT start_chat SITTING PAD_DIVIDE CTL_ALT_SHIFT start_gesture diff --git a/indra/newview/app_settings/keysZQSD.ini b/indra/newview/app_settings/keysZQSD.ini index 3510587c3..72704408f 100644 --- a/indra/newview/app_settings/keysZQSD.ini +++ b/indra/newview/app_settings/keysZQSD.ini @@ -182,16 +182,22 @@ THIRD_PERSON Q CTL_ALT_SHIFT pan_left THIRD_PERSON D CTL_ALT_SHIFT pan_right THIRD_PERSON Z CTL_ALT_SHIFT pan_up THIRD_PERSON S CTL_ALT_SHIFT pan_down +THIRD_PERSON E CTL_ALT_SHIFT pan_in +THIRD_PERSON C CTL_ALT_SHIFT pan_out THIRD_PERSON LEFT CTL_ALT_SHIFT pan_left THIRD_PERSON RIGHT CTL_ALT_SHIFT pan_right THIRD_PERSON UP CTL_ALT_SHIFT pan_up THIRD_PERSON DOWN CTL_ALT_SHIFT pan_down +THIRD_PERSON PGUP CTL_ALT_SHIFT pan_in +THIRD_PERSON PGDN CTL_ALT_SHIFT pan_out THIRD_PERSON PAD_LEFT CTL_ALT_SHIFT pan_left THIRD_PERSON PAD_RIGHT CTL_ALT_SHIFT pan_right THIRD_PERSON PAD_UP CTL_ALT_SHIFT pan_up THIRD_PERSON PAD_DOWN CTL_ALT_SHIFT pan_down +THIRD_PERSON PAD_PGUP CTL_ALT_SHIFT pan_in +THIRD_PERSON PAD_PGDN CTL_ALT_SHIFT pan_out THIRD_PERSON PAD_ENTER CTL_ALT_SHIFT start_chat THIRD_PERSON PAD_DIVIDE CTL_ALT_SHIFT start_gesture @@ -319,16 +325,22 @@ SITTING Q CTL_ALT_SHIFT pan_left SITTING D CTL_ALT_SHIFT pan_right SITTING Z CTL_ALT_SHIFT pan_up SITTING S CTL_ALT_SHIFT pan_down +SITTING E CTL_ALT_SHIFT pan_in +SITTING C CTL_ALT_SHIFT pan_out SITTING LEFT CTL_ALT_SHIFT pan_left SITTING RIGHT CTL_ALT_SHIFT pan_right SITTING UP CTL_ALT_SHIFT pan_up SITTING DOWN CTL_ALT_SHIFT pan_down +SITTING PGUP CTL_ALT_SHIFT pan_in +SITTING PGDN CTL_ALT_SHIFT pan_out SITTING PAD_LEFT CTL_ALT_SHIFT pan_left SITTING PAD_RIGHT CTL_ALT_SHIFT pan_right SITTING PAD_UP CTL_ALT_SHIFT pan_up SITTING PAD_DOWN CTL_ALT_SHIFT pan_down +SITTING PAD_PGUP CTL_ALT_SHIFT pan_in +SITTING PAD_PGDN CTL_ALT_SHIFT pan_out SITTING PAD_ENTER CTL_ALT_SHIFT start_chat SITTING PAD_DIVIDE CTL_ALT_SHIFT start_gesture diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 64861526c..633294259 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -742,6 +742,17 @@ Value 0 + LiruHighlightNewInventory + + Comment + When false, new inventory items will not be highlighted upon being accepted. + Persist + 1 + Type + Boolean + Value + 1 + LiruLegacyDisplayMuteds Comment @@ -751,7 +762,7 @@ Type Boolean Value - 1 + 0 LiruLegacyLandmarks @@ -797,6 +808,17 @@ Value 1 + LiruResizeRootWithScreen + + Comment + When false, the ui view won't resize when the screen does (floaters won't move around without user interaction, but they also might be restricted from moving everywhere). + Persist + 1 + Type + Boolean + Value + 1 + LiruLegacyScrollToEnd Comment @@ -5062,6 +5084,39 @@ This should be as low as possible, but too low may break functionality Value 0 + ContextConeInAlpha + + Comment + Cone In Alpha + Persist + 0 + Type + F32 + Value + 0.0 + + ContextConeOutAlpha + + Comment + Cone Out Alpha + Persist + 0 + Type + F32 + Value + 1.0 + + ContextConeFadeTime + + Comment + Cone Fade Time + Persist + 0 + Type + F32 + Value + .08 + CookiesEnabled Comment @@ -7713,6 +7768,17 @@ This should be as low as possible, but too low may break functionality Value 1 + RadarAlertShowDist + + Comment + Show distance in radar announcements. + Persist + 1 + Type + Boolean + Value + 1 + RadarAlertSim Comment @@ -16883,6 +16949,28 @@ This should be as low as possible, but too low may break functionality Value 0 + VivoxShutdownTimeout + + Comment + shutdown timeout in miliseconds. The amount of time to wait for the service to shutdown gracefully after the last disconnect + Persist + 1 + Type + String + Value + 5 + + VivoxLogDirectory + + Comment + Default log path is Application Support/SecondLife/logs specify alternate absolute path here. + Persist + 1 + Type + String + Value + + VivoxDebugSIPURIHostName Comment diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index 8be48da2d..41207d047 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -47,6 +47,17 @@ Value 1 + IMNameSystem + + Comment + For names in chat tabs. 0 = Old Style, 1 = Display Names and Username, 2 = Displayname only, 3 = Old Style (Display Name) + Persist + 1 + Type + S32 + Value + 0 + LandManagementNameSystem Comment @@ -124,6 +135,17 @@ Value 0 + AlchemyRainbowEffects + + Comment + Makes agent effects rainbows! + Persist + 1 + Type + Boolean + Value + 0 + AlchemyRegionRestartShake Comment @@ -1659,6 +1681,17 @@ Value 0 + ToolbarVisibleQuit + + Comment + Whether or not the button to quit is on the toolbar + Persist + 1 + Type + Boolean + Value + 0 + ToolbarVisibleRadar Comment diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index d5c721237..7e369cf26 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -216,31 +216,18 @@ - AscentInstantMessageResponseRepeat - - Comment - Whether to keep on resending the autoresponse every line they send - Persist - 1 - Type - Boolean - Value - 0 - - - AscentInstantMessageShowOnTyping - - Comment - Whether to perform the autorespond the moment they begin to type instead of waiting for an actual message - Persist - 1 - Type - Boolean - Value - 0 - - + AscentInstantMessageResponseRepeat + + Comment + Whether to keep on resending the autoresponse every line they send + Persist + 1 + Type + Boolean + Value + 0 + AutoresponseAnyone Comment @@ -438,7 +425,7 @@ Boolean Value 0 - + BusyModeResponseItemID Comment diff --git a/indra/newview/ascentprefschat.cpp b/indra/newview/ascentprefschat.cpp index 3f50e53b6..c604a3260 100644 --- a/indra/newview/ascentprefschat.cpp +++ b/indra/newview/ascentprefschat.cpp @@ -226,7 +226,7 @@ void LLPrefsAscentChat::refreshValues() mSecondsInLog = gSavedSettings.getBOOL("SecondsInLog"); std::string format = gSavedSettings.getString("ShortTimeFormat"); - if (format.find("%p") == -1) + if (format.find("%p") == std::string::npos) { mTimeFormat = 0; } @@ -236,7 +236,7 @@ void LLPrefsAscentChat::refreshValues() } format = gSavedSettings.getString("ShortDateFormat"); - if (format.find("%m/%d/%") != -1) + if (format.find("%m/%d/%") != std::string::npos) { mDateFormat = 2; } @@ -265,6 +265,7 @@ void LLPrefsAscentChat::refreshValues() mLegacyEndScroll = gSavedSettings.getBOOL("LiruLegacyScrollToEnd"); mItalicizeActions = gSavedSettings.getBOOL("LiruItalicizeActions"); mLegacyLogLaunch = gSavedSettings.getBOOL("LiruLegacyLogLaunch"); + mChatTabNames = gSavedSettings.getS32("IMNameSystem"); mFriendNames = gSavedSettings.getS32("FriendNameSystem"); mGroupMembersNames = gSavedSettings.getS32("GroupMembersNameSystem"); mLandManagementNames = gSavedSettings.getS32("LandManagementNameSystem"); @@ -348,6 +349,8 @@ void LLPrefsAscentChat::refresh() } //Chat UI ----------------------------------------------------------------------------- + if (combo = getChild("chat_tabs_namesystem_combobox")) + combo->setCurrentByIndex(mChatTabNames); if (combo = getChild("friends_namesystem_combobox")) combo->setCurrentByIndex(mFriendNames); if (combo = getChild("group_members_namesystem_combobox")) @@ -501,6 +504,7 @@ void LLPrefsAscentChat::cancel() gSavedSettings.setBOOL("LiruLegacyScrollToEnd", mLegacyEndScroll); gSavedSettings.setBOOL("LiruItalicizeActions", mItalicizeActions); gSavedSettings.setBOOL("LiruLegacyLogLaunch", mLegacyLogLaunch); + gSavedSettings.setS32("IMNameSystem", mChatTabNames); gSavedSettings.setS32("FriendNameSystem", mFriendNames); gSavedSettings.setS32("GroupMembersNameSystem", mGroupMembersNames); gSavedSettings.setS32("LandManagementNameSystem", mLandManagementNames); diff --git a/indra/newview/ascentprefschat.h b/indra/newview/ascentprefschat.h index c04a2d297..709635d4f 100644 --- a/indra/newview/ascentprefschat.h +++ b/indra/newview/ascentprefschat.h @@ -87,6 +87,7 @@ private: bool mLegacyEndScroll; bool mItalicizeActions; bool mLegacyLogLaunch; + S32 mChatTabNames; S32 mFriendNames; S32 mGroupMembersNames; S32 mLandManagementNames; diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index 27082628b..45beb85a5 100644 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -53,6 +53,9 @@ ATI ASUS EAH38xx .*ATI.*ASUS.*EAH38.* 3 1 ATI ASUS EAH43xx .*ATI.*ASUS.*EAH43.* 1 1 ATI ASUS EAH45xx .*ATI.*ASUS.*EAH45.* 1 1 ATI ASUS EAH48xx .*ATI.*ASUS.*EAH48.* 3 1 +ATI ASUS EAH54xx .*ATI.*ASUS.*EAH54.* 3 1 +ATI ASUS EAH55xx .*ATI.*ASUS.*EAH55.* 3 1 +ATI ASUS EAH56xx .*ATI.*ASUS.*EAH56.* 3 1 ATI ASUS EAH57xx .*ATI.*ASUS.*EAH57.* 3 1 ATI ASUS EAH58xx .*ATI.*ASUS.*EAH58.* 3 1 ATI ASUS EAH6xxx .*ATI.*ASUS.*EAH6.* 3 1 @@ -186,6 +189,14 @@ ATI Radeon HD 7600 .*ATI.*Radeon HD *76.. 3 1 ATI Radeon HD 7700 .*ATI.*Radeon HD *77.. 3 1 ATI Radeon HD 7800 .*ATI.*Radeon HD *78.. 3 1 ATI Radeon HD 7900 .*ATI.*Radeon HD *79.. 3 1 +ATI Radeon HD 8200 .*ATI.*AMD Radeon.* HD 82.* 3 1 +ATI Radeon HD 8300 .*ATI.*AMD Radeon.* HD 83.* 3 1 +ATI Radeon HD 8400 .*ATI.*AMD Radeon.* HD 84.* 3 1 +ATI Radeon HD 8500 .*ATI.*AMD Radeon.* HD 85.* 3 1 +ATI Radeon HD 8600 .*ATI.*AMD Radeon.* HD 86.* 3 1 +ATI Radeon HD 8700 .*ATI.*AMD Radeon.* HD 87.* 3 1 +ATI Radeon HD 8800 .*ATI.*AMD Radeon.* HD 88.* 3 1 +ATI Radeon HD 8900 .*ATI.*AMD Radeon.* HD 89.* 3 1 ATI Radeon OpenGL .*ATI.*Radeon OpenGL.* 0 0 ATI Radeon 2100 .*ATI.*Radeon 21.. 0 1 ATI Radeon 3000 .*ATI.*Radeon 30.. 0 1 @@ -301,15 +312,15 @@ Intel Eaglelake .*Intel.*Eaglelake.* 0 1 Intel Graphics Media HD .*Intel.*Graphics Media.*HD.* 0 1 Intel HD Graphics 2000 .*Intel.*HD Graphics 2000.* 1 1 Intel HD Graphics 3000 .*Intel.*HD Graphics 3000.* 2 1 -Intel HD Graphics 3000 .*Intel.*Sandybridge.* 2 1 +Intel HD Graphics 3000 .*Intel.*Sandybridge.* 2 1 Intel HD Graphics 4000 .*Intel.*HD Graphics 4000.* 2 1 -Intel HD Graphics 4000 .*Intel.*Ivybridge.* 2 1 -Intel Intel Iris Pro Graphics 5200 .*Intel.*Iris Pro Graphics 52.* 2 1 -Intel Intel Iris Graphics 5100 .*Intel.*Iris Graphics 51.* 2 1 -Intel Intel Iris OpenGL Engine .*Intel.*Iris OpenGL.* 2 1 -Intel Intel Iris Pro OpenGL Engine .*Intel.*Iris Pro OpenGL.* 3 1 +Intel HD Graphics 4000 .*Intel.*Ivybridge.* 2 1 +Intel Intel Iris Pro Graphics 5200 .*Intel.*Iris Pro Graphics 52.* 2 1 +Intel Intel Iris Graphics 5100 .*Intel.*Iris Graphics 51.* 2 1 +Intel Intel Iris OpenGL Engine .*Intel.*Iris OpenGL.* 2 1 +Intel Intel Iris Pro OpenGL Engine .*Intel.*Iris Pro OpenGL.* 3 1 Intel HD Graphics 5000 .*Intel.*HD Graphics 5.* 2 1 -Intel HD Graphics 5000 .*Intel.*Haswell.* 2 1 +Intel HD Graphics 5000 .*Intel.*Haswell.* 2 1 Intel HD Graphics .*Intel.*HD Graphics.* 2 1 Intel Mobile 4 Series .*Intel.*Mobile.* 4 Series.* 0 1 Intel Media Graphics HD .*Intel.*Media Graphics HD.* 0 1 @@ -319,8 +330,10 @@ Intel Springdale .*Intel.*Springdale.* 0 0 Intel HD Graphics 2000 .*Intel.*HD2000.* 1 1 Intel HD Graphics 3000 .*Intel.*HD3000.* 2 1 Matrox .*Matrox.* 0 0 +Intel Mesa (Ivybridge) .*Mesa DRI.*Ivybridge.* 2 1 +Intel Mesa (Haswell) .*Mesa DRI.*Haswell.* 2 1 Mesa .*Mesa.* 0 0 -Gallium .*Gallium.* 1 1 +Gallium .*Gallium.* 1 1 NVIDIA 205 .*NVIDIA .*GeForce 205.* 2 1 NVIDIA 210 .*NVIDIA .*GeForce 210.* 2 1 NVIDIA 310M .*NVIDIA .*GeForce 310M.* 1 1 @@ -421,7 +434,7 @@ NVIDIA GTX 760 .*NVIDIA .*GTX *76.* 3 1 NVIDIA GTX 770 .*NVIDIA .*GTX *77.* 3 1 NVIDIA GTX 780 .*NVIDIA .*GTX *78.* 3 1 NVIDIA GTX TITAN .*NVIDIA .*GTX *TITAN.* 3 1 -NVIDIA GT 7xxM .*NVIDIA .*GT *7.* 3 1 +NVIDIA GT 7xxM .*NVIDIA .*GT *7.* 3 1 NVIDIA C51 .*NVIDIA .*C51.* 0 1 NVIDIA G72 .*NVIDIA .*G72.* 1 1 NVIDIA G73 .*NVIDIA .*G73.* 1 1 @@ -544,6 +557,7 @@ NVIDIA MCP78 .*NVIDIA .*MCP78.* 1 1 NVIDIA MCP79 .*NVIDIA .*MCP79.* 1 1 NVIDIA MCP7A .*NVIDIA .*MCP7A.* 1 1 NVIDIA Quadro2 .*Quadro2.* 0 1 +NVIDIA Quadro K1000 .*Quadro.* (K1|1)00[0-9].* 2 1 NVIDIA Quadro 1000M .*Quadro.*1000M.* 2 1 NVIDIA Quadro 2000 M/D .*Quadro.*2000.* 3 1 NVIDIA Quadro 3000M .*Quadro.*3000M.* 3 1 @@ -552,6 +566,7 @@ NVIDIA Quadro 4000 .*Quadro *4000.* 3 1 NVIDIA Quadro 50x0 M .*Quadro.*50.0.* 3 1 NVIDIA Quadro 6000 .*Quadro.*6000.* 3 1 NVIDIA Quadro 400 .*Quadro.*400.* 2 1 +NVIDIA Quadro K600 .*Quadro.* (K6|6)0[0-9][^0].* 2 1 NVIDIA Quadro 600 .*Quadro.*600.* 2 1 NVIDIA Quadro4 .*Quadro4.* 0 1 NVIDIA Quadro DCC .*Quadro DCC.* 0 1 @@ -606,6 +621,8 @@ NVIDIA Quadro 6000 .*Quadro.*6000.* 2 1 NVIDIA Quadro 600 .*Quadro.*600.* 2 1 NVIDIA Quadro NVS .*(Quadro|NVIDIA) NVS.* 0 1 NVIDIA RIVA TNT .*RIVA TNT.* 0 0 +NVIDIA GRID .*NVIDIA .*GRID.* 0 0 +NVIDIA ION .*NVIDIA.* *ION.* 2 1 NVIDIA PCI .*NVIDIA.*/PCI/SSE2 0 0 S3 .*S3 Graphics.* 0 0 SiS SiS.* 0 0 diff --git a/indra/newview/hbfloatergrouptitles.cpp b/indra/newview/hbfloatergrouptitles.cpp index c96189de1..5efb69118 100644 --- a/indra/newview/hbfloatergrouptitles.cpp +++ b/indra/newview/hbfloatergrouptitles.cpp @@ -162,7 +162,7 @@ void HBFloaterGroupTitles::onActivate(void* userdata) void update_titles_list(HBFloaterGroupTitles* self) { S32 i; - S32 count = gAgent.mGroups.count(); + S32 count = gAgent.mGroups.size(); LLUUID id; LLUUID highlight_id = LLUUID::null; LLUUID current_group_id = gAgent.getGroupID(); @@ -178,7 +178,7 @@ void update_titles_list(HBFloaterGroupTitles* self) for (i = 0; i < count; ++i) { - group_datap = &gAgent.mGroups.get(i); + group_datap = &gAgent.mGroups[i]; id = group_datap->mID; if (self->mFirstUse) { diff --git a/indra/newview/importtracker.cpp b/indra/newview/importtracker.cpp index 4b8a7e843..bddbf790e 100644 --- a/indra/newview/importtracker.cpp +++ b/indra/newview/importtracker.cpp @@ -507,10 +507,10 @@ public: gVFS->getData(data->assetid, data->type, buffer, 0, size); std::string script((char*)buffer); BOOL domono = FALSE;//Phox- this needs to be fixed when the preproc is added = JCLSLPreprocessor::mono_directive(script); - *//*if(script.find("//mono\n") != -1) + *//*if(script.find("//mono\n") != std::string::npos) { domono = TRUE; - }else if(script.find("//lsl2\n") != -1) + }else if(script.find("//lsl2\n") != std::string::npos) { domono = FALSE; }*//* diff --git a/indra/newview/jcfloaterareasearch.cpp b/indra/newview/jcfloaterareasearch.cpp index 8b1ac9d77..3beacdf3d 100644 --- a/indra/newview/jcfloaterareasearch.cpp +++ b/indra/newview/jcfloaterareasearch.cpp @@ -221,10 +221,10 @@ void JCFloaterAreaSearch::results() LLStringUtil::toLower(object_desc); LLStringUtil::toLower(object_owner); LLStringUtil::toLower(object_group); - if ((mFilterStrings[LIST_OBJECT_NAME].empty() || object_name.find(mFilterStrings[LIST_OBJECT_NAME]) != -1) && - (mFilterStrings[LIST_OBJECT_DESC].empty() || object_desc.find(mFilterStrings[LIST_OBJECT_DESC]) != -1) && - (mFilterStrings[LIST_OBJECT_OWNER].empty() || object_owner.find(mFilterStrings[LIST_OBJECT_OWNER]) != -1) && - (mFilterStrings[LIST_OBJECT_GROUP].empty() || object_group.find(mFilterStrings[LIST_OBJECT_GROUP]) != -1)) + if ((mFilterStrings[LIST_OBJECT_NAME].empty() || object_name.find(mFilterStrings[LIST_OBJECT_NAME]) != std::string::npos) && + (mFilterStrings[LIST_OBJECT_DESC].empty() || object_desc.find(mFilterStrings[LIST_OBJECT_DESC]) != std::string::npos) && + (mFilterStrings[LIST_OBJECT_OWNER].empty() || object_owner.find(mFilterStrings[LIST_OBJECT_OWNER]) != std::string::npos) && + (mFilterStrings[LIST_OBJECT_GROUP].empty() || object_group.find(mFilterStrings[LIST_OBJECT_GROUP]) != std::string::npos)) { //llinfos << "pass" << llendl; LLSD element; diff --git a/indra/newview/lfsimfeaturehandler.cpp b/indra/newview/lfsimfeaturehandler.cpp index 2e6b55b37..83b17125d 100644 --- a/indra/newview/lfsimfeaturehandler.cpp +++ b/indra/newview/lfsimfeaturehandler.cpp @@ -20,7 +20,6 @@ #include "lfsimfeaturehandler.h" #include "llagent.h" -#include "llenvmanager.h" #include "llviewerregion.h" #include "hippogridmanager.h" @@ -33,7 +32,7 @@ LFSimFeatureHandler::LFSimFeatureHandler() , mWhisperRange(10) { if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) // Remove this line if we ever handle SecondLife sim features - LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LFSimFeatureHandler::handleRegionChange, this)); + gAgent.addRegionChangedCallback(boost::bind(&LFSimFeatureHandler::handleRegionChange, this)); } ExportPolicy LFSimFeatureHandler::exportPolicy() const @@ -85,6 +84,11 @@ void LFSimFeatureHandler::setSupportedFeatures() has_feature_or_default(mDestinationGuideURL, extras, "destination-guide-url"); mMapServerURL = extras.has("map-server-url") ? extras["map-server-url"].asString() : ""; has_feature_or_default(mSearchURL, extras, "search-server-url"); + if (extras.has("GridName")) + { + const std::string& grid_name(extras["GridName"]); + mGridName = gHippoGridManager->getConnectedGrid()->getGridName() != grid_name ? grid_name : ""; + } } has_feature_or_default(mSayRange, extras, "say-range"); has_feature_or_default(mShoutRange, extras, "shout-range"); @@ -98,6 +102,7 @@ void LFSimFeatureHandler::setSupportedFeatures() mDestinationGuideURL.reset(); mMapServerURL = ""; mSearchURL.reset(); + mGridName.reset(); } mSayRange.reset(); mShoutRange.reset(); @@ -105,33 +110,3 @@ void LFSimFeatureHandler::setSupportedFeatures() } } } - -boost::signals2::connection LFSimFeatureHandler::setSupportsExportCallback(const SignaledType::slot_t& slot) -{ - return mSupportsExport.connect(slot); -} - -boost::signals2::connection LFSimFeatureHandler::setDestinationGuideURLCallback(const SignaledType::slot_t& slot) -{ - return mDestinationGuideURL.connect(slot); -} - -boost::signals2::connection LFSimFeatureHandler::setSearchURLCallback(const SignaledType::slot_t& slot) -{ - return mSearchURL.connect(slot); -} - -boost::signals2::connection LFSimFeatureHandler::setSayRangeCallback(const SignaledType::slot_t& slot) -{ - return mSayRange.connect(slot); -} - -boost::signals2::connection LFSimFeatureHandler::setShoutRangeCallback(const SignaledType::slot_t& slot) -{ - return mShoutRange.connect(slot); -} - -boost::signals2::connection LFSimFeatureHandler::setWhisperRangeCallback(const SignaledType::slot_t& slot) -{ - return mWhisperRange.connect(slot); -} diff --git a/indra/newview/lfsimfeaturehandler.h b/indra/newview/lfsimfeaturehandler.h index c1260d4cc..893edb5a0 100644 --- a/indra/newview/lfsimfeaturehandler.h +++ b/indra/newview/lfsimfeaturehandler.h @@ -41,6 +41,7 @@ public: return *this; } operator Type() const { return mValue; } + const Type& ref() const { return mValue; } void reset() { *this = mDefaultValue; } const Type& getDefault() const { return mDefaultValue; } @@ -61,18 +62,19 @@ public: void setSupportedFeatures(); // Connection setters - boost::signals2::connection setSupportsExportCallback(const SignaledType::slot_t& slot); - boost::signals2::connection setDestinationGuideURLCallback(const SignaledType::slot_t& slot); - boost::signals2::connection setSearchURLCallback(const SignaledType::slot_t& slot); - boost::signals2::connection setSayRangeCallback(const SignaledType::slot_t& slot); - boost::signals2::connection setShoutRangeCallback(const SignaledType::slot_t& slot); - boost::signals2::connection setWhisperRangeCallback(const SignaledType::slot_t& slot); + boost::signals2::connection setSupportsExportCallback(const SignaledType::slot_t& slot) { return mSupportsExport.connect(slot); } + boost::signals2::connection setDestinationGuideURLCallback(const SignaledType::slot_t& slot) { return mDestinationGuideURL.connect(slot); } + boost::signals2::connection setSearchURLCallback(const SignaledType::slot_t& slot) { return mSearchURL.connect(slot); } + boost::signals2::connection setSayRangeCallback(const SignaledType::slot_t& slot) { return mSayRange.connect(slot); } + boost::signals2::connection setShoutRangeCallback(const SignaledType::slot_t& slot) { return mShoutRange.connect(slot); } + boost::signals2::connection setWhisperRangeCallback(const SignaledType::slot_t& slot) { return mWhisperRange.connect(slot); } // Accessors bool simSupportsExport() const { return mSupportsExport; } std::string destinationGuideURL() const { return mDestinationGuideURL; } std::string mapServerURL() const { return mMapServerURL; } std::string searchURL() const { return mSearchURL; } + const std::string& gridName() const { return mGridName.ref(); } U32 sayRange() const { return mSayRange; } U32 shoutRange() const { return mShoutRange; } U32 whisperRange() const { return mWhisperRange; } @@ -84,6 +86,7 @@ private: SignaledType mDestinationGuideURL; std::string mMapServerURL; SignaledType mSearchURL; + SignaledType mGridName; SignaledType mSayRange; SignaledType mShoutRange; SignaledType mWhisperRange; diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index cf5e3a3c8..a8fa1568b 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -103,6 +103,7 @@ #include "lluictrlfactory.h" //For LLUICtrlFactory::getLayeredXMLNode +#include "hippolimits.h" // for getMaxAgentGroups // [RLVa:KB] - Checked: 2011-11-04 (RLVa-1.4.4a) #include "rlvactions.h" #include "rlvhandler.h" @@ -246,6 +247,7 @@ protected: private: }; + //-------------------------------------------------------------------- // Statics // @@ -272,11 +274,10 @@ void LLAgentFriendObserver::changed(U32 mask) } } -// static -void LLAgent::parcelChangedCallback() + +void LLAgent::setCanEditParcel() // called via mParcelChangedSignal { bool can_edit = LLToolMgr::getInstance()->canEdit(); - gAgent.mCanEditParcel = can_edit; } @@ -435,6 +436,8 @@ LLAgent::LLAgent() : mControlsTakenCount[i] = 0; mControlsTakenPassedOnCount[i] = 0; } + + addParcelChangedCallback(&setCanEditParcel); } // Requires gSavedSettings to be initialized. @@ -444,10 +447,10 @@ LLAgent::LLAgent() : void LLAgent::init() { + // *Note: this is where LLViewerCamera::getInstance() used to be constructed. + setFlying( gSavedSettings.getBOOL("FlyingAtExit") ); - - // LLDebugVarMessageBox::show("Camera Lag", &CAMERA_FOCUS_HALF_LIFE, 0.5f, 0.01f); *mEffectColor = gSavedSettings.getColor4("EffectColor"); @@ -458,8 +461,6 @@ void LLAgent::init() mLastKnownRequestMaturity = mLastKnownResponseMaturity; mIsDoSendMaturityPreferenceToServer = true; - LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(boost::bind(&LLAgent::parcelChangedCallback)); - if (!mTeleportFinishedSlot.connected()) { mTeleportFinishedSlot = LLViewerParcelMgr::getInstance()->setTeleportFinishedCallback(boost::bind(&LLAgent::handleTeleportFinished, this)); @@ -706,8 +707,7 @@ BOOL LLAgent::canFly() // static const LLCachedControl ascent_fly_always_enabled("AscentFlyAlwaysEnabled",false); - if(ascent_fly_always_enabled) - return TRUE; + if(ascent_fly_always_enabled) return TRUE; // LLViewerRegion* regionp = getRegion(); @@ -759,10 +759,7 @@ void LLAgent::setFlying(BOOL fly) if (fly) { // [RLVa:KB] - Checked: 2010-03-02 (RLVa-1.2.0d) | Modified: RLVa-1.0.0c - if (gRlvHandler.hasBehaviour(RLV_BHVR_FLY)) - { - return; - } + if (gRlvHandler.hasBehaviour(RLV_BHVR_FLY)) return; // [/RLVa:KB] BOOL was_flying = getFlying(); @@ -815,6 +812,8 @@ void LLAgent::toggleFlying() bool LLAgent::enableFlying() { BOOL sitting = FALSE; + static LLCachedControl continue_flying_on_unsit(gSavedSettings, "LiruContinueFlyingOnUnsit", false); + if (!continue_flying_on_unsit) if (isAgentAvatarValid()) { sitting = gAgentAvatarp->isSitting(); @@ -858,22 +857,30 @@ void LLAgent::handleServerBakeRegionTransition(const LLUUID& region_id) } } +void LLAgent::changeParcels() +{ + LL_DEBUGS("AgentLocation") << "Calling ParcelChanged callbacks" << LL_ENDL; + // Notify anything that wants to know about parcel changes + mParcelChangedSignal(); +} + +boost::signals2::connection LLAgent::addParcelChangedCallback(parcel_changed_callback_t cb) +{ + return mParcelChangedSignal.connect(cb); +} + //----------------------------------------------------------------------------- // setRegion() //----------------------------------------------------------------------------- void LLAgent::setRegion(LLViewerRegion *regionp) { - bool teleport = true; - llassert(regionp); if (mRegionp != regionp) { - // std::string host_name; - // host_name = regionp->getHost().getHostName(); std::string ip = regionp->getHost().getString(); - llinfos << "Moving agent into region: " << regionp->getName() - << " located at " << ip << llendl; + LL_INFOS("AgentLocation") << "Moving agent into region: " << regionp->getName() + << " located at " << ip << LL_ENDL; if (mRegionp) { // NaCl - Antispam Registry @@ -905,9 +912,6 @@ void LLAgent::setRegion(LLViewerRegion *regionp) { gSky.mVOGroundp->setRegion(regionp); } - - // Notify windlight managers - teleport = (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE); } else { @@ -929,6 +933,7 @@ void LLAgent::setRegion(LLViewerRegion *regionp) // Pass new region along to metrics components that care about this level of detail. LLAppViewer::metricsUpdateRegion(regionp->getHandle()); } + mRegionp = regionp; // Must shift hole-covering water object locations because local @@ -943,33 +948,18 @@ void LLAgent::setRegion(LLViewerRegion *regionp) LLSelectMgr::getInstance()->updateSelectionCenter(); - if (teleport) - { - LLEnvManagerNew::instance().onTeleport(); - } - else - { - LLEnvManagerNew::instance().onRegionCrossing(); - } - - // If the newly entered region is using server bakes, and our - // current appearance is non-baked, request appearance update from - // server. - if (mRegionp->capabilitiesReceived()) - { - handleServerBakeRegionTransition(mRegionp->getRegionID()); - } - else - { - // Need to handle via callback after caps arrive. - mRegionp->setCapabilitiesReceivedCallback(boost::bind(&LLAgent::handleServerBakeRegionTransition,this,_1)); - } + LL_DEBUGS("AgentLocation") << "Calling RegionChanged callbacks" << LL_ENDL; + mRegionChangedSignal(); } //----------------------------------------------------------------------------- // getRegion() //----------------------------------------------------------------------------- +LLViewerRegion *LLAgent::getRegion() const +{ + return mRegionp; +} const LLHost& LLAgent::getRegionHost() const { @@ -983,6 +973,16 @@ const LLHost& LLAgent::getRegionHost() const } } +boost::signals2::connection LLAgent::addRegionChangedCallback(const region_changed_signal_t::slot_type& cb) +{ + return mRegionChangedSignal.connect(cb); +} + +void LLAgent::removeRegionChangedCallback(boost::signals2::connection callback) +{ + mRegionChangedSignal.disconnect(callback); +} + //----------------------------------------------------------------------------- // inPrelude() //----------------------------------------------------------------------------- @@ -1906,12 +1906,6 @@ std::ostream& operator<<(std::ostream &s, const LLAgent &agent) return s; } - -// ------------------- Beginning of legacy LLCamera hack ---------------------- -// This section is included for legacy LLCamera support until -// it is no longer needed. Some legacy code must exist in -// non-legacy functions, and is labeled with "// legacy" comments. - // TRUE if your own avatar needs to be rendered. Usually only // in third person and build. //----------------------------------------------------------------------------- @@ -1950,8 +1944,8 @@ void LLAgent::startTyping() if (mChatTimer.getElapsedTimeF32() < 2.f) { - LLVOAvatar* chatter = gObjectList.findAvatar(mLastChatterID); - if (chatter) + LLViewerObject* chatter = gObjectList.findObject(mLastChatterID); + if (chatter && chatter->isAvatar()) { gAgentCamera.setLookAt(LOOKAT_TARGET_RESPOND, chatter, LLVector3::zero); } @@ -1961,7 +1955,8 @@ void LLAgent::startTyping() { sendAnimationRequest(ANIM_AGENT_TYPE, ANIM_REQUEST_START); } - gChatBar->sendChatFromViewer("", CHAT_TYPE_START, FALSE); + gChatBar-> + sendChatFromViewer("", CHAT_TYPE_START, FALSE); } //----------------------------------------------------------------------------- @@ -1973,7 +1968,8 @@ void LLAgent::stopTyping() { clearRenderState(AGENT_STATE_TYPING); sendAnimationRequest(ANIM_AGENT_TYPE, ANIM_REQUEST_STOP); - gChatBar->sendChatFromViewer("", CHAT_TYPE_STOP, FALSE); + gChatBar-> + sendChatFromViewer("", CHAT_TYPE_STOP, FALSE); } } @@ -2068,6 +2064,7 @@ void LLAgent::endAnimationUpdateUI() mViewsPushed = FALSE; } + gAgentCamera.setLookAt(LOOKAT_TARGET_CLEAR); if( gMorphView ) { @@ -2223,13 +2220,6 @@ void LLAgent::endAnimationUpdateUI() LLToolMgr::getInstance()->setCurrentToolset(gFaceEditToolset); LLFloaterMap::getInstance()->pushVisible(FALSE); - /* - LLView *view; - for (view = gFloaterView->getFirstChild(); view; view = gFloaterView->getNextChild()) - { - view->pushVisible(FALSE); - } - */ if( gMorphView ) { @@ -2567,28 +2557,30 @@ int LLAgent::convertTextToMaturity(char text) return LLAgentAccess::convertTextToMaturity(text); } -extern AIHTTPTimeoutPolicy maturityPreferences_timeout; class LLMaturityPreferencesResponder : public LLHTTPClient::ResponderWithResult { + LOG_CLASS(LLMaturityPreferencesResponder); public: LLMaturityPreferencesResponder(LLAgent *pAgent, U8 pPreferredMaturity, U8 pPreviousMaturity); virtual ~LLMaturityPreferencesResponder(); - /*virtual*/ void httpSuccess(void); - /*virtual*/ void httpFailure(void); +protected: + virtual void httpSuccess(); + virtual void httpFailure(); - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return maturityPreferences_timeout; } /*virtual*/ char const* getName(void) const { return "LLMaturityPreferencesResponder"; } +protected: private: - U8 parseMaturityFromServerResponse(const LLSD &pContent); + U8 parseMaturityFromServerResponse(const LLSD &pContent) const; LLAgent *mAgent; U8 mPreferredMaturity; U8 mPreviousMaturity; }; -LLMaturityPreferencesResponder::LLMaturityPreferencesResponder(LLAgent *pAgent, U8 pPreferredMaturity, U8 pPreviousMaturity) : +LLMaturityPreferencesResponder::LLMaturityPreferencesResponder(LLAgent *pAgent, U8 pPreferredMaturity, U8 pPreviousMaturity) + : mAgent(pAgent), mPreferredMaturity(pPreferredMaturity), mPreviousMaturity(pPreviousMaturity) @@ -2599,75 +2591,49 @@ LLMaturityPreferencesResponder::~LLMaturityPreferencesResponder() { } -void LLMaturityPreferencesResponder::httpSuccess(void) +void LLMaturityPreferencesResponder::httpSuccess() { - U8 actualMaturity = parseMaturityFromServerResponse(mContent); + U8 actualMaturity = parseMaturityFromServerResponse(getContent()); if (actualMaturity != mPreferredMaturity) { - llwarns << "while attempting to change maturity preference from '" << LLViewerRegion::accessToString(mPreviousMaturity) - << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', the server responded with '" - << LLViewerRegion::accessToString(actualMaturity) << "' [value:" << static_cast(actualMaturity) << ", llsd:" - << mContent << "]" << llendl; + llwarns << "while attempting to change maturity preference from '" + << LLViewerRegion::accessToString(mPreviousMaturity) + << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) + << "', the server responded with '" + << LLViewerRegion::accessToString(actualMaturity) + << "' [value:" << static_cast(actualMaturity) + << "], " << dumpResponse() << llendl; } mAgent->handlePreferredMaturityResult(actualMaturity); } -void LLMaturityPreferencesResponder::httpFailure(void) +void LLMaturityPreferencesResponder::httpFailure() { - llwarns << "while attempting to change maturity preference from '" << LLViewerRegion::accessToString(mPreviousMaturity) - << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', we got an error because '" - << mReason << "' [status:" << mStatus << "]" << llendl; + llwarns << "while attempting to change maturity preference from '" + << LLViewerRegion::accessToString(mPreviousMaturity) + << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) + << "', " << dumpResponse() << llendl; mAgent->handlePreferredMaturityError(); } -U8 LLMaturityPreferencesResponder::parseMaturityFromServerResponse(const LLSD &pContent) +U8 LLMaturityPreferencesResponder::parseMaturityFromServerResponse(const LLSD &pContent) const { - // stinson 05/24/2012 Pathfinding regions have re-defined the response behavior. In the old server code, - // if you attempted to change the preferred maturity to the same value, the response content would be an - // undefined LLSD block. In the new server code with pathfinding, the response content should always be - // defined. Thus, the check for isUndefined() can be replaced with an assert after pathfinding is merged - // into server trunk and fully deployed. U8 maturity = SIM_ACCESS_MIN; - if (pContent.isUndefined()) + + llassert(pContent.isDefined()); + llassert(pContent.isMap()); + llassert(pContent.has("access_prefs")); + llassert(pContent.get("access_prefs").isMap()); + llassert(pContent.get("access_prefs").has("max")); + llassert(pContent.get("access_prefs").get("max").isString()); + if (pContent.isDefined() && pContent.isMap() && pContent.has("access_prefs") + && pContent.get("access_prefs").isMap() && pContent.get("access_prefs").has("max") + && pContent.get("access_prefs").get("max").isString()) { - maturity = mPreferredMaturity; - } - else - { - llassert(!pContent.isUndefined()); - llassert(pContent.isMap()); - - if (!pContent.isUndefined() && pContent.isMap()) - { - // stinson 05/24/2012 Pathfinding regions have re-defined the response syntax. The if statement catches - // the new syntax, and the else statement catches the old syntax. After pathfinding is merged into - // server trunk and fully deployed, we can remove the else statement. - if (pContent.has("access_prefs")) - { - llassert(pContent.has("access_prefs")); - llassert(pContent.get("access_prefs").isMap()); - llassert(pContent.get("access_prefs").has("max")); - llassert(pContent.get("access_prefs").get("max").isString()); - if (pContent.get("access_prefs").isMap() && pContent.get("access_prefs").has("max") && - pContent.get("access_prefs").get("max").isString()) - { - LLSD::String actualPreference = pContent.get("access_prefs").get("max").asString(); - LLStringUtil::trim(actualPreference); - maturity = LLViewerRegion::shortStringToAccess(actualPreference); - } - } - else if (pContent.has("max")) - { - llassert(pContent.get("max").isString()); - if (pContent.get("max").isString()) - { - LLSD::String actualPreference = pContent.get("max").asString(); - LLStringUtil::trim(actualPreference); - maturity = LLViewerRegion::shortStringToAccess(actualPreference); - } - } - } + LLSD::String actualPreference = pContent.get("access_prefs").get("max").asString(); + LLStringUtil::trim(actualPreference); + maturity = LLViewerRegion::shortStringToAccess(actualPreference); } return maturity; @@ -2802,7 +2768,7 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity) mLastKnownRequestMaturity = pPreferredMaturity; // Create a response handler - boost::intrusive_ptr responderPtr = new LLMaturityPreferencesResponder(this, pPreferredMaturity, mLastKnownResponseMaturity); + boost::intrusive_ptr responderPtr = boost::intrusive_ptr(new LLMaturityPreferencesResponder(this, pPreferredMaturity, mLastKnownResponseMaturity)); // If we don't have a region, report it as an error if (getRegion() == NULL) @@ -2817,7 +2783,8 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity) // If the capability is not defined, report it as an error if (url.empty()) { - responderPtr->failureResult(0U, "capability 'UpdateAgentInformation' is not defined for region", LLSD()); + responderPtr->failureResult(0U, + "capability 'UpdateAgentInformation' is not defined for region", LLSD()); } else { @@ -2881,12 +2848,11 @@ void LLAgent::handleMaturity(const LLSD &pNewValue) sendMaturityPreferenceToServer(static_cast(pNewValue.asInteger())); } +//---------------------------------------------------------------------------- + void LLAgent::buildFullname(std::string& name) const { - if (isAgentAvatarValid()) - { - name = gAgentAvatarp->getFullname(); - } + if (isAgentAvatarValid()) name = gAgentAvatarp->getFullname(); } void LLAgent::buildFullnameAndTitle(std::string& name) const @@ -2912,10 +2878,10 @@ BOOL LLAgent::isInGroup(const LLUUID& group_id, BOOL ignore_god_mode /* FALSE */ if (!ignore_god_mode && isGodlike()) return true; - S32 count = mGroups.count(); - for(S32 i = 0; i < count; ++i) + U32 count = mGroups.size(); + for(U32 i = 0; i < count; ++i) { - if(mGroups.get(i).mID == group_id) + if(mGroups[i].mID == group_id) { return TRUE; } @@ -2932,12 +2898,12 @@ BOOL LLAgent::hasPowerInGroup(const LLUUID& group_id, U64 power) const // GP_NO_POWERS can also mean no power is enough to grant an ability. if (GP_NO_POWERS == power) return FALSE; - S32 count = mGroups.count(); - for(S32 i = 0; i < count; ++i) + U32 count = mGroups.size(); + for(U32 i = 0; i < count; ++i) { - if(mGroups.get(i).mID == group_id) + if(mGroups[i].mID == group_id) { - return (BOOL)((mGroups.get(i).mPowers & power) > 0); + return (BOOL)((mGroups[i].mPowers & power) > 0); } } return FALSE; @@ -2953,12 +2919,12 @@ U64 LLAgent::getPowerInGroup(const LLUUID& group_id) const if (isGodlike()) return GP_ALL_POWERS; - S32 count = mGroups.count(); - for(S32 i = 0; i < count; ++i) + U32 count = mGroups.size(); + for(U32 i = 0; i < count; ++i) { - if(mGroups.get(i).mID == group_id) + if(mGroups[i].mID == group_id) { - return (mGroups.get(i).mPowers); + return (mGroups[i].mPowers); } } @@ -2967,12 +2933,12 @@ U64 LLAgent::getPowerInGroup(const LLUUID& group_id) const BOOL LLAgent::getGroupData(const LLUUID& group_id, LLGroupData& data) const { - S32 count = mGroups.count(); + S32 count = mGroups.size(); for(S32 i = 0; i < count; ++i) { - if(mGroups.get(i).mID == group_id) + if(mGroups[i].mID == group_id) { - data = mGroups.get(i); + data = mGroups[i]; return TRUE; } } @@ -2981,12 +2947,12 @@ BOOL LLAgent::getGroupData(const LLUUID& group_id, LLGroupData& data) const S32 LLAgent::getGroupContribution(const LLUUID& group_id) const { - S32 count = mGroups.count(); + S32 count = mGroups.size(); for(S32 i = 0; i < count; ++i) { - if(mGroups.get(i).mID == group_id) + if(mGroups[i].mID == group_id) { - S32 contribution = mGroups.get(i).mContribution; + S32 contribution = mGroups[i].mContribution; return contribution; } } @@ -2995,12 +2961,12 @@ S32 LLAgent::getGroupContribution(const LLUUID& group_id) const BOOL LLAgent::setGroupContribution(const LLUUID& group_id, S32 contribution) { - S32 count = mGroups.count(); + S32 count = mGroups.size(); for(S32 i = 0; i < count; ++i) { - if(mGroups.get(i).mID == group_id) + if(mGroups[i].mID == group_id) { - mGroups.get(i).mContribution = contribution; + mGroups[i].mContribution = contribution; LLMessageSystem* msg = gMessageSystem; msg->newMessage("SetGroupContribution"); msg->nextBlock("AgentData"); @@ -3018,14 +2984,13 @@ BOOL LLAgent::setGroupContribution(const LLUUID& group_id, S32 contribution) BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOOL list_in_profile) { - S32 count = mGroups.count(); + S32 count = mGroups.size(); for(S32 i = 0; i < count; ++i) { - LLGroupData &group = mGroups.get(i); - if(group.mID == group_id) + if(mGroups[i].mID == group_id) { - group.mAcceptNotices = accept_notices; - group.mListInProfile = list_in_profile; + mGroups[i].mAcceptNotices = accept_notices; + mGroups[i].mListInProfile = list_in_profile; LLMessageSystem* msg = gMessageSystem; msg->newMessage("SetGroupAcceptNotices"); msg->nextBlock("AgentData"); @@ -3038,7 +3003,7 @@ BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOO msg->addBOOL("ListInProfile", list_in_profile); sendReliableMessage(); - update_group_floaters(group.mID); + update_group_floaters(mGroups[i].mID); return TRUE; } @@ -3046,6 +3011,10 @@ BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOO return FALSE; } +BOOL LLAgent::canJoinGroups() const +{ + return (S32)mGroups.size() < gHippoLimits->getMaxAgentGroups(); +} LLQuaternion LLAgent::getHeadRotation() { @@ -3173,7 +3142,7 @@ void LLAgent::sendRevokePermissions(const LLUUID & target, U32 permissions) msg->nextBlockFast(_PREHASH_Data); msg->addUUIDFast(_PREHASH_ObjectID, target); // Must be in the region - msg->addU32Fast(_PREHASH_ObjectPermissions, permissions); + msg->addS32Fast(_PREHASH_ObjectPermissions, (S32) permissions); sendReliableMessage(); } @@ -3312,9 +3281,19 @@ void LLAgent::getName(std::string& name) } } -const LLColor4 &LLAgent::getEffectColor() +const LLColor4 LLAgent::getEffectColor() { - return *mEffectColor; + LLColor4 effect_color = *mEffectColor; + + // Rainbow Particle Effects + static LLCachedControl AlchemyRainbowEffects(gSavedSettings, "AlchemyRainbowEffects"); + if(AlchemyRainbowEffects) + { + LLColor3 rainbow; + rainbow.setHSL(fmodf((F32)LLFrameTimer::getElapsedSeconds()/4.f, 1.f), 1.f, 0.5f); + effect_color.set(rainbow, 1.0f); + } + return effect_color; } void LLAgent::setEffectColor(const LLColor4 &color) @@ -3364,6 +3343,7 @@ BOOL LLAgent::downGrabbed() const void update_group_floaters(const LLUUID& group_id) { + LLGroupActions::refresh(group_id); // update avatar info @@ -3394,10 +3374,10 @@ void LLAgent::processAgentDropGroup(LLMessageSystem *msg, void **) // Remove the group if it already exists remove it and add the new data to pick up changes. LLGroupData gd; gd.mID = group_id; - S32 index = gAgent.mGroups.find(gd); - if (index != -1) + std::vector::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), gd); + if (found_it != gAgent.mGroups.end()) { - gAgent.mGroups.remove(index); + gAgent.mGroups.erase(found_it); if (gAgent.getGroupID() == group_id) { gAgent.mGroupID.setNull(); @@ -3434,8 +3414,7 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode !input.has("body") ) { //what to do with badly formed message? - response->statusUnknownError(400); - response->result(LLSD("Invalid message parameters")); + response->extendedResult(HTTP_BAD_REQUEST, "", LLSD("Invalid message parameters")); } LLSD body = input["body"]; @@ -3473,10 +3452,10 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode // and add the new data to pick up changes. LLGroupData gd; gd.mID = group_id; - S32 index = gAgent.mGroups.find(gd); - if (index != -1) + std::vector::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), gd); + if (found_it != gAgent.mGroups.end()) { - gAgent.mGroups.remove(index); + gAgent.mGroups.erase(found_it); if (gAgent.getGroupID() == group_id) { gAgent.mGroupID.setNull(); @@ -3507,8 +3486,7 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode else { //what to do with badly formed message? - response->statusUnknownError(400); - response->result(LLSD("Invalid message parameters")); + response->extendedResult(HTTP_BAD_REQUEST, "", LLSD("Invalid message parameters")); } } }; @@ -3532,7 +3510,6 @@ void LLAgent::processAgentGroupDataUpdate(LLMessageSystem *msg, void **) S32 count = msg->getNumberOfBlocksFast(_PREHASH_GroupData); LLGroupData group; - S32 index = -1; bool need_floater_update = false; for(S32 i = 0; i < count; ++i) { @@ -3547,12 +3524,12 @@ void LLAgent::processAgentGroupDataUpdate(LLMessageSystem *msg, void **) { need_floater_update = true; // Remove the group if it already exists remove it and add the new data to pick up changes. - index = gAgent.mGroups.find(group); - if (index != -1) + std::vector::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), group); + if (found_it != gAgent.mGroups.end()) { - gAgent.mGroups.remove(index); + gAgent.mGroups.erase(found_it); } - gAgent.mGroups.put(group); + gAgent.mGroups.push_back(group); } if (need_floater_update) { @@ -3591,7 +3568,6 @@ class LLAgentGroupDataUpdateViewerNode : public LLHTTPNode { LLGroupData group; - S32 index = -1; bool need_floater_update = false; group.mID = (*iter_group)["GroupID"].asUUID(); @@ -3608,12 +3584,12 @@ class LLAgentGroupDataUpdateViewerNode : public LLHTTPNode { need_floater_update = true; // Remove the group if it already exists remove it and add the new data to pick up changes. - index = gAgent.mGroups.find(group); - if (index != -1) + std::vector::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), group); + if (found_it != gAgent.mGroups.end()) { - gAgent.mGroups.remove(index); + gAgent.mGroups.erase(found_it); } - gAgent.mGroups.put(group); + gAgent.mGroups.push_back(group); } if (need_floater_update) { @@ -3692,12 +3668,9 @@ void LLAgent::processScriptControlChange(LLMessageSystem *msg, void **) total_count++; } } - + // Any control taken? If so, might be first time. - if (total_count > 0) - { - LLFirstUse::useOverrideKeys(); - } + if (total_count > 0) LLFirstUse::useOverrideKeys(); } else { @@ -3813,7 +3786,7 @@ void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void * return; } - if (isAgentAvatarValid() && gAgentAvatarp->isEditingAppearance()) + if (gAgentAvatarp->isEditingAppearance()) { // ignore baked textures when in customize mode return; diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index a66b375f4..6294d2e0a 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -36,7 +36,6 @@ #include #include "indra_constants.h" - #include "llevent.h" // LLObservable base class #include "llagentconstants.h" #include "llagentdata.h" // gAgentID, gAgentSessionID @@ -72,9 +71,12 @@ class LLSLURL; class LLSimInfo; class LLTeleportRequest; -typedef std::vector llvo_vec_t; typedef boost::shared_ptr LLTeleportRequestPtr; +//-------------------------------------------------------------------- +// Types +//-------------------------------------------------------------------- + enum EAnimRequest { ANIM_REQUEST_START, @@ -213,7 +215,7 @@ public: //-------------------------------------------------------------------- public: const LLCoordFrame& getFrameAgent() const { return mFrameAgent; } - void initOriginGlobal(const LLVector3d &origin_global); // Only to be used in ONE place! - djs 08/07/02 + void initOriginGlobal(const LLVector3d &origin_global); // Only to be used in ONE place void resetAxes(); void resetAxes(const LLVector3 &look_at); // Makes reasonable left and up // The following three get*Axis functions return direction avatar is looking, not camera. @@ -238,15 +240,52 @@ private: U64 mHomeRegionHandle; LLVector3 mHomePosRegion; + //-------------------------------------------------------------------- + // Parcel + //-------------------------------------------------------------------- +public: + void changeParcels(); // called by LLViewerParcelMgr when we cross a parcel boundary + + // Register a boost callback to be called when the agent changes parcels + typedef boost::function parcel_changed_callback_t; + boost::signals2::connection addParcelChangedCallback(parcel_changed_callback_t); + +private: + typedef boost::signals2::signal parcel_changed_signal_t; + parcel_changed_signal_t mParcelChangedSignal; + //-------------------------------------------------------------------- // Region //-------------------------------------------------------------------- public: void setRegion(LLViewerRegion *regionp); - LLViewerRegion *getRegion() const { return mRegionp; } + LLViewerRegion *getRegion() const; const LLHost& getRegionHost() const; BOOL inPrelude(); + /** + * Register a boost callback to be called when the agent changes regions + * Note that if you need to access a capability for the region, you may need to wait + * for the capabilities to be received, since in some cases your region changed + * callback will be called before the capabilities have been received. Your callback + * may need to look something like: + * + * LLViewerRegion* region = gAgent.getRegion(); + * if (region->capabilitiesReceived()) + * { + * useCapability(region); + * } + * else // Need to handle via callback after caps arrive. + * { + * region->setCapabilitiesReceivedCallback(boost::bind(&useCapability,region,_1)); + * // you may or may not want to remove that callback + * } + */ + typedef boost::signals2::signal region_changed_signal_t; + + boost::signals2::connection addRegionChangedCallback(const region_changed_signal_t::slot_type& cb); + void removeRegionChangedCallback(boost::signals2::connection callback); + // struct SHLureRequest { @@ -260,9 +299,10 @@ public: void showLureDestination(const std::string fromname, U64& handle, U32 x, U32 y, U32 z); void onFoundLureDestination(LLSimInfo *siminfo = NULL); // - + private: LLViewerRegion *mRegionp; + region_changed_signal_t mRegionChangedSignal; //-------------------------------------------------------------------- // History @@ -274,6 +314,7 @@ public: const LLVector3d &getLastPositionGlobal() const { return mLastPositionGlobal; } void setLastPositionGlobal(const LLVector3d &pos) { mLastPositionGlobal = pos; } + private: std::set mRegionsVisited; // Stat - what distinct regions has the avatar been to? F64 mDistanceTraveled; // Stat - how far has the avatar moved? @@ -654,6 +695,7 @@ private: void handleTeleportFinished(); void handleTeleportFailed(); +public: void handleServerBakeRegionTransition(const LLUUID& region_id); //-------------------------------------------------------------------- @@ -682,9 +724,10 @@ private: public: bool canEditParcel() const { return mCanEditParcel; } private: + static void setCanEditParcel(); bool mCanEditParcel; - static void parcelChangedCallback(); + /******************************************************************************** ** ** @@ -807,7 +850,7 @@ private: // HUD //-------------------------------------------------------------------- public: - const LLColor4 &getEffectColor(); + const LLColor4 getEffectColor(); void setEffectColor(const LLColor4 &color); private: LLColor4 *mEffectColor; @@ -831,6 +874,7 @@ public: BOOL setGroupContribution(const LLUUID& group_id, S32 contribution); BOOL setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOOL list_in_profile); const std::string &getGroupName() const { return mGroupName; } + BOOL canJoinGroups() const; private: std::string mGroupName; LLUUID mGroupID; @@ -845,7 +889,7 @@ protected: // Only used for building titles. BOOL isGroupMember() const { return !mGroupID.isNull(); } public: - LLDynamicArray mGroups; + std::vector mGroups; //-------------------------------------------------------------------- // Group Title diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index a8e0a5c2a..af8bad3d6 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -2272,6 +2272,7 @@ void LLAgentCamera::changeCameraToFollow(BOOL animate) if (mCameraMode == CAMERA_MODE_MOUSELOOK) { animate = FALSE; + if (gViewerWindow->getRightMouseDown()) LLViewerCamera::instance().loadDefaultFOV(); // We could be zoomed in } startCameraAnimation(); @@ -2361,6 +2362,7 @@ void LLAgentCamera::changeCameraToThirdPerson(BOOL animate) mCurrentCameraDistance = MIN_CAMERA_DISTANCE; mTargetCameraDistance = MIN_CAMERA_DISTANCE; animate = FALSE; + if (gViewerWindow->getRightMouseDown()) LLViewerCamera::instance().loadDefaultFOV(); // We could be zoomed in } updateLastCamera(); mCameraMode = CAMERA_MODE_THIRD_PERSON; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 6294e62af..bffaafd3c 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -113,7 +113,7 @@ public: }; // support for secondlife:///app/appearance SLapps -/*class LLAppearanceHandler : public LLCommandHandler +class LLAppearanceHandler : public LLCommandHandler { public: // requests will be throttled from a non-trusted browser @@ -121,6 +121,7 @@ public: bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { + /* Singu Note: Nopenopenope. // support secondlife:///app/appearance/show, but for now we just // make all secondlife:///app/appearance SLapps behave this way if (!LLUI::sSettingGroups["config"]->getBOOL("EnableAppearance")) @@ -128,13 +129,14 @@ public: LLNotificationsUtil::add("NoAppearance", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); return true; } + */ - LLFloaterSidePanelContainer::showPanel("appearance", LLSD()); + LLFloaterCustomize::getInstance()->open(); return true; } }; -LLAppearanceHandler gAppearanceHandler;*/ +LLAppearanceHandler gAppearanceHandler; LLUUID findDescendentCategoryIDByName(const LLUUID& parent_id, const std::string& name) @@ -147,11 +149,11 @@ LLUUID findDescendentCategoryIDByName(const LLUUID& parent_id, const std::string item_array, LLInventoryModel::EXCLUDE_TRASH, has_name); - if (0 == cat_array.count()) + if (0 == cat_array.size()) return LLUUID(); else { - LLViewerInventoryCategory *cat = cat_array.get(0); + LLViewerInventoryCategory *cat = cat_array.at(0); if (cat) return cat->getUUID(); else @@ -215,11 +217,10 @@ public: // Request or re-request operation for specified item. void addItem(const LLUUID& item_id) { - LL_DEBUGS("Avatar") << "item_id " << item_id << llendl; - + LL_DEBUGS("Avatar") << "item_id " << item_id << LL_ENDL; if (!requestOperation(item_id)) { - LL_DEBUGS("Avatar") << "item_id " << item_id << " requestOperation false, skipping" << llendl; + LL_DEBUGS("Avatar") << "item_id " << item_id << " requestOperation false, skipping" << LL_ENDL; return; } @@ -249,7 +250,7 @@ public: } mPendingRequests--; F32 elapsed = timestamp.getElapsedTimeF32(); - LL_DEBUGS("Avatar") << "op done, src_id " << src_id << " dst_id " << dst_id << " after " << elapsed << " seconds" << llendl; + LL_DEBUGS("Avatar") << "op done, src_id " << src_id << " dst_id " << dst_id << " after " << elapsed << " seconds" << LL_ENDL; if (mWaitTimes.find(src_id) == mWaitTimes.end()) { // No longer waiting for this item - either serviced @@ -353,16 +354,16 @@ public: void reportStats() { - LL_DEBUGS("Avatar") << "Phase: " << mTrackingPhase << llendl; - LL_DEBUGS("Avatar") << "mFailCount: " << mFailCount << llendl; - LL_DEBUGS("Avatar") << "mRetryCount: " << mRetryCount << llendl; - LL_DEBUGS("Avatar") << "Times: n " << mTimeStats.getCount() << " min " << mTimeStats.getMinValue() << " max " << mTimeStats.getMaxValue() << llendl; - LL_DEBUGS("Avatar") << "Mean " << mTimeStats.getMean() << " stddev " << mTimeStats.getStdDev() << llendl; + LL_DEBUGS("Avatar") << "Phase: " << mTrackingPhase << LL_ENDL; + LL_DEBUGS("Avatar") << "mFailCount: " << mFailCount << LL_ENDL; + LL_DEBUGS("Avatar") << "mRetryCount: " << mRetryCount << LL_ENDL; + LL_DEBUGS("Avatar") << "Times: n " << mTimeStats.getCount() << " min " << mTimeStats.getMinValue() << " max " << mTimeStats.getMaxValue() << LL_ENDL; + LL_DEBUGS("Avatar") << "Mean " << mTimeStats.getMean() << " stddev " << mTimeStats.getStdDev() << LL_ENDL; } virtual ~LLCallAfterInventoryBatchMgr() { - LL_DEBUGS("Avatar") << "deleting" << llendl; + LL_DEBUGS("Avatar") << "deleting" << LL_ENDL; } protected: @@ -395,16 +396,22 @@ public: LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func, on_failure_func, retry_after, max_retries) { addItems(src_items); + sInstanceCount++; + } + + ~LLCallAfterInventoryCopyMgr() + { + sInstanceCount--; } virtual bool requestOperation(const LLUUID& item_id) { LLViewerInventoryItem *item = gInventory.getItem(item_id); llassert(item); - LL_DEBUGS("Avatar") << "copying item " << item_id << llendl; + LL_DEBUGS("Avatar") << "copying item " << item_id << LL_ENDL; if (ll_frand() < gSavedSettings.getF32("InventoryDebugSimulateOpFailureRate")) { - LL_DEBUGS("Avatar") << "simulating failure by not sending request for item " << item_id << llendl; + LL_DEBUGS("Avatar") << "simulating failure by not sending request for item " << item_id << LL_ENDL; return true; } copy_inventory_item( @@ -417,8 +424,15 @@ public: ); return true; } + + static S32 getInstanceCount() { return sInstanceCount; } + +private: + static S32 sInstanceCount; }; +S32 LLCallAfterInventoryCopyMgr::sInstanceCount = 0; + class LLCallAfterInventoryLinkMgr: public LLCallAfterInventoryBatchMgr { public: @@ -2635,6 +2649,11 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool category->getUUID(), copy, append)); } +S32 LLAppearanceMgr::getActiveCopyOperations() const +{ + return LLCallAfterInventoryCopyMgr::getInstanceCount(); +} + void LLAppearanceMgr::wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool append) { LL_INFOS("Avatar") << self_av_string() << "starting" << LL_ENDL; @@ -2733,6 +2752,7 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego LLAppearanceMgr::changeOutfit(TRUE, category->getUUID(), append); } +// FIXME do we really want to search entire inventory for matching name? void LLAppearanceMgr::wearOutfitByName(const std::string& name) { LL_INFOS("Avatar") << self_av_string() << "Wearing category " << name << LL_ENDL; @@ -2747,10 +2767,10 @@ void LLAppearanceMgr::wearOutfitByName(const std::string& name) has_name); bool copy_items = false; LLInventoryCategory* cat = NULL; - if (cat_array.count() > 0) + if (cat_array.size() > 0) { // Just wear the first one that matches - cat = cat_array.get(0); + cat = cat_array.at(0); } else { @@ -2759,9 +2779,9 @@ void LLAppearanceMgr::wearOutfitByName(const std::string& name) item_array, LLInventoryModel::EXCLUDE_TRASH, has_name); - if(cat_array.count() > 0) + if(cat_array.size() > 0) { - cat = cat_array.get(0); + cat = cat_array.at(0); copy_items = true; } } @@ -2775,8 +2795,6 @@ void LLAppearanceMgr::wearOutfitByName(const std::string& name) llwarns << "Couldn't find outfit " <getWearableType(); const bool is_body_part = (wearable_type == LLWearableType::WT_SHAPE) @@ -2958,18 +2976,24 @@ LLInventoryModel::item_array_t LLAppearanceMgr::findCOFItemLinks(const LLUUID& i cat_array, item_array, LLInventoryModel::EXCLUDE_TRASH); - for (S32 i=0; igetLinkedUUID() == vitem->getLinkedUUID()) { - result.put(item_array.get(i)); + result.push_back(item_array.at(i)); } } } return result; } +bool LLAppearanceMgr::isLinkedInCOF(const LLUUID& item_id) +{ + LLInventoryModel::item_array_t links = LLAppearanceMgr::instance().findCOFItemLinks(item_id); + return links.size() > 0; +} + void LLAppearanceMgr::removeAllClothesFromAvatar() { // Fetch worn clothes (i.e. the ones in COF). @@ -3035,27 +3059,13 @@ void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id) cat_array, item_array, LLInventoryModel::EXCLUDE_TRASH); - for (S32 i=0; igetIsLinkType() && item->getLinkedUUID() == item_id) { -#if 0 // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG - // NOTE-RLVa: debug-only, can be removed down the line - if (rlv_handler_t::isEnabled()) - { - RLV_ASSERT(rlvPredCanRemoveItem(item)); - } -#endif // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG gInventory.purgeObject(item->getUUID()); } -// [/RLVa:KB] -// const LLInventoryItem* item = item_array.get(i).get(); -// if (item->getIsLinkType() && item->getLinkedUUID() == item_id) -// { -// gInventory.purgeObject(item->getUUID()); -// } } } @@ -3072,16 +3082,6 @@ void LLAppearanceMgr::removeCOFLinksOfType(LLWearableType::EType type) const LLViewerInventoryItem* item = *it; if (item->getIsLinkType()) // we must operate on links only { -// [RLVa:KB] - Checked: 2013-02-12 (RLVa-1.4.8) -#if 0 // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG - // NOTE-RLVa: debug-only, can be removed down the line - if (rlv_handler_t::isEnabled()) - { - RLV_ASSERT(rlvPredCanRemoveItem(item)); - } -#endif // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG -// [/RLVa:KB] - gInventory.purgeObject(item->getUUID()); } } @@ -3091,7 +3091,7 @@ bool sort_by_linked_uuid(const LLViewerInventoryItem* item1, const LLViewerInven { if (!item1 || !item2) { - llwarning("item1, item2 cannot be null, something is very wrong", 0); + llwarns << "item1, item2 cannot be null, something is very wrong" << llendl; return true; } @@ -3133,8 +3133,9 @@ void LLAppearanceMgr::updateIsDirty() gInventory.collectDescendentsIf(base_outfit, outfit_cats, outfit_items, LLInventoryModel::EXCLUDE_TRASH, collector); - if(outfit_items.count() != cof_items.count()) + if(outfit_items.size() != cof_items.size()) { + LL_DEBUGS("Avatar") << "item count different - base " << outfit_items.size() << " cof " << cof_items.size() << LL_ENDL; // Current outfit folder should have one more item than the outfit folder. // this one item is the link back to the outfit folder itself. mOutfitIsDirty = true; @@ -3147,18 +3148,37 @@ void LLAppearanceMgr::updateIsDirty() for (U32 i = 0; i < cof_items.size(); ++i) { - LLViewerInventoryItem *item1 = cof_items.get(i); - LLViewerInventoryItem *item2 = outfit_items.get(i); + LLViewerInventoryItem *item1 = cof_items.at(i); + LLViewerInventoryItem *item2 = outfit_items.at(i); if (item1->getLinkedUUID() != item2->getLinkedUUID() || item1->getName() != item2->getName() || item1->getActualDescription() != item2->getActualDescription()) { + if (item1->getLinkedUUID() != item2->getLinkedUUID()) + { + LL_DEBUGS("Avatar") << "link id different " << LL_ENDL; + } + else + { + if (item1->getName() != item2->getName()) + { + LL_DEBUGS("Avatar") << "name different " << item1->getName() << " " << item2->getName() << LL_ENDL; + } + if (item1->getActualDescription() != item2->getActualDescription()) + { + LL_DEBUGS("Avatar") << "desc different " << item1->getActualDescription() + << " " << item2->getActualDescription() + << " names " << item1->getName() << " " << item2->getName() << LL_ENDL; + } + } mOutfitIsDirty = true; return; } } } + llassert(!mOutfitIsDirty); + LL_DEBUGS("Avatar") << "clean" << LL_ENDL; } // *HACK: Must match name in Library or agent inventory @@ -3240,23 +3260,6 @@ void LLAppearanceMgr::copyLibraryGestures() } } -void LLAppearanceMgr::autopopulateOutfits() -{ - // If this is the very first time the user has logged into viewer2+ (from a legacy viewer, or new account) - // then auto-populate outfits from the library into the My Outfits folder. - - LL_INFOS("Avatar") << self_av_string() << "avatar fully visible" << LL_ENDL; - - static bool check_populate_my_outfits = true; - if (check_populate_my_outfits && - (LLInventoryModel::getIsFirstTimeInViewer2() - || gSavedSettings.getBOOL("MyOutfitsAutofill"))) - { - gAgentWearables.populateMyOutfitsFolder(); - } - check_populate_my_outfits = false; -} - // Handler for anything that's deferred until avatar de-clouds. void LLAppearanceMgr::onFirstFullyVisible() { @@ -3264,10 +3267,6 @@ void LLAppearanceMgr::onFirstFullyVisible() gAgentAvatarp->reportAvatarRezTime(); gAgentAvatarp->debugAvatarVisible(); - // The auto-populate is failing at the point of generating outfits - // folders, so don't do the library copy until that is resolved. - // autopopulateOutfits(); - // If this is the first time we've ever logged in, // then copy default gestures from the library. if (gAgent.isFirstLogin()) { @@ -3293,6 +3292,7 @@ bool LLAppearanceMgr::updateBaseOutfit() llassert(!isOutfitLocked()); return false; } + setOutfitLocked(true); gAgentWearables.notifyLoadingStarted(); @@ -3319,12 +3319,12 @@ void LLAppearanceMgr::divvyWearablesByType(const LLInventoryModel::item_array_t& items_by_type.resize(LLWearableType::WT_COUNT); if (items.empty()) return; - for (S32 i=0; igetActualDescription(); const std::string& desc2 = item2->getActualDescription(); @@ -3376,8 +3370,10 @@ struct WearablesOrderComparator //items with ordering information but not for the associated wearables type if (!item1_valid && item2_valid) return false; + else if (item1_valid && !item2_valid) + return true; - return true; + return item1->getName() < item2->getName(); } U32 mControlSize; @@ -3408,7 +3404,6 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base bool inventory_changed = false; for (U32 type = LLWearableType::WT_SHIRT; type < LLWearableType::WT_COUNT; type++) { - U32 size = items_by_type[type].size(); if (!size) continue; @@ -3428,7 +3423,7 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base item->setComplete(TRUE); item->updateServer(FALSE); gInventory.updateItem(item); - + inventory_changed = true; } } @@ -3496,31 +3491,16 @@ class RequestAgentUpdateAppearanceResponder: public LLHTTPClient::ResponderWithR { public: virtual AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return requestAgentUpdateAppearance_timeout; } - RequestAgentUpdateAppearanceResponder() - { - mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10); - } + RequestAgentUpdateAppearanceResponder(); - virtual ~RequestAgentUpdateAppearanceResponder() - { - } + virtual ~RequestAgentUpdateAppearanceResponder(); +protected: // Successful completion. - /* virtual */ void httpSuccess(void) - { - LL_DEBUGS("Avatar") << "content: " << ll_pretty_print_sd(mContent) << LL_ENDL; - if (mContent["success"].asBoolean()) - { - LL_DEBUGS("Avatar") << "OK" << LL_ENDL; - } - else - { - onFailure(200); - } - } + /* virtual */ void httpSuccess(); // Error - /*virtual*/ void httpFailure(void) + /*virtual*/ void httpFailure() { llwarns << "appearance update request failed, " << dumpResponse() << llendl; onFailure(mStatus); @@ -3548,6 +3528,15 @@ public: /*virtual*/ char const* getName(void) const { return "RequestAgentUpdateAppearanceResponder"; } }; +RequestAgentUpdateAppearanceResponder::RequestAgentUpdateAppearanceResponder() +{ + mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10); +} + +RequestAgentUpdateAppearanceResponder::~RequestAgentUpdateAppearanceResponder() +{ +} + void LLAppearanceMgr::requestServerAppearanceUpdate(LLHTTPClient::ResponderPtr responder_ptr) { if (gAgentAvatarp->isEditingAppearance()) @@ -3638,6 +3627,41 @@ void scroll_to_folder(const LLUUID& folder_id) } } +/* virtual */ void RequestAgentUpdateAppearanceResponder::httpSuccess() +{ + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(400, "Malformed response contents", content); + return; + } + if (content["success"].asBoolean()) + { + LL_DEBUGS("Avatar") << "succeeded" << LL_ENDL; + static LLCachedControl debug_ava_appr_msg(gSavedSettings, "DebugAvatarAppearanceMessage"); + if (debug_ava_appr_msg) + { + dump_sequential_xml(gAgentAvatarp->getFullname() + "_appearance_request_ok", content); + } + + //onSuccess(); + } + else + { + failureResult(400, "Non-success response", content); + } +} + +std::string LLAppearanceMgr::getAppearanceServiceURL() const +{ + if (gSavedSettings.getString("AgentAppearanceServiceURL").empty()) + { + return mAppearanceServiceURL; + } + return gSavedSettings.getString("AgentAppearanceServiceURL"); // Singu TODO: Use "DebugAvatarAppearanceServiceURLOverride" +} + + class LLBoostFuncInventoryCallbackFireOnce : public LLBoostFuncInventoryCallback { public: diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index b3539de66..887e7991a 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -78,6 +78,8 @@ public: LLInventoryModel::item_array_t& items_to_kill); void enforceItemRestrictions(); + S32 getActiveCopyOperations() const; + // Copy all items and the src category itself. void shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id, LLPointer cb); @@ -153,6 +155,7 @@ public: // Find COF entries referencing the given item. LLInventoryModel::item_array_t findCOFItemLinks(const LLUUID& item_id); + bool isLinkedInCOF(const LLUUID& item_id); // Remove COF entries void removeCOFItemLinks(const LLUUID& item_id); @@ -213,6 +216,13 @@ public: void requestServerAppearanceUpdate(LLHTTPClient::ResponderPtr responder_ptr = NULL); + void setAppearanceServiceURL(const std::string& url) { mAppearanceServiceURL = url; } + std::string getAppearanceServiceURL() const; + +private: + std::string mAppearanceServiceURL; + + protected: LLAppearanceMgr(); ~LLAppearanceMgr(); @@ -255,7 +265,7 @@ private: */ bool mOutfitLocked; - std::auto_ptr mUnlockOutfitTimer; + boost::scoped_ptr mUnlockOutfitTimer; // [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-18 (Catznip-3.0.0a) | Modified: Catznip-2.1.2e public: diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index caf66d6bc..e35d5ab27 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -881,9 +881,6 @@ bool LLAppViewer::init() gGLManager.getGLInfo(gDebugInfo); gGLManager.printGLInfoString(); - //load key settings - bind_keyboard_functions(); - // Load Default bindings load_default_bindings(gSavedSettings.getBOOL("LiruUseZQSDKeys")); @@ -3705,37 +3702,55 @@ static LLFastTimer::DeclareTimer FTM_VLMANAGER("VL Manager"); /////////////////////////////////////////////////////// void LLAppViewer::idle() { +//LAZY_FT is just temporary. +#define LAZY_FT(str) static LLFastTimer::DeclareTimer ftm(str); LLFastTimer t(ftm) pingMainloopTimeout("Main:Idle"); - + // Update frame timers static LLTimer idle_timer; - LLFrameTimer::updateFrameTimeAndCount(); - LLEventTimer::updateClass(); - LLCriticalDamp::updateInterpolants(); - LLMortician::updateClass(); - F32 dt_raw = idle_timer.getElapsedTimeAndResetF32(); - - // Cap out-of-control frame times - // Too low because in menus, swapping, debugger, etc. - // Too high because idle called with no objects in view, etc. - const F32 MIN_FRAME_RATE = 1.f; - const F32 MAX_FRAME_RATE = 200.f; - - F32 frame_rate_clamped = 1.f / dt_raw; - frame_rate_clamped = llclamp(frame_rate_clamped, MIN_FRAME_RATE, MAX_FRAME_RATE); - gFrameDTClamped = 1.f / frame_rate_clamped; - - // Global frame timer - // Smoothly weight toward current frame - gFPSClamped = (frame_rate_clamped + (4.f * gFPSClamped)) / 5.f; - - F32 qas = gSavedSettings.getF32("QuitAfterSeconds"); - if (qas > 0.f) { - if (gRenderStartTime.getElapsedTimeF32() > qas) + LAZY_FT("updateFrameTimeAndCount"); + LLFrameTimer::updateFrameTimeAndCount(); + } + { + LAZY_FT("LLEventTimer::updateClass"); + LLEventTimer::updateClass(); + } + { + LAZY_FT("LLCriticalDamp::updateInterpolants"); + LLCriticalDamp::updateInterpolants(); + } + { + LAZY_FT("LLMortician::updateClass"); + LLMortician::updateClass(); + } + F32 dt_raw; + { + LAZY_FT("UpdateGlobalTimers"); + dt_raw = idle_timer.getElapsedTimeAndResetF32(); + + // Cap out-of-control frame times + // Too low because in menus, swapping, debugger, etc. + // Too high because idle called with no objects in view, etc. + const F32 MIN_FRAME_RATE = 1.f; + const F32 MAX_FRAME_RATE = 200.f; + + F32 frame_rate_clamped = 1.f / dt_raw; + frame_rate_clamped = llclamp(frame_rate_clamped, MIN_FRAME_RATE, MAX_FRAME_RATE); + gFrameDTClamped = 1.f / frame_rate_clamped; + + // Global frame timer + // Smoothly weight toward current frame + gFPSClamped = (frame_rate_clamped + (4.f * gFPSClamped)) / 5.f; + + F32 qas = gSavedSettings.getF32("QuitAfterSeconds"); + if (qas > 0.f) { - LLAppViewer::instance()->forceQuit(); + if (gRenderStartTime.getElapsedTimeF32() > qas) + { + LLAppViewer::instance()->forceQuit(); + } } } @@ -3751,38 +3766,44 @@ void LLAppViewer::idle() // Must wait until both have avatar object and mute list, so poll // here. - request_initial_instant_messages(); + { + LAZY_FT("request_initial_instant_messages"); + request_initial_instant_messages(); + } /////////////////////////////////// // // Special case idle if still starting up // - if (LLStartUp::getStartupState() < STATE_STARTED) { - // Skip rest if idle startup returns false (essentially, no world yet) - gGLActive = TRUE; - if (!idle_startup()) + LAZY_FT("idle_startup"); + if (LLStartUp::getStartupState() < STATE_STARTED) { + // Skip rest if idle startup returns false (essentially, no world yet) + gGLActive = TRUE; + if (!idle_startup()) + { + gGLActive = FALSE; + return; + } gGLActive = FALSE; - return; } - gGLActive = FALSE; } - - F32 yaw = 0.f; // radians + + F32 yaw = 0.f; // radians if (!gDisconnected) { LLFastTimer t(FTM_NETWORK); // Update spaceserver timeinfo - LLWorld::getInstance()->setSpaceTimeUSec(LLWorld::getInstance()->getSpaceTimeUSec() + (U32)(dt_raw * SEC_TO_MICROSEC)); - - - ////////////////////////////////////// - // - // Update simulator agent state - // + LLWorld::getInstance()->setSpaceTimeUSec(LLWorld::getInstance()->getSpaceTimeUSec() + (U32)(dt_raw * SEC_TO_MICROSEC)); + + + ////////////////////////////////////// + // + // Update simulator agent state + // if (gSavedSettings.getBOOL("RotateRight")) { @@ -3795,22 +3816,22 @@ void LLAppViewer::idle() gAgentPilot.updateTarget(); gAgent.autoPilot(&yaw); } - - static LLFrameTimer agent_update_timer; - static U32 last_control_flags; - - // When appropriate, update agent location to the simulator. - F32 agent_update_time = agent_update_timer.getElapsedTimeF32(); - BOOL flags_changed = gAgent.controlFlagsDirty() || (last_control_flags != gAgent.getControlFlags()); - - if (flags_changed || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND))) - { - LLFastTimer t(FTM_AGENT_UPDATE); - // Send avatar and camera info - last_control_flags = gAgent.getControlFlags(); + + static LLFrameTimer agent_update_timer; + static U32 last_control_flags; + + // When appropriate, update agent location to the simulator. + F32 agent_update_time = agent_update_timer.getElapsedTimeF32(); + BOOL flags_changed = gAgent.controlFlagsDirty() || (last_control_flags != gAgent.getControlFlags()); + + if (flags_changed || (agent_update_time > (1.0f / (F32)AGENT_UPDATES_PER_SECOND))) + { + LLFastTimer t(FTM_AGENT_UPDATE); + // Send avatar and camera info + last_control_flags = gAgent.getControlFlags(); send_agent_update(TRUE); - agent_update_timer.reset(); - } + agent_update_timer.reset(); + } } ////////////////////////////////////// @@ -3819,6 +3840,7 @@ void LLAppViewer::idle() // // { + LAZY_FT("Frame Stats"); // Initialize the viewer_stats_timer with an already elapsed time // of SEND_STATS_PERIOD so that the initial stats report will // be sent immediately. @@ -3862,26 +3884,26 @@ void LLAppViewer::idle() } gFrameStats.addFrameData(); } - + if (!gDisconnected) { LLFastTimer t(FTM_NETWORK); - - //////////////////////////////////////////////// - // - // Network processing - // - // NOTE: Starting at this point, we may still have pointers to "dead" objects - // floating throughout the various object lists. - // + + //////////////////////////////////////////////// + // + // Network processing + // + // NOTE: Starting at this point, we may still have pointers to "dead" objects + // floating throughout the various object lists. + // idleNameCache(); - - gFrameStats.start(LLFrameStats::IDLE_NETWORK); + + gFrameStats.start(LLFrameStats::IDLE_NETWORK); stop_glerror(); idleNetwork(); - stop_glerror(); - - gFrameStats.start(LLFrameStats::AGENT_MISC); + stop_glerror(); + + gFrameStats.start(LLFrameStats::AGENT_MISC); // Check for away from keyboard, kick idle agents. idle_afk_check(); @@ -3895,17 +3917,16 @@ void LLAppViewer::idle() // Handle the regular UI idle callbacks as well as // hover callbacks // - { -// LLFastTimer t(FTM_IDLE_CB); + LLFastTimer t(FTM_IDLE_CB); // Do event notifications if necessary. Yes, we may want to move this elsewhere. gEventNotifier.update(); - + gIdleCallbacks.callFunctions(); gInventory.idleNotifyObservers(); } - + // Metrics logging (LLViewerAssetStats, etc.) { static LLTimer report_interval; @@ -3914,22 +3935,23 @@ void LLAppViewer::idle() F32 seconds = report_interval.getElapsedTimeF32(); if (seconds >= app_metrics_interval) { - metricsSend(! gDisconnected); + LAZY_FT("metricsSend"); + metricsSend(!gDisconnected); report_interval.reset(); } } if (gDisconnected) - { + { return; - } + } - static const LLCachedControl hide_tp_screen("AscentDisableTeleportScreens",false); + static const LLCachedControl hide_tp_screen("AscentDisableTeleportScreens", false); LLAgent::ETeleportState tp_state = gAgent.getTeleportState(); if (!hide_tp_screen && tp_state != LLAgent::TELEPORT_NONE && tp_state != LLAgent::TELEPORT_LOCAL && tp_state != LLAgent::TELEPORT_PENDING) - { + { return; - } + } gViewerWindow->updateUI(); @@ -3939,11 +3961,12 @@ void LLAppViewer::idle() /////////////////////////////////////// // Agent and camera movement // - LLCoordGL current_mouse = gViewerWindow->getCurrentMouse(); + LLCoordGL current_mouse = gViewerWindow->getCurrentMouse(); { // After agent and camera moved, figure out if we need to // deselect objects. + LAZY_FT("deselectAllIfTooFar"); LLSelectMgr::getInstance()->deselectAllIfTooFar(); } @@ -3958,15 +3981,15 @@ void LLAppViewer::idle() } { - LLFastTimer t(FTM_OBJECTLIST_UPDATE); + LLFastTimer t(FTM_OBJECTLIST_UPDATE); gFrameStats.start(LLFrameStats::OBJECT_UPDATE); - - if (!(logoutRequestSent() && hasSavedFinalSnapshot())) + + if (!(logoutRequestSent() && hasSavedFinalSnapshot())) { gObjectList.update(gAgent, *LLWorld::getInstance()); } } - + ////////////////////////////////////// // // Deletes objects... @@ -3985,7 +4008,7 @@ void LLAppViewer::idle() LLDrawable::cleanupDeadDrawables(); } } - + // // After this point, in theory we should never see a dead object // in the various object/drawable lists. @@ -4019,25 +4042,29 @@ void LLAppViewer::idle() LLFastTimer t(FTM_NETWORK); gVLManager.unpackData(); } - + ///////////////////////// // // Update surfaces, and surface textures as well. // - LLWorld::getInstance()->updateVisibilities(); + { + LAZY_FT("updateVisibilities"); + LLWorld::getInstance()->updateVisibilities(); + } { const F32 max_region_update_time = .001f; // 1ms LLFastTimer t(FTM_REGION_UPDATE); LLWorld::getInstance()->updateRegions(max_region_update_time); } - + ///////////////////////// // // Update weather effects // if (!gNoRender) { + LAZY_FT("Weather"); #if ENABLE_CLASSIC_CLOUDS LLWorld::getInstance()->updateClouds(gFrameDTClamped); #endif @@ -4054,7 +4081,7 @@ void LLAppViewer::idle() gWindVec = regionp->mWind.getVelocity(wind_position_region); // Compute average wind and use to drive motion of water - + average_wind = regionp->mWind.getAverage(); #if ENABLE_CLASSIC_CLOUDS F32 cloud_density = regionp->mCloudLayer.getDensityRegion(wind_position_region); @@ -4069,13 +4096,13 @@ void LLAppViewer::idle() } } stop_glerror(); - + ////////////////////////////////////// // // Sort and cull in the new renderer are moved to pipeline.cpp // Here, particles are updated and drawables are moved. // - + if (!gNoRender) { LLFastTimer t(FTM_WORLD_UPDATE); @@ -4087,26 +4114,38 @@ void LLAppViewer::idle() } stop_glerror(); - if (LLViewerJoystick::getInstance()->getOverrideCamera()) { - LLViewerJoystick::getInstance()->moveFlycam(); - } - else - { - if (LLToolMgr::getInstance()->inBuildMode()) + LAZY_FT("Move*"); + if (LLViewerJoystick::getInstance()->getOverrideCamera()) { - LLViewerJoystick::getInstance()->moveObjects(); + LLViewerJoystick::getInstance()->moveFlycam(); } + else + { + if (LLToolMgr::getInstance()->inBuildMode()) + { + LLViewerJoystick::getInstance()->moveObjects(); + } - gAgentCamera.updateCamera(); + gAgentCamera.updateCamera(); + } } // update media focus - LLViewerMediaFocus::getInstance()->update(); - + { + LAZY_FT("Media Focus"); + LLViewerMediaFocus::getInstance()->update(); + } + // Update marketplace - LLMarketplaceInventoryImporter::update(); - LLMarketplaceInventoryNotifications::update(); + { + LAZY_FT("MPII::update"); + LLMarketplaceInventoryImporter::update(); + } + { + LAZY_FT("MPIN::update"); + LLMarketplaceInventoryNotifications::update(); + } // objects and camera should be in sync, do LOD calculations now { @@ -4115,7 +4154,10 @@ void LLAppViewer::idle() } // Execute deferred tasks. - LLDeferredTaskList::instance().run(); + { + LAZY_FT("DeferredTaskRun"); + LLDeferredTaskList::instance().run(); + } // Handle shutdown process, for example, // wait for floaters to close, send quit message, diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 16dd0d4e5..178eb094f 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -37,6 +37,7 @@ #include "llagent.h" #include "llcompilequeue.h" #include "llfloaterbuycurrency.h" +#include "statemachine/aifilepicker.h" #include "llinventorydefines.h" #include "llinventoryobserver.h" #include "llinventorypanel.h" @@ -66,8 +67,6 @@ #include "llsdutil.h" #include "llvfs.h" -#include "statemachine/aifilepicker.h" - // When uploading multiple files, don't display any of them when uploading more than this number. static const S32 FILE_COUNT_DISPLAY_THRESHOLD = 5; @@ -190,9 +189,10 @@ void on_new_single_inventory_upload_complete( LLAssetUploadResponder::LLAssetUploadResponder(const LLSD &post_data, const LLUUID& vfile_id, LLAssetType::EType asset_type) -: mPostData(post_data), - mVFileID(vfile_id), - mAssetType(asset_type) +: + mPostData(post_data), + mVFileID(vfile_id), + mAssetType(asset_type) { if (!gVFS->getExists(vfile_id, asset_type)) { @@ -207,9 +207,10 @@ LLAssetUploadResponder::LLAssetUploadResponder( const LLSD &post_data, const std::string& file_name, LLAssetType::EType asset_type) -: mPostData(post_data), - mFileName(file_name), - mAssetType(asset_type) +: + mPostData(post_data), + mFileName(file_name), + mAssetType(asset_type) { } @@ -223,7 +224,7 @@ LLAssetUploadResponder::~LLAssetUploadResponder() } // virtual -void LLAssetUploadResponder::httpFailure(void) +void LLAssetUploadResponder::httpFailure() { llinfos << "LLAssetUploadResponder::error " << mStatus << " reason: " << mReason << llendl; @@ -248,15 +249,21 @@ void LLAssetUploadResponder::httpFailure(void) } //virtual -void LLAssetUploadResponder::httpSuccess(void) +void LLAssetUploadResponder::httpSuccess() { + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR_OTHER, "Malformed response contents", content); + return; + } lldebugs << "LLAssetUploadResponder::result from capabilities" << llendl; - std::string state = mContent["state"]; + const std::string& state = content["state"].asString(); if (state == "upload") { - uploadUpload(mContent); + uploadUpload(content); } else if (state == "complete") { @@ -264,20 +271,20 @@ void LLAssetUploadResponder::httpSuccess(void) if (mFileName.empty()) { // rename the file in the VFS to the actual asset id - // llinfos << "Changing uploaded asset UUID to " << mContent["new_asset"].asUUID() << llendl; - gVFS->renameFile(mVFileID, mAssetType, mContent["new_asset"].asUUID(), mAssetType); + // LL_INFOS() << "Changing uploaded asset UUID to " << content["new_asset"].asUUID() << LL_ENDL; + gVFS->renameFile(mVFileID, mAssetType, content["new_asset"].asUUID(), mAssetType); } - uploadComplete(mContent); + uploadComplete(content); } else { - uploadFailure(mContent); + uploadFailure(content); } } void LLAssetUploadResponder::uploadUpload(const LLSD& content) { - std::string uploader = content["uploader"]; + const std::string& uploader = content["uploader"].asString(); if (mFileName.empty()) { LLHTTPClient::postFile(uploader, mVFileID, mAssetType, this); @@ -293,7 +300,7 @@ void LLAssetUploadResponder::uploadFailure(const LLSD& content) // remove the "Uploading..." message LLUploadDialog::modalUploadFinished(); - std::string reason = content["state"]; + const std::string& reason = content["state"].asString(); // deal with L$ errors if (reason == "insufficient funds") { @@ -316,10 +323,8 @@ void LLAssetUploadResponder::uploadComplete(const LLSD& content) LLNewAgentInventoryResponder::LLNewAgentInventoryResponder( const LLSD& post_data, const LLUUID& vfile_id, - LLAssetType::EType asset_type, - void (*callback)(bool, void*), - void* user_data) - : LLAssetUploadResponder(post_data, vfile_id, asset_type), mCallBack(callback), mUserData(user_data) + LLAssetType::EType asset_type) + : LLAssetUploadResponder(post_data, vfile_id, asset_type) { } @@ -327,17 +332,13 @@ LLNewAgentInventoryResponder::LLNewAgentInventoryResponder( const LLSD& post_data, const std::string& file_name, LLAssetType::EType asset_type) - : LLAssetUploadResponder(post_data, file_name, asset_type), mCallBack(NULL), mUserData(NULL) + : LLAssetUploadResponder(post_data, file_name, asset_type) { } // virtual -void LLNewAgentInventoryResponder::httpFailure(void) +void LLNewAgentInventoryResponder::httpFailure() { - if (mCallBack) - { - (*mCallBack)(false, mUserData); - } LLAssetUploadResponder::httpFailure(); //LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, LLUUID(), FALSE); } @@ -346,10 +347,6 @@ void LLNewAgentInventoryResponder::httpFailure(void) //virtual void LLNewAgentInventoryResponder::uploadFailure(const LLSD& content) { - if (mCallBack) - { - (*mCallBack)(false, mUserData); - } LLAssetUploadResponder::uploadFailure(content); //LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, content["new_asset"], FALSE); @@ -360,14 +357,9 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content) { lldebugs << "LLNewAgentInventoryResponder::result from capabilities" << llendl; - if (mCallBack) - { - (*mCallBack)(true, mUserData); - } - //std::ostringstream llsdxml; //LLSDSerialize::toXML(content, llsdxml); - //llinfos << "upload complete content:\n " << llsdxml.str() << llendl; + //LL_INFOS() << "upload complete content:\n " << llsdxml.str() << LL_ENDL; LLAssetType::EType asset_type = LLAssetType::lookup(mPostData["asset_type"].asString()); LLInventoryType::EType inventory_type = LLInventoryType::lookup(mPostData["inventory_type"].asString()); @@ -456,57 +448,6 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content) */ } -LLSendTexLayerResponder::LLSendTexLayerResponder(const LLSD& post_data, - const LLUUID& vfile_id, - LLAssetType::EType asset_type, - LLBakedUploadData * baked_upload_data) : - LLAssetUploadResponder(post_data, vfile_id, asset_type), - mBakedUploadData(baked_upload_data) -{ -} - -LLSendTexLayerResponder::~LLSendTexLayerResponder() -{ - // mBakedUploadData is normally deleted by calls to LLViewerTexLayerSetBuffer::onTextureUploadComplete() below - if (mBakedUploadData) - { // ...but delete it in the case where uploadComplete() is never called - delete mBakedUploadData; - mBakedUploadData = NULL; - } -} - - -// Baked texture upload completed -void LLSendTexLayerResponder::uploadComplete(const LLSD& content) -{ - LLUUID item_id = mPostData["item_id"]; - - std::string result = content["state"]; - LLUUID new_id = content["new_asset"]; - - llinfos << "result: " << result << " new_id: " << new_id << llendl; - if (result == "complete" - && mBakedUploadData != NULL) - { // Invoke - LLViewerTexLayerSetBuffer::onTextureUploadComplete(new_id, (void*) mBakedUploadData, 0, LL_EXSTAT_NONE); - mBakedUploadData = NULL; // deleted in onTextureUploadComplete() - } - else - { // Invoke the original callback with an error result - LLViewerTexLayerSetBuffer::onTextureUploadComplete(new_id, (void*) mBakedUploadData, -1, LL_EXSTAT_NONE); - mBakedUploadData = NULL; // deleted in onTextureUploadComplete() - } -} - -void LLSendTexLayerResponder::httpFailure(void) -{ - llinfos << "status: " << mStatus << " reason: " << mReason << llendl; - - // Invoke the original callback with an error result - LLViewerTexLayerSetBuffer::onTextureUploadComplete(LLUUID(), (void*) mBakedUploadData, -1, LL_EXSTAT_NONE); - mBakedUploadData = NULL; // deleted in onTextureUploadComplete() -} - LLUpdateAgentInventoryResponder::LLUpdateAgentInventoryResponder( const LLSD& post_data, const LLUUID& vfile_id, @@ -533,7 +474,7 @@ void LLUpdateAgentInventoryResponder::uploadComplete(const LLSD& content) if(!item) { llwarns << "Inventory item for " << mVFileID - << " is no longer in agent inventory." << llendl; + << " is no longer in agent inventory." << LL_ENDL; return; } @@ -544,7 +485,7 @@ void LLUpdateAgentInventoryResponder::uploadComplete(const LLSD& content) gInventory.notifyObservers(); llinfos << "Inventory item " << item->getName() << " saved into " - << content["new_asset"].asString() << llendl; + << content["new_asset"].asString() << LL_ENDL; LLInventoryType::EType inventory_type = new_item->getInventoryType(); switch(inventory_type) @@ -605,6 +546,7 @@ void LLUpdateAgentInventoryResponder::uploadComplete(const LLSD& content) { previewp->onUpdateSucceeded(); } + break; } case LLInventoryType::IT_WEARABLE: @@ -650,8 +592,7 @@ void LLUpdateTaskInventoryResponder::uploadComplete(const LLSD& content) case LLAssetType::AT_NOTECARD: { // Update the UI with the new asset. - LLPreviewNotecard* nc; - nc = (LLPreviewNotecard*)LLPreview::find(item_id); + LLPreviewNotecard* nc = (LLPreviewNotecard*)LLPreview::find(item_id); if (nc) { // *HACK: we have to delete the asset in the VFS so @@ -674,8 +615,7 @@ void LLUpdateTaskInventoryResponder::uploadComplete(const LLSD& content) { if (mQueueId.notNull()) { - LLFloaterCompileQueue* queue = - (LLFloaterCompileQueue*) LLFloaterScriptQueue::findInstance(mQueueId); + LLFloaterCompileQueue* queue = (LLFloaterCompileQueue*) LLFloaterScriptQueue::findInstance(mQueueId); if (NULL != queue) { queue->removeItemByItemID(item_id); @@ -724,7 +664,7 @@ public: { llwarns << "LLAssetUploadResponder called with nonexistant " - << "vfile_id " << vfile_id << llendl; + << "vfile_id " << vfile_id << LL_ENDL; mVFileID.setNull(); mAssetType = LLAssetType::AT_NONE; } @@ -1020,17 +960,15 @@ LLNewAgentInventoryVariablePriceResponder::~LLNewAgentInventoryVariablePriceResp delete mImpl; } -void LLNewAgentInventoryVariablePriceResponder::httpFailure(void) +void LLNewAgentInventoryVariablePriceResponder::httpFailure() { - lldebugs - << "LLNewAgentInventoryVariablePrice::error " << mStatus - << " reason: " << mReason << llendl; + const LLSD& content = getContent(); + LL_WARNS("Upload") << dumpResponse() << LL_ENDL; - if ( mContent.has("error") ) - { static const std::string _ERROR = "error"; - - mImpl->onTransportError(mContent[_ERROR]); + if ( content.has(_ERROR) ) + { + mImpl->onTransportError(content[_ERROR]); } else { @@ -1038,8 +976,14 @@ void LLNewAgentInventoryVariablePriceResponder::httpFailure(void) } } -void LLNewAgentInventoryVariablePriceResponder::httpSuccess(void) +void LLNewAgentInventoryVariablePriceResponder::httpSuccess() { + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR_OTHER, "Malformed response contents", content); + return; + } // Parse out application level errors and the appropriate // responses for them static const std::string _ERROR = "error"; @@ -1053,13 +997,14 @@ void LLNewAgentInventoryVariablePriceResponder::httpSuccess(void) static const std::string _RSVP = "rsvp"; // Check for application level errors - if (mContent.has(_ERROR)) + if ( content.has(_ERROR) ) { - onApplicationLevelError(mContent[_ERROR]); + LL_WARNS("Upload") << dumpResponse() << LL_ENDL; + onApplicationLevelError(content[_ERROR]); return; } - std::string state = mContent[_STATE]; + std::string state = content[_STATE]; LLAssetType::EType asset_type = mImpl->getAssetType(); if (_COMPLETE == state) @@ -1068,11 +1013,11 @@ void LLNewAgentInventoryVariablePriceResponder::httpSuccess(void) if (mImpl->getFilename().empty()) { // rename the file in the VFS to the actual asset id - // llinfos << "Changing uploaded asset UUID to " << mContent["new_asset"].asUUID() << llendl; + // LL_INFOS() << "Changing uploaded asset UUID to " << content["new_asset"].asUUID() << LL_ENDL; gVFS->renameFile( mImpl->getVFileID(), asset_type, - mContent["new_asset"].asUUID(), + content["new_asset"].asUUID(), asset_type); } @@ -1083,8 +1028,8 @@ void LLNewAgentInventoryVariablePriceResponder::httpSuccess(void) mImpl->getFolderID(), mImpl->getItemName(), mImpl->getItemDescription(), - mContent, - mContent[_UPLOAD_PRICE].asInteger()); + content, + content[_UPLOAD_PRICE].asInteger()); // TODO* Add bulk (serial) uploading or add // a super class of this that does so @@ -1092,12 +1037,13 @@ void LLNewAgentInventoryVariablePriceResponder::httpSuccess(void) else if ( _CONFIRM_UPLOAD == state ) { showConfirmationDialog( - mContent[_UPLOAD_PRICE].asInteger(), - mContent[_RESOURCE_COST].asInteger(), - mContent[_RSVP].asString()); + content[_UPLOAD_PRICE].asInteger(), + content[_RESOURCE_COST].asInteger(), + content[_RSVP].asString()); } else { + LL_WARNS("Upload") << dumpResponse() << LL_ENDL; onApplicationLevelError(""); } } @@ -1170,3 +1116,4 @@ void LLNewAgentInventoryVariablePriceResponder::showConfirmationDialog( } } + diff --git a/indra/newview/llassetuploadresponders.h b/indra/newview/llassetuploadresponders.h index 2c2b87152..21787786f 100644 --- a/indra/newview/llassetuploadresponders.h +++ b/indra/newview/llassetuploadresponders.h @@ -36,10 +36,6 @@ #include "llhttpclient.h" #include "llinventory.h" -class AIHTTPTimeoutPolicy; -extern AIHTTPTimeoutPolicy assetUploadResponder_timeout; -extern AIHTTPTimeoutPolicy newAgentInventoryVariablePriceResponder_timeout; - void on_new_single_inventory_upload_complete(LLAssetType::EType asset_type, LLInventoryType::EType inventory_type, const std::string inventory_type_string, @@ -53,6 +49,8 @@ void on_new_single_inventory_upload_complete(LLAssetType::EType asset_type, // via capabilities class LLAssetUploadResponder : public LLHTTPClient::ResponderWithResult { +protected: + LOG_CLASS(LLAssetUploadResponder); public: LLAssetUploadResponder(const LLSD& post_data, const LLUUID& vfile_id, @@ -61,10 +59,12 @@ public: const std::string& file_name, LLAssetType::EType asset_type); ~LLAssetUploadResponder(); - /*virtual*/ void httpFailure(void); - /*virtual*/ void httpSuccess(void); - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return assetUploadResponder_timeout; } +protected: + virtual void httpFailure(); + virtual void httpSuccess(); + +public: virtual void uploadUpload(const LLSD& content); virtual void uploadComplete(const LLSD& content); virtual void uploadFailure(const LLSD& content); @@ -76,25 +76,24 @@ protected: std::string mFileName; }; +// TODO*: Remove this once deprecated class LLNewAgentInventoryResponder : public LLAssetUploadResponder { - void (*mCallBack)(bool, void*); - void* mUserData; + LOG_CLASS(LLNewAgentInventoryResponder); public: LLNewAgentInventoryResponder( const LLSD& post_data, const LLUUID& vfile_id, - LLAssetType::EType asset_type, - void (*callback)(bool, void*) = NULL, - void* user_data = NULL); + LLAssetType::EType asset_type); LLNewAgentInventoryResponder( const LLSD& post_data, const std::string& file_name, LLAssetType::EType asset_type); - /*virtual*/ void httpFailure(void); virtual void uploadComplete(const LLSD& content); virtual void uploadFailure(const LLSD& content); - /*virtual*/ char const* getName(void) const { return "LLNewAgentInventoryResponder"; } + /*virtual*/ char const* getName() const { return "LLNewAgentInventoryResponder"; } +protected: + virtual void httpFailure(); }; // A base class which goes through and performs some default @@ -104,6 +103,7 @@ public: class LLNewAgentInventoryVariablePriceResponder : public LLHTTPClient::ResponderWithResult { + LOG_CLASS(LLNewAgentInventoryVariablePriceResponder); public: LLNewAgentInventoryVariablePriceResponder( const LLUUID& vfile_id, @@ -116,10 +116,11 @@ public: const LLSD& inventory_info); virtual ~LLNewAgentInventoryVariablePriceResponder(); - /*virtual*/ void httpFailure(void); - /*virtual*/ void httpSuccess(void); - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return newAgentInventoryVariablePriceResponder_timeout; } +private: + /* virtual */ void httpFailure(); + /* virtual */ void httpSuccess(); +public: virtual void onApplicationLevelError( const LLSD& error); virtual void showConfirmationDialog( @@ -132,25 +133,6 @@ private: Impl* mImpl; }; -struct LLBakedUploadData; -class LLSendTexLayerResponder : public LLAssetUploadResponder -{ - LOG_CLASS(LLSendTexLayerResponder); -public: - LLSendTexLayerResponder(const LLSD& post_data, - const LLUUID& vfile_id, - LLAssetType::EType asset_type, - LLBakedUploadData * baked_upload_data); - - ~LLSendTexLayerResponder(); - - /*virtual*/ void uploadComplete(const LLSD& content); - /*virtual*/ void httpFailure(void); - /*virtual*/ char const* getName(void) const { return "LLSendTexLayerResponder"; } - - LLBakedUploadData * mBakedUploadData; -}; - class LLUpdateAgentInventoryResponder : public LLAssetUploadResponder { public: @@ -161,7 +143,7 @@ public: const std::string& file_name, LLAssetType::EType asset_type); virtual void uploadComplete(const LLSD& content); - /*virtual*/ char const* getName(void) const { return "LLUpdateAgentInventoryResponder"; } + /*virtual*/ char const* getName() const { return "LLUpdateAgentInventoryResponder"; } }; class LLUpdateTaskInventoryResponder : public LLAssetUploadResponder @@ -179,7 +161,7 @@ public: LLAssetType::EType asset_type); virtual void uploadComplete(const LLSD& content); - /*virtual*/ char const* getName(void) const { return "LLUpdateTaskInventoryResponder"; } + /*virtual*/ char const* getName() const { return "LLUpdateTaskInventoryResponder"; } private: LLUUID mQueueId; diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index fae1b7c3d..1282ba0cc 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -37,20 +37,26 @@ #include "llagent.h" #include "llcallingcard.h" // for LLAvatarTracker #include "llfloateravatarinfo.h" +#include "llfloateravatarpicker.h" // for LLFloaterAvatarPicker +#include "llfloaterchatterbox.h" #include "llfloatergroupbulkban.h" #include "llfloatergroupinvite.h" #include "llfloatergroups.h" #include "llfloaterwebprofile.h" #include "llfloaterworldmap.h" +#include "llgiveinventory.h" #include "llgivemoney.h" +#include "llinventorybridge.h" +#include "llinventoryfunctions.h" +#include "llinventorypanel.h" #include "llimview.h" // for gIMMgr -#include "llinventoryobserver.h" #include "llmutelist.h" #include "llpanelprofile.h" #include "lltrans.h" #include "llvoiceclient.h" #include "llweb.h" #include "llslurl.h" // IDEVO +#include "llpanelmaininventory.h" #include "llavatarname.h" #include "llagentui.h" // [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0) @@ -569,7 +575,262 @@ void LLAvatarActions::csr(const LLUUID& id) LLWeb::loadURL(url); } -// Singu TODO: Share inventory code block should live here +//static +void LLAvatarActions::share(const LLUUID& id) +{ + /* + LLSD key; + LLFloaterSidePanelContainer::showPanel("inventory", key); + LLFloaterReg::showInstance("im_container"); + */ + LLInventoryView::getActiveInventory()->setVisible(true); + + LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL, id); + + if (!gIMMgr->hasSession(session_id)) + { + startIM(id); + } + + if (gIMMgr->hasSession(session_id)) + { + // we should always get here, but check to verify anyways + LLIMMgr::getInstance()->addMessage(session_id, LLUUID::null, SYSTEM_FROM, LLTrans::getString("share_alert")); + LLFloaterChatterBox::showInstance(session_id); + } +} + +namespace action_give_inventory +{ + /** + * Returns a pointer to 'Add More' inventory panel of Edit Outfit SP. + * + static LLInventoryPanel* get_outfit_editor_inventory_panel() + { + LLPanelOutfitEdit* panel_outfit_edit = dynamic_cast(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit")); + if (NULL == panel_outfit_edit) return NULL; + + LLInventoryPanel* inventory_panel = panel_outfit_edit->findChild("folder_view"); + return inventory_panel; + }*/ + + /** + * @return active inventory panel, or NULL if there's no such panel + */ + static LLInventoryPanel* get_active_inventory_panel() + { + LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); + /*if (!active_panel) + { + active_panel = get_outfit_editor_inventory_panel(); + }*/ + + return active_panel; + } + + /** + * Checks My Inventory visibility. + */ + + static bool is_give_inventory_acceptable() + { + // check selection in the panel + const std::set inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); + if (inventory_selected_uuids.empty()) return false; // nothing selected + + bool acceptable = false; + std::set::const_iterator it = inventory_selected_uuids.begin(); + const std::set::const_iterator it_end = inventory_selected_uuids.end(); + for (; it != it_end; ++it) + { + LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); + // any category can be offered. + if (inv_cat) + { + acceptable = true; + continue; + } + + LLViewerInventoryItem* inv_item = gInventory.getItem(*it); + // check if inventory item can be given + if (LLGiveInventory::isInventoryGiveAcceptable(inv_item)) + { + acceptable = true; + continue; + } + + // there are neither item nor category in inventory + acceptable = false; + break; + } + return acceptable; + } + + static void build_items_string(const std::set& inventory_selected_uuids , std::string& items_string) + { + llassert(inventory_selected_uuids.size() > 0); + + const std::string& separator = LLTrans::getString("words_separator"); + for (std::set::const_iterator it = inventory_selected_uuids.begin(); ; ) + { + LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); + if (NULL != inv_cat) + { + items_string = inv_cat->getName(); + break; + } + LLViewerInventoryItem* inv_item = gInventory.getItem(*it); + if (NULL != inv_item) + { + items_string.append(inv_item->getName()); + } + if(++it == inventory_selected_uuids.end()) + { + break; + } + items_string.append(separator); + } + } + + struct LLShareInfo : public LLSingleton + { + std::vector mAvatarNames; + uuid_vec_t mAvatarUuids; + }; + + static void give_inventory_cb(const LLSD& notification, const LLSD& response) + { + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + // if Cancel pressed + if (option == 1) + { + return; + } + + const std::set inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); + if (inventory_selected_uuids.empty()) + { + return; + } + + S32 count = LLShareInfo::instance().mAvatarNames.size(); + bool shared = count && !inventory_selected_uuids.empty(); + + // iterate through avatars + for(S32 i = 0; i < count; ++i) + { + const LLUUID& avatar_uuid = LLShareInfo::instance().mAvatarUuids[i]; + + // We souldn't open IM session, just calculate session ID for logging purpose. See EXT-6710 + const LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL, avatar_uuid); + + std::set::const_iterator it = inventory_selected_uuids.begin(); + const std::set::const_iterator it_end = inventory_selected_uuids.end(); + + const std::string& separator = LLTrans::getString("words_separator"); + std::string noncopy_item_names; + LLSD noncopy_items = LLSD::emptyArray(); + // iterate through selected inventory objects + for (; it != it_end; ++it) + { + LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); + if (inv_cat) + { + if (!LLGiveInventory::doGiveInventoryCategory(avatar_uuid, inv_cat, session_id, "ItemsShared")) + { + shared = false; + } + break; + } + LLViewerInventoryItem* inv_item = gInventory.getItem(*it); + if (!inv_item->getPermissions().allowCopyBy(gAgentID)) + { + if (!noncopy_item_names.empty()) + { + noncopy_item_names.append(separator); + } + noncopy_item_names.append(inv_item->getName()); + noncopy_items.append(*it); + } + else + { + if (!LLGiveInventory::doGiveInventoryItem(avatar_uuid, inv_item, session_id)) + { + shared = false; + } + } + } + if (noncopy_items.beginArray() != noncopy_items.endArray()) + { + LLSD substitutions; + substitutions["ITEMS"] = noncopy_item_names; + LLSD payload; + payload["agent_id"] = avatar_uuid; + payload["items"] = noncopy_items; + payload["success_notification"] = "ItemsShared"; + LLNotificationsUtil::add("CannotCopyWarning", substitutions, payload, + &LLGiveInventory::handleCopyProtectedItem); + shared = false; + break; + } + } + if (shared) + { + if (LLFloaterAvatarPicker::instanceExists()) LLFloaterAvatarPicker::instance().close(); + LLNotificationsUtil::add("ItemsShared"); + } + } + + /** + * Performs "give inventory" operations for provided avatars. + * + * Sends one requests to give all selected inventory items for each passed avatar. + * Avatars are represent by two vectors: names and UUIDs which must be sychronized with each other. + * + * @param avatar_names - avatar names request to be sent. + * @param avatar_uuids - avatar names request to be sent. + */ + static void give_inventory(const uuid_vec_t& avatar_uuids, const std::vector avatar_names) + { + llassert(avatar_names.size() == avatar_uuids.size()); + + const std::set inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); + if (inventory_selected_uuids.empty()) + { + return; + } + + std::string residents; + LLAvatarActions::buildResidentsString(avatar_names, residents); + + std::string items; + build_items_string(inventory_selected_uuids, items); + + int folders_count = 0; + std::set::const_iterator it = inventory_selected_uuids.begin(); + + //traverse through selected inventory items and count folders among them + for ( ; it != inventory_selected_uuids.end() && folders_count <=1 ; ++it) + { + LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); + if (NULL != inv_cat) + { + folders_count++; + } + } + + // EXP-1599 + // In case of sharing multiple folders, make the confirmation + // dialog contain a warning that only one folder can be shared at a time. + std::string notification = (folders_count > 1) ? "ShareFolderConfirmation" : "ShareItemsConfirmation"; + LLSD substitutions; + substitutions["RESIDENTS"] = residents; + substitutions["ITEMS"] = items; + LLShareInfo::instance().mAvatarNames = avatar_names; + LLShareInfo::instance().mAvatarUuids = avatar_uuids; + LLNotificationsUtil::add(notification, substitutions, LLSD(), &give_inventory_cb); + } +} // static void LLAvatarActions::buildResidentsString(std::vector avatar_names, std::string& residents_string) @@ -611,7 +872,118 @@ void LLAvatarActions::buildResidentsString(const uuid_vec_t& avatar_uuids, std:: } } -// Singu TODO: Share inventory code block should live here, too +//static +std::set LLAvatarActions::getInventorySelectedUUIDs() +{ + LLInventoryPanel* active_panel = action_give_inventory::get_active_inventory_panel(); + return active_panel ? active_panel->getRootFolder()->getSelectionList() : std::set(); + /*std::set inventory_selected; + + LLInventoryPanel* active_panel = action_give_inventory::get_active_inventory_panel(); + if (active_panel) + { + inventory_selected= active_panel->getRootFolder()->getSelectionList(); + } + + if (inventory_selected.empty()) + { + LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("inventory"); + if (sidepanel_inventory) + { + inventory_selected= sidepanel_inventory->getInboxSelectionList(); + } + } + + std::set inventory_selected_uuids; + for (std::set::iterator it = inventory_selected.begin(), end_it = inventory_selected.end(); + it != end_it; + ++it) + { + inventory_selected_uuids.insert(static_cast((*it)->getViewModelItem())->getUUID()); + } + return inventory_selected_uuids;*/ +} + +//static +void LLAvatarActions::shareWithAvatars(LLView * panel) +{ + using namespace action_give_inventory; + + LLFloater* root_floater = gFloaterView->getParentFloater(panel); + LLFloaterAvatarPicker* picker = + LLFloaterAvatarPicker::show(boost::bind(give_inventory, _1, _2), TRUE, FALSE, FALSE, root_floater->getName()); + if (!picker) + { + return; + } + + picker->setOkBtnEnableCb(boost::bind(is_give_inventory_acceptable)); + picker->openFriendsTab(); + + if (root_floater) + { + root_floater->addDependentFloater(picker); + } + LLNotificationsUtil::add("ShareNotification"); +} + + +// static +bool LLAvatarActions::canShareSelectedItems(LLInventoryPanel* inv_panel /* = NULL*/) +{ + using namespace action_give_inventory; + + if (!inv_panel) + { + LLInventoryPanel* active_panel = get_active_inventory_panel(); + if (!active_panel) return false; + inv_panel = active_panel; + } + + // check selection in the panel + LLFolderView* root_folder = inv_panel->getRootFolder(); + if (!root_folder) + { + return false; + } + const std::set inventory_selected = root_folder->getSelectionList(); + if (inventory_selected.empty()) return false; // nothing selected + + bool can_share = true; + const LLUUID& trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); // + std::set::const_iterator it = inventory_selected.begin(); + const std::set::const_iterator it_end = inventory_selected.end(); + for (; it != it_end; ++it) + { + const LLUUID id(*it); + LLViewerInventoryCategory* inv_cat = gInventory.getCategory(id); + // any category can be offered. + if (inv_cat && !gInventory.isObjectDescendentOf(inv_cat->getUUID(), trash_id)) // + { + continue; + } + + // check if inventory item can be given + else if (!inv_cat && gInventory.isObjectDescendentOf(id, gInventory.getRootFolderID())) // Singu Note: These three ifs comprise the item half of LLInvFVBridge::canShare, which LL calls here. + if (LLViewerInventoryItem* item = gInventory.getItem(id)) + if (LLInventoryCollectFunctor::itemTransferCommonlyAllowed(item) && LLGiveInventory::isInventoryGiveAcceptable(item)) + /* + LLFolderViewItem* item = *it; + if (!item) return false; + LLInvFVBridge* bridge = dynamic_cast(item->getViewModelItem()); + if (bridge && bridge->canShare()) + */ + { + continue; + } + + // there are neither item nor category in inventory + can_share = false; + break; + } + + return can_share; +} // static void LLAvatarActions::toggleBlock(const LLUUID& id) @@ -687,13 +1059,18 @@ bool LLAvatarActions::canOfferTeleport(const uuid_vec_t& ids) void LLAvatarActions::inviteToGroup(const LLUUID& id) { - LLFloaterGroupPicker* widget = LLFloaterGroupPicker::showInstance(LLSD(id)); + inviteToGroup(uuid_vec_t(1, id)); +} + +void LLAvatarActions::inviteToGroup(const uuid_vec_t& ids) +{ + LLFloaterGroupPicker* widget = LLFloaterGroupPicker::showInstance(LLSD(ids.front())); if (widget) { widget->center(); widget->setPowersMask(GP_MEMBER_INVITE); widget->removeNoneOption(); - widget->setSelectGroupCallback(boost::bind(callback_invite_to_group, _1, id)); + widget->setSelectGroupCallback(boost::bind(callback_invite_to_group, _1, ids)); } } @@ -767,11 +1144,8 @@ void ban_from_group(const uuid_vec_t& ids) // // static -void LLAvatarActions::callback_invite_to_group(LLUUID group_id, LLUUID id) +void LLAvatarActions::callback_invite_to_group(LLUUID group_id, uuid_vec_t& agent_ids) { - uuid_vec_t agent_ids; - agent_ids.push_back(id); - LLFloaterGroupInvite::showForGroup(group_id, &agent_ids); } @@ -896,6 +1270,21 @@ bool LLAvatarActions::canBlock(const LLUUID& id) return !is_self && !is_linden; } +//static +bool LLAvatarActions::isAgentMappable(const LLUUID& agent_id) +{ + const LLRelationship* buddy_info = NULL; + bool is_friend = LLAvatarActions::isFriend(agent_id); + + if (is_friend) + buddy_info = LLAvatarTracker::instance().getBuddyInfo(agent_id); + + return (buddy_info && + buddy_info->isOnline() && + buddy_info->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION) + ); +} + // static void LLAvatarActions::copyUUIDs(const uuid_vec_t& ids) { diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 3bb613185..57e1ddd17 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -28,7 +28,9 @@ #define LL_LLAVATARACTIONS_H class LLAvatarName; +class LLInventoryPanel; class LLFloater; +class LLView; /** * Friend-related actions (add, remove, offer teleport, etc) @@ -108,6 +110,16 @@ public: static void teleportRequest(const LLUUID& id); static void teleport_request_callback(const LLSD& notification, const LLSD& response); + /** + * Share items with the avatar. + */ + static void share(const LLUUID& id); + + /** + * Share items with the picked avatars. + */ + static void shareWithAvatars(LLView * panel); + /** * Block/unblock the avatar. */ @@ -155,6 +167,7 @@ public: * Invite avatar to a group. */ static void inviteToGroup(const LLUUID& id); + static void inviteToGroup(const uuid_vec_t& ids); /** * Kick avatar off grid @@ -189,6 +202,20 @@ public: */ static bool canOfferTeleport(const uuid_vec_t& ids); + /** + * Checks whether all items selected in the given inventory panel can be shared + * + * @param inv_panel Inventory panel to get selection from. If NULL, the active inventory panel is used. + * + * @return false if the selected items cannot be shared or the active inventory panel cannot be obtained + */ + static bool canShareSelectedItems(LLInventoryPanel* inv_panel = NULL); + + /** + * Checks whether agent is mappable + */ + static bool isAgentMappable(const LLUUID& agent_id); + /** * Builds a string of residents' display names separated by "words_separator" string. * @@ -205,6 +232,8 @@ public: */ static void buildResidentsString(const uuid_vec_t& avatar_uuids, std::string& residents_string); + static std::set getInventorySelectedUUIDs(); + /** * Copy the selected avatar's UUID to clipboard */ @@ -217,7 +246,7 @@ private: static bool handleKick(const LLSD& notification, const LLSD& response); static bool handleFreeze(const LLSD& notification, const LLSD& response); static bool handleUnfreeze(const LLSD& notification, const LLSD& response); - static void callback_invite_to_group(LLUUID group_id, LLUUID id); + static void callback_invite_to_group(LLUUID group_id, uuid_vec_t& ids); static void on_avatar_name_cache_teleport_request(const LLUUID& id, const LLAvatarName& av_name); public: diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 1481f49b4..91bc47e7b 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -895,11 +895,10 @@ bool LLCollectOnlineBuddies::operator()(const LLUUID& buddy_id, LLRelationship* return true; } +const S32& friend_name_system(); bool LLCollectAllBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy) { - LLAvatarName av_name; - LLAvatarNameCache::get(buddy_id, &av_name); - mFullName = av_name.mDisplayName; + LLAvatarNameCache::getPNSName(buddy_id, mFullName, friend_name_system()); buddy_map_t::value_type value(mFullName, buddy_id); if(buddy->isOnline()) { diff --git a/indra/newview/lldroptarget.cpp b/indra/newview/lldroptarget.cpp index 9e7cc377e..f41d0681a 100644 --- a/indra/newview/lldroptarget.cpp +++ b/indra/newview/lldroptarget.cpp @@ -37,6 +37,9 @@ #include "lldroptarget.h" +#include + +#include "llbutton.h" #include "llinventorymodel.h" #include "llstartup.h" #include "lltextbox.h" @@ -46,8 +49,9 @@ static LLRegisterWidget r("drop_target"); -static std::string currently_set_to(const LLViewerInventoryItem* item) +std::string currently_set_to(const LLInventoryItem* item) { + if (!item) return LLTrans::getString("CurrentlyNotSet"); LLStringUtil::format_map_t args; args["[ITEM]"] = item->getName(); return LLTrans::getString("CurrentlySetTo", args); @@ -55,26 +59,32 @@ static std::string currently_set_to(const LLViewerInventoryItem* item) LLDropTarget::LLDropTarget(const LLDropTarget::Params& p) : LLView(p) +, mReset(NULL) { setToolTip(std::string(p.tool_tip)); - mText = new LLTextBox("drop_text", p.rect, p.label); + mText = new LLTextBox("drop_text", LLRect(), p.label); addChild(mText); setControlName(p.control_name, NULL); - mText->setOrigin(0, 0); mText->setFollows(FOLLOWS_NONE); mText->setMouseOpaque(false); mText->setHAlign(LLFontGL::HCENTER); mText->setVPad(1); - mBorder = new LLViewBorder("drop_border", p.rect, LLViewBorder::BEVEL_IN); + mBorder = new LLViewBorder("drop_border", LLRect(), LLViewBorder::BEVEL_IN); addChild(mBorder); mBorder->setMouseOpaque(false); - - if (p.fill_parent) fillParent(getParent()); if (!p.border_visible) mBorder->setBorderWidth(0); + + if (p.show_reset) + { + addChild(mReset = new LLButton("reset", LLRect(), "icn_clear_lineeditor.tga", "icn_clear_lineeditor.tga", "", boost::bind(&LLDropTarget::setValue, this, _2))); + } + + // Now set the rects of the children + p.fill_parent ? fillParent(getParent()) : setChildRects(p.rect); } LLDropTarget::~LLDropTarget() @@ -84,7 +94,7 @@ LLDropTarget::~LLDropTarget() // static LLView* LLDropTarget::fromXML(LLXMLNodePtr node, LLView* parent, LLUICtrlFactory* factory) { - LLDropTarget* target = new LLDropTarget(); + LLDropTarget* target = new LLDropTarget; target->initFromXML(node, parent); return target; } @@ -95,9 +105,17 @@ void LLDropTarget::initFromXML(LLXMLNodePtr node, LLView* parent) LLView::initFromXML(node, parent); const LLRect& rect = getRect(); - const LLRect child_rect(0, rect.getHeight(), rect.getWidth(), 0); - mText->setRect(child_rect); - mBorder->setRect(child_rect); + if (node->hasAttribute("show_reset")) + { + bool show; + node->getAttribute_bool("show_reset", show); + if (!show) + { + delete mReset; + mReset = NULL; + } + } + setChildRects(LLRect(0, rect.getHeight(), rect.getWidth(), 0)); if (node->hasAttribute("name")) // Views can't have names, but drop targets can { @@ -134,9 +152,11 @@ void LLDropTarget::setControlName(const std::string& control_name, LLView* conte if (control_name.empty()) // The "empty set" { mControl = NULL; + mConnection.disconnect(); return; // This DropTarget never changes text, it isn't tied to a control } + bool none(true); std::string text; if (LLStartUp::getStartupState() != STATE_STARTED) // Too early for PerAccount { @@ -151,15 +171,40 @@ void LLDropTarget::setControlName(const std::string& control_name, LLView* conte return; // Though this should never happen. } const LLUUID id(mControl->getValue().asString()); - if (id.isNull()) + none = id.isNull(); + if (none) text = LLTrans::getString("CurrentlyNotSet"); else if (LLViewerInventoryItem* item = gInventory.getItem(id)) text = currently_set_to(item); else text = LLTrans::getString("CurrentlySetToAnItemNotOnThisAccount"); } + if (mControl) + mConnection = mControl->getSignal()->connect(boost::bind(&LLView::setValue, this, _2)); + else + mConnection.disconnect(); mText->setText(text); + if (mReset) mReset->setVisible(!none); +} + +void LLDropTarget::setChildRects(LLRect rect) +{ + mBorder->setRect(rect); + if (mReset) + { + // Reset button takes rightmost part of the text area. + S32 height(rect.getHeight()); + rect.mRight -= height; + mText->setRect(rect); + rect.mLeft = rect.mRight; + rect.mRight += height; + mReset->setRect(rect); + } + else + { + mText->setRect(rect); + } } void LLDropTarget::fillParent(const LLView* parent) @@ -174,13 +219,33 @@ void LLDropTarget::fillParent(const LLView* parent) } // The following block enlarges the target, but maintains the desired size for the text and border - const LLRect& rect = getRect(); // Children maintain the old rectangle - mText->setRect(rect); - mBorder->setRect(rect); + setChildRects(getRect()); // Children maintain the old rectangle const LLRect& parent_rect = parent->getRect(); setRect(LLRect(0, parent_rect.getHeight(), parent_rect.getWidth(), 0)); } +void LLDropTarget::setControlValue(const std::string& val) +{ + if (mControl) + { + boost::signals2::shared_connection_block block(mConnection); + mControl->setValue(val); + } +} + +void LLDropTarget::setItem(const LLInventoryItem* item) +{ + if (mReset) mReset->setVisible(!!item); + mText->setText(currently_set_to(item)); + setControlValue(item ? item->getUUID().asString() : ""); +} + +void LLDropTarget::setValue(const LLSD& value) +{ + const LLUUID& id(value.asUUID()); + setItem(id.isNull() ? NULL : gInventory.getItem(id)); +} + void LLDropTarget::doDrop(EDragAndDropType cargo_type, void* cargo_data) { llinfos << "LLDropTarget::doDrop()" << llendl; @@ -188,23 +253,14 @@ void LLDropTarget::doDrop(EDragAndDropType cargo_type, void* cargo_data) BOOL LLDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg) { - if (mEntityID.isNull()) + if (mEntityID.notNull()) + return getParent() ? LLToolDragAndDrop::handleGiveDragAndDrop(mEntityID, LLUUID::null, drop, cargo_type, cargo_data, accept) : false; + + if (LLViewerInventoryItem* inv_item = static_cast(cargo_data)) { - if (LLViewerInventoryItem* inv_item = static_cast(cargo_data)) - { - *accept = ACCEPT_YES_COPY_SINGLE; - if (drop) - { - mText->setText(currently_set_to(inv_item)); - if (mControl) mControl->setValue(inv_item->getUUID().asString()); - } - } - else - { - *accept = ACCEPT_NO; - } - return true; + *accept = ACCEPT_YES_COPY_SINGLE; + if (drop) setItem(inv_item); } - return getParent() ? LLToolDragAndDrop::handleGiveDragAndDrop(mEntityID, LLUUID::null, drop, cargo_type, cargo_data, accept) : false; + return true; } diff --git a/indra/newview/lldroptarget.h b/indra/newview/lldroptarget.h index 08026bd2a..69d9a6998 100644 --- a/indra/newview/lldroptarget.h +++ b/indra/newview/lldroptarget.h @@ -47,11 +47,13 @@ public: Optional border_visible; // Whether or not to display the border Optional control_name; // Control to change on item drop (Per Account only) Optional label; // Label for the LLTextBox, used when label doesn't dynamically change on drop + Optional show_reset; // Whether or not to show the reset button Optional fill_parent; // Whether or not to fill the direct parent, to have a larger drop target. If true, the next sibling must explicitly define its rect without deltas. Params() : border_visible("border_visible", true) , control_name("control_name", "") , label("label", "") + , show_reset("show_reset", true) , fill_parent("fill_parent", false) { changeDefault(mouse_opaque, false); @@ -69,16 +71,23 @@ public: virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg); static LLView* fromXML(LLXMLNodePtr node, LLView* parent, class LLUICtrlFactory* factory); virtual void initFromXML(LLXMLNodePtr node, LLView* parent); - virtual void setControlName(const std::string& control, LLView* context); + virtual void setControlName(const std::string& control, LLView* context); + virtual void setValue(const LLSD& value); + void setChildRects(LLRect rect); void fillParent(const LLView* parent); void setEntityID(const LLUUID& id) { mEntityID = id;} + protected: + virtual void setItem(const class LLInventoryItem* item); + void setControlValue(const std::string& val); + LLUUID mEntityID; -private: class LLViewBorder* mBorder; LLControlVariable* mControl; + boost::signals2::scoped_connection mConnection; class LLTextBox* mText; + class LLButton* mReset; }; #endif // LLDROPTARGET_H diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp index 3033d4e07..8f31c6c6f 100644 --- a/indra/newview/llenvmanager.cpp +++ b/indra/newview/llenvmanager.cpp @@ -105,9 +105,11 @@ void LLEnvPrefs::setUseDayCycle(const std::string& name) } //============================================================================= -LLEnvManagerNew::LLEnvManagerNew() +LLEnvManagerNew::LLEnvManagerNew(): + mInterpNextChangeMessage(true), + mCurRegionUUID(LLUUID::null), + mLastReceivedID(LLUUID::null) { - mInterpNextChangeMessage = true; // Set default environment settings. mUserPrefs.mUseRegionSettings = true; @@ -115,6 +117,9 @@ LLEnvManagerNew::LLEnvManagerNew() mUserPrefs.mWaterPresetName = "Default"; mUserPrefs.mSkyPresetName = "Default"; mUserPrefs.mDayCycleName = "Default"; + + LL_DEBUGS("Windlight")<getRegionID() : LLUUID::null; - if (region_uuid == mCurRegionUUID) + if (region_uuid != mCurRegionUUID) { - return; + // Clear locally modified region settings. + mNewRegionPrefs.clear(); + + // *TODO: clear environment settings of the previous region? + + // Request environment settings of the new region. + mCurRegionUUID = region_uuid; + // for region crossings, interpolate the change; for teleports, don't + mInterpNextChangeMessage = (gAgent.getTeleportState() == LLAgent::TELEPORT_NONE); + LL_DEBUGS("Windlight") << (mInterpNextChangeMessage ? "Crossed" : "Teleported") + << " to new region: " << region_uuid + << LL_ENDL; + requestRegionSettings(); + } + else + { + LL_DEBUGS("Windlight") << "disregarding region change; interp: " + << (mInterpNextChangeMessage ? "true" : "false") + << " regionp: " << regionp + << " old: " << mCurRegionUUID + << " new: " << region_uuid + << LL_ENDL; } - - // Clear locally modified region settings. - mNewRegionPrefs.clear(); - - // *TODO: clear environment settings of the previous region? - - // Request environment settings of the new region. - LL_DEBUGS("Windlight") << "New viewer region: " << region_uuid << LL_ENDL; - mCurRegionUUID = region_uuid; - mInterpNextChangeMessage = interpolate; - requestRegionSettings(); - - // Let interested parties know agent region has been changed. - mRegionChangeSignal(); } // Aurora-sim windlight refresh @@ -729,7 +731,7 @@ class WindLightRefresh : public LLHTTPNode llinfos << "Windlight Refresh, interpolate:" << env->mInterpNextChangeMessage << llendl; env->requestRegionSettings(); - env->mRegionChangeSignal(); + env->onRegionChange(); } }; diff --git a/indra/newview/llenvmanager.h b/indra/newview/llenvmanager.h index 8d5317996..6d7efeab6 100644 --- a/indra/newview/llenvmanager.h +++ b/indra/newview/llenvmanager.h @@ -2,31 +2,25 @@ * @file llenvmanager.h * @brief Declaration of classes managing WindLight and water settings. * - * $LicenseInfo:firstyear=2009&license=viewergpl$ - * - * Copyright (c) 2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2011, Linden Research, Inc. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * 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. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * 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. * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * 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$ */ @@ -39,7 +33,6 @@ class LLWLParamManager; class LLWaterParamManager; class LLWLAnimator; -class WindLightRefresh; // generic key struct LLEnvKey @@ -173,7 +166,6 @@ class LLEnvManagerNew : public LLSingleton public: typedef boost::signals2::signal prefs_change_signal_t; typedef boost::signals2::signal region_settings_change_signal_t; - typedef boost::signals2::signal region_change_signal_t; typedef boost::signals2::signal region_settings_applied_signal_t; LLEnvManagerNew(); @@ -229,15 +221,12 @@ public: bool sendRegionSettings(const LLEnvironmentSettings& new_settings); boost::signals2::connection setPreferencesChangeCallback(const prefs_change_signal_t::slot_type& cb); boost::signals2::connection setRegionSettingsChangeCallback(const region_settings_change_signal_t::slot_type& cb); - boost::signals2::connection setRegionChangeCallback(const region_change_signal_t::slot_type& cb); boost::signals2::connection setRegionSettingsAppliedCallback(const region_settings_applied_signal_t::slot_type& cb); static bool canEditRegionSettings(); /// @return true if we have access to editing region environment static const std::string getScopeString(LLEnvKey::EScope scope); // Public callbacks. - void onRegionCrossing(); - void onTeleport(); void onRegionSettingsResponse(const LLSD& content); void onRegionSettingsApplyResponse(bool ok); @@ -261,7 +250,7 @@ private: bool useDefaultSky(); bool useDefaultWater(); - void onRegionChange(bool interpolate); + void onRegionChange(); /// Emitted when user environment preferences change. prefs_change_signal_t mUsePrefsChangeSignal; @@ -269,9 +258,6 @@ private: /// Emitted when region environment settings update comes. region_settings_change_signal_t mRegionSettingsChangeSignal; - /// Emitted when agent region changes. Move to LLAgent? - region_change_signal_t mRegionChangeSignal; - /// Emitted when agent region changes. Move to LLAgent? region_settings_applied_signal_t mRegionSettingsAppliedSignal; diff --git a/indra/newview/llestateinfomodel.cpp b/indra/newview/llestateinfomodel.cpp index 09c05f3af..b15a1cced 100644 --- a/indra/newview/llestateinfomodel.cpp +++ b/indra/newview/llestateinfomodel.cpp @@ -38,9 +38,6 @@ #include "llfloaterregioninfo.h" // for invoice id #include "llviewerregion.h" -class AIHTTPTimeoutPolicy; -extern AIHTTPTimeoutPolicy estateChangeInfoResponder_timeout; - LLEstateInfoModel::LLEstateInfoModel() : mID(0) , mFlags(0) @@ -68,12 +65,12 @@ void LLEstateInfoModel::sendEstateInfo() } } -bool LLEstateInfoModel::getUseFixedSun() const { return mFlags & REGION_FLAGS_SUN_FIXED; } -bool LLEstateInfoModel::getIsExternallyVisible() const { return mFlags & REGION_FLAGS_EXTERNALLY_VISIBLE; } -bool LLEstateInfoModel::getAllowDirectTeleport() const { return mFlags & REGION_FLAGS_ALLOW_DIRECT_TELEPORT; } -bool LLEstateInfoModel::getDenyAnonymous() const { return mFlags & REGION_FLAGS_DENY_ANONYMOUS; } -bool LLEstateInfoModel::getDenyAgeUnverified() const { return mFlags & REGION_FLAGS_DENY_AGEUNVERIFIED; } -bool LLEstateInfoModel::getAllowVoiceChat() const { return mFlags & REGION_FLAGS_ALLOW_VOICE; } +bool LLEstateInfoModel::getUseFixedSun() const { return getFlag(REGION_FLAGS_SUN_FIXED); } +bool LLEstateInfoModel::getIsExternallyVisible() const { return getFlag(REGION_FLAGS_EXTERNALLY_VISIBLE); } +bool LLEstateInfoModel::getAllowDirectTeleport() const { return getFlag(REGION_FLAGS_ALLOW_DIRECT_TELEPORT); } +bool LLEstateInfoModel::getDenyAnonymous() const { return getFlag(REGION_FLAGS_DENY_ANONYMOUS); } +bool LLEstateInfoModel::getDenyAgeUnverified() const { return getFlag(REGION_FLAGS_DENY_AGEUNVERIFIED); } +bool LLEstateInfoModel::getAllowVoiceChat() const { return getFlag(REGION_FLAGS_ALLOW_VOICE); } void LLEstateInfoModel::setUseFixedSun(bool val) { setFlag(REGION_FLAGS_SUN_FIXED, val); } void LLEstateInfoModel::setIsExternallyVisible(bool val) { setFlag(REGION_FLAGS_EXTERNALLY_VISIBLE, val); } @@ -118,19 +115,18 @@ class LLEstateChangeInfoResponder : public LLHTTPClient::ResponderWithResult public: // if we get a normal response, handle it here - /*virtual*/ void httpSuccess(void) + virtual void httpSuccess() { llinfos << "Committed estate info" << llendl; LLEstateInfoModel::instance().notifyCommit(); } // if we get an error response - /*virtual*/ void httpFailure(void) + virtual void httpFailure() { - llwarns << "Failed to commit estate info (" << mStatus << "): " << mReason << llendl; + llwarns << "Failed to commit estate info [status:" << mStatus << "]: " << mReason << llendl; } - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return estateChangeInfoResponder_timeout; } /*virtual*/ char const* getName(void) const { return "LLEstateChangeInfoResponder"; } }; @@ -205,18 +201,6 @@ void LLEstateInfoModel::commitEstateInfoDataserver() gAgent.sendMessage(); } -void LLEstateInfoModel::setFlag(U32 flag, bool val) -{ - if (val) - { - mFlags |= flag; - } - else - { - mFlags &= ~flag; - } -} - std::string LLEstateInfoModel::getInfoDump() { LLSD dump; diff --git a/indra/newview/llestateinfomodel.h b/indra/newview/llestateinfomodel.h index 30e83b140..b83d17f8d 100644 --- a/indra/newview/llestateinfomodel.h +++ b/indra/newview/llestateinfomodel.h @@ -86,19 +86,38 @@ protected: private: bool commitEstateInfoCaps(); void commitEstateInfoDataserver(); - U32 getFlags() const { return mFlags; } - void setFlag(U32 flag, bool val); + inline bool getFlag(U64 flag) const; + inline void setFlag(U64 flag, bool val); + U64 getFlags() const { return mFlags; } std::string getInfoDump(); // estate info std::string mName; /// estate name LLUUID mOwnerID; /// estate owner id U32 mID; /// estate id - U32 mFlags; /// estate flags + U64 mFlags; /// estate flags F32 mSunHour; /// estate sun hour update_signal_t mUpdateSignal; /// emitted when we receive update from sim update_signal_t mCommitSignal; /// emitted when our update gets applied to sim }; +inline bool LLEstateInfoModel::getFlag(U64 flag) const +{ + return ((mFlags & flag) != 0); +} + +inline void LLEstateInfoModel::setFlag(U64 flag, bool val) +{ + if (val) + { + mFlags |= flag; + } + else + { + mFlags &= ~flag; + } +} + + #endif // LL_LLESTATEINFOMODEL_H diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 312296fa5..56060da2b 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -298,7 +298,15 @@ LLFloaterAbout::LLFloaterAbout() // TODO: Implement media plugin version query - support.append("Qt Webkit Version: 4.7.1 (version number hard-coded)"); + support.append("Qt Webkit Version: "); + support.append( +#if LL_LINUX && defined(__x86_64__) + "4.8.6" +#else + "4.7.1" +#endif + ); + support.append(" (version number hard-coded)"); support.append("\n"); if (gPacketsIn > 0) diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index d798540e8..6b47c2680 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -68,7 +68,7 @@ extern U32 gFrameCount; namespace { - void chat_avatar_status(const std::string& name, const LLUUID& key, ERadarStatType type, bool entering) + void chat_avatar_status(const std::string& name, const LLUUID& key, ERadarStatType type, bool entering, const F32& dist) { if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) return; // RLVa:LF Don't announce people are around when blind, that cheats the system. static LLCachedControl radar_chat_alerts(gSavedSettings, "RadarChatAlerts"); @@ -96,6 +96,11 @@ namespace if (args.find("[RANGE]") != args.end()) chat.mText = self->getString("template", args); else if (chat.mText.empty()) return; + if (entering) // Note: If we decide to make this for leaving as well, change this check to dist != F32_MIN + { + static const LLCachedControl radar_show_dist("RadarAlertShowDist"); + if (radar_show_dist) chat.mText += llformat(" (%.2fm)", dist); + } chat.mFromName = name; chat.mURL = llformat("secondlife:///app/agent/%s/about",key.asString().c_str()); chat.mSourceType = CHAT_SOURCE_SYSTEM; @@ -160,7 +165,7 @@ void LLAvatarListEntry::processProperties(void* data, EAvatarProcessorType type) static const LLCachedControl sAvatarAgeAlertDays(gSavedSettings, "AvatarAgeAlertDays"); if ((U32)mAge < sAvatarAgeAlertDays) { - chat_avatar_status(mName, mID, STAT_TYPE_AGE, mStats[STAT_TYPE_AGE] = true); + chat_avatar_status(mName, mID, STAT_TYPE_AGE, mStats[STAT_TYPE_AGE] = true, (mPosition - gAgent.getPositionGlobal()).magVec()); } } // If one wanted more information that gets displayed on profiles to be displayed, here would be the place to do it. @@ -168,14 +173,18 @@ void LLAvatarListEntry::processProperties(void* data, EAvatarProcessorType type) } } -void LLAvatarListEntry::setPosition(const LLVector3d& position, bool this_sim, bool drawn, bool chatrange, bool shoutrange) +void LLAvatarListEntry::setPosition(const LLVector3d& position, const F32& dist, bool drawn) { mPosition = position; mFrame = gFrameCount; - if (this_sim != mStats[STAT_TYPE_SIM]) chat_avatar_status(mName, mID, STAT_TYPE_SIM, mStats[STAT_TYPE_SIM] = this_sim); - if (drawn != mStats[STAT_TYPE_DRAW]) chat_avatar_status(mName, mID, STAT_TYPE_DRAW, mStats[STAT_TYPE_DRAW] = drawn); - if (shoutrange != mStats[STAT_TYPE_SHOUTRANGE]) chat_avatar_status(mName, mID, STAT_TYPE_SHOUTRANGE, mStats[STAT_TYPE_SHOUTRANGE] = shoutrange); - if (chatrange != mStats[STAT_TYPE_CHATRANGE]) chat_avatar_status(mName, mID, STAT_TYPE_CHATRANGE, mStats[STAT_TYPE_CHATRANGE] = chatrange); + bool here(dist != F32_MIN); // F32_MIN only if dead + bool this_sim(here && (gAgent.getRegion()->pointInRegionGlobal(position) || !(LLWorld::getInstance()->positionRegionValidGlobal(position)))); + if (this_sim != mStats[STAT_TYPE_SIM]) chat_avatar_status(mName, mID, STAT_TYPE_SIM, mStats[STAT_TYPE_SIM] = this_sim, dist); + if (drawn != mStats[STAT_TYPE_DRAW]) chat_avatar_status(mName, mID, STAT_TYPE_DRAW, mStats[STAT_TYPE_DRAW] = drawn, dist); + bool shoutrange(here && dist < LFSimFeatureHandler::getInstance()->shoutRange()); + if (shoutrange != mStats[STAT_TYPE_SHOUTRANGE]) chat_avatar_status(mName, mID, STAT_TYPE_SHOUTRANGE, mStats[STAT_TYPE_SHOUTRANGE] = shoutrange, dist); + bool chatrange(here && dist < LFSimFeatureHandler::getInstance()->sayRange()); + if (chatrange != mStats[STAT_TYPE_CHATRANGE]) chat_avatar_status(mName, mID, STAT_TYPE_CHATRANGE, mStats[STAT_TYPE_CHATRANGE] = chatrange, dist); mUpdateTimer.start(); } @@ -553,8 +562,7 @@ void LLFloaterAvatarList::updateAvatarList() } // Announce position - F32 dist((position - mypos).magVec()); - entry->setPosition(position, gAgent.getRegion()->pointInRegionGlobal(position) || !(LLWorld::getInstance()->positionRegionValidGlobal(position)), avatarp, dist < LFSimFeatureHandler::getInstance()->sayRange(), dist < LFSimFeatureHandler::getInstance()->shoutRange()); + entry->setPosition(position, (position - mypos).magVec(), avatarp); // Mark as typing if they are typing if (avatarp && avatarp->isTyping()) entry->setActivity(LLAvatarListEntry::ACTIVITY_TYPING); @@ -621,7 +629,7 @@ void LLFloaterAvatarList::expireAvatarList() } else { - entry->setPosition(entry->getPosition(), false, false, false, false); // Dead and gone + entry->setPosition(entry->getPosition(), F32_MIN, false); // Dead and gone it = mAvatars.erase(it); } } @@ -700,151 +708,171 @@ void LLFloaterAvatarList::refreshAvatarList() LLScrollListItem::Params element; element.value = av_id; - LLScrollListCell::Params mark; - mark.column = "marked"; - mark.type = "text"; - if (entry->isMarked()) + static const LLCachedControl hide_mark("RadarColumnMarkHidden"); + if (!hide_mark) { - mark.value = "X"; - mark.color = LLColor4::blue; - mark.font_style = "BOLD"; - } - - LLScrollListCell::Params name; - name.column = "avatar_name"; - name.type = "text"; - name.value = entry->getName(); - if (entry->isFocused()) - { - name.font_style = "BOLD"; - } - - // custom colors for certain types of avatars! - //Changed a bit so people can modify them in settings. And since they're colors, again it's possibly account-based. Starting to think I need a function just to determine that. - HgB - //name.color = gColors.getColor( "MapAvatar" ); - LLViewerRegion* parent_estate = LLWorld::getInstance()->getRegionFromPosGlobal(entry->getPosition()); - LLUUID estate_owner = LLUUID::null; - if (parent_estate && parent_estate->isAlive()) - { - estate_owner = parent_estate->getOwner(); + LLScrollListCell::Params mark; + mark.column = "marked"; + mark.type = "text"; + if (entry->isMarked()) + { + mark.value = "X"; + mark.color = LLColor4::blue; + mark.font_style = "BOLD"; + } + element.columns.add(mark); } static const LLCachedControl unselected_color(gColors, "ScrollUnselectedColor", LLColor4(0.f, 0.f, 0.f, 0.8f)); - static LLCachedControl sDefaultListText(gColors, "DefaultListText"); - static LLCachedControl sRadarTextChatRange(gColors, "RadarTextChatRange"); - static LLCachedControl sRadarTextShoutRange(gColors, "RadarTextShoutRange"); - static LLCachedControl sRadarTextDrawDist(gColors, "RadarTextDrawDist"); - static LLCachedControl sRadarTextYoung(gColors, "RadarTextYoung"); + static const LLCachedControl sDefaultListText(gColors, "DefaultListText"); static const LLCachedControl ascent_muted_color("AscentMutedColor", LLColor4(0.7f,0.7f,0.7f,1.f)); LLColor4 color = sDefaultListText; - //Lindens are always more Linden than your friend, make that take precedence - if (mm_getMarkerColor(av_id, color)) {} - else if (LLMuteList::getInstance()->isLinden(av_id)) + // Name never hidden { - static const LLCachedControl ascent_linden_color("AscentLindenColor", LLColor4(0.f,0.f,1.f,1.f)); - color = ascent_linden_color; + LLScrollListCell::Params name; + name.column = "avatar_name"; + name.type = "text"; + name.value = entry->getName(); + if (entry->isFocused()) + { + name.font_style = "BOLD"; + } + + // custom colors for certain types of avatars! + //Changed a bit so people can modify them in settings. And since they're colors, again it's possibly account-based. Starting to think I need a function just to determine that. - HgB + //name.color = gColors.getColor( "MapAvatar" ); + LLUUID estate_owner = LLUUID::null; + if (LLViewerRegion* parent_estate = LLWorld::getInstance()->getRegionFromPosGlobal(entry->getPosition())) + if (parent_estate->isAlive()) + estate_owner = parent_estate->getOwner(); + + //Lindens are always more Linden than your friend, make that take precedence + if (mm_getMarkerColor(av_id, color)) {} + else if (LLMuteList::getInstance()->isLinden(av_id)) + { + static const LLCachedControl ascent_linden_color("AscentLindenColor", LLColor4(0.f,0.f,1.f,1.f)); + color = ascent_linden_color; + } + //check if they are an estate owner at their current position + else if (estate_owner.notNull() && av_id == estate_owner) + { + static const LLCachedControl ascent_estate_owner_color("AscentEstateOwnerColor", LLColor4(1.f,0.6f,1.f,1.f)); + color = ascent_estate_owner_color; + } + //without these dots, SL would suck. + else if (LLAvatarActions::isFriend(av_id)) + { + static const LLCachedControl ascent_friend_color("AscentFriendColor", LLColor4(1.f,1.f,0.f,1.f)); + color = ascent_friend_color; + } + //big fat jerkface who is probably a jerk, display them as such. + else if (LLMuteList::getInstance()->isMuted(av_id)) + { + color = ascent_muted_color; + } + name.color = color*0.5f + unselected_color*0.5f; + element.columns.add(name); } - //check if they are an estate owner at their current position - else if (estate_owner.notNull() && av_id == estate_owner) - { - static const LLCachedControl ascent_estate_owner_color("AscentEstateOwnerColor", LLColor4(1.f,0.6f,1.f,1.f)); - color = ascent_estate_owner_color; - } - //without these dots, SL would suck. - else if (LLAvatarActions::isFriend(av_id)) - { - static const LLCachedControl ascent_friend_color("AscentFriendColor", LLColor4(1.f,1.f,0.f,1.f)); - color = ascent_friend_color; - } - //big fat jerkface who is probably a jerk, display them as such. - else if (LLMuteList::getInstance()->isMuted(av_id)) - { - color = ascent_muted_color; - } - name.color = color*0.5f + unselected_color*0.5f; char temp[32]; - color = sDefaultListText; - LLScrollListCell::Params dist; - dist.column = "distance"; - dist.type = "text"; - if (UnknownAltitude) + // Distance never hidden { - strcpy(temp, "?"); - if (entry->mStats[STAT_TYPE_DRAW]) + color = sDefaultListText; + LLScrollListCell::Params dist; + dist.column = "distance"; + dist.type = "text"; + static const LLCachedControl sRadarTextDrawDist(gColors, "RadarTextDrawDist"); + if (UnknownAltitude) { - color = sRadarTextDrawDist; - } - } - else - { - if (distance <= LFSimFeatureHandler::getInstance()->shoutRange()) - { - snprintf(temp, sizeof(temp), "%.1f", distance); - color = (distance > LFSimFeatureHandler::getInstance()->sayRange()) ? sRadarTextShoutRange : sRadarTextChatRange; + strcpy(temp, "?"); + if (entry->mStats[STAT_TYPE_DRAW]) + { + color = sRadarTextDrawDist; + } } else { - if (entry->mStats[STAT_TYPE_DRAW]) color = sRadarTextDrawDist; - snprintf(temp, sizeof(temp), "%d", (S32)distance); + if (distance <= LFSimFeatureHandler::getInstance()->shoutRange()) + { + static const LLCachedControl sRadarTextChatRange(gColors, "RadarTextChatRange"); + static const LLCachedControl sRadarTextShoutRange(gColors, "RadarTextShoutRange"); + snprintf(temp, sizeof(temp), "%.1f", distance); + color = (distance > LFSimFeatureHandler::getInstance()->sayRange()) ? sRadarTextShoutRange : sRadarTextChatRange; + } + else + { + if (entry->mStats[STAT_TYPE_DRAW]) color = sRadarTextDrawDist; + snprintf(temp, sizeof(temp), "%d", (S32)distance); + } } + dist.value = temp; + dist.color = color * 0.7f + unselected_color * 0.3f; // Liru: Blend testing! + //dist.color = color; + element.columns.add(dist); } - dist.value = temp; - dist.color = color * 0.7f + unselected_color * 0.3f; // Liru: Blend testing! - //dist.color = color; - LLScrollListCell::Params pos; - position -= simpos; + static const LLCachedControl hide_pos("RadarColumnPositionHidden"); + if (!hide_pos) + { + LLScrollListCell::Params pos; + position -= simpos; - S32 x(position.mdV[VX]); - S32 y(position.mdV[VY]); - if (x >= 0 && x <= width && y >= 0 && y <= width) - { - snprintf(temp, sizeof(temp), "%d, %d", x, y); + S32 x(position.mdV[VX]); + S32 y(position.mdV[VY]); + if (x >= 0 && x <= width && y >= 0 && y <= width) + { + snprintf(temp, sizeof(temp), "%d, %d", x, y); + } + else + { + temp[0] = '\0'; + if (y < 0) + { + strcat(temp, "S"); + } + else if (y > width) + { + strcat(temp, "N"); + } + if (x < 0) + { + strcat(temp, "W"); + } + else if (x > width) + { + strcat(temp, "E"); + } + } + pos.column = "position"; + pos.type = "text"; + pos.value = temp; + element.columns.add(pos); } - else - { - temp[0] = '\0'; - if (y < 0) - { - strcat(temp, "S"); - } - else if (y > width) - { - strcat(temp, "N"); - } - if (x < 0) - { - strcat(temp, "W"); - } - else if (x > width) - { - strcat(temp, "E"); - } - } - pos.column = "position"; - pos.type = "text"; - pos.value = temp; - LLScrollListCell::Params alt; - alt.column = "altitude"; - alt.type = "text"; - if (UnknownAltitude) + static const LLCachedControl hide_alt("RadarColumnAltitudeHidden"); + if (!hide_alt) { - strcpy(temp, "?"); + LLScrollListCell::Params alt; + alt.column = "altitude"; + alt.type = "text"; + if (UnknownAltitude) + { + strcpy(temp, "?"); + } + else + { + snprintf(temp, sizeof(temp), "%d", (S32)position.mdV[VZ]); + } + alt.value = temp; + element.columns.add(alt); } - else - { - snprintf(temp, sizeof(temp), "%d", (S32)position.mdV[VZ]); - } - alt.value = temp; - LLScrollListCell::Params act; static const LLCachedControl hide_act("RadarColumnActivityHidden"); if (!hide_act) { + LLScrollListCell::Params act; act.column = "activity"; act.type = "icon"; switch(entry->getActivity()) @@ -880,12 +908,13 @@ void LLFloaterAvatarList::refreshAvatarList() default: break; } + element.columns.add(act); } - LLScrollListCell::Params voice; static const LLCachedControl hide_voice("RadarColumnVoiceHidden"); if (!hide_voice) { + LLScrollListCell::Params voice; voice.column("voice"); voice.type("icon"); // transplant from llparticipantlist.cpp, update accordingly. @@ -914,71 +943,78 @@ void LLFloaterAvatarList::refreshAvatarList() voice.color(speakerp->mStatus > LLSpeaker::STATUS_VOICE_ACTIVE ? LLColor4::transparent : speakerp->mDotColor); } } + element.columns.add(voice); } - LLScrollListCell::Params agep; - agep.column = "age"; - agep.type = "text"; - color = sDefaultListText; - std::string age = boost::lexical_cast(entry->mAge); - if (entry->mAge > -1) + static const LLCachedControl hide_age("RadarColumnAgeHidden"); + if (!hide_age) { - static const LLCachedControl sAvatarAgeAlertDays(gSavedSettings, "AvatarAgeAlertDays"); - if ((U32)entry->mAge < sAvatarAgeAlertDays) - color = sRadarTextYoung; - } - else - { - age = "?"; - } - agep.value = age; - agep.color = color; - - int dur = difftime(time(NULL), entry->getTime()); - int hours = dur / 3600; - int mins = (dur % 3600) / 60; - int secs = (dur % 3600) % 60; - - LLScrollListCell::Params time; - time.column = "time"; - time.type = "text"; - time.value = llformat("%d:%02d:%02d", hours, mins, secs); - - LLScrollListCell::Params viewer; - viewer.column = "client"; - viewer.type = "text"; - - static const LLCachedControl avatar_name_color(gColors, "AvatarNameColor",LLColor4(0.98f, 0.69f, 0.36f, 1.f)); - color = avatar_name_color; - if (LLVOAvatar* avatarp = gObjectList.findAvatar(av_id)) - { - std::string client = SHClientTagMgr::instance().getClientName(avatarp, false); - if (client.empty()) + LLScrollListCell::Params agep; + agep.column = "age"; + agep.type = "text"; + color = sDefaultListText; + std::string age = boost::lexical_cast(entry->mAge); + if (entry->mAge > -1) { - color = unselected_color; - client = "?"; + static const LLCachedControl sAvatarAgeAlertDays(gSavedSettings, "AvatarAgeAlertDays"); + if ((U32)entry->mAge < sAvatarAgeAlertDays) + { + static const LLCachedControl sRadarTextYoung(gColors, "RadarTextYoung"); + color = sRadarTextYoung; + } } - else SHClientTagMgr::instance().getClientColor(avatarp, false, color); - viewer.value = client.c_str(); + else + { + age = "?"; + } + agep.value = age; + agep.color = color; + element.columns.add(agep); } - else - { - viewer.value = getString("Out Of Range"); - } - //Blend to make the color show up better - viewer.color = color *.5f + unselected_color * .5f; - // Add individual column cell params to the item param - element.columns.add(mark); - element.columns.add(name); - element.columns.add(dist); - element.columns.add(pos); - element.columns.add(alt); - if (!hide_act) element.columns.add(act); - if (!hide_voice) element.columns.add(voice); - element.columns.add(agep); - element.columns.add(time); - element.columns.add(viewer); + static const LLCachedControl hide_time("RadarColumnTimeHidden"); + if (!hide_time) + { + int dur = difftime(time(NULL), entry->getTime()); + int hours = dur / 3600; + int mins = (dur % 3600) / 60; + int secs = (dur % 3600) % 60; + + LLScrollListCell::Params time; + time.column = "time"; + time.type = "text"; + time.value = llformat("%d:%02d:%02d", hours, mins, secs); + element.columns.add(time); + } + + static const LLCachedControl hide_client("RadarColumnClientHidden"); + if (!hide_client) + { + LLScrollListCell::Params viewer; + viewer.column = "client"; + viewer.type = "text"; + + static const LLCachedControl avatar_name_color(gColors, "AvatarNameColor",LLColor4(0.98f, 0.69f, 0.36f, 1.f)); + color = avatar_name_color; + if (LLVOAvatar* avatarp = gObjectList.findAvatar(av_id)) + { + std::string client = SHClientTagMgr::instance().getClientName(avatarp, false); + if (client.empty()) + { + color = unselected_color; + client = "?"; + } + else SHClientTagMgr::instance().getClientColor(avatarp, false, color); + viewer.value = client.c_str(); + } + else + { + viewer.value = getString("Out Of Range"); + } + //Blend to make the color show up better + viewer.color = color *.5f + unselected_color * .5f; + element.columns.add(viewer); + } // Add to list mAvatarList->addRow(element); diff --git a/indra/newview/llfloateravatarlist.h b/indra/newview/llfloateravatarlist.h index 222107c12..d77231509 100644 --- a/indra/newview/llfloateravatarlist.h +++ b/indra/newview/llfloateravatarlist.h @@ -80,7 +80,7 @@ enum ACTIVITY_TYPE * Update world position. * Affects age. */ - void setPosition(const LLVector3d& position, bool this_sim, bool drawn, bool chatrange, bool shoutrange); + void setPosition(const LLVector3d& position, const F32& dist, bool drawn); const LLVector3d& getPosition() const { return mPosition; } diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 7bc196997..389acdbe0 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -50,6 +50,7 @@ #include "llscrolllistitem.h" #include "lltabcontainer.h" #include "lluictrlfactory.h" +#include "lldraghandle.h" #include "message.h" @@ -58,17 +59,21 @@ static std::map sAvatarNameMap; LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback, BOOL allow_multiple, - BOOL closeOnSelect) + BOOL closeOnSelect, + BOOL skip_agent, + const std::string& name, + LLView * frustumOrigin) { // *TODO: Use a key to allow this not to be an effective singleton - - LLFloaterAvatarPicker* floater = getInstance(); + LLFloaterAvatarPicker* floater = + getInstance(); floater->open(); floater->mSelectionCallback = callback; floater->setAllowMultiple(allow_multiple); floater->mNearMeListComplete = FALSE; floater->mCloseOnSelect = closeOnSelect; + floater->mExcludeAgentFromSearchResults = skip_agent; if (!closeOnSelect) { @@ -79,6 +84,11 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback, floater->getChild("cancel_btn")->setLabel(close_string); } + if(frustumOrigin) + { + floater->mFrustumOrigin = frustumOrigin->getHandle(); + } + return floater; } @@ -87,10 +97,18 @@ LLFloaterAvatarPicker::LLFloaterAvatarPicker() : LLFloater(), mNumResultsReturned(0), mNearMeListComplete(FALSE), - mCloseOnSelect(FALSE) + mCloseOnSelect(FALSE), + mContextConeOpacity (0.f), + mContextConeInAlpha(0.f), + mContextConeOutAlpha(0.f), + mContextConeFadeTime(0.f) { mCommitCallbackRegistrar.add("Refresh.FriendList", boost::bind(&LLFloaterAvatarPicker::populateFriend, this)); LLUICtrlFactory::getInstance()->buildFloater(this, "floater_avatar_picker.xml", NULL); + + mContextConeInAlpha = gSavedSettings.getF32("ContextConeInAlpha"); + mContextConeOutAlpha = gSavedSettings.getF32("ContextConeOutAlpha"); + mContextConeFadeTime = gSavedSettings.getF32("ContextConeFadeTime"); } BOOL LLFloaterAvatarPicker::postBuild() @@ -188,11 +206,10 @@ static void addAvatarUUID(const LLUUID av_id, uuid_vec_t& avatar_ids, std::vecto static void getSelectedAvatarData(const LLUICtrl* from, uuid_vec_t& avatar_ids, std::vector& avatar_names) { - const LLScrollListCtrl* list = dynamic_cast(from); - if(list) + if(const LLScrollListCtrl* list = dynamic_cast(from)) { - std::vector items = list->getAllSelected(); - for (std::vector::iterator iter = items.begin(); iter != items.end(); ++iter) + const std::vector items = list->getAllSelected(); + for (std::vector::const_iterator iter = items.begin(); iter != items.end(); ++iter) { addAvatarUUID((*iter)->getUUID(), avatar_ids, avatar_names); } @@ -361,13 +378,72 @@ void LLFloaterAvatarPicker::populateFriend() } for(it = collector.mOffline.begin(); it!=collector.mOffline.end(); it++) { - friends_scroller->addStringUUIDItem(it->first, it->second); + friends_scroller->addStringUUIDItem(it->first, it->second); } friends_scroller->sortByColumnIndex(0, TRUE); } +void LLFloaterAvatarPicker::drawFrustum() +{ + if (mFrustumOrigin.get()) + { + LLView * frustumOrigin = mFrustumOrigin.get(); + LLRect origin_rect; + frustumOrigin->localRectToOtherView(frustumOrigin->getLocalRect(), &origin_rect, this); + // draw context cone connecting color picker with color swatch in parent floater + LLRect local_rect = getLocalRect(); + if (hasFocus() && frustumOrigin->isInVisibleChain() && mContextConeOpacity > 0.001f) + { + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + LLGLEnable(GL_CULL_FACE); + gGL.begin(LLRender::QUADS); + { + gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + gGL.vertex2i(origin_rect.mLeft, origin_rect.mTop); + gGL.vertex2i(origin_rect.mRight, origin_rect.mTop); + gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + gGL.vertex2i(local_rect.mRight, local_rect.mTop); + gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + + gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + gGL.vertex2i(origin_rect.mLeft, origin_rect.mBottom); + gGL.vertex2i(origin_rect.mLeft, origin_rect.mTop); + + gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + gGL.vertex2i(local_rect.mRight, local_rect.mBottom); + gGL.vertex2i(local_rect.mRight, local_rect.mTop); + gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + gGL.vertex2i(origin_rect.mRight, origin_rect.mTop); + gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom); + + gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + gGL.vertex2i(local_rect.mRight, local_rect.mBottom); + gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom); + gGL.vertex2i(origin_rect.mLeft, origin_rect.mBottom); + } + gGL.end(); + } + + if (gFocusMgr.childHasMouseCapture(getDragHandle())) + { + mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(mContextConeFadeTime)); + } + else + { + mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(mContextConeFadeTime)); + } + } +} + void LLFloaterAvatarPicker::draw() { + drawFrustum(); + // sometimes it is hard to determine when Select/Ok button should be disabled (see LLAvatarActions::shareWithAvatars). // lets check this via mOkButtonValidateSignal callback periodically. static LLFrameTimer timer; @@ -411,19 +487,20 @@ BOOL LLFloaterAvatarPicker::visibleItemsSelected() const return FALSE; } -extern AIHTTPTimeoutPolicy avatarPickerResponder_timeout; class LLAvatarPickerResponder : public LLHTTPClient::ResponderWithCompleted { + LOG_CLASS(LLAvatarPickerResponder); public: LLUUID mQueryID; LLAvatarPickerResponder(const LLUUID& id) : mQueryID(id) { } - /*virtual*/ void httpCompleted(void) +protected: + /*virtual*/ void httpCompleted() { //std::ostringstream ss; - //LLSDSerialize::toPrettyXML(mContent, ss); - //llinfos << ss.str() << llendl; + //LLSDSerialize::toPrettyXML(content, ss); + //LL_INFOS() << ss.str() << LL_ENDL; // in case of invalid characters, the avatar picker returns a 400 // just set it to process so it displays 'not found' @@ -436,12 +513,11 @@ public: } else { - llwarns << "avatar picker failed " << mStatus << " reason " << mReason << llendl; + llwarns << "avatar picker failed " << dumpResponse() << LL_ENDL; } } - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return avatarPickerResponder_timeout; } /*virtual*/ char const* getName(void) const { return "LLAvatarPickerResponder"; } }; @@ -460,9 +536,7 @@ void LLFloaterAvatarPicker::find() LLViewerRegion* region = gAgent.getRegion(); url = region->getCapability("AvatarPickerSearch"); // Prefer use of capabilities to search on both SLID and display name - // but allow display name search to be manually turned off for test - if (!url.empty() - && LLAvatarNameCache::useDisplayNames()) + if (!url.empty()) { // capability urls don't end in '/', but we need one to parse // query parameters correctly @@ -471,6 +545,7 @@ void LLFloaterAvatarPicker::find() url += "/"; } url += "?page_size=100&names="; + std::replace(text.begin(), text.end(), '.', ' '); url += LLURI::escape(text); llinfos << "avatar picker " << url << llendl; LLHTTPClient::get(url, new LLAvatarPickerResponder(mQueryID)); @@ -595,8 +670,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* // Not for us if (agent_id != gAgent.getID()) return; - if(!instanceExists()) - return; + if (!instanceExists()) return; LLFloaterAvatarPicker* floater = getInstance(); // floater is closed or these are not results from our last request @@ -620,35 +694,38 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* msg->getUUIDFast( _PREHASH_Data,_PREHASH_AvatarID, avatar_id, i); msg->getStringFast(_PREHASH_Data,_PREHASH_FirstName, first_name, i); msg->getStringFast(_PREHASH_Data,_PREHASH_LastName, last_name, i); - - std::string avatar_name; - if (avatar_id.isNull()) - { - LLStringUtil::format_map_t map; - map["[TEXT]"] = floater->getChild("Edit")->getValue().asString(); - avatar_name = floater->getString("not_found", map); - search_results->setEnabled(FALSE); - floater->getChildView("ok_btn")->setEnabled(FALSE); - } - else - { - avatar_name = LLCacheName::buildFullName(first_name, last_name); - search_results->setEnabled(TRUE); - found_one = TRUE; - LLAvatarName av_name; - av_name.mLegacyFirstName = first_name; - av_name.mLegacyLastName = last_name; - av_name.mDisplayName = avatar_name; - const LLUUID& agent_id = avatar_id; - sAvatarNameMap[agent_id] = av_name; + if (avatar_id != agent_id || !floater->isExcludeAgentFromSearchResults()) // exclude agent from search results? + { + std::string avatar_name; + if (avatar_id.isNull()) + { + LLStringUtil::format_map_t map; + map["[TEXT]"] = floater->getChild("Edit")->getValue().asString(); + avatar_name = floater->getString("not_found", map); + search_results->setEnabled(FALSE); + floater->getChildView("ok_btn")->setEnabled(FALSE); + } + else + { + avatar_name = LLCacheName::buildFullName(first_name, last_name); + search_results->setEnabled(TRUE); + found_one = TRUE; + LLAvatarName av_name; + av_name.mLegacyFirstName = first_name; + av_name.mLegacyLastName = last_name; + av_name.mDisplayName = avatar_name; + const LLUUID& agent_id = avatar_id; + sAvatarNameMap[agent_id] = av_name; + + } + LLSD element; + element["id"] = avatar_id; // value + element["columns"][0]["column"] = "name"; + element["columns"][0]["value"] = avatar_name; + search_results->addElement(element); } - LLSD element; - element["id"] = avatar_id; // value - element["columns"][0]["column"] = "name"; - element["columns"][0]["value"] = avatar_name; - search_results->addElement(element); } if (found_one) @@ -690,18 +767,21 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& for ( ; it != agents.endArray(); ++it) { const LLSD& row = *it; - item["id"] = row["id"]; - LLSD& columns = item["columns"]; - columns[0]["column"] = "name"; - columns[0]["value"] = row["display_name"]; - columns[1]["column"] = "username"; - columns[1]["value"] = row["username"]; - search_results->addElement(item); + if (row["id"].asUUID() != gAgent.getID() || !mExcludeAgentFromSearchResults) + { + item["id"] = row["id"]; + LLSD& columns = item["columns"]; + columns[0]["column"] = "name"; + columns[0]["value"] = row["display_name"]; + columns[1]["column"] = "username"; + columns[1]["value"] = row["username"]; + search_results->addElement(item); - // add the avatar name to our list - LLAvatarName avatar_name; - avatar_name.fromLLSD(row); - sAvatarNameMap[row["id"].asUUID()] = avatar_name; + // add the avatar name to our list + LLAvatarName avatar_name; + avatar_name.fromLLSD(row); + sAvatarNameMap[row["id"].asUUID()] = avatar_name; + } } getChildView("ok_btn")->setEnabled(true); @@ -713,10 +793,10 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& void LLFloaterAvatarPicker::editKeystroke(LLLineEditor* caller) { - if(caller->getName() == "Edit") + if (caller->getName() == "Edit") getChildView("Find")->setEnabled(caller->getText().size() >= 3); else - childSetEnabled("Select", caller->getValue().asUUID().notNull()); + getChildView("Select")->setEnabled(caller->getValue().asUUID().notNull()); } // virtual diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h index 799d28790..f4fcc91f4 100644 --- a/indra/newview/llfloateravatarpicker.h +++ b/indra/newview/llfloateravatarpicker.h @@ -45,11 +45,15 @@ public: // Call this to select an avatar. static LLFloaterAvatarPicker* show(select_callback_t callback, BOOL allow_multiple = FALSE, - BOOL closeOnSelect = FALSE); + BOOL closeOnSelect = FALSE, + BOOL skip_agent = FALSE, + const std::string& name = "", + LLView * frustumOrigin = NULL); // do not call these directly LLFloaterAvatarPicker(); virtual ~LLFloaterAvatarPicker(); + virtual BOOL postBuild(); void setOkBtnEnableCb(validate_callback_t cb); @@ -63,6 +67,7 @@ public: std::string& tooltip_msg); void openFriendsTab(); + BOOL isExcludeAgentFromSearchResults() { return mExcludeAgentFromSearchResults; } private: void editKeystroke(class LLLineEditor* caller); @@ -84,6 +89,7 @@ private: void setAllowMultiple(BOOL allow_multiple); LLScrollListCtrl* getActiveList(); + void drawFrustum(); virtual void draw(); virtual BOOL handleKeyHere(KEY key, MASK mask); @@ -91,6 +97,12 @@ private: int mNumResultsReturned; BOOL mNearMeListComplete; BOOL mCloseOnSelect; + BOOL mExcludeAgentFromSearchResults; + LLHandle mFrustumOrigin; + F32 mContextConeOpacity; + F32 mContextConeInAlpha; + F32 mContextConeOutAlpha; + F32 mContextConeFadeTime; validate_signal_t mOkButtonValidateSignal; select_callback_t mSelectionCallback; diff --git a/indra/newview/llfloaterdirectory.cpp b/indra/newview/llfloaterdirectory.cpp index ce2f71e16..e6606de36 100644 --- a/indra/newview/llfloaterdirectory.cpp +++ b/indra/newview/llfloaterdirectory.cpp @@ -54,7 +54,6 @@ #include "hippogridmanager.h" #include "lfsimfeaturehandler.h" -#include "llenvmanager.h" #include "llnotificationsutil.h" #include "llviewerregion.h" @@ -279,7 +278,7 @@ LLFloaterDirectory::LLFloaterDirectory(const std::string& name) LLPanelDirMarket* marketp = static_cast(container->getPanelByName(market_panel)); container->removeTabPanel(marketp); // Until we get a MarketPlace URL, tab is removed. marketp->handleRegionChange(container); - LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LLPanelDirMarket::handleRegionChange, marketp, container)); + gAgent.addRegionChangedCallback(boost::bind(&LLPanelDirMarket::handleRegionChange, marketp, container)); } container->setCommitCallback(boost::bind(&LLFloaterDirectory::onTabChanged,_2)); } @@ -455,13 +454,13 @@ void LLFloaterDirectory::requestClassifieds() void LLFloaterDirectory::searchInAll(const std::string& search_text) { + start(); LLPanelDirFindAllInterface::search(sInstance->mFindAllPanel, search_text); performQueryOn2("classified_panel", search_text); performQueryOn2("events_panel", search_text); performQueryOn2("groups_panel", search_text); performQueryOn2("people_panel", search_text); performQueryOn2("places_panel", search_text); - sInstance->open(); } void LLFloaterDirectory::showFindAll(const std::string& search_text) @@ -583,7 +582,7 @@ void LLFloaterDirectory::focusCurrentPanel() } // static -void LLFloaterDirectory::showPanel(const std::string& tabname) +void LLFloaterDirectory::start() { // This function gets called when web browser clicks are processed, // so we don't delete the existing panel, which would delete the @@ -593,6 +592,12 @@ void LLFloaterDirectory::showPanel(const std::string& tabname) sInstance = new LLFloaterDirectory("directory"); } sInstance->open(); /*Flawfinder: ignore*/ +} + +// static +void LLFloaterDirectory::showPanel(const std::string& tabname) +{ + start(); sInstance->childShowTab("Directory Tabs", tabname); sInstance->focusCurrentPanel(); } diff --git a/indra/newview/llfloaterdirectory.h b/indra/newview/llfloaterdirectory.h index 0f5f1b501..c36ce412b 100644 --- a/indra/newview/llfloaterdirectory.h +++ b/indra/newview/llfloaterdirectory.h @@ -94,6 +94,7 @@ public: private: static void performQueryOn(const std::string& name, const std::string& search_text); static void performQueryOn2(const std::string& name, const std::string& search_text); + static void start(); static void showPanel(const std::string& tabname); /*virtual*/ void onClose(bool app_quitting); void focusCurrentPanel(); diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp index d85ea0f59..14a684bbe 100644 --- a/indra/newview/llfloaterfriends.cpp +++ b/indra/newview/llfloaterfriends.cpp @@ -54,7 +54,6 @@ #include "lltextbox.h" #include "lluictrlfactory.h" #include "llviewerwindow.h" -#include "llvoiceclient.h" #include "statemachine/aifilepicker.h" @@ -65,44 +64,19 @@ //#include "llchat.h" //#include "llfloaterchat.h" -#define DEFAULT_PERIOD 5.0 -#define RIGHTS_CHANGE_TIMEOUT 5.0 -#define OBSERVER_TIMEOUT 0.5 - -#define ONLINE_SIP_ICON_NAME "slim_icon_16_viewer.tga" - // simple class to observe the calling cards. - - -class LLAvatarListUpdater : public LLEventTimer -{ -public: - LLAvatarListUpdater(F32 period) - : LLEventTimer(period) - { - mEventTimer.stop(); - } - - virtual BOOL tick() // from LLEventTimer - { - return FALSE; - } -}; - -class LLLocalFriendsObserver : public LLAvatarListUpdater, public LLFriendObserver +class LLLocalFriendsObserver : public LLFriendObserver, public LLEventTimer { LOG_CLASS(LLLocalFriendsObserver); public: LLLocalFriendsObserver(LLPanelFriends* floater) - : mFloater(floater), LLAvatarListUpdater(OBSERVER_TIMEOUT) + : mFloater(floater), LLEventTimer(0.5) { + mEventTimer.stop(); LLAvatarTracker::instance().addObserver(this); - // For notification when SIP online status changes. - LLVoiceClient::getInstance()->addObserver(this); } /*virtual*/ ~LLLocalFriendsObserver() { - LLVoiceClient::getInstance()->removeObserver(this); LLAvatarTracker::instance().removeObserver(this); } /*virtual*/ void changed(U32 mask) @@ -122,7 +96,7 @@ public: mEventTimer.stop(); mMask = 0; - return FALSE; + return false; } protected: @@ -131,15 +105,9 @@ protected: }; LLPanelFriends::LLPanelFriends() : - LLPanel(), - LLEventTimer(DEFAULT_PERIOD), mObserver(NULL), - mShowMaxSelectWarning(TRUE), - mAllowRightsChange(TRUE), - mNumRightsChanged(0), mNumOnline(0) { - mEventTimer.stop(); mObserver = new LLLocalFriendsObserver(this); } @@ -148,66 +116,34 @@ LLPanelFriends::~LLPanelFriends() delete mObserver; } -BOOL LLPanelFriends::tick() -{ - mEventTimer.stop(); - mPeriod = DEFAULT_PERIOD; - mAllowRightsChange = TRUE; - updateFriends(LLFriendObserver::ADD); - return FALSE; -} - void LLPanelFriends::updateFriends(U32 changed_mask) { LLUUID selected_id; - LLCtrlListInterface *friends_list = childGetListInterface("friend_list"); - if (!friends_list) return; - LLCtrlScrollInterface *friends_scroll = childGetScrollInterface("friend_list"); - if (!friends_scroll) return; - - // We kill the selection warning, otherwise we'll spam with warning popups - // if the maximum amount of friends are selected - mShowMaxSelectWarning = false; const uuid_vec_t selected_friends = mFriendsList->getSelectedIDs(); - if(changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE)) + if (changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE | LLFriendObserver::POWERS)) { refreshNames(changed_mask); } - else if(changed_mask & LLFriendObserver::POWERS) - { - --mNumRightsChanged; - if(mNumRightsChanged > 0) - { - mPeriod = RIGHTS_CHANGE_TIMEOUT; - mEventTimer.start(); - mAllowRightsChange = FALSE; - } - else - { - tick(); - } - } - if(!selected_friends.empty()) + if (!selected_friends.empty()) { // only non-null if friends was already found. This may fail, // but we don't really care here, because refreshUI() will // clean up the interface. - friends_list->setCurrentByID(selected_id); + mFriendsList->setCurrentByID(selected_id); for(uuid_vec_t::const_iterator itr = selected_friends.begin(); itr != selected_friends.end(); ++itr) { - friends_list->setSelectedByValue(*itr, true); + mFriendsList->setSelectedByValue(*itr, true); } } refreshUI(); - mShowMaxSelectWarning = true; } // // Contact search and group system. // 09/05/2010 - Charley Levenque -std::string LLPanelFriends::cleanFileName(std::string filename) +/*std::string LLPanelFriends::cleanFileName(std::string filename) { std::string invalidChars = "\"\'\\/?*:<>|"; S32 position = filename.find_first_of(invalidChars); @@ -217,13 +153,11 @@ std::string LLPanelFriends::cleanFileName(std::string filename) position = filename.find_first_of(invalidChars, position); } return filename; -} +}*/ /*void LLPanelFriends::populateContactGroupSelect() { - LLComboBox* combo = getChild("buddy_group_combobox"); - - if (combo) + if (LLComboBox* combo = findChild("buddy_group_combobox")) { combo->removeall(); combo->add("All", ADD_BOTTOM); @@ -239,15 +173,13 @@ std::string LLPanelFriends::cleanFileName(std::string filename) } else { - LLChat msg("Null combo"); - LLFloaterChat::addChat(msg); + LLFloaterChat::addChat("Null combo"); } }*/ -/*void LLPanelFriends::setContactGroup(std::string contact_grp) +/*void LLPanelFriends::setContactGroup(const std::string& contact_grp) { - LLChat msg("Group set to " + contact_grp); - LLFloaterChat::addChat(msg); + LLFloaterChat::addChat("Group set to " + contact_grp); refreshNames(LLFriendObserver::ADD); refreshUI(); categorizeContacts(); @@ -258,8 +190,7 @@ std::string LLPanelFriends::cleanFileName(std::string filename) LLSD contact_groups = gSavedPerAccountSettings.getLLSD("AscentContactGroups"); std::string group_name = "All"; - LLComboBox* combo = getChild("buddy_group_combobox"); - if (combo) + if (LLComboBox* combo = findChild("buddy_group_combobox")) { group_name = combo->getValue().asString(); @@ -268,11 +199,9 @@ std::string LLPanelFriends::cleanFileName(std::string filename) std::vector vFriends = mFriendsList->getAllData(); // all of it. for (std::vector::iterator itr = vFriends.begin(); itr != vFriends.end(); ++itr) { - BOOL show_entry = false;//contact_groups[group_name].has((*itr)->getUUID().asString()); + bool show_entry = false;//contact_groups[group_name].has((*itr)->getUUID().asString()); - S32 count = contact_groups[group_name].size(); - int i; - for(i = 0; i < count; i++) + for(S32 i = 0, count = contact_groups[group_name].size(); i < count; ++i) { if (contact_groups[group_name][i].asString() == (*itr)->getUUID().asString()) { @@ -283,29 +212,25 @@ std::string LLPanelFriends::cleanFileName(std::string filename) if (!show_entry) { - LLChat msg("False: contact_groups['" + group_name + "'].has('" + (*itr)->getUUID().asString() + "');"); - LLFloaterChat::addChat(msg); + LLFloaterChat::addChat("False: contact_groups['" + group_name + "'].has('" + (*itr)->getUUID().asString() + "');"); mFriendsList->deleteItems((*itr)->getValue()); } else { - LLChat msg("True: contact_groups['" + group_name + "'].has('" + (*itr)->getUUID().asString() + "');"); - LLFloaterChat::addChat(msg); + LLFloaterChat::addChat("True: contact_groups['" + group_name + "'].has('" + (*itr)->getUUID().asString() + "');"); } } } else { - LLChat msg("Group set to all."); - LLFloaterChat::addChat(msg); + LLFloaterChat::addChat("Group set to all."); } refreshUI(); } else { - LLChat msg("Null combo."); - LLFloaterChat::addChat(msg); + LLFloaterChat::addChat("Null combo."); } }*/ @@ -313,8 +238,8 @@ void LLPanelFriends::filterContacts(const std::string& search_name) { std::string friend_name; - if ((search_name != "" /*&& search_name != mLastContactSearch*/)) - { + if (!search_name.empty()) + { if (search_name.find(mLastContactSearch) == std::string::npos) { refreshNames(LLFriendObserver::ADD); @@ -326,8 +251,8 @@ void LLPanelFriends::filterContacts(const std::string& search_name) for (std::vector::iterator itr = vFriends.begin(); itr != vFriends.end(); ++itr) { friend_name = utf8str_tolower((*itr)->getColumn(LIST_FRIEND_NAME)->getValue().asString()); - BOOL show_entry = (friend_name.find(utf8str_tolower(search_name)) != std::string::npos); - //llinfos << "friend_name = " << friend_name << (show_entry?" (shown)":"") <deleteItems((*itr)->getValue()); @@ -337,43 +262,30 @@ void LLPanelFriends::filterContacts(const std::string& search_name) mFriendsList->updateLayout(); refreshUI(); } - else if (search_name == "" && search_name != mLastContactSearch) refreshNames(LLFriendObserver::ADD); + else if (!mLastContactSearch.empty()) refreshNames(LLFriendObserver::ADD); mLastContactSearch = search_name; } - -void LLPanelFriends::onContactFilterEdit(const std::string& search_string) -{ - filterContacts(search_string); -} - -/*void LLPanelFriends::onChangeContactGroup(LLUICtrl* ctrl, void* user_data) -{ - LLPanelFriends* panelp = (LLPanelFriends*)user_data; - - if(panelp) - { - LLComboBox* combo = panelp->getChild("buddy_group_combobox"); - panelp->setContactGroup(combo->getValue().asString()); - } -}*/ // -- // virtual BOOL LLPanelFriends::postBuild() { mFriendsList = getChild("friend_list"); - mFriendsList->setCommitOnSelectionChange(TRUE); - mFriendsList->setCommitCallback(onSelectName, this); - //childSetCommitCallback("buddy_group_combobox", onChangeContactGroup, this); - mFriendsList->setDoubleClickCallback(onClickIM, this); + mFriendsList->setCommitOnSelectionChange(true); + /* Singu TODO: Update to C++11 and make everything cleaner here + auto single_selection(boost::bind(&LLScrollListCtrl::getCurrentID, mFriendsList)); + auto selection(boost::bind(&LLScrollListCtrl::getSelectedIDs, mFriendsList)); + */ + mFriendsList->setCommitCallback(boost::bind(&LLPanelFriends::onSelectName, this)); + //getChild("buddy_group_combobox")->setCommitCallback(boost::bind(&LLPanelFriends::setContactGroup, this, _2)); + mFriendsList->setDoubleClickCallback(boost::bind(LLAvatarActions::startIM, boost::bind(&LLScrollListCtrl::getCurrentID, mFriendsList))); // // Contact search and group system. // 09/05/2010 - Charley Levenque - LLFilterEditor* contact = getChild("buddy_search_lineedit"); - if (contact) + if (LLFilterEditor* contact = getChild("buddy_search_lineedit")) { - contact->setCommitCallback(boost::bind(&LLPanelFriends::onContactFilterEdit, this, _2)); + contact->setCommitCallback(boost::bind(&LLPanelFriends::filterContacts, this, _2)); } getChild("s_num")->setValue("0"); @@ -382,16 +294,15 @@ BOOL LLPanelFriends::postBuild() U32 changed_mask = LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE; refreshNames(changed_mask); - childSetAction("im_btn", onClickIM, this); - //childSetAction("assign_btn", onClickAssign, this); - childSetAction("expand_collapse_btn", onClickExpand, this); - childSetAction("profile_btn", onClickProfile, this); + getChild("im_btn")->setCommitCallback(boost::bind(&LLPanelFriends::onClickIM, this, boost::bind(&LLScrollListCtrl::getSelectedIDs, mFriendsList))); + //getChild("assign_btn")->setCommitCallback(boost::bind(ASFloaterContactGroups::show, boost::bind(&LLScrollListCtrl::getSelectedIDs, mFriendsList))); + getChild("profile_btn")->setCommitCallback(boost::bind(LLAvatarActions::showProfiles, boost::bind(&LLScrollListCtrl::getSelectedIDs, mFriendsList), false)); getChild("offer_teleport_btn")->setCommitCallback(boost::bind(static_cast(LLAvatarActions::offerTeleport), boost::bind(&LLScrollListCtrl::getSelectedIDs, mFriendsList))); - childSetAction("pay_btn", onClickPay, this); - childSetAction("add_btn", onClickAddFriend, this); + getChild("pay_btn")->setCommitCallback(boost::bind(LLAvatarActions::pay, boost::bind(&LLScrollListCtrl::getCurrentID, mFriendsList))); + getChild("add_btn")->setCommitCallback(boost::bind(&LLPanelFriends::onClickAddFriend, this)); getChild("remove_btn")->setCommitCallback(boost::bind(LLAvatarActions::removeFriendsDialog, boost::bind(&LLScrollListCtrl::getSelectedIDs, mFriendsList))); - //childSetAction("export_btn", onClickExport, this); Making Dummy View -HgB - //childSetAction("import_btn", onClickImport, this); Making Dummy View -HgB + //getChild("export_btn")->setCommitCallback(boost::bind(&LLPanelFriends::onClickExport, this)); Making Dummy View -HgB + //getChild("import_btn")->setCommitCallback(boost::bind(&LLPanelFriends::onClickImport, this)); Making Dummy View -HgB setDefaultBtn("im_btn"); @@ -399,202 +310,185 @@ BOOL LLPanelFriends::postBuild() refreshUI(); // primary sort = online status, secondary sort = name - mFriendsList->sortByColumn(std::string("friend_name"), TRUE); - mFriendsList->sortByColumn(std::string("icon_online_status"), FALSE); + mFriendsList->sortByColumn(std::string("friend_name"), true); + mFriendsList->sortByColumn(std::string("icon_online_status"), false); - updateColumns(this); + if (LLControlVariable* ctrl = gSavedSettings.getControl("ContactListCollapsed")) + { + updateColumns(ctrl->getValue()); + ctrl->getSignal()->connect(boost::bind(&LLPanelFriends::updateColumns, this, _2)); + } - return TRUE; + return true; } -static const S32& friend_name_system() +const S32& friend_name_system() { static const LLCachedControl name_system("FriendNameSystem", 0); return name_system; } -BOOL LLPanelFriends::addFriend(const LLUUID& agent_id) +static void update_friend_item(LLScrollListItem* item, const LLAvatarName& avname) { - LLAvatarTracker& at = LLAvatarTracker::instance(); - const LLRelationship* relationInfo = at.getBuddyInfo(agent_id); - if(!relationInfo) return FALSE; + std::string name; + LLAvatarNameCache::getPNSName(avname, name, friend_name_system()); + item->getColumn(1)->setValue(name); +} - bool isOnlineSIP = LLVoiceClient::getInstance()->isOnlineSIP(agent_id); - bool isOnline = relationInfo->isOnline(); +void LLPanelFriends::addFriend(const LLUUID& agent_id) +{ + const LLRelationship* relation_info = LLAvatarTracker::instance().getBuddyInfo(agent_id); + if (!relation_info) return; + + bool isOnline = relation_info->isOnline(); std::string fullname; bool have_name = LLAvatarNameCache::getPNSName(agent_id, fullname, friend_name_system()); if (!have_name) gCacheName->getFullName(agent_id, fullname); - LLSD element; - element["id"] = agent_id; - LLSD& friend_column = element["columns"][LIST_FRIEND_NAME]; - friend_column["column"] = "friend_name"; - friend_column["value"] = fullname; - friend_column["font"] = "SANSSERIF"; - friend_column["font-style"] = "NORMAL"; - /* Singu TODO: Liru will fix this up to actually work later + LLScrollListItem::Params element; + element.value = agent_id; + LLScrollListCell::Params friend_column; + friend_column.column("friend_name").value(fullname).font("SANSSERIF"); static const LLCachedControl sDefaultColor(gColors, "DefaultListText"); static const LLCachedControl sMutedColor("AscentMutedColor"); - friend_column["color"] = LLAvatarActions::isBlocked(agent_id) ? sMutedColor : sDefaultColor; - */ + friend_column.color(LLAvatarActions::isBlocked(agent_id) ? sMutedColor : sDefaultColor); + element.columns.add(friend_column); - LLSD& online_status_column = element["columns"][LIST_ONLINE_STATUS]; - online_status_column["column"] = "icon_online_status"; - online_status_column["type"] = "icon"; + LLScrollListCell::Params cell; + cell.column("icon_online_status").type("icon"); if (isOnline) { - mNumOnline++; - friend_column["font-style"] = "BOLD"; - online_status_column["value"] = "icon_avatar_online.tga"; - } - else if(isOnlineSIP) - { - mNumOnline++; - friend_column["font-style"] = "BOLD"; - online_status_column["value"] = ONLINE_SIP_ICON_NAME; + ++mNumOnline; + friend_column.font_style("BOLD"); + cell.value("icon_avatar_online.tga"); } - LLSD& online_column = element["columns"][LIST_VISIBLE_ONLINE]; - online_column["column"] = "icon_visible_online"; - online_column["type"] = "checkbox"; - online_column["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS); + // Add the online indicator, then the names + element.columns.add(cell); + element.columns.add(friend_column); - LLSD& visible_map_column = element["columns"][LIST_VISIBLE_MAP]; - visible_map_column["column"] = "icon_visible_map"; - visible_map_column["type"] = "checkbox"; - visible_map_column["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION); + cell.font_style("NORMAL").type("checkbox") // Ready cell for the extended info - LLSD& edit_my_object_column = element["columns"][LIST_EDIT_MINE]; - edit_my_object_column["column"] = "icon_edit_mine"; - edit_my_object_column["type"] = "checkbox"; - edit_my_object_column["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS); - - LLSD& see_online_them_column = element["columns"][LIST_VISIBLE_ONLINE_THEIRS]; - see_online_them_column["column"] = "icon_visible_online_theirs"; - see_online_them_column["type"] = "checkbox"; - see_online_them_column["enabled"] = ""; - see_online_them_column["value"] = relationInfo->isRightGrantedFrom(LLRelationship::GRANT_ONLINE_STATUS); + .column("icon_visible_online") + .value(relation_info->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS)); + element.columns.add(cell); + cell.column("icon_visible_map") + .value(relation_info->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION)); + element.columns.add(cell); + cell.column("icon_edit_mine") + .value(relation_info->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS)); + element.columns.add(cell); - LLSD& mapstalk_them_column = element["columns"][LIST_VISIBLE_MAP_THEIRS]; - mapstalk_them_column["column"] = "icon_visible_map_theirs"; - mapstalk_them_column["type"] = "checkbox"; - mapstalk_them_column["enabled"] = ""; - mapstalk_them_column["value"] = relationInfo->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION); + cell.enabled(false) // These next cells are disabled. - LLSD& edit_their_object_column = element["columns"][LIST_EDIT_THEIRS]; - edit_their_object_column["column"] = "icon_edit_theirs"; - edit_their_object_column["type"] = "checkbox"; - edit_their_object_column["enabled"] = ""; - edit_their_object_column["value"] = relationInfo->isRightGrantedFrom(LLRelationship::GRANT_MODIFY_OBJECTS); + .column("icon_visible_online_theirs") + .value(relation_info->isRightGrantedFrom(LLRelationship::GRANT_ONLINE_STATUS)); + element.columns.add(cell); - LLSD& update_gen_column = element["columns"][LIST_FRIEND_UPDATE_GEN]; - update_gen_column["column"] = "friend_last_update_generation"; - update_gen_column["value"] = have_name ? relationInfo->getChangeSerialNum() : -1; + cell.column("icon_visible_map_theirs") + .value(relation_info->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION)); + element.columns.add(cell); - mFriendsList->addElement(element, ADD_BOTTOM); - return have_name; + cell.column("icon_edit_theirs") + .value(relation_info->isRightGrantedFrom(LLRelationship::GRANT_MODIFY_OBJECTS)); + element.columns.add(cell); + + cell.type("text") // This is for sort, not display. + .column("friend_last_update_generation") + .value(have_name ? relation_info->getChangeSerialNum() : -1); + element.columns.add(cell); + + LLScrollListItem* item(mFriendsList->addRow(element)); + if (!have_name) LLAvatarNameCache::get(agent_id, boost::bind(update_friend_item, item, _2)); } // propagate actual relationship to UI. // Does not resort the UI list because it can be called frequently. JC -BOOL LLPanelFriends::updateFriendItem(const LLUUID& agent_id, const LLRelationship* info) +void LLPanelFriends::updateFriendItem(const LLUUID& agent_id, const LLRelationship* info) { - if (!info) return FALSE; + if (!info) return; LLScrollListItem* itemp = mFriendsList->getItem(agent_id); - if (!itemp) return FALSE; - - bool isOnlineSIP = LLVoiceClient::getInstance()->isOnlineSIP(itemp->getUUID()); + if (!itemp) return; + bool isOnline = info->isOnline(); std::string fullname; - bool have_name = LLAvatarNameCache::getPNSName(agent_id, fullname, friend_name_system()); - if (!have_name) gCacheName->getFullName(agent_id, fullname); - - // Name of the status icon to use - std::string statusIcon; - - if(isOnline) + if (LLAvatarNameCache::getPNSName(agent_id, fullname, friend_name_system())) { - mNumOnline++; - statusIcon = "icon_avatar_online.tga"; - } - else if(isOnlineSIP) - { - mNumOnline++; - statusIcon = ONLINE_SIP_ICON_NAME; + itemp->getColumn(LIST_FRIEND_UPDATE_GEN)->setValue(info->getChangeSerialNum()); } else { - mNumOnline--; + gCacheName->getFullName(agent_id, fullname); + LLAvatarNameCache::get(agent_id, boost::bind(update_friend_item, itemp, _2)); + itemp->getColumn(LIST_FRIEND_UPDATE_GEN)->setValue(-1); + } + + if (LLScrollListCell* cell = itemp->getColumn(LIST_ONLINE_STATUS)) + { + if (cell->getValue().asString().empty() == isOnline) + { + // Name of the status icon to use + std::string statusIcon; + + if (isOnline) + { + ++mNumOnline; + statusIcon = "icon_avatar_online.tga"; + } + else + { + --mNumOnline; + } + cell->setValue(statusIcon); + } } - itemp->getColumn(LIST_ONLINE_STATUS)->setValue(statusIcon); - itemp->getColumn(LIST_FRIEND_NAME)->setValue(fullname); // render name of online friends in bold text - ((LLScrollListText*)itemp->getColumn(LIST_FRIEND_NAME))->setFontStyle((isOnline || isOnlineSIP) ? LLFontGL::BOLD : LLFontGL::NORMAL); + static_cast(itemp->getColumn(LIST_FRIEND_NAME))->setFontStyle(isOnline ? LLFontGL::BOLD : LLFontGL::NORMAL); itemp->getColumn(LIST_VISIBLE_ONLINE)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS)); itemp->getColumn(LIST_VISIBLE_MAP)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION)); itemp->getColumn(LIST_EDIT_MINE)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS)); //Notes in the original code imply this may not always work. Good to know. -HgB itemp->getColumn(LIST_VISIBLE_ONLINE_THEIRS)->setValue(info->isRightGrantedFrom(LLRelationship::GRANT_ONLINE_STATUS)); - + itemp->getColumn(LIST_VISIBLE_MAP_THEIRS)->setValue(info->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION)); itemp->getColumn(LIST_EDIT_THEIRS)->setValue(info->isRightGrantedFrom(LLRelationship::GRANT_MODIFY_OBJECTS)); - S32 change_generation = have_name ? info->getChangeSerialNum() : -1; - itemp->getColumn(LIST_FRIEND_UPDATE_GEN)->setValue(change_generation); - // enable this item, in case it was disabled after user input - itemp->setEnabled(TRUE); + itemp->setEnabled(true); mFriendsList->setNeedsSort(); // Do not resort, this function can be called frequently. - return have_name; } void LLPanelFriends::refreshRightsChangeList() { - const uuid_vec_t friends = mFriendsList->getSelectedIDs(); - - S32 num_selected = friends.size(); - bool can_offer_teleport = num_selected >= 1; - bool selected_friends_online = true; - /*LLTextBox* processing_label = getChild("process_rights_label"); + size_t num_selected = friends.size(); + bool can_offer_teleport = num_selected; - if(!mAllowRightsChange) + /* if (LLTextBox* processing_label = getChild("process_rights_label")) { - if(processing_label) - { - processing_label->setVisible(true); - // ignore selection for now - friends.clear(); - num_selected = 0; - } - } - else if(processing_label) - { - processing_label->setVisible(false); + processing_label->setVisible(true); + // ignore selection for now + friends.clear(); + num_selected = 0; } Making Dummy View -HgB */ - const LLRelationship* friend_status = NULL; for(uuid_vec_t::const_iterator itr = friends.begin(); itr != friends.end(); ++itr) { - friend_status = LLAvatarTracker::instance().getBuddyInfo(*itr); - if (friend_status) + if (const LLRelationship* friend_status = LLAvatarTracker::instance().getBuddyInfo(*itr)) { - if(!friend_status->isOnline()) - { + if (!friend_status->isOnline()) can_offer_teleport = false; - selected_friends_online = false; - } } else // missing buddy info, don't allow any operations { @@ -603,24 +497,20 @@ void LLPanelFriends::refreshRightsChangeList() } //Stuff for the online/total/select counts. - getChild("s_num")->setValue(llformat("%d", num_selected)); getChild("f_num")->setValue(llformat("%d / %d", mNumOnline, mFriendsList->getItemCount())); - - if (num_selected == 0) // nothing selected + + if (!num_selected) // nothing selected { - childSetEnabled("im_btn", FALSE); - //childSetEnabled("assign_btn", FALSE); - childSetEnabled("offer_teleport_btn", FALSE); + getChildView("im_btn")->setEnabled(false); + //getChildView("assign_btn")->setEnabled(false); + getChildView("offer_teleport_btn")->setEnabled(false); } else // we have at least one friend selected... { - // only allow IMs to groups when everyone in the group is online - // to be consistent with context menus in inventory and because otherwise - // offline friends would be silently dropped from the session - childSetEnabled("im_btn", selected_friends_online || num_selected == 1); - //childSetEnabled("assign_btn", num_selected == 1); - childSetEnabled("offer_teleport_btn", can_offer_teleport); + getChildView("im_btn")->setEnabled(true); + //getChildView("assign_btn")->setEnabled(num_selected == 1); + getChildView("offer_teleport_btn")->setEnabled(can_offer_teleport); } } @@ -634,29 +524,23 @@ struct SortFriendsByID void LLPanelFriends::refreshNames(U32 changed_mask) { - const uuid_vec_t selected_ids = mFriendsList->getSelectedIDs(); + const uuid_vec_t selected_ids = mFriendsList->getSelectedIDs(); S32 pos = mFriendsList->getScrollPos(); // get all buddies we know about LLAvatarTracker::buddy_map_t all_buddies; LLAvatarTracker::instance().copyBuddyList(all_buddies); - BOOL have_names = TRUE; - - if(changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE)) + if (changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE)) { - have_names &= refreshNamesSync(all_buddies); + refreshNamesSync(all_buddies); } - if(changed_mask & LLFriendObserver::ONLINE) + if (changed_mask & LLFriendObserver::ONLINE) { - have_names &= refreshNamesPresence(all_buddies); + refreshNamesPresence(all_buddies); } - if (!have_names) - { - mEventTimer.start(); - } // Changed item in place, need to request sort and update columns // because we might have changed data in a column on which the user // has already sorted. JC @@ -667,41 +551,30 @@ void LLPanelFriends::refreshNames(U32 changed_mask) mFriendsList->setScrollPos(pos); } -BOOL LLPanelFriends::refreshNamesSync(const LLAvatarTracker::buddy_map_t & all_buddies) +void LLPanelFriends::refreshNamesSync(const LLAvatarTracker::buddy_map_t& all_buddies) { mNumOnline = 0; mFriendsList->deleteAllItems(); - BOOL have_names = TRUE; - LLAvatarTracker::buddy_map_t::const_iterator buddy_it = all_buddies.begin(); - - for(; buddy_it != all_buddies.end(); ++buddy_it) + for(LLAvatarTracker::buddy_map_t::const_iterator buddy_it = all_buddies.begin(); buddy_it != all_buddies.end(); ++buddy_it) { - have_names &= addFriend(buddy_it->first); + addFriend(buddy_it->first); } - - return have_names; } -BOOL LLPanelFriends::refreshNamesPresence(const LLAvatarTracker::buddy_map_t & all_buddies) +void LLPanelFriends::refreshNamesPresence(const LLAvatarTracker::buddy_map_t& all_buddies) { std::vector items = mFriendsList->getAllData(); std::sort(items.begin(), items.end(), SortFriendsByID()); LLAvatarTracker::buddy_map_t::const_iterator buddy_it = all_buddies.begin(); std::vector::const_iterator item_it = items.begin(); - BOOL have_names = TRUE; - while(true) + while(item_it != items.end() && buddy_it != all_buddies.end()) { - if(item_it == items.end() || buddy_it == all_buddies.end()) - { - break; - } - - const LLUUID & buddy_uuid = buddy_it->first; - const LLUUID & item_uuid = (*item_it)->getValue().asUUID(); - if(item_uuid == buddy_uuid) + const LLUUID& buddy_uuid = buddy_it->first; + const LLUUID& item_uuid = (*item_it)->getValue().asUUID(); + if (item_uuid == buddy_uuid) { const LLRelationship* info = buddy_it->second; if (!info) @@ -709,18 +582,18 @@ BOOL LLPanelFriends::refreshNamesPresence(const LLAvatarTracker::buddy_map_t & a ++item_it; continue; } - + S32 last_change_generation = (*item_it)->getColumn(LIST_FRIEND_UPDATE_GEN)->getValue().asInteger(); if (last_change_generation < info->getChangeSerialNum()) { // update existing item in UI - have_names &= updateFriendItem(buddy_it->first, info); + updateFriendItem(buddy_it->first, info); } ++buddy_it; ++item_it; } - else if(item_uuid < buddy_uuid) + else if (item_uuid < buddy_uuid) { ++item_it; } @@ -729,199 +602,110 @@ BOOL LLPanelFriends::refreshNamesPresence(const LLAvatarTracker::buddy_map_t & a ++buddy_it; } } - - return have_names; } + // meal disk void LLPanelFriends::refreshUI() -{ - BOOL single_selected = FALSE; - BOOL multiple_selected = FALSE; - int num_selected = mFriendsList->getAllSelected().size(); - if(num_selected > 0) +{ + bool single_selected = false; + bool multiple_selected = false; + size_t num_selected = mFriendsList->getAllSelected().size(); + if (num_selected) { - single_selected = TRUE; - if(num_selected > 1) + single_selected = true; + if (num_selected > 1) { - multiple_selected = TRUE; + multiple_selected = true; } } //Options that can only be performed with one friend selected - childSetEnabled("profile_btn", single_selected && !multiple_selected); - childSetEnabled("pay_btn", single_selected && !multiple_selected); - //childSetEnabled("assign_btn", single_selected && !multiple_selected); + getChildView("pay_btn")->setEnabled(single_selected && !multiple_selected); + //getChildView("assign_btn")->setEnabled(single_selected && !multiple_selected); - //Options that can be performed with up to MAX_FRIEND_SELECT friends selected + //Options that can be performed with multiple friends selected //(single_selected will always be true in this situations) - childSetEnabled("remove_btn", single_selected); - childSetEnabled("im_btn", single_selected); - //childSetEnabled("friend_rights", single_selected); Making Dummy View -HgB + getChildView("profile_btn")->setEnabled(single_selected); + getChildView("remove_btn")->setEnabled(single_selected); + getChildView("im_btn")->setEnabled(single_selected); + //getChildView("friend_rights")->setEnabled(single_selected); Making Dummy View -HgB refreshRightsChangeList(); } -// static -void LLPanelFriends::onSelectName(LLUICtrl* ctrl, void* user_data) +void LLPanelFriends::onSelectName() { - LLPanelFriends* panelp = (LLPanelFriends*)user_data; - - if(panelp) - { - panelp->refreshUI(); - // check to see if rights have changed - panelp->applyRightsToFriends(); - } + refreshUI(); + // check to see if rights have changed + applyRightsToFriends(); } -// static -void LLPanelFriends::onClickProfile(void* user_data) +void LLPanelFriends::updateColumns(bool collapsed) { - LLPanelFriends* panelp = (LLPanelFriends*)user_data; - - //llinfos << "LLPanelFriends::onClickProfile()" << llendl; - const uuid_vec_t ids = panelp->mFriendsList->getSelectedIDs(); - if(!ids.empty()) - { - LLAvatarActions::showProfile(ids[0]); - } + //llinfos << "Refreshing UI" << llendl; + S32 width = collapsed ? 0 : 22; + LLScrollListColumn* column = mFriendsList->getColumn(5); + mFriendsList->updateStaticColumnWidth(column, width); + column->setWidth(width); + column = mFriendsList->getColumn(6); + mFriendsList->updateStaticColumnWidth(column, width); + column->setWidth(width); + column = mFriendsList->getColumn(7); + mFriendsList->updateStaticColumnWidth(column, width); + column->setWidth(width); + mFriendsList->updateLayout(); + if (!collapsed) updateFriends(LLFriendObserver::ADD); } -// static -/*void LLPanelFriends::onClickAssign(void* user_data) +void LLPanelFriends::onClickIM(const uuid_vec_t& ids) { - LLPanelFriends* panelp = (LLPanelFriends*)user_data; - if (panelp) - { - const uuid_vec_t ids = panelp->mFriendsList->getSelectedIDs(); - ASFloaterContactGroups::show(ids); - } -}*/ - -// static -void LLPanelFriends::onClickExpand(void* user_data) -{ - BOOL collapsed = gSavedSettings.getBOOL("ContactListCollapsed"); - gSavedSettings.setBOOL("ContactListCollapsed", !collapsed); - updateColumns(user_data); -} - -void LLPanelFriends::updateColumns(void* user_data) -{ - LLPanelFriends* panelp = (LLPanelFriends*)user_data; - if (panelp) - { - LLButton* expand_button = panelp->getChild("expand_collapse_btn"); - LLScrollListCtrl* list = panelp->getChild("friend_list"); - //llinfos << "Refreshing UI" << llendl; - S32 width = 22; - std::string button = ">"; - if (gSavedSettings.getBOOL("ContactListCollapsed")) - { - width = 0; - button = "<"; - } - expand_button->setLabel(button); - LLScrollListColumn* column = list->getColumn(5); - list->updateStaticColumnWidth(column, width); - column->setWidth(width); - column = list->getColumn(6); - list->updateStaticColumnWidth(column, width); - column->setWidth(width); - column = list->getColumn(7); - list->updateStaticColumnWidth(column, width); - column->setWidth(width); - list->updateLayout(); - if (!gSavedSettings.getBOOL("ContactListCollapsed")) - { - panelp->updateFriends(LLFriendObserver::ADD); - } - } -} - -void LLPanelFriends::onClickIM(void* user_data) -{ - LLPanelFriends* panelp = (LLPanelFriends*)user_data; - //llinfos << "LLPanelFriends::onClickIM()" << llendl; - const uuid_vec_t ids = panelp->mFriendsList->getSelectedIDs(); - if(!ids.empty()) - { - if(ids.size() == 1) - { - LLAvatarActions::startIM(ids[0]); - } - else - { - LLAvatarActions::startConference(ids); - } - } + if (!ids.empty()) + ids.size() == 1 ? LLAvatarActions::startIM(ids[0]) : LLAvatarActions::startConference(ids); } // static -void LLPanelFriends::onPickAvatar( const uuid_vec_t& ids, - const std::vector& names ) +void LLPanelFriends::onPickAvatar(const uuid_vec_t& ids, const std::vector& names) { - if (names.empty()) return; - if (ids.empty()) return; + if (names.empty() || ids.empty()) return; LLAvatarActions::requestFriendshipDialog(ids[0], names[0].getCompleteName()); } -// static -void LLPanelFriends::onClickAddFriend(void* user_data) +void LLPanelFriends::onClickAddFriend() { - LLPanelFriends* panelp = (LLPanelFriends*)user_data; - LLFloater* root_floater = gFloaterView->getParentFloater(panelp); - LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLPanelFriends::onPickAvatar, _1, _2), FALSE, TRUE); - if (root_floater) - { - root_floater->addDependentFloater(picker); - } + if (LLFloater* root_floater = gFloaterView->getParentFloater(this)) + root_floater->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelFriends::onPickAvatar, _1, _2), false, true)); } -void LLPanelFriends::onClickExport(void* user_data) +/* Singu Note: We don't currently use these. +void LLPanelFriends::onClickExport() { std::string agn; gAgent.getName(agn); AIFilePicker* filepicker = AIFilePicker::create(); filepicker->open(agn + ".friendlist", FFSAVE_ALL); - filepicker->run(boost::bind(&LLPanelFriends::onClickExport_continued, user_data, filepicker)); + filepicker->run(boost::bind(&LLPanelFriends::onClickExport_continued, this, filepicker)); } -void LLPanelFriends::onClickExport_continued(void* user_data, AIFilePicker* filepicker) +void LLPanelFriends::onClickExport_continued(AIFilePicker* filepicker) { - if(!filepicker->hasFilename()) - { - // User canceled save. - return; - } - std::string const filename = filepicker->getFilename(); - LLPanelFriends* panelp = (LLPanelFriends*)user_data; - std::vector selected = panelp->mFriendsList->getAllData();//->getAllSelected(); + if(!filepicker->hasFilename()) return; + + const std::string filename(filepicker->getFilename()); + std::vector selected = mFriendsList->getAllData(); LLSD llsd; - //U32 count = 0; - //std::string friendlist; - for(std::vector::iterator itr = selected.begin(); itr != selected.end(); ++itr) + for(std::vector::const_iterator itr = selected.begin(); itr != selected.end(); ++itr) { - LLSD fraind; - std::string friend_name = (*itr)->getColumn(LIST_FRIEND_NAME)->getValue().asString(); - std::string friend_uuid = (*itr)->getUUID().asString(); - bool show_online_status = (*itr)->getColumn(LIST_VISIBLE_ONLINE)->getValue().asBoolean(); - bool show_map_location = (*itr)->getColumn(LIST_VISIBLE_MAP)->getValue().asBoolean(); - bool allow_modify_objects = (*itr)->getColumn(LIST_EDIT_MINE)->getValue().asBoolean(); - fraind["name"] = friend_name; - fraind["see_online"] = show_online_status; - fraind["can_map"] = show_map_location; - fraind["can_mod"] = allow_modify_objects; - //friendlist += friend_name+"|"+friend_uuid+"|"+show_online_status+"|"+show_map_location+"|"+allow_modify_objects+"\n"; - llsd[friend_uuid] = fraind; - //count += 1; + const LLScrollListItem* it(*itr); + LLSD& fraind = llsd[it->getUUID().asString()]; + fraind["name"] = it->getColumn(LIST_FRIEND_NAME)->getValue().asString(); + fraind["see_online"] = it->getColumn(LIST_VISIBLE_ONLINE)->getValue().asBoolean(); + fraind["can_map"] = it->getColumn(LIST_VISIBLE_MAP)->getValue().asBoolean(); + fraind["can_mod"] = it->getColumn(LIST_EDIT_MINE)->getValue().asBoolean(); } - std::string grid_uri = gHippoGridManager->getConnectedGrid()->getLoginUri(); - //LLStringUtil::toLower(uris[0]); - llsd["GRID"] = grid_uri; + llsd["GRID"] = gHippoGridManager->getConnectedGrid()->getLoginUri(); llofstream export_file; export_file.open(filename); @@ -953,7 +737,7 @@ void LLPanelFriends::onClickImport_filepicker_continued(AIFilePicker* filepicker if(data.has("GRID")) { std::string grid = gHippoGridManager->getConnectedGrid()->getLoginUri(); - if(grid != data["GRID"])return; + if (grid != data["GRID"])return; data.erase("GRID"); } @@ -964,24 +748,22 @@ void LLPanelFriends::onClickImport_filepicker_continued(AIFilePicker* filepicker #endif std::string importstate = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "friendimportstate.dat"); - + llifstream stateload(importstate); LLSD importstatellsd; LLSDSerialize::fromXMLDocument(importstatellsd, stateload); static bool merging; - //LLMessageSystem* msg = gMessageSystem; LLSD newdata; - LLSD::map_const_iterator iter; - for(iter = data.beginMap(); iter != data.endMap(); ++iter) + for(LLSD::map_const_iterator iter = data.beginMap(); iter != data.endMap(); ++iter) {//first= var second = val LLSD content = iter->second; - if(!content.has("name"))continue; - if(!content.has("see_online"))continue; - if(!content.has("can_map"))continue; - if(!content.has("can_mod"))continue; + if (!content.has("name")) continue; + if (!content.has("see_online")) continue; + if (!content.has("can_map")) continue; + if (!content.has("can_mod")) continue; LLUUID agent_id = LLUUID(iter->first); if(merging && importstatellsd.has(agent_id.asString()))continue;//dont need to request what we've already requested from another list import and have not got a reply yet @@ -992,19 +774,13 @@ void LLPanelFriends::onClickImport_filepicker_continued(AIFilePicker* filepicker if(merging)importstatellsd[agent_id.asString()] = content;//MERGEEEE LLAvatarActions::requestFriendship(agent_id, agent_name, "Imported from "+file); newdata[iter->first] = iter->second; - }else - { - //data.erase(iter->first); - //--iter;//god help us all } } - data = newdata; - newdata = LLSD(); if(!merging) { merging = true;//this hack is to support importing multiple account lists without spamming users but considering LLs fail in forcing silent declines - importstatellsd = data; + importstatellsd = newdata; } llofstream export_file; @@ -1027,14 +803,11 @@ void LLPanelFriends::FriendImportState(LLUUID id, bool accepted) LLSD user = data[id.asString()]; if(accepted) { - BOOL can_map = user["can_map"].asBoolean(); - BOOL can_mod = user["can_mod"].asBoolean(); - BOOL see_online = user["see_online"].asBoolean(); S32 rights = 0; - if(can_map)rights |= LLRelationship::GRANT_MAP_LOCATION; - if(can_mod)rights |= LLRelationship::GRANT_MODIFY_OBJECTS; - if(see_online)rights |= LLRelationship::GRANT_ONLINE_STATUS; - if(LLAvatarActions::isFriend(id))//is this legit shit yo + if (user["can_map"].asBoolean()) rights |= LLRelationship::GRANT_MAP_LOCATION; + if (user["can_mod"].asBoolean()) rights |= LLRelationship::GRANT_MODIFY_OBJECTS; + if (user["see_online"].asBoolean()) rights |= LLRelationship::GRANT_ONLINE_STATUS; + if (LLAvatarActions::isFriend(id)) //is this legit shit yo { const LLRelationship* friend_status = LLAvatarTracker::instance().getBuddyInfo(id); if(friend_status) @@ -1045,8 +818,8 @@ void LLPanelFriends::FriendImportState(LLUUID id, bool accepted) LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_GrantUserRights); msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUID(_PREHASH_AgentID, gAgent.getID()); - msg->addUUID(_PREHASH_SessionID, gAgent.getSessionID()); + msg->addUUID(_PREHASH_AgentID, gAgentID); + msg->addUUID(_PREHASH_SessionID, gAgentSessionID); msg->nextBlockFast(_PREHASH_Rights); msg->addUUID(_PREHASH_AgentRelated, id); msg->addS32(_PREHASH_RelatedRights, rights); @@ -1063,27 +836,12 @@ void LLPanelFriends::FriendImportState(LLUUID id, bool accepted) export_file.close(); } } - -// static -void LLPanelFriends::onClickPay(void* user_data) -{ - LLPanelFriends* panelp = (LLPanelFriends*)user_data; - - const uuid_vec_t ids = panelp->mFriendsList->getSelectedIDs(); - if(!ids.empty()) - { - LLAvatarActions::pay(ids[0]); - } -} +*/ void LLPanelFriends::confirmModifyRights(rights_map_t& rights, EGrantRevoke command) { if (rights.empty()) return; - // Make a copy on the heap: rights is allocated on the stack. - // This copy will be deleted in LLPanelFriends::modifyRightsConfirmation. - rights_map_t* heap_rights = new rights_map_t(rights); - // for single friend, show their name if (rights.size() == 1) { @@ -1092,52 +850,29 @@ void LLPanelFriends::confirmModifyRights(rights_map_t& rights, EGrantRevoke comm if (LLAvatarNameCache::getPNSName(rights.begin()->first, fullname, friend_name_system())) args["NAME"] = fullname; - if (command == GRANT) - { - LLNotificationsUtil::add("GrantModifyRights", - args, - LLSD(), - boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights)); - } - else - { - LLNotificationsUtil::add("RevokeModifyRights", - args, - LLSD(), - boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights)); - } + LLNotificationsUtil::add(command == GRANT ? "GrantModifyRights" : "RevokeModifyRights", + args, LLSD(), + boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights)); } else { - if (command == GRANT) - { - LLNotificationsUtil::add("GrantModifyRightsMultiple", - LLSD(), - LLSD(), - boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights)); - } - else - { - LLNotificationsUtil::add("RevokeModifyRightsMultiple", - LLSD(), - LLSD(), - boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights)); - } + LLNotificationsUtil::add(command == GRANT ? "GrantModifyRightsMultiple" : "RevokeModifyRightsMultiple", + LLSD(), LLSD(), + boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights)); } } -bool LLPanelFriends::modifyRightsConfirmation(const LLSD& notification, const LLSD& response, rights_map_t* rights) +bool LLPanelFriends::modifyRightsConfirmation(const LLSD& notification, const LLSD& response, rights_map_t rights) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if(0 == option) { - sendRightsGrant(*rights); + sendRightsGrant(rights); } else { // need to resync view with model, since user cancelled operation - rights_map_t::iterator rights_it; - for (rights_it = rights->begin(); rights_it != rights->end(); ++rights_it) + for (rights_map_t::iterator rights_it = rights.begin(); rights_it != rights.end(); ++rights_it) { const LLRelationship* info = LLAvatarTracker::instance().getBuddyInfo(rights_it->first); updateFriendItem(rights_it->first, info); @@ -1145,18 +880,15 @@ bool LLPanelFriends::modifyRightsConfirmation(const LLSD& notification, const LL } refreshUI(); - delete rights; return false; } void LLPanelFriends::applyRightsToFriends() { - BOOL rights_changed = FALSE; - // store modify rights separately for confirmation rights_map_t rights_updates; - BOOL need_confirmation = FALSE; + bool need_confirmation = false; EGrantRevoke confirmation_type = GRANT; // this assumes that changes only happened to selected items @@ -1165,17 +897,18 @@ void LLPanelFriends::applyRightsToFriends() { LLUUID id = (*itr)->getValue(); const LLRelationship* buddy_relationship = LLAvatarTracker::instance().getBuddyInfo(id); - if (buddy_relationship == NULL) continue; + if (!buddy_relationship) continue; bool show_online_staus = (*itr)->getColumn(LIST_VISIBLE_ONLINE)->getValue().asBoolean(); bool show_map_location = (*itr)->getColumn(LIST_VISIBLE_MAP)->getValue().asBoolean(); bool allow_modify_objects = (*itr)->getColumn(LIST_EDIT_MINE)->getValue().asBoolean(); + bool rights_changed(false); S32 rights = buddy_relationship->getRightsGrantedTo(); - if(buddy_relationship->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS) != show_online_staus) + if (buddy_relationship->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS) != show_online_staus) { - rights_changed = TRUE; - if(show_online_staus) + rights_changed = true; + if (show_online_staus) { rights |= LLRelationship::GRANT_ONLINE_STATUS; } @@ -1185,19 +918,19 @@ void LLPanelFriends::applyRightsToFriends() rights &= ~LLRelationship::GRANT_ONLINE_STATUS; rights &= ~LLRelationship::GRANT_MAP_LOCATION; // propagate rights constraint to UI - (*itr)->getColumn(LIST_VISIBLE_MAP)->setValue(FALSE); + (*itr)->getColumn(LIST_VISIBLE_MAP)->setValue(false); mFriendsList->setNeedsSortColumn(LIST_VISIBLE_MAP); } } - if(buddy_relationship->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION) != show_map_location) + if (buddy_relationship->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION) != show_map_location) { - rights_changed = TRUE; - if(show_map_location) + rights_changed = true; + if (show_map_location) { // ONLINE_STATUS necessary for MAP_LOCATION rights |= LLRelationship::GRANT_MAP_LOCATION; rights |= LLRelationship::GRANT_ONLINE_STATUS; - (*itr)->getColumn(LIST_VISIBLE_ONLINE)->setValue(TRUE); + (*itr)->getColumn(LIST_VISIBLE_ONLINE)->setValue(true); mFriendsList->setNeedsSortColumn(LIST_VISIBLE_ONLINE); } else @@ -1207,12 +940,12 @@ void LLPanelFriends::applyRightsToFriends() } // now check for change in modify object rights, which requires confirmation - if(buddy_relationship->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS) != allow_modify_objects) + if (buddy_relationship->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS) != allow_modify_objects) { - rights_changed = TRUE; - need_confirmation = TRUE; + rights_changed = true; + need_confirmation = true; - if(allow_modify_objects) + if (allow_modify_objects) { rights |= LLRelationship::GRANT_MODIFY_OBJECTS; confirmation_type = GRANT; @@ -1229,7 +962,7 @@ void LLPanelFriends::applyRightsToFriends() rights_updates.insert(std::make_pair(id, rights)); // disable these ui elements until response from server // to avoid race conditions - (*itr)->setEnabled(FALSE); + (*itr)->setEnabled(false); } } @@ -1253,8 +986,8 @@ void LLPanelFriends::sendRightsGrant(rights_map_t& ids) // setup message header msg->newMessageFast(_PREHASH_GrantUserRights); msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUID(_PREHASH_AgentID, gAgent.getID()); - msg->addUUID(_PREHASH_SessionID, gAgent.getSessionID()); + msg->addUUID(_PREHASH_AgentID, gAgentID); + msg->addUUID(_PREHASH_SessionID, gAgentSessionID); rights_map_t::iterator id_it; rights_map_t::iterator end_it = ids.end(); @@ -1265,6 +998,5 @@ void LLPanelFriends::sendRightsGrant(rights_map_t& ids) msg->addS32(_PREHASH_RelatedRights, id_it->second); } - mNumRightsChanged = ids.size(); gAgent.sendReliableMessage(); } diff --git a/indra/newview/llfloaterfriends.h b/indra/newview/llfloaterfriends.h index c82db7886..2fddc7b63 100644 --- a/indra/newview/llfloaterfriends.h +++ b/indra/newview/llfloaterfriends.h @@ -38,15 +38,14 @@ #include "llpanel.h" #include "llstring.h" #include "lluuid.h" -#include "lleventtimer.h" + #include "llcallingcard.h" class LLAvatarName; class LLFriendObserver; class LLRelationship; -class LLScrollListItem; class LLScrollListCtrl; -class AIFilePicker; +class LLScrollListItem; /** * @class LLPanelFriends @@ -55,19 +54,12 @@ class AIFilePicker; * * @sa LLFloater */ -class LLPanelFriends : public LLPanel, public LLEventTimer +class LLPanelFriends : public LLPanel { public: LLPanelFriends(); virtual ~LLPanelFriends(); - /** - * @brief This method either creates or brings to the front the - * current instantiation of this floater. There is only once since - * you can currently only look at your local friends. - */ - virtual BOOL tick(); - /** * @brief This method is called in response to the LLAvatarTracker * sending out a changed() message. @@ -99,16 +91,16 @@ private: // Contacts search and group system void filterContacts(const std::string& search_name); void categorizeContacts(); - void setContactGroup(std::string contact_grp); - std::string cleanFileName(std::string filename); + void setContactGroup(const std::string& contact_grp); + //std::string cleanFileName(std::string filename); // -- - BOOL refreshNamesSync(const LLAvatarTracker::buddy_map_t & all_buddies); - BOOL refreshNamesPresence(const LLAvatarTracker::buddy_map_t & all_buddies); + void refreshNamesSync(const LLAvatarTracker::buddy_map_t & all_buddies); + void refreshNamesPresence(const LLAvatarTracker::buddy_map_t & all_buddies); void refreshUI(); void refreshRightsChangeList(); void applyRightsToFriends(); - BOOL addFriend(const LLUUID& agent_id); - BOOL updateFriendItem(const LLUUID& agent_id, const LLRelationship* relationship); + void addFriend(const LLUUID& agent_id); + void updateFriendItem(const LLUUID& agent_id, const LLRelationship* relationship); typedef enum { @@ -119,27 +111,22 @@ private: void sendRightsGrant(rights_map_t& ids); // callback methods - static void onSelectName(LLUICtrl* ctrl, void* user_data); - static void onChangeContactGroup(LLUICtrl* ctrl, void* user_data); - static void onPickAvatar(const uuid_vec_t& ids, const std::vector& names ); - void onContactFilterEdit(const std::string& search_string); - static void onClickIM(void* user_data); - static void onClickAssign(void* user_data); - static void onClickExpand(void* user_data); - static void updateColumns(void* user_data); - static void onClickProfile(void* user_data); - static void onClickAddFriend(void* user_data); - static void onClickExport(void* user_data); - static void onClickExport_continued(void* user_data, AIFilePicker* filepicker); - static void onClickImport(void* user_data); - static void onClickImport_filepicker_continued(AIFilePicker* filepicker); + void onSelectName(); + static void onPickAvatar(const uuid_vec_t& ids, const std::vector& names); + void onClickIM(const uuid_vec_t& ids); + void updateColumns(bool collapsed); + void onClickAddFriend(); +/* + void onClickExport(); + void onClickExport_continued(class AIFilePicker* filepicker); + void onClickImport(); + void onClickImport_filepicker_continued(AIFilePicker* filepicker); +*/ public: static void FriendImportState(LLUUID id, bool accepted); private: - static void onClickPay(void* user_data); - static void onClickModifyStatus(LLUICtrl* ctrl, void* user_data); - bool modifyRightsConfirmation(const LLSD& notification, const LLSD& response, rights_map_t* rights); + bool modifyRightsConfirmation(const LLSD& notification, const LLSD& response, rights_map_t rights); private: // member data @@ -147,13 +134,8 @@ private: LLUUID mAddFriendID; std::string mAddFriendName; LLScrollListCtrl* mFriendsList; - std::string mContactFilter; - BOOL mShowMaxSelectWarning; - BOOL mAllowRightsChange; - S32 mNumRightsChanged; S32 mNumOnline; std::string mLastContactSearch; }; - #endif // LL_LLFLOATERFRIENDS_H diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index 8cb6681ba..8be4611bf 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -185,7 +185,7 @@ LLPanelGroups::~LLPanelGroups() // clear the group list, and get a fresh set of info. void LLPanelGroups::reset() { - getChild("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.count())); + getChild("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.size())); getChild("groupcount")->setTextArg("[MAX]", llformat("%d", gHippoLimits->getMaxAgentGroups())); init_group_list(getChild("group list"), gAgent.getGroupID()); @@ -194,7 +194,7 @@ void LLPanelGroups::reset() BOOL LLPanelGroups::postBuild() { - getChild("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.count())); + getChild("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.size())); getChild("groupcount")->setTextArg("[MAX]", llformat("%d",gHippoLimits->getMaxAgentGroups())); LLScrollListCtrl *list = getChild("group list"); @@ -231,7 +231,7 @@ BOOL LLPanelGroups::postBuild() void LLPanelGroups::enableButtons() { - getChildView("Create")->setEnabled(gAgent.mGroups.count() < gHippoLimits->getMaxAgentGroups()); + getChildView("Create")->setEnabled(gAgent.canJoinGroups()); LLScrollListCtrl* group_list = getChild("group list"); if (!group_list) return; LLUUID group_id; @@ -368,7 +368,7 @@ LLSD create_group_element(const LLGroupData *group_datap, const LLUUID &active_g void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 powers_mask) { - S32 count = gAgent.mGroups.count(); + S32 count = gAgent.mGroups.size(); LLUUID id; LLCtrlListInterface *group_list = ctrl->getListInterface(); if (!group_list) return; @@ -381,7 +381,7 @@ void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 pow for(S32 i = 0; i < count; ++i) { - LLSD element = create_group_element(&gAgent.mGroups.get(i), highlight_id, powers_mask); + LLSD element = create_group_element(&gAgent.mGroups[i], highlight_id, powers_mask); if(element.size()) group_list->addElement(element, ADD_SORTED); } diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 874e45c49..488f32186 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -165,19 +165,39 @@ LLParcel* LLFloaterLand::getCurrentSelectedParcel() //static LLPanelLandObjects* LLFloaterLand::getCurrentPanelLandObjects() { - return LLFloaterLand::getInstance()->mPanelObjects; + LLFloaterLand* land_instance = LLFloaterLand::getInstance(); + if (land_instance) + { + return land_instance->mPanelObjects; + } + else + { + return NULL; + } } //static LLPanelLandCovenant* LLFloaterLand::getCurrentPanelLandCovenant() { - return LLFloaterLand::getInstance()->mPanelCovenant; + LLFloaterLand* land_instance = LLFloaterLand::getInstance(); + if (land_instance) + { + return land_instance->mPanelCovenant; + } + else + { + return NULL; + } } // static void LLFloaterLand::refreshAll() { - LLFloaterLand::getInstance()->refresh(); + LLFloaterLand* land_instance = LLFloaterLand::getInstance(); + if (land_instance) + { + land_instance->refresh(); + } } void LLFloaterLand::onOpen() @@ -763,6 +783,7 @@ void LLPanelLandGeneral::refresh() BOOL use_pass = parcel->getOwnerID()!= gAgent.getID() && parcel->getParcelFlag(PF_USE_PASS_LIST) && !LLViewerParcelMgr::getInstance()->isCollisionBanned();; mBtnBuyPass->setEnabled(use_pass); + } } @@ -857,11 +878,13 @@ void LLPanelLandGeneral::onClickProfile() if (parcel->getIsGroupOwned()) { - LLGroupActions::show(parcel->getGroupID()); + const LLUUID& group_id = parcel->getGroupID(); + LLGroupActions::show(group_id); } else { - LLAvatarActions::showProfile(parcel->getOwnerID()); + const LLUUID& avatar_id = parcel->getOwnerID(); + LLAvatarActions::showProfile(avatar_id); } } @@ -1538,7 +1561,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo BOOL is_group_owned; S32 object_count; U32 most_recent_time = 0; - BOOL is_online = 0; + BOOL is_online; std::string object_count_str; //BOOL b_need_refresh = FALSE; @@ -1553,7 +1576,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo std::vector avatar_ids; std::vector positions; LLWorld::instance().getAvatars(&avatar_ids, &positions, mypos, F32_MAX); - + for(S32 i = 0; i < rows; ++i) { msg->getUUIDFast(_PREHASH_Data, _PREHASH_OwnerID, owner_id, i); @@ -2834,11 +2857,12 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) void LLPanelLandAccess::onClickAddAccess() { + LLFloater* root_floater = gFloaterView->getParentFloater(this); LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show( boost::bind(&LLPanelLandAccess::callbackAvatarCBAccess, this, _1)); if (picker) { - gFloaterView->getParentFloater(this)->addDependentFloater(picker); + root_floater->addDependentFloater(picker); } } @@ -2882,11 +2906,12 @@ void LLPanelLandAccess::onClickRemoveAccess(void* data) void LLPanelLandAccess::onClickAddBanned() { + LLFloater* root_floater = gFloaterView->getParentFloater(this); LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show( boost::bind(&LLPanelLandAccess::callbackAvatarCBBanned, this, _1)); if (picker) { - gFloaterView->getParentFloater(this)->addDependentFloater(picker); + root_floater->addDependentFloater(picker); } } @@ -3064,15 +3089,15 @@ void LLFloaterLand::open() // Ideally we could just use LLViewerParcelMgr::isParcelOwnedByAgent(), but that has that sneaky exemption // for fake god like (aka View Admin Options) const LLUUID& idOwner = pParcel->getOwnerID(); - if ( (idOwner != gAgent.getID()) ) + if (idOwner != gAgentID) { // *sighs* LLAgent::hasPowerInGroup() has it too so copy/paste from there - S32 count = gAgent.mGroups.count(); bool fShow = false; + S32 count = gAgent.mGroups.size(); bool fShow = false; for (S32 i = 0; i < count; ++i) { - if (gAgent.mGroups.get(i).mID == idOwner) + if (gAgent.mGroups[i].mID == idOwner) { - fShow |= ((gAgent.mGroups.get(i).mPowers & GP_LAND_RETURN) > 0); + fShow |= ((gAgent.mGroups[i].mPowers & GP_LAND_RETURN) > 0); break; } } diff --git a/indra/newview/llfloaterlandholdings.cpp b/indra/newview/llfloaterlandholdings.cpp index 4949678c1..9046e768f 100644 --- a/indra/newview/llfloaterlandholdings.cpp +++ b/indra/newview/llfloaterlandholdings.cpp @@ -100,27 +100,26 @@ BOOL LLFloaterLandHoldings::postBuild() childSetAction("Teleport", onClickTeleport, this); childSetAction("Show on Map", onClickMap, this); - LLScrollListCtrl *grant_list = getChild("grant list"); - // Grant list + LLScrollListCtrl *grant_list = getChild("grant list"); grant_list->setDoubleClickCallback(boost::bind(LLGroupActions::show, boost::bind(&LLScrollListCtrl::getCurrentID, grant_list))); LLCtrlListInterface *list = grant_list->getListInterface(); if (!list) return TRUE; - S32 count = gAgent.mGroups.count(); + S32 count = gAgent.mGroups.size(); for(S32 i = 0; i < count; ++i) { - LLUUID id(gAgent.mGroups.get(i).mID); + LLUUID id(gAgent.mGroups.at(i).mID); LLSD element; element["id"] = id; element["columns"][0]["column"] = "group"; - element["columns"][0]["value"] = gAgent.mGroups.get(i).mName; + element["columns"][0]["value"] = gAgent.mGroups.at(i).mName; element["columns"][0]["font"] = "SANSSERIF"; LLUIString areastr = getString("area_string"); - areastr.setArg("[AREA]", llformat("%d", gAgent.mGroups.get(i).mContribution)); + areastr.setArg("[AREA]", llformat("%d", gAgent.mGroups.at(i).mContribution)); element["columns"][1]["column"] = "area"; element["columns"][1]["value"] = areastr; element["columns"][1]["font"] = "SANSSERIF"; @@ -128,6 +127,8 @@ BOOL LLFloaterLandHoldings::postBuild() list->addElement(element, ADD_SORTED); } + center(); + return TRUE; } @@ -157,8 +158,8 @@ void LLFloaterLandHoldings::refresh() enable_btns = TRUE; } - childSetEnabled("Teleport", enable_btns); - childSetEnabled("Show on Map", enable_btns); + getChildView("Teleport")->setEnabled(enable_btns); + getChildView("Show on Map")->setEnabled(enable_btns); refreshAggregates(); } @@ -291,15 +292,16 @@ void LLFloaterLandHoldings::buttonCore(S32 which) F64 global_z = gAgent.getPositionGlobal().mdV[VZ]; LLVector3d pos_global(global_x, global_y, global_z); + LLFloaterWorldMap* floater_world_map = gFloaterWorldMap; switch(which) { case 0: gAgent.teleportViaLocation(pos_global); - gFloaterWorldMap->trackLocation(pos_global); + if(floater_world_map) floater_world_map->trackLocation(pos_global); break; case 1: - gFloaterWorldMap->trackLocation(pos_global); + if(floater_world_map) floater_world_map->trackLocation(pos_global); LLFloaterWorldMap::show(true); break; default: @@ -329,7 +331,7 @@ void LLFloaterLandHoldings::refreshAggregates() S32 current_area = gStatusBar->getSquareMetersCommitted(); S32 available_area = gStatusBar->getSquareMetersLeft(); - childSetTextArg("allowed_text", "[AREA]", llformat("%d",allowed_area)); - childSetTextArg("current_text", "[AREA]", llformat("%d",current_area)); - childSetTextArg("available_text", "[AREA]", llformat("%d",available_area)); + getChild("allowed_text")->setTextArg("[AREA]", llformat("%d",allowed_area)); + getChild("current_text")->setTextArg("[AREA]", llformat("%d",current_area)); + getChild("available_text")->setTextArg("[AREA]", llformat("%d",available_area)); } diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index 7fe3311cb..f8c170063 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -41,7 +41,6 @@ #include "llavatarnamecache.h" #include "llbutton.h" #include "llcheckboxctrl.h" -#include "llenvmanager.h" #include "llfloater.h" #include "llfontgl.h" #include "llnotifications.h" @@ -84,7 +83,7 @@ void LLFloaterPathfindingObjects::onOpen(/*const LLSD &pKey*/) if (!mRegionBoundaryCrossingSlot.connected()) { - mRegionBoundaryCrossingSlot = LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLFloaterPathfindingObjects::onRegionBoundaryCrossed, this)); + mRegionBoundaryCrossingSlot = gAgent.addRegionChangedCallback(boost::bind(&LLFloaterPathfindingObjects::onRegionBoundaryCrossed, this)); } if (!mGodLevelChangeSlot.connected()) @@ -384,19 +383,31 @@ void LLFloaterPathfindingObjects::buildObjectsScrollList(const LLPathfindingObje void LLFloaterPathfindingObjects::addObjectToScrollList(const LLPathfindingObjectPtr pObjectPtr, const LLSD &pScrollListItemData) { - LLSD rowParams; - rowParams["id"] = pObjectPtr->getUUID(); + LLScrollListCell::Params cellParams; + //cellParams.font = LLFontGL::getFontSansSerif(); + + LLScrollListItem::Params rowParams; + rowParams.value = pObjectPtr->getUUID().asString(); llassert(pScrollListItemData.isArray()); - S32 idx = 0; for (LLSD::array_const_iterator cellIter = pScrollListItemData.beginArray(); cellIter != pScrollListItemData.endArray(); ++cellIter) { - rowParams["columns"][idx] = *cellIter; - idx++; + const LLSD &cellElement = *cellIter; + + llassert(cellElement.has("column")); + llassert(cellElement.get("column").isString()); + cellParams.column = cellElement.get("column").asString(); + + llassert(cellElement.has("value")); + llassert(cellElement.get("value").isString()); + cellParams.value = cellElement.get("value").asString(); + + rowParams.columns.add(cellParams); } - LLScrollListItem *scrollListItem = mObjectsScrollList->addElement(rowParams); + LLScrollListItem *scrollListItem = mObjectsScrollList->addRow(rowParams); + if (pObjectPtr->hasOwner() && !pObjectPtr->hasOwnerName()) { mMissingNameObjectsScrollListItems.insert(std::make_pair(pObjectPtr->getUUID().asString(), scrollListItem)); diff --git a/indra/newview/llfloaterregiondebugconsole.cpp b/indra/newview/llfloaterregiondebugconsole.cpp index 39404fa20..31699d9ea 100644 --- a/indra/newview/llfloaterregiondebugconsole.cpp +++ b/indra/newview/llfloaterregiondebugconsole.cpp @@ -37,10 +37,6 @@ #include "llviewerregion.h" #include "lluictrlfactory.h" -class AIHTTPTimeoutPolicy; -extern AIHTTPTimeoutPolicy asyncConsoleResponder_timeout; -extern AIHTTPTimeoutPolicy consoleResponder_timeout; - // Two versions of the sim console API are supported. // // SimConsole capability (deprecated): @@ -81,7 +77,6 @@ namespace { public: /*virtual*/ void httpFailure(void) { sConsoleReplySignal(UNABLE_TO_SEND_COMMAND); } - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return asyncConsoleResponder_timeout; } /*virtual*/ char const* getName(void) const { return "AsyncConsoleResponder"; } }; @@ -111,7 +106,6 @@ namespace } } - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return consoleResponder_timeout; } /*virtual*/ char const* getName(void) const { return "ConsoleResponder"; } LLTextEditor * mOutput; diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 7df8e5272..23db2f4e8 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -61,6 +61,7 @@ #include "llfloatergodtools.h" // for send_sim_wide_deletes() #include "llfloatertopobjects.h" // added to fix SL-32336 #include "llfloatergroups.h" +#include "llfloaterregiondebugconsole.h" #include "llfloatertelehub.h" #include "llinventorymodel.h" #include "lllineeditor.h" @@ -94,9 +95,6 @@ const S32 TERRAIN_TEXTURE_COUNT = 4; const S32 CORNER_COUNT = 4; -class AIHTTPTimeoutPolicy; -extern AIHTTPTimeoutPolicy estateChangeInfoResponder_timeout; - ///---------------------------------------------------------------------------- /// Local class declaration ///---------------------------------------------------------------------------- @@ -252,7 +250,7 @@ BOOL LLFloaterRegionInfo::postBuild() &processEstateOwnerRequest); // Request region info when agent region changes. - LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LLFloaterRegionInfo::requestRegionInfo, this)); + gAgent.addRegionChangedCallback(boost::bind(&LLFloaterRegionInfo::requestRegionInfo, this)); return TRUE; } @@ -269,6 +267,7 @@ void LLFloaterRegionInfo::onOpen() refreshFromRegion(gAgent.getRegion()); requestRegionInfo(); + requestMeshRezInfo(); LLFloater::onOpen(); } @@ -650,9 +649,10 @@ void LLPanelRegionInfo::initCtrl(const std::string& name) getChild(name)->setCommitCallback(boost::bind(&LLPanelRegionInfo::onChangeAnything, this)); } +// Singu TODO: Make this a callback registrar function instead. void LLPanelRegionInfo::initHelpBtn(const std::string& name, const std::string& xml_alert) { - childSetAction(name, boost::bind(&LLPanelRegionInfo::onClickHelp, this, xml_alert)); + getChild(name)->setCommitCallback(boost::bind(&LLPanelRegionInfo::onClickHelp, this, xml_alert)); } void LLPanelRegionInfo::onClickHelp(const std::string& xml_alert) @@ -857,6 +857,46 @@ bool LLPanelRegionGeneralInfo::onMessageCommit(const LLSD& notification, const L return false; } +class ConsoleRequestResponder : public LLHTTPClient::ResponderIgnoreBody +{ + LOG_CLASS(ConsoleRequestResponder); +protected: + /*virtual*/ + void httpFailure() + { + llwarns << "error requesting mesh_rez_enabled " << dumpResponse() << llendl; + } + /*virtual*/ const char* getName() const { return "ConsoleRequestResponder"; } +}; + + +// called if this request times out. +class ConsoleUpdateResponder : public LLHTTPClient::ResponderIgnoreBody +{ + LOG_CLASS(ConsoleUpdateResponder); +protected: + /* virtual */ + void httpFailure() + { + llwarns << "error updating mesh enabled region setting " << dumpResponse() << llendl; + } +}; + +void LLFloaterRegionInfo::requestMeshRezInfo() +{ + std::string sim_console_url = gAgent.getRegion()->getCapability("SimConsoleAsync"); + + if (!sim_console_url.empty()) + { + std::string request_str = "get mesh_rez_enabled"; + + LLHTTPClient::post( + sim_console_url, + LLSD(request_str), + new ConsoleRequestResponder); + } +} + // setregioninfo // strings[0] = 'Y' - block terraform, 'N' - not // strings[1] = 'Y' - block fly, 'N' - not @@ -969,6 +1009,7 @@ BOOL LLPanelRegionDebugInfo::postBuild() childSetAction("top_scripts_btn", onClickTopScripts, this); childSetAction("restart_btn", onClickRestart, this); childSetAction("cancel_restart_btn", onClickCancelRestart, this); + childSetAction("region_debug_console_btn", onClickDebugConsole, this); return TRUE; } @@ -990,6 +1031,7 @@ bool LLPanelRegionDebugInfo::refreshFromRegion(LLViewerRegion* region) getChildView("top_scripts_btn")->setEnabled(allow_modify); getChildView("restart_btn")->setEnabled(allow_modify); getChildView("cancel_restart_btn")->setEnabled(allow_modify); + getChildView("region_debug_console_btn")->setEnabled(allow_modify); return LLPanelRegionInfo::refreshFromRegion(region); } @@ -1145,6 +1187,11 @@ void LLPanelRegionDebugInfo::onClickCancelRestart(void* data) self->sendEstateOwnerMessage(gMessageSystem, "restart", invoice, strings); } +// static +void LLPanelRegionDebugInfo::onClickDebugConsole(void* data) +{ + LLFloaterRegionDebugConsole::getInstance()->open(); +} BOOL LLPanelRegionTerrainInfo::validateTextureSizes() { @@ -1162,7 +1209,7 @@ BOOL LLPanelRegionTerrainInfo::validateTextureSizes() S32 width = img->getFullWidth(); S32 height = img->getFullHeight(); - //llinfos << "texture detail " << i << " is " << width << "x" << height << "x" << components << llendl; + //LL_INFOS() << "texture detail " << i << " is " << width << "x" << height << "x" << components << LL_ENDL; if (components != 3) { @@ -1173,7 +1220,7 @@ BOOL LLPanelRegionTerrainInfo::validateTextureSizes() return FALSE; } - if (width > 1024 || height > 1024) + if (width > 1024 || height > 1024) // { LLSD args; @@ -1590,7 +1637,7 @@ void LLPanelEstateInfo::onClickKickUser() void LLPanelEstateInfo::onKickUserCommit(const uuid_vec_t& ids, const std::vector& names) { if (names.empty() || ids.empty()) return; - + //check to make sure there is one valid user and id if( ids[0].isNull() ) { @@ -1794,7 +1841,7 @@ void LLPanelEstateInfo::accessAddCore3(const uuid_vec_t& ids, LLEstateAccessChan LLSD args; args["NUM_ADDED"] = llformat("%d",ids.size()); args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); - args["LIST_TYPE"] = "Allowed Residents"; + args["LIST_TYPE"] = LLTrans::getString("RegionInfoListTypeAllowedAgents"); args["NUM_EXCESS"] = llformat("%d",(ids.size()+currentCount)-ESTATE_MAX_ACCESS_IDS); LLNotificationsUtil::add("MaxAgentOnRegionBatch", args); delete change_info; @@ -1810,7 +1857,7 @@ void LLPanelEstateInfo::accessAddCore3(const uuid_vec_t& ids, LLEstateAccessChan LLSD args; args["NUM_ADDED"] = llformat("%d",ids.size()); args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); - args["LIST_TYPE"] = "Banned Residents"; + args["LIST_TYPE"] = LLTrans::getString("RegionInfoListTypeBannedAgents"); args["NUM_EXCESS"] = llformat("%d",(ids.size()+currentCount)-ESTATE_MAX_ACCESS_IDS); LLNotificationsUtil::add("MaxAgentOnRegionBatch", args); delete change_info; @@ -2337,16 +2384,18 @@ void LLPanelEstateInfo::getEstateOwner() class LLEstateChangeInfoResponder : public LLHTTPClient::ResponderWithResult { + LOG_CLASS(LLEstateChangeInfoResponder); public: LLEstateChangeInfoResponder(LLPanelEstateInfo* panel) { mpPanel = panel->getHandle(); } +protected: // if we get a normal response, handle it here - /*virtual*/ void httpSuccess(void) + virtual void httpSuccess() { - LL_INFOS("Windlight") << "Successfully committed estate info" << llendl; + LL_INFOS("Windlight") << "Successfully committed estate info" << LL_ENDL; // refresh the panel from the database LLPanelEstateInfo* panel = dynamic_cast(mpPanel.get()); @@ -2355,13 +2404,11 @@ public: } // if we get an error response - /*virtual*/ void httpFailure(void) + virtual void httpFailure() { - llinfos << "LLEstateChangeInfoResponder::error [status:" - << mStatus << "]: " << mReason << llendl; + LL_WARNS("Windlight") << dumpResponse() << LL_ENDL; } - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return estateChangeInfoResponder_timeout; } /*virtual*/ char const* getName(void) const { return "LLEstateChangeInfoResponder"; } private: @@ -2931,9 +2978,10 @@ bool LLDispatchSetEstateAccess::operator()( } - std::string msg = llformat("Banned residents: (%d, max %d)", - totalBannedAgents, - ESTATE_MAX_ACCESS_IDS); + LLStringUtil::format_map_t args; + args["[BANNEDAGENTS]"] = llformat("%d", totalBannedAgents); + args["[MAXBANNED]"] = llformat("%d", ESTATE_MAX_ACCESS_IDS); + std::string msg = LLTrans::getString("RegionInfoBannedResidents", args); panel->getChild("ban_resident_label")->setValue(LLSD(msg)); if (banned_agent_name_list) @@ -2953,9 +3001,10 @@ bool LLDispatchSetEstateAccess::operator()( if (access_flags & ESTATE_ACCESS_MANAGERS) { - std::string msg = llformat("Estate Managers: (%d, max %d)", - num_estate_managers, - ESTATE_MAX_MANAGERS); + LLStringUtil::format_map_t args; + args["[ESTATEMANAGERS]"] = llformat("%d", num_estate_managers); + args["[MAXMANAGERS]"] = llformat("%d", ESTATE_MAX_MANAGERS); + std::string msg = LLTrans::getString("RegionInfoEstateManagers", args); panel->getChild("estate_manager_label")->setValue(LLSD(msg)); LLNameListCtrl* estate_manager_name_list = @@ -3586,12 +3635,9 @@ void LLFloaterRegionInfo::open() // We'll allow access to the estate tools for estate managers (and for the sim owner) if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) { - LLViewerRegion* pRegion = gAgent.getRegion(); - if (!pRegion) - return; - + const LLViewerRegion* region(gAgent.getRegion()); // Should be able to call LLRegion::canManageEstate() but then we can fake god like - if ( (!pRegion->isEstateManager()) && (pRegion->getOwner() != gAgent.getID()) ) + if (!(region && region->isEstateManager() && region->getOwner() == gAgentID)) return; } diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 00c672b9d..128deaebe 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -95,11 +95,15 @@ public: virtual void refresh(); void requestRegionInfo(); + void requestMeshRezInfo(); + +private: protected: LLFloaterRegionInfo(const LLSD& seed); ~LLFloaterRegionInfo(); +protected: void onTabSelected(const LLSD& param); void refreshFromRegion(LLViewerRegion* region); @@ -211,6 +215,7 @@ protected: static void onClickRestart(void* data); bool callbackRestart(const LLSD& notification, const LLSD& response); static void onClickCancelRestart(void* data); + static void onClickDebugConsole(void* data); private: LLUUID mTargetAvatar; @@ -229,6 +234,7 @@ public: virtual BOOL postBuild(); // LLPanel virtual bool refreshFromRegion(LLViewerRegion* region); // refresh local settings from region update from simulator + void setEnvControls(bool available); // Whether environment settings are available for this region BOOL validateTextureSizes(); diff --git a/indra/newview/llfloaterregionrestarting.cpp b/indra/newview/llfloaterregionrestarting.cpp index a5eeeeecc..448b85216 100644 --- a/indra/newview/llfloaterregionrestarting.cpp +++ b/indra/newview/llfloaterregionrestarting.cpp @@ -31,7 +31,6 @@ #include "lluictrlfactory.h" #include "llagent.h" #include "llagentcamera.h" -#include "llenvmanager.h" #include "llviewercontrol.h" #include "llviewerwindow.h" @@ -103,31 +102,49 @@ LLFloaterRegionRestarting::LLFloaterRegionRestarting(const LLSD& key) : { //buildFromFile("floater_region_restarting.xml"); LLUICtrlFactory::getInstance()->buildFloater(this, "floater_region_restarting.xml"); - - LLStringUtil::format_map_t args; - args["[NAME]"] = key["NAME"].asString(); - getChild("region_name")->setValue(getString("RegionName", args)); - mRestartSeconds = getChild("restart_seconds"); + mName = key.has("NAME") ? key["NAME"].asString() : gAgent.getRegion()->getName(); // center(); - refresh(); - - mRegionChangedConnection = LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LLFloaterRegionRestarting::close, this, false)); - if (mSeconds <= 20) emergency_teleport(); // For emergency teleports } LLFloaterRegionRestarting::~LLFloaterRegionRestarting() { + if (sShakeState != SHAKE_DONE && sShakeState != SHAKE_START) // Finish shake if needed + { + gAgentCamera.resetView(TRUE, TRUE); + sShakeState = SHAKE_DONE; + } mRegionChangedConnection.disconnect(); } BOOL LLFloaterRegionRestarting::postBuild() { + mRegionChangedConnection = gAgent.addRegionChangedCallback(boost::bind(&LLFloaterRegionRestarting::regionChange, this)); + if (mSeconds <= 20) emergency_teleport(); // For emergency teleports + + LLStringUtil::format_map_t args; + std::string text; + + args["[NAME]"] = mName; + text = getString("RegionName", args); + LLTextBox* textbox = getChild("region_name"); + textbox->setValue(text); + + mRestartSeconds = getChild("restart_seconds"); + setBackgroundColor(gColors.getColor("NotifyCautionBoxColor")); sShakeState = SHAKE_START; + + refresh(); + return TRUE; } +void LLFloaterRegionRestarting::regionChange() +{ + close(); +} + BOOL LLFloaterRegionRestarting::tick() { refresh(); @@ -150,9 +167,9 @@ void LLFloaterRegionRestarting::draw() { LLFloater::draw(); - static const LLCachedControl alchemyRegionShake(gSavedSettings, "AlchemyRegionRestartShake", true); - if (!alchemyRegionShake || isMinimized()) // If we're minimized, leave the user alone - return; + static const LLCachedControl alchemyRegionShake(gSavedSettings, "AlchemyRegionRestartShake", true); + if (!alchemyRegionShake || isMinimized()) // If we're minimized, leave the user alone + return; const F32 SHAKE_INTERVAL = 0.025f; const F32 SHAKE_TOTAL_DURATION = 1.8f; // the length of the default alert tone for this @@ -213,16 +230,6 @@ void LLFloaterRegionRestarting::draw() } } -void LLFloaterRegionRestarting::onClose(bool app_quitting) -{ - if (sShakeState != SHAKE_DONE && sShakeState != SHAKE_START) // Finish shake if needed - { - gAgentCamera.resetView(TRUE, TRUE); - sShakeState = SHAKE_DONE; - } - LLFloater::onClose(app_quitting); -} - void LLFloaterRegionRestarting::updateTime(const U32& time) { mSeconds = time; diff --git a/indra/newview/llfloaterregionrestarting.h b/indra/newview/llfloaterregionrestarting.h index ee7cb1d30..663fe3809 100644 --- a/indra/newview/llfloaterregionrestarting.h +++ b/indra/newview/llfloaterregionrestarting.h @@ -45,10 +45,11 @@ private: virtual BOOL tick(); virtual void refresh(); virtual void draw(); - virtual void onClose(bool app_quitting); + virtual void regionChange(); class LLTextBox* mRestartSeconds; U32 mSeconds; + std::string mName; U32 mShakeIterations; F32 mShakeMagnitude; LLTimer mShakeTimer; diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 266beb7ce..29019118c 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -1426,7 +1426,7 @@ void LLSnapshotLivePreview::saveTexture() LLAssetStorage::LLStoreAssetCallback callback = &LLSnapshotLivePreview::saveTextureDone; S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); saveTextureUserData* user_data = new saveTextureUserData(this, sSnapshotIndex, gSavedSettings.getBOOL("TemporaryUpload")); - if (!upload_new_resource(tid, // tid + if (upload_new_resource(tid, // tid LLAssetType::AT_TEXTURE, "Snapshot : " + pos_string, "Taken by " + who_took_it + " at " + pos_string, @@ -1437,7 +1437,11 @@ void LLSnapshotLivePreview::saveTexture() LLFloaterPerms::getGroupPerms("Uploads"), // that is more permissive than other uploads LLFloaterPerms::getEveryonePerms("Uploads"), "Snapshot : " + pos_string, - callback, expected_upload_cost, user_data, &LLSnapshotLivePreview::saveTextureDone2)) + callback, expected_upload_cost, user_data)) + { + saveTextureDone2(true, user_data); + } + else { // Something went wrong. delete user_data; @@ -1787,7 +1791,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater, bool de child_list_t::const_iterator it, end=childs->end(); for (it=childs->begin(); it!=end; ++it) { - LLRadioCtrl *ctrl = dynamic_cast(*it); + LLView* ctrl = *it; if (ctrl && (ctrl->getName() == "texture")) { ctrl->setLabelArg("[UPLOADFEE]", fee); diff --git a/indra/newview/llfloatertest.cpp b/indra/newview/llfloatertest.cpp index 22628dc09..46d0978e7 100644 --- a/indra/newview/llfloatertest.cpp +++ b/indra/newview/llfloatertest.cpp @@ -81,8 +81,6 @@ private: LLIconCtrl* mIcon; LLLineEditor* mLineEditor; LLRadioGroup* mRadioGroup; - LLRadioCtrl* mRadio1; - LLRadioCtrl* mRadio2; LLScrollContainer* mScroll; LLScrollListCtrl* mScrollList; LLTabContainer* mTab; diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 5f27490cc..e621a2e40 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -547,6 +547,7 @@ void LLFloaterTools::refresh() std::string value_string; if ((prim_count == 1) && gSavedSettings.getBOOL("EditLinkedParts")) //Selecting a single prim in "Edit Linked" mode, show link number { + link_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectCost(); childSetTextArg("link_num_obj_count", "[DESC]", std::string("Link number:")); LLViewerObject* selected = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); diff --git a/indra/newview/llfoldervieweventlistener.h b/indra/newview/llfoldervieweventlistener.h index 39e96424a..62c7a67ec 100644 --- a/indra/newview/llfoldervieweventlistener.h +++ b/indra/newview/llfoldervieweventlistener.h @@ -82,7 +82,7 @@ public: virtual void pasteLinkFromClipboard() = 0; virtual void buildContextMenu(LLMenuGL& menu, U32 flags) = 0; virtual BOOL isUpToDate() const = 0; - virtual BOOL hasChildren() const = 0; + virtual bool hasChildren() const = 0; virtual LLInventoryType::EType getInventoryType() const = 0; virtual void performAction(LLInventoryModel* model, std::string action) = 0; virtual LLWearableType::EType getWearableType() const = 0; diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index 25885e68f..c5db73390 100644 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -128,36 +128,31 @@ bool LLGiveInventory::isInventoryGiveAcceptable(const LLInventoryItem* item) { return false; } - - + bool acceptable = true; switch(item->getType()) { - case LLAssetType::AT_CALLINGCARD: - acceptable = false; - break; case LLAssetType::AT_OBJECT: - // - /*if(my_avatar->isWearingAttachment(item->getUUID())) + /* + if (get_is_item_worn(item->getUUID())) { acceptable = false; - }*/ - // + } + */ break; case LLAssetType::AT_BODYPART: case LLAssetType::AT_CLOTHING: { // /*bool copyable = false; - if(item->getPermissions().allowCopyBy(gAgent.getID())) copyable = true; + if(item->getPermissions().allowCopyBy(gAgentID)) copyable = true; - if(!copyable && gAgentWearables.isWearingItem(item->getUUID())) + if (!copyable || get_is_item_worn(item->getUUID())) { acceptable = false; }*/ // } - break; default: break; @@ -185,20 +180,16 @@ bool LLGiveInventory::isInventoryGroupGiveAcceptable(const LLInventoryItem* item bool acceptable = true; - switch(item->getType()) { - case LLAssetType::AT_CALLINGCARD: - acceptable = false; - break; - // - /*case LLAssetType::AT_OBJECT: + case LLAssetType::AT_OBJECT: + /* if(gAgentAvatarp->isWearingAttachment(item->getUUID())) { acceptable = false; - }* - break;*/ - // + } + */ + break; default: break; } @@ -240,17 +231,25 @@ bool LLGiveInventory::doGiveInventoryItem(const LLUUID& to_agent, return res; } -void LLGiveInventory::doGiveInventoryCategory(const LLUUID& to_agent, +bool LLGiveInventory::doGiveInventoryCategory(const LLUUID& to_agent, const LLInventoryCategory* cat, - const LLUUID& im_session_id) + const LLUUID& im_session_id, + const std::string& notification_name) { - if (!cat) return; + if (!cat) + { + return false; + } llinfos << "LLGiveInventory::giveInventoryCategory() - " << cat->getUUID() << llendl; - if (!isAgentAvatarValid()) return; + if (!isAgentAvatarValid()) + { + return false; + } + bool give_successful = true; // Test out how many items are being given. LLViewerInventoryCategory::cat_array_t cats; LLViewerInventoryItem::item_array_t items; @@ -273,24 +272,24 @@ void LLGiveInventory::doGiveInventoryCategory(const LLUUID& to_agent, if(!complete) { LLNotificationsUtil::add("IncompleteInventory"); - return; + give_successful = false; } - count = items.count() + cats.count(); - if(count > MAX_ITEMS) - { + count = items.count() + cats.count(); + if(count > MAX_ITEMS) + { LLNotificationsUtil::add("TooManyItems"); - return; - } - else if(count == 0) - { + give_successful = false; + } + else if(count == 0) + { LLNotificationsUtil::add("NoItems"); - return; - } - else + give_successful = false; + } + else if (give_successful) { if(0 == giveable.countNoCopy()) { - LLGiveInventory::commitGiveInventoryCategory(to_agent, cat, im_session_id); + give_successful = LLGiveInventory::commitGiveInventoryCategory(to_agent, cat, im_session_id); } else { @@ -299,9 +298,16 @@ void LLGiveInventory::doGiveInventoryCategory(const LLUUID& to_agent, LLSD payload; payload["agent_id"] = to_agent; payload["folder_id"] = cat->getUUID(); + if (!notification_name.empty()) + { + payload["success_notification"] = notification_name; + } LLNotificationsUtil::add("CannotCopyCountItems", args, payload, &LLGiveInventory::handleCopyProtectedCategory); + give_successful = false; } } + + return give_successful; } ////////////////////////////////////////////////////////////////////////// @@ -358,6 +364,7 @@ bool LLGiveInventory::handleCopyProtectedItem(const LLSD& notification, const LL S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLSD itmes = notification["payload"]["items"]; LLInventoryItem* item = NULL; + bool give_successful = true; switch(option) { case 0: // "Yes" @@ -376,15 +383,21 @@ bool LLGiveInventory::handleCopyProtectedItem(const LLSD& notification, const LL else { LLNotificationsUtil::add("CannotGiveItem"); + give_successful = false; } } + if (give_successful && notification["payload"]["success_notification"].isDefined()) + { + LLNotificationsUtil::add(notification["payload"]["success_notification"].asString()); + } break; default: // no, cancel, whatever, who cares, not yes. LLNotificationsUtil::add("TransactionCancelled"); + give_successful = false; break; } - return false; + return give_successful; } // static @@ -419,6 +432,7 @@ void LLGiveInventory::commitGiveInventoryItem(const LLUUID& to_agent, bucket, BUCKET_SIZE); gAgent.sendReliableMessage(); + // if (gSavedSettings.getBOOL("BroadcastViewerEffects")) { @@ -444,13 +458,14 @@ bool LLGiveInventory::handleCopyProtectedCategory(const LLSD& notification, cons { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLInventoryCategory* cat = NULL; + bool give_successful = true; switch(option) { case 0: // "Yes" cat = gInventory.getCategory(notification["payload"]["folder_id"].asUUID()); if(cat) { - LLGiveInventory::commitGiveInventoryCategory(notification["payload"]["agent_id"].asUUID(), + give_successful = LLGiveInventory::commitGiveInventoryCategory(notification["payload"]["agent_id"].asUUID(), cat); LLViewerInventoryCategory::cat_array_t cats; LLViewerInventoryItem::item_array_t items; @@ -466,27 +481,37 @@ bool LLGiveInventory::handleCopyProtectedCategory(const LLSD& notification, cons gInventory.deleteObject(items.get(i)->getUUID()); } gInventory.notifyObservers(); + + if (give_successful && notification["payload"]["success_notification"].isDefined()) + { + LLNotificationsUtil::add(notification["payload"]["success_notification"].asString()); + } } else { LLNotificationsUtil::add("CannotGiveCategory"); + give_successful = false; } break; default: // no, cancel, whatever, who cares, not yes. LLNotificationsUtil::add("TransactionCancelled"); + give_successful = false; break; } - return false; + return give_successful; } // static -void LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent, +bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent, const LLInventoryCategory* cat, const LLUUID& im_session_id) { -if(!cat) return; + if (!cat) + { + return false; + } llinfos << "LLGiveInventory::commitGiveInventoryCategory() - " << cat->getUUID() << llendl; @@ -500,6 +525,7 @@ if(!cat) return; LLInventoryModel::EXCLUDE_TRASH, giveable); + bool give_successful = true; // MAX ITEMS is based on (sizeof(uuid)+2) * count must be < // MTUBYTES or 18 * count < 1200 => count < 1200/18 => // 66. I've cut it down a bit from there to give some pad. @@ -507,12 +533,12 @@ if(!cat) return; if(count > MAX_ITEMS) { LLNotificationsUtil::add("TooManyItems"); - return; + give_successful = false; } else if(count == 0) { LLNotificationsUtil::add("NoItems"); - return; + give_successful = false; } else { @@ -565,6 +591,7 @@ if(!cat) return; bucket_size); gAgent.sendReliableMessage(); delete[] bucket; + // if (gSavedSettings.getBOOL("BroadcastViewerEffects")) { @@ -584,5 +611,8 @@ if(!cat) return; logInventoryOffer(to_agent, im_session_id); } + + return give_successful; } + // EOF diff --git a/indra/newview/llgiveinventory.h b/indra/newview/llgiveinventory.h index 19dab82a5..85bc1ed49 100644 --- a/indra/newview/llgiveinventory.h +++ b/indra/newview/llgiveinventory.h @@ -62,9 +62,11 @@ public: /** * Gives passed inventory category to specified avatar in specified session. */ - static void doGiveInventoryCategory(const LLUUID& to_agent, + static bool doGiveInventoryCategory(const LLUUID& to_agent, const LLInventoryCategory* item, - const LLUUID &session_id = LLUUID::null); + const LLUUID &session_id = LLUUID::null, + const std::string& notification = std::string()); + // give inventory item functionality static bool handleCopyProtectedItem(const LLSD& notification, const LLSD& response); @@ -84,7 +86,7 @@ private: // give inventory category functionality static bool handleCopyProtectedCategory(const LLSD& notification, const LLSD& response); - static void commitGiveInventoryCategory(const LLUUID& to_agent, + static bool commitGiveInventoryCategory(const LLUUID& to_agent, const LLInventoryCategory* cat, const LLUUID &im_session_id = LLUUID::null); diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index c93dbaa9d..7d6710b5a 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -40,7 +40,6 @@ #include "llpanelgroup.h" #include "llviewermessage.h" #include "groupchatlistener.h" -#include "hippolimits.h" // for getMaxAgentGroups // [RLVa:KB] - Checked: 2011-03-28 (RLVa-1.3.0) #include "llslurl.h" #include "rlvactions.h" @@ -239,7 +238,7 @@ void LLGroupActions::startCall(const LLUUID& group_id) // static void LLGroupActions::join(const LLUUID& group_id) { - if (gAgent.mGroups.count() >= gHippoLimits->getMaxAgentGroups()) //!gAgent.canJoinGroups() + if (!gAgent.canJoinGroups()) { LLNotificationsUtil::add("JoinedTooManyGroups"); return; diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index da0f11280..ccc13b61c 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -404,7 +404,17 @@ void LLFloaterIMPanel::onAvatarNameLookup(const LLAvatarName& avatar_name) std::string title; LLAvatarNameCache::getPNSName(avatar_name, title); setTitle(title); - // Singu Note: We could set tab name here, too now. + const S32& ns(gSavedSettings.getS32("IMNameSystem")); + LLAvatarNameCache::getPNSName(avatar_name, title, ns); + if (!ns || ns == 3) // Remove Resident, if applicable. + { + size_t pos(title.find(" Resident")); + if (pos != std::string::npos && !gSavedSettings.getBOOL("LiruShowLastNameResident")) + title.erase(pos, 9); + } + setShortTitle(title); + if (LLMultiFloater* mf = dynamic_cast(getParent())) + mf->updateFloaterTitle(this); } LLFloaterIMPanel::~LLFloaterIMPanel() diff --git a/indra/newview/llinventoryactions.cpp b/indra/newview/llinventoryactions.cpp index 5e2729820..20fe180d7 100644 --- a/indra/newview/llinventoryactions.cpp +++ b/indra/newview/llinventoryactions.cpp @@ -34,6 +34,7 @@ #include "llagentwearables.h" #include "llappearancemgr.h" +#include "llavataractions.h" #include "llfloaterperms.h" #include "llfoldervieweventlistener.h" #include "llimview.h" @@ -627,6 +628,7 @@ void init_object_inventory_panel_actions(LLPanelObjectInventory *panel) void init_inventory_actions(LLInventoryView *floater) { + (new LLDoToSelectedFloater())->registerListener(floater, "Inventory.DoToSelected"); (new LLDoToSelectedFloater())->registerListener(floater, "Inventory.DoToSelected"); (new LLCloseAllFoldersFloater())->registerListener(floater, "Inventory.CloseAllFolders"); (new LLEmptyTrashFloater())->registerListener(floater, "Inventory.EmptyTrash"); @@ -640,6 +642,15 @@ void init_inventory_actions(LLInventoryView *floater) (new LLSetSearchType())->registerListener(floater, "Inventory.SetSearchType"); } +class LLShare : public inventory_panel_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + LLAvatarActions::shareWithAvatars(mPtr); + return true; + } +}; + void init_inventory_panel_actions(LLInventoryPanel *panel) { (new LLDoToSelected())->registerListener(panel, "Inventory.DoToSelected"); @@ -649,4 +660,5 @@ void init_inventory_panel_actions(LLInventoryPanel *panel) (new LLEmptyLostAndFound())->registerListener(panel, "Inventory.EmptyLostAndFound"); (new LLDoCreate())->registerListener(panel, "Inventory.DoCreate"); (new LLBeginIMSession())->registerListener(panel, "Inventory.BeginIMSession"); + (new LLShare())->registerListener(panel, "Inventory.Share"); } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 67b991607..368bb3284 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -804,6 +804,12 @@ void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } + addOpenRightClickMenuOption(items); items.push_back(std::string("Properties")); @@ -1235,6 +1241,33 @@ void LLInvFVBridge::purgeItem(LLInventoryModel *model, const LLUUID &uuid) } } +bool LLInvFVBridge::canShare() const +{ + bool can_share = false; + + if (!isItemInTrash() && isAgentInventory()) + { + const LLInventoryModel* model = getInventoryModel(); + if (model) + { + const LLViewerInventoryItem *item = model->getItem(mUUID); + if (item) + { + if (LLInventoryCollectFunctor::itemTransferCommonlyAllowed(item)) + { + can_share = LLGiveInventory::isInventoryGiveAcceptable(item); + } + } + else + { + // Categories can be given. + can_share = (model->getCategory(mUUID) != NULL); + } + } + } + + return can_share; +} bool LLInvFVBridge::canListOnMarketplace() const { @@ -2613,8 +2646,17 @@ void LLRightClickInventoryFetchDescendentsObserver::execute(bool clear_observer) LLInventoryModel::item_array_t* item_array; gInventory.getDirectDescendentsOf(*current_folder, cat_array, item_array); - S32 item_count = item_array->count(); - S32 cat_count = cat_array->count(); + S32 item_count(0); + if (item_array) + { + item_count = item_array->count(); + } + + S32 cat_count(0); + if (cat_array) + { + cat_count = cat_array->count(); + } // Move to next if current folder empty if ((item_count == 0) && (cat_count == 0)) @@ -2851,6 +2893,14 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) restoreItem(); return; } + // Move displaced inventory to lost and found + else if ("move_to_lost_and_found" == action) + { + gInventory.changeCategoryParent(getCategory(), gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND), TRUE); + gInventory.addChangedMask(LLInventoryObserver::REBUILD, mUUID); + gInventory.notifyObservers(); + } + // #ifdef DELETE_SYSTEM_FOLDERS else if ("delete_system_folder" == action) { @@ -3095,7 +3145,7 @@ void LLFolderBridge::pasteFromClipboard(bool only_copies) { if (move_is_into_current_outfit || move_is_into_outfit) { - if (can_move_to_outfit(item, move_is_into_current_outfit)) + if (item && can_move_to_outfit(item, move_is_into_current_outfit)) { dropToOutfit(item, move_is_into_current_outfit); } @@ -3365,12 +3415,29 @@ void LLFolderBridge::buildContextMenuBaseOptions(U32 flags) mWearables=TRUE; } } + // Move displaced inventory to lost and found + else if (!isAgentInventory()) + { + const LLUUID& library(gInventory.getLibraryRootFolderID()); + if (library != mUUID && !gInventory.isObjectDescendentOf(mUUID, library)) + mItems.push_back(std::string("Move to Lost And Found")); + } + // // Preemptively disable system folder removal if more than one item selected. if ((flags & FIRST_SELECTED_ITEM) == 0) { mDisabledItems.push_back(std::string("Delete System Folder")); } + + if (!isOutboxFolder() && !isItemInTrash()) // + { + mItems.push_back(std::string("Share")); + if (!canShare()) + { + mDisabledItems.push_back(std::string("Share")); + } + } } void LLFolderBridge::buildContextMenuFolderOptions(U32 flags) @@ -3512,7 +3579,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) menu.arrangeAndClear(); } -BOOL LLFolderBridge::hasChildren() const +bool LLFolderBridge::hasChildren() const { LLInventoryModel* model = getInventoryModel(); if(!model) return FALSE; @@ -4305,6 +4372,12 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } + addOpenRightClickMenuOption(items); items.push_back(std::string("Properties")); @@ -4396,6 +4469,11 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } items.push_back(std::string("Sound Open")); items.push_back(std::string("Properties")); @@ -4449,6 +4527,11 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } items.push_back(std::string("Landmark Open")); items.push_back(std::string("Properties")); @@ -4718,6 +4801,11 @@ void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } /* Singu Note: Multiple profiles get opened in a multifloater if ((flags & FIRST_SELECTED_ITEM) == 0) { @@ -5023,6 +5111,11 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } addOpenRightClickMenuOption(items); items.push_back(std::string("Properties")); @@ -5078,6 +5171,11 @@ void LLAnimationBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } items.push_back(std::string("Animation Open")); items.push_back(std::string("Properties")); @@ -5395,6 +5493,12 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } + items.push_back(std::string("Properties")); getClipboardEntries(true, items, disabled_items, flags); @@ -5803,6 +5907,12 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { can_open = FALSE; } + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } + if (can_open) { addOpenRightClickMenuOption(items); diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 5fa3641a7..d5d604cd8 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -69,6 +69,7 @@ public: U32 flags = 0x00); virtual ~LLInvFVBridge() {} + bool canShare() const; bool canListOnMarketplace() const; bool canListOnMarketplaceNow() const; @@ -121,6 +122,8 @@ public: void* cargo_data) { return FALSE; } virtual LLInventoryType::EType getInventoryType() const { return mInvType; } virtual LLWearableType::EType getWearableType() const { return LLWearableType::WT_NONE; } + virtual LLInventoryObject* getInventoryObject() const; + //-------------------------------------------------------------------- // Convenience functions for adding various common menu options. @@ -137,16 +140,15 @@ protected: protected: LLInvFVBridge(LLInventoryPanel* inventory, LLFolderView* root, const LLUUID& uuid); - LLInventoryObject* getInventoryObject() const; LLInventoryModel* getInventoryModel() const; BOOL isLinkedObjectInTrash() const; // Is this obj or its baseobj in the trash? BOOL isLinkedObjectMissing() const; // Is this a linked obj whose baseobj is not in inventory? BOOL isAgentInventory() const; // false if lost or in the inventory library - BOOL isCOFFolder() const; // true if COF or descendent of - BOOL isInboxFolder() const; // true if COF or descendent of marketplace inbox - BOOL isOutboxFolder() const; // true if COF or descendent of marketplace outbox + BOOL isCOFFolder() const; // true if COF or descendant of + BOOL isInboxFolder() const; // true if COF or descendant of marketplace inbox + BOOL isOutboxFolder() const; // true if COF or descendant of marketplace outbox BOOL isOutboxFolderDirectParent() const; const LLUUID getOutboxFolder() const; @@ -165,7 +167,7 @@ protected: LLFolderView* mRoot; const LLUUID mUUID; // item id LLInventoryType::EType mInvType; - BOOL mIsLink; + bool mIsLink; void purgeItem(LLInventoryModel *model, const LLUUID &uuid); }; @@ -213,7 +215,7 @@ public: virtual BOOL renameItem(const std::string& new_name); virtual BOOL removeItem(); virtual BOOL isItemCopyable() const; - virtual BOOL hasChildren() const { return FALSE; } + virtual bool hasChildren() const { return FALSE; } virtual BOOL isUpToDate() const { return TRUE; } static void showFloaterImagePreview(LLInventoryItem* item, AIFilePicker* filepicker); @@ -235,8 +237,8 @@ class LLFolderBridge : public LLInvFVBridge public: LLFolderBridge(LLInventoryPanel* inventory, LLFolderView* root, - const LLUUID& uuid) : - LLInvFVBridge(inventory, root, uuid), + const LLUUID& uuid) + : LLInvFVBridge(inventory, root, uuid), mCallingCards(FALSE), mWearables(FALSE) {} @@ -265,7 +267,7 @@ public: virtual void pasteFromClipboard(bool only_copies = false); virtual void pasteLinkFromClipboard(); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual BOOL hasChildren() const; + virtual bool hasChildren() const; virtual BOOL dragOrDrop(MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data); @@ -326,8 +328,9 @@ public: static void staticFolderOptionsMenu(); private: - BOOL mCallingCards; - BOOL mWearables; + + bool mCallingCards; + bool mWearables; menuentry_vec_t mItems; menuentry_vec_t mDisabledItems; LLRootHandle mHandle; @@ -405,7 +408,6 @@ protected: LLCallingCardObserver* mObserver; }; - class LLNotecardBridge : public LLItemBridge { public: @@ -436,7 +438,6 @@ public: static void playGesture(const LLUUID& item_id); }; - class LLAnimationBridge : public LLItemBridge { public: @@ -450,7 +451,6 @@ public: virtual void openItem(); }; - class LLObjectBridge : public LLItemBridge { public: @@ -515,8 +515,6 @@ public: void editOnAvatar(); static BOOL canRemoveFromAvatar( void* userdata ); - //static void onRemoveFromAvatar( void* userdata ); - //static void onRemoveFromAvatarArrived( LLViewerWearable* wearable, void* userdata ); //static void removeAllClothesFromAvatar(); void removeFromAvatar(); protected: @@ -629,7 +627,8 @@ public: class LLRecentInventoryBridgeBuilder : public LLInventoryFVBridgeBuilder { public: - LLRecentInventoryBridgeBuilder(): LLInventoryFVBridgeBuilder() {} + LLRecentInventoryBridgeBuilder() {} + // Overrides FolderBridge for Recent Inventory Panel. // It use base functionality for bridges other than FolderBridge. virtual LLInvFVBridge* createBridge(LLAssetType::EType asset_type, diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index ceabe493a..9118d9cd2 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -245,9 +245,21 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con bool is_hidden_if_empty = LLViewerFolderType::lookupIsHiddenIfEmpty(listener->getPreferredType()); if (is_hidden_if_empty) { - // Force the fetching of those folders so they are hidden iff they really are empty... + // Force the fetching of those folders so they are hidden if they really are empty... gInventory.fetchDescendentsOf(object_id); - return FALSE; + + LLInventoryModel::cat_array_t* cat_array = NULL; + LLInventoryModel::item_array_t* item_array = NULL; + gInventory.getDirectDescendentsOf(object_id,cat_array,item_array); + S32 descendents_actual = 0; + if (cat_array && item_array) + { + descendents_actual = cat_array->count() + item_array->count(); + } + if (descendents_actual == 0) + { + return FALSE; + } } } } diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index fe77aa6c3..d7cab7920 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -876,7 +876,7 @@ bool LLFindWearablesEx::operator()(LLInventoryCategory* cat, LLInventoryItem* it if (!vitem) return false; // Skip non-wearables. - if (!vitem->isWearableType() && vitem->getType() != LLAssetType::AT_OBJECT) + if (!vitem->isWearableType() && vitem->getType() != LLAssetType::AT_OBJECT && vitem->getType() != LLAssetType::AT_GESTURE) { return false; } diff --git a/indra/newview/llmediafilter.cpp b/indra/newview/llmediafilter.cpp index 56d01e422..528dfc86f 100644 --- a/indra/newview/llmediafilter.cpp +++ b/indra/newview/llmediafilter.cpp @@ -101,7 +101,6 @@ void LLMediaFilter::filterAudioUrl(const std::string& url) { if (url.empty()) { - gAudiop->startInternetStream(url); return; } if (url == mCurrentAudioURL) return; diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp index afb66ee77..6183c6942 100644 --- a/indra/newview/llmenucommands.cpp +++ b/indra/newview/llmenucommands.cpp @@ -204,6 +204,7 @@ struct MenuFloaterDict : public LLSingleton registerFloater("outfit", boost::bind(show_outfit_dialog)); registerFloater("PostProcess", boost::bind(LLFloaterPostProcess::show)); registerFloater("preferences", boost::bind(LLFloaterPreference::show, (void*)NULL)); + registerFloater("quit", boost::bind(&LLAppViewer::userQuit, LLAppViewer::instance())); registerFloater("RegionDebugConsole", boost::bind(handle_singleton_toggle, (void*)NULL), boost::bind(LLFloaterRegionDebugConsole::instanceExists)); registerFloater("script errors", boost::bind(LLFloaterScriptDebug::show, LLUUID::null)); registerFloater("search", boost::bind(toggle_search_floater)); diff --git a/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp b/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp index 0dea26fb7..4b08cae72 100644 --- a/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp +++ b/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp @@ -54,6 +54,8 @@ LLMenuOptionPathfindingRebakeNavmesh::LLMenuOptionPathfindingRebakeNavmesh() LLMenuOptionPathfindingRebakeNavmesh::~LLMenuOptionPathfindingRebakeNavmesh() { + if (mIsInitialized) + { if (mRebakeNavMeshMode == kRebakeNavMesh_RequestSent) { LL_WARNS("navmeshRebaking") << "During destruction of the LLMenuOptionPathfindingRebakeNavmesh " @@ -61,9 +63,6 @@ LLMenuOptionPathfindingRebakeNavmesh::~LLMenuOptionPathfindingRebakeNavmesh() << "to be received. This could contribute to a crash on exit." << LL_ENDL; } - llassert(!mIsInitialized); - if (mIsInitialized) - { quit(); } } @@ -80,7 +79,7 @@ void LLMenuOptionPathfindingRebakeNavmesh::initialize() if ( !mRegionCrossingSlot.connected() ) { - mRegionCrossingSlot = LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLMenuOptionPathfindingRebakeNavmesh::handleRegionBoundaryCrossed, this)); + mRegionCrossingSlot = gAgent.addRegionChangedCallback(boost::bind(&LLMenuOptionPathfindingRebakeNavmesh::handleRegionBoundaryCrossed, this)); } if (!mAgentStateSlot.connected()) @@ -93,8 +92,7 @@ void LLMenuOptionPathfindingRebakeNavmesh::initialize() void LLMenuOptionPathfindingRebakeNavmesh::quit() { - llassert(mIsInitialized); - if (mIsInitialized) + if (mIsInitialized) // Quitting from the login screen leaves this uninitialized { if (mNavMeshSlot.connected()) { @@ -174,51 +172,60 @@ void LLMenuOptionPathfindingRebakeNavmesh::handleAgentState(BOOL pCanRebakeRegio void LLMenuOptionPathfindingRebakeNavmesh::handleRebakeNavMeshResponse(bool pResponseStatus) { llassert(mIsInitialized); - if (getMode() == kRebakeNavMesh_RequestSent) + if (mIsInitialized) { - setMode(pResponseStatus ? kRebakeNavMesh_InProgress : kRebakeNavMesh_Default); - } + if (getMode() == kRebakeNavMesh_RequestSent) + { + setMode(pResponseStatus ? kRebakeNavMesh_InProgress : kRebakeNavMesh_Default); + } - if (!pResponseStatus) - { - LLNotificationsUtil::add("PathfindingCannotRebakeNavmesh"); + if (!pResponseStatus) + { + LLNotificationsUtil::add("PathfindingCannotRebakeNavmesh"); + } } } void LLMenuOptionPathfindingRebakeNavmesh::handleNavMeshStatus(const LLPathfindingNavMeshStatus &pNavMeshStatus) { llassert(mIsInitialized); - ERebakeNavMeshMode rebakeNavMeshMode = kRebakeNavMesh_Default; - if (pNavMeshStatus.isValid()) + if (mIsInitialized) { - switch (pNavMeshStatus.getStatus()) + ERebakeNavMeshMode rebakeNavMeshMode = kRebakeNavMesh_Default; + if (pNavMeshStatus.isValid()) { - case LLPathfindingNavMeshStatus::kPending : - case LLPathfindingNavMeshStatus::kRepending : - rebakeNavMeshMode = kRebakeNavMesh_Available; - break; - case LLPathfindingNavMeshStatus::kBuilding : - rebakeNavMeshMode = kRebakeNavMesh_InProgress; - break; - case LLPathfindingNavMeshStatus::kComplete : - rebakeNavMeshMode = kRebakeNavMesh_NotAvailable; - break; - default : - rebakeNavMeshMode = kRebakeNavMesh_Default; - llassert(0); - break; + switch (pNavMeshStatus.getStatus()) + { + case LLPathfindingNavMeshStatus::kPending : + case LLPathfindingNavMeshStatus::kRepending : + rebakeNavMeshMode = kRebakeNavMesh_Available; + break; + case LLPathfindingNavMeshStatus::kBuilding : + rebakeNavMeshMode = kRebakeNavMesh_InProgress; + break; + case LLPathfindingNavMeshStatus::kComplete : + rebakeNavMeshMode = kRebakeNavMesh_NotAvailable; + break; + default: + rebakeNavMeshMode = kRebakeNavMesh_Default; + llassert(0); + break; + } } - } - setMode(rebakeNavMeshMode); + setMode(rebakeNavMeshMode); + } } void LLMenuOptionPathfindingRebakeNavmesh::handleRegionBoundaryCrossed() { llassert(mIsInitialized); - createNavMeshStatusListenerForCurrentRegion(); - mCanRebakeRegion = FALSE; - LLPathfindingManager::getInstance()->requestGetAgentState(); + if (mIsInitialized) + { + createNavMeshStatusListenerForCurrentRegion(); + mCanRebakeRegion = FALSE; + LLPathfindingManager::getInstance()->requestGetAgentState(); + } } void LLMenuOptionPathfindingRebakeNavmesh::createNavMeshStatusListenerForCurrentRegion() @@ -235,3 +242,4 @@ void LLMenuOptionPathfindingRebakeNavmesh::createNavMeshStatusListenerForCurrent LLPathfindingManager::getInstance()->requestGetNavMeshForRegion(currentRegion, true); } } + diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 037c42664..c16c3791f 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1303,7 +1303,7 @@ void LLMeshUploadThread::preStart() AIMeshUpload::AIMeshUpload(LLMeshUploadThread::instance_list& data, LLVector3& scale, bool upload_textures, bool upload_skin, bool upload_joints, std::string const& upload_url, bool do_upload, LLHandle const& fee_observer, LLHandle const& upload_observer) : -#if defined(CWDEBUG) || defined(DEBUG_CURLIO) +#ifdef CWDEBUG AIStateMachine(false), #endif mMeshUpload(new AIStateMachineThread(CWD_ONLY(false))), mWholeModelUploadURL(upload_url) diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index 99b541b23..723a9cc94 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -65,7 +65,6 @@ #include "lluistring.h" #include "llviewerobject.h" #include "llviewerobjectlist.h" -#include "llenvmanager.h" namespace { @@ -235,7 +234,7 @@ LLMuteList::LLMuteList() : gGenericDispatcher.addHandler("emptymutelist", &sDispatchEmptyMuteList); checkNewRegion(); - LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LLMuteList::checkNewRegion, this)); + gAgent.addRegionChangedCallback(boost::bind(&LLMuteList::checkNewRegion, this)); } //----------------------------------------------------------------------------- diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 94cd97200..f8cecab8c 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -473,7 +473,7 @@ BOOL LLPanelAvatarSecondLife::postBuild(void) getChild("Find on Map")->setCommitCallback(boost::bind(LLAvatarActions::showOnMap, boost::bind(&LLPanelAvatar::getAvatarID, pa))); getChild("Instant Message...")->setCommitCallback(boost::bind(LLAvatarActions::startIM, boost::bind(&LLPanelAvatar::getAvatarID, pa))); - getChild("GroupInvite_Button")->setCommitCallback(boost::bind(LLAvatarActions::inviteToGroup, boost::bind(&LLPanelAvatar::getAvatarID, pa))); + getChild("GroupInvite_Button")->setCommitCallback(boost::bind(static_cast(LLAvatarActions::inviteToGroup), boost::bind(&LLPanelAvatar::getAvatarID, pa))); getChild("Add Friend...")->setCommitCallback(boost::bind(LLAvatarActions::requestFriendshipDialog, boost::bind(&LLPanelAvatar::getAvatarID, pa))); getChild("Pay...")->setCommitCallback(boost::bind(LLAvatarActions::pay, boost::bind(&LLPanelAvatar::getAvatarID, pa))); @@ -1631,12 +1631,12 @@ void LLPanelAvatar::resetGroupList() group_list->deleteAllItems(); - S32 count = gAgent.mGroups.count(); + S32 count = gAgent.mGroups.size(); LLUUID id; for(S32 i = 0; i < count; ++i) { - LLGroupData group_data = gAgent.mGroups.get(i); + LLGroupData group_data = gAgent.mGroups[i]; id = group_data.mID; std::string group_string; /* Show group title? DUMMY_POWER for Don Grep diff --git a/indra/newview/llpaneldirclassified.cpp b/indra/newview/llpaneldirclassified.cpp index 2bc854864..fb26e398f 100644 --- a/indra/newview/llpaneldirclassified.cpp +++ b/indra/newview/llpaneldirclassified.cpp @@ -119,7 +119,8 @@ BOOL LLPanelDirClassified::postBuild() // Don't do this every time we open find, it's expensive; require clicking 'search' //requestClassified(); - childSetVisible("filter_gaming", (gAgent.getRegion()->getGamingFlags() & REGION_GAMING_PRESENT) && !(gAgent.getRegion()->getGamingFlags() & REGION_GAMING_HIDE_FIND_CLASSIFIEDS)); + LLViewerRegion* region(gAgent.getRegion()); + getChildView("filter_gaming")->setVisible(region && (region->getGamingFlags() & REGION_GAMING_PRESENT) && !(region->getGamingFlags() & REGION_GAMING_HIDE_FIND_CLASSIFIEDS)); return TRUE; } diff --git a/indra/newview/llpaneldirevents.cpp b/indra/newview/llpaneldirevents.cpp index 8b7453b1b..f38b7efa7 100644 --- a/indra/newview/llpaneldirevents.cpp +++ b/indra/newview/llpaneldirevents.cpp @@ -93,7 +93,8 @@ BOOL LLPanelDirEvents::postBuild() } gDisplayEventHack = FALSE; - childSetVisible("filter_gaming", (gAgent.getRegion()->getGamingFlags() & REGION_GAMING_PRESENT) && !(gAgent.getRegion()->getGamingFlags() & REGION_GAMING_HIDE_FIND_EVENTS)); + LLViewerRegion* region(gAgent.getRegion()); + getChildView("filter_gaming")->setVisible(region && (gAgent.getRegion()->getGamingFlags() & REGION_GAMING_PRESENT) && !(gAgent.getRegion()->getGamingFlags() & REGION_GAMING_HIDE_FIND_EVENTS)); return TRUE; } diff --git a/indra/newview/llpaneldirfind.cpp b/indra/newview/llpaneldirfind.cpp index 5e132cb07..08f685f80 100644 --- a/indra/newview/llpaneldirfind.cpp +++ b/indra/newview/llpaneldirfind.cpp @@ -250,7 +250,10 @@ BOOL LLPanelDirFind::postBuild() } if (LLUICtrl* ctrl = findChild("filter_gaming")) - ctrl->setVisible(gAgent.getRegion() && (gAgent.getRegion()->getGamingFlags() & REGION_GAMING_PRESENT) && !(gAgent.getRegion()->getGamingFlags() & REGION_GAMING_HIDE_FIND_ALL)); + { + const LLViewerRegion* region(gAgent.getRegion()); + ctrl->setVisible(region && (region->getGamingFlags() & REGION_GAMING_PRESENT) && !(region->getGamingFlags() & REGION_GAMING_HIDE_FIND_ALL)); + } return TRUE; } diff --git a/indra/newview/llpaneldirgroups.cpp b/indra/newview/llpaneldirgroups.cpp index 6cdcdd538..bbd07ed2d 100644 --- a/indra/newview/llpaneldirgroups.cpp +++ b/indra/newview/llpaneldirgroups.cpp @@ -61,7 +61,8 @@ BOOL LLPanelDirGroups::postBuild() childDisable("Search"); setDefaultBtn( "Search" ); - childSetVisible("filter_gaming", (gAgent.getRegion()->getGamingFlags() & REGION_GAMING_PRESENT) && !(gAgent.getRegion()->getGamingFlags() & REGION_GAMING_HIDE_FIND_GROUPS)); + LLViewerRegion* region(gAgent.getRegion()); + getChildView("filter_gaming")->setVisible(region && (region->getGamingFlags() & REGION_GAMING_PRESENT) && !(region->getGamingFlags() & REGION_GAMING_HIDE_FIND_GROUPS)); return TRUE; } diff --git a/indra/newview/llpaneldirland.cpp b/indra/newview/llpaneldirland.cpp index 9c249a81d..ccb253111 100644 --- a/indra/newview/llpaneldirland.cpp +++ b/indra/newview/llpaneldirland.cpp @@ -126,7 +126,8 @@ BOOL LLPanelDirLand::postBuild() } } - childSetVisible("filter_gaming", (gAgent.getRegion()->getGamingFlags() & REGION_GAMING_PRESENT) && !(gAgent.getRegion()->getGamingFlags() & REGION_GAMING_HIDE_FIND_LAND)); + LLViewerRegion* region(gAgent.getRegion()); + getChildView("filter_gaming")->setVisible(region && (region->getGamingFlags() & REGION_GAMING_PRESENT) && !(region->getGamingFlags() & REGION_GAMING_HIDE_FIND_LAND)); return TRUE; } diff --git a/indra/newview/llpaneldirplaces.cpp b/indra/newview/llpaneldirplaces.cpp index 706d9013c..971d7f162 100644 --- a/indra/newview/llpaneldirplaces.cpp +++ b/indra/newview/llpaneldirplaces.cpp @@ -99,7 +99,8 @@ BOOL LLPanelDirPlaces::postBuild() childSetEnabled("Category", true); } - childSetVisible("filter_gaming", (gAgent.getRegion()->getGamingFlags() & REGION_GAMING_PRESENT) && !(gAgent.getRegion()->getGamingFlags() & REGION_GAMING_HIDE_FIND_SIMS)); + LLViewerRegion* region(gAgent.getRegion()); + getChildView("filter_gaming")->setVisible(region && (region->getGamingFlags() & REGION_GAMING_PRESENT) && !(region->getGamingFlags() & REGION_GAMING_HIDE_FIND_SIMS)); // Don't prepopulate the places list, as it hurts the database as of 2006-12-04. JC // initialQuery(); diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 40e450dd7..e6bfd0251 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -71,7 +71,14 @@ const S32 NOTICE_DATE_STRING_SIZE = 30; class LLGroupDropTarget : public LLDropTarget { public: - LLGroupDropTarget(const LLDropTarget::Params& p = LLDropTarget::Params()); + struct Params : public LLInitParam::Block + { + Params() + { + changeDefault(show_reset, false); // We have a button for this + } + }; + LLGroupDropTarget(const Params& p = Params()); ~LLGroupDropTarget() {}; // @@ -92,14 +99,14 @@ protected: LLPanelGroupNotices* mGroupNoticesPanel; }; -LLGroupDropTarget::LLGroupDropTarget(const LLDropTarget::Params& p) +LLGroupDropTarget::LLGroupDropTarget(const LLGroupDropTarget::Params& p) : LLDropTarget(p) {} // static LLView* LLGroupDropTarget::fromXML(LLXMLNodePtr node, LLView* parent, LLUICtrlFactory* factory) { - LLGroupDropTarget* target = new LLGroupDropTarget(); + LLGroupDropTarget* target = new LLGroupDropTarget; target->initFromXML(node, parent); return target; } diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 87d6c3844..95bbf36fc 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -137,7 +137,7 @@ public: virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual void performAction(LLInventoryModel* model, std::string action); virtual BOOL isUpToDate() const { return TRUE; } - virtual BOOL hasChildren() const { return FALSE; } + virtual bool hasChildren() const { return FALSE; } virtual LLInventoryType::EType getInventoryType() const { return LLInventoryType::IT_NONE; } virtual LLWearableType::EType getWearableType() const { return LLWearableType::WT_NONE; } @@ -872,7 +872,7 @@ public: virtual BOOL renameItem(const std::string& new_name); virtual BOOL isItemRemovable() const; virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual BOOL hasChildren() const; + virtual bool hasChildren() const; virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const; virtual BOOL dragOrDrop(MASK mask, BOOL drop, EDragAndDropType cargo_type, @@ -922,7 +922,7 @@ void LLTaskCategoryBridge::buildContextMenu(LLMenuGL& menu, U32 flags) hide_context_entries(menu, items, disabled_items); } -BOOL LLTaskCategoryBridge::hasChildren() const +bool LLTaskCategoryBridge::hasChildren() const { // return TRUE if we have or do know know if we have children. // *FIX: For now, return FALSE - we will know for sure soon enough. diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 79147655b..5e1bb5c6a 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -56,15 +56,6 @@ #include "llviewerregion.h" #include "llweb.h" -class AIHTTPTimeoutPolicy; -extern AIHTTPTimeoutPolicy navMeshStatusResponder_timeout; -extern AIHTTPTimeoutPolicy navMeshResponder_timeout; -extern AIHTTPTimeoutPolicy agentStateResponder_timeout; -extern AIHTTPTimeoutPolicy navMeshRebakeResponder_timeout; -extern AIHTTPTimeoutPolicy objectLinksetsResponder_timeout; -extern AIHTTPTimeoutPolicy terrainLinksetsResponder_timeout; -extern AIHTTPTimeoutPolicy charactersResponder_timeout; - #define CAP_SERVICE_RETRIEVE_NAVMESH "RetrieveNavMeshSrc" #define CAP_SERVICE_NAVMESH_STATUS "NavMeshGenerationStatus" @@ -112,19 +103,18 @@ LLHTTPRegistration gHTTPRegistrationAgentStateChangeNode class NavMeshStatusResponder : public LLHTTPClient::ResponderWithResult { + LOG_CLASS(NavMeshStatusResponder); public: - NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion, bool pIsGetStatusOnly); + NavMeshStatusResponder(LLViewerRegion *pRegion, bool pIsGetStatusOnly); virtual ~NavMeshStatusResponder(); - /*virtual*/ void httpSuccess(void); - /*virtual*/ void httpFailure(void); - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return navMeshStatusResponder_timeout; } /*virtual*/ char const* getName(void) const { return "NavMeshStatusResponder"; } protected: + virtual void httpSuccess(); + virtual void httpFailure(); private: - std::string mCapabilityURL; LLViewerRegion *mRegion; LLUUID mRegionUUID; bool mIsGetStatusOnly; @@ -136,19 +126,18 @@ private: class NavMeshResponder : public LLHTTPClient::ResponderWithResult { + LOG_CLASS(NavMeshResponder); public: - NavMeshResponder(const std::string &pCapabilityURL, U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr); + NavMeshResponder(U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr); virtual ~NavMeshResponder(); - /*virtual*/ void httpSuccess(void); - /*virtual*/ void httpFailure(void); - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return navMeshResponder_timeout; } /*virtual*/ char const* getName(void) const { return "NavMeshResponder"; } protected: + virtual void httpSuccess(); + virtual void httpFailure(); private: - std::string mCapabilityURL; U32 mNavMeshVersion; LLPathfindingNavMeshPtr mNavMeshPtr; }; @@ -159,19 +148,16 @@ private: class AgentStateResponder : public LLHTTPClient::ResponderWithResult { + LOG_CLASS(AgentStateResponder); public: - AgentStateResponder(const std::string &pCapabilityURL); + AgentStateResponder(); virtual ~AgentStateResponder(); - /*virtual*/ void httpSuccess(void); - /*virtual*/ void httpFailure(void); - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return agentStateResponder_timeout; } /*virtual*/ char const* getName(void) const { return "AgentStateResponder"; } protected: - -private: - std::string mCapabilityURL; + virtual void httpSuccess(); + virtual void httpFailure(); }; @@ -180,19 +166,18 @@ private: //--------------------------------------------------------------------------- class NavMeshRebakeResponder : public LLHTTPClient::ResponderWithResult { + LOG_CLASS(NavMeshRebakeResponder); public: - NavMeshRebakeResponder(const std::string &pCapabilityURL, LLPathfindingManager::rebake_navmesh_callback_t pRebakeNavMeshCallback); + NavMeshRebakeResponder(LLPathfindingManager::rebake_navmesh_callback_t pRebakeNavMeshCallback); virtual ~NavMeshRebakeResponder(); - /*virtual*/ void httpSuccess(void); - /*virtual*/ void httpFailure(void); - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return navMeshRebakeResponder_timeout; } /*virtual*/ char const* getName(void) const { return "NavMeshRebakeResponder"; } protected: + virtual void httpSuccess(); + virtual void httpFailure(); private: - std::string mCapabilityURL; LLPathfindingManager::rebake_navmesh_callback_t mRebakeNavMeshCallback; }; @@ -207,9 +192,9 @@ public: virtual ~LinksetsResponder(); void handleObjectLinksetsResult(const LLSD &pContent); - void handleObjectLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL); + void handleObjectLinksetsError(); void handleTerrainLinksetsResult(const LLSD &pContent); - void handleTerrainLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL); + void handleTerrainLinksetsError(); protected: @@ -241,19 +226,18 @@ typedef boost::shared_ptr LinksetsResponderPtr; //--------------------------------------------------------------------------- class ObjectLinksetsResponder : public LLHTTPClient::ResponderWithResult { + LOG_CLASS(ObjectLinksetsResponder); public: - ObjectLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr); + ObjectLinksetsResponder(LinksetsResponderPtr pLinksetsResponsderPtr); virtual ~ObjectLinksetsResponder(); - /*virtual*/ void httpSuccess(void); - /*virtual*/ void httpFailure(void); - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return objectLinksetsResponder_timeout; } /*virtual*/ char const* getName(void) const { return "ObjectLinksetsResponder"; } protected: + virtual void httpSuccess(); + virtual void httpFailure(); private: - std::string mCapabilityURL; LinksetsResponderPtr mLinksetsResponsderPtr; }; @@ -262,19 +246,18 @@ private: //--------------------------------------------------------------------------- class TerrainLinksetsResponder : public LLHTTPClient::ResponderWithResult { + LOG_CLASS(TerrainLinksetsResponder); public: - TerrainLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr); + TerrainLinksetsResponder(LinksetsResponderPtr pLinksetsResponsderPtr); virtual ~TerrainLinksetsResponder(); - /*virtual*/ void httpSuccess(void); - /*virtual*/ void httpFailure(void); - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return terrainLinksetsResponder_timeout; } /*virtual*/ char const* getName(void) const { return "TerrainLinksetsResponder"; } protected: + virtual void httpSuccess(); + virtual void httpFailure(); private: - std::string mCapabilityURL; LinksetsResponderPtr mLinksetsResponsderPtr; }; @@ -283,19 +266,18 @@ private: //--------------------------------------------------------------------------- class CharactersResponder : public LLHTTPClient::ResponderWithResult { + LOG_CLASS(TerrainLinksetsResponder); public: - CharactersResponder(const std::string &pCapabilityURL, LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pCharactersCallback); + CharactersResponder(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pCharactersCallback); virtual ~CharactersResponder(); - /*virtual*/ void httpSuccess(void); - /*virtual*/ void httpFailure(void); - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return charactersResponder_timeout; } /*virtual*/ char const* getName(void) const { return "CharactersResponder"; } protected: + virtual void httpSuccess(); + virtual void httpFailure(); private: - std::string mCapabilityURL; LLPathfindingManager::request_id_t mRequestId; LLPathfindingManager::object_request_callback_t mCharactersCallback; }; @@ -382,7 +364,7 @@ void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion, b std::string navMeshStatusURL = getNavMeshStatusURLForRegion(pRegion); llassert(!navMeshStatusURL.empty()); navMeshPtr->handleNavMeshCheckVersion(); - LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(navMeshStatusURL, pRegion, pIsGetStatusOnly); + LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(pRegion, pIsGetStatusOnly); LLHTTPClient::get(navMeshStatusURL, navMeshStatusResponder); } } @@ -416,12 +398,12 @@ void LLPathfindingManager::requestGetLinksets(request_id_t pRequestId, object_re bool doRequestTerrain = isAllowViewTerrainProperties(); LinksetsResponderPtr linksetsResponderPtr(new LinksetsResponder(pRequestId, pLinksetsCallback, true, doRequestTerrain)); - LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(objectLinksetsURL, linksetsResponderPtr); + LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(linksetsResponderPtr); LLHTTPClient::get(objectLinksetsURL, objectLinksetsResponder); if (doRequestTerrain) { - LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(terrainLinksetsURL, linksetsResponderPtr); + LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(linksetsResponderPtr); LLHTTPClient::get(terrainLinksetsURL, terrainLinksetsResponder); } } @@ -465,13 +447,13 @@ void LLPathfindingManager::requestSetLinksets(request_id_t pRequestId, const LLP if (!objectPostData.isUndefined()) { - LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(objectLinksetsURL, linksetsResponderPtr); + LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(linksetsResponderPtr); LLHTTPClient::put(objectLinksetsURL, objectPostData, objectLinksetsResponder); } if (!terrainPostData.isUndefined()) { - LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(terrainLinksetsURL, linksetsResponderPtr); + LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(linksetsResponderPtr); LLHTTPClient::put(terrainLinksetsURL, terrainPostData, terrainLinksetsResponder); } } @@ -504,7 +486,7 @@ void LLPathfindingManager::requestGetCharacters(request_id_t pRequestId, object_ { pCharactersCallback(pRequestId, kRequestStarted, emptyCharacterListPtr); - LLHTTPClient::ResponderPtr charactersResponder = new CharactersResponder(charactersURL, pRequestId, pCharactersCallback); + LLHTTPClient::ResponderPtr charactersResponder = new CharactersResponder(pRequestId, pCharactersCallback); LLHTTPClient::get(charactersURL, charactersResponder); } } @@ -537,7 +519,7 @@ void LLPathfindingManager::requestGetAgentState() { std::string agentStateURL = getAgentStateURLForRegion(currentRegion); llassert(!agentStateURL.empty()); - LLHTTPClient::ResponderPtr responder = new AgentStateResponder(agentStateURL); + LLHTTPClient::ResponderPtr responder = new AgentStateResponder(); LLHTTPClient::get(agentStateURL, responder); } } @@ -561,7 +543,7 @@ void LLPathfindingManager::requestRebakeNavMesh(rebake_navmesh_callback_t pRebak llassert(!navMeshStatusURL.empty()); LLSD postData; postData["command"] = "rebuild"; - LLHTTPClient::ResponderPtr responder = new NavMeshRebakeResponder(navMeshStatusURL, pRebakeNavMeshCallback); + LLHTTPClient::ResponderPtr responder = new NavMeshRebakeResponder(pRebakeNavMeshCallback); LLHTTPClient::post(navMeshStatusURL, postData, responder); } } @@ -583,7 +565,7 @@ void LLPathfindingManager::sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPt else { navMeshPtr->handleNavMeshStart(pNavMeshStatus); - LLHTTPClient::ResponderPtr responder = new NavMeshResponder(navMeshURL, pNavMeshStatus.getVersion(), navMeshPtr); + LLHTTPClient::ResponderPtr responder = new NavMeshResponder(pNavMeshStatus.getVersion(), navMeshPtr); LLSD postData; LLHTTPClient::post(navMeshURL, postData, responder); @@ -797,8 +779,8 @@ void LLAgentStateChangeNode::post(ResponsePtr pResponse, const LLSD &pContext, c // NavMeshStatusResponder //--------------------------------------------------------------------------- -NavMeshStatusResponder::NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion, bool pIsGetStatusOnly) : - mCapabilityURL(pCapabilityURL), +NavMeshStatusResponder::NavMeshStatusResponder(LLViewerRegion *pRegion, bool pIsGetStatusOnly) + : mRegion(pRegion), mRegionUUID(), mIsGetStatusOnly(pIsGetStatusOnly) @@ -813,15 +795,15 @@ NavMeshStatusResponder::~NavMeshStatusResponder() { } -void NavMeshStatusResponder::httpSuccess(void) +void NavMeshStatusResponder::httpSuccess() { - LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID, mContent); + LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID, getContent()); LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion, mIsGetStatusOnly); } -void NavMeshStatusResponder::httpFailure(void) +void NavMeshStatusResponder::httpFailure() { - llwarns << "error with request to URL '" << mCapabilityURL << "' because " << mReason << " (statusCode:" << mStatus << ")" << llendl; + llwarns << dumpResponse() << llendl; LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID); LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion, mIsGetStatusOnly); } @@ -830,8 +812,8 @@ void NavMeshStatusResponder::httpFailure(void) // NavMeshResponder //--------------------------------------------------------------------------- -NavMeshResponder::NavMeshResponder(const std::string &pCapabilityURL, U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr) : - mCapabilityURL(pCapabilityURL), +NavMeshResponder::NavMeshResponder(U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr) + : mNavMeshVersion(pNavMeshVersion), mNavMeshPtr(pNavMeshPtr) { @@ -841,21 +823,22 @@ NavMeshResponder::~NavMeshResponder() { } -void NavMeshResponder::httpSuccess(void) +void NavMeshResponder::httpSuccess() { - mNavMeshPtr->handleNavMeshResult(mContent, mNavMeshVersion); + mNavMeshPtr->handleNavMeshResult(getContent(), mNavMeshVersion); } -void NavMeshResponder::httpFailure(void) +void NavMeshResponder::httpFailure() { - mNavMeshPtr->handleNavMeshError(mStatus, mReason, mCapabilityURL, mNavMeshVersion); + llwarns << dumpResponse() << llendl; + mNavMeshPtr->handleNavMeshError(mNavMeshVersion); } //--------------------------------------------------------------------------- // AgentStateResponder //--------------------------------------------------------------------------- -AgentStateResponder::AgentStateResponder(const std::string &pCapabilityURL) : mCapabilityURL(pCapabilityURL) +AgentStateResponder::AgentStateResponder() { } @@ -863,17 +846,18 @@ AgentStateResponder::~AgentStateResponder() { } -void AgentStateResponder::httpSuccess(void) +void AgentStateResponder::httpSuccess() { - llassert(mContent.has(AGENT_STATE_CAN_REBAKE_REGION_FIELD)); - llassert(mContent.get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).isBoolean()); - BOOL canRebakeRegion = mContent.get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).asBoolean(); + const LLSD& pContent = getContent(); + llassert(pContent.has(AGENT_STATE_CAN_REBAKE_REGION_FIELD)); + llassert(pContent.get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).isBoolean()); + BOOL canRebakeRegion = pContent.get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).asBoolean(); LLPathfindingManager::getInstance()->handleAgentState(canRebakeRegion); } -void AgentStateResponder::httpFailure(void) +void AgentStateResponder::httpFailure() { - llwarns << "error with request to URL '" << mCapabilityURL << "' because " << mReason << " (statusCode:" << mStatus << ")" << llendl; + llwarns << dumpResponse() << llendl; LLPathfindingManager::getInstance()->handleAgentState(FALSE); } @@ -881,8 +865,8 @@ void AgentStateResponder::httpFailure(void) //--------------------------------------------------------------------------- // navmesh rebake responder //--------------------------------------------------------------------------- -NavMeshRebakeResponder::NavMeshRebakeResponder(const std::string &pCapabilityURL, LLPathfindingManager::rebake_navmesh_callback_t pRebakeNavMeshCallback) : - mCapabilityURL(pCapabilityURL), +NavMeshRebakeResponder::NavMeshRebakeResponder(LLPathfindingManager::rebake_navmesh_callback_t pRebakeNavMeshCallback) + : mRebakeNavMeshCallback(pRebakeNavMeshCallback) { } @@ -891,14 +875,14 @@ NavMeshRebakeResponder::~NavMeshRebakeResponder() { } -void NavMeshRebakeResponder::httpSuccess(void) +void NavMeshRebakeResponder::httpSuccess() { mRebakeNavMeshCallback(true); } -void NavMeshRebakeResponder::httpFailure(void) +void NavMeshRebakeResponder::httpFailure() { - llwarns << "error with request to URL '" << mCapabilityURL << "' because " << mReason << " (statusCode:" << mStatus << ")" << llendl; + llwarns << dumpResponse() << llendl; mRebakeNavMeshCallback(false); } @@ -931,9 +915,9 @@ void LinksetsResponder::handleObjectLinksetsResult(const LLSD &pContent) } } -void LinksetsResponder::handleObjectLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL) +void LinksetsResponder::handleObjectLinksetsError() { - llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; + llwarns << "LinksetsResponder object linksets error" << llendl; mObjectMessagingState = kReceivedError; if (mTerrainMessagingState != kWaiting) { @@ -952,8 +936,9 @@ void LinksetsResponder::handleTerrainLinksetsResult(const LLSD &pContent) } } -void LinksetsResponder::handleTerrainLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL) +void LinksetsResponder::handleTerrainLinksetsError() { + llwarns << "LinksetsResponder terrain linksets error" << llendl; mTerrainMessagingState = kReceivedError; if (mObjectMessagingState != kWaiting) { @@ -987,8 +972,8 @@ void LinksetsResponder::sendCallback() // ObjectLinksetsResponder //--------------------------------------------------------------------------- -ObjectLinksetsResponder::ObjectLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr) : - mCapabilityURL(pCapabilityURL), +ObjectLinksetsResponder::ObjectLinksetsResponder(LinksetsResponderPtr pLinksetsResponsderPtr) + : mLinksetsResponsderPtr(pLinksetsResponsderPtr) { } @@ -997,22 +982,23 @@ ObjectLinksetsResponder::~ObjectLinksetsResponder() { } -void ObjectLinksetsResponder::httpSuccess(void) +void ObjectLinksetsResponder::httpSuccess() { - mLinksetsResponsderPtr->handleObjectLinksetsResult(mContent); + mLinksetsResponsderPtr->handleObjectLinksetsResult(getContent()); } -void ObjectLinksetsResponder::httpFailure(void) +void ObjectLinksetsResponder::httpFailure() { - mLinksetsResponsderPtr->handleObjectLinksetsError(mStatus, mReason, mCapabilityURL); + llwarns << dumpResponse() << llendl; + mLinksetsResponsderPtr->handleObjectLinksetsError(); } //--------------------------------------------------------------------------- // TerrainLinksetsResponder //--------------------------------------------------------------------------- -TerrainLinksetsResponder::TerrainLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr) : - mCapabilityURL(pCapabilityURL), +TerrainLinksetsResponder::TerrainLinksetsResponder(LinksetsResponderPtr pLinksetsResponsderPtr) + : mLinksetsResponsderPtr(pLinksetsResponsderPtr) { } @@ -1021,22 +1007,23 @@ TerrainLinksetsResponder::~TerrainLinksetsResponder() { } -void TerrainLinksetsResponder::httpSuccess(void) +void TerrainLinksetsResponder::httpSuccess() { - mLinksetsResponsderPtr->handleTerrainLinksetsResult(mContent); + mLinksetsResponsderPtr->handleTerrainLinksetsResult(getContent()); } -void TerrainLinksetsResponder::httpFailure(void) +void TerrainLinksetsResponder::httpFailure() { - mLinksetsResponsderPtr->handleTerrainLinksetsError(mStatus, mReason, mCapabilityURL); + llwarns << dumpResponse() << llendl; + mLinksetsResponsderPtr->handleTerrainLinksetsError(); } //--------------------------------------------------------------------------- // CharactersResponder //--------------------------------------------------------------------------- -CharactersResponder::CharactersResponder(const std::string &pCapabilityURL, LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pCharactersCallback) : - mCapabilityURL(pCapabilityURL), +CharactersResponder::CharactersResponder(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pCharactersCallback) + : mRequestId(pRequestId), mCharactersCallback(pCharactersCallback) { @@ -1046,15 +1033,15 @@ CharactersResponder::~CharactersResponder() { } -void CharactersResponder::httpSuccess(void) +void CharactersResponder::httpSuccess() { - LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList(mContent)); + LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList(getContent())); mCharactersCallback(mRequestId, LLPathfindingManager::kRequestCompleted, characterListPtr); } -void CharactersResponder::httpFailure(void) +void CharactersResponder::httpFailure() { - llwarns << "error with request to URL '" << mCapabilityURL << "' because " << mReason << " (statusCode:" << mStatus << ")" << llendl; + llwarns << dumpResponse() << llendl; LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList()); mCharactersCallback(mRequestId, LLPathfindingManager::kRequestError, characterListPtr); diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp index e01dd3a15..555105cf4 100644 --- a/indra/newview/llpathfindingnavmesh.cpp +++ b/indra/newview/llpathfindingnavmesh.cpp @@ -184,9 +184,8 @@ void LLPathfindingNavMesh::handleNavMeshError() setRequestStatus(kNavMeshRequestError); } -void LLPathfindingNavMesh::handleNavMeshError(U32 pStatus, const std::string &pReason, const std::string &pURL, U32 pNavMeshVersion) +void LLPathfindingNavMesh::handleNavMeshError(U32 pNavMeshVersion) { - llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; if (mNavMeshStatus.getVersion() == pNavMeshVersion) { handleNavMeshError(); diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h index 7a844f54c..87f32b8d5 100644 --- a/indra/newview/llpathfindingnavmesh.h +++ b/indra/newview/llpathfindingnavmesh.h @@ -74,7 +74,7 @@ public: void handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion); void handleNavMeshNotEnabled(); void handleNavMeshError(); - void handleNavMeshError(U32 pStatus, const std::string &pReason, const std::string &pURL, U32 pNavMeshVersion); + void handleNavMeshError(U32 pNavMeshVersion); protected: diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index c10570d7d..55f723651 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -5201,7 +5201,9 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data { if (node->mInventorySerial != inv_serial) { - node->getObject()->dirtyInventory(); + if (LLViewerObject* object = node->getObject()) + if (object->getInventorySerial() != inv_serial) // Singu Note: the serial number in the object may be correct. + object->dirtyInventory(); } // save texture data as soon as we get texture perms first time diff --git a/indra/newview/llshareavatarhandler.cpp b/indra/newview/llshareavatarhandler.cpp new file mode 100644 index 000000000..959556a51 --- /dev/null +++ b/indra/newview/llshareavatarhandler.cpp @@ -0,0 +1,67 @@ +/** + * @file llshareavatarhandler.cpp + * @brief slapp to handle sharing with an avatar + * + * $LicenseInfo:firstyear=2001&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 "llcommandhandler.h" +#include "llavataractions.h" +#include "llnotificationsutil.h" +#include "llui.h" + +class LLShareWithAvatarHandler : public LLCommandHandler +{ +public: + // requires trusted browser to trigger + LLShareWithAvatarHandler() : LLCommandHandler("sharewithavatar", UNTRUSTED_THROTTLE) + { + } + + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + { + /*if (!LLUI::sSettingGroups["config"]->getBOOL("EnableAvatarShare")) + { + LLNotificationsUtil::add("NoAvatarShare", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); + return true; + }*/ + + //Make sure we have some parameters + if (params.size() == 0) + { + return false; + } + + //Get the ID + LLUUID id; + if (!id.set( params[0], FALSE)) + { + return false; + } + + //instigate share with this avatar + LLAvatarActions::share(id); + return true; + } +}; +LLShareWithAvatarHandler gShareWithAvatar; diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index d15900993..2d76ba707 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -38,7 +38,6 @@ #include "llagent.h" #include "llbutton.h" #include "llcommandhandler.h" -#include "llenvmanager.h" #include "llfloaterbuycurrency.h" #include "llfloaterchat.h" #include "llfloaterinventory.h" @@ -93,6 +92,7 @@ #include #include "hippogridmanager.h" +#include "lfsimfeaturehandler.h" // [RLVa:KB] #include "rlvactions.h" @@ -119,20 +119,11 @@ const F32 ICON_TIMER_EXPIRY = 3.f; // How long the balance and health icons sho const F32 ICON_FLASH_FREQUENCY = 2.f; const S32 TEXT_HEIGHT = 18; -static void onClickParcelInfo(void*); -static void onClickBalance(void*); -static void onClickBuyCurrency(void*); -static void onClickHealth(void*); -static void onClickFly(void*); -static void onClickPush(void*); -static void onClickVoice(void*); -static void onClickBuild(void*); -static void onClickPFDirty(void*); -static void onClickPFDisabled(void*); -static void onClickSeeAV(void*); -static void onClickScripts(void*); -static void onClickBuyLand(void*); -static void onClickScriptDebug(void*); +static void onClickParcelInfo(); +static bool rebakeRegionCallback(const LLSD& n, const LLSD& r); +static void pf_dirty_click() { LLNotificationsUtil::add("PathfindingDirty", LLSD(), LLSD(), rebakeRegionCallback); } +static void onClickScripts(); +static void onClickSearch(const std::string& query); std::vector LLStatusBar::sDays; std::vector LLStatusBar::sMonths; @@ -207,35 +198,50 @@ mIsNavMeshDirty(false) if (!mUPCSupported) mTextUPC->setVisible(false); - childSetAction("scriptout", onClickScriptDebug, this); - childSetAction("health", onClickHealth, this); - childSetAction("no_fly", onClickFly, this); - childSetAction("buyland", onClickBuyLand, this ); - childSetAction("buycurrency", onClickBuyCurrency, this ); - childSetAction("no_build", onClickBuild, this ); - childSetAction("pf_dirty", onClickPFDirty, this); - childSetAction("pf_disabled", onClickPFDisabled, this); - childSetAction("status_SeeAV", onClickSeeAV, this ); - childSetAction("no_scripts", onClickScripts, this ); - childSetAction("restrictpush", onClickPush, this ); - childSetAction("status_no_voice", onClickVoice, this ); + mScriptOut = getChild("scriptout"); + mScriptOut->setCommitCallback(boost::bind(LLFloaterScriptDebug::show, LLUUID::null)); + mHealthV = getChild("health"); + mHealthV->setCommitCallback(boost::bind(LLNotificationsUtil::add, "NotSafe")); + mNoFly = getChild("no_fly"); + mNoFly->setCommitCallback(boost::bind(LLNotificationsUtil::add, "NoFly")); + mBuyLand = getChild("buyland"); + mBuyLand->setCommitCallback(boost::bind(&LLViewerParcelMgr::startBuyLand, boost::bind(LLViewerParcelMgr::getInstance), 0)); + mBuyCurrency = getChild("buycurrency"); + mBuyCurrency->setCommitCallback(boost::bind(LLFloaterBuyCurrency::buyCurrency)); + mNoBuild = getChild("no_build"); + mNoBuild->setCommitCallback(boost::bind(LLNotificationsUtil::add, "NoBuild")); + mPFDirty = getChild("pf_dirty"); + mPFDirty->setCommitCallback(boost::bind(pf_dirty_click)); + mPFDisabled = getChild("pf_disabled"); + mPFDisabled->setCommitCallback(boost::bind(LLNotificationsUtil::add, "DynamicPathfindingDisabled")); + mStatusSeeAV = getChild("status_SeeAV"); + mStatusSeeAV->setCommitCallback(boost::bind(LLNotificationsUtil::add, "SeeAvatars")); + mNoScripts = getChild("no_scripts"); + mNoScripts->setCommitCallback(boost::bind(onClickScripts)); + mRestrictPush = getChild("restrictpush"); + mRestrictPush->setCommitCallback(boost::bind(LLNotificationsUtil::add, "PushRestricted")); + mStatusNoVoice = getChild("status_no_voice"); + mStatusNoVoice->setCommitCallback(boost::bind(LLNotificationsUtil::add, "NoVoice")); - childSetCommitCallback("search_editor", onCommitSearch, this); - childSetAction("search_btn", onClickSearch, this); + mSearchEditor = getChild("search_editor"); + mSearchEditor->setCommitCallback(boost::bind(onClickSearch, _2)); + mSearchBtn = getChild("search_btn"); + mSearchBtn->setCommitCallback(boost::bind(onClickSearch, boost::bind(&LLView::getValue, mSearchEditor))); - childSetVisible("search_editor", gSavedSettings.getBOOL("ShowSearchBar")); - childSetVisible("search_btn", gSavedSettings.getBOOL("ShowSearchBar")); - childSetVisible("menubar_search_bevel_bg", gSavedSettings.getBOOL("ShowSearchBar")); + bool show_search(gSavedSettings.getBOOL("ShowSearchBar")); + mSearchEditor->setVisible(show_search); + mSearchBtn->setVisible(show_search); + mSearchBevel = getChildView("menubar_search_bevel_bg"); + mSearchBevel->setVisible(show_search); - childSetActionTextbox("ParcelNameText", onClickParcelInfo ); - childSetActionTextbox("BalanceText", onClickBalance ); + mTextParcelName->setClickedCallback(boost::bind(onClickParcelInfo)); + mTextBalance->setClickedCallback(boost::bind(LLFloaterBuyCurrency::buyCurrency)); // TODO: Disable buying currency when connected to non-SL grids // that don't support currency yet -- MC - LLButton* buybtn = getChild("buycurrency"); - buybtn->setLabelArg("[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); + mBuyCurrency->setLabelArg("[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); - mRegionCrossingSlot = LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLStatusBar::createNavMeshStatusListenerForCurrentRegion, this)); + mRegionCrossingSlot = gAgent.addRegionChangedCallback(boost::bind(&LLStatusBar::createNavMeshStatusListenerForCurrentRegion, this)); createNavMeshStatusListenerForCurrentRegion(); // Adding Net Stat Graph @@ -269,8 +275,8 @@ mIsNavMeshDirty(false) mSGPacketLoss->mPerSec = FALSE; addChild(mSGPacketLoss); - childSetActionTextbox("stat_btn", onClickStatGraph); - + mStatBtn = getChild("stat_btn"); + mStatBtn->setClickedCallback(boost::bind(LLFloaterLagMeter::showInstance, LLSD())); } LLStatusBar::~LLStatusBar() @@ -336,8 +342,9 @@ void LLStatusBar::refresh() // it's daylight savings time there. internal_time = show_local_time ? std::localtime(&utc_time) : utc_to_pacific_time(utc_time, gPacificDaylightTime); + static const LLCachedControl short_time_fmt(gSavedSettings, "ShortTimeFormat"); std::string t; - timeStructToFormattedString(internal_time, gSavedSettings.getString("ShortTimeFormat"), t); + timeStructToFormattedString(internal_time, short_time_fmt, t); if (show_local_time) { static const std::string local(" " + getString("Local")); @@ -353,8 +360,9 @@ void LLStatusBar::refresh() } mTextTime->setText(t); + static const LLCachedControl long_date_fmt(gSavedSettings, "LongDateFormat"); std::string date; - timeStructToFormattedString(internal_time, gSavedSettings.getString("LongDateFormat"), date); + timeStructToFormattedString(internal_time, long_date_fmt, date); mTextTime->setToolTip(date); LLRect r; @@ -362,8 +370,6 @@ void LLStatusBar::refresh() S32 x = MENU_RIGHT + MENU_PARCEL_SPACING; S32 y = 0; - bool search_visible = gSavedSettings.getBOOL("ShowSearchBar"); - // reshape menu bar to its content's width if (MENU_RIGHT != gMenuBarView->getRect().getWidth()) { @@ -373,40 +379,30 @@ void LLStatusBar::refresh() LLViewerRegion *region = gAgent.getRegion(); LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - LLRect buttonRect; - if (LLHUDIcon::iconsNearby()) { - childGetRect( "scriptout", buttonRect ); + const LLRect& buttonRect = mScriptOut->getRect(); r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect("scriptout",r); - childSetVisible("scriptout", true); + mScriptOut->setRect(r); + mScriptOut->setVisible(true); x += buttonRect.getWidth(); } else { - childSetVisible("scriptout", false); + mScriptOut->setVisible(false); } if ((region && region->getAllowDamage()) || (parcel && parcel->getAllowDamage()) ) { // set visibility based on flashing - if( mHealthTimer->hasExpired() ) - { - childSetVisible("health", true); - } - else - { - BOOL flash = S32(mHealthTimer->getElapsedSeconds() * ICON_FLASH_FREQUENCY) & 1; - childSetVisible("health", flash); - } + mHealthV->setVisible(mHealthTimer->hasExpired() || S32(mHealthTimer->getElapsedSeconds() * ICON_FLASH_FREQUENCY) & 1); mTextHealth->setVisible(TRUE); // Health - childGetRect( "health", buttonRect ); + const LLRect& buttonRect = mHealthV->getRect(); r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect("health", r); + mHealthV->setRect(r); x += buttonRect.getWidth(); const S32 health_width = S32( LLFontGL::getFontSansSerifSmall()->getWidth(std::string("100%")) ); @@ -417,7 +413,7 @@ void LLStatusBar::refresh() else { // invisible if region doesn't allow damage - childSetVisible("health", false); + mHealthV->setVisible(false); mTextHealth->setVisible(FALSE); } @@ -425,168 +421,134 @@ void LLStatusBar::refresh() (parcel && !parcel->getAllowFly()) ) { // No Fly Zone - childGetRect( "no_fly", buttonRect ); - childSetVisible( "no_fly", true ); + mNoFly->setVisible(true); + const LLRect& buttonRect(mNoFly->getRect()); r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect( "no_fly", r ); + mNoFly->setRect(r); x += buttonRect.getWidth(); } else { // Fly Zone - childSetVisible("no_fly", false); + mNoFly->setVisible(false); } - BOOL no_build = parcel && !parcel->getAllowModify(); - if (no_build) + if (parcel && !parcel->getAllowModify()) { - childSetVisible("no_build", TRUE); - childGetRect( "no_build", buttonRect ); // No Build Zone + mNoBuild->setVisible(true); + const LLRect& buttonRect(mNoBuild->getRect()); r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect( "no_build", r ); + mNoBuild->setRect(r); x += buttonRect.getWidth(); } else { - childSetVisible("no_build", FALSE); + mNoBuild->setVisible(false); } - BOOL no_scripts = FALSE; - if((region + if ((region && (region->getRegionFlag(REGION_FLAGS_SKIP_SCRIPTS) || region->getRegionFlag(REGION_FLAGS_ESTATE_SKIP_SCRIPTS))) || (parcel && !parcel->getAllowOtherScripts())) - { - no_scripts = TRUE; - } - if (no_scripts) { // No scripts - childSetVisible("no_scripts", TRUE); - childGetRect( "no_scripts", buttonRect ); + mNoScripts->setVisible(true); + const LLRect& buttonRect(mNoScripts->getRect()); r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect( "no_scripts", r ); + mNoScripts->setRect(r); x += buttonRect.getWidth(); } else { // Yes scripts - childSetVisible("no_scripts", FALSE); + mNoScripts->setVisible(false); } - BOOL no_region_push = (region && region->getRestrictPushObject()); - BOOL no_push = no_region_push || (parcel && parcel->getRestrictPushObject()); - if (no_push) + if ((region && region->getRestrictPushObject()) || (parcel && parcel->getRestrictPushObject())) { - childSetVisible("restrictpush", TRUE); - childGetRect( "restrictpush", buttonRect ); + mRestrictPush->setVisible(true); + const LLRect& buttonRect(mRestrictPush->getRect()); r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect( "restrictpush", r ); + mRestrictPush->setRect(r); x += buttonRect.getWidth(); } else { - childSetVisible("restrictpush", FALSE); + mRestrictPush->setVisible(false); } - BOOL have_voice = parcel && parcel->getParcelFlagAllowVoice(); - if (have_voice) + if (parcel && parcel->getParcelFlagAllowVoice()) { - childSetVisible("status_no_voice", FALSE); + mStatusNoVoice->setVisible(false); } else { - childSetVisible("status_no_voice", TRUE); - childGetRect( "status_no_voice", buttonRect ); + mStatusNoVoice->setVisible(true); + const LLRect& buttonRect(mStatusNoVoice->getRect()); r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect( "status_no_voice", r ); + mStatusNoVoice->setRect(r); x += buttonRect.getWidth(); } - bool no_see_avs = parcel && !parcel->getSeeAVs(); - childSetVisible("status_SeeAV", no_see_avs); - if (no_see_avs) + if (parcel && !parcel->getSeeAVs()) { - childGetRect( "status_SeeAV", buttonRect ); + mStatusSeeAV->setVisible(true); + const LLRect& buttonRect(mStatusSeeAV->getRect()); r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect( "status_SeeAV", r ); + mStatusSeeAV->setRect(r); x += buttonRect.getWidth(); } + else mStatusSeeAV->setVisible(false); if (region) { bool pf_disabled = !region->dynamicPathfindingEnabled(); - getChild("pf_dirty")->setVisible(!pf_disabled && mIsNavMeshDirty); - getChild("pf_disabled")->setVisible(pf_disabled); - const std::string pf_icon = pf_disabled ? "pf_disabled" : mIsNavMeshDirty ? "pf_dirty" : ""; - if (!pf_icon.empty()) + mPFDirty->setVisible(!pf_disabled && mIsNavMeshDirty); + mPFDisabled->setVisible(pf_disabled); + if (LLView* pf_icon = pf_disabled ? mPFDisabled : mIsNavMeshDirty ? mPFDirty : NULL) { x += 6; - childGetRect(pf_icon, buttonRect); + const LLRect& buttonRect(pf_icon->getRect()); r.setOriginAndSize(x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect(pf_icon, r); + pf_icon->setRect(r); x += buttonRect.getWidth(); } } - BOOL canBuyLand = parcel - && !parcel->isPublic() - && LLViewerParcelMgr::getInstance()->canAgentBuyParcel(parcel, false); - childSetVisible("buyland", canBuyLand); - if (canBuyLand) + if (parcel && !parcel->isPublic() && LLViewerParcelMgr::getInstance()->canAgentBuyParcel(parcel, false)) { + mBuyLand->setVisible(true); //HACK: layout tweak until this is all xml x += 9; - childGetRect( "buyland", buttonRect ); + const LLRect& buttonRect(mBuyLand->getRect()); r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect( "buyland", r ); + mBuyLand->setRect(r); x += buttonRect.getWidth(); } + else mBuyLand->setVisible(false); std::string location_name; - if (region) + if (region && parcel) { - const LLVector3& agent_pos_region = gAgent.getPositionAgent(); - S32 pos_x = lltrunc( agent_pos_region.mV[VX] ); - S32 pos_y = lltrunc( agent_pos_region.mV[VY] ); - S32 pos_z = lltrunc( agent_pos_region.mV[VZ] ); - - // Round the numbers based on the velocity - LLVector3 agent_velocity = gAgent.getVelocity(); - F32 velocity_mag_sq = agent_velocity.magVecSquared(); - - const F32 FLY_CUTOFF = 6.f; // meters/sec - const F32 FLY_CUTOFF_SQ = FLY_CUTOFF * FLY_CUTOFF; - const F32 WALK_CUTOFF = 1.5f; // meters/sec - const F32 WALK_CUTOFF_SQ = WALK_CUTOFF * WALK_CUTOFF; - - if (velocity_mag_sq > FLY_CUTOFF_SQ) +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | Modified: RLVa-1.0.0a + if (RlvActions::hasBehaviour(RLV_BHVR_SHOWLOC)) { - pos_x -= pos_x % 4; - pos_y -= pos_y % 4; - } - else if (velocity_mag_sq > WALK_CUTOFF_SQ) - { - pos_x -= pos_x % 2; - pos_y -= pos_y % 2; - } - - if (parcel) - { - if (!LLAgentUI::buildLocationString(location_name, LLAgentUI::LOCATION_FORMAT_FULL)) - { - location_name = "???"; - } + location_name = llformat("%s (%s) - %s", + RlvStrings::getString(RLV_STRING_HIDDEN_REGION).c_str(), region->getSimAccessString().c_str(), + RlvStrings::getString(RLV_STRING_HIDDEN).c_str()); } else +// [/RLVa:KB] + if (!LLAgentUI::buildLocationString(location_name, LLAgentUI::LOCATION_FORMAT_FULL)) + location_name = "???"; + else { - location_name = region->getName() - + llformat(" %d, %d, %d (%s)", - pos_x, pos_y, pos_z, - region->getSimAccessString().c_str()); + const std::string& grid(LFSimFeatureHandler::instance().gridName()); + if (!grid.empty()) location_name += ", " + grid; } - static LLCachedControl show_channel("ShowSimChannel"); + + static const LLCachedControl show_channel("ShowSimChannel"); if (show_channel && !gLastVersionChannel.empty()) location_name += " - " + gLastVersionChannel; } else @@ -595,70 +557,58 @@ void LLStatusBar::refresh() location_name = "(Unknown)"; } -// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | Modified: RLVa-1.0.0a - if ( (region) && (RlvActions::hasBehaviour(RLV_BHVR_SHOWLOC)) ) // region == NULL if we lose our connection to the grid - { - location_name = llformat("%s (%s) - %s", - RlvStrings::getString(RLV_STRING_HIDDEN_REGION).c_str(), region->getSimAccessString().c_str(), - RlvStrings::getString(RLV_STRING_HIDDEN).c_str()); - } -// [/RLVa:KB] - mTextParcelName->setText(location_name); - - // x = right edge // loop through: stat graphs, search btn, search text editor, money, buy money, clock // adjust rect // finally adjust parcel name rect S32 new_right = getRect().getWidth(); + static const LLCachedControl search_visible(gSavedSettings, "ShowSearchBar"); if (search_visible) { - childGetRect("search_btn", r); - //r.translate( new_right - r.mRight, 0); - //childSetRect("search_btn", r); - new_right -= r.getWidth(); - - childGetRect("search_editor", r); - //r.translate( new_right - r.mRight, 0); - //childSetRect("search_editor", r); - new_right -= r.getWidth() + 6; + new_right -= mSearchBtn->getRect().getWidth(); + new_right -= mSearchEditor->getRect().getWidth() + 6; } else { - childGetRect("stat_btn", r); + r = mStatBtn->getRect(); r.translate( new_right - r.mRight, 0); - childSetRect("stat_btn", r); + mStatBtn->setRect(r); new_right -= r.getWidth() + 6; } + // Set search bar visibility + mSearchEditor->setVisible(search_visible); + mSearchBtn->setVisible(search_visible); + mSearchBevel->setVisible(search_visible); + mSGBandwidth->setVisible(! search_visible); + mSGPacketLoss->setVisible(! search_visible); + mStatBtn->setEnabled(!search_visible); + // Set rects of money, buy money, time if (mUPCSupported) { - childGetRect("UPCText", r); + r = mTextUPC->getRect(); r.translate( new_right - r.mRight, 0); - childSetRect("UPCText", r); + mTextUPC->setRect(r); new_right -= r.getWidth() - 18; } - childGetRect("BalanceText", r); + r = mTextBalance->getRect(); r.translate( new_right - r.mRight, 0); - childSetRect("BalanceText", r); + mTextBalance->setRect(r); new_right -= r.getWidth() - 18; - childGetRect("buycurrency", r); + r = mBuyCurrency->getRect(); r.translate( new_right - r.mRight, 0); - childSetRect("buycurrency", r); + mBuyCurrency->setRect(r); new_right -= r.getWidth() + 6; - childGetRect("TimeText", r); - // mTextTime->getTextPixelWidth(); + r = mTextTime->getRect(); r.translate( new_right - r.mRight, 0); - childSetRect("TimeText", r); - // new_right -= r.getWidth() + MENU_PARCEL_SPACING; - + mTextTime->setRect(r); // Adjust region name and parcel name x += 8; @@ -666,14 +616,6 @@ void LLStatusBar::refresh() const S32 PARCEL_RIGHT = llmin(mTextTime->getRect().mLeft, mTextParcelName->getTextPixelWidth() + x + 5); r.set(x+4, getRect().getHeight() - 2, PARCEL_RIGHT, 0); mTextParcelName->setRect(r); - - // Set search bar visibility - childSetVisible("search_editor", search_visible); - childSetVisible("search_btn", search_visible); - childSetVisible("menubar_search_bevel_bg", search_visible); - mSGBandwidth->setVisible(! search_visible); - mSGPacketLoss->setVisible(! search_visible); - childSetEnabled("stat_btn", ! search_visible); } void LLStatusBar::setVisibleForMouselook(bool visible) @@ -682,9 +624,9 @@ void LLStatusBar::setVisibleForMouselook(bool visible) if (mUPCSupported) mTextUPC->setVisible(visible); mTextTime->setVisible(visible); - childSetVisible("buycurrency", visible); - childSetVisible("search_editor", visible); - childSetVisible("search_btn", visible); + mBuyCurrency->setVisible(visible); + mSearchEditor->setVisible(visible); + mSearchBtn->setVisible(visible); mSGBandwidth->setVisible(visible); mSGPacketLoss->setVisible(visible); setBackgroundVisible(visible); @@ -811,53 +753,12 @@ S32 LLStatusBar::getSquareMetersLeft() const return mSquareMetersCredit - mSquareMetersCommitted; } -static void onClickParcelInfo(void* data) +static void onClickParcelInfo() { LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal()); - LLFloaterLand::showInstance(); } -static void onClickBalance(void* data) -{ - onClickBuyCurrency(data); -} - -static void onClickBuyCurrency(void* data) -{ - LLFloaterBuyCurrency::buyCurrency(); -} - -static void onClickHealth(void* ) -{ - LLNotificationsUtil::add("NotSafe"); -} - -static void onClickScriptDebug(void*) -{ - LLFloaterScriptDebug::show(LLUUID::null); -} - -static void onClickFly(void* ) -{ - LLNotificationsUtil::add("NoFly"); -} - -static void onClickPush(void* ) -{ - LLNotificationsUtil::add("PushRestricted"); -} - -static void onClickVoice(void* ) -{ - LLNotificationsUtil::add("NoVoice"); -} - -static void onClickBuild(void*) -{ - LLNotificationsUtil::add("NoBuild"); -} - static bool rebakeRegionCallback(const LLSD& n, const LLSD& r) { if(!LLNotificationsUtil::getSelectedOption(n, r)) //0 is Yes @@ -868,16 +769,6 @@ static bool rebakeRegionCallback(const LLSD& n, const LLSD& r) return false; } -static void onClickPFDirty(void*) -{ - LLNotificationsUtil::add("PathfindingDirty", LLSD(), LLSD(), rebakeRegionCallback); -} - -static void onClickPFDisabled(void*) -{ - LLNotificationsUtil::add("DynamicPathfindingDisabled"); -} - void LLStatusBar::createNavMeshStatusListenerForCurrentRegion() { if (mNavMeshSlot.connected()) @@ -899,12 +790,7 @@ void LLStatusBar::onNavMeshStatusChange(const LLPathfindingNavMeshStatus &pNavMe refresh(); } -static void onClickSeeAV(void*) -{ - LLNotificationsUtil::add("SeeAvatars"); -} - -static void onClickScripts(void*) +static void onClickScripts() { LLViewerRegion* region = gAgent.getRegion(); if(region && region->getRegionFlag(REGION_FLAGS_ESTATE_SKIP_SCRIPTS)) @@ -921,11 +807,6 @@ static void onClickScripts(void*) } } -static void onClickBuyLand(void*) -{ - LLViewerParcelMgr::getInstance()->startBuyLand(); -} - // sets the static variables necessary for the date void LLStatusBar::setupDate() { @@ -989,28 +870,13 @@ void LLStatusBar::setupDate() } } -// static -void LLStatusBar::onCommitSearch(LLUICtrl*, void* data) +static void onClickSearch(const std::string& query) { - // committing is the same as clicking "search" - onClickSearch(data); -} - -// static -void LLStatusBar::onClickSearch(void* data) -{ - LLStatusBar* self = (LLStatusBar*)data; LLFloaterSearch::SearchQuery search; - search.query = self->childGetText("search_editor"); + search.query = query; LLFloaterSearch::showInstance(search); } -// static -void LLStatusBar::onClickStatGraph(void* data) -{ - LLFloaterLagMeter::showInstance(); -} - BOOL can_afford_transaction(S32 cost) { return((cost <= 0)||((gStatusBar) && (gStatusBar->getBalance() >=cost))); diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index b24913ef3..1db2806c7 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -90,10 +90,6 @@ private: // simple method to setup the part that holds the date void setupDate(); - static void onCommitSearch(LLUICtrl*, void* data); - static void onClickSearch(void* data); - static void onClickStatGraph(void* data); - void onRegionBoundaryCrossed(); void createNavMeshStatusListenerForCurrentRegion(); void onNavMeshStatusChange(const LLPathfindingNavMeshStatus &pNavMeshStatus); @@ -111,6 +107,23 @@ private: LLButton *mBtnBuyCurrency; + LLUICtrl* mScriptOut; + LLUICtrl* mHealthV; + LLUICtrl* mNoFly; + LLUICtrl* mBuyLand; + LLUICtrl* mBuyCurrency; + LLUICtrl* mNoBuild; + LLUICtrl* mPFDirty; + LLUICtrl* mPFDisabled; + LLUICtrl* mStatusSeeAV; + LLUICtrl* mNoScripts; + LLUICtrl* mRestrictPush; + LLUICtrl* mStatusNoVoice; + LLUICtrl* mSearchEditor; + LLUICtrl* mSearchBtn; + LLView* mSearchBevel; + LLTextBox* mStatBtn; + S32 mBalance; S32 mUPC; S32 mHealth; diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp index 44c8c4a0e..85cc032a3 100644 --- a/indra/newview/lltoolcomp.cpp +++ b/indra/newview/lltoolcomp.cpp @@ -638,7 +638,7 @@ void LLToolCompRotate::render() LLToolCompGun::LLToolCompGun() : LLToolComposite(std::string("Mouselook")) - , mRightMouseButton(false), mMenuShown(false), mTimerFOV(), mOriginalFOV(), mStartFOV(), mTargetFOV() // + , mMenuShown(false), mTimerFOV(), mOriginalFOV(), mStartFOV(), mTargetFOV() // { mGun = new LLToolGun(this); mGrab = new LLToolGrab(this); @@ -764,10 +764,9 @@ void LLToolCompGun::handleSelect() void LLToolCompGun::handleDeselect() { LLToolComposite::handleDeselect(); - if (mRightMouseButton || mTimerFOV.getStarted()) // Singu Note: Load Default FOV if we were zoomed in + if (mTimerFOV.getStarted()) // Note: Load Default FOV if we were zooming in { LLViewerCamera::getInstance()->loadDefaultFOV(); - mRightMouseButton = false; } setMouseCapture(FALSE); } @@ -777,22 +776,18 @@ void LLToolCompGun::handleDeselect() BOOL LLToolCompGun::handleRightMouseUp(S32 x, S32 y, MASK mask) { // Singu Note: Beware the alt-click menu - if (mRightMouseButton) - { - mRightMouseButton = false; - - mStartFOV = LLViewerCamera::getInstance()->getDefaultFOV(); - mTargetFOV = mOriginalFOV; - gSavedSettings.getBOOL("LiruMouselookInstantZoom") ? LLViewerCamera::getInstance()->setDefaultFOV(mTargetFOV) : - mTimerFOV.start(); - } - if (mMenuShown) { mMenuShown = false; return LLToolComposite::handleRightMouseUp(x, y, mask); } + LLViewerCamera& cam(LLViewerCamera::instance()); + mStartFOV = cam.getDefaultFOV(); + mTargetFOV = mOriginalFOV; + gSavedSettings.getBOOL("LiruMouselookInstantZoom") ? cam.setDefaultFOV(mTargetFOV) : mTimerFOV.start(); + cam.mSavedFOVLoaded = false; + return TRUE; } @@ -805,27 +800,27 @@ BOOL LLToolCompGun::handleRightMouseDown(S32 x, S32 y, MASK mask) return false; } - mRightMouseButton = true; - - if(!mTimerFOV.getStarted()) + LLViewerCamera& cam(LLViewerCamera::instance()); + if (!mTimerFOV.getStarted()) { - mStartFOV = LLViewerCamera::getInstance()->getAndSaveDefaultFOV(); + mStartFOV = cam.getAndSaveDefaultFOV(); mOriginalFOV = mStartFOV; } - else mStartFOV = LLViewerCamera::getInstance()->getDefaultFOV(); + else mStartFOV = cam.getDefaultFOV(); mTargetFOV = gSavedSettings.getF32("ExodusAlternativeFOV"); - gSavedSettings.getBOOL("LiruMouselookInstantZoom") ? LLViewerCamera::getInstance()->setDefaultFOV(mTargetFOV) : - mTimerFOV.start(); + gSavedSettings.getBOOL("LiruMouselookInstantZoom") ? cam.setDefaultFOV(mTargetFOV) : mTimerFOV.start(); + cam.mSavedFOVLoaded = false; return TRUE; } BOOL LLToolCompGun::handleScrollWheel(S32 x, S32 y, S32 clicks) { - if (mRightMouseButton) + if (gViewerWindow->getRightMouseDown()) { - mStartFOV = LLViewerCamera::getInstance()->getDefaultFOV(); + LLViewerCamera& cam(LLViewerCamera::instance()); + mStartFOV = cam.getDefaultFOV(); gSavedSettings.setF32( "ExodusAlternativeFOV", @@ -834,8 +829,8 @@ BOOL LLToolCompGun::handleScrollWheel(S32 x, S32 y, S32 clicks) llclamp(mTargetFOV -= (0.05f * -clicks), 0.1f, 3.0f) ); - gSavedSettings.getBOOL("LiruMouselookInstantZoom") ? LLViewerCamera::getInstance()->setDefaultFOV(mTargetFOV) : - mTimerFOV.start(); + gSavedSettings.getBOOL("LiruMouselookInstantZoom") ? cam.setDefaultFOV(mTargetFOV) : mTimerFOV.start(); + cam.mSavedFOVLoaded = false; } else if (clicks > 0) gAgentCamera.changeCameraToDefault(); @@ -848,16 +843,17 @@ void LLToolCompGun::draw() { if (mTimerFOV.getStarted()) { - if (!LLViewerCamera::getInstance()->mSavedFOVLoaded && mStartFOV != mTargetFOV) + LLViewerCamera& cam(LLViewerCamera::instance()); + if (!cam.mSavedFOVLoaded && mStartFOV != mTargetFOV) { F32 timer = mTimerFOV.getElapsedTimeF32(); if (timer > 0.15f) { - LLViewerCamera::getInstance()->setDefaultFOV(mTargetFOV); + cam.setDefaultFOV(mTargetFOV); mTimerFOV.stop(); } - else LLViewerCamera::getInstance()->setDefaultFOV(lerp(mStartFOV, mTargetFOV, timer * 6.66f)); + else cam.setDefaultFOV(lerp(mStartFOV, mTargetFOV, timer * 6.66f)); } else mTimerFOV.stop(); } diff --git a/indra/newview/lltoolcomp.h b/indra/newview/lltoolcomp.h index 07cf2815b..c1169f0ec 100644 --- a/indra/newview/lltoolcomp.h +++ b/indra/newview/lltoolcomp.h @@ -235,7 +235,7 @@ protected: // private: - bool mRightMouseButton, mMenuShown; + bool mMenuShown; LLTimer mTimerFOV; F32 mOriginalFOV, mStartFOV, mTargetFOV; // diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp index 0065a7f28..2cdfd172a 100644 --- a/indra/newview/lltoolfocus.cpp +++ b/indra/newview/lltoolfocus.cpp @@ -313,11 +313,9 @@ BOOL LLToolCamera::handleMouseUp(S32 x, S32 y, MASK mask) return TRUE; } -static bool right_hold_mouse_walk=false; - BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask) { - if(right_hold_mouse_walk) + if (gViewerWindow->getRightMouseDown()) { agent_push_forward(KEYSTATE_LEVEL); } @@ -461,7 +459,6 @@ BOOL LLToolCamera::handleRightMouseDown(S32 x, S32 y, MASK mask) if(mMouseSteering) { agent_push_forward(KEYSTATE_DOWN); - right_hold_mouse_walk = true; return TRUE; } else @@ -472,10 +469,9 @@ BOOL LLToolCamera::handleRightMouseDown(S32 x, S32 y, MASK mask) BOOL LLToolCamera::handleRightMouseUp(S32 x, S32 y, MASK mask) { - if(mMouseSteering || right_hold_mouse_walk) + if (mMouseSteering) { agent_push_forward(KEYSTATE_UP); - right_hold_mouse_walk = false; return TRUE; } else @@ -487,5 +483,5 @@ BOOL LLToolCamera::handleRightMouseUp(S32 x, S32 y, MASK mask) void LLToolCamera::onMouseCaptureLost() { releaseMouse(); - handleRightMouseUp(0,0,0); + if (gViewerWindow->getRightMouseDown()) agent_push_forward(KEYSTATE_UP); } diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp index 92e525882..542256af0 100644 --- a/indra/newview/lltoolmgr.cpp +++ b/indra/newview/lltoolmgr.cpp @@ -330,6 +330,11 @@ void LLToolMgr::toggleBuildMode() // avoid spurious avatar movements LLViewerJoystick::getInstance()->setNeedsReset(); + if (gFocusMgr.getKeyboardFocus()) gFloaterTools->setFocus(true); // Focus isn't on the world, give it to the build tools. + } + else if (gFloaterTools->getVisible() && !gFloaterTools->hasFocus() && gFocusMgr.getKeyboardFocus()) // Build tools is open, but not the focused floater, give it focus. + { + gFloaterTools->setFocus(true); } else { diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index fa74444ff..06509dc95 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -472,7 +472,11 @@ ECursorType LLToolPie::cursorFromObject(LLViewerObject* object) case CLICK_ACTION_BUY: if ( mClickActionBuyEnabled ) { - cursor = UI_CURSOR_TOOLBUY; + LLSelectNode* node = LLSelectMgr::getInstance()->getHoverNode(); + if (!node || node->mSaleInfo.isForSale()) + { + cursor = UI_CURSOR_TOOLBUY; + } } break; case CLICK_ACTION_OPEN: @@ -578,6 +582,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) mHoverPick = gViewerWindow->pickImmediate(x, y, FALSE); LLViewerObject *parent = NULL; LLViewerObject *object = mHoverPick.getObject(); + LLSelectMgr::getInstance()->setHoverObject(object, mHoverPick.mObjectFace); // [RLVa:KB] - Checked: 2010-03-11 (RLVa-1.2.0e) | Modified: RLVa-1.1.0l // Block all special click action cursors when: // - @fartouch=n restricted and the object is out of range diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 8f7a0ed65..164419dce 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -243,12 +243,11 @@ void audio_update_wind(bool fade) volume_delta = (LLFrameTimer::getFrameDeltaTimeF32() / WIND_SOUND_TRANSITION_TIME) * max_wind_volume; } - static LLCachedControl MuteWind("MuteWind"); - static LLCachedControl ContinueFlying("LiruContinueFlyingOnUnsit"); + static LLCachedControl MuteWind(gSavedSettings, "MuteWind", false); + static LLCachedControl ContinueFlying(gSavedSettings, "LiruContinueFlyingOnUnsit", false); // mute wind entirely when the user asked or when the user is seated, but flying - if (MuteWind || (ContinueFlying && gAgentAvatarp&& gAgentAvatarp->isSitting())) + if (MuteWind || (ContinueFlying && gAgentAvatarp && gAgentAvatarp->isSitting())) { - // volume decreases by itself gAudiop->mMaxWindGain = 0.f; } // mute wind when not /*flying*/ in air diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index 041e804e7..3247d6884 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -751,6 +751,7 @@ void LLViewerCamera::setDefaultFOV(F32 vertical_fov_rads) // void LLViewerCamera::loadDefaultFOV() { + if (mSavedFOVLoaded) return; setView(mSavedFOVDefault); mSavedFOVLoaded = true; mCameraFOVDefault = mSavedFOVDefault; diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index 4971d52be..479b877ad 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -579,7 +579,7 @@ void LLViewerJoystick::cursorSlide(F32 inc) void LLViewerJoystick::cursorPush(F32 inc) { static F32 prev_inc = 0.f; // Smooth a little. - if (!is_approx_zero(0.001f)) + if (!is_approx_zero(inc)) { S32 x, y; LLUI::getMousePositionScreen(&x, &y); diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 5104f7972..c756354d8 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -45,7 +45,8 @@ #include "lltoolfocus.h" #include "llviewerwindow.h" #include "llvoavatarself.h" -#include "lllslconstants.h" + +void handle_reset_view(); // // Constants @@ -59,6 +60,11 @@ const S32 NUDGE_FRAMES = 2; const F32 ORBIT_NUDGE_RATE = 0.05f; // fraction of normal speed const F32 YAW_NUDGE_RATE = 0.05f; // fraction of normal speed +struct LLKeyboardActionRegistry +: public LLRegistrySingleton, LLKeyboardActionRegistry> +{ +}; + LLViewerKeyboard gViewerKeyboard; void agent_jump( EKeystate s ) @@ -66,6 +72,7 @@ void agent_jump( EKeystate s ) if( KEYSTATE_UP == s ) return; F32 time = gKeyboard->getCurKeyElapsedTime(); S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount()); + if( time < FLY_TIME || frame_count <= FLY_FRAMES || gAgent.upGrabbed() @@ -81,9 +88,9 @@ void agent_jump( EKeystate s ) } void agent_toggle_down( EKeystate s ) { - if(KEYSTATE_UP == s) return; - - if(KEYSTATE_DOWN == s && !gAgent.getFlying() && gSavedSettings.getBOOL("SGShiftCrouchToggle")) + if (KEYSTATE_UP == s) return; + + if (KEYSTATE_DOWN == s && !gAgent.getFlying() && gSavedSettings.getBOOL("SGShiftCrouchToggle")) { gAgent.toggleCrouch(); } @@ -242,7 +249,7 @@ void agent_toggle_fly( EKeystate s ) // Only catch the edge if (KEYSTATE_DOWN == s ) { - gAgent.toggleFlying(); + LLAgent::toggleFlying(); } } @@ -252,7 +259,7 @@ F32 get_orbit_rate() if( time < NUDGE_TIME ) { F32 rate = ORBIT_NUDGE_RATE + time * (1 - ORBIT_NUDGE_RATE)/ NUDGE_TIME; - //llinfos << rate << llendl; + //LL_INFOS() << rate << LL_ENDL; return rate; } else @@ -517,6 +524,11 @@ void stop_moving( EKeystate s ) void start_chat( EKeystate s ) { + if (LLAppViewer::instance()->quitRequested()) + { + return; // can't talk, gotta go, kthxbye! + } + // start chat gChatBar->startChat(NULL); } @@ -540,53 +552,52 @@ void start_gesture( EKeystate s ) } } -void bind_keyboard_functions() -{ - gViewerKeyboard.bindNamedFunction("jump", agent_jump); - gViewerKeyboard.bindNamedFunction("push_down", agent_push_down); - gViewerKeyboard.bindNamedFunction("push_forward", agent_push_forward); - gViewerKeyboard.bindNamedFunction("push_backward", agent_push_backward); - gViewerKeyboard.bindNamedFunction("look_up", agent_look_up); - gViewerKeyboard.bindNamedFunction("look_down", agent_look_down); - gViewerKeyboard.bindNamedFunction("toggle_down", agent_toggle_down); - gViewerKeyboard.bindNamedFunction("toggle_fly", agent_toggle_fly); - gViewerKeyboard.bindNamedFunction("turn_left", agent_turn_left); - gViewerKeyboard.bindNamedFunction("turn_right", agent_turn_right); - gViewerKeyboard.bindNamedFunction("slide_left", agent_slide_left); - gViewerKeyboard.bindNamedFunction("slide_right", agent_slide_right); - gViewerKeyboard.bindNamedFunction("spin_around_ccw", camera_spin_around_ccw); - gViewerKeyboard.bindNamedFunction("spin_around_cw", camera_spin_around_cw); - gViewerKeyboard.bindNamedFunction("spin_around_ccw_sitting", camera_spin_around_ccw_sitting); - gViewerKeyboard.bindNamedFunction("spin_around_cw_sitting", camera_spin_around_cw_sitting); - gViewerKeyboard.bindNamedFunction("spin_over", camera_spin_over); - gViewerKeyboard.bindNamedFunction("spin_under", camera_spin_under); - gViewerKeyboard.bindNamedFunction("spin_over_sitting", camera_spin_over_sitting); - gViewerKeyboard.bindNamedFunction("spin_under_sitting", camera_spin_under_sitting); - gViewerKeyboard.bindNamedFunction("move_forward", camera_move_forward); - gViewerKeyboard.bindNamedFunction("move_backward", camera_move_backward); - gViewerKeyboard.bindNamedFunction("move_forward_sitting", camera_move_forward_sitting); - gViewerKeyboard.bindNamedFunction("move_backward_sitting", camera_move_backward_sitting); - gViewerKeyboard.bindNamedFunction("pan_up", camera_pan_up); - gViewerKeyboard.bindNamedFunction("pan_down", camera_pan_down); - gViewerKeyboard.bindNamedFunction("pan_left", camera_pan_left); - gViewerKeyboard.bindNamedFunction("pan_right", camera_pan_right); - gViewerKeyboard.bindNamedFunction("pan_in", camera_pan_in); - gViewerKeyboard.bindNamedFunction("pan_out", camera_pan_out); - gViewerKeyboard.bindNamedFunction("move_forward_fast", camera_move_forward_fast); - gViewerKeyboard.bindNamedFunction("move_backward_fast", camera_move_backward_fast); - gViewerKeyboard.bindNamedFunction("edit_avatar_spin_ccw", edit_avatar_spin_ccw); - gViewerKeyboard.bindNamedFunction("edit_avatar_spin_cw", edit_avatar_spin_cw); - gViewerKeyboard.bindNamedFunction("edit_avatar_spin_over", edit_avatar_spin_over); - gViewerKeyboard.bindNamedFunction("edit_avatar_spin_under", edit_avatar_spin_under); - gViewerKeyboard.bindNamedFunction("edit_avatar_move_forward", edit_avatar_move_forward); - gViewerKeyboard.bindNamedFunction("edit_avatar_move_backward", edit_avatar_move_backward); - gViewerKeyboard.bindNamedFunction("stop_moving", stop_moving); - gViewerKeyboard.bindNamedFunction("start_chat", start_chat); - gViewerKeyboard.bindNamedFunction("start_gesture", start_gesture); -} +#define REGISTER_KEYBOARD_ACTION(KEY, ACTION) LLREGISTER_STATIC(LLKeyboardActionRegistry, KEY, ACTION); +REGISTER_KEYBOARD_ACTION("jump", agent_jump); +REGISTER_KEYBOARD_ACTION("push_down", agent_push_down); +REGISTER_KEYBOARD_ACTION("push_forward", agent_push_forward); +REGISTER_KEYBOARD_ACTION("push_backward", agent_push_backward); +REGISTER_KEYBOARD_ACTION("look_up", agent_look_up); +REGISTER_KEYBOARD_ACTION("look_down", agent_look_down); +REGISTER_KEYBOARD_ACTION("toggle_down", agent_toggle_down); +REGISTER_KEYBOARD_ACTION("toggle_fly", agent_toggle_fly); +REGISTER_KEYBOARD_ACTION("turn_left", agent_turn_left); +REGISTER_KEYBOARD_ACTION("turn_right", agent_turn_right); +REGISTER_KEYBOARD_ACTION("slide_left", agent_slide_left); +REGISTER_KEYBOARD_ACTION("slide_right", agent_slide_right); +REGISTER_KEYBOARD_ACTION("spin_around_ccw", camera_spin_around_ccw); +REGISTER_KEYBOARD_ACTION("spin_around_cw", camera_spin_around_cw); +REGISTER_KEYBOARD_ACTION("spin_around_ccw_sitting", camera_spin_around_ccw_sitting); +REGISTER_KEYBOARD_ACTION("spin_around_cw_sitting", camera_spin_around_cw_sitting); +REGISTER_KEYBOARD_ACTION("spin_over", camera_spin_over); +REGISTER_KEYBOARD_ACTION("spin_under", camera_spin_under); +REGISTER_KEYBOARD_ACTION("spin_over_sitting", camera_spin_over_sitting); +REGISTER_KEYBOARD_ACTION("spin_under_sitting", camera_spin_under_sitting); +REGISTER_KEYBOARD_ACTION("move_forward", camera_move_forward); +REGISTER_KEYBOARD_ACTION("move_backward", camera_move_backward); +REGISTER_KEYBOARD_ACTION("move_forward_sitting", camera_move_forward_sitting); +REGISTER_KEYBOARD_ACTION("move_backward_sitting", camera_move_backward_sitting); +REGISTER_KEYBOARD_ACTION("pan_up", camera_pan_up); +REGISTER_KEYBOARD_ACTION("pan_down", camera_pan_down); +REGISTER_KEYBOARD_ACTION("pan_left", camera_pan_left); +REGISTER_KEYBOARD_ACTION("pan_right", camera_pan_right); +REGISTER_KEYBOARD_ACTION("pan_in", camera_pan_in); +REGISTER_KEYBOARD_ACTION("pan_out", camera_pan_out); +REGISTER_KEYBOARD_ACTION("move_forward_fast", camera_move_forward_fast); +REGISTER_KEYBOARD_ACTION("move_backward_fast", camera_move_backward_fast); +REGISTER_KEYBOARD_ACTION("edit_avatar_spin_ccw", edit_avatar_spin_ccw); +REGISTER_KEYBOARD_ACTION("edit_avatar_spin_cw", edit_avatar_spin_cw); +REGISTER_KEYBOARD_ACTION("edit_avatar_spin_over", edit_avatar_spin_over); +REGISTER_KEYBOARD_ACTION("edit_avatar_spin_under", edit_avatar_spin_under); +REGISTER_KEYBOARD_ACTION("edit_avatar_move_forward", edit_avatar_move_forward); +REGISTER_KEYBOARD_ACTION("edit_avatar_move_backward", edit_avatar_move_backward); +REGISTER_KEYBOARD_ACTION("stop_moving", stop_moving); +REGISTER_KEYBOARD_ACTION("start_chat", start_chat); +REGISTER_KEYBOARD_ACTION("start_gesture", start_gesture); +REGISTER_KEYBOARD_ACTION("reset_camera", boost::bind(handle_reset_view)); +#undef REGISTER_KEYBOARD_ACTION -LLViewerKeyboard::LLViewerKeyboard() : - mNamedFunctionCount(0) +LLViewerKeyboard::LLViewerKeyboard() { for (S32 i = 0; i < MODE_COUNT; i++) { @@ -604,16 +615,6 @@ LLViewerKeyboard::LLViewerKeyboard() : } } - -void LLViewerKeyboard::bindNamedFunction(const std::string& name, LLKeyFunc func) -{ - S32 i = mNamedFunctionCount; - mNamedFunctions[i].mName = name; - mNamedFunctions[i].mFunction = func; - mNamedFunctionCount++; -} - - BOOL LLViewerKeyboard::modeFromString(const std::string& string, S32 *mode) { if (string == "FIRST_PERSON") @@ -667,17 +668,21 @@ BOOL LLViewerKeyboard::handleKey(KEY translated_key, MASK translated_mask, BOOL return FALSE; } - lldebugst(LLERR_USER_INPUT) << "keydown -" << translated_key << "-" << llendl; + LL_DEBUGS("UserInput") << "keydown -" << translated_key << "-" << LL_ENDL; // skip skipped keys if(mKeysSkippedByUI.find(translated_key) != mKeysSkippedByUI.end()) { mKeyHandledByUI[translated_key] = FALSE; + LL_INFOS("Keyboard Handling") << "Key wasn't handled by UI!" << LL_ENDL; } else { // it is sufficient to set this value once per call to handlekey // without clearing it, as it is only used in the subsequent call to scanKey mKeyHandledByUI[translated_key] = gViewerWindow->handleKey(translated_key, translated_mask); + // mKeyHandledByUI is not what you think ... this indicates whether the UI has handled this keypress yet (any keypress) + // NOT whether some UI shortcut wishes to handle the keypress + } return mKeyHandledByUI[translated_key]; } @@ -686,8 +691,9 @@ BOOL LLViewerKeyboard::handleKey(KEY translated_key, MASK translated_mask, BOOL BOOL LLViewerKeyboard::bindKey(const S32 mode, const KEY key, const MASK mask, const std::string& function_name) { - S32 i,index; - void (*function)(EKeystate keystate) = NULL; + S32 index; + typedef boost::function function_t; + function_t function = NULL; std::string name; // Allow remapping of F2-F12 @@ -710,13 +716,11 @@ BOOL LLViewerKeyboard::bindKey(const S32 mode, const KEY key, const MASK mask, c } // Not remapped, look for a function - for (i = 0; i < mNamedFunctionCount; i++) + + function_t* result = LLKeyboardActionRegistry::getValue(function_name); + if (result) { - if (function_name == mNamedFunctions[i].mName) - { - function = mNamedFunctions[i].mFunction; - name = mNamedFunctions[i].mName; - } + function = *result; } if (!function) @@ -740,13 +744,12 @@ BOOL LLViewerKeyboard::bindKey(const S32 mode, const KEY key, const MASK mask, c if (mode >= MODE_COUNT) { - llerror("LLKeyboard::bindKey() - unknown mode passed", mode); + llerrs << "LLKeyboard::bindKey() - unknown mode passed" << mode << llendl; return FALSE; } mBindings[mode][index].mKey = key; mBindings[mode][index].mMask = mask; -// mBindings[mode][index].mName = name; mBindings[mode][index].mFunction = function; if (index == mBindingCount[mode]) @@ -911,18 +914,18 @@ void LLViewerKeyboard::scanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_lev if (key_down && !repeat) { // ...key went down this frame, call function - (*binding[i].mFunction)( KEYSTATE_DOWN ); + binding[i].mFunction( KEYSTATE_DOWN ); } else if (key_up) { // ...key went down this frame, call function - (*binding[i].mFunction)( KEYSTATE_UP ); + binding[i].mFunction( KEYSTATE_UP ); } else if (key_level) { // ...key held down from previous frame // Not windows, just call the function. - (*binding[i].mFunction)( KEYSTATE_LEVEL ); + binding[i].mFunction( KEYSTATE_LEVEL ); }//if }//if }//for diff --git a/indra/newview/llviewerkeyboard.h b/indra/newview/llviewerkeyboard.h index 56a31b18d..1893b6aee 100644 --- a/indra/newview/llviewerkeyboard.h +++ b/indra/newview/llviewerkeyboard.h @@ -61,7 +61,6 @@ typedef enum e_keyboard_mode void bind_keyboard_functions(); - class LLViewerKeyboard { public: @@ -69,10 +68,8 @@ public: BOOL handleKey(KEY key, MASK mask, BOOL repeated); - void bindNamedFunction(const std::string& name, LLKeyFunc func); - S32 loadBindings(const std::string& filename); // returns number bound, 0 on error - void unloadBindings(); + void unloadBindings(); EKeyboardMode getMode(); BOOL modeFromString(const std::string& string, S32 *mode); // False on failure @@ -80,8 +77,6 @@ public: void scanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level); protected: BOOL bindKey(const S32 mode, const KEY key, const MASK mask, const std::string& function_name); - S32 mNamedFunctionCount; - LLNamedFunction mNamedFunctions[MAX_NAMED_FUNCTIONS]; // Hold all the ugly stuff torn out to make LLKeyboard non-viewer-specific here S32 mBindingCount[MODE_COUNT]; @@ -95,4 +90,5 @@ protected: extern LLViewerKeyboard gViewerKeyboard; void agent_push_forward(EKeystate s); + #endif // LL_LLVIEWERKEYBOARD_H diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index fd3346160..444247924 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -755,7 +755,7 @@ void init_menus() ins = gMenuBarView->getChildView("insert_admin", true, false); ins->setVisible(false);*/ - LLEnvManagerNew::instance().setRegionChangeCallback(®ion_change); + gAgent.addRegionChangedCallback(®ion_change); } @@ -2818,24 +2818,27 @@ bool handle_go_to() std::vector strings; std::string val; LLVector3d pos = LLToolPie::getInstance()->getPick().mPosGlobal; - val = llformat("%g", pos.mdV[VX]); + val = llformat("%.9g", pos.mdV[VX]); strings.push_back(val); - val = llformat("%g", pos.mdV[VY]); + val = llformat("%.9g", pos.mdV[VY]); strings.push_back(val); - val = llformat("%g", pos.mdV[VZ]); + val = llformat("%.9g", pos.mdV[VZ]); strings.push_back(val); send_generic_message("autopilot", strings); LLViewerParcelMgr::getInstance()->deselectLand(); - if (isAgentAvatarValid() && !gSavedSettings.getBOOL("AutoPilotLocksCamera")) + if (gSavedSettings.getBOOL("SinguMotionResetsCamera")) { - gAgentCamera.setFocusGlobal(gAgentCamera.getFocusTargetGlobal(), gAgentAvatarp->getID()); - } - else - { - // Snap camera back to behind avatar - gAgentCamera.setFocusOnAvatar(TRUE, ANIMATE); + if (!gSavedSettings.getBOOL("AutoPilotLocksCamera")) + { + gAgentCamera.setFocusGlobal(gAgentCamera.getFocusTargetGlobal(), gAgentID); + } + else + { + // Snap camera back to behind avatar + gAgentCamera.setFocusOnAvatar(TRUE, ANIMATE); + } } // Could be first use @@ -2927,6 +2930,7 @@ class LLObjectImportUpload : public view_listener_t //--------------------------------------------------------------------------- // Parcel freeze, eject, etc. //--------------------------------------------------------------------------- +void send_freeze(const LLUUID& avatar_id, bool freeze); bool callback_freeze(const LLSD& notification, const LLSD& response) { LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID(); @@ -2934,27 +2938,7 @@ bool callback_freeze(const LLSD& notification, const LLSD& response) if (0 == option || 1 == option) { - U32 flags = KICK_FLAGS_FREEZE; - if (1 == option) - { - // unfreeze - flags |= KICK_FLAGS_UNFREEZE; - } - - LLMessageSystem* msg = gMessageSystem; - LLVOAvatar* avatarp = gObjectList.findAvatar(avatar_id); - - if (avatarp && avatarp->getRegion()) - { - msg->newMessage("FreezeUser"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID()); - msg->addUUID("SessionID", gAgent.getSessionID()); - msg->nextBlock("Data"); - msg->addUUID("TargetID", avatar_id ); - msg->addU32("Flags", flags ); - msg->sendReliable( avatarp->getRegion()->getHost() ); - } + send_freeze(avatar_id, !option); } return false; } @@ -3981,17 +3965,7 @@ class LLWorldEnableFly : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - BOOL sitting = FALSE; - static LLCachedControl continue_flying_on_unsit("LiruContinueFlyingOnUnsit"); - if (continue_flying_on_unsit) - { - sitting = false; - } - else if (gAgentAvatarp) - { - sitting = gAgentAvatarp->isSitting(); - } - gMenuHolder->findControl(userdata["control"].asString())->setValue(!sitting); + gMenuHolder->findControl(userdata["control"].asString())->setValue(gAgent.enableFlying()); return true; } }; @@ -9062,7 +9036,7 @@ class ListInviteToGroup : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLAvatarActions::inviteToGroup(get_focused_list_id_selected()); + LLAvatarActions::inviteToGroup(get_focused_list_ids_selected()); return true; } }; @@ -9112,6 +9086,15 @@ class ListRequestTeleport : public view_listener_t } }; +class ListShare : public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + LLAvatarActions::share(get_focused_list_id_selected()); + return true; + } +}; + class ListShowProfile : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) @@ -9566,6 +9549,7 @@ void initialize_menus() addMenu(new ListRemoveFriend(), "List.RemoveFriend"); addMenu(new ListRequestFriendship(), "List.RequestFriendship"); addMenu(new ListRequestTeleport(), "List.RequestTeleport"); + addMenu(new ListShare(), "List.Share"); addMenu(new ListShowProfile(), "List.ShowProfile"); addMenu(new ListShowWebProfile(), "List.ShowWebProfile"); addMenu(new ListStartAdhocCall(), "List.StartAdhocCall"); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 301a461f7..c6e2fdc86 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -1177,8 +1177,7 @@ bool upload_new_resource( const std::string& display_name, LLAssetStorage::LLStoreAssetCallback callback, S32 expected_upload_cost, - void *userdata, - void (*callback2)(bool, void*)) + void *userdata) { if(gDisconnected) { @@ -1230,9 +1229,7 @@ bool upload_new_resource( new LLNewAgentInventoryResponder( body, uuid, - asset_type, - callback2, - userdata)); + asset_type)); } else { @@ -1294,17 +1291,16 @@ bool upload_new_resource( LLAssetID generate_asset_id_for_new_upload(const LLTransactionID& tid) { - LLAssetID uuid; - if (gDisconnected) { - uuid.setNull(); - } - else - { - uuid = tid.makeAssetID(gAgent.getSecureSessionID()); + LLAssetID rv; + + rv.setNull(); + return rv; } + LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID()); + return uuid; } diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index 65ff1a425..4eefa6a93 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -78,8 +78,7 @@ bool upload_new_resource(const LLTransactionID &tid, const std::string& display_name, LLAssetStorage::LLStoreAssetCallback callback, S32 expected_upload_cost, - void *userdata, - void (*callback2)(bool, void*) = NULL); + void *userdata); // The default callback functions, called when 'callback' == NULL (for normal and temporary uploads). // user_data must be a LLResourceData allocated with new (or NULL). diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 1c5ed208f..396fe12d5 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -657,13 +657,14 @@ bool join_group_response(const LLSD& notification, const LLSD& response) LLNotificationsUtil::add("JoinGroup", args, notification["payload"]); return false; } + if(option == 0 && !group_id.isNull()) { // check for promotion or demotion. S32 max_groups = gHippoLimits->getMaxAgentGroups(); if(gAgent.isInGroup(group_id)) ++max_groups; - if(gAgent.mGroups.count() < max_groups) + if((S32)gAgent.mGroups.size() < max_groups) { accept_invite = true; } @@ -1261,6 +1262,7 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam LLInventoryView::showAgentInventory(TRUE); } + if (!gSavedSettings.getBOOL("LiruHighlightNewInventory")) return; //////////////////////////////////////////////////////////////////////////////// // Highlight item LL_DEBUGS("Messaging") << "Highlighting" << obj_id << LL_ENDL; @@ -2260,7 +2262,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) BOOL accept_im_from_only_friend = gSavedSettings.getBOOL("InstantMessagesFriendsOnly"); LLUUID computed_session_id = LLIMMgr::computeSessionID(dialog,from_id); - + chat.mMuted = is_muted && !is_linden; chat.mFromID = from_id; chat.mFromName = name; @@ -2462,8 +2464,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLGiveInventory::doGiveInventoryItem(from_id, item, computed_session_id); if (show_autoresponded) { - gIMMgr->addMessage(computed_session_id, from_id, name, - llformat("%s %s \"%s\"", pns_name.c_str(), LLTrans::getString("IM_autoresponse_sent_item").c_str(), item->getName().c_str())); + gIMMgr->addMessage(computed_session_id, from_id, name, + llformat("%s %s \"%s\"", pns_name.c_str(), LLTrans::getString("IM_autoresponse_sent_item").c_str(), item->getName().c_str())); } } } @@ -2634,7 +2636,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if (show_autoresponded) { gIMMgr->addMessage(computed_session_id, from_id, name, - llformat("%s %s \"%s\"", pns_name.c_str(), LLTrans::getString("IM_autoresponse_sent_item").c_str(), item->getName().c_str())); + llformat("%s %s \"%s\"", pns_name.c_str(), LLTrans::getString("IM_autoresponse_sent_item").c_str(), item->getName().c_str())); } } } @@ -5848,8 +5850,7 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data) // Forcing turning off flying here to prevent flying after pressing "Stand" // to stand up from an object. See EXT-1655. // Unless the user wants to. - static LLCachedControl ContinueFlying("LiruContinueFlyingOnUnsit"); - if (!ContinueFlying) + if (!gSavedSettings.getBOOL("LiruContinueFlyingOnUnsit")) gAgent.setFlying(FALSE); LLViewerObject* object = gObjectList.findObject(sitObjectID); diff --git a/indra/newview/llviewerobjectbackup.cpp b/indra/newview/llviewerobjectbackup.cpp index a24a8b231..e8072a5cf 100644 --- a/indra/newview/llviewerobjectbackup.cpp +++ b/indra/newview/llviewerobjectbackup.cpp @@ -29,76 +29,60 @@ #include "llviewerprecompiledheaders.h" -// system library includes #include #include #include -// linden library includes -#include "indra_constants.h" -#include "llapr.h" #include "llcallbacklist.h" #include "lldir.h" #include "lleconomy.h" #include "llhttpclient.h" -#include "llimage.h" +#include "llinventorydefines.h" #include "llimagej2c.h" #include "lllfsthread.h" #include "llnotificationsutil.h" #include "llsdserialize.h" -#include "llsdutil.h" #include "llsdutil_math.h" #include "lltransactiontypes.h" -#include "llinventorydefines.h" +#include "lluictrlfactory.h" +#include "lluploaddialog.h" -// newview includes #include "llagent.h" #include "llappviewer.h" #include "llassetuploadresponders.h" -#include "statemachine/aifilepicker.h" -#include "llfloaterbvhpreview.h" -#include "llfloaterbuycurrency.h" -#include "llfloaterimagepreview.h" -#include "llfloaternamedesc.h" -#include "llfloatersnapshot.h" -#include "llinventorymodel.h" // gInventory #include "llinventoryfunctions.h" -#include "llresourcedata.h" +#include "llinventorymodel.h" // for gInventory #include "llmaterialmgr.h" #include "llselectmgr.h" -#include "llstatusbar.h" #include "lltexturecache.h" #include "lltoolplacer.h" -#include "lluictrlfactory.h" -#include "lluploaddialog.h" #include "llviewercontrol.h" #include "llviewertexturelist.h" #include "llviewerobjectlist.h" #include "llviewermenu.h" +#include "lfsimfeaturehandler.h" #include "llviewerregion.h" -#include "llviewerstats.h" #include "llviewerwindow.h" -#include "hippogridmanager.h" -#include "lfsimfeaturehandler.h" - -#include "llviewerobjectbackup.h" - -LLObjectBackup* LLObjectBackup::sInstance = NULL; +#include "llviewerobjectbackup.h" // Note: these default textures are initialized with hard coded values to // prevent cheating. When not in SL, the user-configurable values are used // instead (see setDefaultTextures() below). -static LLUUID LL_TEXTURE_PLYWOOD = LLUUID("89556747-24cb-43ed-920b-47caed15465f"); -static LLUUID LL_TEXTURE_BLANK = LLUUID("5748decc-f629-461c-9a36-a35a221fe21f"); -static LLUUID LL_TEXTURE_INVISIBLE = LLUUID("38b86f85-2575-52a9-a531-23108d8da837"); -static LLUUID LL_TEXTURE_TRANSPARENT = LLUUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"); -static LLUUID LL_TEXTURE_MEDIA = LLUUID("8b5fec65-8d8d-9dc5-cda8-8fdf2716e361"); +LLUUID LL_TEXTURE_PLYWOOD = LLUUID("89556747-24cb-43ed-920b-47caed15465f"); +LLUUID LL_TEXTURE_BLANK = LLUUID("5748decc-f629-461c-9a36-a35a221fe21f"); +LLUUID LL_TEXTURE_INVISIBLE = LLUUID("38b86f85-2575-52a9-a531-23108d8da837"); +LLUUID LL_TEXTURE_TRANSPARENT = LLUUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"); +LLUUID LL_TEXTURE_MEDIA = LLUUID("8b5fec65-8d8d-9dc5-cda8-8fdf2716e361"); -class importResponder : public LLNewAgentInventoryResponder +class ImportObjectResponder: public LLNewAgentInventoryResponder { +protected: + LOG_CLASS(ImportObjectResponder); + public: - importResponder(const LLSD& post_data, const LLUUID& vfile_id, LLAssetType::EType asset_type) + ImportObjectResponder(const LLSD& post_data, const LLUUID& vfile_id, + LLAssetType::EType asset_type) : LLNewAgentInventoryResponder(post_data, vfile_id, asset_type) { } @@ -106,10 +90,18 @@ public: //virtual virtual void uploadComplete(const LLSD& content) { - LL_DEBUGS("ObjectBackup") << "LLNewAgentInventoryResponder::result from capabilities" << LL_ENDL; + LLObjectBackup* self = LLObjectBackup::findInstance(); + if (!self) + { + llwarns << "Import aborted, LLObjectBackup instance gone !" + << llendl; + // remove the "Uploading..." message + LLUploadDialog::modalUploadFinished(); + return; + } LLAssetType::EType asset_type = LLAssetType::lookup(mPostData["asset_type"].asString()); - LLInventoryType::EType inventory_type = LLInventoryType::lookup(mPostData["inventory_type"].asString()); + LLInventoryType::EType inv_type = LLInventoryType::lookup(mPostData["inventory_type"].asString()); // Update L$ and ownership credit information // since it probably changed on the server @@ -117,18 +109,19 @@ public: asset_type == LLAssetType::AT_SOUND || asset_type == LLAssetType::AT_ANIMATION) { - gMessageSystem->newMessageFast(_PREHASH_MoneyBalanceRequest); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgentID); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgentSessionID); - gMessageSystem->nextBlockFast(_PREHASH_MoneyData); - gMessageSystem->addUUIDFast(_PREHASH_TransactionID, LLUUID::null ); + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_MoneyBalanceRequest); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgentID); + msg->addUUIDFast(_PREHASH_SessionID, gAgentSessionID); + msg->nextBlockFast(_PREHASH_MoneyData); + msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); gAgent.sendReliableMessage(); } // Actually add the upload to viewer inventory - LL_INFOS("ObjectBackup") << "Adding " << content["new_inventory_item"].asUUID() << " " - << content["new_asset"].asUUID() << " to inventory." << LL_ENDL; + llinfos << "Adding " << content["new_inventory_item"].asUUID() << " " + << content["new_asset"].asUUID() << " to inventory." << llendl; if (mPostData["folder_id"].asUUID().notNull()) { LLPermissions perm; @@ -144,13 +137,12 @@ public: } perm.initMasks(PERM_ALL, PERM_ALL, PERM_NONE, PERM_NONE, next_owner_perm); S32 creation_date_now = time_corrected(); - LLPointer item - = new LLViewerInventoryItem(content["new_inventory_item"].asUUID(), + LLPointer item; + item = new LLViewerInventoryItem(content["new_inventory_item"].asUUID(), mPostData["folder_id"].asUUID(), perm, content["new_asset"].asUUID(), - asset_type, - inventory_type, + asset_type, inv_type, mPostData["name"].asString(), mPostData["description"].asString(), LLSaleInfo::DEFAULT, @@ -161,35 +153,43 @@ public: } else { - LL_WARNS("ObjectBackup") << "Can't find a folder to put it into" << LL_ENDL; + llwarns << "Can't find a folder to put it into" << llendl; } // remove the "Uploading..." message LLUploadDialog::modalUploadFinished(); - LLObjectBackup::getInstance()->updateMap(content["new_asset"].asUUID()); - LLObjectBackup::getInstance()->uploadNextAsset(); + self->updateMap(content["new_asset"].asUUID()); + self->uploadNextAsset(); } /*virtual*/ char const* getName(void) const { return "importResponder"; } }; -class CacheReadResponder : public LLTextureCache::ReadResponder +class BackupCacheReadResponder : public LLTextureCache::ReadResponder { +protected: + LOG_CLASS(BackupCacheReadResponder); + public: - CacheReadResponder(const LLUUID& id, LLImageFormatted* image) + BackupCacheReadResponder(const LLUUID& id, LLImageFormatted* image) : mFormattedImage(image), mID(id) { setImage(image); } - void setData(U8* data, S32 datasize, S32 imagesize, S32 imageformat, BOOL imagelocal) + void setData(U8* data, S32 datasize, S32 imagesize, S32 imageformat, + BOOL imagelocal) { + LLObjectBackup* self = LLObjectBackup::findInstance(); + if (!self) return; + if (imageformat == IMG_CODEC_TGA && mFormattedImage->getCodec() == IMG_CODEC_J2C) { - LL_WARNS("ObjectBackup") << "FAILED: texture " << mID << " is formatted as TGA. Not saving." << LL_ENDL; - LLObjectBackup::getInstance()->mNonExportedTextures |= LLObjectBackup::TEXTURE_BAD_ENCODING; + llwarns << "FAILED: texture " << mID + << " is formatted as TGA. Not saving." << llendl; + self->mNonExportedTextures |= LLObjectBackup::TEXTURE_BAD_ENCODING; mFormattedImage = NULL; mImageSize = 0; return; @@ -197,8 +197,20 @@ public: if (mFormattedImage.notNull()) { - llassert_always(mFormattedImage->getCodec() == imageformat); - mFormattedImage->appendData(data, datasize); + if (mFormattedImage->getCodec() == imageformat) + { + mFormattedImage->appendData(data, datasize); + } + else + { + llwarns << "FAILED: texture " << mID + << " is formatted as " << mFormattedImage->getCodec() + << " while expecting " << imageformat + << ". Not saving." << llendl; + mFormattedImage = NULL; + mImageSize = 0; + return; + } } else { @@ -211,34 +223,42 @@ public: virtual void completed(bool success) { + LLObjectBackup* self = LLObjectBackup::findInstance(); + if (!self) + { + llwarns << "Export aborted, LLObjectBackup instance gone !" + << llendl; + return; + } + if (success && mFormattedImage.notNull() && mImageSize > 0) { - LL_INFOS("ObjectBackup") << "SUCCESS getting texture " << mID << LL_ENDL; + llinfos << "SUCCESS getting texture " << mID << llendl; std::string name; mID.toString(name); - name = LLObjectBackup::getInstance()->getfolder() + "//" + name; - LL_INFOS("ObjectBackup") << "Saving to " << name << LL_ENDL; + name = self->getFolder() + "//" + name; + llinfos << "Saving to " << name << llendl; if (!mFormattedImage->save(name)) { - LL_WARNS("ObjectBackup") << "FAILED to save texture " << mID << LL_ENDL; - LLObjectBackup::getInstance()->mNonExportedTextures |= LLObjectBackup::TEXTURE_SAVED_FAILED; + llwarns << "FAILED to save texture " << mID << llendl; + self->mNonExportedTextures |= LLObjectBackup::TEXTURE_SAVED_FAILED; } } else { if (!success) { - LL_WARNS("ObjectBackup") << "FAILED to get texture " << mID << LL_ENDL; - LLObjectBackup::getInstance()->mNonExportedTextures |= LLObjectBackup::TEXTURE_MISSING; + llwarns << "FAILED to get texture " << mID << llendl; + self->mNonExportedTextures |= LLObjectBackup::TEXTURE_MISSING; } if (mFormattedImage.isNull()) { - LL_WARNS("ObjectBackup") << "FAILED: NULL texture " << mID << LL_ENDL; - LLObjectBackup::getInstance()->mNonExportedTextures |= LLObjectBackup::TEXTURE_IS_NULL; + llwarns << "FAILED: NULL texture " << mID << llendl; + self->mNonExportedTextures |= LLObjectBackup::TEXTURE_IS_NULL; } } - LLObjectBackup::getInstance()->mCheckNextTexture = true; + self->mCheckNextTexture = true; } private: @@ -246,62 +266,70 @@ private: LLUUID mID; }; -LLObjectBackup::LLObjectBackup() -: LLFloater(std::string("Object Backup Floater"), std::string("FloaterObjectBackuptRect"), LLStringUtil::null) +LLObjectBackup::LLObjectBackup(const LLSD&) +: mRunning(false), + mRetexture(false), + mTexturesList(), + mAssetMap(), + mCurrentAsset() { //buildFromFile("floater_object.xml"); - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_object_backup.xml", NULL, false); - mRunning = false; - mTexturesList.clear(); - mAssetMap.clear(); - mCurrentAsset.setNull(); - mRetexture = false; -} - -//////////////////////////////////////////////////////////////////////////////// -// -LLObjectBackup* LLObjectBackup::getInstance() -{ - if (!sInstance) - { - sInstance = new LLObjectBackup(); - } - return sInstance; + LLUICtrlFactory::getInstance()->buildFloater(this, + "floater_object_backup.xml", + NULL, false); // Don't open } +//virtual LLObjectBackup::~LLObjectBackup() { - // save position of floater - gSavedSettings.setRect("FloaterObjectBackuptRect", getRect()); - sInstance = NULL; + // Just in case we got closed unexpectedly... + if (gIdleCallbacks.containsFunction(exportWorker)) + { + gIdleCallbacks.deleteFunction(exportWorker); + } } -void LLObjectBackup::show(bool exporting) +//static +bool LLObjectBackup::confirmCloseCallback(const LLSD& notification, + const LLSD& response) { - // set the title - if (exporting) + if (LLNotification::getSelectedOption(notification, response) == 0) { - setTitle("Object export"); + LLObjectBackup* self = findInstance(); + if (self) + { + self->destroy(); + } + } + return false; +} + +//virtual +void LLObjectBackup::onClose(bool app_quitting) +{ + // Do not destroy the floater on user close action to avoid getting things + // messed up during import/export. + if (app_quitting) + { + destroy(); } else { - setTitle("Object import"); + LLNotificationsUtil::add("ConfirmAbortBackup", LLSD(), LLSD(), + confirmCloseCallback); } - mCurObject = 1; - mCurPrim = 0; - mObjects = 0; - mPrims = 0; - mRezCount = 0; - - // make floater appear - setVisibleAndFrontmost(); } -void LLObjectBackup::onClose(bool app_quitting) +void LLObjectBackup::showFloater(bool exporting) { - setVisible(false); - // HACK for fast XML iteration replace with: - // destroy(); + // Set the title + setTitle(getString(exporting ? "export" : "import")); + + mCurObject = 1; + mCurPrim = mObjects = mPrims = mRezCount = 0; + + // Make the floater pop up + setVisibleAndFrontmost(); } void LLObjectBackup::updateExportNumbers() @@ -322,7 +350,8 @@ void LLObjectBackup::updateImportNumbers() if (mRetexture) { - sstr << " Textures uploads remaining : " << mTexturesList.size() << "\n"; + sstr << " Textures uploads remaining : " << mTexturesList.size() + << "\n"; ctrl->setValue(LLSD("Text") = sstr.str()); } else @@ -392,6 +421,7 @@ void LLObjectBackup::setDefaultTextures() } } +//static bool LLObjectBackup::validatePerms(const LLPermissions* item_permissions) { return item_permissions->allowExportBy(gAgentID, LFSimFeatureHandler::instance().exportPolicy()); @@ -406,18 +436,16 @@ bool LLObjectBackup::validatePerms(const LLPermissions* item_permissions) // The "must be creator" stuff also goes against the usage in Linden Lab's own // official viewers, since those allow you to save full perm textures (such as // the textures in the Library), whoever is the actual creator... Go figure ! -LLUUID LLObjectBackup::validateTextureID(const LLUUID& asset_id) -{ - if (!gHippoGridManager->getConnectedGrid()->isSecondLife()) - { - // If we are not in Second Life, don't bother. - return asset_id; - } - if (mBadPermsTexturesList.count(asset_id)) +//static +bool LLObjectBackup::validateTexturePerms(const LLUUID& asset_id) +{ + if (LFSimFeatureHandler::instance().exportPolicy() == ep_full_perm) { - // We already checked it and know it's bad... - return LL_TEXTURE_PLYWOOD; + // If we are not in Second Life and we don't have export-permission + // support, don't bother and unconditionally accept the texture export + // (legacy behaviour). + return true; } if (asset_id == LL_TEXTURE_PLYWOOD || @@ -427,7 +455,7 @@ LLUUID LLObjectBackup::validateTextureID(const LLUUID& asset_id) asset_id == LL_TEXTURE_MEDIA) { // Allow to export a few default SL textures. - return asset_id; + return true; } LLViewerInventoryCategory::cat_array_t cats; @@ -444,32 +472,94 @@ LLUUID LLObjectBackup::validateTextureID(const LLUUID& asset_id) const LLPermissions item_permissions = items[i]->getPermissions(); if (validatePerms(&item_permissions)) { - return asset_id; + return true; } } } + return false; +} + +LLUUID LLObjectBackup::validateTextureID(const LLUUID& asset_id) +{ + if (mBadPermsTexturesList.count(asset_id)) + { + // We already checked it and know it's bad... + return LL_TEXTURE_PLYWOOD; + } + else if (asset_id.isNull() || validateTexturePerms(asset_id)) + { + return asset_id; + } + else { mBadPermsTexturesList.insert(asset_id); // Cache bad texture ID mNonExportedTextures |= TEXTURE_BAD_PERM; - LL_WARNS("ObjectBackup") << "Bad permissions for texture ID: " << asset_id - << " - Texture will not be exported." << LL_ENDL; + llwarns << "Bad permissions for texture ID: " << asset_id + << " - Texture will not be exported." << llendl; return LL_TEXTURE_PLYWOOD; } } +//static +bool LLObjectBackup::validateNode(LLSelectNode* node) +{ + LLPermissions* perms = node->mPermissions; + if (!perms || !validatePerms(perms)) + { + return false; + } + + // Additionally check if this is a sculpt or a mesh object and if yes, if + // we have export permission on the sclupt texture or the mesh object. + LLViewerObject* obj = node->getObject(); + if (!obj) // Paranoia + { + return false; + } + else if (obj->isSculpted()) + { + if (obj->isMesh()) + { + return false; // We can't export mesh from here, anyway. + } + else + { + LLSculptParams* params; + params = (LLSculptParams*)obj->getParameterEntry(LLNetworkData::PARAMS_SCULPT); + LLUUID sculpt_id = params->getSculptTexture(); + return validateTexturePerms(sculpt_id); + } + } + else + { + return true; + } +} //---------------------------------------------------------------------------// +//static void LLObjectBackup::exportWorker(void *userdata) { - getInstance()->updateExportNumbers(); + LLObjectBackup* self = findInstance(); + if (!self) + { + gIdleCallbacks.deleteFunction(exportWorker); + llwarns << "Export process aborted. LLObjectBackup instance gone !" + << llendl; + LLNotifications::instance().add("ExportAborted"); + return; + } - switch (getInstance()->mExportState) + self->updateExportNumbers(); + + switch (self->mExportState) { case EXPORT_INIT: { - getInstance()->show(true); + self->showFloater(true); + //LLSelectMgr::getInstance()->getSelection()->ref(); // Singu Note: Don't do this. // Fall through to EXPORT_CHECK_PERMS } case EXPORT_CHECK_PERMS: @@ -478,16 +568,17 @@ void LLObjectBackup::exportWorker(void *userdata) { virtual bool apply(LLSelectNode* node) { - return getInstance()->validatePerms(node->mPermissions); + return LLObjectBackup::validateNode(node); } } func; - LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + LLViewerObject* object; + object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if (object) { if (LLSelectMgr::getInstance()->getSelection()->applyToNodes(&func, false)) { - getInstance()->mExportState = EXPORT_FETCH_PHYSICS; + self->mExportState = EXPORT_FETCH_PHYSICS; } else { @@ -501,21 +592,21 @@ void LLObjectBackup::exportWorker(void *userdata) if (LLSelectMgr::getInstance()->getSelection()->applyToNodes(&func2, false)) { - LL_WARNS("ObjectBackup") << "Incorrect permission to export" << LL_ENDL; - getInstance()->mExportState = EXPORT_FAILED; + llwarns << "Incorrect permission to export" << llendl; + self->mExportState = EXPORT_FAILED; LLSelectMgr::getInstance()->getSelection()->unref(); } else { LL_DEBUGS("ObjectBackup") << "Nodes permissions not yet received, delaying..." << LL_ENDL; - getInstance()->mExportState = EXPORT_CHECK_PERMS; + self->mExportState = EXPORT_CHECK_PERMS; } } } else { - LLObjectBackup::getInstance()->mExportState = EXPORT_FAILED; + self->mExportState = EXPORT_ABORTED; LLSelectMgr::getInstance()->getSelection()->unref(); } break; @@ -525,9 +616,9 @@ void LLObjectBackup::exportWorker(void *userdata) { // Don't bother to try and fetch the extra physics flags if we // don't have sim support for them... - if (!getInstance()->mGotExtraPhysics) + if (!self->mGotExtraPhysics) { - getInstance()->mExportState = EXPORT_STRUCTURE; + self->mExportState = EXPORT_STRUCTURE; break; } @@ -536,7 +627,7 @@ void LLObjectBackup::exportWorker(void *userdata) virtual bool apply(LLSelectNode* node) { LLViewerObject* object = node->getObject(); - return object->getPhysicsShapeUnknown(); + return gObjectList.gotObjectPhysicsFlags(object); } } func; @@ -545,7 +636,7 @@ void LLObjectBackup::exportWorker(void *userdata) { if (LLSelectMgr::getInstance()->getSelection()->applyToNodes(&func, false)) { - getInstance()->mExportState = EXPORT_STRUCTURE; + self->mExportState = EXPORT_STRUCTURE; } else { @@ -555,7 +646,7 @@ void LLObjectBackup::exportWorker(void *userdata) } else { - getInstance()->mExportState = EXPORT_FAILED; + self->mExportState = EXPORT_ABORTED; LLSelectMgr::getInstance()->getSelection()->unref(); } break; @@ -571,7 +662,9 @@ void LLObjectBackup::exportWorker(void *userdata) object->boostTexturePriority(true); LLViewerObject::child_list_t children = object->getChildren(); children.push_front(object); //push root onto list - LLSD prim_llsd = LLObjectBackup::getInstance()->primsToLLSD(children, is_attachment); + LLObjectBackup* self = findInstance(); + LLSD prim_llsd = self->primsToLLSD(children, + is_attachment); LLSD stuff; if (is_attachment) { @@ -584,77 +677,88 @@ void LLObjectBackup::exportWorker(void *userdata) stuff["root_rotation"] = ll_sd_from_quaternion(object->getRotation()); } stuff["group_body"] = prim_llsd; - getInstance()->mLLSD["data"].append(stuff); + self->mLLSD["data"].append(stuff); return true; } } func; - getInstance()->mExportState = EXPORT_LLSD; - LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, false); + LLViewerObject* object; + object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + if (object) + { + self->mExportState = EXPORT_LLSD; + LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, false); + } + else + { + self->mExportState = EXPORT_ABORTED; + } LLSelectMgr::getInstance()->getSelection()->unref(); break; } case EXPORT_TEXTURES: { - if (!getInstance()->mCheckNextTexture) + if (!self->mCheckNextTexture) { // The texture is being fetched. Wait till next idle callback. return; } - if (getInstance()->mTexturesList.empty()) + if (self->mTexturesList.empty()) { - getInstance()->mExportState = EXPORT_DONE; + self->mExportState = EXPORT_DONE; return; } // Ok, we got work to do... - getInstance()->mCheckNextTexture= false; - getInstance()->exportNextTexture(); + self->mCheckNextTexture = false; + self->exportNextTexture(); break; } case EXPORT_LLSD: { // Create a file stream and write to it - llofstream export_file(getInstance()->mFileName); - LLSDSerialize::toPrettyXML(getInstance()->mLLSD, export_file); + llofstream export_file(self->mFileName); + LLSDSerialize::toPrettyXML(self->mLLSD, export_file); export_file.close(); - getInstance()->mCheckNextTexture = true; - getInstance()->mExportState = EXPORT_TEXTURES; + self->mCheckNextTexture = true; + self->mExportState = EXPORT_TEXTURES; break; } case EXPORT_DONE: { gIdleCallbacks.deleteFunction(exportWorker); - if (LLObjectBackup::getInstance()->mNonExportedTextures == LLObjectBackup::TEXTURE_OK) + if (self->mNonExportedTextures == LLObjectBackup::TEXTURE_OK) { - LL_INFOS("ObjectBackup") << "Export successful and complete." << LL_ENDL; + llinfos << "Export successful and complete." << llendl; LLNotificationsUtil::add("ExportSuccessful"); } else { - LL_INFOS("ObjectBackup") << "Export successful but incomplete: some texture(s) not saved." << LL_ENDL; + llinfos << "Export successful but incomplete: some texture(s) not saved." + << llendl; std::string reason; - if (getInstance()->mNonExportedTextures & LLObjectBackup::TEXTURE_BAD_PERM) + U32 error_bits_map = self->mNonExportedTextures; + if (error_bits_map & LLObjectBackup::TEXTURE_BAD_PERM) { reason += "\nBad permissions/creator."; } - if (getInstance()->mNonExportedTextures & LLObjectBackup::TEXTURE_MISSING) + if (error_bits_map & LLObjectBackup::TEXTURE_MISSING) { reason += "\nMissing texture (retrying after full rezzing might work)."; } - if (getInstance()->mNonExportedTextures & LLObjectBackup::TEXTURE_BAD_ENCODING) + if (error_bits_map & LLObjectBackup::TEXTURE_BAD_ENCODING) { reason += "\nBad texture encoding."; } - if (getInstance()->mNonExportedTextures & LLObjectBackup::TEXTURE_IS_NULL) + if (error_bits_map & LLObjectBackup::TEXTURE_IS_NULL) { reason += "\nNull texture."; } - if (getInstance()->mNonExportedTextures & LLObjectBackup::TEXTURE_SAVED_FAILED) + if (error_bits_map & LLObjectBackup::TEXTURE_SAVED_FAILED) { reason += "\nCould not write to disk."; } @@ -662,22 +766,32 @@ void LLObjectBackup::exportWorker(void *userdata) args["REASON"] = reason; LLNotificationsUtil::add("ExportPartial", args); } - getInstance()->close(); + self->destroy(); break; } case EXPORT_FAILED: { gIdleCallbacks.deleteFunction(exportWorker); - LL_WARNS("ObjectBackup") << "Export process aborted." << LL_ENDL; + llwarns << "Export process failed." << llendl; LLNotificationsUtil::add("ExportFailed"); - LLObjectBackup::getInstance()->close(); + self->destroy(); + break; + } + + case EXPORT_ABORTED: + { + gIdleCallbacks.deleteFunction(exportWorker); + llwarns << "Export process aborted." << llendl; + LLNotificationsUtil::add("ExportAborted"); + self->destroy(); break; } } } -LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list, bool is_attachment) +LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list, + bool is_attachment) { LLViewerObject* object; LLSD llsd; @@ -690,7 +804,7 @@ LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list, bool i object = (*i); LLUUID id = object->getID(); - LL_INFOS("ObjectBackup") << "Exporting prim " << object->getID().asString() << LL_ENDL; + llinfos << "Exporting prim " << object->getID().asString() << llendl; // Create an LLSD object that represents this prim. It will be injected // in to the overall LLSD tree structure @@ -753,27 +867,32 @@ LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list, bool i prim_llsd["volume"] = params.asLLSD(); // Extra paramsb6fab961-af18-77f8-cf08-f021377a7244 + if (object->isFlexible()) { // Flexible - LLFlexibleObjectData* flex = (LLFlexibleObjectData*)object->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE); + LLFlexibleObjectData* flex; + flex = (LLFlexibleObjectData*)object->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE); prim_llsd["flexible"] = flex->asLLSD(); } if (object->getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT)) { // Light - LLLightParams* light = (LLLightParams*)object->getParameterEntry(LLNetworkData::PARAMS_LIGHT); + LLLightParams* light; + light = (LLLightParams*)object->getParameterEntry(LLNetworkData::PARAMS_LIGHT); prim_llsd["light"] = light->asLLSD(); } if (object->getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE)) { // Light image - LLLightImageParams* light_param = (LLLightImageParams*)object->getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); + LLLightImageParams* light_param; + light_param = (LLLightImageParams*)object->getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); t_id = validateTextureID(light_param->getLightTexture()); if (mTexturesList.count(t_id) == 0) { - LL_INFOS("ObjectBackup") << "Found a light texture, adding to list " << t_id << LL_ENDL; + llinfos << "Found a light texture, adding to list " << t_id + << llendl; mTexturesList.insert(t_id); } prim_llsd["light_texture"] = light_param->asLLSD(); @@ -782,7 +901,8 @@ LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list, bool i if (object->getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT)) { // Sculpt - LLSculptParams* sculpt = (LLSculptParams*)object->getParameterEntry(LLNetworkData::PARAMS_SCULPT); + LLSculptParams* sculpt; + sculpt = (LLSculptParams*)object->getParameterEntry(LLNetworkData::PARAMS_SCULPT); prim_llsd["sculpt"] = sculpt->asLLSD(); if ((sculpt->getSculptType() & LL_SCULPT_TYPE_MASK) != LL_SCULPT_TYPE_MESH) { @@ -791,14 +911,16 @@ LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list, bool i { if (mTexturesList.count(sculpt_texture) == 0) { - LL_INFOS("ObjectBackup") << "Found a sculpt texture, adding to list " << sculpt_texture << LL_ENDL; + llinfos << "Found a sculpt texture, adding to list " + << sculpt_texture << llendl; mTexturesList.insert(sculpt_texture); } } else { - LL_WARNS("ObjectBackup") << "Incorrect permission to export a sculpt texture." << LL_ENDL; - getInstance()->mExportState = EXPORT_FAILED; + llwarns << "Incorrect permission to export a sculpt texture." + << llendl; + mExportState = EXPORT_FAILED; } } } @@ -819,12 +941,8 @@ LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list, bool i this_te_llsd = te->asLLSD(); this_te_llsd["imageid"] = t_id; te_llsd.append(this_te_llsd); - // Do not export Linden textures even though they don't taint creation. - if (t_id != LL_TEXTURE_PLYWOOD && - t_id != LL_TEXTURE_BLANK && - t_id != LL_TEXTURE_TRANSPARENT && - t_id != LL_TEXTURE_INVISIBLE && - t_id != LL_TEXTURE_MEDIA) + // Do not export non-existent default textures + if (t_id != LL_TEXTURE_BLANK && t_id != LL_TEXTURE_INVISIBLE) { if (mTexturesList.count(t_id) == 0) { @@ -862,8 +980,9 @@ LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list, bool i prim_llsd["materials"] = te_mat_llsd; } - // The keys in the primitive maps do not have to be localids, they can be any - // string. We simply use localids because they are a unique identifier + // The keys in the primitive maps do not have to be localids, they can + // be any string. We simply use localids because they are a unique + // identifier snprintf(localid, sizeof(localid), "%u", object->getLocalID()); llsd[(const char*)localid] = prim_llsd; } @@ -882,7 +1001,7 @@ void LLObjectBackup::exportNextTexture() if (mTexturesList.empty()) { mCheckNextTexture = true; - LL_INFOS("ObjectBackup") << "Finished exporting textures." << LL_ENDL; + llinfos << "Finished exporting textures." << llendl; return; } if (iter == mTexturesList.end()) @@ -929,7 +1048,7 @@ void LLObjectBackup::exportNextTexture() } else { - LL_WARNS("ObjectBackup") << "We *DON'T* have the texture " << id.asString() << LL_ENDL; + llwarns << "We *DON'T* have the texture " << id << llendl; mNonExportedTextures |= TEXTURE_MISSING; mTexturesList.erase(id); } @@ -937,10 +1056,20 @@ void LLObjectBackup::exportNextTexture() mTexturesList.erase(id); - LL_INFOS("ObjectBackup") << "Requesting texture " << id << LL_ENDL; + llinfos << "Requesting texture " << id << " from cache." << llendl; LLImageJ2C* mFormattedImage = new LLImageJ2C; - CacheReadResponder* responder = new CacheReadResponder(id, mFormattedImage); - LLAppViewer::getTextureCache()->readFromCache(id, LLWorkerThread::PRIORITY_HIGH, 0, 999999, responder); + BackupCacheReadResponder* responder; + responder = new BackupCacheReadResponder(id, mFormattedImage); + LLAppViewer::getTextureCache()->readFromCache(id, + LLWorkerThread::PRIORITY_HIGH, + 0, 999999, responder); +} + + +bool is_default_texture(const LLUUID& id) +{ + return id.isNull() || id == LL_TEXTURE_PLYWOOD || id == LL_TEXTURE_BLANK || + id == LL_TEXTURE_INVISIBLE; } void LLObjectBackup::importObject(bool upload) @@ -949,7 +1078,7 @@ void LLObjectBackup::importObject(bool upload) mTexturesList.clear(); mAssetMap.clear(); mCurrentAsset.setNull(); - + mGotExtraPhysics = !gAgent.getRegion()->getCapability("GetObjectPhysicsData").empty(); setDefaultTextures(); @@ -975,18 +1104,19 @@ void LLObjectBackup::importObject_continued(AIFilePicker* filepicker) import_file.close(); if (!mLLSD.has("data")) { - LLNotificationsUtil::add("InvalidObjectParams"); - close(); + LLNotificationsUtil::add("ImportFailed"); + destroy(); return; } - show(false); + showFloater(false); mAgentPos = gAgent.getPositionAgent(); mAgentRot = LLQuaternion(gAgent.getAtAxis(), gAgent.getLeftAxis(), gAgent.getUpAxis()); // Get the texture map + mCurObject = 1; mCurPrim = 1; mObjects = mLLSD["data"].size(); @@ -1014,14 +1144,31 @@ void LLObjectBackup::importObject_continued(AIFilePicker* filepicker) LLUUID orig = sculpt.getSculptTexture(); if (mTexturesList.count(orig) == 0) { - LL_INFOS("ObjectBackup") << "Found a new SCULPT texture to upload " << orig << LL_ENDL; + llinfos << "Found a new SCULPT texture to upload " + << orig << llendl; mTexturesList.insert(orig); } } } - LLSD& te_llsd = prim_llsd.has("textures") ? prim_llsd["textures"] : prim_llsd["texture"]; // Firestorm's format uses singular "texture" + if (prim_llsd.has("light_texture")) + { + LLLightImageParams lightimg; + lightimg.fromLLSD(prim_llsd["light_texture"]); + LLUUID t_id = lightimg.getLightTexture(); + if (!is_default_texture(t_id) && + mTexturesList.count(t_id) == 0) + { + llinfos << "Found a new light texture to upload: " << t_id + << llendl; + mTexturesList.insert(t_id); + } + } + // Check both for "textures" and "texture" since the second (buggy) + // case has already been seen in some exported prims XML files... + LLSD& te_llsd = prim_llsd.has("textures") ? prim_llsd["textures"] + : prim_llsd["texture"]; for (LLSD::array_iterator it = te_llsd.beginArray(); it != te_llsd.endArray(); ++it) { @@ -1030,14 +1177,12 @@ void LLObjectBackup::importObject_continued(AIFilePicker* filepicker) te.fromLLSD(the_te); LLUUID t_id = te.getID(); - // Do not upload the default textures - if (t_id != LL_TEXTURE_PLYWOOD && t_id != LL_TEXTURE_BLANK && t_id != LL_TEXTURE_INVISIBLE) // Do not upload the default textures + if (!is_default_texture(t_id) && + mTexturesList.count(t_id) == 0) { - if (mTexturesList.count(t_id) == 0) - { - LL_INFOS("ObjectBackup") << "Found a new texture to upload: "<< t_id << LL_ENDL; + llinfos << "Found a new texture to upload: " << t_id + << llendl; mTexturesList.insert(t_id); - } } } @@ -1052,29 +1197,21 @@ void LLObjectBackup::importObject_continued(AIFilePicker* filepicker) mat.fromLLSD(the_mat); LLUUID t_id = mat.getNormalID(); - if (t_id.notNull() && t_id != LL_TEXTURE_PLYWOOD && - t_id != LL_TEXTURE_BLANK && - t_id != LL_TEXTURE_INVISIBLE) + if (!is_default_texture(t_id) && + mTexturesList.count(t_id) == 0) { - if (mTexturesList.count(t_id) == 0) - { - LL_INFOS("ObjectBackup") << "Found a new normal map to upload: " - << t_id << LL_ENDL; - mTexturesList.insert(t_id); - } + llinfos << "Found a new normal map to upload: " + << t_id << llendl; + mTexturesList.insert(t_id); } t_id = mat.getSpecularID(); - if (t_id.notNull() && t_id != LL_TEXTURE_PLYWOOD && - t_id != LL_TEXTURE_BLANK && - t_id != LL_TEXTURE_INVISIBLE) + if (!is_default_texture(t_id) && + mTexturesList.count(t_id) == 0) { - if (mTexturesList.count(t_id) == 0) - { - LL_INFOS("ObjectBackup") << "Found a new specular map to upload: " - << t_id << LL_ENDL; - mTexturesList.insert(t_id); - } + llinfos << "Found a new specular map to upload: " + << t_id << llendl; + mTexturesList.insert(t_id); } } } @@ -1107,9 +1244,9 @@ void LLObjectBackup::rezAgentOffset(LLVector3 offset) void LLObjectBackup::importFirstObject() { mRunning = true; - show(false); + showFloater(false); mGroupPrimImportIter = mLLSD["data"].beginArray(); - mRootRootPos = (*mGroupPrimImportIter)["root_position"]; + mRootRootPos = LLVector3((*mGroupPrimImportIter)["root_position"]); mObjects = mLLSD["data"].size(); mCurObject = 1; importNextObject(); @@ -1127,7 +1264,7 @@ void LLObjectBackup::importNextObject() mPrims = mThisGroup.size(); updateImportNumbers(); - LLVector3 lgpos = (*mGroupPrimImportIter)["root_position"]; + LLVector3 lgpos = LLVector3((*mGroupPrimImportIter)["root_position"]); mGroupOffset = lgpos - mRootRootPos; mRootPos = offsetAgent(LLVector3(2.0, 0.0, 0.0)); mRootRot = ll_quaternion_from_sd((*mGroupPrimImportIter)["root_rotation"]); @@ -1168,7 +1305,7 @@ void LLObjectBackup::xmlToPrim(LLSD prim_llsd, LLViewerObject* object) if (prim_llsd.has("parent")) { //we are not the root node. - LLVector3 pos = prim_llsd["position"]; + LLVector3 pos = LLVector3(prim_llsd["position"]); LLQuaternion rot = ll_quaternion_from_sd(prim_llsd["rotation"]); object->setPositionRegion(pos * mRootRot + mRootPos + mGroupOffset); object->setRotation(rot * mRootRot); @@ -1180,11 +1317,11 @@ void LLObjectBackup::xmlToPrim(LLSD prim_llsd, LLViewerObject* object) object->setRotation(rot); } - object->setScale(prim_llsd["scale"]); + object->setScale(LLVector3(prim_llsd["scale"])); if (prim_llsd.has("flags")) { - U32 flags(prim_llsd["flags"].asInteger()); + U32 flags = (U32)prim_llsd["flags"].asInteger(); object->setFlags(flags, true); } else // Kept for backward compatibility @@ -1228,12 +1365,12 @@ void LLObjectBackup::xmlToPrim(LLSD prim_llsd, LLViewerObject* object) LLSculptParams sculpt; sculpt.fromLLSD(prim_llsd["sculpt"]); - // TODO: check if map is valid and only set texture if map is valid and changes - - if (mAssetMap.count(sculpt.getSculptTexture())) + // TODO: check if map is valid and only set texture if map is valid and + // changes + LLUUID t_id = sculpt.getSculptTexture(); + if (mAssetMap.count(t_id)) { - LLUUID replacement = mAssetMap[sculpt.getSculptTexture()]; - sculpt.setSculptTexture(replacement); + sculpt.setSculptTexture(mAssetMap[t_id]); } object->setParameterEntry(LLNetworkData::PARAMS_SCULPT, sculpt, true); @@ -1250,7 +1387,13 @@ void LLObjectBackup::xmlToPrim(LLSD prim_llsd, LLViewerObject* object) // Light image LLLightImageParams lightimg; lightimg.fromLLSD(prim_llsd["light_texture"]); - object->setParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE, lightimg, true); + LLUUID t_id = lightimg.getLightTexture(); + if (mAssetMap.count(t_id)) + { + lightimg.setLightTexture(mAssetMap[t_id]); + } + object->setParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE, lightimg, + true); } if (prim_llsd.has("flexible")) @@ -1261,8 +1404,11 @@ void LLObjectBackup::xmlToPrim(LLSD prim_llsd, LLViewerObject* object) } // Textures - LL_INFOS("ObjectBackup") << "Processing textures for prim" << id << LL_ENDL; - LLSD& te_llsd = prim_llsd.has("textures") ? prim_llsd["textures"] : prim_llsd["texture"]; // Firestorm's format uses singular "texture" + // Check both for "textures" and "texture" since the second (buggy) case + // has already been seen in some exported prims XML files... + llinfos << "Processing textures for prim" << id << llendl; + LLSD& te_llsd = prim_llsd.has("textures") ? prim_llsd["textures"] + : prim_llsd["texture"]; U8 i = 0; for (LLSD::array_iterator it = te_llsd.beginArray(); it != te_llsd.endArray(); ++it) @@ -1273,18 +1419,17 @@ void LLObjectBackup::xmlToPrim(LLSD prim_llsd, LLViewerObject* object) LLUUID t_id = te.getID(); if (mAssetMap.count(t_id)) { - LLUUID replacement = mAssetMap[t_id]; - te.setID(replacement); + te.setID(mAssetMap[t_id]); } object->setTE(i++, te); } - LL_INFOS("ObjectBackup") << "Textures done !" << LL_ENDL; + llinfos << "Textures done !" << llendl; // Materials if (prim_llsd.has("materials")) { - LL_INFOS("ObjectBackup") << "Processing materials for prim " << id << LL_ENDL; + llinfos << "Processing materials for prim " << id << llendl; te_llsd = prim_llsd["materials"]; i = 0; for (LLSD::array_iterator it = te_llsd.beginArray(); @@ -1296,20 +1441,18 @@ void LLObjectBackup::xmlToPrim(LLSD prim_llsd, LLViewerObject* object) LLUUID t_id = mat->getNormalID(); if (id.notNull() && mAssetMap.count(t_id)) { - LLUUID replacement = mAssetMap[t_id]; - mat->setNormalID(replacement); + mat->setNormalID(mAssetMap[t_id]); } t_id = mat->getSpecularID(); if (id.notNull() && mAssetMap.count(t_id)) { - LLUUID replacement = mAssetMap[t_id]; - mat->setSpecularID(replacement); + mat->setSpecularID(mAssetMap[t_id]); } LLMaterialMgr::getInstance()->put(id, i++, *mat); } - LL_INFOS("ObjectBackup") << "Materials done !" << LL_ENDL; + llinfos << "Materials done !" << llendl; } object->sendRotationUpdate(); @@ -1320,107 +1463,110 @@ void LLObjectBackup::xmlToPrim(LLSD prim_llsd, LLViewerObject* object) LLSelectMgr::getInstance()->deselectAll(); } -// This is fired when the update packet is processed so we know the prim settings have stuck +// This is fired when the update packet is processed so we know the prim +// settings have stuck +//static void LLObjectBackup::primUpdate(LLViewerObject* object) { - if (!mRunning || (object != NULL && object->mID != mExpectingUpdate)) + LLObjectBackup* self = findInstance(); + if (!object || !self || !self->mRunning || + object->mID != self->mExpectingUpdate) { return; } - ++mCurPrim; - updateImportNumbers(); - ++mPrimImportIter; + ++self->mCurPrim; + self->updateImportNumbers(); + ++self->mPrimImportIter; - LLUUID x; - mExpectingUpdate = x.null; + self->mExpectingUpdate.setNull(); - if (mPrimImportIter == mThisGroup.endMap()) + if (self->mPrimImportIter == self->mThisGroup.endMap()) { - LL_INFOS("ObjectBackup") << "Trying to link" << LL_ENDL; + llinfos << "Trying to link..." << llendl; - if (mToSelect.size() > 1) + if (self->mToSelect.size() > 1) { - std::reverse(mToSelect.begin(), mToSelect.end()); + std::reverse(self->mToSelect.begin(), self->mToSelect.end()); // Now link LLSelectMgr::getInstance()->deselectAll(); - LLSelectMgr::getInstance()->selectObjectAndFamily(mToSelect, true); + LLSelectMgr::getInstance()->selectObjectAndFamily(self->mToSelect, true); LLSelectMgr::getInstance()->sendLink(); - LLViewerObject* root = mToSelect.back(); - root->setRotation(mRootRot); + LLViewerObject* root = self->mToSelect.back(); + root->setRotation(self->mRootRot); } - ++mCurObject; - ++mGroupPrimImportIter; - if (mGroupPrimImportIter != mLLSD["data"].endArray()) + ++self->mCurObject; + ++self->mGroupPrimImportIter; + if (self->mGroupPrimImportIter != self->mLLSD["data"].endArray()) { - importNextObject(); + self->importNextObject(); return; } - mRunning = false; - close(); + self->mRunning = false; + self->destroy(); return; } - LLSD prim_llsd = mThisGroup[mPrimImportIter->first]; + LLSD prim_llsd = self->mThisGroup[self->mPrimImportIter->first]; - if (mToSelect.empty()) + if (self->mToSelect.empty()) { - LL_WARNS("ObjectBackup") << "error: ran out of objects to mod." << LL_ENDL; - mRunning = false; - close(); + llwarns << "error: ran out of objects to mod." << llendl; + self->mRunning = false; + self->destroy(); return; } - if (mPrimImportIter != mThisGroup.endMap()) + if (self->mPrimImportIter != self->mThisGroup.endMap()) { //rezAgentOffset(LLVector3(1.0, 0.0, 0.0)); - LLSD prim_llsd = mThisGroup[mPrimImportIter->first]; - ++mProcessIter; - xmlToPrim(prim_llsd, *mProcessIter); + LLSD prim_llsd =self-> mThisGroup[self->mPrimImportIter->first]; + ++self->mProcessIter; + self->xmlToPrim(prim_llsd, *(self->mProcessIter)); } } // Callback when we rez a new object when the importer is running. -bool LLObjectBackup::newPrim(LLViewerObject* pobject) +//static +void LLObjectBackup::newPrim(LLViewerObject* object) { - if (mRunning) + LLObjectBackup* self = findInstance(); + if (!object || !self || !self->mRunning) return; + + ++self->mRezCount; + self->mToSelect.push_back(object); + self->updateImportNumbers(); + ++self->mPrimImportIter; + + object->setPosition(self->offsetAgent(LLVector3(0.0, 1.0, 0.0))); + LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_POSITION); + + if (self->mPrimImportIter != self->mThisGroup.endMap()) { - ++mRezCount; - mToSelect.push_back(pobject); - updateImportNumbers(); - ++mPrimImportIter; - - pobject->setPosition(offsetAgent(LLVector3(0.0, 1.0, 0.0))); - LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_POSITION); - - if (mPrimImportIter != mThisGroup.endMap()) - { - rezAgentOffset(LLVector3(1.0, 0.0 ,0.0)); - } - else - { - LL_INFOS("ObjectBackup") << "All prims rezzed, moving to build stage" << LL_ENDL; - // Deselecting is required to ensure that the first child prim in - // the link set (which is also the last rezzed prim and thus - // currently selected) will be properly renamed and desced. - LLSelectMgr::getInstance()->deselectAll(); - mPrimImportIter = mThisGroup.beginMap(); - LLSD prim_llsd = mThisGroup[mPrimImportIter->first]; - mProcessIter = mToSelect.begin(); - xmlToPrim(prim_llsd, *mProcessIter); - } + self->rezAgentOffset(LLVector3(1.0, 0.0 ,0.0)); + } + else + { + llinfos << "All prims rezzed, moving to build stage" << llendl; + // Deselecting is required to ensure that the first child prim in + // the link set (which is also the last rezzed prim and thus + // currently selected) will be properly renamed and desced. + LLSelectMgr::getInstance()->deselectAll(); + self->mPrimImportIter = self->mThisGroup.beginMap(); + LLSD prim_llsd = self->mThisGroup[self->mPrimImportIter->first]; + self->mProcessIter = self->mToSelect.begin(); + self->xmlToPrim(prim_llsd, *(self->mProcessIter)); } - return true; } void LLObjectBackup::updateMap(LLUUID uploaded_asset) { if (mCurrentAsset.notNull()) { - LL_INFOS("ObjectBackup") << "Mapping " << mCurrentAsset << " to " << uploaded_asset << LL_ENDL; - + llinfos << "Mapping " << mCurrentAsset << " to " << uploaded_asset + << llendl; mAssetMap[mCurrentAsset] = uploaded_asset; } } @@ -1445,8 +1591,7 @@ void myupload_new_resource(const LLTransactionID &tid, LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID()); // At this point, we're ready for the upload. - std::string upload_message = "Uploading...\n\n"; - upload_message.append(display_name); + std::string upload_message = "Uploading texture:\n\n" + display_name; LLUploadDialog::modalUploadDialog(upload_message); std::string url = gAgent.getRegion()->getCapability("NewFileAgentInventory"); @@ -1463,12 +1608,15 @@ void myupload_new_resource(const LLTransactionID &tid, std::ostringstream llsdxml; LLSDSerialize::toXML(body, llsdxml); - LL_DEBUGS("ObjectBackup") << "posting body to capability: " << llsdxml.str() << LL_ENDL; - LLHTTPClient::post(url, body, new importResponder(body, uuid, asset_type)); + LL_DEBUGS("ObjectBackup") << "posting body to capability: " + << llsdxml.str() << LL_ENDL; + LLHTTPClient::post(url, body, + new ImportObjectResponder(body, uuid, asset_type)); } else { - LL_INFOS("ObjectBackup") << "NewAgentInventory capability not found. Can't upload !" << LL_ENDL; + llinfos << "NewAgentInventory capability not found. Can't upload !" + << llendl; } } @@ -1476,7 +1624,7 @@ void LLObjectBackup::uploadNextAsset() { if (mTexturesList.empty()) { - LL_INFOS("ObjectBackup") << "Texture list is empty, moving to rez stage." << LL_ENDL; + llinfos << "Texture list is empty, moving to rez stage." << llendl; mCurrentAsset.setNull(); importFirstObject(); return; @@ -1488,7 +1636,7 @@ void LLObjectBackup::uploadNextAsset() LLUUID id = *iter; mTexturesList.erase(iter); - LL_INFOS("ObjectBackup") << "Got texture ID " << id << ": trying to upload..." << LL_ENDL; + llinfos << "Got texture ID " << id << ": trying to upload..." << llendl; mCurrentAsset = id; std::string struid; @@ -1517,7 +1665,7 @@ void LLObjectBackup::uploadNextAsset() } else { - LL_WARNS("ObjectBackup") << "Unable to access output file " << filename << LL_ENDL; + llwarns << "Unable to access output file " << filename << llendl; uploadNextAsset(); return; } @@ -1525,5 +1673,5 @@ void LLObjectBackup::uploadNextAsset() myupload_new_resource(tid, LLAssetType::AT_TEXTURE, struid, struid, 0, LLFolderType::FT_TEXTURE, LLInventoryType::defaultForAssetType(LLAssetType::AT_TEXTURE), - 0x0, "Uploaded texture", NULL, NULL); + 0x0, struid, NULL, NULL); } diff --git a/indra/newview/llviewerobjectbackup.h b/indra/newview/llviewerobjectbackup.h index 2b29d91fd..2b2283dff 100644 --- a/indra/newview/llviewerobjectbackup.h +++ b/indra/newview/llviewerobjectbackup.h @@ -30,10 +30,22 @@ #ifndef LL_LLVIEWEROBJECTBACKUP_H #define LL_LLVIEWEROBJECTBACKUP_H +#include +#include +#include + #include "boost/unordered_map.hpp" #include "boost/unordered_set.hpp" +#include "llfloater.h" +#include "statemachine/aifilepicker.h" +#include "lluuid.h" + #include "llviewerinventory.h" +#include "llviewerobject.h" + +class LLSelectNode; +class LLViewerObject; enum export_states { EXPORT_INIT, @@ -43,24 +55,27 @@ enum export_states { EXPORT_TEXTURES, EXPORT_LLSD, EXPORT_DONE, - EXPORT_FAILED + EXPORT_FAILED, + EXPORT_ABORTED }; -class LLObjectBackup : public LLFloater +class LLObjectBackup : public LLFloater, + public LLFloaterSingleton { + friend class LLUISingleton >; + +protected: + LOG_CLASS(LLObjectBackup); + public: - virtual ~LLObjectBackup(); + /////////////////////////////////////////////////////////////////////////// + // LLFloater interface - // Floater stuff - virtual void show(bool exporting); - virtual void onClose(bool app_quitting); + /*virtual*/ ~LLObjectBackup(); + /*virtual*/ void onClose(bool app_quitting); - // Static accessor - static LLObjectBackup* getInstance(); - static bool instanceExists() { return sInstance != NULL; } - - // Export idle callback - static void exportWorker(void *userdata); + /////////////////////////////////////////////////////////////////////////// + // Public interface for invoking the object backup feature // Import entry point void importObject(bool upload = false); @@ -70,47 +85,44 @@ public: void exportObject(); void exportObject_continued(AIFilePicker* filepicker); + /////////////////////////////////////////////////////////////////////////// + // Public methods used in callbacks, workers and responders + // Update map from texture worker void updateMap(LLUUID uploaded_asset); - // Move to next texture upload + // Move to next texture upload, called by the agent inventory responder void uploadNextAsset(); - // Folder public geter - std::string getfolder() { return mFolder; } + // Export idle callback + static void exportWorker(void *userdata); - // Prim updated callback - void primUpdate(LLViewerObject* object); + // Prim updated callback, called in llviewerobjectlist.cpp + static void primUpdate(LLViewerObject* object); - // New prim call back - bool newPrim(LLViewerObject* pobject); + // New prim call back, called in llviewerobjectlist.cpp + static void newPrim(LLViewerObject* object); - static const U32 TEXTURE_OK = 0x00; - static const U32 TEXTURE_BAD_PERM = 0x01; - static const U32 TEXTURE_MISSING = 0x02; - static const U32 TEXTURE_BAD_ENCODING = 0x04; - static const U32 TEXTURE_IS_NULL = 0x08; - static const U32 TEXTURE_SAVED_FAILED = 0x10; + // Folder public getter, used by the texture cache responder + std::string getFolder() { return mFolder; } - // Set when the region supports the extra physics flags - bool mGotExtraPhysics; - - // Are we ready to check for next texture? - bool mCheckNextTexture; - - // Export state machine - enum export_states mExportState; - - // Export result flags for textures. - U32 mNonExportedTextures; static void setDefaultTextures(); - // Is exporting these objects allowed - bool validatePerms(const LLPermissions* item_permissions); + // Permissions checking + static bool validatePerms(const LLPermissions* item_permissions); + static bool validateTexturePerms(const LLUUID& asset_id); + static bool validateNode(LLSelectNode* node); private: - LLObjectBackup(); + // Open only via the importObject() and exportObject() methods defined + // above. + LLObjectBackup(const LLSD&); + + void showFloater(bool exporting); + + static bool confirmCloseCallback(const LLSD& notification, + const LLSD& response); // Update the floater with status numbers void updateImportNumbers(); @@ -133,7 +145,7 @@ private: void exportNextTexture(); // Apply LLSD to object - void xmlToPrim(LLSD prim_llsd, LLViewerObject* pobject); + void xmlToPrim(LLSD prim_llsd, LLViewerObject* object); // Rez a prim at a given position void rezAgentOffset(LLVector3 offset); @@ -141,9 +153,28 @@ private: // Get an offset from the agent based on rotation and current pos LLVector3 offsetAgent(LLVector3 offset); -private: - static LLObjectBackup* sInstance; +public: + // Public static constants, used in callbacks, workers and responders + static const U32 TEXTURE_OK = 0x00; + static const U32 TEXTURE_BAD_PERM = 0x01; + static const U32 TEXTURE_MISSING = 0x02; + static const U32 TEXTURE_BAD_ENCODING = 0x04; + static const U32 TEXTURE_IS_NULL = 0x08; + static const U32 TEXTURE_SAVED_FAILED = 0x10; + // Export state machine + enum export_states mExportState; + + // Export result flags for textures. + U32 mNonExportedTextures; + + // Set when the region supports the extra physics flags + bool mGotExtraPhysics; + + // Are we ready to check for next texture? + bool mCheckNextTexture; + +private: // Are we active flag bool mRunning; @@ -156,7 +187,7 @@ private: U32 mPrims; U32 mCurPrim; - // No prims rezed + // Number of rezzed prims U32 mRezCount; // Root pos and rotation and central root pos for link set @@ -168,31 +199,39 @@ private: // Agent inital pos and rot when starting import LLVector3 mAgentPos; LLQuaternion mAgentRot; - // Rebase map - boost::unordered_map mAssetMap; + + LLUUID mCurrentAsset; + LLUUID mExpectingUpdate; + + // Working llsd iterators for objects and linksets + LLSD::map_const_iterator mPrimImportIter; + LLSD::array_const_iterator mGroupPrimImportIter; + + // File and folder name control + std::string mFileName; + std::string mFolder; // Export texture list typedef boost::unordered_set textures_set_t; textures_set_t mTexturesList; textures_set_t mBadPermsTexturesList; + // Rebase map + boost::unordered_map mAssetMap; + // Import object tracking std::vector mToSelect; std::vector::iterator mProcessIter; - // File and folder name control - std::string mFileName; - std::string mFolder; - // Working LLSD holders - LLUUID mCurrentAsset; - LLUUID mExpectingUpdate; LLSD mLLSD; LLSD mThisGroup; - - // Working llsd itterators for objects and linksets - LLSD::map_const_iterator mPrimImportIter; - LLSD::array_const_iterator mGroupPrimImportIter; }; -#endif \ No newline at end of file +extern LLUUID LL_TEXTURE_PLYWOOD; +extern LLUUID LL_TEXTURE_BLANK; +extern LLUUID LL_TEXTURE_INVISIBLE; +extern LLUUID LL_TEXTURE_TRANSPARENT; +extern LLUUID LL_TEXTURE_MEDIA; + +#endif // LL_LLVIEWEROBJECTBACKUP_H diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 2f9317090..d76659943 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -272,7 +272,7 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp, } else { - LLObjectBackup::getInstance()->primUpdate(objectp); + LLObjectBackup::primUpdate(objectp); } @@ -310,7 +310,7 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp, gViewerWindow->getWindow()->decBusyCount(); gViewerWindow->getWindow()->setCursor( UI_CURSOR_ARROW ); - LLObjectBackup::getInstance()->newPrim(objectp); + LLObjectBackup::newPrim(objectp); } } @@ -1216,6 +1216,17 @@ void LLViewerObjectList::fetchPhysicsFlags() } } +bool LLViewerObjectList::gotObjectPhysicsFlags(LLViewerObject* objectp) +{ + // This will insert objectp in mStalePhysicsFlags if needed: + objectp->getPhysicsShapeType(); + // Data has been retrieved if the object is not in either of the + // two lists: + const LLUUID& id = objectp->getID(); + return mPendingPhysicsFlags.count(id) == 0 && + mStalePhysicsFlags.count(id) == 0; +} + void LLViewerObjectList::clearDebugText() { for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter) diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index c5b6b98f6..516c3d1e1 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -99,6 +99,8 @@ public: void fetchObjectCosts(); void fetchPhysicsFlags(); + bool gotObjectPhysicsFlags(LLViewerObject* objectp); + void updateObjectCost(LLViewerObject* object); void updateObjectCost(const LLUUID& object_id, F32 object_cost, F32 link_cost, F32 physics_cost, F32 link_physics_cost); void onObjectCostFetchFailure(const LLUUID& object_id); diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index cbc64d533..799513e93 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -358,6 +358,10 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, // Create the object lists initStats(); initPartitions(); + // If the newly entered region is using server bakes, and our + // current appearance is non-baked, request appearance update from + // server. + setCapabilitiesReceivedCallback(boost::bind(&LLAgent::handleServerBakeRegionTransition, &gAgent, _1)); // Singu TODO: LLAvatarRenderInfoAccountant } void LLViewerRegion::initPartitions() diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 20c72de3f..a2ef35c92 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -48,7 +48,7 @@ #include "lluuid.h" #include "llweb.h" #include "llcapabilityprovider.h" -#include "m4math.h" // LLMatrix4 +#include "llmatrix4a.h" // LLMatrix4a #include "llhttpclient.h" // Surface id's diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp index cbf32eb43..f563c4062 100644 --- a/indra/newview/llviewertexlayer.cpp +++ b/indra/newview/llviewertexlayer.cpp @@ -361,6 +361,51 @@ BOOL LLViewerTexLayerSetBuffer::requestUpdateImmediate() return result; } +class LLSendTexLayerResponder : public LLAssetUploadResponder +{ + LOG_CLASS(LLSendTexLayerResponder); +public: + LLSendTexLayerResponder(const LLSD& post_data, const LLUUID& vfile_id, LLAssetType::EType asset_type, LLBakedUploadData * baked_upload_data) + : LLAssetUploadResponder(post_data, vfile_id, asset_type) + , mBakedUploadData(baked_upload_data) + {} + + ~LLSendTexLayerResponder() + { + // mBakedUploadData is normally deleted by calls to LLViewerTexLayerSetBuffer::onTextureUploadComplete() below + if (mBakedUploadData) + { // ...but delete it in the case where uploadComplete() is never called + delete mBakedUploadData; + mBakedUploadData = NULL; + } + } + + // Baked texture upload completed + /*virtual*/ void uploadComplete(const LLSD& content) + { + const std::string& result = content["state"]; + const LLUUID& new_id = content["new_asset"]; + + llinfos << "result: " << result << " new_id: " << new_id << llendl; + LLViewerTexLayerSetBuffer::onTextureUploadComplete(new_id, (void*) mBakedUploadData, (result == "complete" && mBakedUploadData) ? 0 : -1, LL_EXSTAT_NONE); + mBakedUploadData = NULL; // deleted in onTextureUploadComplete() + } + + /*virtual*/ void httpFailure() + { + llinfos << dumpResponse() << llendl; + + // Invoke the original callback with an error result + LLViewerTexLayerSetBuffer::onTextureUploadComplete(LLUUID::null, (void*) mBakedUploadData, -1, LL_EXSTAT_NONE); + mBakedUploadData = NULL; // deleted in onTextureUploadComplete() + } + + /*virtual*/ char const* getName() const { return "LLSendTexLayerResponder"; } + +private: + LLBakedUploadData* mBakedUploadData; +}; + // Create the baked texture, send it out to the server, then wait for it to come // back so we can switch to using it. void LLViewerTexLayerSetBuffer::doUpload() diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 099927c6d..5530628c9 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2399,6 +2399,7 @@ void LLViewerWindow::reshape(S32 width, S32 height) // Inform lower views of the change // round up when converting coordinates to make sure there are no gaps at edge of window LLView::sForceReshape = display_scale_changed; + if (/*display_scale_changed && */gSavedSettings.getBOOL("LiruResizeRootWithScreen")) // Singu Note: Nasty hack to keep floaters from repositioning on window resize. mRootView->reshape(llceil((F32)width / mDisplayScale.mV[VX]), llceil((F32)height / mDisplayScale.mV[VY])); LLView::sForceReshape = FALSE; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d734b5a68..443a631ba 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -111,7 +111,6 @@ #include "llsdutil.h" #include "llfloaterexploreanimations.h" -#include "aihttptimeoutpolicy.h" #include "aixmllindengenepool.h" #include "aifile.h" @@ -1800,10 +1799,10 @@ void LLVOAvatar::renderCollisionVolumes() { std::ostringstream ostr; LLGLDepthTest gls_depth(GL_FALSE); - for (S32 i = 0; i < mNumCollisionVolumes; i++) + for (S32 i = 0; i < (S32)mCollisionVolumes.size(); i++) { - mCollisionVolumes[i].renderCollision(); - ostr << mCollisionVolumes[i].getName() << ", "; + mCollisionVolumes[i]->renderCollision(); + ostr << mCollisionVolumes[i]->getName() << ", "; } if (mNameText.notNull()) @@ -1921,11 +1920,11 @@ BOOL LLVOAvatar::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& if (lineSegmentBoundingBox(start, end)) { - for (S32 i = 0; i < mNumCollisionVolumes; ++i) + for (S32 i = 0; i < (S32)mCollisionVolumes.size(); ++i) { - mCollisionVolumes[i].updateWorldMatrix(); + mCollisionVolumes[i]->updateWorldMatrix(); - const LLMatrix4a& mat = mCollisionVolumes[i].getXform()->getWorldMatrix(); + const LLMatrix4a& mat = mCollisionVolumes[i]->getXform()->getWorldMatrix(); LLMatrix4a inverse = mat; inverse.invert(); LLMatrix4a norm_mat = inverse; @@ -5050,7 +5049,7 @@ void LLVOAvatar::bakedTextureOriginCounts(S32 &sb_count, // server-bake, has ori std::string LLVOAvatar::bakedTextureOriginInfo() { std::string result; - + std::set baked_ids; collectBakedTextureUUIDs(baked_ids); for (std::set::const_iterator it = baked_ids.begin(); it != baked_ids.end(); ++it) @@ -5065,11 +5064,17 @@ std::string LLVOAvatar::bakedTextureOriginInfo() { has_host = true; } - if (has_url && !has_host) result += "u"; // server-bake texture with url - else if (has_host && !has_url) result += "h"; // old-style texture on sim - else if (has_host && has_url) result += "?"; // both origins? - else if (!has_host && !has_url) result += "n"; // no origin? + S32 discard = imagep->getDiscardLevel(); + if (has_url && !has_host) result += discard ? "u" : "U"; // server-bake texture with url + else if (has_host && !has_url) result += discard ? "h" : "H"; // old-style texture on sim + else if (has_host && has_url) result += discard ? "x" : "X"; // both origins? + else if (!has_host && !has_url) result += discard ? "n" : "N"; // no origin? + if (discard != 0) + { + result += llformat("(%d/%d)",discard,imagep->getDesiredDiscardLevel()); + } } + return result; } @@ -5196,7 +5201,7 @@ void LLVOAvatar::updateTextures() BOOL render_avatar = TRUE; - if (mIsDummy || gNoRender) + if (mIsDummy) { return; } @@ -5216,6 +5221,7 @@ void LLVOAvatar::updateTextures() } std::vector layer_baked; + // GL NOT ACTIVE HERE - *TODO for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { layer_baked.push_back(isTextureDefined(mBakedTextureDatas[i].mTextureIndex)); @@ -5420,7 +5426,7 @@ const std::string LLVOAvatar::getImageURL(const U8 te, const LLUUID &uuid) std::string url = ""; if (isUsingServerBakes()) { - const std::string& appearance_service_url = gSavedSettings.getString("AgentAppearanceServiceURL"); + const std::string& appearance_service_url = LLAppearanceMgr::instance().getAppearanceServiceURL(); if (appearance_service_url.empty()) { // Probably a server-side issue if we get here: @@ -5507,8 +5513,6 @@ const LLUUID& LLVOAvatar::getStepSound() const //----------------------------------------------------------------------------- void LLVOAvatar::processAnimationStateChanges() { - if (gNoRender) return; - if ( isAnyAnimationSignaled(AGENT_WALK_ANIMS, NUM_AGENT_WALK_ANIMS) ) { startMotion(ANIM_AGENT_WALK_ADJUST); @@ -5537,7 +5541,7 @@ void LLVOAvatar::processAnimationStateChanges() } // clear all current animations - BOOL const AOEnabled = gSavedSettings.getBOOL("AOEnabled"); // Singu note: put this outside the loop. + const bool AOEnabled(gSavedSettings.getBOOL("AOEnabled")); // AnimIterator anim_it; for (anim_it = mPlayingAnimations.begin(); anim_it != mPlayingAnimations.end();) { @@ -5546,14 +5550,8 @@ void LLVOAvatar::processAnimationStateChanges() // playing, but not signaled, so stop if (found_anim == mSignaledAnimations.end()) { - if (AOEnabled && isSelf()) - { - if (LLFloaterAO::stopMotion(anim_it->first, FALSE)) // if the AO replaced this anim serverside then stop it serverside - { -// return TRUE; //no local stop needed - } - } + LLFloaterAO::stopMotion(anim_it->first, FALSE); // if the AO replaced this anim serverside then stop it serverside processSingleAnimationStateChange(anim_it->first, FALSE); // @@ -5896,29 +5894,6 @@ LLJoint *LLVOAvatar::getJoint( const std::string &name ) return jointp; } - -//----------------------------------------------------------------------------- -// resetSpecificJointPosition -//----------------------------------------------------------------------------- -void LLVOAvatar::resetSpecificJointPosition( const std::string& name ) -{ - LLJoint* pJoint = mRoot->findJoint( name ); - - if ( pJoint && pJoint->doesJointNeedToBeReset() ) - { - pJoint->restoreOldXform(); - pJoint->setId( LLUUID::null ); - //If we're reseting the pelvis position make sure not to apply offset - if ( name == "mPelvis" ) - { - mHasPelvisOffset = false; - } - } - else - { - llinfos<<"Did not find "<< name.c_str()<doesJointNeedToBeReset() ) + //Reset joints except for pelvis + if ( pJoint && pJoint != pJointPelvis && pJoint->doesJointNeedToBeReset() ) { pJoint->setId( LLUUID::null ); - //restore joints to default positions, however skip over the pelvis - // *TODO: How does this pointer check skip over pelvis? - if ( pJoint ) - { - pJoint->restoreOldXform(); - } + pJoint->restoreOldXform(); + } + else + if ( pJoint && pJoint == pJointPelvis && pJoint->doesJointNeedToBeReset() ) + { + pJoint->setId( LLUUID::null ); + pJoint->setPosition( LLVector3( 0.0f, 0.0f, 0.0f) ); + //pJoint->setJointResetFlag( false ); // Singu TODO } } + //make sure we don't apply the joint offset mHasPelvisOffset = false; mPelvisFixup = mLastPelvisFixup; @@ -5996,7 +5978,7 @@ void LLVOAvatar::getGround(const LLVector3 &in_pos_agent, LLVector3 &out_pos_age LLVector3d z_vec(0.0f, 0.0f, 1.0f); LLVector3d p0_global, p1_global; - if (gNoRender || mIsDummy) + if (mIsDummy) { outNorm.setVec(z_vec); out_pos_agent = in_pos_agent; @@ -6155,11 +6137,6 @@ BOOL LLVOAvatar::loadSkeletonNode () //----------------------------------------------------------------------------- void LLVOAvatar::updateVisualParams() { - if (gNoRender) - { - return; - } - setSex( (getVisualParamWeight( "male" ) > 0.5f) ? SEX_MALE : SEX_FEMALE ); LLCharacter::updateVisualParams(); @@ -6174,7 +6151,6 @@ void LLVOAvatar::updateVisualParams() dirtyMesh(); updateHeadOffset(); } - //----------------------------------------------------------------------------- // isActive() //----------------------------------------------------------------------------- @@ -6235,7 +6211,6 @@ BOOL LLVOAvatar::updateJointLODs() F32 avatar_num_factor = clamp_rescale((F32)sNumVisibleAvatars, 8, 25, 1.f, avatar_num_min_factor); F32 area_scale = 0.16f; - { if (isSelf()) { if(gAgentCamera.cameraCustomizeAvatar() || gAgentCamera.cameraMouselook()) @@ -6270,7 +6245,6 @@ BOOL LLVOAvatar::updateJointLODs() dirtyMesh(2); return TRUE; } - } return FALSE; } @@ -6399,19 +6373,18 @@ void LLVOAvatar::addChild(LLViewerObject *childp) LLViewerObject::addChild(childp); if (childp->mDrawable) { - if(isSelf()) + if (!attachObject(childp)) { - LL_INFOS("Attachment") << childp->getID() << " ("<getAttachmentPointName()<<") attached." << llendl; - llassert(std::find(mPendingAttachment.begin(), mPendingAttachment.end(), childp) == mPendingAttachment.end()); + llwarns << "addChild() failed for " + << childp->getID() + << " item " << childp->getAttachmentItemID() + << llendl; + // MAINT-3312 backout + // mPendingAttachment.push_back(childp); } - attachObject(childp); } else { - if(isSelf()) - { - LL_INFOS("Attachment") << childp->getID() << " ("<getAttachmentPointName()<<") pending." << llendl; - } mPendingAttachment.push_back(childp); } } @@ -6540,17 +6513,22 @@ void LLVOAvatar::lazyAttach() for (U32 i = 0; i < mPendingAttachment.size(); i++) { - if (mPendingAttachment[i]->mDrawable) + LLPointer cur_attachment = mPendingAttachment[i]; + if (cur_attachment->mDrawable) { - if(isSelf()) - { - LL_INFOS("Attachment") << mPendingAttachment[i]->getID() << " ("<getAttachmentPointName()<<") done pending. attached." << llendl; + if(!attachObject(cur_attachment)) + { // Drop it + llwarns << "attachObject() failed for " + << cur_attachment->getID() + << " item " << cur_attachment->getAttachmentItemID() + << llendl; + // MAINT-3312 backout + //still_pending.push_back(cur_attachment); } - attachObject(mPendingAttachment[i]); } else { - still_pending.push_back(mPendingAttachment[i]); + still_pending.push_back(cur_attachment); } } @@ -6559,6 +6537,7 @@ void LLVOAvatar::lazyAttach() void LLVOAvatar::resetHUDAttachments() { + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter) @@ -6633,6 +6612,7 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO ) //----------------------------------------------------------------------------- BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) { + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter) @@ -6644,6 +6624,7 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) vector_replace_with_last(mAttachedObjectsVector,std::make_pair(viewer_object,attachment)); cleanupAttachedMesh( viewer_object ); + attachment->removeObject(viewer_object); lldebugs << "Detaching object " << viewer_object->mID << " from " << attachment->getName() << llendl; return TRUE; @@ -7058,9 +7039,12 @@ void LLVOAvatar::clearPhases() void LLVOAvatar::startPhase(const std::string& phase_name) { - F32 elapsed; - bool completed; - if (getPhases().getPhaseValues(phase_name, elapsed, completed)) + F32 elapsed = 0.0; + bool completed = false; + bool found = getPhases().getPhaseValues(phase_name, elapsed, completed); + //LL_DEBUGS("Avatar") << avString() << " phase state " << phase_name + // << " found " << found << " elapsed " << elapsed << " completed " << completed << LL_ENDL; + if (found) { if (!completed) { @@ -7074,8 +7058,8 @@ void LLVOAvatar::startPhase(const std::string& phase_name) void LLVOAvatar::stopPhase(const std::string& phase_name, bool err_check) { - F32 elapsed; - bool completed; + F32 elapsed = 0.0; + bool completed = false; if (getPhases().getPhaseValues(phase_name, elapsed, completed)) { if (!completed) @@ -7261,8 +7245,8 @@ BOOL LLVOAvatar::isFullyLoaded() const bool LLVOAvatar::isTooComplex() const { - static const LLCachedControl render_avatar_complexity_limit("RenderAvatarComplexityLimit",0); - if (render_avatar_complexity_limit > 0 && mVisualComplexity >= render_avatar_complexity_limit) + static LLCachedControl ava_complexity_limit(gSavedSettings, "RenderAvatarComplexityLimit"); + if (ava_complexity_limit > 0 && mVisualComplexity >= ava_complexity_limit) { return true; } @@ -7283,7 +7267,8 @@ LLMotion* LLVOAvatar::findMotion(const LLUUID& id) const // colorized if using deferred rendering. void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color) { - if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) + static LLCachedControl debug_avatar_comp_baked(gSavedSettings, "DebugAvatarCompositeBaked"); + if (debug_avatar_comp_baked) { avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin(); avatar_joint_mesh_list_t::iterator end = mBakedTextureDatas[i].mJointMeshes.end(); @@ -7299,6 +7284,7 @@ void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color) } } } + //----------------------------------------------------------------------------- // updateMeshTextures() // Uses the current TE values to set the meshes' and layersets' textures. @@ -7613,7 +7599,6 @@ void LLVOAvatar::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_com } } - // returns TRUE if morph masks are present and not valid for a given baked texture, FALSE otherwise BOOL LLVOAvatar::morphMaskNeedsUpdate(LLAvatarAppearanceDefines::EBakedTextureIndex index) { @@ -7796,7 +7781,7 @@ LLBBox LLVOAvatar::getHUDBBox() const //----------------------------------------------------------------------------- void LLVOAvatar::onFirstTEMessageReceived() { - LL_INFOS("Avatar") << avString() << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << LL_ENDL; if( !mFirstTEMessageReceived ) { mFirstTEMessageReceived = TRUE; @@ -8038,13 +8023,13 @@ bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32 { appearance_version = contents.mParamAppearanceVersion; } - if (contents.mAppearanceVersion >= 0) + else if (contents.mAppearanceVersion > 0) { appearance_version = contents.mAppearanceVersion; } - if (appearance_version < 0) // still not set, go with 0. + else // still not set, go with 1. { - appearance_version = 0; + appearance_version = 1; } LL_DEBUGS("Avatar") << "appearance version info - field " << contents.mAppearanceVersion << " param: " << contents.mParamAppearanceVersion @@ -8082,6 +8067,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) llwarns << "bad appearance version info, discarding" << llendl; return; } + S32 this_update_cof_version = contents.mCOFVersion; S32 last_update_request_cof_version = LLAppearanceMgr::instance().mLastUpdateRequestCOFVersion; @@ -8129,6 +8115,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) return; } + // SUNSHINE CLEANUP - is this case OK now? S32 num_params = contents.mParamWeights.size(); if (num_params <= 1) { @@ -8153,9 +8140,15 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) && mBakedTextureDatas[baked_index].mLastTextureID != IMG_DEFAULT && baked_index != BAKED_SKIRT) { + LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using mLastTextureID " << mBakedTextureDatas[baked_index].mLastTextureID << LL_ENDL; setTEImage(mBakedTextureDatas[baked_index].mTextureIndex, LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[baked_index].mLastTextureID, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); } + else + { + LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using texture id " + << getTE(mBakedTextureDatas[baked_index].mTextureIndex)->getID() << LL_ENDL; + } } // runway - was @@ -8183,6 +8176,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) LL_DEBUGS("Avatar") << avString() << " handle visual params, num_params " << num_params << LL_ENDL; BOOL params_changed = FALSE; BOOL interp_params = FALSE; + S32 params_changed_count = 0; for( S32 i = 0; i < num_params; i++ ) { @@ -8197,8 +8191,11 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) if (is_first_appearance_message || (param->getWeight() != newWeight)) { params_changed = TRUE; + params_changed_count++; + if(is_first_appearance_message) { + //LL_DEBUGS("Avatar") << "param slam " << i << " " << newWeight << LL_ENDL; param->setWeight(newWeight, FALSE); } else @@ -8214,6 +8211,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) LL_DEBUGS("Avatar") << "Number of params in AvatarAppearance msg (" << num_params << ") does not match number of tweakable params in avatar xml file (" << expected_tweakable_count << "). Processing what we can. object: " << getID() << LL_ENDL; } + LL_DEBUGS("Avatar") << "Changed " << params_changed_count << " params" << LL_ENDL; if (params_changed) { if (interp_params) @@ -8263,35 +8261,36 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } updateMeshTextures(); - //if (enable_verbose_dumps) dumpArchetypeXML(dump_prefix + "process_end"); } // static -void LLVOAvatar::getAnimLabels( LLDynamicArray* labels ) +void LLVOAvatar::getAnimLabels( std::vector* labels ) { S32 i; + labels->reserve(gUserAnimStatesCount); for( i = 0; i < gUserAnimStatesCount; i++ ) { - labels->put( LLAnimStateLabels::getStateLabel( gUserAnimStates[i].mName ) ); + labels->push_back( LLAnimStateLabels::getStateLabel( gUserAnimStates[i].mName ) ); } // Special case to trigger away (AFK) state - labels->put( "Away From Keyboard" ); + labels->push_back( "Away From Keyboard" ); } // static -void LLVOAvatar::getAnimNames( LLDynamicArray* names ) +void LLVOAvatar::getAnimNames( std::vector* names ) { S32 i; + names->reserve(gUserAnimStatesCount); for( i = 0; i < gUserAnimStatesCount; i++ ) { - names->put( std::string(gUserAnimStates[i].mName) ); + names->push_back( std::string(gUserAnimStates[i].mName) ); } // Special case to trigger away (AFK) state - names->put( "enter_away_from_keyboard_state" ); + names->push_back( "enter_away_from_keyboard_state" ); } // static @@ -8444,7 +8443,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) LLViewerTexture* image_baked = getImage( mBakedTextureDatas[i].mTextureIndex, 0 ); if (id == image_baked->getID()) { - LL_DEBUGS("Avatar") << avString() << " i " << i << " id " << id << LL_ENDL; + //LL_DEBUGS("Avatar") << avString() << " i " << i << " id " << id << LL_ENDL; mBakedTextureDatas[i].mIsLoaded = true; mBakedTextureDatas[i].mLastTextureID = id; mBakedTextureDatas[i].mIsUsed = true; @@ -8517,6 +8516,15 @@ std::string get_sequential_numbered_file_name(const std::string& prefix, return outfilename; } +void dump_sequential_xml(const std::string outprefix, const LLSD& content) +{ + std::string outfilename = get_sequential_numbered_file_name(outprefix,".xml"); + std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); + std::ofstream ofs(fullpath.c_str(), std::ios_base::out); + ofs << LLSDOStreamer(content, LLSDFormatter::OPTIONS_PRETTY); + LL_DEBUGS("Avatar") << "results saved to: " << fullpath << LL_ENDL; +} + void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_wearables ) { std::string outprefix(prefix); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index b0bc08ab3..6dd1f0b71 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -250,7 +250,6 @@ public: virtual LLJoint* getJoint(const std::string &name); void resetJointPositionsToDefault( void ); - void resetSpecificJointPosition( const std::string& name ); /*virtual*/ const LLUUID& getID() const; /*virtual*/ void addDebugText(const std::string& text); @@ -916,11 +915,11 @@ private: **/ public: - /*virtual*/ std::string getFullname() const; // Returns "FirstName LastName" + std::string getFullname() const; // Returns "FirstName LastName" std::string avString() const; // Frequently used string in log messages "Avatar '* labels); - static void getAnimNames(LLDynamicArray* names); + static void getAnimLabels(std::vector* labels); + static void getAnimNames(std::vector* names); private: std::string mNameString; // UTF-8 title + name + status std::string mTitle; @@ -1074,8 +1073,10 @@ private: // }; // LLVOAvatar - extern const F32 SELF_ADDITIONAL_PRI; extern const S32 MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL; +void dump_sequential_xml(const std::string outprefix, const LLSD& content); + #endif // LL_VOAVATAR_H + diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index f5cf396c3..c77914e36 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -620,12 +620,21 @@ void LLVOAvatarSelf::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) // virtual LLJoint *LLVOAvatarSelf::getJoint(const std::string &name) { - if (mScreenp) + // - findJoint Opt + LLJoint* jointp = LLVOAvatar::getJoint(name); + if (!jointp && mScreenp) { - LLJoint* jointp = mScreenp->findJoint(name); - if (jointp) return jointp; + jointp = mScreenp->findJoint(name); } - return LLVOAvatar::getJoint(name); + return jointp; + + // + //if (mScreenp) + //{ + // LLJoint* jointp = mScreenp->findJoint(name); + // if (jointp) return jointp; + //} + //return LLVOAvatar::getJoint(name); } // virtual BOOL LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 weight, BOOL upload_bake ) @@ -663,14 +672,6 @@ BOOL LLVOAvatarSelf::setParamWeight(const LLViewerVisualParam *param, F32 weight return FALSE; } -#if 0 - // FIXME DRANO - kludgy way to avoid overwriting avatar state from wearables. - if (isUsingServerBakes() && !isUsingLocalAppearance()) - { - return FALSE; - } -#endif - if (param->getCrossWearable()) { LLWearableType::EType type = (LLWearableType::EType)param->getWearableType(); @@ -741,50 +742,9 @@ void LLVOAvatarSelf::stopMotionFromSource(const LLUUID& source_id) } //virtual -U32 LLVOAvatarSelf::processUpdateMessage(LLMessageSystem *mesgsys, - void **user_data, - U32 block_num, - const EObjectUpdateType update_type, - LLDataPacker *dp) +U32 LLVOAvatarSelf::processUpdateMessage(LLMessageSystem *mesgsys, void **user_data, U32 block_num, const EObjectUpdateType update_type, LLDataPacker *dp) { - U32 retval = LLVOAvatar::processUpdateMessage(mesgsys,user_data,block_num,update_type,dp); - -#if 0 - // DRANO - it's not clear this does anything useful. If we wait - // until an appearance message has been received, we already have - // the texture ids. If we don't wait, we don't yet know where to - // look for baked textures, because we haven't received the - // appearance version data from the appearance message. This looks - // like an old optimization that's incompatible with server-side - // texture baking. - - // FIXME DRANO - skipping in the case of !mFirstAppearanceMessageReceived prevents us from trying to - // load textures before we know where they come from (ie, from baking service or not); - // unknown impact on performance. - if (mInitialBakesLoaded == false && retval == 0x0 && mFirstAppearanceMessageReceived) - { - // call update textures to force the images to be created - updateMeshTextures(); - - // unpack the texture UUIDs to the texture slots - retval = unpackTEMessage(mesgsys, _PREHASH_ObjectData, (S32) block_num); - - // need to trigger a few operations to get the avatar to use the new bakes - for (U32 i = 0; i < mBakedTextureDatas.size(); i++) - { - const LLAvatarAppearanceDefines::ETextureIndex te = mBakedTextureDatas[i].mTextureIndex; - LLUUID texture_id = getTEImage(te)->getID(); - setNewBakedTexture(te, texture_id); - mInitialBakeIDs[i] = texture_id; - } - - onFirstTEMessageReceived(); - - mInitialBakesLoaded = true; - } -#endif - - return retval; + return LLVOAvatar::processUpdateMessage(mesgsys, user_data, block_num, update_type, dp); } void LLVOAvatarSelf::setLocalTextureTE(U8 te, LLViewerTexture* image, U32 index) @@ -824,7 +784,7 @@ void LLVOAvatarSelf::removeMissingBakedTextures() if (!tex || tex->isMissingAsset()) { LLViewerTexture *imagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT_AVATAR); - if (imagep) + if (imagep && imagep != tex) { setTEImage(te, imagep); removed = TRUE; @@ -863,9 +823,9 @@ void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp) // Diagnostic info //LLVector3d pos_from_new_region = getPositionGlobal(); - //llinfos << "pos_from_old_region is " << global_pos_from_old_region + //LL_INFOS() << "pos_from_old_region is " << global_pos_from_old_region // << " while pos_from_new_region is " << pos_from_new_region - // << llendl; + // << LL_ENDL; } if (!regionp || (regionp->getHandle() != mLastRegionHandle)) @@ -971,7 +931,6 @@ void LLVOAvatarSelf::idleUpdateTractorBeam() mBeam->setPositionGlobal(pick.mPosGlobal); } - } if (mBeamTimer.getElapsedTimeF32() > 0.25f) { @@ -988,7 +947,7 @@ void LLVOAvatarSelf::idleUpdateTractorBeam() // virtual void LLVOAvatarSelf::restoreMeshData() { - //llinfos << "Restoring" << llendl; + //LL_INFOS() << "Restoring" << LL_ENDL; mMeshValid = TRUE; updateJointLODs(); updateAttachmentVisibility(gAgentCamera.getCameraMode()); @@ -1069,13 +1028,13 @@ void LLVOAvatarSelf::wearableUpdated( LLWearableType::EType type, BOOL upload_re } } } - + // Physics type has no associated baked textures, but change of params needs to be sent to // other avatars. if (type == LLWearableType::WT_PHYSICS) - { - gAgent.sendAgentSetAppearance(); - } + { + gAgent.sendAgentSetAppearance(); + } } //----------------------------------------------------------------------------- @@ -1492,7 +1451,7 @@ BOOL LLVOAvatarSelf::isLocalTextureDataAvailable(const LLViewerTexLayerSet* laye //----------------------------------------------------------------------------- BOOL LLVOAvatarSelf::isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset) const { - const U32 desired_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel"); + static LLCachedControl desired_tex_discard_level(gSavedSettings, "TextureDiscardLevel"); // const U32 desired_tex_discard_level = 0; // hack to not bake textures on lower discard levels. for (U32 i = 0; i < mBakedTextureDatas.size(); i++) @@ -1527,7 +1486,7 @@ BOOL LLVOAvatarSelf::isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset BOOL LLVOAvatarSelf::isAllLocalTextureDataFinal() const { - const U32 desired_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel"); + static LLCachedControl desired_tex_discard_level(gSavedSettings, "TextureDiscardLevel"); // const U32 desired_tex_discard_level = 0; // hack to not bake textures on lower discard levels for (U32 i = 0; i < mBakedTextureDatas.size(); i++) @@ -1669,7 +1628,7 @@ void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset, BOOL upload_r { return; } - // llinfos << "LLVOAvatar::invalidComposite() " << layerset->getBodyRegionName() << llendl; + // LL_INFOS() << "LLVOAvatar::invalidComposite() " << layerset->getBodyRegionName() << LL_ENDL; layer_set->requestUpdate(); layer_set->invalidateMorphMasks(); @@ -2101,7 +2060,10 @@ BOOL LLVOAvatarSelf::getIsCloud() const /*static*/ void LLVOAvatarSelf::debugOnTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) { - gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata); + if (gAgentAvatarp.notNull()) + { + gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata); + } } void LLVOAvatarSelf::debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) @@ -2214,7 +2176,7 @@ void LLVOAvatarSelf::dumpAllTextures() const if (!layerset_buffer) continue; vd_text += verboseDebugDumpLocalTextureDataInfo(layerset); } - LL_DEBUGS("Avatar") << vd_text << llendl; + LL_DEBUGS("Avatar") << vd_text << LL_ENDL; } const std::string LLVOAvatarSelf::debugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const @@ -2285,28 +2247,9 @@ const std::string LLVOAvatarSelf::debugDumpAllLocalTextureDataInfo() const return text; } - -#if 0 -// Dump avatar metrics data. -LLSD LLVOAvatarSelf::metricsData() -{ - // runway - add region info - LLSD result; - result["rez_status"] = LLVOAvatar::rezStatusToString(getRezzedStatus()); - result["timers"]["debug_existence"] = mDebugExistenceTimer.getElapsedTimeF32(); - result["timers"]["ruth_debug"] = mRuthDebugTimer.getElapsedTimeF32(); - result["timers"]["ruth"] = mRuthTimer.getElapsedTimeF32(); - result["timers"]["invisible"] = mInvisibleTimer.getElapsedTimeF32(); - result["timers"]["fully_loaded"] = mFullyLoadedTimer.getElapsedTimeF32(); - result["startup"] = LLStartUp::getPhases().dumpPhases(); - - return result; -} -#endif - -extern AIHTTPTimeoutPolicy appearanceChangeMetricsResponder_timeout; class ViewerAppearanceChangeMetricsResponder: public LLHTTPClient::ResponderWithResult { + LOG_CLASS(ViewerAppearanceChangeMetricsResponder); public: ViewerAppearanceChangeMetricsResponder( S32 expected_sequence, volatile const S32 & live_sequence, @@ -2317,7 +2260,8 @@ public: { } - /*virtual*/ void httpSuccess(void) +private: + /* virtual */ void httpSuccess() { LL_DEBUGS("Avatar") << "OK" << LL_ENDL; if (mLiveSequence == mExpectedSequence) @@ -2325,11 +2269,12 @@ public: mReportingStarted = true; } } - /*virtual*/ void httpFailure(void) + + /* virtual */ void httpFailure() { - LL_WARNS("Avatar") << "Failed " << mStatus << " reason " << mReason << LL_ENDL; + // if we add retry, this should be removed from the httpFailure case + LL_WARNS("Avatar") << dumpResponse() << LL_ENDL; } - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return appearanceChangeMetricsResponder_timeout; } /*virtual*/ char const* getName(void) const { return "AppearanceChangeMetricsResponder"; } private: S32 mExpectedSequence; @@ -2481,19 +2426,14 @@ void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics() } } -extern AIHTTPTimeoutPolicy checkAgentAppearanceServiceResponder_timeout; class CheckAgentAppearanceServiceResponder: public LLHTTPClient::ResponderHeadersOnly { public: - CheckAgentAppearanceServiceResponder() - { - } - - virtual ~CheckAgentAppearanceServiceResponder() - { - } + CheckAgentAppearanceServiceResponder() {} - /*virtual*/ void completedHeaders(void) + virtual ~CheckAgentAppearanceServiceResponder() {} + + /*virtual*/ void completedHeaders() { if (isGoodStatus(mStatus)) { @@ -2509,16 +2449,6 @@ public: } } - // Error - /*virtual*//* void httpFailure(void) - { - if (isAgentAvatarValid()) - { - LL_DEBUGS("Avatar") << "failed, will rebake" << llendl; - forceAppearanceUpdate(); - } - } */ - static void forceAppearanceUpdate() { // Trying to rebake immediately after crossing region boundary @@ -2527,7 +2457,6 @@ public: doAfterInterval(force_bake_all_textures, 5.0); } - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return checkAgentAppearanceServiceResponder_timeout; } /*virtual*/ char const* getName(void) const { return "CheckAgentAppearanceServiceResponder"; } }; diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 2ee1c17bd..2c892af3f 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -349,6 +349,7 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() : mCaptureBufferRecording(false), mCaptureBufferRecorded(false), mCaptureBufferPlaying(false), + mShutdownComplete(true), mPlayRequestCount(0), mAvatarNameCacheConnection() @@ -404,6 +405,14 @@ void LLVivoxVoiceClient::terminate() { logout(); connectorShutdown(); +#ifdef LL_WINDOWS + S32 count = 0; + while (!mShutdownComplete && 10 > ++count) + { + stateMachine(); + _sleep(1000); + } +#endif // LL_WINDOW closeSocket(); // Need to do this now -- bad things happen if the destructor does it later. cleanUp(); } @@ -503,10 +512,9 @@ void LLVivoxVoiceClient::connectorCreate() std::string savedLogLevel = gSavedSettings.getString("VivoxDebugLevel"); - if(savedLogLevel != "-0") + if(savedLogLevel != "0") { LL_DEBUGS("Voice") << "creating connector with logging enabled" << LL_ENDL; - loglevel = "0"; } stream @@ -524,13 +532,14 @@ void LLVivoxVoiceClient::connectorCreate() stream << "" - << "" << logpath << "" - << "Connector" - << ".log" - << "" << loglevel << "" + << "" << logpath << "" + << "Connector" + << ".log" + << "" << loglevel << "" << "" - << "SecondLifeViewer.1" - << "\n\n\n"; + << "" //Name can cause problems per vivox. + << "12" + << "\n\n\n"; writeString(stream.str()); } @@ -548,6 +557,7 @@ void LLVivoxVoiceClient::connectorShutdown() << "" << "\n\n\n"; + mShutdownComplete = false; mConnectorHandle.clear(); writeString(stream.str()); @@ -836,9 +846,13 @@ void LLVivoxVoiceClient::stateMachine() { // vivox executable exists. Build the command line and launch the daemon. std::string args, cmd; - // SLIM SDK: these arguments are no longer necessary. -// std::string args = " -p tcp -h -c"; + std::string loglevel = gSavedSettings.getString("VivoxDebugLevel"); +// Singu Note: omit shutdown timeout for Linux, as we are using 2.x version of the SDK there +// Singu TODO: Remove this when the Vivox SDK 4.x is working on Linux +#ifndef LL_LINUX + std::string shutdown_timeout = gSavedSettings.getString("VivoxShutdownTimeout"); +#endif if(loglevel.empty()) { loglevel = "0"; // turn logging off completely @@ -852,6 +866,23 @@ void LLVivoxVoiceClient::stateMachine() #else args += loglevel; #endif + args += " -lf "; + std::string log_folder = gSavedSettings.getString("VivoxLogDirectory"); + if (log_folder.empty()) + { + log_folder = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); + } + args += "logfolder"; + +// Singu Note: omit shutdown timeout for Linux, as we are using 2.x version of the SDK there +// Singu TODO: Remove this when the Vivox SDK 4.x is working on Linux +#ifndef LL_LINUX + if(!shutdown_timeout.empty()) + { + args += " -st "; + args += shutdown_timeout; + } +#endif // If we allow multiple instances of the viewer to start the voicedaemon if (gSavedSettings.getBOOL("VoiceMultiInstance")) @@ -1641,7 +1672,7 @@ void LLVivoxVoiceClient::stateMachine() // Always reset the terminate request flag when we get here. mSessionTerminateRequested = false; - if((mVoiceEnabled || !mIsInitialized) && !mRelogRequested) + if((mVoiceEnabled || !mIsInitialized) && !mRelogRequested && !LLApp::isExiting()) { // Just leaving a channel, go back to stateNoChannel (the "logged in but have no channel" state). setState(stateNoChannel); @@ -1684,6 +1715,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateConnectorStopping case stateConnectorStopping: // waiting for connector stop // The handler for the Connector.InitiateShutdown response will transition from here to stateConnectorStopped. + mShutdownComplete = true; break; //MARK: stateConnectorStopped diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index a2afe4e66..2d723184b 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -878,6 +878,7 @@ private: bool mCaptureBufferRecording; // A voice sample is being captured. bool mCaptureBufferRecorded; // A voice sample is captured in the buffer ready to play. bool mCaptureBufferPlaying; // A voice sample is being played. + bool mShutdownComplete; LLTimer mCaptureTimer; LLUUID mPreviewVoiceFont; diff --git a/indra/newview/res/Ascent_icon.png b/indra/newview/res/Ascent_icon.png index 92fa4158b..ac8444a63 100644 Binary files a/indra/newview/res/Ascent_icon.png and b/indra/newview/res/Ascent_icon.png differ diff --git a/indra/newview/res/ll_icon.png b/indra/newview/res/ll_icon.png index 414b70311..680ef2137 100644 Binary files a/indra/newview/res/ll_icon.png and b/indra/newview/res/ll_icon.png differ diff --git a/indra/newview/res/singularity_icon.png b/indra/newview/res/singularity_icon.png index 67396b366..ae3d64aa3 100644 Binary files a/indra/newview/res/singularity_icon.png and b/indra/newview/res/singularity_icon.png differ diff --git a/indra/newview/res/snowglobe_icon.png b/indra/newview/res/snowglobe_icon.png index 7e00cb75c..fdd54c3aa 100644 Binary files a/indra/newview/res/snowglobe_icon.png and b/indra/newview/res/snowglobe_icon.png differ diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp index e736193ef..5ee7bfba6 100644 --- a/indra/newview/rlvcommon.cpp +++ b/indra/newview/rlvcommon.cpp @@ -36,7 +36,8 @@ #include "rlvlocks.h" #include "../lscript/lscript_byteformat.h" //Need LSCRIPTRunTimePermissionBits and SCRIPT_PERMISSION_* -#include +#include // icontains +#include // regex_replace_all // ============================================================================ // RlvNotifications @@ -366,6 +367,12 @@ void RlvStrings::setCustomString(const std::string& strStringName, const std::st bool RlvUtil::m_fForceTp = false; +std::string escape_for_regex(const std::string& str) +{ + using namespace boost; + return regex_replace(str, regex("[.^$|()\\[\\]{}*+?\\\\]"), "\\\\&", match_default|format_sed); +} + // Checked: 2009-07-04 (RLVa-1.0.0a) | Modified: RLVa-1.0.0a void RlvUtil::filterLocation(std::string& strUTF8Text) { @@ -373,12 +380,12 @@ void RlvUtil::filterLocation(std::string& strUTF8Text) LLWorld::region_list_t regions = LLWorld::getInstance()->getRegionList(); const std::string& strHiddenRegion = RlvStrings::getString(RLV_STRING_HIDDEN_REGION); for (LLWorld::region_list_t::const_iterator itRegion = regions.begin(); itRegion != regions.end(); ++itRegion) - boost::ireplace_all(strUTF8Text, (*itRegion)->getName(), strHiddenRegion); + boost::replace_all_regex(strUTF8Text, boost::regex("\\b" + escape_for_regex((*itRegion)->getName()) + "\\b", boost::regex::icase), strHiddenRegion); // Filter any mention of the parcel name LLViewerParcelMgr* pParcelMgr = LLViewerParcelMgr::getInstance(); if (pParcelMgr) - boost::ireplace_all(strUTF8Text, pParcelMgr->getAgentParcelName(), RlvStrings::getString(RLV_STRING_HIDDEN_PARCEL)); + boost::replace_all_regex(strUTF8Text, boost::regex("\\b" + escape_for_regex(pParcelMgr->getAgentParcelName()) + "\\b", boost::regex::icase), RlvStrings::getString(RLV_STRING_HIDDEN_PARCEL)); } // Checked: 2010-12-08 (RLVa-1.2.2c) | Modified: RLVa-1.2.2c @@ -391,7 +398,7 @@ void RlvUtil::filterNames(std::string& strUTF8Text, bool fFilterLegacy) LLAvatarName avName; if (LLAvatarNameCache::get(idAgents[idxAgent], &avName)) { - const std::string& strDisplayName = avName.mDisplayName; + const std::string& strDisplayName = escape_for_regex(avName.mDisplayName); bool fFilterDisplay = (strDisplayName.length() > 2); const std::string& strLegacyName = avName.getLegacyName(); fFilterLegacy &= (strLegacyName.length() > 2); @@ -401,16 +408,16 @@ void RlvUtil::filterNames(std::string& strUTF8Text, bool fFilterLegacy) if (boost::icontains(strLegacyName, strDisplayName)) { if (fFilterLegacy) - boost::ireplace_all(strUTF8Text, strLegacyName, strAnonym); + boost::replace_all_regex(strUTF8Text, boost::regex("\\b" + strLegacyName + "\\b", boost::regex::icase), strAnonym); if (fFilterDisplay) - boost::ireplace_all(strUTF8Text, strDisplayName, strAnonym); + boost::replace_all_regex(strUTF8Text, boost::regex("\\b" + strDisplayName + "\\b", boost::regex::icase), strAnonym); } else { if (fFilterDisplay) - boost::ireplace_all(strUTF8Text, strDisplayName, strAnonym); + boost::replace_all_regex(strUTF8Text, boost::regex("\\b" + strDisplayName + "\\b", boost::regex::icase), strAnonym); if (fFilterLegacy) - boost::ireplace_all(strUTF8Text, strLegacyName, strAnonym); + boost::replace_all_regex(strUTF8Text, boost::regex("\\b" + strLegacyName + "\\b", boost::regex::icase), strAnonym); } } } diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index 143ff6903..b44fd340e 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -1750,9 +1750,9 @@ ERlvCmdRet RlvHandler::onForceGroup(const RlvCommand& rlvCmd) const } else { - for (S32 idxGroup = 0, cntGroup = gAgent.mGroups.count(); (idxGroup < cntGroup) && (idGroup.isNull()); idxGroup++) - if (boost::iequals(gAgent.mGroups.get(idxGroup).mName, rlvCmd.getOption())) - idGroup = gAgent.mGroups.get(idxGroup).mID; + for (S32 idxGroup = 0, cntGroup = gAgent.mGroups.size(); (idxGroup < cntGroup) && (idGroup.isNull()); idxGroup++) + if (boost::iequals(gAgent.mGroups[idxGroup].mName, rlvCmd.getOption())) + idGroup = gAgent.mGroups[idxGroup].mID; fValid = (idGroup.notNull()) || ("none" == rlvCmd.getOption()); } diff --git a/indra/newview/rlvui.cpp b/indra/newview/rlvui.cpp index 46327d8c2..81c431453 100644 --- a/indra/newview/rlvui.cpp +++ b/indra/newview/rlvui.cpp @@ -488,12 +488,12 @@ bool RlvUIEnabler::canViewParcelProperties() const LLUUID& idOwner = pParcel->getOwnerID(); if ( (idOwner != gAgent.getID()) ) { - S32 count = gAgent.mGroups.count(); + S32 count = gAgent.mGroups.size(); for (S32 i = 0; i < count; ++i) { - if (gAgent.mGroups.get(i).mID == idOwner) + if (gAgent.mGroups[i].mID == idOwner) { - fShow = ((gAgent.mGroups.get(i).mPowers & GP_LAND_RETURN) > 0); + fShow = ((gAgent.mGroups[i].mPowers & GP_LAND_RETURN) > 0); break; } } diff --git a/indra/newview/skins/DarkGreen.xml b/indra/newview/skins/DarkGreen.xml new file mode 100644 index 000000000..4f32939ae --- /dev/null +++ b/indra/newview/skins/DarkGreen.xml @@ -0,0 +1,14 @@ + + + skin_name + Dark Green + author_name + JB Kraft, modified by SLB Wirefly + additional_author_names + Linden Lab + skin_info + + folder_name + darkgreen + + diff --git a/indra/newview/skins/apollo/textures/checkerboard_transparency_bg.png b/indra/newview/skins/apollo/textures/checkerboard_transparency_bg.png index 9a1693520..fe06d38ef 100644 Binary files a/indra/newview/skins/apollo/textures/checkerboard_transparency_bg.png and b/indra/newview/skins/apollo/textures/checkerboard_transparency_bg.png differ diff --git a/indra/newview/skins/apollo/textures/down_arrow.png b/indra/newview/skins/apollo/textures/down_arrow.png index 155f80c97..d376d980d 100644 Binary files a/indra/newview/skins/apollo/textures/down_arrow.png and b/indra/newview/skins/apollo/textures/down_arrow.png differ diff --git a/indra/newview/skins/apollo/textures/icon_avatar_expand.png b/indra/newview/skins/apollo/textures/icon_avatar_expand.png index 47698e9eb..453a52c1d 100644 Binary files a/indra/newview/skins/apollo/textures/icon_avatar_expand.png and b/indra/newview/skins/apollo/textures/icon_avatar_expand.png differ diff --git a/indra/newview/skins/apollo/textures/notify_next.png b/indra/newview/skins/apollo/textures/notify_next.png index 6faa14a99..d649a4775 100644 Binary files a/indra/newview/skins/apollo/textures/notify_next.png and b/indra/newview/skins/apollo/textures/notify_next.png differ diff --git a/indra/newview/skins/apollo/textures/preview.png b/indra/newview/skins/apollo/textures/preview.png index d045ac734..b8e2fa660 100644 Binary files a/indra/newview/skins/apollo/textures/preview.png and b/indra/newview/skins/apollo/textures/preview.png differ diff --git a/indra/newview/skins/apollo/textures/skin_thumbnail_dark.png b/indra/newview/skins/apollo/textures/skin_thumbnail_dark.png index 2cac82923..fc102a014 100644 Binary files a/indra/newview/skins/apollo/textures/skin_thumbnail_dark.png and b/indra/newview/skins/apollo/textures/skin_thumbnail_dark.png differ diff --git a/indra/newview/skins/apollo/textures/skin_thumbnail_default.png b/indra/newview/skins/apollo/textures/skin_thumbnail_default.png index 40fe64bb4..e22b1c164 100644 Binary files a/indra/newview/skins/apollo/textures/skin_thumbnail_default.png and b/indra/newview/skins/apollo/textures/skin_thumbnail_default.png differ diff --git a/indra/newview/skins/apollo/textures/skin_thumbnail_gred.png b/indra/newview/skins/apollo/textures/skin_thumbnail_gred.png index 827135499..d60584743 100644 Binary files a/indra/newview/skins/apollo/textures/skin_thumbnail_gred.png and b/indra/newview/skins/apollo/textures/skin_thumbnail_gred.png differ diff --git a/indra/newview/skins/apollo/textures/skin_thumbnail_phoenix.png b/indra/newview/skins/apollo/textures/skin_thumbnail_phoenix.png index ab35bc0ab..f2ab49e6d 100644 Binary files a/indra/newview/skins/apollo/textures/skin_thumbnail_phoenix.png and b/indra/newview/skins/apollo/textures/skin_thumbnail_phoenix.png differ diff --git a/indra/newview/skins/apollo/textures/skin_thumbnail_pslgreen.png b/indra/newview/skins/apollo/textures/skin_thumbnail_pslgreen.png index 73e117e9f..3eb7263d6 100644 Binary files a/indra/newview/skins/apollo/textures/skin_thumbnail_pslgreen.png and b/indra/newview/skins/apollo/textures/skin_thumbnail_pslgreen.png differ diff --git a/indra/newview/skins/apollo/textures/skin_thumbnail_pslpurple.png b/indra/newview/skins/apollo/textures/skin_thumbnail_pslpurple.png index 902ad82b1..877514d8c 100644 Binary files a/indra/newview/skins/apollo/textures/skin_thumbnail_pslpurple.png and b/indra/newview/skins/apollo/textures/skin_thumbnail_pslpurple.png differ diff --git a/indra/newview/skins/apollo/textures/skin_thumbnail_ruby.png b/indra/newview/skins/apollo/textures/skin_thumbnail_ruby.png index d45e75ad0..944b51985 100644 Binary files a/indra/newview/skins/apollo/textures/skin_thumbnail_ruby.png and b/indra/newview/skins/apollo/textures/skin_thumbnail_ruby.png differ diff --git a/indra/newview/skins/apollo/textures/skin_thumbnail_saphire.png b/indra/newview/skins/apollo/textures/skin_thumbnail_saphire.png index 7ec8e1991..2ee896780 100644 Binary files a/indra/newview/skins/apollo/textures/skin_thumbnail_saphire.png and b/indra/newview/skins/apollo/textures/skin_thumbnail_saphire.png differ diff --git a/indra/newview/skins/apollo/textures/skin_thumbnail_silver.png b/indra/newview/skins/apollo/textures/skin_thumbnail_silver.png index 51707bb9d..51f4cceb0 100644 Binary files a/indra/newview/skins/apollo/textures/skin_thumbnail_silver.png and b/indra/newview/skins/apollo/textures/skin_thumbnail_silver.png differ diff --git a/indra/newview/skins/apollo/textures/status_search_btn.png b/indra/newview/skins/apollo/textures/status_search_btn.png index 67f61332b..e648ba849 100644 Binary files a/indra/newview/skins/apollo/textures/status_search_btn.png and b/indra/newview/skins/apollo/textures/status_search_btn.png differ diff --git a/indra/newview/skins/apollo/textures/status_search_btn_pressed.png b/indra/newview/skins/apollo/textures/status_search_btn_pressed.png index 1437273d3..ec4254f4d 100644 Binary files a/indra/newview/skins/apollo/textures/status_search_btn_pressed.png and b/indra/newview/skins/apollo/textures/status_search_btn_pressed.png differ diff --git a/indra/newview/skins/apollo/textures/up_arrow.png b/indra/newview/skins/apollo/textures/up_arrow.png index fe68ad49d..a1a5d3823 100644 Binary files a/indra/newview/skins/apollo/textures/up_arrow.png and b/indra/newview/skins/apollo/textures/up_arrow.png differ diff --git a/indra/newview/skins/blackdark/textures/down_arrow.png b/indra/newview/skins/blackdark/textures/down_arrow.png index 46bb251f5..07ab1a91c 100644 Binary files a/indra/newview/skins/blackdark/textures/down_arrow.png and b/indra/newview/skins/blackdark/textures/down_arrow.png differ diff --git a/indra/newview/skins/blackdark/textures/notify_next.png b/indra/newview/skins/blackdark/textures/notify_next.png index 9b371e03e..d14feccb1 100644 Binary files a/indra/newview/skins/blackdark/textures/notify_next.png and b/indra/newview/skins/blackdark/textures/notify_next.png differ diff --git a/indra/newview/skins/blackdark/textures/preview.png b/indra/newview/skins/blackdark/textures/preview.png index 2022d7c88..0191b4def 100644 Binary files a/indra/newview/skins/blackdark/textures/preview.png and b/indra/newview/skins/blackdark/textures/preview.png differ diff --git a/indra/newview/skins/blackdark/textures/status_search_btn.png b/indra/newview/skins/blackdark/textures/status_search_btn.png index b755f6f10..f9fbebc83 100644 Binary files a/indra/newview/skins/blackdark/textures/status_search_btn.png and b/indra/newview/skins/blackdark/textures/status_search_btn.png differ diff --git a/indra/newview/skins/blackdark/textures/status_search_btn_pressed.png b/indra/newview/skins/blackdark/textures/status_search_btn_pressed.png index c19945885..056908992 100644 Binary files a/indra/newview/skins/blackdark/textures/status_search_btn_pressed.png and b/indra/newview/skins/blackdark/textures/status_search_btn_pressed.png differ diff --git a/indra/newview/skins/blackdark/textures/up_arrow.png b/indra/newview/skins/blackdark/textures/up_arrow.png index 5c60a61db..95a712f4a 100644 Binary files a/indra/newview/skins/blackdark/textures/up_arrow.png and b/indra/newview/skins/blackdark/textures/up_arrow.png differ diff --git a/indra/newview/skins/blacklightblue/textures/down_arrow.png b/indra/newview/skins/blacklightblue/textures/down_arrow.png index 88c8c8481..e8b4a6622 100644 Binary files a/indra/newview/skins/blacklightblue/textures/down_arrow.png and b/indra/newview/skins/blacklightblue/textures/down_arrow.png differ diff --git a/indra/newview/skins/blacklightblue/textures/notify_next.png b/indra/newview/skins/blacklightblue/textures/notify_next.png index 9b371e03e..d14feccb1 100644 Binary files a/indra/newview/skins/blacklightblue/textures/notify_next.png and b/indra/newview/skins/blacklightblue/textures/notify_next.png differ diff --git a/indra/newview/skins/blacklightblue/textures/preview.png b/indra/newview/skins/blacklightblue/textures/preview.png index 57c16eaf3..a52cee782 100644 Binary files a/indra/newview/skins/blacklightblue/textures/preview.png and b/indra/newview/skins/blacklightblue/textures/preview.png differ diff --git a/indra/newview/skins/blacklightblue/textures/status_search_btn.png b/indra/newview/skins/blacklightblue/textures/status_search_btn.png index 1798559e7..7bcc4ab44 100644 Binary files a/indra/newview/skins/blacklightblue/textures/status_search_btn.png and b/indra/newview/skins/blacklightblue/textures/status_search_btn.png differ diff --git a/indra/newview/skins/blacklightblue/textures/status_search_btn_pressed.png b/indra/newview/skins/blacklightblue/textures/status_search_btn_pressed.png index c19945885..056908992 100644 Binary files a/indra/newview/skins/blacklightblue/textures/status_search_btn_pressed.png and b/indra/newview/skins/blacklightblue/textures/status_search_btn_pressed.png differ diff --git a/indra/newview/skins/blacklightblue/textures/up_arrow.png b/indra/newview/skins/blacklightblue/textures/up_arrow.png index 1e55b6ca7..9fb5efaeb 100644 Binary files a/indra/newview/skins/blacklightblue/textures/up_arrow.png and b/indra/newview/skins/blacklightblue/textures/up_arrow.png differ diff --git a/indra/newview/skins/blackred/textures/down_arrow.png b/indra/newview/skins/blackred/textures/down_arrow.png index abd706481..82fdc1dfd 100644 Binary files a/indra/newview/skins/blackred/textures/down_arrow.png and b/indra/newview/skins/blackred/textures/down_arrow.png differ diff --git a/indra/newview/skins/blackred/textures/notify_next.png b/indra/newview/skins/blackred/textures/notify_next.png index 9b371e03e..d14feccb1 100644 Binary files a/indra/newview/skins/blackred/textures/notify_next.png and b/indra/newview/skins/blackred/textures/notify_next.png differ diff --git a/indra/newview/skins/blackred/textures/preview.png b/indra/newview/skins/blackred/textures/preview.png index 294a6a03a..2a370e11f 100644 Binary files a/indra/newview/skins/blackred/textures/preview.png and b/indra/newview/skins/blackred/textures/preview.png differ diff --git a/indra/newview/skins/blackred/textures/status_search_btn.png b/indra/newview/skins/blackred/textures/status_search_btn.png index f6db36fbc..4b3cb952b 100644 Binary files a/indra/newview/skins/blackred/textures/status_search_btn.png and b/indra/newview/skins/blackred/textures/status_search_btn.png differ diff --git a/indra/newview/skins/blackred/textures/status_search_btn_pressed.png b/indra/newview/skins/blackred/textures/status_search_btn_pressed.png index c19945885..056908992 100644 Binary files a/indra/newview/skins/blackred/textures/status_search_btn_pressed.png and b/indra/newview/skins/blackred/textures/status_search_btn_pressed.png differ diff --git a/indra/newview/skins/blackred/textures/up_arrow.png b/indra/newview/skins/blackred/textures/up_arrow.png index 6beea5fd7..ecd191136 100644 Binary files a/indra/newview/skins/blackred/textures/up_arrow.png and b/indra/newview/skins/blackred/textures/up_arrow.png differ diff --git a/indra/newview/skins/dark/colors.xml b/indra/newview/skins/dark/colors.xml index 032351a88..c911a04f4 100644 --- a/indra/newview/skins/dark/colors.xml +++ b/indra/newview/skins/dark/colors.xml @@ -183,12 +183,6 @@ - - - - - - diff --git a/indra/newview/skins/dark/textures/notify_next.png b/indra/newview/skins/dark/textures/notify_next.png index b57c26e26..83603835d 100644 Binary files a/indra/newview/skins/dark/textures/notify_next.png and b/indra/newview/skins/dark/textures/notify_next.png differ diff --git a/indra/newview/skins/dark/textures/preview.png b/indra/newview/skins/dark/textures/preview.png index a9f2b8b02..bf4df71c5 100644 Binary files a/indra/newview/skins/dark/textures/preview.png and b/indra/newview/skins/dark/textures/preview.png differ diff --git a/indra/newview/skins/darkcatalan/colors.xml b/indra/newview/skins/darkcatalan/colors.xml index e2579eeee..f8a009e0d 100644 --- a/indra/newview/skins/darkcatalan/colors.xml +++ b/indra/newview/skins/darkcatalan/colors.xml @@ -150,8 +150,6 @@ - - diff --git a/indra/newview/skins/darkcatalan/textures/checkerboard_transparency_bg.png b/indra/newview/skins/darkcatalan/textures/checkerboard_transparency_bg.png index 9a1693520..fe06d38ef 100644 Binary files a/indra/newview/skins/darkcatalan/textures/checkerboard_transparency_bg.png and b/indra/newview/skins/darkcatalan/textures/checkerboard_transparency_bg.png differ diff --git a/indra/newview/skins/darkcatalan/textures/down_arrow.png b/indra/newview/skins/darkcatalan/textures/down_arrow.png index 155f80c97..d376d980d 100644 Binary files a/indra/newview/skins/darkcatalan/textures/down_arrow.png and b/indra/newview/skins/darkcatalan/textures/down_arrow.png differ diff --git a/indra/newview/skins/darkcatalan/textures/icon_avatar_expand.png b/indra/newview/skins/darkcatalan/textures/icon_avatar_expand.png index 47698e9eb..453a52c1d 100644 Binary files a/indra/newview/skins/darkcatalan/textures/icon_avatar_expand.png and b/indra/newview/skins/darkcatalan/textures/icon_avatar_expand.png differ diff --git a/indra/newview/skins/darkcatalan/textures/notify_next.png b/indra/newview/skins/darkcatalan/textures/notify_next.png index 6faa14a99..d649a4775 100644 Binary files a/indra/newview/skins/darkcatalan/textures/notify_next.png and b/indra/newview/skins/darkcatalan/textures/notify_next.png differ diff --git a/indra/newview/skins/darkcatalan/textures/preview.png b/indra/newview/skins/darkcatalan/textures/preview.png index 2a9a6f579..32c661b57 100644 Binary files a/indra/newview/skins/darkcatalan/textures/preview.png and b/indra/newview/skins/darkcatalan/textures/preview.png differ diff --git a/indra/newview/skins/darkcatalan/textures/status_search_btn.png b/indra/newview/skins/darkcatalan/textures/status_search_btn.png index 67f61332b..e648ba849 100644 Binary files a/indra/newview/skins/darkcatalan/textures/status_search_btn.png and b/indra/newview/skins/darkcatalan/textures/status_search_btn.png differ diff --git a/indra/newview/skins/darkcatalan/textures/status_search_btn_pressed.png b/indra/newview/skins/darkcatalan/textures/status_search_btn_pressed.png index 1437273d3..ec4254f4d 100644 Binary files a/indra/newview/skins/darkcatalan/textures/status_search_btn_pressed.png and b/indra/newview/skins/darkcatalan/textures/status_search_btn_pressed.png differ diff --git a/indra/newview/skins/darkcatalan/textures/up_arrow.png b/indra/newview/skins/darkcatalan/textures/up_arrow.png index 601dc39f4..02d93c437 100644 Binary files a/indra/newview/skins/darkcatalan/textures/up_arrow.png and b/indra/newview/skins/darkcatalan/textures/up_arrow.png differ diff --git a/indra/newview/skins/darkgred/colors.xml b/indra/newview/skins/darkgred/colors.xml index 22034c252..c005b75fc 100644 --- a/indra/newview/skins/darkgred/colors.xml +++ b/indra/newview/skins/darkgred/colors.xml @@ -184,11 +184,6 @@ - - - - - diff --git a/indra/newview/skins/darkgred/textures/notify_next.png b/indra/newview/skins/darkgred/textures/notify_next.png index b57c26e26..83603835d 100644 Binary files a/indra/newview/skins/darkgred/textures/notify_next.png and b/indra/newview/skins/darkgred/textures/notify_next.png differ diff --git a/indra/newview/skins/darkgred/textures/preview.png b/indra/newview/skins/darkgred/textures/preview.png index af7680116..598cf053c 100644 Binary files a/indra/newview/skins/darkgred/textures/preview.png and b/indra/newview/skins/darkgred/textures/preview.png differ diff --git a/indra/newview/skins/darkgreen/colors.xml b/indra/newview/skins/darkgreen/colors.xml new file mode 100644 index 000000000..4745c72dd --- /dev/null +++ b/indra/newview/skins/darkgreen/colors.xml @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/darkgreen/textures/0098b015-3daf-4cfe-a72f-915369ea97c2.tga b/indra/newview/skins/darkgreen/textures/0098b015-3daf-4cfe-a72f-915369ea97c2.tga new file mode 100644 index 000000000..a563672f7 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/0098b015-3daf-4cfe-a72f-915369ea97c2.tga differ diff --git a/indra/newview/skins/darkgreen/textures/3c18c87e-5f50-14e2-e744-f44734aa365f.tga b/indra/newview/skins/darkgreen/textures/3c18c87e-5f50-14e2-e744-f44734aa365f.tga new file mode 100644 index 000000000..f7841968a Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/3c18c87e-5f50-14e2-e744-f44734aa365f.tga differ diff --git a/indra/newview/skins/darkgreen/textures/5748decc-f629-461c-9a36-a35a221fe21f.tga b/indra/newview/skins/darkgreen/textures/5748decc-f629-461c-9a36-a35a221fe21f.tga new file mode 100644 index 000000000..55e379309 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/5748decc-f629-461c-9a36-a35a221fe21f.tga differ diff --git a/indra/newview/skins/darkgreen/textures/7a0b1bdb-b5d9-4df5-bac2-ba230da93b5b.tga b/indra/newview/skins/darkgreen/textures/7a0b1bdb-b5d9-4df5-bac2-ba230da93b5b.tga new file mode 100644 index 000000000..dd57c8027 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/7a0b1bdb-b5d9-4df5-bac2-ba230da93b5b.tga differ diff --git a/indra/newview/skins/darkgreen/textures/7dabc040-ec13-2309-ddf7-4f161f6de2f4.tga b/indra/newview/skins/darkgreen/textures/7dabc040-ec13-2309-ddf7-4f161f6de2f4.tga new file mode 100644 index 000000000..132b192ef Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/7dabc040-ec13-2309-ddf7-4f161f6de2f4.tga differ diff --git a/indra/newview/skins/darkgreen/textures/89e9fc7c-0b16-457d-be4f-136270759c4d.tga b/indra/newview/skins/darkgreen/textures/89e9fc7c-0b16-457d-be4f-136270759c4d.tga new file mode 100644 index 000000000..6cc9ea194 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/89e9fc7c-0b16-457d-be4f-136270759c4d.tga differ diff --git a/indra/newview/skins/darkgreen/textures/9cad3e6d-2d6d-107d-f8ab-5ba272b5bfe1.tga b/indra/newview/skins/darkgreen/textures/9cad3e6d-2d6d-107d-f8ab-5ba272b5bfe1.tga new file mode 100644 index 000000000..ceaaabab8 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/9cad3e6d-2d6d-107d-f8ab-5ba272b5bfe1.tga differ diff --git a/indra/newview/skins/darkgreen/textures/active_speakers.tga b/indra/newview/skins/darkgreen/textures/active_speakers.tga new file mode 100644 index 000000000..37521d2dd Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/active_speakers.tga differ diff --git a/indra/newview/skins/darkgreen/textures/active_voice_tab.tga b/indra/newview/skins/darkgreen/textures/active_voice_tab.tga new file mode 100644 index 000000000..1a68c98e3 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/active_voice_tab.tga differ diff --git a/indra/newview/skins/darkgreen/textures/arrow_down.tga b/indra/newview/skins/darkgreen/textures/arrow_down.tga new file mode 100644 index 000000000..5b05df1c2 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/arrow_down.tga differ diff --git a/indra/newview/skins/darkgreen/textures/arrow_up.tga b/indra/newview/skins/darkgreen/textures/arrow_up.tga new file mode 100644 index 000000000..abe5c20a8 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/arrow_up.tga differ diff --git a/indra/newview/skins/darkgreen/textures/b4870163-6208-42a9-9801-93133bf9a6cd.tga b/indra/newview/skins/darkgreen/textures/b4870163-6208-42a9-9801-93133bf9a6cd.tga new file mode 100644 index 000000000..66c9dc4e0 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/b4870163-6208-42a9-9801-93133bf9a6cd.tga differ diff --git a/indra/newview/skins/darkgreen/textures/black.tga b/indra/newview/skins/darkgreen/textures/black.tga new file mode 100644 index 000000000..e368ea496 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/black.tga differ diff --git a/indra/newview/skins/darkgreen/textures/btn_chatbar.tga b/indra/newview/skins/darkgreen/textures/btn_chatbar.tga new file mode 100644 index 000000000..76008aef0 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/btn_chatbar.tga differ diff --git a/indra/newview/skins/darkgreen/textures/btn_chatbar_selected.tga b/indra/newview/skins/darkgreen/textures/btn_chatbar_selected.tga new file mode 100644 index 000000000..1698e72c2 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/btn_chatbar_selected.tga differ diff --git a/indra/newview/skins/darkgreen/textures/button_anim_pause.tga b/indra/newview/skins/darkgreen/textures/button_anim_pause.tga new file mode 100644 index 000000000..2d9f2b504 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/button_anim_pause.tga differ diff --git a/indra/newview/skins/darkgreen/textures/button_anim_pause_selected.tga b/indra/newview/skins/darkgreen/textures/button_anim_pause_selected.tga new file mode 100644 index 000000000..f75b97d6d Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/button_anim_pause_selected.tga differ diff --git a/indra/newview/skins/darkgreen/textures/button_anim_play.tga b/indra/newview/skins/darkgreen/textures/button_anim_play.tga new file mode 100644 index 000000000..37e9c7ec1 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/button_anim_play.tga differ diff --git a/indra/newview/skins/darkgreen/textures/button_anim_play_selected.tga b/indra/newview/skins/darkgreen/textures/button_anim_play_selected.tga new file mode 100644 index 000000000..21d1c6db9 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/button_anim_play_selected.tga differ diff --git a/indra/newview/skins/darkgreen/textures/button_anim_stop.tga b/indra/newview/skins/darkgreen/textures/button_anim_stop.tga new file mode 100644 index 000000000..088896955 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/button_anim_stop.tga differ diff --git a/indra/newview/skins/darkgreen/textures/button_anim_stop_selected.tga b/indra/newview/skins/darkgreen/textures/button_anim_stop_selected.tga new file mode 100644 index 000000000..46cce99d0 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/button_anim_stop_selected.tga differ diff --git a/indra/newview/skins/darkgreen/textures/button_disabled_32x128.tga b/indra/newview/skins/darkgreen/textures/button_disabled_32x128.tga new file mode 100644 index 000000000..c3f0ad776 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/button_disabled_32x128.tga differ diff --git a/indra/newview/skins/darkgreen/textures/button_enabled_32x128.tga b/indra/newview/skins/darkgreen/textures/button_enabled_32x128.tga new file mode 100644 index 000000000..acfa33e7f Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/button_enabled_32x128.tga differ diff --git a/indra/newview/skins/darkgreen/textures/button_enabled_selected_32x128.tga b/indra/newview/skins/darkgreen/textures/button_enabled_selected_32x128.tga new file mode 100644 index 000000000..3823bc194 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/button_enabled_selected_32x128.tga differ diff --git a/indra/newview/skins/darkgreen/textures/c1e21504-f136-451d-b8e9-929037812f1d.tga b/indra/newview/skins/darkgreen/textures/c1e21504-f136-451d-b8e9-929037812f1d.tga new file mode 100644 index 000000000..6430fce18 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/c1e21504-f136-451d-b8e9-929037812f1d.tga differ diff --git a/indra/newview/skins/darkgreen/textures/c63f124c-6340-4fbf-b59e-0869a44adb64.tga b/indra/newview/skins/darkgreen/textures/c63f124c-6340-4fbf-b59e-0869a44adb64.tga new file mode 100644 index 000000000..8b743416e Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/c63f124c-6340-4fbf-b59e-0869a44adb64.tga differ diff --git a/indra/newview/skins/darkgreen/textures/cam_rotate_in.tga b/indra/newview/skins/darkgreen/textures/cam_rotate_in.tga new file mode 100644 index 000000000..d08f98059 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/cam_rotate_in.tga differ diff --git a/indra/newview/skins/darkgreen/textures/cam_rotate_out.tga b/indra/newview/skins/darkgreen/textures/cam_rotate_out.tga new file mode 100644 index 000000000..f8f64f1df Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/cam_rotate_out.tga differ diff --git a/indra/newview/skins/darkgreen/textures/cam_tracking_in.tga b/indra/newview/skins/darkgreen/textures/cam_tracking_in.tga new file mode 100644 index 000000000..562c951be Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/cam_tracking_in.tga differ diff --git a/indra/newview/skins/darkgreen/textures/cam_tracking_out.tga b/indra/newview/skins/darkgreen/textures/cam_tracking_out.tga new file mode 100644 index 000000000..7835704d1 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/cam_tracking_out.tga differ diff --git a/indra/newview/skins/darkgreen/textures/cam_zoom_minus_in.tga b/indra/newview/skins/darkgreen/textures/cam_zoom_minus_in.tga new file mode 100644 index 000000000..a1da27bf8 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/cam_zoom_minus_in.tga differ diff --git a/indra/newview/skins/darkgreen/textures/cam_zoom_out.tga b/indra/newview/skins/darkgreen/textures/cam_zoom_out.tga new file mode 100644 index 000000000..2e9519d72 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/cam_zoom_out.tga differ diff --git a/indra/newview/skins/darkgreen/textures/cam_zoom_plus_in.tga b/indra/newview/skins/darkgreen/textures/cam_zoom_plus_in.tga new file mode 100644 index 000000000..c17d60792 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/cam_zoom_plus_in.tga differ diff --git a/indra/newview/skins/darkgreen/textures/ce15fd63-b0b6-463c-a37d-ea6393208b3e.tga b/indra/newview/skins/darkgreen/textures/ce15fd63-b0b6-463c-a37d-ea6393208b3e.tga new file mode 100644 index 000000000..046e69688 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/ce15fd63-b0b6-463c-a37d-ea6393208b3e.tga differ diff --git a/indra/newview/skins/darkgreen/textures/checkbox_disabled_false.tga b/indra/newview/skins/darkgreen/textures/checkbox_disabled_false.tga new file mode 100644 index 000000000..074ded732 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/checkbox_disabled_false.tga differ diff --git a/indra/newview/skins/darkgreen/textures/checkbox_disabled_true.tga b/indra/newview/skins/darkgreen/textures/checkbox_disabled_true.tga new file mode 100644 index 000000000..79d25902f Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/checkbox_disabled_true.tga differ diff --git a/indra/newview/skins/darkgreen/textures/checkbox_enabled_false.tga b/indra/newview/skins/darkgreen/textures/checkbox_enabled_false.tga new file mode 100644 index 000000000..c29ed89c6 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/checkbox_enabled_false.tga differ diff --git a/indra/newview/skins/darkgreen/textures/checkbox_enabled_true.tga b/indra/newview/skins/darkgreen/textures/checkbox_enabled_true.tga new file mode 100644 index 000000000..c8904bc60 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/checkbox_enabled_true.tga differ diff --git a/indra/newview/skins/darkgreen/textures/circle.tga b/indra/newview/skins/darkgreen/textures/circle.tga new file mode 100644 index 000000000..d7097e3a3 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/circle.tga differ diff --git a/indra/newview/skins/darkgreen/textures/close_in_blue.tga b/indra/newview/skins/darkgreen/textures/close_in_blue.tga new file mode 100644 index 000000000..a1a421e41 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/close_in_blue.tga differ diff --git a/indra/newview/skins/darkgreen/textures/close_inactive.tga b/indra/newview/skins/darkgreen/textures/close_inactive.tga new file mode 100644 index 000000000..30f6e7b5f Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/close_inactive.tga differ diff --git a/indra/newview/skins/darkgreen/textures/close_inactive_blue.tga b/indra/newview/skins/darkgreen/textures/close_inactive_blue.tga new file mode 100644 index 000000000..30f6e7b5f Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/close_inactive_blue.tga differ diff --git a/indra/newview/skins/darkgreen/textures/closebox.tga b/indra/newview/skins/darkgreen/textures/closebox.tga new file mode 100644 index 000000000..96488b4da Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/closebox.tga differ diff --git a/indra/newview/skins/darkgreen/textures/combobox_arrow.tga b/indra/newview/skins/darkgreen/textures/combobox_arrow.tga new file mode 100644 index 000000000..d769d3105 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/combobox_arrow.tga differ diff --git a/indra/newview/skins/darkgreen/textures/darkgray.tga b/indra/newview/skins/darkgreen/textures/darkgray.tga new file mode 100644 index 000000000..e69be0893 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/darkgray.tga differ diff --git a/indra/newview/skins/darkgreen/textures/eye_button_active.tga b/indra/newview/skins/darkgreen/textures/eye_button_active.tga new file mode 100644 index 000000000..cac3de533 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/eye_button_active.tga differ diff --git a/indra/newview/skins/darkgreen/textures/eye_button_inactive.tga b/indra/newview/skins/darkgreen/textures/eye_button_inactive.tga new file mode 100644 index 000000000..6ca8feec8 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/eye_button_inactive.tga differ diff --git a/indra/newview/skins/darkgreen/textures/ff9a71eb-7414-4cf8-866e-a701deb7c3cf.tga b/indra/newview/skins/darkgreen/textures/ff9a71eb-7414-4cf8-866e-a701deb7c3cf.tga new file mode 100644 index 000000000..8b9d012a9 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/ff9a71eb-7414-4cf8-866e-a701deb7c3cf.tga differ diff --git a/indra/newview/skins/darkgreen/textures/ff_edit_mine_button.tga b/indra/newview/skins/darkgreen/textures/ff_edit_mine_button.tga new file mode 100644 index 000000000..01770a3c4 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/ff_edit_mine_button.tga differ diff --git a/indra/newview/skins/darkgreen/textures/ff_edit_theirs_button.tga b/indra/newview/skins/darkgreen/textures/ff_edit_theirs_button.tga new file mode 100644 index 000000000..78a23b0b7 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/ff_edit_theirs_button.tga differ diff --git a/indra/newview/skins/darkgreen/textures/ff_online_status_button.tga b/indra/newview/skins/darkgreen/textures/ff_online_status_button.tga new file mode 100644 index 000000000..79f291829 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/ff_online_status_button.tga differ diff --git a/indra/newview/skins/darkgreen/textures/ff_visible_map_button.tga b/indra/newview/skins/darkgreen/textures/ff_visible_map_button.tga new file mode 100644 index 000000000..bce9a8c61 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/ff_visible_map_button.tga differ diff --git a/indra/newview/skins/darkgreen/textures/ff_visible_online_button.tga b/indra/newview/skins/darkgreen/textures/ff_visible_online_button.tga new file mode 100644 index 000000000..c888b08c7 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/ff_visible_online_button.tga differ diff --git a/indra/newview/skins/darkgreen/textures/flyout_btn_left.tga b/indra/newview/skins/darkgreen/textures/flyout_btn_left.tga new file mode 100644 index 000000000..3060d8016 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/flyout_btn_left.tga differ diff --git a/indra/newview/skins/darkgreen/textures/flyout_btn_left_disabled.tga b/indra/newview/skins/darkgreen/textures/flyout_btn_left_disabled.tga new file mode 100644 index 000000000..060a56bd3 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/flyout_btn_left_disabled.tga differ diff --git a/indra/newview/skins/darkgreen/textures/flyout_btn_left_selected.tga b/indra/newview/skins/darkgreen/textures/flyout_btn_left_selected.tga new file mode 100644 index 000000000..9965fb416 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/flyout_btn_left_selected.tga differ diff --git a/indra/newview/skins/darkgreen/textures/flyout_btn_right.tga b/indra/newview/skins/darkgreen/textures/flyout_btn_right.tga new file mode 100644 index 000000000..0a2354ef5 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/flyout_btn_right.tga differ diff --git a/indra/newview/skins/darkgreen/textures/flyout_btn_right_disabled.tga b/indra/newview/skins/darkgreen/textures/flyout_btn_right_disabled.tga new file mode 100644 index 000000000..9050e1252 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/flyout_btn_right_disabled.tga differ diff --git a/indra/newview/skins/darkgreen/textures/flyout_btn_right_selected.tga b/indra/newview/skins/darkgreen/textures/flyout_btn_right_selected.tga new file mode 100644 index 000000000..58594dacc Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/flyout_btn_right_selected.tga differ diff --git a/indra/newview/skins/darkgreen/textures/folder_arrow.tga b/indra/newview/skins/darkgreen/textures/folder_arrow.tga new file mode 100644 index 000000000..77d470731 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/folder_arrow.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_active-speakers-dot-lvl0.tga b/indra/newview/skins/darkgreen/textures/icn_active-speakers-dot-lvl0.tga new file mode 100644 index 000000000..35846cef3 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_active-speakers-dot-lvl0.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_active-speakers-dot-lvl1.tga b/indra/newview/skins/darkgreen/textures/icn_active-speakers-dot-lvl1.tga new file mode 100644 index 000000000..1f9f564fa Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_active-speakers-dot-lvl1.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_active-speakers-dot-lvl2.tga b/indra/newview/skins/darkgreen/textures/icn_active-speakers-dot-lvl2.tga new file mode 100644 index 000000000..b2e5609f1 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_active-speakers-dot-lvl2.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_active-speakers-typing1.tga b/indra/newview/skins/darkgreen/textures/icn_active-speakers-typing1.tga new file mode 100644 index 000000000..3706c96e0 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_active-speakers-typing1.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_active-speakers-typing2.tga b/indra/newview/skins/darkgreen/textures/icn_active-speakers-typing2.tga new file mode 100644 index 000000000..0d127f946 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_active-speakers-typing2.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_active-speakers-typing3.tga b/indra/newview/skins/darkgreen/textures/icn_active-speakers-typing3.tga new file mode 100644 index 000000000..031b3ad34 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_active-speakers-typing3.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_chatbar.tga b/indra/newview/skins/darkgreen/textures/icn_chatbar.tga new file mode 100644 index 000000000..94fd6dc89 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_chatbar.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_clear_lineeditor.tga b/indra/newview/skins/darkgreen/textures/icn_clear_lineeditor.tga new file mode 100644 index 000000000..8cd8310c6 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_clear_lineeditor.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_media-pause_active.tga b/indra/newview/skins/darkgreen/textures/icn_media-pause_active.tga new file mode 100644 index 000000000..8988829aa Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_media-pause_active.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_media-pause_disabled.tga b/indra/newview/skins/darkgreen/textures/icn_media-pause_disabled.tga new file mode 100644 index 000000000..4690f4256 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_media-pause_disabled.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_media-pause_enabled.tga b/indra/newview/skins/darkgreen/textures/icn_media-pause_enabled.tga new file mode 100644 index 000000000..c01399e27 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_media-pause_enabled.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_media-play_enabled.tga b/indra/newview/skins/darkgreen/textures/icn_media-play_enabled.tga new file mode 100644 index 000000000..accac38b0 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_media-play_enabled.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_media-stop_enabled.tga b/indra/newview/skins/darkgreen/textures/icn_media-stop_enabled.tga new file mode 100644 index 000000000..d935fa317 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_media-stop_enabled.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_media.tga b/indra/newview/skins/darkgreen/textures/icn_media.tga new file mode 100644 index 000000000..2a035ba5d Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_media.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_music.tga b/indra/newview/skins/darkgreen/textures/icn_music.tga new file mode 100644 index 000000000..81da5abcf Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_music.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_scrollbar.tga b/indra/newview/skins/darkgreen/textures/icn_scrollbar.tga new file mode 100644 index 000000000..a19a8a5d1 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_scrollbar.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_scrollbar_bg.tga b/indra/newview/skins/darkgreen/textures/icn_scrollbar_bg.tga new file mode 100644 index 000000000..cd484c61e Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_scrollbar_bg.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_scrollbar_thumb.tga b/indra/newview/skins/darkgreen/textures/icn_scrollbar_thumb.tga new file mode 100644 index 000000000..b11b1bdcd Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_scrollbar_thumb.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_slide-groove_dark.tga b/indra/newview/skins/darkgreen/textures/icn_slide-groove_dark.tga new file mode 100644 index 000000000..19361436e Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_slide-groove_dark.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_slide-highlight.tga b/indra/newview/skins/darkgreen/textures/icn_slide-highlight.tga new file mode 100644 index 000000000..0747e3ceb Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_slide-highlight.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_slide-thumb_dark.tga b/indra/newview/skins/darkgreen/textures/icn_slide-thumb_dark.tga new file mode 100644 index 000000000..7605b2c43 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_slide-thumb_dark.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_speaker-muted_dark.tga b/indra/newview/skins/darkgreen/textures/icn_speaker-muted_dark.tga new file mode 100644 index 000000000..f53e8ccf3 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_speaker-muted_dark.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_speaker_dark.tga b/indra/newview/skins/darkgreen/textures/icn_speaker_dark.tga new file mode 100644 index 000000000..6b326cf5e Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_speaker_dark.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_toolbar_build.tga b/indra/newview/skins/darkgreen/textures/icn_toolbar_build.tga new file mode 100644 index 000000000..46e84efbc Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_toolbar_build.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_toolbar_fly.tga b/indra/newview/skins/darkgreen/textures/icn_toolbar_fly.tga new file mode 100644 index 000000000..8bd422ac5 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_toolbar_fly.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_toolbar_inventory.tga b/indra/newview/skins/darkgreen/textures/icn_toolbar_inventory.tga new file mode 100644 index 000000000..b832ebce9 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_toolbar_inventory.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_toolbar_map.tga b/indra/newview/skins/darkgreen/textures/icn_toolbar_map.tga new file mode 100644 index 000000000..a100f5784 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_toolbar_map.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_toolbar_minimap.tga b/indra/newview/skins/darkgreen/textures/icn_toolbar_minimap.tga new file mode 100644 index 000000000..21149f326 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_toolbar_minimap.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_toolbar_radar.tga b/indra/newview/skins/darkgreen/textures/icn_toolbar_radar.tga new file mode 100644 index 000000000..d1a55ed74 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_toolbar_radar.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_toolbar_search.tga b/indra/newview/skins/darkgreen/textures/icn_toolbar_search.tga new file mode 100644 index 000000000..2da9704f1 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_toolbar_search.tga differ diff --git a/indra/newview/skins/darkgreen/textures/icn_toolbar_snapshot.tga b/indra/newview/skins/darkgreen/textures/icn_toolbar_snapshot.tga new file mode 100644 index 000000000..23b97c0eb Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/icn_toolbar_snapshot.tga differ diff --git a/indra/newview/skins/darkgreen/textures/lightgray.tga b/indra/newview/skins/darkgreen/textures/lightgray.tga new file mode 100644 index 000000000..e69be0893 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/lightgray.tga differ diff --git a/indra/newview/skins/darkgreen/textures/minimize.tga b/indra/newview/skins/darkgreen/textures/minimize.tga new file mode 100644 index 000000000..35d2e9ada Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/minimize.tga differ diff --git a/indra/newview/skins/darkgreen/textures/minimize_inactive.tga b/indra/newview/skins/darkgreen/textures/minimize_inactive.tga new file mode 100644 index 000000000..8f09acda9 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/minimize_inactive.tga differ diff --git a/indra/newview/skins/darkgreen/textures/minimize_pressed.tga b/indra/newview/skins/darkgreen/textures/minimize_pressed.tga new file mode 100644 index 000000000..bc03952e7 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/minimize_pressed.tga differ diff --git a/indra/newview/skins/darkgreen/textures/move_backward_in.tga b/indra/newview/skins/darkgreen/textures/move_backward_in.tga new file mode 100644 index 000000000..b64204eb2 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/move_backward_in.tga differ diff --git a/indra/newview/skins/darkgreen/textures/move_backward_out.tga b/indra/newview/skins/darkgreen/textures/move_backward_out.tga new file mode 100644 index 000000000..1acce4b7b Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/move_backward_out.tga differ diff --git a/indra/newview/skins/darkgreen/textures/move_down_in.tga b/indra/newview/skins/darkgreen/textures/move_down_in.tga new file mode 100644 index 000000000..904e9a8c8 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/move_down_in.tga differ diff --git a/indra/newview/skins/darkgreen/textures/move_down_out.tga b/indra/newview/skins/darkgreen/textures/move_down_out.tga new file mode 100644 index 000000000..39bcda4c3 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/move_down_out.tga differ diff --git a/indra/newview/skins/darkgreen/textures/move_forward_in.tga b/indra/newview/skins/darkgreen/textures/move_forward_in.tga new file mode 100644 index 000000000..d41a1e1ed Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/move_forward_in.tga differ diff --git a/indra/newview/skins/darkgreen/textures/move_forward_out.tga b/indra/newview/skins/darkgreen/textures/move_forward_out.tga new file mode 100644 index 000000000..643c26066 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/move_forward_out.tga differ diff --git a/indra/newview/skins/darkgreen/textures/move_left_in.tga b/indra/newview/skins/darkgreen/textures/move_left_in.tga new file mode 100644 index 000000000..f63ff2d4a Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/move_left_in.tga differ diff --git a/indra/newview/skins/darkgreen/textures/move_left_out.tga b/indra/newview/skins/darkgreen/textures/move_left_out.tga new file mode 100644 index 000000000..775bc151b Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/move_left_out.tga differ diff --git a/indra/newview/skins/darkgreen/textures/move_right_in.tga b/indra/newview/skins/darkgreen/textures/move_right_in.tga new file mode 100644 index 000000000..c85c4c335 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/move_right_in.tga differ diff --git a/indra/newview/skins/darkgreen/textures/move_right_out.tga b/indra/newview/skins/darkgreen/textures/move_right_out.tga new file mode 100644 index 000000000..729331d99 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/move_right_out.tga differ diff --git a/indra/newview/skins/darkgreen/textures/move_turn_left_in.tga b/indra/newview/skins/darkgreen/textures/move_turn_left_in.tga new file mode 100644 index 000000000..970b7f2ec Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/move_turn_left_in.tga differ diff --git a/indra/newview/skins/darkgreen/textures/move_turn_left_out.tga b/indra/newview/skins/darkgreen/textures/move_turn_left_out.tga new file mode 100644 index 000000000..8c1677574 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/move_turn_left_out.tga differ diff --git a/indra/newview/skins/darkgreen/textures/move_turn_right_in.tga b/indra/newview/skins/darkgreen/textures/move_turn_right_in.tga new file mode 100644 index 000000000..367deaeb9 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/move_turn_right_in.tga differ diff --git a/indra/newview/skins/darkgreen/textures/move_turn_right_out.tga b/indra/newview/skins/darkgreen/textures/move_turn_right_out.tga new file mode 100644 index 000000000..3105adb7b Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/move_turn_right_out.tga differ diff --git a/indra/newview/skins/darkgreen/textures/move_up_in.tga b/indra/newview/skins/darkgreen/textures/move_up_in.tga new file mode 100644 index 000000000..f62727d90 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/move_up_in.tga differ diff --git a/indra/newview/skins/darkgreen/textures/move_up_out.tga b/indra/newview/skins/darkgreen/textures/move_up_out.tga new file mode 100644 index 000000000..777b221f8 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/move_up_out.tga differ diff --git a/indra/newview/skins/darkgreen/textures/mute_icon.tga b/indra/newview/skins/darkgreen/textures/mute_icon.tga new file mode 100644 index 000000000..879b9e618 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/mute_icon.tga differ diff --git a/indra/newview/skins/darkgreen/textures/notify_next.png b/indra/newview/skins/darkgreen/textures/notify_next.png new file mode 100644 index 000000000..83603835d Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/notify_next.png differ diff --git a/indra/newview/skins/darkgreen/textures/preview.png b/indra/newview/skins/darkgreen/textures/preview.png new file mode 100644 index 000000000..7e17fec90 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/preview.png differ diff --git a/indra/newview/skins/darkgreen/textures/progress_fill.tga b/indra/newview/skins/darkgreen/textures/progress_fill.tga new file mode 100644 index 000000000..bbdf5dd0b Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/progress_fill.tga differ diff --git a/indra/newview/skins/darkgreen/textures/progressbar_fill.tga b/indra/newview/skins/darkgreen/textures/progressbar_fill.tga new file mode 100644 index 000000000..7070343c0 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/progressbar_fill.tga differ diff --git a/indra/newview/skins/darkgreen/textures/progressbar_track.tga b/indra/newview/skins/darkgreen/textures/progressbar_track.tga new file mode 100644 index 000000000..3434330c1 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/progressbar_track.tga differ diff --git a/indra/newview/skins/darkgreen/textures/ptt_lock_off.tga b/indra/newview/skins/darkgreen/textures/ptt_lock_off.tga new file mode 100644 index 000000000..cb6834469 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/ptt_lock_off.tga differ diff --git a/indra/newview/skins/darkgreen/textures/ptt_lock_on.tga b/indra/newview/skins/darkgreen/textures/ptt_lock_on.tga new file mode 100644 index 000000000..5a7413bde Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/ptt_lock_on.tga differ diff --git a/indra/newview/skins/darkgreen/textures/radio_active_false.tga b/indra/newview/skins/darkgreen/textures/radio_active_false.tga new file mode 100644 index 000000000..15d5e5927 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/radio_active_false.tga differ diff --git a/indra/newview/skins/darkgreen/textures/radio_active_true.tga b/indra/newview/skins/darkgreen/textures/radio_active_true.tga new file mode 100644 index 000000000..cbef88913 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/radio_active_true.tga differ diff --git a/indra/newview/skins/darkgreen/textures/radio_inactive_false.tga b/indra/newview/skins/darkgreen/textures/radio_inactive_false.tga new file mode 100644 index 000000000..48a934221 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/radio_inactive_false.tga differ diff --git a/indra/newview/skins/darkgreen/textures/radio_inactive_true.tga b/indra/newview/skins/darkgreen/textures/radio_inactive_true.tga new file mode 100644 index 000000000..785b3fa6d Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/radio_inactive_true.tga differ diff --git a/indra/newview/skins/darkgreen/textures/resize_handle_bottom_right_blue.tga b/indra/newview/skins/darkgreen/textures/resize_handle_bottom_right_blue.tga new file mode 100644 index 000000000..b40ef7305 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/resize_handle_bottom_right_blue.tga differ diff --git a/indra/newview/skins/darkgreen/textures/restore.tga b/indra/newview/skins/darkgreen/textures/restore.tga new file mode 100644 index 000000000..904797e7e Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/restore.tga differ diff --git a/indra/newview/skins/darkgreen/textures/restore_inactive.tga b/indra/newview/skins/darkgreen/textures/restore_inactive.tga new file mode 100644 index 000000000..8f09acda9 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/restore_inactive.tga differ diff --git a/indra/newview/skins/darkgreen/textures/restore_pressed.tga b/indra/newview/skins/darkgreen/textures/restore_pressed.tga new file mode 100644 index 000000000..c8ce0f9b9 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/restore_pressed.tga differ diff --git a/indra/newview/skins/darkgreen/textures/rounded_square.tga b/indra/newview/skins/darkgreen/textures/rounded_square.tga new file mode 100644 index 000000000..c8fc7b799 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/rounded_square.tga differ diff --git a/indra/newview/skins/darkgreen/textures/rounded_square_soft.tga b/indra/newview/skins/darkgreen/textures/rounded_square_soft.tga new file mode 100644 index 000000000..0e5bc79ac Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/rounded_square_soft.tga differ diff --git a/indra/newview/skins/darkgreen/textures/scrollbutton_down_in_blue.tga b/indra/newview/skins/darkgreen/textures/scrollbutton_down_in_blue.tga new file mode 100644 index 000000000..6a89d4ac7 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/scrollbutton_down_in_blue.tga differ diff --git a/indra/newview/skins/darkgreen/textures/scrollbutton_down_out_blue.tga b/indra/newview/skins/darkgreen/textures/scrollbutton_down_out_blue.tga new file mode 100644 index 000000000..04e158eba Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/scrollbutton_down_out_blue.tga differ diff --git a/indra/newview/skins/darkgreen/textures/scrollbutton_left_in_blue.tga b/indra/newview/skins/darkgreen/textures/scrollbutton_left_in_blue.tga new file mode 100644 index 000000000..4efaa9908 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/scrollbutton_left_in_blue.tga differ diff --git a/indra/newview/skins/darkgreen/textures/scrollbutton_left_out_blue.tga b/indra/newview/skins/darkgreen/textures/scrollbutton_left_out_blue.tga new file mode 100644 index 000000000..4de4ca5dc Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/scrollbutton_left_out_blue.tga differ diff --git a/indra/newview/skins/darkgreen/textures/scrollbutton_right_in_blue.tga b/indra/newview/skins/darkgreen/textures/scrollbutton_right_in_blue.tga new file mode 100644 index 000000000..484f0469b Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/scrollbutton_right_in_blue.tga differ diff --git a/indra/newview/skins/darkgreen/textures/scrollbutton_right_out_blue.tga b/indra/newview/skins/darkgreen/textures/scrollbutton_right_out_blue.tga new file mode 100644 index 000000000..fca79181b Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/scrollbutton_right_out_blue.tga differ diff --git a/indra/newview/skins/darkgreen/textures/scrollbutton_up_in_blue.tga b/indra/newview/skins/darkgreen/textures/scrollbutton_up_in_blue.tga new file mode 100644 index 000000000..d8fd0a7cc Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/scrollbutton_up_in_blue.tga differ diff --git a/indra/newview/skins/darkgreen/textures/scrollbutton_up_out_blue.tga b/indra/newview/skins/darkgreen/textures/scrollbutton_up_out_blue.tga new file mode 100644 index 000000000..9112d187e Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/scrollbutton_up_out_blue.tga differ diff --git a/indra/newview/skins/darkgreen/textures/spacer24.tga b/indra/newview/skins/darkgreen/textures/spacer24.tga new file mode 100644 index 000000000..c7cab6b38 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/spacer24.tga differ diff --git a/indra/newview/skins/darkgreen/textures/spacer35.tga b/indra/newview/skins/darkgreen/textures/spacer35.tga new file mode 100644 index 000000000..b88bc6680 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/spacer35.tga differ diff --git a/indra/newview/skins/darkgreen/textures/spin_down_in_blue.tga b/indra/newview/skins/darkgreen/textures/spin_down_in_blue.tga new file mode 100644 index 000000000..1f3dbfc3d Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/spin_down_in_blue.tga differ diff --git a/indra/newview/skins/darkgreen/textures/spin_down_out_blue.tga b/indra/newview/skins/darkgreen/textures/spin_down_out_blue.tga new file mode 100644 index 000000000..6728a6d9f Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/spin_down_out_blue.tga differ diff --git a/indra/newview/skins/darkgreen/textures/spin_up_in_blue.tga b/indra/newview/skins/darkgreen/textures/spin_up_in_blue.tga new file mode 100644 index 000000000..4bb545e0c Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/spin_up_in_blue.tga differ diff --git a/indra/newview/skins/darkgreen/textures/spin_up_out_blue.tga b/indra/newview/skins/darkgreen/textures/spin_up_out_blue.tga new file mode 100644 index 000000000..4a5cbcb94 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/spin_up_out_blue.tga differ diff --git a/indra/newview/skins/darkgreen/textures/square_btn_32x128.tga b/indra/newview/skins/darkgreen/textures/square_btn_32x128.tga new file mode 100644 index 000000000..495b05656 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/square_btn_32x128.tga differ diff --git a/indra/newview/skins/darkgreen/textures/square_btn_selected_32x128.tga b/indra/newview/skins/darkgreen/textures/square_btn_selected_32x128.tga new file mode 100644 index 000000000..0abbf56ce Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/square_btn_selected_32x128.tga differ diff --git a/indra/newview/skins/darkgreen/textures/status_buy_currency.tga b/indra/newview/skins/darkgreen/textures/status_buy_currency.tga new file mode 100644 index 000000000..206550cbb Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/status_buy_currency.tga differ diff --git a/indra/newview/skins/darkgreen/textures/status_buy_currency_pressed.tga b/indra/newview/skins/darkgreen/textures/status_buy_currency_pressed.tga new file mode 100644 index 000000000..2b82aef0f Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/status_buy_currency_pressed.tga differ diff --git a/indra/newview/skins/darkgreen/textures/status_buy_land.tga b/indra/newview/skins/darkgreen/textures/status_buy_land.tga new file mode 100644 index 000000000..4c4e977a8 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/status_buy_land.tga differ diff --git a/indra/newview/skins/darkgreen/textures/tab_bottom_blue.tga b/indra/newview/skins/darkgreen/textures/tab_bottom_blue.tga new file mode 100644 index 000000000..65c9228db Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/tab_bottom_blue.tga differ diff --git a/indra/newview/skins/darkgreen/textures/tab_bottom_selected_blue.tga b/indra/newview/skins/darkgreen/textures/tab_bottom_selected_blue.tga new file mode 100644 index 000000000..7507edabb Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/tab_bottom_selected_blue.tga differ diff --git a/indra/newview/skins/darkgreen/textures/tab_left.tga b/indra/newview/skins/darkgreen/textures/tab_left.tga new file mode 100644 index 000000000..36a48bfd2 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/tab_left.tga differ diff --git a/indra/newview/skins/darkgreen/textures/tab_left_selected.tga b/indra/newview/skins/darkgreen/textures/tab_left_selected.tga new file mode 100644 index 000000000..2ed53bc03 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/tab_left_selected.tga differ diff --git a/indra/newview/skins/darkgreen/textures/tab_top_blue.tga b/indra/newview/skins/darkgreen/textures/tab_top_blue.tga new file mode 100644 index 000000000..8f2625e72 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/tab_top_blue.tga differ diff --git a/indra/newview/skins/darkgreen/textures/tab_top_selected_blue.tga b/indra/newview/skins/darkgreen/textures/tab_top_selected_blue.tga new file mode 100644 index 000000000..bab178a71 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/tab_top_selected_blue.tga differ diff --git a/indra/newview/skins/darkgreen/textures/tabarea.tga b/indra/newview/skins/darkgreen/textures/tabarea.tga new file mode 100644 index 000000000..5517aebfc Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/tabarea.tga differ diff --git a/indra/newview/skins/darkgreen/textures/textures.xml b/indra/newview/skins/darkgreen/textures/textures.xml new file mode 100644 index 000000000..451b70062 --- /dev/null +++ b/indra/newview/skins/darkgreen/textures/textures.xml @@ -0,0 +1,389 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/darkgreen/textures/tool_dozer.tga b/indra/newview/skins/darkgreen/textures/tool_dozer.tga new file mode 100644 index 000000000..bc1cc7ade Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/tool_dozer.tga differ diff --git a/indra/newview/skins/darkgreen/textures/tool_dozer_active.tga b/indra/newview/skins/darkgreen/textures/tool_dozer_active.tga new file mode 100644 index 000000000..6099823a8 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/tool_dozer_active.tga differ diff --git a/indra/newview/skins/darkgreen/textures/tool_zoom.tga b/indra/newview/skins/darkgreen/textures/tool_zoom.tga new file mode 100644 index 000000000..2f6a75e4b Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/tool_zoom.tga differ diff --git a/indra/newview/skins/darkgreen/textures/tool_zoom_active.tga b/indra/newview/skins/darkgreen/textures/tool_zoom_active.tga new file mode 100644 index 000000000..e83ca1a4b Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/tool_zoom_active.tga differ diff --git a/indra/newview/skins/darkgreen/textures/toolbar_btn_disabled.tga b/indra/newview/skins/darkgreen/textures/toolbar_btn_disabled.tga new file mode 100644 index 000000000..59c57fc7c Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/toolbar_btn_disabled.tga differ diff --git a/indra/newview/skins/darkgreen/textures/toolbar_btn_enabled.tga b/indra/newview/skins/darkgreen/textures/toolbar_btn_enabled.tga new file mode 100644 index 000000000..f005949b0 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/toolbar_btn_enabled.tga differ diff --git a/indra/newview/skins/darkgreen/textures/toolbar_btn_selected.tga b/indra/newview/skins/darkgreen/textures/toolbar_btn_selected.tga new file mode 100644 index 000000000..cfd577b55 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/toolbar_btn_selected.tga differ diff --git a/indra/newview/skins/darkgreen/textures/toolbar_tab.tga b/indra/newview/skins/darkgreen/textures/toolbar_tab.tga new file mode 100644 index 000000000..eda95f6e2 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/toolbar_tab.tga differ diff --git a/indra/newview/skins/darkgreen/textures/white.tga b/indra/newview/skins/darkgreen/textures/white.tga new file mode 100644 index 000000000..55e379309 Binary files /dev/null and b/indra/newview/skins/darkgreen/textures/white.tga differ diff --git a/indra/newview/skins/darkorange/colors.xml b/indra/newview/skins/darkorange/colors.xml index f3ff107f0..07c97ce6e 100644 --- a/indra/newview/skins/darkorange/colors.xml +++ b/indra/newview/skins/darkorange/colors.xml @@ -186,12 +186,6 @@ - - - - - - diff --git a/indra/newview/skins/darkorange/textures/checkerboard_transparency_bg.png b/indra/newview/skins/darkorange/textures/checkerboard_transparency_bg.png index 9a1693520..fe06d38ef 100644 Binary files a/indra/newview/skins/darkorange/textures/checkerboard_transparency_bg.png and b/indra/newview/skins/darkorange/textures/checkerboard_transparency_bg.png differ diff --git a/indra/newview/skins/darkorange/textures/down_arrow.png b/indra/newview/skins/darkorange/textures/down_arrow.png index 155f80c97..d376d980d 100644 Binary files a/indra/newview/skins/darkorange/textures/down_arrow.png and b/indra/newview/skins/darkorange/textures/down_arrow.png differ diff --git a/indra/newview/skins/darkorange/textures/icon_avatar_expand.png b/indra/newview/skins/darkorange/textures/icon_avatar_expand.png index 4b7862c26..0572551de 100644 Binary files a/indra/newview/skins/darkorange/textures/icon_avatar_expand.png and b/indra/newview/skins/darkorange/textures/icon_avatar_expand.png differ diff --git a/indra/newview/skins/darkorange/textures/notify_next.png b/indra/newview/skins/darkorange/textures/notify_next.png index 2235d25ff..7b4aba9d3 100644 Binary files a/indra/newview/skins/darkorange/textures/notify_next.png and b/indra/newview/skins/darkorange/textures/notify_next.png differ diff --git a/indra/newview/skins/darkorange/textures/preview.png b/indra/newview/skins/darkorange/textures/preview.png index 05bfbeb3d..19c48b34f 100644 Binary files a/indra/newview/skins/darkorange/textures/preview.png and b/indra/newview/skins/darkorange/textures/preview.png differ diff --git a/indra/newview/skins/darkorange/textures/skin_thumbnail_dark.png b/indra/newview/skins/darkorange/textures/skin_thumbnail_dark.png index 2cac82923..fc102a014 100644 Binary files a/indra/newview/skins/darkorange/textures/skin_thumbnail_dark.png and b/indra/newview/skins/darkorange/textures/skin_thumbnail_dark.png differ diff --git a/indra/newview/skins/darkorange/textures/skin_thumbnail_default.png b/indra/newview/skins/darkorange/textures/skin_thumbnail_default.png index 40fe64bb4..e22b1c164 100644 Binary files a/indra/newview/skins/darkorange/textures/skin_thumbnail_default.png and b/indra/newview/skins/darkorange/textures/skin_thumbnail_default.png differ diff --git a/indra/newview/skins/darkorange/textures/skin_thumbnail_emerald.png b/indra/newview/skins/darkorange/textures/skin_thumbnail_emerald.png index ab35bc0ab..f2ab49e6d 100644 Binary files a/indra/newview/skins/darkorange/textures/skin_thumbnail_emerald.png and b/indra/newview/skins/darkorange/textures/skin_thumbnail_emerald.png differ diff --git a/indra/newview/skins/darkorange/textures/skin_thumbnail_gred.png b/indra/newview/skins/darkorange/textures/skin_thumbnail_gred.png index 827135499..d60584743 100644 Binary files a/indra/newview/skins/darkorange/textures/skin_thumbnail_gred.png and b/indra/newview/skins/darkorange/textures/skin_thumbnail_gred.png differ diff --git a/indra/newview/skins/darkorange/textures/skin_thumbnail_pslgreen.png b/indra/newview/skins/darkorange/textures/skin_thumbnail_pslgreen.png index 73e117e9f..3eb7263d6 100644 Binary files a/indra/newview/skins/darkorange/textures/skin_thumbnail_pslgreen.png and b/indra/newview/skins/darkorange/textures/skin_thumbnail_pslgreen.png differ diff --git a/indra/newview/skins/darkorange/textures/skin_thumbnail_pslpurple.png b/indra/newview/skins/darkorange/textures/skin_thumbnail_pslpurple.png index 902ad82b1..877514d8c 100644 Binary files a/indra/newview/skins/darkorange/textures/skin_thumbnail_pslpurple.png and b/indra/newview/skins/darkorange/textures/skin_thumbnail_pslpurple.png differ diff --git a/indra/newview/skins/darkorange/textures/skin_thumbnail_ruby.png b/indra/newview/skins/darkorange/textures/skin_thumbnail_ruby.png index d45e75ad0..944b51985 100644 Binary files a/indra/newview/skins/darkorange/textures/skin_thumbnail_ruby.png and b/indra/newview/skins/darkorange/textures/skin_thumbnail_ruby.png differ diff --git a/indra/newview/skins/darkorange/textures/skin_thumbnail_saphire.png b/indra/newview/skins/darkorange/textures/skin_thumbnail_saphire.png index 7ec8e1991..2ee896780 100644 Binary files a/indra/newview/skins/darkorange/textures/skin_thumbnail_saphire.png and b/indra/newview/skins/darkorange/textures/skin_thumbnail_saphire.png differ diff --git a/indra/newview/skins/darkorange/textures/skin_thumbnail_silver.png b/indra/newview/skins/darkorange/textures/skin_thumbnail_silver.png index 51707bb9d..51f4cceb0 100644 Binary files a/indra/newview/skins/darkorange/textures/skin_thumbnail_silver.png and b/indra/newview/skins/darkorange/textures/skin_thumbnail_silver.png differ diff --git a/indra/newview/skins/darkorange/textures/status_search_btn.png b/indra/newview/skins/darkorange/textures/status_search_btn.png index 67f61332b..e648ba849 100644 Binary files a/indra/newview/skins/darkorange/textures/status_search_btn.png and b/indra/newview/skins/darkorange/textures/status_search_btn.png differ diff --git a/indra/newview/skins/darkorange/textures/status_search_btn_pressed.png b/indra/newview/skins/darkorange/textures/status_search_btn_pressed.png index 1437273d3..ec4254f4d 100644 Binary files a/indra/newview/skins/darkorange/textures/status_search_btn_pressed.png and b/indra/newview/skins/darkorange/textures/status_search_btn_pressed.png differ diff --git a/indra/newview/skins/darkorange/textures/up_arrow.png b/indra/newview/skins/darkorange/textures/up_arrow.png index a3b666741..42de741a8 100644 Binary files a/indra/newview/skins/darkorange/textures/up_arrow.png and b/indra/newview/skins/darkorange/textures/up_arrow.png differ diff --git a/indra/newview/skins/default/html/btn_purplepill_bg.png b/indra/newview/skins/default/html/btn_purplepill_bg.png index b78127ae3..d8debe7b6 100644 Binary files a/indra/newview/skins/default/html/btn_purplepill_bg.png and b/indra/newview/skins/default/html/btn_purplepill_bg.png differ diff --git a/indra/newview/skins/default/html/unabletoconnect.png b/indra/newview/skins/default/html/unabletoconnect.png index 138351650..71cc8334a 100644 Binary files a/indra/newview/skins/default/html/unabletoconnect.png and b/indra/newview/skins/default/html/unabletoconnect.png differ diff --git a/indra/newview/skins/default/textures/Cam_Preset_Back_Off.png b/indra/newview/skins/default/textures/Cam_Preset_Back_Off.png index 00158a7bc..1ace20d14 100644 Binary files a/indra/newview/skins/default/textures/Cam_Preset_Back_Off.png and b/indra/newview/skins/default/textures/Cam_Preset_Back_Off.png differ diff --git a/indra/newview/skins/default/textures/Cam_Preset_Back_On.png b/indra/newview/skins/default/textures/Cam_Preset_Back_On.png index 3748f5e19..fc7413de3 100644 Binary files a/indra/newview/skins/default/textures/Cam_Preset_Back_On.png and b/indra/newview/skins/default/textures/Cam_Preset_Back_On.png differ diff --git a/indra/newview/skins/default/textures/Cam_Preset_Front_Off.png b/indra/newview/skins/default/textures/Cam_Preset_Front_Off.png index c49b8f9a2..19fcbb5c1 100644 Binary files a/indra/newview/skins/default/textures/Cam_Preset_Front_Off.png and b/indra/newview/skins/default/textures/Cam_Preset_Front_Off.png differ diff --git a/indra/newview/skins/default/textures/Cam_Preset_Front_On.png b/indra/newview/skins/default/textures/Cam_Preset_Front_On.png index bc8c4db04..d40d8a1ca 100644 Binary files a/indra/newview/skins/default/textures/Cam_Preset_Front_On.png and b/indra/newview/skins/default/textures/Cam_Preset_Front_On.png differ diff --git a/indra/newview/skins/default/textures/Cam_Preset_Side_Off.png b/indra/newview/skins/default/textures/Cam_Preset_Side_Off.png index b919a0a15..08366b918 100644 Binary files a/indra/newview/skins/default/textures/Cam_Preset_Side_Off.png and b/indra/newview/skins/default/textures/Cam_Preset_Side_Off.png differ diff --git a/indra/newview/skins/default/textures/Cam_Preset_Side_On.png b/indra/newview/skins/default/textures/Cam_Preset_Side_On.png index de9da359a..9635186f0 100644 Binary files a/indra/newview/skins/default/textures/Cam_Preset_Side_On.png and b/indra/newview/skins/default/textures/Cam_Preset_Side_On.png differ diff --git a/indra/newview/skins/default/textures/Edit_Flip_X.png b/indra/newview/skins/default/textures/Edit_Flip_X.png index 5106b4359..e19224d5e 100644 Binary files a/indra/newview/skins/default/textures/Edit_Flip_X.png and b/indra/newview/skins/default/textures/Edit_Flip_X.png differ diff --git a/indra/newview/skins/default/textures/Flag.png b/indra/newview/skins/default/textures/Flag.png index 66739e9bf..cf6804685 100644 Binary files a/indra/newview/skins/default/textures/Flag.png and b/indra/newview/skins/default/textures/Flag.png differ diff --git a/indra/newview/skins/default/textures/Inv_WaterLight.png b/indra/newview/skins/default/textures/Inv_WaterLight.png index a5bc5f549..6ba9a1786 100644 Binary files a/indra/newview/skins/default/textures/Inv_WaterLight.png and b/indra/newview/skins/default/textures/Inv_WaterLight.png differ diff --git a/indra/newview/skins/default/textures/Inv_WindLight.png b/indra/newview/skins/default/textures/Inv_WindLight.png index 0e633a38f..39cc20ac2 100644 Binary files a/indra/newview/skins/default/textures/Inv_WindLight.png and b/indra/newview/skins/default/textures/Inv_WindLight.png differ diff --git a/indra/newview/skins/default/textures/Parcel_Exp_Color.png b/indra/newview/skins/default/textures/Parcel_Exp_Color.png index 4813d3719..fd5c13e73 100644 Binary files a/indra/newview/skins/default/textures/Parcel_Exp_Color.png and b/indra/newview/skins/default/textures/Parcel_Exp_Color.png differ diff --git a/indra/newview/skins/default/textures/Pathfinding_Dirty.png b/indra/newview/skins/default/textures/Pathfinding_Dirty.png index 4ed8c1442..c2a4aa4d5 100644 Binary files a/indra/newview/skins/default/textures/Pathfinding_Dirty.png and b/indra/newview/skins/default/textures/Pathfinding_Dirty.png differ diff --git a/indra/newview/skins/default/textures/Pathfinding_Disabled.png b/indra/newview/skins/default/textures/Pathfinding_Disabled.png index 09cb47edd..4680a38f3 100644 Binary files a/indra/newview/skins/default/textures/Pathfinding_Disabled.png and b/indra/newview/skins/default/textures/Pathfinding_Disabled.png differ diff --git a/indra/newview/skins/default/textures/Refresh_Off.png b/indra/newview/skins/default/textures/Refresh_Off.png index a8acfda74..1171ee315 100644 Binary files a/indra/newview/skins/default/textures/Refresh_Off.png and b/indra/newview/skins/default/textures/Refresh_Off.png differ diff --git a/indra/newview/skins/default/textures/Rounded_Rect.png b/indra/newview/skins/default/textures/Rounded_Rect.png index c270c2803..4da0c234e 100644 Binary files a/indra/newview/skins/default/textures/Rounded_Rect.png and b/indra/newview/skins/default/textures/Rounded_Rect.png differ diff --git a/indra/newview/skins/default/textures/checkerboard_transparency_bg.png b/indra/newview/skins/default/textures/checkerboard_transparency_bg.png index 9a1693520..fe06d38ef 100644 Binary files a/indra/newview/skins/default/textures/checkerboard_transparency_bg.png and b/indra/newview/skins/default/textures/checkerboard_transparency_bg.png differ diff --git a/indra/newview/skins/default/textures/down_arrow.png b/indra/newview/skins/default/textures/down_arrow.png index 155f80c97..d376d980d 100644 Binary files a/indra/newview/skins/default/textures/down_arrow.png and b/indra/newview/skins/default/textures/down_arrow.png differ diff --git a/indra/newview/skins/default/textures/go-home.png b/indra/newview/skins/default/textures/go-home.png index 058c00af4..fc4a76c1c 100644 Binary files a/indra/newview/skins/default/textures/go-home.png and b/indra/newview/skins/default/textures/go-home.png differ diff --git a/indra/newview/skins/default/textures/go-media-pause.png b/indra/newview/skins/default/textures/go-media-pause.png index 8aea17088..f8ffc44a3 100644 Binary files a/indra/newview/skins/default/textures/go-media-pause.png and b/indra/newview/skins/default/textures/go-media-pause.png differ diff --git a/indra/newview/skins/default/textures/go-media-play.png b/indra/newview/skins/default/textures/go-media-play.png index daa40e3c3..b8bce12e6 100644 Binary files a/indra/newview/skins/default/textures/go-media-play.png and b/indra/newview/skins/default/textures/go-media-play.png differ diff --git a/indra/newview/skins/default/textures/go-media-skip-backwards.png b/indra/newview/skins/default/textures/go-media-skip-backwards.png index 02497b165..16b042f36 100644 Binary files a/indra/newview/skins/default/textures/go-media-skip-backwards.png and b/indra/newview/skins/default/textures/go-media-skip-backwards.png differ diff --git a/indra/newview/skins/default/textures/go-media-skip-forward.png b/indra/newview/skins/default/textures/go-media-skip-forward.png index 97090e1f1..27ae7c751 100644 Binary files a/indra/newview/skins/default/textures/go-media-skip-forward.png and b/indra/newview/skins/default/textures/go-media-skip-forward.png differ diff --git a/indra/newview/skins/default/textures/go-media-stop.png b/indra/newview/skins/default/textures/go-media-stop.png index 80a54d1b2..c951ac535 100644 Binary files a/indra/newview/skins/default/textures/go-media-stop.png and b/indra/newview/skins/default/textures/go-media-stop.png differ diff --git a/indra/newview/skins/default/textures/go-media-unzoom.png b/indra/newview/skins/default/textures/go-media-unzoom.png index 0f45c2c9c..42d7e6981 100644 Binary files a/indra/newview/skins/default/textures/go-media-unzoom.png and b/indra/newview/skins/default/textures/go-media-unzoom.png differ diff --git a/indra/newview/skins/default/textures/go-media-zoom.png b/indra/newview/skins/default/textures/go-media-zoom.png index b06c0fd52..b214a88c2 100644 Binary files a/indra/newview/skins/default/textures/go-media-zoom.png and b/indra/newview/skins/default/textures/go-media-zoom.png differ diff --git a/indra/newview/skins/default/textures/go-next.png b/indra/newview/skins/default/textures/go-next.png index b4362c1ed..9f767fdd1 100644 Binary files a/indra/newview/skins/default/textures/go-next.png and b/indra/newview/skins/default/textures/go-next.png differ diff --git a/indra/newview/skins/default/textures/go-previous.png b/indra/newview/skins/default/textures/go-previous.png index d5a677ecd..8cebd0eac 100644 Binary files a/indra/newview/skins/default/textures/go-previous.png and b/indra/newview/skins/default/textures/go-previous.png differ diff --git a/indra/newview/skins/default/textures/go-reload.png b/indra/newview/skins/default/textures/go-reload.png index cb5d1b97c..8b254921e 100644 Binary files a/indra/newview/skins/default/textures/go-reload.png and b/indra/newview/skins/default/textures/go-reload.png differ diff --git a/indra/newview/skins/default/textures/go-stop.png b/indra/newview/skins/default/textures/go-stop.png index 08dab9a32..0e91628f6 100644 Binary files a/indra/newview/skins/default/textures/go-stop.png and b/indra/newview/skins/default/textures/go-stop.png differ diff --git a/indra/newview/skins/default/textures/green_checkmark.png b/indra/newview/skins/default/textures/green_checkmark.png index d2a5b348d..eb0ba930c 100644 Binary files a/indra/newview/skins/default/textures/green_checkmark.png and b/indra/newview/skins/default/textures/green_checkmark.png differ diff --git a/indra/newview/skins/default/textures/icn_toolbar_quit.tga b/indra/newview/skins/default/textures/icn_toolbar_quit.tga new file mode 100644 index 000000000..0a1a235f3 Binary files /dev/null and b/indra/newview/skins/default/textures/icn_toolbar_quit.tga differ diff --git a/indra/newview/skins/default/textures/inv_invalid.png b/indra/newview/skins/default/textures/inv_invalid.png index 5d070e467..acefab8c4 100644 Binary files a/indra/newview/skins/default/textures/inv_invalid.png and b/indra/newview/skins/default/textures/inv_invalid.png differ diff --git a/indra/newview/skins/default/textures/inv_item_physics.png b/indra/newview/skins/default/textures/inv_item_physics.png index 360baec46..f41162240 100644 Binary files a/indra/newview/skins/default/textures/inv_item_physics.png and b/indra/newview/skins/default/textures/inv_item_physics.png differ diff --git a/indra/newview/skins/default/textures/lock.png b/indra/newview/skins/default/textures/lock.png index d23cb4d29..0f0770908 100644 Binary files a/indra/newview/skins/default/textures/lock.png and b/indra/newview/skins/default/textures/lock.png differ diff --git a/indra/newview/skins/default/textures/materials_ui_x_24.png b/indra/newview/skins/default/textures/materials_ui_x_24.png index 6d8855491..43a72ef04 100644 Binary files a/indra/newview/skins/default/textures/materials_ui_x_24.png and b/indra/newview/skins/default/textures/materials_ui_x_24.png differ diff --git a/indra/newview/skins/default/textures/media_btn_back.png b/indra/newview/skins/default/textures/media_btn_back.png index 9783a0374..a93b74bc7 100644 Binary files a/indra/newview/skins/default/textures/media_btn_back.png and b/indra/newview/skins/default/textures/media_btn_back.png differ diff --git a/indra/newview/skins/default/textures/media_btn_done.png b/indra/newview/skins/default/textures/media_btn_done.png index f407aa358..2638d02df 100644 Binary files a/indra/newview/skins/default/textures/media_btn_done.png and b/indra/newview/skins/default/textures/media_btn_done.png differ diff --git a/indra/newview/skins/default/textures/media_btn_forward.png b/indra/newview/skins/default/textures/media_btn_forward.png index 4e7e60980..d8f2d5c60 100644 Binary files a/indra/newview/skins/default/textures/media_btn_forward.png and b/indra/newview/skins/default/textures/media_btn_forward.png differ diff --git a/indra/newview/skins/default/textures/media_btn_home.png b/indra/newview/skins/default/textures/media_btn_home.png index cc59ddf21..6fd5e20ba 100644 Binary files a/indra/newview/skins/default/textures/media_btn_home.png and b/indra/newview/skins/default/textures/media_btn_home.png differ diff --git a/indra/newview/skins/default/textures/media_btn_newwindow.png b/indra/newview/skins/default/textures/media_btn_newwindow.png index c5f9c972c..ced106d5f 100644 Binary files a/indra/newview/skins/default/textures/media_btn_newwindow.png and b/indra/newview/skins/default/textures/media_btn_newwindow.png differ diff --git a/indra/newview/skins/default/textures/media_btn_optimalzoom.png b/indra/newview/skins/default/textures/media_btn_optimalzoom.png index dd68edc66..19e692f3c 100644 Binary files a/indra/newview/skins/default/textures/media_btn_optimalzoom.png and b/indra/newview/skins/default/textures/media_btn_optimalzoom.png differ diff --git a/indra/newview/skins/default/textures/media_btn_reload.png b/indra/newview/skins/default/textures/media_btn_reload.png index afbfe8f8a..72cc54b60 100644 Binary files a/indra/newview/skins/default/textures/media_btn_reload.png and b/indra/newview/skins/default/textures/media_btn_reload.png differ diff --git a/indra/newview/skins/default/textures/media_btn_scrolldown.png b/indra/newview/skins/default/textures/media_btn_scrolldown.png index ad921d511..149c6ba5b 100644 Binary files a/indra/newview/skins/default/textures/media_btn_scrolldown.png and b/indra/newview/skins/default/textures/media_btn_scrolldown.png differ diff --git a/indra/newview/skins/default/textures/media_btn_scrollleft.png b/indra/newview/skins/default/textures/media_btn_scrollleft.png index a69c7e7bd..8f07aadf4 100644 Binary files a/indra/newview/skins/default/textures/media_btn_scrollleft.png and b/indra/newview/skins/default/textures/media_btn_scrollleft.png differ diff --git a/indra/newview/skins/default/textures/media_btn_scrollright.png b/indra/newview/skins/default/textures/media_btn_scrollright.png index c553449d1..d6d58048a 100644 Binary files a/indra/newview/skins/default/textures/media_btn_scrollright.png and b/indra/newview/skins/default/textures/media_btn_scrollright.png differ diff --git a/indra/newview/skins/default/textures/media_btn_scrollup.png b/indra/newview/skins/default/textures/media_btn_scrollup.png index ef3752927..cf87cf8fa 100644 Binary files a/indra/newview/skins/default/textures/media_btn_scrollup.png and b/indra/newview/skins/default/textures/media_btn_scrollup.png differ diff --git a/indra/newview/skins/default/textures/media_btn_stoploading.png b/indra/newview/skins/default/textures/media_btn_stoploading.png index 8578d7547..dddf51abc 100644 Binary files a/indra/newview/skins/default/textures/media_btn_stoploading.png and b/indra/newview/skins/default/textures/media_btn_stoploading.png differ diff --git a/indra/newview/skins/default/textures/media_panel_bg.png b/indra/newview/skins/default/textures/media_panel_bg.png index 975dc3e43..6e8556988 100644 Binary files a/indra/newview/skins/default/textures/media_panel_bg.png and b/indra/newview/skins/default/textures/media_panel_bg.png differ diff --git a/indra/newview/skins/default/textures/media_panel_divider.png b/indra/newview/skins/default/textures/media_panel_divider.png index 5f947e88a..510151aba 100644 Binary files a/indra/newview/skins/default/textures/media_panel_divider.png and b/indra/newview/skins/default/textures/media_panel_divider.png differ diff --git a/indra/newview/skins/default/textures/media_panel_hoverrectangle.png b/indra/newview/skins/default/textures/media_panel_hoverrectangle.png index 1cdeabf58..1fc0ebf88 100644 Binary files a/indra/newview/skins/default/textures/media_panel_hoverrectangle.png and b/indra/newview/skins/default/textures/media_panel_hoverrectangle.png differ diff --git a/indra/newview/skins/default/textures/media_panel_scrollbg.png b/indra/newview/skins/default/textures/media_panel_scrollbg.png index 2b63c9f5d..3545b7033 100644 Binary files a/indra/newview/skins/default/textures/media_panel_scrollbg.png and b/indra/newview/skins/default/textures/media_panel_scrollbg.png differ diff --git a/indra/newview/skins/default/textures/menu_separator.png b/indra/newview/skins/default/textures/menu_separator.png index 89dcdcdff..0b1cd3c65 100644 Binary files a/indra/newview/skins/default/textures/menu_separator.png and b/indra/newview/skins/default/textures/menu_separator.png differ diff --git a/indra/newview/skins/default/textures/notify_next.png b/indra/newview/skins/default/textures/notify_next.png index 2235d25ff..7b4aba9d3 100644 Binary files a/indra/newview/skins/default/textures/notify_next.png and b/indra/newview/skins/default/textures/notify_next.png differ diff --git a/indra/newview/skins/default/textures/preview.png b/indra/newview/skins/default/textures/preview.png index 40fe64bb4..e22b1c164 100644 Binary files a/indra/newview/skins/default/textures/preview.png and b/indra/newview/skins/default/textures/preview.png differ diff --git a/indra/newview/skins/default/textures/red_x.png b/indra/newview/skins/default/textures/red_x.png index a61202f09..1ea8e42cb 100644 Binary files a/indra/newview/skins/default/textures/red_x.png and b/indra/newview/skins/default/textures/red_x.png differ diff --git a/indra/newview/skins/default/textures/skin_thumbnail_default.png b/indra/newview/skins/default/textures/skin_thumbnail_default.png index 40fe64bb4..e22b1c164 100644 Binary files a/indra/newview/skins/default/textures/skin_thumbnail_default.png and b/indra/newview/skins/default/textures/skin_thumbnail_default.png differ diff --git a/indra/newview/skins/default/textures/skin_thumbnail_silver.png b/indra/newview/skins/default/textures/skin_thumbnail_silver.png index 51707bb9d..51f4cceb0 100644 Binary files a/indra/newview/skins/default/textures/skin_thumbnail_silver.png and b/indra/newview/skins/default/textures/skin_thumbnail_silver.png differ diff --git a/indra/newview/skins/default/textures/status_search_btn.png b/indra/newview/skins/default/textures/status_search_btn.png index 67f61332b..e648ba849 100644 Binary files a/indra/newview/skins/default/textures/status_search_btn.png and b/indra/newview/skins/default/textures/status_search_btn.png differ diff --git a/indra/newview/skins/default/textures/status_search_btn_pressed.png b/indra/newview/skins/default/textures/status_search_btn_pressed.png index 1437273d3..ec4254f4d 100644 Binary files a/indra/newview/skins/default/textures/status_search_btn_pressed.png and b/indra/newview/skins/default/textures/status_search_btn_pressed.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index fb9c6c1e3..574f2b3a7 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -122,7 +122,7 @@ - + diff --git a/indra/newview/skins/default/textures/up_arrow.png b/indra/newview/skins/default/textures/up_arrow.png index fe68ad49d..a1a5d3823 100644 Binary files a/indra/newview/skins/default/textures/up_arrow.png and b/indra/newview/skins/default/textures/up_arrow.png differ diff --git a/indra/newview/skins/default/xui/de/panel_friends.xml b/indra/newview/skins/default/xui/de/panel_friends.xml index 8e4718cfa..a9660404d 100644 --- a/indra/newview/skins/default/xui/de/panel_friends.xml +++ b/indra/newview/skins/default/xui/de/panel_friends.xml @@ -18,7 +18,7 @@ - + + +