aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llviewermenu.cpp568
1 files changed, 180 insertions, 388 deletions
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index 4081e97..9374a36 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$ 5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2002-2008, Linden Research, Inc. 7 * Copyright (c) 2002-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -85,6 +85,7 @@
85#include "llfloateranimpreview.h" 85#include "llfloateranimpreview.h"
86#include "llfloateravatarinfo.h" 86#include "llfloateravatarinfo.h"
87#include "llfloateravatartextures.h" 87#include "llfloateravatartextures.h"
88#include "llfloaterbeacons.h"
88#include "llfloaterbuildoptions.h" 89#include "llfloaterbuildoptions.h"
89#include "llfloaterbulkpermission.h" 90#include "llfloaterbulkpermission.h"
90#include "llfloaterbump.h" 91#include "llfloaterbump.h"
@@ -323,13 +324,6 @@ void handle_talk_to(void *userdata);
323// Debug menu 324// Debug menu
324void show_permissions_control(void*); 325void show_permissions_control(void*);
325void toggle_build_options(void* user_data); 326void toggle_build_options(void* user_data);
326#if 0 // Unused
327void handle_audio_status_1(void*);
328void handle_audio_status_2(void*);
329void handle_audio_status_3(void*);
330void handle_audio_status_4(void*);
331#endif
332void manage_landmarks(void*);
333void reload_ui(void*); 327void reload_ui(void*);
334void handle_agent_stop_moving(void*); 328void handle_agent_stop_moving(void*);
335void print_packets_lost(void*); 329void print_packets_lost(void*);
@@ -409,6 +403,7 @@ void force_error_llerror(void *);
409void force_error_bad_memory_access(void *); 403void force_error_bad_memory_access(void *);
410void force_error_infinite_loop(void *); 404void force_error_infinite_loop(void *);
411void force_error_software_exception(void *); 405void force_error_software_exception(void *);
406void force_error_driver_crash(void *);
412 407
413void handle_stopall(void*); 408void handle_stopall(void*);
414//void handle_hinge(void*); 409//void handle_hinge(void*);
@@ -935,6 +930,8 @@ void init_client_menu(LLMenuGL* menu)
935 sub->append(new LLMenuItemCallGL("Force LLError And Crash", &force_error_llerror)); 930 sub->append(new LLMenuItemCallGL("Force LLError And Crash", &force_error_llerror));
936 sub->append(new LLMenuItemCallGL("Force Bad Memory Access", &force_error_bad_memory_access)); 931 sub->append(new LLMenuItemCallGL("Force Bad Memory Access", &force_error_bad_memory_access));
937 sub->append(new LLMenuItemCallGL("Force Infinite Loop", &force_error_infinite_loop)); 932 sub->append(new LLMenuItemCallGL("Force Infinite Loop", &force_error_infinite_loop));
933 sub->append(new LLMenuItemCallGL("Force Driver Crash", &force_error_driver_crash));
934 sub->append(new LLMenuItemCallGL("Force Disconnect Viewer", &handle_disconnect_viewer));
938 // *NOTE:Mani this isn't handled yet... sub->append(new LLMenuItemCallGL("Force Software Exception", &force_error_unhandled_exception)); 935 // *NOTE:Mani this isn't handled yet... sub->append(new LLMenuItemCallGL("Force Software Exception", &force_error_unhandled_exception));
939 sub->createJumpKeys(); 936 sub->createJumpKeys();
940 menu->appendMenu(sub); 937 menu->appendMenu(sub);
@@ -1018,7 +1015,6 @@ void init_debug_ui_menu(LLMenuGL* menu)
1018{ 1015{
1019 menu->append(new LLMenuItemCallGL("SLURL Test", &handle_slurl_test)); 1016 menu->append(new LLMenuItemCallGL("SLURL Test", &handle_slurl_test));
1020 menu->append(new LLMenuItemCallGL("Editable UI", &edit_ui)); 1017 menu->append(new LLMenuItemCallGL("Editable UI", &edit_ui));
1021 menu->append(new LLMenuItemToggleGL("Async Keystrokes", &gHandleKeysAsync));
1022 menu->append(new LLMenuItemCallGL( "Dump SelectMgr", &dump_select_mgr)); 1018 menu->append(new LLMenuItemCallGL( "Dump SelectMgr", &dump_select_mgr));
1023 menu->append(new LLMenuItemCallGL( "Dump Inventory", &dump_inventory)); 1019 menu->append(new LLMenuItemCallGL( "Dump Inventory", &dump_inventory));
1024 menu->append(new LLMenuItemCallGL( "Dump Focus Holder", &handle_dump_focus, NULL, NULL, 'F', MASK_ALT | MASK_CONTROL)); 1020 menu->append(new LLMenuItemCallGL( "Dump Focus Holder", &handle_dump_focus, NULL, NULL, 'F', MASK_ALT | MASK_CONTROL));
@@ -1149,10 +1145,6 @@ void init_debug_rendering_menu(LLMenuGL* menu)
1149 &LLPipeline::toggleRenderDebugFeature, NULL, 1145 &LLPipeline::toggleRenderDebugFeature, NULL,
1150 &LLPipeline::toggleRenderDebugFeatureControl, 1146 &LLPipeline::toggleRenderDebugFeatureControl,
1151 (void*)LLPipeline::RENDER_DEBUG_FEATURE_FOG, KEY_F6, MASK_ALT|MASK_CONTROL)); 1147 (void*)LLPipeline::RENDER_DEBUG_FEATURE_FOG, KEY_F6, MASK_ALT|MASK_CONTROL));
1152 sub_menu->append(new LLMenuItemCheckGL("Palletized Textures",
1153 &LLPipeline::toggleRenderDebugFeature, NULL,
1154 &LLPipeline::toggleRenderDebugFeatureControl,
1155 (void*)LLPipeline::RENDER_DEBUG_FEATURE_PALETTE, KEY_F7, MASK_ALT|MASK_CONTROL));
1156 sub_menu->append(new LLMenuItemCheckGL("Test FRInfo", 1148 sub_menu->append(new LLMenuItemCheckGL("Test FRInfo",
1157 &LLPipeline::toggleRenderDebugFeature, NULL, 1149 &LLPipeline::toggleRenderDebugFeature, NULL,
1158 &LLPipeline::toggleRenderDebugFeatureControl, 1150 &LLPipeline::toggleRenderDebugFeatureControl,
@@ -1203,9 +1195,6 @@ void init_debug_rendering_menu(LLMenuGL* menu)
1203 sub_menu->append(new LLMenuItemCheckGL("Face Area (sqrt(A))",&LLPipeline::toggleRenderDebug, NULL, 1195 sub_menu->append(new LLMenuItemCheckGL("Face Area (sqrt(A))",&LLPipeline::toggleRenderDebug, NULL,
1204 &LLPipeline::toggleRenderDebugControl, 1196 &LLPipeline::toggleRenderDebugControl,
1205 (void*)LLPipeline::RENDER_DEBUG_FACE_AREA)); 1197 (void*)LLPipeline::RENDER_DEBUG_FACE_AREA));
1206 sub_menu->append(new LLMenuItemCheckGL("Pick Render", &LLPipeline::toggleRenderDebug, NULL,
1207 &LLPipeline::toggleRenderDebugControl,
1208 (void*)LLPipeline::RENDER_DEBUG_PICKING));
1209 sub_menu->append(new LLMenuItemCheckGL("Lights", &LLPipeline::toggleRenderDebug, NULL, 1198 sub_menu->append(new LLMenuItemCheckGL("Lights", &LLPipeline::toggleRenderDebug, NULL,
1210 &LLPipeline::toggleRenderDebugControl, 1199 &LLPipeline::toggleRenderDebugControl,
1211 (void*)LLPipeline::RENDER_DEBUG_LIGHTS)); 1200 (void*)LLPipeline::RENDER_DEBUG_LIGHTS));
@@ -1224,9 +1213,7 @@ void init_debug_rendering_menu(LLMenuGL* menu)
1224 sub_menu->append(new LLMenuItemCheckGL("Sculpt", &LLPipeline::toggleRenderDebug, NULL, 1213 sub_menu->append(new LLMenuItemCheckGL("Sculpt", &LLPipeline::toggleRenderDebug, NULL,
1225 &LLPipeline::toggleRenderDebugControl, 1214 &LLPipeline::toggleRenderDebugControl,
1226 (void*)LLPipeline::RENDER_DEBUG_SCULPTED)); 1215 (void*)LLPipeline::RENDER_DEBUG_SCULPTED));
1227 1216
1228 sub_menu->append(new LLMenuItemToggleGL("Show Select Buffer", &gDebugSelect));
1229
1230 sub_menu->append(new LLMenuItemCallGL("Vectorize Perf Test", &run_vectorize_perf_test)); 1217 sub_menu->append(new LLMenuItemCallGL("Vectorize Perf Test", &run_vectorize_perf_test));
1231 1218
1232 sub_menu = new LLMenuGL("Render Tests"); 1219 sub_menu = new LLMenuGL("Render Tests");
@@ -1771,6 +1758,23 @@ class LLViewCheckJoystickFlycam : public view_listener_t
1771 } 1758 }
1772}; 1759};
1773 1760
1761class LLViewCommunicate : public view_listener_t
1762{
1763 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
1764 {
1765 if (LLFloaterChatterBox::getInstance()->getFloaterCount() == 0)
1766 {
1767 LLFloaterMyFriends::toggleInstance();
1768 }
1769 else
1770 {
1771 LLFloaterChatterBox::toggleInstance();
1772 }
1773 return true;
1774 }
1775};
1776
1777
1774void handle_toggle_flycam() 1778void handle_toggle_flycam()
1775{ 1779{
1776 LLViewerJoystick::getInstance()->toggleFlycam(); 1780 LLViewerJoystick::getInstance()->toggleFlycam();
@@ -2245,37 +2249,71 @@ class LLAvatarDebug : public view_listener_t
2245 } 2249 }
2246}; 2250};
2247 2251
2252struct MenuCallbackData
2253{
2254 bool ban_enabled;
2255 LLUUID avatar_id;
2256};
2257
2248void callback_eject(S32 option, void* data) 2258void callback_eject(S32 option, void* data)
2249{ 2259{
2250 LLUUID* avatar_id = (LLUUID*) data; 2260 MenuCallbackData *callback_data = (MenuCallbackData*)data;
2261 if (!callback_data)
2262 {
2263 return;
2264 }
2265 if (2 == option)
2266 {
2267 // Cancle button.
2268 return;
2269 }
2270 LLUUID avatar_id = callback_data->avatar_id;
2271 bool ban_enabled = callback_data->ban_enabled;
2251 2272
2252 if (0 == option || 1 == option) 2273 if (0 == option)
2253 { 2274 {
2275 // Eject button
2254 LLMessageSystem* msg = gMessageSystem; 2276 LLMessageSystem* msg = gMessageSystem;
2255 LLViewerObject* avatar = gObjectList.findObject(*avatar_id); 2277 LLViewerObject* avatar = gObjectList.findObject(avatar_id);
2256 2278
2257 if (avatar) 2279 if (avatar)
2258 { 2280 {
2259 U32 flags = 0x0; 2281 U32 flags = 0x0;
2260 if (1 == option) 2282 msg->newMessage("EjectUser");
2261 { 2283 msg->nextBlock("AgentData");
2262 // eject and add to ban list 2284 msg->addUUID("AgentID", gAgent.getID() );
2263 flags |= 0x1; 2285 msg->addUUID("SessionID", gAgent.getSessionID() );
2264 } 2286 msg->nextBlock("Data");
2287 msg->addUUID("TargetID", avatar_id );
2288 msg->addU32("Flags", flags );
2289 msg->sendReliable( avatar->getRegion()->getHost() );
2290 }
2291 }
2292 else if (ban_enabled)
2293 {
2294 // This is tricky. It is similar to say if it is not an 'Eject' button,
2295 // and it is also not an 'Cancle' button, and ban_enabled==ture,
2296 // it should be the 'Eject and Ban' button.
2297 LLMessageSystem* msg = gMessageSystem;
2298 LLViewerObject* avatar = gObjectList.findObject(avatar_id);
2265 2299
2300 if (avatar)
2301 {
2302 U32 flags = 0x1;
2266 msg->newMessage("EjectUser"); 2303 msg->newMessage("EjectUser");
2267 msg->nextBlock("AgentData"); 2304 msg->nextBlock("AgentData");
2268 msg->addUUID("AgentID", gAgent.getID() ); 2305 msg->addUUID("AgentID", gAgent.getID() );
2269 msg->addUUID("SessionID", gAgent.getSessionID() ); 2306 msg->addUUID("SessionID", gAgent.getSessionID() );
2270 msg->nextBlock("Data"); 2307 msg->nextBlock("Data");
2271 msg->addUUID("TargetID", *avatar_id ); 2308 msg->addUUID("TargetID", avatar_id );
2272 msg->addU32("Flags", flags ); 2309 msg->addU32("Flags", flags );
2273 msg->sendReliable( avatar->getRegion()->getHost() ); 2310 msg->sendReliable( avatar->getRegion()->getHost() );
2274 } 2311 }
2275 } 2312 }
2276 2313
2277 delete avatar_id; 2314
2278 avatar_id = NULL; 2315 delete callback_data;
2316 callback_data = NULL;
2279} 2317}
2280 2318
2281class LLAvatarEject : public view_listener_t 2319class LLAvatarEject : public view_listener_t
@@ -2285,23 +2323,50 @@ class LLAvatarEject : public view_listener_t
2285 LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); 2323 LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
2286 if( avatar ) 2324 if( avatar )
2287 { 2325 {
2288 LLUUID* avatar_id = new LLUUID( avatar->getID() ); 2326 MenuCallbackData *data = new MenuCallbackData;
2327 (*data).avatar_id = avatar->getID();
2289 std::string fullname = avatar->getFullname(); 2328 std::string fullname = avatar->getFullname();
2290 2329
2291 if (!fullname.empty()) 2330 const LLVector3d& pos = avatar->getPositionGlobal();
2331 LLParcel* parcel = LLViewerParcelMgr::getInstance()->selectParcelAt(pos)->getParcel();
2332
2333 if (LLViewerParcelMgr::getInstance()->isParcelOwnedByAgent(parcel,GP_LAND_MANAGE_BANNED))
2292 { 2334 {
2293 LLStringUtil::format_map_t args; 2335 (*data).ban_enabled = true;
2294 args["[AVATAR_NAME]"] = fullname; 2336 if (!fullname.empty())
2295 gViewerWindow->alertXml("EjectAvatarFullname", 2337 {
2296 args, 2338 LLStringUtil::format_map_t args;
2297 callback_eject, 2339 args["[AVATAR_NAME]"] = fullname;
2298 (void*)avatar_id); 2340 gViewerWindow->alertXml("EjectAvatarFullname",
2341 args,
2342 callback_eject,
2343 (void*)data);
2344 }
2345 else
2346 {
2347 gViewerWindow->alertXml("EjectAvatar",
2348 callback_eject,
2349 (void*)data);
2350 }
2299 } 2351 }
2300 else 2352 else
2301 { 2353 {
2302 gViewerWindow->alertXml("EjectAvatar", 2354 (*data).ban_enabled = false;
2303 callback_eject, 2355 if (!fullname.empty())
2304 (void*)avatar_id); 2356 {
2357 LLStringUtil::format_map_t args;
2358 args["[AVATAR_NAME]"] = fullname;
2359 gViewerWindow->alertXml("EjectAvatarFullnameNoBan",
2360 args,
2361 callback_eject,
2362 (void*)data);
2363 }
2364 else
2365 {
2366 gViewerWindow->alertXml("EjectAvatarNoBan",
2367 callback_eject,
2368 (void*)data);
2369 }
2305 } 2370 }
2306 } 2371 }
2307 return true; 2372 return true;
@@ -2318,12 +2383,18 @@ class LLAvatarEnableFreezeEject : public view_listener_t
2318 if (new_value) 2383 if (new_value)
2319 { 2384 {
2320 const LLVector3& pos = avatar->getPositionRegion(); 2385 const LLVector3& pos = avatar->getPositionRegion();
2386 const LLVector3d& pos_global = avatar->getPositionGlobal();
2387 LLParcel* parcel = LLViewerParcelMgr::getInstance()->selectParcelAt(pos_global)->getParcel();
2321 LLViewerRegion* region = avatar->getRegion(); 2388 LLViewerRegion* region = avatar->getRegion();
2322 new_value = (region != NULL); 2389 new_value = (region != NULL);
2323 2390
2324 if (new_value) 2391 if (new_value)
2325 { 2392 {
2326 new_value = (region->isOwnedSelf(pos) || region->isOwnedGroup(pos)); 2393 new_value = region->isOwnedSelf(pos);
2394 if (!new_value || region->isOwnedGroup(pos))
2395 {
2396 new_value = LLViewerParcelMgr::getInstance()->isParcelOwnedByAgent(parcel,GP_LAND_ADMIN);
2397 }
2327 } 2398 }
2328 } 2399 }
2329 2400
@@ -2694,33 +2765,6 @@ void process_grant_godlike_powers(LLMessageSystem* msg, void**)
2694 } 2765 }
2695} 2766}
2696 2767
2697void load_url_local_file(const std::string& file_name)
2698{
2699 if( gAgent.cameraMouselook() )
2700 {
2701 gAgent.changeCameraToDefault();
2702 }
2703
2704#if LL_DARWIN || LL_LINUX || LL_SOLARIS
2705 // MBW -- If the Mac client is in fullscreen mode, it needs to go windowed so the browser will be visible.
2706 if(gViewerWindow->mWindow->getFullscreen())
2707 {
2708 gViewerWindow->toggleFullscreen(TRUE);
2709 }
2710#endif
2711
2712 // JC - system() blocks until IE has launched.
2713 // spawn() runs asynchronously, but opens a command prompt.
2714 // ShellExecute() just opens the damn file with the default
2715 // web browser.
2716 std::string full_path = "file:///";
2717 full_path.append(gDirUtilp->getAppRODataDir());
2718 full_path.append(gDirUtilp->getDirDelimiter());
2719 full_path.append(file_name);
2720
2721 LLWeb::loadURL(full_path);
2722}
2723
2724/* 2768/*
2725class LLHaveCallingcard : public LLInventoryCollectFunctor 2769class LLHaveCallingcard : public LLInventoryCollectFunctor
2726{ 2770{
@@ -2928,63 +2972,16 @@ void show_permissions_control(void*)
2928 floaterp->mPermissions->addPermissionsData("foo3", LLUUID::null, 0); 2972 floaterp->mPermissions->addPermissionsData("foo3", LLUUID::null, 0);
2929} 2973}
2930 2974
2931#if 0 // Unused (these just modify AudioInfoPage which is not used anywhere in the code
2932void handle_audio_status_1(void*)
2933{
2934 S32 page = gSavedSettings.getS32("AudioInfoPage");
2935 if (1 == page)
2936 {
2937 page = 0;
2938 }
2939 else
2940 {
2941 page = 1;
2942 }
2943 gSavedSettings.setS32("AudioInfoPage", page);
2944}
2945
2946void handle_audio_status_2(void*)
2947{
2948 S32 page = gSavedSettings.getS32("AudioInfoPage");
2949 if (2 == page)
2950 {
2951 page = 0;
2952 }
2953 else
2954 {
2955 page = 2;
2956 }
2957 gSavedSettings.setS32("AudioInfoPage", page);
2958}
2959
2960void handle_audio_status_3(void*)
2961{
2962 S32 page = gSavedSettings.getS32("AudioInfoPage");
2963 if (3 == page)
2964 {
2965 page = 0;
2966 }
2967 else
2968 {
2969 page = 3;
2970 }
2971 gSavedSettings.setS32("AudioInfoPage", page);
2972}
2973 2975
2974void handle_audio_status_4(void*) 2976class LLCreateLandmarkCallback : public LLInventoryCallback
2975{ 2977{
2976 S32 page = gSavedSettings.getS32("AudioInfoPage"); 2978public:
2977 if (4 == page) 2979 /*virtual*/ void fire(const LLUUID& inv_item)
2978 {
2979 page = 0;
2980 }
2981 else
2982 { 2980 {
2983 page = 4; 2981 llinfos << "Created landmark with inventory id " << inv_item
2982 << llendl;
2984 } 2983 }
2985 gSavedSettings.setS32("AudioInfoPage", page); 2984};
2986}
2987#endif
2988 2985
2989void reload_ui(void *) 2986void reload_ui(void *)
2990{ 2987{
@@ -3217,26 +3214,7 @@ void reset_view_final( BOOL proceed, void* )
3217 return; 3214 return;
3218 } 3215 }
3219 3216
3220 gAgent.changeCameraToDefault(); 3217 gAgent.resetView(TRUE, TRUE);
3221
3222 if (LLViewerJoystick::getInstance()->getOverrideCamera())
3223 {
3224 handle_toggle_flycam();
3225 }
3226
3227 // reset avatar mode from eventual residual motion
3228 if (LLToolMgr::getInstance()->inBuildMode())
3229 {
3230 LLViewerJoystick::getInstance()->moveAvatar(true);
3231 }
3232
3233 gAgent.resetView(!gFloaterTools->getVisible());
3234 gFloaterTools->close();
3235
3236 gViewerWindow->showCursor();
3237
3238 // Switch back to basic toolset
3239 LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
3240} 3218}
3241 3219
3242class LLViewLookAtLastChatter : public view_listener_t 3220class LLViewLookAtLastChatter : public view_listener_t
@@ -4806,7 +4784,7 @@ class LLWorldCreateLandmark : public view_listener_t
4806 LLAssetType::AT_LANDMARK, 4784 LLAssetType::AT_LANDMARK,
4807 LLInventoryType::IT_LANDMARK, 4785 LLInventoryType::IT_LANDMARK,
4808 NOT_WEARABLE, PERM_ALL, 4786 NOT_WEARABLE, PERM_ALL,
4809 NULL); 4787 new LLCreateLandmarkCallback);
4810 return true; 4788 return true;
4811 } 4789 }
4812}; 4790};
@@ -5230,6 +5208,10 @@ class LLShowFloater : public view_listener_t
5230 { 5208 {
5231 LLFloaterMediaBrowser::toggle(); 5209 LLFloaterMediaBrowser::toggle();
5232 } 5210 }
5211 else if (floater_name == "beacons")
5212 {
5213 LLFloaterBeacons::toggleInstance(LLSD());
5214 }
5233 return true; 5215 return true;
5234 } 5216 }
5235}; 5217};
@@ -5245,6 +5227,10 @@ class LLFloaterVisible : public view_listener_t
5245 { 5227 {
5246 new_value = LLFloaterMyFriends::instanceVisible(0); 5228 new_value = LLFloaterMyFriends::instanceVisible(0);
5247 } 5229 }
5230 else if (floater_name == "communicate")
5231 {
5232 new_value = LLFloaterChatterBox::instanceVisible();
5233 }
5248 else if (floater_name == "toolbar") 5234 else if (floater_name == "toolbar")
5249 { 5235 {
5250 new_value = LLToolBar::visible(NULL); 5236 new_value = LLToolBar::visible(NULL);
@@ -5277,6 +5263,15 @@ class LLFloaterVisible : public view_listener_t
5277 { 5263 {
5278 new_value = LLFloaterActiveSpeakers::instanceVisible(LLSD()); 5264 new_value = LLFloaterActiveSpeakers::instanceVisible(LLSD());
5279 } 5265 }
5266 else if (floater_name == "beacons")
5267 {
5268 new_value = LLFloaterBeacons::instanceVisible(LLSD());
5269 }
5270 else if (floater_name == "inventory")
5271 {
5272 LLInventoryView* iv = LLInventoryView::getActiveInventory();
5273 new_value = (NULL != iv && TRUE == iv->getVisible());
5274 }
5280 gMenuHolder->findControl(control_name)->setValue(new_value); 5275 gMenuHolder->findControl(control_name)->setValue(new_value);
5281 return true; 5276 return true;
5282 } 5277 }
@@ -5313,37 +5308,6 @@ class LLPromptShowURL : public view_listener_t
5313 } 5308 }
5314}; 5309};
5315 5310
5316void callback_show_file(S32 option, void* data)
5317{
5318 std::string* filenamep = (std::string*)data;
5319 if (0 == option)
5320 {
5321 load_url_local_file(*filenamep);
5322 }
5323 delete filenamep;
5324}
5325
5326class LLPromptShowFile : public view_listener_t
5327{
5328 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
5329 {
5330 std::string param = userdata.asString();
5331 std::string::size_type offset = param.find(",");
5332 if (offset != param.npos)
5333 {
5334 std::string alert = param.substr(0, offset);
5335 std::string file = param.substr(offset+1);
5336 std::string* file_copy = new std::string(file);
5337 gViewerWindow->alertXml(alert, callback_show_file, file_copy);
5338 }
5339 else
5340 {
5341 llinfos << "PromptShowFile invalid parameters! Expecting \"ALERT,FILE\"." << llendl;
5342 }
5343 return true;
5344 }
5345};
5346
5347class LLShowAgentProfile : public view_listener_t 5311class LLShowAgentProfile : public view_listener_t
5348{ 5312{
5349 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 5313 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -5967,7 +5931,6 @@ namespace
5967 5931
5968void queue_actions(LLFloaterScriptQueue* q, const std::string& noscriptmsg, const std::string& nomodmsg) 5932void queue_actions(LLFloaterScriptQueue* q, const std::string& noscriptmsg, const std::string& nomodmsg)
5969{ 5933{
5970 // Apply until an object fails
5971 QueueObjects func(q); 5934 QueueObjects func(q);
5972 LLSelectMgr *mgr = LLSelectMgr::getInstance(); 5935 LLSelectMgr *mgr = LLSelectMgr::getInstance();
5973 LLObjectSelectionHandle selectHandle = mgr->getSelection(); 5936 LLObjectSelectionHandle selectHandle = mgr->getSelection();
@@ -5996,7 +5959,6 @@ void queue_actions(LLFloaterScriptQueue* q, const std::string& noscriptmsg, cons
5996 } 5959 }
5997} 5960}
5998 5961
5999
6000class LLToolsSetBulkPerms : public view_listener_t 5962class LLToolsSetBulkPerms : public view_listener_t
6001{ 5963{
6002 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 5964 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -6007,62 +5969,67 @@ class LLToolsSetBulkPerms : public view_listener_t
6007 } 5969 }
6008}; 5970};
6009 5971
5972void handle_compile_queue(std::string to_lang)
5973{
5974 LLFloaterCompileQueue* queue;
5975 if (to_lang == "mono")
5976 {
5977 queue = LLFloaterCompileQueue::create(TRUE);
5978 }
5979 else
5980 {
5981 queue = LLFloaterCompileQueue::create(FALSE);
5982 }
5983 queue_actions(queue, "CannotRecompileSelectObjectsNoScripts", "CannotRecompileSelectObjectsNoPermission");
5984}
5985
5986void handle_reset_selection(void)
5987{
5988 LLFloaterResetQueue* queue = LLFloaterResetQueue::create();
5989 queue_actions(queue, "CannotResetSelectObjectsNoScripts", "CannotResetSelectObjectsNoPermission");
5990}
5991
5992void handle_set_run_selection(void)
5993{
5994 LLFloaterRunQueue* queue = LLFloaterRunQueue::create();
5995 queue_actions(queue, "CannotSetRunningSelectObjectsNoScripts", "CannotSerRunningSelectObjectsNoPermission");
5996}
5997
5998void handle_set_not_run_selection(void)
5999{
6000 LLFloaterNotRunQueue* queue = LLFloaterNotRunQueue::create();
6001 queue_actions(queue, "CannotSetRunningNotSelectObjectsNoScripts", "CannotSerRunningNotSelectObjectsNoPermission");
6002}
6010 6003
6011class LLToolsSelectedScriptAction : public view_listener_t 6004class LLToolsSelectedScriptAction : public view_listener_t
6012{ 6005{
6013 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 6006 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
6014 { 6007 {
6015 std::string action = userdata.asString(); 6008 std::string action = userdata.asString();
6016 LLFloaterScriptQueue* queue = NULL;
6017 if (action == "compile mono") 6009 if (action == "compile mono")
6018 { 6010 {
6019 queue = LLFloaterCompileQueue::create(TRUE); 6011 handle_compile_queue("mono");
6020 } 6012 }
6021 if (action == "compile lsl") 6013 if (action == "compile lsl")
6022 { 6014 {
6023 queue = LLFloaterCompileQueue::create(FALSE); 6015 handle_compile_queue("lsl");
6024 } 6016 }
6025 else if (action == "reset") 6017 else if (action == "reset")
6026 { 6018 {
6027 queue = LLFloaterResetQueue::create(); 6019 handle_reset_selection();
6028 } 6020 }
6029 else if (action == "start") 6021 else if (action == "start")
6030 { 6022 {
6031 queue = LLFloaterRunQueue::create(); 6023 handle_set_run_selection();
6032 } 6024 }
6033 else if (action == "stop") 6025 else if (action == "stop")
6034 { 6026 {
6035 queue = LLFloaterNotRunQueue::create(); 6027 handle_set_not_run_selection();
6036 }
6037 if (!queue)
6038 {
6039 return true;
6040 } 6028 }
6041
6042 queue_actions(queue, "CannotRecompileSelectObjectsNoScripts", "CannotRecompileSelectObjectsNoPermission");
6043
6044 return true; 6029 return true;
6045 } 6030 }
6046}; 6031};
6047 6032
6048void handle_reset_selection(void*)
6049{
6050 LLFloaterResetQueue* queue = LLFloaterResetQueue::create();
6051 queue_actions(queue, "CannotResetSelectObjectsNoScripts", "CannotResetSelectObjectsNoPermission");
6052}
6053
6054void handle_set_run_selection(void*)
6055{
6056 LLFloaterRunQueue* queue = LLFloaterRunQueue::create();
6057 queue_actions(queue, "CannotSetRunningSelectObjectsNoScripts", "CannotSerRunningSelectObjectsNoPermission");
6058}
6059
6060void handle_set_not_run_selection(void*)
6061{
6062 LLFloaterNotRunQueue* queue = LLFloaterNotRunQueue::create();
6063 queue_actions(queue, "CannotSetRunningNotSelectObjectsNoScripts", "CannotSerRunningNotSelectObjectsNoPermission");
6064}
6065
6066void handle_selected_texture_info(void*) 6033void handle_selected_texture_info(void*)
6067{ 6034{
6068 for (LLObjectSelection::valid_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_begin(); 6035 for (LLObjectSelection::valid_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_begin();
@@ -6903,6 +6870,11 @@ void force_error_software_exception(void *)
6903 LLAppViewer::instance()->forceErrorSoftwareException(); 6870 LLAppViewer::instance()->forceErrorSoftwareException();
6904} 6871}
6905 6872
6873void force_error_driver_crash(void *)
6874{
6875 LLAppViewer::instance()->forceErrorDriverCrash();
6876}
6877
6906class LLToolsUseSelectionForGrid : public view_listener_t 6878class LLToolsUseSelectionForGrid : public view_listener_t
6907{ 6879{
6908 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 6880 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -7078,148 +7050,6 @@ class LLViewCheckHighlightTransparent : public view_listener_t
7078 } 7050 }
7079}; 7051};
7080 7052
7081class LLViewBeaconWidth : public view_listener_t
7082{
7083 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7084 {
7085 std::string width = userdata.asString();
7086 if(width == "1")
7087 {
7088 gSavedSettings.setS32("DebugBeaconLineWidth", 1);
7089 }
7090 else if(width == "4")
7091 {
7092 gSavedSettings.setS32("DebugBeaconLineWidth", 4);
7093 }
7094 else if(width == "16")
7095 {
7096 gSavedSettings.setS32("DebugBeaconLineWidth", 16);
7097 }
7098 else if(width == "32")
7099 {
7100 gSavedSettings.setS32("DebugBeaconLineWidth", 32);
7101 }
7102
7103 return true;
7104 }
7105};
7106
7107
7108class LLViewToggleBeacon : public view_listener_t
7109{
7110 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7111 {
7112 std::string beacon = userdata.asString();
7113 if (beacon == "scriptsbeacon")
7114 {
7115 LLPipeline::toggleRenderScriptedBeacons(NULL);
7116 gSavedSettings.setBOOL( "scriptsbeacon", LLPipeline::getRenderScriptedBeacons(NULL) );
7117 // toggle the other one off if it's on
7118 if (LLPipeline::getRenderScriptedBeacons(NULL) && LLPipeline::getRenderScriptedTouchBeacons(NULL))
7119 {
7120 LLPipeline::toggleRenderScriptedTouchBeacons(NULL);
7121 gSavedSettings.setBOOL( "scripttouchbeacon", LLPipeline::getRenderScriptedTouchBeacons(NULL) );
7122 }
7123 }
7124 else if (beacon == "physicalbeacon")
7125 {
7126 LLPipeline::toggleRenderPhysicalBeacons(NULL);
7127 gSavedSettings.setBOOL( "physicalbeacon", LLPipeline::getRenderPhysicalBeacons(NULL) );
7128 }
7129 else if (beacon == "soundsbeacon")
7130 {
7131 LLPipeline::toggleRenderSoundBeacons(NULL);
7132 gSavedSettings.setBOOL( "soundsbeacon", LLPipeline::getRenderSoundBeacons(NULL) );
7133 }
7134 else if (beacon == "particlesbeacon")
7135 {
7136 LLPipeline::toggleRenderParticleBeacons(NULL);
7137 gSavedSettings.setBOOL( "particlesbeacon", LLPipeline::getRenderParticleBeacons(NULL) );
7138 }
7139 else if (beacon == "scripttouchbeacon")
7140 {
7141 LLPipeline::toggleRenderScriptedTouchBeacons(NULL);
7142 gSavedSettings.setBOOL( "scripttouchbeacon", LLPipeline::getRenderScriptedTouchBeacons(NULL) );
7143 // toggle the other one off if it's on
7144 if (LLPipeline::getRenderScriptedBeacons(NULL) && LLPipeline::getRenderScriptedTouchBeacons(NULL))
7145 {
7146 LLPipeline::toggleRenderScriptedBeacons(NULL);
7147 gSavedSettings.setBOOL( "scriptsbeacon", LLPipeline::getRenderScriptedBeacons(NULL) );
7148 }
7149 }
7150 else if (beacon == "renderbeacons")
7151 {
7152 LLPipeline::toggleRenderBeacons(NULL);
7153 gSavedSettings.setBOOL( "renderbeacons", LLPipeline::getRenderBeacons(NULL) );
7154 // toggle the other one on if it's not
7155 if (!LLPipeline::getRenderBeacons(NULL) && !LLPipeline::getRenderHighlights(NULL))
7156 {
7157 LLPipeline::toggleRenderHighlights(NULL);
7158 gSavedSettings.setBOOL( "renderhighlights", LLPipeline::getRenderHighlights(NULL) );
7159 }
7160 }
7161 else if (beacon == "renderhighlights")
7162 {
7163 LLPipeline::toggleRenderHighlights(NULL);
7164 gSavedSettings.setBOOL( "renderhighlights", LLPipeline::getRenderHighlights(NULL) );
7165 // toggle the other one on if it's not
7166 if (!LLPipeline::getRenderBeacons(NULL) && !LLPipeline::getRenderHighlights(NULL))
7167 {
7168 LLPipeline::toggleRenderBeacons(NULL);
7169 gSavedSettings.setBOOL( "renderbeacons", LLPipeline::getRenderBeacons(NULL) );
7170 }
7171 }
7172
7173 return true;
7174 }
7175};
7176
7177class LLViewCheckBeaconEnabled : public view_listener_t
7178{
7179 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7180 {
7181 std::string beacon = userdata["data"].asString();
7182 bool new_value = false;
7183 if (beacon == "scriptsbeacon")
7184 {
7185 new_value = gSavedSettings.getBOOL( "scriptsbeacon");
7186 LLPipeline::setRenderScriptedBeacons(new_value);
7187 }
7188 else if (beacon == "physicalbeacon")
7189 {
7190 new_value = gSavedSettings.getBOOL( "physicalbeacon");
7191 LLPipeline::setRenderPhysicalBeacons(new_value);
7192 }
7193 else if (beacon == "soundsbeacon")
7194 {
7195 new_value = gSavedSettings.getBOOL( "soundsbeacon");
7196 LLPipeline::setRenderSoundBeacons(new_value);
7197 }
7198 else if (beacon == "particlesbeacon")
7199 {
7200 new_value = gSavedSettings.getBOOL( "particlesbeacon");
7201 LLPipeline::setRenderParticleBeacons(new_value);
7202 }
7203 else if (beacon == "scripttouchbeacon")
7204 {
7205 new_value = gSavedSettings.getBOOL( "scripttouchbeacon");
7206 LLPipeline::setRenderScriptedTouchBeacons(new_value);
7207 }
7208 else if (beacon == "renderbeacons")
7209 {
7210 new_value = gSavedSettings.getBOOL( "renderbeacons");
7211 LLPipeline::setRenderBeacons(new_value);
7212 }
7213 else if (beacon == "renderhighlights")
7214 {
7215 new_value = gSavedSettings.getBOOL( "renderhighlights");
7216 LLPipeline::setRenderHighlights(new_value);
7217 }
7218 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
7219 return true;
7220 }
7221};
7222
7223class LLViewToggleRenderType : public view_listener_t 7053class LLViewToggleRenderType : public view_listener_t
7224{ 7054{
7225 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 7055 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -7596,7 +7426,6 @@ class LLAdvancedCheckConsole : public view_listener_t
7596 7426
7597 7427
7598 7428
7599
7600////////////////////////// 7429//////////////////////////
7601// DUMP INFO TO CONSOLE // 7430// DUMP INFO TO CONSOLE //
7602////////////////////////// 7431//////////////////////////
@@ -7851,10 +7680,6 @@ U32 feature_from_string(std::string feature)
7851 { 7680 {
7852 return LLPipeline::RENDER_DEBUG_FEATURE_FOG; 7681 return LLPipeline::RENDER_DEBUG_FEATURE_FOG;
7853 } 7682 }
7854 else if ("palette" == feature)
7855 {
7856 return LLPipeline::RENDER_DEBUG_FEATURE_PALETTE;
7857 }
7858 else if ("fr info" == feature) 7683 else if ("fr info" == feature)
7859 { 7684 {
7860 return LLPipeline::RENDER_DEBUG_FEATURE_FR_INFO; 7685 return LLPipeline::RENDER_DEBUG_FEATURE_FR_INFO;
@@ -8320,33 +8145,6 @@ class LLAdvancedToggleEditableUI : public view_listener_t
8320 8145
8321 8146
8322 8147
8323//////////////////////
8324// ASYNC KEYSTROKES //
8325//////////////////////
8326
8327
8328class LLAdvancedToggleAsyncKeystrokes : public view_listener_t
8329{
8330 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
8331 {
8332 gHandleKeysAsync = !(gHandleKeysAsync);
8333 return true;
8334 }
8335};
8336
8337class LLAdvancedCheckAsyncKeystrokes : public view_listener_t
8338{
8339 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
8340 {
8341 bool new_value = gHandleKeysAsync;
8342 std::string control_name = userdata["control"].asString();
8343 gMenuHolder->findControl(control_name)->setValue(new_value);
8344 return true;
8345 }
8346};
8347
8348
8349
8350///////////////////// 8148/////////////////////
8351// DUMP SELECT MGR // 8149// DUMP SELECT MGR //
8352///////////////////// 8150/////////////////////
@@ -9718,8 +9516,6 @@ void initialize_menus()
9718 addMenu(new LLViewLookAtLastChatter(), "View.LookAtLastChatter"); 9516 addMenu(new LLViewLookAtLastChatter(), "View.LookAtLastChatter");
9719 addMenu(new LLViewShowHoverTips(), "View.ShowHoverTips"); 9517 addMenu(new LLViewShowHoverTips(), "View.ShowHoverTips");
9720 addMenu(new LLViewHighlightTransparent(), "View.HighlightTransparent"); 9518 addMenu(new LLViewHighlightTransparent(), "View.HighlightTransparent");
9721 addMenu(new LLViewToggleBeacon(), "View.ToggleBeacon");
9722 addMenu(new LLViewBeaconWidth(), "View.BeaconWidth");
9723 addMenu(new LLViewToggleRenderType(), "View.ToggleRenderType"); 9519 addMenu(new LLViewToggleRenderType(), "View.ToggleRenderType");
9724 addMenu(new LLViewShowHUDAttachments(), "View.ShowHUDAttachments"); 9520 addMenu(new LLViewShowHUDAttachments(), "View.ShowHUDAttachments");
9725 addMenu(new LLViewZoomOut(), "View.ZoomOut"); 9521 addMenu(new LLViewZoomOut(), "View.ZoomOut");
@@ -9734,7 +9530,6 @@ void initialize_menus()
9734 addMenu(new LLViewCheckJoystickFlycam(), "View.CheckJoystickFlycam"); 9530 addMenu(new LLViewCheckJoystickFlycam(), "View.CheckJoystickFlycam");
9735 addMenu(new LLViewCheckShowHoverTips(), "View.CheckShowHoverTips"); 9531 addMenu(new LLViewCheckShowHoverTips(), "View.CheckShowHoverTips");
9736 addMenu(new LLViewCheckHighlightTransparent(), "View.CheckHighlightTransparent"); 9532 addMenu(new LLViewCheckHighlightTransparent(), "View.CheckHighlightTransparent");
9737 addMenu(new LLViewCheckBeaconEnabled(), "View.CheckBeaconEnabled");
9738 addMenu(new LLViewCheckRenderType(), "View.CheckRenderType"); 9533 addMenu(new LLViewCheckRenderType(), "View.CheckRenderType");
9739 addMenu(new LLViewCheckHUDAttachments(), "View.CheckHUDAttachments"); 9534 addMenu(new LLViewCheckHUDAttachments(), "View.CheckHUDAttachments");
9740 9535
@@ -9873,7 +9668,6 @@ void initialize_menus()
9873 // Generic actions 9668 // Generic actions
9874 addMenu(new LLShowFloater(), "ShowFloater"); 9669 addMenu(new LLShowFloater(), "ShowFloater");
9875 addMenu(new LLPromptShowURL(), "PromptShowURL"); 9670 addMenu(new LLPromptShowURL(), "PromptShowURL");
9876 addMenu(new LLPromptShowFile(), "PromptShowFile");
9877 addMenu(new LLShowAgentProfile(), "ShowAgentProfile"); 9671 addMenu(new LLShowAgentProfile(), "ShowAgentProfile");
9878 addMenu(new LLShowAgentGroups(), "ShowAgentGroups"); 9672 addMenu(new LLShowAgentGroups(), "ShowAgentGroups");
9879 addMenu(new LLToggleControl(), "ToggleControl"); 9673 addMenu(new LLToggleControl(), "ToggleControl");
@@ -9942,8 +9736,6 @@ void initialize_menus()
9942 addMenu(new LLAdvancedSLURLTest(), "Advanced.SLURLTest"); 9736 addMenu(new LLAdvancedSLURLTest(), "Advanced.SLURLTest");
9943 addMenu(new LLAdvancedToggleEditableUI(), "Advanced.ToggleEditableUI"); 9737 addMenu(new LLAdvancedToggleEditableUI(), "Advanced.ToggleEditableUI");
9944 //addMenu(new LLAdvancedCheckEditableUI(), "Advanced.CheckEditableUI"); 9738 //addMenu(new LLAdvancedCheckEditableUI(), "Advanced.CheckEditableUI");
9945 addMenu(new LLAdvancedToggleAsyncKeystrokes(), "Advanced.ToggleAsyncKeystrokes");
9946 addMenu(new LLAdvancedCheckAsyncKeystrokes(), "Advanced.CheckAsyncKeystrokes");
9947 addMenu(new LLAdvancedDumpSelectMgr(), "Advanced.DumpSelectMgr"); 9739 addMenu(new LLAdvancedDumpSelectMgr(), "Advanced.DumpSelectMgr");
9948 addMenu(new LLAdvancedDumpInventory(), "Advanced.DumpInventory"); 9740 addMenu(new LLAdvancedDumpInventory(), "Advanced.DumpInventory");
9949 addMenu(new LLAdvancedDumpFocusHolder(), "Advanced.DumpFocusHolder"); 9741 addMenu(new LLAdvancedDumpFocusHolder(), "Advanced.DumpFocusHolder");