Skip to content
Snippets Groups Projects
Commit 9b77ffb7 authored by Richard Linden's avatar Richard Linden
Browse files

CHUI-94 FIX Clicking OK on a notification does not remove the notification...

CHUI-94 FIX Clicking OK on a notification does not remove the notification from the notifications listing
parent dde1342f
No related branches found
No related tags found
No related merge requests found
...@@ -207,7 +207,7 @@ namespace LLInitParam ...@@ -207,7 +207,7 @@ namespace LLInitParam
typedef T value_t; typedef T value_t;
ParamValue() ParamValue()
: T(), : T(),
mValidated(false) mValidated(false)
{} {}
...@@ -741,6 +741,13 @@ namespace LLInitParam ...@@ -741,6 +741,13 @@ namespace LLInitParam
typedef LLInitParam::IS_A_BLOCK IS_A_BLOCK; typedef LLInitParam::IS_A_BLOCK IS_A_BLOCK;
typedef LLInitParam::NOT_BLOCK NOT_A_BLOCK; typedef LLInitParam::NOT_BLOCK NOT_A_BLOCK;
template<typename T>
struct Sequential : public LLTypeTags::TypeTagBase<T, 2>
{
template <typename S> struct Cons { typedef Sequential<ParamValue<S> > value_t; };
template <typename S> struct Cons<Sequential<S> > { typedef Sequential<S> value_t; };
};
template<typename T> template<typename T>
struct Atomic : public LLTypeTags::TypeTagBase<T, 1> struct Atomic : public LLTypeTags::TypeTagBase<T, 1>
{ {
...@@ -2050,6 +2057,13 @@ namespace LLInitParam ...@@ -2050,6 +2057,13 @@ namespace LLInitParam
typedef typename IsBlock<T>::value_t value_t; typedef typename IsBlock<T>::value_t value_t;
}; };
template<typename T, typename BLOCK_IDENTIFIER>
struct IsBlock<ParamValue<BaseBlock::Sequential<T>, typename IsBlock<BaseBlock::Sequential<T> >::value_t >, BLOCK_IDENTIFIER>
{
typedef typename IsBlock<T>::value_t value_t;
};
template<typename T> template<typename T>
struct InnerMostType struct InnerMostType
{ {
...@@ -2157,6 +2171,135 @@ namespace LLInitParam ...@@ -2157,6 +2171,135 @@ namespace LLInitParam
T mValue; T mValue;
}; };
template<typename T>
class ParamValue <BaseBlock::Sequential<T>, IS_A_BLOCK>
{
typedef ParamValue <BaseBlock::Sequential<T>, IS_A_BLOCK> self_t;
public:
typedef typename InnerMostType<T>::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<typename T>
class ParamValue <BaseBlock::Sequential<T>, NOT_BLOCK>
: public T
{
typedef ParamValue <BaseBlock::Sequential<T>, NOT_BLOCK> self_t;
public:
typedef typename InnerMostType<T>::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<typename T, typename BLOCK_T> template<typename T, typename BLOCK_T>
class ParamValue <BaseBlock::Lazy<T, IS_A_BLOCK>, BLOCK_T> class ParamValue <BaseBlock::Lazy<T, IS_A_BLOCK>, BLOCK_T>
{ {
......
...@@ -115,8 +115,8 @@ struct All : public LLInitParam::Block<All, Occurs> ...@@ -115,8 +115,8 @@ struct All : public LLInitParam::Block<All, Occurs>
struct Attribute : public LLInitParam::Block<Attribute> struct Attribute : public LLInitParam::Block<Attribute>
{ {
Mandatory<std::string> name; Mandatory<std::string> name,
Mandatory<std::string> type; type;
Mandatory<EUse> use; Mandatory<EUse> use;
Attribute() Attribute()
......
...@@ -123,7 +123,7 @@ class LLNotificationWellWindow : public LLSysWellWindow ...@@ -123,7 +123,7 @@ class LLNotificationWellWindow : public LLSysWellWindow
struct WellNotificationChannel : public LLNotificationChannel struct WellNotificationChannel : public LLNotificationChannel
{ {
WellNotificationChannel(LLNotificationWellWindow*); WellNotificationChannel(LLNotificationWellWindow*);
void onAdd(LLNotificationPtr notify) void onDelete(LLNotificationPtr notify)
{ {
mWellWindow->removeItemByID(notify->getID()); mWellWindow->removeItemByID(notify->getID());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment