EXP-1337 FIX Add Confirmation dialog to "Restore Defaults" in the Toybox
Reviewed by Lesliemeow-7.2.2
parent
9ca4b8219f
commit
45a3168316
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue