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/llpanelgroup.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/llpanelgroup.cpp')
-rw-r--r-- | indra/newview/llpanelgroup.cpp | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index 2d5f789141..6233740d53 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -45,6 +45,7 @@ #include "lluictrlfactory.h" #include "llviewerwindow.h" #include "llappviewer.h" +#include "llnotifications.h" // static void* LLPanelGroupTab::createTab(void* data) @@ -115,17 +116,12 @@ void LLPanelGroupTab::handleClickHelp() std::string help_text( getHelpText() ); if ( !help_text.empty() ) { - LLStringUtil::format_map_t args; - args["[MESSAGE]"] = help_text; - LLAlertDialog* dialogp = gViewerWindow->alertXml("GenericAlert", args); - if (dialogp) - { - LLFloater* root_floater = gFloaterView->getParentFloater(this);; - if (root_floater) - { - root_floater->addDependentFloater(dialogp); - } - } + LLSD args; + args["MESSAGE"] = help_text; + LLFloater* parent_floater = gFloaterView->getParentFloater(this); + LLNotification::Params params(parent_floater->contextualNotification("GenericAlert")); + params.substitutions(args); + LLNotifications::instance().add(params); } } @@ -411,11 +407,11 @@ BOOL LLPanelGroup::attemptTransition() mesg = mDefaultNeedsApplyMesg; } // Create a notify box, telling the user about the unapplied tab. - LLStringUtil::format_map_t args; - args["[NEEDS_APPLY_MESSAGE]"] = mesg; - args["[WANT_APPLY_MESSAGE]"] = mWantApplyMesg; - gViewerWindow->alertXml("PanelGroupApply", args, - onNotifyCallback, (void*) this); + LLSD args; + args["NEEDS_APPLY_MESSAGE"] = mesg; + args["WANT_APPLY_MESSAGE"] = mWantApplyMesg; + LLNotifications::instance().add("PanelGroupApply", args, LLSD(), + boost::bind(&LLPanelGroup::handleNotifyCallback, this, _1, _2)); mShowingNotifyDialog = TRUE; // We need to reselect the current tab, since it isn't finished. @@ -465,18 +461,9 @@ void LLPanelGroup::transitionToTab() } } -// static -void LLPanelGroup::onNotifyCallback(S32 option, void* user_data) -{ - LLPanelGroup* self = static_cast<LLPanelGroup*>(user_data); - if (self) - { - self->handleNotifyCallback(option); - } -} - -void LLPanelGroup::handleNotifyCallback(S32 option) +bool LLPanelGroup::handleNotifyCallback(const LLSD& notification, const LLSD& response) { + S32 option = LLNotification::getSelectedOption(notification, response); mShowingNotifyDialog = FALSE; switch (option) { @@ -512,6 +499,7 @@ void LLPanelGroup::handleNotifyCallback(S32 option) LLAppViewer::instance()->abortQuit(); break; } + return false; } // static @@ -568,9 +556,9 @@ bool LLPanelGroup::apply() // Inform the user. if ( !apply_mesg.empty() ) { - LLStringUtil::format_map_t args; - args["[MESSAGE]"] = apply_mesg; - gViewerWindow->alertXml("GenericAlert", args); + LLSD args; + args["MESSAGE"] = apply_mesg; + LLNotifications::instance().add("GenericAlert", args); } return false; @@ -638,7 +626,7 @@ void LLPanelGroup::showNotice(const std::string& subject, // We need to clean up that inventory offer. if (inventory_offer) { - inventory_offer_callback( IOR_DECLINE , inventory_offer); + inventory_offer->forceResponse(IOR_DECLINE); } return; } |