From 9b77ffb71ba112d27296b7ce8ab571285b9bba06 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 24 Apr 2012 16:51:59 -0700 Subject: CHUI-94 FIX Clicking OK on a notification does not remove the notification from the notifications listing --- indra/llxuixml/llinitparam.h | 145 +++++++++++++++++++++++++++++++++++++++- indra/llxuixml/llxuiparser.cpp | 4 +- indra/newview/llsyswellwindow.h | 2 +- 3 files changed, 147 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index a956719fa3..be63e5cb39 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -207,7 +207,7 @@ namespace LLInitParam typedef T value_t; ParamValue() - : T(), + : T(), mValidated(false) {} @@ -741,6 +741,13 @@ namespace LLInitParam typedef LLInitParam::IS_A_BLOCK IS_A_BLOCK; typedef LLInitParam::NOT_BLOCK NOT_A_BLOCK; + template + struct Sequential : public LLTypeTags::TypeTagBase + { + template struct Cons { typedef Sequential > value_t; }; + template struct Cons > { typedef Sequential value_t; }; + }; + template struct Atomic : public LLTypeTags::TypeTagBase { @@ -2050,6 +2057,13 @@ namespace LLInitParam typedef typename IsBlock::value_t value_t; }; + template + struct IsBlock, typename IsBlock >::value_t >, BLOCK_IDENTIFIER> + { + typedef typename IsBlock::value_t value_t; + }; + + template struct InnerMostType { @@ -2157,6 +2171,135 @@ namespace LLInitParam T mValue; }; + template + class ParamValue , IS_A_BLOCK> + { + typedef ParamValue , IS_A_BLOCK> self_t; + + public: + typedef typename InnerMostType::value_t value_t; + typedef T default_value_t; + + ParamValue() + : mValue(), + mValidated(false) + { + mCurParam = getBlockDescriptor().mAllParams.begin(); + } + + ParamValue(const default_value_t& value) + : mValue(value), + mValidated(false) + { + mCurParam = getBlockDescriptor().mAllParams.begin(); + } + + void setValue(const value_t& val) + { + mValue.setValue(val); + } + + const value_t& getValue() const + { + return mValue.getValue(); + } + + value_t& getValue() + { + return mValue.getValue(); + } + + bool deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack_range, bool new_name) + { + if (new_name) + { + mCurParam = getBlockDescriptor().mAllParams.begin(); + } + if (name_stack_range.first == name_stack_range.second + && mCurParam != getBlockDescriptor().mAllParams.end()) + { + // deserialize to mCurParam + LLParamDescriptor& pd = *(*mCurParam); + ParamDescriptor::deserialize_func_t deserialize_func = pd.mDeserializeFunc; + LLParam* paramp = mValue.getParamFromHandle(pd.mParamHandle); + + if (deserialize_func + && paramp + && deserialize_func(paramp, p, name_stack_range, new_name)) + { + ++mCurParam; + return true; + } + else + { + return false; + } + } + else + { + return mValue.deserializeBlock(p, name_stack_range, new_name); + } + } + + void serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const self_t* diff_block = NULL) const + { + const BaseBlock* base_block = diff_block + ? &(diff_block->mValue) + : NULL; + mValue.serializeBlock(p, name_stack, base_block); + } + + bool inspectBlock(Parser& p, Parser::name_stack_t name_stack = Parser::name_stack_t(), S32 min_count = 0, S32 max_count = S32_MAX) const + { + return mValue.inspectBlock(p, name_stack, min_count, max_count); + } + + bool mergeBlockParam(bool source_provided, bool dst_provided, BlockDescriptor& block_data, const self_t& source, bool overwrite) + { + return mValue.mergeBlock(block_data, source.getValue(), overwrite); + } + + bool validateBlock(bool emit_errors = true) const + { + return mValue.validateBlock(emit_errors); + } + + static BlockDescriptor& getBlockDescriptor() + { + return value_t::getBlockDescriptor(); + } + + mutable bool mValidated; // lazy validation flag + + private: + + BlockDescriptor::all_params_list_t::iterator mCurParam; + T mValue; + }; + + template + class ParamValue , NOT_BLOCK> + : public T + { + typedef ParamValue , NOT_BLOCK> self_t; + + public: + typedef typename InnerMostType::value_t value_t; + typedef T default_value_t; + + ParamValue() + : T(), + mValidated(false) + {} + + ParamValue(const default_value_t& value) + : T(value.getValue()), + mValidated(false) + {} + + mutable bool mValidated; // lazy validation flag + }; + template class ParamValue , BLOCK_T> { diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp index 808e391575..9cd88a1620 100644 --- a/indra/llxuixml/llxuiparser.cpp +++ b/indra/llxuixml/llxuiparser.cpp @@ -115,8 +115,8 @@ struct All : public LLInitParam::Block struct Attribute : public LLInitParam::Block { - Mandatory name; - Mandatory type; + Mandatory name, + type; Mandatory use; Attribute() diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index caf30cfd67..f497f546aa 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -123,7 +123,7 @@ protected: struct WellNotificationChannel : public LLNotificationChannel { WellNotificationChannel(LLNotificationWellWindow*); - void onAdd(LLNotificationPtr notify) + void onDelete(LLNotificationPtr notify) { mWellWindow->removeItemByID(notify->getID()); } -- cgit v1.2.3