diff options
-rw-r--r-- | ChangeLog.txt | 11 | ||||
-rw-r--r-- | linden/indra/newview/llmutelist.cpp | 38 | ||||
-rw-r--r-- | linden/indra/newview/llmutelist.h | 5 | ||||
-rw-r--r-- | linden/indra/newview/llviewermenu.cpp | 12 | ||||
-rw-r--r-- | linden/indra/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 @@ | |||
1 | 2009-06-01 Jacek Antonelli <jacek.antonelli@gmail.com> | ||
2 | |||
3 | * Added confirmation dialogs for Mute from pie menu. | ||
4 | Dialog is for muting avatars and objects from the pie menu only. | ||
5 | |||
6 | modified: linden/indra/newview/llmutelist.cpp | ||
7 | modified: linden/indra/newview/llmutelist.h | ||
8 | modified: linden/indra/newview/llviewermenu.cpp | ||
9 | modified: linden/indra/newview/skins/default/xui/en-us/alerts.xml | ||
10 | |||
11 | |||
1 | 2009-05-31 Jacek Antonelli <jacek.antonelli@gmail.com> | 12 | 2009-05-31 Jacek Antonelli <jacek.antonelli@gmail.com> |
2 | 13 | ||
3 | * Added a confirmation dialog for Take Off All Clothes. | 14 | * 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 @@ | |||
64 | #include "llworld.h" //for particle system banning | 64 | #include "llworld.h" //for particle system banning |
65 | #include "llchat.h" | 65 | #include "llchat.h" |
66 | #include "llfloaterchat.h" | 66 | #include "llfloaterchat.h" |
67 | #include "llfloatermute.h" | ||
67 | #include "llimpanel.h" | 68 | #include "llimpanel.h" |
68 | #include "llimview.h" | 69 | #include "llimview.h" |
69 | #include "llnotify.h" | 70 | #include "llnotify.h" |
@@ -245,6 +246,43 @@ BOOL LLMuteList::isLinden(const std::string& name) const | |||
245 | } | 246 | } |
246 | 247 | ||
247 | 248 | ||
249 | void LLMuteList::addMuteAgentConfirm( const LLMute &mute ) | ||
250 | { | ||
251 | LLMute *newmute = new LLMute(mute); | ||
252 | |||
253 | LLStringUtil::format_map_t args; | ||
254 | args["[NAME]"] = newmute->mName; | ||
255 | |||
256 | gViewerWindow->alertXml("ConfirmMuteAgent", args, | ||
257 | LLMuteList::addMuteCallback, | ||
258 | static_cast<void*>(newmute)); | ||
259 | } | ||
260 | |||
261 | void LLMuteList::addMuteObjectConfirm( const LLMute &mute ) | ||
262 | { | ||
263 | LLMute *newmute = new LLMute(mute); | ||
264 | |||
265 | LLStringUtil::format_map_t args; | ||
266 | args["[NAME]"] = newmute->mName; | ||
267 | |||
268 | gViewerWindow->alertXml("ConfirmMuteObject", args, | ||
269 | LLMuteList::addMuteCallback, | ||
270 | static_cast<void*>(newmute)); | ||
271 | } | ||
272 | |||
273 | // static | ||
274 | void LLMuteList::addMuteCallback(S32 option, void *userdata) | ||
275 | { | ||
276 | LLMute *mute = static_cast<LLMute*>(userdata); | ||
277 | if( option == 0 ) | ||
278 | { | ||
279 | // They confirmed it. Here we go! | ||
280 | LLMuteList::getInstance()->add( *mute ); | ||
281 | LLFloaterMute::showInstance(); | ||
282 | } | ||
283 | delete mute; | ||
284 | } | ||
285 | |||
248 | BOOL LLMuteList::add(const LLMute& mute, U32 flags) | 286 | BOOL LLMuteList::add(const LLMute& mute, U32 flags) |
249 | { | 287 | { |
250 | // Can't mute text from Lindens | 288 | // 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: | |||
102 | void addObserver(LLMuteListObserver* observer); | 102 | void addObserver(LLMuteListObserver* observer); |
103 | void removeObserver(LLMuteListObserver* observer); | 103 | void removeObserver(LLMuteListObserver* observer); |
104 | 104 | ||
105 | |||
106 | void addMuteAgentConfirm( const LLMute &mute ); | ||
107 | void addMuteObjectConfirm( const LLMute &mute ); | ||
108 | static void addMuteCallback(S32 option, void *userdata); | ||
109 | |||
105 | // Add either a normal or a BY_NAME mute, for any or all properties. | 110 | // Add either a normal or a BY_NAME mute, for any or all properties. |
106 | BOOL add(const LLMute& mute, U32 flags = 0); | 111 | BOOL add(const LLMute& mute, U32 flags = 0); |
107 | 112 | ||
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 | |||
2087 | } | 2087 | } |
2088 | else | 2088 | else |
2089 | { | 2089 | { |
2090 | LLMuteList::getInstance()->add(mute); | 2090 | if( LLMute::AGENT == type ) |
2091 | LLFloaterMute::showInstance(); | 2091 | { |
2092 | LLMuteList::getInstance()->addMuteAgentConfirm(mute); | ||
2093 | } | ||
2094 | else | ||
2095 | { | ||
2096 | // must be an object. | ||
2097 | LLMuteList::getInstance()->addMuteObjectConfirm(mute); | ||
2098 | } | ||
2092 | } | 2099 | } |
2093 | |||
2094 | return true; | 2100 | return true; |
2095 | } | 2101 | } |
2096 | }; | 2102 | }; |
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! | |||
5130 | </option> | 5130 | </option> |
5131 | </alert> | 5131 | </alert> |
5132 | 5132 | ||
5133 | <alert modal="true" name="ConfirmMuteAgent"> | ||
5134 | <message name="message"> | ||
5135 | Are you sure you want to mute [NAME] (resident)? | ||
5136 | </message> | ||
5137 | <ignore name="ignore"> | ||
5138 | When muting a Resident | ||
5139 | </ignore> | ||
5140 | <option name="Mute"> | ||
5141 | Mute | ||
5142 | </option> | ||
5143 | <option name="Cancel"> | ||
5144 | Cancel | ||
5145 | </option> | ||
5146 | </alert> | ||
5147 | |||
5148 | <alert modal="true" name="ConfirmMuteObject"> | ||
5149 | <message name="message"> | ||
5150 | Are you sure you want to mute [NAME] (object)? | ||
5151 | </message> | ||
5152 | <ignore name="ignore"> | ||
5153 | When muting an object | ||
5154 | </ignore> | ||
5155 | <option name="Mute"> | ||
5156 | Mute | ||
5157 | </option> | ||
5158 | <option name="Cancel"> | ||
5159 | Cancel | ||
5160 | </option> | ||
5161 | </alert> | ||
5162 | |||
5133 | </alerts> | 5163 | </alerts> |
5134 | 5164 | ||