From b8a46c81eefc3da66fc1a1c3ed9bfbf4418b535d Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 5 Feb 2010 12:06:57 -0800 Subject: Media classes + A step toward restructuring Nearby Media floater Several changes here: - Implemented support for "media classification": see http://docs.google.com/a/lindenlab.com/View?id=ddznhrqn_29vhnr2pg8 - Added settings for auto-playing of said classifications Nearby Media Floater: - On/Off buttons are now explicit...no more power buttons - Parcel Media and Parcel Audio are "lighter weight", with no more on/off - List now sorts with playing items at top, non-playing below - There is now a "Show" drop-down that filters the list by classification - Added checkboxes to the bottom to control auto-play settings More work is needed, so consider this a checkpoint --- indra/newview/app_settings/settings.xml | 33 +++++++ indra/newview/llviewermedia.cpp | 148 ++++++++++++++++++++++++++++++-- indra/newview/llviewermedia.h | 33 +++++-- 3 files changed, 200 insertions(+), 14 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c7300fcee2..32fee52cb4 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4578,6 +4578,39 @@ Value 0 + MediaShowOnOthers + + Comment + Whether or not to show media on other avatars + Persist + 1 + Type + Boolean + Value + 1 + + MediaShowOutsideParcel + + Comment + Whether or not to show media from outside the current parcel + Persist + 1 + Type + Boolean + Value + 0 + + MediaShowWithinParcel + + Comment + Whether or not to show media within the current parcel + Persist + 1 + Type + Boolean + Value + 1 + MemoryLogFrequency Comment diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 9ced0194a2..90fb76c715 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -50,6 +50,9 @@ #include "llcallbacklist.h" #include "llparcel.h" #include "llaudioengine.h" // for gAudiop +#include "llvoavatar.h" +#include "llvoavatarself.h" +#include "llviewerregion.h" #include "llevent.h" // LLSimpleListener #include "llnotificationsutil.h" @@ -62,6 +65,10 @@ #include /*static*/ const char* LLViewerMedia::AUTO_PLAY_MEDIA_SETTING = "ParcelMediaAutoPlayEnable"; +/*static*/ const char* LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING = "MediaShowOnOthers"; +/*static*/ const char* LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING = "MediaShowWithinParcel"; +/*static*/ const char* LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING = "MediaShowOutsideParcel"; + // Move this to its own file. @@ -365,8 +372,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s // The current media URL is not empty. // If (the media was already loaded OR the media was set to autoplay) AND this update didn't come from this agent, // do a navigate. - bool auto_play = (media_impl->mMediaAutoPlay && gSavedSettings.getBOOL(AUTO_PLAY_MEDIA_SETTING)); - + bool auto_play = media_impl->isAutoPlayable(); if((was_loaded || auto_play) && !update_from_self) { needs_navigate = url_changed; @@ -390,7 +396,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s media_impl->mMediaAutoPlay = media_entry->getAutoPlay(); media_impl->mMediaEntryURL = media_entry->getCurrentURL(); - if(media_impl->mMediaAutoPlay && gSavedSettings.getBOOL(AUTO_PLAY_MEDIA_SETTING)) + if(media_impl->isAutoPlayable()) { needs_navigate = true; } @@ -818,7 +824,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg) impl_count_total++; } - + // Overrides if the window is minimized or we lost focus (taking care // not to accidentally "raise" the priority either) if (!gViewerWindow->getActive() /* viewer window minimized? */ @@ -846,7 +852,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg) } } } - + pimpl->setPriority(new_priority); if(pimpl->getUsedInUI()) @@ -940,6 +946,7 @@ bool LLViewerMedia::firstRunCallback(const LLSD& notification, const LLSD& respo { // user has elected to automatically play media. gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, TRUE); + // XXX TODO: what to do about other AUTO_PLAY settings? gSavedSettings.setBOOL("AudioStreamingMusic", TRUE); gSavedSettings.setBOOL("AudioStreamingMedia", TRUE); @@ -959,6 +966,7 @@ bool LLViewerMedia::firstRunCallback(const LLSD& notification, const LLSD& respo else { gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, FALSE); + // XXX TODO: what to do about other AUTO_PLAY settings? gSavedSettings.setBOOL("AudioStreamingMedia", FALSE); gSavedSettings.setBOOL("AudioStreamingMusic", FALSE); } @@ -2111,6 +2119,21 @@ void LLViewerMediaImpl::scaleMouse(S32 *mouse_x, S32 *mouse_y) #endif } + + +////////////////////////////////////////////////////////////////////////////////////////// +bool LLViewerMediaImpl::isMediaTimeBased() +{ + bool result = false; + + if(mMediaSource) + { + result = mMediaSource->pluginSupportsMediaTime(); + } + + return result; +} + ////////////////////////////////////////////////////////////////////////////////////////// bool LLViewerMediaImpl::isMediaPlaying() { @@ -2172,7 +2195,7 @@ void LLViewerMediaImpl::setDisabled(bool disabled) else { // We just (re)enabled this media. Do a navigate if auto-play is in order. - if(mMediaAutoPlay && gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING)) + if(isAutoPlayable()) { navigateTo(mMediaEntryURL, "", true, true); } @@ -2199,6 +2222,12 @@ bool LLViewerMediaImpl::isForcedUnloaded() const } } + // If this media's class is not supposed to be shown, unload + if (!shouldShowBasedOnClass()) + { + return true; + } + return false; } @@ -2684,3 +2713,110 @@ void LLViewerMediaImpl::setTextureID(LLUUID id) } } +////////////////////////////////////////////////////////////////////////////////////////// +// +bool LLViewerMediaImpl::isAutoPlayable() const +{ + return (mMediaAutoPlay && gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING)); +} + +////////////////////////////////////////////////////////////////////////////////////////// +// +bool LLViewerMediaImpl::shouldShowBasedOnClass() const +{ + // If this is parcel media or in the UI, return true always + if (getUsedInUI() || isParcelMedia()) return true; + + bool attached_to_another_avatar = isAttachedToAnotherAvatar(); + bool inside_parcel = isInAgentParcel(); + + // llinfos << " hasFocus = " << hasFocus() << + // " others = " << (attached_to_another_avatar && gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING)) << + // " within = " << (inside_parcel && gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING)) << + // " outside = " << (!inside_parcel && gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING)) << llendl; + + // If it has focus, we should show it + if (hasFocus()) + return true; + + // If it is attached to an avatar and the pref is off, we shouldn't show it + if (attached_to_another_avatar) + return gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING); + + if (inside_parcel) + return gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING); + else + return gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING); +} + +////////////////////////////////////////////////////////////////////////////////////////// +// +bool LLViewerMediaImpl::isAttachedToAnotherAvatar() const +{ + bool result = false; + + std::list< LLVOVolume* >::const_iterator iter = mObjectList.begin(); + std::list< LLVOVolume* >::const_iterator end = mObjectList.end(); + for ( ; iter != end; iter++) + { + if (isObjectAttachedToAnotherAvatar(*iter)) + { + result = true; + break; + } + } + return result; +} + +////////////////////////////////////////////////////////////////////////////////////////// +// +//static +bool LLViewerMediaImpl::isObjectAttachedToAnotherAvatar(LLVOVolume *obj) +{ + bool result = false; + LLXform *xform = obj; + // Walk up parent chain + while (NULL != xform) + { + LLViewerObject *object = dynamic_cast (xform); + if (NULL != object) + { + LLVOAvatar *avatar = object->asAvatar(); + if (NULL != avatar && avatar != gAgent.getAvatarObject()) + { + result = true; + break; + } + } + xform = xform->getParent(); + } + return result; +} + +////////////////////////////////////////////////////////////////////////////////////////// +// +bool LLViewerMediaImpl::isInAgentParcel() const +{ + bool result = false; + + std::list< LLVOVolume* >::const_iterator iter = mObjectList.begin(); + std::list< LLVOVolume* >::const_iterator end = mObjectList.end(); + for ( ; iter != end; iter++) + { + LLVOVolume *object = *iter; + if (LLViewerMediaImpl::isObjectInAgentParcel(object)) + { + result = true; + break; + } + } + return result; +} + +////////////////////////////////////////////////////////////////////////////////////////// +// +// static +bool LLViewerMediaImpl::isObjectInAgentParcel(LLVOVolume *obj) +{ + return (LLViewerParcelMgr::getInstance()->inAgentParcel(obj->getPositionGlobal())); +} diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index ff18ed605a..849e14e6c8 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -48,7 +48,7 @@ class LLViewerMediaImpl; class LLUUID; class LLViewerMediaTexture; class LLMediaEntry; -class LLVOVolume ; +class LLVOVolume; class LLMimeDiscoveryResponder; typedef LLPointer viewer_media_t; @@ -76,7 +76,10 @@ class LLViewerMedia public: // String to get/set media autoplay in gSavedSettings - static const char *AUTO_PLAY_MEDIA_SETTING; + static const char* AUTO_PLAY_MEDIA_SETTING; + static const char* SHOW_MEDIA_ON_OTHERS_SETTING; + static const char* SHOW_MEDIA_WITHIN_PARCEL_SETTING; + static const char* SHOW_MEDIA_OUTSIDE_PARCEL_SETTING; typedef std::vector impl_list; @@ -204,14 +207,16 @@ public: void updateImagesMediaStreams(); LLUUID getMediaTextureID() const; - void suspendUpdates(bool suspend) { mSuspendUpdates = suspend; }; + void suspendUpdates(bool suspend) { mSuspendUpdates = suspend; } void setVisible(bool visible); - bool getVisible() const { return mVisible; }; + bool getVisible() const { return mVisible; } + bool isVisible() const { return mVisible; } + bool isMediaTimeBased(); bool isMediaPlaying(); bool isMediaPaused(); bool hasMedia() const; - bool isMediaFailed() const { return mMediaSourceFailed; }; + bool isMediaFailed() const { return mMediaSourceFailed; } void setMediaFailed(bool val) { mMediaSourceFailed = val; } void resetPreviousMediaState(); @@ -227,10 +232,10 @@ public: // returns true if this instance could be playable based on autoplay setting, current load state, etc. bool isPlayable() const; - void setIsParcelMedia(bool is_parcel_media) { mIsParcelMedia = is_parcel_media; }; - bool isParcelMedia() const { return mIsParcelMedia; }; + void setIsParcelMedia(bool is_parcel_media) { mIsParcelMedia = is_parcel_media; } + bool isParcelMedia() const { return mIsParcelMedia; } - ECursorType getLastSetCursor() { return mLastSetCursor; }; + ECursorType getLastSetCursor() { return mLastSetCursor; } // utility function to create a ready-to-use media instance from a desired media type. static LLPluginClassMedia* newSourceFromMediaType(std::string media_type, LLPluginClassMediaOwner *owner /* may be NULL */, S32 default_width, S32 default_height); @@ -331,6 +336,18 @@ public: void cancelMimeTypeProbe(); + // Is this media attached to an avatar *not* self + bool isAttachedToAnotherAvatar() const; + + // Is this media in the agent's parcel? + bool isInAgentParcel() const; + +private: + bool isAutoPlayable() const; + bool shouldShowBasedOnClass() const; + static bool isObjectAttachedToAnotherAvatar(LLVOVolume *obj); + static bool isObjectInAgentParcel(LLVOVolume *obj); + private: // a single media url with some data and an impl. LLPluginClassMedia* mMediaSource; -- cgit v1.2.3 From 8ca06e7bf37f7e5391e14f74d8404bdc05d683d4 Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 8 Feb 2010 08:19:32 -0800 Subject: nearby media pops up on hover --- indra/llui/lldockcontrol.cpp | 41 ++++++++++++ indra/llui/lldockcontrol.h | 5 +- indra/newview/llappviewer.cpp | 3 - indra/newview/llstatusbar.cpp | 72 +++++++++++----------- .../skins/default/xui/en/panel_status_bar.xml | 23 ++++++- 5 files changed, 99 insertions(+), 45 deletions(-) (limited to 'indra') diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp index d836a5f4cd..f91c07184d 100644 --- a/indra/llui/lldockcontrol.cpp +++ b/indra/llui/lldockcontrol.cpp @@ -162,7 +162,9 @@ bool LLDockControl::isDockVisible() { case LEFT: // to keep compiler happy break; + case BOTTOM: case TOP: + { // check is dock inside parent rect LLRect dockParentRect = mDockWidget->getParent()->calcScreenRect(); @@ -173,6 +175,9 @@ bool LLDockControl::isDockVisible() } break; } + default: + break; + } } } @@ -254,6 +259,42 @@ void LLDockControl::moveDockable() } mDockTongueY = dockRect.mTop; + break; + case BOTTOM: + x = dockRect.getCenterX() - dockableRect.getWidth() / 2; + y = dockRect.mBottom; + // unique docking used with dock tongue, so add tongue height o the Y coordinate + if (use_tongue) + { + y -= mDockTongue->getHeight(); + } + + // check is dockable inside root view rect + if (x < rootRect.mLeft) + { + x = rootRect.mLeft; + } + if (x + dockableRect.getWidth() > rootRect.mRight) + { + x = rootRect.mRight - dockableRect.getWidth(); + } + + // calculate dock tongue position + dockParentRect = mDockWidget->getParent()->calcScreenRect(); + if (dockRect.getCenterX() < dockParentRect.mLeft) + { + mDockTongueX = dockParentRect.mLeft - mDockTongue->getWidth() / 2; + } + else if (dockRect.getCenterX() > dockParentRect.mRight) + { + mDockTongueX = dockParentRect.mRight - mDockTongue->getWidth() / 2;; + } + else + { + mDockTongueX = dockRect.getCenterX() - mDockTongue->getWidth() / 2; + } + mDockTongueY = dockRect.mTop + mDockTongue->getHeight(); + break; } diff --git a/indra/llui/lldockcontrol.h b/indra/llui/lldockcontrol.h index 550955c4c5..a5caf68001 100644 --- a/indra/llui/lldockcontrol.h +++ b/indra/llui/lldockcontrol.h @@ -47,8 +47,9 @@ class LLDockControl public: enum DocAt { - TOP - ,LEFT + TOP, + LEFT, + BOTTOM }; public: diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 2d694eefd3..5a2152e1e7 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1353,9 +1353,6 @@ bool LLAppViewer::cleanup() llinfos << "Cache files removed" << llendflush; - - cleanup_menus(); - // Wait for any pending VFS IO while (1) { diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index bff32af228..a2648e4c3a 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -130,7 +130,6 @@ LLStatusBar::LLStatusBar(const LLRect& rect) // status bar can possible overlay menus? setMouseOpaque(FALSE); - setIsChrome(TRUE); // size of day of the weeks and year sDays.reserve(7); @@ -140,9 +139,39 @@ LLStatusBar::LLStatusBar(const LLRect& rect) mHealthTimer = new LLFrameTimer(); LLUICtrlFactory::getInstance()->buildPanel(this,"panel_status_bar.xml"); +} - // status bar can never get a tab - setFocusRoot(FALSE); +LLStatusBar::~LLStatusBar() +{ + delete mBalanceTimer; + mBalanceTimer = NULL; + + delete mHealthTimer; + mHealthTimer = NULL; + + // LLView destructor cleans up children +} + +//----------------------------------------------------------------------- +// Overrides +//----------------------------------------------------------------------- + +// virtual +void LLStatusBar::draw() +{ + refresh(); + LLPanel::draw(); +} + +BOOL LLStatusBar::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ + show_navbar_context_menu(this,x,y); + return TRUE; +} + +BOOL LLStatusBar::postBuild() +{ + gMenuBarView->setRightMouseDownCallback(boost::bind(&show_navbar_context_menu, _1, _2, _3)); // build date necessary data (must do after panel built) setupDate(); @@ -158,7 +187,9 @@ LLStatusBar::LLStatusBar(const LLRect& rect) mBtnVolume = getChild( "volume_btn" ); mBtnVolume->setClickedCallback( onClickVolume, this ); mBtnVolume->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterVolume, this)); - mBtnVolume->setIsChrome(TRUE); + + LLButton* media_toggle = getChild("media_toggle_btn"); + media_toggle->setMouseEnterCallback(boost::bind(&LLFloaterReg::showInstance, "nearby_media", LLSD(), true)); gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2)); @@ -218,39 +249,6 @@ LLStatusBar::LLStatusBar(const LLRect& rect) mPanelVolumePulldown->setShape(volume_pulldown_rect); mPanelVolumePulldown->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); mPanelVolumePulldown->setVisible(FALSE); -} - -LLStatusBar::~LLStatusBar() -{ - delete mBalanceTimer; - mBalanceTimer = NULL; - - delete mHealthTimer; - mHealthTimer = NULL; - - // LLView destructor cleans up children -} - -//----------------------------------------------------------------------- -// Overrides -//----------------------------------------------------------------------- - -// virtual -void LLStatusBar::draw() -{ - refresh(); - LLPanel::draw(); -} - -BOOL LLStatusBar::handleRightMouseDown(S32 x, S32 y, MASK mask) -{ - show_navbar_context_menu(this,x,y); - return TRUE; -} - -BOOL LLStatusBar::postBuild() -{ - gMenuBarView->setRightMouseDownCallback(boost::bind(&show_navbar_context_menu, _1, _2, _3)); return TRUE; } diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml index 5754f67045..77eb9f2a75 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -3,6 +3,7 @@ background_opaque="true" background_visible="true" bg_opaque_color="MouseGray" + chrome="true" follows="top|right" height="19" layout="topleft" @@ -10,6 +11,7 @@ mouse_opaque="false" name="status" top="19" + tab_stop="false" width="1000"> @@ -73,7 +75,7 @@ pad_bottom="2" tool_tip="Click to buy more L$" top="2" - width="71" /> + width="45" /> + width="80"> 24:00 AM PST + + - + + + + + + + + + + + + + + + + Parcel Audio + + + + + + + + - + - - - - + + - + - Nearby Media - - - + + - Show: - - + - - - - - - + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + left="10"/> + + + + -- cgit v1.2.3 From 1513643e62a88531888f330e57aa1eb623061729 Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 16 Feb 2010 15:45:17 -0800 Subject: EXT-5471 - Tons of spam in log about Invalid param "name" reviewed by Rick --- indra/llui/llui.cpp | 10 ++++++++-- indra/llui/llui.h | 4 ++-- indra/llui/lluiimage.h | 1 + indra/llxuixml/llinitparam.cpp | 28 ++++----------------------- indra/llxuixml/llinitparam.h | 43 +++++++++++++++++++----------------------- 5 files changed, 34 insertions(+), 52 deletions(-) (limited to 'indra') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 76f07373b4..caf04339c2 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1894,7 +1894,9 @@ namespace LLInitParam blue("blue"), alpha("alpha"), control("") - {} + { + setBlockFromValue(); + } void TypedParam::setValueFromBlock() const { @@ -1939,6 +1941,7 @@ namespace LLInitParam size("size"), style("style") { + setBlockFromValue(); addSynonym(name, ""); } @@ -1979,7 +1982,9 @@ namespace LLInitParam bottom("bottom"), width("width"), height("height") - {} + { + setBlockFromValue(); + } void TypedParam::setValueFromBlock() const { @@ -2064,6 +2069,7 @@ namespace LLInitParam x("x"), y("y") { + setBlockFromValue(); } void TypedParam::setValueFromBlock() const diff --git a/indra/llui/llui.h b/indra/llui/llui.h index 5840e76f5c..af8d4ea03b 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -426,8 +426,8 @@ namespace LLInitParam { typedef BlockValue super_t; public: - Mandatory name; - Optional size, + Optional name, + size, style; TypedParam(BlockDescriptor& descriptor, const char* name, const LLFontGL* const value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count); diff --git a/indra/llui/lluiimage.h b/indra/llui/lluiimage.h index bdfc44262d..4ea0738026 100644 --- a/indra/llui/lluiimage.h +++ b/indra/llui/lluiimage.h @@ -109,6 +109,7 @@ namespace LLInitParam TypedParam(BlockDescriptor& descriptor, const char* name, super_t::value_assignment_t value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count) : super_t(descriptor, name, value, func, min_count, max_count) { + setBlockFromValue(); } void setValueFromBlock() const; diff --git a/indra/llxuixml/llinitparam.cpp b/indra/llxuixml/llinitparam.cpp index fb0a04dc58..2ead5a4a57 100644 --- a/indra/llxuixml/llinitparam.cpp +++ b/indra/llxuixml/llinitparam.cpp @@ -137,7 +137,7 @@ namespace LLInitParam } - bool BaseBlock::validateBlock(bool silent) const + bool BaseBlock::validateBlock(bool emit_errors) const { const BlockDescriptor& block_data = getBlockDescriptor(); for (BlockDescriptor::param_validation_list_t::const_iterator it = block_data.mValidationList.begin(); it != block_data.mValidationList.end(); ++it) @@ -145,7 +145,7 @@ namespace LLInitParam const Param* param = getParamFromHandle(it->first); if (!it->second(param)) { - if (!silent) + if (emit_errors) { llwarns << "Invalid param \"" << getParamName(block_data, param) << "\"" << llendl; } @@ -458,7 +458,7 @@ namespace LLInitParam // take all provided params from other and apply to self // NOTE: this requires that "other" is of the same derived type as this - bool BaseBlock::overwriteFromImpl(BlockDescriptor& block_data, const BaseBlock& other) + bool BaseBlock::merge(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) { bool param_changed = false; BlockDescriptor::all_params_list_t::const_iterator end_it = block_data.mAllParams.end(); @@ -471,27 +471,7 @@ namespace LLInitParam if (merge_func) { Param* paramp = getParamFromHandle(it->mParamHandle); - param_changed |= merge_func(*paramp, *other_paramp, true); - } - } - return param_changed; - } - - // take all provided params that are not already provided, and apply to self - bool BaseBlock::fillFromImpl(BlockDescriptor& block_data, const BaseBlock& other) - { - bool param_changed = false; - BlockDescriptor::all_params_list_t::const_iterator end_it = block_data.mAllParams.end(); - for (BlockDescriptor::all_params_list_t::const_iterator it = block_data.mAllParams.begin(); - it != end_it; - ++it) - { - const Param* other_paramp = other.getParamFromHandle(it->mParamHandle); - ParamDescriptor::merge_func_t merge_func = it->mMergeFunc; - if (merge_func) - { - Param* paramp = getParamFromHandle(it->mParamHandle); - param_changed |= merge_func(*paramp, *other_paramp, false); + param_changed |= merge_func(*paramp, *other_paramp, overwrite); } } return param_changed; diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index d264cea3b2..c9c1d4af90 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -407,7 +407,7 @@ namespace LLInitParam class BaseBlock { public: - // "Multiple" constraint types + // "Multiple" constraint types, put here in root class to avoid ambiguity during use struct AnyAmount { static U32 minCount() { return 0; } @@ -452,7 +452,7 @@ namespace LLInitParam bool submitValue(const Parser::name_stack_t& name_stack, Parser& p, bool silent=false); param_handle_t getHandleFromParam(const Param* param) const; - bool validateBlock(bool silent = false) const; + bool validateBlock(bool emit_errors = true) const; Param* getParamFromHandle(const param_handle_t param_handle) { @@ -500,10 +500,7 @@ namespace LLInitParam // take all provided params from other and apply to self - bool overwriteFromImpl(BlockDescriptor& block_data, const BaseBlock& other); - - // take all provided params that are not already provided, and apply to self - bool fillFromImpl(BlockDescriptor& block_data, const BaseBlock& other); + bool merge(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite); // can be updated in getters mutable S32 mChangeVersion; @@ -805,7 +802,7 @@ namespace LLInitParam if (Param::getProvided() && mData.mValidatedVersion < T::getLastChangeVersion()) { // a sub-block is "provided" when it has been filled in enough to be valid - mData.mValidated = T::validateBlock(true); + mData.mValidated = T::validateBlock(false); mData.mValidatedVersion = T::getLastChangeVersion(); } return Param::getProvided() && mData.mValidated; @@ -1236,7 +1233,7 @@ namespace LLInitParam it != mValues.end(); ++it) { - if(it->validateBlock(true)) count++; + if(it->validateBlock(false)) count++; } return count; } @@ -1286,7 +1283,7 @@ namespace LLInitParam bool overwriteFrom(const self_t& other) { mCurChoice = other.mCurChoice; - return BaseBlock::overwriteFromImpl(blockDescriptor(), other); + return BaseBlock::merge(blockDescriptor(), other, true); } // take all provided params that are not already provided, and apply to self @@ -1413,13 +1410,13 @@ namespace LLInitParam // take all provided params from other and apply to self bool overwriteFrom(const self_t& other) { - return BaseBlock::overwriteFromImpl(blockDescriptor(), other); + return BaseBlock::merge(blockDescriptor(), other, true); } // take all provided params that are not already provided, and apply to self bool fillFrom(const self_t& other) { - return BaseBlock::fillFromImpl(blockDescriptor(), other); + return BaseBlock::merge(blockDescriptor(), other, false); } protected: Block() @@ -1710,7 +1707,7 @@ namespace LLInitParam // if cached value is stale, regenerate from params if (Param::getProvided() && mData.mLastParamVersion < BaseBlock::getLastChangeVersion()) { - if (block_t::validateBlock(true)) + if (block_t::validateBlock(false)) { static_cast(this)->setValueFromBlock(); // clear stale keyword associated with old value @@ -1769,7 +1766,7 @@ namespace LLInitParam if (Param::getProvided() && (mData.mLastParamVersion < BaseBlock::getLastChangeVersion())) { // go ahead and issue warnings at this point if any param is invalid - if(block_t::validateBlock(false)) + if(block_t::validateBlock(true)) { static_cast(this)->setValueFromBlock(); mData.clearKey(); @@ -1797,25 +1794,23 @@ namespace LLInitParam private: static bool mergeWith(Param& dst, const Param& src, bool overwrite) { - const self_t& src_param = static_cast(src); + const self_t& src_typed_param = static_cast(src); self_t& dst_typed_param = static_cast(dst); - if (src_param.isProvided() + if (src_typed_param.isProvided() && (overwrite || !dst_typed_param.isProvided())) { // assign individual parameters - if (overwrite) - { - dst_typed_param.BaseBlock::overwriteFromImpl(block_t::blockDescriptor(), src_param); - } - else - { - dst_typed_param.BaseBlock::fillFromImpl(block_t::blockDescriptor(), src_param); - } + dst_typed_param.BaseBlock::merge(block_t::blockDescriptor(), src_typed_param, overwrite); + // then copy actual value - dst_typed_param.mData.mValue = src_param.get(); + dst_typed_param.mData.mValue = src_typed_param.get(); dst_typed_param.mData.clearKey(); dst_typed_param.setProvided(true); + + // Propagate value back to block params since the value was updated during this merge. + // This will result in mData.mValue and the block params being in sync. + static_cast(dst_typed_param).setBlockFromValue(); return true; } return false; -- cgit v1.2.3 From 69032d8d9d660de5b3c97589b7cc55dac70b153c Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 16 Feb 2010 19:14:55 -0800 Subject: EXT-5071 - Script Editor slows down FPS when editing scripts with 500+ lines reviewed by Monroe --- indra/llui/lltexteditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index ce5f1bd082..7d230f7d42 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2524,9 +2524,9 @@ void LLTextEditor::loadKeywords(const std::string& filename, void LLTextEditor::updateSegments() { - LLFastTimer ft(FTM_SYNTAX_HIGHLIGHTING); - if (mKeywords.isLoaded()) + if (mReflowIndex < S32_MAX && mKeywords.isLoaded()) { + LLFastTimer ft(FTM_SYNTAX_HIGHLIGHTING); // HACK: No non-ascii keywords for now segment_vec_t segment_list; mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this); -- cgit v1.2.3 From 6518cbdfa578c13cfc96191fef737045fa5d9919 Mon Sep 17 00:00:00 2001 From: Eli Linden Date: Wed, 17 Feb 2010 11:44:51 +0800 Subject: DEV-43688 Cycle3 massive linguistic changes for DE by Simone for better UI, post truncation fix --- indra/newview/skins/default/xui/de/floater_pay.xml | 4 ++-- indra/newview/skins/default/xui/de/floater_pay_object.xml | 2 +- indra/newview/skins/default/xui/de/floater_preferences.xml | 4 ++-- indra/newview/skins/default/xui/de/floater_preview_animation.xml | 4 ++-- indra/newview/skins/default/xui/de/floater_preview_sound.xml | 4 ++-- indra/newview/skins/default/xui/de/floater_report_abuse.xml | 2 +- indra/newview/skins/default/xui/de/floater_sell_land.xml | 8 ++++---- indra/newview/skins/default/xui/de/floater_snapshot.xml | 6 +++--- indra/newview/skins/default/xui/de/inspect_object.xml | 2 +- indra/newview/skins/default/xui/de/menu_attachment_other.xml | 2 +- indra/newview/skins/default/xui/de/menu_avatar_other.xml | 2 +- indra/newview/skins/default/xui/de/menu_inspect_avatar_gear.xml | 2 +- indra/newview/skins/default/xui/de/menu_inspect_object_gear.xml | 2 +- indra/newview/skins/default/xui/de/menu_inventory.xml | 6 +++--- indra/newview/skins/default/xui/de/menu_object.xml | 2 +- indra/newview/skins/default/xui/de/menu_participant_list.xml | 2 +- indra/newview/skins/default/xui/de/menu_people_groups.xml | 2 +- indra/newview/skins/default/xui/de/menu_people_nearby.xml | 2 +- .../skins/default/xui/de/menu_people_nearby_multiselect.xml | 2 +- .../newview/skins/default/xui/de/menu_people_nearby_view_sort.xml | 4 ++-- .../newview/skins/default/xui/de/menu_people_recent_view_sort.xml | 2 +- indra/newview/skins/default/xui/de/menu_profile_overflow.xml | 2 +- indra/newview/skins/default/xui/de/menu_viewer.xml | 6 +++--- indra/newview/skins/default/xui/de/notifications.xml | 8 ++++---- indra/newview/skins/default/xui/de/panel_classified_info.xml | 2 +- indra/newview/skins/default/xui/de/panel_edit_classified.xml | 2 +- indra/newview/skins/default/xui/de/panel_edit_pick.xml | 2 +- indra/newview/skins/default/xui/de/panel_friends.xml | 2 +- indra/newview/skins/default/xui/de/panel_group_notify.xml | 2 +- indra/newview/skins/default/xui/de/panel_main_inventory.xml | 2 +- indra/newview/skins/default/xui/de/panel_navigation_bar.xml | 2 +- indra/newview/skins/default/xui/de/panel_preferences_alerts.xml | 4 ++-- indra/newview/skins/default/xui/de/panel_preferences_general.xml | 4 ++-- indra/newview/skins/default/xui/de/panel_preferences_privacy.xml | 4 ++-- indra/newview/skins/default/xui/de/sidepanel_task_info.xml | 2 +- 35 files changed, 55 insertions(+), 55 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/de/floater_pay.xml b/indra/newview/skins/default/xui/de/floater_pay.xml index 6eb1d9472d..fb89eeb600 100644 --- a/indra/newview/skins/default/xui/de/floater_pay.xml +++ b/indra/newview/skins/default/xui/de/floater_pay.xml @@ -7,7 +7,7 @@ Einwohner bezahlen - Zahlen: + Bezahlen: @@ -20,6 +20,6 @@ Oder Betrag auswählen: -