diff options
| author | Richard Nelson <richard@lindenlab.com> | 2011-09-16 11:58:16 -0700 | 
|---|---|---|
| committer | Richard Nelson <richard@lindenlab.com> | 2011-09-16 11:58:16 -0700 | 
| commit | 712d4585950230ebd5ba66b3c60982ebcf6ebce9 (patch) | |
| tree | dfdc5af716d83250c0be5b34eaf01cd66c1b1dee | |
| parent | 9e00dc0cc0af26d85d5613e8bddc03067e37c7d2 (diff) | |
| parent | c10832bb9ade5efa2a501cb3b39f769aa3024363 (diff) | |
Automated merge with ssh://hg.lindenlab.com/richard/viewer-experience
| -rw-r--r-- | indra/llui/llnotificationtemplate.h | 4 | ||||
| -rw-r--r-- | indra/llui/lluictrlfactory.h | 6 | ||||
| -rw-r--r-- | indra/llxuixml/llinitparam.h | 115 | ||||
| -rw-r--r-- | indra/llxuixml/llxuiparser.cpp | 3 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 168 | 
5 files changed, 194 insertions, 102 deletions
| diff --git a/indra/llui/llnotificationtemplate.h b/indra/llui/llnotificationtemplate.h index eff572b553..ab777d37a5 100644 --- a/indra/llui/llnotificationtemplate.h +++ b/indra/llui/llnotificationtemplate.h @@ -88,10 +88,10 @@ struct LLNotificationTemplate  	{  	private:  		// this idiom allows  -		// <notification unique="true"> +		// <notification> <unique/> </notification>  		// as well as  		// <notification> <unique> <context></context> </unique>... -		Optional<bool>			dummy_val; +		Flag			dummy_val;  	public:  		Multiple<UniquenessContext>	contexts; diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index f0ba7fc7d7..d345ad4cd0 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -125,12 +125,12 @@ private:  	// base case for recursion, there are NO base classes of LLInitParam::BaseBlock  	template<int DUMMY> -	class ParamDefaults<LLInitParam::BaseBlock, DUMMY> : public LLSingleton<ParamDefaults<LLInitParam::BaseBlock, DUMMY> > +	class ParamDefaults<LLInitParam::BaseBlockWithFlags, DUMMY> : public LLSingleton<ParamDefaults<LLInitParam::BaseBlockWithFlags, DUMMY> >  	{  	public: -		const LLInitParam::BaseBlock& get() { return mBaseBlock; } +		const LLInitParam::BaseBlockWithFlags& get() { return mBaseBlock; }  	private: -		LLInitParam::BaseBlock mBaseBlock; +		LLInitParam::BaseBlockWithFlags mBaseBlock;  	};  public: diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index 9d0fe781ce..fd4482f592 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -289,20 +289,20 @@ namespace LLInitParam  	protected:  		bool anyProvided() const { return mIsProvided; } -		Param(class BaseBlock* enclosing_block); +		Param(BaseBlock* enclosing_block);  		// store pointer to enclosing block as offset to reduce space and allow for quick copying -		class BaseBlock& enclosingBlock() const +		BaseBlock& enclosingBlock() const  		{   			const U8* my_addr = reinterpret_cast<const U8*>(this);  			// get address of enclosing BLOCK class using stored offset to enclosing BaseBlock class -			return *const_cast<class BaseBlock*> -				(reinterpret_cast<const class BaseBlock*> +			return *const_cast<BaseBlock*> +				(reinterpret_cast<const BaseBlock*>  					(my_addr - (ptrdiff_t)(S32)mEnclosingBlockOffset));  		}  	private: -		friend class BaseBlock; +		friend BaseBlock;  		U32		mEnclosingBlockOffset:31;  		U32		mIsProvided:1; @@ -367,18 +367,16 @@ namespace LLInitParam  		typedef boost::unordered_map<const std::string, ParamDescriptorPtr>						param_map_t;   		typedef std::vector<ParamDescriptorPtr>													param_list_t;  -		typedef std::list<ParamDescriptorPtr>														all_params_list_t; +		typedef std::list<ParamDescriptorPtr>													all_params_list_t;  		typedef std::vector<std::pair<param_handle_t, ParamDescriptor::validation_func_t> >		param_validation_list_t;  		param_map_t						mNamedParams;			// parameters with associated names  		param_list_t					mUnnamedParams;			// parameters with_out_ associated names  		param_validation_list_t			mValidationList;		// parameters that must be validated  		all_params_list_t				mAllParams;				// all parameters, owns descriptors - -		size_t					mMaxParamOffset; - -		EInitializationState	mInitializationState;	// whether or not static block data has been initialized -		class BaseBlock*		mCurrentBlockPtr;		// pointer to block currently being constructed +		size_t							mMaxParamOffset; +		EInitializationState			mInitializationState;	// whether or not static block data has been initialized +		BaseBlock*						mCurrentBlockPtr;		// pointer to block currently being constructed  	};  	class BaseBlock @@ -499,6 +497,92 @@ namespace LLInitParam  		const std::string& getParamName(const BlockDescriptor& block_data, const Param* paramp) const;  	}; +	class BaseBlockWithFlags : public BaseBlock +	{ +	public: +		class FlagBase : public Param +		{ +		public: +			typedef FlagBase self_t; + +			FlagBase(const char* name, BaseBlock* enclosing_block) : Param(enclosing_block)  +			{ +				if (LL_UNLIKELY(enclosing_block->mostDerivedBlockDescriptor().mInitializationState == BlockDescriptor::INITIALIZING)) +				{ +					ParamDescriptorPtr param_descriptor = ParamDescriptorPtr(new ParamDescriptor( +						enclosing_block->getHandleFromParam(this), +						&mergeWith, +						&deserializeParam, +						&serializeParam, +						NULL, +						&inspectParam, +						0, 1)); +					BaseBlock::addParam(enclosing_block->mostDerivedBlockDescriptor(), param_descriptor, name); +				} +			} + +			bool isProvided() const { return anyProvided(); } + +		private: +			static bool mergeWith(Param& dst, const Param& src, bool overwrite) +			{ +				const self_t& src_typed_param = static_cast<const self_t&>(src); +				self_t& dst_typed_param = static_cast<self_t&>(dst); + +				if (src_typed_param.isProvided() +					&& (overwrite || !dst_typed_param.isProvided())) +				{ +					dst.setProvided(true); +					return true; +				} +				return false; +			} + +			static bool deserializeParam(Param& param, Parser& parser, const Parser::name_stack_range_t& name_stack, S32 generation) +			{ +				self_t& typed_param = static_cast<self_t&>(param); + +				// no further names in stack, parse value now +				if (name_stack.first == name_stack.second) +				{ +					typed_param.setProvided(true); +					typed_param.enclosingBlock().paramChanged(param, true); +					return true; +				} + +				return false; +			} + +			static void serializeParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, const Param* diff_param) +			{ +				const self_t& typed_param = static_cast<const self_t&>(param); +				const self_t* typed_diff_param = static_cast<const self_t*>(diff_param); + +				if (!typed_param.isProvided()) return; + +				if (!name_stack.empty()) +				{ +					name_stack.back().second = parser.newParseGeneration(); +				} + +				// then try to serialize value directly +				if (!typed_diff_param || !typed_diff_param->isProvided()) +				{ +					if (!parser.writeValue(NoParamValue(), name_stack))  +					{ +						return; +					} +				} +			} + +			static void inspectParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, S32 min_count, S32 max_count) +			{ +				// tell parser about our actual type +				parser.inspectValue<NoParamValue>(name_stack, min_count, max_count, NULL); +			} +		}; +	}; +  	// these templates allow us to distinguish between template parameters  	// that derive from BaseBlock and those that don't  	template<typename T, typename Void = void> @@ -1424,7 +1508,7 @@ namespace LLInitParam  		}  	}; -	template <typename DERIVED_BLOCK, typename BASE_BLOCK = BaseBlock> +	template <typename DERIVED_BLOCK, typename BASE_BLOCK = BaseBlockWithFlags>  	class Block   	:	public BASE_BLOCK  	{ @@ -1520,6 +1604,13 @@ namespace LLInitParam  		}; +		class Flag : public FlagBase +		{ +		public: +			Flag(const char* name) : FlagBase(name, DERIVED_BLOCK::selfBlockDescriptor().mCurrentBlockPtr) +			{} +		}; +  		template <typename T, typename RANGE = BaseBlock::AnyAmount, typename NAME_VALUE_LOOKUP = TypeValues<T> >  		class Multiple : public TypedParam<T, NAME_VALUE_LOOKUP, true>  		{ diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp index 72a7bb7af5..4af077b22c 100644 --- a/indra/llxuixml/llxuiparser.cpp +++ b/indra/llxuixml/llxuiparser.cpp @@ -440,12 +440,11 @@ bool LLXUIParser::readXUIImpl(LLXMLNodePtr nodep, LLInitParam::BaseBlock& block)  		&& nodep->mAttributes.empty()   		&& nodep->getSanitizedValue().empty())  	{ -		// empty node, just parse as NoValue +		// empty node, just parse as flag  		mCurReadNode = DUMMY_NODE;  		return block.submitValue(mNameStack, *this, silent);  	} -  	// submit attributes for current node  	values_parsed |= readAttributes(nodep, block); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 64438fe614..41a90f5984 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -2297,8 +2297,8 @@ Would you be my friend?   icon="alertmodal.tga"   label="Save Outfit"   name="SaveOutfitAs" - type="alertmodal" - unique="true"> + type="alertmodal"> +    <unique/>      Save what I'm wearing as a new Outfit:      <tag>confirm</tag>      <form name="form"> @@ -4611,8 +4611,8 @@ Go to your [http://secondlife.com/account/ Dashboard] to see your account histor    <notification     icon="alertmodal.tga"     name="ConfirmQuit" -   type="alertmodal" -   unique="true"> +   type="alertmodal"> +    <unique/>  Are you sure you want to quit?      <tag>confirm</tag>      <usetemplate @@ -4625,8 +4625,8 @@ Are you sure you want to quit?    <notification     icon="alertmodal.tga"     name="DeleteItems" -   type="alertmodal" -   unique="true"> +   type="alertmodal"> +    <unique/>      [QUESTION]      <tag>confirm</tag>      <usetemplate @@ -4639,8 +4639,9 @@ Are you sure you want to quit?    <notification     icon="alertmodal.tga"     name="HelpReportAbuseEmailLL" -   type="alert" -   unique="true"> +   type="alert"> +    <unique/> +      Use this tool to report violations of the [http://secondlife.com/corporate/tos.php Terms of Service] and [http://secondlife.com/corporate/cs.php Community Standards].  All reported abuses are investigated and resolved. @@ -5615,8 +5616,8 @@ Message from [NAME]:     icon="notify.tga"     name="NotSafe"     persist="true" -   type="notify" -   unique="true"> +   type="notify"> +    <unique/>  This land has damage enabled.  You can be hurt here. If you die, you will be teleported to your home location.    </notification> @@ -5625,8 +5626,8 @@ You can be hurt here. If you die, you will be teleported to your home location.     icon="notify.tga"     name="NoFly"     persist="true" -   type="notify" -   unique="true"> +   type="notify"> +    <unique/>     <tag>fail</tag>  This area has flying disabled.  You can't fly here. @@ -5636,8 +5637,8 @@ You can't fly here.     icon="notify.tga"     name="PushRestricted"     persist="true" -   type="notify" -   unique="true"> +   type="notify"> +    <unique/>      This area does not allow pushing. You can't push others here unless you own the land.    </notification> @@ -5645,8 +5646,8 @@ This area does not allow pushing. You can't push others here unless you own     icon="notify.tga"     name="NoVoice"     persist="true" -   type="notify" -   unique="true"> +   type="notify"> +    <unique/>      This area has voice chat disabled. You won't be able to hear anyone talking.      <tag>voice</tag>    </notification> @@ -5655,8 +5656,8 @@ This area has voice chat disabled. You won't be able to hear anyone talking     icon="notify.tga"     name="NoBuild"     persist="true" -   type="notify" -   unique="true"> +   type="notify"> +    <unique/>      This area has building disabled. You can't build or rez objects here.    </notification> @@ -5664,8 +5665,8 @@ This area has building disabled. You can't build or rez objects here.     icon="notify.tga"     name="SeeAvatars"     persist="true" -   type="notify" -   unique="true"> +   type="notify"> +    <unique/>      This parcel hides avatars and text chat from another parcel.   You can't see other residents outside the parcel, and those outside are not able to see you.  Regular text chat on channel 0 is also blocked.    </notification> @@ -6553,8 +6554,8 @@ The voice call you are trying to join, [VOICE_CHANNEL_NAME], has reached maximum    <notification     icon="notifytip.tga"     name="ProximalVoiceChannelFull" -   type="notifytip" -   unique="true"> +   type="notifytip"> +    <unique/>      We're sorry.  This area has reached maximum capacity for voice conversations.  Please try to use voice in another area.      <tag>fail</tag>      <tag>voice</tag> @@ -6622,8 +6623,8 @@ Failed to connect to [VOICE_CHANNEL_NAME], please try again later.  You will now     duration="10"     icon="notifytip.tga"     name="VoiceLoginRetry" -   type="notifytip" -   unique="true"> +   type="notifytip"> +    <unique/>      We are creating a voice channel for you. This may take up to one minute.    <tag>status</tag>    <tag>voice</tag> @@ -6634,8 +6635,8 @@ We are creating a voice channel for you. This may take up to one minute.     name="VoiceEffectsExpired"     sound="UISndAlert"     persist="true" -   type="notify" -   unique="true"> +   type="notify"> +    <unique/>      One or more of your subscribed Voice Morphs has expired.  [[URL] Click here] to renew your subscription.    <tag>fail</tag> @@ -6647,8 +6648,8 @@ One or more of your subscribed Voice Morphs has expired.     name="VoiceEffectsExpiredInUse"     sound="UISndAlert"     persist="true" -   type="notify" -   unique="true"> +   type="notify"> +    <unique/>  The active Voice Morph has expired, your normal voice settings have been applied.  [[URL] Click here] to renew your subscription.      <tag>fail</tag> @@ -6660,8 +6661,8 @@ The active Voice Morph has expired, your normal voice settings have been applied     name="VoiceEffectsWillExpire"     sound="UISndAlert"     persist="true" -   type="notify" -   unique="true"> +   type="notify"> +    <unique/>      One or more of your Voice Morphs will expire in less than [INTERVAL] days.  [[URL] Click here] to renew your subscription.    <tag>fail</tag> @@ -6673,8 +6674,8 @@ One or more of your Voice Morphs will expire in less than [INTERVAL] days.     name="VoiceEffectsNew"     sound="UISndAlert"     persist="true" -   type="notify" -   unique="true"> +   type="notify"> +    <unique/>      New Voice Morphs are available!     <tag>voice</tag>    </notification> @@ -7075,8 +7076,9 @@ Are you sure you want to leave this call?       ignoretext="Confirm before I leave call"       name="okcancelignore"       notext="No" -     yestext="Yes" -     unique="true"/> +     yestext="Yes"> +      <unique/> +    </usetemplate>    </notification>    <notification @@ -7095,31 +7097,31 @@ Mute everyone?       ignoretext="Confirm before I mute all participants in a group call"       name="okcancelignore"       yestext="Ok" -     notext="Cancel" -     unique="true"/> +     notext="Cancel"> +      <unique/> +    </usetemplate>    </notification>    <notification    name="HintChat"    label="Chat" -  type="hint" -  unique="true"> +  type="hint"> +    <unique/>      To join the conversation, type into the chat field below.    </notification>    <notification    name="HintSit" -      label="Stand" -  type="hint" -  unique="true"> +  type="hint"> +    <unique/>      To stand up and exit the sitting position, click the Stand button.    </notification>    <notification    name="HintSpeak"    label="Speak" -  type="hint" -  unique="true"> +  type="hint"> +    <unique/>      Click the Speak button to turn your microphone on and off.  Click on the up arrow to see the voice control panel. @@ -7130,32 +7132,32 @@ Hiding the Speak button will disable the voice feature.    <notification    name="HintDestinationGuide"    label="Explore the World" -  type="hint" -  unique="true"> +  type="hint"> +    <unique/>      The Destination Guide contains thousands of new places to discover. Select a location and choose Teleport to start exploring.    </notification>    <notification      name="HintSidePanel"      label="Side Panel" -    type="hint" -    unique="true"> +    type="hint"> +    <unique/>      Get quick access to your inventory, outfits, profiles and more in the side panel.    </notification>    <notification    name="HintMove"    label="Move" -  type="hint" -  unique="true"> +  type="hint"> +    <unique/>      To walk or run, open the Move Panel and use the directional arrows to navigate. You can also use the directional keys on your keyboard.    </notification>    <notification    name="HintMoveClick"    label="" -  type="hint" -  unique="true"> +  type="hint"> +    <unique/>      1. Click to Walk  Click anywhere on the ground to walk to that spot. @@ -7167,8 +7169,8 @@ Click and drag anywhere on the world to rotate your view    <notification    name="HintDisplayName"    label="Display Name" -  type="hint" -  unique="true"> +  type="hint"> +    <unique/>      Set your customizable display name here. This is in addition to your unique username, which can't be changed. You can change how you see other people's names in your preferences.    </notification> @@ -7176,8 +7178,8 @@ Click and drag anywhere on the world to rotate your view    <notification    name="HintView"    label="View" -  type="hint" -  unique="true"> +  type="hint"> +    <unique/>      To change your camera view, use the Orbit and Pan controls. Reset your view by pressing Escape or walking.      <tag>custom_skin</tag>    </notification> @@ -7185,16 +7187,16 @@ Click and drag anywhere on the world to rotate your view    <notification    name="HintInventory"    label="Inventory" -  type="hint" -  unique="true"> +  type="hint"> +    <unique/>      Check your inventory to find items. Newest items can be easily found in the Recent tab.    </notification>    <notification    name="HintLindenDollar"    label="You've got Linden Dollars!" -  type="hint" -  unique="true"> +  type="hint"> +    <unique/>      Here's your current balance of L$. Click Buy L$ to purchase more Linden Dollars.      <tag>funds</tag>    </notification> @@ -7383,8 +7385,8 @@ The site at '<nolink>[HOST_NAME]</nolink>' in realm '    <notification   name="ModeChange"   label="" - type="alertmodal" - unique="true"> + type="alertmodal"> +    <unique/>      Changing modes requires you to quit and restart.      <tag>confirm</tag>      <usetemplate @@ -7396,8 +7398,8 @@ The site at '<nolink>[HOST_NAME]</nolink>' in realm '    <notification   name="NoClassifieds"   label="" - type="alertmodal" - unique="true"> + type="alertmodal"> +    <unique/>      <tag>fail</tag>      <tag>confirm</tag>      Creation and editing of Classifieds is only available in Advanced mode. Would you like to quit and change modes? The mode selector can be found on the login screen. @@ -7410,8 +7412,8 @@ The site at '<nolink>[HOST_NAME]</nolink>' in realm '    <notification   name="NoGroupInfo"   label="" - type="alertmodal" - unique="true"> + type="alertmodal"> +    <unique/>      <tag>fail</tag>      <tag>confirm</tag>      Creation and editing of Groups is only available in Advanced mode. Would you like to quit and change modes? The mode selector can be found on the login screen. @@ -7424,8 +7426,8 @@ The site at '<nolink>[HOST_NAME]</nolink>' in realm '    <notification   name="NoPlaceInfo"   label="" - type="alertmodal" - unique="true"> + type="alertmodal"> +    <unique/>      <tag>fail</tag>      <tag>confirm</tag>      Viewing place profile is only available in Advanced mode. Would you like to quit and change modes? The mode selector can be found on the login screen. @@ -7438,8 +7440,8 @@ The site at '<nolink>[HOST_NAME]</nolink>' in realm '    <notification   name="NoPicks"   label="" - type="alertmodal" - unique="true"> + type="alertmodal"> +    <unique/>      <tag>fail</tag>      <tag>confirm</tag>      Creation and editing of Picks is only available in Advanced mode. Would you like to quit and change modes? The mode selector can be found on the login screen. @@ -7452,8 +7454,8 @@ The site at '<nolink>[HOST_NAME]</nolink>' in realm '    <notification   name="NoWorldMap"   label="" - type="alertmodal" - unique="true"> + type="alertmodal"> +    <unique/>      <tag>fail</tag>      <tag>confirm</tag>      Viewing of the world map is only available in Advanced mode. Would you like to quit and change modes? The mode selector can be found on the login screen. @@ -7466,8 +7468,8 @@ The site at '<nolink>[HOST_NAME]</nolink>' in realm '    <notification   name="NoVoiceCall"   label="" - type="alertmodal" - unique="true"> + type="alertmodal"> +    <unique/>      <tag>fail</tag>      <tag>confirm</tag>      Voice calls are only available in Advanced mode. Would you like to logout and change modes? @@ -7480,8 +7482,8 @@ The site at '<nolink>[HOST_NAME]</nolink>' in realm '    <notification   name="NoAvatarShare"   label="" - type="alertmodal" - unique="true"> + type="alertmodal"> +    <unique/>      <tag>fail</tag>      <tag>confirm</tag>      Sharing is only available in Advanced mode. Would you like to logout and change modes? @@ -7494,8 +7496,8 @@ The site at '<nolink>[HOST_NAME]</nolink>' in realm '    <notification   name="NoAvatarPay"   label="" - type="alertmodal" - unique="true"> + type="alertmodal"> +    <unique/>      <tag>fail</tag>      <tag>confirm</tag>  	  Paying other residents is only available in Advanced mode. Would you like to logout and change modes? @@ -7508,8 +7510,8 @@ The site at '<nolink>[HOST_NAME]</nolink>' in realm '    <notification   name="NoInventory"   label="" - type="alertmodal" - unique="true"> + type="alertmodal"> +    <unique/>      <tag>fail</tag>      <tag>confirm</tag>      Viewing inventory is only available in Advanced mode. Would you like to logout and change modes? @@ -7522,8 +7524,8 @@ The site at '<nolink>[HOST_NAME]</nolink>' in realm '    <notification   name="NoAppearance"   label="" - type="alertmodal" - unique="true"> + type="alertmodal"> +    <unique/>      <tag>fail</tag>      <tag>confirm</tag>      The appearance editor is only available in Advanced mode. Would you like to logout and change modes? @@ -7536,8 +7538,8 @@ The site at '<nolink>[HOST_NAME]</nolink>' in realm '    <notification   name="NoSearch"   label="" - type="alertmodal" - unique="true"> + type="alertmodal"> +    <unique/>      <tag>fail</tag>      <tag>confirm</tag>      Search is only available in Advanced mode. Would you like to logout and change modes? | 
