From 5e0bd59c616dea79cde604827074bc4be39a7cd1 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Fri, 11 Dec 2009 12:13:52 +0200 Subject: synchronized creation of notification chiclet and notification window to avoid skipping notifications from notification window; --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llchiclet.cpp') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 30967677e8..9671c048ef 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -53,6 +53,7 @@ #include "llgroupmgr.h" #include "llnotificationmanager.h" #include "lltransientfloatermgr.h" +#include "llsyswellwindow.h" static LLDefaultChildRegistry::Register t1("chiclet_panel"); static LLDefaultChildRegistry::Register t2_0("chiclet_im_well"); @@ -233,6 +234,10 @@ LLNotificationChiclet::LLNotificationChiclet(const Params& p) connectCounterUpdatersToSignal("notify"); connectCounterUpdatersToSignal("groupnotify"); connectCounterUpdatersToSignal("offer"); + + // ensure that notification well window exists, to synchronously + // handle toast add/delete events. + LLNotificationWellWindow::getInstance(); } void LLNotificationChiclet::connectCounterUpdatersToSignal(const std::string& notification_type) -- cgit v1.2.3 From 72032eb8863b0ad39e5d731c30070d17feb9b06b Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 14 Dec 2009 12:18:28 +0200 Subject: Improvements for normal task EXT-3147 (Implement new states for message indicators) -- Fixed: wells should flash every time new message arrives even if "new message" state is already set -- Also fixed: Well leaves in 'Lit' state if incomeing notification is resolved while flashing to the "Lit" state --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'indra/newview/llchiclet.cpp') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 9671c048ef..960d9e02b2 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -112,6 +112,11 @@ public: mEventTimer.start(); } + void stopFlashing() + { + mEventTimer.stop(); + } + private: callback_t mCallback; S32 mFlashCount; @@ -174,10 +179,18 @@ void LLSysWellChiclet::setCounter(S32 counter) */ mButton->setForcePressedState(counter > 0); - if (mCounter == 0 && counter > 0) + // we have to flash to 'Lit' state each time new unread message is comming. + if (counter > mCounter) { mFlashToLitTimer->flash(); } + else if (counter == 0) + { + // if notification is resolved while well is flashing it can leave in the 'Lit' state + // when flashing finishes itself. Let break flashing here. + mFlashToLitTimer->stopFlashing(); + } + mCounter = counter; } -- cgit v1.2.3 From 40a10565ac02b5e0b8b34969f92c3e9b5c6b497c Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 15 Dec 2009 15:40:13 +0200 Subject: Work on task EXT-3147 (Implement new states for message indicators) -- Code recactored for future implementation of "Opening either Message Well will clear the "new messages" state (and thus the "lit" status)" --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'indra/newview/llchiclet.cpp') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 960d9e02b2..b27634e105 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -169,15 +169,7 @@ void LLSysWellChiclet::setCounter(S32 counter) mButton->setLabel(s_count); - /* - Emulate 4 states of button by background images, see detains in EXT-3147 - xml attribute Description - image_unselected "Unlit" - there are no new messages - image_selected "Unlit" + "Selected" - there are no new messages and the Well is open - image_pressed "Lit" - there are new messages - image_pressed_selected "Lit" + "Selected" - there are new messages and the Well is open - */ - mButton->setForcePressedState(counter > 0); + setNewMessagesState(counter > 0); // we have to flash to 'Lit' state each time new unread message is comming. if (counter > mCounter) @@ -208,11 +200,24 @@ void LLSysWellChiclet::changeLitState() { static bool set_lit = false; - mButton->setForcePressedState(set_lit); + setNewMessagesState(set_lit); set_lit ^= true; } +void LLSysWellChiclet::setNewMessagesState(bool new_messages) +{ + /* + Emulate 4 states of button by background images, see detains in EXT-3147 + xml attribute Description + image_unselected "Unlit" - there are no new messages + image_selected "Unlit" + "Selected" - there are no new messages and the Well is open + image_pressed "Lit" - there are new messages + image_pressed_selected "Lit" + "Selected" - there are new messages and the Well is open + */ + mButton->setForcePressedState(new_messages); +} + /************************************************************************/ /* LLIMWellChiclet implementation */ /************************************************************************/ -- cgit v1.2.3 From eccc3ed597121ec49ae9a9979200985cc80e9edd Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 15 Dec 2009 16:41:52 +0200 Subject: Work on task EXT-3147 (Implement new states for message indicators) -- fixed bug: Well icon leaves in "Unlit" state if new message arrives when it is in the "Lit" state while flashing Improved behavior of reversing Lit/Unlit states --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'indra/newview/llchiclet.cpp') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index b27634e105..08782abf0d 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -89,6 +89,14 @@ class LLSysWellChiclet::FlashToLitTimer : public LLEventTimer { public: typedef boost::function callback_t; + + /** + * Constructor. + * + * @param count - how many times callback should be called (twice to not change original state) + * @param period - how frequently callback should be called + * @param cb - callback to be called each tick + */ FlashToLitTimer(S32 count, F32 period, callback_t cb) : LLEventTimer(period) , mCallback(cb) @@ -119,6 +127,10 @@ public: private: callback_t mCallback; + + /** + * How many times Well will blink. + */ S32 mFlashCount; S32 mCurrentFlashCount; }; @@ -140,6 +152,7 @@ LLSysWellChiclet::LLSysWellChiclet(const Params& p) , mButton(NULL) , mCounter(0) , mMaxDisplayedCount(p.max_displayed_count) +, mIsNewMessagesState(false) , mFlashToLitTimer(NULL) { LLButton::Params button_params = p.button; @@ -198,11 +211,7 @@ void LLSysWellChiclet::setToggleState(BOOL toggled) { void LLSysWellChiclet::changeLitState() { - static bool set_lit = false; - - setNewMessagesState(set_lit); - - set_lit ^= true; + setNewMessagesState(!mIsNewMessagesState); } void LLSysWellChiclet::setNewMessagesState(bool new_messages) @@ -216,6 +225,8 @@ void LLSysWellChiclet::setNewMessagesState(bool new_messages) image_pressed_selected "Lit" + "Selected" - there are new messages and the Well is open */ mButton->setForcePressedState(new_messages); + + mIsNewMessagesState = new_messages; } /************************************************************************/ -- cgit v1.2.3 From 5eb82cdeaa4202ee696308b421d68061d4029b8c Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 15 Dec 2009 18:56:38 +0200 Subject: Work on task EXT-3147 (Implement new states for message indicators) -- Implemented requirement: Opening either Message Well will clear the "new messages" state (and thus the "lit" status), even though there may still be unread messages --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llchiclet.cpp') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 08782abf0d..c7f77810df 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -239,6 +239,8 @@ LLIMWellChiclet::LLIMWellChiclet(const Params& p) LLIMModel::instance().addNoUnreadMsgsCallback(boost::bind(&LLIMWellChiclet::messageCountChanged, this, _1)); LLIMMgr::getInstance()->addSessionObserver(this); + + LLIMWellWindow::getInstance()->setSysWellChiclet(this); } LLIMWellChiclet::~LLIMWellChiclet() @@ -266,7 +268,7 @@ LLNotificationChiclet::LLNotificationChiclet(const Params& p) // ensure that notification well window exists, to synchronously // handle toast add/delete events. - LLNotificationWellWindow::getInstance(); + LLNotificationWellWindow::getInstance()->setSysWellChiclet(this); } void LLNotificationChiclet::connectCounterUpdatersToSignal(const std::string& notification_type) -- cgit v1.2.3