From c6896185f87d27ab16ecc53398bc5b7bebf94aca Mon Sep 17 00:00:00 2001 From: Cinders Date: Sat, 30 Nov 2013 19:22:29 -0700 Subject: [PATCH] FIRE-2700: Delete notecard confirmation --- indra/newview/llpreviewnotecard.cpp | 22 +++++++++++++++++++ indra/newview/llpreviewnotecard.h | 5 +++++ .../skins/default/xui/en/notifications.xml | 13 +++++++++++ 3 files changed, 40 insertions(+) diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 4f3fd82736..68ba15829e 100755 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -403,6 +403,15 @@ void LLPreviewNotecard::onClickSave(void* user_data) // static void LLPreviewNotecard::onClickDelete(void* user_data) { +// [FS:CR] FIRE-2700 + LLPreviewNotecard* preview = (LLPreviewNotecard*)user_data; + LLNotificationsUtil::add("DeleteNotecard", LLSD(), LLSD(), boost::bind(&LLPreviewNotecard::handleDeleteChangesDialog, preview, _1, _2)); +} + +// static +void LLPreviewNotecard::onConfirmDelete(void* user_data) +{ +// [/FS:CR] LLPreviewNotecard* preview = (LLPreviewNotecard*)user_data; if(preview) { @@ -628,4 +637,17 @@ bool LLPreviewNotecard::handleSaveChangesDialog(const LLSD& notification, const return false; } +// [FS:CR] FIRE-2700 +bool LLPreviewNotecard::handleDeleteChangesDialog(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) + { + LLPreviewNotecard::onConfirmDelete((void*)this); + } + + return false; +} +// [/FS:CR] + // EOF diff --git a/indra/newview/llpreviewnotecard.h b/indra/newview/llpreviewnotecard.h index 12850fe35a..fb8e23b081 100755 --- a/indra/newview/llpreviewnotecard.h +++ b/indra/newview/llpreviewnotecard.h @@ -102,6 +102,11 @@ protected: S32 status, LLExtStat ext_status); bool handleSaveChangesDialog(const LLSD& notification, const LLSD& response); + + // [FS:CR] FIRE-2700 + bool handleDeleteChangesDialog(const LLSD& notification, const LLSD& response); + static void onConfirmDelete(void* user_data); + // [FS:CR] protected: LLViewerTextEditor* mEditor; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 606dce5363..d9ef25db82 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -1168,6 +1168,19 @@ Save Changes? yestext="Save"/> + +Are you sure you want to delete this notecard? + confirm + + +