diff options
Diffstat (limited to 'indra/newview/llconfirmationmanager.cpp')
-rw-r--r-- | indra/newview/llconfirmationmanager.cpp | 67 |
1 files changed, 28 insertions, 39 deletions
diff --git a/indra/newview/llconfirmationmanager.cpp b/indra/newview/llconfirmationmanager.cpp index 1c62b70b4c..8ea59fdd83 100644 --- a/indra/newview/llconfirmationmanager.cpp +++ b/indra/newview/llconfirmationmanager.cpp @@ -2,30 +2,25 @@ * @file llconfirmationmanager.cpp * @brief LLConfirmationManager class implementation * - * $LicenseInfo:firstyear=2006&license=viewergpl$ - * - * Copyright (c) 2006-2007, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2006&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * Copyright (C) 2010, Linden Research, Inc. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -36,33 +31,31 @@ #include "lluictrlfactory.h" // viewer includes -#include "llviewerwindow.h" -#include "lllineeditor.h" +#include "llnotificationsutil.h" #include "llstring.h" +#include "llxmlnode.h" 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 = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { listener->confirmed(""); } delete listener; + return false; } -static void onConfirmAlertPassword( - S32 option, const LLString& 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 = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { @@ -70,6 +63,7 @@ static void onConfirmAlertPassword( } delete listener; + return false; } @@ -77,22 +71,17 @@ void LLConfirmationManager::confirm(Type type, const std::string& action, ListenerBase* listener) { - LLString::format_map_t args; - args["[ACTION]"] = action; + LLSD args; + args["ACTION"] = action; switch (type) { case TYPE_CLICK: - gViewerWindow->alertXml("ConfirmPurchase", args, - onConfirmAlert, listener); + LLNotificationsUtil::add("ConfirmPurchase", args, LLSD(), boost::bind(onConfirmAlert, _1, _2, listener)); break; case TYPE_PASSWORD: - gViewerWindow->alertXmlEditText("ConfirmPurchasePassword", args, - NULL, NULL, - onConfirmAlertPassword, listener, - LLString::format_map_t(), - TRUE); + LLNotificationsUtil::add("ConfirmPurchasePassword", args, LLSD(), boost::bind(onConfirmAlertPassword, _1, _2, listener)); break; case TYPE_NONE: default: |