diff options
Diffstat (limited to 'indra/newview/llchiclet.cpp')
-rwxr-xr-x[-rw-r--r--] | indra/newview/llchiclet.cpp | 50 |
1 files changed, 32 insertions, 18 deletions
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 43c6b558bc..46b7679915 100644..100755 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -192,7 +192,7 @@ void LLNotificationChiclet::createMenu() { if(mContextMenu) { - llwarns << "Menu already exists" << llendl; + LL_WARNS() << "Menu already exists" << LL_ENDL; return; } @@ -204,6 +204,7 @@ void LLNotificationChiclet::createMenu() enable_registrar.add("NotificationWellChicletMenu.EnableItem", boost::bind(&LLNotificationChiclet::enableMenuItem, this, _2)); + llassert(LLMenuGL::sMenuContainer != NULL); mContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu> ("menu_notification_well_button.xml", LLMenuGL::sMenuContainer, @@ -220,18 +221,25 @@ void LLNotificationChiclet::setCounter(S32 counter) bool LLNotificationChiclet::ChicletNotificationChannel::filterNotification( LLNotificationPtr notification ) { - if (notification->getName() == "ScriptDialog") + bool displayNotification; + if ( (notification->getName() == "ScriptDialog") // special case for scripts + // if there is no toast window for the notification, filter it + || (!LLNotificationWellWindow::getInstance()->findItemByID(notification->getID())) + ) { - return false; + displayNotification = false; } - - if( !(notification->canLogToIM() && notification->hasFormElements()) - && (!notification->getPayload().has("give_inventory_notification") - || notification->getPayload()["give_inventory_notification"])) + else if( !(notification->canLogToIM() && notification->hasFormElements()) + && (!notification->getPayload().has("give_inventory_notification") + || notification->getPayload()["give_inventory_notification"])) { - return true; + displayNotification = true; } - return false; + else + { + displayNotification = false; + } + return displayNotification; } ////////////////////////////////////////////////////////////////////////// @@ -368,11 +376,19 @@ BOOL LLIMChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask) return TRUE; } +void LLIMChiclet::hidePopupMenu() +{ + if (mPopupMenu) + { + mPopupMenu->setVisible(FALSE); + } +} + bool LLIMChiclet::canCreateMenu() { if(mPopupMenu) { - llwarns << "Menu already exists" << llendl; + LL_WARNS() << "Menu already exists" << LL_ENDL; return false; } if(getSessionId().isNull()) @@ -430,14 +446,12 @@ void LLChicletPanel::onMessageCountChanged(const LLSD& data) { // *TODO : we either suppress this method or return a value. Right now, it servers no purpose. /* - LLUUID session_id = data["session_id"].asUUID(); - S32 unread = data["participant_unread"].asInteger(); - LLFloaterIMSession* im_floater = LLFloaterIMSession::findInstance(session_id); - if (im_floater && im_floater->getVisible() && im_floater->hasFocus()) - { - unread = 0; - } + //LLFloaterIMSession* im_floater = LLFloaterIMSession::findInstance(session_id); + //if (im_floater && im_floater->getVisible() && im_floater->hasFocus()) + //{ + // unread = 0; + //} */ } @@ -720,7 +734,7 @@ void LLChicletPanel::setChicletToggleState(const LLUUID& session_id, bool toggle { if(session_id.isNull()) { - llwarns << "Null Session ID" << llendl; + LL_WARNS() << "Null Session ID" << LL_ENDL; } // toggle off all chiclets, except specified |