EXP-1337 FIX Add Confirmation dialog to "Restore Defaults" in the Toybox

Reviewed by Leslie
meow-7.2.2
callum 2011-10-12 16:08:53 -07:00
parent 9ca4b8219f
commit 45a3168316
2 changed files with 29 additions and 2 deletions

View File

@ -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,

View File

@ -4622,6 +4622,20 @@ Are you sure you want to quit?
yestext="Quit"/>
</notification>
<notification
icon="alertmodal.tga"
name="ConfirmRestoreToybox"
type="alertmodal">
<unique/>
Are you sure you want to restore your default buttons and toolbars?
You cannot undo this action.
<usetemplate
name="okcancelbuttons"
notext="Cancel"
yestext="OK"/>
</notification>
<notification
icon="alertmodal.tga"
name="DeleteItems"