//static bool LLNotifyBox::onNotification(const LLSD& notify) { LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID()); if (!notification) return false; if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change") { //bring existing notification to top LLNotifyBox* boxp = LLNotifyBox::getInstance(notification->getID()); if (boxp && !boxp->isDead()) { gNotifyBoxView->showOnly(boxp); } else { bool is_script_dialog = (notification->getName() == "ScriptDialog" || notification->getName() == "ScriptDialogGroup"); LLNotifyBox* notify_box = new LLNotifyBox( notification, is_script_dialog); //layout_script_dialog); gNotifyBoxView->addChild(notify_box); } } else if (notify["sigtype"].asString() == "delete") { LLNotifyBox* boxp = LLNotifyBox::getInstance(notification->getID()); if (boxp && !boxp->isDead()) { boxp->close(); } } return false; }
//static bool LLNotifyBox::onNotification(const LLSD& notify) { LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID()); if (!notification) return false; if (notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change") { if (notification->getPayload().has("SUPPRESS_TOAST")) { chat_notification(notification); return false; } //bring existing notification to top //This getInstance is ugly, as LLNotifyBox is derived from both LLInstanceTracker and LLEventTimer, which also is derived from its own LLInstanceTracker //Have to explicitly determine which getInstance function to use. LLNotifyBox* boxp = LLInstanceTracker<LLNotifyBox, LLUUID>::getInstance(notification->getID()); if (boxp && !boxp->isDead()) { gNotifyBoxView->showOnly(boxp); } else { gNotifyBoxView->addChild(new LLNotifyBox(notification)); } } else if (notify["sigtype"].asString() == "delete") { LLNotifyBox* boxp = LLInstanceTracker<LLNotifyBox, LLUUID>::getInstance(notification->getID()); if (boxp && !boxp->isDead()) { boxp->close(); } } return false; }
//static bool LLNotifyBox::onNotification(const LLSD& notify) { LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID()); if (!notification) return false; if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change") { //bring existing notification to top //This getInstance is ugly, as LLNotifyBox is derived from both LLInstanceTracker and LLEventTimer, which also is derived from its own LLInstanceTracker //Have to explicitly determine which getInstance function to use. LLNotifyBox* boxp = LLInstanceTracker<LLNotifyBox, LLUUID>::getInstance(notification->getID()); if (boxp && !boxp->isDead()) { gNotifyBoxView->showOnly(boxp); } else { bool is_script_dialog = (notification->getName() == "ScriptDialog" || notification->getName() == "ScriptDialogGroup"); LLNotifyBox* notify_box = new LLNotifyBox( notification, is_script_dialog); //layout_script_dialog); gNotifyBoxView->addChild(notify_box); } } else if (notify["sigtype"].asString() == "delete") { LLNotifyBox* boxp = LLInstanceTracker<LLNotifyBox, LLUUID>::getInstance(notification->getID()); if (boxp && !boxp->isDead()) { boxp->close(); } } return false; }
LLNotifyBox* LLNotifyBoxView::getFirstNontipBox() const { // *TODO: Don't make assumptions like this! // assumes every child is a notify box for(child_list_const_iter_t iter = getChildList()->begin(); iter != getChildList()->end(); iter++) { // hack! *TODO: Integrate llnotify and llgroupnotify if (isGroupNotifyBox(*iter)) continue; LLNotifyBox* box = static_cast<LLNotifyBox*>(*iter); if (!box->isTip() && !box->isDead()) return box; } return NULL; }