diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-02-08 14:58:53 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-02-08 14:58:53 -0500 |
commit | 399d70eede54dff2ba6d14b33f85fdad4d33a662 (patch) | |
tree | ce922e0963b8d46c236c4320b574916507fa3b65 | |
parent | 7e1932878563e5847335d5dcb66c9b23232c372c (diff) | |
parent | 19f4240f977fc26d97e686c4e3a1f13b063e191c (diff) |
automated merge viewer2.0->viewer2.0
122 files changed, 1530 insertions, 1185 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/llimage/llimage.cpp b/indra/llimage/llimage.cpp index e02be6c8c1..5649b4cab7 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -676,9 +676,6 @@ void LLImageRaw::copy(LLImageRaw* src) LLImageRaw* dst = this; // Just for clarity. - llassert( (3 == src->getComponents()) || (4 == src->getComponents()) ); - llassert( (3 == dst->getComponents()) || (4 == dst->getComponents()) ); - if( (src->getWidth() == dst->getWidth()) && (src->getHeight() == dst->getHeight()) ) { // No scaling needed diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index 59e7d890f4..22fad792da 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -504,8 +504,13 @@ void LLFontFreetype::resetBitmapCache() mCharGlyphInfoMap.clear(); mFontBitmapCachep->reset(); - // Add the empty glyph - addGlyphFromFont(this, 0, 0); + // Adding default glyph is skipped for fallback fonts here as well as in loadFace(). + // This if was added as fix for EXT-4971. + if(!mIsFallback) + { + // Add the empty glyph + addGlyphFromFont(this, 0, 0); + } } void LLFontFreetype::destroyGL() diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index ce068618e2..853f6f173d 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -90,6 +90,7 @@ set(llui_SOURCE_FILES lltextbox.cpp lltexteditor.cpp lltextparser.cpp + lltextvalidate.cpp lltransutil.cpp lltoggleablemenu.cpp lltooltip.cpp @@ -182,6 +183,7 @@ set(llui_HEADER_FILES lltextbox.h lltexteditor.h lltextparser.h + lltextvalidate.h lltoggleablemenu.h lltooltip.h lltransutil.h diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 14b77925f2..1d4dc35cee 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -81,10 +81,9 @@ LLButton::Params::Params() image_pressed_selected("image_pressed_selected"), image_overlay("image_overlay"), image_overlay_alignment("image_overlay_alignment", std::string("center")), - image_left_pad("image_left_pad"), - image_right_pad("image_right_pad"), image_top_pad("image_top_pad"), image_bottom_pad("image_bottom_pad"), + imgoverlay_label_space("imgoverlay_label_space", 1), label_color("label_color"), label_color_selected("label_color_selected"), // requires is_toggle true label_color_disabled("label_color_disabled"), @@ -144,10 +143,9 @@ LLButton::LLButton(const LLButton::Params& p) mImageOverlay(p.image_overlay()), mImageOverlayColor(p.image_overlay_color()), mImageOverlayAlignment(LLFontGL::hAlignFromName(p.image_overlay_alignment)), - mImageOverlayLeftPad(p.image_left_pad), - mImageOverlayRightPad(p.image_right_pad), mImageOverlayTopPad(p.image_top_pad), mImageOverlayBottomPad(p.image_bottom_pad), + mImgOverlayLabelSpace(p.imgoverlay_label_space), mIsToggle(p.is_toggle), mScaleImage(p.scale_image), mDropShadowedText(p.label_shadow), @@ -783,9 +781,9 @@ void LLButton::draw() switch(mImageOverlayAlignment) { case LLFontGL::LEFT: - text_left += overlay_width + 1; + text_left += overlay_width + mImgOverlayLabelSpace; mImageOverlay->draw( - mImageOverlayLeftPad, + mLeftHPad, center_y - (overlay_height / 2), overlay_width, overlay_height, @@ -800,9 +798,9 @@ void LLButton::draw() overlay_color); break; case LLFontGL::RIGHT: - text_right -= overlay_width + 1; + text_right -= overlay_width + mImgOverlayLabelSpace; mImageOverlay->draw( - getRect().getWidth() - mImageOverlayRightPad - overlay_width, + getRect().getWidth() - mRightHPad - overlay_width, center_y - (overlay_height / 2), overlay_width, overlay_height, diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 8e5f19602f..8f35db1007 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -107,11 +107,14 @@ public: Optional<S32> pad_bottom; // under text label //image overlay paddings - Optional<S32> image_left_pad; - Optional<S32> image_right_pad; Optional<S32> image_top_pad; Optional<S32> image_bottom_pad; + /** + * Space between image_overlay and label + */ + Optional<S32> imgoverlay_label_space; + // callbacks Optional<CommitCallbackParam> click_callback, // alias -> commit_callback mouse_down_callback, @@ -192,10 +195,6 @@ public: void setLeftHPad( S32 pad ) { mLeftHPad = pad; } void setRightHPad( S32 pad ) { mRightHPad = pad; } - void setImageOverlayLeftPad( S32 pad ) { mImageOverlayLeftPad = pad; } - S32 getImageOverlayLeftPad() const { return mImageOverlayLeftPad; } - void setImageOverlayRightPad( S32 pad ) { mImageOverlayRightPad = pad; } - S32 getImageOverlayRightPad() const { return mImageOverlayRightPad; } void setImageOverlayTopPad( S32 pad ) { mImageOverlayTopPad = pad; } S32 getImageOverlayTopPad() const { return mImageOverlayTopPad; } void setImageOverlayBottomPad( S32 pad ) { mImageOverlayBottomPad = pad; } @@ -328,11 +327,14 @@ private: S32 mRightHPad; S32 mBottomVPad; // under text label - S32 mImageOverlayLeftPad; - S32 mImageOverlayRightPad; S32 mImageOverlayTopPad; S32 mImageOverlayBottomPad; + /* + * Space between image_overlay and label + */ + S32 mImgOverlayLabelSpace; + F32 mHoverGlowStrength; F32 mCurGlowStrength; 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/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 30b09352d8..483a394bbd 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -83,19 +83,6 @@ template class LLLineEditor* LLView::getChild<class LLLineEditor>( // Member functions // -void LLLineEditor::PrevalidateNamedFuncs::declareValues() -{ - declare("ascii", LLLineEditor::prevalidateASCII); - declare("float", LLLineEditor::prevalidateFloat); - declare("int", LLLineEditor::prevalidateInt); - declare("positive_s32", LLLineEditor::prevalidatePositiveS32); - declare("non_negative_s32", LLLineEditor::prevalidateNonNegativeS32); - declare("alpha_num", LLLineEditor::prevalidateAlphaNum); - declare("alpha_num_space", LLLineEditor::prevalidateAlphaNumSpace); - declare("ascii_printable_no_pipe", LLLineEditor::prevalidateASCIIPrintableNoPipe); - declare("ascii_printable_no_space", LLLineEditor::prevalidateASCIIPrintableNoSpace); -} - LLLineEditor::Params::Params() : max_length_bytes("max_length", 254), keystroke_callback("keystroke_callback"), @@ -1984,51 +1971,12 @@ void LLLineEditor::setRect(const LLRect& rect) } } -void LLLineEditor::setPrevalidate(LLLinePrevalidateFunc func) +void LLLineEditor::setPrevalidate(LLTextValidate::validate_func_t func) { mPrevalidateFunc = func; updateAllowingLanguageInput(); } -// Limits what characters can be used to [1234567890.-] with [-] only valid in the first position. -// Does NOT ensure that the string is a well-formed number--that's the job of post-validation--for -// the simple reasons that intermediate states may be invalid even if the final result is valid. -// -// static -BOOL LLLineEditor::prevalidateFloat(const LLWString &str) -{ - LLLocale locale(LLLocale::USER_LOCALE); - - BOOL success = TRUE; - LLWString trimmed = str; - LLWStringUtil::trim(trimmed); - S32 len = trimmed.length(); - if( 0 < len ) - { - // May be a comma or period, depending on the locale - llwchar decimal_point = (llwchar)LLResMgr::getInstance()->getDecimalPoint(); - - S32 i = 0; - - // First character can be a negative sign - if( '-' == trimmed[0] ) - { - i++; - } - - for( ; i < len; i++ ) - { - if( (decimal_point != trimmed[i] ) && !LLStringOps::isDigit( trimmed[i] ) ) - { - success = FALSE; - break; - } - } - } - - return success; -} - // static BOOL LLLineEditor::postvalidateFloat(const std::string &str) { @@ -2088,223 +2036,6 @@ BOOL LLLineEditor::postvalidateFloat(const std::string &str) return success; } -// Limits what characters can be used to [1234567890-] with [-] only valid in the first position. -// Does NOT ensure that the string is a well-formed number--that's the job of post-validation--for -// the simple reasons that intermediate states may be invalid even if the final result is valid. -// -// static -BOOL LLLineEditor::prevalidateInt(const LLWString &str) -{ - LLLocale locale(LLLocale::USER_LOCALE); - - BOOL success = TRUE; - LLWString trimmed = str; - LLWStringUtil::trim(trimmed); - S32 len = trimmed.length(); - if( 0 < len ) - { - S32 i = 0; - - // First character can be a negative sign - if( '-' == trimmed[0] ) - { - i++; - } - - for( ; i < len; i++ ) - { - if( !LLStringOps::isDigit( trimmed[i] ) ) - { - success = FALSE; - break; - } - } - } - - return success; -} - -// static -BOOL LLLineEditor::prevalidatePositiveS32(const LLWString &str) -{ - LLLocale locale(LLLocale::USER_LOCALE); - - LLWString trimmed = str; - LLWStringUtil::trim(trimmed); - S32 len = trimmed.length(); - BOOL success = TRUE; - if(0 < len) - { - if(('-' == trimmed[0]) || ('0' == trimmed[0])) - { - success = FALSE; - } - S32 i = 0; - while(success && (i < len)) - { - if(!LLStringOps::isDigit(trimmed[i++])) - { - success = FALSE; - } - } - } - if (success) - { - S32 val = strtol(wstring_to_utf8str(trimmed).c_str(), NULL, 10); - if (val <= 0) - { - success = FALSE; - } - } - return success; -} - -BOOL LLLineEditor::prevalidateNonNegativeS32(const LLWString &str) -{ - LLLocale locale(LLLocale::USER_LOCALE); - - LLWString trimmed = str; - LLWStringUtil::trim(trimmed); - S32 len = trimmed.length(); - BOOL success = TRUE; - if(0 < len) - { - if('-' == trimmed[0]) - { - success = FALSE; - } - S32 i = 0; - while(success && (i < len)) - { - if(!LLStringOps::isDigit(trimmed[i++])) - { - success = FALSE; - } - } - } - if (success) - { - S32 val = strtol(wstring_to_utf8str(trimmed).c_str(), NULL, 10); - if (val < 0) - { - success = FALSE; - } - } - return success; -} - -BOOL LLLineEditor::prevalidateAlphaNum(const LLWString &str) -{ - LLLocale locale(LLLocale::USER_LOCALE); - - BOOL rv = TRUE; - S32 len = str.length(); - if(len == 0) return rv; - while(len--) - { - if( !LLStringOps::isAlnum((char)str[len]) ) - { - rv = FALSE; - break; - } - } - return rv; -} - -// static -BOOL LLLineEditor::prevalidateAlphaNumSpace(const LLWString &str) -{ - LLLocale locale(LLLocale::USER_LOCALE); - - BOOL rv = TRUE; - S32 len = str.length(); - if(len == 0) return rv; - while(len--) - { - if(!(LLStringOps::isAlnum((char)str[len]) || (' ' == str[len]))) - { - rv = FALSE; - break; - } - } - return rv; -} - -// Used for most names of things stored on the server, due to old file-formats -// that used the pipe (|) for multiline text storage. Examples include -// inventory item names, parcel names, object names, etc. -// static -BOOL LLLineEditor::prevalidateASCIIPrintableNoPipe(const LLWString &str) -{ - BOOL rv = TRUE; - S32 len = str.length(); - if(len == 0) return rv; - while(len--) - { - llwchar wc = str[len]; - if (wc < 0x20 - || wc > 0x7f - || wc == '|') - { - rv = FALSE; - break; - } - if(!(wc == ' ' - || LLStringOps::isAlnum((char)wc) - || LLStringOps::isPunct((char)wc) ) ) - { - rv = FALSE; - break; - } - } - return rv; -} - - -// Used for avatar names -// static -BOOL LLLineEditor::prevalidateASCIIPrintableNoSpace(const LLWString &str) -{ - BOOL rv = TRUE; - S32 len = str.length(); - if(len == 0) return rv; - while(len--) - { - llwchar wc = str[len]; - if (wc < 0x20 - || wc > 0x7f - || LLStringOps::isSpace(wc)) - { - rv = FALSE; - break; - } - if( !(LLStringOps::isAlnum((char)str[len]) || - LLStringOps::isPunct((char)str[len]) ) ) - { - rv = FALSE; - break; - } - } - return rv; -} - - -// static -BOOL LLLineEditor::prevalidateASCII(const LLWString &str) -{ - BOOL rv = TRUE; - S32 len = str.length(); - while(len--) - { - if (str[len] < 0x20 || str[len] > 0x7f) - { - rv = FALSE; - break; - } - } - return rv; -} - void LLLineEditor::onMouseCaptureLost() { endSelection(); diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index f275dfc45a..b62138426b 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -51,27 +51,18 @@ #include "llviewborder.h" #include "llpreeditor.h" -#include <boost/function.hpp> +#include "lltextvalidate.h" class LLFontGL; class LLLineEditorRollback; class LLButton; class LLContextMenu; -typedef boost::function<BOOL (const LLWString &wstr)> LLLinePrevalidateFunc; - class LLLineEditor : public LLUICtrl, public LLEditMenuHandler, protected LLPreeditor { public: - struct PrevalidateNamedFuncs - : public LLInitParam::TypeValuesHelper<LLLinePrevalidateFunc, PrevalidateNamedFuncs> - - { - static void declareValues(); - }; - typedef boost::function<void (LLLineEditor* caller)> keystroke_callback_t; struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> @@ -81,7 +72,7 @@ public: Optional<keystroke_callback_t> keystroke_callback; - Optional<LLLinePrevalidateFunc, PrevalidateNamedFuncs> prevalidate_callback; + Optional<LLTextValidate::validate_func_t, LLTextValidate::ValidateTextNamedFuncs> prevalidate_callback; Optional<LLViewBorder::Params> border; @@ -236,17 +227,7 @@ public: void setTextPadding(S32 left, S32 right); // Prevalidation controls which keystrokes can affect the editor - void setPrevalidate( LLLinePrevalidateFunc func ); - static BOOL prevalidateFloat(const LLWString &str ); - static BOOL prevalidateInt(const LLWString &str ); - static BOOL prevalidatePositiveS32(const LLWString &str); - static BOOL prevalidateNonNegativeS32(const LLWString &str); - static BOOL prevalidateAlphaNum(const LLWString &str ); - static BOOL prevalidateAlphaNumSpace(const LLWString &str ); - static BOOL prevalidateASCIIPrintableNoPipe(const LLWString &str); - static BOOL prevalidateASCIIPrintableNoSpace(const LLWString &str); - static BOOL prevalidateASCII(const LLWString &str); - + void setPrevalidate( LLTextValidate::validate_func_t func ); static BOOL postvalidateFloat(const std::string &str); // line history support: @@ -326,7 +307,7 @@ protected: S32 mLastSelectionStart; S32 mLastSelectionEnd; - LLLinePrevalidateFunc mPrevalidateFunc; + LLTextValidate::validate_func_t mPrevalidateFunc; LLFrameTimer mKeystrokeTimer; LLTimer mTripleClickTimer; 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/llmultisliderctrl.cpp b/indra/llui/llmultisliderctrl.cpp index f4434a0f78..cb81c39103 100644 --- a/indra/llui/llmultisliderctrl.cpp +++ b/indra/llui/llmultisliderctrl.cpp @@ -138,7 +138,7 @@ LLMultiSliderCtrl::LLMultiSliderCtrl(const LLMultiSliderCtrl::Params& p) params.font(p.font); params.max_length_bytes(MAX_STRING_LENGTH); params.commit_callback.function(LLMultiSliderCtrl::onEditorCommit); - params.prevalidate_callback(&LLLineEditor::prevalidateFloat); + params.prevalidate_callback(&LLTextValidate::validateFloat); params.follows.flags(FOLLOWS_LEFT | FOLLOWS_BOTTOM); mEditor = LLUICtrlFactory::create<LLLineEditor> (params); mEditor->setFocusReceivedCallback( boost::bind(LLMultiSliderCtrl::onEditorGainFocus, _1, this) ); diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 7f23fe2671..7b406e090a 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -936,7 +936,7 @@ LLPanel *LLPanel::childGetVisiblePanelWithHelp() return ::childGetVisiblePanelWithHelp(this); } -void LLPanel::childSetPrevalidate(const std::string& id, BOOL (*func)(const LLWString &) ) +void LLPanel::childSetPrevalidate(const std::string& id, bool (*func)(const LLWString &) ) { LLLineEditor* child = findChild<LLLineEditor>(id); if (child) diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index 6de83fe3a7..4e53fd7ea3 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -226,7 +226,7 @@ public: std::string childGetText(const std::string& id) const { return childGetValue(id).asString(); } // LLLineEditor - void childSetPrevalidate(const std::string& id, BOOL (*func)(const LLWString &) ); + void childSetPrevalidate(const std::string& id, bool (*func)(const LLWString &) ); // LLButton void childSetAction(const std::string& id, boost::function<void(void*)> function, void* value = NULL); diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp index 01c274bb4e..80ee5d0984 100644 --- a/indra/llui/llsliderctrl.cpp +++ b/indra/llui/llsliderctrl.cpp @@ -141,7 +141,7 @@ LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p) line_p.rect.setIfNotProvided(text_rect); line_p.font.setIfNotProvided(p.font); line_p.commit_callback.function(&LLSliderCtrl::onEditorCommit); - line_p.prevalidate_callback(&LLLineEditor::prevalidateFloat); + line_p.prevalidate_callback(&LLTextValidate::validateFloat); mEditor = LLUICtrlFactory::create<LLLineEditor>(line_p); mEditor->setFocusReceivedCallback( boost::bind(&LLSliderCtrl::onEditorGainFocus, _1, this )); diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp index 28f3788817..491cd7b6f3 100644 --- a/indra/llui/llspinctrl.cpp +++ b/indra/llui/llspinctrl.cpp @@ -127,7 +127,7 @@ LLSpinCtrl::LLSpinCtrl(const LLSpinCtrl::Params& p) } params.max_length_bytes(MAX_STRING_LENGTH); params.commit_callback.function((boost::bind(&LLSpinCtrl::onEditorCommit, this, _2))); - params.prevalidate_callback(&LLLineEditor::prevalidateFloat); + params.prevalidate_callback(&LLTextValidate::validateFloat); params.follows.flags(FOLLOWS_LEFT | FOLLOWS_BOTTOM); mEditor = LLUICtrlFactory::create<LLLineEditor> (params); mEditor->setFocusReceivedCallback( boost::bind(&LLSpinCtrl::onEditorGainFocus, _1, this )); diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 19408989a5..ef9d195a19 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -1628,15 +1628,11 @@ void LLTabContainer::setTabImage(LLPanel* child, LLIconCtrl* icon) void LLTabContainer::reshapeTuple(LLTabTuple* tuple) { static LLUICachedControl<S32> tab_padding ("UITabPadding", 0); - static LLUICachedControl<S32> image_left_padding ("UIButtonImageLeftPadding", 4); - static LLUICachedControl<S32> image_right_padding ("UIButtonImageRightPadding", 4); static LLUICachedControl<S32> image_top_padding ("UIButtonImageTopPadding", 2); static LLUICachedControl<S32> image_bottom_padding ("UIButtonImageBottomPadding", 2); if (!mIsVertical) { - tuple->mButton->setImageOverlayLeftPad(image_left_padding); - tuple->mButton->setImageOverlayRightPad(image_right_padding); tuple->mButton->setImageOverlayTopPad(image_top_padding); tuple->mButton->setImageOverlayBottomPad(image_bottom_padding); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 2b1e2b8226..b84e6f45fb 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1137,6 +1137,7 @@ void LLTextBase::reflow() line_list_t::iterator iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), start_index, line_end_compare()); line_start_index = iter->mDocIndexStart; line_count = iter->mLineNum; + cur_top = iter->mRect.mTop; getSegmentAndOffset(iter->mDocIndexStart, &seg_iter, &seg_offset); mLineInfoList.erase(iter, mLineInfoList.end()); } @@ -1574,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; } } @@ -2296,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/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index ac5a0376fc..ad9f066539 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -237,6 +237,7 @@ private: /////////////////////////////////////////////////////////////////// LLTextEditor::Params::Params() : default_text("default_text"), + prevalidate_callback("prevalidate_callback"), embedded_items("embedded_items", false), ignore_tab("ignore_tab", true), handle_edit_keys_directly("handle_edit_keys_directly", false), @@ -244,7 +245,9 @@ LLTextEditor::Params::Params() default_color("default_color"), commit_on_focus_lost("commit_on_focus_lost", false), show_context_menu("show_context_menu") -{} +{ + addSynonym(prevalidate_callback, "text_type"); +} LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) : LLTextBase(p), @@ -259,6 +262,7 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) : mMouseDownX(0), mMouseDownY(0), mTabsToNextField(p.ignore_tab), + mPrevalidateFunc(p.prevalidate_callback()), mContextMenu(NULL), mShowContextMenu(p.show_context_menu) { @@ -320,6 +324,17 @@ LLTextEditor::~LLTextEditor() void LLTextEditor::setText(const LLStringExplicit &utf8str, const LLStyle::Params& input_params) { + // validate incoming text if necessary + if (mPrevalidateFunc) + { + LLWString test_text = utf8str_to_wstring(utf8str); + if (!mPrevalidateFunc(test_text)) + { + // not valid text, nothing to do + return; + } + } + blockUndo(); deselect(); @@ -911,6 +926,21 @@ S32 LLTextEditor::execute( TextCmd* cmd ) // Push the new command is now on the top (front) of the undo stack. mUndoStack.push_front(cmd); mLastCmd = cmd; + + bool need_to_rollback = mPrevalidateFunc + && !mPrevalidateFunc(getViewModel()->getDisplay()); + if (need_to_rollback) + { + // get rid of this last command and clean up undo stack + undo(); + + // remove any evidence of this command from redo history + mUndoStack.pop_front(); + delete cmd; + + // failure, nothing changed + delta = 0; + } } else { @@ -1034,7 +1064,21 @@ S32 LLTextEditor::addChar(S32 pos, llwchar wc) if (mLastCmd && mLastCmd->canExtend(pos)) { S32 delta = 0; + if (mPrevalidateFunc) + { + // get a copy of current text contents + LLWString test_string(getViewModel()->getDisplay()); + + // modify text contents as if this addChar succeeded + llassert(pos <= (S32)test_string.size()); + test_string.insert(pos, 1, wc); + if (!mPrevalidateFunc( test_string)) + { + return 0; + } + } mLastCmd->extendAndExecute(this, pos, wc, &delta); + return delta; } else diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index d96198d9ce..00c6a8b68a 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -44,6 +44,7 @@ #include "lldarray.h" #include "llviewborder.h" // for params #include "lltextbase.h" +#include "lltextvalidate.h" #include "llpreeditor.h" #include "llcontrol.h" @@ -63,6 +64,7 @@ public: struct Params : public LLInitParam::Block<Params, LLTextBase::Params> { Optional<std::string> default_text; + Optional<LLTextValidate::validate_func_t, LLTextValidate::ValidateTextNamedFuncs> prevalidate_callback; Optional<bool> embedded_items, ignore_tab, @@ -334,6 +336,7 @@ private: LLCoordGL mLastIMEPosition; // Last position of the IME editor keystroke_signal_t mKeystrokeSignal; + LLTextValidate::validate_func_t mPrevalidateFunc; LLContextMenu* mContextMenu; }; // end class LLTextEditor diff --git a/indra/llui/lltextvalidate.cpp b/indra/llui/lltextvalidate.cpp new file mode 100644 index 0000000000..8b6bc5bd7d --- /dev/null +++ b/indra/llui/lltextvalidate.cpp @@ -0,0 +1,302 @@ +/** + * @file lltextvalidate.cpp + * @brief Text validation helper functions + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("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$ + */ + +// Text editor widget to let users enter a single line. + +#include "linden_common.h" + +#include "lltextvalidate.h" +#include "llresmgr.h" // for LLLocale + +namespace LLTextValidate +{ + void ValidateTextNamedFuncs::declareValues() + { + declare("ascii", validateASCII); + declare("float", validateFloat); + declare("int", validateInt); + declare("positive_s32", validatePositiveS32); + declare("non_negative_s32", validateNonNegativeS32); + declare("alpha_num", validateAlphaNum); + declare("alpha_num_space", validateAlphaNumSpace); + declare("ascii_printable_no_pipe", validateASCIIPrintableNoPipe); + declare("ascii_printable_no_space", validateASCIIPrintableNoSpace); + } + + // Limits what characters can be used to [1234567890.-] with [-] only valid in the first position. + // Does NOT ensure that the string is a well-formed number--that's the job of post-validation--for + // the simple reasons that intermediate states may be invalid even if the final result is valid. + // + bool validateFloat(const LLWString &str) + { + LLLocale locale(LLLocale::USER_LOCALE); + + bool success = TRUE; + LLWString trimmed = str; + LLWStringUtil::trim(trimmed); + S32 len = trimmed.length(); + if( 0 < len ) + { + // May be a comma or period, depending on the locale + llwchar decimal_point = (llwchar)LLResMgr::getInstance()->getDecimalPoint(); + + S32 i = 0; + + // First character can be a negative sign + if( '-' == trimmed[0] ) + { + i++; + } + + for( ; i < len; i++ ) + { + if( (decimal_point != trimmed[i] ) && !LLStringOps::isDigit( trimmed[i] ) ) + { + success = FALSE; + break; + } + } + } + + return success; + } + + // Limits what characters can be used to [1234567890-] with [-] only valid in the first position. + // Does NOT ensure that the string is a well-formed number--that's the job of post-validation--for + // the simple reasons that intermediate states may be invalid even if the final result is valid. + // + bool validateInt(const LLWString &str) + { + LLLocale locale(LLLocale::USER_LOCALE); + + bool success = TRUE; + LLWString trimmed = str; + LLWStringUtil::trim(trimmed); + S32 len = trimmed.length(); + if( 0 < len ) + { + S32 i = 0; + + // First character can be a negative sign + if( '-' == trimmed[0] ) + { + i++; + } + + for( ; i < len; i++ ) + { + if( !LLStringOps::isDigit( trimmed[i] ) ) + { + success = FALSE; + break; + } + } + } + + return success; + } + + bool validatePositiveS32(const LLWString &str) + { + LLLocale locale(LLLocale::USER_LOCALE); + + LLWString trimmed = str; + LLWStringUtil::trim(trimmed); + S32 len = trimmed.length(); + bool success = TRUE; + if(0 < len) + { + if(('-' == trimmed[0]) || ('0' == trimmed[0])) + { + success = FALSE; + } + S32 i = 0; + while(success && (i < len)) + { + if(!LLStringOps::isDigit(trimmed[i++])) + { + success = FALSE; + } + } + } + if (success) + { + S32 val = strtol(wstring_to_utf8str(trimmed).c_str(), NULL, 10); + if (val <= 0) + { + success = FALSE; + } + } + return success; + } + + bool validateNonNegativeS32(const LLWString &str) + { + LLLocale locale(LLLocale::USER_LOCALE); + + LLWString trimmed = str; + LLWStringUtil::trim(trimmed); + S32 len = trimmed.length(); + bool success = TRUE; + if(0 < len) + { + if('-' == trimmed[0]) + { + success = FALSE; + } + S32 i = 0; + while(success && (i < len)) + { + if(!LLStringOps::isDigit(trimmed[i++])) + { + success = FALSE; + } + } + } + if (success) + { + S32 val = strtol(wstring_to_utf8str(trimmed).c_str(), NULL, 10); + if (val < 0) + { + success = FALSE; + } + } + return success; + } + + bool validateAlphaNum(const LLWString &str) + { + LLLocale locale(LLLocale::USER_LOCALE); + + bool rv = TRUE; + S32 len = str.length(); + if(len == 0) return rv; + while(len--) + { + if( !LLStringOps::isAlnum((char)str[len]) ) + { + rv = FALSE; + break; + } + } + return rv; + } + + bool validateAlphaNumSpace(const LLWString &str) + { + LLLocale locale(LLLocale::USER_LOCALE); + + bool rv = TRUE; + S32 len = str.length(); + if(len == 0) return rv; + while(len--) + { + if(!(LLStringOps::isAlnum((char)str[len]) || (' ' == str[len]))) + { + rv = FALSE; + break; + } + } + return rv; + } + + // Used for most names of things stored on the server, due to old file-formats + // that used the pipe (|) for multiline text storage. Examples include + // inventory item names, parcel names, object names, etc. + bool validateASCIIPrintableNoPipe(const LLWString &str) + { + bool rv = TRUE; + S32 len = str.length(); + if(len == 0) return rv; + while(len--) + { + llwchar wc = str[len]; + if (wc < 0x20 + || wc > 0x7f + || wc == '|') + { + rv = FALSE; + break; + } + if(!(wc == ' ' + || LLStringOps::isAlnum((char)wc) + || LLStringOps::isPunct((char)wc) ) ) + { + rv = FALSE; + break; + } + } + return rv; + } + + + // Used for avatar names + bool validateASCIIPrintableNoSpace(const LLWString &str) + { + bool rv = TRUE; + S32 len = str.length(); + if(len == 0) return rv; + while(len--) + { + llwchar wc = str[len]; + if (wc < 0x20 + || wc > 0x7f + || LLStringOps::isSpace(wc)) + { + rv = FALSE; + break; + } + if( !(LLStringOps::isAlnum((char)str[len]) || + LLStringOps::isPunct((char)str[len]) ) ) + { + rv = FALSE; + break; + } + } + return rv; + } + + bool validateASCII(const LLWString &str) + { + bool rv = TRUE; + S32 len = str.length(); + while(len--) + { + if (str[len] < 0x20 || str[len] > 0x7f) + { + rv = FALSE; + break; + } + } + return rv; + } +} diff --git a/indra/llui/lltextvalidate.h b/indra/llui/lltextvalidate.h new file mode 100644 index 0000000000..ffb4e85e7c --- /dev/null +++ b/indra/llui/lltextvalidate.h @@ -0,0 +1,63 @@ +/** + * @file lltextbase.h + * @author Martin Reddy + * @brief The base class of text box/editor, providing Url handling support + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 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_LLTEXTVALIDATE_H +#define LL_LLTEXTVALIDATE_H + +#include "llstring.h" +#include "llinitparam.h" +#include <boost/function.hpp> + +namespace LLTextValidate +{ + typedef boost::function<BOOL (const LLWString &wstr)> validate_func_t; + + struct ValidateTextNamedFuncs + : public LLInitParam::TypeValuesHelper<validate_func_t, ValidateTextNamedFuncs> + { + static void declareValues(); + }; + + bool validateFloat(const LLWString &str ); + bool validateInt(const LLWString &str ); + bool validatePositiveS32(const LLWString &str); + bool validateNonNegativeS32(const LLWString &str); + bool validateAlphaNum(const LLWString &str ); + bool validateAlphaNumSpace(const LLWString &str ); + bool validateASCIIPrintableNoPipe(const LLWString &str); + bool validateASCIIPrintableNoSpace(const LLWString &str); + bool validateASCII(const LLWString &str); +} + + +#endif diff --git a/indra/llui/lltooltip.h b/indra/llui/lltooltip.h index 7978b6a583..c0811c56c3 100644 --- a/indra/llui/lltooltip.h +++ b/indra/llui/lltooltip.h @@ -129,7 +129,8 @@ private: class LLInspector : public LLToolTip { public: - struct Params : public LLInitParam::Block<Params, LLToolTip::Params> {}; + struct Params : public LLInitParam::Block<Params, LLToolTip::Params> + {}; }; class LLToolTipMgr : public LLSingleton<LLToolTipMgr> 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/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 923ba44906..a32f0d046e 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9938,28 +9938,6 @@ <key>Value</key> <integer>15</integer> </map> - <key>UIButtonImageLeftPadding</key> - <map> - <key>Comment</key> - <string>Button Overlay Image Left Padding</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>4</integer> - </map> - <key>UIButtonImageRightPadding</key> - <map> - <key>Comment</key> - <string>Button Overlay Image Right Padding</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>4</integer> - </map> <key>UIButtonImageTopPadding</key> <map> <key>Comment</key> 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 2d694eefd3..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" @@ -1353,9 +1354,6 @@ bool LLAppViewer::cleanup() llinfos << "Cache files removed" << llendflush; - - cleanup_menus(); - // Wait for any pending VFS IO while (1) { @@ -2365,9 +2363,6 @@ bool LLAppViewer::initWindow() // store setting in a global for easy access and modification gNoRender = gSavedSettings.getBOOL("DisableRendering"); - // Hide the splash screen - LLSplashScreen::hide(); - // always start windowed BOOL ignorePixelDepth = gSavedSettings.getBOOL("IgnorePixelDepth"); gViewerWindow = new LLViewerWindow(gWindowTitle, 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 f046e08827..929457046c 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -262,7 +262,7 @@ public: mSourceType = CHAT_SOURCE_SYSTEM; } - LLTextEditor* userName = getChild<LLTextEditor>("user_name"); + LLTextBox* userName = getChild<LLTextBox>("user_name"); userName->setReadOnlyColor(style_params.readonly_color()); userName->setColor(style_params.color()); @@ -300,7 +300,7 @@ public: /*virtual*/ void draw() { - LLTextEditor* user_name = getChild<LLTextEditor>("user_name"); + LLTextBox* user_name = getChild<LLTextBox>("user_name"); LLTextBox* time_box = getChild<LLTextBox>("time_box"); LLRect user_name_rect = user_name->getRect(); @@ -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..8efa814a2e 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" @@ -1158,10 +1159,10 @@ void im_chiclet_callback(LLChicletPanel* panel, const LLSD& data){ void object_chiclet_callback(const LLSD& data) { - LLUUID object_id = data["object_id"]; + LLUUID notification_id = data["notification_id"]; bool new_message = data["new_message"]; - std::list<LLChiclet*> chiclets = LLIMChiclet::sFindChicletsSignal(object_id); + std::list<LLChiclet*> chiclets = LLIMChiclet::sFindChicletsSignal(notification_id); std::list<LLChiclet *>::iterator iter; for (iter = chiclets.begin(); iter != chiclets.end(); iter++) { @@ -1893,12 +1894,8 @@ void LLScriptChiclet::setSessionId(const LLUUID& session_id) setShowNewMessagesIcon( getSessionId() != session_id ); LLIMChiclet::setSessionId(session_id); - LLUUID notification_id = LLScriptFloaterManager::getInstance()->findNotificationId(session_id); - LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id); - if(notification) - { - setToolTip(notification->getSubstitutions()["TITLE"].asString()); - } + + setToolTip(LLScriptFloaterManager::getObjectName(session_id)); } void LLScriptChiclet::setCounter(S32 counter) @@ -1947,13 +1944,10 @@ void LLInvOfferChiclet::setSessionId(const LLUUID& session_id) { setShowNewMessagesIcon( getSessionId() != session_id ); + setToolTip(LLScriptFloaterManager::getObjectName(session_id)); + LLIMChiclet::setSessionId(session_id); - LLUUID notification_id = LLScriptFloaterManager::getInstance()->findNotificationId(session_id); - LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id); - if(notification) - { - setToolTip(notification->getSubstitutions()["TITLE"].asString()); - } + LLNotificationPtr notification = LLNotifications::getInstance()->find(session_id); if ( notification && notification->getName() == INVENTORY_USER_OFFER ) { diff --git a/indra/newview/llcurrencyuimanager.cpp b/indra/newview/llcurrencyuimanager.cpp index 00c05445e1..be6c15eab4 100644 --- a/indra/newview/llcurrencyuimanager.cpp +++ b/indra/newview/llcurrencyuimanager.cpp @@ -426,7 +426,7 @@ void LLCurrencyUIManager::Impl::prepare() LLLineEditor* lindenAmount = mPanel.getChild<LLLineEditor>("currency_amt"); if (lindenAmount) { - lindenAmount->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32); + lindenAmount->setPrevalidate(LLTextValidate::validateNonNegativeS32); lindenAmount->setKeystrokeCallback(onCurrencyKey, this); } } 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/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index 9496e94780..ecb6254f8a 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -65,7 +65,7 @@ public: LLPanelCameraZoom(); /* virtual */ BOOL postBuild(); - /* virtual */ void onOpen(const LLSD& key); + /* virtual */ void draw(); protected: void onZoomPlusHeldDown(); @@ -73,7 +73,6 @@ protected: void onSliderValueChanged(); private: - F32 mSavedSliderVal; LLButton* mPlusBtn; LLButton* mMinusBtn; LLSlider* mSlider; @@ -88,8 +87,7 @@ static LLRegisterPanelClassWrapper<LLPanelCameraZoom> t_camera_zoom_panel("camer LLPanelCameraZoom::LLPanelCameraZoom() : mPlusBtn( NULL ), mMinusBtn( NULL ), - mSlider( NULL ), - mSavedSliderVal(0.f) + mSlider( NULL ) { mCommitCallbackRegistrar.add("Zoom.minus", boost::bind(&LLPanelCameraZoom::onZoomPlusHeldDown, this)); mCommitCallbackRegistrar.add("Zoom.plus", boost::bind(&LLPanelCameraZoom::onZoomMinusHeldDown, this)); @@ -101,16 +99,13 @@ BOOL LLPanelCameraZoom::postBuild() mPlusBtn = getChild <LLButton> ("zoom_plus_btn"); mMinusBtn = getChild <LLButton> ("zoom_minus_btn"); mSlider = getChild <LLSlider> ("zoom_slider"); - mSlider->setMinValue(.0f); - mSlider->setMaxValue(8.f); return LLPanel::postBuild(); } -void LLPanelCameraZoom::onOpen(const LLSD& key) +void LLPanelCameraZoom::draw() { - LLVector3d to_focus = gAgent.getPosGlobalFromAgent(LLViewerCamera::getInstance()->getOrigin()) - gAgent.calcFocusPositionTargetGlobal(); - mSavedSliderVal = 8.f - (F32)to_focus.magVec(); // maximum minus current - mSlider->setValue( mSavedSliderVal ); + mSlider->setValue(gAgent.getCameraZoomFraction()); + LLPanel::draw(); } void LLPanelCameraZoom::onZoomPlusHeldDown() @@ -135,13 +130,8 @@ void LLPanelCameraZoom::onZoomMinusHeldDown() void LLPanelCameraZoom::onSliderValueChanged() { - F32 val = mSlider->getValueF32(); - F32 rate = val - mSavedSliderVal; - - gAgent.unlockView(); - gAgent.cameraOrbitIn(rate); - - mSavedSliderVal = val; + F32 zoom_level = mSlider->getValueF32(); + gAgent.setCameraZoomFraction(zoom_level); } void activate_camera_tool() 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/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index c2b0bd18fa..5294f09e64 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -414,17 +414,17 @@ LLPanelRegionTools::LLPanelRegionTools() BOOL LLPanelRegionTools::postBuild() { getChild<LLLineEditor>("region name")->setKeystrokeCallback(onChangeSimName, this); - childSetPrevalidate("region name", &LLLineEditor::prevalidateASCIIPrintableNoPipe); - childSetPrevalidate("estate", &LLLineEditor::prevalidatePositiveS32); - childSetPrevalidate("parentestate", &LLLineEditor::prevalidatePositiveS32); + childSetPrevalidate("region name", &LLTextValidate::validateASCIIPrintableNoPipe); + childSetPrevalidate("estate", &LLTextValidate::validatePositiveS32); + childSetPrevalidate("parentestate", &LLTextValidate::validatePositiveS32); childDisable("parentestate"); - childSetPrevalidate("gridposx", &LLLineEditor::prevalidatePositiveS32); + childSetPrevalidate("gridposx", &LLTextValidate::validatePositiveS32); childDisable("gridposx"); - childSetPrevalidate("gridposy", &LLLineEditor::prevalidatePositiveS32); + childSetPrevalidate("gridposy", &LLTextValidate::validatePositiveS32); childDisable("gridposy"); - childSetPrevalidate("redirectx", &LLLineEditor::prevalidatePositiveS32); - childSetPrevalidate("redirecty", &LLLineEditor::prevalidatePositiveS32); + childSetPrevalidate("redirectx", &LLTextValidate::validatePositiveS32); + childSetPrevalidate("redirecty", &LLTextValidate::validatePositiveS32); return TRUE; } diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 8cd63deebe..26c6db9652 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -353,7 +353,7 @@ BOOL LLPanelLandGeneral::postBuild() { mEditName = getChild<LLLineEditor>("Name"); mEditName->setCommitCallback(onCommitAny, this); - childSetPrevalidate("Name", LLLineEditor::prevalidateASCIIPrintableNoPipe); + childSetPrevalidate("Name", LLTextValidate::validateASCIIPrintableNoPipe); mEditDesc = getChild<LLTextEditor>("Description"); mEditDesc->setCommitOnFocusLost(TRUE); @@ -1111,7 +1111,7 @@ BOOL LLPanelLandObjects::postBuild() mCleanOtherObjectsTime->setFocusLostCallback(boost::bind(onLostFocus, _1, this)); mCleanOtherObjectsTime->setCommitCallback(onCommitClean, this); - childSetPrevalidate("clean other time", LLLineEditor::prevalidateNonNegativeS32); + childSetPrevalidate("clean other time", LLTextValidate::validateNonNegativeS32); mBtnRefresh = getChild<LLButton>("Refresh List"); mBtnRefresh->setClickedCallback(onClickRefresh, this); diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp index 810761e034..159ce41b79 100644 --- a/indra/newview/llfloaternamedesc.cpp +++ b/indra/newview/llfloaternamedesc.cpp @@ -111,7 +111,7 @@ BOOL LLFloaterNameDesc::postBuild() if (NameEditor) { NameEditor->setMaxTextLength(DB_INV_ITEM_NAME_STR_LEN); - NameEditor->setPrevalidate(&LLLineEditor::prevalidateASCIIPrintableNoPipe); + NameEditor->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); } y -= llfloor(PREVIEW_LINE_HEIGHT * 1.2f); @@ -123,7 +123,7 @@ BOOL LLFloaterNameDesc::postBuild() if (DescEditor) { DescEditor->setMaxTextLength(DB_INV_ITEM_DESC_STR_LEN); - DescEditor->setPrevalidate(&LLLineEditor::prevalidateASCIIPrintableNoPipe); + DescEditor->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); } y -= llfloor(PREVIEW_LINE_HEIGHT * 1.2f); diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index 00959322e5..51364594e4 100644 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -204,7 +204,7 @@ BOOL LLFloaterPay::postBuild() getChild<LLLineEditor>("amount")->setKeystrokeCallback(&LLFloaterPay::onKeystroke, this); childSetText("amount", last_amount); - childSetPrevalidate("amount", LLLineEditor::prevalidateNonNegativeS32); + childSetPrevalidate("amount", LLTextValidate::validateNonNegativeS32); info = new LLGiveMoneyInfo(this, 0); mCallbackData.push_back(info); diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index ff9002787c..bde86a4034 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -130,9 +130,9 @@ BOOL LLFloaterProperties::postBuild() { // build the UI // item name & description - childSetPrevalidate("LabelItemName",&LLLineEditor::prevalidateASCIIPrintableNoPipe); + childSetPrevalidate("LabelItemName",&LLTextValidate::validateASCIIPrintableNoPipe); getChild<LLUICtrl>("LabelItemName")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitName,this)); - childSetPrevalidate("LabelItemDesc",&LLLineEditor::prevalidateASCIIPrintableNoPipe); + childSetPrevalidate("LabelItemDesc",&LLTextValidate::validateASCIIPrintableNoPipe); getChild<LLUICtrl>("LabelItemDesc")->setCommitCallback(boost::bind(&LLFloaterProperties:: onCommitDescription, this)); // Creator information getChild<LLUICtrl>("BtnCreator")->setCommitCallback(boost::bind(&LLFloaterProperties::onClickCreator,this)); diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp index e2b0c4b66f..9895665026 100644 --- a/indra/newview/llfloatersellland.cpp +++ b/indra/newview/llfloatersellland.cpp @@ -163,7 +163,7 @@ BOOL LLFloaterSellLandUI::postBuild() { childSetCommitCallback("sell_to", onChangeValue, this); childSetCommitCallback("price", onChangeValue, this); - childSetPrevalidate("price", LLLineEditor::prevalidateNonNegativeS32); + childSetPrevalidate("price", LLTextValidate::validateNonNegativeS32); childSetCommitCallback("sell_objects", onChangeValue, this); childSetAction("sell_to_select_agent", boost::bind( &LLFloaterSellLandUI::doSelectAgent, this)); childSetAction("cancel_btn", doCancel, this); @@ -268,7 +268,7 @@ void LLFloaterSellLandUI::refreshUI() std::string price_str = childGetValue("price").asString(); bool valid_price = false; - valid_price = (price_str != "") && LLLineEditor::prevalidateNonNegativeS32(utf8str_to_wstring(price_str)); + valid_price = (price_str != "") && LLTextValidate::validateNonNegativeS32(utf8str_to_wstring(price_str)); if (valid_price && mParcelActualArea > 0) { 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/llfolderview.cpp b/indra/newview/llfolderview.cpp index 5c65b2c293..57c7ba8e27 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -225,7 +225,7 @@ LLFolderView::LLFolderView(const Params& p) params.font(getLabelFontForStyle(LLFontGL::NORMAL)); params.max_length_bytes(DB_INV_ITEM_NAME_STR_LEN); params.commit_callback.function(boost::bind(&LLFolderView::commitRename, this, _2)); - params.prevalidate_callback(&LLLineEditor::prevalidateASCIIPrintableNoPipe); + params.prevalidate_callback(&LLTextValidate::validateASCIIPrintableNoPipe); params.commit_on_focus_lost(true); params.visible(false); mRenamer = LLUICtrlFactory::create<LLLineEditor> (params); diff --git a/indra/newview/llinspect.cpp b/indra/newview/llinspect.cpp index c7b651f37c..81cfce53b1 100644 --- a/indra/newview/llinspect.cpp +++ b/indra/newview/llinspect.cpp @@ -32,6 +32,7 @@ #include "llinspect.h" +#include "lltooltip.h" #include "llcontrol.h" // LLCachedControl #include "llui.h" // LLUI::sSettingsGroups #include "llviewermenu.h" @@ -104,6 +105,26 @@ BOOL LLInspect::handleHover(S32 x, S32 y, MASK mask) return LLView::handleHover(x, y, mask); } +BOOL LLInspect::handleToolTip(S32 x, S32 y, MASK mask) +{ + BOOL handled = FALSE; + + + //delegate handling of tooltip to the hovered child + LLView* child_handler = childFromPoint(x,y); + if (child_handler && !child_handler->getToolTip().empty())// show tooltip if a view has non-empty tooltip message + { + //build LLInspector params to get correct tooltip setting, etc. background image + LLInspector::Params params; + params.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLInspector>()); + params.message = child_handler->getToolTip(); + //set up delay if there is no visible tooltip at this moment + params.delay_time = LLToolTipMgr::instance().toolTipVisible() ? 0.f : LLUI::sSettingGroups["config"]->getF32( "ToolTipDelay" ); + LLToolTipMgr::instance().show(params); + handled = TRUE; + } + return handled; +} // virtual void LLInspect::onMouseLeave(S32 x, S32 y, MASK mask) { diff --git a/indra/newview/llinspect.h b/indra/newview/llinspect.h index f8c86618d2..6d994a8d7c 100644 --- a/indra/newview/llinspect.h +++ b/indra/newview/llinspect.h @@ -47,6 +47,7 @@ public: /*virtual*/ void draw(); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); /// Start open animation diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 3c34d26692..501a137b42 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -982,16 +982,20 @@ void LLMediaCtrl::onClickLinkHref( LLPluginClassMedia* self ) U32 target_type = self->getClickTargetType(); // is there is a target specified for the link? - if (gSavedSettings.getBOOL("UseExternalBrowser") || target_type == LLPluginClassMedia::TARGET_EXTERNAL) + if (target_type == LLPluginClassMedia::TARGET_EXTERNAL || + target_type == LLPluginClassMedia::TARGET_BLANK ) { - LLSD payload; - payload["url"] = url; - payload["target_type"] = LLSD::Integer(target_type); - LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget); - } - else if (target_type == LLPluginClassMedia::TARGET_BLANK) - { - clickLinkWithTarget(url, target_type); + if (gSavedSettings.getBOOL("UseExternalBrowser")) + { + LLSD payload; + payload["url"] = url; + payload["target_type"] = LLSD::Integer(target_type); + LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget); + } + else + { + clickLinkWithTarget(url, target_type); + } } else { const std::string protocol1( "http://" ); @@ -1042,7 +1046,7 @@ bool LLMediaCtrl::onClickLinkExternalTarget(const LLSD& notification, const LLSD // static void LLMediaCtrl::clickLinkWithTarget(const std::string& url, const S32& target_type ) { - if (gSavedSettings.getBOOL("UseExternalBrowser") || target_type == LLPluginClassMedia::TARGET_EXTERNAL) + if (target_type == LLPluginClassMedia::TARGET_EXTERNAL) { // load target in an external browser LLWeb::loadURLExternal(url); 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/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 1e46827c1a..8ca044f72b 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -242,7 +242,7 @@ BOOL LLPanelClassified::postBuild() mNameEditor->setCommitOnFocusLost(TRUE); mNameEditor->setFocusReceivedCallback(boost::bind(focusReceived, _1, this)); mNameEditor->setCommitCallback(onCommitAny, this); - mNameEditor->setPrevalidate( LLLineEditor::prevalidateASCII ); + mNameEditor->setPrevalidate( LLTextValidate::validateASCII ); mDescEditor = getChild<LLTextEditor>("desc_editor"); mDescEditor->setCommitOnFocusLost(TRUE); @@ -1072,7 +1072,7 @@ BOOL LLFloaterPriceForListing::postBuild() LLLineEditor* edit = getChild<LLLineEditor>("price_edit"); if (edit) { - edit->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32); + edit->setPrevalidate(LLTextValidate::validateNonNegativeS32); std::string min_price = llformat("%d", MINIMUM_PRICE_FOR_LISTING); edit->setText(min_price); edit->selectAll(); diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 51fc670d87..3b303eed0f 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -214,7 +214,7 @@ void LLPanelGroupGeneral::setupCtrls(LLPanel* panel_group) } mFounderName = panel_group->getChild<LLNameBox>("founder_name"); mGroupNameEditor = panel_group->getChild<LLLineEditor>("group_name_editor"); - mGroupNameEditor->setPrevalidate( LLLineEditor::prevalidateASCII ); + mGroupNameEditor->setPrevalidate( LLTextValidate::validateASCII ); } // static 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/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 2d5246c409..43f4024bac 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -213,8 +213,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, } #if !USE_VIEWER_AUTH - childSetPrevalidate("first_name_edit", LLLineEditor::prevalidateASCIIPrintableNoSpace); - childSetPrevalidate("last_name_edit", LLLineEditor::prevalidateASCIIPrintableNoSpace); + childSetPrevalidate("first_name_edit", LLTextValidate::validateASCIIPrintableNoSpace); + childSetPrevalidate("last_name_edit", LLTextValidate::validateASCIIPrintableNoSpace); childSetCommitCallback("password_edit", mungePassword, this); getChild<LLLineEditor>("password_edit")->setKeystrokeCallback(onPassKey, this); 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/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 8b8b1bed37..01b6e8ffad 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -142,9 +142,9 @@ LLPanelPermissions::LLPanelPermissions() : BOOL LLPanelPermissions::postBuild() { childSetCommitCallback("Object Name",LLPanelPermissions::onCommitName,this); - childSetPrevalidate("Object Name",LLLineEditor::prevalidateASCIIPrintableNoPipe); + childSetPrevalidate("Object Name",LLTextValidate::validateASCIIPrintableNoPipe); childSetCommitCallback("Object Description",LLPanelPermissions::onCommitDesc,this); - childSetPrevalidate("Object Description",LLLineEditor::prevalidateASCIIPrintableNoPipe); + childSetPrevalidate("Object Description",LLTextValidate::validateASCIIPrintableNoPipe); getChild<LLUICtrl>("button set group")->setCommitCallback(boost::bind(&LLPanelPermissions::onClickGroup,this)); 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/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp index 92bd4dc62b..0cc747f789 100644 --- a/indra/newview/llpreviewanim.cpp +++ b/indra/newview/llpreviewanim.cpp @@ -79,7 +79,7 @@ BOOL LLPreviewAnim::postBuild() childSetAction("Anim audition btn",auditionAnim, this); childSetCommitCallback("desc", LLPreview::onText, this); - childSetPrevalidate("desc", &LLLineEditor::prevalidateASCIIPrintableNoPipe); + childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); return LLPreview::postBuild(); } diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 53e351e66e..57a8ca3d12 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -472,7 +472,7 @@ BOOL LLPreviewGesture::postBuild() edit = getChild<LLLineEditor>("wait_time_editor"); edit->setEnabled(FALSE); edit->setVisible(FALSE); - edit->setPrevalidate(LLLineEditor::prevalidateFloat); + edit->setPrevalidate(LLTextValidate::validateFloat); // edit->setKeystrokeCallback(onKeystrokeCommit, this); edit->setCommitOnFocusLost(TRUE); edit->setCommitCallback(onCommitWaitTime, this); @@ -504,10 +504,10 @@ BOOL LLPreviewGesture::postBuild() if (item) { childSetText("desc", item->getDescription()); - childSetPrevalidate("desc", &LLLineEditor::prevalidateASCIIPrintableNoPipe); + childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); childSetText("name", item->getName()); - childSetPrevalidate("name", &LLLineEditor::prevalidateASCIIPrintableNoPipe); + childSetPrevalidate("name", &LLTextValidate::validateASCIIPrintableNoPipe); } return LLPreview::postBuild(); diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index cc70360528..ee8e3f1db6 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -95,7 +95,7 @@ BOOL LLPreviewNotecard::postBuild() childSetCommitCallback("desc", LLPreview::onText, this); if (item) childSetText("desc", item->getDescription()); - childSetPrevalidate("desc", &LLLineEditor::prevalidateASCIIPrintableNoPipe); + childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); return LLPreview::postBuild(); } diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 7bcbe334ff..a8feaf690d 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -955,7 +955,7 @@ BOOL LLPreviewLSL::postBuild() childSetCommitCallback("desc", LLPreview::onText, this); childSetText("desc", item->getDescription()); - childSetPrevalidate("desc", &LLLineEditor::prevalidateASCIIPrintableNoPipe); + childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); return LLPreview::postBuild(); } diff --git a/indra/newview/llpreviewsound.cpp b/indra/newview/llpreviewsound.cpp index d7fd252fb6..44b828854b 100644 --- a/indra/newview/llpreviewsound.cpp +++ b/indra/newview/llpreviewsound.cpp @@ -75,7 +75,7 @@ BOOL LLPreviewSound::postBuild() button->setSoundFlags(LLView::SILENT); childSetCommitCallback("desc", LLPreview::onText, this); - childSetPrevalidate("desc", &LLLineEditor::prevalidateASCIIPrintableNoPipe); + childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); return LLPreview::postBuild(); } diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index dfc67d0126..0ed6bea74f 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -126,7 +126,7 @@ BOOL LLPreviewTexture::postBuild() { childSetCommitCallback("desc", LLPreview::onText, this); childSetText("desc", item->getDescription()); - childSetPrevalidate("desc", &LLLineEditor::prevalidateASCIIPrintableNoPipe); + childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); } } diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index 0d9cf06bc3..465d36b8de 100644 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -38,9 +38,11 @@ #include "llchiclet.h" #include "llfloaterreg.h" #include "llnotifications.h" +#include "llnotificationsutil.h" #include "llscreenchannel.h" #include "llsyswellwindow.h" #include "lltoastnotifypanel.h" +#include "lltrans.h" #include "llviewerwindow.h" #include "llimfloater.h" @@ -70,12 +72,11 @@ LLScriptFloater::LLScriptFloater(const LLSD& key) setOverlapsScreenChannel(true); } -bool LLScriptFloater::toggle(const LLUUID& object_id) +bool LLScriptFloater::toggle(const LLUUID& notification_id) { // Force chiclet toggle on here because first onFocusReceived() will not toggle it on. - LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(object_id, true); + LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(notification_id, true); - LLUUID notification_id = LLScriptFloaterManager::getInstance()->findNotificationId(object_id); LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", notification_id); // show existing floater @@ -96,22 +97,21 @@ bool LLScriptFloater::toggle(const LLUUID& object_id) // create and show new floater else { - show(object_id); + show(notification_id); return true; } } -LLScriptFloater* LLScriptFloater::show(const LLUUID& object_id) +LLScriptFloater* LLScriptFloater::show(const LLUUID& notification_id) { - LLUUID notification_id = LLScriptFloaterManager::getInstance()->findNotificationId(object_id); - LLScriptFloater* floater = LLFloaterReg::showTypedInstance<LLScriptFloater>("script_floater", notification_id); - floater->setObjectId(object_id); - floater->createForm(object_id); + + floater->setNotificationId(notification_id); + floater->createForm(notification_id); if (floater->getDockControl() == NULL) { - LLChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLChiclet>(object_id); + LLChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLChiclet>(notification_id); if (chiclet == NULL) { llerror("Dock chiclet for LLScriptFloater doesn't exist", 0); @@ -133,7 +133,7 @@ void LLScriptFloater::getAllowedRect(LLRect& rect) rect = gViewerWindow->getWorldViewRectRaw(); } -void LLScriptFloater::createForm(const LLUUID& object_id) +void LLScriptFloater::createForm(const LLUUID& notification_id) { // delete old form if(mScriptForm) @@ -142,8 +142,7 @@ void LLScriptFloater::createForm(const LLUUID& object_id) mScriptForm->die(); } - LLNotificationPtr notification = LLNotifications::getInstance()->find( - LLScriptFloaterManager::getInstance()->findNotificationId(object_id)); + LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id); if(NULL == notification) { return; @@ -165,9 +164,9 @@ void LLScriptFloater::createForm(const LLUUID& object_id) void LLScriptFloater::onClose(bool app_quitting) { - if(getObjectId().notNull()) + if(getNotificationId().notNull()) { - LLScriptFloaterManager::getInstance()->removeNotificationByObjectId(getObjectId()); + LLScriptFloaterManager::getInstance()->onRemoveNotification(getNotificationId()); } } @@ -186,7 +185,7 @@ void LLScriptFloater::setVisible(BOOL visible) if(!visible) { - LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(getObjectId()); + LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(getNotificationId()); if(chiclet) { chiclet->setToggleState(false); @@ -196,10 +195,10 @@ void LLScriptFloater::setVisible(BOOL visible) void LLScriptFloater::onMouseDown() { - if(getObjectId().notNull()) + if(getNotificationId().notNull()) { // Remove new message icon - LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(getObjectId()); + LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(getNotificationId()); if (chiclet == NULL) { llerror("Dock chiclet for LLScriptFloater doesn't exist", 0); @@ -213,15 +212,18 @@ void LLScriptFloater::onMouseDown() void LLScriptFloater::onFocusLost() { - LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(getObjectId(), false); + if(getNotificationId().notNull()) + { + LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(getNotificationId(), false); + } } void LLScriptFloater::onFocusReceived() { // first focus will be received before setObjectId() call - don't toggle chiclet - if(getObjectId().notNull()) + if(getNotificationId().notNull()) { - LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(getObjectId(), true); + LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(getNotificationId(), true); } } @@ -246,200 +248,203 @@ void LLScriptFloater::hideToastsIfNeeded() void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) { - // get scripted Object's ID - LLUUID object_id = notification_id_to_object_id(notification_id); - if(object_id.isNull()) + if(notification_id.isNull()) { - llwarns << "Invalid notification, no object id" << llendl; + llwarns << "Invalid notification ID" << llendl; return; } + // get scripted Object's ID + LLUUID object_id = notification_id_to_object_id(notification_id); + // Need to indicate of "new message" for object chiclets according to requirements // specified in the Message Bar design specification. See EXT-3142. bool set_new_message = false; + EObjectType obj_type = getObjectType(notification_id); - // If an Object spawns more-than-one floater, only the newest one is shown. - // The previous is automatically closed. - script_notification_map_t::iterator it = mNotifications.find(object_id); - if(it != mNotifications.end()) + // LLDialog can spawn only one instance, LLLoadURL and LLGiveInventory can spawn unlimited number of instances + if(OBJ_SCRIPT == obj_type) { - LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(object_id); - if(chiclet) + // If an Object spawns more-than-one floater, only the newest one is shown. + // The previous is automatically closed. + script_notification_map_t::const_iterator it = findUsingObjectId(object_id); + if(it != mNotifications.end()) { - // Pass the new_message icon state further. - set_new_message = chiclet->getShowNewMessagesIcon(); - } + LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(it->first); + if(chiclet) + { + // Pass the new_message icon state further. + set_new_message = chiclet->getShowNewMessagesIcon(); + } - LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", it->second.notification_id); - if(floater) - { - // Generate chiclet with a "new message" indicator if a docked window was opened but not in focus. See EXT-3142. - set_new_message |= !floater->hasFocus(); - } + LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", it->first); + if(floater) + { + // Generate chiclet with a "new message" indicator if a docked window was opened but not in focus. See EXT-3142. + set_new_message |= !floater->hasFocus(); + } - onRemoveNotification(it->second.notification_id); + onRemoveNotification(it->first); + } } - LLNotificationData nd = {notification_id}; - mNotifications.insert(std::make_pair(object_id, nd)); + mNotifications.insert(std::make_pair(notification_id, object_id)); // Create inventory offer chiclet for offer type notifications - LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id); - if( notification && notification->getType() == "offer" ) + if( OBJ_GIVE_INVENTORY == obj_type ) { - LLBottomTray::instance().getChicletPanel()->createChiclet<LLInvOfferChiclet>(object_id); + LLBottomTray::instance().getChicletPanel()->createChiclet<LLInvOfferChiclet>(notification_id); } else { - LLBottomTray::getInstance()->getChicletPanel()->createChiclet<LLScriptChiclet>(object_id); + LLBottomTray::getInstance()->getChicletPanel()->createChiclet<LLScriptChiclet>(notification_id); } - LLIMWellWindow::getInstance()->addObjectRow(object_id, set_new_message); + LLIMWellWindow::getInstance()->addObjectRow(notification_id, set_new_message); LLSD data; - data["object_id"] = object_id; + data["notification_id"] = notification_id; data["new_message"] = set_new_message; data["unread"] = 1; // each object has got only one floater mNewObjectSignal(data); - toggleScriptFloater(object_id, set_new_message); + toggleScriptFloater(notification_id, set_new_message); } void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id) { - LLUUID object_id = findObjectId(notification_id); - if(object_id.isNull()) + if(notification_id.isNull()) { - llwarns << "Invalid notification, no object id" << llendl; + llwarns << "Invalid notification ID" << llendl; return; } - using namespace LLNotificationsUI; - - // remove related toast - LLUUID channel_id(gSavedSettings.getString("NotificationChannelUUID")); - LLScreenChannel* channel = dynamic_cast<LLScreenChannel*> - (LLChannelManager::getInstance()->findChannelByID(channel_id)); - LLUUID n_toast_id = findNotificationToastId(object_id); - if(channel && n_toast_id.notNull()) - { - channel->killToastByNotificationID(n_toast_id); - } - // remove related chiclet - LLBottomTray::getInstance()->getChicletPanel()->removeChiclet(object_id); + LLBottomTray::getInstance()->getChicletPanel()->removeChiclet(notification_id); - LLIMWellWindow::getInstance()->removeObjectRow(object_id); + LLIMWellWindow::getInstance()->removeObjectRow(notification_id); // close floater LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", notification_id); if(floater) { - floater->setObjectId(LLUUID::null); + floater->setNotificationId(LLUUID::null); floater->closeFloater(); } - mNotifications.erase(object_id); -} - -void LLScriptFloaterManager::removeNotificationByObjectId(const LLUUID& object_id) -{ - // Check we have not removed notification yet - LLNotificationPtr notification = LLNotifications::getInstance()->find( - findNotificationId(object_id)); - if(notification) - { - onRemoveNotification(notification->getID()); - } + mNotifications.erase(notification_id); } -void LLScriptFloaterManager::toggleScriptFloater(const LLUUID& object_id, bool set_new_message) +void LLScriptFloaterManager::toggleScriptFloater(const LLUUID& notification_id, bool set_new_message) { - // kill toast - using namespace LLNotificationsUI; - LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(LLChannelManager::getInstance()->findChannelByID( - LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); - if(channel) - { - channel->killToastByNotificationID(findNotificationToastId(object_id)); - } - LLSD data; - data["object_id"] = object_id; + data["notification_id"] = notification_id; data["new_message"] = set_new_message; mToggleFloaterSignal(data); // toggle floater - LLScriptFloater::toggle(object_id); + LLScriptFloater::toggle(notification_id); } -void LLScriptFloaterManager::setNotificationToastId(const LLUUID& object_id, const LLUUID& notification_id) +LLUUID LLScriptFloaterManager::findObjectId(const LLUUID& notification_id) { - script_notification_map_t::iterator it = mNotifications.find(object_id); + script_notification_map_t::const_iterator it = mNotifications.find(notification_id); if(mNotifications.end() != it) { - it->second.toast_notification_id = notification_id; + return it->second; } + return LLUUID::null; } -LLUUID LLScriptFloaterManager::findObjectId(const LLUUID& notification_id) +LLUUID LLScriptFloaterManager::findNotificationId(const LLUUID& object_id) { - if(notification_id.notNull()) + if(object_id.notNull()) { - script_notification_map_t::const_iterator it = mNotifications.begin(); - for(; mNotifications.end() != it; ++it) + script_notification_map_t::const_iterator it = findUsingObjectId(object_id); + if(mNotifications.end() != it) { - if(notification_id == it->second.notification_id) - { - return it->first; - } + return it->first; } } return LLUUID::null; } -LLUUID LLScriptFloaterManager::findNotificationId(const LLUUID& object_id) +// static +LLScriptFloaterManager::EObjectType LLScriptFloaterManager::getObjectType(const LLUUID& notification_id) { - script_notification_map_t::const_iterator it = mNotifications.find(object_id); - if(mNotifications.end() != it) + if(notification_id.isNull()) { - return it->second.notification_id; + llwarns << "Invalid notification ID" << llendl; + return OBJ_UNKNOWN; } - return LLUUID::null; -} -LLUUID LLScriptFloaterManager::findNotificationToastId(const LLUUID& object_id) -{ - script_notification_map_t::const_iterator it = mNotifications.find(object_id); - if(mNotifications.end() != it) + static const object_type_map TYPE_MAP = initObjectTypeMap(); + + LLNotificationPtr notification = LLNotificationsUtil::find(notification_id); + object_type_map::const_iterator it = TYPE_MAP.find(notification->getName()); + if(it != TYPE_MAP.end()) { - return it->second.toast_notification_id; + return it->second; } - return LLUUID::null; + + llwarns << "Unknown object type" << llendl; + return OBJ_UNKNOWN; } -//static -void LLScriptFloaterManager::onToastButtonClick(const LLSD¬ification, const LLSD&response) +// static +std::string LLScriptFloaterManager::getObjectName(const LLUUID& notification_id) { - S32 option = LLNotification::getSelectedOption(notification, response); - LLUUID object_id = notification["payload"]["object_id"].asUUID(); + using namespace LLNotificationsUI; + LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id); + if(!notification) + { + llwarns << "Invalid notification" << llendl; + return LLStringUtil::null; + } + + std::string text; - switch(option) + switch(LLScriptFloaterManager::getObjectType(notification_id)) { - case 0: // "Open" - LLScriptFloaterManager::getInstance()->toggleScriptFloater(object_id); + case LLScriptFloaterManager::OBJ_SCRIPT: + text = notification->getSubstitutions()["TITLE"].asString(); break; - case 1: // "Ignore" - LLScriptFloaterManager::getInstance()->removeNotificationByObjectId(object_id); + case LLScriptFloaterManager::OBJ_LOAD_URL: + text = notification->getSubstitutions()["OBJECTNAME"].asString(); break; - case 2: // "Block" - LLMuteList::getInstance()->add(LLMute(object_id, notification["substitutions"]["TITLE"], LLMute::OBJECT)); - LLScriptFloaterManager::getInstance()->removeNotificationByObjectId(object_id); + case LLScriptFloaterManager::OBJ_GIVE_INVENTORY: + text = notification->getSubstitutions()["NAME"].asString(); break; default: - llwarns << "Unexpected value" << llendl; + text = LLTrans::getString("object"); break; } + + return text; +} + +//static +LLScriptFloaterManager::object_type_map LLScriptFloaterManager::initObjectTypeMap() +{ + object_type_map type_map; + type_map["ScriptDialog"] = OBJ_SCRIPT; + type_map["ScriptDialogGroup"] = OBJ_SCRIPT; + type_map["LoadWebPage"] = OBJ_LOAD_URL; + type_map["ObjectGiveItem"] = OBJ_GIVE_INVENTORY; + return type_map; +} + +LLScriptFloaterManager::script_notification_map_t::const_iterator LLScriptFloaterManager::findUsingObjectId(const LLUUID& object_id) +{ + script_notification_map_t::const_iterator it = mNotifications.begin(); + for(; mNotifications.end() != it; ++it) + { + if(object_id == it->second) + { + return it; + } + } + return mNotifications.end(); } // EOF diff --git a/indra/newview/llscriptfloater.h b/indra/newview/llscriptfloater.h index f86605c5d1..f7efff83f9 100644 --- a/indra/newview/llscriptfloater.h +++ b/indra/newview/llscriptfloater.h @@ -48,6 +48,15 @@ class LLScriptFloaterManager : public LLSingleton<LLScriptFloaterManager> // know how script notifications should look like. public: + typedef enum e_object_type + { + OBJ_SCRIPT, + OBJ_GIVE_INVENTORY, + OBJ_LOAD_URL, + + OBJ_UNKNOWN + }EObjectType; + /** * Handles new notifications. * Saves notification and object ids, removes old notification if needed, creates script chiclet @@ -62,11 +71,6 @@ public: void onRemoveNotification(const LLUUID& notification_id); /** - * Wrapper for onRemoveNotification, removes notification by object id. - */ - void removeNotificationByObjectId(const LLUUID& object_id); - - /** * Toggles script floater. * Removes "new message" icon from chiclet and removes notification toast. */ @@ -76,12 +80,9 @@ public: LLUUID findNotificationId(const LLUUID& object_id); - LLUUID findNotificationToastId(const LLUUID& object_id); + static EObjectType getObjectType(const LLUUID& notification_id); - /** - * Associate notification toast id with object id. - */ - void setNotificationToastId(const LLUUID& object_id, const LLUUID& notification_id); + static std::string getObjectName(const LLUUID& notification_id); /** * Callback for notification toast buttons. @@ -93,16 +94,18 @@ public: boost::signals2::connection addNewObjectCallback(const object_signal_t::slot_type& cb) { return mNewObjectSignal.connect(cb); } boost::signals2::connection addToggleObjectFloaterCallback(const object_signal_t::slot_type& cb) { return mToggleFloaterSignal.connect(cb); } -private: +protected: - struct LLNotificationData - { - LLUUID notification_id; - LLUUID toast_notification_id; - }; + typedef std::map<std::string, EObjectType> object_type_map; + + static object_type_map initObjectTypeMap(); - // <object_id, notification_data> - typedef std::map<LLUUID, LLNotificationData> script_notification_map_t; + // <notification_id, object_id> + typedef std::map<LLUUID, LLUUID> script_notification_map_t; + + script_notification_map_t::const_iterator findUsingObjectId(const LLUUID& object_id); + +private: script_notification_map_t mNotifications; @@ -136,9 +139,9 @@ public: */ static LLScriptFloater* show(const LLUUID& object_id); - const LLUUID& getObjectId() { return mObjectId; } + const LLUUID& getNotificationId() { return mNotificationId; } - void setObjectId(const LLUUID& id) { mObjectId = id; } + void setNotificationId(const LLUUID& id) { mNotificationId = id; } /** * Close notification if script floater is closed. @@ -180,7 +183,7 @@ protected: private: LLToastNotifyPanel* mScriptForm; - LLUUID mObjectId; + LLUUID mNotificationId; }; #endif //LL_SCRIPTFLOATER_H diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 94fe95d215..44348ba429 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -109,9 +109,9 @@ BOOL LLSidepanelItemInfo::postBuild() { LLSidepanelInventorySubpanel::postBuild(); - childSetPrevalidate("LabelItemName",&LLLineEditor::prevalidateASCIIPrintableNoPipe); + childSetPrevalidate("LabelItemName",&LLTextValidate::validateASCIIPrintableNoPipe); getChild<LLUICtrl>("LabelItemName")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitName,this)); - childSetPrevalidate("LabelItemDesc",&LLLineEditor::prevalidateASCIIPrintableNoPipe); + childSetPrevalidate("LabelItemDesc",&LLTextValidate::validateASCIIPrintableNoPipe); getChild<LLUICtrl>("LabelItemDesc")->setCommitCallback(boost::bind(&LLSidepanelItemInfo:: onCommitDescription, this)); // Creator information getChild<LLUICtrl>("BtnCreator")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onClickCreator,this)); diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 0b8f66c5f3..0630981d7e 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -104,9 +104,9 @@ BOOL LLSidepanelTaskInfo::postBuild() mLabelGroupName = getChild<LLNameBox>("Group Name Proxy"); childSetCommitCallback("Object Name", LLSidepanelTaskInfo::onCommitName,this); - childSetPrevalidate("Object Name", LLLineEditor::prevalidateASCIIPrintableNoPipe); + childSetPrevalidate("Object Name", LLTextValidate::validateASCIIPrintableNoPipe); childSetCommitCallback("Object Description", LLSidepanelTaskInfo::onCommitDesc,this); - childSetPrevalidate("Object Description", LLLineEditor::prevalidateASCIIPrintableNoPipe); + childSetPrevalidate("Object Description", LLTextValidate::validateASCIIPrintableNoPipe); getChild<LLUICtrl>("button set group")->setCommitCallback(boost::bind(&LLSidepanelTaskInfo::onClickGroup,this)); childSetCommitCallback("checkbox share with group", &LLSidepanelTaskInfo::onCommitGroupShare,this); childSetAction("button deed", &LLSidepanelTaskInfo::onClickDeedToGroup,this); 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 37c8d94d5e..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" @@ -800,6 +801,9 @@ bool idle_startup() gLoginMenuBarView->setVisible( TRUE ); gLoginMenuBarView->setEnabled( TRUE ); + // Hide the splash screen + LLSplashScreen::hide(); + // Push our window frontmost gViewerWindow->getWindow()->show(); display_startup(); @@ -1198,6 +1202,7 @@ bool idle_startup() display_startup(); LLStartUp::setStartupState( STATE_MULTIMEDIA_INIT ); + return FALSE; } @@ -1704,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. @@ -2556,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/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index ba15053381..4d1718be6a 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -418,16 +418,16 @@ BOOL LLIMWellWindow::RowPanel::handleRightMouseDown(S32 x, S32 y, MASK mask) /* ObjectRowPanel implementation */ /************************************************************************/ -LLIMWellWindow::ObjectRowPanel::ObjectRowPanel(const LLUUID& object_id, bool new_message/* = false*/) +LLIMWellWindow::ObjectRowPanel::ObjectRowPanel(const LLUUID& notification_id, bool new_message/* = false*/) : LLPanel() , mChiclet(NULL) { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_active_object_row.xml", NULL); - initChiclet(object_id); + initChiclet(notification_id); LLTextBox* obj_name = getChild<LLTextBox>("object_name"); - obj_name->setValue(getObjectName(object_id)); + obj_name->setValue(LLScriptFloaterManager::getObjectName(notification_id)); mCloseBtn = getChild<LLButton>("hide_btn"); mCloseBtn->setCommitCallback(boost::bind(&LLIMWellWindow::ObjectRowPanel::onClosePanel, this)); @@ -438,90 +438,18 @@ LLIMWellWindow::ObjectRowPanel::~ObjectRowPanel() { } -std::string LLIMWellWindow::ObjectRowPanel::getObjectName(const LLUUID& object_id) -{ - using namespace LLNotificationsUI; - LLUUID notification_id = LLScriptFloaterManager::getInstance()->findNotificationId(object_id); - LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id); - if(!notification) - { - llwarns << "Invalid notification" << llendl; - return LLStringUtil::null; - } - - std::string text; - - switch(getObjectType(notification)) - { - case OBJ_SCRIPT: - text = notification->getSubstitutions()["TITLE"].asString(); - break; - case OBJ_LOAD_URL: - text = notification->getSubstitutions()["OBJECTNAME"].asString(); - break; - case OBJ_GIVE_INVENTORY: - text = notification->getSubstitutions()["NAME"].asString(); - break; - default: - text = getString("unknown_obj"); - break; - } - - return text; -} - //--------------------------------------------------------------------------------- void LLIMWellWindow::ObjectRowPanel::onClosePanel() { - LLScriptFloaterManager::getInstance()->removeNotificationByObjectId(mChiclet->getSessionId()); -} - -//static -LLIMWellWindow::ObjectRowPanel::object_type_map LLIMWellWindow::ObjectRowPanel::initObjectTypeMap() -{ - object_type_map type_map; - type_map["ScriptDialog"] = OBJ_SCRIPT; - type_map["LoadWebPage"] = OBJ_LOAD_URL; - type_map["ObjectGiveItem"] = OBJ_GIVE_INVENTORY; - return type_map; -} - -// static -LLIMWellWindow::ObjectRowPanel::EObjectType LLIMWellWindow::ObjectRowPanel::getObjectType(const LLNotificationPtr& notification) -{ - if(!notification) - { - llwarns << "Invalid notification" << llendl; - return OBJ_UNKNOWN; - } - - static object_type_map type_map = initObjectTypeMap(); - std::string name = notification->getName(); - object_type_map::const_iterator it = type_map.find(name); - if(it != type_map.end()) - { - return it->second; - } - - llwarns << "Unknown object type" << llendl; - return OBJ_UNKNOWN; + LLScriptFloaterManager::getInstance()->onRemoveNotification(mChiclet->getSessionId()); } -void LLIMWellWindow::ObjectRowPanel::initChiclet(const LLUUID& object_id, bool new_message/* = false*/) +void LLIMWellWindow::ObjectRowPanel::initChiclet(const LLUUID& notification_id, bool new_message/* = false*/) { - using namespace LLNotificationsUI; - LLUUID notification_id = LLScriptFloaterManager::getInstance()->findNotificationId(object_id); - LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id); - if(!notification) - { - llwarns << "Invalid notification" << llendl; - return; - } - // Choose which of the pre-created chiclets to use. - switch(getObjectType(notification)) + switch(LLScriptFloaterManager::getObjectType(notification_id)) { - case OBJ_GIVE_INVENTORY: + case LLScriptFloaterManager::OBJ_GIVE_INVENTORY: mChiclet = getChild<LLInvOfferChiclet>("inv_offer_chiclet"); break; default: @@ -530,8 +458,7 @@ void LLIMWellWindow::ObjectRowPanel::initChiclet(const LLUUID& object_id, bool n } mChiclet->setVisible(true); - mChiclet->setSessionId(object_id); -// mChiclet->setShowNewMessagesIcon(new_message); + mChiclet->setSessionId(notification_id); } //--------------------------------------------------------------------------------- @@ -780,10 +707,10 @@ void LLIMWellWindow::sessionIDUpdated(const LLUUID& old_session_id, const LLUUID } } -LLChiclet* LLIMWellWindow::findObjectChiclet(const LLUUID& object_id) +LLChiclet* LLIMWellWindow::findObjectChiclet(const LLUUID& notification_id) { LLChiclet* res = NULL; - ObjectRowPanel* panel = mMessageList->getTypedItemByValue<ObjectRowPanel>(object_id); + ObjectRowPanel* panel = mMessageList->getTypedItemByValue<ObjectRowPanel>(notification_id); if (panel != NULL) { res = panel->mChiclet; @@ -861,33 +788,33 @@ void LLIMWellWindow::delIMRow(const LLUUID& sessionId) } } -void LLIMWellWindow::addObjectRow(const LLUUID& object_id, bool new_message/* = false*/) +void LLIMWellWindow::addObjectRow(const LLUUID& notification_id, bool new_message/* = false*/) { - if (mMessageList->getItemByValue(object_id) == NULL) + if (mMessageList->getItemByValue(notification_id) == NULL) { - ObjectRowPanel* item = new ObjectRowPanel(object_id, new_message); - if (mMessageList->insertItemAfter(mSeparator, item, object_id)) + ObjectRowPanel* item = new ObjectRowPanel(notification_id, new_message); + if (mMessageList->insertItemAfter(mSeparator, item, notification_id)) { handleItemAdded(IT_INSTANT_MESSAGE); } else { - llwarns << "Unable to add Object Row into the list, objectID: " << object_id << llendl; + llwarns << "Unable to add Object Row into the list, notificationID: " << notification_id << llendl; item->die(); } reshapeWindow(); } } -void LLIMWellWindow::removeObjectRow(const LLUUID& object_id) +void LLIMWellWindow::removeObjectRow(const LLUUID& notification_id) { - if (mMessageList->removeItemByValue(object_id)) + if (mMessageList->removeItemByValue(notification_id)) { handleItemRemoved(IT_INSTANT_MESSAGE); } else { - llwarns << "Unable to remove Object Row from the list, objectID: " << object_id << llendl; + llwarns << "Unable to remove Object Row from the list, notificationID: " << notification_id << llendl; } reshapeWindow(); @@ -967,8 +894,7 @@ void LLIMWellWindow::closeAllImpl() ObjectRowPanel* obj_panel = dynamic_cast <ObjectRowPanel*> (panel); if (obj_panel) { - LLScriptFloaterManager::instance() - .removeNotificationByObjectId(*iter); + LLScriptFloaterManager::instance().onRemoveNotification(*iter); } } } diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index 0c81d1f369..3790aa3ea9 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -188,8 +188,8 @@ public: /*virtual*/ void sessionRemoved(const LLUUID& session_id); /*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id); - void addObjectRow(const LLUUID& object_id, bool new_message = false); - void removeObjectRow(const LLUUID& object_id); + void addObjectRow(const LLUUID& notification_id, bool new_message = false); + void removeObjectRow(const LLUUID& notification_id); void addIMRow(const LLUUID& session_id); bool hasIMRow(const LLUUID& session_id); @@ -201,7 +201,7 @@ protected: private: LLChiclet * findIMChiclet(const LLUUID& sessionId); - LLChiclet* findObjectChiclet(const LLUUID& object_id); + LLChiclet* findObjectChiclet(const LLUUID& notification_id); void addIMRow(const LLUUID& sessionId, S32 chicletCounter, const std::string& name, const LLUUID& otherParticipantId); void delIMRow(const LLUUID& sessionId); @@ -235,17 +235,8 @@ private: class ObjectRowPanel: public LLPanel { - typedef enum e_object_type - { - OBJ_UNKNOWN, - - OBJ_SCRIPT, - OBJ_GIVE_INVENTORY, - OBJ_LOAD_URL - }EObjectType; - public: - ObjectRowPanel(const LLUUID& object_id, bool new_message = false); + ObjectRowPanel(const LLUUID& notification_id, bool new_message = false); virtual ~ObjectRowPanel(); /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask); /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); @@ -254,12 +245,8 @@ private: private: void onClosePanel(); - static EObjectType getObjectType(const LLNotificationPtr& notification); - void initChiclet(const LLUUID& object_id, bool new_message = false); - std::string getObjectName(const LLUUID& object_id); + void initChiclet(const LLUUID& notification_id, bool new_message = false); - typedef std::map<std::string, EObjectType> object_type_map; - static object_type_map initObjectTypeMap(); public: LLIMChiclet* mChiclet; private: diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 9ced0194a2..da090d074c 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -712,7 +712,6 @@ void LLViewerMedia::updateMedia(void *dummy_arg) std::vector<LLViewerMediaImpl*> proximity_order; bool inworld_media_enabled = gSavedSettings.getBOOL("AudioStreamingMedia"); - bool needs_first_run = LLViewerMedia::needsMediaFirstRun(); U32 max_instances = gSavedSettings.getU32("PluginInstancesTotal"); U32 max_normal = gSavedSettings.getU32("PluginInstancesNormal"); U32 max_low = gSavedSettings.getU32("PluginInstancesLow"); @@ -838,12 +837,6 @@ void LLViewerMedia::updateMedia(void *dummy_arg) if(!pimpl->getUsedInUI()) { new_priority = LLPluginClassMedia::PRIORITY_UNLOADED; - if(needs_first_run) - { - // Don't do this more than once in this loop. - needs_first_run = false; - LLViewerMedia::displayMediaFirstRun(); - } } } @@ -913,59 +906,6 @@ void LLViewerMedia::cleanupClass() gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL); } - -////////////////////////////////////////////////////////////////////////////////////////// -// static -bool LLViewerMedia::needsMediaFirstRun() -{ - return gWarningSettings.getBOOL("FirstStreamingMedia"); -} - -////////////////////////////////////////////////////////////////////////////////////////// -// static -void LLViewerMedia::displayMediaFirstRun() -{ - gWarningSettings.setBOOL("FirstStreamingMedia", FALSE); - - LLNotificationsUtil::add("ParcelCanPlayMedia", LLSD(), LLSD(), - boost::bind(firstRunCallback, _1, _2)); -} - -////////////////////////////////////////////////////////////////////////////////////////// -// static -bool LLViewerMedia::firstRunCallback(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option == 0) - { - // user has elected to automatically play media. - gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, TRUE); - gSavedSettings.setBOOL("AudioStreamingMusic", TRUE); - gSavedSettings.setBOOL("AudioStreamingMedia", TRUE); - - LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - - if (parcel) - { - // play media right now, if available - LLViewerParcelMedia::play(parcel); - - // play music right now, if available - std::string music_url = parcel->getMusicURL(); - if (gAudiop && !music_url.empty()) - gAudiop->startInternetStream(music_url); - } - } - else - { - gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, FALSE); - gSavedSettings.setBOOL("AudioStreamingMedia", FALSE); - gSavedSettings.setBOOL("AudioStreamingMusic", FALSE); - } - return false; -} - - ////////////////////////////////////////////////////////////////////////////////////////// // LLViewerMediaImpl ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index ff18ed605a..daad70f14f 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -117,11 +117,6 @@ class LLViewerMedia // This is the comparitor used to sort the list. static bool priorityComparitor(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2); - // For displaying the media first-run dialog. - static bool needsMediaFirstRun(); - static void displayMediaFirstRun(); - static bool firstRunCallback(const LLSD& notification, const LLSD& response); - }; // Implementation functions not exported into header file 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..42f7793b5a 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"; @@ -1261,10 +1263,6 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& gInventory.addObserver(opener); } - // Remove script dialog because there is no need in it no more. - LLUUID object_id = notification["payload"]["object_id"].asUUID(); - LLScriptFloaterManager::instance().removeNotificationByObjectId(object_id); - delete this; return false; } @@ -1438,10 +1436,6 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const gInventory.addObserver(opener); } - // Remove script dialog because there is no need in it no more. - LLUUID object_id = notification["payload"]["object_id"].asUUID(); - LLScriptFloaterManager::instance().removeNotificationByObjectId(object_id); - delete this; return false; } @@ -1592,7 +1586,6 @@ void inventory_offer_handler(LLOfferInfo* info) { payload["give_inventory_notification"] = TRUE; LLNotificationPtr notification = LLNotifications::instance().add(p.payload(payload)); - LLScriptFloaterManager::getInstance()->setNotificationToastId(object_id, notification->getID()); } } } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 886f1d9ef5..d0afa9d9de 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4019,9 +4019,14 @@ LLBBox LLViewerObject::getBoundingBoxAgent() const { LLVector3 position_agent; LLQuaternion rot; + LLViewerObject* avatar_parent = NULL; LLViewerObject* root_edit = (LLViewerObject*)getRootEdit(); - LLViewerObject* avatar_parent = (LLViewerObject*)root_edit->getParent(); - if (avatar_parent && avatar_parent->isAvatar() && root_edit->mDrawable.notNull()) + if (root_edit) + { + avatar_parent = (LLViewerObject*)root_edit->getParent(); + } + + if (avatar_parent && avatar_parent->isAvatar() && root_edit && root_edit->mDrawable.notNull()) { LLXform* parent_xform = root_edit->mDrawable->getXform()->getParent(); position_agent = (getPositionEdit() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition(); diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index c4fc2e5cab..2c5c0a37e8 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -105,15 +105,6 @@ void LLViewerParcelMedia::update(LLParcel* parcel) std::string mediaUrl = std::string ( parcel->getMediaURL () ); std::string mediaCurrentUrl = std::string( parcel->getMediaCurrentURL()); - // First use warning - if( (!mediaUrl.empty() || - !parcel->getMusicURL().empty()) - && LLViewerMedia::needsMediaFirstRun()) - { - LLViewerMedia::displayMediaFirstRun(); - return; - } - // if we have a current (link sharing) url, use it instead if (mediaCurrentUrl != "" && parcel->getMediaType() == "text/html") { 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/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 315b7c52cf..4a86e1ca41 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1726,7 +1726,11 @@ void LLViewerWindow::shutdownViews() // destroy the nav bar, not currently part of gViewerWindow // *TODO: Make LLNavigationBar part of gViewerWindow delete LLNavigationBar::getInstance(); - + + // destroy menus after instantiating navbar above, as it needs + // access to gMenuHolder + cleanup_menus(); + // Delete all child views. delete mRootView; mRootView = NULL; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index a5815df20a..b5f0ec7176 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -565,7 +565,7 @@ public: void updateMeshData(); protected: void releaseMeshData(); - /*virtual*/ void restoreMeshData(); + virtual void restoreMeshData(); private: BOOL mDirtyMesh; BOOL mMeshTexturesDirty; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index b1ea8a1bbb..13e28b246a 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -510,8 +510,12 @@ BOOL LLVOAvatarSelf::buildMenus() LLVOAvatarSelf::~LLVOAvatarSelf() { - gAgent.setAvatarObject(NULL); - gAgentWearables.setAvatarObject(NULL); + // gAgents pointer might have been set to a different Avatar Self, don't get rid of it if so. + if (gAgent.getAvatarObject() == this) + { + gAgent.setAvatarObject(NULL); + gAgentWearables.setAvatarObject(NULL); + } delete mScreenp; mScreenp = NULL; } 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/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index ccf49f6a9f..309c2a5f30 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -143,12 +143,12 @@ with the same filename but different name <texture name="DownArrow" file_name="bottomtray/DownArrow.png" preload="false" /> - <texture name="DropDown_Disabled" file_name="widgets/DropDown_Disabled.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> - <texture name="DropDown_Over" file_name="widgets/DropDown_Over.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> - <texture name="DropDown_Press" file_name="widgets/DropDown_Press.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> - <texture name="DropDown_Selected" file_name="widgets/DropDown_Selected.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> - <texture name="DropDown_On" file_name="widgets/DropDown_On.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> - <texture name="DropDown_Off" file_name="widgets/DropDown_Off.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> + <texture name="DropDown_Disabled" file_name="widgets/DropDown_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="99" scale.bottom="4" /> + <texture name="DropDown_Over" file_name="widgets/DropDown_Over.png" preload="true" scale.left="4" scale.top="19" scale.right="99" scale.bottom="4" /> + <texture name="DropDown_Press" file_name="widgets/DropDown_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="99" scale.bottom="4" /> + <texture name="DropDown_Selected" file_name="widgets/DropDown_Selected.png" preload="true" scale.left="4" scale.top="19" scale.right="99" scale.bottom="4" /> + <texture name="DropDown_On" file_name="widgets/DropDown_On.png" preload="true" scale.left="4" scale.top="19" scale.right="99" scale.bottom="4" /> + <texture name="DropDown_Off" file_name="widgets/DropDown_Off.png" preload="true" scale.left="4" scale.top="19" scale.right="99" scale.bottom="4" /> <texture name="DropTarget" file_name="widgets/DropTarget.png" preload="false" /> @@ -265,8 +265,8 @@ with the same filename but different name <texture name="Linden_Dollar_Alert" file_name="widgets/Linden_Dollar_Alert.png"/> <texture name="Linden_Dollar_Background" file_name="widgets/Linden_Dollar_Background.png"/> - <texture name="ListItem_Select" file_name="widgets/ListItem_Select.png" preload="true" /> - <texture name="ListItem_Over" file_name="widgets/ListItem_Over.png" preload="true" /> + <texture name="ListItem_Select" file_name="widgets/ListItem_Select.png" preload="true" scale.left="2" scale.bottom="2" scale.top="22" scale.right="278" /> + <texture name="ListItem_Over" file_name="widgets/ListItem_Over.png" preload="true" scale.left="2" scale.bottom="2" scale.top="22" scale.right="278" /> <texture name="Lock" file_name="icons/Lock.png" preload="false" /> <texture name="Lock2" file_name="navbar/Lock.png" preload="false" /> diff --git a/indra/newview/skins/default/xui/de/panel_side_tray.xml b/indra/newview/skins/default/xui/de/panel_side_tray.xml index 2cd11cdcef..446117962f 100644 --- a/indra/newview/skins/default/xui/de/panel_side_tray.xml +++ b/indra/newview/skins/default/xui/de/panel_side_tray.xml @@ -2,26 +2,26 @@ <!-- Side tray cannot show background because it is always partially on screen to hold tab buttons. --> <side_tray name="sidebar"> - <sidetray_tab description="Seitenleiste auf-/zuklappen." name="sidebar_openclose"/> - <sidetray_tab description="Startseite." name="sidebar_home"> + <sidetray_tab description="Seitenleiste auf-/zuklappen." name="sidebar_openclose" tab_title="Seitenleiste auf-/zuklappen"/> + <sidetray_tab description="Startseite." name="sidebar_home" tab_title="Startseite"> <panel label="Startseite" name="panel_home"/> </sidetray_tab> - <sidetray_tab description="Ihr öffentliches Profil und Auswahl bearbeiten." name="sidebar_me"> + <sidetray_tab description="Ihr öffentliches Profil und Auswahl bearbeiten." name="sidebar_me" tab_title="Mein Profil"> <panel label="Ich" name="panel_me"/> </sidetray_tab> - <sidetray_tab description="Freunde, Kontakte und Leute in Ihrer Nähe finden." name="sidebar_people"> + <sidetray_tab description="Freunde, Kontakte und Leute in Ihrer Nähe finden." name="sidebar_people" tab_title="Leute"> <panel_container name="panel_container"> <panel label="Gruppeninfo" name="panel_group_info_sidetray"/> <panel label="Ignorierte Einwohner & Objekte" name="panel_block_list_sidetray"/> </panel_container> </sidetray_tab> - <sidetray_tab description="Hier finden Sie neue Orte und Orte, die Sie bereits besucht haben." label="Orte" name="sidebar_places"> + <sidetray_tab description="Hier finden Sie neue Orte und Orte, die Sie bereits besucht haben." label="Orte" name="sidebar_places" tab_title="Orte"> <panel label="Orte" name="panel_places"/> </sidetray_tab> - <sidetray_tab description="Inventar durchsuchen." name="sidebar_inventory"> + <sidetray_tab description="Inventar durchsuchen." name="sidebar_inventory" tab_title="Mein Inventar"> <panel label="Inventar bearbeiten" name="sidepanel_inventory"/> </sidetray_tab> - <sidetray_tab description="Ändern Sie Ihr Aussehen und Ihren aktuellen Look." name="sidebar_appearance"> + <sidetray_tab description="Ändern Sie Ihr Aussehen und Ihren aktuellen Look." name="sidebar_appearance" tab_title="Mein Aussehen"> <panel label="Aussehen bearbeiten" name="sidepanel_appearance"/> </sidetray_tab> </side_tray> 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_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml index a797d54749..2bd8420925 100644 --- a/indra/newview/skins/default/xui/en/floater_camera.xml +++ b/indra/newview/skins/default/xui/en/floater_camera.xml @@ -82,6 +82,8 @@ orientation="vertical" tool_tip="Zoom camera toward focus" top_pad="0" + min_val="0" + max_val="1" width="18"> <commit_callback function="Slider.value_changed"/> </slider_bar> 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_test_text_editor.xml b/indra/newview/skins/default/xui/en/floater_test_text_editor.xml index dc8f00d5f3..b730f0e511 100644 --- a/indra/newview/skins/default/xui/en/floater_test_text_editor.xml +++ b/indra/newview/skins/default/xui/en/floater_test_text_editor.xml @@ -28,4 +28,17 @@ width="200"> This contains long text and should scroll horizontally to the right </text_editor> + <text_editor + height="50" + follows="top|left|bottom" + font="SansSerif" + left="10" + name="numeric_text_editor" + tool_tip="text editor for numeric text entry only" + top_pad="10" + text_type="int" + width="200"> + This is text that is NOT a number, so shouldn't appear + </text_editor> + </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/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 72ac457882..90381c2af4 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -1733,21 +1733,6 @@ Try selecting a single parcel. <notification icon="alertmodal.tga" - name="ParcelCanPlayMedia" - type="alertmodal"> -This location can play streaming media. -Streaming media requires a fast Internet connection. - -Play streaming media when available? -(You can change this option later under Preferences > Privacy.) - <usetemplate - name="okcancelbuttons" - notext="Disable" - yestext="Play Media"/> - </notification> - - <notification - icon="alertmodal.tga" name="CannotDeedLandWaitingForServer" type="alertmodal"> Unable to deed land: diff --git a/indra/newview/skins/default/xui/en/panel_active_object_row.xml b/indra/newview/skins/default/xui/en/panel_active_object_row.xml index 7657fb8055..bef5f8dafd 100644 --- a/indra/newview/skins/default/xui/en/panel_active_object_row.xml +++ b/indra/newview/skins/default/xui/en/panel_active_object_row.xml @@ -10,10 +10,6 @@ background_opaque="false" background_visible="true" bg_alpha_color="0.0 0.0 0.0 0.0" > - <string - name="unknown_obj"> - Unknown Object - </string> <chiclet_script name="object_chiclet" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/panel_chat_header.xml b/indra/newview/skins/default/xui/en/panel_chat_header.xml index 89d632c4c6..51e2256a7d 100644 --- a/indra/newview/skins/default/xui/en/panel_chat_header.xml +++ b/indra/newview/skins/default/xui/en/panel_chat_header.xml @@ -19,7 +19,7 @@ name="avatar_icon" top="3" width="18" /> - <text_editor + <text allow_scroll="false" v_pad = "7" read_only = "true" diff --git a/indra/newview/skins/default/xui/en/panel_classified_info.xml b/indra/newview/skins/default/xui/en/panel_classified_info.xml index 31719aad20..34c1923582 100644 --- a/indra/newview/skins/default/xui/en/panel_classified_info.xml +++ b/indra/newview/skins/default/xui/en/panel_classified_info.xml @@ -29,7 +29,7 @@ layout="topleft" name="back_btn" picture_style="true" - left="10" + left="11" tab_stop="false" top="2" width="23" /> @@ -40,7 +40,7 @@ layout="topleft" left_pad="10" name="title" - text_color="white" + text_color="LtGray" top="0" value="Classified Info" use_ellipses="true" @@ -49,13 +49,13 @@ color="DkGray2" opaque="true" follows="all" - height="500" + height="502" layout="topleft" - left="10" + left="9" top_pad="10" name="profile_scroll" reserve_scroll_corner="false" - width="313"> + width="310"> <panel name="scroll_content_panel" follows="left|top" @@ -65,16 +65,16 @@ background_visible="false" height="500" left="0" - width="295"> + width="285"> <texture_picker enabled="false" - follows="left|top" + follows="left|top|right" height="197" layout="topleft" - left="10" + left="11" name="classified_snapshot" - top="20" - width="290" /> + top="10" + width="286" /> <text_editor allow_scroll="false" bg_visible="false" @@ -181,37 +181,35 @@ </scroll_container> <panel follows="left|right|bottom" - height="20" + height="35" layout="topleft" - top_pad="8" - left="10" + top_pad="5" + left="9" name="buttons"> <button follows="bottom|left" - height="19" + height="23" label="Teleport" layout="topleft" left="0" name="teleport_btn" top="0" - width="90" /> + width="101" /> <button follows="bottom|left" - height="19" + height="23" label="Map" layout="topleft" - left_pad="10" + left_pad="3" name="show_on_map_btn" - top="0" - width="90" /> + width="100" /> <button follows="bottom|left" - height="19" + height="23" label="Edit" layout="topleft" - right="-1" name="edit_btn" - top="0" - width="90" /> + left_pad="3" + width="101" /> </panel> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml b/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml index 9518151b72..1375eb87d9 100644 --- a/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml @@ -76,6 +76,6 @@ left_pad="5" right="-8" name="info_chevron" - top_delta="15" + top_delta="24" width="20" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_edit_classified.xml b/indra/newview/skins/default/xui/en/panel_edit_classified.xml index 188ded3dab..a357ba1d97 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_classified.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_classified.xml @@ -23,7 +23,7 @@ layout="topleft" name="back_btn" picture_style="true" - left="10" + left="11" tab_stop="false" top="2" width="23" /> @@ -31,27 +31,27 @@ type="string" length="1" follows="top" - font="SansSerifHuge" - height="15" + font="SansSerifHugeBold" + height="26" layout="topleft" left_pad="10" name="title" - text_color="white" - top="5" + text_color="LtGray" + top="0" width="250"> Edit Classified </text> <scroll_container color="DkGray2" follows="all" - height="510" + height="502" layout="topleft" - left="10" + left="9" top_pad="10" name="profile_scroll" reserve_scroll_corner="false" opaque="true" - width="313"> + width="310"> <panel name="scroll_content_panel" follows="left|top" @@ -65,10 +65,10 @@ <texture_picker follows="left|top|right" height="197" - width="290" + width="286" layout="topleft" - top="20" - left="10" + top="10" + left="11" name="classified_snapshot" /> <icon height="18" @@ -78,7 +78,7 @@ name="edit_icon" label="" tool_tip="Click to select an image" - top="27" + top="17" width="18" /> <text type="string" @@ -165,29 +165,29 @@ </text> <button follows="left|top" - height="20" + height="23" label="Set to Current Location" layout="topleft" - left="8" + left="10" top_pad="5" name="set_to_curr_location_btn" - width="200" /> + width="156" /> <combo_box follows="left|top" - height="18" + height="23" label="" left="10" name="category" top_pad="5" - width="200" /> + width="156" /> <combo_box allow_text_entry="false" follows="left|top" - height="18" + height="23" left="10" name="content_type" top_pad="5" - width="200"> + width="156"> <combo_item name="mature_ci" value="Mature"> @@ -203,10 +203,11 @@ decimal_digits="0" follows="left|top" halign="left" - height="16" + height="23" increment="1" label_width="20" label="L$" + v_pad="10" layout="topleft" left="10" value="50" @@ -228,30 +229,29 @@ </scroll_container> <panel follows="left|right|bottom" - height="20" + height="23" label="bottom_panel" layout="topleft" - left="10" + left="9" name="bottom_panel" top_pad="5" width="303"> <button follows="bottom|left" - height="19" + height="23" label="Save" layout="topleft" name="save_changes_btn" left="0" top="0" - width="130" /> + width="152" /> <button follows="bottom|left" - height="19" + height="23" label="Cancel" layout="topleft" name="cancel_btn" - left_pad="5" - right="-1" - width="130" /> + left_pad="3" + width="152" /> </panel> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_edit_pick.xml b/indra/newview/skins/default/xui/en/panel_edit_pick.xml index 8e39697a16..6ef762dc1d 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_pick.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_pick.xml @@ -18,7 +18,7 @@ image_overlay="BackArrow_Off" layout="topleft" name="back_btn" - left="10" + left="11" tab_stop="false" top="2" width="23" /> @@ -26,26 +26,26 @@ type="string" length="1" follows="top" - font="SansSerifHuge" - height="15" + font="SansSerifHugeBold" + height="26" layout="topleft" left_pad="10" name="title" - text_color="white" - top="5" + text_color="LtGray" + top="0" width="250"> Edit Pick </text> <scroll_container color="DkGray2" follows="all" - height="500" + height="502" layout="topleft" - left="10" + left="9" top_pad="10" name="profile_scroll" opaque="true" - width="313"> + width="310"> <panel name="scroll_content_panel" follows="left|top|right" @@ -59,11 +59,11 @@ <texture_picker follows="left|top|right" height="197" - width="280" + width="272" layout="topleft" no_commit_on_selection="true" - top="20" - left="10" + top="10" + left="11" name="pick_snapshot" /> <icon height="18" @@ -73,7 +73,7 @@ name="edit_icon" label="" tool_tip="Click to select an image" - top="27" + top="17" width="18" /> <text type="string" @@ -100,7 +100,7 @@ max_length="63" name="pick_name" text_color="black" - width="280" /> + width="273" /> <text type="string" length="1" @@ -119,7 +119,7 @@ <text_editor follows="left|top|right" height="100" - width="280" + width="273" hide_scrollbar="false" layout="topleft" left="10" @@ -158,41 +158,40 @@ </text> <button follows="left|top" - height="20" + height="23" label="Set to Current Location" layout="topleft" left="8" top_pad="0" name="set_to_curr_location_btn" - width="200" /> + width="156" /> </panel> </scroll_container> <panel follows="left|right|bottom" - height="20" + height="23" label="bottom_panel" layout="topleft" - left="10" + left="9" name="bottom_panel" top_pad="5" width="303"> <button follows="bottom|left" - height="19" + height="23" label="Save [WHAT]" layout="topleft" name="save_changes_btn" left="0" top="0" - width="130" /> + width="152" /> <button follows="bottom|left" - height="19" + height="23" label="Cancel" layout="topleft" name="cancel_btn" - left_pad="5" - right="-1" - width="130" /> + left_pad="3" + width="152" /> </panel> </panel> 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 diff --git a/indra/newview/skins/default/xui/en/panel_pick_info.xml b/indra/newview/skins/default/xui/en/panel_pick_info.xml index 375f369ba7..097813131f 100644 --- a/indra/newview/skins/default/xui/en/panel_pick_info.xml +++ b/indra/newview/skins/default/xui/en/panel_pick_info.xml @@ -16,7 +16,7 @@ image_overlay="BackArrow_Off" layout="topleft" name="back_btn" - left="10" + left="11" tab_stop="false" top="2" width="23" /> @@ -27,7 +27,7 @@ layout="topleft" left_pad="10" name="title" - text_color="white" + text_color="LtGray" top="0" value="Pick Info" use_ellipses="true" @@ -36,12 +36,12 @@ color="DkGray2" opaque="true" follows="all" - height="500" + height="502" layout="topleft" - left="10" - top_pad="5" + left="9" + top_pad="10" name="profile_scroll" - width="313"> + width="310"> <panel name="scroll_content_panel" follows="left|top|right" @@ -57,10 +57,10 @@ follows="left|top|right" height="197" layout="topleft" - left="10" + left="11" name="pick_snapshot" - top="20" - width="280" /> + top="10" + width="272" /> <text_editor allow_scroll="false" bg_visible="false" @@ -115,8 +115,8 @@ follows="left|right|bottom" height="35" layout="topleft" - top_pad="8" - left="10" + top_pad="5" + left="9" name="buttons"> <button follows="bottom|left" @@ -126,24 +126,22 @@ left="0" name="teleport_btn" top="0" - width="90" /> + width="101" /> <button follows="bottom|left" height="23" label="Map" layout="topleft" - left_pad="10" + left_pad="3" name="show_on_map_btn" - top="0" - width="90" /> + width="100" /> <button follows="bottom|left" height="23" label="Edit" layout="topleft" - right="-1" name="edit_btn" - top="0" - width="90" /> + left_pad="3" + width="101" /> </panel> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_pick_list_item.xml b/indra/newview/skins/default/xui/en/panel_pick_list_item.xml index 9bcce1685e..8b25fb5d2a 100644 --- a/indra/newview/skins/default/xui/en/panel_pick_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_pick_list_item.xml @@ -76,6 +76,6 @@ left_pad="5" right="-8" name="info_chevron" - top_delta="15" + top_delta="24" width="20" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_picks.xml b/indra/newview/skins/default/xui/en/panel_picks.xml index d31f4d039f..887a89d518 100644 --- a/indra/newview/skins/default/xui/en/panel_picks.xml +++ b/indra/newview/skins/default/xui/en/panel_picks.xml @@ -1,5 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <panel +bg_opaque_color="DkGray2" + background_visible="true" + background_opaque="true" follows="all" height="540" label="Picks" @@ -70,13 +73,15 @@ </accordion_tab> </accordion> <panel - background_visible="true" +bg_opaque_color="DkGray2" + background_visible="true" + background_opaque="true" bevel_style="none" enabled="false" auto_resize="false" follows="bottom" - left="0" - height="18" + left="1" + height="27" label="bottom_panel" layout="topleft" name="edit_panel" @@ -90,9 +95,9 @@ image_unselected="OptionsMenu_Off" image_disabled="OptionsMenu_Disabled" layout="topleft" - left="0" + left="10" name="gear_menu_btn" - top="5" + top="9" width="18" /> <button follows="bottom|left" @@ -104,7 +109,7 @@ left_pad="15" name="new_btn" tool_tip="Create a new pick or classified at the current location" - top="5" + top="9" width="18" /> <button follows="bottom|right" @@ -115,14 +120,17 @@ layout="topleft" name="trash_btn" right="-10" - top="5" + top="9" width="18" /> </panel> <panel + bg_opaque_color="DkGray" + background_visible="true" + background_opaque="true" layout="topleft" left="0" height="30" - top_pad="10" + top_pad="7" name="buttons_cucks" width="313"> <button @@ -131,35 +139,33 @@ height="23" label="Info" layout="topleft" - left="5" + left="2" name="info_btn" tab_stop="false" tool_tip="Show pick information" - top="0" - width="55" /> + top="5" + width="95" /> <button enabled="false" follows="bottom|left" height="23" label="Teleport" layout="topleft" - left_pad="5" + left_pad="3" name="teleport_btn" tab_stop="false" tool_tip="Teleport to the corresponding area" - top="0" - width="77" /> + width="117" /> <button enabled="false" follows="bottom|left" height="23" label="Map" layout="topleft" - left_pad="5" + left_pad="3" name="show_on_map_btn" tab_stop="false" tool_tip="Show the corresponding area on the World Map" - top="0" - width="50" /> + width="90" /> </panel> </panel> diff --git a/indra/newview/skins/default/xui/en/widgets/button.xml b/indra/newview/skins/default/xui/en/widgets/button.xml index 74d8478551..1b34a731a5 100644 --- a/indra/newview/skins/default/xui/en/widgets/button.xml +++ b/indra/newview/skins/default/xui/en/widgets/button.xml @@ -7,10 +7,9 @@ image_selected="PushButton_Selected" image_disabled_selected="PushButton_Selected_Disabled" image_disabled="PushButton_Disabled" - image_left_pad="0" - image_right_pad="0" image_top_pad="0" image_bottom_pad="0" + imgoverlay_label_space="1" label_color="ButtonLabelColor" label_color_selected="ButtonLabelSelectedColor" label_color_disabled="ButtonLabelDisabledColor" diff --git a/indra/newview/skins/default/xui/en/widgets/inspector.xml b/indra/newview/skins/default/xui/en/widgets/inspector.xml index 8ec206023e..428b2ce03b 100644 --- a/indra/newview/skins/default/xui/en/widgets/inspector.xml +++ b/indra/newview/skins/default/xui/en/widgets/inspector.xml @@ -1,10 +1,9 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<!-- See also settings.xml UIFloater* settings for configuration --> <inspector name="inspector" - bg_opaque_color="DkGray_66" - background_visible="true" - bg_opaque_image="none" - background_opaque="true" - bg_alpha_image="none" - text_color="InspectorTipTextColor" - /> + bg_opaque_color="DkGray_66" + background_visible="true" + bg_opaque_image="Inspector_Hover" + background_opaque="true" + bg_alpha_image="none" + mouse_opaque="true" + text_color="InspectorTipTextColor"/> diff --git a/indra/newview/skins/default/xui/en/widgets/tool_tip.xml b/indra/newview/skins/default/xui/en/widgets/tool_tip.xml index a19201f7c3..9ca15ae50d 100644 --- a/indra/newview/skins/default/xui/en/widgets/tool_tip.xml +++ b/indra/newview/skins/default/xui/en/widgets/tool_tip.xml @@ -1,12 +1,11 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<!-- See also settings.xml UIFloater* settings for configuration --> <tool_tip name="tooltip" max_width="200" padding="4" wrap="true" font="SansSerif" + mouse_opaque="false" bg_opaque_image="Tooltip" background_opaque="true" background_visible="true" - text_color="ToolTipTextColor" - /> + text_color="ToolTipTextColor"/> diff --git a/indra/newview/skins/default/xui/ja/floater_buy_currency.xml b/indra/newview/skins/default/xui/ja/floater_buy_currency.xml index ffdcf838d3..357b3682ba 100644 --- a/indra/newview/skins/default/xui/ja/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/ja/floater_buy_currency.xml @@ -46,7 +46,7 @@ L$ [AMT] </text> <text name="currency_links"> - [http://www.secondlife.com/my/account/payment_method_management.php?lang=ja-JP payment method] | [http://www.secondlife.com/my/account/currency.php?lang=ja-JP currency] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=ja-JP exchange rate] + [http://www.secondlife.com/my/account/payment_method_management.php?lang=ja-JP 支払方法] | [http://www.secondlife.com/my/account/currency.php?lang=ja-JP 通貨] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=ja-JP 換算レート] </text> <text name="exchange_rate_note"> 金額を再入力して最新換算レートを確認します。 diff --git a/indra/newview/skins/default/xui/ja/panel_side_tray.xml b/indra/newview/skins/default/xui/ja/panel_side_tray.xml index ce5f0b940c..48636f1e3b 100644 --- a/indra/newview/skins/default/xui/ja/panel_side_tray.xml +++ b/indra/newview/skins/default/xui/ja/panel_side_tray.xml @@ -2,26 +2,26 @@ <!-- Side tray cannot show background because it is always partially on screen to hold tab buttons. --> <side_tray name="sidebar"> - <sidetray_tab description="サイドバーを表示・非表示" name="sidebar_openclose"/> - <sidetray_tab description="ホーム。" name="sidebar_home"> + <sidetray_tab description="サイドバーを表示・非表示" name="sidebar_openclose" tab_title="サイドバーを開く・閉じる"/> + <sidetray_tab description="ホーム。" name="sidebar_home" tab_title="ホーム"> <panel label="ホーム" name="panel_home"/> </sidetray_tab> - <sidetray_tab description="あなたの公開プロフィールとピックを編集してください。" name="sidebar_me"> + <sidetray_tab description="あなたの公開プロフィールとピックを編集してください。" name="sidebar_me" tab_title="マイ プロフィール"> <panel label="ミー" name="panel_me"/> </sidetray_tab> - <sidetray_tab description="フレンド、連絡先、近くの人を探してください。" name="sidebar_people"> + <sidetray_tab description="フレンド、連絡先、近くの人を探してください。" name="sidebar_people" tab_title="人"> <panel_container name="panel_container"> <panel label="グループ情報" name="panel_group_info_sidetray"/> <panel label="ブロックされた住人とオブジェクト" name="panel_block_list_sidetray"/> </panel_container> </sidetray_tab> - <sidetray_tab description="行きたい場所、行ったことのある場所を探してください。" label="場所" name="sidebar_places"> + <sidetray_tab description="行きたい場所、行ったことのある場所を探してください。" label="場所" name="sidebar_places" tab_title="場所"> <panel label="場所" name="panel_places"/> </sidetray_tab> - <sidetray_tab description="あなたの持ち物を眺めてください。" name="sidebar_inventory"> + <sidetray_tab description="あなたの持ち物を眺めてください。" name="sidebar_inventory" tab_title="マイ 持ち物"> <panel label="持ち物を編集" name="sidepanel_inventory"/> </sidetray_tab> - <sidetray_tab description="あなたの容姿や現在の見た目を変更してください。" name="sidebar_appearance"> + <sidetray_tab description="あなたの容姿や現在の見た目を変更してください。" name="sidebar_appearance" tab_title="マイ 容姿"> <panel label="容姿の編集" name="sidepanel_appearance"/> </sidetray_tab> </side_tray> |