diff options
Diffstat (limited to 'linden/indra/newview/llpanelavatar.cpp')
-rw-r--r-- | linden/indra/newview/llpanelavatar.cpp | 215 |
1 files changed, 82 insertions, 133 deletions
diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp index 872c5e7..489f0d3 100644 --- a/linden/indra/newview/llpanelavatar.cpp +++ b/linden/indra/newview/llpanelavatar.cpp | |||
@@ -17,7 +17,8 @@ | |||
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | 20 | * online at |
21 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | 22 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 23 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 24 | * that you have read and understood your obligations described above, |
@@ -78,9 +79,6 @@ | |||
78 | #include "llweb.h" | 79 | #include "llweb.h" |
79 | #include "llinventorymodel.h" | 80 | #include "llinventorymodel.h" |
80 | #include "roles_constants.h" | 81 | #include "roles_constants.h" |
81 | |||
82 | #define kArraySize( _kArray ) ( sizeof( (_kArray) ) / sizeof( _kArray[0] ) ) | ||
83 | |||
84 | #include "lluictrlfactory.h" | 82 | #include "lluictrlfactory.h" |
85 | 83 | ||
86 | // Statics | 84 | // Statics |
@@ -142,79 +140,15 @@ BOOL LLDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, | |||
142 | EAcceptance* accept, | 140 | EAcceptance* accept, |
143 | std::string& tooltip_msg) | 141 | std::string& tooltip_msg) |
144 | { | 142 | { |
145 | BOOL handled = FALSE; | ||
146 | if(getParent()) | 143 | if(getParent()) |
147 | { | 144 | { |
148 | // check if inside | 145 | LLToolDragAndDrop::handleGiveDragAndDrop(mAgentID, LLUUID::null, drop, |
149 | //LLRect parent_rect = mParentView->getRect(); | 146 | cargo_type, cargo_data, accept); |
150 | //getRect().set(0, parent_rect.getHeight(), parent_rect.getWidth(), 0); | ||
151 | handled = TRUE; | ||
152 | 147 | ||
153 | // check the type | 148 | return TRUE; |
154 | switch(cargo_type) | ||
155 | { | ||
156 | case DAD_TEXTURE: | ||
157 | case DAD_SOUND: | ||
158 | case DAD_LANDMARK: | ||
159 | case DAD_SCRIPT: | ||
160 | case DAD_OBJECT: | ||
161 | case DAD_NOTECARD: | ||
162 | case DAD_CLOTHING: | ||
163 | case DAD_BODYPART: | ||
164 | case DAD_ANIMATION: | ||
165 | case DAD_GESTURE: | ||
166 | { | ||
167 | LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data; | ||
168 | if(gInventory.getItem(inv_item->getUUID()) | ||
169 | && LLToolDragAndDrop::isInventoryGiveAcceptable(inv_item)) | ||
170 | { | ||
171 | // *TODO: get multiple object transfers working | ||
172 | *accept = ACCEPT_YES_COPY_SINGLE; | ||
173 | if(drop) | ||
174 | { | ||
175 | LLToolDragAndDrop::giveInventory(mAgentID, inv_item); | ||
176 | } | ||
177 | } | ||
178 | else | ||
179 | { | ||
180 | // It's not in the user's inventory (it's probably | ||
181 | // in an object's contents), so disallow dragging | ||
182 | // it here. You can't give something you don't | ||
183 | // yet have. | ||
184 | *accept = ACCEPT_NO; | ||
185 | } | ||
186 | break; | ||
187 | } | ||
188 | case DAD_CATEGORY: | ||
189 | { | ||
190 | LLViewerInventoryCategory* inv_cat = (LLViewerInventoryCategory*)cargo_data; | ||
191 | if( gInventory.getCategory( inv_cat->getUUID() ) ) | ||
192 | { | ||
193 | // *TODO: get multiple object transfers working | ||
194 | *accept = ACCEPT_YES_COPY_SINGLE; | ||
195 | if(drop) | ||
196 | { | ||
197 | LLToolDragAndDrop::giveInventoryCategory(mAgentID, | ||
198 | inv_cat); | ||
199 | } | ||
200 | } | ||
201 | else | ||
202 | { | ||
203 | // It's not in the user's inventory (it's probably | ||
204 | // in an object's contents), so disallow dragging | ||
205 | // it here. You can't give something you don't | ||
206 | // yet have. | ||
207 | *accept = ACCEPT_NO; | ||
208 | } | ||
209 | break; | ||
210 | } | ||
211 | case DAD_CALLINGCARD: | ||
212 | default: | ||
213 | *accept = ACCEPT_NO; | ||
214 | break; | ||
215 | } | ||
216 | } | 149 | } |
217 | return handled; | 150 | |
151 | return FALSE; | ||
218 | } | 152 | } |
219 | 153 | ||
220 | 154 | ||
@@ -354,20 +288,24 @@ void LLPanelAvatarSecondLife::onDoubleClickGroup(void* data) | |||
354 | // static | 288 | // static |
355 | void LLPanelAvatarSecondLife::onClickPublishHelp(void *) | 289 | void LLPanelAvatarSecondLife::onClickPublishHelp(void *) |
356 | { | 290 | { |
357 | gViewerWindow->alertXml("ClickPublishHelpAvatar"); | 291 | LLNotifications::instance().add("ClickPublishHelpAvatar"); |
358 | } | 292 | } |
359 | 293 | ||
360 | // static | 294 | // static |
361 | void LLPanelAvatarSecondLife::onClickPartnerHelp(void *) | 295 | void LLPanelAvatarSecondLife::onClickPartnerHelp(void *) |
362 | { | 296 | { |
363 | gViewerWindow->alertXml("ClickPartnerHelpAvatar", onClickPartnerHelpLoadURL, (void*) NULL); | 297 | LLNotifications::instance().add("ClickPartnerHelpAvatar", LLSD(), LLSD(), onClickPartnerHelpLoadURL); |
364 | } | 298 | } |
365 | 299 | ||
366 | // static | 300 | // static |
367 | void LLPanelAvatarSecondLife::onClickPartnerHelpLoadURL(S32 option, void* userdata) | 301 | bool LLPanelAvatarSecondLife::onClickPartnerHelpLoadURL(const LLSD& notification, const LLSD& response) |
368 | { | 302 | { |
369 | if (option == 0) | 303 | S32 option = LLNotification::getSelectedOption(notification, response); |
370 | LLWeb::loadURL("http://secondlife.com/partner"); | 304 | if (option == 0) |
305 | { | ||
306 | LLWeb::loadURL("http://secondlife.com/partner"); | ||
307 | } | ||
308 | return false; | ||
371 | } | 309 | } |
372 | 310 | ||
373 | // static | 311 | // static |
@@ -391,7 +329,6 @@ LLPanelAvatarFirstLife::LLPanelAvatarFirstLife(const std::string& name, | |||
391 | { | 329 | { |
392 | } | 330 | } |
393 | 331 | ||
394 | |||
395 | void LLPanelAvatarFirstLife::enableControls(BOOL self) | 332 | void LLPanelAvatarFirstLife::enableControls(BOOL self) |
396 | { | 333 | { |
397 | childSetEnabled("img", self); | 334 | childSetEnabled("img", self); |
@@ -441,6 +378,8 @@ BOOL LLPanelAvatarSecondLife::postBuild(void) | |||
441 | 378 | ||
442 | childSetDoubleClickCallback("groups", onDoubleClickGroup, this ); | 379 | childSetDoubleClickCallback("groups", onDoubleClickGroup, this ); |
443 | 380 | ||
381 | getChild<LLTextureCtrl>("img")->setFallbackImageName("default_profile_picture.j2c"); | ||
382 | |||
444 | return TRUE; | 383 | return TRUE; |
445 | } | 384 | } |
446 | 385 | ||
@@ -448,6 +387,9 @@ BOOL LLPanelAvatarFirstLife::postBuild(void) | |||
448 | { | 387 | { |
449 | BOOL own_avatar = (getPanelAvatar()->getAvatarID() == gAgent.getID() ); | 388 | BOOL own_avatar = (getPanelAvatar()->getAvatarID() == gAgent.getID() ); |
450 | enableControls(own_avatar); | 389 | enableControls(own_avatar); |
390 | |||
391 | getChild<LLTextureCtrl>("img")->setFallbackImageName("default_profile_picture.j2c"); | ||
392 | |||
451 | return TRUE; | 393 | return TRUE; |
452 | } | 394 | } |
453 | 395 | ||
@@ -498,17 +440,17 @@ BOOL LLPanelAvatarPicks::postBuild(void) | |||
498 | 440 | ||
499 | BOOL LLPanelAvatarAdvanced::postBuild() | 441 | BOOL LLPanelAvatarAdvanced::postBuild() |
500 | { | 442 | { |
501 | for(size_t ii = 0; ii < kArraySize(mWantToCheck); ++ii) | 443 | for(size_t ii = 0; ii < LL_ARRAY_SIZE(mWantToCheck); ++ii) |
502 | mWantToCheck[ii] = NULL; | 444 | mWantToCheck[ii] = NULL; |
503 | for(size_t ii = 0; ii < kArraySize(mSkillsCheck); ++ii) | 445 | for(size_t ii = 0; ii < LL_ARRAY_SIZE(mSkillsCheck); ++ii) |
504 | mSkillsCheck[ii] = NULL; | 446 | mSkillsCheck[ii] = NULL; |
505 | mWantToCount = (8>kArraySize(mWantToCheck))?kArraySize(mWantToCheck):8; | 447 | mWantToCount = (8>LL_ARRAY_SIZE(mWantToCheck))?LL_ARRAY_SIZE(mWantToCheck):8; |
506 | for(S32 tt=0; tt < mWantToCount; ++tt) | 448 | for(S32 tt=0; tt < mWantToCount; ++tt) |
507 | { | 449 | { |
508 | std::string ctlname = llformat("chk%d", tt); | 450 | std::string ctlname = llformat("chk%d", tt); |
509 | mWantToCheck[tt] = getChild<LLCheckBoxCtrl>(ctlname); | 451 | mWantToCheck[tt] = getChild<LLCheckBoxCtrl>(ctlname); |
510 | } | 452 | } |
511 | mSkillsCount = (6>kArraySize(mSkillsCheck))?kArraySize(mSkillsCheck):6; | 453 | mSkillsCount = (6>LL_ARRAY_SIZE(mSkillsCheck))?LL_ARRAY_SIZE(mSkillsCheck):6; |
512 | 454 | ||
513 | for(S32 tt=0; tt < mSkillsCount; ++tt) | 455 | for(S32 tt=0; tt < mSkillsCount; ++tt) |
514 | { | 456 | { |
@@ -592,7 +534,7 @@ void LLPanelAvatarWeb::onCommitURL(LLUICtrl* ctrl, void* data) | |||
592 | // static | 534 | // static |
593 | void LLPanelAvatarWeb::onClickWebProfileHelp(void *) | 535 | void LLPanelAvatarWeb::onClickWebProfileHelp(void *) |
594 | { | 536 | { |
595 | gViewerWindow->alertXml("ClickWebProfileHelpAvatar"); | 537 | LLNotifications::instance().add("ClickWebProfileHelpAvatar"); |
596 | } | 538 | } |
597 | 539 | ||
598 | void LLPanelAvatarWeb::load(std::string url) | 540 | void LLPanelAvatarWeb::load(std::string url) |
@@ -938,26 +880,25 @@ void LLPanelAvatarClassified::onClickNew(void* data) | |||
938 | // [/RLVa:KB] | 880 | // [/RLVa:KB] |
939 | LLPanelAvatarClassified* self = (LLPanelAvatarClassified*)data; | 881 | LLPanelAvatarClassified* self = (LLPanelAvatarClassified*)data; |
940 | 882 | ||
941 | gViewerWindow->alertXml("AddClassified",callbackNew,self); | 883 | LLNotifications::instance().add("AddClassified", LLSD(), LLSD(), boost::bind(&LLPanelAvatarClassified::callbackNew, self, _1, _2)); |
942 | 884 | ||
943 | } | 885 | } |
944 | 886 | ||
945 | // static | 887 | bool LLPanelAvatarClassified::callbackNew(const LLSD& notification, const LLSD& response) |
946 | void LLPanelAvatarClassified::callbackNew(S32 option, void* data) | ||
947 | { | 888 | { |
948 | LLPanelAvatarClassified* self = (LLPanelAvatarClassified*)data; | 889 | S32 option = LLNotification::getSelectedOption(notification, response); |
949 | |||
950 | if (0 == option) | 890 | if (0 == option) |
951 | { | 891 | { |
952 | LLPanelClassified* panel_classified = new LLPanelClassified(false, false); | 892 | LLPanelClassified* panel_classified = new LLPanelClassified(false, false); |
953 | panel_classified->initNewClassified(); | 893 | panel_classified->initNewClassified(); |
954 | LLTabContainer* tabs = self->getChild<LLTabContainer>("classified tab"); | 894 | LLTabContainer* tabs = getChild<LLTabContainer>("classified tab"); |
955 | if(tabs) | 895 | if(tabs) |
956 | { | 896 | { |
957 | tabs->addTabPanel(panel_classified, panel_classified->getClassifiedName()); | 897 | tabs->addTabPanel(panel_classified, panel_classified->getClassifiedName()); |
958 | tabs->selectLastTab(); | 898 | tabs->selectLastTab(); |
959 | } | 899 | } |
960 | } | 900 | } |
901 | return false; | ||
961 | } | 902 | } |
962 | 903 | ||
963 | 904 | ||
@@ -974,18 +915,17 @@ void LLPanelAvatarClassified::onClickDelete(void* data) | |||
974 | } | 915 | } |
975 | if (!panel_classified) return; | 916 | if (!panel_classified) return; |
976 | 917 | ||
977 | LLStringUtil::format_map_t args; | 918 | LLSD args; |
978 | args["[NAME]"] = panel_classified->getClassifiedName(); | 919 | args["NAME"] = panel_classified->getClassifiedName(); |
979 | gViewerWindow->alertXml("DeleteClassified", args, callbackDelete, self); | 920 | LLNotifications::instance().add("DeleteClassified", args, LLSD(), boost::bind(&LLPanelAvatarClassified::callbackDelete, self, _1, _2)); |
980 | 921 | ||
981 | } | 922 | } |
982 | 923 | ||
983 | 924 | ||
984 | // static | 925 | bool LLPanelAvatarClassified::callbackDelete(const LLSD& notification, const LLSD& response) |
985 | void LLPanelAvatarClassified::callbackDelete(S32 option, void* data) | ||
986 | { | 926 | { |
987 | LLPanelAvatarClassified* self = (LLPanelAvatarClassified*)data; | 927 | S32 option = LLNotification::getSelectedOption(notification, response); |
988 | LLTabContainer* tabs = self->getChild<LLTabContainer>("classified tab"); | 928 | LLTabContainer* tabs = getChild<LLTabContainer>("classified tab"); |
989 | LLPanelClassified* panel_classified=NULL; | 929 | LLPanelClassified* panel_classified=NULL; |
990 | if(tabs) | 930 | if(tabs) |
991 | { | 931 | { |
@@ -994,7 +934,7 @@ void LLPanelAvatarClassified::callbackDelete(S32 option, void* data) | |||
994 | 934 | ||
995 | LLMessageSystem* msg = gMessageSystem; | 935 | LLMessageSystem* msg = gMessageSystem; |
996 | 936 | ||
997 | if (!panel_classified) return; | 937 | if (!panel_classified) return false; |
998 | 938 | ||
999 | if (0 == option) | 939 | if (0 == option) |
1000 | { | 940 | { |
@@ -1013,6 +953,7 @@ void LLPanelAvatarClassified::callbackDelete(S32 option, void* data) | |||
1013 | delete panel_classified; | 953 | delete panel_classified; |
1014 | panel_classified = NULL; | 954 | panel_classified = NULL; |
1015 | } | 955 | } |
956 | return false; | ||
1016 | } | 957 | } |
1017 | 958 | ||
1018 | 959 | ||
@@ -1141,24 +1082,23 @@ void LLPanelAvatarPicks::onClickDelete(void* data) | |||
1141 | 1082 | ||
1142 | if (!panel_pick) return; | 1083 | if (!panel_pick) return; |
1143 | 1084 | ||
1144 | LLStringUtil::format_map_t args; | 1085 | LLSD args; |
1145 | args["[PICK]"] = panel_pick->getPickName(); | 1086 | args["PICK"] = panel_pick->getPickName(); |
1146 | 1087 | ||
1147 | gViewerWindow->alertXml("DeleteAvatarPick", args, | 1088 | LLNotifications::instance().add("DeleteAvatarPick", args, LLSD(), |
1148 | callbackDelete, | 1089 | boost::bind(&LLPanelAvatarPicks::callbackDelete, self, _1, _2)); |
1149 | self); | ||
1150 | } | 1090 | } |
1151 | 1091 | ||
1152 | 1092 | ||
1153 | // static | 1093 | // static |
1154 | void LLPanelAvatarPicks::callbackDelete(S32 option, void* data) | 1094 | bool LLPanelAvatarPicks::callbackDelete(const LLSD& notification, const LLSD& response) |
1155 | { | 1095 | { |
1156 | LLPanelAvatarPicks* self = (LLPanelAvatarPicks*)data; | 1096 | S32 option = LLNotification::getSelectedOption(notification, response); |
1157 | LLTabContainer* tabs = self->getChild<LLTabContainer>("picks tab"); | 1097 | LLTabContainer* tabs = getChild<LLTabContainer>("picks tab"); |
1158 | LLPanelPick* panel_pick = tabs?(LLPanelPick*)tabs->getCurrentPanel():NULL; | 1098 | LLPanelPick* panel_pick = tabs ? (LLPanelPick*)tabs->getCurrentPanel() : NULL; |
1159 | LLMessageSystem* msg = gMessageSystem; | 1099 | LLMessageSystem* msg = gMessageSystem; |
1160 | 1100 | ||
1161 | if (!panel_pick) return; | 1101 | if (!panel_pick) return false; |
1162 | 1102 | ||
1163 | if (0 == option) | 1103 | if (0 == option) |
1164 | { | 1104 | { |
@@ -1194,6 +1134,7 @@ void LLPanelAvatarPicks::callbackDelete(S32 option, void* data) | |||
1194 | delete panel_pick; | 1134 | delete panel_pick; |
1195 | panel_pick = NULL; | 1135 | panel_pick = NULL; |
1196 | } | 1136 | } |
1137 | return false; | ||
1197 | } | 1138 | } |
1198 | 1139 | ||
1199 | 1140 | ||
@@ -1856,7 +1797,7 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) | |||
1856 | msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_BornOn, born_on); | 1797 | msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_BornOn, born_on); |
1857 | msg->getString("PropertiesData","ProfileURL", profile_url); | 1798 | msg->getString("PropertiesData","ProfileURL", profile_url); |
1858 | msg->getU32Fast(_PREHASH_PropertiesData, _PREHASH_Flags, flags); | 1799 | msg->getU32Fast(_PREHASH_PropertiesData, _PREHASH_Flags, flags); |
1859 | 1800 | ||
1860 | identified = (flags & AVATAR_IDENTIFIED); | 1801 | identified = (flags & AVATAR_IDENTIFIED); |
1861 | transacted = (flags & AVATAR_TRANSACTED); | 1802 | transacted = (flags & AVATAR_TRANSACTED); |
1862 | age_verified = (flags & AVATAR_AGEVERIFIED); // Not currently getting set in dataserver/lldataavatar.cpp for privacy considerations | 1803 | age_verified = (flags & AVATAR_AGEVERIFIED); // Not currently getting set in dataserver/lldataavatar.cpp for privacy considerations |
@@ -1887,7 +1828,7 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) | |||
1887 | "AcctTypeCharterMember", | 1828 | "AcctTypeCharterMember", |
1888 | "AcctTypeEmployee" | 1829 | "AcctTypeEmployee" |
1889 | }; | 1830 | }; |
1890 | caption_index = llclamp(caption_index, (U8)0, (U8)(sizeof(ACCT_TYPE)/sizeof(ACCT_TYPE[0])-1)); | 1831 | caption_index = llclamp(caption_index, (U8)0, (U8)(LL_ARRAY_SIZE(ACCT_TYPE)-1)); |
1891 | args["[ACCTTYPE]"] = self->mPanelSecondLife->getString(ACCT_TYPE[caption_index]); | 1832 | args["[ACCTTYPE]"] = self->mPanelSecondLife->getString(ACCT_TYPE[caption_index]); |
1892 | 1833 | ||
1893 | std::string payment_text = " "; | 1834 | std::string payment_text = " "; |
@@ -1909,7 +1850,7 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) | |||
1909 | args["[PAYMENTINFO]"] = self->mPanelSecondLife->getString(payment_text); | 1850 | args["[PAYMENTINFO]"] = self->mPanelSecondLife->getString(payment_text); |
1910 | std::string age_text = age_verified ? "AgeVerified" : "NotAgeVerified"; | 1851 | std::string age_text = age_verified ? "AgeVerified" : "NotAgeVerified"; |
1911 | // Do not display age verification status at this time | 1852 | // Do not display age verification status at this time |
1912 | //args["[AGEVERIFICATION]"] = self->mPanelSecondLife->getString(age_text); | 1853 | //args["[[AGEVERIFICATION]]"] = self->mPanelSecondLife->getString(age_text); |
1913 | args["[AGEVERIFICATION]"] = " "; | 1854 | args["[AGEVERIFICATION]"] = " "; |
1914 | } | 1855 | } |
1915 | else | 1856 | else |
@@ -2287,85 +2228,93 @@ void LLPanelAvatar::onClickKick(void* userdata) | |||
2287 | gFloaterView->getNewFloaterPosition(&left, &top); | 2228 | gFloaterView->getNewFloaterPosition(&left, &top); |
2288 | LLRect rect(left, top, left+400, top-300); | 2229 | LLRect rect(left, top, left+400, top-300); |
2289 | 2230 | ||
2290 | gViewerWindow->alertXmlEditText("KickUser", LLStringUtil::format_map_t(), | 2231 | LLSD payload; |
2291 | NULL, NULL, | 2232 | payload["avatar_id"] = self->mAvatarID; |
2292 | LLPanelAvatar::finishKick, self); | 2233 | LLNotifications::instance().add("KickUser", LLSD(), payload, finishKick); |
2293 | } | 2234 | } |
2294 | 2235 | ||
2295 | // static | 2236 | //static |
2296 | void LLPanelAvatar::finishKick(S32 option, const std::string& text, void* userdata) | 2237 | bool LLPanelAvatar::finishKick(const LLSD& notification, const LLSD& response) |
2297 | { | 2238 | { |
2298 | LLPanelAvatar* self = (LLPanelAvatar*) userdata; | 2239 | S32 option = LLNotification::getSelectedOption(notification, response); |
2299 | 2240 | ||
2300 | if (option == 0) | 2241 | if (option == 0) |
2301 | { | 2242 | { |
2243 | LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID(); | ||
2302 | LLMessageSystem* msg = gMessageSystem; | 2244 | LLMessageSystem* msg = gMessageSystem; |
2303 | 2245 | ||
2304 | msg->newMessageFast(_PREHASH_GodKickUser); | 2246 | msg->newMessageFast(_PREHASH_GodKickUser); |
2305 | msg->nextBlockFast(_PREHASH_UserInfo); | 2247 | msg->nextBlockFast(_PREHASH_UserInfo); |
2306 | msg->addUUIDFast(_PREHASH_GodID, gAgent.getID() ); | 2248 | msg->addUUIDFast(_PREHASH_GodID, gAgent.getID() ); |
2307 | msg->addUUIDFast(_PREHASH_GodSessionID, gAgent.getSessionID()); | 2249 | msg->addUUIDFast(_PREHASH_GodSessionID, gAgent.getSessionID()); |
2308 | msg->addUUIDFast(_PREHASH_AgentID, self->mAvatarID ); | 2250 | msg->addUUIDFast(_PREHASH_AgentID, avatar_id ); |
2309 | msg->addU32("KickFlags", KICK_FLAGS_DEFAULT ); | 2251 | msg->addU32("KickFlags", KICK_FLAGS_DEFAULT ); |
2310 | msg->addStringFast(_PREHASH_Reason, text ); | 2252 | msg->addStringFast(_PREHASH_Reason, response["message"].asString() ); |
2311 | gAgent.sendReliableMessage(); | 2253 | gAgent.sendReliableMessage(); |
2312 | } | 2254 | } |
2255 | return false; | ||
2313 | } | 2256 | } |
2314 | 2257 | ||
2315 | // static | 2258 | // static |
2316 | void LLPanelAvatar::onClickFreeze(void* userdata) | 2259 | void LLPanelAvatar::onClickFreeze(void* userdata) |
2317 | { | 2260 | { |
2318 | gViewerWindow->alertXmlEditText("FreezeUser", LLStringUtil::format_map_t(), | 2261 | LLPanelAvatar* self = (LLPanelAvatar*) userdata; |
2319 | NULL, NULL, | 2262 | LLSD payload; |
2320 | LLPanelAvatar::finishFreeze, userdata); | 2263 | payload["avatar_id"] = self->mAvatarID; |
2264 | LLNotifications::instance().add("FreezeUser", LLSD(), payload, LLPanelAvatar::finishFreeze); | ||
2321 | } | 2265 | } |
2322 | 2266 | ||
2323 | // static | 2267 | // static |
2324 | void LLPanelAvatar::finishFreeze(S32 option, const std::string& text, void* userdata) | 2268 | bool LLPanelAvatar::finishFreeze(const LLSD& notification, const LLSD& response) |
2325 | { | 2269 | { |
2326 | LLPanelAvatar* self = (LLPanelAvatar*) userdata; | 2270 | S32 option = LLNotification::getSelectedOption(notification, response); |
2327 | 2271 | ||
2328 | if (option == 0) | 2272 | if (option == 0) |
2329 | { | 2273 | { |
2274 | LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID(); | ||
2330 | LLMessageSystem* msg = gMessageSystem; | 2275 | LLMessageSystem* msg = gMessageSystem; |
2331 | 2276 | ||
2332 | msg->newMessageFast(_PREHASH_GodKickUser); | 2277 | msg->newMessageFast(_PREHASH_GodKickUser); |
2333 | msg->nextBlockFast(_PREHASH_UserInfo); | 2278 | msg->nextBlockFast(_PREHASH_UserInfo); |
2334 | msg->addUUIDFast(_PREHASH_GodID, gAgent.getID() ); | 2279 | msg->addUUIDFast(_PREHASH_GodID, gAgent.getID() ); |
2335 | msg->addUUIDFast(_PREHASH_GodSessionID, gAgent.getSessionID()); | 2280 | msg->addUUIDFast(_PREHASH_GodSessionID, gAgent.getSessionID()); |
2336 | msg->addUUIDFast(_PREHASH_AgentID, self->mAvatarID ); | 2281 | msg->addUUIDFast(_PREHASH_AgentID, avatar_id ); |
2337 | msg->addU32("KickFlags", KICK_FLAGS_FREEZE ); | 2282 | msg->addU32("KickFlags", KICK_FLAGS_FREEZE ); |
2338 | msg->addStringFast(_PREHASH_Reason, text ); | 2283 | msg->addStringFast(_PREHASH_Reason, response["message"].asString() ); |
2339 | gAgent.sendReliableMessage(); | 2284 | gAgent.sendReliableMessage(); |
2340 | } | 2285 | } |
2286 | return false; | ||
2341 | } | 2287 | } |
2342 | 2288 | ||
2343 | // static | 2289 | // static |
2344 | void LLPanelAvatar::onClickUnfreeze(void* userdata) | 2290 | void LLPanelAvatar::onClickUnfreeze(void* userdata) |
2345 | { | 2291 | { |
2346 | gViewerWindow->alertXmlEditText("UnFreezeUser", LLStringUtil::format_map_t(), | 2292 | LLPanelAvatar* self = (LLPanelAvatar*) userdata; |
2347 | NULL, NULL, | 2293 | LLSD payload; |
2348 | LLPanelAvatar::finishUnfreeze, userdata); | 2294 | payload["avatar_id"] = self->mAvatarID; |
2295 | LLNotifications::instance().add("UnFreezeUser", LLSD(), payload, LLPanelAvatar::finishUnfreeze); | ||
2349 | } | 2296 | } |
2350 | 2297 | ||
2351 | // static | 2298 | // static |
2352 | void LLPanelAvatar::finishUnfreeze(S32 option, const std::string& text, void* userdata) | 2299 | bool LLPanelAvatar::finishUnfreeze(const LLSD& notification, const LLSD& response) |
2353 | { | 2300 | { |
2354 | LLPanelAvatar* self = (LLPanelAvatar*) userdata; | 2301 | S32 option = LLNotification::getSelectedOption(notification, response); |
2355 | 2302 | std::string text = response["message"].asString(); | |
2356 | if (option == 0) | 2303 | if (option == 0) |
2357 | { | 2304 | { |
2305 | LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID(); | ||
2358 | LLMessageSystem* msg = gMessageSystem; | 2306 | LLMessageSystem* msg = gMessageSystem; |
2359 | 2307 | ||
2360 | msg->newMessageFast(_PREHASH_GodKickUser); | 2308 | msg->newMessageFast(_PREHASH_GodKickUser); |
2361 | msg->nextBlockFast(_PREHASH_UserInfo); | 2309 | msg->nextBlockFast(_PREHASH_UserInfo); |
2362 | msg->addUUIDFast(_PREHASH_GodID, gAgent.getID() ); | 2310 | msg->addUUIDFast(_PREHASH_GodID, gAgent.getID() ); |
2363 | msg->addUUIDFast(_PREHASH_GodSessionID, gAgent.getSessionID()); | 2311 | msg->addUUIDFast(_PREHASH_GodSessionID, gAgent.getSessionID()); |
2364 | msg->addUUIDFast(_PREHASH_AgentID, self->mAvatarID ); | 2312 | msg->addUUIDFast(_PREHASH_AgentID, avatar_id ); |
2365 | msg->addU32("KickFlags", KICK_FLAGS_UNFREEZE ); | 2313 | msg->addU32("KickFlags", KICK_FLAGS_UNFREEZE ); |
2366 | msg->addStringFast(_PREHASH_Reason, text ); | 2314 | msg->addStringFast(_PREHASH_Reason, text ); |
2367 | gAgent.sendReliableMessage(); | 2315 | gAgent.sendReliableMessage(); |
2368 | } | 2316 | } |
2317 | return false; | ||
2369 | } | 2318 | } |
2370 | 2319 | ||
2371 | // static | 2320 | // static |