From 45a316831636043663972bdf83adbefb345549de Mon Sep 17 00:00:00 2001 From: callum Date: Wed, 12 Oct 2011 16:08:53 -0700 Subject: EXP-1337 FIX Add Confirmation dialog to "Restore Defaults" in the Toybox Reviewed by Leslie --- indra/newview/llfloatertoybox.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloatertoybox.cpp') diff --git a/indra/newview/llfloatertoybox.cpp b/indra/newview/llfloatertoybox.cpp index 84881655f8..b4c9894271 100644 --- a/indra/newview/llfloatertoybox.cpp +++ b/indra/newview/llfloatertoybox.cpp @@ -30,12 +30,13 @@ #include "llbutton.h" #include "llcommandmanager.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llpanel.h" #include "lltoolbar.h" #include "lltoolbarview.h" #include "lltrans.h" - LLFloaterToybox::LLFloaterToybox(const LLSD& key) : LLFloater(key) , mBtnRestoreDefaults(NULL) @@ -113,9 +114,21 @@ void LLFloaterToybox::draw() LLFloater::draw(); } +static bool finish_restore_toybox(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + if (option == 0) + { + LLToolBarView::loadDefaultToolbars(); + } + return false; +} +static LLNotificationFunctorRegistration finish_restore_toybox_reg("ConfirmRestoreToybox", finish_restore_toybox); + void LLFloaterToybox::onBtnRestoreDefaults() { - LLToolBarView::loadDefaultToolbars(); + LLNotificationsUtil::add("ConfirmRestoreToybox"); } BOOL LLFloaterToybox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, -- cgit v1.2.3