summaryrefslogtreecommitdiff
path: root/indra/newview/llconfirmationmanager.cpp
diff options
context:
space:
mode:
authorKent Quirk <q@lindenlab.com>2009-01-05 18:59:12 +0000
committerKent Quirk <q@lindenlab.com>2009-01-05 18:59:12 +0000
commit667ca55bad0108c4bdf8f007b89e1a52fc766aad (patch)
tree7bd62ac8d9af079c3994565f3f200ccc250bbc28 /indra/newview/llconfirmationmanager.cpp
parent95f365789f4cebc7bd97ccefd538f14d481a8373 (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/llconfirmationmanager.cpp')
-rw-r--r--indra/newview/llconfirmationmanager.cpp28
1 files changed, 11 insertions, 17 deletions
diff --git a/indra/newview/llconfirmationmanager.cpp b/indra/newview/llconfirmationmanager.cpp
index 167afb8062..6c465ccf92 100644
--- a/indra/newview/llconfirmationmanager.cpp
+++ b/indra/newview/llconfirmationmanager.cpp
@@ -45,24 +45,22 @@ LLConfirmationManager::ListenerBase::~ListenerBase()
}
-static void onConfirmAlert(S32 option, void* data)
+static bool onConfirmAlert(const LLSD& notification, const LLSD& response, LLConfirmationManager::ListenerBase* listener)
{
- LLConfirmationManager::ListenerBase* listener
- = (LLConfirmationManager::ListenerBase*)data;
-
+ S32 option = LLNotification::getSelectedOption(notification, response);
if (option == 0)
{
listener->confirmed("");
}
delete listener;
+ return false;
}
-static void onConfirmAlertPassword(
- S32 option, const std::string& text, void* data)
+static bool onConfirmAlertPassword(const LLSD& notification, const LLSD& response, LLConfirmationManager::ListenerBase* listener)
{
- LLConfirmationManager::ListenerBase* listener
- = (LLConfirmationManager::ListenerBase*)data;
+ std::string text = response["message"].asString();
+ S32 option = LLNotification::getSelectedOption(notification, response);
if (option == 0)
{
@@ -70,6 +68,7 @@ static void onConfirmAlertPassword(
}
delete listener;
+ return false;
}
@@ -77,22 +76,17 @@ void LLConfirmationManager::confirm(Type type,
const std::string& action,
ListenerBase* listener)
{
- LLStringUtil::format_map_t args;
- args["[ACTION]"] = action;
+ LLSD args;
+ args["ACTION"] = action;
switch (type)
{
case TYPE_CLICK:
- gViewerWindow->alertXml("ConfirmPurchase", args,
- onConfirmAlert, listener);
+ LLNotifications::instance().add("ConfirmPurchase", args, LLSD(), boost::bind(onConfirmAlert, _1, _2, listener));
break;
case TYPE_PASSWORD:
- gViewerWindow->alertXmlEditText("ConfirmPurchasePassword", args,
- NULL, NULL,
- onConfirmAlertPassword, listener,
- LLStringUtil::format_map_t(),
- TRUE);
+ LLNotifications::instance().add("ConfirmPurchasePassword", args, LLSD(), boost::bind(onConfirmAlertPassword, _1, _2, listener));
break;
case TYPE_NONE:
default: