diff options
Diffstat (limited to 'indra')
49 files changed, 625 insertions, 235 deletions
diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 9ead183a9e..4481d334b2 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -50,6 +50,7 @@ set(llcommon_SOURCE_FILES lleventdispatcher.cpp lleventfilter.cpp llevents.cpp + lleventtimer.cpp llfasttimer_class.cpp llfile.cpp llfindlocale.cpp @@ -164,7 +165,6 @@ set(llcommon_HEADER_FILES llhttpstatuscodes.h llindexedqueue.h llinstancetracker.h - llinstancetracker.h llkeythrottle.h lllazy.h lllistenerwrapper.h diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index 968b92d1e7..6b2d1b7c20 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -41,7 +41,7 @@ #include "lllivefile.h" #include "llmemory.h" #include "llstl.h" // for DeletePointer() -#include "lltimer.h" +#include "lleventtimer.h" // // Signal handling diff --git a/indra/llcommon/lleventtimer.cpp b/indra/llcommon/lleventtimer.cpp new file mode 100644 index 0000000000..d44e7ec1e6 --- /dev/null +++ b/indra/llcommon/lleventtimer.cpp @@ -0,0 +1,95 @@ +/** + * @file lleventtimer.cpp + * @brief Cross-platform objects for doing timing + * + * $LicenseInfo:firstyear=2000&license=viewergpl$ + * + * Copyright (c) 2000-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "lleventtimer.h" + +#include "u64.h" + + +////////////////////////////////////////////////////////////////////////////// +// +// LLEventTimer Implementation +// +////////////////////////////////////////////////////////////////////////////// + +LLEventTimer::LLEventTimer(F32 period) +: mEventTimer() +{ + mPeriod = period; +} + +LLEventTimer::LLEventTimer(const LLDate& time) +: mEventTimer() +{ + mPeriod = (F32)(time.secondsSinceEpoch() - LLDate::now().secondsSinceEpoch()); +} + + +LLEventTimer::~LLEventTimer() +{ +} + +//static +void LLEventTimer::updateClass() +{ + std::list<LLEventTimer*> completed_timers; + + { + 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 ); + } + } + } + } + + if ( completed_timers.size() > 0 ) + { + for (std::list<LLEventTimer*>::iterator completed_iter = completed_timers.begin(); + completed_iter != completed_timers.end(); + completed_iter++ ) + { + delete *completed_iter; + } + } +} + + diff --git a/indra/llcommon/lleventtimer.h b/indra/llcommon/lleventtimer.h new file mode 100644 index 0000000000..5181cce52d --- /dev/null +++ b/indra/llcommon/lleventtimer.h @@ -0,0 +1,60 @@ +/** + * @file lleventtimer.h + * @brief Cross-platform objects for doing timing + * + * $LicenseInfo:firstyear=2000&license=viewergpl$ + * + * Copyright (c) 2000-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_EVENTTIMER_H +#define LL_EVENTTIMER_H + +#include "stdtypes.h" +#include "lldate.h" +#include "llinstancetracker.h" +#include "lltimer.h" + +// class for scheduling a function to be called at a given frequency (approximate, inprecise) +class LL_COMMON_API LLEventTimer : protected LLInstanceTracker<LLEventTimer> +{ +public: + LLEventTimer(F32 period); // period is the amount of time between each call to tick() in seconds + LLEventTimer(const LLDate& time); + virtual ~LLEventTimer(); + + //function to be called at the supplied frequency + // Normally return FALSE; TRUE will delete the timer after the function returns. + virtual BOOL tick() = 0; + + static void updateClass(); + +protected: + LLTimer mEventTimer; + F32 mPeriod; +}; + +#endif //LL_EVENTTIMER_H diff --git a/indra/llcommon/llfasttimer_class.cpp b/indra/llcommon/llfasttimer_class.cpp index 6d8d81e114..2e5edb1f3b 100644 --- a/indra/llcommon/llfasttimer_class.cpp +++ b/indra/llcommon/llfasttimer_class.cpp @@ -218,9 +218,10 @@ 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 = DeclareTimer::beginInstances(); - it != DeclareTimer::endInstances(); + for (DeclareTimer::instance_iter it = guard.beginInstances(); + it != guard.endInstances(); ++it) { // update cached pointer @@ -371,20 +372,23 @@ void LLFastTimer::NamedTimer::buildHierarchy() if (sCurFrameIndex < 0 ) return; // set up initial tree - for (instance_iter it = NamedTimer::beginInstances(); - it != endInstances(); - ++it) { - NamedTimer& timer = *it; - if (&timer == NamedTimerFactory::instance().getRootTimer()) continue; - - // bootstrap tree construction by attaching to last timer to be on stack - // when this timer was called - if (timer.getFrameState().mLastCaller && timer.mParent == NamedTimerFactory::instance().getRootTimer()) + NamedTimer::LLInstanceTrackerScopedGuard guard; + for (instance_iter it = guard.beginInstances(); + it != guard.endInstances(); + ++it) { - timer.setParent(timer.getFrameState().mLastCaller->mTimer); - // no need to push up tree on first use, flag can be set spuriously - timer.getFrameState().mMoveUpTree = false; + NamedTimer& timer = *it; + if (&timer == NamedTimerFactory::instance().getRootTimer()) continue; + + // bootstrap tree construction by attaching to last timer to be on stack + // when this timer was called + if (timer.getFrameState().mLastCaller && timer.mParent == NamedTimerFactory::instance().getRootTimer()) + { + timer.setParent(timer.getFrameState().mLastCaller->mTimer); + // no need to push up tree on first use, flag can be set spuriously + timer.getFrameState().mMoveUpTree = false; + } } } @@ -486,18 +490,21 @@ void LLFastTimer::NamedTimer::resetFrame() F64 total_time = 0; LLSD sd; - for (NamedTimer::instance_iter it = NamedTimer::beginInstances(); - it != NamedTimer::endInstances(); - ++it) { - NamedTimer& timer = *it; - FrameState& info = timer.getFrameState(); - sd[timer.getName()]["Time"] = (LLSD::Real) (info.mSelfTimeCounter*iclock_freq); - sd[timer.getName()]["Calls"] = (LLSD::Integer) info.mCalls; - - // computing total time here because getting the root timer's getCountHistory - // doesn't work correctly on the first frame - total_time = total_time + info.mSelfTimeCounter * iclock_freq; + NamedTimer::LLInstanceTrackerScopedGuard guard; + for (NamedTimer::instance_iter it = guard.beginInstances(); + it != guard.endInstances(); + ++it) + { + NamedTimer& timer = *it; + FrameState& info = timer.getFrameState(); + sd[timer.getName()]["Time"] = (LLSD::Real) (info.mSelfTimeCounter*iclock_freq); + sd[timer.getName()]["Calls"] = (LLSD::Integer) info.mCalls; + + // computing total time here because getting the root timer's getCountHistory + // doesn't work correctly on the first frame + total_time = total_time + info.mSelfTimeCounter * iclock_freq; + } } sd["Total"]["Time"] = (LLSD::Real) total_time; @@ -531,21 +538,24 @@ void LLFastTimer::NamedTimer::resetFrame() DeclareTimer::updateCachedPointers(); // reset for next frame - for (NamedTimer::instance_iter it = NamedTimer::beginInstances(); - it != NamedTimer::endInstances(); - ++it) { - NamedTimer& timer = *it; - - FrameState& info = timer.getFrameState(); - info.mSelfTimeCounter = 0; - info.mCalls = 0; - info.mLastCaller = NULL; - info.mMoveUpTree = false; - // update parent pointer in timer state struct - if (timer.mParent) + NamedTimer::LLInstanceTrackerScopedGuard guard; + for (NamedTimer::instance_iter it = guard.beginInstances(); + it != guard.endInstances(); + ++it) { - info.mParent = &timer.mParent->getFrameState(); + NamedTimer& timer = *it; + + FrameState& info = timer.getFrameState(); + info.mSelfTimeCounter = 0; + info.mCalls = 0; + info.mLastCaller = NULL; + info.mMoveUpTree = false; + // update parent pointer in timer state struct + if (timer.mParent) + { + info.mParent = &timer.mParent->getFrameState(); + } } } @@ -575,20 +585,23 @@ void LLFastTimer::NamedTimer::reset() } // reset all history - for (NamedTimer::instance_iter it = NamedTimer::beginInstances(); - it != NamedTimer::endInstances(); - ++it) { - NamedTimer& timer = *it; - if (&timer != NamedTimerFactory::instance().getRootTimer()) + NamedTimer::LLInstanceTrackerScopedGuard guard; + for (NamedTimer::instance_iter it = guard.beginInstances(); + it != guard.endInstances(); + ++it) { - timer.setParent(NamedTimerFactory::instance().getRootTimer()); + NamedTimer& timer = *it; + if (&timer != NamedTimerFactory::instance().getRootTimer()) + { + timer.setParent(NamedTimerFactory::instance().getRootTimer()); + } + + timer.mCountAverage = 0; + timer.mCallAverage = 0; + memset(timer.mCountHistory, 0, sizeof(U32) * HISTORY_NUM); + memset(timer.mCallHistory, 0, sizeof(U32) * HISTORY_NUM); } - - timer.mCountAverage = 0; - timer.mCallAverage = 0; - memset(timer.mCountHistory, 0, sizeof(U32) * HISTORY_NUM); - memset(timer.mCallHistory, 0, sizeof(U32) * HISTORY_NUM); } sLastFrameIndex = 0; diff --git a/indra/llcommon/llinstancetracker.cpp b/indra/llcommon/llinstancetracker.cpp new file mode 100644 index 0000000000..c962cb5be1 --- /dev/null +++ b/indra/llcommon/llinstancetracker.cpp @@ -0,0 +1,20 @@ +/** + * @file lllinstancetracker.cpp + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * Copyright (c) 2009, Linden Research, Inc. + * $/LicenseInfo$ + */ + +// Precompiled header +#include "linden_common.h" +// associated header +#include "llinstancetracker.h" +// STL headers +// std headers +// external library headers +// other Linden headers + +// llinstancetracker.h is presently header-only. This file exists only because our CMake +// test macro ADD_BUILD_TEST requires it. +int dummy = 0; diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h index 11fe523651..9df7998273 100644 --- a/indra/llcommon/llinstancetracker.h +++ b/indra/llcommon/llinstancetracker.h @@ -98,7 +98,10 @@ private: mKey = key; getMap_()[key] = static_cast<T*>(this); } - void remove_() { getMap_().erase(mKey); } + void remove_() + { + getMap_().erase(mKey); + } static InstanceMap& getMap_() { @@ -129,31 +132,65 @@ public: /// for completeness of analogy with the generic implementation static T* getInstance(T* k) { return k; } - static key_iter beginKeys() { return getSet_().begin(); } - static key_iter endKeys() { return getSet_().end(); } - static instance_iter beginInstances() { return instance_iter(getSet_().begin()); } - static instance_iter endInstances() { return instance_iter(getSet_().end()); } 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 + { + public: + LLInstanceTrackerScopedGuard() + { + ++sIterationNestDepth; + } + + ~LLInstanceTrackerScopedGuard() + { + --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(); } + }; + protected: - LLInstanceTracker() { getSet_().insert(static_cast<T*>(this)); } - virtual ~LLInstanceTracker() { getSet_().erase(static_cast<T*>(this)); } + 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() + { + // it's unsafe to delete instances of this type while all instances are being iterated over. + llassert(sIterationNestDepth == 0); + getSet_().erase(static_cast<T*>(this)); + } - LLInstanceTracker(const LLInstanceTracker& other) { getSet_().insert(static_cast<T*>(this)); } + LLInstanceTracker(const LLInstanceTracker& other) + { + //llassert(sIterationNestDepth == 0); + getSet_().insert(static_cast<T*>(this)); + } - static InstanceSet& getSet_() // called after getReady() but before go() - { - if (! sInstances) - { - sInstances = new InstanceSet; - } - return *sInstances; - } + static InstanceSet& getSet_() + { + if (! sInstances) + { + sInstances = new InstanceSet; + } + return *sInstances; + } static InstanceSet* sInstances; + static S32 sIterationNestDepth; }; template <typename T, typename KEY> typename LLInstanceTracker<T, KEY>::InstanceMap* LLInstanceTracker<T, KEY>::sInstances = NULL; template <typename T> typename LLInstanceTracker<T, T*>::InstanceSet* LLInstanceTracker<T, T*>::sInstances = NULL; +template <typename T> S32 LLInstanceTracker<T, T*>::sIterationNestDepth = 0; #endif diff --git a/indra/llcommon/lllivefile.cpp b/indra/llcommon/lllivefile.cpp index effda6c49c..5ca90d82ba 100644 --- a/indra/llcommon/lllivefile.cpp +++ b/indra/llcommon/lllivefile.cpp @@ -33,7 +33,7 @@ #include "lllivefile.h" #include "llframetimer.h" -#include "lltimer.h" +#include "lleventtimer.h" const F32 DEFAULT_CONFIG_FILE_REFRESH = 5.0f; diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp index 21e165ebc9..25b768079b 100644 --- a/indra/llcommon/lltimer.cpp +++ b/indra/llcommon/lltimer.cpp @@ -555,60 +555,3 @@ void secondsToTimecodeString(F32 current_time, std::string& tcstring) } -////////////////////////////////////////////////////////////////////////////// -// -// LLEventTimer Implementation -// -////////////////////////////////////////////////////////////////////////////// - -LLEventTimer::LLEventTimer(F32 period) -: mEventTimer() -{ - mPeriod = period; - mBusy = false; -} - -LLEventTimer::LLEventTimer(const LLDate& time) -: mEventTimer() -{ - mPeriod = (F32)(time.secondsSinceEpoch() - LLDate::now().secondsSinceEpoch()); - mBusy = false; -} - - -LLEventTimer::~LLEventTimer() -{ - llassert(!mBusy); // this LLEventTimer was destroyed from within its own tick() function - bad. if you want tick() to cause destruction of its own timer, make it return true. -} - -//static -void LLEventTimer::updateClass() -{ - std::list<LLEventTimer*> completed_timers; - for (instance_iter iter = beginInstances(); iter != endInstances(); ) - { - LLEventTimer& timer = *iter++; - F32 et = timer.mEventTimer.getElapsedTimeF32(); - if (timer.mEventTimer.getStarted() && et > timer.mPeriod) { - timer.mEventTimer.reset(); - timer.mBusy = true; - if ( timer.tick() ) - { - completed_timers.push_back( &timer ); - } - timer.mBusy = false; - } - } - - if ( completed_timers.size() > 0 ) - { - for (std::list<LLEventTimer*>::iterator completed_iter = completed_timers.begin(); - completed_iter != completed_timers.end(); - completed_iter++ ) - { - delete *completed_iter; - } - } -} - - diff --git a/indra/llcommon/lltimer.h b/indra/llcommon/lltimer.h index 4d995d5bba..baba95bfa1 100644 --- a/indra/llcommon/lltimer.h +++ b/indra/llcommon/lltimer.h @@ -39,8 +39,6 @@ #include <limits.h> #include "stdtypes.h" -#include "lldate.h" -#include "llinstancetracker.h" #include <string> #include <list> @@ -171,26 +169,6 @@ LL_COMMON_API struct tm* utc_to_pacific_time(time_t utc_time, BOOL pacific_dayli LL_COMMON_API void microsecondsToTimecodeString(U64 current_time, std::string& tcstring); LL_COMMON_API void secondsToTimecodeString(F32 current_time, std::string& tcstring); -// class for scheduling a function to be called at a given frequency (approximate, inprecise) -class LL_COMMON_API LLEventTimer : protected LLInstanceTracker<LLEventTimer> -{ -public: - LLEventTimer(F32 period); // period is the amount of time between each call to tick() in seconds - LLEventTimer(const LLDate& time); - virtual ~LLEventTimer(); - - //function to be called at the supplied frequency - // Normally return FALSE; TRUE will delete the timer after the function returns. - virtual BOOL tick() = 0; - - static void updateClass(); - -protected: - LLTimer mEventTimer; - F32 mPeriod; - bool mBusy; -}; - U64 LL_COMMON_API totalTime(); // Returns current system time in microseconds #endif diff --git a/indra/llcommon/tests/llinstancetracker_test.cpp b/indra/llcommon/tests/llinstancetracker_test.cpp index 7415f2d33b..4bb3ec2922 100644 --- a/indra/llcommon/tests/llinstancetracker_test.cpp +++ b/indra/llcommon/tests/llinstancetracker_test.cpp @@ -138,23 +138,29 @@ namespace tut keys.insert(&one); keys.insert(&two); keys.insert(&three); - for (Unkeyed::key_iter ki(Unkeyed::beginKeys()), kend(Unkeyed::endKeys()); - ki != kend; ++ki) - { - ensure_equals("spurious key", keys.erase(*ki), 1); - } + { + 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); - for (Unkeyed::instance_iter ii(Unkeyed::beginInstances()), iend(Unkeyed::endInstances()); - ii != iend; ++ii) - { - Unkeyed& ref = *ii; - ensure_equals("spurious instance", instances.erase(&ref), 1); - } + { + Unkeyed::LLInstanceTrackerScopedGuard guard; + for (Unkeyed::instance_iter ii(guard.beginInstances()), iend(guard.endInstances()); + ii != iend; ++ii) + { + Unkeyed& ref = *ii; + ensure_equals("spurious instance", instances.erase(&ref), 1); + } + } ensure_equals("unreported instance", instances.size(), 0); } } // namespace tut diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 1aaba88c49..dc79550eb4 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -816,7 +816,10 @@ void LLLayoutStack::calcMinExtents() //static void LLLayoutStack::updateClass() { - for (LLLayoutStack::instance_iter it = beginInstances(); it != endInstances(); ++it) + LLInstanceTrackerScopedGuard guard; + for (LLLayoutStack::instance_iter it = guard.beginInstances(); + it != guard.endInstances(); + ++it) { it->updateLayout(); } diff --git a/indra/llui/llmultifloater.cpp b/indra/llui/llmultifloater.cpp index 78738c826d..33d47a3f0e 100644 --- a/indra/llui/llmultifloater.cpp +++ b/indra/llui/llmultifloater.cpp @@ -92,14 +92,6 @@ void LLMultiFloater::draw() } else { - for (S32 i = 0; i < mTabContainer->getTabCount(); i++) - { - LLFloater* floaterp = (LLFloater*)mTabContainer->getPanelByIndex(i); - if (floaterp->getShortTitle() != mTabContainer->getPanelTitle(i)) - { - mTabContainer->setPanelTitle(i, floaterp->getShortTitle()); - } - } LLFloater::draw(); } } diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index a83cc19d36..b84e6f45fb 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1575,8 +1575,10 @@ void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, c { LLStyle::Params icon; icon.image = image; - // HACK: fix spacing of images and remove the fixed char spacing - appendAndHighlightText(" ", prepend_newline, part, icon); + // Text will be replaced during rendering with the icon, + // but string cannot be empty or the segment won't be + // added (or drawn). + appendAndHighlightText(" ", prepend_newline, part, icon); prepend_newline = false; } } @@ -2297,14 +2299,21 @@ F32 LLNormalTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selec { if ( mStyle->isImage() && (start >= 0) && (end <= mEnd - mStart)) { + // ...for images, only render the image, not the underlying text, + // which is only a placeholder space LLColor4 color = LLColor4::white % mEditor.getDrawContext().mAlpha; LLUIImagePtr image = mStyle->getImage(); S32 style_image_height = image->getHeight(); S32 style_image_width = image->getWidth(); - // Center the image vertically - S32 image_bottom = draw_rect.getCenterY() - (style_image_height/2); + // Text is drawn from the top of the draw_rect downward + S32 text_center = draw_rect.mTop - (mFontHeight / 2); + // Align image to center of text + S32 image_bottom = text_center - (style_image_height / 2); image->draw(draw_rect.mLeft, image_bottom, style_image_width, style_image_height, color); + + const S32 IMAGE_HPAD = 3; + return draw_rect.mLeft + style_image_width + IMAGE_HPAD; } return drawClippedSegment( getStart() + start, getStart() + end, selection_start, selection_end, draw_rect); diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index f1b08c380b..63e627ceb5 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1720,6 +1720,7 @@ LLView* LLView::findChildView(const std::string& name, BOOL recurse) const for ( child_it = mChildList.begin(); child_it != mChildList.end(); ++child_it) { LLView* childp = *child_it; + llassert(childp); if (childp->getName() == name) { return childp; @@ -1731,6 +1732,7 @@ LLView* LLView::findChildView(const std::string& name, BOOL recurse) const for ( child_it = mChildList.begin(); child_it != mChildList.end(); ++child_it) { LLView* childp = *child_it; + llassert(childp); LLView* viewp = childp->findChildView(name, recurse); if ( viewp ) { diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 77c6fa57b6..bf3233f386 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -113,6 +113,7 @@ if (WINDOWS) ) list(APPEND llwindow_LINK_LIBRARIES comdlg32 # Common Dialogs for ChooseColor + ole32 ) endif (WINDOWS) diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 7cbd7e46a9..d560331392 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1412,7 +1412,7 @@ LLUUID LLAgentWearables::makeNewOutfitLinks(const std::string& new_folder_name) new_folder_name); LLPointer<LLInventoryCallback> cb = new LLShowCreatedOutfit(folder_id); - LLAppearanceManager::instance().shallowCopyCategory(LLAppearanceManager::instance().getCOF(),folder_id, cb); + LLAppearanceManager::instance().shallowCopyCategoryContents(LLAppearanceManager::instance().getCOF(),folder_id, cb); LLAppearanceManager::instance().createBaseOutfitLink(folder_id, cb); return folder_id; @@ -2329,7 +2329,7 @@ void LLLibraryOutfitsFetch::libraryDone(void) LLUUID folder_id = gInventory.createNewCategory(mImportedClothingID, LLFolderType::FT_NONE, iter->second); - LLAppearanceManager::getInstance()->shallowCopyCategory(iter->first, folder_id, copy_waiter); + LLAppearanceManager::getInstance()->shallowCopyCategoryContents(iter->first, folder_id, copy_waiter); } } else diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 326fc41c1e..0cceba6cb0 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -48,6 +48,31 @@ #include "llviewerregion.h" #include "llwearablelist.h" +LLUUID findDescendentCategoryIDByName(const LLUUID& parent_id,const std::string& name) +{ + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; + LLNameCategoryCollector has_name(name); + gInventory.collectDescendentsIf(parent_id, + cat_array, + item_array, + LLInventoryModel::EXCLUDE_TRASH, + has_name); + if (0 == cat_array.count()) + return LLUUID(); + else + { + LLViewerInventoryCategory *cat = cat_array.get(0); + if (cat) + return cat->getUUID(); + else + { + llwarns << "null cat" << llendl; + return LLUUID(); + } + } +} + // support for secondlife:///app/appearance SLapps class LLAppearanceHandler : public LLCommandHandler { @@ -519,9 +544,33 @@ void LLAppearanceManager::changeOutfit(bool proceed, const LLUUID& category, boo LLAppearanceManager::instance().updateCOF(category,append); } +// Create a copy of src_id + contents as a subfolder of dst_id. void LLAppearanceManager::shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id, LLPointer<LLInventoryCallback> cb) { + LLInventoryCategory *src_cat = gInventory.getCategory(src_id); + if (!src_cat) + { + llwarns << "folder not found for src " << src_id.asString() << llendl; + return; + } + LLUUID parent_id = dst_id; + if(parent_id.isNull()) + { + parent_id = gInventory.getRootFolderID(); + } + LLUUID subfolder_id = gInventory.createNewCategory( parent_id, + LLFolderType::FT_NONE, + src_cat->getName()); + shallowCopyCategoryContents(src_id, subfolder_id, cb); + + gInventory.notifyObservers(); +} + +// Copy contents of src_id to dst_id. +void LLAppearanceManager::shallowCopyCategoryContents(const LLUUID& src_id, const LLUUID& dst_id, + LLPointer<LLInventoryCallback> cb) +{ LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; gInventory.collectDescendents(src_id, cats, items, diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 38d1e01d08..5fdff45735 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -35,6 +35,8 @@ #include "llsingleton.h" #include "llinventorymodel.h" +#include "llinventoryobserver.h" +#include "llviewerinventory.h" #include "llcallbacklist.h" class LLWearable; @@ -54,10 +56,14 @@ public: void wearOutfitByName(const std::string& name); void changeOutfit(bool proceed, const LLUUID& category, bool append); - // Copy all items in a category. + // Copy all items and the src category itself. void shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id, LLPointer<LLInventoryCallback> cb); + // Copy all items in a category. + void shallowCopyCategoryContents(const LLUUID& src_id, const LLUUID& dst_id, + LLPointer<LLInventoryCallback> cb); + // Find the Current Outfit folder. const LLUUID getCOF() const; @@ -144,6 +150,8 @@ public: #define SUPPORT_ENSEMBLES 0 +LLUUID findDescendentCategoryIDByName(const LLUUID& parent_id,const std::string& name); + // Shim class and template function to allow arbitrary boost::bind // expressions to be run as one-time idle callbacks. template <typename T> @@ -212,4 +220,103 @@ void doOnIdleRepeating(T callable) gIdleCallbacks.addFunction(&OnIdleCallbackRepeating<T>::onIdle,cb_functor); } +template <class T> +class CallAfterCategoryFetchStage2: public LLInventoryFetchObserver +{ +public: + CallAfterCategoryFetchStage2(T callable): + mCallable(callable) + { + } + ~CallAfterCategoryFetchStage2() + { + } + virtual void done() + { + gInventory.removeObserver(this); + doOnIdle(mCallable); + delete this; + } +protected: + T mCallable; +}; + +template <class T> +class CallAfterCategoryFetchStage1: public LLInventoryFetchDescendentsObserver +{ +public: + CallAfterCategoryFetchStage1(T callable): + mCallable(callable) + { + } + ~CallAfterCategoryFetchStage1() + { + } + virtual void done() + { + // What we do here is get the complete information on the items in + // the library, and set up an observer that will wait for that to + // happen. + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; + gInventory.collectDescendents(mCompleteFolders.front(), + cat_array, + item_array, + LLInventoryModel::EXCLUDE_TRASH); + S32 count = item_array.count(); + if(!count) + { + llwarns << "Nothing fetched in category " << mCompleteFolders.front() + << llendl; + //dec_busy_count(); + gInventory.removeObserver(this); + delete this; + return; + } + + CallAfterCategoryFetchStage2<T> *stage2 = new CallAfterCategoryFetchStage2<T>(mCallable); + LLInventoryFetchObserver::item_ref_t ids; + for(S32 i = 0; i < count; ++i) + { + ids.push_back(item_array.get(i)->getUUID()); + } + + gInventory.removeObserver(this); + + // do the fetch + stage2->fetchItems(ids); + if(stage2->isEverythingComplete()) + { + // everything is already here - call done. + stage2->done(); + } + else + { + // it's all on it's way - add an observer, and the inventory + // will call done for us when everything is here. + gInventory.addObserver(stage2); + } + delete this; + } +protected: + T mCallable; +}; + +template <class T> +void callAfterCategoryFetch(const LLUUID& cat_id, T callable) +{ + CallAfterCategoryFetchStage1<T> *stage1 = new CallAfterCategoryFetchStage1<T>(callable); + LLInventoryFetchDescendentsObserver::folder_ref_t folders; + folders.push_back(cat_id); + stage1->fetchDescendents(folders); + if (stage1->isEverythingComplete()) + { + stage1->done(); + } + else + { + gInventory.addObserver(stage1); + } +} + #endif diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index a3720769a1..98ec907886 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -40,6 +40,7 @@ #include "lluictrlfactory.h" #include "lltexteditor.h" #include "llerrorcontrol.h" +#include "lleventtimer.h" #include "llviewertexturelist.h" #include "llgroupmgr.h" #include "llagent.h" diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index a011c5ebfd..a915b7fa50 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -36,6 +36,7 @@ #include "llallocator.h" #include "llcontrol.h" #include "llsys.h" // for LLOSInfo +#include "lltimer.h" class LLCommandLineParser; class LLFrameTimer; diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index d405c1bbc1..97a5c3b8e2 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -678,8 +678,7 @@ void LLCallFloater::resetVoiceRemoveTimers() void LLCallFloater::removeVoiceRemoveTimer(const LLUUID& voice_speaker_id) { - bool delete_it = true; - mSpeakerDelayRemover->unsetActionTimer(voice_speaker_id, delete_it); + mSpeakerDelayRemover->unsetActionTimer(voice_speaker_id); } bool LLCallFloater::validateSpeaker(const LLUUID& speaker_id) diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 3aea70d1b4..929457046c 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -444,6 +444,7 @@ LLChatHistory::LLChatHistory(const LLChatHistory::Params& p) editor_params.rect = getLocalRect(); editor_params.follows.flags = FOLLOWS_ALL; editor_params.enabled = false; // read only + editor_params.show_context_menu = "true"; mEditor = LLUICtrlFactory::create<LLTextEditor>(editor_params, this); } diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 18bd7b725f..db804c7c8b 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -36,6 +36,7 @@ #include "llagent.h" #include "llavataractions.h" #include "llbottomtray.h" +#include "lleventtimer.h" #include "llgroupactions.h" #include "lliconctrl.h" #include "llimfloater.h" diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index eca9f8aba2..cc4e1a1868 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -39,7 +39,7 @@ #include "llhttpclient.h" #include "llhttpstatuscodes.h" #include "llsdserialize.h" -#include "lltimer.h" +#include "lleventtimer.h" #include "llviewerregion.h" #include "message.h" #include "lltrans.h" diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp index ccc5cab85a..4e2633d750 100644 --- a/indra/newview/llfloaterfriends.cpp +++ b/indra/newview/llfloaterfriends.cpp @@ -58,7 +58,7 @@ #include "llmenucommands.h" #include "llviewercontrol.h" #include "llviewermessage.h" -#include "lltimer.h" +#include "lleventtimer.h" #include "lltextbox.h" #include "llvoiceclient.h" diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index c6e12476bd..3e804bef9d 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -41,6 +41,7 @@ #include "llfloateruipreview.h" // Own header // Internal utility +#include "lleventtimer.h" #include "llrender.h" #include "llsdutil.h" #include "llxmltree.h" @@ -91,7 +92,6 @@ static std::string get_xui_dir() } // Forward declarations to avoid header dependencies -class LLEventTimer; class LLColor; class LLScrollListCtrl; class LLComboBox; diff --git a/indra/newview/llmediadataclient.h b/indra/newview/llmediadataclient.h index 75d32e707b..8dd72cb595 100755 --- a/indra/newview/llmediadataclient.h +++ b/indra/newview/llmediadataclient.h @@ -37,7 +37,7 @@ #include <queue> #include "llrefcount.h" #include "llpointer.h" -#include "lltimer.h" +#include "lleventtimer.h" // Link seam for LLVOVolume diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index d579058c32..40e8b64362 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -356,8 +356,9 @@ void LLNameListCtrl::refresh(const LLUUID& id, const std::string& first, void LLNameListCtrl::refreshAll(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) { + LLInstanceTrackerScopedGuard guard; LLInstanceTracker<LLNameListCtrl>::instance_iter it; - for (it = beginInstances(); it != endInstances(); ++it) + for (it = guard.beginInstances(); it != guard.endInstances(); ++it) { LLNameListCtrl& ctrl = *it; ctrl.refresh(id, first, last, is_group); diff --git a/indra/newview/llpanellandaudio.cpp b/indra/newview/llpanellandaudio.cpp index 6a4c909759..a92b4357ed 100644 --- a/indra/newview/llpanellandaudio.cpp +++ b/indra/newview/llpanellandaudio.cpp @@ -153,6 +153,13 @@ void LLPanelLandAudio::refresh() mCheckParcelEnableVoice->set(allow_voice); mCheckParcelVoiceLocal->set(!parcel->getParcelFlagUseEstateVoiceChannel()); + // don't display urls if you're not able to change it + // much requested change in forums so people can't 'steal' urls + // NOTE: bug#2009 means this is still vunerable - however, bug + // should be closed since this bug opens up major security issues elsewhere. + bool obscure_music = ! can_change_media && parcel->getObscureMusic(); + + mMusicURLEdit->setDrawAsterixes(obscure_music); mMusicURLEdit->setText(parcel->getMusicURL()); mMusicURLEdit->setEnabled( can_change_media ); } diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 423ee61e25..36fab86280 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -36,6 +36,7 @@ #include "llfloaterreg.h" #include "llmenugl.h" #include "llnotificationsutil.h" +#include "lleventtimer.h" #include "llfiltereditor.h" #include "lltabcontainer.h" #include "lluictrlfactory.h" diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index a49386cb5c..c0491cc00f 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -1023,7 +1023,6 @@ void LLPanelPlaces::showAddedLandmarkInfo(const std::vector<LLUUID>& items) { setItem(item); } - break; } } } diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 2dc3a62637..479769ee20 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -1036,8 +1036,9 @@ void LLPanelPrimMediaControls::updateZoom() } if (zoom_padding > 0.0f) - { - LLViewerMediaFocus::setCameraZoom(getTargetObject(), mTargetObjectNormal, zoom_padding); + { + // since we only zoom into medium for now, always set zoom_in constraint to true + LLViewerMediaFocus::setCameraZoom(getTargetObject(), mTargetObjectNormal, zoom_padding, true); } // Remember the object ID/face we zoomed into, so we can update the zoom icon appropriately diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 786fa24e65..717a8bda1e 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -175,6 +175,11 @@ BOOL LLSpeakerActionTimer::tick() return TRUE; } +void LLSpeakerActionTimer::unset() +{ + mActionCallback = 0; +} + LLSpeakersDelayActionsStorage::LLSpeakersDelayActionsStorage(LLSpeakerActionTimer::action_callback_t action_cb, F32 action_delay) : mActionCallback(action_cb) , mActionDelay(action_delay) @@ -205,7 +210,7 @@ void LLSpeakersDelayActionsStorage::setActionTimer(const LLUUID& speaker_id) } } -void LLSpeakersDelayActionsStorage::unsetActionTimer(const LLUUID& speaker_id, bool delete_it) +void LLSpeakersDelayActionsStorage::unsetActionTimer(const LLUUID& speaker_id) { if (mActionTimersMap.size() == 0) return; @@ -213,10 +218,7 @@ void LLSpeakersDelayActionsStorage::unsetActionTimer(const LLUUID& speaker_id, b if (it_speaker != mActionTimersMap.end()) { - if (delete_it) - { - delete it_speaker->second; - } + it_speaker->second->unset(); mActionTimersMap.erase(it_speaker); } } @@ -233,8 +235,7 @@ void LLSpeakersDelayActionsStorage::removeAllTimers() bool LLSpeakersDelayActionsStorage::onTimerActionCallback(const LLUUID& speaker_id) { - bool delete_it = false; // we're *in* this timer, return true to delete it, don't manually delete it - unsetActionTimer(speaker_id, delete_it); + unsetActionTimer(speaker_id); if (mActionCallback) { @@ -293,9 +294,7 @@ LLPointer<LLSpeaker> LLSpeakerMgr::setSpeaker(const LLUUID& id, const std::strin } } - bool delete_it = true; - mSpeakerDelayRemover->unsetActionTimer(speakerp->mID, delete_it); - + mSpeakerDelayRemover->unsetActionTimer(speakerp->mID); return speakerp; } diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index ddc3632f07..b924fb2f2c 100644 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -34,6 +34,7 @@ #define LL_LLSPEAKERS_H #include "llevent.h" +#include "lleventtimer.h" #include "llspeakers.h" #include "llvoicechannel.h" @@ -155,6 +156,13 @@ public: */ virtual BOOL tick(); + /** + * Clears the callback. + * + * Use this instead of deleteing this object. + * The next call to tick() will return true and that will destroy this object. + */ + void unset(); private: action_callback_t mActionCallback; LLUUID mSpeakerId; @@ -180,7 +188,7 @@ public: * * @see onTimerActionCallback() */ - void unsetActionTimer(const LLUUID& speaker_id, bool delete_it); + void unsetActionTimer(const LLUUID& speaker_id); void removeAllTimers(); private: @@ -188,7 +196,6 @@ private: * Callback of the each instance of LLSpeakerActionTimer. * * Unsets an appropriate timer instance and calls action callback for specified speacker_id. - * It always returns false to not use LLEventTimer::updateClass functionality of timer deleting. * * @see unsetActionTimer() */ diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 7f002db364..d1b91df6e9 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -135,13 +135,14 @@ #include "llsecondlifeurls.h" #include "llselectmgr.h" #include "llsky.h" +#include "llsidetray.h" #include "llstatview.h" -#include "lltrans.h" #include "llstatusbar.h" // sendMoneyBalanceRequest(), owns L$ balance #include "llsurface.h" #include "lltexturecache.h" #include "lltexturefetch.h" #include "lltoolmgr.h" +#include "lltrans.h" #include "llui.h" #include "llurldispatcher.h" #include "llurlsimstring.h" @@ -1201,6 +1202,7 @@ bool idle_startup() display_startup(); LLStartUp::setStartupState( STATE_MULTIMEDIA_INIT ); + return FALSE; } @@ -1707,6 +1709,9 @@ bool idle_startup() // Set the show start location to true, now that the user has logged // on with this install. gSavedSettings.setBOOL("ShowStartLocation", TRUE); + + LLSideTray::getInstance()->showPanel("panel_home", LLSD()); + } // We're successfully logged in. @@ -2559,27 +2564,53 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, // try to find the outfit - if not there, create some default // wearables. - LLInventoryModel::cat_array_t cat_array; - LLInventoryModel::item_array_t item_array; - LLNameCategoryCollector has_name(outfit_folder_name); - gInventory.collectDescendentsIf(gInventory.getLibraryRootFolderID(), - cat_array, - item_array, - LLInventoryModel::EXCLUDE_TRASH, - has_name); - if (0 == cat_array.count()) + LLUUID cat_id = findDescendentCategoryIDByName( + gInventory.getLibraryRootFolderID(), + outfit_folder_name); + if (cat_id.isNull()) { gAgentWearables.createStandardWearables(gender); } else { - LLInventoryCategory* cat = cat_array.get(0); bool do_copy = true; bool do_append = false; + LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id); LLAppearanceManager::instance().wearInventoryCategory(cat, do_copy, do_append); } - LLAppearanceManager::instance().wearOutfitByName(gestures); - LLAppearanceManager::instance().wearOutfitByName(COMMON_GESTURES_FOLDER); + + // Copy gestures + LLUUID dst_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_GESTURE); + LLPointer<LLInventoryCallback> cb(NULL); + LLAppearanceManager *app_mgr = &(LLAppearanceManager::instance()); + + // - Copy gender-specific gestures. + LLUUID gestures_cat_id = findDescendentCategoryIDByName( + gInventory.getLibraryRootFolderID(), + gestures); + if (gestures_cat_id.notNull()) + { + callAfterCategoryFetch(gestures_cat_id, + boost::bind(&LLAppearanceManager::shallowCopyCategory, + app_mgr, + gestures_cat_id, + dst_id, + cb)); + } + + // - Copy common gestures. + LLUUID common_gestures_cat_id = findDescendentCategoryIDByName( + gInventory.getLibraryRootFolderID(), + COMMON_GESTURES_FOLDER); + if (common_gestures_cat_id.notNull()) + { + callAfterCategoryFetch(common_gestures_cat_id, + boost::bind(&LLAppearanceManager::shallowCopyCategory, + app_mgr, + common_gestures_cat_id, + dst_id, + cb)); + } // This is really misnamed -- it means we have started loading // an outfit/shape that will give the avatar a gender eventually. JC diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp index a0ac9c2091..f508a3462a 100644 --- a/indra/newview/llviewermediafocus.cpp +++ b/indra/newview/llviewermediafocus.cpp @@ -157,7 +157,6 @@ void LLViewerMediaFocus::setFocusFace(LLPointer<LLViewerObject> objectp, S32 fac mFocusedObjectFace = 0; } } - } void LLViewerMediaFocus::clearFocus() @@ -198,7 +197,7 @@ bool LLViewerMediaFocus::getFocus() } // This function selects an ideal viewing distance based on the focused object, pick normal, and padding value -void LLViewerMediaFocus::setCameraZoom(LLViewerObject* object, LLVector3 normal, F32 padding_factor) +void LLViewerMediaFocus::setCameraZoom(LLViewerObject* object, LLVector3 normal, F32 padding_factor, bool zoom_in_only) { if (object) { @@ -269,7 +268,16 @@ void LLViewerMediaFocus::setCameraZoom(LLViewerObject* object, LLVector3 normal, camera_pos += 0.01 * len * delta; } + // If we are not allowing zooming out and the old camera position is closer to + // the center then the new intended camera position, don't move camera and return + if (zoom_in_only && + (dist_vec_squared(gAgent.getCameraPositionGlobal(), target_pos) < dist_vec_squared(camera_pos, target_pos))) + { + return; + } + gAgent.setCameraPosAndFocusGlobal(camera_pos, target_pos, object->getID() ); + } else { diff --git a/indra/newview/llviewermediafocus.h b/indra/newview/llviewermediafocus.h index 89ee0ae283..002044ea2e 100644 --- a/indra/newview/llviewermediafocus.h +++ b/indra/newview/llviewermediafocus.h @@ -66,7 +66,7 @@ public: void update(); - static void setCameraZoom(LLViewerObject* object, LLVector3 normal, F32 padding_factor); + static void setCameraZoom(LLViewerObject* object, LLVector3 normal, F32 padding_factor, bool zoom_in_only = false); static F32 getBBoxAspectRatio(const LLBBox& bbox, const LLVector3& normal, F32* height, F32* width, F32* depth); bool isFocusedOnFace(LLPointer<LLViewerObject> objectp, S32 face); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 143d95d27e..c5d3d7cb25 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -38,6 +38,7 @@ #include "llavataractions.h" #include "lscript_byteformat.h" #include "lleconomy.h" +#include "lleventtimer.h" #include "llfloaterreg.h" #include "llfollowcamparams.h" #include "llregionhandle.h" @@ -914,12 +915,13 @@ void open_inventory_offer(const std::vector<LLUUID>& items, const std::string& f { // Landmark creation handling is moved to LLPanelPlaces::showAddedLandmarkInfo() // TODO* LLPanelPlaces dependency is going to be removed. See EXT-4347. - if("create_landmark" == places_panel->getPlaceInfoType() && !places_panel->getItem()) - { - //places_panel->setItem(item); - } + //if("create_landmark" == places_panel->getPlaceInfoType() && !places_panel->getItem()) + //{ + // places_panel->setItem(item); + //} + //else // we are opening a group notice attachment - else + if("create_landmark" != places_panel->getPlaceInfoType()) { LLSD args; args["type"] = "landmark"; diff --git a/indra/newview/llviewerparcelmediaautoplay.h b/indra/newview/llviewerparcelmediaautoplay.h index 1d80b4756c..40142c1dd1 100644 --- a/indra/newview/llviewerparcelmediaautoplay.h +++ b/indra/newview/llviewerparcelmediaautoplay.h @@ -33,7 +33,7 @@ #ifndef LLVIEWERPARCELMEDIAAUTOPLAY_H #define LLVIEWERPARCELMEDIAAUTOPLAY_H -#include "lltimer.h" +#include "lleventtimer.h" #include "lluuid.h" // timer to automatically play media diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index a075a706e1..07c8867e26 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1762,6 +1762,12 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use { optionally_start_music(music_url); } + else + { + llinfos << "Stopping parcel music (invalid audio stream URL)" << llendl; + // clears the URL + gAudiop->startInternetStream(LLStringUtil::null); + } } else if (!gAudiop->getInternetStreamURL().empty()) { diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 1940d65ae4..5edf72d4ae 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -128,10 +128,10 @@ void LLWorldMapView::initClass() sHomeImage = LLUI::getUIImage("map_home.tga"); sTelehubImage = LLUI::getUIImage("map_telehub.tga"); sInfohubImage = LLUI::getUIImage("map_infohub.tga"); - sEventImage = LLUI::getUIImage("map_event.tga"); - sEventMatureImage = LLUI::getUIImage("map_event_mature.tga"); + sEventImage = LLUI::getUIImage("Parcel_PG_Dark"); + sEventMatureImage = LLUI::getUIImage("Parcel_M_Dark"); // To Do: update the image resource for adult events. - sEventAdultImage = LLUI::getUIImage("map_event_adult.tga"); + sEventAdultImage = LLUI::getUIImage("Parcel_R_Dark"); sTrackCircleImage = LLUI::getUIImage("map_track_16.tga"); sTrackArrowImage = LLUI::getUIImage("direction_arrow.tga"); diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 61ca783d14..44c9284b36 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -1825,6 +1825,15 @@ Only large parcels can be listed in search. top_delta="0" right="-15" select_on_focus="true" /> + <check_box + height="16" + label="Hide URL" + layout="topleft" + name="hide_music_url" + tool_tip="Checking this option will hide the music url to any non-authorized viewers of this parcel information." + left_delta="10" + top_pad="5" + width="292" /> <text type="string" length="1" diff --git a/indra/newview/skins/default/xui/en/floater_inventory.xml b/indra/newview/skins/default/xui/en/floater_inventory.xml index e187eabd3a..0d381fe5cb 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory.xml @@ -20,11 +20,11 @@ </floater.string> <floater.string name="TitleFetching"> - Inventory (Fetching [ITEM_COUNT] Items...) [FILTER] + MY INVENTORY (Fetching [ITEM_COUNT] Items...) [FILTER] </floater.string> <floater.string name="TitleCompleted"> - Inventory ([ITEM_COUNT] Items) [FILTER] + MY INVENTORY ([ITEM_COUNT] Items) [FILTER] </floater.string> <floater.string name="Fetched"> diff --git a/indra/newview/skins/default/xui/en/floater_test_inspectors.xml b/indra/newview/skins/default/xui/en/floater_test_inspectors.xml index 0f5c5f2be0..209285da2e 100644 --- a/indra/newview/skins/default/xui/en/floater_test_inspectors.xml +++ b/indra/newview/skins/default/xui/en/floater_test_inspectors.xml @@ -116,10 +116,10 @@ follows="left|top" font="SansSerif" height="20" - left="0" + left="10" max_length="65536" name="slurl" - top_pad="4" + top_pad="20" width="150"> secondlife:///app/agent/00000000-0000-0000-0000-000000000000/inspect </text> @@ -127,12 +127,11 @@ follows="left|top" font="SansSerif" height="20" - left="0" + left="10" max_length="65536" name="slurl_group" - top_pad="4" + top_pad="20" width="150"> secondlife:///app/group/00000000-0000-0000-0000-000000000000/inspect </text> - </floater> diff --git a/indra/newview/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml index 34d4b19410..86ac7c8e54 100644 --- a/indra/newview/skins/default/xui/en/floater_world_map.xml +++ b/indra/newview/skins/default/xui/en/floater_world_map.xml @@ -279,12 +279,12 @@ <icon follows="top|right" height="16" - image_name="map_event.tga" + image_name="Parcel_PG_Dark" layout="topleft" mouse_opaque="true" name="event" left_pad="0" - width="16" /> + width="18" /> <text type="string" length="1" @@ -312,13 +312,13 @@ <icon follows="top|right" height="16" - image_name="map_event_mature.tga" + image_name="Parcel_M_Dark" layout="topleft" mouse_opaque="true" name="events_mature_icon" top_delta="0" left_pad="0" - width="16" /> + width="18" /> <text type="string" length="1" @@ -345,13 +345,13 @@ <icon follows="top|right" height="16" - image_name="map_event_adult.tga" + image_name="Parcel_R_Dark" layout="topleft" left_pad="0" mouse_opaque="true" name="events_adult_icon" top_delta="0" - width="16" /> + width="18" /> <text type="string" length="1" diff --git a/indra/newview/skins/default/xui/en/panel_group_notices.xml b/indra/newview/skins/default/xui/en/panel_group_notices.xml index 5f46ad7860..1f16aea2ef 100644 --- a/indra/newview/skins/default/xui/en/panel_group_notices.xml +++ b/indra/newview/skins/default/xui/en/panel_group_notices.xml @@ -159,6 +159,7 @@ Maximum 200 per group daily left_pad="3" max_length="511" name="create_message" + text_type="ascii" top_delta="0" width="220" word_wrap="true" /> diff --git a/indra/newview/skins/default/xui/en/panel_landmark_info.xml b/indra/newview/skins/default/xui/en/panel_landmark_info.xml index d1b22a34bb..6927906d3d 100644 --- a/indra/newview/skins/default/xui/en/panel_landmark_info.xml +++ b/indra/newview/skins/default/xui/en/panel_landmark_info.xml @@ -269,6 +269,7 @@ name="notes_editor" read_only="true" text_readonly_color="white" + text_type="ascii" top_pad="5" width="290" wrap="true" /> diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 447ac1b123..31ea54cf40 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -237,7 +237,7 @@ If you're looking for people to hang out with, [secondlife:///app/worldmap try t left="0" name="group_list" no_filtered_groups_msg="No groups" - no_groups_msg="[secondlife:///app/search/groups Trying searching for some groups to join.]" + no_groups_msg="[secondlife:///app/search/groups Try searching for some groups to join.]" top="0" width="313" /> <panel |