aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterregioninfo.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/llfloaterregioninfo.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/llfloaterregioninfo.cpp537
1 files changed, 309 insertions, 228 deletions
diff --git a/linden/indra/newview/llfloaterregioninfo.cpp b/linden/indra/newview/llfloaterregioninfo.cpp
index 6e0dba1..d7b7c9c 100644
--- a/linden/indra/newview/llfloaterregioninfo.cpp
+++ b/linden/indra/newview/llfloaterregioninfo.cpp
@@ -18,7 +18,8 @@
18 * There are special exceptions to the terms and conditions of the GPL as 18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception 19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or 20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 * 23 *
23 * By copying, modifying or distributing this software, you acknowledge 24 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above, 25 * that you have read and understood your obligations described above,
@@ -59,6 +60,7 @@
59#include "llfloatergroups.h" 60#include "llfloatergroups.h"
60#include "llfloatertelehub.h" 61#include "llfloatertelehub.h"
61#include "llfloaterwindlight.h" 62#include "llfloaterwindlight.h"
63#include "llinventorymodel.h"
62#include "lllineeditor.h" 64#include "lllineeditor.h"
63#include "llalertdialog.h" 65#include "llalertdialog.h"
64#include "llnamelistctrl.h" 66#include "llnamelistctrl.h"
@@ -68,6 +70,7 @@
68#include "lltextbox.h" 70#include "lltextbox.h"
69#include "llinventory.h" 71#include "llinventory.h"
70#include "lltexturectrl.h" 72#include "lltexturectrl.h"
73#include "lltrans.h"
71#include "llviewercontrol.h" 74#include "llviewercontrol.h"
72#include "lluictrlfactory.h" 75#include "lluictrlfactory.h"
73#include "llviewerimage.h" 76#include "llviewerimage.h"
@@ -127,9 +130,12 @@ void unpack_request_params(
127 // LLUUID in compressed form which may have embedded \0's,) 130 // LLUUID in compressed form which may have embedded \0's,)
128 str_buf[0] = '\0'; 131 str_buf[0] = '\0';
129 S32 data_size = msg->getSizeFast(_PREHASH_StringData, i, _PREHASH_SParam); 132 S32 data_size = msg->getSizeFast(_PREHASH_StringData, i, _PREHASH_SParam);
130 msg->getBinaryDataFast(_PREHASH_StringData, _PREHASH_SParam, 133 if (data_size >= 0)
131 str_buf, data_size, i, MAX_STRING - 1); 134 {
132 strings.push_back(std::string(str_buf, data_size)); 135 msg->getBinaryDataFast(_PREHASH_StringData, _PREHASH_SParam,
136 str_buf, data_size, i, MAX_STRING - 1);
137 strings.push_back(std::string(str_buf, data_size));
138 }
133 } 139 }
134 140
135 U32 int_buf; 141 U32 int_buf;
@@ -293,6 +299,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
293 299
294 // extract message 300 // extract message
295 std::string sim_name; 301 std::string sim_name;
302 std::string sim_type = LLTrans::getString("land_type_unknown");
296 U32 region_flags; 303 U32 region_flags;
297 U8 agent_limit; 304 U8 agent_limit;
298 F32 object_bonus_factor; 305 F32 object_bonus_factor;
@@ -313,10 +320,18 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
313 msg->getBOOL("RegionInfo", "UseEstateSun", use_estate_sun); 320 msg->getBOOL("RegionInfo", "UseEstateSun", use_estate_sun);
314 // actually the "last set" sun hour, not the current sun hour. JC 321 // actually the "last set" sun hour, not the current sun hour. JC
315 msg->getF32("RegionInfo", "SunHour", sun_hour); 322 msg->getF32("RegionInfo", "SunHour", sun_hour);
323 // the only reasonable way to decide if we actually have any data is to
324 // check to see if any of these fields have nonzero sizes
325 if (msg->getSize("RegionInfo2", "ProductSKU") > 0 ||
326 msg->getSize("RegionInfo2", "ProductName") > 0)
327 {
328 msg->getString("RegionInfo2", "ProductName", sim_type);
329 }
316 330
317 // GENERAL PANEL 331 // GENERAL PANEL
318 panel = tab->getChild<LLPanel>("General"); 332 panel = tab->getChild<LLPanel>("General");
319 panel->childSetValue("region_text", LLSD(sim_name)); 333 panel->childSetValue("region_text", LLSD(sim_name));
334 panel->childSetValue("region_type", LLSD(sim_type));
320 panel->childSetValue("version_channel_text", gLastVersionChannel); 335 panel->childSetValue("version_channel_text", gLastVersionChannel);
321 336
322 panel->childSetValue("block_terraform_check", (region_flags & REGION_FLAGS_BLOCK_TERRAFORM) ? TRUE : FALSE ); 337 panel->childSetValue("block_terraform_check", (region_flags & REGION_FLAGS_BLOCK_TERRAFORM) ? TRUE : FALSE );
@@ -328,7 +343,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
328 panel->childSetValue("block_parcel_search_check", (region_flags & REGION_FLAGS_BLOCK_PARCEL_SEARCH) ? TRUE : FALSE ); 343 panel->childSetValue("block_parcel_search_check", (region_flags & REGION_FLAGS_BLOCK_PARCEL_SEARCH) ? TRUE : FALSE );
329 panel->childSetValue("agent_limit_spin", LLSD((F32)agent_limit) ); 344 panel->childSetValue("agent_limit_spin", LLSD((F32)agent_limit) );
330 panel->childSetValue("object_bonus_spin", LLSD(object_bonus_factor) ); 345 panel->childSetValue("object_bonus_spin", LLSD(object_bonus_factor) );
331 panel->childSetValue("access_combo", LLSD(LLViewerRegion::accessToString(sim_access)) ); 346 panel->childSetValue("access_combo", LLSD(sim_access) );
332 347
333 348
334 // detect teen grid for maturity 349 // detect teen grid for maturity
@@ -540,8 +555,8 @@ void LLPanelRegionInfo::initHelpBtn(const std::string& name, const std::string&
540// static 555// static
541void LLPanelRegionInfo::onClickHelp(void* data) 556void LLPanelRegionInfo::onClickHelp(void* data)
542{ 557{
543 const std::string* xml_alert = (std::string*)data; 558 std::string* xml_alert = (std::string*)data;
544 gViewerWindow->alertXml(*xml_alert); 559 LLNotifications::instance().add(*xml_alert);
545} 560}
546 561
547///////////////////////////////////////////////////////////////////////////// 562/////////////////////////////////////////////////////////////////////////////
@@ -638,16 +653,17 @@ void LLPanelRegionGeneralInfo::onKickCommit(const std::vector<std::string>& name
638void LLPanelRegionGeneralInfo::onClickKickAll(void* userdata) 653void LLPanelRegionGeneralInfo::onClickKickAll(void* userdata)
639{ 654{
640 llinfos << "LLPanelRegionGeneralInfo::onClickKickAll" << llendl; 655 llinfos << "LLPanelRegionGeneralInfo::onClickKickAll" << llendl;
641 gViewerWindow->alertXml("KickUsersFromRegion", onKickAllCommit, userdata); 656 LLNotifications::instance().add("KickUsersFromRegion",
657 LLSD(),
658 LLSD(),
659 boost::bind(&LLPanelRegionGeneralInfo::onKickAllCommit, (LLPanelRegionGeneralInfo*)userdata, _1, _2));
642} 660}
643 661
644// static 662bool LLPanelRegionGeneralInfo::onKickAllCommit(const LLSD& notification, const LLSD& response)
645void LLPanelRegionGeneralInfo::onKickAllCommit(S32 option, void* userdata)
646{ 663{
664 S32 option = LLNotification::getSelectedOption(notification, response);
647 if (option == 0) 665 if (option == 0)
648 { 666 {
649 LLPanelRegionGeneralInfo* self = (LLPanelRegionGeneralInfo*)userdata;
650 if(!self) return;
651 strings_t strings; 667 strings_t strings;
652 // [0] = our agent id 668 // [0] = our agent id
653 std::string buffer; 669 std::string buffer;
@@ -656,26 +672,29 @@ void LLPanelRegionGeneralInfo::onKickAllCommit(S32 option, void* userdata)
656 672
657 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 673 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
658 // historical message name 674 // historical message name
659 self->sendEstateOwnerMessage(gMessageSystem, "teleporthomeallusers", invoice, strings); 675 sendEstateOwnerMessage(gMessageSystem, "teleporthomeallusers", invoice, strings);
660 } 676 }
677 return false;
661} 678}
662 679
663// static 680// static
664void LLPanelRegionGeneralInfo::onClickMessage(void* userdata) 681void LLPanelRegionGeneralInfo::onClickMessage(void* userdata)
665{ 682{
666 llinfos << "LLPanelRegionGeneralInfo::onClickMessage" << llendl; 683 llinfos << "LLPanelRegionGeneralInfo::onClickMessage" << llendl;
667 gViewerWindow->alertXmlEditText("MessageRegion", LLStringUtil::format_map_t(), 684 LLNotifications::instance().add("MessageRegion",
668 NULL, NULL, 685 LLSD(),
669 onMessageCommit, userdata); 686 LLSD(),
687 boost::bind(&LLPanelRegionGeneralInfo::onMessageCommit, (LLPanelRegionGeneralInfo*)userdata, _1, _2));
670} 688}
671 689
672// static 690// static
673void LLPanelRegionGeneralInfo::onMessageCommit(S32 option, const std::string& text, void* userdata) 691bool LLPanelRegionGeneralInfo::onMessageCommit(const LLSD& notification, const LLSD& response)
674{ 692{
675 if(option != 0) return; 693 if(LLNotification::getSelectedOption(notification, response) != 0) return false;
676 if(text.empty()) return; 694
677 LLPanelRegionGeneralInfo* self = (LLPanelRegionGeneralInfo*)userdata; 695 std::string text = response["message"].asString();
678 if(!self) return; 696 if (text.empty()) return false;
697
679 llinfos << "Message to everyone: " << text << llendl; 698 llinfos << "Message to everyone: " << text << llendl;
680 strings_t strings; 699 strings_t strings;
681 // [0] grid_x, unused here 700 // [0] grid_x, unused here
@@ -693,7 +712,8 @@ void LLPanelRegionGeneralInfo::onMessageCommit(S32 option, const std::string& te
693 strings.push_back(strings_t::value_type(name)); 712 strings.push_back(strings_t::value_type(name));
694 strings.push_back(strings_t::value_type(text)); 713 strings.push_back(strings_t::value_type(text));
695 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 714 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
696 self->sendEstateOwnerMessage(gMessageSystem, "simulatormessage", invoice, strings); 715 sendEstateOwnerMessage(gMessageSystem, "simulatormessage", invoice, strings);
716 return false;
697} 717}
698 718
699// static 719// static
@@ -711,7 +731,7 @@ void LLPanelRegionGeneralInfo::onClickManageTelehub(void* data)
711// strings[3] = 'Y' - allow land sale, 'N' - not 731// strings[3] = 'Y' - allow land sale, 'N' - not
712// strings[4] = agent limit 732// strings[4] = agent limit
713// strings[5] = object bonus 733// strings[5] = object bonus
714// strings[6] = sim access (0 = unknown, 13 = PG, 21 = Mature) 734// strings[6] = sim access (0 = unknown, 13 = PG, 21 = Mature, 42 = Adult)
715// strings[7] = restrict pushobject 735// strings[7] = restrict pushobject
716// strings[8] = 'Y' - allow parcel subdivide, 'N' - not 736// strings[8] = 'Y' - allow parcel subdivide, 'N' - not
717// strings[9] = 'Y' - block parcel search, 'N' - allow 737// strings[9] = 'Y' - block parcel search, 'N' - allow
@@ -730,9 +750,7 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate()
730 body["allow_land_resell"] = childGetValue("allow_land_resell_check"); 750 body["allow_land_resell"] = childGetValue("allow_land_resell_check");
731 body["agent_limit"] = childGetValue("agent_limit_spin"); 751 body["agent_limit"] = childGetValue("agent_limit_spin");
732 body["prim_bonus"] = childGetValue("object_bonus_spin"); 752 body["prim_bonus"] = childGetValue("object_bonus_spin");
733 // the combo box stores strings "Mature" and "PG", but we have to convert back to a number, 753 body["sim_access"] = childGetValue("access_combo");
734 // because the sim doesn't know from strings for this stuff
735 body["sim_access"] = LLViewerRegion::stringToAccess(childGetValue("access_combo").asString());
736 body["restrict_pushobject"] = childGetValue("restrict_pushobject"); 754 body["restrict_pushobject"] = childGetValue("restrict_pushobject");
737 body["allow_parcel_changes"] = childGetValue("allow_parcel_changes_check"); 755 body["allow_parcel_changes"] = childGetValue("allow_parcel_changes_check");
738 body["block_parcel_search"] = childGetValue("block_parcel_search_check"); 756 body["block_parcel_search"] = childGetValue("block_parcel_search_check");
@@ -764,8 +782,7 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate()
764 buffer = llformat("%f", value); 782 buffer = llformat("%f", value);
765 strings.push_back(strings_t::value_type(buffer)); 783 strings.push_back(strings_t::value_type(buffer));
766 784
767 U8 access = LLViewerRegion::stringToAccess(childGetValue("access_combo").asString()); 785 buffer = llformat("%d", childGetValue("access_combo").asInteger());
768 buffer = llformat("%d", (S32)access);
769 strings.push_back(strings_t::value_type(buffer)); 786 strings.push_back(strings_t::value_type(buffer));
770 787
771 buffer = llformat("%s", (childGetValue("restrict_pushobject").asBoolean() ? "Y" : "N")); 788 buffer = llformat("%s", (childGetValue("restrict_pushobject").asBoolean() ? "Y" : "N"));
@@ -776,17 +793,14 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate()
776 793
777 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 794 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
778 sendEstateOwnerMessage(gMessageSystem, "setregioninfo", invoice, strings); 795 sendEstateOwnerMessage(gMessageSystem, "setregioninfo", invoice, strings);
779
780 LLViewerRegion* region = gAgent.getRegion();
781 if (region && access != region->getSimAccess() )
782 {
783 gViewerWindow->alertXml("RegionMaturityChange");
784 }
785 } 796 }
786 797
787 798 // if we changed access levels, tell user about it
788 //integers_t integers; 799 LLViewerRegion* region = gAgent.getRegion();
789 800 if (region && (childGetValue("access_combo").asInteger() != region->getSimAccess()) )
801 {
802 LLNotifications::instance().add("RegionMaturityChange");
803 }
790 804
791 return TRUE; 805 return TRUE;
792} 806}
@@ -881,48 +895,56 @@ void LLPanelRegionDebugInfo::onClickReturn(void* data)
881 LLPanelRegionDebugInfo* panelp = (LLPanelRegionDebugInfo*) data; 895 LLPanelRegionDebugInfo* panelp = (LLPanelRegionDebugInfo*) data;
882 if (panelp->mTargetAvatar.isNull()) return; 896 if (panelp->mTargetAvatar.isNull()) return;
883 897
884 LLStringUtil::format_map_t args; 898 LLSD args;
885 args["[USER_NAME]"] = panelp->childGetValue("target_avatar_name").asString(); 899 args["USER_NAME"] = panelp->childGetValue("target_avatar_name").asString();
886 gViewerWindow->alertXml("EstateObjectReturn", args, callbackReturn, data); 900 LLSD payload;
901 payload["avatar_id"] = panelp->mTargetAvatar;
902
903 U32 flags = SWD_ALWAYS_RETURN_OBJECTS;
904
905 if (panelp->childGetValue("return_scripts").asBoolean())
906 {
907 flags |= SWD_SCRIPTED_ONLY;
908 }
909
910 if (panelp->childGetValue("return_other_land").asBoolean())
911 {
912 flags |= SWD_OTHERS_LAND_ONLY;
913 }
914 payload["flags"] = int(flags);
915 payload["return_estate_wide"] = panelp->childGetValue("return_estate_wide").asBoolean();
916 LLNotifications::instance().add("EstateObjectReturn", args, payload,
917 boost::bind(&LLPanelRegionDebugInfo::callbackReturn, panelp, _1, _2));
887} 918}
888 919
889// static 920bool LLPanelRegionDebugInfo::callbackReturn(const LLSD& notification, const LLSD& response)
890void LLPanelRegionDebugInfo::callbackReturn( S32 option, void* userdata )
891{ 921{
892 if (option != 0) return; 922 S32 option = LLNotification::getSelectedOption(notification, response);
923 if (option != 0) return false;
893 924
894 LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*) userdata; 925 LLUUID target_avatar = notification["payload"]["avatar_id"].asUUID();
895 if (!self->mTargetAvatar.isNull()) 926 if (!target_avatar.isNull())
896 { 927 {
897 U32 flags = SWD_ALWAYS_RETURN_OBJECTS; 928 U32 flags = notification["payload"]["flags"].asInteger();
898 929 bool return_estate_wide = notification["payload"]["return_estate_wide"];
899 if (self->childGetValue("return_scripts").asBoolean()) 930 if (return_estate_wide)
900 {
901 flags |= SWD_SCRIPTED_ONLY;
902 }
903
904 if (self->childGetValue("return_other_land").asBoolean())
905 {
906 flags |= SWD_OTHERS_LAND_ONLY;
907 }
908
909 if (self->childGetValue("return_estate_wide").asBoolean())
910 { 931 {
911 // send as estate message - routed by spaceserver to all regions in estate 932 // send as estate message - routed by spaceserver to all regions in estate
912 strings_t strings; 933 strings_t strings;
913 strings.push_back(llformat("%d", flags)); 934 strings.push_back(llformat("%d", flags));
914 strings.push_back(self->mTargetAvatar.asString()); 935 strings.push_back(target_avatar.asString());
915 936
916 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 937 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
917 938
918 self->sendEstateOwnerMessage(gMessageSystem, "estateobjectreturn", invoice, strings); 939 sendEstateOwnerMessage(gMessageSystem, "estateobjectreturn", invoice, strings);
919 } 940 }
920 else 941 else
921 { 942 {
922 // send to this simulator only 943 // send to this simulator only
923 send_sim_wide_deletes(self->mTargetAvatar, flags); 944 send_sim_wide_deletes(target_avatar, flags);
924 } 945 }
925 } 946 }
947 return false;
926} 948}
927 949
928 950
@@ -953,19 +975,20 @@ void LLPanelRegionDebugInfo::onClickTopScripts(void* data)
953// static 975// static
954void LLPanelRegionDebugInfo::onClickRestart(void* data) 976void LLPanelRegionDebugInfo::onClickRestart(void* data)
955{ 977{
956 gViewerWindow->alertXml("ConfirmRestart", callbackRestart, data); 978 LLNotifications::instance().add("ConfirmRestart", LLSD(), LLSD(),
979 boost::bind(&LLPanelRegionDebugInfo::callbackRestart, (LLPanelRegionDebugInfo*)data, _1, _2));
957} 980}
958 981
959// static 982bool LLPanelRegionDebugInfo::callbackRestart(const LLSD& notification, const LLSD& response)
960void LLPanelRegionDebugInfo::callbackRestart(S32 option, void* data)
961{ 983{
962 if (option != 0) return; 984 S32 option = LLNotification::getSelectedOption(notification, response);
985 if (option != 0) return false;
963 986
964 LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*)data;
965 strings_t strings; 987 strings_t strings;
966 strings.push_back("120"); 988 strings.push_back("120");
967 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 989 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
968 self->sendEstateOwnerMessage(gMessageSystem, "restart", invoice, strings); 990 sendEstateOwnerMessage(gMessageSystem, "restart", invoice, strings);
991 return false;
969} 992}
970 993
971// static 994// static
@@ -1123,21 +1146,21 @@ BOOL LLPanelRegionTextureInfo::validateTextureSizes()
1123 1146
1124 if (components != 3) 1147 if (components != 3)
1125 { 1148 {
1126 LLStringUtil::format_map_t args; 1149 LLSD args;
1127 args["[TEXTURE_NUM]"] = llformat("%d",i+1); 1150 args["TEXTURE_NUM"] = i+1;
1128 args["[TEXTURE_BIT_DEPTH]"] = llformat("%d",components * 8); 1151 args["TEXTURE_BIT_DEPTH"] = llformat("%d",components * 8);
1129 gViewerWindow->alertXml("InvalidTerrainBitDepth", args); 1152 LLNotifications::instance().add("InvalidTerrainBitDepth", args);
1130 return FALSE; 1153 return FALSE;
1131 } 1154 }
1132 1155
1133 if (width > 512 || height > 512) 1156 if (width > 512 || height > 512)
1134 { 1157 {
1135 1158
1136 LLStringUtil::format_map_t args; 1159 LLSD args;
1137 args["[TEXTURE_NUM]"] = llformat("%d",i+1); 1160 args["TEXTURE_NUM"] = i+1;
1138 args["[TEXTURE_SIZE_X]"] = llformat("%d",width); 1161 args["TEXTURE_SIZE_X"] = width;
1139 args["[TEXTURE_SIZE_Y]"] = llformat("%d",height); 1162 args["TEXTURE_SIZE_Y"] = height;
1140 gViewerWindow->alertXml("InvalidTerrainSize", args); 1163 LLNotifications::instance().add("InvalidTerrainSize", args);
1141 return FALSE; 1164 return FALSE;
1142 1165
1143 } 1166 }
@@ -1334,26 +1357,27 @@ void LLPanelRegionTerrainInfo::onClickUploadRaw(void* data)
1334 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 1357 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1335 self->sendEstateOwnerMessage(gMessageSystem, "terrain", invoice, strings); 1358 self->sendEstateOwnerMessage(gMessageSystem, "terrain", invoice, strings);
1336 1359
1337 gViewerWindow->alertXml("RawUploadStarted"); 1360 LLNotifications::instance().add("RawUploadStarted");
1338} 1361}
1339 1362
1340// static 1363// static
1341void LLPanelRegionTerrainInfo::onClickBakeTerrain(void* data) 1364void LLPanelRegionTerrainInfo::onClickBakeTerrain(void* data)
1342{ 1365{
1343 gViewerWindow->alertXml("ConfirmBakeTerrain", 1366 LLNotifications::instance().add(
1344 callbackBakeTerrain, data); 1367 LLNotification::Params("ConfirmBakeTerrain")
1368 .functor(boost::bind(&LLPanelRegionTerrainInfo::callbackBakeTerrain, (LLPanelRegionTerrainInfo*)data, _1, _2)));
1345} 1369}
1346 1370
1347// static 1371bool LLPanelRegionTerrainInfo::callbackBakeTerrain(const LLSD& notification, const LLSD& response)
1348void LLPanelRegionTerrainInfo::callbackBakeTerrain(S32 option, void* data)
1349{ 1372{
1350 if (option != 0) return; 1373 S32 option = LLNotification::getSelectedOption(notification, response);
1374 if (option != 0) return false;
1351 1375
1352 LLPanelRegionTerrainInfo* self = (LLPanelRegionTerrainInfo*)data;
1353 strings_t strings; 1376 strings_t strings;
1354 strings.push_back("bake"); 1377 strings.push_back("bake");
1355 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 1378 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1356 self->sendEstateOwnerMessage(gMessageSystem, "terrain", invoice, strings); 1379 sendEstateOwnerMessage(gMessageSystem, "terrain", invoice, strings);
1380 return false;
1357} 1381}
1358 1382
1359///////////////////////////////////////////////////////////////////////////// 1383/////////////////////////////////////////////////////////////////////////////
@@ -1440,9 +1464,9 @@ void LLPanelEstateInfo::onClickAddAllowedAgent(void* user_data)
1440 { 1464 {
1441 //args 1465 //args
1442 1466
1443 LLStringUtil::format_map_t args; 1467 LLSD args;
1444 args["[MAX_AGENTS]"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); 1468 args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS);
1445 gViewerWindow->alertXml("MaxAllowedAgentOnRegion", args); 1469 LLNotifications::instance().add("MaxAllowedAgentOnRegion", args);
1446 return; 1470 return;
1447 } 1471 }
1448 accessAddCore(ESTATE_ACCESS_ALLOWED_AGENT_ADD, "EstateAllowedAgentAdd"); 1472 accessAddCore(ESTATE_ACCESS_ALLOWED_AGENT_ADD, "EstateAllowedAgentAdd");
@@ -1462,35 +1486,36 @@ void LLPanelEstateInfo::onClickAddAllowedGroup(void* user_data)
1462 if (!list) return; 1486 if (!list) return;
1463 if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS) 1487 if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS)
1464 { 1488 {
1465 LLStringUtil::format_map_t args; 1489 LLSD args;
1466 args["[MAX_GROUPS]"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); 1490 args["MAX_GROUPS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS);
1467 gViewerWindow->alertXml("MaxAllowedGroupsOnRegion", args); 1491 LLNotifications::instance().add("MaxAllowedGroupsOnRegion", args);
1468 return; 1492 return;
1469 } 1493 }
1494
1495 LLNotification::Params params("ChangeLindenAccess");
1496 params.functor(boost::bind(&LLPanelEstateInfo::addAllowedGroup, self, _1, _2));
1470 if (isLindenEstate()) 1497 if (isLindenEstate())
1471 { 1498 {
1472 gViewerWindow->alertXml("ChangeLindenAccess", addAllowedGroup, user_data); 1499 LLNotifications::instance().add(params);
1473 } 1500 }
1474 else 1501 else
1475 { 1502 {
1476 addAllowedGroup(0, user_data); 1503 LLNotifications::instance().forceResponse(params, 0);
1477 } 1504 }
1478} 1505}
1479 1506
1480// static 1507bool LLPanelEstateInfo::addAllowedGroup(const LLSD& notification, const LLSD& response)
1481void LLPanelEstateInfo::addAllowedGroup(S32 option, void* user_data)
1482{ 1508{
1483 if (option != 0) return; 1509 S32 option = LLNotification::getSelectedOption(notification, response);
1484 1510 if (option != 0) return false;
1485 LLPanelEstateInfo* panelp = (LLPanelEstateInfo*)user_data;
1486 1511
1487 LLFloater* parent_floater = gFloaterView->getParentFloater(panelp); 1512 LLFloater* parent_floater = gFloaterView->getParentFloater(this);
1488 1513
1489 LLFloaterGroupPicker* widget; 1514 LLFloaterGroupPicker* widget;
1490 widget = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID())); 1515 widget = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID()));
1491 if (widget) 1516 if (widget)
1492 { 1517 {
1493 widget->setSelectCallback(addAllowedGroup2, user_data); 1518 widget->setSelectCallback(addAllowedGroup2, NULL);
1494 if (parent_floater) 1519 if (parent_floater)
1495 { 1520 {
1496 LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, widget); 1521 LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, widget);
@@ -1498,6 +1523,8 @@ void LLPanelEstateInfo::addAllowedGroup(S32 option, void* user_data)
1498 parent_floater->addDependentFloater(widget); 1523 parent_floater->addDependentFloater(widget);
1499 } 1524 }
1500 } 1525 }
1526
1527 return false;
1501} 1528}
1502 1529
1503// static 1530// static
@@ -1514,9 +1541,9 @@ void LLPanelEstateInfo::onClickAddBannedAgent(void* user_data)
1514 if (!list) return; 1541 if (!list) return;
1515 if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS) 1542 if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS)
1516 { 1543 {
1517 LLStringUtil::format_map_t args; 1544 LLSD args;
1518 args["[MAX_BANNED]"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); 1545 args["MAX_BANNED"] = llformat("%d",ESTATE_MAX_ACCESS_IDS);
1519 gViewerWindow->alertXml("MaxBannedAgentsOnRegion", args); 1546 LLNotifications::instance().add("MaxBannedAgentsOnRegion", args);
1520 return; 1547 return;
1521 } 1548 }
1522 accessAddCore(ESTATE_ACCESS_BANNED_AGENT_ADD, "EstateBannedAgentAdd"); 1549 accessAddCore(ESTATE_ACCESS_BANNED_AGENT_ADD, "EstateBannedAgentAdd");
@@ -1536,9 +1563,9 @@ void LLPanelEstateInfo::onClickAddEstateManager(void* user_data)
1536 if (!list) return; 1563 if (!list) return;
1537 if (list->getItemCount() >= ESTATE_MAX_MANAGERS) 1564 if (list->getItemCount() >= ESTATE_MAX_MANAGERS)
1538 { // Tell user they can't add more managers 1565 { // Tell user they can't add more managers
1539 LLStringUtil::format_map_t args; 1566 LLSD args;
1540 args["[MAX_MANAGER]"] = llformat("%d",ESTATE_MAX_MANAGERS); 1567 args["MAX_MANAGER"] = llformat("%d",ESTATE_MAX_MANAGERS);
1541 gViewerWindow->alertXml("MaxManagersOnRegion", args); 1568 LLNotifications::instance().add("MaxManagersOnRegion", args);
1542 } 1569 }
1543 else 1570 else
1544 { // Go pick managers to add 1571 { // Go pick managers to add
@@ -1558,7 +1585,6 @@ void LLPanelEstateInfo::onClickRemoveEstateManager(void* user_data)
1558struct LLKickFromEstateInfo 1585struct LLKickFromEstateInfo
1559{ 1586{
1560 LLPanelEstateInfo *mEstatePanelp; 1587 LLPanelEstateInfo *mEstatePanelp;
1561 std::string mDialogName;
1562 LLUUID mAgentID; 1588 LLUUID mAgentID;
1563}; 1589};
1564 1590
@@ -1590,45 +1616,42 @@ void LLPanelEstateInfo::onKickUserCommit(const std::vector<std::string>& names,
1590 //keep track of what user they want to kick and other misc info 1616 //keep track of what user they want to kick and other misc info
1591 LLKickFromEstateInfo *kick_info = new LLKickFromEstateInfo(); 1617 LLKickFromEstateInfo *kick_info = new LLKickFromEstateInfo();
1592 kick_info->mEstatePanelp = self; 1618 kick_info->mEstatePanelp = self;
1593 kick_info->mDialogName = "EstateKickUser";
1594 kick_info->mAgentID = ids[0]; 1619 kick_info->mAgentID = ids[0];
1595 1620
1596 //Bring up a confirmation dialog 1621 //Bring up a confirmation dialog
1597 LLStringUtil::format_map_t args; 1622 LLSD args;
1598 args["[EVIL_USER]"] = names[0]; 1623 args["EVIL_USER"] = names[0];
1599 gViewerWindow->alertXml(kick_info->mDialogName, args, LLPanelEstateInfo::kickUserConfirm, (void*)kick_info); 1624 LLSD payload;
1625 payload["agent_id"] = ids[0];
1626 LLNotifications::instance().add("EstateKickUser", args, payload, boost::bind(&LLPanelEstateInfo::kickUserConfirm, self, _1, _2));
1600 1627
1601} 1628}
1602 1629
1603void LLPanelEstateInfo::kickUserConfirm(S32 option, void* userdata) 1630bool LLPanelEstateInfo::kickUserConfirm(const LLSD& notification, const LLSD& response)
1604{ 1631{
1605 //extract the callback parameter 1632 S32 option = LLNotification::getSelectedOption(notification, response);
1606 LLKickFromEstateInfo *kick_info = (LLKickFromEstateInfo*) userdata;
1607 if (!kick_info) return;
1608
1609 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1610 strings_t strings;
1611 std::string buffer;
1612
1613 switch(option) 1633 switch(option)
1614 { 1634 {
1615 case 0: 1635 case 0:
1616 //Kick User 1636 {
1617 kick_info->mAgentID.toString(buffer); 1637 //Kick User
1618 strings.push_back(buffer); 1638 strings_t strings;
1639 strings.push_back(notification["payload"]["agent_id"].asString());
1619 1640
1620 kick_info->mEstatePanelp->sendEstateOwnerMessage(gMessageSystem, "kickestate", invoice, strings); 1641 sendEstateOwnerMessage(gMessageSystem, "kickestate", LLFloaterRegionInfo::getLastInvoice(), strings);
1621 break; 1642 break;
1643 }
1622 default: 1644 default:
1623 break; 1645 break;
1624 } 1646 }
1625 1647 return false;
1626 delete kick_info;
1627 kick_info = NULL;
1628} 1648}
1629 1649
1630//--------------------------------------------------------------------------- 1650//---------------------------------------------------------------------------
1631// Core Add/Remove estate access methods 1651// Core Add/Remove estate access methods
1652// TODO: INTERNATIONAL: don't build message text here;
1653// instead, create multiple translatable messages and choose
1654// one based on the status.
1632//--------------------------------------------------------------------------- 1655//---------------------------------------------------------------------------
1633std::string all_estates_text() 1656std::string all_estates_text()
1634{ 1657{
@@ -1669,6 +1692,33 @@ bool LLPanelEstateInfo::isLindenEstate()
1669typedef std::vector<LLUUID> AgentOrGroupIDsVector; 1692typedef std::vector<LLUUID> AgentOrGroupIDsVector;
1670struct LLEstateAccessChangeInfo 1693struct LLEstateAccessChangeInfo
1671{ 1694{
1695 LLEstateAccessChangeInfo(const LLSD& sd)
1696 {
1697 mDialogName = sd["dialog_name"].asString();
1698 mOperationFlag = (U32)sd["operation"].asInteger();
1699 LLSD::array_const_iterator end_it = sd["allowed_ids"].endArray();
1700 for (LLSD::array_const_iterator id_it = sd["allowed_ids"].beginArray();
1701 id_it != end_it;
1702 ++id_it)
1703 {
1704 mAgentOrGroupIDs.push_back(id_it->asUUID());
1705 }
1706 }
1707
1708 const LLSD asLLSD() const
1709 {
1710 LLSD sd;
1711 sd["name"] = mDialogName;
1712 sd["operation"] = (S32)mOperationFlag;
1713 for (AgentOrGroupIDsVector::const_iterator it = mAgentOrGroupIDs.begin();
1714 it != mAgentOrGroupIDs.end();
1715 ++it)
1716 {
1717 sd["allowed_ids"].append(*it);
1718 }
1719 return sd;
1720 }
1721
1672 U32 mOperationFlag; // ESTATE_ACCESS_BANNED_AGENT_ADD, _REMOVE, etc. 1722 U32 mOperationFlag; // ESTATE_ACCESS_BANNED_AGENT_ADD, _REMOVE, etc.
1673 std::string mDialogName; 1723 std::string mDialogName;
1674 AgentOrGroupIDsVector mAgentOrGroupIDs; // List of agent IDs to apply to this change 1724 AgentOrGroupIDsVector mAgentOrGroupIDs; // List of agent IDs to apply to this change
@@ -1678,56 +1728,65 @@ struct LLEstateAccessChangeInfo
1678// static 1728// static
1679void LLPanelEstateInfo::addAllowedGroup2(LLUUID id, void* user_data) 1729void LLPanelEstateInfo::addAllowedGroup2(LLUUID id, void* user_data)
1680{ 1730{
1681 LLEstateAccessChangeInfo* change_info = new LLEstateAccessChangeInfo; 1731 LLSD payload;
1682 change_info->mOperationFlag = ESTATE_ACCESS_ALLOWED_GROUP_ADD; 1732 payload["operation"] = (S32)ESTATE_ACCESS_ALLOWED_GROUP_ADD;
1683 change_info->mDialogName = "EstateAllowedGroupAdd"; 1733 payload["dialog_name"] = "EstateAllowedGroupAdd";
1684 change_info->mAgentOrGroupIDs.push_back(id); 1734 payload["allowed_ids"].append(id);
1735
1736 LLSD args;
1737 args["ALL_ESTATES"] = all_estates_text();
1685 1738
1739 LLNotification::Params params("EstateAllowedGroupAdd");
1740 params.payload(payload)
1741 .substitutions(args)
1742 .functor(accessCoreConfirm);
1686 if (isLindenEstate()) 1743 if (isLindenEstate())
1687 { 1744 {
1688 accessCoreConfirm(0, (void*)change_info); 1745 LLNotifications::instance().forceResponse(params, 0);
1689 } 1746 }
1690 else 1747 else
1691 { 1748 {
1692 LLStringUtil::format_map_t args; 1749 LLNotifications::instance().add(params);
1693 args["[ALL_ESTATES]"] = all_estates_text();
1694 gViewerWindow->alertXml(change_info->mDialogName, args, accessCoreConfirm, (void*)change_info);
1695 } 1750 }
1696} 1751}
1697 1752
1698// static 1753// static
1699void LLPanelEstateInfo::accessAddCore(U32 operation_flag, const std::string& dialog_name) 1754void LLPanelEstateInfo::accessAddCore(U32 operation_flag, const std::string& dialog_name)
1700{ 1755{
1701 LLEstateAccessChangeInfo* change_info = new LLEstateAccessChangeInfo; 1756 LLSD payload;
1702 change_info->mOperationFlag = operation_flag; 1757 payload["operation"] = (S32)operation_flag;
1703 change_info->mDialogName = dialog_name; 1758 payload["dialog_name"] = dialog_name;
1704 // agent id filled in after avatar picker 1759 // agent id filled in after avatar picker
1705 1760
1761 LLNotification::Params params("ChangeLindenAccess");
1762 params.payload(payload)
1763 .functor(accessAddCore2);
1764
1706 if (isLindenEstate()) 1765 if (isLindenEstate())
1707 { 1766 {
1708 gViewerWindow->alertXml("ChangeLindenAccess", accessAddCore2, change_info); 1767 LLNotifications::instance().add(params);
1709 } 1768 }
1710 else 1769 else
1711 { 1770 {
1712 // same as clicking "OK" 1771 // same as clicking "OK"
1713 accessAddCore2(0, change_info); 1772 LLNotifications::instance().forceResponse(params, 0);
1714 } 1773 }
1715} 1774}
1716 1775
1717// static 1776// static
1718void LLPanelEstateInfo::accessAddCore2(S32 option, void* data) 1777bool LLPanelEstateInfo::accessAddCore2(const LLSD& notification, const LLSD& response)
1719{ 1778{
1720 LLEstateAccessChangeInfo* change_info = (LLEstateAccessChangeInfo*)data; 1779 S32 option = LLNotification::getSelectedOption(notification, response);
1721 if (option != 0) 1780 if (option != 0)
1722 { 1781 {
1723 // abort change 1782 // abort change
1724 delete change_info; 1783 return false;
1725 change_info = NULL;
1726 return;
1727 } 1784 }
1728 1785
1786 LLEstateAccessChangeInfo* change_info = new LLEstateAccessChangeInfo(notification["payload"]);
1729 // avatar picker yes multi-select, yes close-on-select 1787 // avatar picker yes multi-select, yes close-on-select
1730 LLFloaterAvatarPicker::show(accessAddCore3, (void*)change_info, TRUE, TRUE); 1788 LLFloaterAvatarPicker::show(accessAddCore3, (void*)change_info, TRUE, TRUE);
1789 return false;
1731} 1790}
1732 1791
1733// static 1792// static
@@ -1756,12 +1815,12 @@ void LLPanelEstateInfo::accessAddCore3(const std::vector<std::string>& names, co
1756 int currentCount = (list ? list->getItemCount() : 0); 1815 int currentCount = (list ? list->getItemCount() : 0);
1757 if (ids.size() + currentCount > ESTATE_MAX_ACCESS_IDS) 1816 if (ids.size() + currentCount > ESTATE_MAX_ACCESS_IDS)
1758 { 1817 {
1759 LLStringUtil::format_map_t args; 1818 LLSD args;
1760 args["[NUM_ADDED]"] = llformat("%d",ids.size()); 1819 args["NUM_ADDED"] = llformat("%d",ids.size());
1761 args["[MAX_AGENTS]"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); 1820 args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS);
1762 args["[LIST_TYPE]"] = "Allowed Residents"; 1821 args["LIST_TYPE"] = "Allowed Residents";
1763 args["[NUM_EXCESS]"] = llformat("%d",(ids.size()+currentCount)-ESTATE_MAX_ACCESS_IDS); 1822 args["NUM_EXCESS"] = llformat("%d",(ids.size()+currentCount)-ESTATE_MAX_ACCESS_IDS);
1764 gViewerWindow->alertXml("MaxAgentOnRegionBatch", args); 1823 LLNotifications::instance().add("MaxAgentOnRegionBatch", args);
1765 delete change_info; 1824 delete change_info;
1766 return; 1825 return;
1767 } 1826 }
@@ -1772,28 +1831,34 @@ void LLPanelEstateInfo::accessAddCore3(const std::vector<std::string>& names, co
1772 int currentCount = (list ? list->getItemCount() : 0); 1831 int currentCount = (list ? list->getItemCount() : 0);
1773 if (ids.size() + currentCount > ESTATE_MAX_ACCESS_IDS) 1832 if (ids.size() + currentCount > ESTATE_MAX_ACCESS_IDS)
1774 { 1833 {
1775 LLStringUtil::format_map_t args; 1834 LLSD args;
1776 args["[NUM_ADDED]"] = llformat("%d",ids.size()); 1835 args["NUM_ADDED"] = llformat("%d",ids.size());
1777 args["[MAX_AGENTS]"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); 1836 args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS);
1778 args["[LIST_TYPE]"] = "Banned Residents"; 1837 args["LIST_TYPE"] = "Banned Residents";
1779 args["[NUM_EXCESS]"] = llformat("%d",(ids.size()+currentCount)-ESTATE_MAX_ACCESS_IDS); 1838 args["NUM_EXCESS"] = llformat("%d",(ids.size()+currentCount)-ESTATE_MAX_ACCESS_IDS);
1780 gViewerWindow->alertXml("MaxAgentOnRegionBatch", args); 1839 LLNotifications::instance().add("MaxAgentOnRegionBatch", args);
1781 delete change_info; 1840 delete change_info;
1782 return; 1841 return;
1783 } 1842 }
1784 } 1843 }
1785 1844
1845 LLSD args;
1846 args["ALL_ESTATES"] = all_estates_text();
1847
1848 LLNotification::Params params(change_info->mDialogName);
1849 params.substitutions(args)
1850 .payload(change_info->asLLSD())
1851 .functor(accessCoreConfirm);
1852
1786 if (isLindenEstate()) 1853 if (isLindenEstate())
1787 { 1854 {
1788 // just apply to this estate 1855 // just apply to this estate
1789 accessCoreConfirm(0, (void*)change_info); 1856 LLNotifications::instance().forceResponse(params, 0);
1790 } 1857 }
1791 else 1858 else
1792 { 1859 {
1793 // ask if this estate or all estates with this owner 1860 // ask if this estate or all estates with this owner
1794 LLStringUtil::format_map_t args; 1861 LLNotifications::instance().add(params);
1795 args["[ALL_ESTATES]"] = all_estates_text();
1796 gViewerWindow->alertXml(change_info->mDialogName, args, accessCoreConfirm, (void*)change_info);
1797 } 1862 }
1798} 1863}
1799 1864
@@ -1809,85 +1874,87 @@ void LLPanelEstateInfo::accessRemoveCore(U32 operation_flag, const std::string&
1809 if (list_vector.size() == 0) 1874 if (list_vector.size() == 0)
1810 return; 1875 return;
1811 1876
1812 LLEstateAccessChangeInfo* change_info = new LLEstateAccessChangeInfo; 1877 LLSD payload;
1813 change_info->mOperationFlag = operation_flag; 1878 payload["operation"] = (S32)operation_flag;
1814 change_info->mDialogName = dialog_name; 1879 payload["dialog_name"] = dialog_name;
1815 1880
1816 for (std::vector<LLScrollListItem*>::const_iterator iter = list_vector.begin(); 1881 for (std::vector<LLScrollListItem*>::const_iterator iter = list_vector.begin();
1817 iter != list_vector.end(); 1882 iter != list_vector.end();
1818 iter++) 1883 iter++)
1819 { 1884 {
1820 LLScrollListItem *item = (*iter); 1885 LLScrollListItem *item = (*iter);
1821 change_info->mAgentOrGroupIDs.push_back(item->getUUID()); 1886 payload["allowed_ids"].append(item->getUUID());
1822 } 1887 }
1823 1888
1889 LLNotification::Params params("ChangeLindenAccess");
1890 params.payload(payload)
1891 .functor(accessRemoveCore2);
1892
1824 if (isLindenEstate()) 1893 if (isLindenEstate())
1825 { 1894 {
1826 // warn on change linden estate 1895 // warn on change linden estate
1827 gViewerWindow->alertXml("ChangeLindenAccess", 1896 LLNotifications::instance().add(params);
1828 accessRemoveCore2,
1829 (void*)change_info);
1830 } 1897 }
1831 else 1898 else
1832 { 1899 {
1833 // just proceed, as if clicking OK 1900 // just proceed, as if clicking OK
1834 accessRemoveCore2(0, (void*)change_info); 1901 LLNotifications::instance().forceResponse(params, 0);
1835 } 1902 }
1836} 1903}
1837 1904
1838// static 1905// static
1839void LLPanelEstateInfo::accessRemoveCore2(S32 option, void* data) 1906bool LLPanelEstateInfo::accessRemoveCore2(const LLSD& notification, const LLSD& response)
1840{ 1907{
1841 LLEstateAccessChangeInfo* change_info = (LLEstateAccessChangeInfo*)data; 1908 S32 option = LLNotification::getSelectedOption(notification, response);
1842 if (option != 0) 1909 if (option != 0)
1843 { 1910 {
1844 // abort 1911 // abort
1845 delete change_info; 1912 return false;
1846 change_info = NULL;
1847 return;
1848 } 1913 }
1849 1914
1850 // If Linden estate, can only apply to "this" estate, not all estates 1915 // If Linden estate, can only apply to "this" estate, not all estates
1851 // owned by NULL. 1916 // owned by NULL.
1852 if (isLindenEstate()) 1917 if (isLindenEstate())
1853 { 1918 {
1854 accessCoreConfirm(0, (void*)change_info); 1919 accessCoreConfirm(notification, response);
1855 } 1920 }
1856 else 1921 else
1857 { 1922 {
1858 LLStringUtil::format_map_t args; 1923 LLSD args;
1859 args["[ALL_ESTATES]"] = all_estates_text(); 1924 args["ALL_ESTATES"] = all_estates_text();
1860 gViewerWindow->alertXml(change_info->mDialogName, 1925 LLNotifications::instance().add(notification["payload"]["dialog_name"],
1861 args, 1926 args,
1862 accessCoreConfirm, 1927 notification["payload"],
1863 (void*)change_info); 1928 accessCoreConfirm);
1864 } 1929 }
1930 return false;
1865} 1931}
1866 1932
1867// Used for both access add and remove operations, depending on the mOperationFlag 1933// Used for both access add and remove operations, depending on the mOperationFlag
1868// passed in (ESTATE_ACCESS_BANNED_AGENT_ADD, ESTATE_ACCESS_ALLOWED_AGENT_REMOVE, etc.) 1934// passed in (ESTATE_ACCESS_BANNED_AGENT_ADD, ESTATE_ACCESS_ALLOWED_AGENT_REMOVE, etc.)
1869// static 1935// static
1870void LLPanelEstateInfo::accessCoreConfirm(S32 option, void* data) 1936bool LLPanelEstateInfo::accessCoreConfirm(const LLSD& notification, const LLSD& response)
1871{ 1937{
1872 LLEstateAccessChangeInfo* change_info = (LLEstateAccessChangeInfo*)data; 1938 S32 option = LLNotification::getSelectedOption(notification, response);
1873 const U32 originalFlags = change_info->mOperationFlag; 1939 const U32 originalFlags = (U32)notification["payload"]["operation"].asInteger();
1874 AgentOrGroupIDsVector& ids = change_info->mAgentOrGroupIDs;
1875 1940
1876 LLViewerRegion* region = gAgent.getRegion(); 1941 LLViewerRegion* region = gAgent.getRegion();
1877 1942
1878 for (AgentOrGroupIDsVector::const_iterator iter = ids.begin(); 1943 LLSD::array_const_iterator end_it = notification["payload"]["allowed_ids"].endArray();
1879 iter != ids.end(); 1944
1945 for (LLSD::array_const_iterator iter = notification["payload"]["allowed_ids"].beginArray();
1946 iter != end_it;
1880 iter++) 1947 iter++)
1881 { 1948 {
1882 U32 flags = originalFlags; 1949 U32 flags = originalFlags;
1883 if (iter + 1 != ids.end()) 1950 if (iter + 1 != end_it)
1884 flags |= ESTATE_ACCESS_NO_REPLY; 1951 flags |= ESTATE_ACCESS_NO_REPLY;
1885 1952
1886 const LLUUID id = (*iter); 1953 const LLUUID id = iter->asUUID();
1887 if ((change_info->mOperationFlag & ESTATE_ACCESS_BANNED_AGENT_ADD) 1954 if (((U32)notification["payload"]["operation"].asInteger() & ESTATE_ACCESS_BANNED_AGENT_ADD)
1888 && region && (region->getOwner() == id)) 1955 && region && (region->getOwner() == id))
1889 { 1956 {
1890 gViewerWindow->alertXml("OwnerCanNotBeDenied"); 1957 LLNotifications::instance().add("OwnerCanNotBeDenied");
1891 break; 1958 break;
1892 } 1959 }
1893 switch(option) 1960 switch(option)
@@ -1919,8 +1986,7 @@ void LLPanelEstateInfo::accessCoreConfirm(S32 option, void* data)
1919 break; 1986 break;
1920 } 1987 }
1921 } 1988 }
1922 delete change_info; 1989 return false;
1923 change_info = NULL;
1924} 1990}
1925 1991
1926// key = "estateaccessdelta" 1992// key = "estateaccessdelta"
@@ -2146,34 +2212,34 @@ BOOL LLPanelEstateInfo::sendUpdate()
2146{ 2212{
2147 llinfos << "LLPanelEsateInfo::sendUpdate()" << llendl; 2213 llinfos << "LLPanelEsateInfo::sendUpdate()" << llendl;
2148 2214
2215 LLNotification::Params params("ChangeLindenEstate");
2216 params.functor(boost::bind(&LLPanelEstateInfo::callbackChangeLindenEstate, this, _1, _2));
2217
2149 if (getEstateID() <= ESTATE_LAST_LINDEN) 2218 if (getEstateID() <= ESTATE_LAST_LINDEN)
2150 { 2219 {
2151 // trying to change reserved estate, warn 2220 // trying to change reserved estate, warn
2152 gViewerWindow->alertXml("ChangeLindenEstate", 2221 LLNotifications::instance().add(params);
2153 callbackChangeLindenEstate,
2154 this);
2155 } 2222 }
2156 else 2223 else
2157 { 2224 {
2158 // for normal estates, just make the change 2225 // for normal estates, just make the change
2159 callbackChangeLindenEstate(0, this); 2226 LLNotifications::instance().forceResponse(params, 0);
2160 } 2227 }
2161 return TRUE; 2228 return TRUE;
2162} 2229}
2163 2230
2164// static 2231bool LLPanelEstateInfo::callbackChangeLindenEstate(const LLSD& notification, const LLSD& response)
2165void LLPanelEstateInfo::callbackChangeLindenEstate(S32 option, void* data)
2166{ 2232{
2167 LLPanelEstateInfo* self = (LLPanelEstateInfo*)data; 2233 S32 option = LLNotification::getSelectedOption(notification, response);
2168 switch(option) 2234 switch(option)
2169 { 2235 {
2170 case 0: 2236 case 0:
2171 // send the update 2237 // send the update
2172 if (!self->commitEstateInfoCaps()) 2238 if (!commitEstateInfoCaps())
2173 { 2239 {
2174 // the caps method failed, try the old way 2240 // the caps method failed, try the old way
2175 LLFloaterRegionInfo::nextInvoice(); 2241 LLFloaterRegionInfo::nextInvoice();
2176 self->commitEstateInfoDataserver(); 2242 commitEstateInfoDataserver();
2177 } 2243 }
2178 // we don't want to do this because we'll get it automatically from the sim 2244 // we don't want to do this because we'll get it automatically from the sim
2179 // after the spaceserver processes it 2245 // after the spaceserver processes it
@@ -2188,6 +2254,7 @@ void LLPanelEstateInfo::callbackChangeLindenEstate(S32 option, void* data)
2188 // do nothing 2254 // do nothing
2189 break; 2255 break;
2190 } 2256 }
2257 return false;
2191} 2258}
2192 2259
2193 2260
@@ -2572,18 +2639,15 @@ BOOL LLPanelEstateInfo::checkSunHourSlider(LLUICtrl* child_ctrl)
2572void LLPanelEstateInfo::onClickMessageEstate(void* userdata) 2639void LLPanelEstateInfo::onClickMessageEstate(void* userdata)
2573{ 2640{
2574 llinfos << "LLPanelEstateInfo::onClickMessageEstate" << llendl; 2641 llinfos << "LLPanelEstateInfo::onClickMessageEstate" << llendl;
2575 gViewerWindow->alertXmlEditText("MessageEstate", LLStringUtil::format_map_t(), 2642 LLNotifications::instance().add("MessageEstate", LLSD(), LLSD(), boost::bind(&LLPanelEstateInfo::onMessageCommit, (LLPanelEstateInfo*)userdata, _1, _2));
2576 NULL, NULL,
2577 onMessageCommit, userdata);
2578} 2643}
2579 2644
2580// static 2645bool LLPanelEstateInfo::onMessageCommit(const LLSD& notification, const LLSD& response)
2581void LLPanelEstateInfo::onMessageCommit(S32 option, const std::string& text, void* userdata)
2582{ 2646{
2583 if(option != 0) return; 2647 S32 option = LLNotification::getSelectedOption(notification, response);
2584 if(text.empty()) return; 2648 std::string text = response["message"].asString();
2585 LLPanelEstateInfo* self = (LLPanelEstateInfo*)userdata; 2649 if(option != 0) return false;
2586 if(!self) return; 2650 if(text.empty()) return false;
2587 llinfos << "Message to everyone: " << text << llendl; 2651 llinfos << "Message to everyone: " << text << llendl;
2588 strings_t strings; 2652 strings_t strings;
2589 //integers_t integers; 2653 //integers_t integers;
@@ -2592,7 +2656,8 @@ void LLPanelEstateInfo::onMessageCommit(S32 option, const std::string& text, voi
2592 strings.push_back(strings_t::value_type(name)); 2656 strings.push_back(strings_t::value_type(name));
2593 strings.push_back(strings_t::value_type(text)); 2657 strings.push_back(strings_t::value_type(text));
2594 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 2658 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
2595 self->sendEstateOwnerMessage(gMessageSystem, "instantmessage", invoice, strings); 2659 sendEstateOwnerMessage(gMessageSystem, "instantmessage", invoice, strings);
2660 return false;
2596} 2661}
2597 2662
2598LLPanelEstateCovenant::LLPanelEstateCovenant() 2663LLPanelEstateCovenant::LLPanelEstateCovenant()
@@ -2635,6 +2700,19 @@ bool LLPanelEstateCovenant::refreshFromRegion(LLViewerRegion* region)
2635 } 2700 }
2636 } 2701 }
2637 2702
2703 LLTextBox* region_maturity = getChild<LLTextBox>("region_maturity_text");
2704 if (region_maturity)
2705 {
2706 region_maturity->setText(region->getSimAccessString());
2707 }
2708
2709 LLTextBox* region_landtype = getChild<LLTextBox>("region_landtype_text");
2710 if (region_landtype)
2711 {
2712 region_landtype->setText(region->getSimProductName());
2713 }
2714
2715
2638 // let the parent class handle the general data collection. 2716 // let the parent class handle the general data collection.
2639 bool rv = LLPanelRegionInfo::refreshFromRegion(region); 2717 bool rv = LLPanelRegionInfo::refreshFromRegion(region);
2640 LLMessageSystem *msg = gMessageSystem; 2718 LLMessageSystem *msg = gMessageSystem;
@@ -2695,9 +2773,10 @@ BOOL LLPanelEstateCovenant::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop
2695 *accept = ACCEPT_YES_COPY_SINGLE; 2773 *accept = ACCEPT_YES_COPY_SINGLE;
2696 if (item && drop) 2774 if (item && drop)
2697 { 2775 {
2698 gViewerWindow->alertXml("EstateChangeCovenant", 2776 LLSD payload;
2699 LLPanelEstateCovenant::confirmChangeCovenantCallback, 2777 payload["item_id"] = item->getUUID();
2700 item); 2778 LLNotifications::instance().add("EstateChangeCovenant", LLSD(), payload,
2779 LLPanelEstateCovenant::confirmChangeCovenantCallback);
2701 } 2780 }
2702 break; 2781 break;
2703 default: 2782 default:
@@ -2709,12 +2788,13 @@ BOOL LLPanelEstateCovenant::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop
2709} 2788}
2710 2789
2711// static 2790// static
2712void LLPanelEstateCovenant::confirmChangeCovenantCallback(S32 option, void* userdata) 2791bool LLPanelEstateCovenant::confirmChangeCovenantCallback(const LLSD& notification, const LLSD& response)
2713{ 2792{
2714 LLInventoryItem* item = (LLInventoryItem*)userdata; 2793 S32 option = LLNotification::getSelectedOption(notification, response);
2794 LLInventoryItem* item = gInventory.getItem(notification["payload"]["item_id"].asUUID());
2715 LLPanelEstateCovenant* self = LLFloaterRegionInfo::getPanelCovenant(); 2795 LLPanelEstateCovenant* self = LLFloaterRegionInfo::getPanelCovenant();
2716 2796
2717 if (!item || !self) return; 2797 if (!item || !self) return false;
2718 2798
2719 switch(option) 2799 switch(option)
2720 { 2800 {
@@ -2724,22 +2804,22 @@ void LLPanelEstateCovenant::confirmChangeCovenantCallback(S32 option, void* user
2724 default: 2804 default:
2725 break; 2805 break;
2726 } 2806 }
2807 return false;
2727} 2808}
2728 2809
2729// static 2810// static
2730void LLPanelEstateCovenant::resetCovenantID(void* userdata) 2811void LLPanelEstateCovenant::resetCovenantID(void* userdata)
2731{ 2812{
2732 gViewerWindow->alertXml("EstateChangeCovenant", 2813 LLNotifications::instance().add("EstateChangeCovenant", LLSD(), LLSD(), confirmResetCovenantCallback);
2733 LLPanelEstateCovenant::confirmResetCovenantCallback,
2734 NULL);
2735} 2814}
2736 2815
2737// static 2816// static
2738void LLPanelEstateCovenant::confirmResetCovenantCallback(S32 option, void* userdata) 2817bool LLPanelEstateCovenant::confirmResetCovenantCallback(const LLSD& notification, const LLSD& response)
2739{ 2818{
2740 LLPanelEstateCovenant* self = LLFloaterRegionInfo::getPanelCovenant(); 2819 LLPanelEstateCovenant* self = LLFloaterRegionInfo::getPanelCovenant();
2741 if (!self) return; 2820 if (!self) return false;
2742 2821
2822 S32 option = LLNotification::getSelectedOption(notification, response);
2743 switch(option) 2823 switch(option)
2744 { 2824 {
2745 case 0: 2825 case 0:
@@ -2748,6 +2828,7 @@ void LLPanelEstateCovenant::confirmResetCovenantCallback(S32 option, void* userd
2748 default: 2828 default:
2749 break; 2829 break;
2750 } 2830 }
2831 return false;
2751} 2832}
2752 2833
2753void LLPanelEstateCovenant::loadInvItem(LLInventoryItem *itemp) 2834void LLPanelEstateCovenant::loadInvItem(LLInventoryItem *itemp)
@@ -2808,7 +2889,7 @@ void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs,
2808 if( !panelp->mEditor->importBuffer( buffer, file_length+1 ) ) 2889 if( !panelp->mEditor->importBuffer( buffer, file_length+1 ) )
2809 { 2890 {
2810 llwarns << "Problem importing estate covenant." << llendl; 2891 llwarns << "Problem importing estate covenant." << llendl;
2811 gViewerWindow->alertXml("ProblemImportingEstateCovenant"); 2892 LLNotifications::instance().add("ProblemImportingEstateCovenant");
2812 } 2893 }
2813 else 2894 else
2814 { 2895 {
@@ -2829,15 +2910,15 @@ void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs,
2829 if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || 2910 if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ||
2830 LL_ERR_FILE_EMPTY == status) 2911 LL_ERR_FILE_EMPTY == status)
2831 { 2912 {
2832 gViewerWindow->alertXml("MissingNotecardAssetID"); 2913 LLNotifications::instance().add("MissingNotecardAssetID");
2833 } 2914 }
2834 else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status) 2915 else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status)
2835 { 2916 {
2836 gViewerWindow->alertXml("NotAllowedToViewNotecard"); 2917 LLNotifications::instance().add("NotAllowedToViewNotecard");
2837 } 2918 }
2838 else 2919 else
2839 { 2920 {
2840 gViewerWindow->alertXml("UnableToLoadNotecard"); 2921 LLNotifications::instance().add("UnableToLoadNotecardAsset");
2841 } 2922 }
2842 2923
2843 llwarns << "Problem loading notecard: " << status << llendl; 2924 llwarns << "Problem loading notecard: " << status << llendl;