From c3f2d6b01a3fb000f9d76de92e109c29efa75a6d Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Mon, 1 Jun 2009 00:27:32 -0500 Subject: Added confirmation dialogs for Mute from pie menu. Dialog is for muting avatars and objects from the pie menu only. --- ChangeLog.txt | 11 +++++++ linden/indra/newview/llmutelist.cpp | 38 ++++++++++++++++++++++ linden/indra/newview/llmutelist.h | 5 +++ linden/indra/newview/llviewermenu.cpp | 12 +++++-- .../newview/skins/default/xui/en-us/alerts.xml | 30 +++++++++++++++++ 5 files changed, 93 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 26b507d..7f61891 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,14 @@ +2009-06-01 Jacek Antonelli + + * Added confirmation dialogs for Mute from pie menu. + Dialog is for muting avatars and objects from the pie menu only. + + modified: linden/indra/newview/llmutelist.cpp + modified: linden/indra/newview/llmutelist.h + modified: linden/indra/newview/llviewermenu.cpp + modified: linden/indra/newview/skins/default/xui/en-us/alerts.xml + + 2009-05-31 Jacek Antonelli * Added a confirmation dialog for Take Off All Clothes. diff --git a/linden/indra/newview/llmutelist.cpp b/linden/indra/newview/llmutelist.cpp index 0cdfe83..00ef9c3 100644 --- a/linden/indra/newview/llmutelist.cpp +++ b/linden/indra/newview/llmutelist.cpp @@ -64,6 +64,7 @@ #include "llworld.h" //for particle system banning #include "llchat.h" #include "llfloaterchat.h" +#include "llfloatermute.h" #include "llimpanel.h" #include "llimview.h" #include "llnotify.h" @@ -245,6 +246,43 @@ BOOL LLMuteList::isLinden(const std::string& name) const } +void LLMuteList::addMuteAgentConfirm( const LLMute &mute ) +{ + LLMute *newmute = new LLMute(mute); + + LLStringUtil::format_map_t args; + args["[NAME]"] = newmute->mName; + + gViewerWindow->alertXml("ConfirmMuteAgent", args, + LLMuteList::addMuteCallback, + static_cast(newmute)); +} + +void LLMuteList::addMuteObjectConfirm( const LLMute &mute ) +{ + LLMute *newmute = new LLMute(mute); + + LLStringUtil::format_map_t args; + args["[NAME]"] = newmute->mName; + + gViewerWindow->alertXml("ConfirmMuteObject", args, + LLMuteList::addMuteCallback, + static_cast(newmute)); +} + +// static +void LLMuteList::addMuteCallback(S32 option, void *userdata) +{ + LLMute *mute = static_cast(userdata); + if( option == 0 ) + { + // They confirmed it. Here we go! + LLMuteList::getInstance()->add( *mute ); + LLFloaterMute::showInstance(); + } + delete mute; +} + BOOL LLMuteList::add(const LLMute& mute, U32 flags) { // Can't mute text from Lindens diff --git a/linden/indra/newview/llmutelist.h b/linden/indra/newview/llmutelist.h index 400f13e..d66dd17 100644 --- a/linden/indra/newview/llmutelist.h +++ b/linden/indra/newview/llmutelist.h @@ -102,6 +102,11 @@ public: void addObserver(LLMuteListObserver* observer); void removeObserver(LLMuteListObserver* observer); + + void addMuteAgentConfirm( const LLMute &mute ); + void addMuteObjectConfirm( const LLMute &mute ); + static void addMuteCallback(S32 option, void *userdata); + // Add either a normal or a BY_NAME mute, for any or all properties. BOOL add(const LLMute& mute, U32 flags = 0); diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index d477b0c..4081e97 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -2087,10 +2087,16 @@ class LLObjectMute : public view_listener_t } else { - LLMuteList::getInstance()->add(mute); - LLFloaterMute::showInstance(); + if( LLMute::AGENT == type ) + { + LLMuteList::getInstance()->addMuteAgentConfirm(mute); + } + else + { + // must be an object. + LLMuteList::getInstance()->addMuteObjectConfirm(mute); + } } - return true; } }; diff --git a/linden/indra/newview/skins/default/xui/en-us/alerts.xml b/linden/indra/newview/skins/default/xui/en-us/alerts.xml index cb37663..25d3a84 100644 --- a/linden/indra/newview/skins/default/xui/en-us/alerts.xml +++ b/linden/indra/newview/skins/default/xui/en-us/alerts.xml @@ -5130,5 +5130,35 @@ WARNING: Don't restore if you aren't sure where the object will go! + + + Are you sure you want to mute [NAME] (resident)? + + + When muting a Resident + + + + + + + + Are you sure you want to mute [NAME] (object)? + + + When muting an object + + + + + -- cgit v1.1