LLNotificationPtr LLNotifications::find(LLUUID uuid) { LLNotificationPtr target = LLNotificationPtr(new LLNotification(uuid)); LLNotificationSet::iterator it=mItems.find(target); if (it == mItems.end()) { llwarns << "Tried to dereference uuid '" << uuid << "' as a notification key but didn't find it." << llendl; return LLNotificationPtr((LLNotification*)NULL); } else { return *it; } }
LLNotificationPtr LLNotifications::find(LLUUID const& uuid) { LLNotificationPtr target = LLNotificationPtr(new LLNotification(uuid)); AILOCK_mItems; LLNotificationSet::iterator it=mItems.find(target); if (it == mItems.end()) { LL_WARNS() << "Tried to dereference uuid '" << uuid << "' as a notification key but didn't find it." << LL_ENDL; return LLNotificationPtr((LLNotification*)NULL); } else { return *it; } }
/* virtual */ LLNotificationPtr add( const std::string& name, const LLSD& substitutions, const LLSD& payload, LLNotificationFunctorRegistry::ResponseFunctor functor) { mResponder = functor; mAddedCount++; return LLNotificationPtr((LLNotification*)NULL); }
void loadPersistentNotifications() { llinfos << "Loading open notifications from " << mFileName << llendl; llifstream notify_file(mFileName.c_str()); if (!notify_file.is_open()) { llwarns << "Failed to open " << mFileName << llendl; return; } LLSD input; LLPointer<LLSDParser> parser = new LLSDXMLParser(); if (parser->parse(notify_file, input, LLSDSerialize::SIZE_UNLIMITED) < 0) { llwarns << "Failed to parse open notifications" << llendl; return; } if (input.isUndefined()) return; std::string version = input["version"]; if (version != NOTIFICATION_PERSIST_VERSION) { llwarns << "Bad open notifications version: " << version << llendl; return; } LLSD& data = input["data"]; if (data.isUndefined()) return; LLNotifications& instance = LLNotifications::instance(); for (LLSD::array_const_iterator notification_it = data.beginArray(); notification_it != data.endArray(); ++notification_it) { instance.add(LLNotificationPtr(new LLNotification(*notification_it))); } }
void LLPanelMsgs::buildLists() //void LLFloaterPreference::buildPopupLists() in v3 { LLScrollListCtrl& disabled_popups = getChildRef<LLScrollListCtrl>("disabled_popups"); LLScrollListCtrl& enabled_popups = getChildRef<LLScrollListCtrl>("enabled_popups"); disabled_popups.deleteAllItems(); enabled_popups.deleteAllItems(); for (LLNotifications::TemplateMap::const_iterator iter = LLNotifications::instance().templatesBegin(); iter != LLNotifications::instance().templatesEnd(); ++iter) { LLNotificationTemplatePtr templatep = iter->second; LLNotificationFormPtr formp = templatep->mForm; LLNotificationForm::EIgnoreType ignore = formp->getIgnoreType(); if (ignore == LLNotificationForm::IGNORE_NO) continue; LLSD params; params["name"] = (*iter).first; LLNotificationPtr notification = LLNotificationPtr(new LLNotification(params)); LLSD row; std::string ignore_msg = formp->getIgnoreMessage(); LLStringUtil::format(ignore_msg,notification->getSubstitutions()); row["columns"][0]["value"] = ignore_msg; row["columns"][0]["font"] = "SANSSERIF_SMALL"; row["columns"][0]["width"] = 300; LLScrollListItem* item = NULL; bool show_popup = !formp->getIgnored(); if (!show_popup) { if (ignore == LLNotificationForm::IGNORE_WITH_LAST_RESPONSE) { LLSD last_response = LLUI::sConfigGroup->getLLSD("Default" + templatep->mName); if (!last_response.isUndefined()) { for (LLSD::map_const_iterator it = last_response.beginMap(); it != last_response.endMap(); ++it) { if (it->second.asBoolean()) { row["columns"][1]["value"] = formp->getElement(it->first)["ignore"].asString(); break; } } } row["columns"][1]["font"] = "SANSSERIF_SMALL"; row["columns"][1]["width"] = 160; } item = disabled_popups.addElement(row, ADD_SORTED); } else { item = enabled_popups.addElement(row, ADD_SORTED); } if (item) { item->setUserdata((void*)&iter->first); } } }