aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewermenu.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/llviewermenu.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/llviewermenu.cpp666
1 files changed, 332 insertions, 334 deletions
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index 023c758..26a8c02 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -1,3 +1,4 @@
1
1/** 2/**
2 * @file llviewermenu.cpp 3 * @file llviewermenu.cpp
3 * @brief Builds menus out of items. 4 * @brief Builds menus out of items.
@@ -17,7 +18,8 @@
17 * 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
18 * 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
19 * 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
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 23 *
22 * By copying, modifying or distributing this software, you acknowledge 24 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 25 * that you have read and understood your obligations described above,
@@ -100,13 +102,16 @@
100#include "llfloatereditui.h" 102#include "llfloatereditui.h"
101#include "llfloaterchatterbox.h" 103#include "llfloaterchatterbox.h"
102#include "llfloaterfriends.h" 104#include "llfloaterfriends.h"
105#include "llfloaterfonttest.h"
103#include "llfloatergesture.h" 106#include "llfloatergesture.h"
104#include "llfloatergodtools.h" 107#include "llfloatergodtools.h"
105#include "llfloatergroupinfo.h" 108#include "llfloatergroupinfo.h"
106#include "llfloatergroupinvite.h" 109#include "llfloatergroupinvite.h"
107#include "llfloatergroups.h" 110#include "llfloatergroups.h"
108#include "llfloaterhtml.h" 111#include "llfloaterhtml.h"
109#include "llfloaterhtmlhelp.h" 112#include "llfloaterhtmlcurrency.h"
113#include "llfloaterhtmlhelp.h" // gViewerHtmlHelp
114#include "llfloaterhtmlsimple.h"
110#include "llfloaterhud.h" 115#include "llfloaterhud.h"
111#include "llfloaterinspect.h" 116#include "llfloaterinspect.h"
112#include "llfloaterlagmeter.h" 117#include "llfloaterlagmeter.h"
@@ -116,6 +121,7 @@
116#include "llfloatermute.h" 121#include "llfloatermute.h"
117#include "llfloateropenobject.h" 122#include "llfloateropenobject.h"
118#include "llfloaterpermissionsmgr.h" 123#include "llfloaterpermissionsmgr.h"
124#include "llfloaterperms.h"
119#include "llfloaterpostprocess.h" 125#include "llfloaterpostprocess.h"
120#include "llfloaterpreference.h" 126#include "llfloaterpreference.h"
121#include "llfloaterregioninfo.h" 127#include "llfloaterregioninfo.h"
@@ -182,6 +188,7 @@
182#include "llviewercamera.h" 188#include "llviewercamera.h"
183#include "llviewergenericmessage.h" 189#include "llviewergenericmessage.h"
184#include "llviewergesture.h" 190#include "llviewergesture.h"
191#include "llviewerimagelist.h" // gImageList
185#include "llviewerinventory.h" 192#include "llviewerinventory.h"
186#include "llviewermenufile.h" // init_menu_file() 193#include "llviewermenufile.h" // init_menu_file()
187#include "llviewermessage.h" 194#include "llviewermessage.h"
@@ -208,6 +215,7 @@
208 215
209#include "lltexlayer.h" 216#include "lltexlayer.h"
210 217
218using namespace LLVOAvatarDefines;
211void init_client_menu(LLMenuGL* menu); 219void init_client_menu(LLMenuGL* menu);
212void init_server_menu(LLMenuGL* menu); 220void init_server_menu(LLMenuGL* menu);
213 221
@@ -281,9 +289,6 @@ typedef LLMemberListener<LLView> view_listener_t;
281void handle_leave_group(void *); 289void handle_leave_group(void *);
282 290
283// File Menu 291// File Menu
284const char* upload_pick(void* data);
285void handle_upload(void* data);
286//void handle_upload_object(void* data);
287void handle_compress_image(void*); 292void handle_compress_image(void*);
288BOOL enable_save_as(void *); 293BOOL enable_save_as(void *);
289 294
@@ -307,7 +312,7 @@ BOOL is_selection_buy_not_take();
307S32 selection_price(); 312S32 selection_price();
308BOOL enable_take(); 313BOOL enable_take();
309void handle_take(); 314void handle_take();
310void confirm_take(S32 option, void* data); 315bool confirm_take(const LLSD& notification, const LLSD& response);
311BOOL enable_buy(void*); 316BOOL enable_buy(void*);
312void handle_buy(void *); 317void handle_buy(void *);
313void handle_buy_object(LLSaleInfo sale_info); 318void handle_buy_object(LLSaleInfo sale_info);
@@ -329,7 +334,6 @@ void handle_agent_stop_moving(void*);
329void print_packets_lost(void*); 334void print_packets_lost(void*);
330void drop_packet(void*); 335void drop_packet(void*);
331void velocity_interpolate( void* data ); 336void velocity_interpolate( void* data );
332void update_fov(S32 increments);
333void toggle_wind_audio(void); 337void toggle_wind_audio(void);
334void toggle_water_audio(void); 338void toggle_water_audio(void);
335void handle_rebake_textures(void*); 339void handle_rebake_textures(void*);
@@ -358,7 +362,8 @@ void run_vectorize_perf_test(void *)
358 362
359// Debug UI 363// Debug UI
360void handle_web_search_demo(void*); 364void handle_web_search_demo(void*);
361void handle_slurl_test(void*); 365void handle_web_browser_test(void*);
366void handle_buy_currency_test(void*);
362void handle_save_to_xml(void*); 367void handle_save_to_xml(void*);
363void handle_load_from_xml(void*); 368void handle_load_from_xml(void*);
364 369
@@ -416,7 +421,6 @@ void handle_force_delete(void*);
416void print_object_info(void*); 421void print_object_info(void*);
417void print_agent_nvpairs(void*); 422void print_agent_nvpairs(void*);
418void toggle_debug_menus(void*); 423void toggle_debug_menus(void*);
419void toggle_map( void* user_data );
420void export_info_callback(LLAssetInfo *info, void **user_data, S32 result); 424void export_info_callback(LLAssetInfo *info, void **user_data, S32 result);
421void export_data_callback(LLVFS *vfs, const LLUUID& uuid, LLAssetType::EType type, void **user_data, S32 result); 425void export_data_callback(LLVFS *vfs, const LLUUID& uuid, LLAssetType::EType type, void **user_data, S32 result);
422void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExtStat ext_status); 426void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExtStat ext_status);
@@ -466,7 +470,6 @@ BOOL enable_grab_texture(void*);
466void handle_dump_region_object_cache(void*); 470void handle_dump_region_object_cache(void*);
467 471
468BOOL menu_ui_enabled(void *user_data); 472BOOL menu_ui_enabled(void *user_data);
469void check_toggle_control( LLUICtrl *, void* user_data );
470BOOL menu_check_control( void* user_data); 473BOOL menu_check_control( void* user_data);
471void menu_toggle_variable( void* user_data ); 474void menu_toggle_variable( void* user_data );
472BOOL menu_check_variable( void* user_data); 475BOOL menu_check_variable( void* user_data);
@@ -651,7 +654,7 @@ void init_menus()
651 gViewerWindow->setMenuBackgroundColor(false, 654 gViewerWindow->setMenuBackgroundColor(false,
652 LLViewerLogin::getInstance()->isInProductionGrid()); 655 LLViewerLogin::getInstance()->isInProductionGrid());
653 656
654 // *TODO:Get the cost info from the server 657 // Assume L$10 for now, the server will tell us the real cost at login
655 const std::string upload_cost("10"); 658 const std::string upload_cost("10");
656 gMenuHolder->childSetLabelArg("Upload Image", "[COST]", upload_cost); 659 gMenuHolder->childSetLabelArg("Upload Image", "[COST]", upload_cost);
657 gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", upload_cost); 660 gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", upload_cost);
@@ -950,13 +953,6 @@ void init_client_menu(LLMenuGL* menu)
950 &menu_check_control, 953 &menu_check_control,
951 (void*)"SaveMinidump")); 954 (void*)"SaveMinidump"));
952 955
953 // TomY Temporary menu item so we can test this floater
954 menu->append(new LLMenuItemCheckGL("Clothing...",
955 &handle_clothing,
956 NULL,
957 NULL,
958 NULL));
959
960 menu->append(new LLMenuItemCallGL("Debug Settings...", LLFloaterSettingsDebug::show, NULL, NULL)); 956 menu->append(new LLMenuItemCallGL("Debug Settings...", LLFloaterSettingsDebug::show, NULL, NULL));
961 menu->append(new LLMenuItemCheckGL("View Admin Options", &handle_admin_override_toggle, NULL, &check_admin_override, NULL, 'V', MASK_CONTROL | MASK_ALT)); 957 menu->append(new LLMenuItemCheckGL("View Admin Options", &handle_admin_override_toggle, NULL, &check_admin_override, NULL, 'V', MASK_CONTROL | MASK_ALT));
962 958
@@ -999,6 +995,7 @@ void init_debug_world_menu(LLMenuGL* menu)
999 995
1000void handle_export_menus_to_xml(void*) 996void handle_export_menus_to_xml(void*)
1001{ 997{
998
1002 LLFilePicker& picker = LLFilePicker::instance(); 999 LLFilePicker& picker = LLFilePicker::instance();
1003 if(!picker.getSaveFile(LLFilePicker::FFSAVE_XML)) 1000 if(!picker.getSaveFile(LLFilePicker::FFSAVE_XML))
1004 { 1001 {
@@ -1020,7 +1017,13 @@ extern BOOL gDebugSelectMgr;
1020 1017
1021void init_debug_ui_menu(LLMenuGL* menu) 1018void init_debug_ui_menu(LLMenuGL* menu)
1022{ 1019{
1023 menu->append(new LLMenuItemCallGL("SLURL Test", &handle_slurl_test)); 1020 menu->append(new LLMenuItemCheckGL("Rotate Mini-Map", menu_toggle_control, NULL, menu_check_control, (void*)"MiniMapRotate"));
1021 menu->append(new LLMenuItemCheckGL("Use default system color picker", menu_toggle_control, NULL, menu_check_control, (void*)"UseDefaultColorPicker"));
1022 menu->append(new LLMenuItemCheckGL("Show search panel in overlay bar", menu_toggle_control, NULL, menu_check_control, (void*)"ShowSearchBar"));
1023 menu->appendSeparator();
1024
1025 menu->append(new LLMenuItemCallGL("Web Browser Test", &handle_web_browser_test));
1026 menu->append(new LLMenuItemCallGL("Buy Currency Test", &handle_buy_currency_test));
1024 menu->append(new LLMenuItemCallGL("Editable UI", &edit_ui)); 1027 menu->append(new LLMenuItemCallGL("Editable UI", &edit_ui));
1025 menu->append(new LLMenuItemCallGL( "Dump SelectMgr", &dump_select_mgr)); 1028 menu->append(new LLMenuItemCallGL( "Dump SelectMgr", &dump_select_mgr));
1026 menu->append(new LLMenuItemCallGL( "Dump Inventory", &dump_inventory)); 1029 menu->append(new LLMenuItemCallGL( "Dump Inventory", &dump_inventory));
@@ -1044,6 +1047,7 @@ void init_debug_ui_menu(LLMenuGL* menu)
1044 menu->appendSeparator(); 1047 menu->appendSeparator();
1045 menu->append(new LLMenuItemCheckGL("Show Time", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowTime")); 1048 menu->append(new LLMenuItemCheckGL("Show Time", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowTime"));
1046 menu->append(new LLMenuItemCheckGL("Show Render Info", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowRenderInfo")); 1049 menu->append(new LLMenuItemCheckGL("Show Render Info", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowRenderInfo"));
1050 menu->append(new LLMenuItemCheckGL("Show Matrices", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowRenderMatrices"));
1047 menu->append(new LLMenuItemCheckGL("Show Color Under Cursor", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowColor")); 1051 menu->append(new LLMenuItemCheckGL("Show Color Under Cursor", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowColor"));
1048 1052
1049 menu->createJumpKeys(); 1053 menu->createJumpKeys();
@@ -1052,6 +1056,7 @@ void init_debug_ui_menu(LLMenuGL* menu)
1052void init_debug_xui_menu(LLMenuGL* menu) 1056void init_debug_xui_menu(LLMenuGL* menu)
1053{ 1057{
1054 menu->append(new LLMenuItemCallGL("Floater Test...", LLFloaterTest::show)); 1058 menu->append(new LLMenuItemCallGL("Floater Test...", LLFloaterTest::show));
1059 menu->append(new LLMenuItemCallGL("Font Test...", LLFloaterFontTest::show));
1055 menu->append(new LLMenuItemCallGL("Export Menus to XML...", handle_export_menus_to_xml)); 1060 menu->append(new LLMenuItemCallGL("Export Menus to XML...", handle_export_menus_to_xml));
1056 menu->append(new LLMenuItemCallGL("Edit UI...", LLFloaterEditUI::show)); 1061 menu->append(new LLMenuItemCallGL("Edit UI...", LLFloaterEditUI::show));
1057 menu->append(new LLMenuItemCallGL("Load from XML...", handle_load_from_xml)); 1062 menu->append(new LLMenuItemCallGL("Load from XML...", handle_load_from_xml));
@@ -1181,6 +1186,9 @@ void init_debug_rendering_menu(LLMenuGL* menu)
1181 sub_menu->append(new LLMenuItemCheckGL("Octree", &LLPipeline::toggleRenderDebug, NULL, 1186 sub_menu->append(new LLMenuItemCheckGL("Octree", &LLPipeline::toggleRenderDebug, NULL,
1182 &LLPipeline::toggleRenderDebugControl, 1187 &LLPipeline::toggleRenderDebugControl,
1183 (void*)LLPipeline::RENDER_DEBUG_OCTREE)); 1188 (void*)LLPipeline::RENDER_DEBUG_OCTREE));
1189 sub_menu->append(new LLMenuItemCheckGL("Shadow Frusta", &LLPipeline::toggleRenderDebug, NULL,
1190 &LLPipeline::toggleRenderDebugControl,
1191 (void*)LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA));
1184 sub_menu->append(new LLMenuItemCheckGL("Occlusion", &LLPipeline::toggleRenderDebug, NULL, 1192 sub_menu->append(new LLMenuItemCheckGL("Occlusion", &LLPipeline::toggleRenderDebug, NULL,
1185 &LLPipeline::toggleRenderDebugControl, 1193 &LLPipeline::toggleRenderDebugControl,
1186 (void*)LLPipeline::RENDER_DEBUG_OCCLUSION)); 1194 (void*)LLPipeline::RENDER_DEBUG_OCCLUSION));
@@ -1306,8 +1314,6 @@ void init_debug_rendering_menu(LLMenuGL* menu)
1306 menu->createJumpKeys(); 1314 menu->createJumpKeys();
1307} 1315}
1308 1316
1309extern BOOL gDebugAvatarRotation;
1310
1311void init_debug_avatar_menu(LLMenuGL* menu) 1317void init_debug_avatar_menu(LLMenuGL* menu)
1312{ 1318{
1313 LLMenuGL* sub_menu = new LLMenuGL("Grab Baked Texture"); 1319 LLMenuGL* sub_menu = new LLMenuGL("Grab Baked Texture");
@@ -1352,9 +1358,15 @@ void init_debug_avatar_menu(LLMenuGL* menu)
1352 //menu->append(new LLMenuItemToggleGL("Show Attachment Points", &LLVOAvatar::sShowAttachmentPoints)); 1358 //menu->append(new LLMenuItemToggleGL("Show Attachment Points", &LLVOAvatar::sShowAttachmentPoints));
1353 //diabling collision plane due to DEV-14477 -brad 1359 //diabling collision plane due to DEV-14477 -brad
1354 //menu->append(new LLMenuItemToggleGL("Show Collision Plane", &LLVOAvatar::sShowFootPlane)); 1360 //menu->append(new LLMenuItemToggleGL("Show Collision Plane", &LLVOAvatar::sShowFootPlane));
1355 menu->append(new LLMenuItemToggleGL("Show Collision Skeleton", &LLVOAvatar::sShowCollisionVolumes)); 1361 menu->append(new LLMenuItemCheckGL("Show Collision Skeleton",
1356 menu->append(new LLMenuItemToggleGL( "Display Agent Target", &LLAgent::sDebugDisplayTarget)); 1362 &LLPipeline::toggleRenderDebug, NULL,
1357 menu->append(new LLMenuItemToggleGL( "Debug Rotation", &gDebugAvatarRotation)); 1363 &LLPipeline::toggleRenderDebugControl,
1364 (void*)LLPipeline::RENDER_DEBUG_AVATAR_VOLUME));
1365 menu->append(new LLMenuItemCheckGL("Display Agent Target",
1366 &LLPipeline::toggleRenderDebug, NULL,
1367 &LLPipeline::toggleRenderDebugControl,
1368 (void*)LLPipeline::RENDER_DEBUG_AGENT_TARGET));
1369 menu->append(new LLMenuItemToggleGL( "Debug Rotation", &LLVOAvatar::sDebugAvatarRotation));
1358 menu->append(new LLMenuItemCallGL("Dump Attachments", handle_dump_attachments)); 1370 menu->append(new LLMenuItemCallGL("Dump Attachments", handle_dump_attachments));
1359 menu->append(new LLMenuItemCallGL("Rebake Textures", handle_rebake_textures, NULL, NULL, 'R', MASK_ALT | MASK_CONTROL )); 1371 menu->append(new LLMenuItemCallGL("Rebake Textures", handle_rebake_textures, NULL, NULL, 'R', MASK_ALT | MASK_CONTROL ));
1360#ifndef LL_RELEASE_FOR_DOWNLOAD 1372#ifndef LL_RELEASE_FOR_DOWNLOAD
@@ -1366,11 +1378,12 @@ void init_debug_avatar_menu(LLMenuGL* menu)
1366 1378
1367void init_debug_baked_texture_menu(LLMenuGL* menu) 1379void init_debug_baked_texture_menu(LLMenuGL* menu)
1368{ 1380{
1369 menu->append(new LLMenuItemCallGL("Iris", handle_grab_texture, enable_grab_texture, (void*) LLVOAvatar::TEX_EYES_BAKED)); 1381 menu->append(new LLMenuItemCallGL("Iris", handle_grab_texture, enable_grab_texture, (void*) TEX_EYES_BAKED));
1370 menu->append(new LLMenuItemCallGL("Head", handle_grab_texture, enable_grab_texture, (void*) LLVOAvatar::TEX_HEAD_BAKED)); 1382 menu->append(new LLMenuItemCallGL("Head", handle_grab_texture, enable_grab_texture, (void*) TEX_HEAD_BAKED));
1371 menu->append(new LLMenuItemCallGL("Upper Body", handle_grab_texture, enable_grab_texture, (void*) LLVOAvatar::TEX_UPPER_BAKED)); 1383 menu->append(new LLMenuItemCallGL("Upper Body", handle_grab_texture, enable_grab_texture, (void*) TEX_UPPER_BAKED));
1372 menu->append(new LLMenuItemCallGL("Lower Body", handle_grab_texture, enable_grab_texture, (void*) LLVOAvatar::TEX_LOWER_BAKED)); 1384 menu->append(new LLMenuItemCallGL("Lower Body", handle_grab_texture, enable_grab_texture, (void*) TEX_LOWER_BAKED));
1373 menu->append(new LLMenuItemCallGL("Skirt", handle_grab_texture, enable_grab_texture, (void*) LLVOAvatar::TEX_SKIRT_BAKED)); 1385 menu->append(new LLMenuItemCallGL("Skirt", handle_grab_texture, enable_grab_texture, (void*) TEX_SKIRT_BAKED));
1386 menu->append(new LLMenuItemCallGL("Hair", handle_grab_texture, enable_grab_texture, (void*) TEX_HAIR_BAKED));
1374 menu->createJumpKeys(); 1387 menu->createJumpKeys();
1375} 1388}
1376 1389
@@ -2121,9 +2134,10 @@ class LLGoToObject : public view_listener_t
2121//--------------------------------------------------------------------------- 2134//---------------------------------------------------------------------------
2122// Parcel freeze, eject, etc. 2135// Parcel freeze, eject, etc.
2123//--------------------------------------------------------------------------- 2136//---------------------------------------------------------------------------
2124void callback_freeze(S32 option, void* data) 2137bool callback_freeze(const LLSD& notification, const LLSD& response)
2125{ 2138{
2126 LLUUID* avatar_id = (LLUUID*) data; 2139 LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID();
2140 S32 option = LLNotification::getSelectedOption(notification, response);
2127 2141
2128 if (0 == option || 1 == option) 2142 if (0 == option || 1 == option)
2129 { 2143 {
@@ -2135,7 +2149,7 @@ void callback_freeze(S32 option, void* data)
2135 } 2149 }
2136 2150
2137 LLMessageSystem* msg = gMessageSystem; 2151 LLMessageSystem* msg = gMessageSystem;
2138 LLViewerObject* avatar = gObjectList.findObject(*avatar_id); 2152 LLViewerObject* avatar = gObjectList.findObject(avatar_id);
2139 2153
2140 if (avatar) 2154 if (avatar)
2141 { 2155 {
@@ -2144,16 +2158,15 @@ void callback_freeze(S32 option, void* data)
2144 msg->addUUID("AgentID", gAgent.getID()); 2158 msg->addUUID("AgentID", gAgent.getID());
2145 msg->addUUID("SessionID", gAgent.getSessionID()); 2159 msg->addUUID("SessionID", gAgent.getSessionID());
2146 msg->nextBlock("Data"); 2160 msg->nextBlock("Data");
2147 msg->addUUID("TargetID", *avatar_id ); 2161 msg->addUUID("TargetID", avatar_id );
2148 msg->addU32("Flags", flags ); 2162 msg->addU32("Flags", flags );
2149 msg->sendReliable( avatar->getRegion()->getHost() ); 2163 msg->sendReliable( avatar->getRegion()->getHost() );
2150 } 2164 }
2151 } 2165 }
2152 2166 return false;
2153 delete avatar_id;
2154 avatar_id = NULL;
2155} 2167}
2156 2168
2169
2157class LLAvatarFreeze : public view_listener_t 2170class LLAvatarFreeze : public view_listener_t
2158{ 2171{
2159 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 2172 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -2161,23 +2174,25 @@ class LLAvatarFreeze : public view_listener_t
2161 LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); 2174 LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
2162 if( avatar ) 2175 if( avatar )
2163 { 2176 {
2164 LLUUID* avatar_id = new LLUUID( avatar->getID() );
2165 std::string fullname = avatar->getFullname(); 2177 std::string fullname = avatar->getFullname();
2178 LLSD payload;
2179 payload["avatar_id"] = avatar->getID();
2166 2180
2167 if (!fullname.empty()) 2181 if (!fullname.empty())
2168 { 2182 {
2169 LLStringUtil::format_map_t args; 2183 LLSD args;
2170 args["[AVATAR_NAME]"] = fullname; 2184 args["AVATAR_NAME"] = fullname;
2171 gViewerWindow->alertXml("FreezeAvatarFullname", 2185 LLNotifications::instance().add("FreezeAvatarFullname",
2172 args, 2186 args,
2173 callback_freeze, 2187 payload,
2174 (void*)avatar_id); 2188 callback_freeze);
2175 } 2189 }
2176 else 2190 else
2177 { 2191 {
2178 gViewerWindow->alertXml("FreezeAvatar", 2192 LLNotifications::instance().add("FreezeAvatar",
2179 callback_freeze, 2193 LLSD(),
2180 (void*)avatar_id); 2194 payload,
2195 callback_freeze);
2181 } 2196 }
2182 } 2197 }
2183 return true; 2198 return true;
@@ -2223,26 +2238,16 @@ class LLAvatarDebug : public view_listener_t
2223 } 2238 }
2224}; 2239};
2225 2240
2226struct MenuCallbackData 2241bool callback_eject(const LLSD& notification, const LLSD& response)
2227{
2228 bool ban_enabled;
2229 LLUUID avatar_id;
2230};
2231
2232void callback_eject(S32 option, void* data)
2233{ 2242{
2234 MenuCallbackData *callback_data = (MenuCallbackData*)data; 2243 S32 option = LLNotification::getSelectedOption(notification, response);
2235 if (!callback_data)
2236 {
2237 return;
2238 }
2239 if (2 == option) 2244 if (2 == option)
2240 { 2245 {
2241 // Cancle button. 2246 // Cancel button.
2242 return; 2247 return false;
2243 } 2248 }
2244 LLUUID avatar_id = callback_data->avatar_id; 2249 LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID();
2245 bool ban_enabled = callback_data->ban_enabled; 2250 bool ban_enabled = notification["payload"]["ban_enabled"].asBoolean();
2246 2251
2247 if (0 == option) 2252 if (0 == option)
2248 { 2253 {
@@ -2284,10 +2289,7 @@ void callback_eject(S32 option, void* data)
2284 msg->sendReliable( avatar->getRegion()->getHost() ); 2289 msg->sendReliable( avatar->getRegion()->getHost() );
2285 } 2290 }
2286 } 2291 }
2287 2292 return false;
2288
2289 delete callback_data;
2290 callback_data = NULL;
2291} 2293}
2292 2294
2293class LLAvatarEject : public view_listener_t 2295class LLAvatarEject : public view_listener_t
@@ -2297,8 +2299,8 @@ class LLAvatarEject : public view_listener_t
2297 LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); 2299 LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
2298 if( avatar ) 2300 if( avatar )
2299 { 2301 {
2300 MenuCallbackData *data = new MenuCallbackData; 2302 LLSD payload;
2301 (*data).avatar_id = avatar->getID(); 2303 payload["avatar_id"] = avatar->getID();
2302 std::string fullname = avatar->getFullname(); 2304 std::string fullname = avatar->getFullname();
2303 2305
2304 const LLVector3d& pos = avatar->getPositionGlobal(); 2306 const LLVector3d& pos = avatar->getPositionGlobal();
@@ -2306,40 +2308,42 @@ class LLAvatarEject : public view_listener_t
2306 2308
2307 if (LLViewerParcelMgr::getInstance()->isParcelOwnedByAgent(parcel,GP_LAND_MANAGE_BANNED)) 2309 if (LLViewerParcelMgr::getInstance()->isParcelOwnedByAgent(parcel,GP_LAND_MANAGE_BANNED))
2308 { 2310 {
2309 (*data).ban_enabled = true; 2311 payload["ban_enabled"] = true;
2310 if (!fullname.empty()) 2312 if (!fullname.empty())
2311 { 2313 {
2312 LLStringUtil::format_map_t args; 2314 LLSD args;
2313 args["[AVATAR_NAME]"] = fullname; 2315 args["AVATAR_NAME"] = fullname;
2314 gViewerWindow->alertXml("EjectAvatarFullname", 2316 LLNotifications::instance().add("EjectAvatarFullname",
2315 args, 2317 args,
2316 callback_eject, 2318 payload,
2317 (void*)data); 2319 callback_eject);
2318 } 2320 }
2319 else 2321 else
2320 { 2322 {
2321 gViewerWindow->alertXml("EjectAvatar", 2323 LLNotifications::instance().add("EjectAvatarFullname",
2322 callback_eject, 2324 LLSD(),
2323 (void*)data); 2325 payload,
2326 callback_eject);
2324 } 2327 }
2325 } 2328 }
2326 else 2329 else
2327 { 2330 {
2328 (*data).ban_enabled = false; 2331 payload["ban_enabled"] = false;
2329 if (!fullname.empty()) 2332 if (!fullname.empty())
2330 { 2333 {
2331 LLStringUtil::format_map_t args; 2334 LLSD args;
2332 args["[AVATAR_NAME]"] = fullname; 2335 args["AVATAR_NAME"] = fullname;
2333 gViewerWindow->alertXml("EjectAvatarFullnameNoBan", 2336 LLNotifications::instance().add("EjectAvatarFullnameNoBan",
2334 args, 2337 args,
2335 callback_eject, 2338 payload,
2336 (void*)data); 2339 callback_eject);
2337 } 2340 }
2338 else 2341 else
2339 { 2342 {
2340 gViewerWindow->alertXml("EjectAvatarNoBan", 2343 LLNotifications::instance().add("EjectAvatarNoBan",
2341 callback_eject, 2344 LLSD(),
2342 (void*)data); 2345 payload,
2346 callback_eject);
2343 } 2347 }
2344 } 2348 }
2345 } 2349 }
@@ -2386,13 +2390,16 @@ class LLAvatarGiveCard : public view_listener_t
2386 if(dest && dest->isAvatar()) 2390 if(dest && dest->isAvatar())
2387 { 2391 {
2388 bool found_name = false; 2392 bool found_name = false;
2389 LLStringUtil::format_map_t args; 2393 LLSD args;
2394 LLSD old_args;
2390 LLNameValue* nvfirst = dest->getNVPair("FirstName"); 2395 LLNameValue* nvfirst = dest->getNVPair("FirstName");
2391 LLNameValue* nvlast = dest->getNVPair("LastName"); 2396 LLNameValue* nvlast = dest->getNVPair("LastName");
2392 if(nvfirst && nvlast) 2397 if(nvfirst && nvlast)
2393 { 2398 {
2394 args["[FIRST]"] = nvfirst->getString(); 2399 args["FIRST"] = nvfirst->getString();
2395 args["[LAST]"] = nvlast->getString(); 2400 args["LAST"] = nvlast->getString();
2401 old_args["FIRST"] = nvfirst->getString();
2402 old_args["LAST"] = nvlast->getString();
2396 found_name = true; 2403 found_name = true;
2397 } 2404 }
2398 LLViewerRegion* region = dest->getRegion(); 2405 LLViewerRegion* region = dest->getRegion();
@@ -2414,11 +2421,11 @@ class LLAvatarGiveCard : public view_listener_t
2414 transaction_id.generate(); 2421 transaction_id.generate();
2415 msg->addUUIDFast(_PREHASH_TransactionID, transaction_id); 2422 msg->addUUIDFast(_PREHASH_TransactionID, transaction_id);
2416 msg->sendReliable(dest_host); 2423 msg->sendReliable(dest_host);
2417 LLNotifyBox::showXml("OfferedCard", args); 2424 LLNotifications::instance().add("OfferedCard", args);
2418 } 2425 }
2419 else 2426 else
2420 { 2427 {
2421 gViewerWindow->alertXml("CantOfferCallingCard", args); 2428 LLNotifications::instance().add("CantOfferCallingCard", old_args);
2422 } 2429 }
2423 } 2430 }
2424 return true; 2431 return true;
@@ -2435,8 +2442,9 @@ void login_done(S32 which, void *user)
2435} 2442}
2436 2443
2437 2444
2438void callback_leave_group(S32 option, void *userdata) 2445bool callback_leave_group(const LLSD& notification, const LLSD& response)
2439{ 2446{
2447 S32 option = LLNotification::getSelectedOption(notification, response);
2440 if (option == 0) 2448 if (option == 0)
2441 { 2449 {
2442 LLMessageSystem *msg = gMessageSystem; 2450 LLMessageSystem *msg = gMessageSystem;
@@ -2449,15 +2457,16 @@ void callback_leave_group(S32 option, void *userdata)
2449 msg->addUUIDFast(_PREHASH_GroupID, gAgent.mGroupID ); 2457 msg->addUUIDFast(_PREHASH_GroupID, gAgent.mGroupID );
2450 gAgent.sendReliableMessage(); 2458 gAgent.sendReliableMessage();
2451 } 2459 }
2460 return false;
2452} 2461}
2453 2462
2454void handle_leave_group(void *) 2463void handle_leave_group(void *)
2455{ 2464{
2456 if (gAgent.getGroupID() != LLUUID::null) 2465 if (gAgent.getGroupID() != LLUUID::null)
2457 { 2466 {
2458 LLStringUtil::format_map_t args; 2467 LLSD args;
2459 args["[GROUP]"] = gAgent.mGroupName; 2468 args["GROUP"] = gAgent.mGroupName;
2460 gViewerWindow->alertXml("GroupLeaveConfirmMember", args, callback_leave_group); 2469 LLNotifications::instance().add("GroupLeaveConfirmMember", args, LLSD(), callback_leave_group);
2461 } 2470 }
2462} 2471}
2463 2472
@@ -2520,7 +2529,7 @@ void handle_buy_object(LLSaleInfo sale_info)
2520{ 2529{
2521 if(!LLSelectMgr::getInstance()->selectGetAllRootsValid()) 2530 if(!LLSelectMgr::getInstance()->selectGetAllRootsValid())
2522 { 2531 {
2523 LLNotifyBox::showXml("UnableToBuyWhileDownloading"); 2532 LLNotifications::instance().add("UnableToBuyWhileDownloading");
2524 return; 2533 return;
2525 } 2534 }
2526 2535
@@ -2529,7 +2538,7 @@ void handle_buy_object(LLSaleInfo sale_info)
2529 BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name); 2538 BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
2530 if (!owners_identical) 2539 if (!owners_identical)
2531 { 2540 {
2532 LLNotifyBox::showXml("CannotBuyObjectsFromDifferentOwners"); 2541 LLNotifications::instance().add("CannotBuyObjectsFromDifferentOwners");
2533 return; 2542 return;
2534 } 2543 }
2535 2544
@@ -2539,7 +2548,7 @@ void handle_buy_object(LLSaleInfo sale_info)
2539 valid &= LLSelectMgr::getInstance()->selectGetAggregatePermissions(ag_perm); 2548 valid &= LLSelectMgr::getInstance()->selectGetAggregatePermissions(ag_perm);
2540 if(!valid || !sale_info.isForSale() || !perm.allowTransferTo(gAgent.getID())) 2549 if(!valid || !sale_info.isForSale() || !perm.allowTransferTo(gAgent.getID()))
2541 { 2550 {
2542 LLNotifyBox::showXml("ObjectNotForSale"); 2551 LLNotifications::instance().add("ObjectNotForSale");
2543 return; 2552 return;
2544 } 2553 }
2545 2554
@@ -2685,22 +2694,22 @@ void set_god_level(U8 god_level)
2685 // inventory in items may change in god mode 2694 // inventory in items may change in god mode
2686 gObjectList.dirtyAllObjectInventory(); 2695 gObjectList.dirtyAllObjectInventory();
2687 2696
2688 if(gViewerWindow) 2697 if(gViewerWindow)
2689 { 2698 {
2690 gViewerWindow->setMenuBackgroundColor(god_level > GOD_NOT, 2699 gViewerWindow->setMenuBackgroundColor(god_level > GOD_NOT,
2691 LLViewerLogin::getInstance()->isInProductionGrid()); 2700 LLViewerLogin::getInstance()->isInProductionGrid());
2692 } 2701 }
2693 2702
2694 LLStringUtil::format_map_t args; 2703 LLSD args;
2695 if(god_level > GOD_NOT) 2704 if(god_level > GOD_NOT)
2696 { 2705 {
2697 args["[LEVEL]"] = llformat("%d",(S32)god_level); 2706 args["LEVEL"] = llformat("%d",(S32)god_level);
2698 LLNotifyBox::showXml("EnteringGodMode", args); 2707 LLNotifications::instance().add("EnteringGodMode", args);
2699 } 2708 }
2700 else 2709 else
2701 { 2710 {
2702 args["[LEVEL]"] = llformat("%d",(S32)old_god_level); 2711 args["LEVEL"] = llformat("%d",(S32)old_god_level);
2703 LLNotifyBox::showXml("LeavingGodMode", args); 2712 LLNotifications::instance().add("LeavingGodMode", args);
2704 } 2713 }
2705 2714
2706 2715
@@ -2825,13 +2834,13 @@ void request_friendship(const LLUUID& dest_id)
2825 if(dest && dest->isAvatar()) 2834 if(dest && dest->isAvatar())
2826 { 2835 {
2827 std::string fullname; 2836 std::string fullname;
2828 LLStringUtil::format_map_t args; 2837 LLSD args;
2829 LLNameValue* nvfirst = dest->getNVPair("FirstName"); 2838 LLNameValue* nvfirst = dest->getNVPair("FirstName");
2830 LLNameValue* nvlast = dest->getNVPair("LastName"); 2839 LLNameValue* nvlast = dest->getNVPair("LastName");
2831 if(nvfirst && nvlast) 2840 if(nvfirst && nvlast)
2832 { 2841 {
2833 args["[FIRST]"] = nvfirst->getString(); 2842 args["FIRST"] = nvfirst->getString();
2834 args["[LAST]"] = nvlast->getString(); 2843 args["LAST"] = nvlast->getString();
2835 fullname = nvfirst->getString(); 2844 fullname = nvfirst->getString();
2836 fullname += " "; 2845 fullname += " ";
2837 fullname += nvlast->getString(); 2846 fullname += nvlast->getString();
@@ -2842,7 +2851,7 @@ void request_friendship(const LLUUID& dest_id)
2842 } 2851 }
2843 else 2852 else
2844 { 2853 {
2845 gViewerWindow->alertXml("CantOfferFriendship"); 2854 LLNotifications::instance().add("CantOfferFriendship");
2846 } 2855 }
2847 } 2856 }
2848} 2857}
@@ -2852,12 +2861,8 @@ class LLEditEnableCustomizeAvatar : public view_listener_t
2852{ 2861{
2853 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 2862 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
2854 { 2863 {
2855 LLVOAvatar* avatar = gAgent.getAvatarObject(); 2864 bool new_value = gAgent.areWearablesLoaded();
2856 2865 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
2857 bool enabled = ((avatar && avatar->isFullyLoaded()) &&
2858 (gAgent.getWearablesLoaded()));
2859
2860 gMenuHolder->findControl(userdata["control"].asString())->setValue(enabled);
2861 return true; 2866 return true;
2862 } 2867 }
2863}; 2868};
@@ -3044,86 +3049,6 @@ void velocity_interpolate( void* data )
3044} 3049}
3045 3050
3046 3051
3047void update_fov(S32 increments)
3048{
3049 F32 old_fov = LLViewerCamera::getInstance()->getDefaultFOV();
3050 // for each increment, FoV is 20% bigger
3051 F32 new_fov = old_fov * pow(1.2f, increments);
3052
3053 // cap the FoV
3054 new_fov = llclamp(new_fov, MIN_FIELD_OF_VIEW, MAX_FIELD_OF_VIEW);
3055
3056 if (new_fov != old_fov)
3057 {
3058 LLMessageSystem* msg = gMessageSystem;
3059 msg->newMessageFast(_PREHASH_AgentFOV);
3060 msg->nextBlockFast(_PREHASH_AgentData);
3061 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
3062 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
3063 msg->addU32Fast(_PREHASH_CircuitCode, gMessageSystem->mOurCircuitCode);
3064
3065 msg->nextBlockFast(_PREHASH_FOVBlock);
3066 msg->addU32Fast(_PREHASH_GenCounter, 0);
3067 msg->addF32Fast(_PREHASH_VerticalAngle, new_fov);
3068
3069 gAgent.sendReliableMessage();
3070
3071 // force agent to update dirty patches
3072 LLViewerCamera::getInstance()->setDefaultFOV(new_fov);
3073 LLViewerCamera::getInstance()->setView(new_fov);
3074 }
3075}
3076
3077class LLViewZoomOut : public view_listener_t
3078{
3079 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
3080 {
3081 update_fov(1);
3082 return true;
3083 }
3084};
3085
3086class LLViewZoomIn : public view_listener_t
3087{
3088 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
3089 {
3090 update_fov(-1);
3091 return true;
3092 }
3093};
3094
3095class LLViewZoomDefault : public view_listener_t
3096{
3097 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
3098 {
3099 F32 old_fov = LLViewerCamera::getInstance()->getView();
3100 // for each increment, FoV is 20% bigger
3101 F32 new_fov = DEFAULT_FIELD_OF_VIEW;
3102
3103 if (new_fov != old_fov)
3104 {
3105 LLMessageSystem* msg = gMessageSystem;
3106 msg->newMessageFast(_PREHASH_AgentFOV);
3107 msg->nextBlockFast(_PREHASH_AgentData);
3108 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
3109 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
3110 msg->addU32Fast(_PREHASH_CircuitCode, gMessageSystem->mOurCircuitCode);
3111 msg->nextBlockFast(_PREHASH_FOVBlock);
3112 msg->addU32Fast(_PREHASH_GenCounter, 0);
3113 msg->addF32Fast(_PREHASH_VerticalAngle, new_fov);
3114
3115 gAgent.sendReliableMessage();
3116
3117 // force agent to update dirty patches
3118 LLViewerCamera::getInstance()->setDefaultFOV(new_fov);
3119 LLViewerCamera::getInstance()->setView(new_fov);
3120 }
3121 return true;
3122 }
3123};
3124
3125
3126
3127void toggle_wind_audio(void) 3052void toggle_wind_audio(void)
3128{ 3053{
3129 if (gAudiop) 3054 if (gAudiop)
@@ -3163,7 +3088,7 @@ void handle_reset_view()
3163 if( (CAMERA_MODE_CUSTOMIZE_AVATAR == gAgent.getCameraMode()) && gFloaterCustomize ) 3088 if( (CAMERA_MODE_CUSTOMIZE_AVATAR == gAgent.getCameraMode()) && gFloaterCustomize )
3164 { 3089 {
3165 // Show dialog box if needed. 3090 // Show dialog box if needed.
3166 gFloaterCustomize->askToSaveAllIfDirty( reset_view_final, NULL ); 3091 gFloaterCustomize->askToSaveIfDirty( reset_view_final, NULL );
3167 } 3092 }
3168 else 3093 else
3169 { 3094 {
@@ -3263,7 +3188,7 @@ void disabled_duplicate(void*)
3263{ 3188{
3264 if (LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()) 3189 if (LLSelectMgr::getInstance()->getSelection()->getPrimaryObject())
3265 { 3190 {
3266 LLNotifyBox::showXml("CopyFailed"); 3191 LLNotifications::instance().add("CopyFailed");
3267 } 3192 }
3268} 3193}
3269 3194
@@ -3396,7 +3321,7 @@ void handle_claim_public_land(void*)
3396{ 3321{
3397 if (LLViewerParcelMgr::getInstance()->getSelectionRegion() != gAgent.getRegion()) 3322 if (LLViewerParcelMgr::getInstance()->getSelectionRegion() != gAgent.getRegion())
3398 { 3323 {
3399 LLNotifyBox::showXml("ClaimPublicLand"); 3324 LLNotifications::instance().add("ClaimPublicLand");
3400 return; 3325 return;
3401 } 3326 }
3402 3327
@@ -3629,7 +3554,7 @@ void derez_objects(EDeRezDestination dest, const LLUUID& dest_id)
3629 } 3554 }
3630 else if(!error.empty()) 3555 else if(!error.empty())
3631 { 3556 {
3632 gViewerWindow->alertXml(error); 3557 LLNotifications::instance().add(error);
3633 } 3558 }
3634} 3559}
3635 3560
@@ -3656,16 +3581,13 @@ class LLObjectReturn : public view_listener_t
3656 3581
3657 mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); 3582 mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
3658 3583
3659 gViewerWindow->alertXml("ReturnToOwner", 3584 LLNotifications::instance().add("ReturnToOwner", LLSD(), LLSD(), boost::bind(&LLObjectReturn::onReturnToOwner, this, _1, _2));
3660 onReturnToOwner,
3661 (void*)this);
3662 return true; 3585 return true;
3663 } 3586 }
3664 3587
3665 static void onReturnToOwner(S32 option, void* data) 3588 bool onReturnToOwner(const LLSD& notification, const LLSD& response)
3666 { 3589 {
3667 LLObjectReturn* object_return = (LLObjectReturn*)data; 3590 S32 option = LLNotification::getSelectedOption(notification, response);
3668
3669 if (0 == option) 3591 if (0 == option)
3670 { 3592 {
3671 // Ignore category ID for this derez destination. 3593 // Ignore category ID for this derez destination.
@@ -3673,7 +3595,8 @@ class LLObjectReturn : public view_listener_t
3673 } 3595 }
3674 3596
3675 // drop reference to current selection 3597 // drop reference to current selection
3676 object_return->mObjectSelection = NULL; 3598 mObjectSelection = NULL;
3599 return false;
3677 } 3600 }
3678 3601
3679protected: 3602protected:
@@ -3810,48 +3733,46 @@ void handle_take()
3810 { 3733 {
3811 category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT); 3734 category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT);
3812 } 3735 }
3813 LLUUID* cat_id = new LLUUID(category_id); 3736 LLSD payload;
3737 payload["folder_id"] = category_id;
3738
3739 LLNotification::Params params("ConfirmObjectTakeLock");
3740 params.payload(payload)
3741 .functor(confirm_take);
3742
3814 if(locked_but_takeable_object || 3743 if(locked_but_takeable_object ||
3815 !you_own_everything) 3744 !you_own_everything)
3816 { 3745 {
3817 if(locked_but_takeable_object && you_own_everything) 3746 if(locked_but_takeable_object && you_own_everything)
3818 { 3747 {
3819 gViewerWindow->alertXml("ConfirmObjectTakeLock", 3748 params.name("ConfirmObjectTakeLock");
3820 confirm_take,
3821 (void*)cat_id);
3822 3749
3823 } 3750 }
3824 else if(!locked_but_takeable_object && !you_own_everything) 3751 else if(!locked_but_takeable_object && !you_own_everything)
3825 { 3752 {
3826 gViewerWindow->alertXml("ConfirmObjectTakeNoOwn", 3753 params.name("ConfirmObjectTakeNoOwn");
3827 confirm_take,
3828 (void*)cat_id);
3829 } 3754 }
3830 else 3755 else
3831 { 3756 {
3832 gViewerWindow->alertXml("ConfirmObjectTakeLockNoOwn", 3757 params.name("ConfirmObjectTakeLockNoOwn");
3833 confirm_take,
3834 (void*)cat_id);
3835 } 3758 }
3836 3759
3837 3760 LLNotifications::instance().add(params);
3838 } 3761 }
3839
3840 else 3762 else
3841 { 3763 {
3842 confirm_take(0, (void*)cat_id); 3764 LLNotifications::instance().forceResponse(params, 0);
3843 } 3765 }
3844} 3766}
3845 3767
3846void confirm_take(S32 option, void* data) 3768bool confirm_take(const LLSD& notification, const LLSD& response)
3847{ 3769{
3848 LLUUID* cat_id = (LLUUID*)data; 3770 S32 option = LLNotification::getSelectedOption(notification, response);
3849 if(!cat_id) return;
3850 if(enable_take() && (option == 0)) 3771 if(enable_take() && (option == 0))
3851 { 3772 {
3852 derez_objects(DRD_TAKE_INTO_AGENT_INVENTORY, *cat_id); 3773 derez_objects(DRD_TAKE_INTO_AGENT_INVENTORY, notification["payload"]["folder_id"].asUUID());
3853 } 3774 }
3854 delete cat_id; 3775 return false;
3855} 3776}
3856 3777
3857// You can take an item when it is public and transferrable, or when 3778// You can take an item when it is public and transferrable, or when
@@ -4013,13 +3934,15 @@ S32 selection_price()
4013 return total_price; 3934 return total_price;
4014} 3935}
4015 3936
4016void callback_show_buy_currency(S32 option, void*) 3937bool callback_show_buy_currency(const LLSD& notification, const LLSD& response)
4017{ 3938{
3939 S32 option = LLNotification::getSelectedOption(notification, response);
4018 if (0 == option) 3940 if (0 == option)
4019 { 3941 {
4020 llinfos << "Loading page " << BUY_CURRENCY_URL << llendl; 3942 llinfos << "Loading page " << BUY_CURRENCY_URL << llendl;
4021 LLWeb::loadURL(BUY_CURRENCY_URL); 3943 LLWeb::loadURL(BUY_CURRENCY_URL);
4022 } 3944 }
3945 return false;
4023} 3946}
4024 3947
4025 3948
@@ -4034,14 +3957,13 @@ void show_buy_currency(const char* extra)
4034 } 3957 }
4035 mesg << "Go to " << BUY_CURRENCY_URL << "\nfor information on purchasing currency?"; 3958 mesg << "Go to " << BUY_CURRENCY_URL << "\nfor information on purchasing currency?";
4036 3959
4037 LLStringUtil::format_map_t args; 3960 LLSD args;
4038 if (extra != NULL) 3961 if (extra != NULL)
4039 { 3962 {
4040 args["[EXTRA]"] = extra; 3963 args["EXTRA"] = extra;
4041 } 3964 }
4042 args["[URL]"] = BUY_CURRENCY_URL; 3965 args["URL"] = BUY_CURRENCY_URL;
4043 gViewerWindow->alertXml("PromptGoToCurrencyPage", args, 3966 LLNotifications::instance().add("PromptGoToCurrencyPage", args, LLSD(), callback_show_buy_currency);
4044 callback_show_buy_currency);
4045} 3967}
4046 3968
4047void handle_buy_currency(void*) 3969void handle_buy_currency(void*)
@@ -4105,18 +4027,6 @@ BOOL sitting_on_selection()
4105 return (avatar->mIsSitting && avatar->getRoot() == root_object); 4027 return (avatar->mIsSitting && avatar->getRoot() == root_object);
4106} 4028}
4107 4029
4108class LLToolsSaveToInventory : public view_listener_t
4109{
4110 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4111 {
4112 if(enable_save_into_inventory(NULL))
4113 {
4114 derez_objects(DRD_SAVE_INTO_AGENT_INVENTORY, LLUUID::null);
4115 }
4116 return true;
4117 }
4118};
4119
4120class LLToolsSaveToObjectInventory : public view_listener_t 4030class LLToolsSaveToObjectInventory : public view_listener_t
4121{ 4031{
4122 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4032 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -4221,29 +4131,29 @@ class LLToolsLink : public view_listener_t
4221 { 4131 {
4222 if(!LLSelectMgr::getInstance()->selectGetAllRootsValid()) 4132 if(!LLSelectMgr::getInstance()->selectGetAllRootsValid())
4223 { 4133 {
4224 LLNotifyBox::showXml("UnableToLinkWhileDownloading"); 4134 LLNotifications::instance().add("UnableToLinkWhileDownloading");
4225 return true; 4135 return true;
4226 } 4136 }
4227 4137
4228 S32 object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); 4138 S32 object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
4229 if (object_count > MAX_CHILDREN_PER_TASK + 1) 4139 if (object_count > MAX_CHILDREN_PER_TASK + 1)
4230 { 4140 {
4231 LLStringUtil::format_map_t args; 4141 LLSD args;
4232 args["[COUNT]"] = llformat("%d", object_count); 4142 args["COUNT"] = llformat("%d", object_count);
4233 int max = MAX_CHILDREN_PER_TASK+1; 4143 int max = MAX_CHILDREN_PER_TASK+1;
4234 args["[MAX]"] = llformat("%d", max); 4144 args["MAX"] = llformat("%d", max);
4235 gViewerWindow->alertXml("UnableToLinkObjects", args); 4145 LLNotifications::instance().add("UnableToLinkObjects", args);
4236 return true; 4146 return true;
4237 } 4147 }
4238 4148
4239 if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() < 2) 4149 if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() < 2)
4240 { 4150 {
4241 gViewerWindow->alertXml("CannotLinkIncompleteSet"); 4151 LLNotifications::instance().add("CannotLinkIncompleteSet");
4242 return true; 4152 return true;
4243 } 4153 }
4244 if(!LLSelectMgr::getInstance()->selectGetRootsModify()) 4154 if(!LLSelectMgr::getInstance()->selectGetRootsModify())
4245 { 4155 {
4246 gViewerWindow->alertXml("CannotLinkModify"); 4156 LLNotifications::instance().add("CannotLinkModify");
4247 return true; 4157 return true;
4248 } 4158 }
4249 LLUUID owner_id; 4159 LLUUID owner_id;
@@ -4253,7 +4163,7 @@ class LLToolsLink : public view_listener_t
4253 // we don't actually care if you're the owner, but novices are 4163 // we don't actually care if you're the owner, but novices are
4254 // the most likely to be stumped by this one, so offer the 4164 // the most likely to be stumped by this one, so offer the
4255 // easiest and most likely solution. 4165 // easiest and most likely solution.
4256 gViewerWindow->alertXml("CannotLinkDifferentOwners"); 4166 LLNotifications::instance().add("CannotLinkDifferentOwners");
4257 return true; 4167 return true;
4258 } 4168 }
4259 LLSelectMgr::getInstance()->sendLink(); 4169 LLSelectMgr::getInstance()->sendLink();
@@ -4287,12 +4197,7 @@ class LLToolsStopAllAnimations : public view_listener_t
4287{ 4197{
4288 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4198 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4289 { 4199 {
4290 LLVOAvatar* avatarp = gAgent.getAvatarObject(); 4200 gAgent.stopCurrentAnimations();
4291 if (avatarp)
4292 {
4293 avatarp->deactivateAllMotions();
4294 avatarp->startDefaultMotions();
4295 }
4296 return true; 4201 return true;
4297 } 4202 }
4298}; 4203};
@@ -4497,6 +4402,16 @@ void handle_force_delete(void*)
4497 LLSelectMgr::getInstance()->selectForceDelete(); 4402 LLSelectMgr::getInstance()->selectForceDelete();
4498} 4403}
4499 4404
4405class LLViewEnableJoystickFlycam : public view_listener_t
4406{
4407 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4408 {
4409 bool new_value = (gSavedSettings.getBOOL("JoystickEnabled") && gSavedSettings.getBOOL("JoystickFlycamEnabled"));
4410 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
4411 return true;
4412 }
4413};
4414
4500class LLViewEnableLastChatter : public view_listener_t 4415class LLViewEnableLastChatter : public view_listener_t
4501{ 4416{
4502 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4417 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -4659,22 +4574,6 @@ void toggle_debug_menus(void*)
4659} 4574}
4660 4575
4661 4576
4662void toggle_map( void* user_data )
4663{
4664 // Toggle the item
4665 BOOL checked = gSavedSettings.getBOOL( static_cast<char*>(user_data) );
4666 gSavedSettings.setBOOL( static_cast<char*>(user_data), !checked );
4667 if (checked)
4668 {
4669 gFloaterMap->close();
4670 }
4671 else
4672 {
4673 gFloaterMap->open(); /* Flawfinder: ignore */
4674 }
4675}
4676
4677
4678// LLUUID gExporterRequestID; 4577// LLUUID gExporterRequestID;
4679// std::string gExportDirectory; 4578// std::string gExportDirectory;
4680 4579
@@ -4812,7 +4711,7 @@ class LLWorldSetBusy : public view_listener_t
4812 else 4711 else
4813 { 4712 {
4814 gAgent.setBusy(); 4713 gAgent.setBusy();
4815 gViewerWindow->alertXml("BusyModeSet"); 4714 LLNotifications::instance().add("BusyModeSet");
4816 } 4715 }
4817 return true; 4716 return true;
4818 } 4717 }
@@ -4838,7 +4737,7 @@ class LLWorldCreateLandmark : public view_listener_t
4838 if (!agent_parcel->getAllowLandmark() 4737 if (!agent_parcel->getAllowLandmark()
4839 && !LLViewerParcelMgr::isParcelOwnedByAgent(agent_parcel, GP_LAND_ALLOW_LANDMARK)) 4738 && !LLViewerParcelMgr::isParcelOwnedByAgent(agent_parcel, GP_LAND_ALLOW_LANDMARK))
4840 { 4739 {
4841 gViewerWindow->alertXml("CannotCreateLandmarkNotOwner"); 4740 LLNotifications::instance().add("CannotCreateLandmarkNotOwner");
4842 return true; 4741 return true;
4843 } 4742 }
4844 4743
@@ -4945,16 +4844,14 @@ class LLAvatarAddFriend : public view_listener_t
4945 } 4844 }
4946}; 4845};
4947 4846
4948void complete_give_money(S32 option, void* user_data) 4847bool complete_give_money(const LLSD& notification, const LLSD& response, LLObjectSelectionHandle handle)
4949{ 4848{
4849 S32 option = LLNotification::getSelectedOption(notification, response);
4950 if (option == 0) 4850 if (option == 0)
4951 { 4851 {
4952 gAgent.clearBusy(); 4852 gAgent.clearBusy();
4953 } 4853 }
4954 4854
4955 LLObjectSelectionHandle handle(*(LLObjectSelectionHandle*)user_data);
4956 delete (LLObjectSelectionHandle*)user_data;
4957
4958 LLViewerObject* objectp = handle->getPrimaryObject(); 4855 LLViewerObject* objectp = handle->getPrimaryObject();
4959 4856
4960 // Show avatar's name if paying attachment 4857 // Show avatar's name if paying attachment
@@ -4980,19 +4877,22 @@ void complete_give_money(S32 option, void* user_data)
4980 LLFloaterPay::payViaObject(&give_money, objectp->getID()); 4877 LLFloaterPay::payViaObject(&give_money, objectp->getID());
4981 } 4878 }
4982 } 4879 }
4880 return false;
4983} 4881}
4984 4882
4985bool handle_give_money_dialog() 4883bool handle_give_money_dialog()
4986{ 4884{
4987 LLObjectSelectionHandle* handlep = new LLObjectSelectionHandle(LLSelectMgr::getInstance()->getSelection()); 4885 LLNotification::Params params("BusyModePay");
4886 params.functor(boost::bind(complete_give_money, _1, _2, LLSelectMgr::getInstance()->getSelection()));
4887
4988 if (gAgent.getBusy()) 4888 if (gAgent.getBusy())
4989 { 4889 {
4990 // warn users of being in busy mode during a transaction 4890 // warn users of being in busy mode during a transaction
4991 gViewerWindow->alertXml("BusyModePay", complete_give_money, handlep); 4891 LLNotifications::instance().add(params);
4992 } 4892 }
4993 else 4893 else
4994 { 4894 {
4995 complete_give_money(1, handlep); 4895 LLNotifications::instance().forceResponse(params, 1);
4996 } 4896 }
4997 return true; 4897 return true;
4998} 4898}
@@ -5143,7 +5043,7 @@ class LLShowFloater : public view_listener_t
5143 } 5043 }
5144 else if (floater_name == "appearance") 5044 else if (floater_name == "appearance")
5145 { 5045 {
5146 if (gAgent.getWearablesLoaded()) 5046 if (gAgent.areWearablesLoaded())
5147 { 5047 {
5148 gAgent.changeCameraToCustomizeAvatar(); 5048 gAgent.changeCameraToCustomizeAvatar();
5149 } 5049 }
@@ -5190,11 +5090,11 @@ class LLShowFloater : public view_listener_t
5190 } 5090 }
5191 else if (floater_name == "mini map") 5091 else if (floater_name == "mini map")
5192 { 5092 {
5193 LLFloaterMap::toggle(NULL); 5093 LLFloaterMap::toggleInstance();
5194 } 5094 }
5195 else if (floater_name == "stat bar") 5095 else if (floater_name == "stat bar")
5196 { 5096 {
5197 gDebugView->mFloaterStatsp->setVisible(!gDebugView->mFloaterStatsp->getVisible()); 5097 LLFloaterStats::toggleInstance();
5198 } 5098 }
5199 else if (floater_name == "my land") 5099 else if (floater_name == "my land")
5200 { 5100 {
@@ -5277,6 +5177,10 @@ class LLShowFloater : public view_listener_t
5277 { 5177 {
5278 LLFloaterBeacons::toggleInstance(LLSD()); 5178 LLFloaterBeacons::toggleInstance(LLSD());
5279 } 5179 }
5180 else if (floater_name == "perm prefs")
5181 {
5182 LLFloaterPerms::toggleInstance(LLSD());
5183 }
5280 return true; 5184 return true;
5281 } 5185 }
5282}; 5186};
@@ -5322,7 +5226,7 @@ class LLFloaterVisible : public view_listener_t
5322 } 5226 }
5323 else if (floater_name == "stat bar") 5227 else if (floater_name == "stat bar")
5324 { 5228 {
5325 new_value = gDebugView->mFloaterStatsp->getVisible(); 5229 new_value = LLFloaterStats::instanceVisible();
5326 } 5230 }
5327 else if (floater_name == "active speakers") 5231 else if (floater_name == "active speakers")
5328 { 5232 {
@@ -5342,14 +5246,14 @@ class LLFloaterVisible : public view_listener_t
5342 } 5246 }
5343}; 5247};
5344 5248
5345void callback_show_url(S32 option, void* data) 5249bool callback_show_url(const LLSD& notification, const LLSD& response)
5346{ 5250{
5347 std::string* urlp = (std::string*)data; 5251 S32 option = LLNotification::getSelectedOption(notification, response);
5348 if (0 == option) 5252 if (0 == option)
5349 { 5253 {
5350 LLWeb::loadURL(*urlp); 5254 LLWeb::loadURL(notification["payload"]["url"].asString());
5351 } 5255 }
5352 delete urlp; 5256 return false;
5353} 5257}
5354 5258
5355class LLPromptShowURL : public view_listener_t 5259class LLPromptShowURL : public view_listener_t
@@ -5362,8 +5266,17 @@ class LLPromptShowURL : public view_listener_t
5362 { 5266 {
5363 std::string alert = param.substr(0, offset); 5267 std::string alert = param.substr(0, offset);
5364 std::string url = param.substr(offset+1); 5268 std::string url = param.substr(offset+1);
5365 std::string* url_copy = new std::string(url); 5269
5366 gViewerWindow->alertXml(alert, callback_show_url, url_copy); 5270 if(gSavedSettings.getBOOL("UseExternalBrowser"))
5271 {
5272 LLSD payload;
5273 payload["url"] = url;
5274 LLNotifications::instance().add(alert, LLSD(), payload, callback_show_url);
5275 }
5276 else
5277 {
5278 LLWeb::loadURL(url);
5279 }
5367 } 5280 }
5368 else 5281 else
5369 { 5282 {
@@ -5373,6 +5286,39 @@ class LLPromptShowURL : public view_listener_t
5373 } 5286 }
5374}; 5287};
5375 5288
5289bool callback_show_file(const LLSD& notification, const LLSD& response)
5290{
5291 S32 option = LLNotification::getSelectedOption(notification, response);
5292 if (0 == option)
5293 {
5294 LLWeb::loadURL(notification["payload"]["url"]);
5295 }
5296 return false;
5297}
5298
5299class LLPromptShowFile : public view_listener_t
5300{
5301 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
5302 {
5303 std::string param = userdata.asString();
5304 std::string::size_type offset = param.find(",");
5305 if (offset != param.npos)
5306 {
5307 std::string alert = param.substr(0, offset);
5308 std::string file = param.substr(offset+1);
5309
5310 LLSD payload;
5311 payload["url"] = file;
5312 LLNotifications::instance().add(alert, LLSD(), payload, callback_show_file);
5313 }
5314 else
5315 {
5316 llinfos << "PromptShowFile invalid parameters! Expecting \"ALERT,FILE\"." << llendl;
5317 }
5318 return true;
5319 }
5320};
5321
5376class LLShowAgentProfile : public view_listener_t 5322class LLShowAgentProfile : public view_listener_t
5377{ 5323{
5378 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 5324 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -5461,7 +5407,6 @@ class LLLandEdit : public view_listener_t
5461 5407
5462 LLViewerParcelMgr::getInstance()->selectParcelAt( LLToolPie::getInstance()->getPick().mPosGlobal ); 5408 LLViewerParcelMgr::getInstance()->selectParcelAt( LLToolPie::getInstance()->getPick().mPosGlobal );
5463 5409
5464 gFloaterTools->showMore(TRUE);
5465 gFloaterView->bringToFront( gFloaterTools ); 5410 gFloaterView->bringToFront( gFloaterTools );
5466 5411
5467 // Switch to land edit toolset 5412 // Switch to land edit toolset
@@ -5772,8 +5717,7 @@ class LLAttachmentEnableDrop : public view_listener_t
5772{ 5717{
5773 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 5718 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
5774 { 5719 {
5775 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); 5720 BOOL can_build = gAgent.isGodlike() || (LLViewerParcelMgr::getInstance()->agentCanBuild());
5776 BOOL can_build = gAgent.isGodlike() || (parcel && parcel->getAllowModify());
5777 5721
5778 //Add an inventory observer to only allow dropping the newly attached item 5722 //Add an inventory observer to only allow dropping the newly attached item
5779 //once it exists in your inventory. Look at Jira 2422. 5723 //once it exists in your inventory. Look at Jira 2422.
@@ -6004,11 +5948,11 @@ void queue_actions(LLFloaterScriptQueue* q, const std::string& noscriptmsg, cons
6004 { 5948 {
6005 if ( !func.scripted ) 5949 if ( !func.scripted )
6006 { 5950 {
6007 gViewerWindow->alertXml(noscriptmsg); 5951 LLNotifications::instance().add(noscriptmsg);
6008 } 5952 }
6009 else if ( !func.modifiable ) 5953 else if ( !func.modifiable )
6010 { 5954 {
6011 gViewerWindow->alertXml(nomodmsg); 5955 LLNotifications::instance().add(nomodmsg);
6012 } 5956 }
6013 else 5957 else
6014 { 5958 {
@@ -6229,13 +6173,6 @@ class LLToggleControl : public view_listener_t
6229 } 6173 }
6230}; 6174};
6231 6175
6232// As above, but can be a callback from a LLCheckboxCtrl
6233void check_toggle_control( LLUICtrl *, void* user_data )
6234{
6235 BOOL checked = gSavedSettings.getBOOL( static_cast<char*>(user_data) );
6236 gSavedSettings.setBOOL( static_cast<char*>(user_data), !checked );
6237}
6238
6239BOOL menu_check_control( void* user_data) 6176BOOL menu_check_control( void* user_data)
6240{ 6177{
6241 return gSavedSettings.getBOOL((char*)user_data); 6178 return gSavedSettings.getBOOL((char*)user_data);
@@ -6462,16 +6399,6 @@ BOOL enable_save_into_inventory(void*)
6462 return FALSE; 6399 return FALSE;
6463} 6400}
6464 6401
6465class LLToolsEnableSaveToInventory : public view_listener_t
6466{
6467 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
6468 {
6469 bool new_value = enable_save_into_inventory(NULL);
6470 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
6471 return true;
6472 }
6473};
6474
6475BOOL enable_save_into_task_inventory(void*) 6402BOOL enable_save_into_task_inventory(void*)
6476{ 6403{
6477 LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); 6404 LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
@@ -6761,12 +6688,12 @@ void handle_debug_avatar_textures(void*)
6761 6688
6762void handle_grab_texture(void* data) 6689void handle_grab_texture(void* data)
6763{ 6690{
6764 LLVOAvatar::ETextureIndex index = (LLVOAvatar::ETextureIndex)((intptr_t)data); 6691 ETextureIndex index = (ETextureIndex)((intptr_t)data);
6765 LLVOAvatar* avatar = gAgent.getAvatarObject(); 6692 LLVOAvatar* avatar = gAgent.getAvatarObject();
6766 if ( avatar ) 6693 if ( avatar )
6767 { 6694 {
6768 const LLUUID& asset_id = avatar->grabLocalTexture(index); 6695 const LLUUID& asset_id = avatar->grabLocalTexture(index);
6769 llinfos << "Adding baked texture " << asset_id << " to inventory." << llendl; 6696 LL_INFOS("texture") << "Adding baked texture " << asset_id << " to inventory." << llendl;
6770 LLAssetType::EType asset_type = LLAssetType::AT_TEXTURE; 6697 LLAssetType::EType asset_type = LLAssetType::AT_TEXTURE;
6771 LLInventoryType::EType inv_type = LLInventoryType::IT_TEXTURE; 6698 LLInventoryType::EType inv_type = LLInventoryType::IT_TEXTURE;
6772 LLUUID folder_id(gInventory.findCategoryUUIDForType(asset_type)); 6699 LLUUID folder_id(gInventory.findCategoryUUIDForType(asset_type));
@@ -6775,21 +6702,24 @@ void handle_grab_texture(void* data)
6775 std::string name = "Baked "; 6702 std::string name = "Baked ";
6776 switch (index) 6703 switch (index)
6777 { 6704 {
6778 case LLVOAvatar::TEX_EYES_BAKED: 6705 case TEX_EYES_BAKED:
6779 name.append("Iris"); 6706 name.append("Iris");
6780 break; 6707 break;
6781 case LLVOAvatar::TEX_HEAD_BAKED: 6708 case TEX_HEAD_BAKED:
6782 name.append("Head"); 6709 name.append("Head");
6783 break; 6710 break;
6784 case LLVOAvatar::TEX_UPPER_BAKED: 6711 case TEX_UPPER_BAKED:
6785 name.append("Upper Body"); 6712 name.append("Upper Body");
6786 break; 6713 break;
6787 case LLVOAvatar::TEX_LOWER_BAKED: 6714 case TEX_LOWER_BAKED:
6788 name.append("Lower Body"); 6715 name.append("Lower Body");
6789 break; 6716 break;
6790 case LLVOAvatar::TEX_SKIRT_BAKED: 6717 case TEX_SKIRT_BAKED:
6791 name.append("Skirt"); 6718 name.append("Skirt");
6792 break; 6719 break;
6720 case TEX_HAIR_BAKED:
6721 name.append("Hair");
6722 break;
6793 default: 6723 default:
6794 name.append("Unknown"); 6724 name.append("Unknown");
6795 break; 6725 break;
@@ -6851,7 +6781,7 @@ void handle_grab_texture(void* data)
6851 6781
6852BOOL enable_grab_texture(void* data) 6782BOOL enable_grab_texture(void* data)
6853{ 6783{
6854 LLVOAvatar::ETextureIndex index = (LLVOAvatar::ETextureIndex)((intptr_t)data); 6784 ETextureIndex index = (ETextureIndex)((intptr_t)data);
6855 LLVOAvatar* avatar = gAgent.getAvatarObject(); 6785 LLVOAvatar* avatar = gAgent.getAvatarObject();
6856 if ( avatar ) 6786 if ( avatar )
6857 { 6787 {
@@ -7002,7 +6932,7 @@ void handle_save_to_xml(void*)
7002 LLFloater* frontmost = gFloaterView->getFrontmost(); 6932 LLFloater* frontmost = gFloaterView->getFrontmost();
7003 if (!frontmost) 6933 if (!frontmost)
7004 { 6934 {
7005 gViewerWindow->alertXml("NoFrontmostFloater"); 6935 LLNotifications::instance().add("NoFrontmostFloater");
7006 return; 6936 return;
7007 } 6937 }
7008 6938
@@ -7035,17 +6965,54 @@ void handle_load_from_xml(void*)
7035 } 6965 }
7036} 6966}
7037 6967
7038void handle_slurl_test(void*) 6968void handle_web_browser_test(void*)
7039{ 6969{
7040 const bool open_links_externally = false; 6970 const bool open_links_externally = false;
7041 const bool open_app_slurls = true; 6971 const bool open_app_slurls = true;
7042 LLFloaterHtml::getInstance()->show( 6972 LLFloaterHtml::getInstance()->show(
7043 "http://secondlife.com/app/search/slurls.html", 6973 "http://secondlife.com/app/search/slurls.html",
7044 "SLURL Test", 6974 "Web Browser Test",
7045 open_links_externally, 6975 open_links_externally,
7046 open_app_slurls); 6976 open_app_slurls);
7047} 6977}
7048 6978
6979void handle_buy_currency_test(void*)
6980{
6981 std::string url =
6982 "http://sarahd-sl-13041.webdev.lindenlab.com/app/lindex/index.php?agent_id=[AGENT_ID]&secure_session_id=[SESSION_ID]&lang=[LANGUAGE]";
6983
6984 LLStringUtil::format_map_t replace;
6985 replace["[AGENT_ID]"] = gAgent.getID().asString();
6986 replace["[SESSION_ID]"] = gAgent.getSecureSessionID().asString();
6987
6988 // *TODO: Replace with call to LLUI::getLanguage() after windows-setup
6989 // branch merges in. JC
6990 std::string language = "en-us";
6991 language = gSavedSettings.getString("Language");
6992 if (language.empty() || language == "default")
6993 {
6994 language = gSavedSettings.getString("InstallLanguage");
6995 }
6996 if (language.empty() || language == "default")
6997 {
6998 language = gSavedSettings.getString("SystemLanguage");
6999 }
7000 if (language.empty() || language == "default")
7001 {
7002 language = "en-us";
7003 }
7004
7005 replace["[LANGUAGE]"] = language;
7006 LLStringUtil::format(url, replace);
7007
7008 llinfos << "buy currency url " << url << llendl;
7009
7010 LLFloaterHtmlCurrency* floater = LLFloaterHtmlCurrency::showInstance(url);
7011 // Needed so we can use secondlife:///app/floater/self/close SLURLs
7012 floater->setTrusted(true);
7013 floater->center();
7014}
7015
7049void handle_rebake_textures(void*) 7016void handle_rebake_textures(void*)
7050{ 7017{
7051 LLVOAvatar* avatar = gAgent.getAvatarObject(); 7018 LLVOAvatar* avatar = gAgent.getAvatarObject();
@@ -7417,6 +7384,37 @@ static void addMenu(view_listener_t *menu, const std::string& name)
7417 7384
7418void initialize_menus() 7385void initialize_menus()
7419{ 7386{
7387 // A parameterized event handler used as ctrl-8/9/0 zoom controls below.
7388 class LLZoomer : public view_listener_t
7389 {
7390 public:
7391 // The "mult" parameter says whether "val" is a multiplier or used to set the value.
7392 LLZoomer(F32 val, bool mult=true) : mVal(val), mMult(mult) {}
7393 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7394 {
7395 F32 new_fov_rad = mMult ? LLViewerCamera::getInstance()->getDefaultFOV() * mVal : mVal;
7396 LLViewerCamera::getInstance()->setDefaultFOV(new_fov_rad);
7397 gSavedSettings.setF32("CameraAngle", LLViewerCamera::getInstance()->getView()); // setView may have clamped it.
7398 return true;
7399 }
7400 private:
7401 F32 mVal;
7402 bool mMult;
7403 };
7404
7405 class LLAvatarReportAbuse : public view_listener_t
7406 {
7407 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7408 {
7409 LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
7410 if(avatar)
7411 {
7412 LLFloaterReporter::showFromObject(avatar->getID());
7413 }
7414 return true;
7415 }
7416 };
7417
7420 // File menu 7418 // File menu
7421 init_menu_file(); 7419 init_menu_file();
7422 7420
@@ -7456,13 +7454,14 @@ void initialize_menus()
7456 addMenu(new LLViewHighlightTransparent(), "View.HighlightTransparent"); 7454 addMenu(new LLViewHighlightTransparent(), "View.HighlightTransparent");
7457 addMenu(new LLViewToggleRenderType(), "View.ToggleRenderType"); 7455 addMenu(new LLViewToggleRenderType(), "View.ToggleRenderType");
7458 addMenu(new LLViewShowHUDAttachments(), "View.ShowHUDAttachments"); 7456 addMenu(new LLViewShowHUDAttachments(), "View.ShowHUDAttachments");
7459 addMenu(new LLViewZoomOut(), "View.ZoomOut"); 7457 addMenu(new LLZoomer(1.2f), "View.ZoomOut");
7460 addMenu(new LLViewZoomIn(), "View.ZoomIn"); 7458 addMenu(new LLZoomer(1/1.2f), "View.ZoomIn");
7461 addMenu(new LLViewZoomDefault(), "View.ZoomDefault"); 7459 addMenu(new LLZoomer(DEFAULT_FIELD_OF_VIEW, false), "View.ZoomDefault");
7462 addMenu(new LLViewFullscreen(), "View.Fullscreen"); 7460 addMenu(new LLViewFullscreen(), "View.Fullscreen");
7463 addMenu(new LLViewDefaultUISize(), "View.DefaultUISize"); 7461 addMenu(new LLViewDefaultUISize(), "View.DefaultUISize");
7464 7462
7465 addMenu(new LLViewEnableMouselook(), "View.EnableMouselook"); 7463 addMenu(new LLViewEnableMouselook(), "View.EnableMouselook");
7464 addMenu(new LLViewEnableJoystickFlycam(), "View.EnableJoystickFlycam");
7466 addMenu(new LLViewEnableLastChatter(), "View.EnableLastChatter"); 7465 addMenu(new LLViewEnableLastChatter(), "View.EnableLastChatter");
7467 7466
7468 addMenu(new LLViewCheckBuildMode(), "View.CheckBuildMode"); 7467 addMenu(new LLViewCheckBuildMode(), "View.CheckBuildMode");
@@ -7513,7 +7512,6 @@ void initialize_menus()
7513 addMenu(new LLToolsLookAtSelection(), "Tools.LookAtSelection"); 7512 addMenu(new LLToolsLookAtSelection(), "Tools.LookAtSelection");
7514 addMenu(new LLToolsBuyOrTake(), "Tools.BuyOrTake"); 7513 addMenu(new LLToolsBuyOrTake(), "Tools.BuyOrTake");
7515 addMenu(new LLToolsTakeCopy(), "Tools.TakeCopy"); 7514 addMenu(new LLToolsTakeCopy(), "Tools.TakeCopy");
7516 addMenu(new LLToolsSaveToInventory(), "Tools.SaveToInventory");
7517 addMenu(new LLToolsSaveToObjectInventory(), "Tools.SaveToObjectInventory"); 7515 addMenu(new LLToolsSaveToObjectInventory(), "Tools.SaveToObjectInventory");
7518 addMenu(new LLToolsSelectedScriptAction(), "Tools.SelectedScriptAction"); 7516 addMenu(new LLToolsSelectedScriptAction(), "Tools.SelectedScriptAction");
7519 7517
@@ -7522,7 +7520,6 @@ void initialize_menus()
7522 addMenu(new LLToolsEnableUnlink(), "Tools.EnableUnlink"); 7520 addMenu(new LLToolsEnableUnlink(), "Tools.EnableUnlink");
7523 addMenu(new LLToolsEnableBuyOrTake(), "Tools.EnableBuyOrTake"); 7521 addMenu(new LLToolsEnableBuyOrTake(), "Tools.EnableBuyOrTake");
7524 addMenu(new LLToolsEnableTakeCopy(), "Tools.EnableTakeCopy"); 7522 addMenu(new LLToolsEnableTakeCopy(), "Tools.EnableTakeCopy");
7525 addMenu(new LLToolsEnableSaveToInventory(), "Tools.SaveToInventory");
7526 addMenu(new LLToolsEnableSaveToObjectInventory(), "Tools.SaveToObjectInventory"); 7523 addMenu(new LLToolsEnableSaveToObjectInventory(), "Tools.SaveToObjectInventory");
7527 7524
7528 /*addMenu(new LLToolsVisibleBuyObject(), "Tools.VisibleBuyObject"); 7525 /*addMenu(new LLToolsVisibleBuyObject(), "Tools.VisibleBuyObject");
@@ -7549,6 +7546,7 @@ void initialize_menus()
7549 addMenu(new LLAvatarGiveCard(), "Avatar.GiveCard"); 7546 addMenu(new LLAvatarGiveCard(), "Avatar.GiveCard");
7550 addMenu(new LLAvatarEject(), "Avatar.Eject"); 7547 addMenu(new LLAvatarEject(), "Avatar.Eject");
7551 addMenu(new LLAvatarSendIM(), "Avatar.SendIM"); 7548 addMenu(new LLAvatarSendIM(), "Avatar.SendIM");
7549 addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse");
7552 7550
7553 addMenu(new LLObjectEnableMute(), "Avatar.EnableMute"); 7551 addMenu(new LLObjectEnableMute(), "Avatar.EnableMute");
7554 addMenu(new LLAvatarEnableAddFriend(), "Avatar.EnableAddFriend"); 7552 addMenu(new LLAvatarEnableAddFriend(), "Avatar.EnableAddFriend");