diff options
author | Ychebotarev ProductEngine <ychebotarev@productengine.com> | 2010-01-19 17:13:21 +0200 |
---|---|---|
committer | Ychebotarev ProductEngine <ychebotarev@productengine.com> | 2010-01-19 17:13:21 +0200 |
commit | 82de841c52357642d30b6d89b11da079f9c0f5d1 (patch) | |
tree | 8ed3ec82392b6afd2ddf2023035fdfa45cd74c0b /indra/newview/llchiclet.cpp | |
parent | 4610e911c959cdd21728822ae80b9e717ccd3012 (diff) | |
parent | 00c05a885fb1cbee967065798f57d74bf47f2478 (diff) |
merge
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llchiclet.cpp')
-rw-r--r-- | indra/newview/llchiclet.cpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 5cbe6f9670..f21fbbe6f5 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -453,6 +453,7 @@ LLIMChiclet::LLIMChiclet(const LLIMChiclet::Params& p) , mNewMessagesIcon(NULL) , mSpeakerCtrl(NULL) , mCounterCtrl(NULL) +, mChicletButton(NULL) { enableCounterControl(p.enable_counter); } @@ -576,6 +577,11 @@ void LLIMChiclet::onMouseDown() setCounter(0); } +void LLIMChiclet::setToggleState(bool toggle) +{ + mChicletButton->setToggleState(toggle); +} + BOOL LLIMChiclet::handleMouseDown(S32 x, S32 y, MASK mask) { onMouseDown(); @@ -634,6 +640,7 @@ LLIMChiclet::EType LLIMChiclet::getIMSessionType(const LLUUID& session_id) LLIMP2PChiclet::Params::Params() : avatar_icon("avatar_icon") +, chiclet_button("chiclet_button") , unread_notifications("unread_notifications") , speaker("speaker") , new_message_icon("new_message_icon") @@ -646,6 +653,10 @@ LLIMP2PChiclet::LLIMP2PChiclet(const Params& p) , mChicletIconCtrl(NULL) , mPopupMenu(NULL) { + LLButton::Params button_params = p.chiclet_button; + mChicletButton = LLUICtrlFactory::create<LLButton>(button_params); + addChild(mChicletButton); + LLIconCtrl::Params new_msg_params = p.new_message_icon; mNewMessagesIcon = LLUICtrlFactory::create<LLIconCtrl>(new_msg_params); addChild(mNewMessagesIcon); @@ -760,6 +771,7 @@ void LLIMP2PChiclet::onMenuItemClicked(const LLSD& user_data) LLAdHocChiclet::Params::Params() : avatar_icon("avatar_icon") +, chiclet_button("chiclet_button") , unread_notifications("unread_notifications") , speaker("speaker") , new_message_icon("new_message_icon") @@ -773,6 +785,10 @@ LLAdHocChiclet::LLAdHocChiclet(const Params& p) , mChicletIconCtrl(NULL) , mPopupMenu(NULL) { + LLButton::Params button_params = p.chiclet_button; + mChicletButton = LLUICtrlFactory::create<LLButton>(button_params); + addChild(mChicletButton); + LLIconCtrl::Params new_msg_params = p.new_message_icon; mNewMessagesIcon = LLUICtrlFactory::create<LLIconCtrl>(new_msg_params); addChild(mNewMessagesIcon); @@ -887,6 +903,7 @@ BOOL LLAdHocChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask) LLIMGroupChiclet::Params::Params() : group_icon("group_icon") +, chiclet_button("chiclet_button") , unread_notifications("unread_notifications") , speaker("speaker") , new_message_icon("new_message_icon") @@ -900,6 +917,10 @@ LLIMGroupChiclet::LLIMGroupChiclet(const Params& p) , mChicletIconCtrl(NULL) , mPopupMenu(NULL) { + LLButton::Params button_params = p.chiclet_button; + mChicletButton = LLUICtrlFactory::create<LLButton>(button_params); + addChild(mChicletButton); + LLIconCtrl::Params new_msg_params = p.new_message_icon; mNewMessagesIcon = LLUICtrlFactory::create<LLIconCtrl>(new_msg_params); addChild(mNewMessagesIcon); @@ -1414,6 +1435,32 @@ S32 LLChicletPanel::notifyParent(const LLSD& info) return LLPanel::notifyParent(info); } +void LLChicletPanel::setChicletToggleState(const LLUUID& session_id, bool toggle) +{ + if(session_id.isNull()) + { + llwarns << "Null Session ID" << llendl; + } + + // toggle off all chiclets, except specified + S32 size = getChicletCount(); + for(int n = 0; n < size; ++n) + { + LLIMChiclet* chiclet = getChiclet<LLIMChiclet>(n); + if(chiclet && chiclet->getSessionId() != session_id) + { + chiclet->setToggleState(false); + } + } + + // toggle specified chiclet + LLIMChiclet* chiclet = findChiclet<LLIMChiclet>(session_id); + if(chiclet) + { + chiclet->setToggleState(toggle); + } +} + void LLChicletPanel::arrange() { if(mChicletList.empty()) @@ -1806,6 +1853,7 @@ LLChicletSpeakerCtrl::LLChicletSpeakerCtrl(const Params&p) LLScriptChiclet::Params::Params() : icon("icon") + , chiclet_button("chiclet_button") , new_message_icon("new_message_icon") { } @@ -1814,6 +1862,10 @@ LLScriptChiclet::LLScriptChiclet(const Params&p) : LLIMChiclet(p) , mChicletIconCtrl(NULL) { + LLButton::Params button_params = p.chiclet_button; + mChicletButton = LLUICtrlFactory::create<LLButton>(button_params); + addChild(mChicletButton); + LLIconCtrl::Params new_msg_params = p.new_message_icon; mNewMessagesIcon = LLUICtrlFactory::create<LLIconCtrl>(new_msg_params); addChild(mNewMessagesIcon); @@ -1862,6 +1914,7 @@ static const std::string INVENTORY_USER_OFFER ("UserGiveItem"); LLInvOfferChiclet::Params::Params() : icon("icon") + , chiclet_button("chiclet_button") , new_message_icon("new_message_icon") { } @@ -1870,6 +1923,10 @@ LLInvOfferChiclet::LLInvOfferChiclet(const Params&p) : LLIMChiclet(p) , mChicletIconCtrl(NULL) { + LLButton::Params button_params = p.chiclet_button; + mChicletButton = LLUICtrlFactory::create<LLButton>(button_params); + addChild(mChicletButton); + LLIconCtrl::Params new_msg_params = p.new_message_icon; mNewMessagesIcon = LLUICtrlFactory::create<LLIconCtrl>(new_msg_params); addChild(mNewMessagesIcon); |