Aditional changes for normal task EXT-3081 (Separate Message Well on Notifications Well and IM Well)

-- moved Notification well specific functionality from the "LLSysWellChiclet" into derived "LLNotificationChiclet" class

--HG--
branch : product-engine
meow-7.2.2
Mike Antipov 2009-12-07 13:52:35 +02:00
parent 660d818348
commit 4880959567
2 changed files with 19 additions and 19 deletions

View File

@ -92,7 +92,6 @@ LLSysWellChiclet::LLSysWellChiclet(const Params& p)
: LLChiclet(p)
, mButton(NULL)
, mCounter(0)
, mUreadSystemNotifications(0)
{
LLButton::Params button_params = p.button;
mButton = LLUICtrlFactory::create<LLButton>(button_params);
@ -104,17 +103,6 @@ LLSysWellChiclet::~LLSysWellChiclet()
}
void LLSysWellChiclet::connectCounterUpdatersToSignal(std::string notification_type)
{
LLNotificationsUI::LLNotificationManager* manager = LLNotificationsUI::LLNotificationManager::getInstance();
LLNotificationsUI::LLEventHandler* n_handler = manager->getHandlerForNotification(notification_type);
if(n_handler)
{
n_handler->setNewNotificationCallback(boost::bind(&LLNotificationChiclet::incUreadSystemNotifications, this));
n_handler->setDelNotification(boost::bind(&LLNotificationChiclet::decUreadSystemNotifications, this));
}
}
void LLSysWellChiclet::setCounter(S32 counter)
{
std::string s_count;
@ -160,6 +148,7 @@ void LLIMWellChiclet::messageCountChanged(const LLSD& session_data)
/************************************************************************/
LLNotificationChiclet::LLNotificationChiclet(const Params& p)
: LLSysWellChiclet(p)
, mUreadSystemNotifications(0)
{
// connect counter handlers to the signals
connectCounterUpdatersToSignal("notify");
@ -167,6 +156,16 @@ LLNotificationChiclet::LLNotificationChiclet(const Params& p)
connectCounterUpdatersToSignal("offer");
}
void LLNotificationChiclet::connectCounterUpdatersToSignal(const std::string& notification_type)
{
LLNotificationsUI::LLNotificationManager* manager = LLNotificationsUI::LLNotificationManager::getInstance();
LLNotificationsUI::LLEventHandler* n_handler = manager->getHandlerForNotification(notification_type);
if(n_handler)
{
n_handler->setNewNotificationCallback(boost::bind(&LLNotificationChiclet::incUreadSystemNotifications, this));
n_handler->setDelNotification(boost::bind(&LLNotificationChiclet::decUreadSystemNotifications, this));
}
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////

View File

@ -770,20 +770,13 @@ public:
/*virtual*/ ~LLSysWellChiclet();
// methods for updating a number of unread System notifications
void incUreadSystemNotifications() { setCounter(++mUreadSystemNotifications); }
void decUreadSystemNotifications() { setCounter(--mUreadSystemNotifications); }
void setToggleState(BOOL toggled);
protected:
// connect counter updaters to the corresponding signals
void connectCounterUpdatersToSignal(std::string notification_type);
LLSysWellChiclet(const Params& p);
friend class LLUICtrlFactory;
S32 mUreadSystemNotifications;
protected:
LLButton* mButton;
S32 mCounter;
@ -820,6 +813,14 @@ class LLNotificationChiclet : public LLSysWellChiclet
protected:
LLNotificationChiclet(const Params& p);
// connect counter updaters to the corresponding signals
void connectCounterUpdatersToSignal(const std::string& notification_type);
// methods for updating a number of unread System notifications
void incUreadSystemNotifications() { setCounter(++mUreadSystemNotifications); }
void decUreadSystemNotifications() { setCounter(--mUreadSystemNotifications); }
S32 mUreadSystemNotifications;
};
/**