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
meow-7.2.2
Mike Antipov 2009-12-15 18:56:38 +02:00
parent eccc3ed597
commit 5eb82cdeaa
4 changed files with 31 additions and 3 deletions

View File

@ -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)

View File

@ -791,6 +791,8 @@ public:
void setToggleState(BOOL toggled);
void setNewMessagesState(bool new_messages);
protected:
LLSysWellChiclet(const Params& p);
@ -804,8 +806,6 @@ protected:
*/
void changeLitState();
void setNewMessagesState(bool new_messages);
protected:
class FlashToLitTimer;
LLButton* mButton;

View File

@ -51,6 +51,7 @@
LLSysWellWindow::LLSysWellWindow(const LLSD& key) : LLDockableFloater(NULL, key),
mChannel(NULL),
mMessageList(NULL),
mSysWellChiclet(NULL),
mSeparator(NULL),
NOTIFICATION_WELL_ANCHOR_NAME("notification_well_panel"),
IM_WELL_ANCHOR_NAME("im_well_panel")
@ -80,6 +81,9 @@ BOOL LLSysWellWindow::postBuild()
mMessageList->addItem(mSeparator);
// click on SysWell Window should clear "new message" state (and 'Lit' status). EXT-3147.
setMouseDownCallback(boost::bind(&LLSysWellWindow::releaseNewMessagesState, this));
return LLDockableFloater::postBuild();
}
@ -174,6 +178,11 @@ void LLSysWellWindow::setVisible(BOOL visible)
mChannel->updateShowToastsState();
mChannel->redrawToasts();
}
if (visible)
{
releaseNewMessagesState();
}
}
//---------------------------------------------------------------------------------
@ -227,6 +236,14 @@ void LLSysWellWindow::reshapeWindow()
}
}
void LLSysWellWindow::releaseNewMessagesState()
{
if (NULL != mSysWellChiclet)
{
mSysWellChiclet->setNewMessagesState(false);
}
}
//---------------------------------------------------------------------------------
bool LLSysWellWindow::isWindowEmpty()
{

View File

@ -47,6 +47,7 @@ class LLFlatListView;
class LLChiclet;
class LLIMChiclet;
class LLScriptChiclet;
class LLSysWellChiclet;
class LLSysWellWindow : public LLDockableFloater
@ -78,6 +79,8 @@ public:
void onStartUpToastClick(S32 x, S32 y, MASK mask);
void setSysWellChiclet(LLSysWellChiclet* chiclet) { mSysWellChiclet = chiclet; }
// size constants for the window and for its elements
static const S32 MAX_WINDOW_HEIGHT = 200;
static const S32 MIN_WINDOW_WIDTH = 318;
@ -104,11 +107,17 @@ protected:
virtual const std::string& getAnchorViewName() = 0;
void reshapeWindow();
void releaseNewMessagesState();
// pointer to a corresponding channel's instance
LLNotificationsUI::LLScreenChannel* mChannel;
LLFlatListView* mMessageList;
/**
* Reference to an appropriate Well chiclet to release "new message" state. EXT-3147
*/
LLSysWellChiclet* mSysWellChiclet;
/**
* Special panel which is used as separator of Notifications & IM Rows.
* It is always presents in the list and shown when it is necessary.