diff options
73 files changed, 1154 insertions, 660 deletions
diff --git a/autobuild.xml b/autobuild.xml index d381035248..c6e1a425d5 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -138,9 +138,9 @@ <key>archive</key> <map> <key>hash</key> - <string>e6caaeea16131e1f2343ecd7765e3147</string> + <string>6299f1fd01147820e05195b84a3fe1d7</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/ares-1.7.1-darwin-20110217.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ares/rev/233053/arch/Darwin/installer/ares-1.7.4-darwin-20110616.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -150,9 +150,9 @@ <key>archive</key> <map> <key>hash</key> - <string>0745872db83d45f4ab3bdc697d98e264</string> + <string>b62efd5a68e5dd38314f60a20e651d43</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ares/rev/223275/arch/Linux/installer/ares-1.7.1-linux-20110310.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ares/rev/233053/arch/Linux/installer/ares-1.7.4-linux-20110616.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -162,9 +162,9 @@ <key>archive</key> <map> <key>hash</key> - <string>1dcec6babd249a2597114d4ac226c461</string> + <string>c2f4ea23619f3d453e799d6e89ff6930</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ares/rev/220963/arch/CYGWIN/installer/ares-1.7.1-windows-20110211.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ares/rev/233053/arch/CYGWIN/installer/ares-1.7.4-windows-20110616.tar.bz2</string> </map> <key>name</key> <string>windows</string> @@ -282,9 +282,9 @@ <key>archive</key> <map> <key>hash</key> - <string>aaea644191807f51051cefa2fac11069</string> + <string>463e4cc99ec8659eeee518beb41f31b6</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/curl-7.21.1-darwin-20110316.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-curl/rev/236200/arch/Darwin/installer/curl-7.21.1-darwin-20110719.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -306,9 +306,9 @@ <key>archive</key> <map> <key>hash</key> - <string>fea96aa2a7d513397317194f3d6c979b</string> + <string>23d603a7bb864d0a8b6001f19a1b7335</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/curl-7.21.1-windows-20110211.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-curl/rev/236200/arch/CYGWIN/installer/curl-7.21.1-windows-20110719.tar.bz2</string> </map> <key>name</key> <string>windows</string> @@ -1206,9 +1206,9 @@ <key>archive</key> <map> <key>hash</key> - <string>a7c80fd8516df3b879b669b2b220067f</string> + <string>c6c28da2f262b4a146a90724b635f13f</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/232420/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20110608.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/236284/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20110720.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1218,9 +1218,9 @@ <key>archive</key> <map> <key>hash</key> - <string>c05a33ee8b6f253b5a744596dfc3707d</string> + <string>67505bb5e72ed5912c818d506e9eac22</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-linux-qt4.6-20101013.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/236284/arch/Linux/installer/llqtwebkit-4.7.1-linux-20110720.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1230,9 +1230,9 @@ <key>archive</key> <map> <key>hash</key> - <string>b9cc0333cc274c9cc40256ab7146b4fc</string> + <string>433e15cbb4d59aae9be10c18d19b094e</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/232420/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20110608.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/236284/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20110720.tar.bz2</string> </map> <key>name</key> <string>windows</string> @@ -1359,36 +1359,26 @@ </map> </map> </map> - <key>openSSL</key> + <key>openal_soft</key> <map> <key>license</key> - <string>openSSL</string> + <string>lgpl</string> <key>license_file</key> - <string>LICENSES/openssl.txt</string> + <string>LICENSES/OPENAL.txt</string> <key>name</key> - <string>openSSL</string> + <string>openal_soft</string> <key>platforms</key> <map> - <key>darwin</key> - <map> - <key>archive</key> - <map> - <key>hash</key> - <string>facee34b8bd57ad602157e65a5af1a49</string> - <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openssl-0.9.8q-darwin-20110211.tar.bz2</string> - </map> - <key>name</key> - <string>darwin</string> - </map> <key>linux</key> <map> <key>archive</key> <map> <key>hash</key> - <string>3d40be8566fa4b9df9a38e2a0f9ea467</string> + <string>fccdca18a950ac9363c6fb39118b80e1</string> + <key>hash_algorithm</key> + <string>md5</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-openssl/rev/226882/arch/Linux/installer/openssl-1.0.0d-linux-20110418.tar.bz2</string> + <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openal-3ad86a1c-linux-20110114.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1398,35 +1388,47 @@ <key>archive</key> <map> <key>hash</key> - <string>774c7f0a0312bee3054757a623e227bc</string> + <string>04df406f3e5d04cf176660bdac66c3a1</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-openssl/rev/220986/arch/CYGWIN/installer/openssl-0.9.8q-windows-20110211.tar.bz2</string> + <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openal-1.12.854-1.1.0-windows-20110301.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>3ad86a1c</string> </map> - <key>openal_soft</key> + <key>openjpeg</key> <map> <key>license</key> - <string>lgpl</string> + <string>openjpeg</string> <key>license_file</key> - <string>LICENSES/OPENAL.txt</string> + <string>LICENSES/openjpeg.txt</string> <key>name</key> - <string>openal_soft</string> + <string>openjpeg</string> <key>platforms</key> <map> + <key>darwin</key> + <map> + <key>archive</key> + <map> + <key>hash</key> + <string>4be51c7cca7d84831e30b63279df7ae5</string> + <key>url</key> + <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-darwin-20110302.tar.bz2</string> + </map> + <key>name</key> + <string>darwin</string> + </map> <key>linux</key> <map> <key>archive</key> <map> <key>hash</key> - <string>fccdca18a950ac9363c6fb39118b80e1</string> - <key>hash_algorithm</key> - <string>md5</string> + <string>fb2382014c79e0049746e4e29bd834f9</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openal-3ad86a1c-linux-20110114.tar.bz2</string> + <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-linux-20110314.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1436,25 +1438,23 @@ <key>archive</key> <map> <key>hash</key> - <string>04df406f3e5d04cf176660bdac66c3a1</string> + <string>ca5765af55f798724d601720afdf6953</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openal-1.12.854-1.1.0-windows-20110301.tar.bz2</string> + <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-windows-20110302.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> - <key>version</key> - <string>3ad86a1c</string> </map> - <key>openjpeg</key> + <key>openssl</key> <map> <key>license</key> - <string>openjpeg</string> + <string>openssl</string> <key>license_file</key> - <string>LICENSES/openjpeg.txt</string> + <string>LICENSES/openssl.txt</string> <key>name</key> - <string>openjpeg</string> + <string>openssl</string> <key>platforms</key> <map> <key>darwin</key> @@ -1462,9 +1462,9 @@ <key>archive</key> <map> <key>hash</key> - <string>4be51c7cca7d84831e30b63279df7ae5</string> + <string>1aecd89fee54741f2c4fd65c082d2604</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-darwin-20110302.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-openssl/rev/227862/arch/Darwin/installer/openssl-1.0.0d-darwin-20110427.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1474,9 +1474,9 @@ <key>archive</key> <map> <key>hash</key> - <string>fb2382014c79e0049746e4e29bd834f9</string> + <string>eab3a49d1ef77a651a3896d1d4864a78</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-linux-20110314.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-openssl/rev/227862/arch/Linux/installer/openssl-1.0.0d-linux-20110427.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1486,9 +1486,9 @@ <key>archive</key> <map> <key>hash</key> - <string>ca5765af55f798724d601720afdf6953</string> + <string>8ba049ecc76bb1adf3ab3e5bad64c39e</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-windows-20110302.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-openssl/rev/227862/arch/CYGWIN/installer/openssl-1.0.0d-windows-20110427.tar.bz2</string> </map> <key>name</key> <string>windows</string> @@ -1907,12 +1907,12 @@ <map> <key>build</key> <map> + <key>command</key> + <string>xcodebuild</string> <key>filters</key> <array> <string>setenv</string> </array> - <key>command</key> - <string>xcodebuild</string> <key>options</key> <array> <string>-configuration Debug</string> @@ -1961,12 +1961,12 @@ <map> <key>build</key> <map> + <key>command</key> + <string>xcodebuild</string> <key>filters</key> <array> <string>setenv</string> </array> - <key>command</key> - <string>xcodebuild</string> <key>options</key> <array> <string>-configuration RelWithDebInfo</string> @@ -2017,12 +2017,12 @@ <map> <key>build</key> <map> + <key>command</key> + <string>xcodebuild</string> <key>filters</key> <array> <string>setenv</string> </array> - <key>command</key> - <string>xcodebuild</string> <key>options</key> <array> <string>-configuration Release</string> diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index 5982ee9a49..dc50b1b8e7 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -7,7 +7,7 @@ set(OpenSSL_FIND_REQUIRED ON) if (STANDALONE) include(FindOpenSSL) else (STANDALONE) - use_prebuilt_binary(openSSL) + use_prebuilt_binary(openssl) if (WINDOWS) set(OPENSSL_LIBRARIES ssleay32 libeay32) else (WINDOWS) diff --git a/indra/llcommon/lleventtimer.cpp b/indra/llcommon/lleventtimer.cpp index 7743826c60..0d96e03da4 100644 --- a/indra/llcommon/lleventtimer.cpp +++ b/indra/llcommon/lleventtimer.cpp @@ -58,19 +58,15 @@ LLEventTimer::~LLEventTimer() void LLEventTimer::updateClass() { std::list<LLEventTimer*> completed_timers; - + for (instance_iter iter = beginInstances(); iter != endInstances(); ) { - LLInstanceTrackerScopedGuard guard; - for (instance_iter iter = guard.beginInstances(); iter != guard.endInstances(); ) - { - LLEventTimer& timer = *iter++; - F32 et = timer.mEventTimer.getElapsedTimeF32(); - if (timer.mEventTimer.getStarted() && et > timer.mPeriod) { - timer.mEventTimer.reset(); - if ( timer.tick() ) - { - completed_timers.push_back( &timer ); - } + LLEventTimer& timer = *iter++; + F32 et = timer.mEventTimer.getElapsedTimeF32(); + if (timer.mEventTimer.getStarted() && et > timer.mPeriod) { + timer.mEventTimer.reset(); + if ( timer.tick() ) + { + completed_timers.push_back( &timer ); } } } diff --git a/indra/llcommon/llfasttimer_class.cpp b/indra/llcommon/llfasttimer_class.cpp index 675eda2fc5..ebb5961c91 100644 --- a/indra/llcommon/llfasttimer_class.cpp +++ b/indra/llcommon/llfasttimer_class.cpp @@ -219,22 +219,19 @@ LLFastTimer::DeclareTimer::DeclareTimer(const std::string& name) // static void LLFastTimer::DeclareTimer::updateCachedPointers() { - DeclareTimer::LLInstanceTrackerScopedGuard guard; // propagate frame state pointers to timer declarations - for (DeclareTimer::instance_iter it = guard.beginInstances(); - it != guard.endInstances(); - ++it) + for (instance_iter it = beginInstances(); it != endInstances(); ++it) { // update cached pointer it->mFrameState = &it->mTimer.getFrameState(); } - // also update frame states of timers on stack
- LLFastTimer* cur_timerp = LLFastTimer::sCurTimerData.mCurTimer;
- while(cur_timerp->mLastTimerData.mCurTimer != cur_timerp)
- {
- cur_timerp->mFrameState = &cur_timerp->mFrameState->mTimer->getFrameState();
- cur_timerp = cur_timerp->mLastTimerData.mCurTimer;
+ // also update frame states of timers on stack + LLFastTimer* cur_timerp = LLFastTimer::sCurTimerData.mCurTimer; + while(cur_timerp->mLastTimerData.mCurTimer != cur_timerp) + { + cur_timerp->mFrameState = &cur_timerp->mFrameState->mTimer->getFrameState(); + cur_timerp = cur_timerp->mLastTimerData.mCurTimer; } } @@ -396,10 +393,7 @@ void LLFastTimer::NamedTimer::buildHierarchy() // set up initial tree { - NamedTimer::LLInstanceTrackerScopedGuard guard; - for (instance_iter it = guard.beginInstances(); - it != guard.endInstances(); - ++it) + for (instance_iter it = beginInstances(); it != endInstances(); ++it) { NamedTimer& timer = *it; if (&timer == NamedTimerFactory::instance().getRootTimer()) continue; @@ -527,10 +521,7 @@ void LLFastTimer::NamedTimer::resetFrame() LLSD sd; { - NamedTimer::LLInstanceTrackerScopedGuard guard; - for (NamedTimer::instance_iter it = guard.beginInstances(); - it != guard.endInstances(); - ++it) + for (instance_iter it = beginInstances(); it != endInstances(); ++it) { NamedTimer& timer = *it; FrameState& info = timer.getFrameState(); @@ -567,7 +558,7 @@ void LLFastTimer::NamedTimer::resetFrame() llassert_always(timerp->mFrameStateIndex < (S32)getFrameStateList().size()); } - // sort timers by dfs traversal order to improve cache coherency + // sort timers by DFS traversal order to improve cache coherency std::sort(getFrameStateList().begin(), getFrameStateList().end(), SortTimersDFS()); // update pointers into framestatelist now that we've sorted it @@ -575,10 +566,7 @@ void LLFastTimer::NamedTimer::resetFrame() // reset for next frame { - NamedTimer::LLInstanceTrackerScopedGuard guard; - for (NamedTimer::instance_iter it = guard.beginInstances(); - it != guard.endInstances(); - ++it) + for (instance_iter it = beginInstances(); it != endInstances(); ++it) { NamedTimer& timer = *it; @@ -622,10 +610,7 @@ void LLFastTimer::NamedTimer::reset() // reset all history { - NamedTimer::LLInstanceTrackerScopedGuard guard; - for (NamedTimer::instance_iter it = guard.beginInstances(); - it != guard.endInstances(); - ++it) + for (instance_iter it = beginInstances(); it != endInstances(); ++it) { NamedTimer& timer = *it; if (&timer != NamedTimerFactory::instance().getRootTimer()) @@ -873,7 +858,7 @@ std::string LLFastTimer::sClockType = "rdtsc"; #else //LL_COMMON_API U64 get_clock_count(); // in lltimer.cpp -// These use QueryPerformanceCounter, which is arguably fine and also works on amd architectures. +// These use QueryPerformanceCounter, which is arguably fine and also works on AMD architectures. U32 LLFastTimer::getCPUClockCount32() { return (U32)(get_clock_count()>>8); diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h index b971b2f914..47041f790f 100644 --- a/indra/llcommon/llinstancetracker.h +++ b/indra/llcommon/llinstancetracker.h @@ -52,13 +52,68 @@ class LLInstanceTracker : public LLInstanceTrackerBase { typedef typename std::map<KEY, T*> InstanceMap; typedef LLInstanceTracker<T, KEY> MyT; - typedef boost::function<const KEY&(typename InstanceMap::value_type&)> KeyGetter; - typedef boost::function<T*(typename InstanceMap::value_type&)> InstancePtrGetter; public: - /// Dereferencing key_iter gives you a const KEY& - typedef boost::transform_iterator<KeyGetter, typename InstanceMap::iterator> key_iter; - /// Dereferencing instance_iter gives you a T& - typedef boost::indirect_iterator< boost::transform_iterator<InstancePtrGetter, typename InstanceMap::iterator> > instance_iter; + class instance_iter : public boost::iterator_facade<instance_iter, T, boost::forward_traversal_tag> + { + public: + instance_iter(typename InstanceMap::iterator& it) + : mIterator(it) + { + ++sIterationNestDepth; + } + + ~instance_iter() + { + --sIterationNestDepth; + } + + private: + friend class boost::iterator_core_access; + + void increment() { mIterator++; } + bool equal(instance_iter const& other) const + { + return mIterator == other.mIterator; + } + + T& dereference() const + { + return *(mIterator->second); + } + + typename InstanceMap::iterator mIterator; + }; + + class key_iter : public boost::iterator_facade<key_iter, KEY, boost::forward_traversal_tag> + { + public: + key_iter(typename InstanceMap::iterator& it) + : mIterator(it) + { + ++sIterationNestDepth; + } + + ~key_iter() + { + --sIterationNestDepth; + } + + private: + friend class boost::iterator_core_access; + + void increment() { mIterator++; } + bool equal(key_iter const& other) const + { + return mIterator == other.mIterator; + } + + KEY& dereference() const + { + return const_cast<KEY&>(mIterator->first); + } + + typename InstanceMap::iterator mIterator; + }; static T* getInstance(const KEY& k) { @@ -66,42 +121,47 @@ public: return (found == getMap_().end()) ? NULL : found->second; } - static key_iter beginKeys() - { - return boost::make_transform_iterator(getMap_().begin(), - boost::bind(&InstanceMap::value_type::first, _1)); + static instance_iter beginInstances() + { + return instance_iter(getMap_().begin()); } - static key_iter endKeys() + + static instance_iter endInstances() { - return boost::make_transform_iterator(getMap_().end(), - boost::bind(&InstanceMap::value_type::first, _1)); + return instance_iter(getMap_().end()); } - static instance_iter beginInstances() + + static S32 instanceCount() { return getMap_().size(); } + + static key_iter beginKeys() { - return instance_iter(boost::make_transform_iterator(getMap_().begin(), - boost::bind(&InstanceMap::value_type::second, _1))); + return key_iter(getMap_().begin()); } - static instance_iter endInstances() + static key_iter endKeys() { - return instance_iter(boost::make_transform_iterator(getMap_().end(), - boost::bind(&InstanceMap::value_type::second, _1))); + return key_iter(getMap_().end()); } - static S32 instanceCount() { return getMap_().size(); } + protected: LLInstanceTracker(KEY key) { add_(key); } - virtual ~LLInstanceTracker() { remove_(); } + virtual ~LLInstanceTracker() + { + // it's unsafe to delete instances of this type while all instances are being iterated over. + llassert(sIterationNestDepth == 0); + remove_(); + } virtual void setKey(KEY key) { remove_(); add_(key); } - virtual const KEY& getKey() const { return mKey; } + virtual const KEY& getKey() const { return mInstanceKey; } private: void add_(KEY key) { - mKey = key; + mInstanceKey = key; getMap_()[key] = static_cast<T*>(this); } void remove_() { - getMap_().erase(mKey); + getMap_().erase(mInstanceKey); } static InstanceMap& getMap_() @@ -116,9 +176,12 @@ private: private: - KEY mKey; + KEY mInstanceKey; + static S32 sIterationNestDepth; }; +template <typename T, typename KEY> S32 LLInstanceTracker<T, KEY>::sIterationNestDepth = 0; + /// explicit specialization for default case where KEY is T* /// use a simple std::set<T*> template<typename T> @@ -127,42 +190,55 @@ class LLInstanceTracker<T, T*> : public LLInstanceTrackerBase typedef typename std::set<T*> InstanceSet; typedef LLInstanceTracker<T, T*> MyT; public: - /// Dereferencing key_iter gives you a T* (since T* is the key) - typedef typename InstanceSet::iterator key_iter; - /// Dereferencing instance_iter gives you a T& - typedef boost::indirect_iterator<key_iter> instance_iter; /// for completeness of analogy with the generic implementation static T* getInstance(T* k) { return k; } static S32 instanceCount() { return getSet_().size(); } - // Instantiate this to get access to iterators for this type. It's a 'guard' in the sense - // that it treats deletes of this type as errors as long as there is an instance of - // this class alive in scope somewhere (i.e. deleting while iterating is bad). - class LLInstanceTrackerScopedGuard + class instance_iter : public boost::iterator_facade<instance_iter, T, boost::forward_traversal_tag> { public: - LLInstanceTrackerScopedGuard() + instance_iter(typename InstanceSet::iterator& it) + : mIterator(it) + { + ++sIterationNestDepth; + } + + instance_iter(const instance_iter& other) + : mIterator(other.mIterator) { ++sIterationNestDepth; } - ~LLInstanceTrackerScopedGuard() + ~instance_iter() { --sIterationNestDepth; } - static instance_iter beginInstances() { return instance_iter(getSet_().begin()); } - static instance_iter endInstances() { return instance_iter(getSet_().end()); } - static key_iter beginKeys() { return getSet_().begin(); } - static key_iter endKeys() { return getSet_().end(); } + private: + friend class boost::iterator_core_access; + + void increment() { mIterator++; } + bool equal(instance_iter const& other) const + { + return mIterator == other.mIterator; + } + + T& dereference() const + { + return **mIterator; + } + + typename InstanceSet::iterator mIterator; }; + static instance_iter beginInstances() { return instance_iter(getSet_().begin()); } + static instance_iter endInstances() { return instance_iter(getSet_().end()); } + protected: LLInstanceTracker() { // it's safe but unpredictable to create instances of this type while all instances are being iterated over. I hate unpredictable. This assert will probably be turned on early in the next development cycle. - //llassert(sIterationNestDepth == 0); getSet_().insert(static_cast<T*>(this)); } virtual ~LLInstanceTracker() @@ -174,7 +250,6 @@ protected: LLInstanceTracker(const LLInstanceTracker& other) { - //llassert(sIterationNestDepth == 0); getSet_().insert(static_cast<T*>(this)); } diff --git a/indra/llcommon/tests/llinstancetracker_test.cpp b/indra/llcommon/tests/llinstancetracker_test.cpp index c7cb488ca1..73cbd76d91 100644 --- a/indra/llcommon/tests/llinstancetracker_test.cpp +++ b/indra/llcommon/tests/llinstancetracker_test.cpp @@ -151,28 +151,13 @@ namespace tut { Unkeyed one, two, three; typedef std::set<Unkeyed*> KeySet; - KeySet keys; - keys.insert(&one); - keys.insert(&two); - keys.insert(&three); - { - Unkeyed::LLInstanceTrackerScopedGuard guard; - for (Unkeyed::key_iter ki(guard.beginKeys()), kend(guard.endKeys()); - ki != kend; ++ki) - { - ensure_equals("spurious key", keys.erase(*ki), 1); - } - } - ensure_equals("unreported key", keys.size(), 0); - + KeySet instances; instances.insert(&one); instances.insert(&two); instances.insert(&three); { - Unkeyed::LLInstanceTrackerScopedGuard guard; - for (Unkeyed::instance_iter ii(guard.beginInstances()), iend(guard.endInstances()); - ii != iend; ++ii) + for (Unkeyed::instance_iter ii(Unkeyed::beginInstances()), iend(Unkeyed::endInstances()); ii != iend; ++ii) { Unkeyed& ref = *ii; ensure_equals("spurious instance", instances.erase(&ref), 1); diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 8937726209..39f59c0bd8 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -2140,8 +2140,7 @@ void LLGLNamePool::release(GLuint name) void LLGLNamePool::upkeepPools() { LLMemType mt(LLMemType::MTYPE_UPKEEP_POOLS); - tracker_t::LLInstanceTrackerScopedGuard guard; - for (tracker_t::instance_iter iter = guard.beginInstances(); iter != guard.endInstances(); ++iter) + for (tracker_t::instance_iter iter = beginInstances(); iter != endInstances(); ++iter) { LLGLNamePool & pool = *iter; pool.upkeep(); @@ -2151,8 +2150,7 @@ void LLGLNamePool::upkeepPools() //static void LLGLNamePool::cleanupPools() { - tracker_t::LLInstanceTrackerScopedGuard guard; - for (tracker_t::instance_iter iter = guard.beginInstances(); iter != guard.endInstances(); ++iter) + for (tracker_t::instance_iter iter = beginInstances(); iter != endInstances(); ++iter) { LLGLNamePool & pool = *iter; pool.cleanup(); diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 0bbdcfd6ff..673494820f 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -29,6 +29,7 @@ set(llui_SOURCE_FILES llaccordionctrl.cpp llaccordionctrltab.cpp llbadge.cpp + llbadgeholder.cpp llbadgeowner.cpp llbutton.cpp llcheckboxctrl.cpp @@ -123,6 +124,7 @@ set(llui_HEADER_FILES llaccordionctrl.h llaccordionctrltab.h llbadge.h + llbadgeholder.h llbadgeowner.h llbutton.h llcallbackmap.h diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp index c28a947a7f..fde3c53a65 100644 --- a/indra/llui/llbadge.cpp +++ b/indra/llui/llbadge.cpp @@ -43,6 +43,8 @@ LLBadge::Params::Params() , image_color("image_color") , label("label") , label_color("label_color") + , label_offset_horiz("label_offset_horiz") + , label_offset_vert("label_offset_vert") , location("location", LLRelPos::TOP_LEFT) , location_percent_hcenter("location_percent_hcenter") , location_percent_vcenter("location_percent_vcenter") @@ -65,6 +67,8 @@ bool LLBadge::Params::equals(const Params& a) const comp &= (image_color() == a.image_color()); comp &= (label() == a.label()); comp &= (label_color() == a.label_color()); + comp &= (label_offset_horiz() == a.label_offset_horiz()); + comp &= (label_offset_vert() == a.label_offset_vert()); comp &= (location() == a.location()); comp &= (location_percent_hcenter() == a.location_percent_hcenter()); comp &= (location_percent_vcenter() == a.location_percent_vcenter()); @@ -84,6 +88,8 @@ LLBadge::LLBadge(const LLBadge::Params& p) , mImageColor(p.image_color) , mLabel(p.label) , mLabelColor(p.label_color) + , mLabelOffsetHoriz(p.label_offset_horiz) + , mLabelOffsetVert(p.label_offset_vert) , mLocation(p.location) , mLocationPercentHCenter(0.5f) , mLocationPercentVCenter(0.5f) @@ -131,6 +137,18 @@ LLBadge::~LLBadge() { } +bool LLBadge::addToView(LLView * view) +{ + bool child_added = view->addChild(this); + + if (child_added) + { + setShape(view->getLocalRect()); + } + + return child_added; +} + void LLBadge::setLabel(const LLStringExplicit& label) { mLabel = label; @@ -241,8 +259,10 @@ void LLBadge::draw() // Draw the label // - mGLFont->render(badge_label_wstring, badge_label_begin_offset, - badge_center_x, badge_center_y, + mGLFont->render(badge_label_wstring, + badge_label_begin_offset, + badge_center_x + mLabelOffsetHoriz, + badge_center_y + mLabelOffsetVert, mLabelColor % alpha, LLFontGL::HCENTER, LLFontGL::VCENTER, // centered around the position LLFontGL::NORMAL, // normal text (not bold, italics, etc.) diff --git a/indra/llui/llbadge.h b/indra/llui/llbadge.h index 0f923ef01b..f81ccdf0cd 100644 --- a/indra/llui/llbadge.h +++ b/indra/llui/llbadge.h @@ -104,6 +104,9 @@ public: Optional< std::string > label; Optional< LLUIColor > label_color; + Optional< S32 > label_offset_horiz; + Optional< S32 > label_offset_vert; + Optional< LLRelPos::Location > location; Optional< U32 > location_percent_hcenter; Optional< U32 > location_percent_vcenter; @@ -123,7 +126,9 @@ protected: public: ~LLBadge(); - + + bool addToView(LLView * view); + virtual void draw(); const std::string getLabel() const { return wstring_to_utf8str(mLabel); } @@ -141,6 +146,9 @@ private: LLUIString mLabel; LLUIColor mLabelColor; + S32 mLabelOffsetHoriz; + S32 mLabelOffsetVert; + LLRelPos::Location mLocation; F32 mLocationPercentHCenter; F32 mLocationPercentVCenter; diff --git a/indra/llui/llbadgeholder.cpp b/indra/llui/llbadgeholder.cpp new file mode 100644 index 0000000000..1f786f36ae --- /dev/null +++ b/indra/llui/llbadgeholder.cpp @@ -0,0 +1,45 @@ +/** + * @file llbadgeholder.cpp + * @brief Source for badge holders + * + * $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 "llbadgeholder.h" + +#include "llbadge.h" +#include "llview.h" + + +bool LLBadgeHolder::addBadge(LLBadge * badge) +{ + bool badge_added = false; + + LLView * this_view = dynamic_cast<LLView *>(this); + + if (this_view && mAcceptsBadge) + { + badge_added = badge->addToView(this_view); + } + + return badge_added; +} diff --git a/indra/llui/llbadgeholder.h b/indra/llui/llbadgeholder.h new file mode 100644 index 0000000000..2538eaae91 --- /dev/null +++ b/indra/llui/llbadgeholder.h @@ -0,0 +1,56 @@ +/** + * @file llbadgeholder.h + * @brief Header for badge holders + * + * $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$ + */ + +#ifndef LL_LLBADGEHOLDER_H +#define LL_LLBADGEHOLDER_H + +// +// Classes +// + +class LLBadge; + +class LLBadgeHolder +{ +public: + + LLBadgeHolder(bool acceptsBadge) + : mAcceptsBadge(acceptsBadge) + { + } + + void setAcceptsBadge(bool acceptsBadge) { mAcceptsBadge = acceptsBadge; } + bool acceptsBadge() const { return mAcceptsBadge; } + + virtual bool addBadge(LLBadge * badge); + +private: + + bool mAcceptsBadge; + +}; + +#endif // LL_LLBADGEHOLDER_H diff --git a/indra/llui/llbadgeowner.cpp b/indra/llui/llbadgeowner.cpp index 77f15567bf..1860a05edd 100644 --- a/indra/llui/llbadgeowner.cpp +++ b/indra/llui/llbadgeowner.cpp @@ -26,6 +26,7 @@ #include "linden_common.h" +#include "llbadgeholder.h" #include "llbadgeowner.h" #include "llpanel.h" @@ -81,40 +82,44 @@ void LLBadgeOwner::setBadgeVisibility(bool visible) } } -void LLBadgeOwner::addBadgeToParentPanel() +bool LLBadgeOwner::addBadgeToParentPanel() { + bool badge_added = false; + LLView * owner_view = mBadgeOwnerView.get(); if (mBadge && owner_view) { - // Badge parent is badge owner by default - LLView * badge_parent = owner_view; + LLBadgeHolder * badge_holder = NULL; - // Find the appropriate parent for the badge + // Find the appropriate holder for the badge LLView * parent = owner_view->getParent(); while (parent) { - LLPanel * parent_panel = dynamic_cast<LLPanel *>(parent); + LLBadgeHolder * badge_holder_panel = dynamic_cast<LLBadgeHolder *>(parent); - if (parent_panel && parent_panel->acceptsBadge()) + if (badge_holder_panel && badge_holder_panel->acceptsBadge()) { - badge_parent = parent; + badge_holder = badge_holder_panel; break; } parent = parent->getParent(); } - if (badge_parent) + if (badge_holder) { - badge_parent->addChild(mBadge); + badge_added = badge_holder->addBadge(mBadge); } else { - llwarns << "Unable to find parent panel for badge " << mBadge->getName() << " on " << owner_view->getName() << llendl; + // Badge parent is fallback badge owner if no valid holder exists in the hierarchy + badge_added = mBadge->addToView(owner_view); } } + + return badge_added; } LLBadge* LLBadgeOwner::createBadge(const LLBadge::Params& p) diff --git a/indra/llui/llbadgeowner.h b/indra/llui/llbadgeowner.h index a2399189a5..8d03e30645 100644 --- a/indra/llui/llbadgeowner.h +++ b/indra/llui/llbadgeowner.h @@ -41,7 +41,7 @@ public: LLBadgeOwner(LLHandle< LLView > viewHandle); void initBadgeParams(const LLBadge::Params& p); - void addBadgeToParentPanel(); + bool addBadgeToParentPanel(); bool badgeHasParent() const { return (mBadge && mBadge->getParent()); } diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp index 04040200d0..161496b1f5 100644 --- a/indra/llui/llconsole.cpp +++ b/indra/llui/llconsole.cpp @@ -372,9 +372,7 @@ LLConsole::Paragraph::Paragraph (LLWString str, const LLColor4 &color, F32 add_t // static void LLConsole::updateClass() { - LLInstanceTrackerScopedGuard guard; - - for (instance_iter it = guard.beginInstances(); it != guard.endInstances(); ++it) + for (instance_iter it = beginInstances(); it != endInstances(); ++it) { it->update(); } diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index d19e33ea55..43a37d6dff 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -766,7 +766,6 @@ void LLFloater::closeFloater(bool app_quitting) void LLFloater::reshape(S32 width, S32 height, BOOL called_from_parent) { LLPanel::reshape(width, height, called_from_parent); - storeRectControl(); } void LLFloater::releaseFocus() @@ -968,6 +967,11 @@ void LLFloater::handleReshape(const LLRect& new_rect, bool by_user) const LLRect old_rect = getRect(); LLView::handleReshape(new_rect, by_user); + if (by_user) + { + storeRectControl(); + } + // if not minimized, adjust all snapped dependents to new shape if (!isMinimized()) { @@ -2048,7 +2052,6 @@ static LLDefaultChildRegistry::Register<LLFloaterView> r("floater_view"); LLFloaterView::LLFloaterView (const Params& p) : LLUICtrl (p), - mFocusCycleMode(FALSE), mMinimizePositionVOffset(0), mSnapOffsetBottom(0), @@ -2059,12 +2062,6 @@ LLFloaterView::LLFloaterView (const Params& p) // By default, adjust vertical. void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent) { - reshapeFloater(width, height, called_from_parent, ADJUST_VERTICAL_YES); -} - -// When reshaping this view, make the floaters follow their closest edge. -void LLFloaterView::reshapeFloater(S32 width, S32 height, BOOL called_from_parent, BOOL adjust_vertical) -{ S32 old_width = getRect().getWidth(); S32 old_height = getRect().getHeight(); @@ -2109,11 +2106,7 @@ void LLFloaterView::reshapeFloater(S32 width, S32 height, BOOL called_from_paren // "No vertical adjustment" usually means that the bottom of the view // has been pushed up or down. Hence we want the floaters to follow // the top. - if (!adjust_vertical) - { - follow_flags |= FOLLOWS_TOP; - } - else if (top_offset < bottom_offset) + if (top_offset < bottom_offset) { follow_flags |= FOLLOWS_TOP; } @@ -2847,7 +2840,7 @@ void LLFloater::initFromParams(const LLFloater::Params& p) mAutoTile = p.auto_tile; mOpenCentered = p.open_centered; - if (p.save_rect) + if (p.save_rect && mRectControl.empty()) { mRectControl = "t"; // flag to build mRectControl name once mInstanceName is set } @@ -2885,13 +2878,54 @@ boost::signals2::connection LLFloater::setCloseCallback( const commit_signal_t:: } LLFastTimer::DeclareTimer POST_BUILD("Floater Post Build"); +static LLFastTimer::DeclareTimer FTM_EXTERNAL_FLOATER_LOAD("Load Extern Floater Reference"); bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::string& filename, LLXMLNodePtr output_node) { - Params params(LLUICtrlFactory::getDefaultParams<LLFloater>()); + Params default_params(LLUICtrlFactory::getDefaultParams<LLFloater>()); + Params params(default_params); + LLXUIParser parser; parser.readXUI(node, params, filename); // *TODO: Error checking + std::string xml_filename = params.filename; + + if (!xml_filename.empty()) + { + LLXMLNodePtr referenced_xml; + + if (output_node) + { + //if we are exporting, we want to export the current xml + //not the referenced xml + Params output_params; + parser.readXUI(node, output_params, LLUICtrlFactory::getInstance()->getCurFileName()); + setupParamsForExport(output_params, parent); + output_node->setName(node->getName()->mString); + parser.writeXUI(output_node, output_params, &default_params); + return TRUE; + } + + LLUICtrlFactory::instance().pushFileName(xml_filename); + + LLFastTimer _(FTM_EXTERNAL_FLOATER_LOAD); + if (!LLUICtrlFactory::getLayeredXMLNode(xml_filename, referenced_xml)) + { + llwarns << "Couldn't parse panel from: " << xml_filename << llendl; + + return FALSE; + } + + parser.readXUI(referenced_xml, params, LLUICtrlFactory::getInstance()->getCurFileName()); + + // add children using dimensions from referenced xml for consistent layout + setShape(params.rect); + LLUICtrlFactory::createChildren(this, referenced_xml, child_registry_t::instance()); + + LLUICtrlFactory::instance().popFileName(); + } + + if (output_node) { Params output_params(params); @@ -2912,7 +2946,6 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::str { params.rect.left.set(0); } - params.from_xui = true; applyXUILayout(params, parent); initFromParams(params); @@ -3054,3 +3087,24 @@ bool LLFloater::buildFromFile(const std::string& filename, LLXMLNodePtr output_n return res; } + +void LLFloater::stackWith(LLFloater& other) +{ + static LLUICachedControl<S32> floater_offset ("UIFloaterOffset", 16); + + LLRect next_rect; + if (other.getHost()) + { + next_rect = other.getHost()->getRect(); + } + else + { + next_rect = other.getRect(); + } + next_rect.translate(floater_offset, -floater_offset); + + next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, getRect().getWidth(), getRect().getHeight()); + + mRectControl.clear(); // don't save rect of stacked floaters + setShape(next_rect); +}
\ No newline at end of file diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 5b7b020881..58c2d34253 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -253,7 +253,7 @@ public: LLHandle<LLFloater> getHandle() const { return mHandle; } const LLSD& getKey() { return mKey; } - BOOL matchesKey(const LLSD& key) { return mSingleInstance || KeyCompare::equate(key, mKey); } + virtual bool matchesKey(const LLSD& key) { return mSingleInstance || KeyCompare::equate(key, mKey); } const std::string& getInstanceName() { return mInstanceName; } @@ -265,6 +265,8 @@ public: virtual void setTornOff(bool torn_off) { mTornOff = torn_off; } + void stackWith(LLFloater& other); + // Return a closeable floater, if any, given the current focus. static LLFloater* getClosableFloaterFromFocus(); @@ -289,9 +291,6 @@ public: void updateTransparency(ETypeTransparency transparency_type); protected: - - void setRectControl(const std::string& rectname) { mRectControl = rectname; }; - virtual void applySavedVariables(); void applyRectControl(); @@ -455,8 +454,6 @@ protected: public: /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - void reshapeFloater(S32 width, S32 height, BOOL called_from_parent, BOOL adjust_vertical); - /*virtual*/ void draw(); /*virtual*/ LLRect getSnapRect() const; /*virtual*/ void refresh(); diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 4677d535db..1463d0bfbb 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -57,7 +57,7 @@ void LLFloaterReg::add(const std::string& name, const std::string& filename, con } //static -LLRect LLFloaterReg::getFloaterRect(const std::string& name) +LLFloater* LLFloaterReg::getLastFloaterInGroup(const std::string& name) { LLRect rect; const std::string& groupname = sGroupMap[name]; @@ -66,20 +66,10 @@ LLRect LLFloaterReg::getFloaterRect(const std::string& name) instance_list_t& list = sInstanceMap[groupname]; if (!list.empty()) { - static LLUICachedControl<S32> floater_offset ("UIFloaterOffset", 16); - LLFloater* last_floater = list.back(); - if (last_floater->getHost()) - { - rect = last_floater->getHost()->getRect(); - } - else - { - rect = last_floater->getRect(); - } - rect.translate(floater_offset, -floater_offset); + return list.back(); } } - return rect; + return NULL; } //static @@ -129,17 +119,20 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) } // Note: key should eventually be a non optional LLFloater arg; for now, set mKey to be safe - res->mKey = key; + if (res->mKey.isUndefined()) + { + res->mKey = key; + } res->setInstanceName(name); res->applySavedVariables(); // Can't apply rect and dock state until setting instance name if (res->mAutoTile && !res->getHost() && index > 0) { - const LLRect& cur_rect = res->getRect(); - LLRect next_rect = getFloaterRect(groupname); - next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, cur_rect.getWidth(), cur_rect.getHeight()); - res->setRect(next_rect); - res->setRectControl(LLStringUtil::null); // don't save rect of tiled floaters - gFloaterView->adjustToFitScreen(res, true); + LLFloater* last_floater = getLastFloaterInGroup(groupname); + if (last_floater) + { + res->stackWith(*last_floater); + gFloaterView->adjustToFitScreen(res, true); + } } else { @@ -221,7 +214,7 @@ LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, LLFloater* instance = getInstance(name, key); if (instance) { - instance->openFloater(key); + instance->openFloater(instance->mKey); if (focus) instance->setFocus(TRUE); } diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h index 8414b92113..a2027a77a0 100644 --- a/indra/llui/llfloaterreg.h +++ b/indra/llui/llfloaterreg.h @@ -86,7 +86,7 @@ public: const std::string& groupname = LLStringUtil::null); // Helpers - static LLRect getFloaterRect(const std::string& name); + static LLFloater* getLastFloaterInGroup(const std::string& name); // Find / get (create) / remove / destroy static LLFloater* findInstance(const std::string& name, const LLSD& key = LLSD()); diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 6a91ec56e4..a59247ba09 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -713,10 +713,7 @@ void LLLayoutStack::createResizeBars() //static void LLLayoutStack::updateClass() { - LLInstanceTrackerScopedGuard guard; - for (LLLayoutStack::instance_iter it = guard.beginInstances(); - it != guard.endInstances(); - ++it) + for (instance_iter it = beginInstances(); it != endInstances(); ++it) { it->updateLayout(); } diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 1dcdd79efa..e3193bc352 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -99,6 +99,7 @@ LLPanel::Params::Params() LLPanel::LLPanel(const LLPanel::Params& p) : LLUICtrl(p), + LLBadgeHolder(p.accepts_badge), mBgVisible(p.background_visible), mBgOpaque(p.background_opaque), mBgOpaqueColor(p.bg_opaque_color()), @@ -114,8 +115,7 @@ LLPanel::LLPanel(const LLPanel::Params& p) mCommitCallbackRegistrar(false), mEnableCallbackRegistrar(false), mXMLFilename(p.filename), - mVisibleSignal(NULL), - mAcceptsBadge(p.accepts_badge) + mVisibleSignal(NULL) // *NOTE: Be sure to also change LLPanel::initFromParams(). We have too // many classes derived from LLPanel to retrofit them all to pass in params. { @@ -488,7 +488,7 @@ void LLPanel::initFromParams(const LLPanel::Params& p) mBgOpaqueImageOverlay = p.bg_opaque_image_overlay; mBgAlphaImageOverlay = p.bg_alpha_image_overlay; - mAcceptsBadge = p.accepts_badge; + setAcceptsBadge(p.accepts_badge); } static LLFastTimer::DeclareTimer FTM_PANEL_SETUP("Panel Setup"); @@ -515,9 +515,6 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu if (!xml_filename.empty()) { - LLUICtrlFactory::instance().pushFileName(xml_filename); - - LLFastTimer timer(FTM_EXTERNAL_PANEL_LOAD); if (output_node) { //if we are exporting, we want to export the current xml @@ -530,6 +527,9 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu return TRUE; } + LLUICtrlFactory::instance().pushFileName(xml_filename); + + LLFastTimer timer(FTM_EXTERNAL_PANEL_LOAD); if (!LLUICtrlFactory::getLayeredXMLNode(xml_filename, referenced_xml)) { llwarns << "Couldn't parse panel from: " << xml_filename << llendl; diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index 67674fab7e..790025cb2d 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -35,6 +35,7 @@ #include "lluiimage.h" #include "lluistring.h" #include "v4color.h" +#include "llbadgeholder.h" #include <list> #include <queue> @@ -51,7 +52,7 @@ class LLUIImage; * With or without border, * Can contain LLUICtrls. */ -class LLPanel : public LLUICtrl +class LLPanel : public LLUICtrl, public LLBadgeHolder { public: struct LocalizedString : public LLInitParam::Block<LocalizedString> @@ -252,8 +253,6 @@ public: boost::signals2::connection setVisibleCallback( const commit_signal_t::slot_type& cb ); - bool acceptsBadge() const { return mAcceptsBadge; } - protected: // Override to set not found list LLButton* getDefaultButton() { return mDefaultBtn; } @@ -266,9 +265,11 @@ protected: std::string mHelpTopic; // the name of this panel's help topic to display in the Help Viewer typedef std::deque<const LLCallbackMap::map_t*> factory_stack_t; static factory_stack_t sFactoryStack; + + // for setting the xml filename when building panel in context dependent cases + std::string mXMLFilename; private: - bool mAcceptsBadge; BOOL mBgVisible; // any background at all? BOOL mBgOpaque; // use opaque color or image LLUIColor mBgOpaqueColor; @@ -285,8 +286,6 @@ private: typedef std::map<std::string, std::string> ui_string_map_t; ui_string_map_t mUIStrings; - // for setting the xml filename when building panel in context dependent cases - std::string mXMLFilename; }; // end class LLPanel diff --git a/indra/llui/llsdparam.h b/indra/llui/llsdparam.h index 69dab2b411..f776c781b3 100644 --- a/indra/llui/llsdparam.h +++ b/indra/llui/llsdparam.h @@ -93,8 +93,17 @@ class LLSDParamAdapter : public T LLParamSDParser parser; parser.readSD(sd, *this); } + + operator LLSD() const + { + LLParamSDParser parser; + LLSD sd; + parser.writeSD(sd, *this); + return sd; + } LLSDParamAdapter(const T& val) + : T(val) { T::operator=(val); } diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 28d7e0a5ba..58ba9e05f5 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -2095,7 +2095,7 @@ namespace LLInitParam alpha("alpha"), control("") { - updateBlockFromValue(); + updateBlockFromValue(false); } void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateValueFromBlock() @@ -2110,14 +2110,14 @@ namespace LLInitParam } } - void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateBlockFromValue() + void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateBlockFromValue(bool make_block_authoritative) { LLColor4 color = getValue(); - red.set(color.mV[VRED], false); - green.set(color.mV[VGREEN], false); - blue.set(color.mV[VBLUE], false); - alpha.set(color.mV[VALPHA], false); - control.set("", false); + red.set(color.mV[VRED], make_block_authoritative); + green.set(color.mV[VGREEN], make_block_authoritative); + blue.set(color.mV[VBLUE], make_block_authoritative); + alpha.set(color.mV[VALPHA], make_block_authoritative); + control.set("", make_block_authoritative); } bool ParamCompare<const LLFontGL*, false>::equals(const LLFontGL* a, const LLFontGL* b) @@ -2137,7 +2137,7 @@ namespace LLInitParam updateValue(LLFontGL::getFontDefault()); } addSynonym(name, ""); - updateBlockFromValue(); + updateBlockFromValue(false); } void ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::updateValueFromBlock() @@ -2163,13 +2163,13 @@ namespace LLInitParam } } - void ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::updateBlockFromValue() + void ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::updateBlockFromValue(bool make_block_authoritative) { if (getValue()) { - name.set(LLFontGL::nameFromFont(getValue()), false); - size.set(LLFontGL::sizeFromFont(getValue()), false); - style.set(LLFontGL::getStringFromStyle(getValue()->getFontDesc().getStyle()), false); + name.set(LLFontGL::nameFromFont(getValue()), make_block_authoritative); + size.set(LLFontGL::sizeFromFont(getValue()), make_block_authoritative); + style.set(LLFontGL::getStringFromStyle(getValue()->getFontDesc().getStyle()), make_block_authoritative); } } @@ -2182,7 +2182,7 @@ namespace LLInitParam width("width"), height("height") { - updateBlockFromValue(); + updateBlockFromValue(false); } void ParamValue<LLRect, TypeValues<LLRect> >::updateValueFromBlock() @@ -2249,19 +2249,19 @@ namespace LLInitParam updateValue(rect); } - void ParamValue<LLRect, TypeValues<LLRect> >::updateBlockFromValue() + void ParamValue<LLRect, TypeValues<LLRect> >::updateBlockFromValue(bool make_block_authoritative) { // because of the ambiguity in specifying a rect by position and/or dimensions - // we clear the "provided" flag so that values from xui/etc have priority - // over those calculated from the rect object - + // we use the lowest priority pairing so that any valid pairing in xui + // will override those calculated from the rect object + // in this case, that is left+width and bottom+height LLRect& value = getValue(); - left.set(value.mLeft, false); - right.set(value.mRight, false); - bottom.set(value.mBottom, false); - top.set(value.mTop, false); - width.set(value.getWidth(), false); - height.set(value.getHeight(), false); + + left.set(value.mLeft, make_block_authoritative); + width.set(value.getWidth(), make_block_authoritative); + + bottom.set(value.mBottom, make_block_authoritative); + height.set(value.getHeight(), make_block_authoritative); } ParamValue<LLCoordGL, TypeValues<LLCoordGL> >::ParamValue(const LLCoordGL& coord) @@ -2269,7 +2269,7 @@ namespace LLInitParam x("x"), y("y") { - updateBlockFromValue(); + updateBlockFromValue(false); } void ParamValue<LLCoordGL, TypeValues<LLCoordGL> >::updateValueFromBlock() @@ -2277,10 +2277,10 @@ namespace LLInitParam updateValue(LLCoordGL(x, y)); } - void ParamValue<LLCoordGL, TypeValues<LLCoordGL> >::updateBlockFromValue() + void ParamValue<LLCoordGL, TypeValues<LLCoordGL> >::updateBlockFromValue(bool make_block_authoritative) { - x.set(getValue().mX, false); - y.set(getValue().mY, false); + x.set(getValue().mX, make_block_authoritative); + y.set(getValue().mY, make_block_authoritative); } diff --git a/indra/llui/llui.h b/indra/llui/llui.h index a04b232a28..7801a01ace 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -410,7 +410,7 @@ namespace LLInitParam ParamValue(const LLRect& value); void updateValueFromBlock(); - void updateBlockFromValue(); + void updateBlockFromValue(bool make_block_authoritative); }; template<> @@ -428,7 +428,7 @@ namespace LLInitParam ParamValue(const LLUIColor& color); void updateValueFromBlock(); - void updateBlockFromValue(); + void updateBlockFromValue(bool make_block_authoritative); }; template<> @@ -443,7 +443,7 @@ namespace LLInitParam ParamValue(const LLFontGL* value); void updateValueFromBlock(); - void updateBlockFromValue(); + void updateBlockFromValue(bool make_block_authoritative); }; template<> @@ -482,7 +482,7 @@ namespace LLInitParam ParamValue(const LLCoordGL& val); void updateValueFromBlock(); - void updateBlockFromValue(); + void updateBlockFromValue(bool make_block_authoritative); }; } diff --git a/indra/llui/lluiimage.cpp b/indra/llui/lluiimage.cpp index f37947a50b..1d9ce29ba9 100644 --- a/indra/llui/lluiimage.cpp +++ b/indra/llui/lluiimage.cpp @@ -172,15 +172,15 @@ namespace LLInitParam } } - void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateBlockFromValue() + void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateBlockFromValue(bool make_block_authoritative) { if (getValue() == NULL) { - name.set("none", false); + name.set("none", make_block_authoritative); } else { - name.set(getValue()->getName(), false); + name.set(getValue()->getName(), make_block_authoritative); } } diff --git a/indra/llui/lluiimage.h b/indra/llui/lluiimage.h index 139d88e0ac..f07e8fa746 100644 --- a/indra/llui/lluiimage.h +++ b/indra/llui/lluiimage.h @@ -103,12 +103,12 @@ namespace LLInitParam ParamValue(LLUIImage* const& image) : super_t(image) { - updateBlockFromValue(); + updateBlockFromValue(false); addSynonym(name, "name"); } void updateValueFromBlock(); - void updateBlockFromValue(); + void updateBlockFromValue(bool make_block_authoritative); }; // Need custom comparison function for our test app, which only loads diff --git a/indra/llui/tests/llurlentry_stub.cpp b/indra/llui/tests/llurlentry_stub.cpp index 26b3b17577..d522123260 100644 --- a/indra/llui/tests/llurlentry_stub.cpp +++ b/indra/llui/tests/llurlentry_stub.cpp @@ -137,7 +137,7 @@ namespace LLInitParam void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateValueFromBlock() {} - void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateBlockFromValue() + void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateBlockFromValue(bool) {} bool ParamCompare<const LLFontGL*, false>::equals(const LLFontGL* a, const LLFontGL* b) @@ -152,7 +152,7 @@ namespace LLInitParam void ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::updateValueFromBlock() {} - void ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::updateBlockFromValue() + void ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::updateBlockFromValue(bool) {} void TypeValues<LLFontGL::HAlign>::declareValues() @@ -167,7 +167,7 @@ namespace LLInitParam void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateValueFromBlock() {} - void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateBlockFromValue() + void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateBlockFromValue(bool) {} diff --git a/indra/llui/tests/llurlmatch_test.cpp b/indra/llui/tests/llurlmatch_test.cpp index 3cd61e574e..fb6a2eabf1 100644 --- a/indra/llui/tests/llurlmatch_test.cpp +++ b/indra/llui/tests/llurlmatch_test.cpp @@ -111,7 +111,7 @@ namespace LLInitParam void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateValueFromBlock() {} - void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateBlockFromValue() + void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateBlockFromValue(bool) {} bool ParamCompare<const LLFontGL*, false>::equals(const LLFontGL* a, const LLFontGL* b) @@ -127,7 +127,7 @@ namespace LLInitParam void ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::updateValueFromBlock() {} - void ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::updateBlockFromValue() + void ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::updateBlockFromValue(bool) {} void TypeValues<LLFontGL::HAlign>::declareValues() @@ -142,7 +142,7 @@ namespace LLInitParam void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateValueFromBlock() {} - void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateBlockFromValue() + void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateBlockFromValue(bool) {} bool ParamCompare<LLUIImage*, false>::equals( diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index 35c889b69f..194ef8af6a 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -740,7 +740,6 @@ namespace LLInitParam if (src_typed_param.isProvided() && (overwrite || !dst_typed_param.isProvided())) { - dst_typed_param.clearValueName(); dst_typed_param.set(src_typed_param.getValue()); return true; } @@ -1744,39 +1743,35 @@ namespace LLInitParam : mValue(value), mValueAge(VALUE_AUTHORITATIVE), mKeyVersion(0), - mValidatedVersion(-1) + mValidatedVersion(-1), + mValidated(false) {} bool deserializeBlock(Parser& parser, Parser::name_stack_range_t name_stack, S32 generation) { derived_t& typed_param = static_cast<derived_t&>(*this); - // type to apply parse direct value T + // try to parse direct value T if (name_stack.first == name_stack.second) { if(parser.readValue(typed_param.mValue)) { - typed_param.clearValueName(); typed_param.mValueAge = VALUE_AUTHORITATIVE; - typed_param.updateBlockFromValue(); + typed_param.updateBlockFromValue(false); + + typed_param.clearValueName(); return true; } } // fall back on parsing block components for T - // if we deserialized at least one component... - if (typed_param.BaseBlock::deserializeBlock(parser, name_stack, generation)) - { - return true; - } - - return false; + return typed_param.BaseBlock::deserializeBlock(parser, name_stack, generation); } void serializeBlock(Parser& parser, Parser::name_stack_t name_stack = Parser::name_stack_t(), const BaseBlock* diff_block = NULL) const { - const self_t& typed_param = static_cast<const self_t&>(*this); - const self_t* diff_param = static_cast<const self_t*>(diff_block); + const derived_t& typed_param = static_cast<const derived_t&>(*this); + const derived_t* diff_param = static_cast<const derived_t*>(diff_block); std::string key = typed_param.getValueName(); @@ -1801,7 +1796,20 @@ namespace LLInitParam // be exported as <color green="1"/>, since it was probably the intent of the user to // be specific about the RGB color values. This also fixes an issue where we distinguish // between rect.left not being provided and rect.left being explicitly set to 0 (same as default) - block_t::serializeBlock(parser, name_stack, NULL); + + if (typed_param.mValueAge == VALUE_AUTHORITATIVE) + { + // if the value is authoritative but the parser doesn't accept the value type + // go ahead and make a copy, and splat the value out to its component params + // and serialize those params + derived_t copy(typed_param); + copy.updateBlockFromValue(true); + copy.block_t::serializeBlock(parser, name_stack, NULL); + } + else + { + block_t::serializeBlock(parser, name_stack, NULL); + } } } } @@ -1850,7 +1858,7 @@ namespace LLInitParam { BaseBlock::paramChanged(changed_param, user_provided); if (user_provided) - { + { // a parameter changed, so our value is out of date mValueAge = VALUE_NEEDS_UPDATE; } @@ -1863,7 +1871,7 @@ namespace LLInitParam mValueAge = VALUE_AUTHORITATIVE; mValue = val; typed_param.clearValueName(); - static_cast<derived_t*>(const_cast<self_t*>(this))->updateBlockFromValue(); + static_cast<derived_t*>(this)->updateBlockFromValue(false); } value_assignment_t getValue() const @@ -1918,7 +1926,6 @@ namespace LLInitParam mutable bool mValidated; // lazy validation flag private: - mutable T mValue; mutable EValueAge mValueAge; }; diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 648ef9ebbc..954af8c84a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -16,8 +16,10 @@ <key>AFKTimeout</key> <map> <key>Comment</key> - <string>Time before automatically setting AFK (away from keyboard) mode (seconds, 0=never). - Valid values are: 0, 120, 300, 600, 1800</string> + <string> + Time before automatically setting AFK (away from keyboard) mode (seconds, 0=never). + Valid values are: 0, 120, 300, 600, 1800 +</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -4444,17 +4446,6 @@ <key>Value</key> <real>2.0</real> </map> - <key>LastInventoryInboxExpand</key> - <map> - <key>Comment</key> - <string>The last time the received items inbox was expanded.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>String</string> - <key>Value</key> - <string /> - </map> <key>LCDDestination</key> <map> <key>Comment</key> @@ -6054,10 +6045,12 @@ <key>ToastButtonWidth</key> <map> <key>Comment</key> - <string>Default width of buttons in the toast. + <string> + Default width of buttons in the toast. Notes: If required width will be less then this one, a button will be reshaped to default size , otherwise to required - Change of this parameter will affect the layout of buttons in notification toast.</string> + Change of this parameter will affect the layout of buttons in notification toast. +</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -6599,7 +6592,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <string>0</string> + <integer>0</integer> </map> <key>PrecachingDelay</key> <map> @@ -7349,8 +7342,10 @@ <key>RenderPerformanceTest</key> <map> <key>Comment</key> - <string>Disable rendering of everything but in-world content for - performance testing</string> + <string> + Disable rendering of everything but in-world content for + performance testing +</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -13414,9 +13409,9 @@ <integer>650</integer> <integer>490</integer> <integer>0</integer> - </array> - </map> - <key>HelpFloaterOpen</key> + </array> + </map> + <key>HelpFloaterOpen</key> <map> <key>Comment</key> <string>Show Help Floater on login?</string> diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index ff24efaf2c..1142f01232 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -33,6 +33,17 @@ <key>Value</key> <string /> </map> + <key>LastInventoryInboxExpand</key> + <map> + <key>Comment</key> + <string>The last time the received items inbox was expanded.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string /> + </map> <key>LastLogoff</key> <map> <key>Comment</key> diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 8344b08bfb..5ccd5ff073 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -316,7 +316,12 @@ static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarNa // PROFILES: open in webkit window const bool show_chrome = false; static LLCachedControl<LLRect> profile_rect(gSavedSettings, "WebProfileRect"); - LLFloaterWebContent::create(url, "", agent_id.asString(), show_chrome, profile_rect); + LLFloaterWebContent::create(LLFloaterWebContent::Params(). + url(url). + id(agent_id). + show_chrome(show_chrome). + window_class("profile"). + preferred_media_size(profile_rect)); } // static @@ -331,7 +336,9 @@ void LLAvatarActions::showProfile(const LLUUID& id) //static bool LLAvatarActions::profileVisible(const LLUUID& id) { - LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("web_content", id.asString())); + LLSD sd; + sd["id"] = id; + LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("web_content", sd)); return browser && browser->isShown(); } @@ -339,7 +346,9 @@ bool LLAvatarActions::profileVisible(const LLUUID& id) //static void LLAvatarActions::hideProfile(const LLUUID& id) { - LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("web_content", id.asString())); + LLSD sd; + sd["id"] = id; + LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("web_content", sd)); if (browser) { browser->closeFloater(); diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index dd12fa64d3..3f00ba39c7 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -887,18 +887,14 @@ void LLFloaterProperties::dirtyAll() LLMultiProperties::LLMultiProperties() : LLMultiFloater(LLSD()) { - // *TODO: There should be a .xml file for this - const LLRect& nextrect = LLFloaterReg::getFloaterRect("properties"); // place where the next properties should show up - if (nextrect.getWidth() > 0) - { - setRect(nextrect); - } - else - { - // start with a small rect in the top-left corner ; will get resized - LLRect rect; - rect.setLeftTopAndSize(0, gViewerWindow->getWindowHeightScaled(), 20, 20); - setRect(rect); + // start with a small rect in the top-left corner ; will get resized + LLRect rect; + rect.setLeftTopAndSize(0, gViewerWindow->getWindowHeightScaled(), 20, 20); + setRect(rect); + LLFloater* last_floater = LLFloaterReg::getLastFloaterInGroup("properties"); + if (last_floater) + { + stackWith(*last_floater); } setTitle(LLTrans::getString("MultiPropertiesTitle")); buildTabContainer(); diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index d5806e375c..ce0bba802d 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -70,21 +70,28 @@ public: } // create the LLSD arguments for the search floater - LLSD args; - args["category"] = category; - args["id"] = LLURI::unescape(search_text); + LLFloaterSearch::Params p; + p.category = category; + p.query = LLURI::unescape(search_text); // open the search floater and perform the requested search - LLFloaterReg::showInstance("search", args); + LLFloaterReg::showInstance("search", p); return true; } }; LLSearchHandler gSearchHandler; -LLFloaterSearch::LLFloaterSearch(const LLSD& key) : - LLFloater(key), - LLViewerMediaObserver(), - mBrowser(NULL), +LLFloaterSearch::_Params::_Params() +: category("category", ""), + query("query") +{ + trusted_content = true; + allow_address_entry = false; +} + + +LLFloaterSearch::LLFloaterSearch(const Params& key) : + LLFloaterWebContent(key), mSearchGodLevel(0) { // declare a map that transforms a category name into @@ -102,53 +109,43 @@ LLFloaterSearch::LLFloaterSearch(const LLSD& key) : BOOL LLFloaterSearch::postBuild() { - mBrowser = getChild<LLMediaCtrl>("browser"); - mBrowser->addObserver(this); + LLFloaterWebContent::postBuild(); + mWebBrowser->addObserver(this); return TRUE; } void LLFloaterSearch::onOpen(const LLSD& key) { + LLFloaterWebContent::onOpen(key); search(key); } void LLFloaterSearch::onClose(bool app_quitting) { + LLFloaterWebContent::onClose(app_quitting); // tear down the web view so we don't show the previous search // result when the floater is opened next time destroy(); } -void LLFloaterSearch::handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event) -{ - switch (event) - { - case MEDIA_EVENT_NAVIGATE_BEGIN: - getChild<LLUICtrl>("status_text")->setValue(getString("loading_text")); - break; - - case MEDIA_EVENT_NAVIGATE_COMPLETE: - getChild<LLUICtrl>("status_text")->setValue(getString("done_text")); - break; - - default: - break; - } -} - void LLFloaterSearch::godLevelChanged(U8 godlevel) { // search results can change based upon god level - if the user // changes god level, then give them a warning (we don't refresh // the search as this might undo any page navigation or // AJAX-driven changes since the last search). - getChildView("refresh_search")->setVisible( (godlevel != mSearchGodLevel)); + + //FIXME: set status bar text + + //getChildView("refresh_search")->setVisible( (godlevel != mSearchGodLevel)); } void LLFloaterSearch::search(const LLSD &key) { - if (! mBrowser) + Params p(key); + + if (! mWebBrowser || !p.validateBlock()) { return; } @@ -159,10 +156,9 @@ void LLFloaterSearch::search(const LLSD &key) // work out the subdir to use based on the requested category LLSD subs; - std::string category = key.has("category") ? key["category"].asString() : ""; - if (mCategoryPaths.has(category)) + if (mCategoryPaths.has(p.category)) { - subs["CATEGORY"] = mCategoryPaths[category].asString(); + subs["CATEGORY"] = mCategoryPaths[p.category].asString(); } else { @@ -170,8 +166,7 @@ void LLFloaterSearch::search(const LLSD &key) } // add the search query string - std::string search_text = key.has("id") ? key["id"].asString() : ""; - subs["QUERY"] = LLURI::escape(search_text); + subs["QUERY"] = LLURI::escape(p.query); // add the permissions token that login.cgi gave us // We use "search_token", and fallback to "auth_token" if not present. @@ -207,5 +202,5 @@ void LLFloaterSearch::search(const LLSD &key) url = LLWeb::expandURLSubstitutions(url, subs); // and load the URL in the web view - mBrowser->navigateTo(url, "text/html"); + mWebBrowser->navigateTo(url, "text/html"); } diff --git a/indra/newview/llfloatersearch.h b/indra/newview/llfloatersearch.h index ba4dc4c0fa..a4043b2353 100644 --- a/indra/newview/llfloatersearch.h +++ b/indra/newview/llfloatersearch.h @@ -28,7 +28,7 @@ #ifndef LL_LLFLOATERSEARCH_H #define LL_LLFLOATERSEARCH_H -#include "llfloater.h" +#include "llfloaterwebcontent.h" #include "llviewermediaobserver.h" #include <string> @@ -43,11 +43,20 @@ class LLMediaCtrl; /// so that the user can click on teleport links in search results. /// class LLFloaterSearch : - public LLFloater, - public LLViewerMediaObserver + public LLFloaterWebContent { public: - LLFloaterSearch(const LLSD& key); + struct _Params : public LLInitParam::Block<_Params, LLFloaterWebContent::Params> + { + Optional<std::string> category; + Optional<std::string> query; + + _Params(); + }; + + typedef LLSDParamAdapter<_Params> Params; + + LLFloaterSearch(const Params& key); /// show the search floater with a new search /// see search() for details on the key parameter. @@ -70,10 +79,6 @@ public: private: /*virtual*/ BOOL postBuild(); - // inherited from LLViewerMediaObserver - /*virtual*/ void handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event); - - LLMediaCtrl *mBrowser; LLSD mCategoryPaths; U8 mSearchGodLevel; }; diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 43eecbf048..8aeb5675a5 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -40,8 +40,21 @@ #include "llfloaterwebcontent.h" -LLFloaterWebContent::LLFloaterWebContent( const LLSD& key ) - : LLFloater( key ) +LLFloaterWebContent::_Params::_Params() +: url("url"), + target("target"), + id("id"), + window_class("window_class", "web_content"), + show_chrome("show_chrome", true), + allow_address_entry("allow_address_entry", true), + preferred_media_size("preferred_media_size"), + trusted_content("trusted_content", false) +{} + +LLFloaterWebContent::LLFloaterWebContent( const Params& params ) +: LLFloater( params ), + LLInstanceTracker(params.id()), + mUUID(params.id().asString()) { mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this )); mCommitCallbackRegistrar.add( "WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this )); @@ -54,9 +67,9 @@ LLFloaterWebContent::LLFloaterWebContent( const LLSD& key ) BOOL LLFloaterWebContent::postBuild() { // these are used in a bunch of places so cache them - mWebBrowser = getChild< LLMediaCtrl >( "webbrowser" ); - mAddressCombo = getChild< LLComboBox >( "address" ); - mStatusBarText = getChild< LLTextBox >( "statusbartext" ); + mWebBrowser = getChild< LLMediaCtrl >( "webbrowser" ); + mAddressCombo = getChild< LLComboBox >( "address" ); + mStatusBarText = getChild< LLTextBox >( "statusbartext" ); mStatusBarProgress = getChild<LLProgressBar>("statusbarprogress" ); // observe browser events @@ -75,6 +88,20 @@ BOOL LLFloaterWebContent::postBuild() return TRUE; } +bool LLFloaterWebContent::matchesKey(const LLSD& key) +{ + LLUUID id = key["id"]; + if (id.notNull()) + { + return id == mKey["id"].asUUID(); + } + else + { + return key["target"].asString() == mKey["target"].asString(); + } +} + + void LLFloaterWebContent::initializeURLHistory() { // start with an empty list @@ -86,10 +113,8 @@ void LLFloaterWebContent::initializeURLHistory() // Get all of the entries in the "browser" collection LLSD browser_history = LLURLHistory::getURLHistory("browser"); - LLSD::array_iterator iter_history = - browser_history.beginArray(); - LLSD::array_iterator end_history = - browser_history.endArray(); + LLSD::array_iterator iter_history = browser_history.beginArray(); + LLSD::array_iterator end_history = browser_history.endArray(); for(; iter_history != end_history; ++iter_history) { std::string url = (*iter_history).asString(); @@ -99,30 +124,25 @@ void LLFloaterWebContent::initializeURLHistory() } //static -void LLFloaterWebContent::create( const std::string &url, const std::string& target, const std::string& uuid, bool show_chrome, const LLRect& preferred_media_size) +LLFloater* LLFloaterWebContent::create( Params p) { - lldebugs << "url = " << url << ", target = " << target << ", uuid = " << uuid << llendl; + lldebugs << "url = " << p.url() << ", target = " << p.target() << ", uuid = " << p.id().asString() << llendl; - std::string tag = target; + if (!p.id.isProvided()) + { + p.id = LLUUID::generateNewID(); + } - if(target.empty() || target == "_blank") + if(!p.target.isProvided() || p.target() == "_blank") { - if(!uuid.empty()) - { - tag = uuid; - } - else - { - // create a unique tag for this instance - LLUUID id; - id.generate(); - tag = id.asString(); - } + p.target = p.id().asString(); } S32 browser_window_limit = gSavedSettings.getS32("WebContentWindowLimit"); - if(LLFloaterReg::findInstance("web_content", tag) != NULL) + LLSD sd; + sd["target"] = p.target; + if(LLFloaterReg::findInstance(p.window_class, sd) != NULL) { // There's already a web browser for this tag, so we won't be opening a new window. } @@ -131,12 +151,12 @@ void LLFloaterWebContent::create( const std::string &url, const std::string& tar // showInstance will open a new window. Figure out how many web browsers are already open, // and close the least recently opened one if this will put us over the limit. - LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList("web_content"); + LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList(p.window_class); lldebugs << "total instance count is " << instances.size() << llendl; for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++) { - lldebugs << " " << (*iter)->getKey() << llendl; + lldebugs << " " << (*iter)->getKey()["target"] << llendl; } if(instances.size() >= (size_t)browser_window_limit) @@ -146,63 +166,26 @@ void LLFloaterWebContent::create( const std::string &url, const std::string& tar } } - LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::showInstance("web_content", tag)); - llassert(browser); - if(browser) - { - browser->mUUID = uuid; - - // tell the browser instance to load the specified URL - browser->open_media(url, target); - LLViewerMedia::proxyWindowOpened(target, uuid); - - browser->getChild<LLLayoutPanel>("status_bar")->setVisible(show_chrome); - browser->getChild<LLLayoutPanel>("nav_controls")->setVisible(show_chrome); - - if (!show_chrome) - { - browser->setResizeLimits(100, 100); - } - - if (!preferred_media_size.isEmpty()) - { - //ignore x, y for now - browser->geometryChanged(browser->getRect().mLeft, browser->getRect().mBottom, preferred_media_size.getWidth(), preferred_media_size.getHeight()); - } - } + return LLFloaterReg::showInstance(p.window_class, p); } //static void LLFloaterWebContent::closeRequest(const std::string &uuid) { - LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("web_content"); - lldebugs << "instance list size is " << inst_list.size() << ", incoming uuid is " << uuid << llendl; - for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) + LLFloaterWebContent* floaterp = getInstance(LLUUID(uuid)); + if (floaterp) { - LLFloaterWebContent* i = dynamic_cast<LLFloaterWebContent*>(*iter); - lldebugs << " " << i->mUUID << llendl; - if (i && i->mUUID == uuid) - { - i->closeFloater(false); - return; - } - } + floaterp->closeFloater(false); + } } //static void LLFloaterWebContent::geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height) { - LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("web_content"); - lldebugs << "instance list size is " << inst_list.size() << ", incoming uuid is " << uuid << llendl; - for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) + LLFloaterWebContent* floaterp = getInstance(LLUUID(uuid)); + if (floaterp) { - LLFloaterWebContent* i = dynamic_cast<LLFloaterWebContent*>(*iter); - lldebugs << " " << i->mUUID << llendl; - if (i && i->mUUID == uuid) - { - i->geometryChanged(x, y, width, height); - return; - } + floaterp->geometryChanged(x, y, width, height); } } @@ -216,24 +199,68 @@ void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height) getWindow()->getSize(&window_size); // Adjust width and height for the size of the chrome on the web Browser window. - width += getRect().getWidth() - mWebBrowser->getRect().getWidth(); - height += getRect().getHeight() - mWebBrowser->getRect().getHeight(); + LLRect browser_rect; + mWebBrowser->localRectToOtherView(mWebBrowser->getLocalRect(), &browser_rect, this); + S32 requested_browser_bottom = window_size.mY - (y + height); LLRect geom; - geom.setOriginAndSize(x, window_size.mY - (y + height), width, height); + geom.setOriginAndSize(x - browser_rect.mLeft, + requested_browser_bottom - browser_rect.mBottom, + width + getRect().getWidth() - browser_rect.getWidth(), + height + getRect().getHeight() - browser_rect.getHeight()); lldebugs << "geometry change: " << geom << llendl; - - setShape(geom); + + LLRect new_rect; + getParent()->screenRectToLocal(geom, &new_rect); + setShape(new_rect); } -void LLFloaterWebContent::open_media(const std::string& web_url, const std::string& target) +void LLFloaterWebContent::open_media(const Params& p) { // Specifying a mime type of text/html here causes the plugin system to skip the MIME type probe and just open a browser plugin. - mWebBrowser->setHomePageUrl(web_url, "text/html"); - mWebBrowser->setTarget(target); - mWebBrowser->navigateTo(web_url, "text/html"); - set_current_url(web_url); + LLViewerMedia::proxyWindowOpened(p.target(), p.id().asString()); + mWebBrowser->setHomePageUrl(p.url, "text/html"); + mWebBrowser->setTarget(p.target); + mWebBrowser->navigateTo(p.url, "text/html"); + + set_current_url(p.url); + + getChild<LLLayoutPanel>("status_bar")->setVisible(p.show_chrome); + getChild<LLLayoutPanel>("nav_controls")->setVisible(p.show_chrome); + getChild<LLUICtrl>("address")->setEnabled(p.allow_address_entry && !p.trusted_content); + + if (!p.show_chrome) + { + setResizeLimits(100, 100); + } + + if (!p.preferred_media_size().isEmpty()) + { + LLLayoutStack::updateClass(); + LLRect browser_rect = mWebBrowser->calcScreenRect(); + LLCoordWindow window_size; + getWindow()->getSize(&window_size); + + geometryChanged(browser_rect.mLeft, window_size.mY - browser_rect.mTop, p.preferred_media_size().getWidth(), p.preferred_media_size().getHeight()); + } + +} + +void LLFloaterWebContent::onOpen(const LLSD& key) +{ + Params params(key); + + if (!params.validateBlock()) + { + closeFloater(); + return; + } + + mWebBrowser->setTrustedContent(params.trusted_content); + + // tell the browser instance to load the specified URL + open_media(params); } //virtual @@ -246,7 +273,7 @@ void LLFloaterWebContent::onClose(bool app_quitting) // virtual void LLFloaterWebContent::draw() { - // this is asychronous so we need to keep checking + // this is asynchronous so we need to keep checking getChildView( "back" )->setEnabled( mWebBrowser->canNavigateBack() ); getChildView( "forward" )->setEnabled( mWebBrowser->canNavigateForward() ); @@ -388,7 +415,7 @@ void LLFloaterWebContent::onClickStop() // still should happen when we catch the navigate complete event // but sometimes (don't know why) that event isn't sent from Qt - // and we getto a point where the stop button stays active. + // and we ghetto a point where the stop button stays active. getChildView("reload")->setVisible( true ); getChildView("stop")->setVisible( false ); } diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index 56b6ef12c8..2e3c6ffd84 100644 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -29,6 +29,7 @@ #include "llfloater.h" #include "llmediactrl.h" +#include "llsdparam.h" class LLMediaCtrl; class LLComboBox; @@ -38,24 +39,45 @@ class LLIconCtrl; class LLFloaterWebContent : public LLFloater, - public LLViewerMediaObserver + public LLViewerMediaObserver, + public LLInstanceTracker<LLFloaterWebContent, LLUUID> { public: LOG_CLASS(LLFloaterWebContent); - LLFloaterWebContent(const LLSD& key); + + struct _Params : public LLInitParam::Block<_Params> + { + Optional<std::string> url, + target, + window_class; + Optional<LLUUID> id; + Optional<bool> show_chrome, + allow_address_entry, + trusted_content; + Optional<LLRect> preferred_media_size; + + _Params(); + }; + + typedef LLSDParamAdapter<_Params> Params; + + LLFloaterWebContent(const Params& params); void initializeURLHistory(); - static void create(const std::string &url, const std::string& target, const std::string& uuid = LLStringUtil::null, bool show_chrome = true, const LLRect& preferred_media_size = LLRect() ); + static LLFloater* create(Params); static void closeRequest(const std::string &uuid); static void geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height); void geometryChanged(S32 x, S32 y, S32 width, S32 height); /* virtual */ BOOL postBuild(); + /* virtual */ void onOpen(const LLSD& key); + /* virtual */ bool matchesKey(const LLSD& key); /* virtual */ void onClose(bool app_quitting); /* virtual */ void draw(); +protected: // inherited from LLViewerMediaObserver /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); @@ -66,8 +88,7 @@ public: void onEnterAddress(); void onPopExternal(); -private: - void open_media(const std::string& media_url, const std::string& target); + void open_media(const Params& ); void set_current_url(const std::string& url); LLMediaCtrl* mWebBrowser; diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index e90b6c1c3d..7581fa91c5 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -402,6 +402,16 @@ static LLFastTimer::DeclareTimer FTM_ARRANGE("Arrange"); // This view grows and shinks to enclose all of its children items and folders. S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_generation ) { + if (getListener()->getUUID().notNull()) + { + if (mNeedsSort) + { + mFolders.sort(mSortFunction); + mItems.sort(mSortFunction); + mNeedsSort = false; + } + } + LLFastTimer t2(FTM_ARRANGE); filter_generation = mFilter->getMinRequiredGeneration(); @@ -1916,8 +1926,8 @@ BOOL LLFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, } else { - handled = mFolders.front()->handleDragAndDropFromChild(mask,drop,cargo_type,cargo_data,accept,tooltip_msg); - } + handled = mFolders.front()->handleDragAndDropFromChild(mask,drop,cargo_type,cargo_data,accept,tooltip_msg); + } } if (handled) diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 6e4f55fb2f..e2b7c45eab 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -286,7 +286,7 @@ void LLFolderViewItem::refreshFromListener() time_t creation_date = mListener->getCreationDate(); if (mCreationDate != creation_date) { - mCreationDate = mListener->getCreationDate(); + setCreationDate(mListener->getCreationDate()); dirtyFilter(); } if (mRoot->useLabelSuffix()) @@ -2430,7 +2430,7 @@ time_t LLFolderViewFolder::getCreationDate() const if (item_creation_date) { - mCreationDate = item_creation_date; + setCreationDate(item_creation_date); break; } } @@ -2446,7 +2446,7 @@ time_t LLFolderViewFolder::getCreationDate() const if (folder_creation_date) { - mCreationDate = folder_creation_date; + setCreationDate(folder_creation_date); break; } } diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index e2f94a2b63..f70e63ecdf 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -173,6 +173,8 @@ protected: static LLFontGL* getLabelFontForStyle(U8 style); + virtual void setCreationDate(time_t creation_date_utc) const { mCreationDate = creation_date_utc; } + public: BOOL postBuild(); @@ -228,7 +230,7 @@ public: void deselectItem(); // this method is used to select this element - void selectItem(); + virtual void selectItem(); // gets multiple-element selection virtual std::set<LLUUID> getSelectionList() const; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 9f093b8a34..ff328fd071 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2483,8 +2483,6 @@ void LLFolderBridge::staticFolderOptionsMenu() void LLFolderBridge::folderOptionsMenu() { - menuentry_vec_t disabled_items; - LLInventoryModel* model = getInventoryModel(); if(!model) return; @@ -2516,7 +2514,7 @@ void LLFolderBridge::folderOptionsMenu() if (!isItemRemovable()) { - disabled_items.push_back(std::string("Delete")); + mDisabledItems.push_back(std::string("Delete")); } #ifndef LL_RELEASE_FOR_DOWNLOAD @@ -2557,18 +2555,18 @@ void LLFolderBridge::folderOptionsMenu() mItems.push_back(std::string("Remove From Outfit")); if (!LLAppearanceMgr::getCanRemoveFromCOF(mUUID)) { - disabled_items.push_back(std::string("Remove From Outfit")); + mDisabledItems.push_back(std::string("Remove From Outfit")); } if (!LLAppearanceMgr::instance().getCanReplaceCOF(mUUID)) { - disabled_items.push_back(std::string("Replace Outfit")); + mDisabledItems.push_back(std::string("Replace Outfit")); } mItems.push_back(std::string("Outfit Separator")); } LLMenuGL* menup = dynamic_cast<LLMenuGL*>(mMenu.get()); if (menup) { - hide_context_entries(*menup, mItems, disabled_items, TRUE); + hide_context_entries(*menup, mItems, mDisabledItems, TRUE); // Reposition the menu, in case we're adding items to an existing menu. menup->needsArrange(); diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 21d5de9a5b..50b5a2a5e5 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2168,6 +2168,9 @@ void LLInventoryModel::registerCallbacks(LLMessageSystem* msg) msg->setHandlerFuncFast(_PREHASH_RemoveInventoryFolder, processRemoveInventoryFolder, NULL); + msg->setHandlerFuncFast(_PREHASH_RemoveInventoryObjects, + processRemoveInventoryObjects, + NULL); //msg->setHandlerFuncFast(_PREHASH_ExchangeCallingCard, // processExchangeCallingcard, // NULL); @@ -2284,17 +2287,9 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account) } // static -void LLInventoryModel::processRemoveInventoryItem(LLMessageSystem* msg, void**) +void LLInventoryModel::removeInventoryItem(LLUUID agent_id, LLMessageSystem* msg) { - lldebugs << "LLInventoryModel::processRemoveInventoryItem()" << llendl; - LLUUID agent_id, item_id; - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); - if(agent_id != gAgent.getID()) - { - llwarns << "Got a RemoveInventoryItem for the wrong agent." - << llendl; - return; - } + LLUUID item_id; S32 count = msg->getNumberOfBlocksFast(_PREHASH_InventoryData); uuid_vec_t item_ids; update_map_t update; @@ -2316,6 +2311,21 @@ void LLInventoryModel::processRemoveInventoryItem(LLMessageSystem* msg, void**) { gInventory.deleteObject(*it); } +} + +// static +void LLInventoryModel::processRemoveInventoryItem(LLMessageSystem* msg, void**) +{ + lldebugs << "LLInventoryModel::processRemoveInventoryItem()" << llendl; + LLUUID agent_id, item_id; + msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); + if(agent_id != gAgent.getID()) + { + llwarns << "Got a RemoveInventoryItem for the wrong agent." + << llendl; + return; + } + LLInventoryModel::removeInventoryItem(agent_id, msg); gInventory.notifyObservers(); } @@ -2380,18 +2390,10 @@ void LLInventoryModel::processUpdateInventoryFolder(LLMessageSystem* msg, } // static -void LLInventoryModel::processRemoveInventoryFolder(LLMessageSystem* msg, - void**) +void LLInventoryModel::removeInventoryFolder(LLUUID agent_id, + LLMessageSystem* msg) { - lldebugs << "LLInventoryModel::processRemoveInventoryFolder()" << llendl; - LLUUID agent_id, folder_id; - msg->getUUIDFast(_PREHASH_FolderData, _PREHASH_AgentID, agent_id); - if(agent_id != gAgent.getID()) - { - llwarns << "Got a RemoveInventoryFolder for the wrong agent." - << llendl; - return; - } + LLUUID folder_id; uuid_vec_t folder_ids; update_map_t update; S32 count = msg->getNumberOfBlocksFast(_PREHASH_FolderData); @@ -2410,6 +2412,42 @@ void LLInventoryModel::processRemoveInventoryFolder(LLMessageSystem* msg, { gInventory.deleteObject(*it); } +} + +// static +void LLInventoryModel::processRemoveInventoryFolder(LLMessageSystem* msg, + void**) +{ + lldebugs << "LLInventoryModel::processRemoveInventoryFolder()" << llendl; + LLUUID agent_id, session_id; + msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); + msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_SessionID, session_id); + if(agent_id != gAgent.getID()) + { + llwarns << "Got a RemoveInventoryFolder for the wrong agent." + << llendl; + return; + } + LLInventoryModel::removeInventoryFolder( agent_id, msg ); + gInventory.notifyObservers(); +} + +// static +void LLInventoryModel::processRemoveInventoryObjects(LLMessageSystem* msg, + void**) +{ + lldebugs << "LLInventoryModel::processRemoveInventoryObjects()" << llendl; + LLUUID agent_id, session_id; + msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); + msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_SessionID, session_id); + if(agent_id != gAgent.getID()) + { + llwarns << "Got a RemoveInventoryObjects for the wrong agent." + << llendl; + return; + } + LLInventoryModel::removeInventoryFolder( agent_id, msg ); + LLInventoryModel::removeInventoryItem( agent_id, msg ); gInventory.notifyObservers(); } diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 15da09990f..c3775ac088 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -492,9 +492,12 @@ protected: //-------------------------------------------------------------------- public: static void processUpdateCreateInventoryItem(LLMessageSystem* msg, void**); + static void removeInventoryItem(LLUUID agent_id, LLMessageSystem* msg); static void processRemoveInventoryItem(LLMessageSystem* msg, void**); static void processUpdateInventoryFolder(LLMessageSystem* msg, void**); + static void removeInventoryFolder(LLUUID agent_id, LLMessageSystem* msg); static void processRemoveInventoryFolder(LLMessageSystem* msg, void**); + static void processRemoveInventoryObjects(LLMessageSystem* msg, void**); static void processSaveAssetIntoInventory(LLMessageSystem* msg, void**); static void processBulkUpdateInventory(LLMessageSystem* msg, void**); static void processInventoryDescendents(LLMessageSystem* msg, void**); diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index afaf660cb7..91fdd67806 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -105,7 +105,7 @@ BOOL LLInventoryModelBackgroundFetch::backgroundFetchActive() const void LLInventoryModelBackgroundFetch::start(const LLUUID& cat_id, BOOL recursive) { - if (!mAllFoldersFetched) + if (!mAllFoldersFetched || cat_id.notNull()) { LL_DEBUGS("InventoryFetch") << "Start fetching category: " << cat_id << ", recursive: " << recursive << LL_ENDL; @@ -211,7 +211,7 @@ void LLInventoryModelBackgroundFetch::backgroundFetch() // Double timeouts on failure. mMinTimeBetweenFetches = llmin(mMinTimeBetweenFetches * 2.f, 10.f); mMaxTimeBetweenFetches = llmin(mMaxTimeBetweenFetches * 2.f, 120.f); - llinfos << "Inventory fetch times grown to (" << mMinTimeBetweenFetches << ", " << mMaxTimeBetweenFetches << ")" << llendl; + lldebugs << "Inventory fetch times grown to (" << mMinTimeBetweenFetches << ", " << mMaxTimeBetweenFetches << ")" << llendl; // fetch is no longer considered "timely" although we will wait for full time-out. mTimelyFetchPending = FALSE; } @@ -280,7 +280,7 @@ void LLInventoryModelBackgroundFetch::backgroundFetch() // Shrink timeouts based on success. mMinTimeBetweenFetches = llmax(mMinTimeBetweenFetches * 0.8f, 0.3f); mMaxTimeBetweenFetches = llmax(mMaxTimeBetweenFetches * 0.8f, 10.f); - //llinfos << "Inventory fetch times shrunk to (" << mMinTimeBetweenFetches << ", " << mMaxTimeBetweenFetches << ")" << llendl; + lldebugs << "Inventory fetch times shrunk to (" << mMinTimeBetweenFetches << ", " << mMaxTimeBetweenFetches << ")" << llendl; } mTimelyFetchPending = FALSE; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 702e8d5a1f..d5d40ca65d 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -902,6 +902,18 @@ void LLInventoryPanel::onFocusReceived() LLPanel::onFocusReceived(); } +bool LLInventoryPanel::addBadge(LLBadge * badge) +{ + bool badge_added = false; + + if (acceptsBadge()) + { + badge_added = badge->addToView(mFolderRoot); + } + + return badge_added; +} + void LLInventoryPanel::openAllFolders() { mFolderRoot->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_DOWN); diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index a4287a438e..7676bbb6d7 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -125,6 +125,9 @@ public: /*virtual*/ void onFocusLost(); /*virtual*/ void onFocusReceived(); + // LLBadgeHolder methods + bool addBadge(LLBadge * badge); + // Call this method to set the selection. void openAllFolders(); void setSelection(const LLUUID& obj_id, BOOL take_keyboard_focus); diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 03ccabc994..1eb786f433 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -1164,3 +1164,12 @@ void LLMediaCtrl::hideNotification() mWindowShade->hide(); } } + +void LLMediaCtrl::setTrustedContent(bool trusted) +{ + mTrusted = trusted; + if (mMediaSource) + { + mMediaSource->setTrustedBrowser(trusted); + } +} diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 28666e620f..0e4a5b1d65 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -149,6 +149,8 @@ public: void showNotification(boost::shared_ptr<class LLNotification> notify); void hideNotification(); + void setTrustedContent(bool trusted); + // over-rides virtual BOOL handleKeyHere( KEY key, MASK mask); virtual void handleVisibilityChange ( BOOL new_visibility ); @@ -164,6 +166,8 @@ public: // Incoming media event dispatcher virtual void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); + LLUUID getTextureID() {return mMediaTextureID;} + protected: void convertInputCoords(S32& x, S32& y); @@ -176,7 +180,7 @@ public: LLViewBorder* mBorder; bool mFrequentUpdates; bool mForceUpdate; - const bool mTrusted; + bool mTrusted; std::string mHomePageUrl; std::string mHomePageMimeType; std::string mCurrentNavUrl; diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index b8832dfd8e..9d54ad7463 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -716,7 +716,7 @@ void LLNavigationBar::handleLoginComplete() void LLNavigationBar::invokeSearch(std::string search_text) { - LLFloaterReg::showInstance("search", LLSD().with("category", "all").with("id", LLSD(search_text))); + LLFloaterReg::showInstance("search", LLSD().with("category", "all").with("query", LLSD(search_text))); } void LLNavigationBar::clearHistoryCache() diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index af74f8f261..c505ad85a3 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -27,15 +27,14 @@ #include "llviewerprecompiledheaders.h"
#include "llpanelmarketplaceinbox.h"
+#include "llpanelmarketplaceinboxinventory.h"
#include "llappviewer.h"
#include "llbutton.h"
#include "llinventorypanel.h"
#include "llfolderview.h"
#include "llsidepanelinventory.h"
-
-
-#define SUPPORTING_FRESH_ITEM_COUNT 0
+#include "llviewercontrol.h"
static LLRegisterPanelClassWrapper<LLPanelMarketplaceInbox> t_panel_marketplace_inbox("panel_marketplace_inbox");
@@ -54,6 +53,10 @@ LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p) LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox()
{
+ if (getChild<LLButton>("inbox_btn")->getToggleState())
+ {
+ gSavedPerAccountSettings.setString("LastInventoryInboxExpand", LLDate::now().asString());
+ }
}
// virtual
@@ -157,10 +160,10 @@ U32 LLPanelMarketplaceInbox::getFreshItemCount() const for (; folders_it != folders_end; ++folders_it)
{
- const LLFolderViewFolder * folder = *folders_it;
+ const LLFolderViewFolder * folder_view = *folders_it;
+ const LLInboxFolderViewFolder * inbox_folder_view = dynamic_cast<const LLInboxFolderViewFolder*>(folder_view);
- // TODO: Replace this check with new "fresh" flag
- if (folder->getCreationDate() > 1500)
+ if (inbox_folder_view && inbox_folder_view->isFresh())
{
fresh_item_count++;
}
diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index b644f0e5cb..2c97d539a1 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -141,9 +141,11 @@ LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge LLInboxFolderViewFolder::LLInboxFolderViewFolder(const Params& p) : LLFolderViewFolder(p) , LLBadgeOwner(getHandle()) - , mFresh(false) + , mFresh(true) { +#if SUPPORTING_FRESH_ITEM_COUNT initBadgeParams(p.new_badge()); +#endif } LLInboxFolderViewFolder::~LLInboxFolderViewFolder() @@ -151,17 +153,56 @@ LLInboxFolderViewFolder::~LLInboxFolderViewFolder() } // virtual +time_t LLInboxFolderViewFolder::getCreationDate() const +{ + time_t ret_val = LLFolderViewFolder::getCreationDate(); + + if (!mCreationDate) + { + updateFlag(); + } + + return ret_val; +} + +// virtual void LLInboxFolderViewFolder::draw() { +#if SUPPORTING_FRESH_ITEM_COUNT if (!badgeHasParent()) { addBadgeToParentPanel(); } setBadgeVisibility(mFresh); +#endif LLFolderViewFolder::draw(); } +void LLInboxFolderViewFolder::updateFlag() const +{ + LLDate saved_freshness_date = LLDate(gSavedPerAccountSettings.getString("LastInventoryInboxExpand")); + mFresh = (mCreationDate > saved_freshness_date.secondsSinceEpoch()); +} + +void LLInboxFolderViewFolder::selectItem() +{ + mFresh = false; + LLFolderViewFolder::selectItem(); +} + +void LLInboxFolderViewFolder::toggleOpen() +{ + mFresh = false; + LLFolderViewFolder::toggleOpen(); +} + +void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc) const +{ + mCreationDate = creation_date_utc; + updateFlag(); +} + // eof diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h index 8f198c41c1..8946b9dc98 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.h +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -32,6 +32,11 @@ #include "llinventorypanel.h" #include "llfolderviewitem.h" + +#define SUPPORTING_FRESH_ITEM_COUNT 0 + + + class LLInboxInventoryPanel : public LLInventoryPanel { public: @@ -66,11 +71,21 @@ public: LLInboxFolderViewFolder(const Params& p); ~LLInboxFolderViewFolder(); + + time_t getCreationDate() const; void draw(); + void updateFlag() const; + void selectItem(); + void toggleOpen(); + + bool isFresh() const { return mFresh; } + protected: - bool mFresh; + void setCreationDate(time_t creation_date_utc) const; + + mutable bool mFresh; }; diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index a90f23d637..119fc95cf0 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -444,18 +444,15 @@ void LLPreview::handleReshape(const LLRect& new_rect, bool by_user) LLMultiPreview::LLMultiPreview() : LLMultiFloater(LLSD()) { - // *TODO: There should be a .xml file for this - const LLRect& nextrect = LLFloaterReg::getFloaterRect("preview"); // place where the next preview should show up - if (nextrect.getWidth() > 0) - { - setRect(nextrect); - } - else + // start with a rect in the top-left corner ; will get resized + LLRect rect; + rect.setLeftTopAndSize(0, gViewerWindow->getWindowHeightScaled(), 200, 400); + setRect(rect); + + LLFloater* last_floater = LLFloaterReg::getLastFloaterInGroup("preview"); + if (last_floater) { - // start with a rect in the top-left corner ; will get resized - LLRect rect; - rect.setLeftTopAndSize(0, gViewerWindow->getWindowHeightScaled(), 200, 400); - setRect(rect); + stackWith(*last_floater); } setTitle(LLTrans::getString("MultiPreviewTitle")); buildTabContainer(); diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index 028891a90e..a1f38f1854 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -50,6 +50,7 @@ #include "llappviewer.h" #include "llweb.h" #include "lluictrlfactory.h" +#include "llpanellogin.h" LLProgressView* LLProgressView::sInstance = NULL; @@ -66,7 +67,9 @@ LLProgressView::LLProgressView() mMediaCtrl( NULL ), mMouseDownInActiveArea( false ), mUpdateEvents("LLProgressView"), - mFadeToWorldTimer() + mFadeToWorldTimer(), + mFadeFromLoginTimer(), + mStartupComplete(false) { mUpdateEvents.listen("self", boost::bind(&LLProgressView::handleUpdate, this, _1)); } @@ -79,10 +82,13 @@ BOOL LLProgressView::postBuild() mMediaCtrl = getChild<LLMediaCtrl>("login_media_panel"); mMediaCtrl->setVisible( false ); // hidden initially mMediaCtrl->addObserver( this ); // watch events + + LLViewerMedia::setOnlyAudibleMediaTextureID(mMediaCtrl->getTextureID()); mCancelBtn = getChild<LLButton>("cancel_btn"); mCancelBtn->setClickedCallback( LLProgressView::onCancelButtonClicked, NULL ); mFadeToWorldTimer.stop(); + mFadeFromLoginTimer.stop(); getChild<LLTextBox>("title_text")->setText(LLStringExplicit(LLAppViewer::instance()->getSecondLifeTitle())); @@ -130,18 +136,34 @@ void LLProgressView::revealIntroPanel() // if user hasn't yet seen intro video std::string intro_url = gSavedSettings.getString("PostFirstLoginIntroURL"); if ( intro_url.length() > 0 && + gSavedSettings.getBOOL("BrowserJavascriptEnabled") && gSavedSettings.getBOOL("PostFirstLoginIntroViewed" ) == FALSE ) { + // hide the progress bar + getChild<LLView>("stack1")->setVisible(false); + // navigate to intro URL and reveal widget mMediaCtrl->navigateTo( intro_url ); mMediaCtrl->setVisible( TRUE ); + // flag as having seen the new user post login intro gSavedSettings.setBOOL("PostFirstLoginIntroViewed", TRUE ); + + mMediaCtrl->setFocus(TRUE); } - else + + mFadeFromLoginTimer.start(); +} + +void LLProgressView::setStartupComplete() +{ + mStartupComplete = true; + + // if we are not showing a video, fade into world + if (!mMediaCtrl->getVisible()) { - // start the timer that will control the fade through to the world view + mFadeFromLoginTimer.stop(); mFadeToWorldTimer.start(); } } @@ -162,17 +184,15 @@ void LLProgressView::setVisible(BOOL visible) } } -void LLProgressView::draw() -{ - static LLTimer timer; - // Paint bitmap if we've got one +void LLProgressView::drawStartTexture(F32 alpha) +{ glPushMatrix(); if (gStartTexture) { LLGLSUIDefault gls_ui; gGL.getTexUnit(0)->bind(gStartTexture.get()); - gGL.color4f(1.f, 1.f, 1.f, 1.f); + gGL.color4f(1.f, 1.f, 1.f, alpha); F32 image_aspect = (F32)gStartImageWidth / (F32)gStartImageHeight; S32 width = getRect().getWidth(); S32 height = getRect().getHeight(); @@ -198,6 +218,33 @@ void LLProgressView::draw() gl_rect_2d(getRect()); } glPopMatrix(); +} + + +void LLProgressView::draw() +{ + static LLTimer timer; + + if (mFadeFromLoginTimer.getStarted()) + { + F32 alpha = clamp_rescale(mFadeFromLoginTimer.getElapsedTimeF32(), 0.f, FADE_TO_WORLD_TIME, 0.f, 1.f); + LLViewDrawContext context(alpha); + + if (!mMediaCtrl->getVisible()) + { + drawStartTexture(alpha); + } + + LLPanel::draw(); + + if (mFadeFromLoginTimer.getElapsedTimeF32() > FADE_TO_WORLD_TIME ) + { + mFadeFromLoginTimer.stop(); + LLPanelLogin::closePanel(); + } + + return; + } // handle fade out to world view when we're asked to if (mFadeToWorldTimer.getStarted()) @@ -205,6 +252,8 @@ void LLProgressView::draw() // draw fading panel F32 alpha = clamp_rescale(mFadeToWorldTimer.getElapsedTimeF32(), 0.f, FADE_TO_WORLD_TIME, 1.f, 0.f); LLViewDrawContext context(alpha); + + drawStartTexture(alpha); LLPanel::draw(); // faded out completely - remove panel and reveal world @@ -212,6 +261,8 @@ void LLProgressView::draw() { mFadeToWorldTimer.stop(); + LLViewerMedia::setOnlyAudibleMediaTextureID(LLUUID::null); + // Fade is complete, release focus gFocusMgr.releaseFocusIfNeeded( this ); @@ -235,6 +286,7 @@ void LLProgressView::draw() return; } + drawStartTexture(1.0f); // draw children LLPanel::draw(); } @@ -349,9 +401,26 @@ bool LLProgressView::onAlertModal(const LLSD& notify) void LLProgressView::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) { + // the intro web content calls javascript::window.close() when it's done if( event == MEDIA_EVENT_CLOSE_REQUEST ) { - // the intro web content calls javascript::window.close() when it's done - mFadeToWorldTimer.start(); + if (mStartupComplete) + { + //make sure other timer has stopped + mFadeFromLoginTimer.stop(); + mFadeToWorldTimer.start(); + } + else + { + // hide the media ctrl and wait for startup to be completed before fading to world + mMediaCtrl->setVisible(false); + if (mMediaCtrl->getMediaPlugin()) + { + mMediaCtrl->getMediaPlugin()->stop(); + } + + // show the progress bar + getChild<LLView>("stack1")->setVisible(true); + } } } diff --git a/indra/newview/llprogressview.h b/indra/newview/llprogressview.h index 73dd478e98..fac00ad04d 100644 --- a/indra/newview/llprogressview.h +++ b/indra/newview/llprogressview.h @@ -48,6 +48,7 @@ public: BOOL postBuild(); /*virtual*/ void draw(); + void drawStartTexture(F32 alpha); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); @@ -65,6 +66,8 @@ public: // turns on (under certain circumstances) the into video after login void revealIntroPanel(); + void setStartupComplete(); + void setCancelButtonVisible(BOOL b, const std::string& label); static void onCancelButtonClicked( void* ); @@ -82,8 +85,10 @@ protected: std::string mMessage; LLButton* mCancelBtn; LLFrameTimer mFadeToWorldTimer; + LLFrameTimer mFadeFromLoginTimer; LLRect mOutlineRect; bool mMouseDownInActiveArea; + bool mStartupComplete; // The LLEventStream mUpdateEvents depends upon this class being a singleton // to avoid pump name conflicts. diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 65655f82cd..6f809ba3ca 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -61,8 +61,6 @@ static LLRegisterPanelClassWrapper<LLSidepanelInventory> t_inventory("sidepanel_ // Constants // -static const char * const INBOX_EXPAND_TIME_SETTING = "LastInventoryInboxExpand"; - static const char * const INBOX_BUTTON_NAME = "inbox_btn"; static const char * const OUTBOX_BUTTON_NAME = "outbox_btn"; @@ -404,7 +402,7 @@ void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id) // Expand the inbox since we have fresh items LLPanelMarketplaceInbox * inbox = findChild<LLPanelMarketplaceInbox>(MARKETPLACE_INBOX_PANEL); - if (inbox && (inbox->getFreshItemCount() > 0)) + if (inbox) { getChild<LLButton>(INBOX_BUTTON_NAME)->setToggleState(true); onToggleInboxBtn(); @@ -458,13 +456,9 @@ void LLSidepanelInventory::onToggleInboxBtn() LLButton* otherButton = getChild<LLButton>(OUTBOX_BUTTON_NAME); LLLayoutPanel* otherPanel = getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME); - bool inboxExpanded = manageInboxOutboxPanels(stack, pressedButton, pressedPanel, otherButton, otherPanel); + manageInboxOutboxPanels(stack, pressedButton, pressedPanel, otherButton, otherPanel); - if (inboxExpanded) - { - // Save current time as a setting for future new-ness tests - gSavedSettings.setString(INBOX_EXPAND_TIME_SETTING, LLDate::now().asString()); - } + gSavedPerAccountSettings.setString("LastInventoryInboxExpand", LLDate::now().asString()); } void LLSidepanelInventory::onToggleOutboxBtn() diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 4dfcb85295..b390c933f7 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -897,7 +897,7 @@ bool idle_startup() if (show_connect_box) { LLSLURL slurl; - LLPanelLogin::closePanel(); + //LLPanelLogin::closePanel(); } @@ -944,6 +944,8 @@ bool idle_startup() gViewerWindow->setShowProgress(TRUE); gViewerWindow->setProgressCancelButtonVisible(TRUE, LLTrans::getString("Quit")); + gViewerWindow->revealIntroPanel(); + // Poke the VFS, which could potentially block for a while if // Windows XP is acting up set_startup_status(0.07f, LLTrans::getString("LoginVerifyingCache"), LLStringUtil::null); @@ -1962,8 +1964,8 @@ bool idle_startup() gViewerWindow->getWindow()->resetBusyCount(); gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); LL_DEBUGS("AppInit") << "Done releasing bitmap" << LL_ENDL; - gViewerWindow->revealIntroPanel(); - //gViewerWindow->setShowProgress(FALSE); // reveal intro video now handles this + //gViewerWindow->revealIntroPanel(); + gViewerWindow->setStartupComplete(); gViewerWindow->setProgressCancelButtonVisible(FALSE); // We're not away from keyboard, even though login might have taken diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index b19c738ed2..f7fa5690d6 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -36,6 +36,7 @@ #include "llviewerwindow.h" #include "llvoiceclient.h" #include "llviewermedia.h" +#include "llprogressview.h" ///////////////////////////////////////////////////////// @@ -101,7 +102,16 @@ void audio_update_volume(bool force_update) { F32 master_volume = gSavedSettings.getF32("AudioLevelMaster"); BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio"); - if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized"))) + + LLProgressView* progress = gViewerWindow->getProgressView(); + BOOL progress_view_visible = FALSE; + + if (progress) + { + progress_view_visible = progress->getVisible(); + } + + if (!gViewerWindow->getActive() && gSavedSettings.getBOOL("MuteWhenMinimized")) { mute_audio = TRUE; } @@ -114,7 +124,7 @@ void audio_update_volume(bool force_update) gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler")); gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff")); - gAudiop->setMuted(mute_audio); + gAudiop->setMuted(mute_audio || progress_view_visible); if (force_update) { @@ -136,7 +146,7 @@ void audio_update_volume(bool force_update) F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); BOOL music_muted = gSavedSettings.getBOOL("MuteMusic"); music_volume = mute_volume * master_volume * music_volume; - gAudiop->setInternetStreamGain ( music_muted ? 0.f : music_volume ); + gAudiop->setInternetStreamGain ( music_muted || progress_view_visible ? 0.f : music_volume ); } diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 6ae8e79be4..77afd0ea22 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -246,15 +246,11 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("publish_classified", "floater_publish_classified.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPublishClassifiedFloater>); LLFloaterReg::add("telehubs", "floater_telehub.xml",&LLFloaterReg::build<LLFloaterTelehub>); - LLFloaterReg::add("test_inspectors", "floater_test_inspectors.xml", - &LLFloaterReg::build<LLFloaterTestInspectors>); + LLFloaterReg::add("test_inspectors", "floater_test_inspectors.xml", &LLFloaterReg::build<LLFloaterTestInspectors>); //LLFloaterReg::add("test_list_view", "floater_test_list_view.xml",&LLFloaterReg::build<LLFloaterTestListView>); - LLFloaterReg::add("test_textbox", "floater_test_textbox.xml", - &LLFloaterReg::build<LLFloater>); - LLFloaterReg::add("test_text_editor", "floater_test_text_editor.xml", - &LLFloaterReg::build<LLFloater>); - LLFloaterReg::add("test_widgets", "floater_test_widgets.xml", - &LLFloaterReg::build<LLFloater>); + LLFloaterReg::add("test_textbox", "floater_test_textbox.xml", &LLFloaterReg::build<LLFloater>); + LLFloaterReg::add("test_text_editor", "floater_test_text_editor.xml", &LLFloaterReg::build<LLFloater>); + LLFloaterReg::add("test_widgets", "floater_test_widgets.xml", &LLFloaterReg::build<LLFloater>); LLFloaterReg::add("top_objects", "floater_top_objects.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTopObjects>); LLFloaterReg::add("reporter", "floater_report_abuse.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterReporter>); @@ -274,7 +270,9 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("start_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterRunQueue>); LLFloaterReg::add("stop_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotRunQueue>); LLFloaterReg::add("snapshot", "floater_snapshot.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSnapshot>); - LLFloaterReg::add("search", "floater_search.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSearch>); + LLFloaterReg::add("search", "floater_search.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSearch>); + LLFloaterReg::add("profile", "floater_web_content.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWebContent>); + LLFloaterUIPreviewUtil::registerFloater(); LLFloaterReg::add("upload_anim", "floater_animation_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAnimPreview>, "upload"); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 1be58eae45..384f7cd61d 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -344,6 +344,8 @@ static LLViewerMedia::impl_id_map sViewerMediaTextureIDMap; static LLTimer sMediaCreateTimer; static const F32 LLVIEWERMEDIA_CREATE_DELAY = 1.0f; static F32 sGlobalVolume = 1.0f; +static bool sForceUpdate = false; +static LLUUID sOnlyAudibleTextureID = LLUUID::null; static F64 sLowestLoadableImplInterest = 0.0f; static bool sAnyMediaShowing = false; static boost::signals2::connection sTeleportFinishConnection; @@ -606,7 +608,7 @@ bool LLViewerMedia::textureHasMedia(const LLUUID& texture_id) // static void LLViewerMedia::setVolume(F32 volume) { - if(volume != sGlobalVolume) + if(volume != sGlobalVolume || sForceUpdate) { sGlobalVolume = volume; impl_list::iterator iter = sViewerMediaImplList.begin(); @@ -617,6 +619,8 @@ void LLViewerMedia::setVolume(F32 volume) LLViewerMediaImpl* pimpl = *iter; pimpl->updateVolume(); } + + sForceUpdate = false; } } @@ -1626,6 +1630,15 @@ void LLViewerMedia::onTeleportFinished() gSavedSettings.setBOOL("MediaTentativeAutoPlay", true); } + +////////////////////////////////////////////////////////////////////////////////////////// +// static +void LLViewerMedia::setOnlyAudibleMediaTextureID(const LLUUID& texture_id) +{ + sOnlyAudibleTextureID = texture_id; + sForceUpdate = true; +} + ////////////////////////////////////////////////////////////////////////////////////////// // LLViewerMediaImpl ////////////////////////////////////////////////////////////////////////////////////////// @@ -2188,7 +2201,14 @@ void LLViewerMediaImpl::updateVolume() } } - mMediaSource->setVolume(volume); + if (sOnlyAudibleTextureID == LLUUID::null || sOnlyAudibleTextureID == mTextureId) + { + mMediaSource->setVolume(volume); + } + else + { + mMediaSource->setVolume(0.0f); + } } } diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index a70c6f4887..aeac6ba29a 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -160,6 +160,8 @@ public: static void createSpareBrowserMediaSource(); static LLPluginClassMedia* getSpareBrowserMediaSource(); + + static void setOnlyAudibleMediaTextureID(const LLUUID& texture_id); private: static void setOpenIDCookie(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 988c4ed1a2..f04337ca89 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4547,6 +4547,14 @@ void LLViewerWindow::setShowProgress(const BOOL show) } } +void LLViewerWindow::setStartupComplete() +{ + if (mProgressView) + { + mProgressView->setStartupComplete(); + } +} + BOOL LLViewerWindow::getShowProgress() const { return (mProgressView && mProgressView->getVisible()); diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index ff49ed1f62..edd241a742 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -272,6 +272,7 @@ public: void setProgressCancelButtonVisible( BOOL b, const std::string& label = LLStringUtil::null ); LLProgressView *getProgressView() const; void revealIntroPanel(); + void setStartupComplete(); void updateObjectUnderCursor(); diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index b73017a51a..e4cdfaaaaf 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -81,19 +81,20 @@ void LLWeb::initClass() // static void LLWeb::loadURL(const std::string& url, const std::string& target, const std::string& uuid) { - if(target == "_internal") - { - // Force load in the internal browser, as if with a blank target. - loadURLInternal(url, "", uuid); - } - else if (gSavedSettings.getBOOL("UseExternalBrowser") || (target == "_external")) - { - loadURLExternal(url); - } - else - { - loadURLInternal(url, target, uuid); - } + loadWebURL(url, target, uuid); + //if(target == "_internal") + //{ + // // Force load in the internal browser, as if with a blank target. + // loadURLInternal(url, "", uuid); + //} + //else if (gSavedSettings.getBOOL("UseExternalBrowser") || (target == "_external")) + //{ + // loadURLExternal(url); + //} + //else + //{ + // loadURLInternal(url, target, uuid); + //} } // static @@ -124,17 +125,15 @@ void LLWeb::loadURLInternal(const std::string &url, const std::string& target, c // Explicitly open a Web URL using the Web content floater void LLWeb::loadWebURLInternal(const std::string &url, const std::string& target, const std::string& uuid) { - LLFloaterWebContent::create(url, target, uuid); + LLFloaterWebContent::create(LLFloaterWebContent::Params().url(url).target(target).id(LLUUID(uuid))); } - // static void LLWeb::loadURLExternal(const std::string& url, const std::string& uuid) { loadURLExternal(url, true, uuid); } - // static void LLWeb::loadURLExternal(const std::string& url, bool async, const std::string& uuid) { diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 8cdb615686..265d5dc801 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -1752,13 +1752,13 @@ BOOL LLWorldMapView::handleDoubleClick( S32 x, S32 y, MASK mask ) case MAP_ITEM_LAND_FOR_SALE_ADULT: { LLFloaterReg::hideInstance("world_map"); - LLFloaterReg::showInstance("search", LLSD().with("category", "destinations").with("id", id)); + LLFloaterReg::showInstance("search", LLSD().with("category", "destinations").with("query", id)); break; } case MAP_ITEM_CLASSIFIED: { LLFloaterReg::hideInstance("world_map"); - LLFloaterReg::showInstance("search", LLSD().with("category", "classifieds").with("id", id)); + LLFloaterReg::showInstance("search", LLSD().with("category", "classifieds").with("query", id)); break; } default: diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 76965ad14b..31b6fc77f5 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -134,7 +134,7 @@ reference="AvatarListItemIconOfflineColor" /> <color name="BadgeImageColor" - value="0.44 0.69 0.56 1.0" /> + value="1.0 0.40 0.0 1.0" /> <color name="BadgeBorderColor" value="0.9 0.9 0.9 1.0" /> diff --git a/indra/newview/skins/default/textures/widgets/Badge_Background_New.png b/indra/newview/skins/default/textures/widgets/Badge_Background_New.png Binary files differnew file mode 100644 index 0000000000..9f114f2e4a --- /dev/null +++ b/indra/newview/skins/default/textures/widgets/Badge_Background_New.png diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml index c7b26c59c7..114b3a72e0 100644 --- a/indra/newview/skins/default/xui/en/floater_search.xml +++ b/indra/newview/skins/default/xui/en/floater_search.xml @@ -1,72 +1,18 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater - legacy_header_height="13" - can_resize="true" - height="600" - layout="topleft" - min_height="400" - min_width="450" - name="floater_search" - help_topic="floater_search" - save_rect="true" - save_visibility="true" - single_instance="true" - title="FIND" - width="650"> - <floater.string - name="loading_text"> - Loading... - </floater.string> - <floater.string - name="done_text"> - Done - </floater.string> - <layout_stack - height="580" - follows="left|right|top|bottom" - layout="topleft" - left="10" - name="stack1" - top="20" - width="630"> - <layout_panel - height="570" - layout="topleft" - left_delta="0" - top_delta="0" - name="browser_layout" - user_resize="false" - width="630"> - <web_browser - tab_stop="true" - trusted_content="true" - follows="left|right|top|bottom" - layout="topleft" - left="0" - name="browser" - top="0" - height="540" - width="630" /> - <text - follows="bottom|left" - height="16" - layout="topleft" - left_delta="0" - name="status_text" - top_pad="10" - width="150" /> - <text - visible="false" - follows="bottom|right" - height="16" - left_delta="0" - name="refresh_search" - left_pad="0" - right="-10" - halign="right" - width="450"> - Redo search to reflect current God level - </text> - </layout_panel> - </layout_stack> -</floater> + legacy_header_height="18" + can_resize="true" + height="775" + layout="topleft" + min_height="400" + min_width="500" + name="floater_web_content" + help_topic="floater_web_content" + save_rect="true" + auto_tile="true" + save_visibility="true" + title="" + initial_mime_type="text/html" + width="780" + filename="floater_web_content.xml"/> + tab_stop="true"
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml index 69e6057556..0eda9ae62a 100644 --- a/indra/newview/skins/default/xui/en/floater_web_content.xml +++ b/indra/newview/skins/default/xui/en/floater_web_content.xml @@ -40,6 +40,7 @@ image_disabled_selected="PushButton_Disabled" image_selected="PushButton_Selected" image_unselected="PushButton_Off" + chrome="true" hover_glow_amount="0.15" tool_tip="Navigate back" follows="left|top" @@ -58,6 +59,7 @@ image_disabled_selected="PushButton_Disabled" image_selected="PushButton_Selected" image_unselected="PushButton_Off" + chrome="true" tool_tip="Navigate forward" follows="left|top" height="22" @@ -75,6 +77,7 @@ image_disabled_selected="PushButton_Disabled" image_selected="PushButton_Selected" image_unselected="PushButton_Off" + chrome="true" tool_tip="Stop navigation" enabled="true" follows="left|top" @@ -93,6 +96,7 @@ image_disabled_selected="PushButton_Disabled" image_selected="PushButton_Selected" image_unselected="PushButton_Off" + chrome="true" tool_tip="Reload page" follows="left|top" height="22" @@ -137,6 +141,7 @@ image_disabled_selected="PushButton_Disabled" image_selected="PushButton_Selected" image_unselected="PushButton_Off" + chrome="true" tool_tip="Open current URL in your desktop browser" follows="right|top" enabled="true" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 661165069e..1bc377126e 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4991,19 +4991,19 @@ Would you like to automatically wear the clothing you are about to create? name="NotAgeVerified" type="alertmodal"> <tag>fail</tag> -You must be age-verified to visit this area. Do you want to go to the [SECOND_LIFE] website and verify your age? +To access adult content and areas in Second Life you must be at least 18 years old. Please visit our age verification page to confirm you are over 18. +Note this will launch your web browser. [_URL] <tag>confirm</tag> <url option="0" name="url"> - - https://secondlife.com/account/verification.php + https://secondlife.com/my/account/verification.php </url> <usetemplate ignoretext="I have not verified my age" name="okcancelignore" - notext="No" - yestext="Yes"/> + notext="Cancel" + yestext="Go to Age Verification"/> </notification> <notification diff --git a/indra/newview/skins/default/xui/en/widgets/badge.xml b/indra/newview/skins/default/xui/en/widgets/badge.xml index f77c4b7178..2d4c02b092 100644 --- a/indra/newview/skins/default/xui/en/widgets/badge.xml +++ b/indra/newview/skins/default/xui/en/widgets/badge.xml @@ -7,11 +7,14 @@ image="Badge_Background" image_color="BadgeImageColor" label_color="BadgeLabelColor" + label_offset_horiz="0" + label_offset_vert="0" location="top_left" location_percent_hcenter="85" location_percent_vcenter="85" padding_horiz="7" padding_vert="4" requests_front="true" + mouse_opaque="false" > </badge> diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml index 2c987b158d..95f5cf2ecd 100644 --- a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml +++ b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml @@ -6,5 +6,14 @@ item_top_pad="4" selection_image="Rounded_Square" > - <new_badge label="New" location="right" location_percent_hcenter="70" /> + <new_badge + label="New" + label_offset_horiz="-1" + location="right" + padding_horiz="4" + padding_vert="1" + location_percent_hcenter="70" + border_image="" + image="Badge_Background_New" + /> </inbox_folder_view_folder> |