aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatergodtools.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-04-30 13:04:20 -0500
committerJacek Antonelli2009-04-30 13:07:16 -0500
commitca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch)
tree8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/newview/llfloatergodtools.cpp
parentSecond Life viewer sources 1.22.11 (diff)
downloadmeta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz
Second Life viewer sources 1.23.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfloatergodtools.cpp101
1 files changed, 54 insertions, 47 deletions
diff --git a/linden/indra/newview/llfloatergodtools.cpp b/linden/indra/newview/llfloatergodtools.cpp
index 7d54ecf..4959a29 100644
--- a/linden/indra/newview/llfloatergodtools.cpp
+++ b/linden/indra/newview/llfloatergodtools.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,
@@ -918,34 +919,31 @@ void LLPanelGridTools::refresh()
918// static 919// static
919void LLPanelGridTools::onClickKickAll(void* userdata) 920void LLPanelGridTools::onClickKickAll(void* userdata)
920{ 921{
921 LLPanelGridTools* self = (LLPanelGridTools*) userdata;
922
923 S32 left, top; 922 S32 left, top;
924 gFloaterView->getNewFloaterPosition(&left, &top); 923 gFloaterView->getNewFloaterPosition(&left, &top);
925 LLRect rect(left, top, left+400, top-300); 924 LLRect rect(left, top, left+400, top-300);
926 925
927 gViewerWindow->alertXmlEditText("KickAllUsers", LLStringUtil::format_map_t(), 926 LLNotifications::instance().add("KickAllUsers", LLSD(), LLSD(), LLPanelGridTools::confirmKick);
928 NULL, NULL,
929 LLPanelGridTools::confirmKick, self);
930} 927}
931 928
932 929
933void LLPanelGridTools::confirmKick(S32 option, const std::string& text, void* userdata) 930bool LLPanelGridTools::confirmKick(const LLSD& notification, const LLSD& response)
934{ 931{
935 LLPanelGridTools* self = (LLPanelGridTools*) userdata; 932 if (LLNotification::getSelectedOption(notification, response) == 0)
936
937 if (option == 0)
938 { 933 {
939 self->mKickMessage = text; 934 LLSD payload;
940 gViewerWindow->alertXml("ConfirmKick",LLPanelGridTools::finishKick, self); 935 payload["kick_message"] = response["message"].asString();
936 LLNotifications::instance().add("ConfirmKick", LLSD(), payload, LLPanelGridTools::finishKick);
941 } 937 }
938 return false;
942} 939}
943 940
944 941
945// static 942// static
946void LLPanelGridTools::finishKick(S32 option, void* userdata) 943bool LLPanelGridTools::finishKick(const LLSD& notification, const LLSD& response)
947{ 944{
948 LLPanelGridTools* self = (LLPanelGridTools*) userdata; 945 S32 option = LLNotification::getSelectedOption(notification, response);
946
949 947
950 if (option == 0) 948 if (option == 0)
951 { 949 {
@@ -957,26 +955,24 @@ void LLPanelGridTools::finishKick(S32 option, void* userdata)
957 msg->addUUIDFast(_PREHASH_GodSessionID, gAgent.getSessionID()); 955 msg->addUUIDFast(_PREHASH_GodSessionID, gAgent.getSessionID());
958 msg->addUUIDFast(_PREHASH_AgentID, LL_UUID_ALL_AGENTS ); 956 msg->addUUIDFast(_PREHASH_AgentID, LL_UUID_ALL_AGENTS );
959 msg->addU32("KickFlags", KICK_FLAGS_DEFAULT ); 957 msg->addU32("KickFlags", KICK_FLAGS_DEFAULT );
960 msg->addStringFast(_PREHASH_Reason, self->mKickMessage ); 958 msg->addStringFast(_PREHASH_Reason, notification["payload"]["kick_message"].asString());
961 gAgent.sendReliableMessage(); 959 gAgent.sendReliableMessage();
962 } 960 }
961 return false;
963} 962}
964 963
965 964
966// static 965// static
967void LLPanelGridTools::onClickFlushMapVisibilityCaches(void* data) 966void LLPanelGridTools::onClickFlushMapVisibilityCaches(void* data)
968{ 967{
969 gViewerWindow->alertXml("FlushMapVisibilityCaches", 968 LLNotifications::instance().add("FlushMapVisibilityCaches", LLSD(), LLSD(), flushMapVisibilityCachesConfirm);
970 flushMapVisibilityCachesConfirm, data);
971} 969}
972 970
973// static 971// static
974void LLPanelGridTools::flushMapVisibilityCachesConfirm(S32 option, void* data) 972bool LLPanelGridTools::flushMapVisibilityCachesConfirm(const LLSD& notification, const LLSD& response)
975{ 973{
976 if (option != 0) return; 974 S32 option = LLNotification::getSelectedOption(notification, response);
977 975 if (option != 0) return false;
978 LLPanelGridTools* self = (LLPanelGridTools*)data;
979 if (!self) return;
980 976
981 // HACK: Send this as an EstateOwnerRequest so it gets routed 977 // HACK: Send this as an EstateOwnerRequest so it gets routed
982 // correctly by the spaceserver. JC 978 // correctly by the spaceserver. JC
@@ -992,6 +988,7 @@ void LLPanelGridTools::flushMapVisibilityCachesConfirm(S32 option, void* data)
992 msg->nextBlock("ParamList"); 988 msg->nextBlock("ParamList");
993 msg->addString("Parameter", gAgent.getID().asString()); 989 msg->addString("Parameter", gAgent.getID().asString());
994 gAgent.sendReliableMessage(); 990 gAgent.sendReliableMessage();
991 return false;
995} 992}
996 993
997 994
@@ -1182,13 +1179,16 @@ void LLPanelObjectTools::onClickDeletePublicOwnedBy(void* userdata)
1182 panelp->mSimWideDeletesFlags = 1179 panelp->mSimWideDeletesFlags =
1183 SWD_SCRIPTED_ONLY | SWD_OTHERS_LAND_ONLY; 1180 SWD_SCRIPTED_ONLY | SWD_OTHERS_LAND_ONLY;
1184 1181
1185 LLStringUtil::format_map_t args; 1182 LLSD args;
1186 args["[AVATAR_NAME]"] = panelp->childGetValue("target_avatar_name").asString(); 1183 args["AVATAR_NAME"] = panelp->childGetValue("target_avatar_name").asString();
1184 LLSD payload;
1185 payload["avatar_id"] = panelp->mTargetAvatar;
1186 payload["flags"] = (S32)panelp->mSimWideDeletesFlags;
1187 1187
1188 gViewerWindow->alertXml( "GodDeleteAllScriptedPublicObjectsByUser", 1188 LLNotifications::instance().add( "GodDeleteAllScriptedPublicObjectsByUser",
1189 args, 1189 args,
1190 callbackSimWideDeletes, 1190 payload,
1191 userdata); 1191 callbackSimWideDeletes);
1192 } 1192 }
1193} 1193}
1194 1194
@@ -1201,13 +1201,16 @@ void LLPanelObjectTools::onClickDeleteAllScriptedOwnedBy(void* userdata)
1201 { 1201 {
1202 panelp->mSimWideDeletesFlags = SWD_SCRIPTED_ONLY; 1202 panelp->mSimWideDeletesFlags = SWD_SCRIPTED_ONLY;
1203 1203
1204 LLStringUtil::format_map_t args; 1204 LLSD args;
1205 args["[AVATAR_NAME]"] = panelp->childGetValue("target_avatar_name").asString(); 1205 args["AVATAR_NAME"] = panelp->childGetValue("target_avatar_name").asString();
1206 LLSD payload;
1207 payload["avatar_id"] = panelp->mTargetAvatar;
1208 payload["flags"] = (S32)panelp->mSimWideDeletesFlags;
1206 1209
1207 gViewerWindow->alertXml( "GodDeleteAllScriptedObjectsByUser", 1210 LLNotifications::instance().add( "GodDeleteAllScriptedObjectsByUser",
1208 args, 1211 args,
1209 callbackSimWideDeletes, 1212 payload,
1210 userdata); 1213 callbackSimWideDeletes);
1211 } 1214 }
1212} 1215}
1213 1216
@@ -1220,28 +1223,32 @@ void LLPanelObjectTools::onClickDeleteAllOwnedBy(void* userdata)
1220 { 1223 {
1221 panelp->mSimWideDeletesFlags = 0; 1224 panelp->mSimWideDeletesFlags = 0;
1222 1225
1223 LLStringUtil::format_map_t args; 1226 LLSD args;
1224 args["[AVATAR_NAME]"] = panelp->childGetValue("target_avatar_name").asString(); 1227 args["AVATAR_NAME"] = panelp->childGetValue("target_avatar_name").asString();
1228 LLSD payload;
1229 payload["avatar_id"] = panelp->mTargetAvatar;
1230 payload["flags"] = (S32)panelp->mSimWideDeletesFlags;
1225 1231
1226 gViewerWindow->alertXml( "GodDeleteAllObjectsByUser", 1232 LLNotifications::instance().add( "GodDeleteAllObjectsByUser",
1227 args, 1233 args,
1228 callbackSimWideDeletes, 1234 payload,
1229 userdata); 1235 callbackSimWideDeletes);
1230 } 1236 }
1231} 1237}
1232 1238
1233// static 1239// static
1234void LLPanelObjectTools::callbackSimWideDeletes( S32 option, void* userdata ) 1240bool LLPanelObjectTools::callbackSimWideDeletes( const LLSD& notification, const LLSD& response )
1235{ 1241{
1242 S32 option = LLNotification::getSelectedOption(notification, response);
1236 if (option == 0) 1243 if (option == 0)
1237 { 1244 {
1238 LLPanelObjectTools* object_tools = (LLPanelObjectTools*) userdata; 1245 if (!notification["payload"]["avatar_id"].asUUID().isNull())
1239 if (!object_tools->mTargetAvatar.isNull())
1240 { 1246 {
1241 send_sim_wide_deletes(object_tools->mTargetAvatar, 1247 send_sim_wide_deletes(notification["payload"]["avatar_id"].asUUID(),
1242 object_tools->mSimWideDeletesFlags); 1248 notification["payload"]["flags"].asInteger());
1243 } 1249 }
1244 } 1250 }
1251 return false;
1245} 1252}
1246 1253
1247void LLPanelObjectTools::onClickSet(void* data) 1254void LLPanelObjectTools::onClickSet(void* data)
@@ -1344,8 +1351,8 @@ void LLPanelRequestTools::refresh()
1344 list->operateOnAll(LLCtrlListInterface::OP_DELETE); 1351 list->operateOnAll(LLCtrlListInterface::OP_DELETE);
1345 list->addSimpleElement(SELECTION); 1352 list->addSimpleElement(SELECTION);
1346 list->addSimpleElement(AGENT_REGION); 1353 list->addSimpleElement(AGENT_REGION);
1347 for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->mActiveRegionList.begin(); 1354 for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
1348 iter != LLWorld::getInstance()->mActiveRegionList.end(); ++iter) 1355 iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
1349 { 1356 {
1350 LLViewerRegion* regionp = *iter; 1357 LLViewerRegion* regionp = *iter;
1351 std::string name = regionp->getName(); 1358 std::string name = regionp->getName();
@@ -1405,8 +1412,8 @@ void LLPanelRequestTools::onClickRequest(void* data)
1405 else 1412 else
1406 { 1413 {
1407 // find region by name 1414 // find region by name
1408 for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->mActiveRegionList.begin(); 1415 for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
1409 iter != LLWorld::getInstance()->mActiveRegionList.end(); ++iter) 1416 iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
1410 { 1417 {
1411 LLViewerRegion* regionp = *iter; 1418 LLViewerRegion* regionp = *iter;
1412 if(dest == regionp->getName()) 1419 if(dest == regionp->getName())
@@ -1420,7 +1427,7 @@ void LLPanelRequestTools::onClickRequest(void* data)
1420 1427
1421void terrain_download_done(void** data, S32 status, LLExtStat ext_status) 1428void terrain_download_done(void** data, S32 status, LLExtStat ext_status)
1422{ 1429{
1423 LLNotifyBox::showXml("TerrainDownloaded"); 1430 LLNotifications::instance().add("TerrainDownloaded");
1424} 1431}
1425 1432
1426 1433