diff options
author | pavelkproductengine <pavelkproductengine@lindenlab.com> | 2015-07-15 22:59:59 +0300 |
---|---|---|
committer | pavelkproductengine <pavelkproductengine@lindenlab.com> | 2015-07-15 22:59:59 +0300 |
commit | 9131f7705974c84127bcc3109d2ab1c56cb1f009 (patch) | |
tree | 59b7494d361a9ad570ed3bcec9efdb6a5dff6166 /indra/newview/llsyswellwindow.cpp | |
parent | 02441157a0d22619ccf2a2ee735c8f5251b54fdb (diff) | |
parent | 3d4433de504c0ac17f2d3d98d3cbc43955cc1dda (diff) |
merge changes for MAINT-4734
Diffstat (limited to 'indra/newview/llsyswellwindow.cpp')
-rwxr-xr-x | indra/newview/llsyswellwindow.cpp | 152 |
1 files changed, 0 insertions, 152 deletions
diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 8babb874f8..8f64cff47c 100755 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -296,158 +296,6 @@ BOOL LLIMWellWindow::ObjectRowPanel::handleRightMouseDown(S32 x, S32 y, MASK mas } /************************************************************************/ -/* LLNotificationWellWindow implementation */ -/************************************************************************/ - -////////////////////////////////////////////////////////////////////////// -// PUBLIC METHODS -LLNotificationWellWindow::WellNotificationChannel::WellNotificationChannel(LLNotificationWellWindow* well_window) -: LLNotificationChannel(LLNotificationChannel::Params().name(well_window->getPathname())), - mWellWindow(well_window) -{ - connectToChannel("Notifications"); - connectToChannel("Group Notifications"); - connectToChannel("Offer"); -} - -LLNotificationWellWindow::LLNotificationWellWindow(const LLSD& key) -: LLSysWellWindow(key) -{ - mNotificationUpdates.reset(new WellNotificationChannel(this)); -} - -// static -LLNotificationWellWindow* LLNotificationWellWindow::getInstance(const LLSD& key /*= LLSD()*/) -{ - return LLFloaterReg::getTypedInstance<LLNotificationWellWindow>("notification_well_window", key); -} - -// virtual -BOOL LLNotificationWellWindow::postBuild() -{ - BOOL rv = LLSysWellWindow::postBuild(); - setTitle(getString("title_notification_well_window")); - return rv; -} - -// virtual -void LLNotificationWellWindow::setVisible(BOOL visible) -{ - if (visible) - { - // when Notification channel is cleared, storable toasts will be added into the list. - clearScreenChannels(); - } - - LLSysWellWindow::setVisible(visible); -} - -//--------------------------------------------------------------------------------- -void LLNotificationWellWindow::addItem(LLSysWellItem::Params p) -{ - LLSD value = p.notification_id; - // do not add clones - if( mMessageList->getItemByValue(value)) - return; - - LLSysWellItem* new_item = new LLSysWellItem(p); - if (mMessageList->addItem(new_item, value, ADD_TOP)) - { - mSysWellChiclet->updateWidget(isWindowEmpty()); - reshapeWindow(); - new_item->setOnItemCloseCallback(boost::bind(&LLNotificationWellWindow::onItemClose, this, _1)); - new_item->setOnItemClickCallback(boost::bind(&LLNotificationWellWindow::onItemClick, this, _1)); - } - else - { - LL_WARNS() << "Unable to add Notification into the list, notification ID: " << p.notification_id - << ", title: " << p.title - << LL_ENDL; - - new_item->die(); - } -} - -void LLNotificationWellWindow::closeAll() -{ - // Need to clear notification channel, to add storable toasts into the list. - clearScreenChannels(); - std::vector<LLPanel*> items; - mMessageList->getItems(items); - for (std::vector<LLPanel*>::iterator - iter = items.begin(), - iter_end = items.end(); - iter != iter_end; ++iter) - { - LLSysWellItem* sys_well_item = dynamic_cast<LLSysWellItem*>(*iter); - if (sys_well_item) - onItemClose(sys_well_item); - } -} - -////////////////////////////////////////////////////////////////////////// -// PRIVATE METHODS -void LLNotificationWellWindow::initChannel() -{ - LLSysWellWindow::initChannel(); - if(mChannel) - { - mChannel->addOnStoreToastCallback(boost::bind(&LLNotificationWellWindow::onStoreToast, this, _1, _2)); - } -} - -void LLNotificationWellWindow::clearScreenChannels() -{ - // 1 - remove StartUp toast and channel if present - if(!LLNotificationsUI::LLScreenChannel::getStartUpToastShown()) - { - LLNotificationsUI::LLChannelManager::getInstance()->onStartUpToastClose(); - } - - // 2 - remove toasts in Notification channel - if(mChannel) - { - mChannel->removeAndStoreAllStorableToasts(); - } -} - -void LLNotificationWellWindow::onStoreToast(LLPanel* info_panel, LLUUID id) -{ - LLSysWellItem::Params p; - p.notification_id = id; - p.title = static_cast<LLToastPanel*>(info_panel)->getTitle(); - addItem(p); -} - -void LLNotificationWellWindow::onItemClick(LLSysWellItem* item) -{ - LLUUID id = item->getID(); - LLFloaterReg::showInstance("inspect_toast", id); -} - -void LLNotificationWellWindow::onItemClose(LLSysWellItem* item) -{ - LLUUID id = item->getID(); - - if(mChannel) - { - // removeItemByID() is invoked from killToastByNotificationID() and item will removed; - mChannel->killToastByNotificationID(id); - } - else - { - // removeItemByID() should be called one time for each item to remove it from notification well - removeItemByID(id); - } - -} - -void LLNotificationWellWindow::onAdd( LLNotificationPtr notify ) -{ - removeItemByID(notify->getID()); -} - -/************************************************************************/ /* LLIMWellWindow implementation */ /************************************************************************/ |