diff options
| author | Kent Quirk <q@lindenlab.com> | 2009-01-05 18:59:12 +0000 |
|---|---|---|
| committer | Kent Quirk <q@lindenlab.com> | 2009-01-05 18:59:12 +0000 |
| commit | 667ca55bad0108c4bdf8f007b89e1a52fc766aad (patch) | |
| tree | 7bd62ac8d9af079c3994565f3f200ccc250bbc28 /indra/newview/lleventnotifier.cpp | |
| parent | 95f365789f4cebc7bd97ccefd538f14d481a8373 (diff) | |
svn merge -r106715:HEAD svn+ssh://svn.lindenlab.com/svn/linden/branches/q/notifications-merge-r106715 . QAR-1149 -- Final merge of notifications to trunk.
Diffstat (limited to 'indra/newview/lleventnotifier.cpp')
| -rw-r--r-- | indra/newview/lleventnotifier.cpp | 53 |
1 files changed, 22 insertions, 31 deletions
diff --git a/indra/newview/lleventnotifier.cpp b/indra/newview/lleventnotifier.cpp index 343a572a6a..59f5cd342b 100644 --- a/indra/newview/lleventnotifier.cpp +++ b/indra/newview/lleventnotifier.cpp @@ -77,11 +77,11 @@ void LLEventNotifier::update() if (np->getEventDate() < (alert_time)) { - LLStringUtil::format_map_t args; - args["[NAME]"] = np->getEventName(); - args["[DATE]"] = np->getEventDateStr(); - LLNotifyBox::showXml("EventNotification", args, - notifyCallback, np); + LLSD args; + args["NAME"] = np->getEventName(); + args["DATE"] = np->getEventDateStr(); + LLNotifications::instance().add("EventNotification", args, LLSD(), + boost::bind(&LLEventNotification::handleResponse, np, _1, _2)); mEventNotifications.erase(iter++); } else @@ -173,47 +173,38 @@ void LLEventNotifier::remove(const U32 event_id) mEventNotifications.erase(iter); } -//static -void LLEventNotifier::notifyCallback(S32 option, void *user_data) +LLEventNotification::LLEventNotification() : + mEventID(0), + mEventName("") { - LLEventNotification *np = (LLEventNotification *)user_data; - if (!np) - { - llwarns << "Event notification callback without data!" << llendl; - return; - } +} + + +LLEventNotification::~LLEventNotification() +{ +} + +bool LLEventNotification::handleResponse(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotification::getSelectedOption(notification, response); switch (option) { case 0: - gAgent.teleportViaLocation(np->getEventPosGlobal()); - gFloaterWorldMap->trackLocation(np->getEventPosGlobal()); + gAgent.teleportViaLocation(getEventPosGlobal()); + gFloaterWorldMap->trackLocation(getEventPosGlobal()); break; case 1: gDisplayEventHack = TRUE; - LLFloaterDirectory::showEvents(np->getEventID()); + LLFloaterDirectory::showEvents(getEventID()); break; case 2: break; } // We could clean up the notification on the server now if we really wanted to. + return false; } - - -LLEventNotification::LLEventNotification() : - mEventID(0), - mEventName(""), - mEventDate(0) -{ -} - - -LLEventNotification::~LLEventNotification() -{ -} - - BOOL LLEventNotification::load(const LLUserAuth::response_t &response) { |
