diff options
Diffstat (limited to 'indra')
508 files changed, 20650 insertions, 12788 deletions
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index dc31d3d729..127b62f424 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -120,14 +120,14 @@ if (LINUX) endif (${GXX_VERSION} STREQUAL ${CXX_VERSION}) # Let's actually get a numerical version of gxx's version - STRING(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.([0-9]).*" "\\1\\2\\3" CXX_VERSION ${CXX_VERSION}) + STRING(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.([0-9]).*" "\\1\\2\\3" CXX_VERSION_NUMBER ${CXX_VERSION}) - # gcc 4.3 and above don't like the LL boost and also + # gcc 4.3 and above don't like the LL boost and also # cause warnings due to our use of deprecated headers - if(${CXX_VERSION} GREATER 429) + if(${CXX_VERSION_NUMBER} GREATER 429) add_definitions(-Wno-parentheses) set(CMAKE_CXX_FLAGS "-Wno-deprecated ${CMAKE_CXX_FLAGS}") - endif (${CXX_VERSION} GREATER 429) + endif (${CXX_VERSION_NUMBER} GREATER 429) # End of hacks. diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index bbf31f9297..5a142f23c9 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -19,10 +19,12 @@ if(WINDOWS) set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-win32") set(vivox_files SLVoice.exe - alut.dll + libsndfile-1.dll + vivoxplatform.dll vivoxsdk.dll ortp.dll - wrap_oal.dll + zlib1.dll + vivoxoal.dll ) #******************************* @@ -33,7 +35,6 @@ if(WINDOWS) set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug") set(debug_files openjpegd.dll - libtcmalloc_minimal-debug.dll libapr-1.dll libaprutil-1.dll libapriconv-1.dll @@ -44,12 +45,16 @@ if(WINDOWS) set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release") set(release_files openjpeg.dll - libtcmalloc_minimal.dll libapr-1.dll libaprutil-1.dll libapriconv-1.dll ) + if(USE_GOOGLE_PERFTOOLS) + set(debug_files ${debug_files} libtcmalloc_minimal-debug.dll) + set(release_files ${release_files} libtcmalloc_minimal.dll) + endif(USE_GOOGLE_PERFTOOLS) + if (FMOD_SDK_DIR) set(fmod_files fmod.dll) endif (FMOD_SDK_DIR) @@ -139,9 +144,10 @@ elseif(DARWIN) set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/universal-darwin") set(vivox_files SLVoice - libalut.dylib - libopenal.dylib + libsndfile.dylib + libvivoxoal.dylib libortp.dylib + libvivoxplatform.dylib libvivoxsdk.dylib ) # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables @@ -190,9 +196,10 @@ elseif(LINUX) set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux") set(vivox_files - libalut.so - libopenal.so.1 + libsndfile.so.1 libortp.so + libvivoxoal.so.1 + libvivoxplatform.so libvivoxsdk.so SLVoice ) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 6559051b5a..db0b44eb8f 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -24,6 +24,7 @@ set(SCRIPTS_PREFIX ../scripts) set(SERVER_PREFIX) set(VIEWER_PREFIX) set(INTEGRATION_TESTS_PREFIX) +set(LL_TESTS ON CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation") set(LIBS_CLOSED_DIR ${CMAKE_SOURCE_DIR}/${LIBS_CLOSED_PREFIX}) set(LIBS_OPEN_DIR ${CMAKE_SOURCE_DIR}/${LIBS_OPEN_PREFIX}) @@ -115,4 +116,7 @@ For more information, please see JIRA DEV-14943 - Cmake Linux cannot build both ") endif (LINUX AND SERVER AND VIEWER) + +set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header directives where supported.") + source_group("CMake Rules" FILES CMakeLists.txt) diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py index fff78ecbe3..0f6967e42a 100644 --- a/indra/cmake/run_build_test.py +++ b/indra/cmake/run_build_test.py @@ -64,20 +64,20 @@ def main(command, libpath=[], vars={}): # might not exist; instead of KeyError, just use an empty string. dirs = os.environ.get(var, "").split(os.pathsep) # Append the sequence in libpath -## print "%s += %r" % (var, libpath) + print "%s += %r" % (var, libpath) dirs.extend(libpath) # Now rebuild the path string. This way we use a minimum of separators # -- and we avoid adding a pointless separator when libpath is empty. os.environ[var] = os.pathsep.join(dirs) # Now handle arbitrary environment variables. The tricky part is ensuring # that all the keys and values we try to pass are actually strings. -## if vars: -## print "Setting:" -## for key, value in vars.iteritems(): -## print "%s=%s" % (key, value) + if vars: + print "Setting:" + for key, value in vars.iteritems(): + print "%s=%s" % (key, value) os.environ.update(dict([(str(key), str(value)) for key, value in vars.iteritems()])) # Run the child process. -## print "Running: %s" % " ".join(command) + print "Running: %s" % " ".join(command) return subprocess.call(command) if __name__ == "__main__": diff --git a/indra/llaudio/CMakeLists.txt b/indra/llaudio/CMakeLists.txt index 9e9e1aaeae..bfa2c34c12 100644 --- a/indra/llaudio/CMakeLists.txt +++ b/indra/llaudio/CMakeLists.txt @@ -31,7 +31,6 @@ set(llaudio_SOURCE_FILES llaudioengine.cpp lllistener.cpp llaudiodecodemgr.cpp - llvorbisdecode.cpp llvorbisencode.cpp ) @@ -41,7 +40,6 @@ set(llaudio_HEADER_FILES llaudioengine.h lllistener.h llaudiodecodemgr.h - llvorbisdecode.h llvorbisencode.h llwindgen.h ) @@ -60,11 +58,11 @@ if (FMOD) ) if (LINUX) - if (${CXX_VERSION} MATCHES "4.[23]") + if (${CXX_VERSION_NUMBER} GREATER 419) set_source_files_properties(llaudioengine_fmod.cpp llstreamingaudio_fmod.cpp COMPILE_FLAGS -Wno-write-strings) - endif (${CXX_VERSION} MATCHES "4.[23]") + endif (${CXX_VERSION_NUMBER} GREATER 419) endif (LINUX) endif (FMOD) diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp index ae959eaa81..6bbaad9cef 100644 --- a/indra/llaudio/llaudiodecodemgr.cpp +++ b/indra/llaudio/llaudiodecodemgr.cpp @@ -33,7 +33,6 @@ #include "llaudiodecodemgr.h" -#include "llvorbisdecode.h" #include "llaudioengine.h" #include "lllfsthread.h" #include "llvfile.h" diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 416303342a..ac7cc2cdac 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -25,6 +25,8 @@ include_directories( # ${LLCOMMON_LIBRARIES}) set(llcommon_SOURCE_FILES + imageids.cpp + indra_constants.cpp llallocator.cpp llallocator_heap_profile.cpp llapp.cpp @@ -39,6 +41,7 @@ set(llcommon_SOURCE_FILES llcursortypes.cpp lldate.cpp lldependencies.cpp + lldictionary.cpp llerror.cpp llerrorthread.cpp llevent.cpp @@ -164,6 +167,7 @@ set(llcommon_HEADER_FILES llinstancetracker.h llkeythrottle.h lllazy.h + lllistenerwrapper.h lllinkedqueue.h llliveappconfig.h lllivefile.h @@ -221,6 +225,7 @@ set(llcommon_HEADER_FILES llversionserver.h llversionviewer.h llworkerthread.h + ll_template_cast.h metaclass.h metaclasst.h metaproperty.h @@ -265,33 +270,34 @@ target_link_libraries( add_dependencies(llcommon stage_third_party_libs) -include(LLAddBuildTest) -SET(llcommon_TEST_SOURCE_FILES - # unit-testing llcommon is not possible right now as the test-harness *itself* depends upon llcommon, causing a circular dependency. Add your 'unit' tests as integration tests for now. - ) -LL_ADD_PROJECT_UNIT_TESTS(llcommon "${llcommon_TEST_SOURCE_FILES}") - -#set(TEST_DEBUG on) -set(test_libs llcommon ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES} ${GOOGLEMOCK_LIBRARIES}) -LL_ADD_INTEGRATION_TEST(commonmisc "" "${test_libs}") -LL_ADD_INTEGRATION_TEST(bitpack "" "${test_libs}") -LL_ADD_INTEGRATION_TEST(llbase64 "" "${test_libs}") -LL_ADD_INTEGRATION_TEST(lldate "" "${test_libs}") -LL_ADD_INTEGRATION_TEST(lldependencies "" "${test_libs}") -LL_ADD_INTEGRATION_TEST(llerror "" "${test_libs}") -LL_ADD_INTEGRATION_TEST(llframetimer "" "${test_libs}") -LL_ADD_INTEGRATION_TEST(llinstancetracker "" "${test_libs}") -LL_ADD_INTEGRATION_TEST(lllazy "" "${test_libs}") -LL_ADD_INTEGRATION_TEST(llrand "" "${test_libs}") -LL_ADD_INTEGRATION_TEST(llsdserialize "" "${test_libs}") -LL_ADD_INTEGRATION_TEST(llstring "" "${test_libs}") -LL_ADD_INTEGRATION_TEST(lltreeiterators "" "${test_libs}") -LL_ADD_INTEGRATION_TEST(lluri "" "${test_libs}") -LL_ADD_INTEGRATION_TEST(reflection "" "${test_libs}") -LL_ADD_INTEGRATION_TEST(stringize "" "${test_libs}") +if (LL_TESTS) + include(LLAddBuildTest) + SET(llcommon_TEST_SOURCE_FILES + # unit-testing llcommon is not possible right now as the test-harness *itself* depends upon llcommon, causing a circular dependency. Add your 'unit' tests as integration tests for now. + ) + LL_ADD_PROJECT_UNIT_TESTS(llcommon "${llcommon_TEST_SOURCE_FILES}") -# *TODO - reenable these once tcmalloc libs no longer break the build. -#ADD_BUILD_TEST(llallocator llcommon) -#ADD_BUILD_TEST(llallocator_heap_profile llcommon) -#ADD_BUILD_TEST(llmemtype llcommon) + #set(TEST_DEBUG on) + set(test_libs llcommon ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES} ${GOOGLEMOCK_LIBRARIES}) + LL_ADD_INTEGRATION_TEST(commonmisc "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(bitpack "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(llbase64 "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(lldate "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(lldependencies "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(llerror "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(llframetimer "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(llinstancetracker "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(lllazy "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(llrand "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(llsdserialize "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(llstring "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(lltreeiterators "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(lluri "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(reflection "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(stringize "" "${test_libs}") + # *TODO - reenable these once tcmalloc libs no longer break the build. + #ADD_BUILD_TEST(llallocator llcommon) + #ADD_BUILD_TEST(llallocator_heap_profile llcommon) + #ADD_BUILD_TEST(llmemtype llcommon) +endif (LL_TESTS) diff --git a/indra/llcommon/imageids.cpp b/indra/llcommon/imageids.cpp new file mode 100644 index 0000000000..f48bb1374d --- /dev/null +++ b/indra/llcommon/imageids.cpp @@ -0,0 +1,76 @@ +/** + * @file imageids.cpp + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "imageids.h" + +#include "lluuid.h" + +// +// USE OF THIS FILE IS DEPRECATED +// +// Please use viewerart.ini and the standard +// art import path. // indicates if file is only + // on dataserver, or also + // pre-cached on viewer + +// Grass Images +const LLUUID IMG_SMOKE ("b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d"); // VIEWER + +const LLUUID IMG_DEFAULT ("d2114404-dd59-4a4d-8e6c-49359e91bbf0"); // VIEWER + +const LLUUID IMG_SUN ("cce0f112-878f-4586-a2e2-a8f104bba271"); // dataserver +const LLUUID IMG_MOON ("d07f6eed-b96a-47cd-b51d-400ad4a1c428"); // dataserver +const LLUUID IMG_CLOUD_POOF ("fc4b9f0b-d008-45c6-96a4-01dd947ac621"); // dataserver +const LLUUID IMG_SHOT ("35f217a3-f618-49cf-bbca-c86d486551a9"); // dataserver +const LLUUID IMG_SPARK ("d2e75ac1-d0fb-4532-820e-a20034ac814d"); // dataserver +const LLUUID IMG_FIRE ("aca40aa8-44cf-44ca-a0fa-93e1a2986f82"); // dataserver +const LLUUID IMG_FACE_SELECT ("a85ac674-cb75-4af6-9499-df7c5aaf7a28"); // face selector +const LLUUID IMG_DEFAULT_AVATAR ("c228d1cf-4b5d-4ba8-84f4-899a0796aa97"); // dataserver +const LLUUID IMG_INVISIBLE ("3a367d1c-bef1-6d43-7595-e88c1e3aadb3"); // dataserver + +const LLUUID IMG_EXPLOSION ("68edcf47-ccd7-45b8-9f90-1649d7f12806"); // On dataserver +const LLUUID IMG_EXPLOSION_2 ("21ce046c-83fe-430a-b629-c7660ac78d7c"); // On dataserver +const LLUUID IMG_EXPLOSION_3 ("fedea30a-1be8-47a6-bc06-337a04a39c4b"); // On dataserver +const LLUUID IMG_EXPLOSION_4 ("abf0d56b-82e5-47a2-a8ad-74741bb2c29e"); // On dataserver +const LLUUID IMG_SMOKE_POOF ("1e63e323-5fe0-452e-92f8-b98bd0f764e3"); // On dataserver + +const LLUUID IMG_BIG_EXPLOSION_1 ("5e47a0dc-97bf-44e0-8b40-de06718cee9d"); // On dataserver +const LLUUID IMG_BIG_EXPLOSION_2 ("9c8eca51-53d5-42a7-bb58-cef070395db8"); // On dataserver + +const LLUUID IMG_BLOOM1 ("3c59f7fe-9dc8-47f9-8aaf-a9dd1fbc3bef"); // VIEWER +const LLUUID TERRAIN_DIRT_DETAIL ("0bc58228-74a0-7e83-89bc-5c23464bcec5"); // VIEWER +const LLUUID TERRAIN_GRASS_DETAIL ("63338ede-0037-c4fd-855b-015d77112fc8"); // VIEWER +const LLUUID TERRAIN_MOUNTAIN_DETAIL ("303cd381-8560-7579-23f1-f0a880799740"); // VIEWER +const LLUUID TERRAIN_ROCK_DETAIL ("53a2f406-4895-1d13-d541-d2e3b86bc19c"); // VIEWER + +const LLUUID DEFAULT_WATER_NORMAL ("822ded49-9a6c-f61c-cb89-6df54f42cdf4"); // VIEWER diff --git a/indra/llcommon/imageids.h b/indra/llcommon/imageids.h index 832708c782..dc726dcf53 100644 --- a/indra/llcommon/imageids.h +++ b/indra/llcommon/imageids.h @@ -33,46 +33,43 @@ #ifndef LL_IMAGEIDS_H #define LL_IMAGEIDS_H -#include "lluuid.h" - // // USE OF THIS FILE IS DEPRECATED // // Please use viewerart.ini and the standard -// art import path. // indicates if file is only - // on dataserver, or also - // pre-cached on viewer +// art import path. + +class LLUUID; -// Grass Images -const LLUUID IMG_SMOKE ("b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d"); // VIEWER +LL_COMMON_API extern const LLUUID IMG_SMOKE; -const LLUUID IMG_DEFAULT ("d2114404-dd59-4a4d-8e6c-49359e91bbf0"); // VIEWER +LL_COMMON_API extern const LLUUID IMG_DEFAULT; -const LLUUID IMG_SUN ("cce0f112-878f-4586-a2e2-a8f104bba271"); // dataserver -const LLUUID IMG_MOON ("d07f6eed-b96a-47cd-b51d-400ad4a1c428"); // dataserver -const LLUUID IMG_CLOUD_POOF ("fc4b9f0b-d008-45c6-96a4-01dd947ac621"); // dataserver -const LLUUID IMG_SHOT ("35f217a3-f618-49cf-bbca-c86d486551a9"); // dataserver -const LLUUID IMG_SPARK ("d2e75ac1-d0fb-4532-820e-a20034ac814d"); // dataserver -const LLUUID IMG_FIRE ("aca40aa8-44cf-44ca-a0fa-93e1a2986f82"); // dataserver -const LLUUID IMG_FACE_SELECT ("a85ac674-cb75-4af6-9499-df7c5aaf7a28"); // face selector -const LLUUID IMG_DEFAULT_AVATAR ("c228d1cf-4b5d-4ba8-84f4-899a0796aa97"); // dataserver -const LLUUID IMG_INVISIBLE ("3a367d1c-bef1-6d43-7595-e88c1e3aadb3"); // dataserver +LL_COMMON_API extern const LLUUID IMG_SUN; +LL_COMMON_API extern const LLUUID IMG_MOON; +LL_COMMON_API extern const LLUUID IMG_CLOUD_POOF; +LL_COMMON_API extern const LLUUID IMG_SHOT; +LL_COMMON_API extern const LLUUID IMG_SPARK; +LL_COMMON_API extern const LLUUID IMG_FIRE; +LL_COMMON_API extern const LLUUID IMG_FACE_SELECT; +LL_COMMON_API extern const LLUUID IMG_DEFAULT_AVATAR; +LL_COMMON_API extern const LLUUID IMG_INVISIBLE; -const LLUUID IMG_EXPLOSION ("68edcf47-ccd7-45b8-9f90-1649d7f12806"); // On dataserver -const LLUUID IMG_EXPLOSION_2 ("21ce046c-83fe-430a-b629-c7660ac78d7c"); // On dataserver -const LLUUID IMG_EXPLOSION_3 ("fedea30a-1be8-47a6-bc06-337a04a39c4b"); // On dataserver -const LLUUID IMG_EXPLOSION_4 ("abf0d56b-82e5-47a2-a8ad-74741bb2c29e"); // On dataserver -const LLUUID IMG_SMOKE_POOF ("1e63e323-5fe0-452e-92f8-b98bd0f764e3"); // On dataserver +LL_COMMON_API extern const LLUUID IMG_EXPLOSION; +LL_COMMON_API extern const LLUUID IMG_EXPLOSION_2; +LL_COMMON_API extern const LLUUID IMG_EXPLOSION_3; +LL_COMMON_API extern const LLUUID IMG_EXPLOSION_4; +LL_COMMON_API extern const LLUUID IMG_SMOKE_POOF; -const LLUUID IMG_BIG_EXPLOSION_1 ("5e47a0dc-97bf-44e0-8b40-de06718cee9d"); // On dataserver -const LLUUID IMG_BIG_EXPLOSION_2 ("9c8eca51-53d5-42a7-bb58-cef070395db8"); // On dataserver +LL_COMMON_API extern const LLUUID IMG_BIG_EXPLOSION_1; +LL_COMMON_API extern const LLUUID IMG_BIG_EXPLOSION_2; -const LLUUID IMG_BLOOM1 ("3c59f7fe-9dc8-47f9-8aaf-a9dd1fbc3bef"); // VIEWER -const LLUUID TERRAIN_DIRT_DETAIL ("0bc58228-74a0-7e83-89bc-5c23464bcec5"); // VIEWER -const LLUUID TERRAIN_GRASS_DETAIL ("63338ede-0037-c4fd-855b-015d77112fc8"); // VIEWER -const LLUUID TERRAIN_MOUNTAIN_DETAIL ("303cd381-8560-7579-23f1-f0a880799740"); // VIEWER -const LLUUID TERRAIN_ROCK_DETAIL ("53a2f406-4895-1d13-d541-d2e3b86bc19c"); // VIEWER +LL_COMMON_API extern const LLUUID IMG_BLOOM1; +LL_COMMON_API extern const LLUUID TERRAIN_DIRT_DETAIL; +LL_COMMON_API extern const LLUUID TERRAIN_GRASS_DETAIL; +LL_COMMON_API extern const LLUUID TERRAIN_MOUNTAIN_DETAIL; +LL_COMMON_API extern const LLUUID TERRAIN_ROCK_DETAIL; -const LLUUID DEFAULT_WATER_NORMAL ("822ded49-9a6c-f61c-cb89-6df54f42cdf4"); // VIEWER +LL_COMMON_API extern const LLUUID DEFAULT_WATER_NORMAL; #endif diff --git a/indra/llcommon/indra_constants.cpp b/indra/llcommon/indra_constants.cpp new file mode 100644 index 0000000000..8a1290d4dc --- /dev/null +++ b/indra/llcommon/indra_constants.cpp @@ -0,0 +1,46 @@ +/** + * @file indra_constants.cpp + * @brief some useful short term constants for Indra + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#include "linden_common.h" + +#include "indra_constants.h" + +#include "lluuid.h" + +// "agent id" for things that should be done to ALL agents +const LLUUID LL_UUID_ALL_AGENTS("44e87126-e794-4ded-05b3-7c42da3d5cdb"); + +// Governor Linden's agent id. +const LLUUID ALEXANDRIA_LINDEN_ID("ba2a564a-f0f1-4b82-9c61-b7520bfcd09f"); +const LLUUID GOVERNOR_LINDEN_ID("3d6181b0-6a4b-97ef-18d8-722652995cf1"); +const LLUUID REALESTATE_LINDEN_ID("3d6181b0-6a4b-97ef-18d8-722652995cf1"); +// Maintenance's group id. +const LLUUID MAINTENANCE_GROUP_ID("dc7b21cd-3c89-fcaa-31c8-25f9ffd224cd"); diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index 6b75a720af..d4a07d77cc 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -34,7 +34,8 @@ #define LL_INDRA_CONSTANTS_H #include "stdtypes.h" -#include "lluuid.h" + +class LLUUID; // At 45 Hz collisions seem stable and objects seem // to settle down at a reasonable rate. @@ -46,7 +47,7 @@ #define PHYSICS_TIMESTEP (1.f / 45.f) const F32 COLLISION_TOLERANCE = 0.1f; -const F32 HALF_COLLISION_TOLERANCE = COLLISION_TOLERANCE * 0.5f; +const F32 HALF_COLLISION_TOLERANCE = 0.05f; // Time constants const U32 HOURS_PER_LINDEN_DAY = 4; @@ -97,9 +98,9 @@ const F32 MIN_AGENT_WIDTH = 0.40f; const F32 DEFAULT_AGENT_WIDTH = 0.60f; const F32 MAX_AGENT_WIDTH = 0.80f; -const F32 MIN_AGENT_HEIGHT = 1.3f - 2.0f * COLLISION_TOLERANCE; +const F32 MIN_AGENT_HEIGHT = 1.1f; const F32 DEFAULT_AGENT_HEIGHT = 1.9f; -const F32 MAX_AGENT_HEIGHT = 2.65f - 2.0f * COLLISION_TOLERANCE; +const F32 MAX_AGENT_HEIGHT = 2.45f; // For linked sets const S32 MAX_CHILDREN_PER_TASK = 255; @@ -266,14 +267,15 @@ const U8 GOD_LIKE = 1; const U8 GOD_NOT = 0; // "agent id" for things that should be done to ALL agents -const LLUUID LL_UUID_ALL_AGENTS("44e87126-e794-4ded-05b3-7c42da3d5cdb"); +LL_COMMON_API extern const LLUUID LL_UUID_ALL_AGENTS; + +// inventory library owner +LL_COMMON_API extern const LLUUID ALEXANDRIA_LINDEN_ID; -// Governor Linden's agent id. -const LLUUID ALEXANDRIA_LINDEN_ID("ba2a564a-f0f1-4b82-9c61-b7520bfcd09f"); -const LLUUID GOVERNOR_LINDEN_ID("3d6181b0-6a4b-97ef-18d8-722652995cf1"); -const LLUUID REALESTATE_LINDEN_ID("3d6181b0-6a4b-97ef-18d8-722652995cf1"); +LL_COMMON_API extern const LLUUID GOVERNOR_LINDEN_ID; +LL_COMMON_API extern const LLUUID REALESTATE_LINDEN_ID; // Maintenance's group id. -const LLUUID MAINTENANCE_GROUP_ID("dc7b21cd-3c89-fcaa-31c8-25f9ffd224cd"); +LL_COMMON_API extern const LLUUID MAINTENANCE_GROUP_ID; // Flags for kick message const U32 KICK_FLAGS_DEFAULT = 0x0; diff --git a/indra/llcommon/linden_common.h b/indra/llcommon/linden_common.h index c2eb867795..771af01279 100644 --- a/indra/llcommon/linden_common.h +++ b/indra/llcommon/linden_common.h @@ -64,6 +64,8 @@ #pragma warning (disable : 4244) // conversion from time_t to S32 #endif // LL_WINDOWS +// *TODO: Eliminate these, most library .cpp files don't need them. +// Add them to llviewerprecompiledheaders.h if necessary. #include <list> #include <map> #include <vector> diff --git a/indra/llcommon/ll_template_cast.h b/indra/llcommon/ll_template_cast.h new file mode 100644 index 0000000000..cff58ce00d --- /dev/null +++ b/indra/llcommon/ll_template_cast.h @@ -0,0 +1,160 @@ +/** + * @file ll_template_cast.h + * @author Nat Goodspeed + * @date 2009-11-21 + * @brief Define ll_template_cast function + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * Copyright (c) 2009, Linden Research, Inc. + * $/LicenseInfo$ + */ + +#if ! defined(LL_LL_TEMPLATE_CAST_H) +#define LL_LL_TEMPLATE_CAST_H + +/** + * Implementation for ll_template_cast() (q.v.). + * + * Default implementation: trying to cast two completely unrelated types + * returns 0. Typically you'd specify T and U as pointer types, but in fact T + * can be any type that can be initialized with 0. + */ +template <typename T, typename U> +struct ll_template_cast_impl +{ + T operator()(U) + { + return 0; + } +}; + +/** + * ll_template_cast<T>(some_value) is for use in a template function when + * some_value might be of arbitrary type, but you want to recognize type T + * specially. + * + * It's designed for use with pointer types. Example: + * @code + * struct SpecialClass + * { + * void someMethod(const std::string&) const; + * }; + * + * template <class REALCLASS> + * void somefunc(const REALCLASS& instance) + * { + * const SpecialClass* ptr = ll_template_cast<const SpecialClass*>(&instance); + * if (ptr) + * { + * ptr->someMethod("Call method only available on SpecialClass"); + * } + * } + * @endcode + * + * Why is this better than dynamic_cast<>? Because unless OtherClass is + * polymorphic, the following won't even compile (gcc 4.0.1): + * @code + * OtherClass other; + * SpecialClass* ptr = dynamic_cast<SpecialClass*>(&other); + * @endcode + * to say nothing of this: + * @code + * void function(int); + * SpecialClass* ptr = dynamic_cast<SpecialClass*>(&function); + * @endcode + * ll_template_cast handles these kinds of cases by returning 0. + */ +template <typename T, typename U> +T ll_template_cast(U value) +{ + return ll_template_cast_impl<T, U>()(value); +} + +/** + * Implementation for ll_template_cast() (q.v.). + * + * Implementation for identical types: return same value. + */ +template <typename T> +struct ll_template_cast_impl<T, T> +{ + T operator()(T value) + { + return value; + } +}; + +/** + * LL_TEMPLATE_CONVERTIBLE(dest, source) asserts that, for a value @c s of + * type @c source, <tt>ll_template_cast<dest>(s)</tt> will return @c s -- + * presuming that @c source can be converted to @c dest by the normal rules of + * C++. + * + * By default, <tt>ll_template_cast<dest>(s)</tt> will return 0 unless @c s's + * type is literally identical to @c dest. (This is because of the + * straightforward application of template specialization rules.) That can + * lead to surprising results, e.g.: + * + * @code + * Foo myFoo; + * const Foo* fooptr = ll_template_cast<const Foo*>(&myFoo); + * @endcode + * + * Here @c fooptr will be 0 because <tt>&myFoo</tt> is of type <tt>Foo*</tt> + * -- @em not <tt>const Foo*</tt>. (Declaring <tt>const Foo myFoo;</tt> would + * force the compiler to do the right thing.) + * + * More disappointingly: + * @code + * struct Base {}; + * struct Subclass: public Base {}; + * Subclass object; + * Base* ptr = ll_template_cast<Base*>(&object); + * @endcode + * + * Here @c ptr will be 0 because <tt>&object</tt> is of type + * <tt>Subclass*</tt> rather than <tt>Base*</tt>. We @em want this cast to + * succeed, but without our help ll_template_cast can't recognize it. + * + * The following would suffice: + * @code + * LL_TEMPLATE_CONVERTIBLE(Base*, Subclass*); + * ... + * Base* ptr = ll_template_cast<Base*>(&object); + * @endcode + * + * However, as noted earlier, this is easily fooled: + * @code + * const Base* ptr = ll_template_cast<const Base*>(&object); + * @endcode + * would still produce 0 because we haven't yet seen: + * @code + * LL_TEMPLATE_CONVERTIBLE(const Base*, Subclass*); + * @endcode + * + * @TODO + * This macro should use Boost type_traits facilities for stripping and + * re-adding @c const and @c volatile qualifiers so that invoking + * LL_TEMPLATE_CONVERTIBLE(dest, source) will automatically generate all + * permitted permutations. It's really not fair to the coder to require + * separate: + * @code + * LL_TEMPLATE_CONVERTIBLE(Base*, Subclass*); + * LL_TEMPLATE_CONVERTIBLE(const Base*, Subclass*); + * LL_TEMPLATE_CONVERTIBLE(const Base*, const Subclass*); + * @endcode + * + * (Naturally we omit <tt>LL_TEMPLATE_CONVERTIBLE(Base*, const Subclass*)</tt> + * because that's not permitted by normal C++ assignment anyway.) + */ +#define LL_TEMPLATE_CONVERTIBLE(DEST, SOURCE) \ +template <> \ +struct ll_template_cast_impl<DEST, SOURCE> \ +{ \ + DEST operator()(SOURCE wrapper) \ + { \ + return wrapper; \ + } \ +} + +#endif /* ! defined(LL_LL_TEMPLATE_CAST_H) */ diff --git a/indra/llcommon/lldictionary.cpp b/indra/llcommon/lldictionary.cpp new file mode 100644 index 0000000000..8730238d92 --- /dev/null +++ b/indra/llcommon/lldictionary.cpp @@ -0,0 +1,52 @@ +/** + * @file lldictionary.cpp + * @brief Lldictionary class header file + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "lldictionary.h" + +#include "llstring.h" + +// Define in .cpp file to prevent header include of llstring.h +LLDictionaryEntry::LLDictionaryEntry(const std::string &name) +: mName(name) +{ + mNameCapitalized = mName; + LLStringUtil::replaceChar(mNameCapitalized, '-', ' '); + LLStringUtil::replaceChar(mNameCapitalized, '_', ' '); + for (U32 i=0; i < mNameCapitalized.size(); i++) + { + if (i == 0 || mNameCapitalized[i-1] == ' ') // don't change ordering of this statement or crash + { + mNameCapitalized[i] = toupper(mNameCapitalized[i]); + } + } +} diff --git a/indra/llcommon/lldictionary.h b/indra/llcommon/lldictionary.h index 436b689ca6..95178b41e7 100644 --- a/indra/llcommon/lldictionary.h +++ b/indra/llcommon/lldictionary.h @@ -33,23 +33,11 @@ #define LL_LLDICTIONARY_H #include <map> +#include <string> -struct LLDictionaryEntry +struct LL_COMMON_API LLDictionaryEntry { - LLDictionaryEntry(const std::string &name) : - mName(name) - { - mNameCapitalized = mName; - LLStringUtil::replaceChar(mNameCapitalized, '-', ' '); - LLStringUtil::replaceChar(mNameCapitalized, '_', ' '); - for (U32 i=0; i < mNameCapitalized.size(); i++) - { - if (i == 0 || mNameCapitalized[i-1] == ' ') // don't change ordering of this statement or crash - { - mNameCapitalized[i] = toupper(mNameCapitalized[i]); - } - } - } + LLDictionaryEntry(const std::string &name); virtual ~LLDictionaryEntry() {} const std::string mName; std::string mNameCapitalized; diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp index 4bdfe5a867..31fdd9e60a 100644 --- a/indra/llcommon/llevents.cpp +++ b/indra/llcommon/llevents.cpp @@ -459,11 +459,25 @@ void LLEventPump::stopListening(const std::string& name) bool LLEventStream::post(const LLSD& event) { if (! mEnabled) + { return false; + } + // NOTE NOTE NOTE: Any new access to member data beyond this point should + // cause us to move our LLStandardSignal object to a pimpl class along + // with said member data. Then the local shared_ptr will preserve both. + + // DEV-43463: capture a local copy of mSignal. We've turned up a + // cross-coroutine scenario (described in the Jira) in which this post() + // call could end up destroying 'this', the LLEventPump subclass instance + // containing mSignal, during the call through *mSignal. So -- capture a + // *stack* instance of the shared_ptr, ensuring that our heap + // LLStandardSignal object will live at least until post() returns, even + // if 'this' gets destroyed during the call. + boost::shared_ptr<LLStandardSignal> signal(mSignal); // Let caller know if any one listener handled the event. This is mostly // useful when using LLEventStream as a listener for an upstream // LLEventPump. - return (*mSignal)(event); + return (*signal)(event); } /***************************************************************************** @@ -492,9 +506,16 @@ void LLEventQueue::flush() // be processed in the *next* flush() call. EventQueue queue(mEventQueue); mEventQueue.clear(); + // NOTE NOTE NOTE: Any new access to member data beyond this point should + // cause us to move our LLStandardSignal object to a pimpl class along + // with said member data. Then the local shared_ptr will preserve both. + + // DEV-43463: capture a local copy of mSignal. See LLEventStream::post() + // for detailed comments. + boost::shared_ptr<LLStandardSignal> signal(mSignal); for ( ; ! queue.empty(); queue.pop_front()) { - (*mSignal)(queue.front()); + (*signal)(queue.front()); } } diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h index f52cf33fd8..a73ada2931 100644 --- a/indra/llcommon/llevents.h +++ b/indra/llcommon/llevents.h @@ -44,6 +44,7 @@ #include "llsd.h" #include "llsingleton.h" #include "lldependencies.h" +#include "ll_template_cast.h" /*==========================================================================*| // override this to allow binding free functions with more parameters @@ -256,6 +257,11 @@ namespace LLEventDetail /// signature. typedef boost::function<LLBoundListener(const LLEventListener&)> ConnectFunc; + /// overload of visit_and_connect() when we have a string identifier available + template <typename LISTENER> + LLBoundListener visit_and_connect(const std::string& name, + const LISTENER& listener, + const ConnectFunc& connect_func); /** * Utility template function to use Visitor appropriately * @@ -266,7 +272,10 @@ namespace LLEventDetail */ template <typename LISTENER> LLBoundListener visit_and_connect(const LISTENER& listener, - const ConnectFunc& connect_func); + const ConnectFunc& connect_func) + { + return visit_and_connect("", listener, connect_func); + } } // namespace LLEventDetail /***************************************************************************** @@ -468,7 +477,8 @@ public: // This is why listen() is a template. Conversion from boost::bind() // to LLEventListener performs type erasure, so it's important to look // at the boost::bind object itself before that happens. - return LLEventDetail::visit_and_connect(listener, + return LLEventDetail::visit_and_connect(name, + listener, boost::bind(&LLEventPump::listen_impl, this, name, @@ -522,7 +532,7 @@ private: protected: /// implement the dispatching - boost::scoped_ptr<LLStandardSignal> mSignal; + boost::shared_ptr<LLStandardSignal> mSignal; /// valve open? bool mEnabled; @@ -664,6 +674,62 @@ private: LLSD mReqid; }; +/** + * Base class for LLListenerWrapper. See visit_and_connect() and llwrap(). We + * provide virtual @c accept_xxx() methods, customization points allowing a + * subclass access to certain data visible at LLEventPump::listen() time. + * Example subclass usage: + * + * @code + * myEventPump.listen("somename", + * llwrap<MyListenerWrapper>(boost::bind(&MyClass::method, instance, _1))); + * @endcode + * + * Because of the anticipated usage (note the anonymous temporary + * MyListenerWrapper instance in the example above), the @c accept_xxx() + * methods must be @c const. + */ +class LL_COMMON_API LLListenerWrapperBase +{ +public: + /// New instance. The accept_xxx() machinery makes it important to use + /// shared_ptrs for our data. Many copies of this object are made before + /// the instance that actually ends up in the signal, yet accept_xxx() + /// will later be called on the @em original instance. All copies of the + /// same original instance must share the same data. + LLListenerWrapperBase(): + mName(new std::string), + mConnection(new LLBoundListener) + { + } + + /// Copy constructor. Copy shared_ptrs to original instance data. + LLListenerWrapperBase(const LLListenerWrapperBase& that): + mName(that.mName), + mConnection(that.mConnection) + { + } + virtual ~LLListenerWrapperBase() {} + + /// Ask LLEventPump::listen() for the listener name + virtual void accept_name(const std::string& name) const + { + *mName = name; + } + + /// Ask LLEventPump::listen() for the new connection + virtual void accept_connection(const LLBoundListener& connection) const + { + *mConnection = connection; + } + +protected: + /// Listener name. + boost::shared_ptr<std::string> mName; + /// Connection. + boost::shared_ptr<LLBoundListener> mConnection; +}; + /***************************************************************************** * Underpinnings *****************************************************************************/ @@ -898,7 +964,8 @@ namespace LLEventDetail * LLStandardSignal, returning LLBoundListener. */ template <typename LISTENER> - LLBoundListener visit_and_connect(const LISTENER& raw_listener, + LLBoundListener visit_and_connect(const std::string& name, + const LISTENER& raw_listener, const ConnectFunc& connect_func) { // Capture the listener @@ -913,14 +980,20 @@ namespace LLEventDetail // which type details have been erased. unwrap() comes from // Boost.Signals, in case we were passed a boost::ref(). visit_each(visitor, LLEventDetail::unwrap(raw_listener)); - // Make the connection using passed function. At present, wrapping - // this functionality into this function is a bit silly: we don't - // really need a visit_and_connect() function any more, just a visit() - // function. The definition of this function dates from when, after - // visit_each(), after establishing the connection, we had to - // postprocess the new connection with the visitor object. That's no - // longer necessary. - return connect_func(listener); + // Make the connection using passed function. + LLBoundListener connection(connect_func(listener)); + // If the LISTENER is an LLListenerWrapperBase subclass, pass it the + // desired information. It's important that we pass the raw_listener + // so the compiler can make decisions based on its original type. + const LLListenerWrapperBase* lwb = + ll_template_cast<const LLListenerWrapperBase*>(&raw_listener); + if (lwb) + { + lwb->accept_name(name); + lwb->accept_connection(connection); + } + // In any case, show new connection to caller. + return connection; } } // namespace LLEventDetail diff --git a/indra/llcommon/lllistenerwrapper.h b/indra/llcommon/lllistenerwrapper.h new file mode 100644 index 0000000000..2f747fb182 --- /dev/null +++ b/indra/llcommon/lllistenerwrapper.h @@ -0,0 +1,181 @@ +/** + * @file lllistenerwrapper.h + * @author Nat Goodspeed + * @date 2009-11-30 + * @brief Introduce LLListenerWrapper template + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * Copyright (c) 2009, Linden Research, Inc. + * $/LicenseInfo$ + */ + +#if ! defined(LL_LLLISTENERWRAPPER_H) +#define LL_LLLISTENERWRAPPER_H + +#include "llevents.h" // LLListenerWrapperBase +#include <boost/visit_each.hpp> + +/** + * Template base class for coding wrappers for LLEventPump listeners. + * + * Derive your listener wrapper from LLListenerWrapper. You must use + * LLLISTENER_WRAPPER_SUBCLASS() so your subclass will play nicely with + * boost::visit_each (q.v.). That way boost::signals2 can still detect + * derivation from LLEventTrackable, and so forth. + */ +template <typename LISTENER> +class LLListenerWrapper: public LLListenerWrapperBase +{ +public: + /// Wrap an arbitrary listener object + LLListenerWrapper(const LISTENER& listener): + mListener(listener) + {} + + /// call + virtual bool operator()(const LLSD& event) + { + return mListener(event); + } + + /// Allow boost::visit_each() to peek at our mListener. + template <class V> + void accept_visitor(V& visitor) const + { + using boost::visit_each; + visit_each(visitor, mListener, 0); + } + +private: + LISTENER mListener; +}; + +/** + * Specialize boost::visit_each() (leveraging ADL) to peek inside an + * LLListenerWrapper<T> to traverse its LISTENER. We borrow the + * accept_visitor() pattern from boost::bind(), avoiding the need to make + * mListener public. + */ +template <class V, typename T> +void visit_each(V& visitor, const LLListenerWrapper<T>& wrapper, int) +{ + wrapper.accept_visitor(visitor); +} + +/// use this (sigh!) for each subclass of LLListenerWrapper<T> you write +#define LLLISTENER_WRAPPER_SUBCLASS(CLASS) \ +template <class V, typename T> \ +void visit_each(V& visitor, const CLASS<T>& wrapper, int) \ +{ \ + visit_each(visitor, static_cast<const LLListenerWrapper<T>&>(wrapper), 0); \ +} \ + \ +/* Have to state this explicitly, rather than using LL_TEMPLATE_CONVERTIBLE, */ \ +/* because the source type is itself a template. */ \ +template <typename T> \ +struct ll_template_cast_impl<const LLListenerWrapperBase*, const CLASS<T>*> \ +{ \ + const LLListenerWrapperBase* operator()(const CLASS<T>* wrapper) \ + { \ + return wrapper; \ + } \ +} + +/** + * Make an instance of a listener wrapper. Every wrapper class must be a + * template accepting a listener object of arbitrary type. In particular, the + * type of a boost::bind() expression is deliberately undocumented. So we + * can't just write Wrapper<CorrectType>(boost::bind(...)). Instead we must + * write llwrap<Wrapper>(boost::bind(...)). + */ +template <template<typename> class WRAPPER, typename T> +WRAPPER<T> llwrap(const T& listener) +{ + return WRAPPER<T>(listener); +} + +/** + * This LLListenerWrapper template subclass is used to report entry/exit to an + * event listener, by changing this: + * @code + * someEventPump.listen("MyClass", + * boost::bind(&MyClass::method, ptr, _1)); + * @endcode + * to this: + * @code + * someEventPump.listen("MyClass", + * llwrap<LLCoutListener>( + * boost::bind(&MyClass::method, ptr, _1))); + * @endcode + */ +template <class LISTENER> +class LLCoutListener: public LLListenerWrapper<LISTENER> +{ + typedef LLListenerWrapper<LISTENER> super; + +public: + /// Wrap an arbitrary listener object + LLCoutListener(const LISTENER& listener): + super(listener) + {} + + /// call + virtual bool operator()(const LLSD& event) + { + std::cout << "Entering listener " << *super::mName << " with " << event << std::endl; + bool handled = super::operator()(event); + std::cout << "Leaving listener " << *super::mName; + if (handled) + { + std::cout << " (handled)"; + } + std::cout << std::endl; + return handled; + } +}; + +LLLISTENER_WRAPPER_SUBCLASS(LLCoutListener); + +/** + * This LLListenerWrapper template subclass is used to log entry/exit to an + * event listener, by changing this: + * @code + * someEventPump.listen("MyClass", + * boost::bind(&MyClass::method, ptr, _1)); + * @endcode + * to this: + * @code + * someEventPump.listen("MyClass", + * llwrap<LLLogListener>( + * boost::bind(&MyClass::method, ptr, _1))); + * @endcode + */ +template <class LISTENER> +class LLLogListener: public LLListenerWrapper<LISTENER> +{ + typedef LLListenerWrapper<LISTENER> super; + +public: + /// Wrap an arbitrary listener object + LLLogListener(const LISTENER& listener): + super(listener) + {} + + /// call + virtual bool operator()(const LLSD& event) + { + LL_DEBUGS("LLLogListener") << "Entering listener " << *super::mName << " with " << event << LL_ENDL; + bool handled = super::operator()(event); + LL_DEBUGS("LLLogListener") << "Leaving listener " << *super::mName; + if (handled) + { + LL_CONT << " (handled)"; + } + LL_CONT << LL_ENDL; + return handled; + } +}; + +LLLISTENER_WRAPPER_SUBCLASS(LLLogListener); + +#endif /* ! defined(LL_LLLISTENERWRAPPER_H) */ diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h index bb3301df9f..5eefa6a16b 100644 --- a/indra/llcommon/llpreprocessor.h +++ b/indra/llcommon/llpreprocessor.h @@ -128,6 +128,10 @@ #pragma warning( disable : 4800 ) // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning) #pragma warning( disable : 4996 ) // warning: deprecated +// Linker optimization with "extern template" generates these warnings +#pragma warning( disable : 4231 ) // nonstandard extension used : 'extern' before template explicit instantiation +#pragma warning( disable : 4506 ) // no definition for inline function + // level 4 warnings that we need to disable: #pragma warning (disable : 4100) // unreferenced formal parameter #pragma warning (disable : 4127) // conditional expression is constant (e.g. while(1) ) diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp index 9140ebb3f3..c863d4e266 100644 --- a/indra/llcommon/llsd.cpp +++ b/indra/llcommon/llsd.cpp @@ -355,7 +355,7 @@ namespace using LLSD::Impl::erase; // Unhiding erase(LLSD::Integer) using LLSD::Impl::ref; // Unhiding ref(LLSD::Integer) virtual LLSD get(const LLSD::String&) const; - LLSD& insert(const LLSD::String& k, const LLSD& v); + void insert(const LLSD::String& k, const LLSD& v); virtual void erase(const LLSD::String&); LLSD& ref(const LLSD::String&); virtual const LLSD& ref(const LLSD::String&) const; @@ -394,14 +394,9 @@ namespace return (i != mData.end()) ? i->second : LLSD(); } - LLSD& ImplMap::insert(const LLSD::String& k, const LLSD& v) + void ImplMap::insert(const LLSD::String& k, const LLSD& v) { mData.insert(DataMap::value_type(k, v)); - #ifdef LL_MSVC7 - return *((LLSD*)this); - #else - return *dynamic_cast<LLSD*>(this); - #endif } void ImplMap::erase(const LLSD::String& k) @@ -450,7 +445,7 @@ namespace virtual int size() const; virtual LLSD get(LLSD::Integer) const; void set(LLSD::Integer, const LLSD&); - LLSD& insert(LLSD::Integer, const LLSD&); + void insert(LLSD::Integer, const LLSD&); void append(const LLSD&); virtual void erase(LLSD::Integer); LLSD& ref(LLSD::Integer); @@ -499,14 +494,10 @@ namespace mData[index] = v; } - LLSD& ImplArray::insert(LLSD::Integer i, const LLSD& v) + void ImplArray::insert(LLSD::Integer i, const LLSD& v) { if (i < 0) { - #ifdef LL_MSVC7 - return *((LLSD*)this); - #else - return *dynamic_cast<LLSD*>(this); - #endif + return; } DataVector::size_type index = i; @@ -516,11 +507,6 @@ namespace } mData.insert(mData.begin() + index, v); - #ifdef LL_MSVC7 - return *((LLSD*)this); - #else - return *dynamic_cast<LLSD*>(this); - #endif } void ImplArray::append(const LLSD& v) @@ -763,11 +749,12 @@ LLSD LLSD::emptyMap() bool LLSD::has(const String& k) const { return safe(impl).has(k); } LLSD LLSD::get(const String& k) const { return safe(impl).get(k); } +void LLSD::insert(const String& k, const LLSD& v) { makeMap(impl).insert(k, v); } -LLSD& LLSD::insert(const String& k, const LLSD& v) +LLSD& LLSD::with(const String& k, const LLSD& v) { makeMap(impl).insert(k, v); - return *dynamic_cast<LLSD*>(this); + return *this; } void LLSD::erase(const String& k) { makeMap(impl).erase(k); } @@ -788,8 +775,9 @@ int LLSD::size() const { return safe(impl).size(); } LLSD LLSD::get(Integer i) const { return safe(impl).get(i); } void LLSD::set(Integer i, const LLSD& v){ makeArray(impl).set(i, v); } +void LLSD::insert(Integer i, const LLSD& v) { makeArray(impl).insert(i, v); } -LLSD& LLSD::insert(Integer i, const LLSD& v) +LLSD& LLSD::with(Integer i, const LLSD& v) { makeArray(impl).insert(i, v); return *this; diff --git a/indra/llcommon/llsd.h b/indra/llcommon/llsd.h index 552bb57498..135133c19c 100644 --- a/indra/llcommon/llsd.h +++ b/indra/llcommon/llsd.h @@ -223,8 +223,9 @@ public: bool has(const String&) const; LLSD get(const String&) const; - LLSD& insert(const String&, const LLSD&); + void insert(const String&, const LLSD&); void erase(const String&); + LLSD& with(const String&, const LLSD&); LLSD& operator[](const String&); LLSD& operator[](const char* c) { return (*this)[String(c)]; } @@ -238,9 +239,10 @@ public: LLSD get(Integer) const; void set(Integer, const LLSD&); - LLSD& insert(Integer, const LLSD&); + void insert(Integer, const LLSD&); void append(const LLSD&); void erase(Integer); + LLSD& with(Integer, const LLSD&); const LLSD& operator[](Integer) const; LLSD& operator[](Integer); diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h index f55fafadd8..ddeb4d1489 100644 --- a/indra/llcommon/llsingleton.h +++ b/indra/llcommon/llsingleton.h @@ -35,7 +35,6 @@ #include <typeinfo> #include <boost/noncopyable.hpp> -#include <boost/any.hpp> /// @brief A global registry of all singletons to prevent duplicate allocations /// across shared library boundaries diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index c027aa7bdd..5f3d9d6582 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -985,6 +985,15 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token, return true; } replacement = datetime.toHTTPDateString(code); + + // *HACK: delete leading zero from hour string in case 'hour12' (code = %I) time format + // to show time without leading zero, e.g. 08:16 -> 8:16 (EXT-2738). + // We could have used '%l' format instead, but it's not supported by Windows. + if(code == "%I" && token == "hour12" && replacement.at(0) == '0') + { + replacement = replacement.at(1); + } + return !code.empty(); } diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index cba8cf85b0..0272c55db2 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -77,72 +77,72 @@ static const S32 CPUINFO_BUFFER_SIZE = 16383; LLCPUInfo gSysCPU; #if LL_WINDOWS -#ifndef DLLVERSIONINFO
-typedef struct _DllVersionInfo
-{
- DWORD cbSize;
- DWORD dwMajorVersion;
- DWORD dwMinorVersion;
- DWORD dwBuildNumber;
- DWORD dwPlatformID;
-}DLLVERSIONINFO;
-#endif
-
-#ifndef DLLGETVERSIONPROC
-typedef int (FAR WINAPI *DLLGETVERSIONPROC) (DLLVERSIONINFO *);
-#endif
-
-bool get_shell32_dll_version(DWORD& major, DWORD& minor, DWORD& build_number)
-{
- bool result = false;
- const U32 BUFF_SIZE = 32767;
- WCHAR tempBuf[BUFF_SIZE];
- if(GetSystemDirectory((LPWSTR)&tempBuf, BUFF_SIZE))
- {
-
- std::basic_string<WCHAR> shell32_path(tempBuf);
-
- // Shell32.dll contains the DLLGetVersion function.
- // according to msdn its not part of the API
- // so you have to go in and get it.
- // http://msdn.microsoft.com/en-us/library/bb776404(VS.85).aspx
- shell32_path += TEXT("\\shell32.dll");
-
- HMODULE hDllInst = LoadLibrary(shell32_path.c_str()); //load the DLL
- if(hDllInst)
- { // Could successfully load the DLL
- DLLGETVERSIONPROC pDllGetVersion;
- /*
- You must get this function explicitly because earlier versions of the DLL
- don't implement this function. That makes the lack of implementation of the
- function a version marker in itself.
- */
- pDllGetVersion = (DLLGETVERSIONPROC) GetProcAddress(hDllInst,
- "DllGetVersion");
-
- if(pDllGetVersion)
- {
- // DLL supports version retrieval function
- DLLVERSIONINFO dvi;
-
- ZeroMemory(&dvi, sizeof(dvi));
- dvi.cbSize = sizeof(dvi);
- HRESULT hr = (*pDllGetVersion)(&dvi);
-
- if(SUCCEEDED(hr))
- { // Finally, the version is at our hands
- major = dvi.dwMajorVersion;
- minor = dvi.dwMinorVersion;
- build_number = dvi.dwBuildNumber;
- result = true;
- }
- }
-
- FreeLibrary(hDllInst); // Release DLL
- }
- }
- return result;
-}
+#ifndef DLLVERSIONINFO +typedef struct _DllVersionInfo +{ + DWORD cbSize; + DWORD dwMajorVersion; + DWORD dwMinorVersion; + DWORD dwBuildNumber; + DWORD dwPlatformID; +}DLLVERSIONINFO; +#endif + +#ifndef DLLGETVERSIONPROC +typedef int (FAR WINAPI *DLLGETVERSIONPROC) (DLLVERSIONINFO *); +#endif + +bool get_shell32_dll_version(DWORD& major, DWORD& minor, DWORD& build_number) +{ + bool result = false; + const U32 BUFF_SIZE = 32767; + WCHAR tempBuf[BUFF_SIZE]; + if(GetSystemDirectory((LPWSTR)&tempBuf, BUFF_SIZE)) + { + + std::basic_string<WCHAR> shell32_path(tempBuf); + + // Shell32.dll contains the DLLGetVersion function. + // according to msdn its not part of the API + // so you have to go in and get it. + // http://msdn.microsoft.com/en-us/library/bb776404(VS.85).aspx + shell32_path += TEXT("\\shell32.dll"); + + HMODULE hDllInst = LoadLibrary(shell32_path.c_str()); //load the DLL + if(hDllInst) + { // Could successfully load the DLL + DLLGETVERSIONPROC pDllGetVersion; + /* + You must get this function explicitly because earlier versions of the DLL + don't implement this function. That makes the lack of implementation of the + function a version marker in itself. + */ + pDllGetVersion = (DLLGETVERSIONPROC) GetProcAddress(hDllInst, + "DllGetVersion"); + + if(pDllGetVersion) + { + // DLL supports version retrieval function + DLLVERSIONINFO dvi; + + ZeroMemory(&dvi, sizeof(dvi)); + dvi.cbSize = sizeof(dvi); + HRESULT hr = (*pDllGetVersion)(&dvi); + + if(SUCCEEDED(hr)) + { // Finally, the version is at our hands + major = dvi.dwMajorVersion; + minor = dvi.dwMinorVersion; + build_number = dvi.dwBuildNumber; + result = true; + } + } + + FreeLibrary(hDllInst); // Release DLL + } + } + return result; +} #endif // LL_WINDOWS LLOSInfo::LLOSInfo() : diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp index 1558df231a..6785d0cf17 100644 --- a/indra/llcommon/tests/llerror_test.cpp +++ b/indra/llcommon/tests/llerror_test.cpp @@ -545,6 +545,15 @@ namespace tut // output order void ErrorTestObject::test<10>() { +#if LL_LINUX + skip("Fails on Linux, see comments"); +// on Linux: +// [error, 10] fail: 'order is time type location function message: expected +// '1947-07-08T03:04:05Z INFO: llcommon/tests/llerror_test.cpp(268) : +// writeReturningLocationAndFunction: apple' actual +// '1947-07-08T03:04:05Z INFO: llcommon/tests/llerror_test.cpp(268) : +// LLError::NoClassInfo::writeReturningLocationAndFunction: apple'' +#endif LLError::setPrintLocation(true); LLError::setTimeFunction(roswell); mRecorder.setWantsTime(true); diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt index 7957c32be2..e93fe90650 100644 --- a/indra/llmath/CMakeLists.txt +++ b/indra/llmath/CMakeLists.txt @@ -86,27 +86,29 @@ list(APPEND llmath_SOURCE_FILES ${llmath_HEADER_FILES}) add_library (llmath ${llmath_SOURCE_FILES}) # Add tests -include(LLAddBuildTest) -# UNIT TESTS -SET(llmath_TEST_SOURCE_FILES - llbboxlocal.cpp - llmodularmath.cpp - llrect.cpp - v2math.cpp - v3color.cpp - v4color.cpp - v4coloru.cpp - ) -LL_ADD_PROJECT_UNIT_TESTS(llmath "${llmath_TEST_SOURCE_FILES}") +if (LL_TESTS) + include(LLAddBuildTest) + # UNIT TESTS + SET(llmath_TEST_SOURCE_FILES + llbboxlocal.cpp + llmodularmath.cpp + llrect.cpp + v2math.cpp + v3color.cpp + v4color.cpp + v4coloru.cpp + ) + LL_ADD_PROJECT_UNIT_TESTS(llmath "${llmath_TEST_SOURCE_FILES}") -# INTEGRATION TESTS -set(test_libs llmath llcommon ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES}) -# TODO: Some of these need refactoring to be proper Unit tests rather than Integration tests. -LL_ADD_INTEGRATION_TEST(llbbox llbbox.cpp "${test_libs}") -LL_ADD_INTEGRATION_TEST(llquaternion llquaternion.cpp "${test_libs}") -LL_ADD_INTEGRATION_TEST(mathmisc "" "${test_libs}") -LL_ADD_INTEGRATION_TEST(m3math "" "${test_libs}") -LL_ADD_INTEGRATION_TEST(v3dmath v3dmath.cpp "${test_libs}") -LL_ADD_INTEGRATION_TEST(v3math v3math.cpp "${test_libs}") -LL_ADD_INTEGRATION_TEST(v4math v4math.cpp "${test_libs}") -LL_ADD_INTEGRATION_TEST(xform xform.cpp "${test_libs}") + # INTEGRATION TESTS + set(test_libs llmath llcommon ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES}) + # TODO: Some of these need refactoring to be proper Unit tests rather than Integration tests. + LL_ADD_INTEGRATION_TEST(llbbox llbbox.cpp "${test_libs}") + LL_ADD_INTEGRATION_TEST(llquaternion llquaternion.cpp "${test_libs}") + LL_ADD_INTEGRATION_TEST(mathmisc "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(m3math "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(v3dmath v3dmath.cpp "${test_libs}") + LL_ADD_INTEGRATION_TEST(v3math v3math.cpp "${test_libs}") + LL_ADD_INTEGRATION_TEST(v4math v4math.cpp "${test_libs}") + LL_ADD_INTEGRATION_TEST(xform xform.cpp "${test_libs}") +endif (LL_TESTS) diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index a611de0cda..1f8ee26716 100644 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -92,6 +92,7 @@ set(llmessage_SOURCE_FILES llxfer_mem.cpp llxfer_vfile.cpp llxorcipher.cpp + machine.cpp message.cpp message_prehash.cpp message_string_table.cpp @@ -100,6 +101,7 @@ set(llmessage_SOURCE_FILES patch_code.cpp patch_dct.cpp patch_idct.cpp + sound_ids.cpp ) set(llmessage_HEADER_FILES @@ -217,36 +219,37 @@ target_link_libraries( ) # tests - -SET(llmessage_TEST_SOURCE_FILES - # llhttpclientadapter.cpp - llmime.cpp - llnamevalue.cpp - lltrustedmessageservice.cpp - lltemplatemessagedispatcher.cpp +if (LL_TESTS) + SET(llmessage_TEST_SOURCE_FILES + # llhttpclientadapter.cpp + llmime.cpp + llnamevalue.cpp + lltrustedmessageservice.cpp + lltemplatemessagedispatcher.cpp llregionpresenceverifier.cpp - ) -LL_ADD_PROJECT_UNIT_TESTS(llmessage "${llmessage_TEST_SOURCE_FILES}") - -# set(TEST_DEBUG on) -set(test_libs - ${LLMESSAGE_LIBRARIES} - ${WINDOWS_LIBRARIES} - ${LLVFS_LIBRARIES} - ${LLMATH_LIBRARIES} - ${LLCOMMON_LIBRARIES} + ) + LL_ADD_PROJECT_UNIT_TESTS(llmessage "${llmessage_TEST_SOURCE_FILES}") + + # set(TEST_DEBUG on) + set(test_libs + ${LLMESSAGE_LIBRARIES} + ${WINDOWS_LIBRARIES} + ${LLVFS_LIBRARIES} + ${LLMATH_LIBRARIES} + ${LLCOMMON_LIBRARIES} ${GOOGLEMOCK_LIBRARIES} - ) + ) -LL_ADD_INTEGRATION_TEST( - llsdmessage - "llsdmessage.cpp" - "${test_libs}" - ${PYTHON_EXECUTABLE} - "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_llsdmessage_peer.py" - ) + LL_ADD_INTEGRATION_TEST( + llsdmessage + "llsdmessage.cpp" + "${test_libs}" + ${PYTHON_EXECUTABLE} + "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_llsdmessage_peer.py" + ) -LL_ADD_INTEGRATION_TEST(llhost "" "${test_libs}") -LL_ADD_INTEGRATION_TEST(llpartdata "" "${test_libs}") -LL_ADD_INTEGRATION_TEST(llxfer_file "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(llhost "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(llpartdata "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(llxfer_file "" "${test_libs}") +endif (LL_TESTS) diff --git a/indra/llmessage/llareslistener.cpp b/indra/llmessage/llareslistener.cpp index 7db3675b77..97efa96d53 100644 --- a/indra/llmessage/llareslistener.cpp +++ b/indra/llmessage/llareslistener.cpp @@ -34,7 +34,7 @@ LLAresListener::LLAresListener(LLAres* llares): "On failure, returns an array containing only the original URI, so\n" "failure case can be processed like success case.", &LLAresListener::rewriteURI, - LLSD().insert("uri", LLSD()).insert("reply", LLSD())); + LLSD().with("uri", LLSD()).with("reply", LLSD())); } /// This UriRewriteResponder subclass packages returned URIs as an LLSD diff --git a/indra/llmessage/lldatapacker.cpp b/indra/llmessage/lldatapacker.cpp index 1f52bf3a23..a1b5c7908d 100644 --- a/indra/llmessage/lldatapacker.cpp +++ b/indra/llmessage/lldatapacker.cpp @@ -55,6 +55,18 @@ LLDataPacker::LLDataPacker() : mPassFlags(0), mWriteEnabled(FALSE) { } +//virtual +void LLDataPacker::reset() +{ + llerrs << "Using unimplemented datapacker reset!" << llendl; +} + +//virtual +void LLDataPacker::dumpBufferToLog() +{ + llerrs << "dumpBufferToLog not implemented for this type!" << llendl; +} + BOOL LLDataPacker::packFixed(const F32 value, const char *name, const BOOL is_signed, const U32 int_bits, const U32 frac_bits) { diff --git a/indra/llmessage/lldatapacker.h b/indra/llmessage/lldatapacker.h index 92bfec698b..b8d9fcbdd4 100644 --- a/indra/llmessage/lldatapacker.h +++ b/indra/llmessage/lldatapacker.h @@ -45,8 +45,9 @@ class LLDataPacker public: virtual ~LLDataPacker() {} - virtual void reset() { llerrs << "Using unimplemented datapacker reset!" << llendl; }; - virtual void dumpBufferToLog() { llerrs << "dumpBufferToLog not implemented for this type!" << llendl; } + // Not required to override, but error to call? + virtual void reset(); + virtual void dumpBufferToLog(); virtual BOOL hasNext() const = 0; diff --git a/indra/llmessage/machine.cpp b/indra/llmessage/machine.cpp new file mode 100644 index 0000000000..afaaeb8ea2 --- /dev/null +++ b/indra/llmessage/machine.cpp @@ -0,0 +1,62 @@ +/** + * @file machine.cpp + * @brief LLMachine class header file + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#include "linden_common.h" + +#include "machine.h" + +#include "llerror.h" + +void LLMachine::setMachinePort(S32 port) +{ + if (port < 0) + { + llinfos << "Can't assign a negative number to LLMachine::mPort" << llendl; + mHost.setPort(0); + } + else + { + mHost.setPort(port); + } +} + +void LLMachine::setControlPort( S32 port ) +{ + if (port < 0) + { + llinfos << "Can't assign a negative number to LLMachine::mControlPort" << llendl; + mControlPort = 0; + } + else + { + mControlPort = port; + } +} diff --git a/indra/llmessage/machine.h b/indra/llmessage/machine.h index 63a038159e..6da8e5e04e 100644 --- a/indra/llmessage/machine.h +++ b/indra/llmessage/machine.h @@ -33,7 +33,6 @@ #ifndef LL_MACHINE_H #define LL_MACHINE_H -#include "llerror.h" #include "net.h" #include "llhost.h" @@ -79,31 +78,8 @@ public: void setMachineIP(U32 ip) { mHost.setAddress(ip); } void setMachineHost(const LLHost &host) { mHost = host; } - void setMachinePort(S32 port) - { - if (port < 0) - { - llinfos << "Can't assign a negative number to LLMachine::mPort" << llendl; - mHost.setPort(0); - } - else - { - mHost.setPort(port); - } - } - - void setControlPort( S32 port ) - { - if (port < 0) - { - llinfos << "Can't assign a negative number to LLMachine::mControlPort" << llendl; - mControlPort = 0; - } - else - { - mControlPort = port; - } - } + void setMachinePort(S32 port); + void setControlPort( S32 port ); // member variables diff --git a/indra/llmessage/sound_ids.cpp b/indra/llmessage/sound_ids.cpp new file mode 100644 index 0000000000..edd9a36c5f --- /dev/null +++ b/indra/llmessage/sound_ids.cpp @@ -0,0 +1,314 @@ +/** + * @file sound_ids.cpp + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#include "linden_common.h" + +#include "sound_ids.h" + +#include "lluuid.h" + +const LLUUID SND_NULL = LLUUID::null; +const LLUUID SND_RIDE ("00000000-0000-0000-0000-000000000100"); +const LLUUID SND_SHOT ("00000000-0000-0000-0000-000000000101"); +const LLUUID SND_MORTAR ("00000000-0000-0000-0000-000000000102"); +const LLUUID SND_HIT ("00000000-0000-0000-0000-000000000103"); +const LLUUID SND_EXPLOSION ("00000000-0000-0000-0000-000000000104"); +const LLUUID SND_BOING ("00000000-0000-0000-0000-000000000105"); +const LLUUID SND_OBJECT_CREATE ("9f1bc096-3592-411e-9b0b-c447a9ff054c"); + +// +// Different bird sounds for different states +// + +const LLUUID SND_CHIRP ("00000000-0000-0000-0000-000000000106"); // Flying random chirp +const LLUUID SND_CHIRP2 ("828a9526-175b-455d-8af0-0e3c0fb602b2"); // Spooked by user +const LLUUID SND_CHIRP3 ("f99772d6-1ce6-4a39-a28b-06d26c94c9e3"); // Spooked by object +const LLUUID SND_CHIRP4 ("54472ca4-7fc9-42cb-b7d5-99ad5b12bd50"); // Chasing other bird +const LLUUID SND_CHIRP5 ("2929964f-fac5-40d7-9179-2864a8fa9ace"); // Hopping random chirp +const LLUUID SND_CHIRPDEAD ("9abff1d3-863a-4e04-bd83-3834fd7fcff4"); // Hit by grenade - dead! + + +const LLUUID SND_MUNCH ("00000000-0000-0000-0000-000000000107"); +const LLUUID SND_PUNCH ("00000000-0000-0000-0000-000000000108"); +const LLUUID SND_SPLASH ("00000000-0000-0000-0000-000000000109"); +const LLUUID SND_CLICK ("00000000-0000-0000-0000-000000000110"); +const LLUUID SND_WHISTLE ("ab858f9a-1f44-4d39-9b33-351543d03ccb"); +const LLUUID SND_TYPING ("5e191c7b-8996-9ced-a177-b2ac32bfea06"); + +const LLUUID SND_ARROW_SHOT ("00000000-0000-0000-0000-000000000111"); +const LLUUID SND_ARROW_THUD ("00000000-0000-0000-0000-000000000112"); +const LLUUID SND_LASER_SHOT ("00000000-0000-0000-0000-000000000113"); +const LLUUID SND_JET_THRUST ("67f5e4f0-0534-4d97-bc01-f297648d20e0"); + +const LLUUID SND_SILENCE ("00000000-0000-0000-0000-000000000114"); +const LLUUID SND_BUBBLES ("00000000-0000-0000-0000-000000000115"); +const LLUUID SND_WELCOME ("00000000-0000-0000-0000-000000000116"); +const LLUUID SND_SQUISH ("00000000-0000-0000-0000-000000000117"); +const LLUUID SND_SUBPOD ("00000000-0000-0000-0000-000000000118"); +const LLUUID SND_FOOTSTEPS ("00000000-0000-0000-0000-000000000119"); +const LLUUID SND_STEP_LEFT ("00000000-0000-0000-0000-000000000124"); +const LLUUID SND_STEP_RIGHT ("00000000-0000-0000-0000-000000000125"); + +const LLUUID SND_BALL_COLLISION ("00000000-0000-0000-0000-000000000120"); + +const LLUUID SND_OOOH_SCARE_ME ("00000000-0000-0000-0000-000000000121"); +const LLUUID SND_PAYBACK_TIME ("00000000-0000-0000-0000-000000000122"); +const LLUUID SND_READY_FOR_BATTLE ("00000000-0000-0000-0000-000000000123"); + +const LLUUID SND_FLESH_FLESH ("dce5fdd4-afe4-4ea1-822f-dd52cac46b08"); +const LLUUID SND_FLESH_PLASTIC ("51011582-fbca-4580-ae9e-1a5593f094ec"); +const LLUUID SND_FLESH_RUBBER ("68d62208-e257-4d0c-bbe2-20c9ea9760bb"); +const LLUUID SND_GLASS_FLESH ("75872e8c-bc39-451b-9b0b-042d7ba36cba"); +const LLUUID SND_GLASS_GLASS ("6a45ba0b-5775-4ea8-8513-26008a17f873"); +const LLUUID SND_GLASS_PLASTIC ("992a6d1b-8c77-40e0-9495-4098ce539694"); +const LLUUID SND_GLASS_RUBBER ("2de4da5a-faf8-46be-bac6-c4d74f1e5767"); +const LLUUID SND_GLASS_WOOD ("6e3fb0f7-6d9c-42ca-b86b-1122ff562d7d"); +const LLUUID SND_METAL_FLESH ("14209133-4961-4acc-9649-53fc38ee1667"); +const LLUUID SND_METAL_GLASS ("bc4a4348-cfcc-4e5e-908e-8a52a8915fe6"); +const LLUUID SND_METAL_METAL ("9e5c1297-6eed-40c0-825a-d9bcd86e3193"); +const LLUUID SND_METAL_PLASTIC ("e534761c-1894-4b61-b20c-658a6fb68157"); +const LLUUID SND_METAL_RUBBER ("8761f73f-6cf9-4186-8aaa-0948ed002db1"); +const LLUUID SND_METAL_WOOD ("874a26fd-142f-4173-8c5b-890cd846c74d"); +const LLUUID SND_PLASTIC_PLASTIC ("0e24a717-b97e-4b77-9c94-b59a5a88b2da"); +const LLUUID SND_RUBBER_PLASTIC ("75cf3ade-9a5b-4c4d-bb35-f9799bda7fb2"); +const LLUUID SND_RUBBER_RUBBER ("153c8bf7-fb89-4d89-b263-47e58b1b4774"); +const LLUUID SND_STONE_FLESH ("55c3e0ce-275a-46fa-82ff-e0465f5e8703"); +const LLUUID SND_STONE_GLASS ("24babf58-7156-4841-9a3f-761bdbb8e237"); +const LLUUID SND_STONE_METAL ("aca261d8-e145-4610-9e20-9eff990f2c12"); +const LLUUID SND_STONE_PLASTIC ("0642fba6-5dcf-4d62-8e7b-94dbb529d117"); +const LLUUID SND_STONE_RUBBER ("25a863e8-dc42-4e8a-a357-e76422ace9b5"); +const LLUUID SND_STONE_STONE ("9538f37c-456e-4047-81be-6435045608d4"); +const LLUUID SND_STONE_WOOD ("8c0f84c3-9afd-4396-b5f5-9bca2c911c20"); +const LLUUID SND_WOOD_FLESH ("be582e5d-b123-41a2-a150-454c39e961c8"); +const LLUUID SND_WOOD_PLASTIC ("c70141d4-ba06-41ea-bcbc-35ea81cb8335"); +const LLUUID SND_WOOD_RUBBER ("7d1826f4-24c4-4aac-8c2e-eff45df37783"); +const LLUUID SND_WOOD_WOOD ("063c97d3-033a-4e9b-98d8-05c8074922cb"); + + +const LLUUID SND_SLIDE_FLESH_FLESH ("614eec22-f73d-4fdc-8691-a37dc5c58333"); +const LLUUID SND_SLIDE_FLESH_PLASTIC (SND_NULL); +const LLUUID SND_SLIDE_FLESH_RUBBER (SND_NULL); +const LLUUID SND_SLIDE_FLESH_FABRIC ("3678b9b9-2a0c-42b5-9c83-80b64ad6e898"); +const LLUUID SND_SLIDE_FLESH_GRAVEL ("02eaa42a-ce1a-4b6b-9c38-cd7ad0e8f4a6"); +const LLUUID SND_SLIDE_FLESH_GRAVEL_02 ("e7d3b501-79f8-4419-b842-ab6843e0f840"); +const LLUUID SND_SLIDE_FLESH_GRAVEL_03 ("4c3e8b52-6244-4e44-85a6-f4ab994418ed"); +const LLUUID SND_SLIDE_GLASS_GRAVEL ("ca491e77-5c47-4ea1-8021-b3ebbf636cab"); +const LLUUID SND_SLIDE_GLASS_GRAVEL_02 ("30794d49-91ce-48e3-a527-c06f67bd6cbe"); +const LLUUID SND_SLIDE_GLASS_GRAVEL_03 ("04c78e54-fd8d-46b6-8ab9-7678b5d6e5cb"); +const LLUUID SND_SLIDE_GLASS_FLESH (SND_NULL); +const LLUUID SND_SLIDE_GLASS_GLASS (SND_NULL); +const LLUUID SND_SLIDE_GLASS_PLASTIC (SND_NULL); +const LLUUID SND_SLIDE_GLASS_RUBBER (SND_NULL); +const LLUUID SND_SLIDE_GLASS_WOOD (SND_NULL); +const LLUUID SND_SLIDE_METAL_FABRIC ("18b66e81-2958-42d4-a373-7a5054919adc"); +const LLUUID SND_SLIDE_METAL_FLESH ("dde65837-633c-4841-af2f-62ec471bf61e"); +const LLUUID SND_SLIDE_METAL_FLESH_02 ("f3cc2cbe-1a1a-4db7-a8d2-e9c8f8fa1f4f"); +const LLUUID SND_SLIDE_METAL_GLASS ("4188be39-7b1f-4495-bf2b-83ddd82eea05"); +const LLUUID SND_SLIDE_METAL_GLASS_02 ("336faa2b-9d96-4e14-93ad-b63b60074379"); +const LLUUID SND_SLIDE_METAL_GLASS_03 ("34d912aa-cf73-4462-b7d0-dcba2c66caba"); +const LLUUID SND_SLIDE_METAL_GLASS_04 ("97ffc063-e872-4469-8e95-1450ac6bad2b"); +const LLUUID SND_SLIDE_METAL_GRAVEL ("2bbff37d-009a-4cfc-9a0d-817652c08fbe"); +const LLUUID SND_SLIDE_METAL_GRAVEL_02 ("a906a228-783b-49e7-9f0a-e20a41d0e39f"); +const LLUUID SND_SLIDE_METAL_METAL ("09461277-c691-45de-b2c5-89dfd3712f79"); +const LLUUID SND_SLIDE_METAL_METAL_02 ("e00a5d97-8fdc-46c1-bd53-7e312727466c"); +const LLUUID SND_SLIDE_METAL_METAL_03 ("8ebfa780-c440-4b52-ab65-5edf3bc15bf1"); +const LLUUID SND_SLIDE_METAL_METAL_04 ("d6d03cb2-5b16-4e31-b7d4-2a81d2a0909b"); +const LLUUID SND_SLIDE_METAL_METAL_05 ("3a46f447-916e-47de-a1e5-95d1af46bd0f"); +const LLUUID SND_SLIDE_METAL_METAL_06 ("cd423231-e70d-4fd2-ad26-f1c6cf5f0610"); +const LLUUID SND_SLIDE_METAL_PLASTIC (SND_NULL); +const LLUUID SND_SLIDE_METAL_RUBBER ("12d97bc0-3c15-4744-b6bd-77d1316eb4f0"); +const LLUUID SND_SLIDE_METAL_WOOD ("4afb6926-a73f-4cb7-85d5-0f9a40107434"); +const LLUUID SND_SLIDE_METAL_WOOD_02 ("349970bf-187d-4bcb-b2cf-e7bb6581590f"); +const LLUUID SND_SLIDE_METAL_WOOD_03 ("64bf6e87-73d4-4cb4-84f7-55cecfd97cd3"); +const LLUUID SND_SLIDE_METAL_WOOD_04 ("0dc670a9-dbe8-41bc-b8ee-4d96d99219d5"); +const LLUUID SND_SLIDE_METAL_WOOD_05 ("6e3cc57b-c9aa-4829-86a1-8e82aeaccb47"); +const LLUUID SND_SLIDE_METAL_WOOD_06 ("c1237f4c-8c88-4da1-bfbc-2af26a8d9e5a"); +const LLUUID SND_SLIDE_METAL_WOOD_07 ("0e1ec243-063b-4dcb-a903-52b8dffed3d2"); +const LLUUID SND_SLIDE_METAL_WOOD_08 ("66736d0f-533d-4007-a8ee-0f27c2034126"); +const LLUUID SND_SLIDE_PLASTIC_GRAVEL ("35092c21-5c48-4b4d-a818-3cf240af2348"); +const LLUUID SND_SLIDE_PLASTIC_GRAVEL_02("c37f5776-0020-47e8-89a0-c74cc6f5742d"); +const LLUUID SND_SLIDE_PLASTIC_GRAVEL_03("d2fc8db6-2e66-464a-8ccb-f99b61ee4987"); +const LLUUID SND_SLIDE_PLASTIC_GRAVEL_04("93cbdb10-6e82-4c0b-a547-7b3b79ac25f6"); +const LLUUID SND_SLIDE_PLASTIC_GRAVEL_05("2f6d0542-fcd1-4264-a17b-f57bf5ebf402"); +const LLUUID SND_SLIDE_PLASTIC_GRAVEL_06("5b8887d4-3be2-45a0-b25d-85af3b1e6392"); +const LLUUID SND_SLIDE_PLASTIC_PLASTIC (SND_NULL); +const LLUUID SND_SLIDE_PLASTIC_PLASTIC_02 (SND_NULL); +const LLUUID SND_SLIDE_PLASTIC_PLASTIC_03 (SND_NULL); +const LLUUID SND_SLIDE_PLASTIC_FABRIC ("7294d9ad-3e41-4373-992c-a9f21d5d66ad"); +const LLUUID SND_SLIDE_PLASTIC_FABRIC_02("58608ce1-f524-472f-b447-bbe6ce4a46e0"); +const LLUUID SND_SLIDE_PLASTIC_FABRIC_03("06ae285e-0b34-4ea6-84ab-9c6c31b414fc"); +const LLUUID SND_SLIDE_PLASTIC_FABRIC_04("211613db-0461-49bd-9554-5c14ad8b31f6"); +const LLUUID SND_SLIDE_RUBBER_PLASTIC ("a98ffa5a-e48e-4f9d-9242-b9a3210ad84a"); +const LLUUID SND_SLIDE_RUBBER_PLASTIC_02 ("d4136c40-eeaa-49c6-a982-8e5a16f5d93a"); +const LLUUID SND_SLIDE_RUBBER_PLASTIC_03 ("29ec0fb2-0b23-47b2-835b-c83cc7cf9fb0"); +const LLUUID SND_SLIDE_RUBBER_RUBBER (SND_NULL); +const LLUUID SND_SLIDE_STONE_FLESH (SND_NULL); +const LLUUID SND_SLIDE_STONE_GLASS (SND_NULL); +const LLUUID SND_SLIDE_STONE_METAL (SND_NULL); +const LLUUID SND_SLIDE_STONE_PLASTIC ("afd0bcc3-d41a-4572-9e7f-08a29eeb0b8a"); +const LLUUID SND_SLIDE_STONE_PLASTIC_02 ("881b720a-96cf-4128-bb98-5d87e03e93c7"); +const LLUUID SND_SLIDE_STONE_PLASTIC_03 ("293dac42-658a-4c5a-a7a2-6d4c5e5658b0"); +const LLUUID SND_SLIDE_STONE_RUBBER ("0724b946-6a3f-4eeb-bb50-0a3b33120974"); +const LLUUID SND_SLIDE_STONE_RUBBER_02 ("ada93d00-76e2-4bf1-9ad9-493727630717"); +const LLUUID SND_SLIDE_STONE_STONE ("ade766dc-2e75-4699-9b41-7c8e53d2b3f2"); +const LLUUID SND_SLIDE_STONE_STONE_02 ("66698375-6594-47b0-8046-c3973de1291d"); +const LLUUID SND_SLIDE_STONE_WOOD ("174ef324-ed50-4f65-9479-b4da580aeb3c"); +const LLUUID SND_SLIDE_STONE_WOOD_02 ("33d517fd-ff11-4d01-a7b5-0e3abf818dcf"); +const LLUUID SND_SLIDE_STONE_WOOD_03 ("1bac4b63-e6fd-4659-9761-991284cf4582"); +const LLUUID SND_SLIDE_STONE_WOOD_04 ("a7d28564-6821-4c01-a378-cde98fba7ba9"); +const LLUUID SND_SLIDE_WOOD_FABRIC ("22c58e74-22cd-4960-9ab7-5bf08ab824e5"); +const LLUUID SND_SLIDE_WOOD_FABRIC_02 ("0b0ed22e-4a0f-4617-a4cf-20d0f2b78ccc"); +const LLUUID SND_SLIDE_WOOD_FABRIC_03 ("42b80abb-9823-4b74-a210-326ccf23636a"); +const LLUUID SND_SLIDE_WOOD_FABRIC_04 ("8538298a-1e6b-4b69-a9ee-5e01e4a02b35"); +const LLUUID SND_SLIDE_WOOD_FLESH ("84b026f3-a11c-4366-aa7c-07edcd89b2bb"); +const LLUUID SND_SLIDE_WOOD_FLESH_02 ("2644191f-4848-47ba-8ba7-bddc0bfcb3da"); +const LLUUID SND_SLIDE_WOOD_FLESH_03 ("edb978e4-9be9-456f-b2fc-e8502bfe25be"); +const LLUUID SND_SLIDE_WOOD_FLESH_04 ("bf2b972e-f42a-46d7-b53e-5fca38f5bc61"); +const LLUUID SND_SLIDE_WOOD_GRAVEL ("d063bb4d-0eff-4403-a6cc-c6c6c073e624"); +const LLUUID SND_SLIDE_WOOD_GRAVEL_02 ("511eb679-6d93-47fa-9141-c3ef9261c919"); +const LLUUID SND_SLIDE_WOOD_GRAVEL_03 ("4ed1fd43-4707-4e5c-b7b7-21ec4e72c1ac"); +const LLUUID SND_SLIDE_WOOD_GRAVEL_04 ("99ea89b3-aa76-4b87-99c8-670365c6d8c3"); +const LLUUID SND_SLIDE_WOOD_PLASTIC ("505ca3c4-94a0-4e28-8fc1-ea72a428396b"); +const LLUUID SND_SLIDE_WOOD_PLASTIC_02 ("fc404011-df71-4ed0-8f22-b72bdd18f63c"); +const LLUUID SND_SLIDE_WOOD_PLASTIC_03 ("67dbe225-26df-4efa-8c8b-f1ef669fec45"); +const LLUUID SND_SLIDE_WOOD_RUBBER (SND_NULL); +const LLUUID SND_SLIDE_WOOD_WOOD ("3079d569-b3e8-4df4-9e09-f0d4611213ef"); +const LLUUID SND_SLIDE_WOOD_WOOD_02 ("276b093d-dbcb-4279-a89e-a54b0b416af6"); +const LLUUID SND_SLIDE_WOOD_WOOD_03 ("c3f3ca5e-2768-4081-847f-247139310fdb"); +const LLUUID SND_SLIDE_WOOD_WOOD_04 ("f08d44b8-ff87-4a98-9561-c72f1f2fec81"); +const LLUUID SND_SLIDE_WOOD_WOOD_05 ("2d8a58cf-f139-4238-8503-27d334d05c85"); +const LLUUID SND_SLIDE_WOOD_WOOD_06 ("e157ebbd-b12d-4225-aa7c-d47b026a7687"); +const LLUUID SND_SLIDE_WOOD_WOOD_07 ("35e17956-e7b4-478c-b274-e37db8a166b2"); +const LLUUID SND_SLIDE_WOOD_WOOD_08 ("e606fc65-0643-4964-9979-ff964fa6a62c"); + + +const LLUUID SND_ROLL_FLESH_FLESH (SND_NULL); +const LLUUID SND_ROLL_FLESH_PLASTIC ("89a0be4c-848d-4a6e-8886-298f56c2cff4"); +const LLUUID SND_ROLL_FLESH_PLASTIC_02 ("beb06343-1aa1-4af2-b320-5d2ec31c53b1"); +const LLUUID SND_ROLL_FLESH_RUBBER (SND_NULL); +const LLUUID SND_ROLL_GLASS_GRAVEL ("ba795c74-7e09-4572-b495-e09886a46b86"); +const LLUUID SND_ROLL_GLASS_GRAVEL_02 ("4c93c3b7-14cb-4d9b-a7df-628ad935f1f2"); +const LLUUID SND_ROLL_GLASS_FLESH (SND_NULL); +const LLUUID SND_ROLL_GLASS_GLASS (SND_NULL); +const LLUUID SND_ROLL_GLASS_PLASTIC (SND_NULL); +const LLUUID SND_ROLL_GLASS_RUBBER (SND_NULL); +const LLUUID SND_ROLL_GLASS_WOOD ("d40b1f48-a061-4f6e-b18f-4326a3dd5c29"); +const LLUUID SND_ROLL_GLASS_WOOD_02 ("78cd407a-bb36-4163-ba09-20f2e6d9d44b"); +const LLUUID SND_ROLL_GRAVEL_GRAVEL ("c7354cc3-6df5-4738-8dbb-b28a6ac46a05"); +const LLUUID SND_ROLL_GRAVEL_GRAVEL_02 ("01d194c4-72a6-47df-81a5-8db430faff87"); +const LLUUID SND_ROLL_METAL_FABRIC ("ce6e6564-20fd-48e4-81e2-cd3f81c00a3e"); +const LLUUID SND_ROLL_METAL_FABRIC_02 ("fc4d0065-32f6-4bb0-9f3f-f4737eb27163"); +const LLUUID SND_ROLL_METAL_FLESH (SND_NULL); +const LLUUID SND_ROLL_METAL_GLASS ("63d530bb-a41f-402b-aa1f-be6b11959809"); +const LLUUID SND_ROLL_METAL_GLASS_02 ("f62642c2-6db5-4faa-8b77-939067d837c3"); +const LLUUID SND_ROLL_METAL_GLASS_03 ("db5b5a15-2817-4cd7-9f0b-9ad49b5e52c8"); +const LLUUID SND_ROLL_METAL_GRAVEL ("447164e3-9646-4c1a-a16d-606892891466"); +const LLUUID SND_ROLL_METAL_METAL ("c3c22cf3-5d1f-4cc3-b4b5-708b9f65979c"); +const LLUUID SND_ROLL_METAL_METAL_02 ("d8386277-a1ea-460e-b6fd-bb285c323bf1"); +const LLUUID SND_ROLL_METAL_METAL_03 ("69ee1f02-f9cd-4c8b-aedd-39a2d6705680"); +const LLUUID SND_ROLL_METAL_METAL_04 ("5cc6b5fd-26ce-47ad-b21d-3a7c190dd375"); +const LLUUID SND_ROLL_METAL_PLASTIC ("c6a9bbf6-df15-4713-9f84-7237fce4051e"); +const LLUUID SND_ROLL_METAL_PLASTIC_01 ("0fedb59b-2dbb-4cec-b6cc-8559ec027749"); +const LLUUID SND_ROLL_METAL_RUBBER (SND_NULL); +const LLUUID SND_ROLL_METAL_WOOD ("1d76af57-01b1-4c73-9a1d-69523bfa50ea"); +const LLUUID SND_ROLL_METAL_WOOD_02 ("78aa4e71-8e7c-4b90-a561-3ebdc639f99b"); +const LLUUID SND_ROLL_METAL_WOOD_03 ("777d95bf-962f-48fa-93bf-8c1806557d72"); +const LLUUID SND_ROLL_METAL_WOOD_04 ("1833da76-45e2-4a8b-97da-d17413e056c9"); +const LLUUID SND_ROLL_METAL_WOOD_05 ("b13e1232-3d8d-42e9-92ec-b30f9f823962"); +const LLUUID SND_ROLL_PLASTIC_FABRIC ("616a1f03-209f-4c55-b264-83a000b6ef0a"); +const LLUUID SND_ROLL_PLASTIC_PLASTIC ("873f3d82-00b2-4082-9c69-7aef3461dba1"); +const LLUUID SND_ROLL_PLASTIC_PLASTIC_02 ("cc39879f-ebc8-4405-a4fc-8342f5bed31e"); +const LLUUID SND_ROLL_RUBBER_PLASTIC (SND_NULL); +const LLUUID SND_ROLL_RUBBER_RUBBER (SND_NULL); +const LLUUID SND_ROLL_STONE_FLESH (SND_NULL); +const LLUUID SND_ROLL_STONE_GLASS (SND_NULL); +const LLUUID SND_ROLL_STONE_METAL (SND_NULL); +const LLUUID SND_ROLL_STONE_PLASTIC ("155f65a8-cae7-476e-a58b-fd362be7fd0e"); +const LLUUID SND_ROLL_STONE_RUBBER (SND_NULL); +const LLUUID SND_ROLL_STONE_STONE ("67d56e3f-6ed5-4658-9418-14f020c38b11"); +const LLUUID SND_ROLL_STONE_STONE_02 ("43d99d10-d75b-4246-accf-4ceb2c909aa7"); +const LLUUID SND_ROLL_STONE_STONE_03 ("f04e83ff-eed7-4e99-8f45-eb97e4e1d3b7"); +const LLUUID SND_ROLL_STONE_STONE_04 ("10fcc5ad-fa89-48d6-b774-986b580c1efc"); +const LLUUID SND_ROLL_STONE_STONE_05 ("3d86f5a3-1a91-49d9-b99f-8521a7422497"); +const LLUUID SND_ROLL_STONE_WOOD ("53e46fb7-6c21-4fe1-bffe-0567475d48fa"); +const LLUUID SND_ROLL_STONE_WOOD_02 ("5eba8c9a-a014-4299-87f1-315c45ec795b"); +const LLUUID SND_ROLL_STONE_WOOD_03 ("ea6c05fc-6e9c-4526-8a20-bc47810bb549"); +const LLUUID SND_ROLL_STONE_WOOD_04 ("64618cbf-3f42-4728-8094-e77807545efb"); +const LLUUID SND_ROLL_WOOD_FLESH ("26ee185d-6fc3-49f8-89ba-51cab04cfc42"); +const LLUUID SND_ROLL_WOOD_FLESH_02 ("334faa25-1e80-4c99-b29f-4c9c2a3d079d"); +const LLUUID SND_ROLL_WOOD_FLESH_03 ("2f876626-4dce-4f71-a91e-a25302edfab7"); +const LLUUID SND_ROLL_WOOD_FLESH_04 ("d6877aac-07fc-4931-bcde-585f223802ad"); +const LLUUID SND_ROLL_WOOD_GRAVEL ("2a23ebb5-a4a2-4f1f-8d75-7384239354aa"); +const LLUUID SND_ROLL_WOOD_GRAVEL_02 ("208bf26d-f097-450c-95c4-9d26317c613c"); +const LLUUID SND_ROLL_WOOD_GRAVEL_03 ("a26ecaf4-92c6-4e32-9864-56b7c70cab8e"); +const LLUUID SND_ROLL_WOOD_PLASTIC ("71c1000a-9f16-4cc3-8ede-ec4aa3bf5723"); +const LLUUID SND_ROLL_WOOD_PLASTIC_02 ("7bc20ba6-1e6d-4eea-83ad-c5cc3ae0e409"); +const LLUUID SND_ROLL_WOOD_RUBBER (SND_NULL); +const LLUUID SND_ROLL_WOOD_WOOD ("2cc8eec4-bb4a-4ba8-b783-71526ec708e8"); +const LLUUID SND_ROLL_WOOD_WOOD_02 ("0a1f8070-a11a-4b4c-b260-5ffb6acb0a5d"); +const LLUUID SND_ROLL_WOOD_WOOD_03 ("160bef64-da9c-4be8-b07b-a5060b501700"); +const LLUUID SND_ROLL_WOOD_WOOD_04 ("1c62ea16-cc60-48ed-829a-68b8f4cf0c1c"); +const LLUUID SND_ROLL_WOOD_WOOD_05 ("be9cc8fe-b920-4bf5-8924-453088cbc03f"); +const LLUUID SND_ROLL_WOOD_WOOD_06 ("a76cfe60-56b0-43b1-8f31-93e56947d78b"); +const LLUUID SND_ROLL_WOOD_WOOD_07 ("0c6aa481-b5bc-4573-ae83-8e16ff27e750"); +const LLUUID SND_ROLL_WOOD_WOOD_08 ("214ab2c7-871a-451b-b0db-4c5677199011"); +const LLUUID SND_ROLL_WOOD_WOOD_09 ("0086e4db-3ac6-4545-b414-6f359bedd9a5"); + +const LLUUID SND_SLIDE_STONE_STONE_01 ("2a7dcbd1-d3e6-4767-8432-8322648e7b9d"); + +const LLUUID SND_STONE_DIRT_01 ("97727335-392c-4338-ac4b-23a7883279c2"); +const LLUUID SND_STONE_DIRT_02 ("cbe75eb2-3375-41d8-9e3f-2ae46b4164ed"); +const LLUUID SND_STONE_DIRT_03 ("31e236ee-001b-4c8e-ad6c-c2074cb64357"); +const LLUUID SND_STONE_DIRT_04 ("c8091652-e04b-4a11-84ba-15dba06e7a1b"); + +const LLUUID SND_STONE_STONE_02 ("ba4ef5ac-7435-4240-b826-c24ba8fa5a78"); +const LLUUID SND_STONE_STONE_04 ("ea296329-0f09-4993-af1b-e6784bab1dc9"); + + + +// extra guids +#if 0 +const LLUUID SND_ ("a839b8ac-b0af-4ba9-9fde-188754744e02"); +const LLUUID SND_ ("20165fa8-836f-4993-85dc-1529172dcd14"); +const LLUUID SND_ ("fba8e17b-a4b3-4693-9fce-c14800f8a349"); +const LLUUID SND_ ("2d48db8b-7260-4b02-ad2a-b2c6bee60e94"); +const LLUUID SND_ ("956d344b-1808-4d8b-88b1-cbc82b7a96a1"); +const LLUUID SND_ ("b8303cc6-f0b4-4c6f-a199-81f87aba342e"); +const LLUUID SND_ ("fbf7cd0c-bc8f-4cba-9c19-11f4dd03a06b"); +const LLUUID SND_ ("85047f7d-933a-4ce5-a7b5-34670243e1ab"); +const LLUUID SND_ ("0f81acf7-6a2e-4490-957f-c7b0eda00559"); +const LLUUID SND_ ("5631a6a1-79b4-4de8-bccf-1880b6882da1"); +const LLUUID SND_ ("43c87a6b-ffb2-437b-89a0-9deba890a4fc"); +const LLUUID SND_ ("58878d1d-3156-4d01-ac3c-0c4fb99f4d53"); +const LLUUID SND_ ("9a83f321-44bf-40f6-b006-46c085515345"); +const LLUUID SND_ ("ff144533-33ab-40f2-bac8-39c34699ecc4"); +const LLUUID SND_ ("09018e87-d52c-4cd5-9805-015f413319e7"); +const LLUUID SND_ ("17d4c057-7edd-401e-9589-d5b9fe981bf2"); +#endif diff --git a/indra/llmessage/sound_ids.h b/indra/llmessage/sound_ids.h index e7a919056e..f67fdd2aaf 100644 --- a/indra/llmessage/sound_ids.h +++ b/indra/llmessage/sound_ids.h @@ -33,285 +33,263 @@ #ifndef LL_SOUND_IDS_H #define LL_SOUND_IDS_H -#include "lluuid.h" +// *NOTE: Do not put the actual IDs in this file - otherwise the symbols +// and values will be copied into every .o/.obj file and increase link time. -const LLUUID SND_NULL = LLUUID::null; -const LLUUID SND_RIDE ("00000000-0000-0000-0000-000000000100"); -const LLUUID SND_SHOT ("00000000-0000-0000-0000-000000000101"); -const LLUUID SND_MORTAR ("00000000-0000-0000-0000-000000000102"); -const LLUUID SND_HIT ("00000000-0000-0000-0000-000000000103"); -const LLUUID SND_EXPLOSION ("00000000-0000-0000-0000-000000000104"); -const LLUUID SND_BOING ("00000000-0000-0000-0000-000000000105"); -const LLUUID SND_OBJECT_CREATE ("9f1bc096-3592-411e-9b0b-c447a9ff054c"); +class LLUUID; -// -// Different bird sounds for different states -// - -const LLUUID SND_CHIRP ("00000000-0000-0000-0000-000000000106"); // Flying random chirp -const LLUUID SND_CHIRP2 ("828a9526-175b-455d-8af0-0e3c0fb602b2"); // Spooked by user -const LLUUID SND_CHIRP3 ("f99772d6-1ce6-4a39-a28b-06d26c94c9e3"); // Spooked by object -const LLUUID SND_CHIRP4 ("54472ca4-7fc9-42cb-b7d5-99ad5b12bd50"); // Chasing other bird -const LLUUID SND_CHIRP5 ("2929964f-fac5-40d7-9179-2864a8fa9ace"); // Hopping random chirp -const LLUUID SND_CHIRPDEAD ("9abff1d3-863a-4e04-bd83-3834fd7fcff4"); // Hit by grenade - dead! - - -const LLUUID SND_MUNCH ("00000000-0000-0000-0000-000000000107"); -const LLUUID SND_PUNCH ("00000000-0000-0000-0000-000000000108"); -const LLUUID SND_SPLASH ("00000000-0000-0000-0000-000000000109"); -const LLUUID SND_CLICK ("00000000-0000-0000-0000-000000000110"); -const LLUUID SND_WHISTLE ("ab858f9a-1f44-4d39-9b33-351543d03ccb"); -const LLUUID SND_TYPING ("5e191c7b-8996-9ced-a177-b2ac32bfea06"); +extern const LLUUID SND_NULL; +extern const LLUUID SND_RIDE; +extern const LLUUID SND_SHOT; +extern const LLUUID SND_MORTAR; +extern const LLUUID SND_HIT; +extern const LLUUID SND_EXPLOSION; +extern const LLUUID SND_BOING; +extern const LLUUID SND_OBJECT_CREATE; -const LLUUID SND_ARROW_SHOT ("00000000-0000-0000-0000-000000000111"); -const LLUUID SND_ARROW_THUD ("00000000-0000-0000-0000-000000000112"); -const LLUUID SND_LASER_SHOT ("00000000-0000-0000-0000-000000000113"); -const LLUUID SND_JET_THRUST ("67f5e4f0-0534-4d97-bc01-f297648d20e0"); +// Different bird sounds for different states +extern const LLUUID SND_CHIRP; // Flying random chirp +extern const LLUUID SND_CHIRP2; // Spooked by user +extern const LLUUID SND_CHIRP3; // Spooked by object +extern const LLUUID SND_CHIRP4; // Chasing other bird +extern const LLUUID SND_CHIRP5; // Hopping random chirp +extern const LLUUID SND_CHIRPDEAD; // Hit by grenade - dead! -const LLUUID SND_SILENCE ("00000000-0000-0000-0000-000000000114"); -const LLUUID SND_BUBBLES ("00000000-0000-0000-0000-000000000115"); -const LLUUID SND_WELCOME ("00000000-0000-0000-0000-000000000116"); -const LLUUID SND_SQUISH ("00000000-0000-0000-0000-000000000117"); -const LLUUID SND_SUBPOD ("00000000-0000-0000-0000-000000000118"); -const LLUUID SND_FOOTSTEPS ("00000000-0000-0000-0000-000000000119"); -const LLUUID SND_STEP_LEFT ("00000000-0000-0000-0000-000000000124"); -const LLUUID SND_STEP_RIGHT ("00000000-0000-0000-0000-000000000125"); -const LLUUID SND_BALL_COLLISION ("00000000-0000-0000-0000-000000000120"); +extern const LLUUID SND_MUNCH; +extern const LLUUID SND_PUNCH; +extern const LLUUID SND_SPLASH; +extern const LLUUID SND_CLICK; +extern const LLUUID SND_WHISTLE; +extern const LLUUID SND_TYPING; -const LLUUID SND_OOOH_SCARE_ME ("00000000-0000-0000-0000-000000000121"); -const LLUUID SND_PAYBACK_TIME ("00000000-0000-0000-0000-000000000122"); -const LLUUID SND_READY_FOR_BATTLE ("00000000-0000-0000-0000-000000000123"); +extern const LLUUID SND_ARROW_SHOT; +extern const LLUUID SND_ARROW_THUD; +extern const LLUUID SND_LASER_SHOT; +extern const LLUUID SND_JET_THRUST; -const LLUUID SND_FLESH_FLESH ("dce5fdd4-afe4-4ea1-822f-dd52cac46b08"); -const LLUUID SND_FLESH_PLASTIC ("51011582-fbca-4580-ae9e-1a5593f094ec"); -const LLUUID SND_FLESH_RUBBER ("68d62208-e257-4d0c-bbe2-20c9ea9760bb"); -const LLUUID SND_GLASS_FLESH ("75872e8c-bc39-451b-9b0b-042d7ba36cba"); -const LLUUID SND_GLASS_GLASS ("6a45ba0b-5775-4ea8-8513-26008a17f873"); -const LLUUID SND_GLASS_PLASTIC ("992a6d1b-8c77-40e0-9495-4098ce539694"); -const LLUUID SND_GLASS_RUBBER ("2de4da5a-faf8-46be-bac6-c4d74f1e5767"); -const LLUUID SND_GLASS_WOOD ("6e3fb0f7-6d9c-42ca-b86b-1122ff562d7d"); -const LLUUID SND_METAL_FLESH ("14209133-4961-4acc-9649-53fc38ee1667"); -const LLUUID SND_METAL_GLASS ("bc4a4348-cfcc-4e5e-908e-8a52a8915fe6"); -const LLUUID SND_METAL_METAL ("9e5c1297-6eed-40c0-825a-d9bcd86e3193"); -const LLUUID SND_METAL_PLASTIC ("e534761c-1894-4b61-b20c-658a6fb68157"); -const LLUUID SND_METAL_RUBBER ("8761f73f-6cf9-4186-8aaa-0948ed002db1"); -const LLUUID SND_METAL_WOOD ("874a26fd-142f-4173-8c5b-890cd846c74d"); -const LLUUID SND_PLASTIC_PLASTIC ("0e24a717-b97e-4b77-9c94-b59a5a88b2da"); -const LLUUID SND_RUBBER_PLASTIC ("75cf3ade-9a5b-4c4d-bb35-f9799bda7fb2"); -const LLUUID SND_RUBBER_RUBBER ("153c8bf7-fb89-4d89-b263-47e58b1b4774"); -const LLUUID SND_STONE_FLESH ("55c3e0ce-275a-46fa-82ff-e0465f5e8703"); -const LLUUID SND_STONE_GLASS ("24babf58-7156-4841-9a3f-761bdbb8e237"); -const LLUUID SND_STONE_METAL ("aca261d8-e145-4610-9e20-9eff990f2c12"); -const LLUUID SND_STONE_PLASTIC ("0642fba6-5dcf-4d62-8e7b-94dbb529d117"); -const LLUUID SND_STONE_RUBBER ("25a863e8-dc42-4e8a-a357-e76422ace9b5"); -const LLUUID SND_STONE_STONE ("9538f37c-456e-4047-81be-6435045608d4"); -const LLUUID SND_STONE_WOOD ("8c0f84c3-9afd-4396-b5f5-9bca2c911c20"); -const LLUUID SND_WOOD_FLESH ("be582e5d-b123-41a2-a150-454c39e961c8"); -const LLUUID SND_WOOD_PLASTIC ("c70141d4-ba06-41ea-bcbc-35ea81cb8335"); -const LLUUID SND_WOOD_RUBBER ("7d1826f4-24c4-4aac-8c2e-eff45df37783"); -const LLUUID SND_WOOD_WOOD ("063c97d3-033a-4e9b-98d8-05c8074922cb"); +extern const LLUUID SND_SILENCE; +extern const LLUUID SND_BUBBLES; +extern const LLUUID SND_WELCOME; +extern const LLUUID SND_SQUISH; +extern const LLUUID SND_SUBPOD; +extern const LLUUID SND_FOOTSTEPS; +extern const LLUUID SND_STEP_LEFT; +extern const LLUUID SND_STEP_RIGHT; +extern const LLUUID SND_BALL_COLLISION; -const LLUUID SND_SLIDE_FLESH_FLESH ("614eec22-f73d-4fdc-8691-a37dc5c58333"); -const LLUUID SND_SLIDE_FLESH_PLASTIC (SND_NULL); -const LLUUID SND_SLIDE_FLESH_RUBBER (SND_NULL); -const LLUUID SND_SLIDE_FLESH_FABRIC ("3678b9b9-2a0c-42b5-9c83-80b64ad6e898"); -const LLUUID SND_SLIDE_FLESH_GRAVEL ("02eaa42a-ce1a-4b6b-9c38-cd7ad0e8f4a6"); -const LLUUID SND_SLIDE_FLESH_GRAVEL_02 ("e7d3b501-79f8-4419-b842-ab6843e0f840"); -const LLUUID SND_SLIDE_FLESH_GRAVEL_03 ("4c3e8b52-6244-4e44-85a6-f4ab994418ed"); -const LLUUID SND_SLIDE_GLASS_GRAVEL ("ca491e77-5c47-4ea1-8021-b3ebbf636cab"); -const LLUUID SND_SLIDE_GLASS_GRAVEL_02 ("30794d49-91ce-48e3-a527-c06f67bd6cbe"); -const LLUUID SND_SLIDE_GLASS_GRAVEL_03 ("04c78e54-fd8d-46b6-8ab9-7678b5d6e5cb"); -const LLUUID SND_SLIDE_GLASS_FLESH (SND_NULL); -const LLUUID SND_SLIDE_GLASS_GLASS (SND_NULL); -const LLUUID SND_SLIDE_GLASS_PLASTIC (SND_NULL); -const LLUUID SND_SLIDE_GLASS_RUBBER (SND_NULL); -const LLUUID SND_SLIDE_GLASS_WOOD (SND_NULL); -const LLUUID SND_SLIDE_METAL_FABRIC ("18b66e81-2958-42d4-a373-7a5054919adc"); -const LLUUID SND_SLIDE_METAL_FLESH ("dde65837-633c-4841-af2f-62ec471bf61e"); -const LLUUID SND_SLIDE_METAL_FLESH_02 ("f3cc2cbe-1a1a-4db7-a8d2-e9c8f8fa1f4f"); -const LLUUID SND_SLIDE_METAL_GLASS ("4188be39-7b1f-4495-bf2b-83ddd82eea05"); -const LLUUID SND_SLIDE_METAL_GLASS_02 ("336faa2b-9d96-4e14-93ad-b63b60074379"); -const LLUUID SND_SLIDE_METAL_GLASS_03 ("34d912aa-cf73-4462-b7d0-dcba2c66caba"); -const LLUUID SND_SLIDE_METAL_GLASS_04 ("97ffc063-e872-4469-8e95-1450ac6bad2b"); -const LLUUID SND_SLIDE_METAL_GRAVEL ("2bbff37d-009a-4cfc-9a0d-817652c08fbe"); -const LLUUID SND_SLIDE_METAL_GRAVEL_02 ("a906a228-783b-49e7-9f0a-e20a41d0e39f"); -const LLUUID SND_SLIDE_METAL_METAL ("09461277-c691-45de-b2c5-89dfd3712f79"); -const LLUUID SND_SLIDE_METAL_METAL_02 ("e00a5d97-8fdc-46c1-bd53-7e312727466c"); -const LLUUID SND_SLIDE_METAL_METAL_03 ("8ebfa780-c440-4b52-ab65-5edf3bc15bf1"); -const LLUUID SND_SLIDE_METAL_METAL_04 ("d6d03cb2-5b16-4e31-b7d4-2a81d2a0909b"); -const LLUUID SND_SLIDE_METAL_METAL_05 ("3a46f447-916e-47de-a1e5-95d1af46bd0f"); -const LLUUID SND_SLIDE_METAL_METAL_06 ("cd423231-e70d-4fd2-ad26-f1c6cf5f0610"); -const LLUUID SND_SLIDE_METAL_PLASTIC (SND_NULL); -const LLUUID SND_SLIDE_METAL_RUBBER ("12d97bc0-3c15-4744-b6bd-77d1316eb4f0"); -const LLUUID SND_SLIDE_METAL_WOOD ("4afb6926-a73f-4cb7-85d5-0f9a40107434"); -const LLUUID SND_SLIDE_METAL_WOOD_02 ("349970bf-187d-4bcb-b2cf-e7bb6581590f"); -const LLUUID SND_SLIDE_METAL_WOOD_03 ("64bf6e87-73d4-4cb4-84f7-55cecfd97cd3"); -const LLUUID SND_SLIDE_METAL_WOOD_04 ("0dc670a9-dbe8-41bc-b8ee-4d96d99219d5"); -const LLUUID SND_SLIDE_METAL_WOOD_05 ("6e3cc57b-c9aa-4829-86a1-8e82aeaccb47"); -const LLUUID SND_SLIDE_METAL_WOOD_06 ("c1237f4c-8c88-4da1-bfbc-2af26a8d9e5a"); -const LLUUID SND_SLIDE_METAL_WOOD_07 ("0e1ec243-063b-4dcb-a903-52b8dffed3d2"); -const LLUUID SND_SLIDE_METAL_WOOD_08 ("66736d0f-533d-4007-a8ee-0f27c2034126"); -const LLUUID SND_SLIDE_PLASTIC_GRAVEL ("35092c21-5c48-4b4d-a818-3cf240af2348"); -const LLUUID SND_SLIDE_PLASTIC_GRAVEL_02("c37f5776-0020-47e8-89a0-c74cc6f5742d"); -const LLUUID SND_SLIDE_PLASTIC_GRAVEL_03("d2fc8db6-2e66-464a-8ccb-f99b61ee4987"); -const LLUUID SND_SLIDE_PLASTIC_GRAVEL_04("93cbdb10-6e82-4c0b-a547-7b3b79ac25f6"); -const LLUUID SND_SLIDE_PLASTIC_GRAVEL_05("2f6d0542-fcd1-4264-a17b-f57bf5ebf402"); -const LLUUID SND_SLIDE_PLASTIC_GRAVEL_06("5b8887d4-3be2-45a0-b25d-85af3b1e6392"); -const LLUUID SND_SLIDE_PLASTIC_PLASTIC (SND_NULL); -const LLUUID SND_SLIDE_PLASTIC_PLASTIC_02 (SND_NULL); -const LLUUID SND_SLIDE_PLASTIC_PLASTIC_03 (SND_NULL); -const LLUUID SND_SLIDE_PLASTIC_FABRIC ("7294d9ad-3e41-4373-992c-a9f21d5d66ad"); -const LLUUID SND_SLIDE_PLASTIC_FABRIC_02("58608ce1-f524-472f-b447-bbe6ce4a46e0"); -const LLUUID SND_SLIDE_PLASTIC_FABRIC_03("06ae285e-0b34-4ea6-84ab-9c6c31b414fc"); -const LLUUID SND_SLIDE_PLASTIC_FABRIC_04("211613db-0461-49bd-9554-5c14ad8b31f6"); -const LLUUID SND_SLIDE_RUBBER_PLASTIC ("a98ffa5a-e48e-4f9d-9242-b9a3210ad84a"); -const LLUUID SND_SLIDE_RUBBER_PLASTIC_02 ("d4136c40-eeaa-49c6-a982-8e5a16f5d93a"); -const LLUUID SND_SLIDE_RUBBER_PLASTIC_03 ("29ec0fb2-0b23-47b2-835b-c83cc7cf9fb0"); -const LLUUID SND_SLIDE_RUBBER_RUBBER (SND_NULL); -const LLUUID SND_SLIDE_STONE_FLESH (SND_NULL); -const LLUUID SND_SLIDE_STONE_GLASS (SND_NULL); -const LLUUID SND_SLIDE_STONE_METAL (SND_NULL); -const LLUUID SND_SLIDE_STONE_PLASTIC ("afd0bcc3-d41a-4572-9e7f-08a29eeb0b8a"); -const LLUUID SND_SLIDE_STONE_PLASTIC_02 ("881b720a-96cf-4128-bb98-5d87e03e93c7"); -const LLUUID SND_SLIDE_STONE_PLASTIC_03 ("293dac42-658a-4c5a-a7a2-6d4c5e5658b0"); -const LLUUID SND_SLIDE_STONE_RUBBER ("0724b946-6a3f-4eeb-bb50-0a3b33120974"); -const LLUUID SND_SLIDE_STONE_RUBBER_02 ("ada93d00-76e2-4bf1-9ad9-493727630717"); -const LLUUID SND_SLIDE_STONE_STONE ("ade766dc-2e75-4699-9b41-7c8e53d2b3f2"); -const LLUUID SND_SLIDE_STONE_STONE_02 ("66698375-6594-47b0-8046-c3973de1291d"); -const LLUUID SND_SLIDE_STONE_WOOD ("174ef324-ed50-4f65-9479-b4da580aeb3c"); -const LLUUID SND_SLIDE_STONE_WOOD_02 ("33d517fd-ff11-4d01-a7b5-0e3abf818dcf"); -const LLUUID SND_SLIDE_STONE_WOOD_03 ("1bac4b63-e6fd-4659-9761-991284cf4582"); -const LLUUID SND_SLIDE_STONE_WOOD_04 ("a7d28564-6821-4c01-a378-cde98fba7ba9"); -const LLUUID SND_SLIDE_WOOD_FABRIC ("22c58e74-22cd-4960-9ab7-5bf08ab824e5"); -const LLUUID SND_SLIDE_WOOD_FABRIC_02 ("0b0ed22e-4a0f-4617-a4cf-20d0f2b78ccc"); -const LLUUID SND_SLIDE_WOOD_FABRIC_03 ("42b80abb-9823-4b74-a210-326ccf23636a"); -const LLUUID SND_SLIDE_WOOD_FABRIC_04 ("8538298a-1e6b-4b69-a9ee-5e01e4a02b35"); -const LLUUID SND_SLIDE_WOOD_FLESH ("84b026f3-a11c-4366-aa7c-07edcd89b2bb"); -const LLUUID SND_SLIDE_WOOD_FLESH_02 ("2644191f-4848-47ba-8ba7-bddc0bfcb3da"); -const LLUUID SND_SLIDE_WOOD_FLESH_03 ("edb978e4-9be9-456f-b2fc-e8502bfe25be"); -const LLUUID SND_SLIDE_WOOD_FLESH_04 ("bf2b972e-f42a-46d7-b53e-5fca38f5bc61"); -const LLUUID SND_SLIDE_WOOD_GRAVEL ("d063bb4d-0eff-4403-a6cc-c6c6c073e624"); -const LLUUID SND_SLIDE_WOOD_GRAVEL_02 ("511eb679-6d93-47fa-9141-c3ef9261c919"); -const LLUUID SND_SLIDE_WOOD_GRAVEL_03 ("4ed1fd43-4707-4e5c-b7b7-21ec4e72c1ac"); -const LLUUID SND_SLIDE_WOOD_GRAVEL_04 ("99ea89b3-aa76-4b87-99c8-670365c6d8c3"); -const LLUUID SND_SLIDE_WOOD_PLASTIC ("505ca3c4-94a0-4e28-8fc1-ea72a428396b"); -const LLUUID SND_SLIDE_WOOD_PLASTIC_02 ("fc404011-df71-4ed0-8f22-b72bdd18f63c"); -const LLUUID SND_SLIDE_WOOD_PLASTIC_03 ("67dbe225-26df-4efa-8c8b-f1ef669fec45"); -const LLUUID SND_SLIDE_WOOD_RUBBER (SND_NULL); -const LLUUID SND_SLIDE_WOOD_WOOD ("3079d569-b3e8-4df4-9e09-f0d4611213ef"); -const LLUUID SND_SLIDE_WOOD_WOOD_02 ("276b093d-dbcb-4279-a89e-a54b0b416af6"); -const LLUUID SND_SLIDE_WOOD_WOOD_03 ("c3f3ca5e-2768-4081-847f-247139310fdb"); -const LLUUID SND_SLIDE_WOOD_WOOD_04 ("f08d44b8-ff87-4a98-9561-c72f1f2fec81"); -const LLUUID SND_SLIDE_WOOD_WOOD_05 ("2d8a58cf-f139-4238-8503-27d334d05c85"); -const LLUUID SND_SLIDE_WOOD_WOOD_06 ("e157ebbd-b12d-4225-aa7c-d47b026a7687"); -const LLUUID SND_SLIDE_WOOD_WOOD_07 ("35e17956-e7b4-478c-b274-e37db8a166b2"); -const LLUUID SND_SLIDE_WOOD_WOOD_08 ("e606fc65-0643-4964-9979-ff964fa6a62c"); +extern const LLUUID SND_OOOH_SCARE_ME; +extern const LLUUID SND_PAYBACK_TIME; +extern const LLUUID SND_READY_FOR_BATTLE; +extern const LLUUID SND_FLESH_FLESH; +extern const LLUUID SND_FLESH_PLASTIC; +extern const LLUUID SND_FLESH_RUBBER; +extern const LLUUID SND_GLASS_FLESH; +extern const LLUUID SND_GLASS_GLASS; +extern const LLUUID SND_GLASS_PLASTIC; +extern const LLUUID SND_GLASS_RUBBER; +extern const LLUUID SND_GLASS_WOOD; +extern const LLUUID SND_METAL_FLESH; +extern const LLUUID SND_METAL_GLASS; +extern const LLUUID SND_METAL_METAL; +extern const LLUUID SND_METAL_PLASTIC; +extern const LLUUID SND_METAL_RUBBER; +extern const LLUUID SND_METAL_WOOD; +extern const LLUUID SND_PLASTIC_PLASTIC; +extern const LLUUID SND_RUBBER_PLASTIC; +extern const LLUUID SND_RUBBER_RUBBER; +extern const LLUUID SND_STONE_FLESH; +extern const LLUUID SND_STONE_GLASS; +extern const LLUUID SND_STONE_METAL; +extern const LLUUID SND_STONE_PLASTIC; +extern const LLUUID SND_STONE_RUBBER; +extern const LLUUID SND_STONE_STONE; +extern const LLUUID SND_STONE_WOOD; +extern const LLUUID SND_WOOD_FLESH; +extern const LLUUID SND_WOOD_PLASTIC; +extern const LLUUID SND_WOOD_RUBBER; +extern const LLUUID SND_WOOD_WOOD; -const LLUUID SND_ROLL_FLESH_FLESH (SND_NULL); -const LLUUID SND_ROLL_FLESH_PLASTIC ("89a0be4c-848d-4a6e-8886-298f56c2cff4"); -const LLUUID SND_ROLL_FLESH_PLASTIC_02 ("beb06343-1aa1-4af2-b320-5d2ec31c53b1"); -const LLUUID SND_ROLL_FLESH_RUBBER (SND_NULL); -const LLUUID SND_ROLL_GLASS_GRAVEL ("ba795c74-7e09-4572-b495-e09886a46b86"); -const LLUUID SND_ROLL_GLASS_GRAVEL_02 ("4c93c3b7-14cb-4d9b-a7df-628ad935f1f2"); -const LLUUID SND_ROLL_GLASS_FLESH (SND_NULL); -const LLUUID SND_ROLL_GLASS_GLASS (SND_NULL); -const LLUUID SND_ROLL_GLASS_PLASTIC (SND_NULL); -const LLUUID SND_ROLL_GLASS_RUBBER (SND_NULL); -const LLUUID SND_ROLL_GLASS_WOOD ("d40b1f48-a061-4f6e-b18f-4326a3dd5c29"); -const LLUUID SND_ROLL_GLASS_WOOD_02 ("78cd407a-bb36-4163-ba09-20f2e6d9d44b"); -const LLUUID SND_ROLL_GRAVEL_GRAVEL ("c7354cc3-6df5-4738-8dbb-b28a6ac46a05"); -const LLUUID SND_ROLL_GRAVEL_GRAVEL_02 ("01d194c4-72a6-47df-81a5-8db430faff87"); -const LLUUID SND_ROLL_METAL_FABRIC ("ce6e6564-20fd-48e4-81e2-cd3f81c00a3e"); -const LLUUID SND_ROLL_METAL_FABRIC_02 ("fc4d0065-32f6-4bb0-9f3f-f4737eb27163"); -const LLUUID SND_ROLL_METAL_FLESH (SND_NULL); -const LLUUID SND_ROLL_METAL_GLASS ("63d530bb-a41f-402b-aa1f-be6b11959809"); -const LLUUID SND_ROLL_METAL_GLASS_02 ("f62642c2-6db5-4faa-8b77-939067d837c3"); -const LLUUID SND_ROLL_METAL_GLASS_03 ("db5b5a15-2817-4cd7-9f0b-9ad49b5e52c8"); -const LLUUID SND_ROLL_METAL_GRAVEL ("447164e3-9646-4c1a-a16d-606892891466"); -const LLUUID SND_ROLL_METAL_METAL ("c3c22cf3-5d1f-4cc3-b4b5-708b9f65979c"); -const LLUUID SND_ROLL_METAL_METAL_02 ("d8386277-a1ea-460e-b6fd-bb285c323bf1"); -const LLUUID SND_ROLL_METAL_METAL_03 ("69ee1f02-f9cd-4c8b-aedd-39a2d6705680"); -const LLUUID SND_ROLL_METAL_METAL_04 ("5cc6b5fd-26ce-47ad-b21d-3a7c190dd375"); -const LLUUID SND_ROLL_METAL_PLASTIC ("c6a9bbf6-df15-4713-9f84-7237fce4051e"); -const LLUUID SND_ROLL_METAL_PLASTIC_01 ("0fedb59b-2dbb-4cec-b6cc-8559ec027749"); -const LLUUID SND_ROLL_METAL_RUBBER (SND_NULL); -const LLUUID SND_ROLL_METAL_WOOD ("1d76af57-01b1-4c73-9a1d-69523bfa50ea"); -const LLUUID SND_ROLL_METAL_WOOD_02 ("78aa4e71-8e7c-4b90-a561-3ebdc639f99b"); -const LLUUID SND_ROLL_METAL_WOOD_03 ("777d95bf-962f-48fa-93bf-8c1806557d72"); -const LLUUID SND_ROLL_METAL_WOOD_04 ("1833da76-45e2-4a8b-97da-d17413e056c9"); -const LLUUID SND_ROLL_METAL_WOOD_05 ("b13e1232-3d8d-42e9-92ec-b30f9f823962"); -const LLUUID SND_ROLL_PLASTIC_FABRIC ("616a1f03-209f-4c55-b264-83a000b6ef0a"); -const LLUUID SND_ROLL_PLASTIC_PLASTIC ("873f3d82-00b2-4082-9c69-7aef3461dba1"); -const LLUUID SND_ROLL_PLASTIC_PLASTIC_02 ("cc39879f-ebc8-4405-a4fc-8342f5bed31e"); -const LLUUID SND_ROLL_RUBBER_PLASTIC (SND_NULL); -const LLUUID SND_ROLL_RUBBER_RUBBER (SND_NULL); -const LLUUID SND_ROLL_STONE_FLESH (SND_NULL); -const LLUUID SND_ROLL_STONE_GLASS (SND_NULL); -const LLUUID SND_ROLL_STONE_METAL (SND_NULL); -const LLUUID SND_ROLL_STONE_PLASTIC ("155f65a8-cae7-476e-a58b-fd362be7fd0e"); -const LLUUID SND_ROLL_STONE_RUBBER (SND_NULL); -const LLUUID SND_ROLL_STONE_STONE ("67d56e3f-6ed5-4658-9418-14f020c38b11"); -const LLUUID SND_ROLL_STONE_STONE_02 ("43d99d10-d75b-4246-accf-4ceb2c909aa7"); -const LLUUID SND_ROLL_STONE_STONE_03 ("f04e83ff-eed7-4e99-8f45-eb97e4e1d3b7"); -const LLUUID SND_ROLL_STONE_STONE_04 ("10fcc5ad-fa89-48d6-b774-986b580c1efc"); -const LLUUID SND_ROLL_STONE_STONE_05 ("3d86f5a3-1a91-49d9-b99f-8521a7422497"); -const LLUUID SND_ROLL_STONE_WOOD ("53e46fb7-6c21-4fe1-bffe-0567475d48fa"); -const LLUUID SND_ROLL_STONE_WOOD_02 ("5eba8c9a-a014-4299-87f1-315c45ec795b"); -const LLUUID SND_ROLL_STONE_WOOD_03 ("ea6c05fc-6e9c-4526-8a20-bc47810bb549"); -const LLUUID SND_ROLL_STONE_WOOD_04 ("64618cbf-3f42-4728-8094-e77807545efb"); -const LLUUID SND_ROLL_WOOD_FLESH ("26ee185d-6fc3-49f8-89ba-51cab04cfc42"); -const LLUUID SND_ROLL_WOOD_FLESH_02 ("334faa25-1e80-4c99-b29f-4c9c2a3d079d"); -const LLUUID SND_ROLL_WOOD_FLESH_03 ("2f876626-4dce-4f71-a91e-a25302edfab7"); -const LLUUID SND_ROLL_WOOD_FLESH_04 ("d6877aac-07fc-4931-bcde-585f223802ad"); -const LLUUID SND_ROLL_WOOD_GRAVEL ("2a23ebb5-a4a2-4f1f-8d75-7384239354aa"); -const LLUUID SND_ROLL_WOOD_GRAVEL_02 ("208bf26d-f097-450c-95c4-9d26317c613c"); -const LLUUID SND_ROLL_WOOD_GRAVEL_03 ("a26ecaf4-92c6-4e32-9864-56b7c70cab8e"); -const LLUUID SND_ROLL_WOOD_PLASTIC ("71c1000a-9f16-4cc3-8ede-ec4aa3bf5723"); -const LLUUID SND_ROLL_WOOD_PLASTIC_02 ("7bc20ba6-1e6d-4eea-83ad-c5cc3ae0e409"); -const LLUUID SND_ROLL_WOOD_RUBBER (SND_NULL); -const LLUUID SND_ROLL_WOOD_WOOD ("2cc8eec4-bb4a-4ba8-b783-71526ec708e8"); -const LLUUID SND_ROLL_WOOD_WOOD_02 ("0a1f8070-a11a-4b4c-b260-5ffb6acb0a5d"); -const LLUUID SND_ROLL_WOOD_WOOD_03 ("160bef64-da9c-4be8-b07b-a5060b501700"); -const LLUUID SND_ROLL_WOOD_WOOD_04 ("1c62ea16-cc60-48ed-829a-68b8f4cf0c1c"); -const LLUUID SND_ROLL_WOOD_WOOD_05 ("be9cc8fe-b920-4bf5-8924-453088cbc03f"); -const LLUUID SND_ROLL_WOOD_WOOD_06 ("a76cfe60-56b0-43b1-8f31-93e56947d78b"); -const LLUUID SND_ROLL_WOOD_WOOD_07 ("0c6aa481-b5bc-4573-ae83-8e16ff27e750"); -const LLUUID SND_ROLL_WOOD_WOOD_08 ("214ab2c7-871a-451b-b0db-4c5677199011"); -const LLUUID SND_ROLL_WOOD_WOOD_09 ("0086e4db-3ac6-4545-b414-6f359bedd9a5"); -const LLUUID SND_SLIDE_STONE_STONE_01 ("2a7dcbd1-d3e6-4767-8432-8322648e7b9d"); +extern const LLUUID SND_SLIDE_FLESH_FLESH; +extern const LLUUID SND_SLIDE_FLESH_PLASTIC; +extern const LLUUID SND_SLIDE_FLESH_RUBBER; +extern const LLUUID SND_SLIDE_FLESH_FABRIC; +extern const LLUUID SND_SLIDE_FLESH_GRAVEL; +extern const LLUUID SND_SLIDE_FLESH_GRAVEL_02; +extern const LLUUID SND_SLIDE_FLESH_GRAVEL_03; +extern const LLUUID SND_SLIDE_GLASS_GRAVEL; +extern const LLUUID SND_SLIDE_GLASS_GRAVEL_02; +extern const LLUUID SND_SLIDE_GLASS_GRAVEL_03; +extern const LLUUID SND_SLIDE_GLASS_FLESH; +extern const LLUUID SND_SLIDE_GLASS_GLASS; +extern const LLUUID SND_SLIDE_GLASS_PLASTIC; +extern const LLUUID SND_SLIDE_GLASS_RUBBER; +extern const LLUUID SND_SLIDE_GLASS_WOOD; +extern const LLUUID SND_SLIDE_METAL_FABRIC; +extern const LLUUID SND_SLIDE_METAL_FLESH; +extern const LLUUID SND_SLIDE_METAL_FLESH_02; +extern const LLUUID SND_SLIDE_METAL_GLASS; +extern const LLUUID SND_SLIDE_METAL_GLASS_02; +extern const LLUUID SND_SLIDE_METAL_GLASS_03; +extern const LLUUID SND_SLIDE_METAL_GLASS_04; +extern const LLUUID SND_SLIDE_METAL_GRAVEL; +extern const LLUUID SND_SLIDE_METAL_GRAVEL_02; +extern const LLUUID SND_SLIDE_METAL_METAL; +extern const LLUUID SND_SLIDE_METAL_METAL_02; +extern const LLUUID SND_SLIDE_METAL_METAL_03; +extern const LLUUID SND_SLIDE_METAL_METAL_04; +extern const LLUUID SND_SLIDE_METAL_METAL_05; +extern const LLUUID SND_SLIDE_METAL_METAL_06; +extern const LLUUID SND_SLIDE_METAL_PLASTIC; +extern const LLUUID SND_SLIDE_METAL_RUBBER; +extern const LLUUID SND_SLIDE_METAL_WOOD; +extern const LLUUID SND_SLIDE_METAL_WOOD_02; +extern const LLUUID SND_SLIDE_METAL_WOOD_03; +extern const LLUUID SND_SLIDE_METAL_WOOD_04; +extern const LLUUID SND_SLIDE_METAL_WOOD_05; +extern const LLUUID SND_SLIDE_METAL_WOOD_06; +extern const LLUUID SND_SLIDE_METAL_WOOD_07; +extern const LLUUID SND_SLIDE_METAL_WOOD_08; +extern const LLUUID SND_SLIDE_PLASTIC_GRAVEL; +extern const LLUUID SND_SLIDE_PLASTIC_GRAVEL_02; +extern const LLUUID SND_SLIDE_PLASTIC_GRAVEL_03; +extern const LLUUID SND_SLIDE_PLASTIC_GRAVEL_04; +extern const LLUUID SND_SLIDE_PLASTIC_GRAVEL_05; +extern const LLUUID SND_SLIDE_PLASTIC_GRAVEL_06; +extern const LLUUID SND_SLIDE_PLASTIC_PLASTIC; +extern const LLUUID SND_SLIDE_PLASTIC_PLASTIC_02; +extern const LLUUID SND_SLIDE_PLASTIC_PLASTIC_03; +extern const LLUUID SND_SLIDE_PLASTIC_FABRIC; +extern const LLUUID SND_SLIDE_PLASTIC_FABRIC_02; +extern const LLUUID SND_SLIDE_PLASTIC_FABRIC_03; +extern const LLUUID SND_SLIDE_PLASTIC_FABRIC_04; +extern const LLUUID SND_SLIDE_RUBBER_PLASTIC; +extern const LLUUID SND_SLIDE_RUBBER_PLASTIC_02; +extern const LLUUID SND_SLIDE_RUBBER_PLASTIC_03; +extern const LLUUID SND_SLIDE_RUBBER_RUBBER; +extern const LLUUID SND_SLIDE_STONE_FLESH; +extern const LLUUID SND_SLIDE_STONE_GLASS; +extern const LLUUID SND_SLIDE_STONE_METAL; +extern const LLUUID SND_SLIDE_STONE_PLASTIC; +extern const LLUUID SND_SLIDE_STONE_PLASTIC_02; +extern const LLUUID SND_SLIDE_STONE_PLASTIC_03; +extern const LLUUID SND_SLIDE_STONE_RUBBER; +extern const LLUUID SND_SLIDE_STONE_RUBBER_02; +extern const LLUUID SND_SLIDE_STONE_STONE; +extern const LLUUID SND_SLIDE_STONE_STONE_02; +extern const LLUUID SND_SLIDE_STONE_WOOD; +extern const LLUUID SND_SLIDE_STONE_WOOD_02; +extern const LLUUID SND_SLIDE_STONE_WOOD_03; +extern const LLUUID SND_SLIDE_STONE_WOOD_04; +extern const LLUUID SND_SLIDE_WOOD_FABRIC; +extern const LLUUID SND_SLIDE_WOOD_FABRIC_02; +extern const LLUUID SND_SLIDE_WOOD_FABRIC_03; +extern const LLUUID SND_SLIDE_WOOD_FABRIC_04; +extern const LLUUID SND_SLIDE_WOOD_FLESH; +extern const LLUUID SND_SLIDE_WOOD_FLESH_02; +extern const LLUUID SND_SLIDE_WOOD_FLESH_03; +extern const LLUUID SND_SLIDE_WOOD_FLESH_04; +extern const LLUUID SND_SLIDE_WOOD_GRAVEL; +extern const LLUUID SND_SLIDE_WOOD_GRAVEL_02; +extern const LLUUID SND_SLIDE_WOOD_GRAVEL_03; +extern const LLUUID SND_SLIDE_WOOD_GRAVEL_04; +extern const LLUUID SND_SLIDE_WOOD_PLASTIC; +extern const LLUUID SND_SLIDE_WOOD_PLASTIC_02; +extern const LLUUID SND_SLIDE_WOOD_PLASTIC_03; +extern const LLUUID SND_SLIDE_WOOD_RUBBER; +extern const LLUUID SND_SLIDE_WOOD_WOOD; +extern const LLUUID SND_SLIDE_WOOD_WOOD_02; +extern const LLUUID SND_SLIDE_WOOD_WOOD_03; +extern const LLUUID SND_SLIDE_WOOD_WOOD_04; +extern const LLUUID SND_SLIDE_WOOD_WOOD_05; +extern const LLUUID SND_SLIDE_WOOD_WOOD_06; +extern const LLUUID SND_SLIDE_WOOD_WOOD_07; +extern const LLUUID SND_SLIDE_WOOD_WOOD_08; -const LLUUID SND_STONE_DIRT_01 ("97727335-392c-4338-ac4b-23a7883279c2"); -const LLUUID SND_STONE_DIRT_02 ("cbe75eb2-3375-41d8-9e3f-2ae46b4164ed"); -const LLUUID SND_STONE_DIRT_03 ("31e236ee-001b-4c8e-ad6c-c2074cb64357"); -const LLUUID SND_STONE_DIRT_04 ("c8091652-e04b-4a11-84ba-15dba06e7a1b"); -const LLUUID SND_STONE_STONE_02 ("ba4ef5ac-7435-4240-b826-c24ba8fa5a78"); -const LLUUID SND_STONE_STONE_04 ("ea296329-0f09-4993-af1b-e6784bab1dc9"); +extern const LLUUID SND_ROLL_FLESH_FLESH; +extern const LLUUID SND_ROLL_FLESH_PLASTIC; +extern const LLUUID SND_ROLL_FLESH_PLASTIC_02; +extern const LLUUID SND_ROLL_FLESH_RUBBER; +extern const LLUUID SND_ROLL_GLASS_GRAVEL; +extern const LLUUID SND_ROLL_GLASS_GRAVEL_02; +extern const LLUUID SND_ROLL_GLASS_FLESH; +extern const LLUUID SND_ROLL_GLASS_GLASS; +extern const LLUUID SND_ROLL_GLASS_PLASTIC; +extern const LLUUID SND_ROLL_GLASS_RUBBER; +extern const LLUUID SND_ROLL_GLASS_WOOD; +extern const LLUUID SND_ROLL_GLASS_WOOD_02; +extern const LLUUID SND_ROLL_GRAVEL_GRAVEL; +extern const LLUUID SND_ROLL_GRAVEL_GRAVEL_02; +extern const LLUUID SND_ROLL_METAL_FABRIC; +extern const LLUUID SND_ROLL_METAL_FABRIC_02; +extern const LLUUID SND_ROLL_METAL_FLESH; +extern const LLUUID SND_ROLL_METAL_GLASS; +extern const LLUUID SND_ROLL_METAL_GLASS_02; +extern const LLUUID SND_ROLL_METAL_GLASS_03; +extern const LLUUID SND_ROLL_METAL_GRAVEL; +extern const LLUUID SND_ROLL_METAL_METAL; +extern const LLUUID SND_ROLL_METAL_METAL_02; +extern const LLUUID SND_ROLL_METAL_METAL_03; +extern const LLUUID SND_ROLL_METAL_METAL_04; +extern const LLUUID SND_ROLL_METAL_PLASTIC; +extern const LLUUID SND_ROLL_METAL_PLASTIC_01; +extern const LLUUID SND_ROLL_METAL_RUBBER; +extern const LLUUID SND_ROLL_METAL_WOOD; +extern const LLUUID SND_ROLL_METAL_WOOD_02; +extern const LLUUID SND_ROLL_METAL_WOOD_03; +extern const LLUUID SND_ROLL_METAL_WOOD_04; +extern const LLUUID SND_ROLL_METAL_WOOD_05; +extern const LLUUID SND_ROLL_PLASTIC_FABRIC; +extern const LLUUID SND_ROLL_PLASTIC_PLASTIC; +extern const LLUUID SND_ROLL_PLASTIC_PLASTIC_02; +extern const LLUUID SND_ROLL_RUBBER_PLASTIC; +extern const LLUUID SND_ROLL_RUBBER_RUBBER; +extern const LLUUID SND_ROLL_STONE_FLESH; +extern const LLUUID SND_ROLL_STONE_GLASS; +extern const LLUUID SND_ROLL_STONE_METAL; +extern const LLUUID SND_ROLL_STONE_PLASTIC; +extern const LLUUID SND_ROLL_STONE_RUBBER; +extern const LLUUID SND_ROLL_STONE_STONE; +extern const LLUUID SND_ROLL_STONE_STONE_02; +extern const LLUUID SND_ROLL_STONE_STONE_03; +extern const LLUUID SND_ROLL_STONE_STONE_04; +extern const LLUUID SND_ROLL_STONE_STONE_05; +extern const LLUUID SND_ROLL_STONE_WOOD; +extern const LLUUID SND_ROLL_STONE_WOOD_02; +extern const LLUUID SND_ROLL_STONE_WOOD_03; +extern const LLUUID SND_ROLL_STONE_WOOD_04; +extern const LLUUID SND_ROLL_WOOD_FLESH; +extern const LLUUID SND_ROLL_WOOD_FLESH_02; +extern const LLUUID SND_ROLL_WOOD_FLESH_03; +extern const LLUUID SND_ROLL_WOOD_FLESH_04; +extern const LLUUID SND_ROLL_WOOD_GRAVEL; +extern const LLUUID SND_ROLL_WOOD_GRAVEL_02; +extern const LLUUID SND_ROLL_WOOD_GRAVEL_03; +extern const LLUUID SND_ROLL_WOOD_PLASTIC; +extern const LLUUID SND_ROLL_WOOD_PLASTIC_02; +extern const LLUUID SND_ROLL_WOOD_RUBBER; +extern const LLUUID SND_ROLL_WOOD_WOOD; +extern const LLUUID SND_ROLL_WOOD_WOOD_02; +extern const LLUUID SND_ROLL_WOOD_WOOD_03; +extern const LLUUID SND_ROLL_WOOD_WOOD_04; +extern const LLUUID SND_ROLL_WOOD_WOOD_05; +extern const LLUUID SND_ROLL_WOOD_WOOD_06; +extern const LLUUID SND_ROLL_WOOD_WOOD_07; +extern const LLUUID SND_ROLL_WOOD_WOOD_08; +extern const LLUUID SND_ROLL_WOOD_WOOD_09; +extern const LLUUID SND_SLIDE_STONE_STONE_01; +extern const LLUUID SND_STONE_DIRT_01; +extern const LLUUID SND_STONE_DIRT_02; +extern const LLUUID SND_STONE_DIRT_03; +extern const LLUUID SND_STONE_DIRT_04; -// extra guids -#if 0 -const LLUUID SND_ ("a839b8ac-b0af-4ba9-9fde-188754744e02"); -const LLUUID SND_ ("20165fa8-836f-4993-85dc-1529172dcd14"); -const LLUUID SND_ ("fba8e17b-a4b3-4693-9fce-c14800f8a349"); -const LLUUID SND_ ("2d48db8b-7260-4b02-ad2a-b2c6bee60e94"); -const LLUUID SND_ ("956d344b-1808-4d8b-88b1-cbc82b7a96a1"); -const LLUUID SND_ ("b8303cc6-f0b4-4c6f-a199-81f87aba342e"); -const LLUUID SND_ ("fbf7cd0c-bc8f-4cba-9c19-11f4dd03a06b"); -const LLUUID SND_ ("85047f7d-933a-4ce5-a7b5-34670243e1ab"); -const LLUUID SND_ ("0f81acf7-6a2e-4490-957f-c7b0eda00559"); -const LLUUID SND_ ("5631a6a1-79b4-4de8-bccf-1880b6882da1"); -const LLUUID SND_ ("43c87a6b-ffb2-437b-89a0-9deba890a4fc"); -const LLUUID SND_ ("58878d1d-3156-4d01-ac3c-0c4fb99f4d53"); -const LLUUID SND_ ("9a83f321-44bf-40f6-b006-46c085515345"); -const LLUUID SND_ ("ff144533-33ab-40f2-bac8-39c34699ecc4"); -const LLUUID SND_ ("09018e87-d52c-4cd5-9805-015f413319e7"); -const LLUUID SND_ ("17d4c057-7edd-401e-9589-d5b9fe981bf2"); -#endif +extern const LLUUID SND_STONE_STONE_02; +extern const LLUUID SND_STONE_STONE_04; #endif diff --git a/indra/llmessage/tests/llsdmessage_test.cpp b/indra/llmessage/tests/llsdmessage_test.cpp index 9b018d685b..de2c7e00c8 100644 --- a/indra/llmessage/tests/llsdmessage_test.cpp +++ b/indra/llmessage/tests/llsdmessage_test.cpp @@ -21,6 +21,7 @@ #include <iostream> // std headers #include <stdexcept> +#include <typeinfo> // external library headers // other Linden headers #include "../test/lltut.h" @@ -63,6 +64,32 @@ namespace tut { threw = true; } + catch (const std::runtime_error& ex) + { + // This clause is because on Linux, on the viewer side, for this + // one test program (though not others!), the + // LLEventPump::DupPumpName exception isn't caught by the clause + // above. Warn the user... + std::cerr << "Failed to catch " << typeid(ex).name() << std::endl; + // But if the expected exception was thrown, allow the test to + // succeed anyway. Not sure how else to handle this odd case. + if (std::string(typeid(ex).name()) == typeid(LLEventPump::DupPumpName).name()) + { + threw = true; + } + else + { + // We don't even recognize this exception. Let it propagate + // out to TUT to fail the test. + throw; + } + } + catch (...) + { + std::cerr << "Utterly failed to catch expected exception!" << std::endl; + // This case is full of fail. We HAVE to address it. + throw; + } ensure("second LLSDMessage should throw", threw); } diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index c3d8a5aa23..70d770ef7e 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -2,6 +2,7 @@ * @file llpluginclassmedia.cpp * @brief LLPluginClassMedia handles a plugin which knows about the "media" message class. * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +28,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #include "linden_common.h" diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index dcc4a3bd6a..6b64688718 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -2,6 +2,7 @@ * @file llpluginclassmedia.h * @brief LLPluginClassMedia handles interaction with a plugin which knows about the "media" message class. * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +28,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #ifndef LL_LLPLUGINCLASSMEDIA_H diff --git a/indra/llplugin/llpluginclassmediaowner.h b/indra/llplugin/llpluginclassmediaowner.h index c798af29ca..6d369cd51a 100644 --- a/indra/llplugin/llpluginclassmediaowner.h +++ b/indra/llplugin/llpluginclassmediaowner.h @@ -2,6 +2,7 @@ * @file llpluginclassmediaowner.h * @brief LLPluginClassMedia handles interaction with a plugin which knows about the "media" message class. * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +28,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #ifndef LL_LLPLUGINCLASSMEDIAOWNER_H diff --git a/indra/llplugin/llplugininstance.cpp b/indra/llplugin/llplugininstance.cpp index 58fb792d0d..44e3b4950f 100644 --- a/indra/llplugin/llplugininstance.cpp +++ b/indra/llplugin/llplugininstance.cpp @@ -2,6 +2,7 @@ * @file llplugininstance.cpp * @brief LLPluginInstance handles loading the dynamic library of a plugin and setting up its entry points for message passing. * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +28,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #include "linden_common.h" @@ -35,13 +37,21 @@ #include "llapr.h" -//virtual +/** Virtual destructor. */ LLPluginInstanceMessageListener::~LLPluginInstanceMessageListener() { } +/** + * TODO:DOC describe how it's used + */ const char *LLPluginInstance::PLUGIN_INIT_FUNCTION_NAME = "LLPluginInitEntryPoint"; +/** + * Constructor. + * + * @param[in] owner Plugin instance. TODO:DOC is this a good description of what "owner" is? + */ LLPluginInstance::LLPluginInstance(LLPluginInstanceMessageListener *owner) : mDSOHandle(NULL), mPluginUserData(NULL), @@ -50,6 +60,9 @@ LLPluginInstance::LLPluginInstance(LLPluginInstanceMessageListener *owner) : mOwner = owner; } +/** + * Destructor. + */ LLPluginInstance::~LLPluginInstance() { if(mDSOHandle != NULL) @@ -59,6 +72,12 @@ LLPluginInstance::~LLPluginInstance() } } +/** + * Dynamically loads the plugin and runs the plugin's init function. + * + * @param[in] plugin_file Name of plugin dll/dylib/so. TODO:DOC is this correct? see .h + * @return 0 if successful, APR error code or error code from the plugin's init function on failure. + */ int LLPluginInstance::load(std::string &plugin_file) { pluginInitFunction init_function = NULL; @@ -100,6 +119,11 @@ int LLPluginInstance::load(std::string &plugin_file) return (int)result; } +/** + * Sends a message to the plugin. + * + * @param[in] message Message + */ void LLPluginInstance::sendMessage(const std::string &message) { if(mPluginSendMessageFunction) @@ -113,6 +137,10 @@ void LLPluginInstance::sendMessage(const std::string &message) } } +/** + * Idle. TODO:DOC what's the purpose of this? + * + */ void LLPluginInstance::idle(void) { } @@ -126,6 +154,11 @@ void LLPluginInstance::staticReceiveMessage(const char *message_string, void **u self->receiveMessage(message_string); } +/** + * Plugin receives message from plugin loader shell. + * + * @param[in] message_string Message + */ void LLPluginInstance::receiveMessage(const char *message_string) { if(mOwner) diff --git a/indra/llplugin/llplugininstance.h b/indra/llplugin/llplugininstance.h index ba569df10c..c11d5ab5d4 100644 --- a/indra/llplugin/llplugininstance.h +++ b/indra/llplugin/llplugininstance.h @@ -1,7 +1,7 @@ /** * @file llplugininstance.h - * @brief LLPluginInstance handles loading the dynamic library of a plugin and setting up its entry points for message passing. * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +27,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #ifndef LL_LLPLUGININSTANCE_H @@ -37,13 +38,20 @@ #include "apr_dso.h" +/** + * @brief LLPluginInstanceMessageListener receives messages sent from the plugin loader shell to the plugin. + */ class LLPluginInstanceMessageListener { public: virtual ~LLPluginInstanceMessageListener(); + /** Plugin receives message from plugin loader shell. */ virtual void receivePluginMessage(const std::string &message) = 0; }; +/** + * @brief LLPluginInstance handles loading the dynamic library of a plugin and setting up its entry points for message passing. + */ class LLPluginInstance { LOG_CLASS(LLPluginInstance); @@ -58,19 +66,27 @@ public: // Sends a message to the plugin. void sendMessage(const std::string &message); + // TODO:DOC is this comment obsolete? can't find "send_count" anywhere in indra tree. // send_count is the maximum number of message to process from the send queue. If negative, it will drain the queue completely. // The receive queue is always drained completely. // Returns the total number of messages processed from both queues. void idle(void); - // this is the signature of the "send a message" function. - // message_string is a null-terminated C string - // user_data is the opaque reference that the callee supplied during setup. + /** The signature of the function for sending a message from plugin to plugin loader shell. + * + * @param[in] message_string Null-terminated C string + * @param[in] user_data The opaque reference that the callee supplied during setup. + */ typedef void (*sendMessageFunction) (const char *message_string, void **user_data); - // signature of the plugin init function + /** The signature of the plugin init function. TODO:DOC check direction (pluging loader shell to plugin?) + * + * @param[in] host_user_data Data from plugin loader shell. + * @param[in] plugin_send_function Function for sending from the plugin loader shell to plugin. + */ typedef int (*pluginInitFunction) (sendMessageFunction host_send_func, void *host_user_data, sendMessageFunction *plugin_send_func, void **plugin_user_data); + /** Name of plugin init function */ static const char *PLUGIN_INIT_FUNCTION_NAME; private: diff --git a/indra/llplugin/llpluginmessage.cpp b/indra/llplugin/llpluginmessage.cpp index 32601b47db..f76d848a70 100644 --- a/indra/llplugin/llpluginmessage.cpp +++ b/indra/llplugin/llpluginmessage.cpp @@ -2,6 +2,7 @@ * @file llpluginmessage.cpp * @brief LLPluginMessage encapsulates the serialization/deserialization of messages passed to and from plugins. * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +28,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #include "linden_common.h" @@ -35,31 +37,57 @@ #include "llsdserialize.h" #include "u64.h" +/** + * Constructor. + */ LLPluginMessage::LLPluginMessage() { } +/** + * Constructor. + * + * @param[in] p Existing message + */ LLPluginMessage::LLPluginMessage(const LLPluginMessage &p) { mMessage = p.mMessage; } +/** + * Constructor. + * + * @param[in] message_class Message class + * @param[in] message_name Message name + */ LLPluginMessage::LLPluginMessage(const std::string &message_class, const std::string &message_name) { setMessage(message_class, message_name); } +/** + * Destructor. + */ LLPluginMessage::~LLPluginMessage() { } +/** + * Reset all internal state. + */ void LLPluginMessage::clear() { mMessage = LLSD::emptyMap(); mMessage["params"] = LLSD::emptyMap(); } +/** + * Sets the message class and name. Also has the side-effect of clearing any key-value pairs in the message. + * + * @param[in] message_class Message class + * @param[in] message_name Message name + */ void LLPluginMessage::setMessage(const std::string &message_class, const std::string &message_name) { clear(); @@ -67,21 +95,45 @@ void LLPluginMessage::setMessage(const std::string &message_class, const std::st mMessage["name"] = message_name; } +/** + * Sets a key/value pair in the message, where the value is a string. + * + * @param[in] key Key + * @param[in] value String value + */ void LLPluginMessage::setValue(const std::string &key, const std::string &value) { mMessage["params"][key] = value; } +/** + * Sets a key/value pair in the message, where the value is LLSD. + * + * @param[in] key Key + * @param[in] value LLSD value + */ void LLPluginMessage::setValueLLSD(const std::string &key, const LLSD &value) { mMessage["params"][key] = value; } +/** + * Sets a key/value pair in the message, where the value is signed 32-bit. + * + * @param[in] key Key + * @param[in] value 32-bit signed value + */ void LLPluginMessage::setValueS32(const std::string &key, S32 value) { mMessage["params"][key] = value; } +/** + * Sets a key/value pair in the message, where the value is unsigned 32-bit. The value is stored as a string beginning with "0x". + * + * @param[in] key Key + * @param[in] value 32-bit unsigned value + */ void LLPluginMessage::setValueU32(const std::string &key, U32 value) { std::stringstream temp; @@ -89,16 +141,34 @@ void LLPluginMessage::setValueU32(const std::string &key, U32 value) setValue(key, temp.str()); } +/** + * Sets a key/value pair in the message, where the value is a bool. + * + * @param[in] key Key + * @param[in] value Boolean value + */ void LLPluginMessage::setValueBoolean(const std::string &key, bool value) { mMessage["params"][key] = value; } +/** + * Sets a key/value pair in the message, where the value is a double. + * + * @param[in] key Key + * @param[in] value Boolean value + */ void LLPluginMessage::setValueReal(const std::string &key, F64 value) { mMessage["params"][key] = value; } +/** + * Sets a key/value pair in the message, where the value is a pointer. The pointer is stored as a string. + * + * @param[in] key Key + * @param[in] value Pointer value + */ void LLPluginMessage::setValuePointer(const std::string &key, void* value) { std::stringstream temp; @@ -107,16 +177,33 @@ void LLPluginMessage::setValuePointer(const std::string &key, void* value) setValue(key, temp.str()); } +/** + * Gets the message class. + * + * @return Message class + */ std::string LLPluginMessage::getClass(void) const { return mMessage["class"]; } +/** + * Gets the message name. + * + * @return Message name + */ std::string LLPluginMessage::getName(void) const { return mMessage["name"]; } +/** + * Returns true if the specified key exists in this message (useful for optional parameters). + * + * @param[in] key Key + * + * @return True if key exists, false otherwise. + */ bool LLPluginMessage::hasValue(const std::string &key) const { bool result = false; @@ -129,6 +216,13 @@ bool LLPluginMessage::hasValue(const std::string &key) const return result; } +/** + * Gets the value of a key as a string. If the key does not exist, an empty string will be returned. + * + * @param[in] key Key + * + * @return String value of key if key exists, empty string if key does not exist. + */ std::string LLPluginMessage::getValue(const std::string &key) const { std::string result; @@ -141,6 +235,13 @@ std::string LLPluginMessage::getValue(const std::string &key) const return result; } +/** + * Gets the value of a key as LLSD. If the key does not exist, a null LLSD will be returned. + * + * @param[in] key Key + * + * @return LLSD value of key if key exists, null LLSD if key does not exist. + */ LLSD LLPluginMessage::getValueLLSD(const std::string &key) const { LLSD result; @@ -153,6 +254,13 @@ LLSD LLPluginMessage::getValueLLSD(const std::string &key) const return result; } +/** + * Gets the value of a key as signed 32-bit int. If the key does not exist, 0 will be returned. + * + * @param[in] key Key + * + * @return Signed 32-bit int value of key if key exists, 0 if key does not exist. + */ S32 LLPluginMessage::getValueS32(const std::string &key) const { S32 result = 0; @@ -165,6 +273,13 @@ S32 LLPluginMessage::getValueS32(const std::string &key) const return result; } +/** + * Gets the value of a key as unsigned 32-bit int. If the key does not exist, 0 will be returned. + * + * @param[in] key Key + * + * @return Unsigned 32-bit int value of key if key exists, 0 if key does not exist. + */ U32 LLPluginMessage::getValueU32(const std::string &key) const { U32 result = 0; @@ -179,6 +294,13 @@ U32 LLPluginMessage::getValueU32(const std::string &key) const return result; } +/** + * Gets the value of a key as a bool. If the key does not exist, false will be returned. + * + * @param[in] key Key + * + * @return Boolean value of key if it exists, false otherwise. + */ bool LLPluginMessage::getValueBoolean(const std::string &key) const { bool result = false; @@ -191,6 +313,13 @@ bool LLPluginMessage::getValueBoolean(const std::string &key) const return result; } +/** + * Gets the value of a key as a double. If the key does not exist, 0 will be returned. + * + * @param[in] key Key + * + * @return Value as a double if key exists, 0 otherwise. + */ F64 LLPluginMessage::getValueReal(const std::string &key) const { F64 result = 0.0f; @@ -203,6 +332,13 @@ F64 LLPluginMessage::getValueReal(const std::string &key) const return result; } +/** + * Gets the value of a key as a pointer. If the key does not exist, NULL will be returned. + * + * @param[in] key Key + * + * @return Pointer value if key exists, NULL otherwise. + */ void* LLPluginMessage::getValuePointer(const std::string &key) const { void* result = NULL; @@ -217,6 +353,11 @@ void* LLPluginMessage::getValuePointer(const std::string &key) const return result; } +/** + * Flatten the message into a string. + * + * @return Message as a string. + */ std::string LLPluginMessage::generate(void) const { std::ostringstream result; @@ -228,7 +369,11 @@ std::string LLPluginMessage::generate(void) const return result.str(); } - +/** + * Parse an incoming message into component parts. Clears all existing state before starting the parse. + * + * @return Returns -1 on failure, otherwise returns the number of key/value pairs in the incoming message. + */ int LLPluginMessage::parse(const std::string &message) { // clear any previous state @@ -242,27 +387,48 @@ int LLPluginMessage::parse(const std::string &message) } +/** + * Destructor + */ LLPluginMessageListener::~LLPluginMessageListener() { // TODO: should listeners have a way to ensure they're removed from dispatcher lists when deleted? } +/** + * Destructor + */ LLPluginMessageDispatcher::~LLPluginMessageDispatcher() { } +/** + * Add a message listener. TODO:DOC need more info on what uses this. when are multiple listeners needed? + * + * @param[in] listener Message listener + */ void LLPluginMessageDispatcher::addPluginMessageListener(LLPluginMessageListener *listener) { mListeners.insert(listener); } +/** + * Remove a message listener. + * + * @param[in] listener Message listener + */ void LLPluginMessageDispatcher::removePluginMessageListener(LLPluginMessageListener *listener) { mListeners.erase(listener); } +/** + * Distribute a message to all message listeners. + * + * @param[in] message Message + */ void LLPluginMessageDispatcher::dispatchPluginMessage(const LLPluginMessage &message) { for (listener_set_t::iterator it = mListeners.begin(); diff --git a/indra/llplugin/llpluginmessage.h b/indra/llplugin/llpluginmessage.h index 5e93d8b7a1..cbd31e0964 100644 --- a/indra/llplugin/llpluginmessage.h +++ b/indra/llplugin/llpluginmessage.h @@ -1,7 +1,7 @@ /** * @file llpluginmessage.h - * @brief LLPluginMessage encapsulates the serialization/deserialization of messages passed to and from plugins. * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +27,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #ifndef LL_LLPLUGINMESSAGE_H @@ -34,7 +35,9 @@ #include "llsd.h" - +/** + * @brief LLPluginMessage encapsulates the serialization/deserialization of messages passed to and from plugins. + */ class LLPluginMessage { LOG_CLASS(LLPluginMessage); @@ -102,14 +105,23 @@ private: }; +/** + * @brief Listener for plugin messages. + */ class LLPluginMessageListener { public: virtual ~LLPluginMessageListener(); + /** Plugin receives message from plugin loader shell. */ virtual void receivePluginMessage(const LLPluginMessage &message) = 0; }; +/** + * @brief Dispatcher for plugin messages. + * + * Manages the set of plugin message listeners and distributes messages to plugin message listeners. + */ class LLPluginMessageDispatcher { public: @@ -120,7 +132,9 @@ public: protected: void dispatchPluginMessage(const LLPluginMessage &message); + /** A set of message listeners. */ typedef std::set<LLPluginMessageListener*> listener_set_t; + /** The set of message listeners. */ listener_set_t mListeners; }; diff --git a/indra/llplugin/llpluginmessageclasses.h b/indra/llplugin/llpluginmessageclasses.h index 927fcf2eb2..01fddb92c5 100644 --- a/indra/llplugin/llpluginmessageclasses.h +++ b/indra/llplugin/llpluginmessageclasses.h @@ -2,6 +2,7 @@ * @file llpluginmessageclasses.h * @brief This file defines the versions of existing message classes for LLPluginMessage. * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +28,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #ifndef LL_LLPLUGINMESSAGECLASSES_H diff --git a/indra/llplugin/llpluginmessagepipe.cpp b/indra/llplugin/llpluginmessagepipe.cpp index 31ea138912..cc193fca42 100644 --- a/indra/llplugin/llpluginmessagepipe.cpp +++ b/indra/llplugin/llpluginmessagepipe.cpp @@ -2,6 +2,7 @@ * @file llpluginmessagepipe.cpp * @brief Classes that implement connections from the plugin system to pipes/pumps. * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +28,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #include "linden_common.h" diff --git a/indra/llplugin/llpluginmessagepipe.h b/indra/llplugin/llpluginmessagepipe.h index 4eb6575bd4..1ddb38de68 100644 --- a/indra/llplugin/llpluginmessagepipe.h +++ b/indra/llplugin/llpluginmessagepipe.h @@ -2,6 +2,7 @@ * @file llpluginmessagepipe.h * @brief Classes that implement connections from the plugin system to pipes/pumps. * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +28,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #ifndef LL_LLPLUGINMESSAGEPIPE_H diff --git a/indra/llplugin/llpluginprocesschild.cpp b/indra/llplugin/llpluginprocesschild.cpp index fc95136d9e..55cf11c620 100644 --- a/indra/llplugin/llpluginprocesschild.cpp +++ b/indra/llplugin/llpluginprocesschild.cpp @@ -2,6 +2,7 @@ * @file llpluginprocesschild.cpp * @brief LLPluginProcessChild handles the child side of the external-process plugin API. * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +28,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #include "linden_common.h" diff --git a/indra/llplugin/llpluginprocesschild.h b/indra/llplugin/llpluginprocesschild.h index 75860bdf0a..f5c57c3d49 100644 --- a/indra/llplugin/llpluginprocesschild.h +++ b/indra/llplugin/llpluginprocesschild.h @@ -2,6 +2,7 @@ * @file llpluginprocesschild.h * @brief LLPluginProcessChild handles the child side of the external-process plugin API. * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +28,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #ifndef LL_LLPLUGINPROCESSCHILD_H diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp index b7ce800c3a..332ce288d7 100644 --- a/indra/llplugin/llpluginprocessparent.cpp +++ b/indra/llplugin/llpluginprocessparent.cpp @@ -2,6 +2,7 @@ * @file llpluginprocessparent.cpp * @brief LLPluginProcessParent handles the parent side of the external-process plugin API. * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +28,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #include "linden_common.h" diff --git a/indra/llplugin/llpluginprocessparent.h b/indra/llplugin/llpluginprocessparent.h index 1289e86c13..25669f5d78 100644 --- a/indra/llplugin/llpluginprocessparent.h +++ b/indra/llplugin/llpluginprocessparent.h @@ -2,6 +2,7 @@ * @file llpluginprocessparent.h * @brief LLPluginProcessParent handles the parent side of the external-process plugin API. * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +28,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #ifndef LL_LLPLUGINPROCESSPARENT_H diff --git a/indra/llplugin/llpluginsharedmemory.cpp b/indra/llplugin/llpluginsharedmemory.cpp index ce8b8e3e09..3c69a69d28 100644 --- a/indra/llplugin/llpluginsharedmemory.cpp +++ b/indra/llplugin/llpluginsharedmemory.cpp @@ -2,6 +2,7 @@ * @file llpluginsharedmemory.cpp * @brief LLPluginSharedMemory manages a shared memory segment for use by the LLPlugin API. * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +28,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #include "linden_common.h" diff --git a/indra/llplugin/llpluginsharedmemory.h b/indra/llplugin/llpluginsharedmemory.h index a4613b9a54..4014620c52 100644 --- a/indra/llplugin/llpluginsharedmemory.h +++ b/indra/llplugin/llpluginsharedmemory.h @@ -2,6 +2,7 @@ * @file llpluginsharedmemory.h * @brief LLPluginSharedMemory manages a shared memory segment for use by the LLPlugin API. * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +28,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #ifndef LL_LLPLUGINSHAREDMEMORY_H diff --git a/indra/llplugin/slplugin/slplugin.cpp b/indra/llplugin/slplugin/slplugin.cpp index 005e427572..23dc532ba5 100644 --- a/indra/llplugin/slplugin/slplugin.cpp +++ b/indra/llplugin/slplugin/slplugin.cpp @@ -1,11 +1,13 @@ -/** +/** * @file slplugin.cpp * @brief Loader shell for plugins, intended to be launched by the plugin host application, which directly loads a plugin dynamic library. * + * @cond + * * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. - * + * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 @@ -13,20 +15,22 @@ * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or * online at http://secondlife.com/developers/opensource/gplv2 - * + * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or * online at http://secondlife.com/developers/opensource/flossexception - * + * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, * and agree to abide by those obligations. - * + * * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * + * @endcond */ @@ -48,15 +52,15 @@ /* On Mac OS, since we call WaitNextEvent, this process will show up in the dock unless we set the LSBackgroundOnly flag in the Info.plist. - + Normally non-bundled binaries don't have an info.plist file, but it's possible to embed one in the binary by adding this to the linker flags: - + -sectcreate __TEXT __info_plist /path/to/slplugin_info.plist - + which means adding this to the gcc flags: - + -Wl,-sectcreate,__TEXT,__info_plist,/path/to/slplugin_info.plist - + */ #if LL_DARWIN || LL_LINUX @@ -67,7 +71,7 @@ static void crash_handler(int sig) // TODO: add our own crash reporting _exit(1); } -#endif +#endif #if LL_WINDOWS #include <windows.h> @@ -80,7 +84,48 @@ LONG WINAPI myWin32ExceptionHandler( struct _EXCEPTION_POINTERS* exception_infop //std::cerr << "intercepted an unhandled exception and will exit immediately." << std::endl; // TODO: replace exception handler before we exit? - return EXCEPTION_EXECUTE_HANDLER; + return EXCEPTION_EXECUTE_HANDLER; +} + +// Taken from : http://blog.kalmbachnet.de/?postid=75 +// The MSVC 2005 CRT forces the call of the default-debugger (normally Dr.Watson) +// even with the other exception handling code. This (terrifying) piece of code +// patches things so that doesn't happen. +LPTOP_LEVEL_EXCEPTION_FILTER WINAPI MyDummySetUnhandledExceptionFilter( + LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter ) +{ + return NULL; +} + +BOOL PreventSetUnhandledExceptionFilter() +{ +// WARNING: This won't work on 64-bit Windows systems so we turn it off it. +// It should work for any flavor of 32-bit Windows we care about. +// If it's off, sometimes you will see an OS message when a plugin crashes +#ifndef _WIN64 + HMODULE hKernel32 = LoadLibraryA( "kernel32.dll" ); + if ( NULL == hKernel32 ) + return FALSE; + + void *pOrgEntry = GetProcAddress( hKernel32, "SetUnhandledExceptionFilter" ); + if( NULL == pOrgEntry ) + return FALSE; + + unsigned char newJump[ 100 ]; + DWORD dwOrgEntryAddr = (DWORD)pOrgEntry; + dwOrgEntryAddr += 5; // add 5 for 5 op-codes for jmp far + void *pNewFunc = &MyDummySetUnhandledExceptionFilter; + DWORD dwNewEntryAddr = (DWORD) pNewFunc; + DWORD dwRelativeAddr = dwNewEntryAddr - dwOrgEntryAddr; + + newJump[ 0 ] = 0xE9; // JMP absolute + memcpy( &newJump[ 1 ], &dwRelativeAddr, sizeof( pNewFunc ) ); + SIZE_T bytesWritten; + BOOL bRet = WriteProcessMemory( GetCurrentProcess(), pOrgEntry, newJump, sizeof( pNewFunc ) + 1, &bytesWritten ); + return bRet; +#else + return FALSE; +#endif } //////////////////////////////////////////////////////////////////////////////// @@ -91,6 +136,7 @@ void initExceptionHandler() // save old exception handler in case we need to restore it at the end prev_filter = SetUnhandledExceptionFilter( myWin32ExceptionHandler ); + PreventSetUnhandledExceptionFilter(); } bool checkExceptionHandler() @@ -99,6 +145,8 @@ bool checkExceptionHandler() LPTOP_LEVEL_EXCEPTION_FILTER prev_filter; prev_filter = SetUnhandledExceptionFilter(myWin32ExceptionHandler); + PreventSetUnhandledExceptionFilter(); + if (prev_filter != myWin32ExceptionHandler) { LL_WARNS("AppInit") << "Our exception handler (" << (void *)myWin32ExceptionHandler << ") replaced with " << prev_filter << "!" << LL_ENDL; @@ -122,7 +170,7 @@ bool checkExceptionHandler() } #endif -// If this application on Windows platform is a console application, a console is always +// If this application on Windows platform is a console application, a console is always // created which is bad. Making it a Windows "application" via CMake settings but not // adding any code to explicitly create windows does the right thing. #if LL_WINDOWS @@ -133,7 +181,7 @@ int main(int argc, char **argv) { ll_init_apr(); - // Set up llerror logging + // Set up llerror logging { LLError::initForApplication("."); LLError::setDefaultLevel(LLError::LEVEL_INFO); @@ -146,14 +194,14 @@ int main(int argc, char **argv) { LL_ERRS("slplugin") << "usage: " << "SLPlugin" << " launcher_port" << LL_ENDL; }; - + U32 port = 0; if(!LLStringUtil::convertToU32(lpCmdLine, port)) { LL_ERRS("slplugin") << "port number must be numeric" << LL_ENDL; }; - // Insert our exception handler into the system so this plugin doesn't + // Insert our exception handler into the system so this plugin doesn't // display a crash message if something bad happens. The host app will // see the missing heartbeat and log appropriately. initExceptionHandler(); @@ -162,7 +210,7 @@ int main(int argc, char **argv) { LL_ERRS("slplugin") << "usage: " << argv[0] << " launcher_port" << LL_ENDL; } - + U32 port = 0; if(!LLStringUtil::convertToU32(argv[1], port)) { @@ -183,17 +231,17 @@ int main(int argc, char **argv) LLPluginProcessChild *plugin = new LLPluginProcessChild(); plugin->init(port); - + LLTimer timer; timer.start(); #if LL_WINDOWS checkExceptionHandler(); #endif - + while(!plugin->isDone()) { - timer.reset(); + timer.reset(); plugin->idle(); #if LL_DARWIN { @@ -204,7 +252,7 @@ int main(int argc, char **argv) #endif F64 elapsed = timer.getElapsedTimeF64(); F64 remaining = plugin->getSleepTime() - elapsed; - + if(remaining <= 0.0f) { // We've already used our full allotment. @@ -217,26 +265,26 @@ int main(int argc, char **argv) { // LL_INFOS("slplugin") << "elapsed = " << elapsed * 1000.0f << " ms, remaining = " << remaining * 1000.0f << " ms, sleeping for " << remaining * 1000.0f << " ms" << LL_ENDL; -// timer.reset(); - +// timer.reset(); + // This also services the network as needed. plugin->sleep(remaining); - + // LL_INFOS("slplugin") << "slept for "<< timer.getElapsedTimeF64() * 1000.0f << " ms" << LL_ENDL; } #if LL_WINDOWS // More agressive checking of interfering exception handlers. - // Doesn't appear to be required so far - even for plugins - // that do crash with a single call to the intercept + // Doesn't appear to be required so far - even for plugins + // that do crash with a single call to the intercept // exception handler such as QuickTime. //checkExceptionHandler(); #endif } delete plugin; - - ll_cleanup_apr(); + + ll_cleanup_apr(); return 0; } diff --git a/indra/llprimitive/CMakeLists.txt b/indra/llprimitive/CMakeLists.txt index f9392a2b75..af78ed7936 100644 --- a/indra/llprimitive/CMakeLists.txt +++ b/indra/llprimitive/CMakeLists.txt @@ -28,6 +28,7 @@ set(llprimitive_SOURCE_FILES lltreeparams.cpp llvolumemessage.cpp llvolumexml.cpp + material_codes.cpp ) set(llprimitive_HEADER_FILES diff --git a/indra/llprimitive/material_codes.cpp b/indra/llprimitive/material_codes.cpp new file mode 100644 index 0000000000..ce146dad8a --- /dev/null +++ b/indra/llprimitive/material_codes.cpp @@ -0,0 +1,46 @@ +/** + * @file material_codes.cpp + * @brief Material_codes definitions + * + * $LicenseInfo:firstyear=2000&license=viewergpl$ + * + * Copyright (c) 2000-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "material_codes.h" + +#include "lluuid.h" + +const LLUUID LL_DEFAULT_STONE_UUID("87c5765b-aa26-43eb-b8c6-c09a1ca6208e"); +const LLUUID LL_DEFAULT_METAL_UUID("6f3c53e9-ba60-4010-8f3e-30f51a762476"); +const LLUUID LL_DEFAULT_GLASS_UUID("b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d"); +const LLUUID LL_DEFAULT_WOOD_UUID("89556747-24cb-43ed-920b-47caed15465f"); +const LLUUID LL_DEFAULT_FLESH_UUID("80736669-e4b9-450e-8890-d5169f988a50"); +const LLUUID LL_DEFAULT_PLASTIC_UUID("304fcb4e-7d33-4339-ba80-76d3d22dc11a"); +const LLUUID LL_DEFAULT_RUBBER_UUID("9fae0bc5-666d-477e-9f70-84e8556ec867"); +const LLUUID LL_DEFAULT_LIGHT_UUID("00000000-0000-0000-0000-000000000000"); diff --git a/indra/llprimitive/material_codes.h b/indra/llprimitive/material_codes.h index e5a59a2789..ba3faba39f 100644 --- a/indra/llprimitive/material_codes.h +++ b/indra/llprimitive/material_codes.h @@ -33,7 +33,7 @@ #ifndef LL_MATERIAL_CODES_H #define LL_MATERIAL_CODES_H -#include "lluuid.h" +class LLUUID; // material types const U8 LL_MCODE_STONE = 0; @@ -47,13 +47,14 @@ const U8 LL_MCODE_LIGHT = 7; const U8 LL_MCODE_END = 8; const U8 LL_MCODE_MASK = 0x0F; -const LLUUID LL_DEFAULT_STONE_UUID("87c5765b-aa26-43eb-b8c6-c09a1ca6208e"); -const LLUUID LL_DEFAULT_METAL_UUID("6f3c53e9-ba60-4010-8f3e-30f51a762476"); -const LLUUID LL_DEFAULT_GLASS_UUID("b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d"); -const LLUUID LL_DEFAULT_WOOD_UUID("89556747-24cb-43ed-920b-47caed15465f"); -const LLUUID LL_DEFAULT_FLESH_UUID("80736669-e4b9-450e-8890-d5169f988a50"); -const LLUUID LL_DEFAULT_PLASTIC_UUID("304fcb4e-7d33-4339-ba80-76d3d22dc11a"); -const LLUUID LL_DEFAULT_RUBBER_UUID("9fae0bc5-666d-477e-9f70-84e8556ec867"); -const LLUUID LL_DEFAULT_LIGHT_UUID("00000000-0000-0000-0000-000000000000"); +// *NOTE: Define these in .cpp file to reduce duplicate instances +extern const LLUUID LL_DEFAULT_STONE_UUID; +extern const LLUUID LL_DEFAULT_METAL_UUID; +extern const LLUUID LL_DEFAULT_GLASS_UUID; +extern const LLUUID LL_DEFAULT_WOOD_UUID; +extern const LLUUID LL_DEFAULT_FLESH_UUID; +extern const LLUUID LL_DEFAULT_PLASTIC_UUID; +extern const LLUUID LL_DEFAULT_RUBBER_UUID; +extern const LLUUID LL_DEFAULT_LIGHT_UUID; #endif diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index f0b4436df5..74b49b846e 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -60,6 +60,7 @@ set(llui_SOURCE_FILES llmultisliderctrl.cpp llnotifications.cpp llnotificationslistener.cpp + llnotificationsutil.cpp llpanel.cpp llprogressbar.cpp llradiogroup.cpp @@ -147,8 +148,10 @@ set(llui_HEADER_FILES llmultifloater.h llmultisliderctrl.h llmultislider.h + llnotificationptr.h llnotifications.h llnotificationslistener.h + llnotificationsutil.h llpanel.h llprogressbar.h llradiogroup.h diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 8930e32055..7721137e29 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -32,6 +32,7 @@ #include "linden_common.h" +#define LLBUTTON_CPP #include "llbutton.h" // Linden library includes @@ -48,7 +49,7 @@ #include "llfloaterreg.h" #include "llfocusmgr.h" #include "llwindow.h" -#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llrender.h" #include "lluictrlfactory.h" #include "llhelp.h" @@ -56,6 +57,10 @@ static LLDefaultChildRegistry::Register<LLButton> r("button"); +// Compiler optimization, generate extern template +template class LLButton* LLView::getChild<class LLButton>( + const std::string& name, BOOL recurse) const; + // globals loaded from settings.xml S32 LLBUTTON_H_PAD = 0; S32 LLBUTTON_V_PAD = 0; @@ -1106,7 +1111,7 @@ void LLButton::showHelp(LLUICtrl* ctrl, const LLSD& sdname) // display an error if we can't find a help_topic string. // fix this by adding a help_topic attribute to the xui file - LLNotifications::instance().add("UnableToFindHelpTopic"); + LLNotificationsUtil::add("UnableToFindHelpTopic"); } void LLButton::resetMouseDownTimer() diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 8c3b4bd859..4c7400220d 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -322,5 +322,10 @@ private: LLFrameTimer mFlashingTimer; }; +// Build time optimization, generate once in .cpp file +#ifndef LLBUTTON_CPP +extern template class LLButton* LLView::getChild<class LLButton>( + const std::string& name, BOOL recurse) const; +#endif #endif // LL_LLBUTTON_H diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp index 7f0f9751db..cd10dfdb1c 100644 --- a/indra/llui/llcheckboxctrl.cpp +++ b/indra/llui/llcheckboxctrl.cpp @@ -33,6 +33,7 @@ // The mutants are coming! #include "linden_common.h" +#define LLCHECKBOXCTRL_CPP #include "llcheckboxctrl.h" #include "llgl.h" @@ -50,6 +51,10 @@ const U32 MAX_STRING_LENGTH = 10; static LLDefaultChildRegistry::Register<LLCheckBoxCtrl> r("check_box"); +// Compiler optimization, generate extern template +template class LLCheckBoxCtrl* LLView::getChild<class LLCheckBoxCtrl>( + const std::string& name, BOOL recurse) const; + LLCheckBoxCtrl::Params::Params() : text_enabled_color("text_enabled_color"), text_disabled_color("text_disabled_color"), diff --git a/indra/llui/llcheckboxctrl.h b/indra/llui/llcheckboxctrl.h index b14e66b915..28d50f957d 100644 --- a/indra/llui/llcheckboxctrl.h +++ b/indra/llui/llcheckboxctrl.h @@ -126,5 +126,10 @@ protected: LLUIColor mTextDisabledColor; }; +// Build time optimization, generate once in .cpp file +#ifndef LLCHECKBOXCTRL_CPP +extern template class LLCheckBoxCtrl* LLView::getChild<class LLCheckBoxCtrl>( + const std::string& name, BOOL recurse) const; +#endif #endif // LL_LLCHECKBOXCTRL_H diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp index 8de3a8a96f..d4c3cfb7b6 100644 --- a/indra/llui/llflatlistview.cpp +++ b/indra/llui/llflatlistview.cpp @@ -39,8 +39,8 @@ static const LLDefaultChildRegistry::Register<LLFlatListView> flat_list_view("flat_list_view"); -const LLSD SELECTED_EVENT = LLSD().insert("selected", true); -const LLSD UNSELECTED_EVENT = LLSD().insert("selected", false); +const LLSD SELECTED_EVENT = LLSD().with("selected", true); +const LLSD UNSELECTED_EVENT = LLSD().with("selected", false); static const std::string COMMENT_TEXTBOX = "comment_text"; @@ -484,6 +484,8 @@ void LLFlatListView::rearrangeItems() void LLFlatListView::onItemMouseClick(item_pair_t* item_pair, MASK mask) { if (!item_pair) return; + + setFocus(TRUE); bool select_item = !isSelected(item_pair); @@ -528,7 +530,7 @@ BOOL LLFlatListView::handleKeyHere(KEY key, MASK mask) if ( !selectNextItemPair(true, reset_selection) && reset_selection) { // If case we are in accordion tab notify parent to go to the previous accordion - notifyParent(LLSD().insert("action","select_prev")); + notifyParent(LLSD().with("action","select_prev")); } break; } @@ -537,7 +539,7 @@ BOOL LLFlatListView::handleKeyHere(KEY key, MASK mask) if ( !selectNextItemPair(false, reset_selection) && reset_selection) { // If case we are in accordion tab notify parent to go to the next accordion - notifyParent(LLSD().insert("action","select_next")); + notifyParent(LLSD().with("action","select_next")); } break; } @@ -554,12 +556,21 @@ BOOL LLFlatListView::handleKeyHere(KEY key, MASK mask) break; } - if ( key == KEY_UP || key == KEY_DOWN ) + if ( ( key == KEY_UP || key == KEY_DOWN ) && mSelectedItemPairs.size() ) { - LLRect selcted_rect = getLastSelectedItemRect().stretch(1); - LLRect visible_rect = getVisibleContentRect(); - if ( !visible_rect.contains (selcted_rect) ) - scrollToShowRect(selcted_rect); + LLRect visible_rc = getVisibleContentRect(); + LLRect selected_rc = getLastSelectedItemRect(); + + if ( !visible_rc.contains (selected_rc) ) + { + // But scroll in Items panel coordinates + scrollToShowRect(selected_rc); + } + + // In case we are in accordion tab notify parent to show selected rectangle + LLRect screen_rc; + localRectToScreen(selected_rc, &screen_rc); + notifyParent(LLSD().with("scrollToShowRect",screen_rc.getValue())); handled = TRUE; } @@ -645,8 +656,6 @@ bool LLFlatListView::selectItemPair(item_pair_t* item_pair, bool select) onCommit(); } - setFocus(TRUE); - // Stretch selected items rect to ensure it won't be clipped mSelectedItemsBorder->setRect(getSelectedItemsRect().stretch(-1)); @@ -680,6 +689,17 @@ LLRect LLFlatListView::getSelectedItemsRect() return rc; } +void LLFlatListView::selectFirstItem () +{ + selectItemPair(mItemPairs.front(), true); +} + +void LLFlatListView::selectLastItem () +{ + selectItemPair(mItemPairs.back(), true); +} + + // virtual bool LLFlatListView::selectNextItemPair(bool is_up_direction, bool reset_selection) { @@ -687,53 +707,53 @@ bool LLFlatListView::selectNextItemPair(bool is_up_direction, bool reset_selecti if ( !mItemPairs.size() ) return false; - item_pair_t* cur_sel_pair = NULL; + item_pair_t* to_sel_pair = NULL; - + item_pair_t* cur_sel_pair = NULL; if ( mSelectedItemPairs.size() ) { // Take the last selected pair cur_sel_pair = mSelectedItemPairs.back(); - } - else - { - // If there weren't selected items then choose the first one bases on given direction - cur_sel_pair = (is_up_direction) ? mItemPairs.back() : mItemPairs.front(); - // Force selection to first item - to_sel_pair = cur_sel_pair; - } - - // Bases on given direction choose next item to select - if ( is_up_direction ) - { - // Find current selected item position in mItemPairs list - pairs_list_t::reverse_iterator sel_it = std::find(mItemPairs.rbegin(), mItemPairs.rend(), cur_sel_pair); - - for (;++sel_it != mItemPairs.rend();) + // Bases on given direction choose next item to select + if ( is_up_direction ) { - // skip invisible items - if ( (*sel_it)->first->getVisible() ) + // Find current selected item position in mItemPairs list + pairs_list_t::reverse_iterator sel_it = std::find(mItemPairs.rbegin(), mItemPairs.rend(), cur_sel_pair); + + for (;++sel_it != mItemPairs.rend();) { - to_sel_pair = *sel_it; - break; + // skip invisible items + if ( (*sel_it)->first->getVisible() ) + { + to_sel_pair = *sel_it; + break; + } } } - } - else - { - // Find current selected item position in mItemPairs list - pairs_list_t::iterator sel_it = std::find(mItemPairs.begin(), mItemPairs.end(), cur_sel_pair); - - for (;++sel_it != mItemPairs.end();) + else { - // skip invisible items - if ( (*sel_it)->first->getVisible() ) + // Find current selected item position in mItemPairs list + pairs_list_t::iterator sel_it = std::find(mItemPairs.begin(), mItemPairs.end(), cur_sel_pair); + + for (;++sel_it != mItemPairs.end();) { - to_sel_pair = *sel_it; - break; + // skip invisible items + if ( (*sel_it)->first->getVisible() ) + { + to_sel_pair = *sel_it; + break; + } } } } + else + { + // If there weren't selected items then choose the first one bases on given direction + cur_sel_pair = (is_up_direction) ? mItemPairs.back() : mItemPairs.front(); + // Force selection to first item + to_sel_pair = cur_sel_pair; + } + if ( to_sel_pair ) { @@ -911,4 +931,23 @@ void LLFlatListView::onFocusLost() mSelectedItemsBorder->setVisible(FALSE); } +//virtual +void LLFlatListView::notify(const LLSD& info) +{ + if(info.has("action")) + { + std::string str_action = info["action"]; + if(str_action == "select_first") + { + setFocus(true); + selectFirstItem(); + } + else if(str_action == "select_last") + { + setFocus(true); + selectLastItem(); + } + } +} + //EOF diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h index 3867e910c0..9e1e0f90fc 100644 --- a/indra/llui/llflatlistview.h +++ b/indra/llui/llflatlistview.h @@ -279,6 +279,12 @@ public: bool updateValue(const LLSD& old_value, const LLSD& new_value); + + void selectFirstItem (); + void selectLastItem (); + + virtual void notify(const LLSD& info) ; + protected: /** Pairs LLpanel representing a single item LLPanel and LLSD associated with it */ diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 262afbe661..a63187678e 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -66,27 +66,6 @@ // use this to control "jumping" behavior when Ctrl-Tabbing const S32 TABBED_FLOATER_OFFSET = 0; -std::string LLFloater::sButtonActiveImageNames[BUTTON_COUNT] = -{ - "Icon_Close_Foreground", //BUTTON_CLOSE - "Icon_Restore_Foreground", //BUTTON_RESTORE - "Icon_Minimize_Foreground", //BUTTON_MINIMIZE - "tearoffbox.tga", //BUTTON_TEAR_OFF - "Icon_Dock_Foreground", //BUTTON_DOCK - "Icon_Undock_Foreground", //BUTTON_UNDOCK - "Icon_Help_Foreground" //BUTTON_HELP -}; - -std::string LLFloater::sButtonPressedImageNames[BUTTON_COUNT] = -{ - "Icon_Close_Press", //BUTTON_CLOSE - "Icon_Restore_Press", //BUTTON_RESTORE - "Icon_Minimize_Press", //BUTTON_MINIMIZE - "tearoff_pressed.tga", //BUTTON_TEAR_OFF - "Icon_Dock_Press", //BUTTON_DOCK - "Icon_Undock_Press", //BUTTON_UNDOCK - "Icon_Help_Press" //BUTTON_HELP -}; std::string LLFloater::sButtonNames[BUTTON_COUNT] = { @@ -195,6 +174,20 @@ LLFloater::Params::Params() can_dock("can_dock", false), header_height("header_height", 0), legacy_header_height("legacy_header_height", 0), + close_image("close_image"), + restore_image("restore_image"), + minimize_image("minimize_image"), + tear_off_image("tear_off_image"), + dock_image("dock_image"), + undock_image("undock_image"), + help_image("help_image"), + close_pressed_image("close_pressed_image"), + restore_pressed_image("restore_pressed_image"), + minimize_pressed_image("minimize_pressed_image"), + tear_off_pressed_image("tear_off_pressed_image"), + dock_pressed_image("dock_pressed_image"), + undock_pressed_image("undock_pressed_image"), + help_pressed_image("help_pressed_image"), open_callback("open_callback"), close_callback("close_callback") { @@ -247,11 +240,11 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) mDocked(false), mHasBeenDraggedWhileMinimized(FALSE), mPreviousMinimizedBottom(0), - mPreviousMinimizedLeft(0), - mNotificationContext(NULL) + mPreviousMinimizedLeft(0) +// mNotificationContext(NULL) { mHandle.bind(this); - mNotificationContext = new LLFloaterNotificationContext(getHandle()); +// mNotificationContext = new LLFloaterNotificationContext(getHandle()); // Clicks stop here. setMouseOpaque(TRUE); @@ -263,11 +256,9 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) // prior rectangle to be used on restore. mExpandedRect.set(0,0,0,0); - for (S32 i = 0; i < BUTTON_COUNT; i++) - { - mButtonsEnabled[i] = FALSE; - mButtons[i] = NULL; - } + memset(mButtonsEnabled, 0, BUTTON_COUNT * sizeof(bool)); + memset(mButtons, 0, BUTTON_COUNT * sizeof(LLButton*)); + addDragHandle(); addResizeCtrls(); @@ -276,11 +267,11 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) // chrome floaters don't take focus at all setFocusRoot(!getIsChrome()); - initFloater(); + initFloater(p); } // Note: Floaters constructed from XML call init() twice! -void LLFloater::initFloater() +void LLFloater::initFloater(const Params& p) { // Close button. if (mCanClose) @@ -305,7 +296,7 @@ void LLFloater::initFloater() mButtonsEnabled[BUTTON_DOCK] = TRUE; } - buildButtons(); + buildButtons(p); // Floaters are created in the invisible state setVisible(FALSE); @@ -468,8 +459,8 @@ LLFloater::~LLFloater() { LLFloaterReg::removeInstance(mInstanceName, mKey); - delete mNotificationContext; - mNotificationContext = NULL; +// delete mNotificationContext; +// mNotificationContext = NULL; //// am I not hosted by another floater? //if (mHostHandle.isDead()) @@ -1280,7 +1271,7 @@ void LLFloater::removeDependentFloater(LLFloater* floaterp) floaterp->mDependeeHandle = LLHandle<LLFloater>(); } -BOOL LLFloater::offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButtons index) +BOOL LLFloater::offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButton index) { if( mButtonsEnabled[index] ) { @@ -1461,6 +1452,7 @@ void LLFloater::onClickTearOff(LLFloater* self) gFloaterView->adjustToFitScreen(self, FALSE); // give focus to new window to keep continuity for the user self->setFocus(TRUE); + self->setTornOff(true); } else //Attach to parent. { @@ -1472,6 +1464,7 @@ void LLFloater::onClickTearOff(LLFloater* self) // make sure host is visible new_host->openFloater(new_host->getKey()); } + self->setTornOff(false); } } @@ -1798,7 +1791,7 @@ void LLFloater::updateButtons() mDragHandle->setMaxTitleWidth(getRect().getWidth() - (button_count * (floater_close_box_size + 1))); } -void LLFloater::buildButtons() +void LLFloater::buildButtons(const Params& floater_params) { static LLUICachedControl<S32> floater_close_box_size ("UIFloaterCloseBoxSize", 0); static LLUICachedControl<S32> close_box_from_top ("UICloseBoxFromTop", 0); @@ -1832,17 +1825,18 @@ void LLFloater::buildButtons() LLButton::Params p; p.name(sButtonNames[i]); p.rect(btn_rect); - p.image_unselected.name(sButtonActiveImageNames[i]); + p.image_unselected = getButtonImage(floater_params, (EFloaterButton)i); // Selected, no matter if hovered or not, is "pressed" - p.image_selected.name(sButtonPressedImageNames[i]); - p.image_hover_selected.name(sButtonPressedImageNames[i]); + LLUIImage* pressed_image = getButtonPressedImage(floater_params, (EFloaterButton)i); + p.image_selected = pressed_image; + p.image_hover_selected = pressed_image; // Use a glow effect when the user hovers over the button // These icons are really small, need glow amount increased p.hover_glow_amount( 0.33f ); p.click_callback.function(boost::bind(sButtonCallbacks[i], this)); p.tab_stop(false); p.follows.flags(FOLLOWS_TOP|FOLLOWS_RIGHT); - p.tool_tip(sButtonToolTips[i]); + p.tool_tip = getButtonTooltip(floater_params, (EFloaterButton)i); p.scale_image(true); p.chrome(true); @@ -1854,6 +1848,59 @@ void LLFloater::buildButtons() updateButtons(); } +// static +LLUIImage* LLFloater::getButtonImage(const Params& p, EFloaterButton e) +{ + switch(e) + { + default: + case BUTTON_CLOSE: + return p.close_image; + case BUTTON_RESTORE: + return p.restore_image; + case BUTTON_MINIMIZE: + return p.minimize_image; + case BUTTON_TEAR_OFF: + return p.tear_off_image; + case BUTTON_DOCK: + return p.dock_image; + case BUTTON_UNDOCK: + return p.undock_image; + case BUTTON_HELP: + return p.help_image; + } +} + +// static +LLUIImage* LLFloater::getButtonPressedImage(const Params& p, EFloaterButton e) +{ + switch(e) + { + default: + case BUTTON_CLOSE: + return p.close_pressed_image; + case BUTTON_RESTORE: + return p.restore_pressed_image; + case BUTTON_MINIMIZE: + return p.minimize_pressed_image; + case BUTTON_TEAR_OFF: + return p.tear_off_pressed_image; + case BUTTON_DOCK: + return p.dock_pressed_image; + case BUTTON_UNDOCK: + return p.undock_pressed_image; + case BUTTON_HELP: + return p.help_pressed_image; + } +} + +// static +std::string LLFloater::getButtonTooltip(const Params& p, EFloaterButton e) +{ + // TODO: per-floater localizable tooltips set in XML + return sButtonToolTips[e]; +} + ///////////////////////////////////////////////////// // LLFloaterView @@ -2302,8 +2349,7 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out } LLRect::tCoordType screen_width = getSnapRect().getWidth(); LLRect::tCoordType screen_height = getSnapRect().getHeight(); - // convert to local coordinate frame - LLRect snap_rect_local = getLocalSnapRect(); + // only automatically resize non-minimized, resizable floaters if( floater->isResizable() && !floater->isMinimized() ) @@ -2343,7 +2389,7 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out } // move window fully onscreen - if (floater->translateIntoRect( snap_rect_local, allow_partial_outside )) + if (floater->translateIntoRect( getLocalRect(), allow_partial_outside )) { floater->clearSnapTarget(); } @@ -2672,7 +2718,7 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr o setupParams(params, parent); initFromParams(params); - initFloater(); + initFloater(params); LLMultiFloater* last_host = LLFloater::getFloaterHost(); if (node->hasName("multi_floater")) diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 1b98dddddc..b5c835cb47 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -39,7 +39,7 @@ #include "llpanel.h" #include "lluuid.h" -#include "llnotifications.h" +//#include "llnotificationsutil.h" #include <set> class LLDragHandle; @@ -65,20 +65,6 @@ const BOOL CLOSE_NO = FALSE; const BOOL ADJUST_VERTICAL_YES = TRUE; const BOOL ADJUST_VERTICAL_NO = FALSE; -// associates a given notification instance with a particular floater -class LLFloaterNotificationContext : - public LLNotificationContext -{ -public: - LLFloaterNotificationContext(LLHandle<LLFloater> floater_handle) : - mFloaterHandle(floater_handle) - {} - - LLFloater* getFloater() { return mFloaterHandle.get(); } -private: - LLHandle<LLFloater> mFloaterHandle; -}; - class LLFloater : public LLPanel { friend class LLFloaterView; @@ -97,7 +83,7 @@ public: |*==========================================================================*/ }; - enum EFloaterButtons + enum EFloaterButton { BUTTON_CLOSE = 0, BUTTON_RESTORE, @@ -128,6 +114,22 @@ public: can_dock; Optional<S32> header_height, legacy_header_height; // HACK see initFromXML() + + // Images for top-right controls + Optional<LLUIImage*> close_image, + restore_image, + minimize_image, + tear_off_image, + dock_image, + undock_image, + help_image; + Optional<LLUIImage*> close_pressed_image, + restore_pressed_image, + minimize_pressed_image, + tear_off_pressed_image, + dock_pressed_image, + undock_pressed_image, + help_pressed_image; Optional<CommitCallbackParam> open_callback, close_callback; @@ -158,7 +160,7 @@ public: /*virtual*/ void setIsChrome(BOOL is_chrome); /*virtual*/ void setRect(const LLRect &rect); - void initFloater(); + void initFloater(const Params& p); void openFloater(const LLSD& key = LLSD()); @@ -257,6 +259,8 @@ public: bool isDocked() const { return mDocked; } virtual void setDocked(bool docked, bool pop_on_undock = true); + virtual void setTornOff(bool torn_off) {} + // Return a closeable floater, if any, given the current focus. static LLFloater* getClosableFloaterFromFocus(); @@ -264,10 +268,10 @@ public: // handle refocusing. static void closeFocusedFloater(); - LLNotification::Params contextualNotification(const std::string& name) - { - return LLNotification::Params(name).context(mNotificationContext); - } +// LLNotification::Params contextualNotification(const std::string& name) +// { +// return LLNotification::Params(name).context(mNotificationContext); +// } static void onClickClose(LLFloater* floater); static void onClickMinimize(LLFloater* floater); @@ -309,8 +313,15 @@ private: void cleanupHandles(); // remove handles to dead floaters void createMinimizeButton(); void updateButtons(); - void buildButtons(); - BOOL offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButtons index); + void buildButtons(const Params& p); + + // Images and tooltips are named in the XML, but we want to look them + // up by index. + static LLUIImage* getButtonImage(const Params& p, EFloaterButton e); + static LLUIImage* getButtonPressedImage(const Params& p, EFloaterButton e); + static std::string getButtonTooltip(const Params& p, EFloaterButton e); + + BOOL offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButton index); void addResizeCtrls(); void layoutResizeCtrls(); void enableResizeCtrls(bool enable); @@ -368,7 +379,7 @@ private: typedef std::set<LLHandle<LLFloater> >::iterator handle_set_iter_t; handle_set_t mDependents; - BOOL mButtonsEnabled[BUTTON_COUNT]; + bool mButtonsEnabled[BUTTON_COUNT]; LLButton* mButtons[BUTTON_COUNT]; F32 mButtonScale; BOOL mAutoFocus; @@ -382,8 +393,6 @@ private: static LLMultiFloater* sHostp; static BOOL sQuitting; - static std::string sButtonActiveImageNames[BUTTON_COUNT]; - static std::string sButtonPressedImageNames[BUTTON_COUNT]; static std::string sButtonNames[BUTTON_COUNT]; static std::string sButtonToolTips[BUTTON_COUNT]; static std::string sButtonToolTipsIndex[BUTTON_COUNT]; @@ -401,7 +410,7 @@ private: S32 mPreviousMinimizedBottom; S32 mPreviousMinimizedLeft; - LLFloaterNotificationContext* mNotificationContext; +// LLFloaterNotificationContext* mNotificationContext; LLRootHandle<LLFloater> mHandle; }; diff --git a/indra/llui/llfloaterreglistener.cpp b/indra/llui/llfloaterreglistener.cpp index 029d3b6810..082d7c1573 100644 --- a/indra/llui/llfloaterreglistener.cpp +++ b/indra/llui/llfloaterreglistener.cpp @@ -28,7 +28,7 @@ LLFloaterRegListener::LLFloaterRegListener(): add("getBuildMap", "Return on [\"reply\"] data about all registered LLFloaterReg floater names", &LLFloaterRegListener::getBuildMap, - LLSD().insert("reply", LLSD())); + LLSD().with("reply", LLSD())); LLSD requiredName; requiredName["name"] = LLSD(); add("showInstance", diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index bd5734312a..8a21155cc3 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -34,6 +34,7 @@ #include "linden_common.h" +#define LLLINEEDITOR_CPP #include "lllineeditor.h" #include "lltexteditor.h" @@ -71,6 +72,10 @@ const F32 TRIPLE_CLICK_INTERVAL = 0.3f; // delay between double and triple click static LLDefaultChildRegistry::Register<LLLineEditor> r1("line_editor"); +// Compiler optimization, generate extern template +template class LLLineEditor* LLView::getChild<class LLLineEditor>( + const std::string& name, BOOL recurse) const; + // // Member functions // @@ -125,8 +130,8 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p) mScrollHPos( 0 ), mTextPadLeft(p.text_pad_left), mTextPadRight(p.text_pad_right), - mMinHPixels(0), // computed in updateTextPadding() below - mMaxHPixels(0), // computed in updateTextPadding() below + mTextLeftEdge(0), // computed in updateTextPadding() below + mTextRightEdge(0), // computed in updateTextPadding() below mCommitOnFocusLost( p.commit_on_focus_lost ), mRevertOnEsc( p.revert_on_esc ), mKeystrokeCallback( p.keystroke_callback() ), @@ -338,9 +343,8 @@ void LLLineEditor::setTextPadding(S32 left, S32 right) void LLLineEditor::updateTextPadding() { - static LLUICachedControl<S32> line_editor_hpad ("UILineEditorHPad", 0); - mMinHPixels = line_editor_hpad + llclamp(mTextPadLeft, 0, getRect().getWidth());; - mMaxHPixels = getRect().getWidth() - mMinHPixels - llclamp(mTextPadRight, 0, getRect().getWidth()); + mTextLeftEdge = llclamp(mTextPadLeft, 0, getRect().getWidth()); + mTextRightEdge = getRect().getWidth() - llclamp(mTextPadRight, 0, getRect().getWidth()); } @@ -406,8 +410,8 @@ void LLLineEditor::setCursorAtLocalPos( S32 local_mouse_x ) mScrollHPos + mGLFont->charFromPixelOffset( wtext, mScrollHPos, - (F32)(local_mouse_x - mMinHPixels), - (F32)(mMaxHPixels - mMinHPixels + 1)); // min-max range is inclusive + (F32)(local_mouse_x - mTextLeftEdge), + (F32)(mTextRightEdge - mTextLeftEdge + 1)); // min-max range is inclusive setCursor(cursor_pos); } @@ -417,11 +421,11 @@ void LLLineEditor::setCursor( S32 pos ) mCursorPos = llclamp( pos, 0, mText.length()); S32 pixels_after_scroll = findPixelNearestPos(); - if( pixels_after_scroll > mMaxHPixels ) + if( pixels_after_scroll > mTextRightEdge ) { S32 width_chars_to_left = mGLFont->getWidth(mText.getWString().c_str(), 0, mScrollHPos); - S32 last_visible_char = mGLFont->maxDrawableChars(mText.getWString().c_str(), llmax(0.f, (F32)(mMaxHPixels - mMinHPixels + width_chars_to_left))); - S32 min_scroll = mGLFont->firstDrawableChar(mText.getWString().c_str(), (F32)(mMaxHPixels - mMinHPixels), mText.length(), getCursor()); + S32 last_visible_char = mGLFont->maxDrawableChars(mText.getWString().c_str(), llmax(0.f, (F32)(mTextRightEdge - mTextLeftEdge + width_chars_to_left))); + S32 min_scroll = mGLFont->firstDrawableChar(mText.getWString().c_str(), (F32)(mTextRightEdge - mTextLeftEdge), mText.length(), getCursor()); if (old_cursor_pos == last_visible_char) { mScrollHPos = llmin(mText.length(), llmax(min_scroll, mScrollHPos + SCROLL_INCREMENT_ADD)); @@ -682,17 +686,17 @@ BOOL LLLineEditor::handleHover(S32 x, S32 y, MASK mask) S32 increment = llround(mScrollTimer.getElapsedTimeF32() / AUTO_SCROLL_TIME); mScrollTimer.reset(); mScrollTimer.setTimerExpirySec(AUTO_SCROLL_TIME); - if( (x < mMinHPixels) && (mScrollHPos > 0 ) ) + if( (x < mTextLeftEdge) && (mScrollHPos > 0 ) ) { // Scroll to the left mScrollHPos = llclamp(mScrollHPos - increment, 0, mText.length()); } else - if( (x > mMaxHPixels) && (mCursorPos < (S32)mText.length()) ) + if( (x > mTextRightEdge) && (mCursorPos < (S32)mText.length()) ) { // If scrolling one pixel would make a difference... S32 pixels_after_scrolling_one_char = findPixelNearestPos(1); - if( pixels_after_scrolling_one_char >= mMaxHPixels ) + if( pixels_after_scrolling_one_char >= mTextRightEdge ) { // ...scroll to the right mScrollHPos = llclamp(mScrollHPos + increment, 0, mText.length()); @@ -1671,7 +1675,7 @@ void LLLineEditor::draw() } S32 rendered_text = 0; - F32 rendered_pixels_right = (F32)mMinHPixels; + F32 rendered_pixels_right = (F32)mTextLeftEdge; F32 text_bottom = (F32)background.mBottom + (F32)lineeditor_v_pad; if( (gFocusMgr.getKeyboardFocus() == this) && hasSelection() ) @@ -1700,17 +1704,17 @@ void LLLineEditor::draw() 0, LLFontGL::NO_SHADOW, select_left - mScrollHPos, - mMaxHPixels - llround(rendered_pixels_right), + mTextRightEdge - llround(rendered_pixels_right), &rendered_pixels_right); } - if( (rendered_pixels_right < (F32)mMaxHPixels) && (rendered_text < text_len) ) + if( (rendered_pixels_right < (F32)mTextRightEdge) && (rendered_text < text_len) ) { LLColor4 color = mHighlightColor; color.setAlpha(alpha); // selected middle S32 width = mGLFont->getWidth(mText.getWString().c_str(), mScrollHPos + rendered_text, select_right - mScrollHPos - rendered_text); - width = llmin(width, mMaxHPixels - llround(rendered_pixels_right)); + width = llmin(width, mTextRightEdge - llround(rendered_pixels_right)); gl_rect_2d(llround(rendered_pixels_right), cursor_top, llround(rendered_pixels_right)+width, cursor_bottom, color); LLColor4 tmp_color( 1.f - text_color.mV[0], 1.f - text_color.mV[1], 1.f - text_color.mV[2], alpha ); @@ -1722,11 +1726,11 @@ void LLLineEditor::draw() 0, LLFontGL::NO_SHADOW, select_right - mScrollHPos - rendered_text, - mMaxHPixels - llround(rendered_pixels_right), + mTextRightEdge - llround(rendered_pixels_right), &rendered_pixels_right); } - if( (rendered_pixels_right < (F32)mMaxHPixels) && (rendered_text < text_len) ) + if( (rendered_pixels_right < (F32)mTextRightEdge) && (rendered_text < text_len) ) { // unselected, right side mGLFont->render( @@ -1737,7 +1741,7 @@ void LLLineEditor::draw() 0, LLFontGL::NO_SHADOW, S32_MAX, - mMaxHPixels - llround(rendered_pixels_right), + mTextRightEdge - llround(rendered_pixels_right), &rendered_pixels_right); } } @@ -1751,7 +1755,7 @@ void LLLineEditor::draw() 0, LLFontGL::NO_SHADOW, S32_MAX, - mMaxHPixels - llround(rendered_pixels_right), + mTextRightEdge - llround(rendered_pixels_right), &rendered_pixels_right); } #if 1 // for when we're ready for image art. @@ -1809,14 +1813,14 @@ void LLLineEditor::draw() if (0 == mText.length() && mReadOnly) { mGLFont->render(mLabel.getWString(), 0, - mMinHPixels, (F32)text_bottom, + mTextLeftEdge, (F32)text_bottom, label_color, LLFontGL::LEFT, LLFontGL::BOTTOM, 0, LLFontGL::NO_SHADOW, S32_MAX, - mMaxHPixels - llround(rendered_pixels_right), + mTextRightEdge - llround(rendered_pixels_right), &rendered_pixels_right, FALSE); } @@ -1834,14 +1838,14 @@ void LLLineEditor::draw() if (0 == mText.length()) { mGLFont->render(mLabel.getWString(), 0, - mMinHPixels, (F32)text_bottom, + mTextLeftEdge, (F32)text_bottom, label_color, LLFontGL::LEFT, LLFontGL::BOTTOM, 0, LLFontGL::NO_SHADOW, S32_MAX, - mMaxHPixels - llround(rendered_pixels_right), + mTextRightEdge - llround(rendered_pixels_right), &rendered_pixels_right, FALSE); } // Draw children (border) @@ -1859,7 +1863,7 @@ void LLLineEditor::draw() S32 LLLineEditor::findPixelNearestPos(const S32 cursor_offset) const { S32 dpos = getCursor() - mScrollHPos + cursor_offset; - S32 result = mGLFont->getWidth(mText.getWString().c_str(), mScrollHPos, dpos) + mMinHPixels; + S32 result = mGLFont->getWidth(mText.getWString().c_str(), mScrollHPos, dpos) + mTextLeftEdge; return result; } diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 4c4b00094d..49e9539b16 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -303,8 +303,8 @@ protected: LLFrameTimer mScrollTimer; S32 mTextPadLeft; // Used to reserve space before the beginning of the text for children. S32 mTextPadRight; // Used to reserve space after the end of the text for children. - S32 mMinHPixels; - S32 mMaxHPixels; + S32 mTextLeftEdge; // Pixels, cached left edge of text based on left padding and width + S32 mTextRightEdge; // Pixels, cached right edge of text based on right padding and width BOOL mCommitOnFocusLost; BOOL mRevertOnEsc; @@ -395,5 +395,10 @@ private: }; // end class LLLineEditor +// Build time optimization, generate once in .cpp file +#ifndef LLLINEEDITOR_CPP +extern template class LLLineEditor* LLView::getChild<class LLLineEditor>( + const std::string& name, BOOL recurse) const; +#endif #endif // LL_LINEEDITOR_ diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index f8935d03ac..907f2352a0 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -590,12 +590,13 @@ BOOL LLMenuItemSeparatorGL::handleMouseDown(S32 x, S32 y, MASK mask) LLMenuGL* parent_menu = getMenu(); if (y > getRect().getHeight() / 2) { - LLView* prev_menu_item = parent_menu->findPrevSibling(this); + // the menu items are in the child list in bottom up order + LLView* prev_menu_item = parent_menu->findNextSibling(this); return prev_menu_item ? prev_menu_item->handleMouseDown(x, prev_menu_item->getRect().getHeight(), mask) : FALSE; } else { - LLView* next_menu_item = parent_menu->findNextSibling(this); + LLView* next_menu_item = parent_menu->findPrevSibling(this); return next_menu_item ? next_menu_item->handleMouseDown(x, 0, mask) : FALSE; } } @@ -605,12 +606,12 @@ BOOL LLMenuItemSeparatorGL::handleMouseUp(S32 x, S32 y, MASK mask) LLMenuGL* parent_menu = getMenu(); if (y > getRect().getHeight() / 2) { - LLView* prev_menu_item = parent_menu->findPrevSibling(this); + LLView* prev_menu_item = parent_menu->findNextSibling(this); return prev_menu_item ? prev_menu_item->handleMouseUp(x, prev_menu_item->getRect().getHeight(), mask) : FALSE; } else { - LLView* next_menu_item = parent_menu->findNextSibling(this); + LLView* next_menu_item = parent_menu->findPrevSibling(this); return next_menu_item ? next_menu_item->handleMouseUp(x, 0, mask) : FALSE; } } diff --git a/indra/llui/llnotificationptr.h b/indra/llui/llnotificationptr.h new file mode 100644 index 0000000000..0718f7d182 --- /dev/null +++ b/indra/llui/llnotificationptr.h @@ -0,0 +1,41 @@ +/** + * @file llnotificationptr.h + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#ifndef LLNOTIFICATIONPTR_H +#define LLNOTIFICATIONPTR_H + +// Many classes just store a single LLNotificationPtr +// and llnotifications.h is very large, so define this ligher header. +#include <boost/shared_ptr.hpp> + +class LLNotification; +typedef boost::shared_ptr<LLNotification> LLNotificationPtr; + +#endif diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index eb8cc3e2c5..86989012ee 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -711,7 +711,7 @@ LLBoundListener LLNotificationChannelBase::connectChangedImpl(const LLEventListe // only about new notifications for (LLNotificationSet::iterator it = mItems.begin(); it != mItems.end(); ++it) { - slot(LLSD().insert("sigtype", "load").insert("id", (*it)->id())); + slot(LLSD().with("sigtype", "load").with("id", (*it)->id())); } // and then connect the signal so that all future notifications will also be // forwarded. @@ -722,7 +722,7 @@ LLBoundListener LLNotificationChannelBase::connectAtFrontChangedImpl(const LLEve { for (LLNotificationSet::iterator it = mItems.begin(); it != mItems.end(); ++it) { - slot(LLSD().insert("sigtype", "load").insert("id", (*it)->id())); + slot(LLSD().with("sigtype", "load").with("id", (*it)->id())); } return mChanged.connect(slot, boost::signals2::at_front); } @@ -907,7 +907,7 @@ void LLNotificationChannel::setComparator(LLNotificationComparator comparator) mItems.swap(s2); // notify clients that we've been resorted - mChanged(LLSD().insert("sigtype", "sort")); + mChanged(LLSD().with("sigtype", "sort")); } bool LLNotificationChannel::isEmpty() const @@ -1395,10 +1395,9 @@ void LLNotifications::addFromCallback(const LLSD& name) add(LLNotification::Params().name(name.asString())); } -// we provide a couple of simple add notification functions so that it's reasonable to create notifications in one line LLNotificationPtr LLNotifications::add(const std::string& name, - const LLSD& substitutions, - const LLSD& payload) + const LLSD& substitutions, + const LLSD& payload) { LLNotification::Params::Functor functor_p; functor_p.name = name; @@ -1406,15 +1405,16 @@ LLNotificationPtr LLNotifications::add(const std::string& name, } LLNotificationPtr LLNotifications::add(const std::string& name, - const LLSD& substitutions, - const LLSD& payload, - const std::string& functor_name) + const LLSD& substitutions, + const LLSD& payload, + const std::string& functor_name) { LLNotification::Params::Functor functor_p; functor_p.name = functor_name; return add(LLNotification::Params().name(name).substitutions(substitutions).payload(payload).functor(functor_p)); } - + +//virtual LLNotificationPtr LLNotifications::add(const std::string& name, const LLSD& substitutions, const LLSD& payload, @@ -1443,7 +1443,7 @@ void LLNotifications::add(const LLNotificationPtr pNotif) llerrs << "Notification added a second time to the master notification channel." << llendl; } - updateItem(LLSD().insert("sigtype", "add").insert("id", pNotif->id()), pNotif); + updateItem(LLSD().with("sigtype", "add").with("id", pNotif->id()), pNotif); } void LLNotifications::cancel(LLNotificationPtr pNotif) @@ -1454,7 +1454,7 @@ void LLNotifications::cancel(LLNotificationPtr pNotif) llerrs << "Attempted to delete nonexistent notification " << pNotif->getName() << llendl; } pNotif->cancel(); - updateItem(LLSD().insert("sigtype", "delete").insert("id", pNotif->id()), pNotif); + updateItem(LLSD().with("sigtype", "delete").with("id", pNotif->id()), pNotif); } void LLNotifications::update(const LLNotificationPtr pNotif) @@ -1462,7 +1462,7 @@ void LLNotifications::update(const LLNotificationPtr pNotif) LLNotificationSet::iterator it=mItems.find(pNotif); if (it != mItems.end()) { - updateItem(LLSD().insert("sigtype", "change").insert("id", pNotif->id()), pNotif); + updateItem(LLSD().with("sigtype", "change").with("id", pNotif->id()), pNotif); } } diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 0d7cb74f70..aeb4cebf1b 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -103,9 +103,7 @@ #include "llpointer.h" #include "llinitparam.h" #include "llnotificationslistener.h" - -class LLNotification; -typedef boost::shared_ptr<LLNotification> LLNotificationPtr; +#include "llnotificationptr.h" typedef enum e_notification_priority @@ -841,10 +839,11 @@ public: // Add a simple notification (from XUI) void addFromCallback(const LLSD& name); - // we provide a collection of simple add notification functions so that it's reasonable to create notifications in one line + // *NOTE: To add simple notifications, #include "llnotificationsutil.h" + // and use LLNotificationsUtil::add("MyNote") or add("MyNote", args) LLNotificationPtr add(const std::string& name, - const LLSD& substitutions = LLSD(), - const LLSD& payload = LLSD()); + const LLSD& substitutions, + const LLSD& payload); LLNotificationPtr add(const std::string& name, const LLSD& substitutions, const LLSD& payload, diff --git a/indra/llui/llnotificationsutil.cpp b/indra/llui/llnotificationsutil.cpp new file mode 100644 index 0000000000..2cd165f1b3 --- /dev/null +++ b/indra/llui/llnotificationsutil.cpp @@ -0,0 +1,91 @@ +/** + * @file llnotificationsutil.cpp + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#include "linden_common.h" + +#include "llnotificationsutil.h" + +#include "llnotifications.h" +#include "llsd.h" +#include "llxmlnode.h" // apparently needed to call LLNotifications::instance() + +LLNotificationPtr LLNotificationsUtil::add(const std::string& name) +{ + LLNotification::Params::Functor functor_p; + functor_p.name = name; + return LLNotifications::instance().add( + LLNotification::Params().name(name).substitutions(LLSD()).payload(LLSD()).functor(functor_p)); +} + +LLNotificationPtr LLNotificationsUtil::add(const std::string& name, + const LLSD& substitutions) +{ + LLNotification::Params::Functor functor_p; + functor_p.name = name; + return LLNotifications::instance().add( + LLNotification::Params().name(name).substitutions(substitutions).payload(LLSD()).functor(functor_p)); +} + +LLNotificationPtr LLNotificationsUtil::add(const std::string& name, + const LLSD& substitutions, + const LLSD& payload) +{ + LLNotification::Params::Functor functor_p; + functor_p.name = name; + return LLNotifications::instance().add( + LLNotification::Params().name(name).substitutions(substitutions).payload(payload).functor(functor_p)); +} + +LLNotificationPtr LLNotificationsUtil::add(const std::string& name, + const LLSD& substitutions, + const LLSD& payload, + const std::string& functor_name) +{ + LLNotification::Params::Functor functor_p; + functor_p.name = functor_name; + return LLNotifications::instance().add( + LLNotification::Params().name(name).substitutions(substitutions).payload(payload).functor(functor_p)); +} + +LLNotificationPtr LLNotificationsUtil::add(const std::string& name, + const LLSD& substitutions, + const LLSD& payload, + boost::function<void (const LLSD&, const LLSD&)> functor) +{ + LLNotification::Params::Functor functor_p; + functor_p.function = functor; + return LLNotifications::instance().add( + LLNotification::Params().name(name).substitutions(substitutions).payload(payload).functor(functor_p)); +} + +S32 LLNotificationsUtil::getSelectedOption(const LLSD& notification, const LLSD& response) +{ + return LLNotification::getSelectedOption(notification, response); +} diff --git a/indra/llui/llnotificationsutil.h b/indra/llui/llnotificationsutil.h new file mode 100644 index 0000000000..a0801b338f --- /dev/null +++ b/indra/llui/llnotificationsutil.h @@ -0,0 +1,68 @@ +/** + * @file llnotificationsutil.h + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#ifndef LLNOTIFICATIONSUTIL_H +#define LLNOTIFICATIONSUTIL_H + +// The vast majority of clients of the notifications system just want to add +// a notification to the screen, so define this lightweight public interface +// to avoid including the heavyweight llnotifications.h + +#include "llnotificationptr.h" + +#include <boost/function.hpp> + +class LLSD; + +namespace LLNotificationsUtil +{ + LLNotificationPtr add(const std::string& name); + + LLNotificationPtr add(const std::string& name, + const LLSD& substitutions); + + LLNotificationPtr add(const std::string& name, + const LLSD& substitutions, + const LLSD& payload); + + LLNotificationPtr add(const std::string& name, + const LLSD& substitutions, + const LLSD& payload, + const std::string& functor_name); + + LLNotificationPtr add(const std::string& name, + const LLSD& substitutions, + const LLSD& payload, + boost::function<void (const LLSD&, const LLSD&)> functor); + + S32 getSelectedOption(const LLSD& notification, const LLSD& response); +} + +#endif diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 063822dd56..750b190953 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -34,6 +34,7 @@ #include "linden_common.h" +#define LLPANEL_CPP #include "llpanel.h" #include "llalertdialog.h" @@ -58,6 +59,10 @@ static LLDefaultChildRegistry::Register<LLPanel> r1("panel", &LLPanel::fromXML); +// Compiler optimization, generate extern template +template class LLPanel* LLView::getChild<class LLPanel>( + const std::string& name, BOOL recurse) const; + LLPanel::LocalizedString::LocalizedString() : name("name"), value("value") diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index 0a0fed82fb..a8bd5fd5e5 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -275,4 +275,10 @@ private: }; // end class LLPanel +// Build time optimization, generate once in .cpp file +#ifndef LLPANEL_CPP +extern template class LLPanel* LLView::getChild<class LLPanel>( + const std::string& name, BOOL recurse) const; +#endif + #endif diff --git a/indra/llui/llprogressbar.cpp b/indra/llui/llprogressbar.cpp index c8b6e814e1..62ca569e6c 100644 --- a/indra/llui/llprogressbar.cpp +++ b/indra/llui/llprogressbar.cpp @@ -72,12 +72,13 @@ LLProgressBar::~LLProgressBar() void LLProgressBar::draw() { static LLTimer timer; - - LLUIImagePtr bar_fg_imagep = LLUI::getUIImage("progressbar_fill.tga"); + F32 alpha = getDrawContext().mAlpha; - mImageBar->draw(getLocalRect(), mColorBackground.get()); + LLColor4 image_bar_color = mColorBackground.get(); + image_bar_color.setAlpha(alpha); + mImageBar->draw(getLocalRect(), image_bar_color); - F32 alpha = 0.5f + 0.5f*0.5f*(1.f + (F32)sin(3.f*timer.getElapsedTimeF32())); + alpha *= 0.5f + 0.5f*0.5f*(1.f + (F32)sin(3.f*timer.getElapsedTimeF32())); LLColor4 bar_color = mColorBar.get(); bar_color.mV[VALPHA] *= alpha; // modulate alpha LLRect progress_rect = getLocalRect(); diff --git a/indra/llui/llresizebar.cpp b/indra/llui/llresizebar.cpp index a7cf9be277..0c46edf300 100644 --- a/indra/llui/llresizebar.cpp +++ b/indra/llui/llresizebar.cpp @@ -144,9 +144,10 @@ BOOL LLResizeBar::handleHover(S32 x, S32 y, MASK mask) if( valid_rect.localPointInRect( screen_x, screen_y ) && mResizingView ) { // undock floater when user resize it - if (((LLFloater*)getParent())->isDocked()) + LLFloater* parent = dynamic_cast<LLFloater*>( getParent()); + if (parent && parent->isDocked()) { - ((LLFloater*)getParent())->setDocked(false, false); + parent->setDocked( false, false); } // Resize the parent diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index 5e17372fe9..f6caed4617 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -111,7 +111,7 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p) LLView::addChild( mBorder ); mInnerRect.set( 0, getRect().getHeight(), getRect().getWidth(), 0 ); - mInnerRect.stretch( -mBorder->getBorderWidth() ); + mInnerRect.stretch( -getBorderWidth() ); LLRect vertical_scroll_rect = mInnerRect; vertical_scroll_rect.mLeft = vertical_scroll_rect.mRight - scrollbar_size; @@ -189,7 +189,7 @@ void LLScrollContainer::reshape(S32 width, S32 height, LLUICtrl::reshape( width, height, called_from_parent ); mInnerRect = getLocalRect(); - mInnerRect.stretch( -mBorder->getBorderWidth() ); + mInnerRect.stretch( -getBorderWidth() ); if (mScrolledView) { @@ -351,9 +351,9 @@ void LLScrollContainer::calcVisibleSize( S32 *visible_width, S32 *visible_height S32 doc_width = doc_rect.getWidth(); S32 doc_height = doc_rect.getHeight(); - S32 border_width = (mBorder->getVisible() ? 2 * mBorder->getBorderWidth() : 0); - *visible_width = getRect().getWidth() - border_width; - *visible_height = getRect().getHeight() - border_width; + S32 border_width = getBorderWidth(); + *visible_width = getRect().getWidth() - 2 * border_width; + *visible_height = getRect().getHeight() - 2 * border_width; *show_v_scrollbar = FALSE; *show_h_scrollbar = FALSE; @@ -499,7 +499,7 @@ void LLScrollContainer::updateScroll() BOOL show_h_scrollbar = FALSE; calcVisibleSize( &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar ); - S32 border_width = mBorder->getBorderWidth(); + S32 border_width = getBorderWidth(); if( show_v_scrollbar ) { if( doc_rect.mTop < getRect().getHeight() - border_width ) @@ -573,6 +573,9 @@ void LLScrollContainer::updateScroll() void LLScrollContainer::setBorderVisible(BOOL b) { mBorder->setVisible( b ); + // Recompute inner rect, as border visibility changes it + mInnerRect = getLocalRect(); + mInnerRect.stretch( -getBorderWidth() ); } LLRect LLScrollContainer::getVisibleContentRect() @@ -584,15 +587,16 @@ LLRect LLScrollContainer::getVisibleContentRect() return visible_rect; } -LLRect LLScrollContainer::getContentWindowRect() const +LLRect LLScrollContainer::getContentWindowRect() { + updateScroll(); LLRect scroller_view_rect; S32 visible_width = 0; S32 visible_height = 0; BOOL show_h_scrollbar = FALSE; BOOL show_v_scrollbar = FALSE; calcVisibleSize( &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar ); - S32 border_width = mBorder->getVisible() ? mBorder->getBorderWidth() : 0; + S32 border_width = getBorderWidth(); scroller_view_rect.setOriginAndSize(border_width, show_h_scrollbar ? mScrollbar[HORIZONTAL]->getRect().mTop : border_width, visible_width, @@ -673,7 +677,7 @@ void LLScrollContainer::goToBottom() S32 LLScrollContainer::getBorderWidth() const { - if (mBorder) + if (mBorder->getVisible()) { return mBorder->getBorderWidth(); } diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h index ac8ffe5258..25dcd071ab 100644 --- a/indra/llui/llscrollcontainer.h +++ b/indra/llui/llscrollcontainer.h @@ -96,7 +96,7 @@ public: void setReserveScrollCorner( BOOL b ) { mReserveScrollCorner = b; } LLRect getVisibleContentRect(); - LLRect getContentWindowRect() const; + LLRect getContentWindowRect(); const LLRect& getScrolledViewRect() const { return mScrolledView ? mScrolledView->getRect() : LLRect::null; } void pageUp(S32 overlap = 0); void pageDown(S32 overlap = 0); diff --git a/indra/llui/llsearcheditor.cpp b/indra/llui/llsearcheditor.cpp index fad2b7bc99..6fa99df82e 100644 --- a/indra/llui/llsearcheditor.cpp +++ b/indra/llui/llsearcheditor.cpp @@ -141,6 +141,15 @@ void LLSearchEditor::clear() } } +//virtual +void LLSearchEditor::setFocus( BOOL b ) +{ + if (mSearchEditor) + { + mSearchEditor->setFocus(b); + } +} + void LLSearchEditor::onClearButtonClick(const LLSD& data) { setText(LLStringUtil::null); diff --git a/indra/llui/llsearcheditor.h b/indra/llui/llsearcheditor.h index f395e7e816..bd2d595174 100644 --- a/indra/llui/llsearcheditor.h +++ b/indra/llui/llsearcheditor.h @@ -83,6 +83,7 @@ public: virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); virtual void setLabel( const LLStringExplicit &new_label ); virtual void clear(); + virtual void setFocus( BOOL b ); void setKeystrokeCallback( commit_callback_t cb ) { mKeystrokeCallback = cb; } diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 7bf10d774c..82a3c5cf47 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -156,6 +156,7 @@ LLTextBase::Params::Params() read_only("read_only", false), v_pad("v_pad", 0), h_pad("h_pad", 0), + clip_partial("clip_partial", true), line_spacing("line_spacing"), max_text_length("max_length", 255), font_shadow("font_shadow"), @@ -193,6 +194,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mHAlign(p.font_halign), mLineSpacingMult(p.line_spacing.multiple), mLineSpacingPixels(p.line_spacing.pixels), + mClipPartial(p.clip_partial), mTrackEnd( p.track_end ), mScrollIndex(-1), mSelectionStart( 0 ), @@ -379,10 +381,10 @@ void LLTextBase::drawSelectionBackground() // Draw the selection box (we're using a box instead of reversing the colors on the selected text). gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - const LLColor4& color = mReadOnly ? mReadOnlyBgColor.get() : mWriteableBgColor.get(); + const LLColor4& color = mReadOnly ? mReadOnlyFgColor.get() : mFgColor.get(); F32 alpha = hasFocus() ? 0.7f : 0.3f; alpha *= getDrawContext().mAlpha; - gGL.color4f( 1.f - color.mV[0], 1.f - color.mV[1], 1.f - color.mV[2], alpha ); + LLColor4 selection_color(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], alpha); for (std::vector<LLRect>::iterator rect_it = selection_rects.begin(); rect_it != selection_rects.end(); @@ -390,7 +392,7 @@ void LLTextBase::drawSelectionBackground() { LLRect selection_rect = *rect_it; selection_rect.translate(mTextRect.mLeft - content_display_rect.mLeft, mTextRect.mBottom - content_display_rect.mBottom); - gl_rect_2d(selection_rect); + gl_rect_2d(selection_rect, selection_color); } } } @@ -504,7 +506,7 @@ void LLTextBase::drawText() } LLRect scrolled_view_rect = getVisibleDocumentRect(); - std::pair<S32, S32> line_range = getVisibleLines(); + std::pair<S32, S32> line_range = getVisibleLines(mClipPartial); S32 first_line = line_range.first; S32 last_line = line_range.second; if (first_line >= last_line) @@ -524,6 +526,7 @@ void LLTextBase::drawText() for (S32 cur_line = first_line; cur_line < last_line; cur_line++) { + S32 next_line = cur_line + 1; line_info& line = mLineInfoList[cur_line]; if ((line.mRect.mTop - scrolled_view_rect.mBottom) < mTextRect.mBottom) @@ -534,15 +537,23 @@ void LLTextBase::drawText() S32 next_start = -1; S32 line_end = text_len; - if ((cur_line + 1) < getLineCount()) + if (next_line < getLineCount()) { - next_start = getLineStart(cur_line + 1); + next_start = getLineStart(next_line); line_end = next_start; } + // A patch for EXT-1944 "Implement ellipses in message well" + // introduced a regression where text in SansSerif ending in the + // letter "r" is clipped. This may be due to an off-by-one in + // font width information out of FreeType with our fractional font + // sizes. For now, just make an extra pixel of space to resolve + // EXT-2971 "Letter R doesn't show when it's the last letter in a + // text block". See James/Richard for details. + const S32 FIX_CLIPPING_HACK = 1; LLRect text_rect(line.mRect.mLeft + mTextRect.mLeft - scrolled_view_rect.mLeft, line.mRect.mTop - scrolled_view_rect.mBottom + mTextRect.mBottom, - mDocumentView->getRect().getWidth() - scrolled_view_rect.mLeft, + llmin(mDocumentView->getRect().getWidth(), line.mRect.mRight) - scrolled_view_rect.mLeft + FIX_CLIPPING_HACK, line.mRect.mBottom - scrolled_view_rect.mBottom + mTextRect.mBottom); // draw a single line of text @@ -562,6 +573,17 @@ void LLTextBase::drawText() } S32 clipped_end = llmin( line_end, cur_segment->getEnd() ) - cur_segment->getStart(); + + if (mUseEllipses + && clipped_end == line_end + && next_line == last_line + && last_line < (S32)mLineInfoList.size()) + { + // more text to go, but we can't fit it + // so attempt to draw one extra character to force ellipses + clipped_end++; + } + text_rect.mLeft = (S32)(cur_segment->draw(seg_start - cur_segment->getStart(), clipped_end, selection_left, selection_right, text_rect)); seg_start = clipped_end + cur_segment->getStart(); @@ -641,8 +663,6 @@ S32 LLTextBase::insertStringNoUndo(S32 pos, const LLWString &wstr, LLTextBase::s if ( truncate() ) { - // The user's not getting everything he's hoping for - make_ui_sound("UISndBadKeystroke"); insert_len = getLength() - old_len; } @@ -1070,6 +1090,8 @@ void LLTextBase::reflow(S32 start_index) LLRect old_cursor_rect = getLocalRectFromDocIndex(mCursorPos); bool follow_selection = mTextRect.overlaps(old_cursor_rect); // cursor is visible + old_cursor_rect.translate(-mTextRect.mLeft, -mTextRect.mBottom); + S32 first_line = getFirstVisibleLine(); // if scroll anchor not on first line, update it to first character of first line @@ -1080,6 +1102,8 @@ void LLTextBase::reflow(S32 start_index) mScrollIndex = mLineInfoList[first_line].mDocIndexStart; } LLRect first_char_rect = getLocalRectFromDocIndex(mScrollIndex); + // subtract off effect of horizontal scrollbar from local position of first char + first_char_rect.translate(-mTextRect.mLeft, -mTextRect.mBottom); S32 cur_top = 0; @@ -1178,6 +1202,10 @@ void LLTextBase::reflow(S32 start_index) ++seg_iter; seg_offset = 0; } + if (force_newline) + { + line_count++; + } } // calculate visible region for diplaying text @@ -1195,7 +1223,6 @@ void LLTextBase::reflow(S32 start_index) // apply scroll constraints after reflowing text if (!hasMouseCapture() && mScroller) { - LLRect visible_content_rect = getVisibleDocumentRect(); if (scrolled_to_bottom && mTrackEnd) { // keep bottom of text buffer visible @@ -1204,18 +1231,14 @@ void LLTextBase::reflow(S32 start_index) else if (hasSelection() && follow_selection) { // keep cursor in same vertical position on screen when selecting text - LLRect new_cursor_rect_doc = getLocalRectFromDocIndex(mCursorPos); - new_cursor_rect_doc.translate(visible_content_rect.mLeft, visible_content_rect.mBottom); + LLRect new_cursor_rect_doc = getDocRectFromDocIndex(mCursorPos); mScroller->scrollToShowRect(new_cursor_rect_doc, old_cursor_rect); - //llassert_always(getLocalRectFromDocIndex(mCursorPos).mBottom == old_cursor_rect.mBottom); } else { // keep first line of text visible - LLRect new_first_char_rect = getLocalRectFromDocIndex(mScrollIndex); - new_first_char_rect.translate(visible_content_rect.mLeft, visible_content_rect.mBottom); + LLRect new_first_char_rect = getDocRectFromDocIndex(mScrollIndex); mScroller->scrollToShowRect(new_first_char_rect, first_char_rect); - //llassert_always(getLocalRectFromDocIndex(mScrollIndex).mBottom == first_char_rect.mBottom); } } @@ -1464,14 +1487,16 @@ void LLTextBase::setText(const LLStringExplicit &utf8str ,const LLStyle::Params& clearSegments(); // createDefaultSegment(); - startOfDoc(); deselect(); // append the new text (supports Url linking) std::string text(utf8str); LLStringUtil::removeCRLF(text); + // appendText modifies mCursorPos... appendText(text, false, input_params); + // ...so move cursor to top after appending text + startOfDoc(); onValueChange(0, getLength()); } @@ -2065,22 +2090,22 @@ void LLTextBase::updateRects() mContentsRect.unionWith(line_iter->mRect); } - S32 delta_pos_x = -mContentsRect.mLeft; mContentsRect.mTop += mVPad; S32 delta_pos = -mContentsRect.mBottom; // move line segments to fit new document rect for (line_list_t::iterator it = mLineInfoList.begin(); it != mLineInfoList.end(); ++it) { - it->mRect.translate(delta_pos_x, delta_pos); + it->mRect.translate(0, delta_pos); } - mContentsRect.translate(delta_pos_x, delta_pos); + mContentsRect.translate(0, delta_pos); } // update document container dimensions according to text contents LLRect doc_rect = mContentsRect; // use old mTextRect constraint document to width of viewable region - doc_rect.mRight = doc_rect.mLeft + mTextRect.getWidth(); + doc_rect.mLeft = 0; + doc_rect.mRight = mTextRect.getWidth(); mDocumentView->setShape(doc_rect); @@ -2281,7 +2306,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele LLFontGL::LEFT, LLFontGL::TOP, 0, LLFontGL::NO_SHADOW, - length, rect.mRight, + length, rect.getWidth(), &right_x, mEditor.getUseEllipses()); } @@ -2298,7 +2323,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele LLFontGL::LEFT, LLFontGL::TOP, 0, mStyle->getShadowType(), - length, rect.mRight, + length, rect.getWidth(), &right_x, mEditor.getUseEllipses()); } @@ -2380,12 +2405,20 @@ void LLNormalTextSegment::setToolTip(const std::string& tooltip) bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const { - LLWString text = mEditor.getWText(); - height = mFontHeight; - width = mStyle->getFont()->getWidth(text.c_str(), mStart + first_char, num_chars); - // if last character is a newline, then return true, forcing line break - llwchar last_char = text[mStart + first_char + num_chars - 1]; + bool force_newline = false; + if (num_chars > 0) + { + LLWString text = mEditor.getWText(); + width = mStyle->getFont()->getWidth(text.c_str(), mStart + first_char, num_chars); + // if last character is a newline, then return true, forcing line break + llwchar last_char = text[mStart + first_char + num_chars - 1]; + force_newline = (last_char == '\n'); + } + else + { + width = 0; + } LLUIImagePtr image = mStyle->getImage(); if( image.notNull()) @@ -2394,7 +2427,7 @@ bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& widt height = llmax(height, image->getHeight()); } - return num_chars >= 1 && last_char == '\n'; + return force_newline; } S32 LLNormalTextSegment::getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index c376a73615..c60b040655 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -84,11 +84,13 @@ public: wrap, use_ellipses, allow_html, - parse_highlights; + parse_highlights, + clip_partial; Optional<S32> v_pad, h_pad; + Optional<LineSpacingParams> line_spacing; @@ -347,6 +349,7 @@ protected: bool mTrackEnd; // if true, keeps scroll position at end of document during resize bool mReadOnly; bool mBGVisible; // render background? + bool mClipPartial; // false if we show lines that are partially inside bounding rect S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes // support widgets diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index 4c4123cf45..0bd0ab59fb 100644 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -31,7 +31,10 @@ */ #include "linden_common.h" + +#define LLTEXTBOX_CPP #include "lltextbox.h" + #include "lluictrlfactory.h" #include "llfocusmgr.h" #include "llwindow.h" @@ -40,6 +43,10 @@ static LLDefaultChildRegistry::Register<LLTextBox> r("text"); +// Compiler optimization, generate extern template +template class LLTextBox* LLView::getChild<class LLTextBox>( + const std::string& name, BOOL recurse) const; + LLTextBox::LLTextBox(const LLTextBox::Params& p) : LLTextBase(p), mClickedCallback(NULL) diff --git a/indra/llui/lltextbox.h b/indra/llui/lltextbox.h index 01b4bfa5ed..3a045534d3 100644 --- a/indra/llui/lltextbox.h +++ b/indra/llui/lltextbox.h @@ -79,4 +79,10 @@ protected: callback_t mClickedCallback; }; +// Build time optimization, generate once in .cpp file +#ifndef LLTEXTBOX_CPP +extern template class LLTextBox* LLView::getChild<class LLTextBox>( + const std::string& name, BOOL recurse) const; +#endif + #endif diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 3f4ef24f82..e68affc36c 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1,6 +1,5 @@ /** * @file lltexteditor.cpp - * @brief LLTextEditor base class * * $LicenseInfo:firstyear=2001&license=viewergpl$ * @@ -34,6 +33,7 @@ #include "linden_common.h" +#define LLTEXTEDITOR_CPP #include "lltexteditor.h" #include "llfontfreetype.h" // for LLFontFreetype::FIRST_CHAR @@ -73,6 +73,10 @@ // static LLDefaultChildRegistry::Register<LLTextEditor> r("simple_text_editor"); +// Compiler optimization, generate extern template +template class LLTextEditor* LLView::getChild<class LLTextEditor>( + const std::string& name, BOOL recurse) const; + // // Constants // @@ -2158,7 +2162,7 @@ void LLTextEditor::drawLineNumbers() return; } - S32 cursor_line = getLineNumFromDocIndex(mCursorPos); + S32 cursor_line = mLineInfoList[getLineNumFromDocIndex(mCursorPos)].mLineNum; if (mShowLineNumbers) { diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index fb014b86bf..043dda8fa6 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -334,5 +334,10 @@ private: LLContextMenu* mContextMenu; }; // end class LLTextEditor +// Build time optimization, generate once in .cpp file +#ifndef LLTEXTEDITOR_CPP +extern template class LLTextEditor* LLView::getChild<class LLTextEditor>( + const std::string& name, BOOL recurse) const; +#endif #endif // LL_TEXTEDITOR_ diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index 959313a5b6..01c7a81309 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -228,7 +228,7 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) { LLButton::Params p_button; p_button.name(std::string("play_media")); - p_button.label(""); // provid label but set to empty so name does not overwrite it -angela + p_button.label(""); // provide label but set to empty so name does not overwrite it -angela TOOLTIP_PLAYBUTTON_SIZE = 16; LLRect button_rect; button_rect.setOriginAndSize((mPadding +TOOLTIP_ICON_SIZE+ mPadding ), mPadding, TOOLTIP_ICON_SIZE, TOOLTIP_ICON_SIZE); @@ -300,9 +300,8 @@ void LLToolTip::initFromParams(const LLToolTip::Params& p) mTextBox->setText(p.message()); } - LLRect text_contents_rect = mTextBox->getContentsRect(); - S32 text_width = llmin(p.max_width(), text_contents_rect.getWidth()); - S32 text_height = text_contents_rect.getHeight(); + S32 text_width = llmin(p.max_width(), mTextBox->getTextPixelWidth()); + S32 text_height = mTextBox->getTextPixelHeight(); mTextBox->reshape(text_width, text_height); // reshape tooltip panel to fit text box diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index a30d5b4651..706712ec5e 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -31,15 +31,43 @@ * $/LicenseInfo$ */ -//#include "llviewerprecompiledheaders.h" #include "linden_common.h" + +#define LLUICTRL_CPP #include "lluictrl.h" + #include "llfocusmgr.h" #include "llpanel.h" #include "lluictrlfactory.h" static LLDefaultChildRegistry::Register<LLUICtrl> r("ui_ctrl"); +// Compiler optimization, generate extern template +template class LLUICtrl* LLView::getChild<class LLUICtrl>( + const std::string& name, BOOL recurse) const; + +LLUICtrl::CallbackParam::CallbackParam() +: name("name"), + function_name("function"), + parameter("parameter"), + control_name("control") // Shortcut to control -> "control_name" for backwards compatability +{ + addSynonym(parameter, "userdata"); +} + +LLUICtrl::EnableControls::EnableControls() +: enabled("enabled_control"), + disabled("disabled_control") +{} + +LLUICtrl::ControlVisibility::ControlVisibility() +: visible("visibility_control"), + invisible("invisibility_control") +{ + addSynonym(visible, "visiblity_control"); + addSynonym(invisible, "invisiblity_control"); +} + LLUICtrl::Params::Params() : tab_stop("tab_stop", true), chrome("chrome", false), diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index aef1bcd519..b20ff5d798 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -75,14 +75,7 @@ public: Optional<std::string> control_name; - CallbackParam() - : name("name"), - function_name("function"), - parameter("parameter"), - control_name("control") // Shortcut to control -> "control_name" for backwards compatability - { - addSynonym(parameter, "userdata"); - } + CallbackParam(); }; struct CommitCallbackParam : public LLInitParam::Block<CommitCallbackParam, CallbackParam > @@ -105,23 +98,14 @@ public: Alternative<std::string> enabled; Alternative<std::string> disabled; - EnableControls() - : enabled("enabled_control"), - disabled("disabled_control") - {} + EnableControls(); }; struct ControlVisibility : public LLInitParam::Choice<ControlVisibility> { Alternative<std::string> visible; Alternative<std::string> invisible; - ControlVisibility() - : visible("visibility_control"), - invisible("invisibility_control") - { - addSynonym(visible, "visiblity_control"); - addSynonym(invisible, "invisiblity_control"); - } + ControlVisibility(); }; struct Params : public LLInitParam::Block<Params, LLView::Params> { @@ -328,4 +312,10 @@ private: class DefaultTabGroupFirstSorter; }; +// Build time optimization, generate once in .cpp file +#ifndef LLUICTRL_CPP +extern template class LLUICtrl* LLView::getChild<class LLUICtrl>( + const std::string& name, BOOL recurse) const; +#endif + #endif // LL_LLUICTRL_H diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index e5647970f1..f9e134e1e5 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -32,6 +32,7 @@ #include "linden_common.h" +#define LLUICTRLFACTORY_CPP #include "lluictrlfactory.h" #include "llxmlnode.h" @@ -75,6 +76,9 @@ public: static LLDefaultChildRegistry::Register<LLUICtrlLocate> r1("locate"); +// Build time optimization, generate this once in .cpp file +template class LLUICtrlFactory* LLSingleton<class LLUICtrlFactory>::getInstance(); + //----------------------------------------------------------------------------- // LLUICtrlFactory() //----------------------------------------------------------------------------- diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 8a9c9e23c1..55d7d745eb 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -108,6 +108,11 @@ extern LLFastTimer::DeclareTimer FTM_WIDGET_SETUP; extern LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION; extern LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS; +// Build time optimization, generate this once in .cpp file +#ifndef LLUICTRLFACTORY_CPP +extern template class LLUICtrlFactory* LLSingleton<class LLUICtrlFactory>::getInstance(); +#endif + class LLUICtrlFactory : public LLSingleton<LLUICtrlFactory> { private: diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index dba24ee165..6f8455774d 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -33,6 +33,7 @@ #include "linden_common.h" +#define LLVIEW_CPP #include "llview.h" #include <cassert> @@ -76,8 +77,17 @@ std::vector<LLViewDrawContext*> LLViewDrawContext::sDrawContextStack; BOOL LLView::sIsDrawing = FALSE; #endif +// Compiler optimization, generate extern template +template class LLView* LLView::getChild<class LLView>( + const std::string& name, BOOL recurse) const; + static LLDefaultChildRegistry::Register<LLView> r("view"); +LLView::Follows::Follows() +: string(""), + flags("flags", FOLLOWS_LEFT | FOLLOWS_TOP) +{} + LLView::Params::Params() : name("name", std::string("unnamed")), enabled("enabled", true), @@ -2523,6 +2533,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) else { p.rect.left = p.rect.left + parent_rect.getWidth()/2 - p.rect.width/2; + p.rect.right.setProvided(false); // recalculate the right } } else @@ -2543,6 +2554,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) else { p.rect.bottom = p.rect.bottom + parent_rect.getHeight()/2 - p.rect.height/2; + p.rect.top.setProvided(false); // recalculate the top } } else diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 2607120e17..c611e4c85f 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -111,10 +111,7 @@ public: Alternative<std::string> string; Alternative<U32> flags; - Follows() - : string(""), - flags("flags", FOLLOWS_LEFT | FOLLOWS_TOP) - {} + Follows(); }; struct Params : public LLInitParam::Block<Params> @@ -517,6 +514,8 @@ public: virtual void notifyParent(const LLSD& info); virtual void notifyChildren(const LLSD& info); + virtual void notify(const LLSD& info) {}; + static const LLViewDrawContext& getDrawContext(); protected: @@ -659,4 +658,11 @@ template <class T> T* LLView::getChild(const std::string& name, BOOL recurse) co return result; } +// Compiler optimization - don't generate these specializations inline, +// require explicit specialization. See llbutton.cpp for an example. +#ifndef LLVIEW_CPP +extern template class LLView* LLView::getChild<class LLView>( + const std::string& name, BOOL recurse) const; +#endif + #endif //LL_LLVIEW_H diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index af9a30cb25..86bbb0bcf8 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1441,7 +1441,7 @@ static void fixOrigin(void) ::GetPortBounds(port, &portrect); if((portrect.left != 0) || (portrect.top != 0)) { - // Mozilla sometimes changes our port origin. Fuckers. + // Mozilla sometimes changes our port origin. ::SetOrigin(0,0); } } diff --git a/indra/llxuixml/lltrans.cpp b/indra/llxuixml/lltrans.cpp index 4c800a502d..d6f17dbb08 100644 --- a/indra/llxuixml/lltrans.cpp +++ b/indra/llxuixml/lltrans.cpp @@ -162,7 +162,7 @@ std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil:: args["STRING_NAME"] = xml_desc; LL_WARNS_ONCE("configuration") << "Missing String in strings.xml: [" << xml_desc << "]" << LL_ENDL; - //LLNotifications::instance().add("MissingString", args); // *TODO: resurrect + //LLNotificationsUtil::add("MissingString", args); // *TODO: resurrect //return xml_desc; return "MissingString("+xml_desc+")"; @@ -189,7 +189,7 @@ bool LLTrans::findString(std::string &result, const std::string &xml_desc, const LLSD args; args["STRING_NAME"] = xml_desc; LL_WARNS_ONCE("configuration") << "Missing String in strings.xml: [" << xml_desc << "]" << LL_ENDL; - //LLNotifications::instance().add("MissingString", args); + //LLNotificationsUtil::add("MissingString", args); return false; } diff --git a/indra/media_plugins/base/media_plugin_base.cpp b/indra/media_plugins/base/media_plugin_base.cpp index 6acac07423..658783e064 100644 --- a/indra/media_plugins/base/media_plugin_base.cpp +++ b/indra/media_plugins/base/media_plugin_base.cpp @@ -2,6 +2,9 @@ * @file media_plugin_base.cpp * @brief Media plugin base class for LLMedia API plugin system * + * All plugins should be a subclass of MediaPluginBase. + * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +30,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #include "linden_common.h" @@ -35,7 +39,10 @@ // TODO: Make sure that the only symbol exported from this library is LLPluginInitEntryPoint //////////////////////////////////////////////////////////////////////////////// -// +/// Media plugin constructor. +/// +/// @param[in] host_send_func Function for sending messages from plugin to plugin loader shell +/// @param[in] host_user_data Message data for messages from plugin to plugin loader shell MediaPluginBase::MediaPluginBase( LLPluginInstance::sendMessageFunction host_send_func, @@ -53,6 +60,12 @@ MediaPluginBase::MediaPluginBase( mStatus = STATUS_NONE; } +/** + * Converts current media status enum value into string (STATUS_LOADING into "loading", etc.) + * + * @return Media status string ("loading", "playing", "paused", etc) + * + */ std::string MediaPluginBase::statusString() { std::string result; @@ -73,6 +86,12 @@ std::string MediaPluginBase::statusString() return result; } +/** + * Set media status. + * + * @param[in] status Media status (STATUS_LOADING, STATUS_PLAYING, STATUS_PAUSED, etc) + * + */ void MediaPluginBase::setStatus(EStatus status) { if(mStatus != status) @@ -83,6 +102,13 @@ void MediaPluginBase::setStatus(EStatus status) } +/** + * Receive message from plugin loader shell. + * + * @param[in] message_string Message string + * @param[in] user_data Message data + * + */ void MediaPluginBase::staticReceiveMessage(const char *message_string, void **user_data) { MediaPluginBase *self = (MediaPluginBase*)*user_data; @@ -100,12 +126,27 @@ void MediaPluginBase::staticReceiveMessage(const char *message_string, void **us } } +/** + * Send message to plugin loader shell. + * + * @param[in] message Message data being sent to plugin loader shell + * + */ void MediaPluginBase::sendMessage(const LLPluginMessage &message) { std::string output = message.generate(); mHostSendFunction(output.c_str(), &mHostUserData); } +/** + * Notifies plugin loader shell that part of display area needs to be redrawn. + * + * @param[in] left Left X coordinate of area to redraw (0,0 is at top left corner) + * @param[in] top Top Y coordinate of area to redraw (0,0 is at top left corner) + * @param[in] right Right X-coordinate of area to redraw (0,0 is at top left corner) + * @param[in] bottom Bottom Y-coordinate of area to redraw (0,0 is at top left corner) + * + */ void MediaPluginBase::setDirty(int left, int top, int right, int bottom) { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "updated"); @@ -118,6 +159,10 @@ void MediaPluginBase::setDirty(int left, int top, int right, int bottom) sendMessage(message); } +/** + * Sends "media_status" message to plugin loader shell ("loading", "playing", "paused", etc.) + * + */ void MediaPluginBase::sendStatus() { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "media_status"); @@ -141,6 +186,17 @@ extern "C" LLSYMEXPORT int LLPluginInitEntryPoint(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data, LLPluginInstance::sendMessageFunction *plugin_send_func, void **plugin_user_data); } +/** + * Plugin initialization and entry point. Establishes communication channel for messages between plugin and plugin loader shell. TODO:DOC - Please check! + * + * @param[in] host_send_func Function for sending messages from plugin to plugin loader shell + * @param[in] host_user_data Message data for messages from plugin to plugin loader shell + * @param[out] plugin_send_func Function for plugin to receive messages from plugin loader shell + * @param[out] plugin_user_data Pointer to plugin instance + * + * @return int, where 0=success + * + */ LLSYMEXPORT int LLPluginInitEntryPoint(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data, LLPluginInstance::sendMessageFunction *plugin_send_func, void **plugin_user_data) { diff --git a/indra/media_plugins/base/media_plugin_base.h b/indra/media_plugins/base/media_plugin_base.h index f1e96335f9..ed4dc0cfa9 100644 --- a/indra/media_plugins/base/media_plugin_base.h +++ b/indra/media_plugins/base/media_plugin_base.h @@ -2,6 +2,7 @@ * @file media_plugin_base.h * @brief Media plugin base class for LLMedia API plugin system * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +28,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #include "linden_common.h" @@ -40,14 +42,17 @@ class MediaPluginBase { public: MediaPluginBase(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data); + /** Media plugin destructor. */ virtual ~MediaPluginBase() {} + /** Handle received message from plugin loader shell. */ virtual void receiveMessage(const char *message_string) = 0; static void staticReceiveMessage(const char *message_string, void **user_data); protected: + /** Plugin status. */ typedef enum { STATUS_NONE, @@ -59,10 +64,13 @@ protected: STATUS_DONE } EStatus; + /** Plugin shared memory. */ class SharedSegmentInfo { public: + /** Shared memory address. */ void *mAddress; + /** Shared memory size. */ size_t mSize; }; @@ -71,42 +79,56 @@ protected: std::string statusString(); void setStatus(EStatus status); - // The quicktime plugin overrides this to add current time and duration to the message... + /// Note: The quicktime plugin overrides this to add current time and duration to the message. virtual void setDirty(int left, int top, int right, int bottom); + /** Map of shared memory names to shared memory. */ typedef std::map<std::string, SharedSegmentInfo> SharedSegmentMap; + /** Function to send message from plugin to plugin loader shell. */ LLPluginInstance::sendMessageFunction mHostSendFunction; + /** Message data being sent to plugin loader shell by mHostSendFunction. */ void *mHostUserData; + /** Flag to delete plugin instance (self). */ bool mDeleteMe; + /** Pixel array to display. TODO:DOC are pixels always 24-bit RGB format, aligned on 32-bit boundary? Also: calling this a pixel array may be misleading since 1 pixel > 1 char. */ unsigned char* mPixels; + /** TODO:DOC what's this for -- does a texture have its own piece of shared memory? updated on size_change_request, cleared on shm_remove */ std::string mTextureSegmentName; + /** Width of plugin display in pixels. */ int mWidth; + /** Height of plugin display in pixels. */ int mHeight; + /** Width of plugin texture. */ int mTextureWidth; + /** Height of plugin texture. */ int mTextureHeight; + /** Pixel depth (pixel size in bytes). */ int mDepth; + /** Current status of plugin. */ EStatus mStatus; + /** Map of shared memory segments. */ SharedSegmentMap mSharedSegments; }; -// The plugin must define this function to create its instance. +/** The plugin <b>must</b> define this function to create its instance. + * It should look something like this: + * @code + * { + * MediaPluginFoo *self = new MediaPluginFoo(host_send_func, host_user_data); + * *plugin_send_func = MediaPluginFoo::staticReceiveMessage; + * *plugin_user_data = (void*)self; + * + * return 0; + * } + * @endcode + */ int init_media_plugin( LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data, LLPluginInstance::sendMessageFunction *plugin_send_func, void **plugin_user_data); -// It should look something like this: -/* -{ - MediaPluginFoo *self = new MediaPluginFoo(host_send_func, host_user_data); - *plugin_send_func = MediaPluginFoo::staticReceiveMessage; - *plugin_user_data = (void*)self; - - return 0; -} -*/ diff --git a/indra/media_plugins/example/media_plugin_example.cpp b/indra/media_plugins/example/media_plugin_example.cpp index 99e0199a29..f5b077fea0 100644 --- a/indra/media_plugins/example/media_plugin_example.cpp +++ b/indra/media_plugins/example/media_plugin_example.cpp @@ -2,6 +2,7 @@ * @file media_plugin_example.cpp * @brief Example plugin for LLMedia API plugin system * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2009, Linden Research, Inc. @@ -27,6 +28,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #include "linden_common.h" diff --git a/indra/media_plugins/gstreamer010/CMakeLists.txt b/indra/media_plugins/gstreamer010/CMakeLists.txt index a9f7938b41..3b73e04786 100644 --- a/indra/media_plugins/gstreamer010/CMakeLists.txt +++ b/indra/media_plugins/gstreamer010/CMakeLists.txt @@ -42,12 +42,12 @@ set(media_plugin_gstreamer010_HEADER_FILES llmediaimplgstreamertriviallogging.h ) -if (${CXX_VERSION} MATCHES "4[23].") +if (${CXX_VERSION_NUMBER} MATCHES "4[23].") # Work around a bad interaction between broken gstreamer headers and # g++ 4.3's increased strictness. set_source_files_properties(llmediaimplgstreamervidplug.cpp PROPERTIES COMPILE_FLAGS -Wno-write-strings) -endif (${CXX_VERSION} MATCHES "4[23].") +endif (${CXX_VERSION_NUMBER} MATCHES "4[23].") add_library(media_plugin_gstreamer010 SHARED diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamer.h b/indra/media_plugins/gstreamer010/llmediaimplgstreamer.h index ef41736c18..48accd3e66 100644 --- a/indra/media_plugins/gstreamer010/llmediaimplgstreamer.h +++ b/indra/media_plugins/gstreamer010/llmediaimplgstreamer.h @@ -3,6 +3,7 @@ * @author Tofu Linden * @brief implementation that supports media playback via GStreamer. * + * @cond * $LicenseInfo:firstyear=2007&license=viewergpl$ * * Copyright (c) 2007-2009, Linden Research, Inc. @@ -29,6 +30,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ // header guard diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp b/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp index cc52232496..52cea46d46 100644 --- a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp +++ b/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp @@ -2,6 +2,7 @@ * @file llmediaimplgstreamer_syms.cpp * @brief dynamic GStreamer symbol-grabbing code * + * @cond * $LicenseInfo:firstyear=2007&license=viewergpl$ * * Copyright (c) 2007-2009, Linden Research, Inc. @@ -28,6 +29,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #if LL_GSTREAMER010_ENABLED diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.h b/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.h index ee7473d6d1..88f100af6e 100644 --- a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.h +++ b/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.h @@ -2,6 +2,7 @@ * @file llmediaimplgstreamer_syms.h * @brief dynamic GStreamer symbol-grabbing code * + * @cond * $LicenseInfo:firstyear=2007&license=viewergpl$ * * Copyright (c) 2007-2009, Linden Research, Inc. @@ -28,6 +29,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #include "linden_common.h" diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h b/indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h index e31d4a3282..2244ccc146 100644 --- a/indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h +++ b/indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h @@ -2,6 +2,7 @@ * @file llmediaimplgstreamertriviallogging.h * @brief minimal logging utilities. * + * @cond * $LicenseInfo:firstyear=2009&license=viewergpl$ * * Copyright (c) 2009, Linden Research, Inc. @@ -28,6 +29,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #ifndef __LLMEDIAIMPLGSTREAMERTRIVIALLOGGING_H__ diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp b/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp index d8ccfaa702..5bb0ef5a99 100644 --- a/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp +++ b/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp @@ -2,6 +2,7 @@ * @file llmediaimplgstreamervidplug.h * @brief Video-consuming static GStreamer plugin for gst-to-LLMediaImpl * + * @cond * $LicenseInfo:firstyear=2007&license=viewergpl$ * * Copyright (c) 2007-2009, Linden Research, Inc. @@ -28,6 +29,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #if LL_GSTREAMER010_ENABLED diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.h b/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.h index f6d55b8758..208523e8d0 100644 --- a/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.h +++ b/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.h @@ -2,6 +2,7 @@ * @file llmediaimplgstreamervidplug.h * @brief Video-consuming static GStreamer plugin for gst-to-LLMediaImpl * + * @cond * $LicenseInfo:firstyear=2007&license=viewergpl$ * * Copyright (c) 2007-2009, Linden Research, Inc. @@ -28,6 +29,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #ifndef __GST_SLVIDEO_H__ diff --git a/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp b/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp index a4c43988ba..d21ff26f83 100644 --- a/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp +++ b/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp @@ -2,6 +2,7 @@ * @file media_plugin_gstreamer010.cpp * @brief GStreamer-0.10 plugin for LLMedia API plugin system * + * @cond * $LicenseInfo:firstyear=2007&license=viewergpl$ * * Copyright (c) 2007, Linden Research, Inc. @@ -27,6 +28,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #include "linden_common.h" diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp index 236f79978d..dbc44c8334 100644 --- a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp +++ b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp @@ -2,6 +2,7 @@ * @file media_plugin_quicktime.cpp * @brief QuickTime plugin for LLMedia API plugin system * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +28,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #include "linden_common.h" diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 09348782a4..25f4c8720a 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -2,6 +2,7 @@ * @file media_plugin_webkit.cpp * @brief Webkit plugin for LLMedia API plugin system * + * @cond * $LicenseInfo:firstyear=2008&license=viewergpl$ * * Copyright (c) 2008, Linden Research, Inc. @@ -27,6 +28,7 @@ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ + * @endcond */ #include "llqtwebkit.h" @@ -495,7 +497,16 @@ private: { // std::cerr << "unicode input, code = 0x" << std::hex << (unsigned long)(wstr[i]) << std::dec << std::endl; - LLQtWebKit::getInstance()->unicodeInput(mBrowserWindowId, wstr[i], modifiers); + if(wstr[i] == 32) + { + // For some reason, the webkit plugin really wants the space bar to come in through the key-event path, not the unicode path. + LLQtWebKit::getInstance()->keyEvent( mBrowserWindowId, LLQtWebKit::KE_KEY_DOWN, 32, modifiers); + LLQtWebKit::getInstance()->keyEvent( mBrowserWindowId, LLQtWebKit::KE_KEY_UP, 32, modifiers); + } + else + { + LLQtWebKit::getInstance()->unicodeInput(mBrowserWindowId, wstr[i], modifiers); + } } checkEditState(); diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 0616122440..23f8b4b9ca 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -94,6 +94,7 @@ set(viewer_SOURCE_FILES llbox.cpp llbreadcrumbview.cpp llcallbacklist.cpp + llcallfloater.cpp llcallingcard.cpp llcapabilitylistener.cpp llcaphttpsender.cpp @@ -191,7 +192,7 @@ set(viewer_SOURCE_FILES llfloatermemleak.cpp llfloatermodelpreview.cpp llfloaternamedesc.cpp - llfloaternearbymedia.cpp + llfloaternearbymedia.cpp llfloaternotificationsconsole.cpp llfloateropenobject.cpp llfloaterparcel.cpp @@ -218,6 +219,7 @@ set(viewer_SOURCE_FILES llfloaterurldisplay.cpp llfloaterurlentry.cpp llfloatervoicedevicesettings.cpp + llfloatervolumepulldown.cpp llfloaterwater.cpp llfloaterwhitelistentry.cpp llfloaterwindlight.cpp @@ -297,6 +299,7 @@ set(viewer_SOURCE_FILES llnetmap.cpp llnotificationalerthandler.cpp llnotificationgrouphandler.cpp + llnotificationhandlerutil.cpp llnotificationmanager.cpp llnotificationofferhandler.cpp llnotificationscripthandler.cpp @@ -319,6 +322,7 @@ set(viewer_SOURCE_FILES llpanelgrouplandmoney.cpp llpanelgroupnotices.cpp llpanelgrouproles.cpp + llpanelhome.cpp llpanelimcontrolpanel.cpp llpanelland.cpp llpanellandaudio.cpp @@ -594,6 +598,7 @@ set(viewer_HEADER_FILES llbox.h llbreadcrumbview.h llcallbacklist.h + llcallfloater.h llcallingcard.h llcapabilitylistener.h llcapabilityprovider.h @@ -817,6 +822,7 @@ set(viewer_HEADER_FILES llpanelgrouplandmoney.h llpanelgroupnotices.h llpanelgrouproles.h + llpanelhome.h llpanelimcontrolpanel.h llpanelland.h llpanellandaudio.h @@ -1117,22 +1123,13 @@ if (WINDOWS) # the .pch file. # All sources added to viewer_SOURCE_FILES # at this point use it. - set_source_files_properties(llviewerprecompiledheaders.cpp - PROPERTIES - COMPILE_FLAGS "/Ycllviewerprecompiledheaders.h" - ) - foreach( src_file ${viewer_SOURCE_FILES} ) - set_source_files_properties( - ${src_file} + if(USE_PRECOMPILED_HEADERS) + set_source_files_properties(llviewerprecompiledheaders.cpp PROPERTIES - COMPILE_FLAGS "/Yullviewerprecompiledheaders.h" - ) - endforeach( src_file ${viewer_SOURCE_FILES} ) - list(APPEND viewer_SOURCE_FILES llviewerprecompiledheaders.cpp) - # llstartup.cpp needs special symbols for audio libraries, so it resets - # COMPILE_FLAGS below. Make sure it maintains precompiled header settings. - set(LLSTARTUP_COMPILE_FLAGS - "${LLSTARTUP_COMPILE_FLAGS} /Yullviewerprecompiledheaders.h") + COMPILE_FLAGS "/Ycllviewerprecompiledheaders.h" + ) + set(viewer_SOURCE_FILES "${viewer_SOURCE_FILES}" llviewerprecompiledheaders.cpp) + endif(USE_PRECOMPILED_HEADERS) # Add resource files to the project. # viewerRes.rc is the only buildable file, but @@ -1385,6 +1382,13 @@ if (WINDOWS) LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO" LINK_FLAGS_RELEASE ${release_flags} ) + if(USE_PRECOMPILED_HEADERS) + set_target_properties( + ${VIEWER_BINARY_NAME} + PROPERTIES + COMPILE_FLAGS "/Yullviewerprecompiledheaders.h" + ) + endif(USE_PRECOMPILED_HEADERS) # sets the 'working directory' for debugging from visual studio. if (NOT UNATTENDED) @@ -1661,48 +1665,61 @@ if (INSTALL) include(${CMAKE_CURRENT_SOURCE_DIR}/ViewerInstall.cmake) endif (INSTALL) -# To add a viewer unit test, just add the test .cpp file below -# This creates a separate test project per file listed. -include(LLAddBuildTest) -SET(viewer_TEST_SOURCE_FILES - llagentaccess.cpp - lldateutil.cpp - llmediadataclient.cpp - llviewerhelputil.cpp - lllogininstance.cpp - ) -set_source_files_properties( - ${viewer_TEST_SOURCE_FILES} - PROPERTIES - LL_TEST_ADDITIONAL_SOURCE_FILES llviewerprecompiledheaders.cpp - ) -LL_ADD_PROJECT_UNIT_TESTS(${VIEWER_BINARY_NAME} "${viewer_TEST_SOURCE_FILES}") - -#set(TEST_DEBUG on) -set(test_sources llcapabilitylistener.cpp llviewerprecompiledheaders.cpp) -set(test_libs - ${LLMESSAGE_LIBRARIES} - ${WINDOWS_LIBRARIES} - ${LLVFS_LIBRARIES} - ${LLMATH_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ${GOOGLEMOCK_LIBRARIES} +if (LL_TESTS) + # To add a viewer unit test, just add the test .cpp file below + # This creates a separate test project per file listed. + include(LLAddBuildTest) + SET(viewer_TEST_SOURCE_FILES + llagentaccess.cpp + lldateutil.cpp + llmediadataclient.cpp + llviewerhelputil.cpp + lllogininstance.cpp ) + ################################################## + # DISABLING PRECOMPILED HEADERS USAGE FOR TESTS + ################################################## + # if(USE_PRECOMPILED_HEADERS) + # set_source_files_properties( + # ${viewer_TEST_SOURCE_FILES} + # PROPERTIES + # LL_TEST_ADDITIONAL_SOURCE_FILES llviewerprecompiledheaders.cpp + # ) + # endif(USE_PRECOMPILED_HEADERS) + LL_ADD_PROJECT_UNIT_TESTS(${VIEWER_BINARY_NAME} "${viewer_TEST_SOURCE_FILES}") + + #set(TEST_DEBUG on) + set(test_sources llcapabilitylistener.cpp) + ################################################## + # DISABLING PRECOMPILED HEADERS USAGE FOR TESTS + ################################################## + # if(USE_PRECOMPILED_HEADERS) + # set(test_sources "${test_sources}" llviewerprecompiledheaders.cpp) + # endif(USE_PRECOMPILED_HEADERS) + set(test_libs + ${LLMESSAGE_LIBRARIES} + ${WINDOWS_LIBRARIES} + ${LLVFS_LIBRARIES} + ${LLMATH_LIBRARIES} + ${LLCOMMON_LIBRARIES} + ${GOOGLEMOCK_LIBRARIES} + ) -LL_ADD_INTEGRATION_TEST(llcapabilitylistener - "${test_sources}" - "${test_libs}" - ${PYTHON_EXECUTABLE} - "${CMAKE_SOURCE_DIR}/llmessage/tests/test_llsdmessage_peer.py" - ) + LL_ADD_INTEGRATION_TEST(llcapabilitylistener + "${test_sources}" + "${test_libs}" + ${PYTHON_EXECUTABLE} + "${CMAKE_SOURCE_DIR}/llmessage/tests/test_llsdmessage_peer.py" + ) -#ADD_VIEWER_BUILD_TEST(llmemoryview viewer) -#ADD_VIEWER_BUILD_TEST(llagentaccess viewer) -#ADD_VIEWER_BUILD_TEST(llworldmap viewer) -#ADD_VIEWER_BUILD_TEST(llworldmipmap viewer) -#ADD_VIEWER_BUILD_TEST(lltextureinfo viewer) -#ADD_VIEWER_BUILD_TEST(lltextureinfodetails viewer) -#ADD_VIEWER_BUILD_TEST(lltexturestatsuploader viewer) + #ADD_VIEWER_BUILD_TEST(llmemoryview viewer) + #ADD_VIEWER_BUILD_TEST(llagentaccess viewer) + #ADD_VIEWER_BUILD_TEST(llworldmap viewer) + #ADD_VIEWER_BUILD_TEST(llworldmipmap viewer) + #ADD_VIEWER_BUILD_TEST(lltextureinfo viewer) + #ADD_VIEWER_BUILD_TEST(lltextureinfodetails viewer) + #ADD_VIEWER_BUILD_TEST(lltexturestatsuploader viewer) +endif (LL_TESTS) # Don't do these for DARWIN or LINUX here -- they're taken care of by viewer_manifest.py diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index ec80d2d014..d7bb64ce8a 100644 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -34,7 +34,6 @@ </array> <key>classes</key> <array> - <string>LLBottomTray</string> </array> <key>files</key> <array> diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c2270901a6..4ed2927ce6 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -386,17 +386,6 @@ <key>Value</key> <integer>0</integer> </map> - <key>AutoPlayMedia</key> - <map> - <key>Comment</key> - <string>Allow media objects to automatically play or navigate?</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> <key>AutoSnapshot</key> <map> <key>Comment</key> @@ -1385,6 +1374,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>ChatWindow</key> + <map> + <key>Comment</key> + <string>Show chat in multiple windows(by default) or in one multi-tabbed window(requires restart)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>0</integer> + </map> <key>CheesyBeacon</key> <map> <key>Comment</key> @@ -3706,7 +3706,18 @@ <key>Type</key> <string>F32</string> <key>Value</key> - <real>0.15</real> + <real>0.5</real> + </map> + <key>InspectorShowTime</key> + <map> + <key>Comment</key> + <string>Stay timing for inspectors</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>3.0</real> </map> <key>InstallLanguage</key> <map> @@ -7979,7 +7990,7 @@ <key>ShowPGSearchAll</key> <map> <key>Comment</key> - <string>Display results of search All that are flagged as PG</string> + <string>Display results of search All that are flagged as general</string> <key>Persist</key> <integer>1</integer> <key>HideFromEditor</key> @@ -7992,7 +8003,7 @@ <key>ShowMatureSearchAll</key> <map> <key>Comment</key> - <string>Display results of search All that are flagged as mature</string> + <string>Display results of search All that are flagged as moderate</string> <key>Persist</key> <integer>1</integer> <key>HideFromEditor</key> @@ -8018,7 +8029,7 @@ <key>ShowPGGroups</key> <map> <key>Comment</key> - <string>Display results of find groups that are flagged as PG</string> + <string>Display results of find groups that are flagged as general</string> <key>Persist</key> <integer>1</integer> <key>HideFromEditor</key> @@ -8031,7 +8042,7 @@ <key>ShowMatureGroups</key> <map> <key>Comment</key> - <string>Display results of find groups that are flagged as mature</string> + <string>Display results of find groups that are flagged as moderate</string> <key>Persist</key> <integer>1</integer> <key>HideFromEditor</key> @@ -8057,7 +8068,7 @@ <key>ShowPGClassifieds</key> <map> <key>Comment</key> - <string>Display results of find classifieds that are flagged as PG</string> + <string>Display results of find classifieds that are flagged as general</string> <key>Persist</key> <integer>1</integer> <key>HideFromEditor</key> @@ -8070,7 +8081,7 @@ <key>ShowMatureClassifieds</key> <map> <key>Comment</key> - <string>Display results of find classifieds that are flagged as mature</string> + <string>Display results of find classifieds that are flagged as moderate</string> <key>Persist</key> <integer>1</integer> <key>HideFromEditor</key> @@ -8096,7 +8107,7 @@ <key>ShowPGEvents</key> <map> <key>Comment</key> - <string>Display results of find events that are flagged as PG</string> + <string>Display results of find events that are flagged as general</string> <key>Persist</key> <integer>1</integer> <key>HideFromEditor</key> @@ -8109,7 +8120,7 @@ <key>ShowMatureEvents</key> <map> <key>Comment</key> - <string>Display results of find events that are flagged as mature</string> + <string>Display results of find events that are flagged as moderate</string> <key>Persist</key> <integer>1</integer> <key>HideFromEditor</key> @@ -8135,7 +8146,7 @@ <key>ShowPGLand</key> <map> <key>Comment</key> - <string>Display results of find land sales that are flagged as PG</string> + <string>Display results of find land sales that are flagged as general</string> <key>Persist</key> <integer>1</integer> <key>HideFromEditor</key> @@ -8148,7 +8159,7 @@ <key>ShowMatureLand</key> <map> <key>Comment</key> - <string>Display results of find land sales that are flagged as mature</string> + <string>Display results of find land sales that are flagged as moderate</string> <key>Persist</key> <integer>1</integer> <key>HideFromEditor</key> @@ -8174,7 +8185,7 @@ <key>ShowPGSims</key> <map> <key>Comment</key> - <string>Display results of find places or find popular that are in PG sims</string> + <string>Display results of find places or find popular that are in general sims</string> <key>Persist</key> <integer>1</integer> <key>HideFromEditor</key> @@ -8187,7 +8198,7 @@ <key>ShowMatureSims</key> <map> <key>Comment</key> - <string>Display results of find places or find popular that are in mature sims</string> + <string>Display results of find places or find popular that are in moderate sims</string> <key>Persist</key> <integer>1</integer> <key>HideFromEditor</key> @@ -9263,17 +9274,6 @@ <key>Value</key> <integer>2</integer> </map> - <key>UILineEditorHPad</key> - <map> - <key>Comment</key> - <string>UI Line Editor Horizontal Pad</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>2</integer> - </map> <key>UILineEditorVPad</key> <map> <key>Comment</key> @@ -9283,7 +9283,7 @@ <key>Type</key> <string>S32</string> <key>Value</key> - <integer>3</integer> + <integer>4</integer> </map> <key>UIMaxComboWidth</key> <map> @@ -9745,7 +9745,7 @@ <key>Type</key> <string>S32</string> <key>Value</key> - <integer>8</integer> + <integer>11</integer> </map> <key>UISpinctrlBtnWidth</key> <map> diff --git a/indra/newview/installers/darwin/firstlook-dmg/_DS_Store b/indra/newview/installers/darwin/firstlook-dmg/_DS_Store Binary files differindex 408a4d4992..9d9fd897e7 100644 --- a/indra/newview/installers/darwin/firstlook-dmg/_DS_Store +++ b/indra/newview/installers/darwin/firstlook-dmg/_DS_Store diff --git a/indra/newview/installers/darwin/publicnightly-dmg/_DS_Store b/indra/newview/installers/darwin/publicnightly-dmg/_DS_Store Binary files differindex b901e46b65..9d9fd897e7 100644 --- a/indra/newview/installers/darwin/publicnightly-dmg/_DS_Store +++ b/indra/newview/installers/darwin/publicnightly-dmg/_DS_Store diff --git a/indra/newview/installers/darwin/release-dmg/_DS_Store b/indra/newview/installers/darwin/release-dmg/_DS_Store Binary files differindex 2c179b11a4..9d9fd897e7 100644 --- a/indra/newview/installers/darwin/release-dmg/_DS_Store +++ b/indra/newview/installers/darwin/release-dmg/_DS_Store diff --git a/indra/newview/installers/darwin/releasecandidate-dmg/_DS_Store b/indra/newview/installers/darwin/releasecandidate-dmg/_DS_Store Binary files differindex 309c8adaaa..9d9fd897e7 100644 --- a/indra/newview/installers/darwin/releasecandidate-dmg/_DS_Store +++ b/indra/newview/installers/darwin/releasecandidate-dmg/_DS_Store diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 2644235114..2b582c90f0 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -58,6 +58,7 @@ #include "llmoveview.h" #include "llnavigationbar.h" // to show/hide navigation bar when changing mouse look state #include "llnearbychatbar.h" +#include "llnotificationsutil.h" #include "llparcel.h" #include "llsdutil.h" #include "llsidetray.h" @@ -2304,11 +2305,11 @@ void LLAgent::stopAutoPilot(BOOL user_cancel) if (user_cancel && !mAutoPilotBehaviorName.empty()) { if (mAutoPilotBehaviorName == "Sit") - LLNotifications::instance().add("CancelledSit"); + LLNotificationsUtil::add("CancelledSit"); else if (mAutoPilotBehaviorName == "Attach") - LLNotifications::instance().add("CancelledAttach"); + LLNotificationsUtil::add("CancelledAttach"); else - LLNotifications::instance().add("Cancelled"); + LLNotificationsUtil::add("Cancelled"); } } } diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 475f34dc2b..3114a37ada 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -37,10 +37,10 @@ #include "llcallbacklist.h" #include "llfloatercustomize.h" -#include "llfloaterinventory.h" #include "llinventorybridge.h" #include "llinventoryobserver.h" #include "llinventorypanel.h" +#include "llnotificationsutil.h" #include "llnotify.h" #include "llviewerregion.h" #include "llvoavatarself.h" @@ -49,6 +49,10 @@ #include "llgesturemgr.h" #include "llappearancemgr.h" #include "lltexlayer.h" +#include "llsidetray.h" +#include "llpaneloutfitsinventory.h" +#include "llfolderview.h" +#include "llaccordionctrltab.h" #include <boost/scoped_ptr.hpp> @@ -408,7 +412,7 @@ void LLAgentWearables::saveWearable(const EWearableType type, const U32 index, B return; } - gAgent.getAvatarObject()->wearableUpdated( type ); + gAgent.getAvatarObject()->wearableUpdated( type, TRUE ); if (send_update) { @@ -698,7 +702,8 @@ U32 LLAgentWearables::pushWearable(const EWearableType type, LLWearable *wearabl void LLAgentWearables::wearableUpdated(LLWearable *wearable) { - mAvatarObject->wearableUpdated(wearable->getType()); + mAvatarObject->wearableUpdated(wearable->getType(), TRUE); + wearable->refreshName(); wearable->setLabelUpdated(); // Hack pt 2. If the wearable we just loaded has definition version 24, @@ -739,7 +744,7 @@ void LLAgentWearables::popWearable(const EWearableType type, U32 index) if (wearable) { mWearableDatas[type].erase(mWearableDatas[type].begin() + index); - mAvatarObject->wearableUpdated(wearable->getType()); + mAvatarObject->wearableUpdated(wearable->getType(), TRUE); wearable->setLabelUpdated(); } } @@ -1017,7 +1022,7 @@ void LLAgentWearables::onInitialWearableAssetArrived(LLWearable* wearable, void* void LLAgentWearables::recoverMissingWearable(const EWearableType type, U32 index) { // Try to recover by replacing missing wearable with a new one. - LLNotifications::instance().add("ReplacedMissingWearable"); + LLNotificationsUtil::add("ReplacedMissingWearable"); lldebugs << "Wearable " << LLWearableDictionary::getTypeLabel(type) << " could not be downloaded. Replaced inventory item with default wearable." << llendl; LLWearable* new_wearable = LLWearableList::instance().createNewWearable(type); @@ -1295,6 +1300,41 @@ void LLAgentWearables::makeNewOutfit(const std::string& new_folder_name, } } +class LLAutoRenameFolder: public LLInventoryCallback +{ +public: + LLAutoRenameFolder(LLUUID& folder_id): + mFolderID(folder_id) + { + } + + virtual ~LLAutoRenameFolder() + { + LLSD key; + LLSideTray::getInstance()->showPanel("panel_outfits_inventory", key); + LLPanelOutfitsInventory *outfit_panel = + dynamic_cast<LLPanelOutfitsInventory*>(LLSideTray::getInstance()->getPanel("panel_outfits_inventory")); + if (outfit_panel) + { + outfit_panel->getRootFolder()->clearSelection(); + outfit_panel->getRootFolder()->setSelectionByID(mFolderID, TRUE); + outfit_panel->getRootFolder()->setNeedsAutoRename(TRUE); + } + LLAccordionCtrlTab* tab_outfits = outfit_panel ? outfit_panel->findChild<LLAccordionCtrlTab>("tab_outfits") : 0; + if (tab_outfits && !tab_outfits->getDisplayChildren()) + { + tab_outfits->changeOpenClose(tab_outfits->getDisplayChildren()); + } + } + + virtual void fire(const LLUUID&) + { + } + +private: + LLUUID mFolderID; +}; + LLUUID LLAgentWearables::makeNewOutfitLinks(const std::string& new_folder_name) { if (mAvatarObject.isNull()) @@ -1309,17 +1349,9 @@ LLUUID LLAgentWearables::makeNewOutfitLinks(const std::string& new_folder_name) LLFolderType::FT_OUTFIT, new_folder_name); - LLAppearanceManager::instance().shallowCopyCategory(LLAppearanceManager::instance().getCOF(),folder_id, NULL); + LLPointer<LLInventoryCallback> cb = new LLAutoRenameFolder(folder_id); + LLAppearanceManager::instance().shallowCopyCategory(LLAppearanceManager::instance().getCOF(),folder_id, cb); -#if 0 // BAP - fix to go into rename state automatically after outfit is created. - LLViewerInventoryCategory *parent_category = gInventory.getCategory(parent_id); - if (parent_category) - { - parent_category->setSelectionByID(folder_id,TRUE); - parent_category->setNeedsAutoRename(TRUE); - } -#endif - return folder_id; } @@ -1329,10 +1361,10 @@ void LLAgentWearables::makeNewOutfitDone(S32 type, U32 index) // Open the inventory and select the first item we added. if (first_item_id.notNull()) { - LLFloaterInventory* view = LLFloaterInventory::getActiveInventory(); - if (view) + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); + if (active_panel) { - view->getPanel()->setSelection(first_item_id, TAKE_FOCUS_NO); + active_panel->setSelection(first_item_id, TAKE_FOCUS_NO); } } } @@ -1386,7 +1418,7 @@ void LLAgentWearables::removeWearable(const EWearableType type, bool do_remove_a LLSD payload; payload["wearable_type"] = (S32)type; // Bring up view-modal dialog: Save changes? Yes, No, Cancel - LLNotifications::instance().add("WearableSave", LLSD(), payload, &LLAgentWearables::onRemoveWearableDialog); + LLNotificationsUtil::add("WearableSave", LLSD(), payload, &LLAgentWearables::onRemoveWearableDialog); return; } else @@ -1403,7 +1435,7 @@ void LLAgentWearables::removeWearable(const EWearableType type, bool do_remove_a // static bool LLAgentWearables::onRemoveWearableDialog(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); EWearableType type = (EWearableType)notification["payload"]["wearable_type"].asInteger(); switch(option) { @@ -1608,7 +1640,7 @@ void LLAgentWearables::setWearableItem(LLInventoryItem* new_item, LLWearable* ne // Bring up modal dialog: Save changes? Yes, No, Cancel LLSD payload; payload["item_id"] = new_item->getUUID(); - LLNotifications::instance().add("WearableSave", LLSD(), payload, boost::bind(onSetWearableDialog, _1, _2, new_wearable)); + LLNotificationsUtil::add("WearableSave", LLSD(), payload, boost::bind(onSetWearableDialog, _1, _2, new_wearable)); return; } } @@ -1620,7 +1652,7 @@ void LLAgentWearables::setWearableItem(LLInventoryItem* new_item, LLWearable* ne // static bool LLAgentWearables::onSetWearableDialog(const LLSD& notification, const LLSD& response, LLWearable* wearable) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLInventoryItem* new_item = gInventory.getItem(notification["payload"]["item_id"].asUUID()); if (!new_item) { diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 6288088210..d91b9d7ea4 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -39,7 +39,7 @@ #include "llgesturemgr.h" #include "llinventorybridge.h" #include "llinventoryobserver.h" -#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llsidepanelappearance.h" #include "llsidetray.h" #include "llvoavatar.h" @@ -512,6 +512,21 @@ void LLAppearanceManager::updateCOF(const LLUUID& category, bool append) { const LLUUID cof = getCOF(); + // Deactivate currently active gestures in the COF, if replacing outfit + if (!append) + { + LLInventoryModel::item_array_t gest_items; + getDescendentsOfAssetType(cof, gest_items, LLAssetType::AT_GESTURE, false); + for(S32 i = 0; i < gest_items.count(); ++i) + { + LLViewerInventoryItem *gest_item = gest_items.get(i); + if ( LLGestureManager::instance().isGestureActive( gest_item->getLinkedUUID()) ) + { + LLGestureManager::instance().deactivateGesture( gest_item->getLinkedUUID() ); + } + } + } + // Collect and filter descendents to determine new COF contents. // - Body parts: always include COF contents as a fallback in case any @@ -637,7 +652,7 @@ void LLAppearanceManager::updateAppearanceFromCOF() if( !wear_items.count() && !obj_items.count() && !gest_items.count()) { - LLNotifications::instance().add("CouldNotPutOnOutfit"); + LLNotificationsUtil::add("CouldNotPutOnOutfit"); return; } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3e10c4b2b0..ddc818172d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -90,6 +90,8 @@ #include "llvolumemgr.h" #include "llnotificationmanager.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" // Third party library includes #include <boost/bind.hpp> @@ -866,7 +868,7 @@ bool LLAppViewer::init() if (LLFeatureManager::getInstance()->getGPUClass() == GPU_CLASS_UNKNOWN) { - LLNotifications::instance().add("UnknownGPU"); + LLNotificationsUtil::add("UnknownGPU"); } if(unsupported) @@ -875,7 +877,7 @@ bool LLAppViewer::init() || gSavedSettings.getBOOL("WarnUnsupportedHardware")) { args["MINSPECS"] = minSpecs; - LLNotifications::instance().add("UnsupportedHardware", args ); + LLNotificationsUtil::add("UnsupportedHardware", args ); } } @@ -897,6 +899,8 @@ bool LLAppViewer::init() loadEventHostModule(gSavedSettings.getS32("QAModeEventHostPort")); } + LLViewerMedia::initClass(); + return true; } @@ -905,6 +909,7 @@ static LLFastTimer::DeclareTimer FTM_SLEEP("Sleep"); static LLFastTimer::DeclareTimer FTM_TEXTURE_CACHE("Texture Cache"); static LLFastTimer::DeclareTimer FTM_DECODE("Image Decode"); static LLFastTimer::DeclareTimer FTM_VFS("VFS Thread"); +static LLFastTimer::DeclareTimer FTM_LFS("LFS Thread"); static LLFastTimer::DeclareTimer FTM_PAUSE_THREADS("Pause Threads"); static LLFastTimer::DeclareTimer FTM_IDLE("Idle"); static LLFastTimer::DeclareTimer FTM_PUMP("Pump"); @@ -1121,6 +1126,10 @@ bool LLAppViewer::mainLoop() LLFastTimer ftm(FTM_VFS); io_pending += LLVFSThread::updateClass(1); } + { + LLFastTimer ftm(FTM_LFS); + io_pending += LLLFSThread::updateClass(1); + } if (io_pending > 1000) { @@ -1659,7 +1668,7 @@ bool LLAppViewer::initThreads() // Image decoding LLAppViewer::sImageDecodeThread = new LLImageDecodeThread(enable_threads && true); LLAppViewer::sTextureCache = new LLTextureCache(enable_threads && true); - LLAppViewer::sTextureFetch = new LLTextureFetch(LLAppViewer::getTextureCache(), sImageDecodeThread, enable_threads && true); + LLAppViewer::sTextureFetch = new LLTextureFetch(LLAppViewer::getTextureCache(), sImageDecodeThread, enable_threads && false); LLImage::initClass(); if (LLFastTimer::sLog || LLFastTimer::sMetricLog) @@ -2857,7 +2866,7 @@ void LLAppViewer::requestQuit() static bool finish_quit(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { @@ -2869,7 +2878,7 @@ static LLNotificationFunctorRegistration finish_quit_reg("ConfirmQuit", finish_q void LLAppViewer::userQuit() { - LLNotifications::instance().add("ConfirmQuit"); + LLNotificationsUtil::add("ConfirmQuit"); } static bool finish_early_exit(const LLSD& notification, const LLSD& response) @@ -2882,7 +2891,7 @@ void LLAppViewer::earlyExit(const std::string& name, const LLSD& substitutions) { llwarns << "app_early_exit: " << name << llendl; gDoDisconnect = TRUE; - LLNotifications::instance().add(name, substitutions, LLSD(), finish_early_exit); + LLNotificationsUtil::add(name, substitutions, LLSD(), finish_early_exit); } void LLAppViewer::forceExit(S32 arg) @@ -3200,7 +3209,7 @@ std::string LLAppViewer::getWindowTitle() const // Callback from a dialog indicating user was logged out. bool finish_disconnect(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (1 == option) { @@ -3240,12 +3249,12 @@ void LLAppViewer::forceDisconnect(const std::string& mesg) { // Tell users what happened args["ERROR_MESSAGE"] = big_reason; - LLNotifications::instance().add("ErrorMessage", args, LLSD(), &finish_forced_disconnect); + LLNotificationsUtil::add("ErrorMessage", args, LLSD(), &finish_forced_disconnect); } else { args["MESSAGE"] = big_reason; - LLNotifications::instance().add("YouHaveBeenLoggedOut", args, LLSD(), &finish_disconnect ); + LLNotificationsUtil::add("YouHaveBeenLoggedOut", args, LLSD(), &finish_disconnect ); } } diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 6e32a91078..6b1897d077 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -42,7 +42,6 @@ #include "llnotify.h" #include "llinventoryobserver.h" #include "llinventorypanel.h" -#include "llfloaterinventory.h" #include "llfloaterimportcollada.h" #include "llpermissionsflags.h" #include "llpreviewnotecard.h" @@ -64,6 +63,7 @@ #include "lleconomy.h" #include "llfloaterreg.h" #include "llfocusmgr.h" +#include "llnotificationsutil.h" #include "llscrolllistctrl.h" #include "llsdserialize.h" #include "llsdutil.h" @@ -237,14 +237,14 @@ void LLAssetUploadResponder::error(U32 statusNum, const std::string& reason) args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName); args["REASON"] = "Error in upload request. Please visit " "http://secondlife.com/support for help fixing this problem."; - LLNotifications::instance().add("CannotUploadReason", args); + LLNotificationsUtil::add("CannotUploadReason", args); break; case 500: default: args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName); args["REASON"] = "The server is experiencing unexpected " "difficulties."; - LLNotifications::instance().add("CannotUploadReason", args); + LLNotificationsUtil::add("CannotUploadReason", args); break; } LLUploadDialog::modalUploadFinished(); @@ -307,7 +307,7 @@ void LLAssetUploadResponder::uploadFailure(const LLSD& content) LLSD args; args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName); args["REASON"] = content["message"].asString(); - LLNotifications::instance().add("CannotUploadReason", args); + LLNotificationsUtil::add("CannotUploadReason", args); } } @@ -380,6 +380,7 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content) mPostData["description"], content, expected_upload_cost); + LLFocusableElement* focus = gFocusMgr.getKeyboardFocus(); // continue uploading for bulk uploads diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index b08191ce15..a7a6da3ac2 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -38,6 +38,7 @@ #include "llsd.h" #include "lldarray.h" #include "llnotifications.h" +#include "llnotificationsutil.h" #include "roles_constants.h" // for GP_MEMBER_INVITE @@ -69,7 +70,7 @@ void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::strin { if(id == gAgentID) { - LLNotifications::instance().add("AddSelfFriend"); + LLNotificationsUtil::add("AddSelfFriend"); return; } @@ -83,11 +84,11 @@ void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::strin { // Old and busted server version, doesn't support friend // requests with messages. - LLNotifications::instance().add("AddFriend", args, payload, &callbackAddFriend); + LLNotificationsUtil::add("AddFriend", args, payload, &callbackAddFriend); } else { - LLNotifications::instance().add("AddFriendWithMessage", args, payload, &callbackAddFriendWithMessage); + LLNotificationsUtil::add("AddFriendWithMessage", args, payload, &callbackAddFriendWithMessage); } // add friend to recent people list @@ -149,7 +150,7 @@ void LLAvatarActions::removeFriendsDialog(const std::vector<LLUUID>& ids) payload["ids"].append(*it); } - LLNotifications::instance().add(msgType, + LLNotificationsUtil::add(msgType, args, payload, &handleRemove); @@ -380,7 +381,7 @@ void LLAvatarActions::inviteToGroup(const LLUUID& id) // static bool LLAvatarActions::handleRemove(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); const LLSD& ids = notification["payload"]["ids"]; for (LLSD::array_const_iterator itr = ids.beginArray(); itr != ids.endArray(); ++itr) @@ -414,7 +415,7 @@ bool LLAvatarActions::handleRemove(const LLSD& notification, const LLSD& respons // static bool LLAvatarActions::handlePay(const LLSD& notification, const LLSD& response, LLUUID avatar_id) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { gAgent.clearBusy(); @@ -437,7 +438,7 @@ void LLAvatarActions::callback_invite_to_group(LLUUID group_id, LLUUID id) // static bool LLAvatarActions::callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { requestFriendship(notification["payload"]["id"].asUUID(), @@ -450,7 +451,7 @@ bool LLAvatarActions::callbackAddFriendWithMessage(const LLSD& notification, con // static bool LLAvatarActions::callbackAddFriend(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { // Servers older than 1.25 require the text of the message to be the diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp index 327d80ba34..44cbbbb6b2 100644 --- a/indra/newview/llavatariconctrl.cpp +++ b/indra/newview/llavatariconctrl.cpp @@ -234,6 +234,7 @@ void LLAvatarIconCtrl::setValue(const LLSD& value) // Check if cache already contains image_id for that avatar if (!updateFromCache()) { + LLIconCtrl::setValue(mDefaultIconName); app->addObserver(mAvatarId, this); app->sendAvatarPropertiesRequest(mAvatarId); } @@ -302,5 +303,9 @@ void LLAvatarIconCtrl::nameUpdatedCallback( { setToolTip(mFirstName + " " + mLastName); } + else + { + setToolTip(std::string("")); + } } } diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index bb03f47f46..202fbdebd4 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -153,6 +153,13 @@ void LLAvatarList::draw() } } +//virtual +void LLAvatarList::clear() +{ + getIDs().clear(); + setDirty(true); +} + void LLAvatarList::setNameFilter(const std::string& filter) { if (mNameFilter != filter) @@ -363,37 +370,6 @@ void LLAvatarList::computeDifference( vadded.erase(it, vadded.end()); } -static std::string format_secs(S32 secs) -{ - // *TODO: reinventing the wheel? - // *TODO: i18n - static const int LL_AL_MIN = 60; - static const int LL_AL_HOUR = LL_AL_MIN * 60; - static const int LL_AL_DAY = LL_AL_HOUR * 24; - static const int LL_AL_WEEK = LL_AL_DAY * 7; - static const int LL_AL_MONTH = LL_AL_DAY * 31; - static const int LL_AL_YEAR = LL_AL_DAY * 365; - - std::string s; - - if (secs >= LL_AL_YEAR) - s = llformat("%dy", secs / LL_AL_YEAR); - else if (secs >= LL_AL_MONTH) - s = llformat("%dmon", secs / LL_AL_MONTH); - else if (secs >= LL_AL_WEEK) - s = llformat("%dw", secs / LL_AL_WEEK); - else if (secs >= LL_AL_DAY) - s = llformat("%dd", secs / LL_AL_DAY); - else if (secs >= LL_AL_HOUR) - s = llformat("%dh", secs / LL_AL_HOUR); - else if (secs >= LL_AL_MIN) - s = llformat("%dm", secs / LL_AL_MIN); - else - s = llformat("%ds", secs); - - return s; -} - // Refresh shown time of our last interaction with all listed avatars. void LLAvatarList::updateLastInteractionTimes() { @@ -407,7 +383,7 @@ void LLAvatarList::updateLastInteractionTimes() LLAvatarListItem* item = static_cast<LLAvatarListItem*>(*it); S32 secs_since = now - (S32) LLRecentPeople::instance().getDate(item->getAvatarId()).secondsSinceEpoch(); if (secs_since >= 0) - item->setLastInteractionTime(format_secs(secs_since)); + item->setLastInteractionTime(secs_since); } } diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h index 490f93e501..9058fec540 100644 --- a/indra/newview/llavatarlist.h +++ b/indra/newview/llavatarlist.h @@ -70,6 +70,8 @@ public: virtual void draw(); // from LLView + virtual void clear(); + void setNameFilter(const std::string& filter); void setDirty(bool val = true) { mDirty = val; } uuid_vector_t& getIDs() { return mIDs; } diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index c670a65bcc..59ed391c06 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -42,7 +42,7 @@ #include "llavatariconctrl.h" #include "llbutton.h" -LLAvatarListItem::LLAvatarListItem() +LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/) : LLPanel(), mAvatarIcon(NULL), mAvatarName(NULL), @@ -55,14 +55,12 @@ LLAvatarListItem::LLAvatarListItem() mShowInfoBtn(true), mShowProfileBtn(true) { - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_list_item.xml"); - // Remember avatar icon width including its padding from the name text box, - // so that we can hide and show the icon again later. - - mIconWidth = mAvatarName->getRect().mLeft - mAvatarIcon->getRect().mLeft; - mInfoBtnWidth = mInfoBtn->getRect().mRight - mSpeakingIndicator->getRect().mRight; - mProfileBtnWidth = mProfileBtn->getRect().mRight - mInfoBtn->getRect().mRight; - mSpeakingIndicatorWidth = mSpeakingIndicator->getRect().mRight - mAvatarName->getRect().mRight; + if (not_from_ui_factory) + { + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_list_item.xml"); + } + // *NOTE: mantipov: do not use any member here. They can be uninitialized here in case instance + // is created from the UICtrlFactory } LLAvatarListItem::~LLAvatarListItem() @@ -87,6 +85,13 @@ BOOL LLAvatarListItem::postBuild() mProfileBtn->setVisible(false); mProfileBtn->setClickedCallback(boost::bind(&LLAvatarListItem::onProfileBtnClick, this)); + // Remember avatar icon width including its padding from the name text box, + // so that we can hide and show the icon again later. + mIconWidth = mAvatarName->getRect().mLeft - mAvatarIcon->getRect().mLeft; + mInfoBtnWidth = mInfoBtn->getRect().mRight - mSpeakingIndicator->getRect().mRight; + mProfileBtnWidth = mProfileBtn->getRect().mRight - mInfoBtn->getRect().mRight; + mSpeakingIndicatorWidth = mSpeakingIndicator->getRect().mRight - mAvatarName->getRect().mRight; + /* if(!p.buttons.profile) { @@ -198,9 +203,9 @@ void LLAvatarListItem::showLastInteractionTime(bool show) mAvatarName->setRect(name_rect); } -void LLAvatarListItem::setLastInteractionTime(const std::string& val) +void LLAvatarListItem::setLastInteractionTime(U32 secs_since) { - mLastInteractionTime->setValue(val); + mLastInteractionTime->setValue(formatSeconds(secs_since)); } void LLAvatarListItem::setShowInfoBtn(bool show) @@ -260,7 +265,7 @@ void LLAvatarListItem::setAvatarIconVisible(bool visible) void LLAvatarListItem::onInfoBtnClick() { - LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", mAvatarId)); + LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", mAvatarId)); /* TODO fix positioning of inspector localPointToScreen(mXPos, mYPos, &mXPos, &mYPos); @@ -326,3 +331,51 @@ void LLAvatarListItem::reshapeAvatarName() mAvatarName->reshape(width, height); } + +// Convert given number of seconds to a string like "23 minutes", "15 hours" or "3 years", +// taking i18n into account. The format string to use is taken from the panel XML. +std::string LLAvatarListItem::formatSeconds(U32 secs) +{ + static const U32 LL_ALI_MIN = 60; + static const U32 LL_ALI_HOUR = LL_ALI_MIN * 60; + static const U32 LL_ALI_DAY = LL_ALI_HOUR * 24; + static const U32 LL_ALI_WEEK = LL_ALI_DAY * 7; + static const U32 LL_ALI_MONTH = LL_ALI_DAY * 30; + static const U32 LL_ALI_YEAR = LL_ALI_DAY * 365; + + std::string fmt; + U32 count = 0; + + if (secs >= LL_ALI_YEAR) + { + fmt = "FormatYears"; count = secs / LL_ALI_YEAR; + } + else if (secs >= LL_ALI_MONTH) + { + fmt = "FormatMonths"; count = secs / LL_ALI_MONTH; + } + else if (secs >= LL_ALI_WEEK) + { + fmt = "FormatWeeks"; count = secs / LL_ALI_WEEK; + } + else if (secs >= LL_ALI_DAY) + { + fmt = "FormatDays"; count = secs / LL_ALI_DAY; + } + else if (secs >= LL_ALI_HOUR) + { + fmt = "FormatHours"; count = secs / LL_ALI_HOUR; + } + else if (secs >= LL_ALI_MIN) + { + fmt = "FormatMinutes"; count = secs / LL_ALI_MIN; + } + else + { + fmt = "FormatSeconds"; count = secs; + } + + LLStringUtil::format_map_t args; + args["[COUNT]"] = llformat("%u", count); + return getString(fmt, args); +} diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 9d48101a44..a7b080098d 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -51,7 +51,16 @@ public: virtual void show(LLView* spawning_view, const std::vector<LLUUID>& selected_uuids, S32 x, S32 y) = 0; }; - LLAvatarListItem(); + /** + * Creates an instance of LLAvatarListItem. + * + * It is not registered with LLDefaultChildRegistry. It is built via LLUICtrlFactory::buildPanel + * or via registered LLCallbackMap depend on passed parameter. + * + * @param not_from_ui_factory if true instance will be build with LLUICtrlFactory::buildPanel + * otherwise it should be registered via LLCallbackMap before creating. + */ + LLAvatarListItem(bool not_from_ui_factory = true); virtual ~LLAvatarListItem(); virtual BOOL postBuild(); @@ -63,7 +72,7 @@ public: void setOnline(bool online); void setName(const std::string& name); void setAvatarId(const LLUUID& id, bool ignore_status_changes = false); - void setLastInteractionTime(const std::string& val); + void setLastInteractionTime(U32 secs_since); //Show/hide profile/info btn, translating speaker indicator and avatar name coordinates accordingly void setShowProfileBtn(bool show); void setShowInfoBtn(bool show); @@ -82,8 +91,19 @@ public: void setContextMenu(ContextMenu* menu) { mContextMenu = menu; } + /** + * This method was added to fix EXT-2364 (Items in group/ad-hoc IM participant list (avatar names) should be reshaped when adding/removing the "(Moderator)" label) + * But this is a *HACK. The real reason of it was in incorrect logic while hiding profile/info/speaker buttons + * *TODO: new reshape method should be provided in lieu of this one to be called when visibility if those buttons is changed + */ void reshapeAvatarName(); +protected: + /** + * Contains indicator to show voice activity. + */ + LLOutputMonitorCtrl* mSpeakingIndicator; + private: typedef enum e_online_status { @@ -94,11 +114,12 @@ private: void onNameCache(const std::string& first_name, const std::string& last_name); + std::string formatSeconds(U32 secs); + LLAvatarIconCtrl* mAvatarIcon; LLTextBox* mAvatarName; LLTextBox* mLastInteractionTime; - LLOutputMonitorCtrl* mSpeakingIndicator; LLButton* mInfoBtn; LLButton* mProfileBtn; ContextMenu* mContextMenu; diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index c4f0fa53a7..6d3d61d4fe 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -31,6 +31,8 @@ */ #include "llviewerprecompiledheaders.h" // must be first include + +#define LLBOTTOMTRAY_CPP #include "llbottomtray.h" #include "llagent.h" @@ -40,10 +42,15 @@ #include "llimfloater.h" // for LLIMFloater #include "lllayoutstack.h" #include "llnearbychatbar.h" +#include "llnotificationsutil.h" #include "llspeakbutton.h" #include "llsplitbutton.h" #include "llsyswellwindow.h" #include "llfloatercamera.h" +#include "lltexteditor.h" + +// Build time optimization, generate extern template once in .cpp file +template class LLBottomTray* LLSingleton<class LLBottomTray>::getInstance(); LLBottomTray::LLBottomTray(const LLSD&) : mChicletPanel(NULL), @@ -253,7 +260,9 @@ void LLBottomTray::showBottomTrayContextMenu(S32 x, S32 y, MASK mask) // We should show BottomTrayContextMenu in last turn if (mBottomTrayContextMenu && !LLMenuGL::sMenuContainer->getVisibleMenu()) { - //there are no other context menu (IM chiclet etc ), so we can show BottomTrayContextMenu + //there are no other context menu (IM chiclet etc ), so we can show BottomTrayContextMenu + + updateContextMenu(x, y, mask); mBottomTrayContextMenu->buildDrawLabels(); mBottomTrayContextMenu->updateParent(LLMenuGL::sMenuContainer); LLMenuGL::showPopup(this, mBottomTrayContextMenu, x, y); @@ -261,6 +270,33 @@ void LLBottomTray::showBottomTrayContextMenu(S32 x, S32 y, MASK mask) } } +void LLBottomTray::updateContextMenu(S32 x, S32 y, MASK mask) +{ + LLUICtrl* edit_box = mNearbyChatBar->getChild<LLUICtrl>("chat_box"); + + S32 local_x = x - mNearbyChatBar->getRect().mLeft - edit_box->getRect().mLeft; + S32 local_y = y - mNearbyChatBar->getRect().mBottom - edit_box->getRect().mBottom; + + bool in_edit_box = edit_box->pointInView(local_x, local_y); + + LLMenuItemGL* menu_item; + menu_item = mBottomTrayContextMenu->findChild<LLMenuItemGL>("NearbyChatBar_Cut"); + if(menu_item) + menu_item->setVisible(in_edit_box); + menu_item = mBottomTrayContextMenu->findChild<LLMenuItemGL>("NearbyChatBar_Copy"); + if(menu_item) + menu_item->setVisible(in_edit_box); + menu_item = mBottomTrayContextMenu->findChild<LLMenuItemGL>("NearbyChatBar_Paste"); + if(menu_item) + menu_item->setVisible(in_edit_box); + menu_item = mBottomTrayContextMenu->findChild<LLMenuItemGL>("NearbyChatBar_Delete"); + if(menu_item) + menu_item->setVisible(in_edit_box); + menu_item = mBottomTrayContextMenu->findChild<LLMenuItemGL>("NearbyChatBar_Select_All"); + if(menu_item) + menu_item->setVisible(in_edit_box); +} + void LLBottomTray::showGestureButton(BOOL visible) { setTrayButtonVisibleIfPossible(RS_BUTTON_GESTURES, visible); @@ -292,9 +328,14 @@ namespace BOOL LLBottomTray::postBuild() { + + LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("NearbyChatBar.Action", boost::bind(&LLBottomTray::onContextMenuItemClicked, this, _2)); + LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("NearbyChatBar.EnableMenuItem", boost::bind(&LLBottomTray::onContextMenuItemEnabled, this, _2)); + mBottomTrayContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_bottomtray.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); gMenuHolder->addChild(mBottomTrayContextMenu); + mNearbyChatBar = getChild<LLNearbyChatBar>("chat_bar"); mToolbarStack = getChild<LLLayoutStack>("toolbar_stack"); mMovementPanel = getChild<LLPanel>("movement_panel"); @@ -327,6 +368,62 @@ BOOL LLBottomTray::postBuild() return TRUE; } +bool LLBottomTray::onContextMenuItemEnabled(const LLSD& userdata) +{ + std::string item = userdata.asString(); + LLLineEditor* edit_box = mNearbyChatBar->findChild<LLLineEditor>("chat_box"); + + if (item == "can_cut") + { + return edit_box->canCut(); + } + else if (item == "can_copy") + { + return edit_box->canCopy(); + } + else if (item == "can_paste") + { + return edit_box->canPaste(); + } + else if (item == "can_delete") + { + return edit_box->canDoDelete(); + } + else if (item == "can_select_all") + { + return edit_box->canSelectAll() && (edit_box->getLength()>0); + } + return true; +} + + +void LLBottomTray::onContextMenuItemClicked(const LLSD& userdata) +{ + std::string item = userdata.asString(); + LLLineEditor* edit_box = mNearbyChatBar->findChild<LLLineEditor>("chat_box"); + + if (item == "cut") + { + edit_box->cut(); + } + else if (item == "copy") + { + edit_box->copy(); + } + else if (item == "paste") + { + edit_box->paste(); + } + else if (item == "delete") + { + edit_box->doDelete(); + } + else if (item == "select_all") + { + edit_box->selectAll(); + } +} + void LLBottomTray::log(LLView* panel, const std::string& descr) { if (NULL == panel) return; @@ -941,7 +1038,7 @@ void LLBottomTray::setTrayButtonVisibleIfPossible(EResizeState shown_object_type { // mark this button to show it while future bottom tray extending mResizeState |= shown_object_type; - LLNotifications::instance().add("BottomTrayButtonCanNotBeShown"); + LLNotificationsUtil::add("BottomTrayButtonCanNotBeShown"); } } diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index 7640cdcf9d..91ec01654b 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -47,6 +47,11 @@ class LLSpeakButton; class LLNearbyChatBar; class LLIMChiclet; +// Build time optimization, generate once in .cpp file +#ifndef LLBOTTOMTRAY_CPP +extern template class LLBottomTray* LLSingleton<class LLBottomTray>::getInstance(); +#endif + class LLBottomTray : public LLSingleton<LLBottomTray> , public LLPanel @@ -174,6 +179,10 @@ protected: static void* createNearbyChatBar(void* userdata); + void updateContextMenu(S32 x, S32 y, MASK mask); + void onContextMenuItemClicked(const LLSD& userdata); + bool onContextMenuItemEnabled(const LLSD& userdata); + /** * Creates IM Chiclet based on session type (IM chat or Group chat) */ diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp new file mode 100644 index 0000000000..ad59c780f3 --- /dev/null +++ b/indra/newview/llcallfloater.cpp @@ -0,0 +1,275 @@ +/** + * @file llcallfloater.cpp + * @author Mike Antipov + * @brief Voice Control Panel in a Voice Chats (P2P, Group, Nearby...). + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llcallfloater.h" + +#include "llagentdata.h" // for gAgentID +#include "llavatarlist.h" +#include "llbottomtray.h" +#include "llparticipantlist.h" +#include "llspeakers.h" + + +class LLNonAvatarCaller : public LLAvatarListItem +{ +public: + LLNonAvatarCaller() : LLAvatarListItem(false) + { + + } + BOOL postBuild() + { + BOOL rv = LLAvatarListItem::postBuild(); + + if (rv) + { + setOnline(true); + showLastInteractionTime(false); + setShowProfileBtn(false); + setShowInfoBtn(false); + } + return rv; + } + + void setSpeakerId(const LLUUID& id) { mSpeakingIndicator->setSpeakerId(id); } +}; + + +static void* create_non_avatar_caller(void*) +{ + return new LLNonAvatarCaller; +} + +LLCallFloater::LLCallFloater(const LLSD& key) +: LLDockableFloater(NULL, key) +, mSpeakerManager(NULL) +, mPaticipants(NULL) +, mAvatarList(NULL) +, mNonAvatarCaller(NULL) +, mVoiceType(VC_LOCAL_CHAT) +{ + mFactoryMap["non_avatar_caller"] = LLCallbackMap(create_non_avatar_caller, NULL); +} + +LLCallFloater::~LLCallFloater() +{ + mChannelChangedConnection.disconnect(); + delete mPaticipants; + mPaticipants = NULL; +} + +// virtual +BOOL LLCallFloater::postBuild() +{ + LLDockableFloater::postBuild(); + mAvatarList = getChild<LLAvatarList>("speakers_list"); + childSetAction("leave_call_btn", boost::bind(&LLCallFloater::leaveCall, this)); + + mNonAvatarCaller = getChild<LLNonAvatarCaller>("non_avatar_caller"); + + LLView *anchor_panel = LLBottomTray::getInstance()->getChild<LLView>("speak_panel"); + + setDockControl(new LLDockControl( + anchor_panel, this, + getDockTongue(), LLDockControl::TOP)); + + initAgentData(); + + // update list for current session + updateSession(); + + // subscribe to to be notified Voice Channel is changed + mChannelChangedConnection = LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLCallFloater::onCurrentChannelChanged, this, _1)); + return TRUE; +} + +// virtual +void LLCallFloater::onOpen(const LLSD& /*key*/) +{ +} + +////////////////////////////////////////////////////////////////////////// +/// PRIVATE SECTION +////////////////////////////////////////////////////////////////////////// + +void LLCallFloater::leaveCall() +{ + LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel(); + if (voice_channel && voice_channel->isActive()) + { + voice_channel->deactivate(); + } +} + +void LLCallFloater::updateSession() +{ + LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel(); + if (voice_channel) + { + lldebugs << "Current voice channel: " << voice_channel->getSessionID() << llendl; + + if (mSpeakerManager && voice_channel->getSessionID() == mSpeakerManager->getSessionID()) + { + lldebugs << "Speaker manager is already set for session: " << voice_channel->getSessionID() << llendl; + return; + } + else + { + mSpeakerManager = NULL; + } + } + + const LLUUID& session_id = voice_channel->getSessionID(); + lldebugs << "Set speaker manager for session: " << session_id << llendl; + + LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(session_id); + if (im_session) + { + mSpeakerManager = LLIMModel::getInstance()->getSpeakerManager(session_id); + switch (im_session->mType) + { + case IM_NOTHING_SPECIAL: + case IM_SESSION_P2P_INVITE: + mVoiceType = VC_PEER_TO_PEER; + break; + case IM_SESSION_CONFERENCE_START: + mVoiceType = VC_AD_HOC_CHAT; + break; + default: + mVoiceType = VC_GROUP_CHAT; + break; + } + } + + if (NULL == mSpeakerManager) + { + // by default let show nearby chat participants + mSpeakerManager = LLLocalSpeakerMgr::getInstance(); + lldebugs << "Set DEFAULT speaker manager" << llendl; + mVoiceType = VC_LOCAL_CHAT; + } + + updateTitle(); + + //hide "Leave Call" button for nearby chat + bool is_local_chat = mVoiceType == VC_LOCAL_CHAT; + childSetVisible("leave_btn_panel", !is_local_chat); + + refreshPartisipantList(); +} + +void LLCallFloater::refreshPartisipantList() +{ + delete mPaticipants; + mPaticipants = NULL; + mAvatarList->clear(); + + bool non_avatar_caller = false; + if (VC_PEER_TO_PEER == mVoiceType) + { + LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(mSpeakerManager->getSessionID()); + non_avatar_caller = !session->mOtherParticipantIsAvatar; + if (non_avatar_caller) + { + mNonAvatarCaller->setSpeakerId(session->mOtherParticipantID); + mNonAvatarCaller->setName(session->mName); + } + } + + mNonAvatarCaller->setVisible(non_avatar_caller); + mAvatarList->setVisible(!non_avatar_caller); + + if (!non_avatar_caller) + { + bool do_not_use_context_menu_in_local_chat = LLLocalSpeakerMgr::getInstance() != mSpeakerManager; + mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList, do_not_use_context_menu_in_local_chat); + + if (!do_not_use_context_menu_in_local_chat) + { + mAvatarList->setNoItemsCommentText(getString("no_one_near")); + } + } +} + +void LLCallFloater::onCurrentChannelChanged(const LLUUID& /*session_id*/) +{ + // Forget speaker manager from the previous session to avoid using it after session was destroyed. + mSpeakerManager = NULL; + updateSession(); +} + +void LLCallFloater::updateTitle() +{ + LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel(); + std::string title; + switch (mVoiceType) + { + case VC_LOCAL_CHAT: + title = getString("title_nearby"); + break; + case VC_PEER_TO_PEER: + { + LLStringUtil::format_map_t args; + args["[NAME]"] = voice_channel->getSessionName(); + title = getString("title_peer_2_peer", args); + } + break; + case VC_AD_HOC_CHAT: + title = getString("title_adhoc"); + break; + case VC_GROUP_CHAT: + { + LLStringUtil::format_map_t args; + args["[GROUP]"] = voice_channel->getSessionName(); + title = getString("title_group", args); + } + break; + } + + setTitle(title); +} + +void LLCallFloater::initAgentData() +{ + childSetValue("user_icon", gAgentID); + + std::string name; + gCacheName->getFullName(gAgentID, name); + childSetValue("user_text", name); + + LLOutputMonitorCtrl* speaking_indicator = getChild<LLOutputMonitorCtrl>("speaking_indicator"); + speaking_indicator->setSpeakerId(gAgentID); +} +//EOF diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h new file mode 100644 index 0000000000..b615f57d5b --- /dev/null +++ b/indra/newview/llcallfloater.h @@ -0,0 +1,103 @@ +/** + * @file llcallfloater.h + * @author Mike Antipov + * @brief Voice Control Panel in a Voice Chats (P2P, Group, Nearby...). + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLCALLFLOATER_H +#define LL_LLCALLFLOATER_H + +#include "lldockablefloater.h" + +class LLAvatarList; +class LLNonAvatarCaller; +class LLParticipantList; +class LLSpeakerMgr; + +/** + * The Voice Control Panel is an ambient window summoned by clicking the flyout chevron on the Speak button. + * It can be torn-off and freely positioned onscreen. + * + * When the Resident is engaged in Nearby Voice Chat, the Voice Control Panel provides control over + * the Resident's own microphone input volume, the audible volume of each of the other participants, + * the Resident's own Voice Morphing settings (if she has subscribed to enable the feature), and Voice Recording. + * + * When the Resident is engaged in any chat except Nearby Chat, the Voice Control Panel also provides an + * 'Leave Call' button to allow the Resident to leave that voice channel. + */ +class LLCallFloater : public LLDockableFloater +{ +public: + LLCallFloater(const LLSD& key); + ~LLCallFloater(); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + +private: + typedef enum e_voice_controls_type + { + VC_LOCAL_CHAT, + VC_GROUP_CHAT, + VC_AD_HOC_CHAT, + VC_PEER_TO_PEER + }EVoiceControls; + + void leaveCall(); + + /** + * Updates mSpeakerManager and list according to current Voice Channel + * + * It compares mSpeakerManager & current Voice Channel session IDs. + * If they are different gets Speaker manager related to current channel and updates channel participant list. + */ + void updateSession(); + + /** + * Refreshes participant list according to current Voice Channel + */ + void refreshPartisipantList(); + void onCurrentChannelChanged(const LLUUID& session_id); + void updateTitle(); + void initAgentData(); + +private: + LLSpeakerMgr* mSpeakerManager; + LLParticipantList* mPaticipants; + LLAvatarList* mAvatarList; + LLNonAvatarCaller* mNonAvatarCaller; + EVoiceControls mVoiceType; + + boost::signals2::connection mChannelChangedConnection; +}; + + +#endif //LL_LLCALLFLOATER_H + diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 0b10255c2f..714bd20ab8 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -53,6 +53,8 @@ #include "llbutton.h" #include "llinventoryobserver.h" #include "llinventorymodel.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llnotify.h" #include "llresmgr.h" #include "llimview.h" @@ -631,20 +633,21 @@ void LLAvatarTracker::processChange(LLMessageSystem* msg) { if((mBuddyInfo[agent_id]->getRightsGrantedFrom() ^ new_rights) & LLRelationship::GRANT_MODIFY_OBJECTS) { - std::string first, last; + std::string name; LLSD args; - if(gCacheName->getName(agent_id, first, last)) + if(gCacheName->getFullName(agent_id, name)) { - args["FIRST_NAME"] = first; - args["LAST_NAME"] = last; + args["NAME"] = name; } + LLSD payload; + payload["from_id"] = agent_id; if(LLRelationship::GRANT_MODIFY_OBJECTS & new_rights) { - LLNotifications::instance().add("GrantedModifyRights",args); + LLNotificationsUtil::add("GrantedModifyRights",args, payload); } else { - LLNotifications::instance().add("RevokedModifyRights",args); + LLNotificationsUtil::add("RevokedModifyRights",args, payload); } } (mBuddyInfo[agent_id])->setRightsFrom(new_rights); @@ -714,7 +717,7 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) if(notify) { // Popup a notify box with online status of this agent - LLNotificationPtr notification = LLNotifications::instance().add(online ? "FriendOnline" : "FriendOffline", args); + LLNotificationPtr notification = LLNotificationsUtil::add(online ? "FriendOnline" : "FriendOffline", args); // If there's an open IM session with this agent, send a notification there too. LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id); diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 2c9b38b82a..96b5ae5908 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -43,6 +43,7 @@ #include "lltrans.h" #include "llfloaterreg.h" #include "llmutelist.h" +#include "llstylemap.h" #include "llsidetray.h"//for blocked objects panel @@ -78,7 +79,7 @@ public: { LLMuteList::getInstance()->add(LLMute(getAvatarId(), mFrom, LLMute::OBJECT)); - LLSideTray::getInstance()->showPanel("panel_block_list_sidetray", LLSD().insert("blocked_to_select", getAvatarId())); + LLSideTray::getInstance()->showPanel("panel_block_list_sidetray", LLSD().with("blocked_to_select", getAvatarId())); } } @@ -160,11 +161,11 @@ public: { if (mSourceType == CHAT_SOURCE_OBJECT) { - LLFloaterReg::showInstance("inspect_object", LLSD().insert("object_id", mAvatarID)); + LLFloaterReg::showInstance("inspect_object", LLSD().with("object_id", mAvatarID)); } else if (mSourceType == CHAT_SOURCE_AGENT) { - LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", mAvatarID)); + LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", mAvatarID)); } //if chat source is system, you may add "else" here to define behaviour. } @@ -199,7 +200,7 @@ public: userName->setValue(SL); } - setTimeField(chat.mTimeStr); + setTimeField(chat); LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon"); @@ -267,12 +268,13 @@ protected: } private: - void setTimeField(const std::string& time_value) + void setTimeField(const LLChat& chat) { LLTextBox* time_box = getChild<LLTextBox>("time_box"); LLRect rect_before = time_box->getRect(); - time_box->setValue(time_value); + + time_box->setValue(chat.mTimeStr); // set necessary textbox width to fit all text time_box->reshapeToFitText(); @@ -284,7 +286,7 @@ private: time_box->translate(delta_pos_x, delta_pos_y); //... & change width of the name control - LLTextBox* user_name = getChild<LLTextBox>("user_name"); + LLView* user_name = getChild<LLView>("user_name"); const LLRect& user_rect = user_name->getRect(); user_name->reshape(user_rect.getWidth() + delta_pos_x, user_rect.getHeight()); } @@ -354,6 +356,7 @@ void LLChatHistory::clear() { mLastFromName.clear(); LLTextEditor::clear(); + mLastFromID = LLUUID::null; } void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_chat_history, const LLStyle::Params& input_append_params) @@ -370,13 +373,25 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ style_params.font.size(font_size); style_params.font.style(input_append_params.font.style); - std::string header_text = "[" + chat.mTimeStr + "] "; - if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM) - header_text += chat.mFromName + ": "; - if (use_plain_text_chat_history) { - appendText(header_text, getText().size() != 0, style_params); + appendText("[" + chat.mTimeStr + "] ", getText().size() != 0, style_params); + + if (utf8str_trim(chat.mFromName).size() != 0) + { + // Don't hotlink any messages from the system (e.g. "Second Life:"), so just add those in plain text. + if ( chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() ) + { + LLStyle::Params link_params(style_params); + link_params.fillFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); + // Convert the name to a hotlink and add to message. + appendText(chat.mFromName + ": ", false, link_params); + } + else + { + appendText(chat.mFromName + ": ", false, style_params); + } + } } else { @@ -386,7 +401,13 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ p.left_pad = mLeftWidgetPad; p.right_pad = mRightWidgetPad; - if (mLastFromName == chat.mFromName) + LLDate new_message_time = LLDate::now(); + + if (mLastFromName == chat.mFromName + && mLastFromID == chat.mFromID + && mLastMessageTime.notNull() + && (new_message_time.secondsSinceEpoch() - mLastMessageTime.secondsSinceEpoch()) < 60.0 + ) { view = getSeparator(); p.top_pad = mTopSeparatorPad; @@ -412,8 +433,14 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ view->reshape(target_rect.getWidth(), view->getRect().getHeight()); view->setOrigin(target_rect.mLeft, view->getRect().mBottom); + std::string header_text = "[" + chat.mTimeStr + "] "; + if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM) + header_text += chat.mFromName + ": "; + appendWidget(p, header_text, false); mLastFromName = chat.mFromName; + mLastFromID = chat.mFromID; + mLastMessageTime = new_message_time; } //Handle IRC styled /me messages. std::string prefix = chat.mText.substr(0, 4); diff --git a/indra/newview/llchathistory.h b/indra/newview/llchathistory.h index ef5839ff2f..8ca7dd1d58 100644 --- a/indra/newview/llchathistory.h +++ b/indra/newview/llchathistory.h @@ -114,6 +114,8 @@ class LLChatHistory : public LLTextEditor private: std::string mLastFromName; + LLUUID mLastFromID; + LLDate mLastMessageTime; std::string mMessageHeaderFilename; std::string mMessageSeparatorFilename; diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index 8a6935b71b..92df281307 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -44,27 +44,12 @@ #include "llviewercontrol.h" #include "llagentdata.h" -/* -static const S32 BORDER_MARGIN = 2; -static const S32 PARENT_BORDER_MARGIN = 0; - -static const S32 HORIZONTAL_MULTIPLE = 8; -static const S32 VERTICAL_MULTIPLE = 16; -static const F32 MIN_AUTO_SCROLL_RATE = 120.f; -static const F32 MAX_AUTO_SCROLL_RATE = 500.f; -static const F32 AUTO_SCROLL_RATE_ACCEL = 120.f; - -#define MAX_CHAT_HISTORY 100 -*/ - -static const S32 msg_left_offset = 30; +static const S32 msg_left_offset = 10; static const S32 msg_right_offset = 10; -static const S32 msg_height_pad = 2; - -//static LLDefaultChildRegistry::Register<LLChatItemsContainerCtrl> t2("chat_items_container"); +static const S32 msg_height_pad = 5; //******************************************************************************************************************* -//LLChatItemCtrl +//LLNearbyChatToastPanel //******************************************************************************************************************* LLNearbyChatToastPanel* LLNearbyChatToastPanel::createInstance() @@ -79,22 +64,22 @@ void LLNearbyChatToastPanel::reshape (S32 width, S32 height, BOOL called_from_p { LLPanel::reshape(width, height,called_from_parent); - // *NOTE: we must check if child items exist because reshape is called from the - // LLView::initFromParams BEFORE postBuild is called and child controls are not exist yet - LLPanel* caption = findChild<LLPanel>("msg_caption", false); - LLChatMsgBox* msg_text = findChild<LLChatMsgBox>("msg_text" ,false); - if(caption && msg_text) - { - LLRect caption_rect = caption->getRect(); - caption_rect.setLeftTopAndSize( 2, height, width - 4, caption_rect.getHeight()); - caption->reshape( width - 4, caption_rect.getHeight(), 1); - caption->setRect(caption_rect); - - LLRect msg_text_rect = msg_text->getRect(); - msg_text_rect.setLeftTopAndSize( msg_left_offset, height - caption_rect.getHeight() , width - msg_left_offset - msg_right_offset, height - caption_rect.getHeight()); - msg_text->reshape( width - msg_left_offset - msg_right_offset, height - caption_rect.getHeight(), 1); - msg_text->setRect(msg_text_rect); - } + LLUICtrl* msg_text = getChild<LLUICtrl>("msg_text", false); + LLUICtrl* icon = getChild<LLUICtrl>("avatar_icon", false); + + LLRect msg_text_rect = msg_text->getRect(); + LLRect avatar_rect = icon->getRect(); + + avatar_rect.setLeftTopAndSize(2,height-2,avatar_rect.getWidth(),avatar_rect.getHeight()); + icon->setRect(avatar_rect); + + + msg_text_rect.setLeftTopAndSize( avatar_rect.mRight + msg_left_offset, + height - msg_height_pad, + width - avatar_rect.mRight - msg_left_offset - msg_right_offset, + height - 2*msg_height_pad); + msg_text->reshape( msg_text_rect.getWidth(), msg_text_rect.getHeight(), 1); + msg_text->setRect(msg_text_rect); } BOOL LLNearbyChatToastPanel::postBuild() @@ -102,37 +87,62 @@ BOOL LLNearbyChatToastPanel::postBuild() return LLPanel::postBuild(); } - -std::string LLNearbyChatToastPanel::appendTime() +void LLNearbyChatToastPanel::addMessage(LLSD& notification) { - time_t utc_time; - utc_time = time_corrected(); - std::string timeStr ="["+ LLTrans::getString("TimeHour")+"]:[" - +LLTrans::getString("TimeMin")+"] "; + std::string messageText = notification["message"].asString(); // UTF-8 line of text - LLSD substitution; + LLChatMsgBox* msg_text = getChild<LLChatMsgBox>("msg_text", false); - substitution["datetime"] = (S32) utc_time; - LLStringUtil::format (timeStr, substitution); + std::string color_name = notification["text_color"].asString(); + + LLColor4 textColor = LLUIColorTable::instance().getColor(color_name); + textColor.mV[VALPHA] =notification["color_alpha"].asReal(); + + S32 font_size = notification["font_size"].asInteger(); - return timeStr; -} + LLFontGL* messageFont; + switch(font_size) + { + case 0: messageFont = LLFontGL::getFontSansSerifSmall(); break; + default: + case 1: messageFont = LLFontGL::getFontSansSerif(); break; + case 2: messageFont = LLFontGL::getFontSansSerifBig(); break; + } + //append text + { + LLStyle::Params style_params; + style_params.color(textColor); + std::string font_name = LLFontGL::nameFromFont(messageFont); + std::string font_style_size = LLFontGL::sizeFromFont(messageFont); + style_params.font.name(font_name); + style_params.font.size(font_style_size); + int chat_type = notification["chat_type"].asInteger(); + + if(notification["chat_style"].asInteger()== CHAT_STYLE_IRC) + { + style_params.font.style = "ITALIC"; + } + else if( chat_type == CHAT_TYPE_SHOUT) + { + style_params.font.style = "BOLD"; + } + else if( chat_type == CHAT_TYPE_WHISPER) + { + style_params.font.style = "ITALIC"; + } + msg_text->appendText(messageText, TRUE, style_params); + } + + snapToMessageHeight(); -void LLNearbyChatToastPanel::addText (const std::string& message , const LLStyle::Params& input_params) -{ - LLChatMsgBox* msg_text = getChild<LLChatMsgBox>("msg_text", false); - msg_text->addText(message , input_params); - mMessages.push_back(message); } void LLNearbyChatToastPanel::init(LLSD& notification) { - LLPanel* caption = getChild<LLPanel>("msg_caption", false); - - mText = notification["message"].asString(); // UTF-8 line of text - mFromName = notification["from"].asString(); // agent or object name + std::string messageText = notification["message"].asString(); // UTF-8 line of text + std::string fromName = notification["from"].asString(); // agent or object name mFromID = notification["from_id"].asUUID(); // agent id or object id int sType = notification["source"].asInteger(); @@ -140,192 +150,120 @@ void LLNearbyChatToastPanel::init(LLSD& notification) std::string color_name = notification["text_color"].asString(); - mTextColor = LLUIColorTable::instance().getColor(color_name); - mTextColor.mV[VALPHA] =notification["color_alpha"].asReal(); + LLColor4 textColor = LLUIColorTable::instance().getColor(color_name); + textColor.mV[VALPHA] =notification["color_alpha"].asReal(); S32 font_size = notification["font_size"].asInteger(); + + LLFontGL* messageFont; switch(font_size) { - case 0: - mFont = LLFontGL::getFontSansSerifSmall(); - break; + case 0: messageFont = LLFontGL::getFontSansSerifSmall(); break; default: - case 1: - mFont = LLFontGL::getFontSansSerif(); - break; - case 2: - mFont = LLFontGL::getFontSansSerifBig(); - break; + case 1: messageFont = LLFontGL::getFontSansSerif(); break; + case 2: messageFont = LLFontGL::getFontSansSerifBig(); break; } - LLStyle::Params style_params; - style_params.color(mTextColor); -// style_params.font(mFont); - std::string font_name = LLFontGL::nameFromFont(mFont); - std::string font_style_size = LLFontGL::sizeFromFont(mFont); - style_params.font.name(font_name); - style_params.font.size(font_style_size); + LLChatMsgBox* msg_text = getChild<LLChatMsgBox>("msg_text", false); + + msg_text->setText(std::string("")); std::string str_sender; if(gAgentID != mFromID) - str_sender = mFromName; + str_sender = fromName; else - str_sender = LLTrans::getString("You");; + str_sender = LLTrans::getString("You"); - caption->getChild<LLTextBox>("sender_name", false)->setText(str_sender , style_params); - - LLChatMsgBox* msg_text = getChild<LLChatMsgBox>("msg_text", false); + str_sender+=" "; + //append user name + { + LLStyle::Params style_params_name; + + LLColor4 userNameColor = LLUIColorTable::instance().getColor("ChatToastAgentNameColor"); + + style_params_name.color(userNameColor); + + std::string font_name = LLFontGL::nameFromFont(messageFont); + std::string font_style_size = LLFontGL::sizeFromFont(messageFont); + style_params_name.font.name(font_name); + style_params_name.font.size(font_style_size); + + msg_text->appendText(str_sender, FALSE, style_params_name); + + } - if(notification["chat_style"].asInteger()== CHAT_STYLE_IRC) + //append text { - if (mFromName.size() > 0) + LLStyle::Params style_params; + style_params.color(textColor); + std::string font_name = LLFontGL::nameFromFont(messageFont); + std::string font_style_size = LLFontGL::sizeFromFont(messageFont); + style_params.font.name(font_name); + style_params.font.size(font_style_size); + + int chat_type = notification["chat_type"].asInteger(); + + if(notification["chat_style"].asInteger()== CHAT_STYLE_IRC) { style_params.font.style = "ITALIC"; - - msg_text->setText(mFromName, style_params); } - mText = mText.substr(3); - style_params.font.style = "ITALIC"; -#define INFINITE_REFLOW_BUG 0 -#if INFINITE_REFLOW_BUG - // This causes LLTextBase::reflow() to infinite loop until the viewer - // runs out of memory, throws a bad_alloc exception from std::vector - // in mLineInfoList, and the main loop catches it and continues. - // It appears to be caused by addText() adding a line separator in the - // middle of a line. See EXT-2579, EXT-1949 - msg_text->addText(mText,style_params); -#else - msg_text->appendText(mText, FALSE, style_params); -#endif - } - else - { - msg_text->setText(mText, style_params); + else if( chat_type == CHAT_TYPE_SHOUT) + { + style_params.font.style = "BOLD"; + } + else if( chat_type == CHAT_TYPE_WHISPER) + { + style_params.font.style = "ITALIC"; + } + msg_text->appendText(messageText, FALSE, style_params); } - - LLUICtrl* msg_inspector = caption->getChild<LLUICtrl>("msg_inspector"); - if(mSourceType != CHAT_SOURCE_AGENT) - msg_inspector->setVisible(false); - - mMessages.clear(); - - snapToMessageHeight (); + snapToMessageHeight(); mIsDirty = true;//will set Avatar Icon in draw } -void LLNearbyChatToastPanel::setMessage (const LLChat& chat_msg) -{ - LLSD notification; - notification["message"] = chat_msg.mText; - notification["from"] = chat_msg.mFromName; - notification["from_id"] = chat_msg.mFromID; - notification["time"] = chat_msg.mTime; - notification["source"] = (S32)chat_msg.mSourceType; - notification["chat_type"] = (S32)chat_msg.mChatType; - notification["chat_style"] = (S32)chat_msg.mChatStyle; - - std::string r_color_name="White"; - F32 r_color_alpha = 1.0f; - LLViewerChat::getChatColor( chat_msg, r_color_name, r_color_alpha); - - notification["text_color"] = r_color_name; - notification["color_alpha"] = r_color_alpha; - - notification["font_size"] = (S32)LLViewerChat::getChatFontSize() ; - init(notification); - -} - void LLNearbyChatToastPanel::snapToMessageHeight () { LLChatMsgBox* text_box = getChild<LLChatMsgBox>("msg_text", false); - S32 new_height = text_box->getTextPixelHeight() + msg_height_pad; + S32 new_height = llmax (text_box->getTextPixelHeight() + 2*text_box->getVPad() + 2*msg_height_pad, 25); + LLRect panel_rect = getRect(); - S32 caption_height = 0; - LLPanel* caption = getChild<LLPanel>("msg_caption", false); - caption_height = caption->getRect().getHeight(); - - panel_rect.setLeftTopAndSize( panel_rect.mLeft, panel_rect.mTop, panel_rect.getWidth(), caption_height + new_height); + panel_rect.setLeftTopAndSize( panel_rect.mLeft, panel_rect.mTop, panel_rect.getWidth(), new_height); - reshape( getRect().getWidth(), caption_height + new_height, 1); + reshape( getRect().getWidth(), getRect().getHeight(), 1); setRect(panel_rect); } - -void LLNearbyChatToastPanel::setWidth(S32 width) -{ - LLChatMsgBox* text_box = getChild<LLChatMsgBox>("msg_text", false); - text_box->reshape(width - msg_left_offset - msg_right_offset,100/*its not magic number, we just need any number*/); - - LLChatMsgBox* msg_text = getChild<LLChatMsgBox>("msg_text", false); - - LLStyle::Params style_params; - style_params.color(mTextColor); - style_params.font(mFont); - - - if(mText.length()) - msg_text->setText(mText, style_params); - - for(size_t i=0;i<mMessages.size();++i) - msg_text->addText(mMessages[i] , style_params); - - setRect(LLRect(getRect().mLeft, getRect().mTop, getRect().mLeft + width , getRect().mBottom)); - snapToMessageHeight (); -} - void LLNearbyChatToastPanel::onMouseLeave (S32 x, S32 y, MASK mask) { - LLPanel* caption = getChild<LLPanel>("msg_caption", false); - LLUICtrl* msg_inspector = caption->getChild<LLUICtrl>("msg_inspector"); - msg_inspector->setVisible(false); } void LLNearbyChatToastPanel::onMouseEnter (S32 x, S32 y, MASK mask) { if(mSourceType != CHAT_SOURCE_AGENT) return; - LLPanel* caption = getChild<LLPanel>("msg_caption", false); - LLUICtrl* msg_inspector = caption->getChild<LLUICtrl>("msg_inspector"); - msg_inspector->setVisible(true); } BOOL LLNearbyChatToastPanel::handleMouseDown (S32 x, S32 y, MASK mask) { if(mSourceType != CHAT_SOURCE_AGENT) return LLPanel::handleMouseDown(x,y,mask); - LLPanel* caption = getChild<LLPanel>("msg_caption", false); - LLUICtrl* msg_inspector = caption->getChild<LLUICtrl>("msg_inspector"); - S32 local_x = x - msg_inspector->getRect().mLeft - caption->getRect().mLeft; - S32 local_y = y - msg_inspector->getRect().mBottom - caption->getRect().mBottom; - if(msg_inspector->pointInView(local_x, local_y)) - { - LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", mFromID)); - } - else - { - LLFloaterReg::showInstance("nearby_chat",LLSD()); - } + LLFloaterReg::showInstance("nearby_chat",LLSD()); return LLPanel::handleMouseDown(x,y,mask); } void LLNearbyChatToastPanel::setHeaderVisibility(EShowItemHeader e) { - LLPanel* caption = getChild<LLPanel>("msg_caption", false); - - LLUICtrl* icon = caption->getChild<LLUICtrl>("avatar_icon", false); - LLUICtrl* name = caption->getChild<LLUICtrl>("sender_name", false); - - icon->setVisible(e == CHATITEMHEADER_SHOW_ONLY_ICON || e==CHATITEMHEADER_SHOW_BOTH); - name->setVisible(e == CHATITEMHEADER_SHOW_ONLY_NAME || e==CHATITEMHEADER_SHOW_BOTH); + LLUICtrl* icon = getChild<LLUICtrl>("avatar_icon", false); + if(icon) + icon->setVisible(e == CHATITEMHEADER_SHOW_ONLY_ICON || e==CHATITEMHEADER_SHOW_BOTH); } @@ -339,11 +277,10 @@ bool LLNearbyChatToastPanel::canAddText () BOOL LLNearbyChatToastPanel::handleRightMouseDown(S32 x, S32 y, MASK mask) { - LLPanel* caption = getChild<LLPanel>("msg_caption", false); - LLUICtrl* avatar_icon = caption->getChild<LLUICtrl>("avatar_icon", false); + LLUICtrl* avatar_icon = getChild<LLUICtrl>("avatar_icon", false); - S32 local_x = x - avatar_icon->getRect().mLeft - caption->getRect().mLeft; - S32 local_y = y - avatar_icon->getRect().mBottom - caption->getRect().mBottom; + S32 local_x = x - avatar_icon->getRect().mLeft; + S32 local_y = y - avatar_icon->getRect().mBottom; //eat message for avatar icon if msg was from object if(avatar_icon->pointInView(local_x, local_y) && mSourceType != CHAT_SOURCE_AGENT) @@ -354,9 +291,12 @@ void LLNearbyChatToastPanel::draw() { if(mIsDirty) { - LLPanel* caption = findChild<LLPanel>("msg_caption", false); - if(caption) - caption->getChild<LLAvatarIconCtrl>("avatar_icon", false)->setValue(mFromID); + LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon", false); + if(icon) + { + icon->setDrawTooltip(mSourceType == CHAT_SOURCE_AGENT); + icon->setValue(mFromID); + } mIsDirty = false; } LLToastPanelBase::draw(); diff --git a/indra/newview/llchatitemscontainerctrl.h b/indra/newview/llchatitemscontainerctrl.h index a65bfedd09..0a85c52401 100644 --- a/indra/newview/llchatitemscontainerctrl.h +++ b/indra/newview/llchatitemscontainerctrl.h @@ -59,9 +59,8 @@ public: const LLUUID& getFromID() const { return mFromID;} - void addText (const std::string& message , const LLStyle::Params& input_params = LLStyle::Params()); - void setMessage (const LLChat& msg); - void setWidth (S32 width); + //void addText (const std::string& message , const LLStyle::Params& input_params = LLStyle::Params()); + //void setMessage (const LLChat& msg); void snapToMessageHeight (); bool canAddText (); @@ -78,22 +77,16 @@ public: BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); virtual void init(LLSD& data); + virtual void addMessage(LLSD& data); virtual void draw(); -private: - - std::string appendTime (); + const LLUUID& messageID() const { return mFromID;} private: - std::string mText; // UTF-8 line of text - std::string mFromName; // agent or object name LLUUID mFromID; // agent id or object id EChatSourceType mSourceType; - LLColor4 mTextColor; - LLFontGL* mFont; - + - std::vector<std::string> mMessages; bool mIsDirty; }; diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 90f246ddaf..588855d088 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -32,6 +32,7 @@ #include "llviewerprecompiledheaders.h" // must be first include #include "llchiclet.h" + #include "llagent.h" #include "llavataractions.h" #include "llbottomtray.h" @@ -42,6 +43,8 @@ #include "llfloaterreg.h" #include "lllocalcliprect.h" #include "llmenugl.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" #include "lloutputmonitorctrl.h" #include "llscriptfloater.h" #include "lltextbox.h" @@ -592,8 +595,49 @@ void LLAdHocChiclet::setCounter(S32 counter) setShowNewMessagesIcon(counter); } +void LLAdHocChiclet::createPopupMenu() +{ + if(mPopupMenu) + { + llwarns << "Menu already exists" << llendl; + return; + } + if(getSessionId().isNull()) + { + return; + } + + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + registrar.add("IMChicletMenu.Action", boost::bind(&LLAdHocChiclet::onMenuItemClicked, this, _2)); + + mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL> + ("menu_imchiclet_adhoc.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); +} + +void LLAdHocChiclet::onMenuItemClicked(const LLSD& user_data) +{ + std::string level = user_data.asString(); + LLUUID group_id = getSessionId(); + + if("end" == level) + { + LLGroupActions::endIM(group_id); + } +} + BOOL LLAdHocChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask) { + if(!mPopupMenu) + { + createPopupMenu(); + } + + if (mPopupMenu) + { + mPopupMenu->arrangeAndClear(); + LLMenuGL::showPopup(this, mPopupMenu, x, y); + } + return TRUE; } @@ -1359,7 +1403,7 @@ void LLChicletNotificationCounterCtrl::setCounter(S32 counter) LLRect LLChicletNotificationCounterCtrl::getRequiredRect() { LLRect rc; - S32 text_width = getContentsRect().getWidth(); + S32 text_width = getTextPixelWidth(); rc.mRight = rc.mLeft + llmax(text_width, mInitialWidth); @@ -1412,6 +1456,28 @@ void LLChicletGroupIconCtrl::setValue(const LLSD& value ) ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// +LLChicletInvOfferIconCtrl::LLChicletInvOfferIconCtrl(const Params& p) +: LLChicletAvatarIconCtrl(p) + , mDefaultIcon(p.default_icon) +{ +} + +void LLChicletInvOfferIconCtrl::setValue(const LLSD& value ) +{ + if(value.asUUID().isNull()) + { + LLIconCtrl::setValue(mDefaultIcon); + } + else + { + LLChicletAvatarIconCtrl::setValue(value); + } +} + +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// + LLChicletSpeakerCtrl::LLChicletSpeakerCtrl(const Params&p) : LLOutputMonitorCtrl(p) { @@ -1463,4 +1529,60 @@ BOOL LLScriptChiclet::handleMouseDown(S32 x, S32 y, MASK mask) return LLChiclet::handleMouseDown(x, y, mask); } +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// + +static const std::string INVENTORY_USER_OFFER ("UserGiveItem"); + +LLInvOfferChiclet::Params::Params() +{ + // *TODO Vadim: Get rid of hardcoded values. + rect(CHICLET_RECT); + icon.rect(CHICLET_ICON_RECT); +} + +LLInvOfferChiclet::LLInvOfferChiclet(const Params&p) + : LLIMChiclet(p) + , mChicletIconCtrl(NULL) +{ + LLChicletInvOfferIconCtrl::Params icon_params = p.icon; + mChicletIconCtrl = LLUICtrlFactory::create<LLChicletInvOfferIconCtrl>(icon_params); + // Let "new message" icon be on top, else it will be hidden behind chiclet icon. + addChildInBack(mChicletIconCtrl); +} + +void LLInvOfferChiclet::setSessionId(const LLUUID& session_id) +{ + setShowNewMessagesIcon( getSessionId() != session_id ); + + LLIMChiclet::setSessionId(session_id); + LLUUID notification_id = LLScriptFloaterManager::getInstance()->findNotificationId(session_id); + LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id); + if(notification) + { + setToolTip(notification->getSubstitutions()["TITLE"].asString()); + } + + if ( notification && notification->getName() == INVENTORY_USER_OFFER ) + { + mChicletIconCtrl->setValue(notification->getPayload()["from_id"]); + } + else + { + mChicletIconCtrl->setValue(LLUUID::null); + } +} + +void LLInvOfferChiclet::onMouseDown() +{ + LLScriptFloaterManager::instance().toggleScriptFloater(getSessionId()); +} + +BOOL LLInvOfferChiclet::handleMouseDown(S32 x, S32 y, MASK mask) +{ + onMouseDown(); + return LLChiclet::handleMouseDown(x, y, mask); +} + // EOF diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index 1ea141e6c4..c75ad2b546 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -148,6 +148,39 @@ protected: }; /** + * Class for displaying icon in inventory offer chiclet. + */ +class LLChicletInvOfferIconCtrl : public LLChicletAvatarIconCtrl +{ +public: + + struct Params : + public LLInitParam::Block<Params, LLChicletAvatarIconCtrl::Params> + { + Optional<std::string> default_icon; + + Params() + : default_icon("default_icon", "Generic_Object_Small") + { + avatar_id = LLUUID::null; + }; + }; + + /** + * Sets icon, if value is LLUUID::null - default icon will be set. + */ + virtual void setValue(const LLSD& value ); + +protected: + + LLChicletInvOfferIconCtrl(const Params& p); + friend class LLUICtrlFactory; + +private: + std::string mDefaultIcon; +}; + +/** * Class for displaying of speaker's voice indicator */ class LLChicletSpeakerCtrl : public LLOutputMonitorCtrl @@ -518,6 +551,17 @@ protected: friend class LLUICtrlFactory; /** + * Creates chiclet popup menu. Will create AdHoc Chat menu + * based on other participant's id. + */ + virtual void createPopupMenu(); + + /** + * Processes clicks on chiclet popup menu. + */ + virtual void onMenuItemClicked(const LLSD& user_data); + + /** * Displays popup menu. */ virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); @@ -574,6 +618,45 @@ private: }; /** + * Chiclet for inventory offer script floaters. + */ +class LLInvOfferChiclet: public LLIMChiclet +{ +public: + + struct Params : public LLInitParam::Block<Params, LLIMChiclet::Params> + { + Optional<LLChicletInvOfferIconCtrl::Params> icon; + + Params(); + }; + + /*virtual*/ void setSessionId(const LLUUID& session_id); + + /*virtual*/ void setCounter(S32 counter){} + + /*virtual*/ S32 getCounter() { return 0; } + + /** + * Toggle script floater + */ + /*virtual*/ void onMouseDown(); + + /** + * Override default handler + */ + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); + + +protected: + LLInvOfferChiclet(const Params&); + friend class LLUICtrlFactory; + +private: + LLChicletInvOfferIconCtrl* mChicletIconCtrl; +}; + +/** * Implements Group chat chiclet. */ class LLIMGroupChiclet : public LLIMChiclet, public LLGroupMgrObserver diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 9d3b92d937..eb9a2fec2f 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -60,6 +60,7 @@ #include "llbutton.h" #include "lldir.h" #include "llfloaterchat.h" +#include "llnotificationsutil.h" #include "llviewerstats.h" #include "llvfile.h" #include "lluictrlfactory.h" @@ -480,7 +481,7 @@ void LLFloaterCompileQueue::onSaveTextComplete(const LLUUID& asset_id, void* use llwarns << "Unable to save text for script." << llendl; LLSD args; args["REASON"] = std::string(LLAssetStorage::getErrorString(status)); - LLNotifications::instance().add("CompileQueueSaveText", args); + LLNotificationsUtil::add("CompileQueueSaveText", args); } } @@ -500,7 +501,7 @@ void LLFloaterCompileQueue::onSaveBytecodeComplete(const LLUUID& asset_id, void* llwarns << "Unable to save bytecode for script." << llendl; LLSD args; args["REASON"] = std::string(LLAssetStorage::getErrorString(status)); - LLNotifications::instance().add("CompileQueueSaveBytecode", args); + LLNotificationsUtil::add("CompileQueueSaveBytecode", args); } delete data; data = NULL; diff --git a/indra/newview/llconfirmationmanager.cpp b/indra/newview/llconfirmationmanager.cpp index 5813943ad3..4b73339957 100644 --- a/indra/newview/llconfirmationmanager.cpp +++ b/indra/newview/llconfirmationmanager.cpp @@ -37,7 +37,7 @@ #include "lluictrlfactory.h" // viewer includes -#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llstring.h" #include "llxmlnode.h" @@ -48,7 +48,7 @@ LLConfirmationManager::ListenerBase::~ListenerBase() static bool onConfirmAlert(const LLSD& notification, const LLSD& response, LLConfirmationManager::ListenerBase* listener) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { listener->confirmed(""); @@ -61,7 +61,7 @@ static bool onConfirmAlert(const LLSD& notification, const LLSD& response, LLCon static bool onConfirmAlertPassword(const LLSD& notification, const LLSD& response, LLConfirmationManager::ListenerBase* listener) { std::string text = response["message"].asString(); - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { @@ -83,11 +83,11 @@ void LLConfirmationManager::confirm(Type type, switch (type) { case TYPE_CLICK: - LLNotifications::instance().add("ConfirmPurchase", args, LLSD(), boost::bind(onConfirmAlert, _1, _2, listener)); + LLNotificationsUtil::add("ConfirmPurchase", args, LLSD(), boost::bind(onConfirmAlert, _1, _2, listener)); break; case TYPE_PASSWORD: - LLNotifications::instance().add("ConfirmPurchasePassword", args, LLSD(), boost::bind(onConfirmAlertPassword, _1, _2, listener)); + LLNotificationsUtil::add("ConfirmPurchasePassword", args, LLSD(), boost::bind(onConfirmAlertPassword, _1, _2, listener)); break; case TYPE_NONE: default: diff --git a/indra/newview/llcurrencyuimanager.cpp b/indra/newview/llcurrencyuimanager.cpp index 319cbf8209..544711a862 100644 --- a/indra/newview/llcurrencyuimanager.cpp +++ b/indra/newview/llcurrencyuimanager.cpp @@ -85,6 +85,7 @@ public: S32 mUSDCurrencyEstimatedCost; bool mLocalCurrencyEstimated; std::string mLocalCurrencyEstimatedCost; + bool mSupportsInternationalBilling; std::string mSiteConfirm; bool mBought; @@ -137,6 +138,7 @@ LLCurrencyUIManager::Impl::Impl(LLPanel& dialog) mError(false), mUserCurrencyBuy(2000), // note, this is a default, real value set in llfloaterbuycurrency.cpp mUserEnteredCurrencyBuy(false), + mSupportsInternationalBilling(false), mBought(false), mTransactionType(TransactionNone), mTransaction(0), mCurrencyChanged(false) @@ -207,6 +209,7 @@ void LLCurrencyUIManager::Impl::finishCurrencyInfo() if (mLocalCurrencyEstimated) { mLocalCurrencyEstimatedCost = currency["estimatedLocalCost"].asString(); + mSupportsInternationalBilling = true; } S32 newCurrencyBuy = currency["currencyBuy"].asInt(); @@ -464,6 +467,9 @@ void LLCurrencyUIManager::Impl::updateUI() mPanel.childSetTextArg("currency_est", "[LOCALAMOUNT]", getLocalEstimate()); mPanel.childSetVisible("currency_est", hasEstimate() && mUserCurrencyBuy > 0); + mPanel.childSetVisible("currency_links", mSupportsInternationalBilling); + mPanel.childSetVisible("exchange_rate_note", mSupportsInternationalBilling); + if (mPanel.childIsEnabled("buy_btn") ||mPanel.childIsVisible("currency_est") || mPanel.childIsVisible("error_web")) diff --git a/indra/newview/lldelayedgestureerror.cpp b/indra/newview/lldelayedgestureerror.cpp index 1af94b3503..411cb331a8 100644 --- a/indra/newview/lldelayedgestureerror.cpp +++ b/indra/newview/lldelayedgestureerror.cpp @@ -33,7 +33,9 @@ #include "llviewerprecompiledheaders.h" #include "lldelayedgestureerror.h" + #include <list> +#include "llnotificationsutil.h" #include "llnotify.h" #include "llcallbacklist.h" #include "llinventory.h" @@ -119,7 +121,7 @@ bool LLDelayedGestureError::doDialog(const LLErrorEntry &ent, bool uuid_ok) } - LLNotifications::instance().add(ent.mNotifyName, args); + LLNotificationsUtil::add(ent.mNotifyName, args); return true; } diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index 9bc7221dc8..c7c79401a0 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -141,11 +141,12 @@ void LLViewerDynamicTexture::preRender(BOOL clear_depth) gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); } // Set up camera - mCamera.setOrigin(*LLViewerCamera::getInstance()); - mCamera.setAxes(*LLViewerCamera::getInstance()); - mCamera.setAspect(LLViewerCamera::getInstance()->getAspect()); - mCamera.setView(LLViewerCamera::getInstance()->getView()); - mCamera.setNear(LLViewerCamera::getInstance()->getNear()); + LLViewerCamera* camera = LLViewerCamera::getInstance(); + mCamera.setOrigin(*camera); + mCamera.setAxes(*camera); + mCamera.setAspect(camera->getAspect()); + mCamera.setView(camera->getView()); + mCamera.setNear(camera->getNear()); glViewport(mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight); if (clear_depth) @@ -174,11 +175,12 @@ void LLViewerDynamicTexture::postRender(BOOL success) gViewerWindow->setup2DViewport(); // restore camera - LLViewerCamera::getInstance()->setOrigin(mCamera); - LLViewerCamera::getInstance()->setAxes(mCamera); - LLViewerCamera::getInstance()->setAspect(mCamera.getAspect()); - LLViewerCamera::getInstance()->setView(mCamera.getView()); - LLViewerCamera::getInstance()->setNear(mCamera.getNear()); + LLViewerCamera* camera = LLViewerCamera::getInstance(); + camera->setOrigin(mCamera); + camera->setAxes(mCamera); + camera->setAspect(mCamera.getAspect()); + camera->setView(mCamera.getView()); + camera->setNear(mCamera.getNear()); } //----------------------------------------------------------------------------- diff --git a/indra/newview/lleventnotifier.cpp b/indra/newview/lleventnotifier.cpp index da20766e7e..b64799bd86 100644 --- a/indra/newview/lleventnotifier.cpp +++ b/indra/newview/lleventnotifier.cpp @@ -34,6 +34,7 @@ #include "lleventnotifier.h" +#include "llnotificationsutil.h" #include "message.h" #include "llnotify.h" @@ -81,7 +82,7 @@ void LLEventNotifier::update() LLSD args; args["NAME"] = np->getEventName(); args["DATE"] = np->getEventDateStr(); - LLNotifications::instance().add("EventNotification", args, LLSD(), + LLNotificationsUtil::add("EventNotification", args, LLSD(), boost::bind(&LLEventNotification::handleResponse, np, _1, _2)); mEventNotifications.erase(iter++); } @@ -185,7 +186,7 @@ LLEventNotification::~LLEventNotification() bool LLEventNotification::handleResponse(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch (option) { case 0: @@ -196,7 +197,7 @@ bool LLEventNotification::handleResponse(const LLSD& notification, const LLSD& r break; } case 1: - LLFloaterReg::showInstance("search", LLSD().insert("category", "events").insert("id", S32(getEventID()))); + LLFloaterReg::showInstance("search", LLSD().with("category", "events").with("id", S32(getEventID()))); break; case 2: break; diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 7a71802ae7..698d8572aa 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1378,7 +1378,8 @@ F32 LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) LLVector3 center = getPositionAgent(); LLVector3 size = (mExtents[1] - mExtents[0]) * 0.5f; - LLVector3 lookAt = center - LLViewerCamera::getInstance()->getOrigin(); + LLViewerCamera* camera = LLViewerCamera::getInstance(); + LLVector3 lookAt = center - camera->getOrigin(); F32 dist = lookAt.normVec() ; //get area of circle around node @@ -1393,7 +1394,7 @@ F32 LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) } else { - cos_angle_to_view_dir = lookAt * LLViewerCamera::getInstance()->getXAxis() ; + cos_angle_to_view_dir = lookAt * camera->getXAxis() ; mImportanceToCamera = LLFace::calcImportanceToCamera(cos_angle_to_view_dir, dist) ; } @@ -1443,8 +1444,9 @@ F32 LLFace::calcImportanceToCamera(F32 cos_angle_to_view_dir, F32 dist) if(cos_angle_to_view_dir > LLViewerCamera::getInstance()->getCosHalfFov() && dist < FACE_IMPORTANCE_TO_CAMERA_OVER_DISTANCE[FACE_IMPORTANCE_LEVEL - 1][0]) { - F32 camera_moving_speed = LLViewerCamera::getInstance()->getAverageSpeed() ; - F32 camera_angular_speed = LLViewerCamera::getInstance()->getAverageAngularSpeed(); + LLViewerCamera* camera = LLViewerCamera::getInstance(); + F32 camera_moving_speed = camera->getAverageSpeed() ; + F32 camera_angular_speed = camera->getAverageAngularSpeed(); if(camera_moving_speed > 10.0f || camera_angular_speed > 1.0f) { diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 8406ddeeca..17b0710813 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -355,8 +355,8 @@ struct LLFavoritesSort }; LLFavoritesBarCtrl::Params::Params() -: chevron_button_tool_tip("chevron_button_tool_tip"), - image_drag_indication("image_drag_indication") +: image_drag_indication("image_drag_indication"), + chevron_button("chevron_button") { } @@ -365,7 +365,6 @@ LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p) mFont(p.font.isProvided() ? p.font() : LLFontGL::getFontSansSerifSmall()), mPopupMenuHandle(), mInventoryItemsPopupMenuHandle(), - mChevronButtonToolTip(p.chevron_button_tool_tip), mImageDragIndication(p.image_drag_indication), mShowDragMarker(FALSE), mLandingTab(NULL), @@ -381,6 +380,12 @@ LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p) boost::bind(&LLFavoritesBarCtrl::enableSelected, this, _2)); gInventory.addObserver(this); + + //make chevron button + LLButton::Params chevron_button_params(p.chevron_button); + chevron_button_params.click_callback.function(boost::bind(&LLFavoritesBarCtrl::showDropDownMenu, this)); + mChevronButton = LLUICtrlFactory::create<LLButton> (chevron_button_params); + addChild(mChevronButton); } LLFavoritesBarCtrl::~LLFavoritesBarCtrl() @@ -653,10 +658,6 @@ void LLFavoritesBarCtrl::updateButtons(U32 bar_width) buttonXMLNode->getAttributeS32("left", buttonHGap); S32 count = mItems.count(); - - const S32 buttonHPad = LLUI::sSettingGroups["config"]->getS32("ButtonHPad"); - const S32 chevron_button_width = mFont->getWidth(">>") + buttonHPad * 2; - S32 buttons_space = bar_width - buttonHGap; S32 first_drop_down_item = count; @@ -670,7 +671,7 @@ void LLFavoritesBarCtrl::updateButtons(U32 bar_width) { // There is no space for all buttons. // Calculating the number of buttons, that are fit with chevron button - buttons_space -= chevron_button_width + buttonHGap; + buttons_space -= mChevronButton->getRect().getWidth() + buttonHGap; while (i >= 0 && buttons_width > buttons_space) { buttons_width -= buttonWidth + buttonHGap; @@ -718,7 +719,7 @@ void LLFavoritesBarCtrl::updateButtons(U32 bar_width) child_list_const_iter_t cur_it = child_it++; LLView* viewp = *cur_it; LLButton* button = dynamic_cast<LLButton*>(viewp); - if (button) + if (button && (button != mChevronButton)) { removeChild(button); delete button; @@ -732,55 +733,15 @@ void LLFavoritesBarCtrl::updateButtons(U32 bar_width) if (mFirstDropDownItem != count) { // Chevron button should stay right aligned - LLView *chevron_button = findChildView(std::string(">>"), FALSE); - if (chevron_button) - { - LLRect rect; - rect.setOriginAndSize(bar_width - chevron_button_width - buttonHGap, 0, chevron_button_width, getRect().getHeight()); - chevron_button->setRect(rect); - chevron_button->setVisible(TRUE); - mChevronRect = rect; - } - else - { - static LLButton::Params default_button_params(LLUICtrlFactory::getDefaultParams<LLButton>()); - std::string flat_icon = "transparent.j2c"; - std::string hover_icon = default_button_params.image_unselected.name; - std::string hover_icon_selected = default_button_params.image_selected.name; - - LLButton::Params bparams; - - LLRect rect; - rect.setOriginAndSize(bar_width - chevron_button_width - buttonHGap, 0, chevron_button_width, getRect().getHeight()); - - bparams.follows.flags (FOLLOWS_LEFT | FOLLOWS_BOTTOM); - bparams.image_unselected.name(flat_icon); - bparams.image_disabled.name(flat_icon); - bparams.image_selected.name(hover_icon_selected); - bparams.image_hover_selected.name(hover_icon_selected); - bparams.image_disabled_selected.name(hover_icon_selected); - bparams.image_hover_unselected.name(hover_icon); - bparams.rect (rect); - bparams.tab_stop(false); - bparams.font(mFont); - bparams.name(">>"); - bparams.label(">>"); - bparams.tool_tip(mChevronButtonToolTip); - bparams.click_callback.function(boost::bind(&LLFavoritesBarCtrl::showDropDownMenu, this)); - - addChildInBack(LLUICtrlFactory::create<LLButton> (bparams)); - - mChevronRect = rect; - } + LLRect rect; + rect.setOriginAndSize(bar_width - mChevronButton->getRect().getWidth() - buttonHGap, 0, mChevronButton->getRect().getWidth(), mChevronButton->getRect().getHeight()); + mChevronButton->setRect(rect); + mChevronButton->setVisible(TRUE); } else { // Hide chevron button if all items are visible on bar - LLView *chevron_button = findChildView(std::string(">>"), FALSE); - if (chevron_button) - { - chevron_button->setVisible(FALSE); - } + mChevronButton->setVisible(FALSE); } } @@ -917,7 +878,7 @@ void LLFavoritesBarCtrl::showDropDownMenu() if (menu->getButtonRect().isEmpty()) { - menu->setButtonRect(mChevronRect, this); + menu->setButtonRect(mChevronButton->getRect(), this); } LLMenuGL::showPopup(this, menu, getRect().getWidth() - menu->getRect().getWidth(), 0); @@ -981,7 +942,7 @@ void LLFavoritesBarCtrl::showDropDownMenu() menu->buildDrawLabels(); menu->updateParent(LLMenuGL::sMenuContainer); - menu->setButtonRect(mChevronRect, this); + menu->setButtonRect(mChevronButton->getRect(), this); LLMenuGL::showPopup(this, menu, getRect().getWidth() - max_width, 0); diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index 20a324c67c..b2fe3cc651 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -33,6 +33,7 @@ #ifndef LL_LLFAVORITESBARCTRL_H #define LL_LLFAVORITESBARCTRL_H +#include "llbutton.h" #include "lluictrl.h" #include "llinventoryobserver.h" @@ -43,8 +44,8 @@ class LLFavoritesBarCtrl : public LLUICtrl, public LLInventoryObserver public: struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> { - Optional<std::string> chevron_button_tool_tip; Optional<LLUIImage*> image_drag_indication; + Optional<LLButton::Params> chevron_button; Params(); }; @@ -105,9 +106,7 @@ protected: item_names_array_t mItemNamesCache; LLUUID mSelectedItemID; - LLRect mChevronRect; - std::string mChevronButtonToolTip; LLUIImage* mImageDragIndication; private: @@ -150,6 +149,7 @@ private: BOOL mShowDragMarker; LLUICtrl* mLandingTab; LLUICtrl* mLastTab; + LLButton* mChevronButton; LLUUID mDragItemId; BOOL mStartDrag; diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index 893b12ec35..0bcdad5da1 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -36,6 +36,7 @@ // library includes #include "indra_constants.h" +#include "llnotificationsutil.h" // viewer includes #include "llagent.h" // for gAgent.inPrelude() @@ -86,7 +87,7 @@ void LLFirstUse::useBalanceIncrease(S32 delta) LLSD args; args["AMOUNT"] = llformat("%d",delta); - LLNotifications::instance().add("FirstBalanceIncrease", args); + LLNotificationsUtil::add("FirstBalanceIncrease", args); } } @@ -100,7 +101,7 @@ void LLFirstUse::useBalanceDecrease(S32 delta) LLSD args; args["AMOUNT"] = llformat("%d",-delta); - LLNotifications::instance().add("FirstBalanceDecrease", args); + LLNotificationsUtil::add("FirstBalanceDecrease", args); } } @@ -114,7 +115,7 @@ void LLFirstUse::useSit() //{ // gWarningSettings.setBOOL("FirstSit", FALSE); // - // LLNotifications::instance().add("FirstSit"); + // LLNotificationsUtil::add("FirstSit"); //} } @@ -125,7 +126,7 @@ void LLFirstUse::useMap() { gWarningSettings.setBOOL("FirstMap", FALSE); - LLNotifications::instance().add("FirstMap"); + LLNotificationsUtil::add("FirstMap"); } } @@ -142,7 +143,7 @@ void LLFirstUse::useBuild() { gWarningSettings.setBOOL("FirstBuild", FALSE); - LLNotifications::instance().add("FirstBuild"); + LLNotificationsUtil::add("FirstBuild"); } } /* @@ -153,7 +154,7 @@ void LLFirstUse::useLeftClickNoHit() { gWarningSettings.setBOOL("FirstLeftClickNoHit", FALSE); - LLNotifications::instance().add("FirstLeftClickNoHit"); + LLNotificationsUtil::add("FirstLeftClickNoHit"); } } */ @@ -167,7 +168,7 @@ void LLFirstUse::useTeleport() { gWarningSettings.setBOOL("FirstTeleport", FALSE); - LLNotifications::instance().add("FirstTeleport"); + LLNotificationsUtil::add("FirstTeleport"); } } } @@ -183,7 +184,7 @@ void LLFirstUse::useOverrideKeys() { gWarningSettings.setBOOL("FirstOverrideKeys", FALSE); - LLNotifications::instance().add("FirstOverrideKeys"); + LLNotificationsUtil::add("FirstOverrideKeys"); } } } @@ -201,7 +202,7 @@ void LLFirstUse::useAppearance() { gWarningSettings.setBOOL("FirstAppearance", FALSE); - LLNotifications::instance().add("FirstAppearance"); + LLNotificationsUtil::add("FirstAppearance"); } } @@ -212,7 +213,7 @@ void LLFirstUse::useInventory() { gWarningSettings.setBOOL("FirstInventory", FALSE); - LLNotifications::instance().add("FirstInventory"); + LLNotificationsUtil::add("FirstInventory"); } } @@ -227,7 +228,7 @@ void LLFirstUse::useSandbox() LLSD args; args["HOURS"] = llformat("%d",SANDBOX_CLEAN_FREQ); args["TIME"] = llformat("%d",SANDBOX_FIRST_CLEAN_HOUR); - LLNotifications::instance().add("FirstSandbox", args); + LLNotificationsUtil::add("FirstSandbox", args); } } @@ -238,7 +239,7 @@ void LLFirstUse::useFlexible() { gWarningSettings.setBOOL("FirstFlexible", FALSE); - LLNotifications::instance().add("FirstFlexible"); + LLNotificationsUtil::add("FirstFlexible"); } } @@ -249,7 +250,7 @@ void LLFirstUse::useDebugMenus() { gWarningSettings.setBOOL("FirstDebugMenus", FALSE); - LLNotifications::instance().add("FirstDebugMenus"); + LLNotificationsUtil::add("FirstDebugMenus"); } } @@ -260,7 +261,7 @@ void LLFirstUse::useSculptedPrim() { gWarningSettings.setBOOL("FirstSculptedPrim", FALSE); - LLNotifications::instance().add("FirstSculptedPrim"); + LLNotificationsUtil::add("FirstSculptedPrim"); } } @@ -274,6 +275,6 @@ void LLFirstUse::useMedia() // Popup removed as a short-term fix for EXT-1643. // Ultimately, the plan is to kill all First Use dialogs - //LLNotifications::instance().add("FirstMedia"); + //LLNotificationsUtil::add("FirstMedia"); } } diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 80b0a430e0..68fc69b4f7 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -269,10 +269,10 @@ LLSD LLFloaterAbout::getInfo() info["J2C_VERSION"] = LLImageJ2C::getEngineInfo(); bool want_fullname = true; info["AUDIO_DRIVER_VERSION"] = gAudiop ? LLSD(gAudiop->getDriverName(want_fullname)) : LLSD(); - info["VIVOX_VERSION"] = gVoiceClient ? gVoiceClient->getAPIVersion() : "Unknown"; + info["VIVOX_VERSION"] = gVoiceClient ? gVoiceClient->getAPIVersion() : LLTrans::getString("NotConnected"); // TODO: Implement media plugin version query - info["QT_WEBKIT_VERSION"] = "4.5.2"; + info["QT_WEBKIT_VERSION"] = "4.5.2 (version number hard-coded)"; if (gPacketsIn > 0) { @@ -312,7 +312,7 @@ public: add("getInfo", "Request an LLSD::Map containing information used to populate About box", &LLFloaterAboutListener::getInfo, - LLSD().insert("reply", LLSD())); + LLSD().with("reply", LLSD())); } private: diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp index 095fe0a220..eae2747cc9 100644 --- a/indra/newview/llfloateranimpreview.cpp +++ b/indra/newview/llfloateranimpreview.cpp @@ -38,6 +38,7 @@ #include "lldatapacker.h" #include "lldir.h" #include "lleconomy.h" +#include "llnotificationsutil.h" #include "llvfile.h" #include "llapr.h" #include "llstring.h" @@ -998,7 +999,7 @@ void LLFloaterAnimPreview::onBtnOK(void* userdata) else { llwarns << "Failure writing animation data." << llendl; - LLNotifications::instance().add("WriteAnimationFail"); + LLNotificationsUtil::add("WriteAnimationFail"); } } diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp index 9ba61ba92f..b63bcccf6b 100644 --- a/indra/newview/llfloaterauction.cpp +++ b/indra/newview/llfloaterauction.cpp @@ -46,6 +46,8 @@ #include "llagent.h" #include "llcombobox.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llnotify.h" #include "llsavedsettingsglue.h" #include "llviewertexturelist.h" @@ -251,7 +253,7 @@ void LLFloaterAuction::onClickStartAuction(void* data) FALSE); self->getWindow()->incBusyCount(); - LLNotifications::instance().add("UploadingAuctionSnapshot"); + LLNotificationsUtil::add("UploadingAuctionSnapshot"); } LLMessageSystem* msg = gMessageSystem; @@ -478,7 +480,7 @@ void LLFloaterAuction::onClickSellToAnyone(void* data) // Sell confirmation clicked bool LLFloaterAuction::onSellToAnyoneConfirmed(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { doSellToAnyone(); @@ -543,13 +545,13 @@ void auction_tga_upload_done(const LLUUID& asset_id, void* user_data, S32 status if (0 == status) { - LLNotifications::instance().add("UploadWebSnapshotDone"); + LLNotificationsUtil::add("UploadWebSnapshotDone"); } else { LLSD args; args["REASON"] = std::string(LLAssetStorage::getErrorString(status)); - LLNotifications::instance().add("UploadAuctionSnapshotFail", args); + LLNotificationsUtil::add("UploadAuctionSnapshotFail", args); } } @@ -564,12 +566,12 @@ void auction_j2c_upload_done(const LLUUID& asset_id, void* user_data, S32 status if (0 == status) { - LLNotifications::instance().add("UploadSnapshotDone"); + LLNotificationsUtil::add("UploadSnapshotDone"); } else { LLSD args; args["REASON"] = std::string(LLAssetStorage::getErrorString(status)); - LLNotifications::instance().add("UploadAuctionSnapshotFail", args); + LLNotificationsUtil::add("UploadAuctionSnapshotFail", args); } } diff --git a/indra/newview/llfloaterbuy.cpp b/indra/newview/llfloaterbuy.cpp index c8df6c6135..16a5bb63e7 100644 --- a/indra/newview/llfloaterbuy.cpp +++ b/indra/newview/llfloaterbuy.cpp @@ -46,6 +46,7 @@ #include "llfloaterreg.h" #include "llfloaterinventory.h" // for get_item_icon #include "llinventoryfunctions.h" +#include "llnotificationsutil.h" #include "llselectmgr.h" #include "llscrolllistctrl.h" #include "llviewerobject.h" @@ -99,7 +100,7 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info) if (selection->getRootObjectCount() != 1) { - LLNotifications::instance().add("BuyOneObjectOnly"); + LLNotificationsUtil::add("BuyOneObjectOnly"); return; } @@ -136,7 +137,7 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info) BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name); if (!owners_identical) { - LLNotifications::instance().add("BuyObjectOneOwner"); + LLNotificationsUtil::add("BuyObjectOneOwner"); return; } diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index a99d0c918d..39c7bc02af 100644 --- a/indra/newview/llfloaterbuycontents.cpp +++ b/indra/newview/llfloaterbuycontents.cpp @@ -49,6 +49,7 @@ #include "llinventorymodel.h" // for gInventory #include "llfloaterreg.h" #include "llfloaterinventory.h" // for get_item_icon +#include "llnotificationsutil.h" #include "llselectmgr.h" #include "llscrolllistctrl.h" #include "llviewerobject.h" @@ -95,7 +96,7 @@ void LLFloaterBuyContents::show(const LLSaleInfo& sale_info) if (selection->getRootObjectCount() != 1) { - LLNotifications::instance().add("BuyContentsOneOnly"); + LLNotificationsUtil::add("BuyContentsOneOnly"); return; } @@ -114,7 +115,7 @@ void LLFloaterBuyContents::show(const LLSaleInfo& sale_info) BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name); if (!owners_identical) { - LLNotifications::instance().add("BuyContentsOneOwner"); + LLNotificationsUtil::add("BuyContentsOneOwner"); return; } diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index 651122f20a..1642e6725e 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -38,6 +38,7 @@ #include "llcurrencyuimanager.h" #include "llfloater.h" #include "llfloaterreg.h" +#include "llnotificationsutil.h" #include "llstatusbar.h" #include "lltextbox.h" #include "llviewchildren.h" @@ -152,7 +153,7 @@ void LLFloaterBuyCurrencyUI::draw() { if (mManager.bought()) { - LLNotifications::instance().add("BuyLindenDollarSuccess"); + LLNotificationsUtil::add("BuyLindenDollarSuccess"); closeFloater(); return; } diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 976aaf8044..3a8c3ab4d2 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -48,6 +48,7 @@ #include "llframetimer.h" #include "lliconctrl.h" #include "lllineeditor.h" +#include "llnotificationsutil.h" #include "llnotify.h" #include "llparcel.h" #include "llslurl.h" @@ -215,7 +216,7 @@ void LLFloaterBuyLand::buyLand( { if(is_for_group && !gAgent.hasPowerInActiveGroup(GP_LAND_DEED)) { - LLNotifications::instance().add("OnlyOfficerCanBuyLand"); + LLNotificationsUtil::add("OnlyOfficerCanBuyLand"); return; } @@ -493,10 +494,14 @@ void LLFloaterBuyLandUI::updateCovenantInfo() LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if(!region) return; + U8 sim_access = region->getSimAccess(); + std::string rating = LLViewerRegion::accessToString(sim_access); + LLTextBox* region_name = getChild<LLTextBox>("region_name_text"); if (region_name) { - region_name->setText(region->getName()); + std::string region_name_txt = region->getName() + " ("+rating +")"; + region_name->setText(region_name_txt); } LLTextBox* region_type = getChild<LLTextBox>("region_type_text"); @@ -972,7 +977,7 @@ BOOL LLFloaterBuyLandUI::canClose() if (!can_close) { // explain to user why they can't do this, see DEV-9605 - LLNotifications::instance().add("CannotCloseFloaterBuyLand"); + LLNotificationsUtil::add("CannotCloseFloaterBuyLand"); } return can_close; } diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index 92e958b32d..764aff68c9 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -215,17 +215,38 @@ void LLFloaterCamera::onOpen(const LLSD& key) getDockTongue(), LLDockControl::TOP)); mZoom->onOpen(key); + + // Returns to previous mode, see EXT-2727(View tool should remember state). + // In case floater was just hidden and it isn't reset the mode + // just update state to current one. Else go to previous. + if ( !mClosed ) + updateState(); + else + toPrevMode(); + mClosed = FALSE; } void LLFloaterCamera::onClose(bool app_quitting) { //We don't care of camera mode if app is quitting - if(!app_quitting) - switchMode(CAMERA_CTRL_MODE_ORBIT); + if(app_quitting) + return; + // When mCurrMode is in CAMERA_CTRL_MODE_ORBIT + // switchMode won't modify mPrevMode, so force it here. + // It is needed to correctly return to previous mode on open, see EXT-2727. + if (mCurrMode == CAMERA_CTRL_MODE_ORBIT) + mPrevMode = CAMERA_CTRL_MODE_ORBIT; + + // HACK: Should always close as docked to prevent toggleInstance without calling onOpen. + if ( !isDocked() ) + setDocked(true); + switchMode(CAMERA_CTRL_MODE_ORBIT); + mClosed = TRUE; } LLFloaterCamera::LLFloaterCamera(const LLSD& val) : LLTransientDockableFloater(NULL, true, val), + mClosed(FALSE), mCurrMode(CAMERA_CTRL_MODE_ORBIT), mPrevMode(CAMERA_CTRL_MODE_ORBIT) { diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h index 4873a34e00..5d44b4944d 100644 --- a/indra/newview/llfloatercamera.h +++ b/indra/newview/llfloatercamera.h @@ -109,6 +109,7 @@ private: void assignButton2Mode(ECameraControlMode mode, const std::string& button_name); + BOOL mClosed; ECameraControlMode mPrevMode; ECameraControlMode mCurrMode; std::map<ECameraControlMode, LLButton*> mMode2Button; diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp index 2c66ab502d..1482d3fe21 100644 --- a/indra/newview/llfloaterfriends.cpp +++ b/indra/newview/llfloaterfriends.cpp @@ -49,6 +49,7 @@ #include "llavataractions.h" #include "llinventorymodel.h" #include "llnamelistctrl.h" +#include "llnotificationsutil.h" #include "llnotify.h" #include "llresmgr.h" #include "llscrolllistctrl.h" @@ -535,7 +536,7 @@ void LLPanelFriends::onMaximumSelect() { LLSD args; args["MAX_SELECT"] = llformat("%d", MAX_FRIEND_SELECT); - LLNotifications::instance().add("MaxListSelectMessage", args); + LLNotificationsUtil::add("MaxListSelectMessage", args); }; // static @@ -639,14 +640,14 @@ void LLPanelFriends::confirmModifyRights(rights_map_t& ids, EGrantRevoke command } if (command == GRANT) { - LLNotifications::instance().add("GrantModifyRights", + LLNotificationsUtil::add("GrantModifyRights", args, LLSD(), boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights)); } else { - LLNotifications::instance().add("RevokeModifyRights", + LLNotificationsUtil::add("RevokeModifyRights", args, LLSD(), boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights)); @@ -656,14 +657,14 @@ void LLPanelFriends::confirmModifyRights(rights_map_t& ids, EGrantRevoke command { if (command == GRANT) { - LLNotifications::instance().add("GrantModifyRightsMultiple", + LLNotificationsUtil::add("GrantModifyRightsMultiple", args, LLSD(), boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights)); } else { - LLNotifications::instance().add("RevokeModifyRightsMultiple", + LLNotificationsUtil::add("RevokeModifyRightsMultiple", args, LLSD(), boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights)); @@ -674,7 +675,7 @@ void LLPanelFriends::confirmModifyRights(rights_map_t& ids, EGrantRevoke command bool LLPanelFriends::modifyRightsConfirmation(const LLSD& notification, const LLSD& response, rights_map_t* rights) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if(0 == option) { sendRightsGrant(*rights); diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 0f8e4c10d7..5072bc8c82 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -168,6 +168,7 @@ LLFloaterGesture::~LLFloaterGesture() LLGestureManager::instance().removeObserver(mObserver); delete mObserver; mObserver = NULL; + gInventory.removeObserver(this); } // virtual @@ -304,7 +305,7 @@ void LLFloaterGesture::addGesture(const LLUUID& item_id , LLMultiGesture* gestur { font_style = "BOLD"; } - + item_name = gesture->mName; element["columns"][0]["column"] = "trigger"; element["columns"][0]["value"] = gesture->mTrigger; element["columns"][0]["font"]["name"] = "SANSSERIF"; diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index cd3432190b..04ba11530a 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -39,6 +39,7 @@ #include "llframetimer.h" #include "llgl.h" #include "llhost.h" +#include "llnotificationsutil.h" #include "llregionflags.h" #include "llstring.h" #include "message.h" @@ -847,17 +848,17 @@ void LLPanelGridTools::refresh() void LLPanelGridTools::onClickKickAll() { - LLNotifications::instance().add("KickAllUsers", LLSD(), LLSD(), LLPanelGridTools::confirmKick); + LLNotificationsUtil::add("KickAllUsers", LLSD(), LLSD(), LLPanelGridTools::confirmKick); } bool LLPanelGridTools::confirmKick(const LLSD& notification, const LLSD& response) { - if (LLNotification::getSelectedOption(notification, response) == 0) + if (LLNotificationsUtil::getSelectedOption(notification, response) == 0) { LLSD payload; payload["kick_message"] = response["message"].asString(); - LLNotifications::instance().add("ConfirmKick", LLSD(), payload, LLPanelGridTools::finishKick); + LLNotificationsUtil::add("ConfirmKick", LLSD(), payload, LLPanelGridTools::finishKick); } return false; } @@ -866,7 +867,7 @@ bool LLPanelGridTools::confirmKick(const LLSD& notification, const LLSD& respons // static bool LLPanelGridTools::finishKick(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) @@ -887,13 +888,13 @@ bool LLPanelGridTools::finishKick(const LLSD& notification, const LLSD& response void LLPanelGridTools::onClickFlushMapVisibilityCaches() { - LLNotifications::instance().add("FlushMapVisibilityCaches", LLSD(), LLSD(), flushMapVisibilityCachesConfirm); + LLNotificationsUtil::add("FlushMapVisibilityCaches", LLSD(), LLSD(), flushMapVisibilityCachesConfirm); } // static bool LLPanelGridTools::flushMapVisibilityCachesConfirm(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option != 0) return false; // HACK: Send this as an EstateOwnerRequest so it gets routed @@ -1101,7 +1102,7 @@ void LLPanelObjectTools::onClickDeletePublicOwnedBy() payload["avatar_id"] = mTargetAvatar; payload["flags"] = (S32)mSimWideDeletesFlags; - LLNotifications::instance().add( "GodDeleteAllScriptedPublicObjectsByUser", + LLNotificationsUtil::add( "GodDeleteAllScriptedPublicObjectsByUser", args, payload, callbackSimWideDeletes); @@ -1121,7 +1122,7 @@ void LLPanelObjectTools::onClickDeleteAllScriptedOwnedBy() payload["avatar_id"] = mTargetAvatar; payload["flags"] = (S32)mSimWideDeletesFlags; - LLNotifications::instance().add( "GodDeleteAllScriptedObjectsByUser", + LLNotificationsUtil::add( "GodDeleteAllScriptedObjectsByUser", args, payload, callbackSimWideDeletes); @@ -1141,7 +1142,7 @@ void LLPanelObjectTools::onClickDeleteAllOwnedBy() payload["avatar_id"] = mTargetAvatar; payload["flags"] = (S32)mSimWideDeletesFlags; - LLNotifications::instance().add( "GodDeleteAllObjectsByUser", + LLNotificationsUtil::add( "GodDeleteAllObjectsByUser", args, payload, callbackSimWideDeletes); @@ -1151,7 +1152,7 @@ void LLPanelObjectTools::onClickDeleteAllOwnedBy() // static bool LLPanelObjectTools::callbackSimWideDeletes( const LLSD& notification, const LLSD& response ) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { if (!notification["payload"]["avatar_id"].asUUID().isNull()) @@ -1334,7 +1335,7 @@ void LLPanelRequestTools::onClickRequest() void terrain_download_done(void** data, S32 status, LLExtStat ext_status) { - LLNotifications::instance().add("TerrainDownloaded"); + LLNotificationsUtil::add("TerrainDownloaded"); } diff --git a/indra/newview/llfloaterhud.cpp b/indra/newview/llfloaterhud.cpp index 047dc2fa92..14cff3bcc3 100644 --- a/indra/newview/llfloaterhud.cpp +++ b/indra/newview/llfloaterhud.cpp @@ -40,6 +40,7 @@ #include "llalertdialog.h" // Linden libs +#include "llnotificationsutil.h" #include "lluictrlfactory.h" @@ -56,7 +57,7 @@ LLFloaterHUD::LLFloaterHUD(const LLSD& key) // do not build the floater if there the url is empty if (gSavedSettings.getString("TutorialURL") == "") { - LLNotifications::instance().add("TutorialNotFound"); + LLNotificationsUtil::add("TutorialNotFound"); return; } diff --git a/indra/newview/llfloaterinventory.cpp b/indra/newview/llfloaterinventory.cpp index db38fc0fb3..76c0a7637c 100644 --- a/indra/newview/llfloaterinventory.cpp +++ b/indra/newview/llfloaterinventory.cpp @@ -107,37 +107,19 @@ LLInventoryPanel* LLFloaterInventory::getPanel() // static LLFloaterInventory* LLFloaterInventory::showAgentInventory() { + // Hack to generate semi-unique key for each inventory floater. + static S32 instance_num = 0; + instance_num = (instance_num + 1) % S32_MAX; + LLFloaterInventory* iv = NULL; if (!gAgent.cameraMouselook()) { - iv = LLFloaterReg::showTypedInstance<LLFloaterInventory>("inventory", LLSD()); + iv = LLFloaterReg::showTypedInstance<LLFloaterInventory>("inventory", LLSD(instance_num)); } return iv; } // static -LLFloaterInventory* LLFloaterInventory::getActiveInventory() -{ - LLFloaterInventory* res = NULL; - LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory"); - S32 z_min = S32_MAX; - for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) - { - LLFloaterInventory* iv = dynamic_cast<LLFloaterInventory*>(*iter); - if (iv) - { - S32 z_order = gFloaterView->getZOrder(iv); - if (z_order < z_min) - { - res = iv; - z_min = z_order; - } - } - } - return res; -} - -// static void LLFloaterInventory::cleanup() { LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory"); diff --git a/indra/newview/llfloaterinventory.h b/indra/newview/llfloaterinventory.h index c0de89bff2..b661c391a7 100644 --- a/indra/newview/llfloaterinventory.h +++ b/indra/newview/llfloaterinventory.h @@ -55,11 +55,6 @@ public: BOOL postBuild(); - // Return the active inventory view if there is one. Active is - // defined as the inventory that is the closest to the front, and - // is visible. - static LLFloaterInventory* getActiveInventory(); - // This method makes sure that an inventory view exists, is // visible, and has focus. The view chosen is returned. static LLFloaterInventory* showAgentInventory(); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index d855ab1dfa..ed0f24d160 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -39,6 +39,7 @@ #include "llcachename.h" #include "llfocusmgr.h" +#include "llnotificationsutil.h" #include "llparcel.h" #include "message.h" #include "lluserauth.h" @@ -914,7 +915,7 @@ void LLPanelLandGeneral::onClickBuyPass(void* data) args["PARCEL_NAME"] = parcel_name; args["TIME"] = time; - LLNotifications::instance().add("LandBuyPass", args, LLSD(), cbBuyPass); + LLNotificationsUtil::add("LandBuyPass", args, LLSD(), cbBuyPass); } // static @@ -926,7 +927,7 @@ void LLPanelLandGeneral::onClickStartAuction(void* data) { if(parcelp->getForSale()) { - LLNotifications::instance().add("CannotStartAuctionAlreadyForSale"); + LLNotificationsUtil::add("CannotStartAuctionAlreadyForSale"); } else { @@ -939,7 +940,7 @@ void LLPanelLandGeneral::onClickStartAuction(void* data) // static bool LLPanelLandGeneral::cbBuyPass(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) { // User clicked OK @@ -1285,7 +1286,7 @@ void send_return_objects_message(S32 parcel_local_id, S32 return_type, bool LLPanelLandObjects::callbackReturnOwnerObjects(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLParcel *parcel = mParcel->getParcel(); if (0 == option) { @@ -1295,7 +1296,7 @@ bool LLPanelLandObjects::callbackReturnOwnerObjects(const LLSD& notification, co LLSD args; if (owner_id == gAgentID) { - LLNotifications::instance().add("OwnedObjectsReturned"); + LLNotificationsUtil::add("OwnedObjectsReturned"); } else { @@ -1303,7 +1304,7 @@ bool LLPanelLandObjects::callbackReturnOwnerObjects(const LLSD& notification, co gCacheName->getName(owner_id, first, last); args["FIRST"] = first; args["LAST"] = last; - LLNotifications::instance().add("OtherObjectsReturned", args); + LLNotificationsUtil::add("OtherObjectsReturned", args); } send_return_objects_message(parcel->getLocalID(), RT_OWNER); } @@ -1317,7 +1318,7 @@ bool LLPanelLandObjects::callbackReturnOwnerObjects(const LLSD& notification, co bool LLPanelLandObjects::callbackReturnGroupObjects(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLParcel *parcel = mParcel->getParcel(); if (0 == option) { @@ -1327,7 +1328,7 @@ bool LLPanelLandObjects::callbackReturnGroupObjects(const LLSD& notification, co gCacheName->getGroupName(parcel->getGroupID(), group_name); LLSD args; args["GROUPNAME"] = group_name; - LLNotifications::instance().add("GroupObjectsReturned", args); + LLNotificationsUtil::add("GroupObjectsReturned", args); send_return_objects_message(parcel->getLocalID(), RT_GROUP); } } @@ -1339,13 +1340,13 @@ bool LLPanelLandObjects::callbackReturnGroupObjects(const LLSD& notification, co bool LLPanelLandObjects::callbackReturnOtherObjects(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLParcel *parcel = mParcel->getParcel(); if (0 == option) { if (parcel) { - LLNotifications::instance().add("UnOwnedObjectsReturned"); + LLNotificationsUtil::add("UnOwnedObjectsReturned"); send_return_objects_message(parcel->getLocalID(), RT_OTHER); } } @@ -1357,7 +1358,7 @@ bool LLPanelLandObjects::callbackReturnOtherObjects(const LLSD& notification, co bool LLPanelLandObjects::callbackReturnOwnerList(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLParcel *parcel = mParcel->getParcel(); if (0 == option) { @@ -1371,12 +1372,12 @@ bool LLPanelLandObjects::callbackReturnOwnerList(const LLSD& notification, const if (mSelectedIsGroup) { args["GROUPNAME"] = mSelectedName; - LLNotifications::instance().add("GroupObjectsReturned", args); + LLNotificationsUtil::add("GroupObjectsReturned", args); } else { args["NAME"] = mSelectedName; - LLNotifications::instance().add("OtherObjectsReturned2", args); + LLNotificationsUtil::add("OtherObjectsReturned2", args); } send_return_objects_message(parcel->getLocalID(), RT_LIST, &(mSelectedOwners)); @@ -1413,11 +1414,11 @@ void LLPanelLandObjects::onClickReturnOwnerList(void* userdata) args["N"] = llformat("%d",self->mSelectedCount); if (self->mSelectedIsGroup) { - LLNotifications::instance().add("ReturnObjectsDeededToGroup", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerList, self, _1, _2)); + LLNotificationsUtil::add("ReturnObjectsDeededToGroup", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerList, self, _1, _2)); } else { - LLNotifications::instance().add("ReturnObjectsOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerList, self, _1, _2)); + LLNotificationsUtil::add("ReturnObjectsOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerList, self, _1, _2)); } } @@ -1627,14 +1628,14 @@ void LLPanelLandObjects::onClickReturnOwnerObjects(void* userdata) if (owner_id == gAgent.getID()) { - LLNotifications::instance().add("ReturnObjectsOwnedBySelf", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerObjects, panelp, _1, _2)); + LLNotificationsUtil::add("ReturnObjectsOwnedBySelf", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerObjects, panelp, _1, _2)); } else { std::string name; gCacheName->getFullName(owner_id, name); args["NAME"] = name; - LLNotifications::instance().add("ReturnObjectsOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerObjects, panelp, _1, _2)); + LLNotificationsUtil::add("ReturnObjectsOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerObjects, panelp, _1, _2)); } } @@ -1655,7 +1656,7 @@ void LLPanelLandObjects::onClickReturnGroupObjects(void* userdata) args["N"] = llformat("%d", parcel->getGroupPrimCount()); // create and show confirmation textbox - LLNotifications::instance().add("ReturnObjectsDeededToGroup", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnGroupObjects, panelp, _1, _2)); + LLNotificationsUtil::add("ReturnObjectsDeededToGroup", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnGroupObjects, panelp, _1, _2)); } // static @@ -1680,7 +1681,7 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata) gCacheName->getGroupName(parcel->getGroupID(), group_name); args["NAME"] = group_name; - LLNotifications::instance().add("ReturnObjectsNotOwnedByGroup", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOtherObjects, panelp, _1, _2)); + LLNotificationsUtil::add("ReturnObjectsNotOwnedByGroup", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOtherObjects, panelp, _1, _2)); } else { @@ -1688,7 +1689,7 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata) if (owner_id == gAgent.getID()) { - LLNotifications::instance().add("ReturnObjectsNotOwnedBySelf", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOtherObjects, panelp, _1, _2)); + LLNotificationsUtil::add("ReturnObjectsNotOwnedBySelf", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOtherObjects, panelp, _1, _2)); } else { @@ -1696,7 +1697,7 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata) gCacheName->getFullName(owner_id, name); args["NAME"] = name; - LLNotifications::instance().add("ReturnObjectsNotOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOtherObjects, panelp, _1, _2)); + LLNotificationsUtil::add("ReturnObjectsNotOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOtherObjects, panelp, _1, _2)); } } } @@ -2165,7 +2166,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata) if (!allow_other_scripts && region && region->getAllowDamage()) { - LLNotifications::instance().add("UnableToDisableOutsideScripts"); + LLNotificationsUtil::add("UnableToDisableOutsideScripts"); return; } @@ -2209,7 +2210,7 @@ void LLPanelLandOptions::onClickSet(void* userdata) if (agent_parcel->getLocalID() != selected_parcel->getLocalID()) { - LLNotifications::instance().add("MustBeInParcel"); + LLNotificationsUtil::add("MustBeInParcel"); return; } diff --git a/indra/newview/llfloatermediasettings.cpp b/indra/newview/llfloatermediasettings.cpp index 44e68d7745..16a76723eb 100644 --- a/indra/newview/llfloatermediasettings.cpp +++ b/indra/newview/llfloatermediasettings.cpp @@ -41,6 +41,7 @@ #include "lluictrlfactory.h" #include "llbutton.h" #include "llselectmgr.h" +#include "llsdutil.h" LLFloaterMediaSettings* LLFloaterMediaSettings::sInstance = NULL; @@ -57,7 +58,6 @@ LLFloaterMediaSettings::LLFloaterMediaSettings(const LLSD& key) mMultipleMedia(false), mMultipleValidMedia(false) { -// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_media_settings.xml"); } //////////////////////////////////////////////////////////////////////////////// @@ -145,15 +145,15 @@ LLFloaterMediaSettings* LLFloaterMediaSettings::getInstance() //static void LLFloaterMediaSettings::apply() { - LLSD settings; + LLSD settings; sInstance->mPanelMediaSettingsGeneral->preApply(); - sInstance->mPanelMediaSettingsGeneral->getValues( settings ); + sInstance->mPanelMediaSettingsGeneral->getValues( settings ); sInstance->mPanelMediaSettingsSecurity->preApply(); sInstance->mPanelMediaSettingsSecurity->getValues( settings ); sInstance->mPanelMediaSettingsPermissions->preApply(); - sInstance->mPanelMediaSettingsPermissions->getValues( settings ); + sInstance->mPanelMediaSettingsPermissions->getValues( settings ); LLSelectMgr::getInstance()->selectionSetMedia( LLTextureEntry::MF_HAS_MEDIA ); - LLSelectMgr::getInstance()->selectionSetMediaData(settings); + LLSelectMgr::getInstance()->selectionSetMediaData(settings); sInstance->mPanelMediaSettingsGeneral->postApply(); sInstance->mPanelMediaSettingsSecurity->postApply(); sInstance->mPanelMediaSettingsPermissions->postApply(); @@ -183,7 +183,12 @@ void LLFloaterMediaSettings::initValues( const LLSD& media_settings, bool editab sInstance->mPanelMediaSettingsPermissions-> initValues( sInstance->mPanelMediaSettingsPermissions, media_settings, editable ); - + + // Squirrel away initial values + sInstance->mInitialValues.clear(); + sInstance->mPanelMediaSettingsGeneral->getValues( sInstance->mInitialValues ); + sInstance->mPanelMediaSettingsSecurity->getValues( sInstance->mInitialValues ); + sInstance->mPanelMediaSettingsPermissions->getValues( sInstance->mInitialValues ); } //////////////////////////////////////////////////////////////////////////////// @@ -206,11 +211,10 @@ void LLFloaterMediaSettings::clearValues( bool editable) { // clean up all panels before updating sInstance->mPanelMediaSettingsGeneral ->clearValues(sInstance->mPanelMediaSettingsGeneral, editable); - sInstance->mPanelMediaSettingsSecurity ->clearValues(sInstance->mPanelMediaSettingsSecurity, editable); + sInstance->mPanelMediaSettingsSecurity ->clearValues(sInstance->mPanelMediaSettingsSecurity, editable); sInstance->mPanelMediaSettingsPermissions->clearValues(sInstance->mPanelMediaSettingsPermissions, editable); } - //////////////////////////////////////////////////////////////////////////////// // static void LLFloaterMediaSettings::onBtnOK( void* userdata ) @@ -235,7 +239,7 @@ void LLFloaterMediaSettings::onBtnApply( void* userdata ) // static void LLFloaterMediaSettings::onBtnCancel( void* userdata ) { - sInstance->closeFloater(); + sInstance->closeFloater(); } //////////////////////////////////////////////////////////////////////////////// @@ -250,7 +254,6 @@ void LLFloaterMediaSettings::onTabChanged(void* user_data, bool from_click) // void LLFloaterMediaSettings::enableOkApplyBtns( bool enable ) { - setCtrlsEnabled( enable ); childSetEnabled( "OK", enable ); childSetEnabled( "Apply", enable ); } @@ -265,17 +268,36 @@ const std::string LLFloaterMediaSettings::getHomeUrl() return std::string( "" ); } - //////////////////////////////////////////////////////////////////////////////// -// -bool LLFloaterMediaSettings::passesWhiteList( const std::string& test_url ) +// virtual +void LLFloaterMediaSettings::draw() { - // sanity check - don't think this can happen - if ( mPanelMediaSettingsSecurity ) - // version in security dialog code is specialized so we pass in - // empty string for first parameter since it's not used - return mPanelMediaSettingsSecurity->passesWhiteList( "", test_url ); - else - // this is all we can do - return false; + // *NOTE: The code below is very inefficient. Better to do this + // only when data change. + // Every frame, check to see what the values are. If they are not + // the same as the default media data, enable the OK/Apply buttons + LLSD settings; + sInstance->mPanelMediaSettingsGeneral->getValues( settings ); + sInstance->mPanelMediaSettingsSecurity->getValues( settings ); + sInstance->mPanelMediaSettingsPermissions->getValues( settings ); + + bool values_changed = false; + + LLSD::map_const_iterator iter = settings.beginMap(); + LLSD::map_const_iterator end = settings.endMap(); + for ( ; iter != end; ++iter ) + { + const std::string ¤t_key = iter->first; + const LLSD ¤t_value = iter->second; + if ( ! llsd_equals(current_value, mInitialValues[current_key])) + { + values_changed = true; + break; + } + } + + enableOkApplyBtns(values_changed); + + LLFloater::draw(); } + diff --git a/indra/newview/llfloatermediasettings.h b/indra/newview/llfloatermediasettings.h index 17a47cb0f5..b72e3d855d 100644 --- a/indra/newview/llfloatermediasettings.h +++ b/indra/newview/llfloatermediasettings.h @@ -54,10 +54,12 @@ public: static void apply(); static void initValues( const LLSD& media_settings , bool editable); static void clearValues( bool editable); - void enableOkApplyBtns( bool enable ); - LLPanelMediaSettingsSecurity* getPanelSecurity(){return mPanelMediaSettingsSecurity;}; - const std::string getHomeUrl(); - bool passesWhiteList( const std::string& test_url ); + + LLPanelMediaSettingsSecurity* getPanelSecurity(){return mPanelMediaSettingsSecurity;}; + const std::string getHomeUrl(); + //bool passesWhiteList( const std::string& test_url ); + + virtual void draw(); bool mIdenticalHasMediaInfo; bool mMultipleMedia; @@ -73,7 +75,6 @@ protected: LLPanelMediaSettingsSecurity* mPanelMediaSettingsSecurity; LLPanelMediaSettingsPermissions* mPanelMediaSettingsPermissions; - static void onBtnOK(void*); static void onBtnCancel(void*); static void onBtnApply(void*); @@ -83,6 +84,10 @@ protected: static LLFloaterMediaSettings* sInstance; private: + + void enableOkApplyBtns( bool enable ); + + LLSD mInitialValues; bool mWaitingToClose; }; diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp index f20fca1258..90db8988b2 100644 --- a/indra/newview/llfloaternotificationsconsole.cpp +++ b/indra/newview/llfloaternotificationsconsole.cpp @@ -233,7 +233,7 @@ void LLFloaterNotificationConsole::onClickAdd() std::string message_name = getChild<LLComboBox>("notification_types")->getValue().asString(); if (!message_name.empty()) { - LLNotifications::instance().add(message_name, LLSD()); + LLNotifications::instance().add(message_name, LLSD(), LLSD()); } } diff --git a/indra/newview/llfloaternotificationsconsole.h b/indra/newview/llfloaternotificationsconsole.h index 7349ff1d8f..a05d559eb4 100644 --- a/indra/newview/llfloaternotificationsconsole.h +++ b/indra/newview/llfloaternotificationsconsole.h @@ -35,7 +35,9 @@ #include "llfloater.h" #include "lllayoutstack.h" -#include "llnotifications.h" +//#include "llnotificationsutil.h" + +class LLNotification; class LLFloaterNotificationConsole : public LLFloater diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp index e277aba493..56a86c2cb7 100644 --- a/indra/newview/llfloateropenobject.cpp +++ b/indra/newview/llfloateropenobject.cpp @@ -41,6 +41,7 @@ #include "llcachename.h" #include "llbutton.h" +#include "llnotificationsutil.h" #include "lltextbox.h" #include "llalertdialog.h" @@ -84,7 +85,7 @@ void LLFloaterOpenObject::onOpen(const LLSD& key) LLObjectSelectionHandle object_selection = LLSelectMgr::getInstance()->getSelection(); if (object_selection->getRootObjectCount() != 1) { - LLNotifications::instance().add("UnableToViewContentsMoreThanOne"); + LLNotificationsUtil::add("UnableToViewContentsMoreThanOne"); closeFloater(); return; } @@ -141,7 +142,7 @@ void LLFloaterOpenObject::moveToInventory(bool wear) { if (mObjectSelection->getRootObjectCount() != 1) { - LLNotifications::instance().add("OnlyCopyContentsOfSingleItem"); + LLNotificationsUtil::add("OnlyCopyContentsOfSingleItem"); return; } @@ -182,7 +183,7 @@ void LLFloaterOpenObject::moveToInventory(bool wear) delete data; data = NULL; - LLNotifications::instance().add("OpenObjectCannotCopy"); + LLNotificationsUtil::add("OpenObjectCannotCopy"); } } @@ -194,10 +195,10 @@ void LLFloaterOpenObject::callbackMoveInventory(S32 result, void* data) if (result == 0) { LLFloaterInventory::showAgentInventory(); - LLFloaterInventory* view = LLFloaterInventory::getActiveInventory(); - if (view) + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); + if (active_panel) { - view->getPanel()->setSelection(cat->mCatID, TAKE_FOCUS_NO); + active_panel->setSelection(cat->mCatID, TAKE_FOCUS_NO); } } diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp index ae1a99e5fc..572eeb57fe 100644 --- a/indra/newview/llfloaterpostcard.cpp +++ b/indra/newview/llfloaterpostcard.cpp @@ -46,6 +46,7 @@ #include "llbutton.h" #include "lltexteditor.h" #include "llfloaterreg.h" +#include "llnotificationsutil.h" #include "llviewercontrol.h" #include "llviewernetwork.h" #include "lluictrlfactory.h" @@ -222,20 +223,20 @@ void LLFloaterPostcard::onClickSend(void* data) if (to.empty() || !boost::regex_match(to, emailFormat)) { - LLNotifications::instance().add("PromptRecipientEmail"); + LLNotificationsUtil::add("PromptRecipientEmail"); return; } if (from.empty() || !boost::regex_match(from, emailFormat)) { - LLNotifications::instance().add("PromptSelfEmail"); + LLNotificationsUtil::add("PromptSelfEmail"); return; } std::string subject(self->childGetValue("subject_form").asString()); if(subject.empty() || !self->mHasFirstMsgFocus) { - LLNotifications::instance().add("PromptMissingSubjMsg", LLSD(), LLSD(), boost::bind(&LLFloaterPostcard::missingSubjMsgAlertCallback, self, _1, _2)); + LLNotificationsUtil::add("PromptMissingSubjMsg", LLSD(), LLSD(), boost::bind(&LLFloaterPostcard::missingSubjMsgAlertCallback, self, _1, _2)); return; } @@ -245,7 +246,7 @@ void LLFloaterPostcard::onClickSend(void* data) } else { - LLNotifications::instance().add("ErrorProcessingSnapshot"); + LLNotificationsUtil::add("ErrorProcessingSnapshot"); } } } @@ -261,7 +262,7 @@ void LLFloaterPostcard::uploadCallback(const LLUUID& asset_id, void *user_data, { LLSD args; args["REASON"] = std::string(LLAssetStorage::getErrorString(result)); - LLNotifications::instance().add("ErrorUploadingPostcard", args); + LLNotificationsUtil::add("ErrorUploadingPostcard", args); } else { @@ -321,7 +322,7 @@ void LLFloaterPostcard::onMsgFormFocusRecieved(LLFocusableElement* receiver, voi bool LLFloaterPostcard::missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if(0 == option) { // User clicked OK diff --git a/indra/newview/llfloaterpostprocess.cpp b/indra/newview/llfloaterpostprocess.cpp index 2ab54d6e46..87a12d3d66 100644 --- a/indra/newview/llfloaterpostprocess.cpp +++ b/indra/newview/llfloaterpostprocess.cpp @@ -36,7 +36,7 @@ #include "llsliderctrl.h" #include "llcheckboxctrl.h" -#include "llcombobox.h" +#include "llnotificationsutil.h" #include "lluictrlfactory.h" #include "llviewerdisplay.h" #include "llpostprocess.h" @@ -161,7 +161,7 @@ void LLFloaterPostProcess::onSaveEffect(LLLineEditor* editBox) { LLSD payload; payload["effect_name"] = effectName; - LLNotifications::instance().add("PPSaveEffectAlert", LLSD(), payload, boost::bind(&LLFloaterPostProcess::saveAlertCallback, this, _1, _2)); + LLNotificationsUtil::add("PPSaveEffectAlert", LLSD(), payload, boost::bind(&LLFloaterPostProcess::saveAlertCallback, this, _1, _2)); } else { @@ -181,7 +181,7 @@ void LLFloaterPostProcess::onChangeEffectName(LLUICtrl* ctrl) bool LLFloaterPostProcess::saveAlertCallback(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); // if they choose save, do it. Otherwise, don't do anything if (option == 0) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index e20249a737..1c1f27a259 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -60,6 +60,9 @@ #include "llkeyboard.h" #include "llmodaldialog.h" #include "llnavigationbar.h" +#include "llnearbychat.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llpanellogin.h" #include "llradiogroup.h" #include "llsearchcombobox.h" @@ -203,7 +206,7 @@ viewer_media_t get_web_media() bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if ( option == 0 ) // YES { // clean web @@ -216,7 +219,7 @@ bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response // flag client texture cache for clearing next time the client runs gSavedSettings.setBOOL("PurgeCacheOnNextStartup", TRUE); - LLNotifications::instance().add("CacheWillClear"); + LLNotificationsUtil::add("CacheWillClear"); LLSearchHistory::getInstance()->clearHistory(); LLSearchHistory::getInstance()->save(); @@ -241,7 +244,7 @@ void handleNameTagOptionChanged(const LLSD& newvalue) bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option && floater ) { if ( floater ) @@ -256,7 +259,7 @@ bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFlo bool callback_reset_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if ( 0 == option && floater ) { if ( floater ) @@ -360,11 +363,17 @@ BOOL LLFloaterPreference::postBuild() { gSavedSettings.getControl("PlainTextChatHistory")->getSignal()->connect(boost::bind(&LLIMFloater::processChatHistoryStyleUpdate, _2)); + gSavedSettings.getControl("PlainTextChatHistory")->getSignal()->connect(boost::bind(&LLNearbyChat::processChatHistoryStyleUpdate, _2)); + LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core"); if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab"))) tabcontainer->selectFirstTab(); S32 show_avatar_nametag_options = gSavedSettings.getS32("AvatarNameTagMode"); handleNameTagOptionChanged(LLSD(show_avatar_nametag_options)); + + std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""); + childSetText("cache_location", cache_location); + return TRUE; } @@ -412,7 +421,7 @@ void LLFloaterPreference::apply() LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core"); if (sSkin != gSavedSettings.getString("SkinCurrent")) { - LLNotifications::instance().add("ChangeSkin"); + LLNotificationsUtil::add("ChangeSkin"); refreshSkin(this); } // Call apply() on all panels that derive from LLPanelPreference @@ -713,13 +722,13 @@ void LLFloaterPreference::onClickClearCache() { // flag client cache for clearing next time the client runs gSavedSettings.setBOOL("PurgeCacheOnNextStartup", TRUE); - LLNotifications::instance().add("CacheWillClear"); + LLNotificationsUtil::add("CacheWillClear"); } */ void LLFloaterPreference::onClickBrowserClearCache() { - LLNotifications::instance().add("ConfirmClearBrowserCache", LLSD(), LLSD(), callback_clear_browser_cache); + LLNotificationsUtil::add("ConfirmClearBrowserCache", LLSD(), LLSD(), callback_clear_browser_cache); } void LLFloaterPreference::onClickSetCache() @@ -739,7 +748,7 @@ void LLFloaterPreference::onClickSetCache() if (!dir_name.empty() && dir_name != cur_name) { std::string new_top_folder(gDirUtilp->getBaseFileName(dir_name)); - LLNotifications::instance().add("CacheWillBeMoved"); + LLNotificationsUtil::add("CacheWillBeMoved"); gSavedSettings.setString("NewCacheLocation", dir_name); gSavedSettings.setString("NewCacheLocationTopFolder", new_top_folder); } @@ -758,7 +767,7 @@ void LLFloaterPreference::onClickResetCache() { gSavedSettings.setString("NewCacheLocation", ""); gSavedSettings.setString("NewCacheLocationTopFolder", ""); - LLNotifications::instance().add("CacheWillBeMoved"); + LLNotificationsUtil::add("CacheWillBeMoved"); } std::string cache_location = gDirUtilp->getCacheDir(true); gSavedSettings.setString("CacheLocation", cache_location); @@ -1080,12 +1089,12 @@ void LLFloaterPreference::onClickSetMiddleMouse() void LLFloaterPreference::onClickSkipDialogs() { - LLNotifications::instance().add("SkipShowNextTimeDialogs", LLSD(), LLSD(), boost::bind(&callback_skip_dialogs, _1, _2, this)); + LLNotificationsUtil::add("SkipShowNextTimeDialogs", LLSD(), LLSD(), boost::bind(&callback_skip_dialogs, _1, _2, this)); } void LLFloaterPreference::onClickResetDialogs() { - LLNotifications::instance().add("ResetShowNextTimeDialogs", LLSD(), LLSD(), boost::bind(&callback_reset_dialogs, _1, _2, this)); + LLNotificationsUtil::add("ResetShowNextTimeDialogs", LLSD(), LLSD(), boost::bind(&callback_reset_dialogs, _1, _2, this)); } void LLFloaterPreference::onClickEnablePopup() diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 32229bd850..05a46ad894 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -64,6 +64,8 @@ #include "lllineeditor.h" #include "llalertdialog.h" #include "llnamelistctrl.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llscrolllistitem.h" #include "llsliderctrl.h" #include "llslurl.h" @@ -635,7 +637,7 @@ void LLPanelRegionGeneralInfo::onKickCommit(const std::vector<std::string>& name void LLPanelRegionGeneralInfo::onClickKickAll(void* userdata) { llinfos << "LLPanelRegionGeneralInfo::onClickKickAll" << llendl; - LLNotifications::instance().add("KickUsersFromRegion", + LLNotificationsUtil::add("KickUsersFromRegion", LLSD(), LLSD(), boost::bind(&LLPanelRegionGeneralInfo::onKickAllCommit, (LLPanelRegionGeneralInfo*)userdata, _1, _2)); @@ -643,7 +645,7 @@ void LLPanelRegionGeneralInfo::onClickKickAll(void* userdata) bool LLPanelRegionGeneralInfo::onKickAllCommit(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { strings_t strings; @@ -663,7 +665,7 @@ bool LLPanelRegionGeneralInfo::onKickAllCommit(const LLSD& notification, const L void LLPanelRegionGeneralInfo::onClickMessage(void* userdata) { llinfos << "LLPanelRegionGeneralInfo::onClickMessage" << llendl; - LLNotifications::instance().add("MessageRegion", + LLNotificationsUtil::add("MessageRegion", LLSD(), LLSD(), boost::bind(&LLPanelRegionGeneralInfo::onMessageCommit, (LLPanelRegionGeneralInfo*)userdata, _1, _2)); @@ -672,7 +674,7 @@ void LLPanelRegionGeneralInfo::onClickMessage(void* userdata) // static bool LLPanelRegionGeneralInfo::onMessageCommit(const LLSD& notification, const LLSD& response) { - if(LLNotification::getSelectedOption(notification, response) != 0) return false; + if(LLNotificationsUtil::getSelectedOption(notification, response) != 0) return false; std::string text = response["message"].asString(); if (text.empty()) return false; @@ -775,7 +777,7 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate() LLViewerRegion* region = gAgent.getRegion(); if (region && (childGetValue("access_combo").asInteger() != region->getSimAccess()) ) { - LLNotifications::instance().add("RegionMaturityChange"); + LLNotificationsUtil::add("RegionMaturityChange"); } return TRUE; @@ -882,13 +884,13 @@ void LLPanelRegionDebugInfo::onClickReturn(void* data) } payload["flags"] = int(flags); payload["return_estate_wide"] = panelp->childGetValue("return_estate_wide").asBoolean(); - LLNotifications::instance().add("EstateObjectReturn", args, payload, + LLNotificationsUtil::add("EstateObjectReturn", args, payload, boost::bind(&LLPanelRegionDebugInfo::callbackReturn, panelp, _1, _2)); } bool LLPanelRegionDebugInfo::callbackReturn(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option != 0) return false; LLUUID target_avatar = notification["payload"]["avatar_id"].asUUID(); @@ -948,13 +950,13 @@ void LLPanelRegionDebugInfo::onClickTopScripts(void* data) // static void LLPanelRegionDebugInfo::onClickRestart(void* data) { - LLNotifications::instance().add("ConfirmRestart", LLSD(), LLSD(), + LLNotificationsUtil::add("ConfirmRestart", LLSD(), LLSD(), boost::bind(&LLPanelRegionDebugInfo::callbackRestart, (LLPanelRegionDebugInfo*)data, _1, _2)); } bool LLPanelRegionDebugInfo::callbackRestart(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option != 0) return false; strings_t strings; @@ -1122,7 +1124,7 @@ BOOL LLPanelRegionTextureInfo::validateTextureSizes() LLSD args; args["TEXTURE_NUM"] = i+1; args["TEXTURE_BIT_DEPTH"] = llformat("%d",components * 8); - LLNotifications::instance().add("InvalidTerrainBitDepth", args); + LLNotificationsUtil::add("InvalidTerrainBitDepth", args); return FALSE; } @@ -1133,7 +1135,7 @@ BOOL LLPanelRegionTextureInfo::validateTextureSizes() args["TEXTURE_NUM"] = i+1; args["TEXTURE_SIZE_X"] = width; args["TEXTURE_SIZE_Y"] = height; - LLNotifications::instance().add("InvalidTerrainSize", args); + LLNotificationsUtil::add("InvalidTerrainSize", args); return FALSE; } @@ -1311,21 +1313,18 @@ void LLPanelRegionTerrainInfo::onClickUploadRaw(void* data) LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); self->sendEstateOwnerMessage(gMessageSystem, "terrain", invoice, strings); - LLNotifications::instance().add("RawUploadStarted"); + LLNotificationsUtil::add("RawUploadStarted"); } // static void LLPanelRegionTerrainInfo::onClickBakeTerrain(void* data) { - LLNotification::Params::Functor functor_params; - functor_params.function(boost::bind(&LLPanelRegionTerrainInfo::callbackBakeTerrain, (LLPanelRegionTerrainInfo*)data, _1, _2)); - - LLNotifications::instance().add(LLNotification::Params("ConfirmBakeTerrain").functor(functor_params)); + LLNotificationsUtil::add("ConfirmBakeTerrain", LLSD(), LLSD(), boost::bind(&LLPanelRegionTerrainInfo::callbackBakeTerrain, (LLPanelRegionTerrainInfo*)data, _1, _2)); } bool LLPanelRegionTerrainInfo::callbackBakeTerrain(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option != 0) return false; strings_t strings; @@ -1412,7 +1411,7 @@ void LLPanelEstateInfo::onClickAddAllowedAgent(void* user_data) LLSD args; args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); - LLNotifications::instance().add("MaxAllowedAgentOnRegion", args); + LLNotificationsUtil::add("MaxAllowedAgentOnRegion", args); return; } accessAddCore(ESTATE_ACCESS_ALLOWED_AGENT_ADD, "EstateAllowedAgentAdd"); @@ -1432,7 +1431,7 @@ void LLPanelEstateInfo::onClickAddAllowedGroup() { LLSD args; args["MAX_GROUPS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); - LLNotifications::instance().add("MaxAllowedGroupsOnRegion", args); + LLNotificationsUtil::add("MaxAllowedGroupsOnRegion", args); return; } @@ -1450,7 +1449,7 @@ void LLPanelEstateInfo::onClickAddAllowedGroup() bool LLPanelEstateInfo::addAllowedGroup(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option != 0) return false; LLFloater* parent_floater = gFloaterView->getParentFloater(this); @@ -1487,7 +1486,7 @@ void LLPanelEstateInfo::onClickAddBannedAgent(void* user_data) { LLSD args; args["MAX_BANNED"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); - LLNotifications::instance().add("MaxBannedAgentsOnRegion", args); + LLNotificationsUtil::add("MaxBannedAgentsOnRegion", args); return; } accessAddCore(ESTATE_ACCESS_BANNED_AGENT_ADD, "EstateBannedAgentAdd"); @@ -1509,7 +1508,7 @@ void LLPanelEstateInfo::onClickAddEstateManager(void* user_data) { // Tell user they can't add more managers LLSD args; args["MAX_MANAGER"] = llformat("%d",ESTATE_MAX_MANAGERS); - LLNotifications::instance().add("MaxManagersOnRegion", args); + LLNotificationsUtil::add("MaxManagersOnRegion", args); } else { // Go pick managers to add @@ -1567,13 +1566,13 @@ void LLPanelEstateInfo::onKickUserCommit(const std::vector<std::string>& names, args["EVIL_USER"] = names[0]; LLSD payload; payload["agent_id"] = ids[0]; - LLNotifications::instance().add("EstateKickUser", args, payload, boost::bind(&LLPanelEstateInfo::kickUserConfirm, self, _1, _2)); + LLNotificationsUtil::add("EstateKickUser", args, payload, boost::bind(&LLPanelEstateInfo::kickUserConfirm, self, _1, _2)); } bool LLPanelEstateInfo::kickUserConfirm(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch(option) { case 0: @@ -1722,7 +1721,7 @@ void LLPanelEstateInfo::accessAddCore(U32 operation_flag, const std::string& dia // static bool LLPanelEstateInfo::accessAddCore2(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option != 0) { // abort change @@ -1766,7 +1765,7 @@ void LLPanelEstateInfo::accessAddCore3(const std::vector<std::string>& names, co args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); args["LIST_TYPE"] = "Allowed Residents"; args["NUM_EXCESS"] = llformat("%d",(ids.size()+currentCount)-ESTATE_MAX_ACCESS_IDS); - LLNotifications::instance().add("MaxAgentOnRegionBatch", args); + LLNotificationsUtil::add("MaxAgentOnRegionBatch", args); delete change_info; return; } @@ -1782,7 +1781,7 @@ void LLPanelEstateInfo::accessAddCore3(const std::vector<std::string>& names, co args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); args["LIST_TYPE"] = "Banned Residents"; args["NUM_EXCESS"] = llformat("%d",(ids.size()+currentCount)-ESTATE_MAX_ACCESS_IDS); - LLNotifications::instance().add("MaxAgentOnRegionBatch", args); + LLNotificationsUtil::add("MaxAgentOnRegionBatch", args); delete change_info; return; } @@ -1851,7 +1850,7 @@ void LLPanelEstateInfo::accessRemoveCore(U32 operation_flag, const std::string& // static bool LLPanelEstateInfo::accessRemoveCore2(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option != 0) { // abort @@ -1868,7 +1867,7 @@ bool LLPanelEstateInfo::accessRemoveCore2(const LLSD& notification, const LLSD& { LLSD args; args["ALL_ESTATES"] = all_estates_text(); - LLNotifications::instance().add(notification["payload"]["dialog_name"], + LLNotificationsUtil::add(notification["payload"]["dialog_name"], args, notification["payload"], accessCoreConfirm); @@ -1881,7 +1880,7 @@ bool LLPanelEstateInfo::accessRemoveCore2(const LLSD& notification, const LLSD& // static bool LLPanelEstateInfo::accessCoreConfirm(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); const U32 originalFlags = (U32)notification["payload"]["operation"].asInteger(); LLViewerRegion* region = gAgent.getRegion(); @@ -1900,7 +1899,7 @@ bool LLPanelEstateInfo::accessCoreConfirm(const LLSD& notification, const LLSD& if (((U32)notification["payload"]["operation"].asInteger() & ESTATE_ACCESS_BANNED_AGENT_ADD) && region && (region->getOwner() == id)) { - LLNotifications::instance().add("OwnerCanNotBeDenied"); + LLNotificationsUtil::add("OwnerCanNotBeDenied"); break; } switch(option) @@ -2162,7 +2161,7 @@ BOOL LLPanelEstateInfo::sendUpdate() bool LLPanelEstateInfo::callbackChangeLindenEstate(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch(option) { case 0: @@ -2551,12 +2550,12 @@ BOOL LLPanelEstateInfo::checkSunHourSlider(LLUICtrl* child_ctrl) void LLPanelEstateInfo::onClickMessageEstate(void* userdata) { llinfos << "LLPanelEstateInfo::onClickMessageEstate" << llendl; - LLNotifications::instance().add("MessageEstate", LLSD(), LLSD(), boost::bind(&LLPanelEstateInfo::onMessageCommit, (LLPanelEstateInfo*)userdata, _1, _2)); + LLNotificationsUtil::add("MessageEstate", LLSD(), LLSD(), boost::bind(&LLPanelEstateInfo::onMessageCommit, (LLPanelEstateInfo*)userdata, _1, _2)); } bool LLPanelEstateInfo::onMessageCommit(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); std::string text = response["message"].asString(); if(option != 0) return false; if(text.empty()) return false; @@ -2685,7 +2684,7 @@ BOOL LLPanelEstateCovenant::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop { LLSD payload; payload["item_id"] = item->getUUID(); - LLNotifications::instance().add("EstateChangeCovenant", LLSD(), payload, + LLNotificationsUtil::add("EstateChangeCovenant", LLSD(), payload, LLPanelEstateCovenant::confirmChangeCovenantCallback); } break; @@ -2700,7 +2699,7 @@ BOOL LLPanelEstateCovenant::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop // static bool LLPanelEstateCovenant::confirmChangeCovenantCallback(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLInventoryItem* item = gInventory.getItem(notification["payload"]["item_id"].asUUID()); LLPanelEstateCovenant* self = LLFloaterRegionInfo::getPanelCovenant(); @@ -2720,7 +2719,7 @@ bool LLPanelEstateCovenant::confirmChangeCovenantCallback(const LLSD& notificati // static void LLPanelEstateCovenant::resetCovenantID(void* userdata) { - LLNotifications::instance().add("EstateChangeCovenant", LLSD(), LLSD(), confirmResetCovenantCallback); + LLNotificationsUtil::add("EstateChangeCovenant", LLSD(), LLSD(), confirmResetCovenantCallback); } // static @@ -2729,7 +2728,7 @@ bool LLPanelEstateCovenant::confirmResetCovenantCallback(const LLSD& notificatio LLPanelEstateCovenant* self = LLFloaterRegionInfo::getPanelCovenant(); if (!self) return false; - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch(option) { case 0: @@ -2793,7 +2792,7 @@ void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs, if( !panelp->mEditor->importBuffer( &buffer[0], file_length+1 ) ) { llwarns << "Problem importing estate covenant." << llendl; - LLNotifications::instance().add("ProblemImportingEstateCovenant"); + LLNotificationsUtil::add("ProblemImportingEstateCovenant"); } else { @@ -2813,15 +2812,15 @@ void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs, if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) { - LLNotifications::instance().add("MissingNotecardAssetID"); + LLNotificationsUtil::add("MissingNotecardAssetID"); } else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status) { - LLNotifications::instance().add("NotAllowedToViewNotecard"); + LLNotificationsUtil::add("NotAllowedToViewNotecard"); } else { - LLNotifications::instance().add("UnableToLoadNotecardAsset"); + LLNotificationsUtil::add("UnableToLoadNotecardAsset"); } llwarns << "Problem loading notecard: " << status << llendl; diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 1002697fe5..1f3bd50d5b 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -42,6 +42,7 @@ #include "llfontgl.h" #include "llgl.h" // for renderer #include "llinventory.h" +#include "llnotificationsutil.h" #include "llstring.h" #include "llsys.h" #include "llversionviewer.h" @@ -123,11 +124,11 @@ void LLFloaterReporter::processRegionInfo(LLMessageSystem* msg) if ( email_to_estate_owner ) { - LLNotifications::instance().add("HelpReportAbuseEmailEO"); + LLNotificationsUtil::add("HelpReportAbuseEmailEO"); } else { - LLNotifications::instance().add("HelpReportAbuseEmailLL"); + LLNotificationsUtil::add("HelpReportAbuseEmailLL"); } }; } @@ -379,7 +380,7 @@ void LLFloaterReporter::onClickSend(void *userdata) category_value == IP_CONTENT_REMOVAL || category_value == IP_PERMISSONS_EXPLOIT) { - LLNotifications::instance().add("HelpReportAbuseContainsCopyright"); + LLNotificationsUtil::add("HelpReportAbuseContainsCopyright"); self->mCopyrightWarningSeen = TRUE; return; } @@ -388,7 +389,7 @@ void LLFloaterReporter::onClickSend(void *userdata) { // IP_CONTENT_REMOVAL *always* shows the dialog - // ergo you can never send that abuse report type. - LLNotifications::instance().add("HelpReportAbuseContainsCopyright"); + LLNotificationsUtil::add("HelpReportAbuseContainsCopyright"); return; } @@ -524,39 +525,39 @@ bool LLFloaterReporter::validateReport() U8 category = (U8)category_sd.asInteger(); if (category == 0) { - LLNotifications::instance().add("HelpReportAbuseSelectCategory"); + LLNotificationsUtil::add("HelpReportAbuseSelectCategory"); return false; } if ( childGetText("abuser_name_edit").empty() ) { - LLNotifications::instance().add("HelpReportAbuseAbuserNameEmpty"); + LLNotificationsUtil::add("HelpReportAbuseAbuserNameEmpty"); return false; }; if ( childGetText("abuse_location_edit").empty() ) { - LLNotifications::instance().add("HelpReportAbuseAbuserLocationEmpty"); + LLNotificationsUtil::add("HelpReportAbuseAbuserLocationEmpty"); return false; }; if ( childGetText("abuse_location_edit").empty() ) { - LLNotifications::instance().add("HelpReportAbuseAbuserLocationEmpty"); + LLNotificationsUtil::add("HelpReportAbuseAbuserLocationEmpty"); return false; }; if ( childGetText("summary_edit").empty() ) { - LLNotifications::instance().add("HelpReportAbuseSummaryEmpty"); + LLNotificationsUtil::add("HelpReportAbuseSummaryEmpty"); return false; }; if ( childGetText("details_edit") == mDefaultSummary ) { - LLNotifications::instance().add("HelpReportAbuseDetailsEmpty"); + LLNotificationsUtil::add("HelpReportAbuseDetailsEmpty"); return false; }; return true; @@ -829,7 +830,7 @@ void LLFloaterReporter::uploadDoneCallback(const LLUUID &uuid, void *user_data, { LLSD args; args["REASON"] = std::string(LLAssetStorage::getErrorString(result)); - LLNotifications::instance().add("ErrorUploadingReportScreenshot", args); + LLNotificationsUtil::add("ErrorUploadingReportScreenshot", args); std::string err_msg("There was a problem uploading a report screenshot"); err_msg += " due to the following reason: " + args["REASON"].asString(); diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index e2df2ffdf7..4d3724a758 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -37,9 +37,11 @@ #include "lllogininstance.h" #include "lluri.h" #include "llagent.h" +#include "llui.h" LLFloaterSearch::LLFloaterSearch(const LLSD& key) : LLFloater(key), + LLViewerMediaObserver(), mBrowser(NULL) { // declare a map that transforms a category name into @@ -139,6 +141,9 @@ void LLFloaterSearch::search(const LLSD &key) } url += "&r=" + maturity; + // add the current localization information + url += "&lang=" + LLUI::getLanguage(); + // and load the URL in the web view mBrowser->navigateTo(url); } diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp index 2d8ccd1aef..49e8f9c956 100644 --- a/indra/newview/llfloatersellland.cpp +++ b/indra/newview/llfloatersellland.cpp @@ -37,6 +37,8 @@ #include "llfloaterreg.h" #include "llfloaterland.h" #include "lllineeditor.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llnotify.h" #include "llparcel.h" #include "llselectmgr.h" @@ -425,7 +427,7 @@ void LLFloaterSellLandUI::doShowObjects(void *userdata) send_parcel_select_objects(parcel->getLocalID(), RT_SELL); - LLNotifications::instance().add("TransferObjectsHighlighted", + LLNotificationsUtil::add("TransferObjectsHighlighted", LLSD(), LLSD(), &LLFloaterSellLandUI::callbackHighlightTransferable); } @@ -460,7 +462,7 @@ void LLFloaterSellLandUI::doSellLand(void *userdata) && (sale_price == 0) && sell_to_anyone) { - LLNotifications::instance().add("SalePriceRestriction"); + LLNotificationsUtil::add("SalePriceRestriction"); return; } @@ -493,7 +495,7 @@ void LLFloaterSellLandUI::doSellLand(void *userdata) bool LLFloaterSellLandUI::onConfirmSale(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option != 0) { return false; diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 1cc7042c3a..dbecd45d1f 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -76,6 +76,7 @@ #include "llimagebmp.h" #include "llimagej2c.h" #include "lllocalcliprect.h" +#include "llnotificationsutil.h" #include "llresmgr.h" // LLLocale #include "llvfile.h" #include "llvfs.h" @@ -993,7 +994,7 @@ void LLSnapshotLivePreview::saveTexture() } else { - LLNotifications::instance().add("ErrorEncodingSnapshot"); + LLNotificationsUtil::add("ErrorEncodingSnapshot"); llwarns << "Error encoding snapshot" << llendl; } diff --git a/indra/newview/llfloatertestinspectors.cpp b/indra/newview/llfloatertestinspectors.cpp index 09996b0b92..58d5197eaa 100644 --- a/indra/newview/llfloatertestinspectors.cpp +++ b/indra/newview/llfloatertestinspectors.cpp @@ -82,12 +82,12 @@ void LLFloaterTestInspectors::showAvatarInspector(LLUICtrl*, const LLSD& avatar_ id = avatar_id.asUUID(); } // spawns off mouse position automatically - LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", id)); + LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", id)); } void LLFloaterTestInspectors::showObjectInspector(LLUICtrl*, const LLSD& object_id) { - LLFloaterReg::showInstance("inspect_object", LLSD().insert("object_id", object_id)); + LLFloaterReg::showInstance("inspect_object", LLSD().with("object_id", object_id)); } void LLFloaterTestInspectors::onClickAvatar2D() diff --git a/indra/newview/llfloatertestlistview.cpp b/indra/newview/llfloatertestlistview.cpp index 5c942d0ed9..7171449738 100644 --- a/indra/newview/llfloatertestlistview.cpp +++ b/indra/newview/llfloatertestlistview.cpp @@ -33,45 +33,9 @@ #include "llfloatertestlistview.h" -// Viewer includes -#include "lllistview.h" - -// Linden library includes -//#include "lluictrlfactory.h" - LLFloaterTestListView::LLFloaterTestListView(const LLSD& seed) -: LLFloater(seed), - mListView(NULL) -{ - // set up named callback functions for test buttons - mCommitCallbackRegistrar.add("TestListView.Test1", - boost::bind(&LLFloaterTestListView::onClickTest1, this)); - mCommitCallbackRegistrar.add("TestListView.Test2", - boost::bind(&LLFloaterTestListView::onClickTest2, this)); -} +: LLFloater(seed) +{} LLFloaterTestListView::~LLFloaterTestListView() {} - -BOOL LLFloaterTestListView::postBuild() -{ - mListView = getChild<LLListView>("test_list_view"); - // just set a random property - mListView->setString("set programmatically"); - return LLFloater::postBuild(); -} - -void LLFloaterTestListView::onListViewChanged() -{ - llinfos << "list view changed" << llendl; -} - -void LLFloaterTestListView::onClickTest1() -{ - llinfos << "test 1" << llendl; -} - -void LLFloaterTestListView::onClickTest2() -{ - llinfos << "test 2" << llendl; -} diff --git a/indra/newview/llfloatertestlistview.h b/indra/newview/llfloatertestlistview.h index 053da95def..0c47c2ee31 100644 --- a/indra/newview/llfloatertestlistview.h +++ b/indra/newview/llfloatertestlistview.h @@ -34,31 +34,16 @@ #include "llfloater.h" -class LLListView; class LLSD; class LLFloaterTestListView : public LLFloater { friend class LLFloaterReg; -public: - // nothing yet private: // Construction handled by LLFloaterReg LLFloaterTestListView(const LLSD& seed); ~LLFloaterTestListView(); - - /*virtual*/ BOOL postBuild(); - - // Perform some debug action when the list-view sends change notification - void onListViewChanged(); - - // Debug function hookups for buttons - void onClickTest1(); - void onClickTest2(); - -private: - LLListView* mListView; }; #endif diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index dbd3643742..6ba032c152 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -52,6 +52,7 @@ #include "llmediaentry.h" #include "llmediactrl.h" #include "llmenugl.h" +#include "llnotificationsutil.h" #include "llpanelcontents.h" #include "llpanelface.h" #include "llpanelland.h" @@ -1283,7 +1284,7 @@ void LLFloaterTools::onClickBtnAddMedia() LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); if((tool != LLToolFace::getInstance()) || LLSelectMgr::getInstance()->getSelection()->isMultipleTESelected()) { - LLNotifications::instance().add("MultipleFacesSelected",LLSD(), LLSD(), multipleFacesSelectedConfirm); + LLNotificationsUtil::add("MultipleFacesSelected",LLSD(), LLSD(), multipleFacesSelectedConfirm); } else @@ -1296,7 +1297,7 @@ void LLFloaterTools::onClickBtnAddMedia() // static bool LLFloaterTools::multipleFacesSelectedConfirm(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch( option ) { case 0: // "Yes" @@ -1322,14 +1323,14 @@ void LLFloaterTools::onClickBtnEditMedia() // called when a user wants to delete media from a prim or prim face void LLFloaterTools::onClickBtnDeleteMedia() { - LLNotifications::instance().add("DeleteMedia", LLSD(), LLSD(), deleteMediaConfirm); + LLNotificationsUtil::add("DeleteMedia", LLSD(), LLSD(), deleteMediaConfirm); } // static bool LLFloaterTools::deleteMediaConfirm(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch( option ) { case 0: // "Yes" diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp index bf5a1141a6..86992d6a31 100644 --- a/indra/newview/llfloatertopobjects.cpp +++ b/indra/newview/llfloatertopobjects.cpp @@ -41,6 +41,7 @@ #include "llbutton.h" #include "llfloatergodtools.h" #include "llfloaterreg.h" +#include "llnotificationsutil.h" #include "llparcel.h" #include "llscrolllistctrl.h" #include "llscrolllistitem.h" @@ -359,7 +360,7 @@ void LLFloaterTopObjects::doToObjects(int action, bool all) //static bool LLFloaterTopObjects::callbackReturnAll(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLFloaterTopObjects* instance = LLFloaterReg::getTypedInstance<LLFloaterTopObjects>("top_objects"); if(!instance) return false; if (option == 0) @@ -371,7 +372,7 @@ bool LLFloaterTopObjects::callbackReturnAll(const LLSD& notification, const LLSD void LLFloaterTopObjects::onReturnAll() { - LLNotifications::instance().add("ReturnAllTopObjects", LLSD(), LLSD(), &callbackReturnAll); + LLNotificationsUtil::add("ReturnAllTopObjects", LLSD(), LLSD(), &callbackReturnAll); } @@ -384,7 +385,7 @@ void LLFloaterTopObjects::onReturnSelected() //static bool LLFloaterTopObjects::callbackDisableAll(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLFloaterTopObjects* instance = LLFloaterReg::getTypedInstance<LLFloaterTopObjects>("top_objects"); if(!instance) return false; if (option == 0) @@ -396,7 +397,7 @@ bool LLFloaterTopObjects::callbackDisableAll(const LLSD& notification, const LLS void LLFloaterTopObjects::onDisableAll() { - LLNotifications::instance().add("DisableAllTopObjects", LLSD(), LLSD(), callbackDisableAll); + LLNotificationsUtil::add("DisableAllTopObjects", LLSD(), LLSD(), callbackDisableAll); } void LLFloaterTopObjects::onDisableSelected() diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index 8d2d48f1af..69ee8cd547 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -40,8 +40,10 @@ // linden library includes #include "llbutton.h" +#include "llevents.h" #include "llhttpclient.h" #include "llhttpstatuscodes.h" // for HTTP_FOUND +#include "llnotificationsutil.h" #include "llradiogroup.h" #include "lltextbox.h" #include "llui.h" @@ -207,7 +209,7 @@ void LLFloaterTOS::onCancel( void* userdata ) { LLFloaterTOS* self = (LLFloaterTOS*) userdata; llinfos << "User disagrees with TOS." << llendl; - LLNotifications::instance().add("MustAgreeToLogIn", LLSD(), LLSD(), login_alert_done); + LLNotificationsUtil::add("MustAgreeToLogIn", LLSD(), LLSD(), login_alert_done); if(self->mReplyPumpName != "") { diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index a1c6704657..1e92ac0b8e 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -45,11 +45,11 @@ #include "llsdutil.h" #include "llxmltree.h" #include "llviewerwindow.h" -#include "lllivefile.h" // XUI #include "lluictrlfactory.h" #include "llcombobox.h" +#include "llnotificationsutil.h" #include "llresizebar.h" #include "llscrolllistitem.h" #include "llscrolllistctrl.h" @@ -608,7 +608,7 @@ void LLFloaterUIPreview::popupAndPrintWarning(std::string& warning) llwarns << warning << llendl; LLSD args; args["MESSAGE"] = warning; - LLNotifications::instance().add("GenericAlert", args); + LLNotificationsUtil::add("GenericAlert", args); } // Get localization string from drop-down menu diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index 2b01a56373..5e769feea6 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -37,8 +37,8 @@ #include "llpanellandmedia.h" #include "llpanelface.h" -// project includes #include "llcombobox.h" +#include "llnotificationsutil.h" #include "llurlhistory.h" #include "lluictrlfactory.h" #include "llwindow.h" @@ -263,13 +263,13 @@ void LLFloaterURLEntry::onBtnCancel( void* userdata ) //----------------------------------------------------------------------------- void LLFloaterURLEntry::onBtnClear( void* userdata ) { - LLNotifications::instance().add( "ConfirmClearMediaUrlList", LLSD(), LLSD(), + LLNotificationsUtil::add( "ConfirmClearMediaUrlList", LLSD(), LLSD(), boost::bind(&LLFloaterURLEntry::callback_clear_url_list, (LLFloaterURLEntry*)userdata, _1, _2) ); } bool LLFloaterURLEntry::callback_clear_url_list(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if ( option == 0 ) // YES { // clear saved list diff --git a/indra/newview/llfloaterwater.cpp b/indra/newview/llfloaterwater.cpp index a0fe42bf61..66a1f6701f 100644 --- a/indra/newview/llfloaterwater.cpp +++ b/indra/newview/llfloaterwater.cpp @@ -47,6 +47,7 @@ #include "llviewercamera.h" #include "llcombobox.h" #include "lllineeditor.h" +#include "llnotificationsutil.h" #include "llfloaterdaycycle.h" #include "llboost.h" #include "llmultisliderctrl.h" @@ -159,7 +160,7 @@ void LLFloaterWater::initCallbacks(void) { bool LLFloaterWater::newPromptCallback(const LLSD& notification, const LLSD& response) { std::string text = response["message"].asString(); - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if(text == "") { @@ -191,7 +192,7 @@ bool LLFloaterWater::newPromptCallback(const LLSD& notification, const LLSD& res } else { - LLNotifications::instance().add("ExistsWaterPresetAlert"); + LLNotificationsUtil::add("ExistsWaterPresetAlert"); } } return false; @@ -503,7 +504,7 @@ void LLFloaterWater::onNormalMapPicked(LLUICtrl* ctrl) void LLFloaterWater::onNewPreset() { - LLNotifications::instance().add("NewWaterPreset", LLSD(), LLSD(), boost::bind(&LLFloaterWater::newPromptCallback, this, _1, _2)); + LLNotificationsUtil::add("NewWaterPreset", LLSD(), LLSD(), boost::bind(&LLFloaterWater::newPromptCallback, this, _1, _2)); } void LLFloaterWater::onSavePreset() @@ -525,16 +526,16 @@ void LLFloaterWater::onSavePreset() comboBox->getSelectedItemLabel()); if(sIt != sDefaultPresets.end() && !gSavedSettings.getBOOL("WaterEditPresets")) { - LLNotifications::instance().add("WLNoEditDefault"); + LLNotificationsUtil::add("WLNoEditDefault"); return; } - LLNotifications::instance().add("WLSavePresetAlert", LLSD(), LLSD(), boost::bind(&LLFloaterWater::saveAlertCallback, this, _1, _2)); + LLNotificationsUtil::add("WLSavePresetAlert", LLSD(), LLSD(), boost::bind(&LLFloaterWater::saveAlertCallback, this, _1, _2)); } bool LLFloaterWater::saveAlertCallback(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); // if they choose save, do it. Otherwise, don't do anything if(option == 0) { @@ -561,12 +562,12 @@ void LLFloaterWater::onDeletePreset() LLSD args; args["SKY"] = combo_box->getSelectedValue().asString(); - LLNotifications::instance().add("WLDeletePresetAlert", args, LLSD(), boost::bind(&LLFloaterWater::deleteAlertCallback, this, _1, _2)); + LLNotificationsUtil::add("WLDeletePresetAlert", args, LLSD(), boost::bind(&LLFloaterWater::deleteAlertCallback, this, _1, _2)); } bool LLFloaterWater::deleteAlertCallback(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); // if they choose delete, do it. Otherwise, don't do anything if(option == 0) { @@ -587,7 +588,7 @@ bool LLFloaterWater::deleteAlertCallback(const LLSD& notification, const LLSD& r std::set<std::string>::iterator sIt = sDefaultPresets.find(name); if(sIt != sDefaultPresets.end()) { - LLNotifications::instance().add("WaterNoEditDefault"); + LLNotificationsUtil::add("WaterNoEditDefault"); return false; } diff --git a/indra/newview/llfloaterwhitelistentry.cpp b/indra/newview/llfloaterwhitelistentry.cpp index 551a5191fc..04dbd38153 100644 --- a/indra/newview/llfloaterwhitelistentry.cpp +++ b/indra/newview/llfloaterwhitelistentry.cpp @@ -81,7 +81,7 @@ void LLFloaterWhiteListEntry::onBtnOK( void* userdata ) { std::string white_list_item = self->mWhiteListEdit->getText(); - panel->addWhiteListItem( white_list_item ); + panel->addWhiteListEntry( white_list_item ); }; self->closeFloater(); diff --git a/indra/newview/llfloaterwindlight.cpp b/indra/newview/llfloaterwindlight.cpp index 60494f3cce..ea6fda7303 100644 --- a/indra/newview/llfloaterwindlight.cpp +++ b/indra/newview/llfloaterwindlight.cpp @@ -41,6 +41,7 @@ #include "llsliderctrl.h" #include "llmultislider.h" #include "llmultisliderctrl.h" +#include "llnotificationsutil.h" #include "llspinctrl.h" #include "llcheckboxctrl.h" #include "lluictrlfactory.h" @@ -210,7 +211,7 @@ void LLFloaterWindLight::initCallbacks(void) { bool LLFloaterWindLight::newPromptCallback(const LLSD& notification, const LLSD& response) { std::string text = response["message"].asString(); - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if(text == "") { @@ -260,7 +261,7 @@ bool LLFloaterWindLight::newPromptCallback(const LLSD& notification, const LLSD& } else { - LLNotifications::instance().add("ExistsSkyPresetAlert"); + LLNotificationsUtil::add("ExistsSkyPresetAlert"); } } return false; @@ -676,7 +677,7 @@ void LLFloaterWindLight::onStarAlphaMoved(LLUICtrl* ctrl) void LLFloaterWindLight::onNewPreset() { - LLNotifications::instance().add("NewSkyPreset", LLSD(), LLSD(), boost::bind(&LLFloaterWindLight::newPromptCallback, this, _1, _2)); + LLNotificationsUtil::add("NewSkyPreset", LLSD(), LLSD(), boost::bind(&LLFloaterWindLight::newPromptCallback, this, _1, _2)); } void LLFloaterWindLight::onSavePreset() @@ -696,19 +697,19 @@ void LLFloaterWindLight::onSavePreset() comboBox->getSelectedItemLabel()); if(sIt != sDefaultPresets.end() && !gSavedSettings.getBOOL("SkyEditPresets")) { - LLNotifications::instance().add("WLNoEditDefault"); + LLNotificationsUtil::add("WLNoEditDefault"); return; } LLWLParamManager::instance()->mCurParams.mName = comboBox->getSelectedItemLabel(); - LLNotifications::instance().add("WLSavePresetAlert", LLSD(), LLSD(), boost::bind(&LLFloaterWindLight::saveAlertCallback, this, _1, _2)); + LLNotificationsUtil::add("WLSavePresetAlert", LLSD(), LLSD(), boost::bind(&LLFloaterWindLight::saveAlertCallback, this, _1, _2)); } bool LLFloaterWindLight::saveAlertCallback(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); // if they choose save, do it. Otherwise, don't do anything if(option == 0) { @@ -734,13 +735,13 @@ void LLFloaterWindLight::onDeletePreset() LLSD args; args["SKY"] = combo_box->getSelectedValue().asString(); - LLNotifications::instance().add("WLDeletePresetAlert", args, LLSD(), + LLNotificationsUtil::add("WLDeletePresetAlert", args, LLSD(), boost::bind(&LLFloaterWindLight::deleteAlertCallback, this, _1, _2)); } bool LLFloaterWindLight::deleteAlertCallback(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); // if they choose delete, do it. Otherwise, don't do anything if(option == 0) @@ -762,7 +763,7 @@ bool LLFloaterWindLight::deleteAlertCallback(const LLSD& notification, const LLS std::set<std::string>::iterator sIt = sDefaultPresets.find(name); if(sIt != sDefaultPresets.end()) { - LLNotifications::instance().add("WLNoEditDefault"); + LLNotificationsUtil::add("WLNoEditDefault"); return false; } diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 85847e5fce..7ca491a698 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -54,6 +54,7 @@ #include "llinventoryobserver.h" #include "lllandmarklist.h" #include "lllineeditor.h" +#include "llnotificationsutil.h" #include "llregionhandle.h" #include "llscrolllistctrl.h" #include "llslurl.h" @@ -1213,7 +1214,7 @@ void LLFloaterWorldMap::onCopySLURL() LLSD args; args["SLURL"] = mSLURL; - LLNotifications::instance().add("CopySLURL", args); + LLNotificationsUtil::add("CopySLURL", args); } // protected diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index ab49739d58..4e77b42187 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -1803,15 +1803,6 @@ BOOL LLFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, return handled; } -BOOL LLFolderView::handleScrollWheel(S32 x, S32 y, S32 clicks) -{ - if (mScrollContainer) - { - return mScrollContainer->handleScrollWheel(x, y, clicks); - } - return FALSE; -} - void LLFolderView::deleteAllChildren() { if(mRenamer == gFocusMgr.getTopCtrl()) @@ -2217,9 +2208,9 @@ void LLFolderView::setFilterPermMask( PermissionMask filter_perm_mask ) mFilter->setFilterPermissions(filter_perm_mask); } -U32 LLFolderView::getFilterTypes() const +U32 LLFolderView::getFilterObjectTypes() const { - return mFilter->getFilterTypes(); + return mFilter->getFilterObjectTypes(); } PermissionMask LLFolderView::getFilterPermissions() const diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index a0e252ae88..4adf6c2fbf 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -71,9 +71,6 @@ class LLUICtrl; // that only work folders or only work on items, but I'll worry about // that later when it's determined to be too slow. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - class LLFolderViewFunctor { public: @@ -119,7 +116,7 @@ public: // filter is never null LLInventoryFilter* getFilter(); const std::string getFilterSubString(BOOL trim = FALSE); - U32 getFilterTypes() const; + U32 getFilterObjectTypes() const; PermissionMask getFilterPermissions() const; // JAMESDEBUG use getFilter()->getShowFolderState(); //LLInventoryFilter::EFolderShow getShowFolderState(); @@ -230,7 +227,6 @@ public: EAcceptance* accept, std::string& tooltip_msg); /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); virtual void draw(); virtual void deleteAllChildren(); diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index d85ac477e1..4f487ddf04 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -42,6 +42,7 @@ #include "lldatapacker.h" #include "llinventory.h" #include "llmultigesture.h" +#include "llnotificationsutil.h" #include "llstl.h" #include "llstring.h" // todo: remove #include "llvfile.h" @@ -56,6 +57,7 @@ #include "llvoavatarself.h" #include "llviewerstats.h" #include "llnearbychatbar.h" +#include "llappearancemgr.h" // Longest time, in seconds, to wait for all animations to stop playing const F32 MAX_WAIT_ANIM_SECS = 30.f; @@ -72,6 +74,7 @@ LLGestureManager::LLGestureManager() mActive(), mLoadingCount(0) { + mRetryIfMissing = true; gInventory.addObserver(this); } @@ -301,6 +304,8 @@ void LLGestureManager::deactivateGesture(const LLUUID& item_id) gAgent.sendReliableMessage(); + LLAppearanceManager::instance().removeCOFItemLinks(base_item_id, false); + notifyObservers(); } @@ -971,7 +976,7 @@ void LLGestureManager::onLoadComplete(LLVFS *vfs, // we're done with this set of deactivations LLSD args; args["NAMES"] = self.mDeactivateSimilarNames; - LLNotifications::instance().add("DeactivatedGesturesTrigger", args); + LLNotificationsUtil::add("DeactivatedGesturesTrigger", args); } } @@ -983,7 +988,9 @@ void LLGestureManager::onLoadComplete(LLVFS *vfs, else { // Watch this item and set gesture name when item exists in inventory - self.watchItem(item_id); + item_ref_t ids; + ids.push_back(item_id); + self.fetchItems(ids); } self.mActive[item_id] = gesture; @@ -1176,6 +1183,7 @@ void LLGestureManager::getItemIDs(std::vector<LLUUID>* ids) void LLGestureManager::done() { + bool notify = false; for(item_map_t::iterator it = mActive.begin(); it != mActive.end(); ++it) { if(it->second && it->second->mName.empty()) @@ -1184,10 +1192,14 @@ void LLGestureManager::done() if(item) { it->second->mName = item->getName(); + notify = true; } } } - notifyObservers(); + if(notify) + { + notifyObservers(); + } } // static diff --git a/indra/newview/llgesturemgr.h b/indra/newview/llgesturemgr.h index 094ca13798..e80eea9ae9 100644 --- a/indra/newview/llgesturemgr.h +++ b/indra/newview/llgesturemgr.h @@ -54,7 +54,7 @@ public: virtual void changed() = 0; }; -class LLGestureManager : public LLSingleton<LLGestureManager>, public LLInventoryCompletionObserver +class LLGestureManager : public LLSingleton<LLGestureManager>, public LLInventoryFetchObserver { public: diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index f4e1951c7b..fdb2b886a6 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -35,12 +35,12 @@ #include "llgroupactions.h" -// Viewer includes #include "llagent.h" #include "llcommandhandler.h" #include "llfloaterreg.h" #include "llgroupmgr.h" #include "llimview.h" // for gIMMgr +#include "llnotificationsutil.h" #include "llsidetray.h" #include "llstatusbar.h" // can_afford_transaction() #include "llimfloater.h" @@ -100,9 +100,9 @@ public: } if (tokens[1].asString() == "inspect") { - LLSD key; - key["group_id"] = group_id; - LLFloaterReg::showInstance("inspect_group", key); + if (group_id.isNull()) + return true; + LLGroupActions::show(group_id); return true; } return false; @@ -113,7 +113,7 @@ LLGroupHandler gGroupHandler; // static void LLGroupActions::search() { - LLFloaterReg::showInstance("search", LLSD().insert("category", "groups")); + LLFloaterReg::showInstance("search", LLSD().with("category", "groups")); } // static @@ -132,11 +132,11 @@ void LLGroupActions::join(const LLUUID& group_id) if (can_afford_transaction(cost)) { - LLNotifications::instance().add("JoinGroupCanAfford", args, payload, onJoinGroup); + LLNotificationsUtil::add("JoinGroupCanAfford", args, payload, onJoinGroup); } else { - LLNotifications::instance().add("JoinGroupCannotAfford", args, payload); + LLNotificationsUtil::add("JoinGroupCannotAfford", args, payload); } } else @@ -149,7 +149,7 @@ void LLGroupActions::join(const LLUUID& group_id) // static bool LLGroupActions::onJoinGroup(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 1) { @@ -181,7 +181,7 @@ void LLGroupActions::leave(const LLUUID& group_id) args["GROUP"] = gAgent.mGroups.get(i).mName; LLSD payload; payload["group_id"] = group_id; - LLNotifications::instance().add("GroupLeaveConfirmMember", args, payload, onLeaveGroup); + LLNotificationsUtil::add("GroupLeaveConfirmMember", args, payload, onLeaveGroup); } } @@ -346,7 +346,7 @@ bool LLGroupActions::isAvatarMemberOfGroup(const LLUUID& group_id, const LLUUID& // static bool LLGroupActions::onLeaveGroup(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLUUID group_id = notification["payload"]["group_id"].asUUID(); if(option == 0) { diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index cdb85f5b1c..97cf139f1d 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -329,7 +329,7 @@ void LLGroupListItem::setActive(bool active) void LLGroupListItem::onInfoBtnClick() { - LLFloaterReg::showInstance("inspect_group", LLSD().insert("group_id", mGroupID)); + LLFloaterReg::showInstance("inspect_group", LLSD().with("group_id", mGroupID)); } void LLGroupListItem::onProfileBtnClick() diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 59537c1e65..ebb5feb2bf 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -52,7 +52,7 @@ #include "llviewerwindow.h" #include "llpanelgroup.h" #include "llgroupactions.h" -#include "llnotifications.h" +#include "llnotificationsutil.h" #include "lluictrlfactory.h" #include <boost/regex.hpp> @@ -1295,7 +1295,7 @@ void LLGroupMgr::processCreateGroupReply(LLMessageSystem* msg, void ** data) // *TODO: Translate LLSD args; args["MESSAGE"] = message; - LLNotifications::instance().add("UnableToCreateGroup", args); + LLNotificationsUtil::add("UnableToCreateGroup", args); } } diff --git a/indra/newview/llhudicon.cpp b/indra/newview/llhudicon.cpp index 040027c70d..28b0e7356a 100644 --- a/indra/newview/llhudicon.cpp +++ b/indra/newview/llhudicon.cpp @@ -103,28 +103,29 @@ void LLHUDIcon::renderIcon(BOOL for_select) // put icon above object, and in front // RN: don't use drawable radius, it's fricking HUGE - LLVector3 icon_relative_pos = (LLViewerCamera::getInstance()->getUpAxis() * ~mSourceObject->getRenderRotation()); + LLViewerCamera* camera = LLViewerCamera::getInstance(); + LLVector3 icon_relative_pos = (camera->getUpAxis() * ~mSourceObject->getRenderRotation()); icon_relative_pos.abs(); F32 distance_scale = llmin(mSourceObject->getScale().mV[VX] / icon_relative_pos.mV[VX], mSourceObject->getScale().mV[VY] / icon_relative_pos.mV[VY], mSourceObject->getScale().mV[VZ] / icon_relative_pos.mV[VZ]); F32 up_distance = 0.5f * distance_scale; - LLVector3 icon_position = obj_position + (up_distance * LLViewerCamera::getInstance()->getUpAxis()) * 1.2f; + LLVector3 icon_position = obj_position + (up_distance * camera->getUpAxis()) * 1.2f; LLVector3 icon_to_cam = LLViewerCamera::getInstance()->getOrigin() - icon_position; icon_to_cam.normVec(); icon_position += icon_to_cam * mSourceObject->mDrawable->getRadius() * 1.1f; - mDistance = dist_vec(icon_position, LLViewerCamera::getInstance()->getOrigin()); + mDistance = dist_vec(icon_position, camera->getOrigin()); F32 alpha_factor = for_select ? 1.f : clamp_rescale(mDistance, DIST_START_FADE, DIST_END_FADE, 1.f, 0.f); LLVector3 x_pixel_vec; LLVector3 y_pixel_vec; - LLViewerCamera::getInstance()->getPixelVectors(icon_position, y_pixel_vec, x_pixel_vec); + camera->getPixelVectors(icon_position, y_pixel_vec, x_pixel_vec); F32 scale_factor = 1.f; if (mAnimTimer.getElapsedTimeF32() < ANIM_TIME) @@ -226,26 +227,27 @@ BOOL LLHUDIcon::lineSegmentIntersect(const LLVector3& start, const LLVector3& en // put icon above object, and in front // RN: don't use drawable radius, it's fricking HUGE - LLVector3 icon_relative_pos = (LLViewerCamera::getInstance()->getUpAxis() * ~mSourceObject->getRenderRotation()); + LLViewerCamera* camera = LLViewerCamera::getInstance(); + LLVector3 icon_relative_pos = (camera->getUpAxis() * ~mSourceObject->getRenderRotation()); icon_relative_pos.abs(); F32 distance_scale = llmin(mSourceObject->getScale().mV[VX] / icon_relative_pos.mV[VX], mSourceObject->getScale().mV[VY] / icon_relative_pos.mV[VY], mSourceObject->getScale().mV[VZ] / icon_relative_pos.mV[VZ]); F32 up_distance = 0.5f * distance_scale; - LLVector3 icon_position = obj_position + (up_distance * LLViewerCamera::getInstance()->getUpAxis()) * 1.2f; + LLVector3 icon_position = obj_position + (up_distance * camera->getUpAxis()) * 1.2f; LLVector3 icon_to_cam = LLViewerCamera::getInstance()->getOrigin() - icon_position; icon_to_cam.normVec(); icon_position += icon_to_cam * mSourceObject->mDrawable->getRadius() * 1.1f; - mDistance = dist_vec(icon_position, LLViewerCamera::getInstance()->getOrigin()); + mDistance = dist_vec(icon_position, camera->getOrigin()); LLVector3 x_pixel_vec; LLVector3 y_pixel_vec; - LLViewerCamera::getInstance()->getPixelVectors(icon_position, y_pixel_vec, x_pixel_vec); + camera->getPixelVectors(icon_position, y_pixel_vec, x_pixel_vec); F32 scale_factor = 1.f; if (mAnimTimer.getElapsedTimeF32() < ANIM_TIME) diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp index ab0be90def..a02dc3355b 100644 --- a/indra/newview/llhudrender.cpp +++ b/indra/newview/llhudrender.cpp @@ -64,11 +64,12 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, const LLColor4& color, const BOOL orthographic) { + LLViewerCamera* camera = LLViewerCamera::getInstance(); // Do cheap plane culling - LLVector3 dir_vec = pos_agent - LLViewerCamera::getInstance()->getOrigin(); + LLVector3 dir_vec = pos_agent - camera->getOrigin(); dir_vec /= dir_vec.magVec(); - if (wstr.empty() || (!orthographic && dir_vec * LLViewerCamera::getInstance()->getAtAxis() <= 0.f)) + if (wstr.empty() || (!orthographic && dir_vec * camera->getAtAxis() <= 0.f)) { return; } @@ -82,15 +83,15 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, } else { - LLViewerCamera::getInstance()->getPixelVectors(pos_agent, up_axis, right_axis); + camera->getPixelVectors(pos_agent, up_axis, right_axis); } - LLCoordFrame render_frame = *LLViewerCamera::getInstance(); + LLCoordFrame render_frame = *camera; LLQuaternion rot; if (!orthographic) { rot = render_frame.getQuaternion(); - rot = rot * LLQuaternion(-F_PI_BY_TWO, LLViewerCamera::getInstance()->getYAxis()); - rot = rot * LLQuaternion(F_PI_BY_TWO, LLViewerCamera::getInstance()->getXAxis()); + rot = rot * LLQuaternion(-F_PI_BY_TWO, camera->getYAxis()); + rot = rot * LLQuaternion(F_PI_BY_TWO, camera->getXAxis()); } else { diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index ee93a9349a..9de0b1f827 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -34,6 +34,8 @@ #include "llimfloater.h" +#include "llnotificationsutil.h" + #include "llagent.h" #include "llappviewer.h" #include "llbutton.h" @@ -42,6 +44,7 @@ #include "llchiclet.h" #include "llfloaterchat.h" #include "llfloaterreg.h" +#include "llimfloatercontainer.h" // to replace separate IM Floaters with multifloater container #include "lllineeditor.h" #include "lllogchat.h" #include "llpanelimcontrolpanel.h" @@ -53,10 +56,6 @@ #include "lltransientfloatermgr.h" #include "llinventorymodel.h" -#ifdef USE_IM_CONTAINER - #include "llimfloatercontainer.h" // to replace separate IM Floaters with multifloater container -#endif - LLIMFloater::LLIMFloater(const LLUUID& session_id) @@ -261,11 +260,14 @@ BOOL LLIMFloater::postBuild() //*TODO if session is not initialized yet, add some sort of a warning message like "starting session...blablabla" //see LLFloaterIMPanel for how it is done (IB) -#ifdef USE_IM_CONTAINER - return LLFloater::postBuild(); -#else - return LLDockableFloater::postBuild(); -#endif + if(isChatMultiTab()) + { + return LLFloater::postBuild(); + } + else + { + return LLDockableFloater::postBuild(); + } } // virtual @@ -326,59 +328,69 @@ void LLIMFloater::onSlide() //static LLIMFloater* LLIMFloater::show(const LLUUID& session_id) { -#ifdef USE_IM_CONTAINER - LLIMFloater* target_floater = findInstance(session_id); - bool not_existed = NULL == target_floater; + bool not_existed = true; -#else - //hide all - LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("impanel"); - for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); - iter != inst_list.end(); ++iter) + if(isChatMultiTab()) { - LLIMFloater* floater = dynamic_cast<LLIMFloater*>(*iter); - if (floater && floater->isDocked()) + LLIMFloater* target_floater = findInstance(session_id); + not_existed = NULL == target_floater; + } + else + { + //hide all + LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("impanel"); + for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); + iter != inst_list.end(); ++iter) { - floater->setVisible(false); + LLIMFloater* floater = dynamic_cast<LLIMFloater*>(*iter); + if (floater && floater->isDocked()) + { + floater->setVisible(false); + } } } -#endif LLIMFloater* floater = LLFloaterReg::showTypedInstance<LLIMFloater>("impanel", session_id); - floater->updateMessages(); - floater->mInputEditor->setFocus(TRUE); - -#ifdef USE_IM_CONTAINER - // do not add existed floaters to avoid adding torn off instances - if (not_existed) + if(isChatMultiTab()) { - // LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; - // TODO: mantipov: use LLTabContainer::RIGHT_OF_CURRENT if it exists - LLTabContainer::eInsertionPoint i_pt = LLTabContainer::END; + // do not add existed floaters to avoid adding torn off instances + if (not_existed) + { + // LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; + // TODO: mantipov: use LLTabContainer::RIGHT_OF_CURRENT if it exists + LLTabContainer::eInsertionPoint i_pt = LLTabContainer::END; - LLIMFloaterContainer* floater_container = LLFloaterReg::showTypedInstance<LLIMFloaterContainer>("im_container"); - floater_container->addFloater(floater, TRUE, i_pt); + LLIMFloaterContainer* floater_container = LLFloaterReg::showTypedInstance<LLIMFloaterContainer>("im_container"); + floater_container->addFloater(floater, TRUE, i_pt); + } } -#else - if (floater->getDockControl() == NULL) + else { - LLChiclet* chiclet = - LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLChiclet>( - session_id); - if (chiclet == NULL) - { - llerror("Dock chiclet for LLIMFloater doesn't exists", 0); - } - else + // Docking may move chat window, hide it before moving, or user will see how window "jumps" + floater->setVisible(false); + + if (floater->getDockControl() == NULL) { - LLBottomTray::getInstance()->getChicletPanel()->scrollToChiclet(chiclet); + LLChiclet* chiclet = + LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLChiclet>( + session_id); + if (chiclet == NULL) + { + llerror("Dock chiclet for LLIMFloater doesn't exists", 0); + } + else + { + LLBottomTray::getInstance()->getChicletPanel()->scrollToChiclet(chiclet); + } + + floater->setDockControl(new LLDockControl(chiclet, floater, floater->getDockTongue(), + LLDockControl::TOP, boost::bind(&LLIMFloater::getAllowedRect, floater, _1))); } - floater->setDockControl(new LLDockControl(chiclet, floater, floater->getDockTongue(), - LLDockControl::TOP, boost::bind(&LLIMFloater::getAllowedRect, floater, _1))); + // window is positioned, now we can show it. + floater->setVisible(true); } -#endif return floater; } @@ -395,9 +407,10 @@ void LLIMFloater::setDocked(bool docked, bool pop_on_undock) (LLNotificationsUI::LLChannelManager::getInstance()-> findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); -#ifndef USE_IM_CONTAINER - LLTransientDockableFloater::setDocked(docked, pop_on_undock); -#endif + if(!isChatMultiTab()) + { + LLTransientDockableFloater::setDocked(docked, pop_on_undock); + } // update notification channel state if(channel) @@ -406,6 +419,16 @@ void LLIMFloater::setDocked(bool docked, bool pop_on_undock) } } +void LLIMFloater::setTornOff(bool torn_off) +{ + // When IM Floater isn't torn off, "close" button should be hidden. + // This call will just disables it, since there is a hack in LLFloater::updateButton, + // which prevents hiding of close button in that case. + setCanClose(torn_off); + + LLTransientDockableFloater::setTornOff(torn_off); +} + void LLIMFloater::setVisible(BOOL visible) { LLNotificationsUI::LLScreenChannel* channel = dynamic_cast<LLNotificationsUI::LLScreenChannel*> @@ -418,33 +441,39 @@ void LLIMFloater::setVisible(BOOL visible) { channel->updateShowToastsState(); } + + if (visible && mChatHistory && mInputEditor) + { + //only if floater was construced and initialized from xml + updateMessages(); + mInputEditor->setFocus(TRUE); + } } //static bool LLIMFloater::toggle(const LLUUID& session_id) { -#ifndef USE_IM_CONTAINER - LLIMFloater* floater = LLFloaterReg::findTypedInstance<LLIMFloater>("impanel", session_id); - if (floater && floater->getVisible() && floater->isDocked()) - { - // clicking on chiclet to close floater just hides it to maintain existing - // scroll/text entry state - floater->setVisible(false); - return false; - } - else if(floater && !floater->isDocked()) + if(!isChatMultiTab()) { - floater->setVisible(TRUE); - floater->setFocus(TRUE); - return true; - } - else -#endif - { - // ensure the list of messages is updated when floater is made visible - show(session_id); - return true; + LLIMFloater* floater = LLFloaterReg::findTypedInstance<LLIMFloater>("impanel", session_id); + if (floater && floater->getVisible() && floater->isDocked()) + { + // clicking on chiclet to close floater just hides it to maintain existing + // scroll/text entry state + floater->setVisible(false); + return false; + } + else if(floater && !floater->isDocked()) + { + floater->setVisible(TRUE); + floater->setFocus(TRUE); + return true; + } } + + // ensure the list of messages is updated when floater is made visible + show(session_id); + return true; } //static @@ -529,7 +558,6 @@ void LLIMFloater::onInputEditorFocusReceived( LLFocusableElement* caller, void* //in disconnected state IM input editor should be disabled self->mInputEditor->setEnabled(!gDisconnected); } - self->mChatHistory->setCursorAndScrollToEnd(); } // static @@ -635,6 +663,9 @@ void LLIMFloater::processAgentListUpdates(const LLSD& body) else label = LLTrans::getString("IM_to_label") + " " + LLIMModel::instance().getName(mSessionID); mInputEditor->setLabel(label); + + if (moderator_muted_text) + LLNotificationsUtil::add("TextChatIsMutedByModerator"); } } } @@ -888,3 +919,18 @@ void LLIMFloater::removeTypingIndicator(const LLIMInfo* im_info) } } +// static +bool LLIMFloater::isChatMultiTab() +{ + // Restart is required in order to change chat window type. + static bool is_single_window = gSavedSettings.getS32("ChatWindow") == 1; + return is_single_window; +} + +// static +void LLIMFloater::initIMFloater() +{ + // This is called on viewer start up + // init chat window type before user changed it in preferences + isChatMultiTab(); +} diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index 9e1330ff49..f90bc35c34 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -33,11 +33,6 @@ #ifndef LL_IMFLOATER_H #define LL_IMFLOATER_H -// This variable is used to show floaters related to chiclets in a Multi Floater Container -// So, this functionality does not require to have IM Floaters as Dockable & Transient -// See EXT-2640. -#define USE_IM_CONTAINER - #include "lltransientdockablefloater.h" #include "lllogchat.h" #include "lltooldraganddrop.h" @@ -68,6 +63,7 @@ public: // LLFloater overrides /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true); + /*virtual*/ void setTornOff(bool torn_off); // Make IM conversion visible and update the message history static LLIMFloater* show(const LLUUID& session_id); @@ -105,6 +101,14 @@ public: void *cargo_data, EAcceptance *accept, std::string& tooltip_msg); + /** + * Returns true if chat is displayed in multi tabbed floater + * false if chat is displayed in multiple windows + */ + static bool isChatMultiTab(); + + static void initIMFloater(); + private: // process focus events to set a currently active session /* virtual */ void onFocusLost(); diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 6e4b3ae214..2d7333f7e4 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -1,96 +1,96 @@ -/**
- * @file llimfloatercontainer.cpp
- * @brief Multifloater containing active IM sessions in separate tab container tabs
- *
- * $LicenseInfo:firstyear=2009&license=viewergpl$
- *
- * Copyright (c) 2009, Linden Research, Inc.
- *
- * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab. Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
- *
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at
- * http://secondlifegrid.net/programs/open_source/licensing/flossexception
- *
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
- *
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
- * $/LicenseInfo$
- */
-
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llimfloatercontainer.h"
-
-//
-// LLIMFloaterContainer
-//
-LLIMFloaterContainer::LLIMFloaterContainer(const LLSD& seed)
-: LLMultiFloater(seed),
- mActiveVoiceFloater(NULL)
-{
- mAutoResize = FALSE;
-}
-
-LLIMFloaterContainer::~LLIMFloaterContainer()
-{
-}
-
-BOOL LLIMFloaterContainer::postBuild()
-{
- // Do not call base postBuild to not connect to mCloseSignal to not close all floaters via Close button
- // mTabContainer will be initialized in LLMultiFloater::addChild()
- return TRUE;
-}
-
-void LLIMFloaterContainer::onOpen(const LLSD& key)
-{
- LLMultiFloater::onOpen(key);
-/*
- if (key.isDefined())
- {
- LLIMFloater* im_floater = LLIMFloater::findInstance(key.asUUID());
- if (im_floater)
- {
- im_floater->openFloater();
- }
- }
-*/
-}
-
-void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
- BOOL select_added_floater,
- LLTabContainer::eInsertionPoint insertion_point)
-{
- if(!floaterp) return;
-
- // already here
- if (floaterp->getHost() == this)
- {
- openFloater(floaterp->getKey());
- return;
- }
-
- LLMultiFloater::addFloater(floaterp, select_added_floater, insertion_point);
-
- // make sure active voice icon shows up for new tab
- if (floaterp == mActiveVoiceFloater)
- {
- mTabContainer->setTabImage(floaterp, "active_voice_tab.tga");
- }
-}
-
-// EOF
+/** + * @file llimfloatercontainer.cpp + * @brief Multifloater containing active IM sessions in separate tab container tabs + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + + +#include "llviewerprecompiledheaders.h" + +#include "llimfloatercontainer.h" + +// +// LLIMFloaterContainer +// +LLIMFloaterContainer::LLIMFloaterContainer(const LLSD& seed) +: LLMultiFloater(seed), + mActiveVoiceFloater(NULL) +{ + mAutoResize = FALSE; +} + +LLIMFloaterContainer::~LLIMFloaterContainer() +{ +} + +BOOL LLIMFloaterContainer::postBuild() +{ + // Do not call base postBuild to not connect to mCloseSignal to not close all floaters via Close button + // mTabContainer will be initialized in LLMultiFloater::addChild() + return TRUE; +} + +void LLIMFloaterContainer::onOpen(const LLSD& key) +{ + LLMultiFloater::onOpen(key); +/* + if (key.isDefined()) + { + LLIMFloater* im_floater = LLIMFloater::findInstance(key.asUUID()); + if (im_floater) + { + im_floater->openFloater(); + } + } +*/ +} + +void LLIMFloaterContainer::addFloater(LLFloater* floaterp, + BOOL select_added_floater, + LLTabContainer::eInsertionPoint insertion_point) +{ + if(!floaterp) return; + + // already here + if (floaterp->getHost() == this) + { + openFloater(floaterp->getKey()); + return; + } + + LLMultiFloater::addFloater(floaterp, select_added_floater, insertion_point); + + // make sure active voice icon shows up for new tab + if (floaterp == mActiveVoiceFloater) + { + mTabContainer->setTabImage(floaterp, "active_voice_tab.tga"); + } +} + +// EOF diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 10cde56c6e..ead7cf4730 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -1,61 +1,61 @@ -/**
- * @file llimfloatercontainer.h
- * @brief Multifloater containing active IM sessions in separate tab container tabs
- *
- * $LicenseInfo:firstyear=2009&license=viewergpl$
- *
- * Copyright (c) 2009, Linden Research, Inc.
- *
- * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab. Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
- *
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at
- * http://secondlifegrid.net/programs/open_source/licensing/flossexception
- *
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
- *
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLIMFLOATERCONTAINER_H
-#define LL_LLIMFLOATERCONTAINER_H
-
-#include "llfloater.h"
-#include "llmultifloater.h"
-
-class LLTabContainer;
-
-class LLIMFloaterContainer : public LLMultiFloater
-{
-public:
- LLIMFloaterContainer(const LLSD& seed);
- virtual ~LLIMFloaterContainer();
-
- /*virtual*/ BOOL postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
-
- /*virtual*/ void addFloater(LLFloater* floaterp,
- BOOL select_added_floater,
- LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
-
- static LLFloater* getCurrentVoiceFloater();
-
-protected:
-
- LLFloater* mActiveVoiceFloater;
-};
-
-#endif // LL_LLIMFLOATERCONTAINER_H
+/** + * @file llimfloatercontainer.h + * @brief Multifloater containing active IM sessions in separate tab container tabs + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLIMFLOATERCONTAINER_H +#define LL_LLIMFLOATERCONTAINER_H + +#include "llfloater.h" +#include "llmultifloater.h" + +class LLTabContainer; + +class LLIMFloaterContainer : public LLMultiFloater +{ +public: + LLIMFloaterContainer(const LLSD& seed); + virtual ~LLIMFloaterContainer(); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + + /*virtual*/ void addFloater(LLFloater* floaterp, + BOOL select_added_floater, + LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END); + + static LLFloater* getCurrentVoiceFloater(); + +protected: + + LLFloater* mActiveVoiceFloater; +}; + +#endif // LL_LLIMFLOATERCONTAINER_H diff --git a/indra/newview/llimhandler.cpp b/indra/newview/llimhandler.cpp index c081af5879..1cbd273e96 100644 --- a/indra/newview/llimhandler.cpp +++ b/indra/newview/llimhandler.cpp @@ -36,6 +36,7 @@ #include "llnotificationhandler.h" #include "llagentdata.h" +#include "llnotifications.h" #include "lltoastimpanel.h" #include "llviewerwindow.h" diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index ffa943092f..d3058e67af 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -70,6 +70,8 @@ #include "lltoolbar.h" #include "llviewermessage.h" #include "llviewerwindow.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llnotify.h" #include "llnearbychat.h" #include "llviewerregion.h" @@ -81,19 +83,16 @@ #include "llfirstuse.h" #include "llagentui.h" +const static std::string IM_TIME("time"); +const static std::string IM_TEXT("message"); +const static std::string IM_FROM("from"); +const static std::string IM_FROM_ID("from_id"); + // // Globals // LLIMMgr* gIMMgr = NULL; -// -// Statics -// -// *FIXME: make these all either UIStrings or Strings - -const static std::string IM_SEPARATOR(": "); - - void toast_callback(const LLSD& msg){ // do not show toast in busy mode or it goes from agent if (gAgent.getBusy() || gAgent.getID() == msg["from_id"]) @@ -120,7 +119,7 @@ void toast_callback(const LLSD& msg){ args["FROM_ID"] = msg["from_id"]; args["SESSION_ID"] = msg["session_id"]; - LLNotifications::instance().add("IMToast", args, LLSD(), boost::bind(&LLIMFloater::show, msg["session_id"].asUUID())); + LLNotificationsUtil::add("IMToast", args, LLSD(), boost::bind(&LLIMFloater::show, msg["session_id"].asUUID())); } void LLIMModel::setActiveSessionID(const LLUUID& session_id) @@ -163,6 +162,11 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& { mVoiceChannel = new LLVoiceChannelGroup(session_id, name); } + + if(mVoiceChannel) + { + mVoiceChannelStateChangeConnection = mVoiceChannel->setStateChangedCallback(boost::bind(&LLIMSession::onVoiceChannelStateChanged, this, _1, _2)); + } mSpeakers = new LLIMSpeakerMgr(mVoiceChannel); // All participants will be added to the list of people we've recently interacted with. @@ -186,7 +190,63 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& } if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) - LLLogChat::loadHistory(mName, &chatFromLogFile, (void *)this); + { + std::list<LLSD> chat_history; + + //involves parsing of a chat history + LLLogChat::loadAllHistory(mName, chat_history); + addMessagesFromHistory(chat_history); + } +} + +void LLIMModel::LLIMSession::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state) +{ + bool is_p2p_session = dynamic_cast<LLVoiceChannelP2P*>(mVoiceChannel); + bool is_incoming_call = false; + std::string other_avatar_name; + + if(is_p2p_session) + { + is_incoming_call = static_cast<LLVoiceChannelP2P*>(mVoiceChannel)->isIncomingCall(); + gCacheName->getFullName(mOtherParticipantID, other_avatar_name); + + if(is_incoming_call) + { + switch(new_state) + { + case LLVoiceChannel::STATE_CALL_STARTED : + LLIMModel::getInstance()->addMessage(mSessionID, other_avatar_name, mOtherParticipantID, "Started a voice call"); + break; + case LLVoiceChannel::STATE_CONNECTED : + LLIMModel::getInstance()->addMessage(mSessionID, "You", gAgent.getID(), "Joined the voice call"); + default: + break; + } + } + else // outgoing call + { + switch(new_state) + { + case LLVoiceChannel::STATE_CALL_STARTED : + LLIMModel::getInstance()->addMessage(mSessionID, "You", gAgent.getID(), "Started a voice call"); + break; + case LLVoiceChannel::STATE_CONNECTED : + LLIMModel::getInstance()->addMessage(mSessionID, other_avatar_name, mOtherParticipantID, "Joined the voice call"); + default: + break; + } + } + + // Update speakers list when connected + if (LLVoiceChannel::STATE_CONNECTED == new_state) + { + mSpeakers->update(true); + } + } + else // group || ad-hoc calls + { + + } } LLIMModel::LLIMSession::~LLIMSession() @@ -210,9 +270,11 @@ LLIMModel::LLIMSession::~LLIMSession() } } + mVoiceChannelStateChangeConnection.disconnect(); + // HAVE to do this here -- if it happens in the LLVoiceChannel destructor it will call the wrong version (since the object's partially deconstructed at that point). mVoiceChannel->deactivate(); - + delete mVoiceChannel; mVoiceChannel = NULL; } @@ -246,6 +308,30 @@ void LLIMModel::LLIMSession::addMessage(const std::string& from, const LLUUID& f } } +void LLIMModel::LLIMSession::addMessagesFromHistory(const std::list<LLSD>& history) +{ + std::list<LLSD>::const_iterator it = history.begin(); + while (it != history.end()) + { + const LLSD& msg = *it; + + std::string from = msg[IM_FROM]; + LLUUID from_id = LLUUID::null; + if (msg[IM_FROM_ID].isUndefined()) + { + gCacheName->getUUID(from, from_id); + } + + + std::string timestamp = msg[IM_TIME]; + std::string text = msg[IM_TEXT]; + + addMessage(from, from_id, text, timestamp); + + it++; + } +} + void LLIMModel::LLIMSession::chatFromLogFile(LLLogChat::ELogLineType type, const LLSD& msg, void* userdata) { if (!userdata) return; @@ -394,6 +480,19 @@ bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from, return true; } +bool LLIMModel::logToFile(const std::string& session_name, const std::string& from, const LLUUID& from_id, const std::string& utf8_text) +{ + if (gSavedPerAccountSettings.getBOOL("LogInstantMessages")) + { + LLLogChat::saveHistory(session_name, from, from_id, utf8_text); + return true; + } + else + { + return false; + } +} + bool LLIMModel::logToFile(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text) { if (gSavedPerAccountSettings.getBOOL("LogInstantMessages")) @@ -428,7 +527,7 @@ bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, co const std::string& utf8_text, bool log2file /* = true */) { LLIMSession* session = findIMSession(session_id); - if (!session) + if (!session) { llwarns << "session " << session_id << "does not exist " << llendl; return false; @@ -1015,7 +1114,7 @@ LLIMMgr::showSessionStartError( LLSD payload; payload["session_id"] = session_id; - LLNotifications::instance().add( + LLNotificationsUtil::add( "ChatterBoxSessionStartError", args, payload, @@ -1038,7 +1137,7 @@ LLIMMgr::showSessionEventError( LLTrans::getString(event_string); args["RECIPIENT"] = floater->getTitle(); - LLNotifications::instance().add( + LLNotificationsUtil::add( "ChatterBoxSessionEventError", args); } @@ -1059,7 +1158,7 @@ LLIMMgr::showSessionForceClose( LLSD payload; payload["session_id"] = session_id; - LLNotifications::instance().add( + LLNotificationsUtil::add( "ForceCloseChatterBoxSession", args, payload, @@ -1148,7 +1247,7 @@ BOOL LLOutgoingCallDialog::postBuild() childSetAction("Cancel", onCancel, this); // dock the dialog to the sys well, where other sys messages appear - setDockControl(new LLDockControl(LLBottomTray::getInstance()->getSysWell(), + setDockControl(new LLDockControl(LLBottomTray::getInstance()->getChild<LLPanel>("speak_panel"), this, getDockTongue(), LLDockControl::TOP, boost::bind(&LLOutgoingCallDialog::getAllowedRect, this, _1))); @@ -1225,7 +1324,7 @@ void LLIncomingCallDialog::onOpen(const LLSD& key) } // dock the dialog to the sys well, where other sys messages appear - setDockControl(new LLDockControl(LLBottomTray::getInstance()->getSysWell(), + setDockControl(new LLDockControl(LLBottomTray::getInstance()->getChild<LLPanel>("speak_panel"), this, getDockTongue(), LLDockControl::TOP, boost::bind(&LLIncomingCallDialog::getAllowedRect, this, _1))); } @@ -1278,7 +1377,8 @@ void LLIncomingCallDialog::processCallResponse(S32 response) session_id = gIMMgr->addP2PSession( mPayload["session_name"].asString(), mPayload["caller_id"].asUUID(), - mPayload["session_handle"].asString()); + mPayload["session_handle"].asString(), + mPayload["session_uri"].asString()); if (voice) { @@ -1294,13 +1394,13 @@ void LLIncomingCallDialog::processCallResponse(S32 response) } else { - LLUUID session_id = gIMMgr->addSession( + LLUUID new_session_id = gIMMgr->addSession( mPayload["session_name"].asString(), type, session_id); - if (session_id != LLUUID::null) + if (new_session_id != LLUUID::null) { - LLIMFloater::show(session_id); + LLIMFloater::show(new_session_id); } std::string url = gAgent.getRegion()->getCapability( @@ -1363,7 +1463,7 @@ bool inviteUserResponse(const LLSD& notification, const LLSD& response) LLUUID session_id = payload["session_id"].asUUID(); EInstantMessage type = (EInstantMessage)payload["type"].asInteger(); LLIMMgr::EInvitationType inv_type = (LLIMMgr::EInvitationType)payload["inv_type"].asInteger(); - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch(option) { case 0: // accept @@ -1388,13 +1488,13 @@ bool inviteUserResponse(const LLSD& notification, const LLSD& response) } else { - LLUUID session_id = gIMMgr->addSession( + LLUUID new_session_id = gIMMgr->addSession( payload["session_name"].asString(), type, session_id); - if (session_id != LLUUID::null) + if (new_session_id != LLUUID::null) { - LLIMFloater::show(session_id); + LLIMFloater::show(new_session_id); } std::string url = gAgent.getRegion()->getCapability( @@ -1876,7 +1976,7 @@ void LLIMMgr::inviteToSession( args["NAME"] = caller_name; args["GROUP"] = session_name; - LLNotifications::instance().add(notify_box_type, args, payload, &inviteUserResponse); + LLNotificationsUtil::add(notify_box_type, args, payload, &inviteUserResponse); } } mPendingInvitations[session_id.asString()] = LLSD(); @@ -1899,7 +1999,7 @@ void LLIMMgr::onInviteNameLookup(LLSD payload, const LLUUID& id, const std::stri LLSD args; args["NAME"] = payload["caller_name"].asString(); - LLNotifications::instance().add( + LLNotificationsUtil::add( payload["notify_box_type"].asString(), args, payload, diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 62a54bc081..8a0f57deb0 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -60,7 +60,10 @@ public: virtual ~LLIMSession(); void sessionInitReplyReceived(const LLUUID& new_session_id); + + void addMessagesFromHistory(const std::list<LLSD>& history); void addMessage(const std::string& from, const LLUUID& from_id, const std::string& utf8_text, const std::string& time); + void onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state); static void chatFromLogFile(LLLogChat::ELogLineType type, const LLSD& msg, void* userdata); LLUUID mSessionID; @@ -69,6 +72,9 @@ public: LLUUID mOtherParticipantID; std::vector<LLUUID> mInitialTargetIDs; + // connection to voice channel state change signal + boost::signals2::connection mVoiceChannelStateChangeConnection; + //does NOT include system messages S32 mNumUnread; @@ -199,6 +205,11 @@ public: void testMessages(); + /** + * Saves an IM message into a file + */ + bool logToFile(const std::string& session_name, const std::string& from, const LLUUID& from_id, const std::string& utf8_text); + private: /** @@ -271,11 +282,16 @@ public: const LLUUID& other_participant_id, const LLDynamicArray<LLUUID>& ids); - // Creates a P2P session with the requisite handle for responding to voice calls + /** + * Creates a P2P session with the requisite handle for responding to voice calls. + * + * @param caller_uri - sip URI of caller. It should be always be passed into the method to avoid + * incorrect working of LLVoiceChannel instances. See EXT-2985. + */ LLUUID addP2PSession(const std::string& name, const LLUUID& other_participant_id, const std::string& voice_session_handle, - const std::string& caller_uri = LLStringUtil::null); + const std::string& caller_uri); /** * Leave the session with session id. Send leave session notification diff --git a/indra/newview/llinspect.cpp b/indra/newview/llinspect.cpp index aa299014ee..c7b8db9635 100644 --- a/indra/newview/llinspect.cpp +++ b/indra/newview/llinspect.cpp @@ -50,16 +50,16 @@ LLInspect::~LLInspect() void LLInspect::draw() { static LLCachedControl<F32> FADE_TIME(*LLUI::sSettingGroups["config"], "InspectorFadeTime", 1.f); + static LLCachedControl<F32> STAY_TIME(*LLUI::sSettingGroups["config"], "InspectorShowTime", 1.f); if (mOpenTimer.getStarted()) { - F32 alpha = clamp_rescale(mOpenTimer.getElapsedTimeF32(), 0.f, FADE_TIME, 0.f, 1.f); - LLViewDrawContext context(alpha); LLFloater::draw(); - if (alpha == 1.f) + if (mOpenTimer.getElapsedTimeF32() > STAY_TIME) { mOpenTimer.stop(); + mCloseTimer.start(); } - + } else if (mCloseTimer.getStarted()) { @@ -95,3 +95,16 @@ void LLInspect::onFocusLost() mCloseTimer.start(); mOpenTimer.stop(); } + +// virtual +BOOL LLInspect::handleHover(S32 x, S32 y, MASK mask) +{ + mOpenTimer.pause(); + return LLView::handleHover(x, y, mask); +} + +// virtual +void LLInspect::onMouseLeave(S32 x, S32 y, MASK mask) +{ + mOpenTimer.unpause(); +} diff --git a/indra/newview/llinspect.h b/indra/newview/llinspect.h index a461c2fa16..731e99534b 100644 --- a/indra/newview/llinspect.h +++ b/indra/newview/llinspect.h @@ -46,6 +46,9 @@ public: /// Inspectors have a custom fade-in/fade-out animation /*virtual*/ void draw(); + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); + /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); + /// Start open animation /*virtual*/ void onOpen(const LLSD& avatar_id); diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 866669f326..83beae29c1 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -133,7 +133,6 @@ private: LLUUID mAvatarID; // Need avatar name information to spawn friend add request std::string mAvatarName; - LLUUID mPartnerID; // an in-flight request for avatar properties from LLAvatarPropertiesProcessor // is represented by this object LLFetchAvatarData* mPropertiesRequest; @@ -187,8 +186,7 @@ public: LLInspectAvatar::LLInspectAvatar(const LLSD& sd) : LLInspect( LLSD() ), // single_instance, doesn't really need key - mAvatarID(), // set in onOpen() - mPartnerID(), + mAvatarID(), // set in onOpen() *Note: we used to show partner's name but we dont anymore --angela 3rd Dec* mAvatarName(), mPropertiesRequest(NULL) { @@ -257,7 +255,6 @@ void LLInspectAvatar::onOpen(const LLSD& data) // Extract appropriate avatar id mAvatarID = data["avatar_id"]; - mPartnerID = LLUUID::null; BOOL self = mAvatarID == gAgent.getID(); @@ -307,7 +304,6 @@ void LLInspectAvatar::requestUpdate() getChild<LLUICtrl>("user_name")->setValue(""); getChild<LLUICtrl>("user_subtitle")->setValue(""); getChild<LLUICtrl>("user_details")->setValue(""); - getChild<LLUICtrl>("user_partner")->setValue(""); // Make a new request for properties delete mPropertiesRequest; @@ -365,15 +361,6 @@ void LLInspectAvatar::processAvatarData(LLAvatarData* data) std::string details = getString("Details", args); getChild<LLUICtrl>("user_details")->setValue( LLSD(details) ); - // Look up partner name, if there is one - mPartnerID = data->partner_id; - if (mPartnerID.notNull()) - { - gCacheName->get(mPartnerID, FALSE, - boost::bind(&LLInspectAvatar::nameUpdatedCallback, - this, _1, _2, _3, _4)); - } - // Delete the request object as it has been satisfied delete mPropertiesRequest; mPropertiesRequest = NULL; @@ -455,15 +442,6 @@ void LLInspectAvatar::nameUpdatedCallback( mAvatarName = first + " " + last; childSetValue("user_name", LLSD(mAvatarName) ); } - - if (id == mPartnerID) - { - LLStringUtil::format_map_t args; - args["[PARTNER]"] = first + " " + last; - std::string partner = getString("Partner", args); - getChild<LLUICtrl>("user_partner")->setValue(partner); - } - // Otherwise possibly a request for an older inspector, ignore it } void LLInspectAvatar::onClickAddFriend() diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp index e3780f93ff..42d061ff72 100644 --- a/indra/newview/llinspectobject.cpp +++ b/indra/newview/llinspectobject.cpp @@ -36,7 +36,7 @@ // Viewer #include "llinspect.h" #include "llmediaentry.h" -#include "llnotifications.h" // *TODO: Eliminate, add LLNotificationsUtil wrapper +#include "llnotificationsutil.h" // *TODO: Eliminate, add LLNotificationsUtil wrapper #include "llselectmgr.h" #include "llslurl.h" #include "llviewermenu.h" // handle_object_touch(), handle_buy() @@ -631,7 +631,7 @@ void LLInspectObject::onClickOpen() void LLInspectObject::onClickMoreInfo() { // *TODO: Show object info side panel, once that is implemented. - LLNotifications::instance().add("ClickUnimplemented"); + LLNotificationsUtil::add("ClickUnimplemented"); closeFloater(); } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d8ebb3d355..59bfc77723 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1,5295 +1,5341 @@ -/**
- * @file llinventorybridge.cpp
- * @brief Implementation of the Inventory-Folder-View-Bridge classes.
- *
- * $LicenseInfo:firstyear=2001&license=viewergpl$
- *
- * Copyright (c) 2001-2009, Linden Research, Inc.
- *
- * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab. Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
- *
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at
- * http://secondlifegrid.net/programs/open_source/licensing/flossexception
- *
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
- *
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
- * $/LicenseInfo$
- */
-
-#include "llviewerprecompiledheaders.h"
-#include "llinventorybridge.h"
-
-#include "llagent.h"
-#include "llagentwearables.h"
-#include "llappearancemgr.h"
-#include "llavataractions.h"
-#include "llfloatercustomize.h"
-#include "llfloaterinventory.h"
-#include "llfloateropenobject.h"
-#include "llfloaterreg.h"
-#include "llfloaterworldmap.h"
-#include "llfriendcard.h"
-#include "llgesturemgr.h"
-#include "llimfloater.h"
-#include "llimview.h"
-#include "llinventoryclipboard.h"
-#include "llinventoryfunctions.h"
-#include "llinventorymodel.h"
-#include "llinventorypanel.h"
-#include "llpreviewanim.h"
-#include "llpreviewgesture.h"
-#include "llpreviewtexture.h"
-#include "llselectmgr.h"
-#include "llsidetray.h"
-#include "lltrans.h"
-#include "llviewerassettype.h"
-#include "llviewermessage.h"
-#include "llviewerobjectlist.h"
-#include "llviewerwindow.h"
-#include "llvoavatarself.h"
-#include "llwearablelist.h"
-#include "llpaneloutfitsinventory.h"
-
-using namespace LLOldEvents;
-
-// Helpers
-// bug in busy count inc/dec right now, logic is complex... do we really need it?
-void inc_busy_count()
-{
-// gViewerWindow->getWindow()->incBusyCount();
-// check balance of these calls if this code is changed to ever actually
-// *do* something!
-}
-void dec_busy_count()
-{
-// gViewerWindow->getWindow()->decBusyCount();
-// check balance of these calls if this code is changed to ever actually
-// *do* something!
-}
-
-// Function declarations
-void wear_add_inventory_item_on_avatar(LLInventoryItem* item);
-void remove_inventory_category_from_avatar(LLInventoryCategory* category);
-void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_id);
-bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, LLMoveInv*);
-bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& response);
-
-std::string ICON_NAME[ICON_NAME_COUNT] =
-{
- "Inv_Texture",
- "Inv_Sound",
- "Inv_CallingCard",
- "Inv_CallingCard",
- "Inv_Landmark",
- "Inv_Landmark",
- "Inv_Script",
- "Inv_Clothing",
- "Inv_Object",
- "Inv_Object",
- "Inv_Notecard",
- "Inv_Skin",
- "Inv_Snapshot",
-
- "Inv_BodyShape",
- "Inv_Skin",
- "Inv_Hair",
- "Inv_Eye",
- "Inv_Shirt",
- "Inv_Pants",
- "Inv_Shoe",
- "Inv_Socks",
- "Inv_Jacket",
- "Inv_Gloves",
- "Inv_Undershirt",
- "Inv_Underpants",
- "Inv_Skirt",
- "Inv_Alpha",
- "Inv_Tattoo",
-
- "Inv_Animation",
- "Inv_Gesture",
-
- "inv_item_linkitem.tga",
- "inv_item_linkfolder.tga",
-
- "inv_item_mesh.tga"
-};
-
-// +=================================================+
-// | LLInvFVBridge |
-// +=================================================+
-
-LLInvFVBridge::LLInvFVBridge(LLInventoryPanel* inventory, const LLUUID& uuid) :
-mUUID(uuid), mInvType(LLInventoryType::IT_NONE)
-{
- mInventoryPanel = inventory->getHandle();
-}
-
-const std::string& LLInvFVBridge::getName() const
-{
- LLInventoryObject* obj = getInventoryObject();
- if(obj)
- {
- return obj->getName();
- }
- return LLStringUtil::null;
-}
-
-const std::string& LLInvFVBridge::getDisplayName() const
-{
- return getName();
-}
-
-// Folders have full perms
-PermissionMask LLInvFVBridge::getPermissionMask() const
-{
-
- return PERM_ALL;
-}
-
-// virtual
-LLFolderType::EType LLInvFVBridge::getPreferredType() const
-{
- return LLFolderType::FT_NONE;
-}
-
-
-// Folders don't have creation dates.
-time_t LLInvFVBridge::getCreationDate() const
-{
- return 0;
-}
-
-// Can be destroyed (or moved to trash)
-BOOL LLInvFVBridge::isItemRemovable()
-{
- const LLInventoryModel* model = getInventoryModel();
- if(!model)
- {
- return FALSE;
- }
- if(!model->isObjectDescendentOf(mUUID, gInventory.getRootFolderID()))
- {
- return FALSE;
- }
- const LLInventoryObject *obj = model->getItem(mUUID);
- if (obj && obj->getIsLinkType())
- {
- return TRUE;
- }
- if (gAgentWearables.isWearingItem(mUUID))
- {
- return FALSE;
- }
- const LLVOAvatarSelf* avatar = gAgent.getAvatarObject();
- if (avatar && avatar->isWearingAttachment(mUUID))
- {
- return FALSE;
- }
- return TRUE;
-}
-
-// Can be moved to another folder
-BOOL LLInvFVBridge::isItemMovable() const
-{
- return TRUE;
-}
-
-/*virtual*/
-/**
- * @brief Adds this item into clipboard storage
- */
-void LLInvFVBridge::cutToClipboard()
-{
- if(isItemMovable())
- {
- LLInventoryClipboard::instance().cut(mUUID);
- }
-}
-// *TODO: make sure this does the right thing
-void LLInvFVBridge::showProperties()
-{
- LLSD key;
- key["id"] = mUUID;
- LLSideTray::getInstance()->showPanel("sidepanel_inventory", key);
-
- // Disable old properties floater; this is replaced by the sidepanel.
- /*
- LLFloaterReg::showInstance("properties", mUUID);
- */
-}
-
-void LLInvFVBridge::removeBatch(LLDynamicArray<LLFolderViewEventListener*>& batch)
-{
- // Deactivate gestures when moving them into Trash
- LLInvFVBridge* bridge;
- LLInventoryModel* model = getInventoryModel();
- LLViewerInventoryItem* item = NULL;
- LLViewerInventoryCategory* cat = NULL;
- LLInventoryModel::cat_array_t descendent_categories;
- LLInventoryModel::item_array_t descendent_items;
- S32 count = batch.count();
- S32 i,j;
- for(i = 0; i < count; ++i)
- {
- bridge = (LLInvFVBridge*)(batch.get(i));
- if(!bridge || !bridge->isItemRemovable()) continue;
- item = (LLViewerInventoryItem*)model->getItem(bridge->getUUID());
- if (item)
- {
- if(LLAssetType::AT_GESTURE == item->getType())
- {
- LLGestureManager::instance().deactivateGesture(item->getUUID());
- }
- }
- }
- for(i = 0; i < count; ++i)
- {
- bridge = (LLInvFVBridge*)(batch.get(i));
- if(!bridge || !bridge->isItemRemovable()) continue;
- cat = (LLViewerInventoryCategory*)model->getCategory(bridge->getUUID());
- if (cat)
- {
- gInventory.collectDescendents( cat->getUUID(), descendent_categories, descendent_items, FALSE );
- for (j=0; j<descendent_items.count(); j++)
- {
- if(LLAssetType::AT_GESTURE == descendent_items[j]->getType())
- {
- LLGestureManager::instance().deactivateGesture(descendent_items[j]->getUUID());
- }
- }
- }
- }
- removeBatchNoCheck(batch);
-}
-
-void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener*>& batch)
-{
- // this method moves a bunch of items and folders to the trash. As
- // per design guidelines for the inventory model, the message is
- // built and the accounting is performed first. After all of that,
- // we call LLInventoryModel::moveObject() to move everything
- // around.
- LLInvFVBridge* bridge;
- LLInventoryModel* model = getInventoryModel();
- if(!model) return;
- LLMessageSystem* msg = gMessageSystem;
- const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
- LLViewerInventoryItem* item = NULL;
- LLViewerInventoryCategory* cat = NULL;
- std::vector<LLUUID> move_ids;
- LLInventoryModel::update_map_t update;
- bool start_new_message = true;
- S32 count = batch.count();
- S32 i;
- for(i = 0; i < count; ++i)
- {
- bridge = (LLInvFVBridge*)(batch.get(i));
- if(!bridge || !bridge->isItemRemovable()) continue;
- item = (LLViewerInventoryItem*)model->getItem(bridge->getUUID());
- if(item)
- {
- if(item->getParentUUID() == trash_id) continue;
- move_ids.push_back(item->getUUID());
- LLPreview::hide(item->getUUID());
- --update[item->getParentUUID()];
- ++update[trash_id];
- if(start_new_message)
- {
- start_new_message = false;
- msg->newMessageFast(_PREHASH_MoveInventoryItem);
- msg->nextBlockFast(_PREHASH_AgentData);
- msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
- msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
- msg->addBOOLFast(_PREHASH_Stamp, TRUE);
- }
- msg->nextBlockFast(_PREHASH_InventoryData);
- msg->addUUIDFast(_PREHASH_ItemID, item->getUUID());
- msg->addUUIDFast(_PREHASH_FolderID, trash_id);
- msg->addString("NewName", NULL);
- if(msg->isSendFullFast(_PREHASH_InventoryData))
- {
- start_new_message = true;
- gAgent.sendReliableMessage();
- gInventory.accountForUpdate(update);
- update.clear();
- }
- }
- }
- if(!start_new_message)
- {
- start_new_message = true;
- gAgent.sendReliableMessage();
- gInventory.accountForUpdate(update);
- update.clear();
- }
- for(i = 0; i < count; ++i)
- {
- bridge = (LLInvFVBridge*)(batch.get(i));
- if(!bridge || !bridge->isItemRemovable()) continue;
- cat = (LLViewerInventoryCategory*)model->getCategory(bridge->getUUID());
- if(cat)
- {
- if(cat->getParentUUID() == trash_id) continue;
- move_ids.push_back(cat->getUUID());
- --update[cat->getParentUUID()];
- ++update[trash_id];
- if(start_new_message)
- {
- start_new_message = false;
- msg->newMessageFast(_PREHASH_MoveInventoryFolder);
- msg->nextBlockFast(_PREHASH_AgentData);
- msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
- msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
- msg->addBOOL("Stamp", TRUE);
- }
- msg->nextBlockFast(_PREHASH_InventoryData);
- msg->addUUIDFast(_PREHASH_FolderID, cat->getUUID());
- msg->addUUIDFast(_PREHASH_ParentID, trash_id);
- if(msg->isSendFullFast(_PREHASH_InventoryData))
- {
- start_new_message = true;
- gAgent.sendReliableMessage();
- gInventory.accountForUpdate(update);
- update.clear();
- }
- }
- }
- if(!start_new_message)
- {
- gAgent.sendReliableMessage();
- gInventory.accountForUpdate(update);
- }
-
- // move everything.
- std::vector<LLUUID>::iterator it = move_ids.begin();
- std::vector<LLUUID>::iterator end = move_ids.end();
- for(; it != end; ++it)
- {
- gInventory.moveObject((*it), trash_id);
- }
-
- // notify inventory observers.
- model->notifyObservers();
-}
-
-BOOL LLInvFVBridge::isClipboardPasteable() const
-{
- if (!LLInventoryClipboard::instance().hasContents() || !isAgentInventory())
- {
- return FALSE;
- }
- LLInventoryModel* model = getInventoryModel();
- if (!model)
- {
- return FALSE;
- }
-
- const LLUUID &agent_id = gAgent.getID();
-
- LLDynamicArray<LLUUID> objects;
- LLInventoryClipboard::instance().retrieve(objects);
- S32 count = objects.count();
- for(S32 i = 0; i < count; i++)
- {
- const LLUUID &item_id = objects.get(i);
-
- // Can't paste folders
- const LLInventoryCategory *cat = model->getCategory(item_id);
- if (cat)
- {
- return FALSE;
- }
-
- const LLInventoryItem *item = model->getItem(item_id);
- if (item)
- {
- if (!item->getPermissions().allowCopyBy(agent_id))
- {
- return FALSE;
- }
- }
- }
- return TRUE;
-}
-
-BOOL LLInvFVBridge::isClipboardPasteableAsLink() const
-{
- if (!LLInventoryClipboard::instance().hasContents() || !isAgentInventory())
- {
- return FALSE;
- }
- const LLInventoryModel* model = getInventoryModel();
- if (!model)
- {
- return FALSE;
- }
-
- LLDynamicArray<LLUUID> objects;
- LLInventoryClipboard::instance().retrieve(objects);
- S32 count = objects.count();
- for(S32 i = 0; i < count; i++)
- {
- const LLInventoryItem *item = model->getItem(objects.get(i));
- if (item)
- {
- if (!LLAssetType::lookupCanLink(item->getActualType()))
- {
- return FALSE;
- }
- }
- const LLViewerInventoryCategory *cat = model->getCategory(objects.get(i));
- if (cat && !LLFolderType::lookupIsProtectedType(cat->getPreferredType()))
- {
- return FALSE;
- }
- }
- return TRUE;
-}
-
-void hide_context_entries(LLMenuGL& menu,
- const std::vector<std::string> &entries_to_show,
- const std::vector<std::string> &disabled_entries)
-{
- const LLView::child_list_t *list = menu.getChildList();
-
- LLView::child_list_t::const_iterator itor;
- for (itor = list->begin(); itor != list->end(); ++itor)
- {
- std::string name = (*itor)->getName();
-
- // descend into split menus:
- LLMenuItemBranchGL* branchp = dynamic_cast<LLMenuItemBranchGL*>(*itor);
- if ((name == "More") && branchp)
- {
- hide_context_entries(*branchp->getBranch(), entries_to_show, disabled_entries);
- }
-
-
- bool found = false;
- std::vector<std::string>::const_iterator itor2;
- for (itor2 = entries_to_show.begin(); itor2 != entries_to_show.end(); ++itor2)
- {
- if (*itor2 == name)
- {
- found = true;
- }
- }
- if (!found)
- {
- (*itor)->setVisible(FALSE);
- }
- else
- {
- (*itor)->setVisible(TRUE);
- for (itor2 = disabled_entries.begin(); itor2 != disabled_entries.end(); ++itor2)
- {
- if (*itor2 == name)
- {
- (*itor)->setEnabled(FALSE);
- }
- }
- }
- }
-}
-
-// Helper for commonly-used entries
-void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
- std::vector<std::string> &items,
- std::vector<std::string> &disabled_items, U32 flags)
-{
- const LLInventoryObject *obj = getInventoryObject();
- if (obj && obj->getIsLinkType())
- {
- items.push_back(std::string("Find Original"));
- if (LLAssetType::lookupIsLinkType(obj->getType()))
- {
- disabled_items.push_back(std::string("Find Original"));
- }
- }
- else
- {
- items.push_back(std::string("Rename"));
- if (!isItemRenameable() || (flags & FIRST_SELECTED_ITEM) == 0)
- {
- disabled_items.push_back(std::string("Rename"));
- }
-
- if (show_asset_id)
- {
- items.push_back(std::string("Copy Asset UUID"));
- if ( (! ( isItemPermissive() || gAgent.isGodlike() ) )
- || (flags & FIRST_SELECTED_ITEM) == 0)
- {
- disabled_items.push_back(std::string("Copy Asset UUID"));
- }
- }
- items.push_back(std::string("Copy Separator"));
-
- items.push_back(std::string("Copy"));
- if (!isItemCopyable())
- {
- disabled_items.push_back(std::string("Copy"));
- }
- }
-
- items.push_back(std::string("Paste"));
- if (!isClipboardPasteable() || (flags & FIRST_SELECTED_ITEM) == 0)
- {
- disabled_items.push_back(std::string("Paste"));
- }
-
- items.push_back(std::string("Paste As Link"));
- if (!isClipboardPasteableAsLink() || (flags & FIRST_SELECTED_ITEM) == 0)
- {
- disabled_items.push_back(std::string("Paste As Link"));
- }
- items.push_back(std::string("Paste Separator"));
-
- items.push_back(std::string("Delete"));
- if (!isItemRemovable())
- {
- disabled_items.push_back(std::string("Delete"));
- }
-
- // If multiple items are selected, disable properties (if it exists).
- if ((flags & FIRST_SELECTED_ITEM) == 0)
- {
- disabled_items.push_back(std::string("Properties"));
- }
-}
-
-void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
-{
- lldebugs << "LLInvFVBridge::buildContextMenu()" << llendl;
- std::vector<std::string> items;
- std::vector<std::string> disabled_items;
- if(isInTrash())
- {
- items.push_back(std::string("PurgeItem"));
- if (!isItemRemovable())
- {
- disabled_items.push_back(std::string("PurgeItem"));
- }
- items.push_back(std::string("RestoreItem"));
- }
- else
- {
- items.push_back(std::string("Open"));
- items.push_back(std::string("Properties"));
-
- getClipboardEntries(true, items, disabled_items, flags);
- }
- hide_context_entries(menu, items, disabled_items);
-}
-
-// *TODO: remove this
-BOOL LLInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
-{
- BOOL rv = FALSE;
-
- const LLInventoryObject* obj = getInventoryObject();
-
- if(obj)
- {
- *type = LLViewerAssetType::lookupDragAndDropType(obj->getActualType());
- if(*type == DAD_NONE)
- {
- return FALSE;
- }
-
- *id = obj->getUUID();
- //object_ids.put(obj->getUUID());
-
- if (*type == DAD_CATEGORY)
- {
- gInventory.startBackgroundFetch(obj->getUUID());
- }
-
- rv = TRUE;
- }
-
- return rv;
-}
-
-LLInventoryObject* LLInvFVBridge::getInventoryObject() const
-{
- LLInventoryObject* obj = NULL;
- LLInventoryModel* model = getInventoryModel();
- if(model)
- {
- obj = (LLInventoryObject*)model->getObject(mUUID);
- }
- return obj;
-}
-
-LLInventoryModel* LLInvFVBridge::getInventoryModel() const
-{
- LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
- return panel ? panel->getModel() : NULL;
-}
-
-BOOL LLInvFVBridge::isInTrash() const
-{
- LLInventoryModel* model = getInventoryModel();
- if(!model) return FALSE;
- const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
- return model->isObjectDescendentOf(mUUID, trash_id);
-}
-
-BOOL LLInvFVBridge::isLinkedObjectInTrash() const
-{
- if (isInTrash()) return TRUE;
-
- const LLInventoryObject *obj = getInventoryObject();
- if (obj && obj->getIsLinkType())
- {
- LLInventoryModel* model = getInventoryModel();
- if(!model) return FALSE;
- const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
- return model->isObjectDescendentOf(obj->getLinkedUUID(), trash_id);
- }
- return FALSE;
-}
-
-BOOL LLInvFVBridge::isAgentInventory() const
-{
- const LLInventoryModel* model = getInventoryModel();
- if(!model) return FALSE;
- if(gInventory.getRootFolderID() == mUUID) return TRUE;
- return model->isObjectDescendentOf(mUUID, gInventory.getRootFolderID());
-}
-
-BOOL LLInvFVBridge::isCOFFolder() const
-{
- const LLInventoryModel* model = getInventoryModel();
- if(!model) return TRUE;
- const LLUUID cof_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);
- if (mUUID == cof_id || model->isObjectDescendentOf(mUUID, cof_id))
- {
- return TRUE;
- }
- return FALSE;
-}
-
-BOOL LLInvFVBridge::isItemPermissive() const
-{
- return FALSE;
-}
-
-// static
-void LLInvFVBridge::changeItemParent(LLInventoryModel* model,
- LLViewerInventoryItem* item,
- const LLUUID& new_parent,
- BOOL restamp)
-{
- if(item->getParentUUID() != new_parent)
- {
- LLInventoryModel::update_list_t update;
- LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(),-1);
- update.push_back(old_folder);
- LLInventoryModel::LLCategoryUpdate new_folder(new_parent, 1);
- update.push_back(new_folder);
- gInventory.accountForUpdate(update);
-
- LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
- new_item->setParent(new_parent);
- new_item->updateParentOnServer(restamp);
- model->updateItem(new_item);
- model->notifyObservers();
- }
-}
-
-// static
-void LLInvFVBridge::changeCategoryParent(LLInventoryModel* model,
- LLViewerInventoryCategory* cat,
- const LLUUID& new_parent,
- BOOL restamp)
-{
- if(cat->getParentUUID() != new_parent)
- {
- LLInventoryModel::update_list_t update;
- LLInventoryModel::LLCategoryUpdate old_folder(cat->getParentUUID(), -1);
- update.push_back(old_folder);
- LLInventoryModel::LLCategoryUpdate new_folder(new_parent, 1);
- update.push_back(new_folder);
- gInventory.accountForUpdate(update);
-
- LLPointer<LLViewerInventoryCategory> new_cat = new LLViewerInventoryCategory(cat);
- new_cat->setParent(new_parent);
- new_cat->updateParentOnServer(restamp);
- model->updateCategory(new_cat);
- model->notifyObservers();
- }
-}
-
-
-const std::string safe_inv_type_lookup(LLInventoryType::EType inv_type)
-{
- const std::string rv= LLInventoryType::lookup(inv_type);
- if(rv.empty())
- {
- return std::string("<invalid>");
- }
- return rv;
-}
-
-LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
- LLAssetType::EType actual_asset_type,
- LLInventoryType::EType inv_type,
- LLInventoryPanel* inventory,
- const LLUUID& uuid,
- U32 flags)
-{
- LLInvFVBridge* new_listener = NULL;
- switch(asset_type)
- {
- case LLAssetType::AT_TEXTURE:
- if(!(inv_type == LLInventoryType::IT_TEXTURE || inv_type == LLInventoryType::IT_SNAPSHOT))
- {
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl;
- }
- new_listener = new LLTextureBridge(inventory, uuid, inv_type);
- break;
-
- case LLAssetType::AT_SOUND:
- if(!(inv_type == LLInventoryType::IT_SOUND))
- {
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl;
- }
- new_listener = new LLSoundBridge(inventory, uuid);
- break;
-
- case LLAssetType::AT_LANDMARK:
- if(!(inv_type == LLInventoryType::IT_LANDMARK))
- {
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl;
- }
- new_listener = new LLLandmarkBridge(inventory, uuid, flags);
- break;
-
- case LLAssetType::AT_CALLINGCARD:
- if(!(inv_type == LLInventoryType::IT_CALLINGCARD))
- {
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl;
- }
- new_listener = new LLCallingCardBridge(inventory, uuid);
- break;
-
- case LLAssetType::AT_SCRIPT:
- if(!(inv_type == LLInventoryType::IT_LSL))
- {
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl;
- }
- new_listener = new LLScriptBridge(inventory, uuid);
- break;
-
- case LLAssetType::AT_OBJECT:
- if(!(inv_type == LLInventoryType::IT_OBJECT || inv_type == LLInventoryType::IT_ATTACHMENT))
- {
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl;
- }
- new_listener = new LLObjectBridge(inventory, uuid, inv_type, flags);
- break;
-
- case LLAssetType::AT_NOTECARD:
- if(!(inv_type == LLInventoryType::IT_NOTECARD))
- {
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl;
- }
- new_listener = new LLNotecardBridge(inventory, uuid);
- break;
-
- case LLAssetType::AT_ANIMATION:
- if(!(inv_type == LLInventoryType::IT_ANIMATION))
- {
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl;
- }
- new_listener = new LLAnimationBridge(inventory, uuid);
- break;
-
- case LLAssetType::AT_GESTURE:
- if(!(inv_type == LLInventoryType::IT_GESTURE))
- {
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl;
- }
- new_listener = new LLGestureBridge(inventory, uuid);
- break;
-
- case LLAssetType::AT_LSL_TEXT:
- if(!(inv_type == LLInventoryType::IT_LSL))
- {
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl;
- }
- new_listener = new LLLSLTextBridge(inventory, uuid);
- break;
-
- case LLAssetType::AT_CLOTHING:
- case LLAssetType::AT_BODYPART:
- if(!(inv_type == LLInventoryType::IT_WEARABLE))
- {
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl;
- }
- new_listener = new LLWearableBridge(inventory, uuid, asset_type, inv_type, (EWearableType)flags);
- break;
- case LLAssetType::AT_CATEGORY:
- if (actual_asset_type == LLAssetType::AT_LINK_FOLDER)
- {
- // Create a link folder handler instead.
- new_listener = new LLLinkFolderBridge(inventory, uuid);
- break;
- }
- new_listener = new LLFolderBridge(inventory, uuid);
- break;
- case LLAssetType::AT_LINK:
- // Only should happen for broken links.
- new_listener = new LLLinkItemBridge(inventory, uuid);
- break;
- case LLAssetType::AT_LINK_FOLDER:
- // Only should happen for broken links.
- new_listener = new LLLinkItemBridge(inventory, uuid);
- break;
- case LLAssetType::AT_MESH:
- if(!(inv_type == LLInventoryType::IT_MESH))
- {
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl;
- }
- new_listener = new LLMeshBridge(inventory, uuid);
- break;
-
- default:
- llinfos << "Unhandled asset type (llassetstorage.h): "
- << (S32)asset_type << llendl;
- break;
- }
-
- if (new_listener)
- {
- new_listener->mInvType = inv_type;
- }
-
- return new_listener;
-}
-
-void LLInvFVBridge::purgeItem(LLInventoryModel *model, const LLUUID &uuid)
-{
- LLInventoryCategory* cat = model->getCategory(uuid);
- if (cat)
- {
- model->purgeDescendentsOf(uuid);
- model->notifyObservers();
- }
- LLInventoryObject* obj = model->getObject(uuid);
- if (obj)
- {
- model->purgeObject(uuid);
- model->notifyObservers();
- }
-}
-
-// +=================================================+
-// | InventoryFVBridgeBuilder |
-// +=================================================+
-LLInvFVBridge* LLInventoryFVBridgeBuilder::createBridge(LLAssetType::EType asset_type,
- LLAssetType::EType actual_asset_type,
- LLInventoryType::EType inv_type,
- LLInventoryPanel* inventory,
- const LLUUID& uuid,
- U32 flags /* = 0x00 */) const
-{
- return LLInvFVBridge::createBridge(asset_type,
- actual_asset_type,
- inv_type,
- inventory,
- uuid,
- flags);
-}
-
-// +=================================================+
-// | LLItemBridge |
-// +=================================================+
-
-void LLItemBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action)
-{
- if ("goto" == action)
- {
- gotoItem(folder);
- }
- if ("open" == action)
- {
- openItem();
- return;
- }
- else if ("properties" == action)
- {
- showProperties();
- return;
- }
- else if ("purge" == action)
- {
- purgeItem(model, mUUID);
- return;
- }
- else if ("restoreToWorld" == action)
- {
- restoreToWorld();
- return;
- }
- else if ("restore" == action)
- {
- restoreItem();
- return;
- }
- else if ("copy_uuid" == action)
- {
- // Single item only
- LLInventoryItem* item = model->getItem(mUUID);
- if(!item) return;
- LLUUID asset_id = item->getAssetUUID();
- std::string buffer;
- asset_id.toString(buffer);
-
- gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(buffer));
- return;
- }
- else if ("copy" == action)
- {
- copyToClipboard();
- return;
- }
- else if ("paste" == action)
- {
- // Single item only
- LLInventoryItem* itemp = model->getItem(mUUID);
- if (!itemp) return;
-
- LLFolderViewItem* folder_view_itemp = folder->getItemByID(itemp->getParentUUID());
- if (!folder_view_itemp) return;
-
- folder_view_itemp->getListener()->pasteFromClipboard();
- return;
- }
- else if ("paste_link" == action)
- {
- // Single item only
- LLInventoryItem* itemp = model->getItem(mUUID);
- if (!itemp) return;
-
- LLFolderViewItem* folder_view_itemp = folder->getItemByID(itemp->getParentUUID());
- if (!folder_view_itemp) return;
-
- folder_view_itemp->getListener()->pasteLinkFromClipboard();
- return;
- }
-}
-
-void LLItemBridge::selectItem()
-{
- LLViewerInventoryItem* item = (LLViewerInventoryItem*)getItem();
- if(item && !item->isComplete())
- {
- item->fetchFromServer();
- }
-}
-
-void LLItemBridge::restoreItem()
-{
- LLViewerInventoryItem* item = (LLViewerInventoryItem*)getItem();
- if(item)
- {
- LLInventoryModel* model = getInventoryModel();
- const LLUUID new_parent = model->findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(item->getType()));
- // do not restamp on restore.
- LLInvFVBridge::changeItemParent(model, item, new_parent, FALSE);
- }
-}
-
-void LLItemBridge::restoreToWorld()
-{
- LLViewerInventoryItem* itemp = (LLViewerInventoryItem*)getItem();
- if (itemp)
- {
- LLMessageSystem* msg = gMessageSystem;
- msg->newMessage("RezRestoreToWorld");
- msg->nextBlockFast(_PREHASH_AgentData);
- msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
- msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
-
- msg->nextBlockFast(_PREHASH_InventoryData);
- itemp->packMessage(msg);
- msg->sendReliable(gAgent.getRegion()->getHost());
- }
-
- //Similar functionality to the drag and drop rez logic
- BOOL remove_from_inventory = FALSE;
-
- //remove local inventory copy, sim will deal with permissions and removing the item
- //from the actual inventory if its a no-copy etc
- if(!itemp->getPermissions().allowCopyBy(gAgent.getID()))
- {
- remove_from_inventory = TRUE;
- }
-
- // Check if it's in the trash. (again similar to the normal rez logic)
- const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
- if(gInventory.isObjectDescendentOf(itemp->getUUID(), trash_id))
- {
- remove_from_inventory = TRUE;
- }
-
- if(remove_from_inventory)
- {
- gInventory.deleteObject(itemp->getUUID());
- gInventory.notifyObservers();
- }
-}
-
-void LLItemBridge::gotoItem(LLFolderView *folder)
-{
- LLInventoryObject *obj = getInventoryObject();
- if (obj && obj->getIsLinkType())
- {
- LLInventoryPanel* active_panel = LLFloaterInventory::getActiveInventory()->getPanel();
- if (active_panel)
- {
- active_panel->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO);
- }
- }
-}
-
-LLUIImagePtr LLItemBridge::getIcon() const
-{
- return LLUI::getUIImage(ICON_NAME[OBJECT_ICON_NAME]);
-}
-
-PermissionMask LLItemBridge::getPermissionMask() const
-{
- LLViewerInventoryItem* item = getItem();
- PermissionMask perm_mask = 0;
- if(item)
- {
- BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID());
- BOOL mod = item->getPermissions().allowModifyBy(gAgent.getID());
- BOOL xfer = item->getPermissions().allowOperationBy(PERM_TRANSFER,
- gAgent.getID());
-
- if (copy) perm_mask |= PERM_COPY;
- if (mod) perm_mask |= PERM_MODIFY;
- if (xfer) perm_mask |= PERM_TRANSFER;
-
- }
- return perm_mask;
-}
-
-const std::string& LLItemBridge::getDisplayName() const
-{
- if(mDisplayName.empty())
- {
- buildDisplayName(getItem(), mDisplayName);
- }
- return mDisplayName;
-}
-
-void LLItemBridge::buildDisplayName(LLInventoryItem* item, std::string& name)
-{
- if(item)
- {
- name.assign(item->getName());
- }
- else
- {
- name.assign(LLStringUtil::null);
- }
-}
-
-LLFontGL::StyleFlags LLItemBridge::getLabelStyle() const
-{
- U8 font = LLFontGL::NORMAL;
-
- if( gAgentWearables.isWearingItem( mUUID ) )
- {
- // llinfos << "BOLD" << llendl;
- font |= LLFontGL::BOLD;
- }
-
- const LLViewerInventoryItem* item = getItem();
- if (item && item->getIsLinkType())
- {
- font |= LLFontGL::ITALIC;
- }
- return (LLFontGL::StyleFlags)font;
-}
-
-std::string LLItemBridge::getLabelSuffix() const
-{
- // String table is loaded before login screen and inventory items are
- // loaded after login, so LLTrans should be ready.
- static std::string NO_COPY =LLTrans::getString("no_copy");
- static std::string NO_MOD = LLTrans::getString("no_modify");
- static std::string NO_XFER = LLTrans::getString("no_transfer");
- static std::string LINK = LLTrans::getString("link");
- static std::string BROKEN_LINK = LLTrans::getString("broken_link");
- std::string suffix;
- LLInventoryItem* item = getItem();
- if(item)
- {
- // it's a bit confusing to put nocopy/nomod/etc on calling cards.
- if(LLAssetType::AT_CALLINGCARD != item->getType()
- && item->getPermissions().getOwner() == gAgent.getID())
- {
- BOOL broken_link = LLAssetType::lookupIsLinkType(item->getType());
- if (broken_link) return BROKEN_LINK;
-
- BOOL link = item->getIsLinkType();
- if (link) return LINK;
-
- BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID());
- if (!copy)
- {
- suffix += NO_COPY;
- }
- BOOL mod = item->getPermissions().allowModifyBy(gAgent.getID());
- if (!mod)
- {
- suffix += NO_MOD;
- }
- BOOL xfer = item->getPermissions().allowOperationBy(PERM_TRANSFER,
- gAgent.getID());
- if (!xfer)
- {
- suffix += NO_XFER;
- }
- }
- }
- return suffix;
-}
-
-time_t LLItemBridge::getCreationDate() const
-{
- LLViewerInventoryItem* item = getItem();
- if (item)
- {
- return item->getCreationDate();
- }
- return 0;
-}
-
-
-BOOL LLItemBridge::isItemRenameable() const
-{
- LLViewerInventoryItem* item = getItem();
- if(item)
- {
- // (For now) Don't allow calling card rename since that may confuse users as to
- // what the calling card points to.
- if (item->getInventoryType() == LLInventoryType::IT_CALLINGCARD)
- {
- return FALSE;
- }
- return (item->getPermissions().allowModifyBy(gAgent.getID()));
- }
- return FALSE;
-}
-
-BOOL LLItemBridge::renameItem(const std::string& new_name)
-{
- if(!isItemRenameable())
- return FALSE;
- LLPreview::dirty(mUUID);
- LLInventoryModel* model = getInventoryModel();
- if(!model)
- return FALSE;
- LLViewerInventoryItem* item = getItem();
- if(item && (item->getName() != new_name))
- {
- LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
- new_item->rename(new_name);
- buildDisplayName(new_item, mDisplayName);
- new_item->updateServer(FALSE);
- model->updateItem(new_item);
-
- model->notifyObservers();
- }
- // return FALSE because we either notified observers (& therefore
- // rebuilt) or we didn't update.
- return FALSE;
-}
-
-
-BOOL LLItemBridge::removeItem()
-{
- if(!isItemRemovable())
- {
- return FALSE;
- }
- // move it to the trash
- LLPreview::hide(mUUID, TRUE);
- LLInventoryModel* model = getInventoryModel();
- if(!model) return FALSE;
- const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
- LLViewerInventoryItem* item = getItem();
-
- // if item is not already in trash
- if(item && !model->isObjectDescendentOf(mUUID, trash_id))
- {
- // move to trash, and restamp
- LLInvFVBridge::changeItemParent(model, item, trash_id, TRUE);
- // delete was successful
- return TRUE;
- }
- else
- {
- // tried to delete already item in trash (should purge?)
- return FALSE;
- }
-}
-
-BOOL LLItemBridge::isItemCopyable() const
-{
- LLViewerInventoryItem* item = getItem();
- if (item)
- {
- // can't copy worn objects. DEV-15183
- LLVOAvatarSelf *avatarp = gAgent.getAvatarObject();
- if( !avatarp )
- {
- return FALSE;
- }
-
- if(avatarp->isWearingAttachment(mUUID))
- {
- return FALSE;
- }
-
- // All items can be copied, not all can be pasted.
- // The only time an item can't be copied is if it's a link
- // return (item->getPermissions().allowCopyBy(gAgent.getID()));
- if (item->getIsLinkType())
- {
- return FALSE;
- }
- return TRUE;
- }
- return FALSE;
-}
-BOOL LLItemBridge::copyToClipboard() const
-{
- if(isItemCopyable())
- {
- LLInventoryClipboard::instance().add(mUUID);
- return TRUE;
- }
- return FALSE;
-}
-
-LLViewerInventoryItem* LLItemBridge::getItem() const
-{
- LLViewerInventoryItem* item = NULL;
- LLInventoryModel* model = getInventoryModel();
- if(model)
- {
- item = (LLViewerInventoryItem*)model->getItem(mUUID);
- }
- return item;
-}
-
-BOOL LLItemBridge::isItemPermissive() const
-{
- LLViewerInventoryItem* item = getItem();
- if(item)
- {
- U32 mask = item->getPermissions().getMaskBase();
- if((mask & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED)
- {
- return TRUE;
- }
- }
- return FALSE;
-}
-
-// +=================================================+
-// | LLFolderBridge |
-// +=================================================+
-
-LLFolderBridge* LLFolderBridge::sSelf=NULL;
-
-// Can be moved to another folder
-BOOL LLFolderBridge::isItemMovable() const
-{
- LLInventoryObject* obj = getInventoryObject();
- if(obj)
- {
- return (!LLFolderType::lookupIsProtectedType(((LLInventoryCategory*)obj)->getPreferredType()));
- }
- return FALSE;
-}
-
-void LLFolderBridge::selectItem()
-{
-}
-
-
-// Iterate through a folder's children to determine if
-// all the children are removable.
-class LLIsItemRemovable : public LLFolderViewFunctor
-{
-public:
- LLIsItemRemovable() : mPassed(TRUE) {}
- virtual void doFolder(LLFolderViewFolder* folder)
- {
- mPassed &= folder->getListener()->isItemRemovable();
- }
- virtual void doItem(LLFolderViewItem* item)
- {
- mPassed &= item->getListener()->isItemRemovable();
- }
- BOOL mPassed;
-};
-
-// Can be destroyed (or moved to trash)
-BOOL LLFolderBridge::isItemRemovable()
-{
- LLInventoryModel* model = getInventoryModel();
- if(!model)
- {
- return FALSE;
- }
-
- if(!model->isObjectDescendentOf(mUUID, gInventory.getRootFolderID()))
- {
- return FALSE;
- }
-
- LLVOAvatarSelf* avatar = gAgent.getAvatarObject();
- if( !avatar )
- {
- return FALSE;
- }
-
- LLInventoryCategory* category = model->getCategory(mUUID);
- if( !category )
- {
- return FALSE;
- }
- // Allow protected types to be removed, but issue a warning.
- /*
- if(LLFolderType::lookupIsProtectedType(category->getPreferredType()))
- {
- return FALSE;
- }
- */
-
- LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
- LLFolderViewFolder* folderp = dynamic_cast<LLFolderViewFolder*>(panel ? panel->getRootFolder()->getItemByID(mUUID) : NULL);
- if (folderp)
- {
- LLIsItemRemovable folder_test;
- folderp->applyFunctorToChildren(folder_test);
- if (!folder_test.mPassed)
- {
- return FALSE;
- }
- }
- return TRUE;
-}
-
-BOOL LLFolderBridge::isUpToDate() const
-{
- LLInventoryModel* model = getInventoryModel();
- if(!model) return FALSE;
- LLViewerInventoryCategory* category = (LLViewerInventoryCategory*)model->getCategory(mUUID);
- if( !category )
- {
- return FALSE;
- }
-
- return category->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN;
-}
-
-BOOL LLFolderBridge::isItemCopyable() const
-{
- return TRUE;
-}
-
-BOOL LLFolderBridge::copyToClipboard() const
-{
- if(isItemCopyable())
- {
- LLInventoryClipboard::instance().add(mUUID);
- return TRUE;
- }
- return FALSE;
-}
-
-BOOL LLFolderBridge::isClipboardPasteable() const
-{
- if ( ! LLInvFVBridge::isClipboardPasteable() )
- return FALSE;
-
- // Don't allow pasting duplicates to the Calling Card/Friends subfolders, see bug EXT-1599
- if ( LLFriendCardsManager::instance().isCategoryInFriendFolder( getCategory() ) )
- {
- LLInventoryModel* model = getInventoryModel();
- if ( !model )
- {
- return FALSE;
- }
-
- LLDynamicArray<LLUUID> objects;
- LLInventoryClipboard::instance().retrieve(objects);
- const LLViewerInventoryCategory *current_cat = getCategory();
-
- // Search for the direct descendent of current Friends subfolder among all pasted items,
- // and return false if is found.
- for(S32 i = objects.count() - 1; i >= 0; --i)
- {
- const LLUUID &obj_id = objects.get(i);
- if ( LLFriendCardsManager::instance().isObjDirectDescendentOfCategory(model->getObject(obj_id), current_cat) )
- {
- return FALSE;
- }
- }
-
- }
- return TRUE;
-}
-
-BOOL LLFolderBridge::isClipboardPasteableAsLink() const
-{
- // Check normal paste-as-link permissions
- if (!LLInvFVBridge::isClipboardPasteableAsLink())
- {
- return FALSE;
- }
-
- const LLInventoryModel* model = getInventoryModel();
- if (!model)
- {
- return FALSE;
- }
-
- const LLViewerInventoryCategory *current_cat = getCategory();
- if (current_cat)
- {
- const BOOL is_in_friend_folder = LLFriendCardsManager::instance().isCategoryInFriendFolder( current_cat );
- const LLUUID ¤t_cat_id = current_cat->getUUID();
- LLDynamicArray<LLUUID> objects;
- LLInventoryClipboard::instance().retrieve(objects);
- S32 count = objects.count();
- for(S32 i = 0; i < count; i++)
- {
- const LLUUID &obj_id = objects.get(i);
- const LLInventoryCategory *cat = model->getCategory(obj_id);
- if (cat)
- {
- const LLUUID &cat_id = cat->getUUID();
- // Don't allow recursive pasting
- if ((cat_id == current_cat_id) ||
- model->isObjectDescendentOf(current_cat_id, cat_id))
- {
- return FALSE;
- }
- }
- // Don't allow pasting duplicates to the Calling Card/Friends subfolders, see bug EXT-1599
- if ( is_in_friend_folder )
- {
- // If object is direct descendent of current Friends subfolder than return false.
- // Note: We can't use 'const LLInventoryCategory *cat', because it may be null
- // in case type of obj_id is LLInventoryItem.
- if ( LLFriendCardsManager::instance().isObjDirectDescendentOfCategory(model->getObject(obj_id), current_cat) )
- {
- return FALSE;
- }
- }
- }
- }
- return TRUE;
-
-}
-
-BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
- BOOL drop)
-{
- // This should never happen, but if an inventory item is incorrectly parented,
- // the UI will get confused and pass in a NULL.
- if(!inv_cat) return FALSE;
-
- LLInventoryModel* model = getInventoryModel();
- if(!model) return FALSE;
-
- LLVOAvatarSelf* avatar = gAgent.getAvatarObject();
- if(!avatar) return FALSE;
-
- // cannot drag categories into library
- if(!isAgentInventory())
- {
- return FALSE;
- }
-
- // check to make sure source is agent inventory, and is represented there.
- LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource();
- BOOL is_agent_inventory = (model->getCategory(inv_cat->getUUID()) != NULL)
- && (LLToolDragAndDrop::SOURCE_AGENT == source);
-
- BOOL accept = FALSE;
- S32 i;
- LLInventoryModel::cat_array_t descendent_categories;
- LLInventoryModel::item_array_t descendent_items;
- if(is_agent_inventory)
- {
- const LLUUID& cat_id = inv_cat->getUUID();
-
- // Is the destination the trash?
- const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
- BOOL move_is_into_trash = (mUUID == trash_id)
- || model->isObjectDescendentOf(mUUID, trash_id);
- BOOL is_movable = (!LLFolderType::lookupIsProtectedType(inv_cat->getPreferredType()));
- const LLUUID current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);
- BOOL move_is_into_current_outfit = (mUUID == current_outfit_id);
- BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT);
- if (move_is_into_current_outfit || move_is_into_outfit)
- {
- // BAP - restrictions?
- is_movable = true;
- }
-
- if (mUUID == gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE))
- {
- is_movable = FALSE; // It's generally movable but not into Favorites folder. EXT-1604
- }
-
- if( is_movable )
- {
- gInventory.collectDescendents( cat_id, descendent_categories, descendent_items, FALSE );
-
- for( i = 0; i < descendent_categories.count(); i++ )
- {
- LLInventoryCategory* category = descendent_categories[i];
- if(LLFolderType::lookupIsProtectedType(category->getPreferredType()))
- {
- // ...can't move "special folders" like Textures
- is_movable = FALSE;
- break;
- }
- }
-
- if( is_movable )
- {
- if( move_is_into_trash )
- {
- for( i = 0; i < descendent_items.count(); i++ )
- {
- LLInventoryItem* item = descendent_items[i];
- if( (item->getType() == LLAssetType::AT_CLOTHING) ||
- (item->getType() == LLAssetType::AT_BODYPART) )
- {
- if( gAgentWearables.isWearingItem( item->getUUID() ) )
- {
- is_movable = FALSE; // It's generally movable, but not into the trash!
- break;
- }
- }
- else
- if( item->getType() == LLAssetType::AT_OBJECT )
- {
- if( avatar->isWearingAttachment( item->getUUID() ) )
- {
- is_movable = FALSE; // It's generally movable, but not into the trash!
- break;
- }
- }
- }
- }
- }
- }
-
-
- accept = is_movable
- && (mUUID != cat_id) // Can't move a folder into itself
- && (mUUID != inv_cat->getParentUUID()) // Avoid moves that would change nothing
- && !(model->isObjectDescendentOf(mUUID, cat_id)); // Avoid circularity
- if(accept && drop)
- {
- // Look for any gestures and deactivate them
- if (move_is_into_trash)
- {
- for (i = 0; i < descendent_items.count(); i++)
- {
- LLInventoryItem* item = descendent_items[i];
- if (item->getType() == LLAssetType::AT_GESTURE
- && LLGestureManager::instance().isGestureActive(item->getUUID()))
- {
- LLGestureManager::instance().deactivateGesture(item->getUUID());
- }
- }
- }
- // if target is an outfit or current outfit folder we use link
- if (move_is_into_current_outfit || move_is_into_outfit)
- {
- if (inv_cat->getPreferredType() == LLFolderType::FT_NONE)
- {
- if (move_is_into_current_outfit)
- {
- // traverse category and add all contents to currently worn.
- BOOL append = true;
- LLAppearanceManager::instance().wearInventoryCategory(inv_cat, false, append);
- }
- else
- {
- // Recursively create links in target outfit.
- LLInventoryModel::cat_array_t cats;
- LLInventoryModel::item_array_t items;
- gInventory.collectDescendents(inv_cat->getUUID(), cats, items, LLInventoryModel::EXCLUDE_TRASH);
- LLAppearanceManager::instance().linkAll(mUUID,items,NULL);
- }
- }
- else
- {
-#if SUPPORT_ENSEMBLES
- // BAP - should skip if dup.
- if (move_is_into_current_outfit)
- {
- LLAppearanceManager::instance().addEnsembleLink(inv_cat);
- }
- else
- {
- LLPointer<LLInventoryCallback> cb = NULL;
- link_inventory_item(
- gAgent.getID(),
- inv_cat->getUUID(),
- mUUID,
- inv_cat->getName(),
- LLAssetType::AT_LINK_FOLDER,
- cb);
- }
-#endif
- }
- }
- else
- {
-
- // Reparent the folder and restamp children if it's moving
- // into trash.
- LLInvFVBridge::changeCategoryParent(
- model,
- (LLViewerInventoryCategory*)inv_cat,
- mUUID,
- move_is_into_trash);
- }
- }
- }
- else if(LLToolDragAndDrop::SOURCE_WORLD == source)
- {
- // content category has same ID as object itself
- LLUUID object_id = inv_cat->getUUID();
- LLUUID category_id = mUUID;
- accept = move_inv_category_world_to_agent(object_id, category_id, drop);
- }
- return accept;
-}
-
-void warn_move_inventory(LLViewerObject* object, LLMoveInv* move_inv)
-{
- const char* dialog = NULL;
- if (object->flagScripted())
- {
- dialog = "MoveInventoryFromScriptedObject";
- }
- else
- {
- dialog = "MoveInventoryFromObject";
- }
- LLNotifications::instance().add(dialog, LLSD(), LLSD(), boost::bind(move_task_inventory_callback, _1, _2, move_inv));
-}
-
-// Move/copy all inventory items from the Contents folder of an in-world
-// object to the agent's inventory, inside a given category.
-BOOL move_inv_category_world_to_agent(const LLUUID& object_id,
- const LLUUID& category_id,
- BOOL drop,
- void (*callback)(S32, void*),
- void* user_data)
-{
- // Make sure the object exists. If we allowed dragging from
- // anonymous objects, it would be possible to bypass
- // permissions.
- // content category has same ID as object itself
- LLViewerObject* object = gObjectList.findObject(object_id);
- if(!object)
- {
- llinfos << "Object not found for drop." << llendl;
- return FALSE;
- }
-
- // this folder is coming from an object, as there is only one folder in an object, the root,
- // we need to collect the entire contents and handle them as a group
- InventoryObjectList inventory_objects;
- object->getInventoryContents(inventory_objects);
-
- if (inventory_objects.empty())
- {
- llinfos << "Object contents not found for drop." << llendl;
- return FALSE;
- }
-
- BOOL accept = TRUE;
- BOOL is_move = FALSE;
-
- // coming from a task. Need to figure out if the person can
- // move/copy this item.
- InventoryObjectList::iterator it = inventory_objects.begin();
- InventoryObjectList::iterator end = inventory_objects.end();
- for ( ; it != end; ++it)
- {
- // coming from a task. Need to figure out if the person can
- // move/copy this item.
- LLPermissions perm(((LLInventoryItem*)((LLInventoryObject*)(*it)))->getPermissions());
- if((perm.allowCopyBy(gAgent.getID(), gAgent.getGroupID())
- && perm.allowTransferTo(gAgent.getID())))
-// || gAgent.isGodlike())
- {
- accept = TRUE;
- }
- else if(object->permYouOwner())
- {
- // If the object cannot be copied, but the object the
- // inventory is owned by the agent, then the item can be
- // moved from the task to agent inventory.
- is_move = TRUE;
- accept = TRUE;
- }
- else
- {
- accept = FALSE;
- break;
- }
- }
-
- if(drop && accept)
- {
- it = inventory_objects.begin();
- InventoryObjectList::iterator first_it = inventory_objects.begin();
- LLMoveInv* move_inv = new LLMoveInv;
- move_inv->mObjectID = object_id;
- move_inv->mCategoryID = category_id;
- move_inv->mCallback = callback;
- move_inv->mUserData = user_data;
-
- for ( ; it != end; ++it)
- {
- two_uuids_t two(category_id, (*it)->getUUID());
- move_inv->mMoveList.push_back(two);
- }
-
- if(is_move)
- {
- // Callback called from within here.
- warn_move_inventory(object, move_inv);
- }
- else
- {
- LLNotification::Params params("MoveInventoryFromObject");
- params.functor.function(boost::bind(move_task_inventory_callback, _1, _2, move_inv));
- LLNotifications::instance().forceResponse(params, 0);
- }
- }
- return accept;
-}
-
-bool LLFindCOFValidItems::operator()(LLInventoryCategory* cat,
- LLInventoryItem* item)
-{
- // Valid COF items are:
- // - links to wearables (body parts or clothing)
- // - links to attachments
- // - links to gestures
- // - links to ensemble folders
- LLViewerInventoryItem *linked_item = ((LLViewerInventoryItem*)item)->getLinkedItem(); // BAP - safe?
- if (linked_item)
- {
- LLAssetType::EType type = linked_item->getType();
- return (type == LLAssetType::AT_CLOTHING ||
- type == LLAssetType::AT_BODYPART ||
- type == LLAssetType::AT_GESTURE ||
- type == LLAssetType::AT_OBJECT);
- }
- else
- {
- LLViewerInventoryCategory *linked_category = ((LLViewerInventoryItem*)item)->getLinkedCategory(); // BAP - safe?
- // BAP remove AT_NONE support after ensembles are fully working?
- return (linked_category &&
- ((linked_category->getPreferredType() == LLFolderType::FT_NONE) ||
- (LLFolderType::lookupIsEnsembleType(linked_category->getPreferredType()))));
- }
-}
-
-
-bool LLFindWearables::operator()(LLInventoryCategory* cat,
- LLInventoryItem* item)
-{
- if(item)
- {
- if((item->getType() == LLAssetType::AT_CLOTHING)
- || (item->getType() == LLAssetType::AT_BODYPART))
- {
- return TRUE;
- }
- }
- return FALSE;
-}
-
-
-
-//Used by LLFolderBridge as callback for directory recursion.
-class LLRightClickInventoryFetchObserver : public LLInventoryFetchObserver
-{
-public:
- LLRightClickInventoryFetchObserver() :
- mCopyItems(false)
- { };
- LLRightClickInventoryFetchObserver(const LLUUID& cat_id, bool copy_items) :
- mCatID(cat_id),
- mCopyItems(copy_items)
- { };
- virtual void done()
- {
- // we've downloaded all the items, so repaint the dialog
- LLFolderBridge::staticFolderOptionsMenu();
-
- gInventory.removeObserver(this);
- delete this;
- }
-
-
-protected:
- LLUUID mCatID;
- bool mCopyItems;
-
-};
-
-//Used by LLFolderBridge as callback for directory recursion.
-class LLRightClickInventoryFetchDescendentsObserver : public LLInventoryFetchDescendentsObserver
-{
-public:
- LLRightClickInventoryFetchDescendentsObserver(bool copy_items) : mCopyItems(copy_items) {}
- ~LLRightClickInventoryFetchDescendentsObserver() {}
- virtual void done();
-protected:
- bool mCopyItems;
-};
-
-void LLRightClickInventoryFetchDescendentsObserver::done()
-{
- // Avoid passing a NULL-ref as mCompleteFolders.front() down to
- // gInventory.collectDescendents()
- if( mCompleteFolders.empty() )
- {
- llwarns << "LLRightClickInventoryFetchDescendentsObserver::done with empty mCompleteFolders" << llendl;
- dec_busy_count();
- gInventory.removeObserver(this);
- delete this;
- return;
- }
-
- // What we do here is get the complete information on the items in
- // the library, and set up an observer that will wait for that to
- // happen.
- LLInventoryModel::cat_array_t cat_array;
- LLInventoryModel::item_array_t item_array;
- gInventory.collectDescendents(mCompleteFolders.front(),
- cat_array,
- item_array,
- LLInventoryModel::EXCLUDE_TRASH);
- S32 count = item_array.count();
-#if 0 // HACK/TODO: Why?
- // This early causes a giant menu to get produced, and doesn't seem to be needed.
- if(!count)
- {
- llwarns << "Nothing fetched in category " << mCompleteFolders.front()
- << llendl;
- dec_busy_count();
- gInventory.removeObserver(this);
- delete this;
- return;
- }
-#endif
-
- LLRightClickInventoryFetchObserver* outfit;
- outfit = new LLRightClickInventoryFetchObserver(mCompleteFolders.front(), mCopyItems);
- LLInventoryFetchObserver::item_ref_t ids;
- for(S32 i = 0; i < count; ++i)
- {
- ids.push_back(item_array.get(i)->getUUID());
- }
-
- // clean up, and remove this as an observer since the call to the
- // outfit could notify observers and throw us into an infinite
- // loop.
- dec_busy_count();
- gInventory.removeObserver(this);
- delete this;
-
- // increment busy count and either tell the inventory to check &
- // call done, or add this object to the inventory for observation.
- inc_busy_count();
-
- // do the fetch
- outfit->fetchItems(ids);
- outfit->done(); //Not interested in waiting and this will be right 99% of the time.
-//Uncomment the following code for laggy Inventory UI.
-/* if(outfit->isEverythingComplete())
- {
- // everything is already here - call done.
- outfit->done();
- }
- else
- {
- // it's all on it's way - add an observer, and the inventory
- // will call done for us when everything is here.
- gInventory.addObserver(outfit);
- }*/
-}
-
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// Class LLInventoryWearObserver
-//
-// Observer for "copy and wear" operation to support knowing
-// when the all of the contents have been added to inventory.
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-class LLInventoryCopyAndWearObserver : public LLInventoryObserver
-{
-public:
- LLInventoryCopyAndWearObserver(const LLUUID& cat_id, int count) :mCatID(cat_id), mContentsCount(count), mFolderAdded(FALSE) {}
- virtual ~LLInventoryCopyAndWearObserver() {}
- virtual void changed(U32 mask);
-
-protected:
- LLUUID mCatID;
- int mContentsCount;
- BOOL mFolderAdded;
-};
-
-
-
-void LLInventoryCopyAndWearObserver::changed(U32 mask)
-{
- if((mask & (LLInventoryObserver::ADD)) != 0)
- {
- if (!mFolderAdded)
- {
- const std::set<LLUUID>& changed_items = gInventory.getChangedIDs();
-
- std::set<LLUUID>::const_iterator id_it = changed_items.begin();
- std::set<LLUUID>::const_iterator id_end = changed_items.end();
- for (;id_it != id_end; ++id_it)
- {
- if ((*id_it) == mCatID)
- {
- mFolderAdded = TRUE;
- break;
- }
- }
- }
-
- if (mFolderAdded)
- {
- LLViewerInventoryCategory* category = gInventory.getCategory(mCatID);
-
- if (NULL == category)
- {
- llwarns << "gInventory.getCategory(" << mCatID
- << ") was NULL" << llendl;
- }
- else
- {
- if (category->getDescendentCount() ==
- mContentsCount)
- {
- gInventory.removeObserver(this);
- LLAppearanceManager::instance().wearInventoryCategory(category, FALSE, TRUE);
- delete this;
- }
- }
- }
-
- }
-}
-
-
-
-void LLFolderBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action)
-{
- if ("open" == action)
- {
- openItem();
- return;
- }
- else if ("paste" == action)
- {
- pasteFromClipboard();
- return;
- }
- else if ("paste_link" == action)
- {
- pasteLinkFromClipboard();
- return;
- }
- else if ("properties" == action)
- {
- showProperties();
- return;
- }
- else if ("replaceoutfit" == action)
- {
- modifyOutfit(FALSE);
- return;
- }
-#if SUPPORT_ENSEMBLES
- else if ("wearasensemble" == action)
- {
- LLInventoryModel* model = getInventoryModel();
- if(!model) return;
- LLViewerInventoryCategory* cat = getCategory();
- if(!cat) return;
- LLAppearanceManager::instance().addEnsembleLink(cat,true);
- return;
- }
-#endif
- else if ("addtooutfit" == action)
- {
- modifyOutfit(TRUE);
- return;
- }
- else if ("copy" == action)
- {
- copyToClipboard();
- return;
- }
- else if ("removefromoutfit" == action)
- {
- LLInventoryModel* model = getInventoryModel();
- if(!model) return;
- LLViewerInventoryCategory* cat = getCategory();
- if(!cat) return;
-
- remove_inventory_category_from_avatar ( cat );
- return;
- }
- else if ("purge" == action)
- {
- purgeItem(model, mUUID);
- return;
- }
- else if ("restore" == action)
- {
- restoreItem();
- return;
- }
-}
-
-void LLFolderBridge::openItem()
-{
- lldebugs << "LLFolderBridge::openItem()" << llendl;
- LLInventoryModel* model = getInventoryModel();
- if(!model) return;
- if(mUUID.isNull()) return;
- bool fetching_inventory = model->fetchDescendentsOf(mUUID);
- // Only change folder type if we have the folder contents.
- if (!fetching_inventory)
- {
- // Disabling this for now, it's causing crash when new items are added to folders
- // since folder type may change before new item item has finished processing.
- // determineFolderType();
- }
-}
-
-void LLFolderBridge::closeItem()
-{
- determineFolderType();
-}
-
-void LLFolderBridge::determineFolderType()
-{
- if (isUpToDate())
- {
- LLInventoryModel* model = getInventoryModel();
- LLViewerInventoryCategory* category = model->getCategory(mUUID);
- category->determineFolderType();
- }
-}
-
-BOOL LLFolderBridge::isItemRenameable() const
-{
- LLViewerInventoryCategory* cat = (LLViewerInventoryCategory*)getCategory();
- if(cat && !LLFolderType::lookupIsProtectedType(cat->getPreferredType())
- && (cat->getOwnerID() == gAgent.getID()))
- {
- return TRUE;
- }
- return FALSE;
-}
-
-void LLFolderBridge::restoreItem()
-{
- LLViewerInventoryCategory* cat;
- cat = (LLViewerInventoryCategory*)getCategory();
- if(cat)
- {
- LLInventoryModel* model = getInventoryModel();
- const LLUUID new_parent = model->findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(cat->getType()));
- // do not restamp children on restore
- LLInvFVBridge::changeCategoryParent(model, cat, new_parent, FALSE);
- }
-}
-
-LLFolderType::EType LLFolderBridge::getPreferredType() const
-{
- LLFolderType::EType preferred_type = LLFolderType::FT_NONE;
- LLViewerInventoryCategory* cat = getCategory();
- if(cat)
- {
- preferred_type = cat->getPreferredType();
- }
-
- return preferred_type;
-}
-
-// Icons for folders are based on the preferred type
-LLUIImagePtr LLFolderBridge::getIcon() const
-{
- LLFolderType::EType preferred_type = LLFolderType::FT_NONE;
- LLViewerInventoryCategory* cat = getCategory();
- if(cat)
- {
- preferred_type = cat->getPreferredType();
- }
- return getIcon(preferred_type);
-}
-
-LLUIImagePtr LLFolderBridge::getIcon(LLFolderType::EType preferred_type)
-{
- // we only have one folder image now
- return LLUI::getUIImage("Inv_FolderClosed");
- /*case LLAssetType::AT_MESH:
- control = "inv_folder_mesh.tga";
- break;*/
-}
-
-BOOL LLFolderBridge::renameItem(const std::string& new_name)
-{
- if(!isItemRenameable())
- return FALSE;
- LLInventoryModel* model = getInventoryModel();
- if(!model)
- return FALSE;
- LLViewerInventoryCategory* cat = getCategory();
- if(cat && (cat->getName() != new_name))
- {
- LLPointer<LLViewerInventoryCategory> new_cat = new LLViewerInventoryCategory(cat);
- new_cat->rename(new_name);
- new_cat->updateServer(FALSE);
- model->updateCategory(new_cat);
-
- model->notifyObservers();
- }
- // return FALSE because we either notified observers (& therefore
- // rebuilt) or we didn't update.
- return FALSE;
-}
-
-BOOL LLFolderBridge::removeItem()
-{
- if(!isItemRemovable())
- {
- return FALSE;
- }
- const LLViewerInventoryCategory *cat = getCategory();
-
- LLSD payload;
- LLSD args;
- args["FOLDERNAME"] = cat->getName();
-
- LLNotification::Params params("ConfirmDeleteProtectedCategory");
- params.payload(payload).substitutions(args).functor.function(boost::bind(&LLFolderBridge::removeItemResponse, this, _1, _2));
- //params.functor.function(boost::bind(&LLFolderBridge::removeItemResponse, this, _1, _2));
- /*
- LLNotification::Params params("ChangeLindenEstate");
- params.functor.function(boost::bind(&LLPanelEstateInfo::callbackChangeLindenEstate, this, _1, _2));
- */
- if (LLFolderType::lookupIsProtectedType(cat->getPreferredType()))
- {
- LLNotifications::instance().add(params);
- }
- else
- {
- LLNotifications::instance().forceResponse(params, 0);
- }
- return TRUE;
-}
-
-bool LLFolderBridge::removeItemResponse(const LLSD& notification, const LLSD& response)
-{
- S32 option = LLNotification::getSelectedOption(notification, response);
-
- // if they choose delete, do it. Otherwise, don't do anything
- if(option == 0)
- {
- // move it to the trash
- LLPreview::hide(mUUID);
- LLInventoryModel* model = getInventoryModel();
- if(!model) return FALSE;
-
- const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
-
- // Look for any gestures and deactivate them
- LLInventoryModel::cat_array_t descendent_categories;
- LLInventoryModel::item_array_t descendent_items;
- gInventory.collectDescendents( mUUID, descendent_categories, descendent_items, FALSE );
-
- S32 i;
- for (i = 0; i < descendent_items.count(); i++)
- {
- LLInventoryItem* item = descendent_items[i];
- if (item->getType() == LLAssetType::AT_GESTURE
- && LLGestureManager::instance().isGestureActive(item->getUUID()))
- {
- LLGestureManager::instance().deactivateGesture(item->getUUID());
- }
- }
-
- // go ahead and do the normal remove if no 'last calling
- // cards' are being removed.
- LLViewerInventoryCategory* cat = getCategory();
- if(cat)
- {
- LLInvFVBridge::changeCategoryParent(model, cat, trash_id, TRUE);
- }
- return TRUE;
- }
- return FALSE;
-}
-
-void LLFolderBridge::pasteFromClipboard()
-{
- LLInventoryModel* model = getInventoryModel();
- if(model && isClipboardPasteable())
- {
- LLInventoryItem* item = NULL;
- LLDynamicArray<LLUUID> objects;
- LLInventoryClipboard::instance().retrieve(objects);
- S32 count = objects.count();
- const LLUUID parent_id(mUUID);
- for(S32 i = 0; i < count; i++)
- {
- item = model->getItem(objects.get(i));
- if (item)
- {
- if(LLInventoryClipboard::instance().isCutMode())
- {
- // move_inventory_item() is not enough,
- //we have to update inventory locally too
- changeItemParent(model, dynamic_cast<LLViewerInventoryItem*>(item), parent_id, FALSE);
- }
- else
- {
- copy_inventory_item(
- gAgent.getID(),
- item->getPermissions().getOwner(),
- item->getUUID(),
- parent_id,
- std::string(),
- LLPointer<LLInventoryCallback>(NULL));
- }
- }
- }
- }
-}
-
-void LLFolderBridge::pasteLinkFromClipboard()
-{
- const LLInventoryModel* model = getInventoryModel();
- if(model)
- {
- LLDynamicArray<LLUUID> objects;
- LLInventoryClipboard::instance().retrieve(objects);
- S32 count = objects.count();
- LLUUID parent_id(mUUID);
- for(S32 i = 0; i < count; i++)
- {
- const LLUUID &object_id = objects.get(i);
-#if SUPPORT_ENSEMBLES
- if (LLInventoryCategory *cat = model->getCategory(object_id))
- {
- link_inventory_item(
- gAgent.getID(),
- cat->getUUID(),
- parent_id,
- cat->getName(),
- LLAssetType::AT_LINK_FOLDER,
- LLPointer<LLInventoryCallback>(NULL));
- }
- else
-#endif
- if (LLInventoryItem *item = model->getItem(object_id))
- {
- link_inventory_item(
- gAgent.getID(),
- item->getLinkedUUID(),
- parent_id,
- item->getName(),
- LLAssetType::AT_LINK,
- LLPointer<LLInventoryCallback>(NULL));
- }
- }
- }
-}
-
-void LLFolderBridge::staticFolderOptionsMenu()
-{
- if (!sSelf) return;
- sSelf->folderOptionsMenu();
-}
-
-bool isInOutfitsSidePanel(LLPanel *panel)
-{
- LLInventoryPanel *my_panel = dynamic_cast<LLInventoryPanel*>(panel);
- LLPanelOutfitsInventory *outfit_panel =
- dynamic_cast<LLPanelOutfitsInventory*>(LLSideTray::getInstance()->getPanel("panel_outfits_inventory"));
- if (!outfit_panel)
- return false;
- return outfit_panel->isAccordionPanel(my_panel);
-
- //LLInventoryPanel *outfit_inv_panel = outfit_panel ? outfit_panel->getActivePanel(): NULL;
- //return (my_panel && (my_panel == outfit_inv_panel));
-}
-
-void LLFolderBridge::folderOptionsMenu()
-{
- std::vector<std::string> disabled_items;
-
- LLInventoryModel* model = getInventoryModel();
- if(!model) return;
-
- const LLInventoryCategory* category = model->getCategory(mUUID);
- LLFolderType::EType type = category->getPreferredType();
- const bool is_default_folder = category && LLFolderType::lookupIsProtectedType(type);
- // BAP change once we're no longer treating regular categories as ensembles.
- const bool is_ensemble = category && (type == LLFolderType::FT_NONE ||
- LLFolderType::lookupIsEnsembleType(type));
- const bool is_sidepanel = isInOutfitsSidePanel(mInventoryPanel.get());
-
- // calling card related functionality for folders.
-
- if (is_sidepanel)
- {
- mItems.clear();
- }
-
- // Only enable calling-card related options for non-default folders.
- if (!is_sidepanel && !is_default_folder)
- {
- LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD);
- if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard))
- {
- mItems.push_back(std::string("Calling Card Separator"));
- mItems.push_back(std::string("Conference Chat Folder"));
- mItems.push_back(std::string("IM All Contacts In Folder"));
- }
- }
-
- // wearables related functionality for folders.
- //is_wearable
- LLFindWearables is_wearable;
- LLIsType is_object( LLAssetType::AT_OBJECT );
- LLIsType is_gesture( LLAssetType::AT_GESTURE );
-
- if (mWearables ||
- checkFolderForContentsOfType(model, is_wearable) ||
- checkFolderForContentsOfType(model, is_object) ||
- checkFolderForContentsOfType(model, is_gesture) )
- {
- mItems.push_back(std::string("Folder Wearables Separator"));
-
- // Only enable add/replace outfit for non-default folders.
- if (!is_default_folder)
- {
- mItems.push_back(std::string("Add To Outfit"));
- mItems.push_back(std::string("Replace Outfit"));
- }
- if (is_ensemble)
- {
- mItems.push_back(std::string("Wear As Ensemble"));
- }
- mItems.push_back(std::string("Remove From Outfit"));
- }
- hide_context_entries(*mMenu, mItems, disabled_items);
-
- // Reposition the menu, in case we're adding items to an existing menu.
- mMenu->needsArrange();
- mMenu->arrangeAndClear();
-}
-
-BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& is_type)
-{
- LLInventoryModel::cat_array_t cat_array;
- LLInventoryModel::item_array_t item_array;
- model->collectDescendentsIf(mUUID,
- cat_array,
- item_array,
- LLInventoryModel::EXCLUDE_TRASH,
- is_type);
- return ((item_array.count() > 0) ? TRUE : FALSE );
-}
-
-// Flags unused
-void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
-{
- mItems.clear();
- mDisabledItems.clear();
-
- lldebugs << "LLFolderBridge::buildContextMenu()" << llendl;
-// std::vector<std::string> disabled_items;
- LLInventoryModel* model = getInventoryModel();
- if(!model) return;
- const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
- const LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
-
- mItems.clear(); //adding code to clear out member Items (which means Items should not have other data here at this point)
- mDisabledItems.clear(); //adding code to clear out disabled members from previous
- if (lost_and_found_id == mUUID)
- {
- // This is the lost+found folder.
- mItems.push_back(std::string("Empty Lost And Found"));
- }
-
- if(trash_id == mUUID)
- {
- // This is the trash.
- mItems.push_back(std::string("Empty Trash"));
- }
- else if(model->isObjectDescendentOf(mUUID, trash_id))
- {
- // This is a folder in the trash.
- mItems.clear(); // clear any items that used to exist
- mItems.push_back(std::string("Purge Item"));
- if (!isItemRemovable())
- {
- mDisabledItems.push_back(std::string("Purge Item"));
- }
-
- mItems.push_back(std::string("Restore Item"));
- }
- else if(isAgentInventory()) // do not allow creating in library
- {
- LLViewerInventoryCategory *cat = getCategory();
- // BAP removed protected check to re-enable standard ops in untyped folders.
- // Not sure what the right thing is to do here.
- if (!isCOFFolder() && cat /*&&
- LLAssetType::lookupIsProtectedCategoryType(cat->getPreferredType())*/)
- {
- // Do not allow to create 2-level subfolder in the Calling Card/Friends folder. EXT-694.
- if (!LLFriendCardsManager::instance().isCategoryInFriendFolder(cat))
- mItems.push_back(std::string("New Folder"));
- mItems.push_back(std::string("New Script"));
- mItems.push_back(std::string("New Note"));
- mItems.push_back(std::string("New Gesture"));
- mItems.push_back(std::string("New Clothes"));
- mItems.push_back(std::string("New Body Parts"));
- mItems.push_back(std::string("Change Type"));
-
- LLViewerInventoryCategory *cat = getCategory();
- if (cat && LLFolderType::lookupIsProtectedType(cat->getPreferredType()))
- {
- mDisabledItems.push_back(std::string("Change Type"));
- }
-
- getClipboardEntries(false, mItems, mDisabledItems, flags);
- }
- else
- {
- // Want some but not all of the items from getClipboardEntries for outfits.
- if (cat && cat->getPreferredType()==LLFolderType::FT_OUTFIT)
- {
- mItems.push_back(std::string("Rename"));
- mItems.push_back(std::string("Delete"));
- }
- }
-
- //Added by spatters to force inventory pull on right-click to display folder options correctly. 07-17-06
- mCallingCards = mWearables = FALSE;
-
- LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD);
- if (checkFolderForContentsOfType(model, is_callingcard))
- {
- mCallingCards=TRUE;
- }
-
- LLFindWearables is_wearable;
- LLIsType is_object( LLAssetType::AT_OBJECT );
- LLIsType is_gesture( LLAssetType::AT_GESTURE );
-
- if (checkFolderForContentsOfType(model, is_wearable) ||
- checkFolderForContentsOfType(model, is_object) ||
- checkFolderForContentsOfType(model, is_gesture) )
- {
- mWearables=TRUE;
- }
-
- mMenu = &menu;
- sSelf = this;
- LLRightClickInventoryFetchDescendentsObserver* fetch = new LLRightClickInventoryFetchDescendentsObserver(FALSE);
-
- LLInventoryFetchDescendentsObserver::folder_ref_t folders;
- LLViewerInventoryCategory* category = (LLViewerInventoryCategory*)model->getCategory(mUUID);
- if (category)
- {
- folders.push_back(category->getUUID());
- }
- fetch->fetchDescendents(folders);
- inc_busy_count();
- if(fetch->isEverythingComplete())
- {
- // everything is already here - call done.
- fetch->done();
- }
- else
- {
- // it's all on it's way - add an observer, and the inventory
- // will call done for us when everything is here.
- gInventory.addObserver(fetch);
- }
- }
- else
- {
- mItems.push_back(std::string("--no options--"));
- mDisabledItems.push_back(std::string("--no options--"));
- }
- hide_context_entries(menu, mItems, mDisabledItems);
-}
-
-BOOL LLFolderBridge::hasChildren() const
-{
- LLInventoryModel* model = getInventoryModel();
- if(!model) return FALSE;
- LLInventoryModel::EHasChildren has_children;
- has_children = gInventory.categoryHasChildren(mUUID);
- return has_children != LLInventoryModel::CHILDREN_NO;
-}
-
-BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop,
- EDragAndDropType cargo_type,
- void* cargo_data)
-{
- //llinfos << "LLFolderBridge::dragOrDrop()" << llendl;
- BOOL accept = FALSE;
- switch(cargo_type)
- {
- case DAD_TEXTURE:
- case DAD_SOUND:
- case DAD_CALLINGCARD:
- case DAD_LANDMARK:
- case DAD_SCRIPT:
- case DAD_OBJECT:
- case DAD_NOTECARD:
- case DAD_CLOTHING:
- case DAD_BODYPART:
- case DAD_ANIMATION:
- case DAD_GESTURE:
- case DAD_LINK:
- case DAD_MESH:
- accept = dragItemIntoFolder((LLInventoryItem*)cargo_data,
- drop);
- break;
- case DAD_CATEGORY:
- if (LLFriendCardsManager::instance().isAnyFriendCategory(mUUID))
- {
- accept = FALSE;
- }
- else
- {
- accept = dragCategoryIntoFolder((LLInventoryCategory*)cargo_data, drop);
- }
- break;
- default:
- break;
- }
- return accept;
-}
-
-LLViewerInventoryCategory* LLFolderBridge::getCategory() const
-{
- LLViewerInventoryCategory* cat = NULL;
- LLInventoryModel* model = getInventoryModel();
- if(model)
- {
- cat = (LLViewerInventoryCategory*)model->getCategory(mUUID);
- }
- return cat;
-}
-
-
-// static
-void LLFolderBridge::pasteClipboard(void* user_data)
-{
- LLFolderBridge* self = (LLFolderBridge*)user_data;
- if(self) self->pasteFromClipboard();
-}
-
-void LLFolderBridge::createNewCategory(void* user_data)
-{
- LLFolderBridge* bridge = (LLFolderBridge*)user_data;
- if(!bridge) return;
- LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(bridge->mInventoryPanel.get());
- if (!panel) return;
- LLInventoryModel* model = panel->getModel();
- if(!model) return;
- LLUUID id;
- id = model->createNewCategory(bridge->getUUID(),
- LLFolderType::FT_NONE,
- LLStringUtil::null);
- model->notifyObservers();
-
- // At this point, the bridge has probably been deleted, but the
- // view is still there.
- panel->setSelection(id, TAKE_FOCUS_YES);
-}
-
-void LLFolderBridge::createNewShirt(void* user_data)
-{
- LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_SHIRT);
-}
-
-void LLFolderBridge::createNewPants(void* user_data)
-{
- LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_PANTS);
-}
-
-void LLFolderBridge::createNewShoes(void* user_data)
-{
- LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_SHOES);
-}
-
-void LLFolderBridge::createNewSocks(void* user_data)
-{
- LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_SOCKS);
-}
-
-void LLFolderBridge::createNewJacket(void* user_data)
-{
- LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_JACKET);
-}
-
-void LLFolderBridge::createNewSkirt(void* user_data)
-{
- LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_SKIRT);
-}
-
-void LLFolderBridge::createNewGloves(void* user_data)
-{
- LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_GLOVES);
-}
-
-void LLFolderBridge::createNewUndershirt(void* user_data)
-{
- LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_UNDERSHIRT);
-}
-
-void LLFolderBridge::createNewUnderpants(void* user_data)
-{
- LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_UNDERPANTS);
-}
-
-void LLFolderBridge::createNewShape(void* user_data)
-{
- LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_SHAPE);
-}
-
-void LLFolderBridge::createNewSkin(void* user_data)
-{
- LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_SKIN);
-}
-
-void LLFolderBridge::createNewHair(void* user_data)
-{
- LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_HAIR);
-}
-
-void LLFolderBridge::createNewEyes(void* user_data)
-{
- LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_EYES);
-}
-
-// static
-void LLFolderBridge::createWearable(LLFolderBridge* bridge, EWearableType type)
-{
- if(!bridge) return;
- LLUUID parent_id = bridge->getUUID();
- createWearable(parent_id, type);
-}
-
-// Separate function so can be called by global menu as well as right-click
-// menu.
-// static
-void LLFolderBridge::createWearable(const LLUUID &parent_id, EWearableType type)
-{
- LLWearable* wearable = LLWearableList::instance().createNewWearable(type);
- LLAssetType::EType asset_type = wearable->getAssetType();
- LLInventoryType::EType inv_type = LLInventoryType::IT_WEARABLE;
- create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
- parent_id, wearable->getTransactionID(), wearable->getName(),
- wearable->getDescription(), asset_type, inv_type, wearable->getType(),
- wearable->getPermissions().getMaskNextOwner(),
- LLPointer<LLInventoryCallback>(NULL));
-}
-
-void LLFolderBridge::modifyOutfit(BOOL append)
-{
- LLInventoryModel* model = getInventoryModel();
- if(!model) return;
- LLViewerInventoryCategory* cat = getCategory();
- if(!cat) return;
-
- // BAP - was:
- // wear_inventory_category_on_avatar( cat, append );
- LLAppearanceManager::instance().wearInventoryCategory( cat, FALSE, append );
-}
-
-// helper stuff
-bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, LLMoveInv* move_inv)
-{
- LLFloaterOpenObject::LLCatAndWear* cat_and_wear = (LLFloaterOpenObject::LLCatAndWear* )move_inv->mUserData;
- LLViewerObject* object = gObjectList.findObject(move_inv->mObjectID);
- S32 option = LLNotification::getSelectedOption(notification, response);
-
- if(option == 0 && object)
- {
- if (cat_and_wear && cat_and_wear->mWear)
- {
- InventoryObjectList inventory_objects;
- object->getInventoryContents(inventory_objects);
- int contents_count = inventory_objects.size()-1; //subtract one for containing folder
-
- LLInventoryCopyAndWearObserver* inventoryObserver = new LLInventoryCopyAndWearObserver(cat_and_wear->mCatID, contents_count);
- gInventory.addObserver(inventoryObserver);
- }
-
- two_uuids_list_t::iterator move_it;
- for (move_it = move_inv->mMoveList.begin();
- move_it != move_inv->mMoveList.end();
- ++move_it)
- {
- object->moveInventory(move_it->first, move_it->second);
- }
-
- // update the UI.
- dialog_refresh_all();
- }
-
- if (move_inv->mCallback)
- {
- move_inv->mCallback(option, move_inv->mUserData);
- }
-
- delete move_inv;
- return false;
-}
-
-/*
-Next functions intended to reorder items in the inventory folder and save order on server
-Is now used for Favorites folder.
-
-*TODO: refactoring is needed with Favorites Bar functionality. Probably should be moved in LLInventoryModel
-*/
-void saveItemsOrder(LLInventoryModel::item_array_t& items)
-{
- int sortField = 0;
-
- // current order is saved by setting incremental values (1, 2, 3, ...) for the sort field
- for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i)
- {
- LLViewerInventoryItem* item = *i;
-
- item->setSortField(++sortField);
- item->setComplete(TRUE);
- item->updateServer(FALSE);
-
- gInventory.updateItem(item);
- }
-
- gInventory.notifyObservers();
-}
-
-LLInventoryModel::item_array_t::iterator findItemByUUID(LLInventoryModel::item_array_t& items, const LLUUID& id)
-{
- LLInventoryModel::item_array_t::iterator result = items.end();
-
- for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i)
- {
- if ((*i)->getUUID() == id)
- {
- result = i;
- break;
- }
- }
-
- return result;
-}
-
-void updateItemsOrder(LLInventoryModel::item_array_t& items, const LLUUID& srcItemId, const LLUUID& destItemId)
-{
- LLViewerInventoryItem* srcItem = gInventory.getItem(srcItemId);
- LLViewerInventoryItem* destItem = gInventory.getItem(destItemId);
-
- items.erase(findItemByUUID(items, srcItem->getUUID()));
- items.insert(findItemByUUID(items, destItem->getUUID()), srcItem);
-}
-
-BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
- BOOL drop)
-{
- LLInventoryModel* model = getInventoryModel();
- if(!model || !inv_item) return FALSE;
-
- // cannot drag into library
- if(!isAgentInventory())
- {
- return FALSE;
- }
-
- LLVOAvatarSelf* avatar = gAgent.getAvatarObject();
- if(!avatar) return FALSE;
-
- LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource();
- BOOL accept = FALSE;
- LLViewerObject* object = NULL;
- if(LLToolDragAndDrop::SOURCE_AGENT == source)
- {
-
- BOOL is_movable = TRUE;
- switch( inv_item->getActualType() )
- {
- case LLAssetType::AT_CATEGORY:
- is_movable = !LLFolderType::lookupIsProtectedType(((LLInventoryCategory*)inv_item)->getPreferredType());
- break;
- default:
- break;
- }
-
- const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
- BOOL move_is_into_trash = (mUUID == trash_id) || model->isObjectDescendentOf(mUUID, trash_id);
- const LLUUID current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);
- BOOL move_is_into_current_outfit = (mUUID == current_outfit_id);
- BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT);
-
- if(is_movable && move_is_into_trash)
- {
- switch(inv_item->getType())
- {
- case LLAssetType::AT_CLOTHING:
- case LLAssetType::AT_BODYPART:
- is_movable = !gAgentWearables.isWearingItem(inv_item->getUUID());
- break;
-
- case LLAssetType::AT_OBJECT:
- is_movable = !avatar->isWearingAttachment(inv_item->getUUID());
- break;
- default:
- break;
- }
- }
-
- if ( is_movable )
- {
- // Don't allow creating duplicates in the Calling Card/Friends
- // subfolders, see bug EXT-1599. Check is item direct descendent
- // of target folder and forbid item's movement if it so.
- // Note: isItemDirectDescendentOfCategory checks if
- // passed category is in the Calling Card/Friends folder
- is_movable = ! LLFriendCardsManager::instance()
- .isObjDirectDescendentOfCategory (inv_item, getCategory());
- }
-
- const LLUUID& favorites_id = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
- const LLUUID& landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK);
- const BOOL folder_allows_reorder = ((mUUID == landmarks_id) || (mUUID == favorites_id));
-
- // we can move item inside a folder only if this folder is Favorites. See EXT-719
- accept = is_movable && ((mUUID != inv_item->getParentUUID()) || folder_allows_reorder);
- if(accept && drop)
- {
- if (inv_item->getType() == LLAssetType::AT_GESTURE
- && LLGestureManager::instance().isGestureActive(inv_item->getUUID()) && move_is_into_trash)
- {
- LLGestureManager::instance().deactivateGesture(inv_item->getUUID());
- }
- // If an item is being dragged between windows, unselect
- // everything in the active window so that we don't follow
- // the selection to its new location (which is very
- // annoying).
- if (LLFloaterInventory::getActiveInventory())
- {
- LLInventoryPanel* active_panel = LLFloaterInventory::getActiveInventory()->getPanel();
- LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
- if (active_panel && (panel != active_panel))
- {
- active_panel->unSelectAll();
- }
- }
-
- // if dragging from/into favorites folder only reorder items
- if ((mUUID == inv_item->getParentUUID()) && folder_allows_reorder)
- {
- LLInventoryModel::cat_array_t cats;
- LLInventoryModel::item_array_t items;
- LLIsType is_type(LLAssetType::AT_LANDMARK);
- model->collectDescendentsIf(mUUID, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_type);
-
- LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
- LLFolderViewItem* itemp = panel ? panel->getRootFolder()->getDraggingOverItem() : NULL;
- if (itemp)
- {
- LLUUID srcItemId = inv_item->getUUID();
- LLUUID destItemId = itemp->getListener()->getUUID();
-
- // update order
- updateItemsOrder(items, srcItemId, destItemId);
-
- saveItemsOrder(items);
- }
- }
- else if (favorites_id == mUUID) // if target is the favorites folder we use copy
- {
- copy_inventory_item(
- gAgent.getID(),
- inv_item->getPermissions().getOwner(),
- inv_item->getUUID(),
- mUUID,
- std::string(),
- LLPointer<LLInventoryCallback>(NULL));
- }
- else if (move_is_into_current_outfit || move_is_into_outfit)
- {
- // BAP - should skip if dup.
- if (move_is_into_current_outfit)
- {
- LLAppearanceManager::instance().addCOFItemLink(inv_item);
- }
- else
- {
- LLPointer<LLInventoryCallback> cb = NULL;
- link_inventory_item(
- gAgent.getID(),
- inv_item->getLinkedUUID(),
- mUUID,
- inv_item->getName(),
- LLAssetType::AT_LINK,
- cb);
- }
- }
- else
- {
- // restamp if the move is into the trash.
- LLInvFVBridge::changeItemParent(
- model,
- (LLViewerInventoryItem*)inv_item,
- mUUID,
- move_is_into_trash);
- }
- }
- }
- else if(LLToolDragAndDrop::SOURCE_WORLD == source)
- {
- // Make sure the object exists. If we allowed dragging from
- // anonymous objects, it would be possible to bypass
- // permissions.
- object = gObjectList.findObject(inv_item->getParentUUID());
- if(!object)
- {
- llinfos << "Object not found for drop." << llendl;
- return FALSE;
- }
-
- // coming from a task. Need to figure out if the person can
- // move/copy this item.
- LLPermissions perm(inv_item->getPermissions());
- BOOL is_move = FALSE;
- if((perm.allowCopyBy(gAgent.getID(), gAgent.getGroupID())
- && perm.allowTransferTo(gAgent.getID())))
-// || gAgent.isGodlike())
-
- {
- accept = TRUE;
- }
- else if(object->permYouOwner())
- {
- // If the object cannot be copied, but the object the
- // inventory is owned by the agent, then the item can be
- // moved from the task to agent inventory.
- is_move = TRUE;
- accept = TRUE;
- }
- if(drop && accept)
- {
- LLMoveInv* move_inv = new LLMoveInv;
- move_inv->mObjectID = inv_item->getParentUUID();
- two_uuids_t item_pair(mUUID, inv_item->getUUID());
- move_inv->mMoveList.push_back(item_pair);
- move_inv->mCallback = NULL;
- move_inv->mUserData = NULL;
- if(is_move)
- {
- warn_move_inventory(object, move_inv);
- }
- else
- {
- LLNotification::Params params("MoveInventoryFromObject");
- params.functor.function(boost::bind(move_task_inventory_callback, _1, _2, move_inv));
- LLNotifications::instance().forceResponse(params, 0);
- }
- }
-
- }
- else if(LLToolDragAndDrop::SOURCE_NOTECARD == source)
- {
- accept = TRUE;
- if(drop)
- {
- copy_inventory_from_notecard(LLToolDragAndDrop::getInstance()->getObjectID(),
- LLToolDragAndDrop::getInstance()->getSourceID(), inv_item);
- }
- }
- else if(LLToolDragAndDrop::SOURCE_LIBRARY == source)
- {
- LLViewerInventoryItem* item = (LLViewerInventoryItem*)inv_item;
- if(item && item->isComplete())
- {
- accept = TRUE;
- if(drop)
- {
- copy_inventory_item(
- gAgent.getID(),
- inv_item->getPermissions().getOwner(),
- inv_item->getUUID(),
- mUUID,
- std::string(),
- LLPointer<LLInventoryCallback>(NULL));
- }
- }
- }
- else
- {
- llwarns << "unhandled drag source" << llendl;
- }
- return accept;
-}
-
-// +=================================================+
-// | LLScriptBridge (DEPRECTED) |
-// +=================================================+
-
-LLUIImagePtr LLScriptBridge::getIcon() const
-{
- return get_item_icon(LLAssetType::AT_SCRIPT, LLInventoryType::IT_LSL, 0, FALSE);
-}
-
-// +=================================================+
-// | LLTextureBridge |
-// +=================================================+
-
-LLUIImagePtr LLTextureBridge::getIcon() const
-{
- return get_item_icon(LLAssetType::AT_TEXTURE, mInvType, 0, FALSE);
-}
-
-void LLTextureBridge::openItem()
-{
- LLViewerInventoryItem* item = getItem();
-
- if (item)
- {
- LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel());
- }
-}
-
-void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
-{
- lldebugs << "LLTextureBridge::buildContextMenu()" << llendl;
- std::vector<std::string> items;
- std::vector<std::string> disabled_items;
- if(isInTrash())
- {
- items.push_back(std::string("Purge Item"));
- if (!isItemRemovable())
- {
- disabled_items.push_back(std::string("Purge Item"));
- }
-
- items.push_back(std::string("Restore Item"));
- }
- else
- {
- items.push_back(std::string("Open"));
- items.push_back(std::string("Properties"));
-
- getClipboardEntries(true, items, disabled_items, flags);
-
- items.push_back(std::string("Texture Separator"));
- items.push_back(std::string("Save As"));
- }
- hide_context_entries(menu, items, disabled_items);
-}
-
-// virtual
-void LLTextureBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action)
-{
- if ("save_as" == action)
- {
- LLFloaterReg::showInstance("preview_texture", LLSD(mUUID), TAKE_FOCUS_YES);
- LLPreviewTexture* preview_texture = LLFloaterReg::findTypedInstance<LLPreviewTexture>("preview_texture", mUUID);
- if (preview_texture)
- {
- preview_texture->openToSave();
- }
- }
- else LLItemBridge::performAction(folder, model, action);
-}
-
-// +=================================================+
-// | LLSoundBridge |
-// +=================================================+
-
-LLUIImagePtr LLSoundBridge::getIcon() const
-{
- return get_item_icon(LLAssetType::AT_SOUND, LLInventoryType::IT_SOUND, 0, FALSE);
-}
-
-void LLSoundBridge::openItem()
-{
- LLViewerInventoryItem* item = getItem();
-
- if (item)
- {
- LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel());
- }
-/*
-// Changed this back to the way it USED to work:
-// only open the preview dialog through the contextual right-click menu
-// double-click just plays the sound
-
- LLViewerInventoryItem* item = getItem();
- if(item)
- {
- openSoundPreview((void*)this);
- //send_uuid_sound_trigger(item->getAssetUUID(), 1.0);
- }
-*/
-}
-
-void LLSoundBridge::previewItem()
-{
- LLViewerInventoryItem* item = getItem();
- if(item)
- {
- send_sound_trigger(item->getAssetUUID(), 1.0);
- }
-}
-
-void LLSoundBridge::openSoundPreview(void* which)
-{
- LLSoundBridge *me = (LLSoundBridge *)which;
- LLFloaterReg::showInstance("preview_sound", LLSD(me->mUUID), TAKE_FOCUS_YES);
-}
-
-void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
-{
- lldebugs << "LLSoundBridge::buildContextMenu()" << llendl;
- std::vector<std::string> items;
- std::vector<std::string> disabled_items;
-
- if(isInTrash())
- {
- items.push_back(std::string("Purge Item"));
- if (!isItemRemovable())
- {
- disabled_items.push_back(std::string("Purge Item"));
- }
-
- items.push_back(std::string("Restore Item"));
- }
- else
- {
- items.push_back(std::string("Sound Open"));
- items.push_back(std::string("Properties"));
-
- getClipboardEntries(true, items, disabled_items, flags);
- }
-
- items.push_back(std::string("Sound Separator"));
- items.push_back(std::string("Sound Play"));
-
- hide_context_entries(menu, items, disabled_items);
-}
-
-// +=================================================+
-// | LLLandmarkBridge |
-// +=================================================+
-
-LLLandmarkBridge::LLLandmarkBridge(LLInventoryPanel* inventory, const LLUUID& uuid, U32 flags/* = 0x00*/) :
-LLItemBridge(inventory, uuid)
-{
- mVisited = FALSE;
- if (flags & LLInventoryItem::II_FLAGS_LANDMARK_VISITED)
- {
- mVisited = TRUE;
- }
-}
-
-LLUIImagePtr LLLandmarkBridge::getIcon() const
-{
- return get_item_icon(LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, mVisited, FALSE);
-}
-
-void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
-{
- std::vector<std::string> items;
- std::vector<std::string> disabled_items;
-
- lldebugs << "LLLandmarkBridge::buildContextMenu()" << llendl;
- if(isInTrash())
- {
- items.push_back(std::string("Purge Item"));
- if (!isItemRemovable())
- {
- disabled_items.push_back(std::string("Purge Item"));
- }
-
- items.push_back(std::string("Restore Item"));
- }
- else
- {
- items.push_back(std::string("Landmark Open"));
- items.push_back(std::string("Properties"));
-
- getClipboardEntries(true, items, disabled_items, flags);
- }
-
- items.push_back(std::string("Landmark Separator"));
- items.push_back(std::string("About Landmark"));
-
- // Disable "About Landmark" menu item for
- // multiple landmarks selected. Only one landmark
- // info panel can be shown at a time.
- if ((flags & FIRST_SELECTED_ITEM) == 0)
- {
- disabled_items.push_back(std::string("About Landmark"));
- }
-
- hide_context_entries(menu, items, disabled_items);
-}
-
-// Convenience function for the two functions below.
-void teleport_via_landmark(const LLUUID& asset_id)
-{
- gAgent.teleportViaLandmark( asset_id );
-
- // we now automatically track the landmark you're teleporting to
- // because you'll probably arrive at a telehub instead
- LLFloaterWorldMap* floater_world_map = LLFloaterWorldMap::getInstance();
- if( floater_world_map )
- {
- floater_world_map->trackLandmark( asset_id );
- }
-}
-
-// virtual
-void LLLandmarkBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action)
-{
- if ("teleport" == action)
- {
- LLViewerInventoryItem* item = getItem();
- if(item)
- {
- teleport_via_landmark(item->getAssetUUID());
- }
- }
- else if ("about" == action)
- {
- LLViewerInventoryItem* item = getItem();
- if(item)
- {
- LLSD key;
- key["type"] = "landmark";
- key["id"] = item->getUUID();
-
- LLSideTray::getInstance()->showPanel("panel_places", key);
- }
- }
- else
- {
- LLItemBridge::performAction(folder, model, action);
- }
-}
-
-static bool open_landmark_callback(const LLSD& notification, const LLSD& response)
-{
- S32 option = LLNotification::getSelectedOption(notification, response);
-
- LLUUID asset_id = notification["payload"]["asset_id"].asUUID();
- if (option == 0)
- {
- teleport_via_landmark(asset_id);
- }
-
- return false;
-}
-static LLNotificationFunctorRegistration open_landmark_callback_reg("TeleportFromLandmark", open_landmark_callback);
-
-
-void LLLandmarkBridge::openItem()
-{
- LLViewerInventoryItem* item = getItem();
-
- if (item)
- {
- LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel());
- }
-/*
- LLViewerInventoryItem* item = getItem();
- if( item )
- {
- // Opening (double-clicking) a landmark immediately teleports,
- // but warns you the first time.
- // open_landmark(item);
- LLSD payload;
- payload["asset_id"] = item->getAssetUUID();
- LLNotifications::instance().add("TeleportFromLandmark", LLSD(), payload);
- }
-*/
-}
-
-
-// +=================================================+
-// | LLCallingCardObserver |
-// +=================================================+
-void LLCallingCardObserver::changed(U32 mask)
-{
- mBridgep->refreshFolderViewItem();
-}
-
-// +=================================================+
-// | LLCallingCardBridge |
-// +=================================================+
-
-LLCallingCardBridge::LLCallingCardBridge( LLInventoryPanel* inventory, const LLUUID& uuid ) :
- LLItemBridge(inventory, uuid)
-{
- mObserver = new LLCallingCardObserver(this);
- LLAvatarTracker::instance().addObserver(mObserver);
-}
-
-LLCallingCardBridge::~LLCallingCardBridge()
-{
- LLAvatarTracker::instance().removeObserver(mObserver);
- delete mObserver;
-}
-
-void LLCallingCardBridge::refreshFolderViewItem()
-{
- LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
- LLFolderViewItem* itemp = panel ? panel->getRootFolder()->getItemByID(mUUID) : NULL;
- if (itemp)
- {
- itemp->refresh();
- }
-}
-
-// virtual
-void LLCallingCardBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action)
-{
- if ("begin_im" == action)
- {
- LLViewerInventoryItem *item = getItem();
- if (item && (item->getCreatorUUID() != gAgent.getID()) &&
- (!item->getCreatorUUID().isNull()))
- {
- std::string callingcard_name;
- gCacheName->getFullName(item->getCreatorUUID(), callingcard_name);
- LLUUID session_id = gIMMgr->addSession(callingcard_name, IM_NOTHING_SPECIAL, item->getCreatorUUID());
- if (session_id != LLUUID::null)
- {
- LLIMFloater::show(session_id);
- }
- }
- }
- else if ("lure" == action)
- {
- LLViewerInventoryItem *item = getItem();
- if (item && (item->getCreatorUUID() != gAgent.getID()) &&
- (!item->getCreatorUUID().isNull()))
- {
- LLAvatarActions::offerTeleport(item->getCreatorUUID());
- }
- }
- else LLItemBridge::performAction(folder, model, action);
-}
-
-LLUIImagePtr LLCallingCardBridge::getIcon() const
-{
- BOOL online = FALSE;
- LLViewerInventoryItem* item = getItem();
- if(item)
- {
- online = LLAvatarTracker::instance().isBuddyOnline(item->getCreatorUUID());
- }
- return get_item_icon(LLAssetType::AT_CALLINGCARD, LLInventoryType::IT_CALLINGCARD, online, FALSE);
-}
-
-std::string LLCallingCardBridge::getLabelSuffix() const
-{
- LLViewerInventoryItem* item = getItem();
- if( item && LLAvatarTracker::instance().isBuddyOnline(item->getCreatorUUID()) )
- {
- return LLItemBridge::getLabelSuffix() + " (online)";
- }
- else
- {
- return LLItemBridge::getLabelSuffix();
- }
-}
-
-void LLCallingCardBridge::openItem()
-{
- LLViewerInventoryItem* item = getItem();
-
- if (item)
- {
- LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel());
- }
-/*
- LLViewerInventoryItem* item = getItem();
- if(item && !item->getCreatorUUID().isNull())
- {
- LLAvatarActions::showProfile(item->getCreatorUUID());
- }
-*/
-}
-
-void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
-{
- lldebugs << "LLCallingCardBridge::buildContextMenu()" << llendl;
- std::vector<std::string> items;
- std::vector<std::string> disabled_items;
-
- if(isInTrash())
- {
- items.push_back(std::string("Purge Item"));
- if (!isItemRemovable())
- {
- disabled_items.push_back(std::string("Purge Item"));
- }
-
- items.push_back(std::string("Restore Item"));
- }
- else
- {
- items.push_back(std::string("Open"));
- items.push_back(std::string("Properties"));
-
- getClipboardEntries(true, items, disabled_items, flags);
-
- LLInventoryItem* item = getItem();
- BOOL good_card = (item
- && (LLUUID::null != item->getCreatorUUID())
- && (item->getCreatorUUID() != gAgent.getID()));
- BOOL user_online = (LLAvatarTracker::instance().isBuddyOnline(item->getCreatorUUID()));
- items.push_back(std::string("Send Instant Message Separator"));
- items.push_back(std::string("Send Instant Message"));
- items.push_back(std::string("Offer Teleport..."));
- items.push_back(std::string("Conference Chat"));
-
- if (!good_card)
- {
- disabled_items.push_back(std::string("Send Instant Message"));
- }
- if (!good_card || !user_online)
- {
- disabled_items.push_back(std::string("Offer Teleport..."));
- disabled_items.push_back(std::string("Conference Chat"));
- }
- }
- hide_context_entries(menu, items, disabled_items);
-}
-
-BOOL LLCallingCardBridge::dragOrDrop(MASK mask, BOOL drop,
- EDragAndDropType cargo_type,
- void* cargo_data)
-{
- LLViewerInventoryItem* item = getItem();
- BOOL rv = FALSE;
- if(item)
- {
- // check the type
- switch(cargo_type)
- {
- case DAD_TEXTURE:
- case DAD_SOUND:
- case DAD_LANDMARK:
- case DAD_SCRIPT:
- case DAD_CLOTHING:
- case DAD_OBJECT:
- case DAD_NOTECARD:
- case DAD_BODYPART:
- case DAD_ANIMATION:
- case DAD_GESTURE:
- case DAD_MESH:
- {
- LLInventoryItem* inv_item = (LLInventoryItem*)cargo_data;
- const LLPermissions& perm = inv_item->getPermissions();
- if(gInventory.getItem(inv_item->getUUID())
- && perm.allowOperationBy(PERM_TRANSFER, gAgent.getID()))
- {
- rv = TRUE;
- if(drop)
- {
- LLToolDragAndDrop::giveInventory(item->getCreatorUUID(),
- (LLInventoryItem*)cargo_data);
- }
- }
- else
- {
- // It's not in the user's inventory (it's probably in
- // an object's contents), so disallow dragging it here.
- // You can't give something you don't yet have.
- rv = FALSE;
- }
- break;
- }
- case DAD_CATEGORY:
- {
- LLInventoryCategory* inv_cat = (LLInventoryCategory*)cargo_data;
- if( gInventory.getCategory( inv_cat->getUUID() ) )
- {
- rv = TRUE;
- if(drop)
- {
- LLToolDragAndDrop::giveInventoryCategory(
- item->getCreatorUUID(),
- inv_cat);
- }
- }
- else
- {
- // It's not in the user's inventory (it's probably in
- // an object's contents), so disallow dragging it here.
- // You can't give something you don't yet have.
- rv = FALSE;
- }
- break;
- }
- default:
- break;
- }
- }
- return rv;
-}
-
-BOOL LLCallingCardBridge::removeItem()
-{
- if (LLFriendCardsManager::instance().isItemInAnyFriendsList(getItem()))
- {
- LLAvatarActions::removeFriendDialog(getItem()->getCreatorUUID());
- return FALSE;
- }
- else
- {
- return LLItemBridge::removeItem();
- }
-}
-// +=================================================+
-// | LLNotecardBridge |
-// +=================================================+
-
-LLUIImagePtr LLNotecardBridge::getIcon() const
-{
- return get_item_icon(LLAssetType::AT_NOTECARD, LLInventoryType::IT_NOTECARD, 0, FALSE);
-}
-
-void LLNotecardBridge::openItem()
-{
- LLViewerInventoryItem* item = getItem();
-
- if (item)
- {
- LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel());
- }
-
-/*
- LLViewerInventoryItem* item = getItem();
- if (item)
- {
- LLFloaterReg::showInstance("preview_notecard", LLSD(item->getUUID()), TAKE_FOCUS_YES);
- }
-*/
-}
-
-
-// +=================================================+
-// | LLGestureBridge |
-// +=================================================+
-
-LLUIImagePtr LLGestureBridge::getIcon() const
-{
- return get_item_icon(LLAssetType::AT_GESTURE, LLInventoryType::IT_GESTURE, 0, FALSE);
-}
-
-LLFontGL::StyleFlags LLGestureBridge::getLabelStyle() const
-{
- if( LLGestureManager::instance().isGestureActive(mUUID) )
- {
- return LLFontGL::BOLD;
- }
- else
- {
- return LLFontGL::NORMAL;
- }
-}
-
-std::string LLGestureBridge::getLabelSuffix() const
-{
- if( LLGestureManager::instance().isGestureActive(mUUID) )
- {
- return LLItemBridge::getLabelSuffix() + " (active)";
- }
- else
- {
- return LLItemBridge::getLabelSuffix();
- }
-}
-
-// virtual
-void LLGestureBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action)
-{
- if ("activate" == action)
- {
- LLGestureManager::instance().activateGesture(mUUID);
-
- LLViewerInventoryItem* item = gInventory.getItem(mUUID);
- if (!item) return;
-
- // Since we just changed the suffix to indicate (active)
- // the server doesn't need to know, just the viewer.
- gInventory.updateItem(item);
- gInventory.notifyObservers();
- }
- else if ("deactivate" == action)
- {
- LLGestureManager::instance().deactivateGesture(mUUID);
-
- LLViewerInventoryItem* item = gInventory.getItem(mUUID);
- if (!item) return;
-
- // Since we just changed the suffix to indicate (active)
- // the server doesn't need to know, just the viewer.
- gInventory.updateItem(item);
- gInventory.notifyObservers();
- }
- else LLItemBridge::performAction(folder, model, action);
-}
-
-void LLGestureBridge::openItem()
-{
- LLViewerInventoryItem* item = getItem();
-
- if (item)
- {
- LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel());
- }
-/*
- LLViewerInventoryItem* item = getItem();
- if (item)
- {
- LLPreviewGesture* preview = LLPreviewGesture::show(mUUID, LLUUID::null);
- preview->setFocus(TRUE);
- }
-*/
-}
-
-BOOL LLGestureBridge::removeItem()
-{
- // Force close the preview window, if it exists
- LLGestureManager::instance().deactivateGesture(mUUID);
- return LLItemBridge::removeItem();
-}
-
-void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
-{
- lldebugs << "LLGestureBridge::buildContextMenu()" << llendl;
- std::vector<std::string> items;
- std::vector<std::string> disabled_items;
- if(isInTrash())
- {
- items.push_back(std::string("Purge Item"));
- if (!isItemRemovable())
- {
- disabled_items.push_back(std::string("Purge Item"));
- }
-
- items.push_back(std::string("Restore Item"));
- }
- else
- {
- items.push_back(std::string("Open"));
- items.push_back(std::string("Properties"));
-
- getClipboardEntries(true, items, disabled_items, flags);
-
- items.push_back(std::string("Gesture Separator"));
- items.push_back(std::string("Activate"));
- items.push_back(std::string("Deactivate"));
- }
- hide_context_entries(menu, items, disabled_items);
-}
-
-// +=================================================+
-// | LLAnimationBridge |
-// +=================================================+
-
-LLUIImagePtr LLAnimationBridge::getIcon() const
-{
- return get_item_icon(LLAssetType::AT_ANIMATION, LLInventoryType::IT_ANIMATION, 0, FALSE);
-}
-
-void LLAnimationBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
-{
- std::vector<std::string> items;
- std::vector<std::string> disabled_items;
-
- lldebugs << "LLAnimationBridge::buildContextMenu()" << llendl;
- if(isInTrash())
- {
- items.push_back(std::string("Purge Item"));
- if (!isItemRemovable())
- {
- disabled_items.push_back(std::string("Purge Item"));
- }
-
- items.push_back(std::string("Restore Item"));
- }
- else
- {
- items.push_back(std::string("Animation Open"));
- items.push_back(std::string("Properties"));
-
- getClipboardEntries(true, items, disabled_items, flags);
- }
-
- items.push_back(std::string("Animation Separator"));
- items.push_back(std::string("Animation Play"));
- items.push_back(std::string("Animation Audition"));
-
- hide_context_entries(menu, items, disabled_items);
-
-}
-
-// virtual
-void LLAnimationBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action)
-{
- if ((action == "playworld") || (action == "playlocal"))
- {
- if (getItem())
- {
- LLPreviewAnim::e_activation_type activate = LLPreviewAnim::NONE;
- if ("playworld" == action) activate = LLPreviewAnim::PLAY;
- if ("playlocal" == action) activate = LLPreviewAnim::AUDITION;
-
- LLPreviewAnim* preview = LLFloaterReg::showTypedInstance<LLPreviewAnim>("preview_anim", LLSD(mUUID));
- if (preview)
- {
- preview->activate(activate);
- }
- }
- }
- else
- {
- LLItemBridge::performAction(folder, model, action);
- }
-}
-
-void LLAnimationBridge::openItem()
-{
- LLViewerInventoryItem* item = getItem();
-
- if (item)
- {
- LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel());
- }
-/*
- LLViewerInventoryItem* item = getItem();
- if (item)
- {
- LLFloaterReg::showInstance("preview_anim", LLSD(mUUID), TAKE_FOCUS_YES);
- }
-*/
-}
-
-// +=================================================+
-// | LLObjectBridge |
-// +=================================================+
-
-// static
-LLUUID LLObjectBridge::sContextMenuItemID;
-
-LLObjectBridge::LLObjectBridge(LLInventoryPanel* inventory, const LLUUID& uuid, LLInventoryType::EType type, U32 flags) :
-LLItemBridge(inventory, uuid), mInvType(type)
-{
- mAttachPt = (flags & 0xff); // low bye of inventory flags
-
- mIsMultiObject = ( flags & LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS ) ? TRUE: FALSE;
-}
-
-LLUIImagePtr LLObjectBridge::getIcon() const
-{
- return get_item_icon(LLAssetType::AT_OBJECT, mInvType, mAttachPt, mIsMultiObject );
-}
-
-LLInventoryObject* LLObjectBridge::getObject() const
-{
- LLInventoryObject* object = NULL;
- LLInventoryModel* model = getInventoryModel();
- if(model)
- {
- object = (LLInventoryObject*)model->getObject(mUUID);
- }
- return object;
-}
-
-// virtual
-void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action)
-{
- if ("attach" == action)
- {
- LLUUID object_id = mUUID;
- LLViewerInventoryItem* item;
- item = (LLViewerInventoryItem*)gInventory.getItem(object_id);
- if(item && gInventory.isObjectDescendentOf(object_id, gInventory.getRootFolderID()))
- {
- rez_attachment(item, NULL);
- }
- else if(item && item->isComplete())
- {
- // must be in library. copy it to our inventory and put it on.
- LLPointer<LLInventoryCallback> cb = new RezAttachmentCallback(0);
- copy_inventory_item(
- gAgent.getID(),
- item->getPermissions().getOwner(),
- item->getUUID(),
- LLUUID::null,
- std::string(),
- cb);
- }
- gFocusMgr.setKeyboardFocus(NULL);
- }
- else if ("detach" == action)
- {
- LLInventoryItem* item = gInventory.getItem(mUUID);
- if(item)
- {
- gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv);
- gMessageSystem->nextBlockFast(_PREHASH_ObjectData);
- gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
- gMessageSystem->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID());
- gMessageSystem->sendReliable( gAgent.getRegion()->getHost());
- }
- // this object might have been selected, so let the selection manager know it's gone now
- LLViewerObject *found_obj = gObjectList.findObject(item->getLinkedUUID());
- if (found_obj)
- {
- LLSelectMgr::getInstance()->remove(found_obj);
- }
- }
- else LLItemBridge::performAction(folder, model, action);
-}
-
-void LLObjectBridge::openItem()
-{
- LLViewerInventoryItem* item = getItem();
-
- if (item)
- {
- LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel());
- }
-
- LLSD key;
- key["id"] = mUUID;
- LLSideTray::getInstance()->showPanel("sidepanel_inventory", key);
-
- // Disable old properties floater; this is replaced by the sidepanel.
- /*
- LLFloaterReg::showInstance("properties", mUUID);
- */
-}
-
-LLFontGL::StyleFlags LLObjectBridge::getLabelStyle() const
-{
- U8 font = LLFontGL::NORMAL;
-
- LLVOAvatarSelf* avatar = gAgent.getAvatarObject();
- if( avatar && avatar->isWearingAttachment( mUUID ) )
- {
- font |= LLFontGL::BOLD;
- }
-
- LLInventoryItem* item = getItem();
- if (item && item->getIsLinkType())
- {
- font |= LLFontGL::ITALIC;
- }
-
- return (LLFontGL::StyleFlags)font;
-}
-
-std::string LLObjectBridge::getLabelSuffix() const
-{
- LLVOAvatarSelf* avatar = gAgent.getAvatarObject();
- if( avatar && avatar->isWearingAttachment( mUUID ) )
- {
- std::string attachment_point_name = avatar->getAttachedPointName(mUUID);
-
- // e.g. "(worn on ...)" / "(attached to ...)"
- LLStringUtil::format_map_t args;
- args["[ATTACHMENT_POINT]"] = attachment_point_name.c_str();
- return LLItemBridge::getLabelSuffix() + LLTrans::getString("WornOnAttachmentPoint", args);
- }
- else
- {
- return LLItemBridge::getLabelSuffix();
- }
-}
-
-void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment)
-{
- LLSD payload;
- payload["item_id"] = item->getLinkedUUID(); // Wear the base object in case this is a link.
-
- S32 attach_pt = 0;
- if (gAgent.getAvatarObject() && attachment)
- {
- for (LLVOAvatar::attachment_map_t::iterator iter = gAgent.getAvatarObject()->mAttachmentPoints.begin();
- iter != gAgent.getAvatarObject()->mAttachmentPoints.end(); ++iter)
- {
- if (iter->second == attachment)
- {
- attach_pt = iter->first;
- break;
- }
- }
- }
-
- payload["attachment_point"] = attach_pt;
-
-#if !ENABLE_MULTIATTACHMENTS
- if (attachment && attachment->getNumObjects() > 0)
- {
- LLNotifications::instance().add("ReplaceAttachment", LLSD(), payload, confirm_replace_attachment_rez);
- }
- else
-#endif
- {
- LLNotifications::instance().forceResponse(LLNotification::Params("ReplaceAttachment").payload(payload), 0/*YES*/);
- }
-}
-
-bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& response)
-{
- LLVOAvatar *avatarp = gAgent.getAvatarObject();
-
- if (!avatarp->canAttachMoreObjects())
- {
- LLSD args;
- args["MAX_ATTACHMENTS"] = llformat("%d", MAX_AGENT_ATTACHMENTS);
- LLNotifications::instance().add("MaxAttachmentsOnOutfit", args);
- return false;
- }
-
- S32 option = LLNotification::getSelectedOption(notification, response);
- if (option == 0/*YES*/)
- {
- LLViewerInventoryItem* itemp = gInventory.getItem(notification["payload"]["item_id"].asUUID());
-
- if (itemp)
- {
- LLMessageSystem* msg = gMessageSystem;
- msg->newMessageFast(_PREHASH_RezSingleAttachmentFromInv);
- msg->nextBlockFast(_PREHASH_AgentData);
- msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
- msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
- msg->nextBlockFast(_PREHASH_ObjectData);
- msg->addUUIDFast(_PREHASH_ItemID, itemp->getUUID());
- msg->addUUIDFast(_PREHASH_OwnerID, itemp->getPermissions().getOwner());
- U8 attachment_pt = notification["payload"]["attachment_point"].asInteger();
-#if ENABLE_MULTIATTACHMENTS
- attachment_pt |= ATTACHMENT_ADD;
-#endif
- msg->addU8Fast(_PREHASH_AttachmentPt, attachment_pt);
- pack_permissions_slam(msg, itemp->getFlags(), itemp->getPermissions());
- msg->addStringFast(_PREHASH_Name, itemp->getName());
- msg->addStringFast(_PREHASH_Description, itemp->getDescription());
- msg->sendReliable(gAgent.getRegion()->getHost());
- }
- }
- return false;
-}
-static LLNotificationFunctorRegistration confirm_replace_attachment_rez_reg("ReplaceAttachment", confirm_replace_attachment_rez);
-
-void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
-{
- std::vector<std::string> items;
- std::vector<std::string> disabled_items;
- if(isInTrash())
- {
- items.push_back(std::string("Purge Item"));
- if (!isItemRemovable())
- {
- disabled_items.push_back(std::string("Purge Item"));
- }
-
- items.push_back(std::string("Restore Item"));
- }
- else
- {
- items.push_back(std::string("Properties"));
-
- LLInventoryItem *item = getItem();
- getClipboardEntries(true, items, disabled_items, flags);
-
- LLObjectBridge::sContextMenuItemID = mUUID;
-
- if(item)
- {
- LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
- if( !avatarp )
- {
- return;
- }
-
- if( avatarp->isWearingAttachment( mUUID ) )
- {
- items.push_back(std::string("Detach From Yourself"));
- }
- else
- if( !isInTrash() && !isLinkedObjectInTrash() )
- {
- items.push_back(std::string("Attach Separator"));
- items.push_back(std::string("Object Wear"));
- items.push_back(std::string("Attach To"));
- items.push_back(std::string("Attach To HUD"));
- // commented out for DEV-32347
- //items.push_back(std::string("Restore to Last Position"));
-
- if (!avatarp->canAttachMoreObjects())
- {
- disabled_items.push_back(std::string("Object Wear"));
- disabled_items.push_back(std::string("Attach To"));
- disabled_items.push_back(std::string("Attach To HUD"));
- }
- LLMenuGL* attach_menu = menu.findChildMenuByName("Attach To", TRUE);
- LLMenuGL* attach_hud_menu = menu.findChildMenuByName("Attach To HUD", TRUE);
- LLVOAvatar *avatarp = gAgent.getAvatarObject();
- if (attach_menu
- && (attach_menu->getChildCount() == 0)
- && attach_hud_menu
- && (attach_hud_menu->getChildCount() == 0)
- && avatarp)
- {
- for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin();
- iter != avatarp->mAttachmentPoints.end(); )
- {
- LLVOAvatar::attachment_map_t::iterator curiter = iter++;
- LLViewerJointAttachment* attachment = curiter->second;
- LLMenuItemCallGL::Params p;
- std::string submenu_name = attachment->getName();
- if (LLTrans::getString(submenu_name) != "")
- {
- p.name = (" ")+LLTrans::getString(submenu_name)+" ";
- }
- else
- {
- p.name = submenu_name;
- }
- LLSD cbparams;
- cbparams["index"] = curiter->first;
- cbparams["label"] = attachment->getName();
- p.on_click.function_name = "Inventory.AttachObject";
- p.on_click.parameter = LLSD(attachment->getName());
- p.on_enable.function_name = "Attachment.Label";
- p.on_enable.parameter = cbparams;
- LLView* parent = attachment->getIsHUDAttachment() ? attach_hud_menu : attach_menu;
- LLUICtrlFactory::create<LLMenuItemCallGL>(p, parent);
- }
- }
- }
- }
- }
- hide_context_entries(menu, items, disabled_items);
-}
-
-BOOL LLObjectBridge::renameItem(const std::string& new_name)
-{
- if(!isItemRenameable())
- return FALSE;
- LLPreview::dirty(mUUID);
- LLInventoryModel* model = getInventoryModel();
- if(!model)
- return FALSE;
- LLViewerInventoryItem* item = getItem();
- if(item && (item->getName() != new_name))
- {
- LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
- new_item->rename(new_name);
- buildDisplayName(new_item, mDisplayName);
- new_item->updateServer(FALSE);
- model->updateItem(new_item);
-
- model->notifyObservers();
-
- LLVOAvatarSelf* avatar = gAgent.getAvatarObject();
- if( avatar )
- {
- LLViewerObject* obj = avatar->getWornAttachment( item->getUUID() );
- if( obj )
- {
- LLSelectMgr::getInstance()->deselectAll();
- LLSelectMgr::getInstance()->addAsIndividual( obj, SELECT_ALL_TES, FALSE );
- LLSelectMgr::getInstance()->selectionSetObjectName( new_name );
- LLSelectMgr::getInstance()->deselectAll();
- }
- }
- }
- // return FALSE because we either notified observers (& therefore
- // rebuilt) or we didn't update.
- return FALSE;
-}
-
-// +=================================================+
-// | LLLSLTextBridge |
-// +=================================================+
-
-LLUIImagePtr LLLSLTextBridge::getIcon() const
-{
- return get_item_icon(LLAssetType::AT_SCRIPT, LLInventoryType::IT_LSL, 0, FALSE);
-}
-
-void LLLSLTextBridge::openItem()
-{
- LLViewerInventoryItem* item = getItem();
-
- if (item)
- {
- LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel());
- }
- /*
- LLViewerInventoryItem* item = getItem();
- if (item)
- {
- LLFloaterReg::showInstance("preview_script", LLSD(mUUID), TAKE_FOCUS_YES);
- }
- */
-}
-
-// +=================================================+
-// | LLWearableBridge |
-// +=================================================+
-
-// *NOTE: hack to get from avatar inventory to avatar
-void wear_inventory_item_on_avatar( LLInventoryItem* item )
-{
- if(item)
- {
- lldebugs << "wear_inventory_item_on_avatar( " << item->getName()
- << " )" << llendl;
-
- LLAppearanceManager::instance().addCOFItemLink(item);
- }
-}
-
-void wear_add_inventory_item_on_avatar( LLInventoryItem* item )
-{
- if(item)
- {
- lldebugs << "wear_add_inventory_item_on_avatar( " << item->getName()
- << " )" << llendl;
-
- LLWearableList::instance().getAsset(item->getAssetUUID(),
- item->getName(),
- item->getType(),
- LLWearableBridge::onWearAddOnAvatarArrived,
- new LLUUID(item->getUUID()));
- }
-}
-
-void remove_inventory_category_from_avatar( LLInventoryCategory* category )
-{
- if(!category) return;
- lldebugs << "remove_inventory_category_from_avatar( " << category->getName()
- << " )" << llendl;
-
-
- if( gFloaterCustomize )
- {
- gFloaterCustomize->askToSaveIfDirty(
- boost::bind(remove_inventory_category_from_avatar_step2, _1, category->getUUID()));
- }
- else
- {
- remove_inventory_category_from_avatar_step2(TRUE, category->getUUID() );
- }
-}
-
-struct OnRemoveStruct
-{
- LLUUID mUUID;
- OnRemoveStruct(const LLUUID& uuid):
- mUUID(uuid)
- {
- }
-};
-
-void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_id)
-{
-
- // Find all the wearables that are in the category's subtree.
- lldebugs << "remove_inventory_category_from_avatar_step2()" << llendl;
- if(proceed)
- {
- LLInventoryModel::cat_array_t cat_array;
- LLInventoryModel::item_array_t item_array;
- LLFindWearables is_wearable;
- gInventory.collectDescendentsIf(category_id,
- cat_array,
- item_array,
- LLInventoryModel::EXCLUDE_TRASH,
- is_wearable);
- S32 i;
- S32 wearable_count = item_array.count();
-
- LLInventoryModel::cat_array_t obj_cat_array;
- LLInventoryModel::item_array_t obj_item_array;
- LLIsType is_object( LLAssetType::AT_OBJECT );
- gInventory.collectDescendentsIf(category_id,
- obj_cat_array,
- obj_item_array,
- LLInventoryModel::EXCLUDE_TRASH,
- is_object);
- S32 obj_count = obj_item_array.count();
-
- // Find all gestures in this folder
- LLInventoryModel::cat_array_t gest_cat_array;
- LLInventoryModel::item_array_t gest_item_array;
- LLIsType is_gesture( LLAssetType::AT_GESTURE );
- gInventory.collectDescendentsIf(category_id,
- gest_cat_array,
- gest_item_array,
- LLInventoryModel::EXCLUDE_TRASH,
- is_gesture);
- S32 gest_count = gest_item_array.count();
-
- if (wearable_count > 0) //Loop through wearables. If worn, remove.
- {
- for(i = 0; i < wearable_count; ++i)
- {
- LLViewerInventoryItem *item = item_array.get(i);
- if (item->getType() == LLAssetType::AT_BODYPART)
- continue;
- if (gAgent.isTeen() && item->isWearableType() &&
- (item->getWearableType() == WT_UNDERPANTS || item->getWearableType() == WT_UNDERSHIRT))
- continue;
- if( gAgentWearables.isWearingItem (item->getLinkedUUID()) )
- {
- LLWearableList::instance().getAsset(item->getAssetUUID(),
- item->getName(),
- item->getType(),
- LLWearableBridge::onRemoveFromAvatarArrived,
- new OnRemoveStruct(item->getLinkedUUID()));
- }
- }
- }
-
- if (obj_count > 0)
- {
- for(i = 0; i < obj_count; ++i)
- {
- LLViewerInventoryItem *obj_item = obj_item_array.get(i);
- gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv);
- gMessageSystem->nextBlockFast(_PREHASH_ObjectData );
- gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
- gMessageSystem->addUUIDFast(_PREHASH_ItemID, obj_item->getLinkedUUID() );
-
- gMessageSystem->sendReliable( gAgent.getRegion()->getHost() );
-
- // this object might have been selected, so let the selection manager know it's gone now
- LLViewerObject *found_obj = gObjectList.findObject( obj_item->getLinkedUUID());
- if (found_obj)
- {
- LLSelectMgr::getInstance()->remove(found_obj);
- }
- }
- }
-
- if (gest_count > 0)
- {
- for(i = 0; i < gest_count; ++i)
- {
- LLViewerInventoryItem *gest_item = gest_item_array.get(i);
- if ( LLGestureManager::instance().isGestureActive( gest_item->getLinkedUUID()) )
- {
- LLGestureManager::instance().deactivateGesture( gest_item->getLinkedUUID() );
- gInventory.updateItem( gest_item );
- gInventory.notifyObservers();
- }
-
- }
- }
- }
-}
-
-BOOL LLWearableBridge::renameItem(const std::string& new_name)
-{
- if( gAgentWearables.isWearingItem( mUUID ) )
- {
- gAgentWearables.setWearableName( mUUID, new_name );
- }
- return LLItemBridge::renameItem(new_name);
-}
-
-std::string LLWearableBridge::getLabelSuffix() const
-{
- if( gAgentWearables.isWearingItem( mUUID ) )
- {
- // e.g. "(worn)"
- return LLItemBridge::getLabelSuffix() + LLTrans::getString("worn");
- }
- else
- {
- return LLItemBridge::getLabelSuffix();
- }
-}
-
-LLUIImagePtr LLWearableBridge::getIcon() const
-{
- return get_item_icon(mAssetType, mInvType, mWearableType, FALSE);
-}
-
-// virtual
-void LLWearableBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action)
-{
- if ("wear" == action)
- {
- wearOnAvatar();
- }
- else if ("wear_add" == action)
- {
- wearAddOnAvatar();
- }
- else if ("edit" == action)
- {
- editOnAvatar();
- return;
- }
- else if ("take_off" == action)
- {
- if(gAgentWearables.isWearingItem(mUUID))
- {
- LLViewerInventoryItem* item = getItem();
- if (item)
- {
- LLWearableList::instance().getAsset(item->getAssetUUID(),
- item->getName(),
- item->getType(),
- LLWearableBridge::onRemoveFromAvatarArrived,
- new OnRemoveStruct(mUUID));
- }
- }
- }
- else LLItemBridge::performAction(folder, model, action);
-}
-
-void LLWearableBridge::openItem()
-{
- LLViewerInventoryItem* item = getItem();
-
- if (item)
- {
- LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel());
- }
- /*
- if( isInTrash() )
- {
- LLNotifications::instance().add("CannotWearTrash");
- }
- else if(isAgentInventory())
- {
- if( !gAgentWearables.isWearingItem( mUUID ) )
- {
- wearOnAvatar();
- }
- }
- else
- {
- // must be in the inventory library. copy it to our inventory
- // and put it on right away.
- LLViewerInventoryItem* item = getItem();
- if(item && item->isComplete())
- {
- LLPointer<LLInventoryCallback> cb = new WearOnAvatarCallback();
- copy_inventory_item(
- gAgent.getID(),
- item->getPermissions().getOwner(),
- item->getUUID(),
- LLUUID::null,
- std::string(),
- cb);
- }
- else if(item)
- {
- // *TODO: We should fetch the item details, and then do
- // the operation above.
- LLNotifications::instance().add("CannotWearInfoNotComplete");
- }
- }
- */
-}
-
-void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
-{
- lldebugs << "LLWearableBridge::buildContextMenu()" << llendl;
- std::vector<std::string> items;
- std::vector<std::string> disabled_items;
- if(isInTrash())
- {
- items.push_back(std::string("Purge Item"));
- if (!isItemRemovable())
- {
- disabled_items.push_back(std::string("Purge Item"));
- }
-
- items.push_back(std::string("Restore Item"));
- }
- else
- { // FWIW, it looks like SUPPRESS_OPEN_ITEM is not set anywhere
- BOOL no_open = ((flags & SUPPRESS_OPEN_ITEM) == SUPPRESS_OPEN_ITEM);
-
- // If we have clothing, don't add "Open" as it's the same action as "Wear" SL-18976
- LLViewerInventoryItem* item = getItem();
- if( !no_open && item )
- {
- no_open = (item->getType() == LLAssetType::AT_CLOTHING) ||
- (item->getType() == LLAssetType::AT_BODYPART);
- }
- if (!no_open)
- {
- items.push_back(std::string("Open"));
- }
-
- items.push_back(std::string("Properties"));
-
- getClipboardEntries(true, items, disabled_items, flags);
-
- items.push_back(std::string("Wearable Separator"));
-
- items.push_back(std::string("Wearable Wear"));
- items.push_back(std::string("Wearable Add"));
- items.push_back(std::string("Wearable Edit"));
-
- if ((flags & FIRST_SELECTED_ITEM) == 0)
- {
- disabled_items.push_back(std::string("Wearable Edit"));
- }
- // Don't allow items to be worn if their baseobj is in the trash.
- if (isLinkedObjectInTrash())
- {
- disabled_items.push_back(std::string("Wearable Wear"));
- disabled_items.push_back(std::string("Wearable Add"));
- disabled_items.push_back(std::string("Wearable Edit"));
- }
-
- // Disable wear and take off based on whether the item is worn.
- if(item)
- {
- switch (item->getType())
- {
- case LLAssetType::AT_CLOTHING:
- items.push_back(std::string("Take Off"));
- case LLAssetType::AT_BODYPART:
- if (gAgentWearables.isWearingItem(item->getUUID()))
- {
- disabled_items.push_back(std::string("Wearable Wear"));
- disabled_items.push_back(std::string("Wearable Add"));
- }
- else
- {
- disabled_items.push_back(std::string("Take Off"));
- }
- break;
- default:
- break;
- }
- }
- }
- hide_context_entries(menu, items, disabled_items);
-}
-
-// Called from menus
-// static
-BOOL LLWearableBridge::canWearOnAvatar(void* user_data)
-{
- LLWearableBridge* self = (LLWearableBridge*)user_data;
- if(!self) return FALSE;
- if(!self->isAgentInventory())
- {
- LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->getItem();
- if(!item || !item->isComplete()) return FALSE;
- }
- return (!gAgentWearables.isWearingItem(self->mUUID));
-}
-
-// Called from menus
-// static
-void LLWearableBridge::onWearOnAvatar(void* user_data)
-{
- LLWearableBridge* self = (LLWearableBridge*)user_data;
- if(!self) return;
- self->wearOnAvatar();
-}
-
-void LLWearableBridge::wearOnAvatar()
-{
- // Don't wear anything until initial wearables are loaded, can
- // destroy clothing items.
- if (!gAgentWearables.areWearablesLoaded())
- {
- LLNotifications::instance().add("CanNotChangeAppearanceUntilLoaded");
- return;
- }
-
- LLViewerInventoryItem* item = getItem();
- if(item)
- {
- if(!isAgentInventory())
- {
- LLPointer<LLInventoryCallback> cb = new WearOnAvatarCallback();
- copy_inventory_item(
- gAgent.getID(),
- item->getPermissions().getOwner(),
- item->getUUID(),
- LLUUID::null,
- std::string(),
- cb);
- }
- else
- {
- wear_inventory_item_on_avatar(item);
- }
- }
-}
-
-void LLWearableBridge::wearAddOnAvatar()
-{
- // Don't wear anything until initial wearables are loaded, can
- // destroy clothing items.
- if (!gAgentWearables.areWearablesLoaded())
- {
- LLNotifications::instance().add("CanNotChangeAppearanceUntilLoaded");
- return;
- }
-
- LLViewerInventoryItem* item = getItem();
- if(item)
- {
- if(!isAgentInventory())
- {
- LLPointer<LLInventoryCallback> cb = new WearOnAvatarCallback();
- copy_inventory_item(
- gAgent.getID(),
- item->getPermissions().getOwner(),
- item->getUUID(),
- LLUUID::null,
- std::string(),
- cb);
- }
- else
- {
- wear_add_inventory_item_on_avatar(item);
- }
- }
-}
-
-// static
-void LLWearableBridge::onWearOnAvatarArrived( LLWearable* wearable, void* userdata )
-{
- LLUUID* item_id = (LLUUID*) userdata;
- if(wearable)
- {
- LLViewerInventoryItem* item = NULL;
- item = (LLViewerInventoryItem*)gInventory.getItem(*item_id);
- if(item)
- {
- if(item->getAssetUUID() == wearable->getAssetID())
- {
- gAgentWearables.setWearableItem(item, wearable);
- gInventory.notifyObservers();
- //self->getFolderItem()->refreshFromRoot();
- }
- else
- {
- llinfos << "By the time wearable asset arrived, its inv item already pointed to a different asset." << llendl;
- }
- }
- }
- delete item_id;
-}
-
-// static
-// BAP remove the "add" code path once everything is fully COF-ified.
-void LLWearableBridge::onWearAddOnAvatarArrived( LLWearable* wearable, void* userdata )
-{
- LLUUID* item_id = (LLUUID*) userdata;
- if(wearable)
- {
- LLViewerInventoryItem* item = NULL;
- item = (LLViewerInventoryItem*)gInventory.getItem(*item_id);
- if(item)
- {
- if(item->getAssetUUID() == wearable->getAssetID())
- {
- bool do_append = true;
- gAgentWearables.setWearableItem(item, wearable, do_append);
- gInventory.notifyObservers();
- //self->getFolderItem()->refreshFromRoot();
- }
- else
- {
- llinfos << "By the time wearable asset arrived, its inv item already pointed to a different asset." << llendl;
- }
- }
- }
- delete item_id;
-}
-
-// static
-BOOL LLWearableBridge::canEditOnAvatar(void* user_data)
-{
- LLWearableBridge* self = (LLWearableBridge*)user_data;
- if(!self) return FALSE;
-
- return (gAgentWearables.isWearingItem(self->mUUID));
-}
-
-// static
-void LLWearableBridge::onEditOnAvatar(void* user_data)
-{
- LLWearableBridge* self = (LLWearableBridge*)user_data;
- if(self)
- {
- self->editOnAvatar();
- }
-}
-
-void LLWearableBridge::editOnAvatar()
-{
- const LLWearable* wearable = gAgentWearables.getWearableFromItemID(mUUID);
- if( wearable )
- {
- // Set the tab to the right wearable.
- if (gFloaterCustomize)
- gFloaterCustomize->setCurrentWearableType( wearable->getType() );
-
- if( CAMERA_MODE_CUSTOMIZE_AVATAR != gAgent.getCameraMode() )
- {
- // Start Avatar Customization
- gAgent.changeCameraToCustomizeAvatar();
- }
- }
-}
-
-// static
-BOOL LLWearableBridge::canRemoveFromAvatar(void* user_data)
-{
- LLWearableBridge* self = (LLWearableBridge*)user_data;
- if( self && (LLAssetType::AT_BODYPART != self->mAssetType) )
- {
- return gAgentWearables.isWearingItem( self->mUUID );
- }
- return FALSE;
-}
-
-// static
-void LLWearableBridge::onRemoveFromAvatar(void* user_data)
-{
- LLWearableBridge* self = (LLWearableBridge*)user_data;
- if(!self) return;
- if(gAgentWearables.isWearingItem(self->mUUID))
- {
- LLViewerInventoryItem* item = self->getItem();
- if (item)
- {
- LLUUID parent_id = item->getParentUUID();
- LLWearableList::instance().getAsset(item->getAssetUUID(),
- item->getName(),
- item->getType(),
- onRemoveFromAvatarArrived,
- new OnRemoveStruct(LLUUID(self->mUUID)));
- }
- }
-}
-
-// static
-void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable,
- void* userdata)
-{
- OnRemoveStruct *on_remove_struct = (OnRemoveStruct*) userdata;
- const LLUUID &item_id = gInventory.getLinkedItemID(on_remove_struct->mUUID);
- if(wearable)
- {
- if( gAgentWearables.isWearingItem( item_id ) )
- {
- EWearableType type = wearable->getType();
-
- if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR || type==WT_EYES ) ) //&&
- //!((!gAgent.isTeen()) && ( type==WT_UNDERPANTS || type==WT_UNDERSHIRT )) )
- {
- // MULTI_WEARABLE: FIXME HACK - always remove all
- bool do_remove_all = false;
- gAgentWearables.removeWearable( type, do_remove_all, 0 );
- }
- }
- }
-
- // Find and remove this item from the COF.
- LLInventoryModel::item_array_t items = gInventory.collectLinkedItems(item_id, LLAppearanceManager::instance().getCOF());
- llassert(items.size() == 1); // Should always have one and only one item linked to this in the COF.
- for (LLInventoryModel::item_array_t::const_iterator iter = items.begin();
- iter != items.end();
- ++iter)
- {
- const LLViewerInventoryItem *linked_item = (*iter);
- const LLUUID &item_id = linked_item->getUUID();
- gInventory.purgeObject(item_id);
- }
- gInventory.notifyObservers();
-
- delete on_remove_struct;
-}
-
-
-// +=================================================+
-// | LLMeshBridge |
-// +=================================================+
-
-LLUIImagePtr LLMeshBridge::getIcon() const
-{
- return get_item_icon(LLAssetType::AT_MESH, LLInventoryType::IT_MESH, 0, FALSE);
-}
-
-void LLMeshBridge::openItem()
-{
- LLViewerInventoryItem* item = getItem();
-
- if (item)
- {
- // open mesh
- }
-}
-
-void LLMeshBridge::previewItem()
-{
- LLViewerInventoryItem* item = getItem();
- if(item)
- {
- // preview mesh
- }
-}
-
-
-void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
-{
- lldebugs << "LLMeshBridge::buildContextMenu()" << llendl;
- std::vector<std::string> items;
- std::vector<std::string> disabled_items;
-
- if(isInTrash())
- {
- items.push_back(std::string("Purge Item"));
- if (!isItemRemovable())
- {
- disabled_items.push_back(std::string("Purge Item"));
- }
-
- items.push_back(std::string("Restore Item"));
- }
- else
- {
- items.push_back(std::string("Properties"));
-
- getClipboardEntries(true, items, disabled_items, flags);
- }
-
-
- hide_context_entries(menu, items, disabled_items);
-}
-
-
-
-LLInvFVBridgeAction* LLInvFVBridgeAction::createAction(LLAssetType::EType asset_type,
- const LLUUID& uuid,LLInventoryModel* model)
-{
- LLInvFVBridgeAction* action = NULL;
- switch(asset_type)
- {
- case LLAssetType::AT_TEXTURE:
- action = new LLTextureBridgeAction(uuid,model);
- break;
-
- case LLAssetType::AT_SOUND:
- action = new LLSoundBridgeAction(uuid,model);
- break;
-
- case LLAssetType::AT_LANDMARK:
- action = new LLLandmarkBridgeAction(uuid,model);
- break;
-
- case LLAssetType::AT_CALLINGCARD:
- action = new LLCallingCardBridgeAction(uuid,model);
- break;
-
- case LLAssetType::AT_OBJECT:
- action = new LLObjectBridgeAction(uuid,model);
- break;
-
- case LLAssetType::AT_NOTECARD:
- action = new LLNotecardBridgeAction(uuid,model);
- break;
-
- case LLAssetType::AT_ANIMATION:
- action = new LLAnimationBridgeAction(uuid,model);
- break;
-
- case LLAssetType::AT_GESTURE:
- action = new LLGestureBridgeAction(uuid,model);
- break;
-
- case LLAssetType::AT_LSL_TEXT:
- action = new LLLSLTextBridgeAction(uuid,model);
- break;
-
- case LLAssetType::AT_CLOTHING:
- case LLAssetType::AT_BODYPART:
- action = new LLWearableBridgeAction(uuid,model);
-
- break;
-
- case LLAssetType::AT_MESH:
- action = new LLMeshBridgeAction(uuid,model);
- break;
-
-
-
- default:
- break;
- }
- return action;
-}
-
-//static
-void LLInvFVBridgeAction::doAction(LLAssetType::EType asset_type,
- const LLUUID& uuid,LLInventoryModel* model)
-{
- LLInvFVBridgeAction* action = createAction(asset_type,uuid,model);
- if(action)
- {
- action->doIt();
- delete action;
- }
-}
-
-//static
-void LLInvFVBridgeAction::doAction(const LLUUID& uuid, LLInventoryModel* model)
-{
- LLAssetType::EType asset_type = model->getItem(uuid)->getType();
- LLInvFVBridgeAction* action = createAction(asset_type,uuid,model);
- if(action)
- {
- action->doIt();
- delete action;
- }
-}
-
-LLViewerInventoryItem* LLInvFVBridgeAction::getItem() const
-{
- if(mModel)
- return (LLViewerInventoryItem*)mModel->getItem(mUUID);
- return NULL;
-}
-
-//virtual
-void LLTextureBridgeAction::doIt()
-{
- if (getItem())
- {
- LLFloaterReg::showInstance("preview_texture", LLSD(mUUID), TAKE_FOCUS_YES);
- }
-
- LLInvFVBridgeAction::doIt();
-}
-
-//virtual
-void LLSoundBridgeAction::doIt()
-{
- LLViewerInventoryItem* item = getItem();
- if(item)
- {
- LLFloaterReg::showInstance("preview_sound", LLSD(mUUID), TAKE_FOCUS_YES);
- }
-
- LLInvFVBridgeAction::doIt();
-}
-
-
-//virtual
-void LLLandmarkBridgeAction::doIt()
-{
- LLViewerInventoryItem* item = getItem();
- if( item )
- {
- // Opening (double-clicking) a landmark immediately teleports,
- // but warns you the first time.
- LLSD payload;
- payload["asset_id"] = item->getAssetUUID();
- LLNotifications::instance().add("TeleportFromLandmark", LLSD(), payload);
- }
-
- LLInvFVBridgeAction::doIt();
-}
-
-
-//virtual
-void LLCallingCardBridgeAction::doIt()
-{
- LLViewerInventoryItem* item = getItem();
- if(item && item->getCreatorUUID().notNull())
- {
- LLAvatarActions::showProfile(item->getCreatorUUID());
- }
-
- LLInvFVBridgeAction::doIt();
-}
-
-//virtual
-void
-LLNotecardBridgeAction::doIt()
-{
- LLViewerInventoryItem* item = getItem();
- if (item)
- {
- LLFloaterReg::showInstance("preview_notecard", LLSD(item->getUUID()), TAKE_FOCUS_YES);
- }
-
- LLInvFVBridgeAction::doIt();
-}
-
-//virtual
-void LLGestureBridgeAction::doIt()
-{
- LLViewerInventoryItem* item = getItem();
- if (item)
- {
- LLPreviewGesture* preview = LLPreviewGesture::show(mUUID, LLUUID::null);
- preview->setFocus(TRUE);
- }
-
- LLInvFVBridgeAction::doIt();
-}
-
-//virtual
-void LLAnimationBridgeAction::doIt()
-{
- LLViewerInventoryItem* item = getItem();
- if (item)
- {
- LLFloaterReg::showInstance("preview_anim", LLSD(mUUID), TAKE_FOCUS_YES);
- }
-
- LLInvFVBridgeAction::doIt();
-}
-
-
-//virtual
-void LLObjectBridgeAction::doIt()
-{
- LLFloaterReg::showInstance("properties", mUUID);
-
- LLInvFVBridgeAction::doIt();
-}
-
-
-//virtual
-void LLLSLTextBridgeAction::doIt()
-{
- LLViewerInventoryItem* item = getItem();
- if (item)
- {
- LLFloaterReg::showInstance("preview_script", LLSD(mUUID), TAKE_FOCUS_YES);
- }
-
- LLInvFVBridgeAction::doIt();
-}
-
-
-BOOL LLWearableBridgeAction::isInTrash() const
-{
- if(!mModel) return FALSE;
- const LLUUID trash_id = mModel->findCategoryUUIDForType(LLFolderType::FT_TRASH);
- return mModel->isObjectDescendentOf(mUUID, trash_id);
-}
-
-BOOL LLWearableBridgeAction::isAgentInventory() const
-{
- if(!mModel) return FALSE;
- if(gInventory.getRootFolderID() == mUUID) return TRUE;
- return mModel->isObjectDescendentOf(mUUID, gInventory.getRootFolderID());
-}
-
-void LLWearableBridgeAction::wearOnAvatar()
-{
- // Don't wear anything until initial wearables are loaded, can
- // destroy clothing items.
- if (!gAgentWearables.areWearablesLoaded())
- {
- LLNotifications::instance().add("CanNotChangeAppearanceUntilLoaded");
- return;
- }
-
- LLViewerInventoryItem* item = getItem();
- if(item)
- {
- if(!isAgentInventory())
- {
- LLPointer<LLInventoryCallback> cb = new WearOnAvatarCallback();
- copy_inventory_item(
- gAgent.getID(),
- item->getPermissions().getOwner(),
- item->getUUID(),
- LLUUID::null,
- std::string(),
- cb);
- }
- else
- {
- wear_inventory_item_on_avatar(item);
- }
- }
-}
-
-//virtual
-void LLWearableBridgeAction::doIt()
-{
- if(isInTrash())
- {
- LLNotifications::instance().add("CannotWearTrash");
- }
- else if(isAgentInventory())
- {
- if(!gAgentWearables.isWearingItem(mUUID))
- {
- wearOnAvatar();
- }
- }
- else
- {
- // must be in the inventory library. copy it to our inventory
- // and put it on right away.
- LLViewerInventoryItem* item = getItem();
- if(item && item->isComplete())
- {
- LLPointer<LLInventoryCallback> cb = new WearOnAvatarCallback();
- copy_inventory_item(
- gAgent.getID(),
- item->getPermissions().getOwner(),
- item->getUUID(),
- LLUUID::null,
- std::string(),
- cb);
- }
- else if(item)
- {
- // *TODO: We should fetch the item details, and then do
- // the operation above.
- LLNotifications::instance().add("CannotWearInfoNotComplete");
- }
- }
-
- LLInvFVBridgeAction::doIt();
-}
-
-//virtual
-void LLMeshBridgeAction::doIt()
-{
- LLViewerInventoryItem* item = getItem();
- if(item)
- {
- // do it
- }
-
- LLInvFVBridgeAction::doIt();
-}
-
-// +=================================================+
-// | LLLinkItemBridge |
-// +=================================================+
-// For broken links
-
-std::string LLLinkItemBridge::sPrefix("Link: ");
-
-
-LLUIImagePtr LLLinkItemBridge::getIcon() const
-{
- if (LLViewerInventoryItem *item = getItem())
- {
- return get_item_icon(item->getActualType(), LLInventoryType::IT_NONE, 0, FALSE);
- }
- return get_item_icon(LLAssetType::AT_LINK, LLInventoryType::IT_NONE, 0, FALSE);
-}
-
-void LLLinkItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
-{
- // *TODO: Translate
- lldebugs << "LLLink::buildContextMenu()" << llendl;
- std::vector<std::string> items;
- std::vector<std::string> disabled_items;
-
- if(isInTrash())
- {
- items.push_back(std::string("Purge Item"));
- if (!isItemRemovable())
- {
- disabled_items.push_back(std::string("Purge Item"));
- }
-
- items.push_back(std::string("Restore Item"));
- }
- else
- {
- items.push_back(std::string("Delete"));
- if (!isItemRemovable())
- {
- disabled_items.push_back(std::string("Delete"));
- }
- }
- hide_context_entries(menu, items, disabled_items);
-}
-
-
-// +=================================================+
-// | LLLinkBridge |
-// +=================================================+
-// For broken links.
-
-std::string LLLinkFolderBridge::sPrefix("Link: ");
-
-
-LLUIImagePtr LLLinkFolderBridge::getIcon() const
-{
- LLFolderType::EType preferred_type = LLFolderType::FT_NONE;
- if (LLViewerInventoryItem *item = getItem())
- {
- if (const LLViewerInventoryCategory* cat = item->getLinkedCategory())
- {
- preferred_type = cat->getPreferredType();
- }
- }
- return LLFolderBridge::getIcon(preferred_type);
-}
-
-void LLLinkFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
-{
- // *TODO: Translate
- lldebugs << "LLLink::buildContextMenu()" << llendl;
- std::vector<std::string> items;
- std::vector<std::string> disabled_items;
-
- if(isInTrash())
- {
- items.push_back(std::string("Purge Item"));
- if (!isItemRemovable())
- {
- disabled_items.push_back(std::string("Purge Item"));
- }
-
- items.push_back(std::string("Restore Item"));
- }
- else
- {
- items.push_back(std::string("Find Original"));
- items.push_back(std::string("Delete"));
- if (!isItemRemovable())
- {
- disabled_items.push_back(std::string("Delete"));
- }
- }
- hide_context_entries(menu, items, disabled_items);
-}
-
-void LLLinkFolderBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action)
-{
- if ("goto" == action)
- {
- gotoItem(folder);
- return;
- }
- LLItemBridge::performAction(folder,model,action);
-}
-
-void LLLinkFolderBridge::gotoItem(LLFolderView *folder)
-{
- const LLUUID &cat_uuid = getFolderID();
- if (!cat_uuid.isNull())
- {
- if (LLFolderViewItem *base_folder = folder->getItemByID(cat_uuid))
- {
- if (LLInventoryModel* model = getInventoryModel())
- {
- model->fetchDescendentsOf(cat_uuid);
- }
- base_folder->setOpen(TRUE);
- folder->setSelectionFromRoot(base_folder,TRUE);
- folder->scrollToShowSelection();
- }
- }
-}
-
-const LLUUID &LLLinkFolderBridge::getFolderID() const
-{
- if (LLViewerInventoryItem *link_item = getItem())
- {
- if (const LLViewerInventoryCategory *cat = link_item->getLinkedCategory())
- {
- const LLUUID& cat_uuid = cat->getUUID();
- return cat_uuid;
- }
- }
- return LLUUID::null;
-}
+/** + * @file llinventorybridge.cpp + * @brief Implementation of the Inventory-Folder-View-Bridge classes. + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llinventorybridge.h" + +#include "llagent.h" +#include "llagentwearables.h" +#include "llappearancemgr.h" +#include "llavataractions.h" +#include "llfloatercustomize.h" +#include "llfloateropenobject.h" +#include "llfloaterreg.h" +#include "llfloaterworldmap.h" +#include "llfriendcard.h" +#include "llgesturemgr.h" +#include "llimfloater.h" +#include "llimview.h" +#include "llinventoryclipboard.h" +#include "llinventoryfunctions.h" +#include "llinventorymodel.h" +#include "llinventorypanel.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" +#include "llpreviewanim.h" +#include "llpreviewgesture.h" +#include "llpreviewtexture.h" +#include "llselectmgr.h" +#include "llsidetray.h" +#include "lltrans.h" +#include "llviewerassettype.h" +#include "llviewermessage.h" +#include "llviewerobjectlist.h" +#include "llviewerwindow.h" +#include "llvoavatarself.h" +#include "llwearablelist.h" +#include "llpaneloutfitsinventory.h" + +using namespace LLOldEvents; + +// Helpers +// bug in busy count inc/dec right now, logic is complex... do we really need it? +void inc_busy_count() +{ +// gViewerWindow->getWindow()->incBusyCount(); +// check balance of these calls if this code is changed to ever actually +// *do* something! +} +void dec_busy_count() +{ +// gViewerWindow->getWindow()->decBusyCount(); +// check balance of these calls if this code is changed to ever actually +// *do* something! +} + +// Function declarations +void wear_add_inventory_item_on_avatar(LLInventoryItem* item); +void remove_inventory_category_from_avatar(LLInventoryCategory* category); +void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_id); +bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, LLMoveInv*); +bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& response); + +std::string ICON_NAME[ICON_NAME_COUNT] = +{ + "Inv_Texture", + "Inv_Sound", + "Inv_CallingCard", + "Inv_CallingCard", + "Inv_Landmark", + "Inv_Landmark", + "Inv_Script", + "Inv_Clothing", + "Inv_Object", + "Inv_Object", + "Inv_Notecard", + "Inv_Skin", + "Inv_Snapshot", + + "Inv_BodyShape", + "Inv_Skin", + "Inv_Hair", + "Inv_Eye", + "Inv_Shirt", + "Inv_Pants", + "Inv_Shoe", + "Inv_Socks", + "Inv_Jacket", + "Inv_Gloves", + "Inv_Undershirt", + "Inv_Underpants", + "Inv_Skirt", + "Inv_Alpha", + "Inv_Tattoo", + + "Inv_Animation", + "Inv_Gesture", + + "Inv_LinkItem", + "Inv_LinkFolder" + + "inv_item_mesh.tga" +}; + +// +=================================================+ +// | LLInvFVBridge | +// +=================================================+ + +LLInvFVBridge::LLInvFVBridge(LLInventoryPanel* inventory, const LLUUID& uuid) : +mUUID(uuid), mInvType(LLInventoryType::IT_NONE) +{ + mInventoryPanel = inventory->getHandle(); +} + +const std::string& LLInvFVBridge::getName() const +{ + LLInventoryObject* obj = getInventoryObject(); + if(obj) + { + return obj->getName(); + } + return LLStringUtil::null; +} + +const std::string& LLInvFVBridge::getDisplayName() const +{ + return getName(); +} + +// Folders have full perms +PermissionMask LLInvFVBridge::getPermissionMask() const +{ + + return PERM_ALL; +} + +// virtual +LLFolderType::EType LLInvFVBridge::getPreferredType() const +{ + return LLFolderType::FT_NONE; +} + + +// Folders don't have creation dates. +time_t LLInvFVBridge::getCreationDate() const +{ + return 0; +} + +// Can be destroyed (or moved to trash) +BOOL LLInvFVBridge::isItemRemovable() +{ + const LLInventoryModel* model = getInventoryModel(); + if(!model) + { + return FALSE; + } + if(!model->isObjectDescendentOf(mUUID, gInventory.getRootFolderID())) + { + return FALSE; + } + const LLInventoryObject *obj = model->getItem(mUUID); + if (obj && obj->getIsLinkType()) + { + return TRUE; + } + if (gAgentWearables.isWearingItem(mUUID)) + { + return FALSE; + } + const LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); + if (avatar && avatar->isWearingAttachment(mUUID)) + { + return FALSE; + } + return TRUE; +} + +// Can be moved to another folder +BOOL LLInvFVBridge::isItemMovable() const +{ + return TRUE; +} + +/*virtual*/ +/** + * @brief Adds this item into clipboard storage + */ +void LLInvFVBridge::cutToClipboard() +{ + if(isItemMovable()) + { + LLInventoryClipboard::instance().cut(mUUID); + } +} +// *TODO: make sure this does the right thing +void LLInvFVBridge::showProperties() +{ + LLSD key; + key["id"] = mUUID; + LLSideTray::getInstance()->showPanel("sidepanel_inventory", key); + + // Disable old properties floater; this is replaced by the sidepanel. + /* + LLFloaterReg::showInstance("properties", mUUID); + */ +} + +void LLInvFVBridge::removeBatch(LLDynamicArray<LLFolderViewEventListener*>& batch) +{ + // Deactivate gestures when moving them into Trash + LLInvFVBridge* bridge; + LLInventoryModel* model = getInventoryModel(); + LLViewerInventoryItem* item = NULL; + LLViewerInventoryCategory* cat = NULL; + LLInventoryModel::cat_array_t descendent_categories; + LLInventoryModel::item_array_t descendent_items; + S32 count = batch.count(); + S32 i,j; + for(i = 0; i < count; ++i) + { + bridge = (LLInvFVBridge*)(batch.get(i)); + if(!bridge || !bridge->isItemRemovable()) continue; + item = (LLViewerInventoryItem*)model->getItem(bridge->getUUID()); + if (item) + { + if(LLAssetType::AT_GESTURE == item->getType()) + { + LLGestureManager::instance().deactivateGesture(item->getUUID()); + } + } + } + for(i = 0; i < count; ++i) + { + bridge = (LLInvFVBridge*)(batch.get(i)); + if(!bridge || !bridge->isItemRemovable()) continue; + cat = (LLViewerInventoryCategory*)model->getCategory(bridge->getUUID()); + if (cat) + { + gInventory.collectDescendents( cat->getUUID(), descendent_categories, descendent_items, FALSE ); + for (j=0; j<descendent_items.count(); j++) + { + if(LLAssetType::AT_GESTURE == descendent_items[j]->getType()) + { + LLGestureManager::instance().deactivateGesture(descendent_items[j]->getUUID()); + } + } + } + } + removeBatchNoCheck(batch); +} + +void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener*>& batch) +{ + // this method moves a bunch of items and folders to the trash. As + // per design guidelines for the inventory model, the message is + // built and the accounting is performed first. After all of that, + // we call LLInventoryModel::moveObject() to move everything + // around. + LLInvFVBridge* bridge; + LLInventoryModel* model = getInventoryModel(); + if(!model) return; + LLMessageSystem* msg = gMessageSystem; + const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); + LLViewerInventoryItem* item = NULL; + LLViewerInventoryCategory* cat = NULL; + std::vector<LLUUID> move_ids; + LLInventoryModel::update_map_t update; + bool start_new_message = true; + S32 count = batch.count(); + S32 i; + for(i = 0; i < count; ++i) + { + bridge = (LLInvFVBridge*)(batch.get(i)); + if(!bridge || !bridge->isItemRemovable()) continue; + item = (LLViewerInventoryItem*)model->getItem(bridge->getUUID()); + if(item) + { + if(item->getParentUUID() == trash_id) continue; + move_ids.push_back(item->getUUID()); + LLPreview::hide(item->getUUID()); + --update[item->getParentUUID()]; + ++update[trash_id]; + if(start_new_message) + { + start_new_message = false; + msg->newMessageFast(_PREHASH_MoveInventoryItem); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->addBOOLFast(_PREHASH_Stamp, TRUE); + } + msg->nextBlockFast(_PREHASH_InventoryData); + msg->addUUIDFast(_PREHASH_ItemID, item->getUUID()); + msg->addUUIDFast(_PREHASH_FolderID, trash_id); + msg->addString("NewName", NULL); + if(msg->isSendFullFast(_PREHASH_InventoryData)) + { + start_new_message = true; + gAgent.sendReliableMessage(); + gInventory.accountForUpdate(update); + update.clear(); + } + } + } + if(!start_new_message) + { + start_new_message = true; + gAgent.sendReliableMessage(); + gInventory.accountForUpdate(update); + update.clear(); + } + for(i = 0; i < count; ++i) + { + bridge = (LLInvFVBridge*)(batch.get(i)); + if(!bridge || !bridge->isItemRemovable()) continue; + cat = (LLViewerInventoryCategory*)model->getCategory(bridge->getUUID()); + if(cat) + { + if(cat->getParentUUID() == trash_id) continue; + move_ids.push_back(cat->getUUID()); + --update[cat->getParentUUID()]; + ++update[trash_id]; + if(start_new_message) + { + start_new_message = false; + msg->newMessageFast(_PREHASH_MoveInventoryFolder); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->addBOOL("Stamp", TRUE); + } + msg->nextBlockFast(_PREHASH_InventoryData); + msg->addUUIDFast(_PREHASH_FolderID, cat->getUUID()); + msg->addUUIDFast(_PREHASH_ParentID, trash_id); + if(msg->isSendFullFast(_PREHASH_InventoryData)) + { + start_new_message = true; + gAgent.sendReliableMessage(); + gInventory.accountForUpdate(update); + update.clear(); + } + } + } + if(!start_new_message) + { + gAgent.sendReliableMessage(); + gInventory.accountForUpdate(update); + } + + // move everything. + std::vector<LLUUID>::iterator it = move_ids.begin(); + std::vector<LLUUID>::iterator end = move_ids.end(); + for(; it != end; ++it) + { + gInventory.moveObject((*it), trash_id); + } + + // notify inventory observers. + model->notifyObservers(); +} + +BOOL LLInvFVBridge::isClipboardPasteable() const +{ + if (!LLInventoryClipboard::instance().hasContents() || !isAgentInventory()) + { + return FALSE; + } + LLInventoryModel* model = getInventoryModel(); + if (!model) + { + return FALSE; + } + + const LLUUID &agent_id = gAgent.getID(); + + LLDynamicArray<LLUUID> objects; + LLInventoryClipboard::instance().retrieve(objects); + S32 count = objects.count(); + for(S32 i = 0; i < count; i++) + { + const LLUUID &item_id = objects.get(i); + + // Can't paste folders + const LLInventoryCategory *cat = model->getCategory(item_id); + if (cat) + { + return FALSE; + } + + const LLInventoryItem *item = model->getItem(item_id); + if (item) + { + if (!item->getPermissions().allowCopyBy(agent_id)) + { + return FALSE; + } + } + } + return TRUE; +} + +BOOL LLInvFVBridge::isClipboardPasteableAsLink() const +{ + if (!LLInventoryClipboard::instance().hasContents() || !isAgentInventory()) + { + return FALSE; + } + const LLInventoryModel* model = getInventoryModel(); + if (!model) + { + return FALSE; + } + + LLDynamicArray<LLUUID> objects; + LLInventoryClipboard::instance().retrieve(objects); + S32 count = objects.count(); + for(S32 i = 0; i < count; i++) + { + const LLInventoryItem *item = model->getItem(objects.get(i)); + if (item) + { + if (!LLAssetType::lookupCanLink(item->getActualType())) + { + return FALSE; + } + } + const LLViewerInventoryCategory *cat = model->getCategory(objects.get(i)); + if (cat && !LLFolderType::lookupIsProtectedType(cat->getPreferredType())) + { + return FALSE; + } + } + return TRUE; +} + +void hide_context_entries(LLMenuGL& menu, + const std::vector<std::string> &entries_to_show, + const std::vector<std::string> &disabled_entries) +{ + const LLView::child_list_t *list = menu.getChildList(); + + LLView::child_list_t::const_iterator itor; + for (itor = list->begin(); itor != list->end(); ++itor) + { + std::string name = (*itor)->getName(); + + // descend into split menus: + LLMenuItemBranchGL* branchp = dynamic_cast<LLMenuItemBranchGL*>(*itor); + if ((name == "More") && branchp) + { + hide_context_entries(*branchp->getBranch(), entries_to_show, disabled_entries); + } + + + bool found = false; + std::vector<std::string>::const_iterator itor2; + for (itor2 = entries_to_show.begin(); itor2 != entries_to_show.end(); ++itor2) + { + if (*itor2 == name) + { + found = true; + } + } + if (!found) + { + (*itor)->setVisible(FALSE); + } + else + { + (*itor)->setVisible(TRUE); + for (itor2 = disabled_entries.begin(); itor2 != disabled_entries.end(); ++itor2) + { + if (*itor2 == name) + { + (*itor)->setEnabled(FALSE); + } + } + } + } +} + +// Helper for commonly-used entries +void LLInvFVBridge::getClipboardEntries(bool show_asset_id, + std::vector<std::string> &items, + std::vector<std::string> &disabled_items, U32 flags) +{ + const LLInventoryObject *obj = getInventoryObject(); + if (obj) + { + if (obj->getIsLinkType()) + { + items.push_back(std::string("Find Original")); + if (isLinkedObjectMissing()) + { + disabled_items.push_back(std::string("Find Original")); + } + } + else + { + if (LLAssetType::lookupCanLink(obj->getType())) + { + items.push_back(std::string("Find Links")); + } + items.push_back(std::string("Rename")); + if (!isItemRenameable() || (flags & FIRST_SELECTED_ITEM) == 0) + { + disabled_items.push_back(std::string("Rename")); + } + + if (show_asset_id) + { + items.push_back(std::string("Copy Asset UUID")); + if ( (! ( isItemPermissive() || gAgent.isGodlike() ) ) + || (flags & FIRST_SELECTED_ITEM) == 0) + { + disabled_items.push_back(std::string("Copy Asset UUID")); + } + } + items.push_back(std::string("Copy Separator")); + + items.push_back(std::string("Copy")); + if (!isItemCopyable()) + { + disabled_items.push_back(std::string("Copy")); + } + } + } + + items.push_back(std::string("Paste")); + if (!isClipboardPasteable() || (flags & FIRST_SELECTED_ITEM) == 0) + { + disabled_items.push_back(std::string("Paste")); + } + + items.push_back(std::string("Paste As Link")); + if (!isClipboardPasteableAsLink() || (flags & FIRST_SELECTED_ITEM) == 0) + { + disabled_items.push_back(std::string("Paste As Link")); + } + items.push_back(std::string("Paste Separator")); + + items.push_back(std::string("Delete")); + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Delete")); + } + + // If multiple items are selected, disable properties (if it exists). + if ((flags & FIRST_SELECTED_ITEM) == 0) + { + disabled_items.push_back(std::string("Properties")); + } +} + +void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + lldebugs << "LLInvFVBridge::buildContextMenu()" << llendl; + std::vector<std::string> items; + std::vector<std::string> disabled_items; + if(isInTrash()) + { + items.push_back(std::string("PurgeItem")); + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("PurgeItem")); + } + items.push_back(std::string("RestoreItem")); + } + else + { + items.push_back(std::string("Open")); + items.push_back(std::string("Properties")); + + getClipboardEntries(true, items, disabled_items, flags); + } + hide_context_entries(menu, items, disabled_items); +} + +// *TODO: remove this +BOOL LLInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const +{ + BOOL rv = FALSE; + + const LLInventoryObject* obj = getInventoryObject(); + + if(obj) + { + *type = LLViewerAssetType::lookupDragAndDropType(obj->getActualType()); + if(*type == DAD_NONE) + { + return FALSE; + } + + *id = obj->getUUID(); + //object_ids.put(obj->getUUID()); + + if (*type == DAD_CATEGORY) + { + gInventory.startBackgroundFetch(obj->getUUID()); + } + + rv = TRUE; + } + + return rv; +} + +LLInventoryObject* LLInvFVBridge::getInventoryObject() const +{ + LLInventoryObject* obj = NULL; + LLInventoryModel* model = getInventoryModel(); + if(model) + { + obj = (LLInventoryObject*)model->getObject(mUUID); + } + return obj; +} + +LLInventoryModel* LLInvFVBridge::getInventoryModel() const +{ + LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get()); + return panel ? panel->getModel() : NULL; +} + +BOOL LLInvFVBridge::isInTrash() const +{ + LLInventoryModel* model = getInventoryModel(); + if(!model) return FALSE; + const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); + return model->isObjectDescendentOf(mUUID, trash_id); +} + +BOOL LLInvFVBridge::isLinkedObjectInTrash() const +{ + if (isInTrash()) return TRUE; + + const LLInventoryObject *obj = getInventoryObject(); + if (obj && obj->getIsLinkType()) + { + LLInventoryModel* model = getInventoryModel(); + if(!model) return FALSE; + const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); + return model->isObjectDescendentOf(obj->getLinkedUUID(), trash_id); + } + return FALSE; +} + +BOOL LLInvFVBridge::isLinkedObjectMissing() const +{ + const LLInventoryObject *obj = getInventoryObject(); + if (!obj) + { + return TRUE; + } + if (obj->getIsLinkType() && LLAssetType::lookupIsLinkType(obj->getType())) + { + return TRUE; + } + return FALSE; +} + +BOOL LLInvFVBridge::isAgentInventory() const +{ + const LLInventoryModel* model = getInventoryModel(); + if(!model) return FALSE; + if(gInventory.getRootFolderID() == mUUID) return TRUE; + return model->isObjectDescendentOf(mUUID, gInventory.getRootFolderID()); +} + +BOOL LLInvFVBridge::isCOFFolder() const +{ + const LLInventoryModel* model = getInventoryModel(); + if(!model) return TRUE; + const LLUUID cof_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); + if (mUUID == cof_id || model->isObjectDescendentOf(mUUID, cof_id)) + { + return TRUE; + } + return FALSE; +} + +BOOL LLInvFVBridge::isItemPermissive() const +{ + return FALSE; +} + +// static +void LLInvFVBridge::changeItemParent(LLInventoryModel* model, + LLViewerInventoryItem* item, + const LLUUID& new_parent, + BOOL restamp) +{ + if(item->getParentUUID() != new_parent) + { + LLInventoryModel::update_list_t update; + LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(),-1); + update.push_back(old_folder); + LLInventoryModel::LLCategoryUpdate new_folder(new_parent, 1); + update.push_back(new_folder); + gInventory.accountForUpdate(update); + + LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); + new_item->setParent(new_parent); + new_item->updateParentOnServer(restamp); + model->updateItem(new_item); + model->notifyObservers(); + } +} + +// static +void LLInvFVBridge::changeCategoryParent(LLInventoryModel* model, + LLViewerInventoryCategory* cat, + const LLUUID& new_parent, + BOOL restamp) +{ + if(cat->getParentUUID() != new_parent) + { + LLInventoryModel::update_list_t update; + LLInventoryModel::LLCategoryUpdate old_folder(cat->getParentUUID(), -1); + update.push_back(old_folder); + LLInventoryModel::LLCategoryUpdate new_folder(new_parent, 1); + update.push_back(new_folder); + gInventory.accountForUpdate(update); + + LLPointer<LLViewerInventoryCategory> new_cat = new LLViewerInventoryCategory(cat); + new_cat->setParent(new_parent); + new_cat->updateParentOnServer(restamp); + model->updateCategory(new_cat); + model->notifyObservers(); + } +} + + +const std::string safe_inv_type_lookup(LLInventoryType::EType inv_type) +{ + const std::string rv= LLInventoryType::lookup(inv_type); + if(rv.empty()) + { + return std::string("<invalid>"); + } + return rv; +} + +LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, + LLAssetType::EType actual_asset_type, + LLInventoryType::EType inv_type, + LLInventoryPanel* inventory, + const LLUUID& uuid, + U32 flags) +{ + LLInvFVBridge* new_listener = NULL; + switch(asset_type) + { + case LLAssetType::AT_TEXTURE: + if(!(inv_type == LLInventoryType::IT_TEXTURE || inv_type == LLInventoryType::IT_SNAPSHOT)) + { + llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl; + } + new_listener = new LLTextureBridge(inventory, uuid, inv_type); + break; + + case LLAssetType::AT_SOUND: + if(!(inv_type == LLInventoryType::IT_SOUND)) + { + llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl; + } + new_listener = new LLSoundBridge(inventory, uuid); + break; + + case LLAssetType::AT_LANDMARK: + if(!(inv_type == LLInventoryType::IT_LANDMARK)) + { + llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl; + } + new_listener = new LLLandmarkBridge(inventory, uuid, flags); + break; + + case LLAssetType::AT_CALLINGCARD: + if(!(inv_type == LLInventoryType::IT_CALLINGCARD)) + { + llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl; + } + new_listener = new LLCallingCardBridge(inventory, uuid); + break; + + case LLAssetType::AT_SCRIPT: + if(!(inv_type == LLInventoryType::IT_LSL)) + { + llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl; + } + new_listener = new LLScriptBridge(inventory, uuid); + break; + + case LLAssetType::AT_OBJECT: + if(!(inv_type == LLInventoryType::IT_OBJECT || inv_type == LLInventoryType::IT_ATTACHMENT)) + { + llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl; + } + new_listener = new LLObjectBridge(inventory, uuid, inv_type, flags); + break; + + case LLAssetType::AT_NOTECARD: + if(!(inv_type == LLInventoryType::IT_NOTECARD)) + { + llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl; + } + new_listener = new LLNotecardBridge(inventory, uuid); + break; + + case LLAssetType::AT_ANIMATION: + if(!(inv_type == LLInventoryType::IT_ANIMATION)) + { + llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl; + } + new_listener = new LLAnimationBridge(inventory, uuid); + break; + + case LLAssetType::AT_GESTURE: + if(!(inv_type == LLInventoryType::IT_GESTURE)) + { + llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl; + } + new_listener = new LLGestureBridge(inventory, uuid); + break; + + case LLAssetType::AT_LSL_TEXT: + if(!(inv_type == LLInventoryType::IT_LSL)) + { + llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl; + } + new_listener = new LLLSLTextBridge(inventory, uuid); + break; + + case LLAssetType::AT_CLOTHING: + case LLAssetType::AT_BODYPART: + if(!(inv_type == LLInventoryType::IT_WEARABLE)) + { + llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl; + } + new_listener = new LLWearableBridge(inventory, uuid, asset_type, inv_type, (EWearableType)flags); + break; + case LLAssetType::AT_CATEGORY: + if (actual_asset_type == LLAssetType::AT_LINK_FOLDER) + { + // Create a link folder handler instead. + new_listener = new LLLinkFolderBridge(inventory, uuid); + break; + } + new_listener = new LLFolderBridge(inventory, uuid); + break; + case LLAssetType::AT_LINK: + case LLAssetType::AT_LINK_FOLDER: + // Only should happen for broken links. + new_listener = new LLLinkItemBridge(inventory, uuid); + break; + case LLAssetType::AT_MESH: + if(!(inv_type == LLInventoryType::IT_MESH)) + { + llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl; + } + new_listener = new LLMeshBridge(inventory, uuid); + break; + + default: + llinfos << "Unhandled asset type (llassetstorage.h): " + << (S32)asset_type << llendl; + break; + } + + if (new_listener) + { + new_listener->mInvType = inv_type; + } + + return new_listener; +} + +void LLInvFVBridge::purgeItem(LLInventoryModel *model, const LLUUID &uuid) +{ + LLInventoryCategory* cat = model->getCategory(uuid); + if (cat) + { + model->purgeDescendentsOf(uuid); + model->notifyObservers(); + } + LLInventoryObject* obj = model->getObject(uuid); + if (obj) + { + model->purgeObject(uuid); + model->notifyObservers(); + } +} + +// +=================================================+ +// | InventoryFVBridgeBuilder | +// +=================================================+ +LLInvFVBridge* LLInventoryFVBridgeBuilder::createBridge(LLAssetType::EType asset_type, + LLAssetType::EType actual_asset_type, + LLInventoryType::EType inv_type, + LLInventoryPanel* inventory, + const LLUUID& uuid, + U32 flags /* = 0x00 */) const +{ + return LLInvFVBridge::createBridge(asset_type, + actual_asset_type, + inv_type, + inventory, + uuid, + flags); +} + +// +=================================================+ +// | LLItemBridge | +// +=================================================+ + +void LLItemBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) +{ + if ("goto" == action) + { + gotoItem(folder); + } + + if ("open" == action) + { + openItem(); + return; + } + else if ("properties" == action) + { + showProperties(); + return; + } + else if ("purge" == action) + { + purgeItem(model, mUUID); + return; + } + else if ("restoreToWorld" == action) + { + restoreToWorld(); + return; + } + else if ("restore" == action) + { + restoreItem(); + return; + } + else if ("copy_uuid" == action) + { + // Single item only + LLInventoryItem* item = model->getItem(mUUID); + if(!item) return; + LLUUID asset_id = item->getAssetUUID(); + std::string buffer; + asset_id.toString(buffer); + + gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(buffer)); + return; + } + else if ("copy" == action) + { + copyToClipboard(); + return; + } + else if ("paste" == action) + { + // Single item only + LLInventoryItem* itemp = model->getItem(mUUID); + if (!itemp) return; + + LLFolderViewItem* folder_view_itemp = folder->getItemByID(itemp->getParentUUID()); + if (!folder_view_itemp) return; + + folder_view_itemp->getListener()->pasteFromClipboard(); + return; + } + else if ("paste_link" == action) + { + // Single item only + LLInventoryItem* itemp = model->getItem(mUUID); + if (!itemp) return; + + LLFolderViewItem* folder_view_itemp = folder->getItemByID(itemp->getParentUUID()); + if (!folder_view_itemp) return; + + folder_view_itemp->getListener()->pasteLinkFromClipboard(); + return; + } +} + +void LLItemBridge::selectItem() +{ + LLViewerInventoryItem* item = (LLViewerInventoryItem*)getItem(); + if(item && !item->isComplete()) + { + item->fetchFromServer(); + } +} + +void LLItemBridge::restoreItem() +{ + LLViewerInventoryItem* item = (LLViewerInventoryItem*)getItem(); + if(item) + { + LLInventoryModel* model = getInventoryModel(); + const LLUUID new_parent = model->findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(item->getType())); + // do not restamp on restore. + LLInvFVBridge::changeItemParent(model, item, new_parent, FALSE); + } +} + +void LLItemBridge::restoreToWorld() +{ + LLViewerInventoryItem* itemp = (LLViewerInventoryItem*)getItem(); + if (itemp) + { + LLMessageSystem* msg = gMessageSystem; + msg->newMessage("RezRestoreToWorld"); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + + msg->nextBlockFast(_PREHASH_InventoryData); + itemp->packMessage(msg); + msg->sendReliable(gAgent.getRegion()->getHost()); + } + + //Similar functionality to the drag and drop rez logic + BOOL remove_from_inventory = FALSE; + + //remove local inventory copy, sim will deal with permissions and removing the item + //from the actual inventory if its a no-copy etc + if(!itemp->getPermissions().allowCopyBy(gAgent.getID())) + { + remove_from_inventory = TRUE; + } + + // Check if it's in the trash. (again similar to the normal rez logic) + const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); + if(gInventory.isObjectDescendentOf(itemp->getUUID(), trash_id)) + { + remove_from_inventory = TRUE; + } + + if(remove_from_inventory) + { + gInventory.deleteObject(itemp->getUUID()); + gInventory.notifyObservers(); + } +} + +void LLItemBridge::gotoItem(LLFolderView *folder) +{ + LLInventoryObject *obj = getInventoryObject(); + if (obj && obj->getIsLinkType()) + { + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); + if (active_panel) + { + active_panel->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO); + } + } +} + +LLUIImagePtr LLItemBridge::getIcon() const +{ + return LLUI::getUIImage(ICON_NAME[OBJECT_ICON_NAME]); +} + +PermissionMask LLItemBridge::getPermissionMask() const +{ + LLViewerInventoryItem* item = getItem(); + PermissionMask perm_mask = 0; + if(item) + { + BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID()); + BOOL mod = item->getPermissions().allowModifyBy(gAgent.getID()); + BOOL xfer = item->getPermissions().allowOperationBy(PERM_TRANSFER, + gAgent.getID()); + + if (copy) perm_mask |= PERM_COPY; + if (mod) perm_mask |= PERM_MODIFY; + if (xfer) perm_mask |= PERM_TRANSFER; + + } + return perm_mask; +} + +const std::string& LLItemBridge::getDisplayName() const +{ + if(mDisplayName.empty()) + { + buildDisplayName(getItem(), mDisplayName); + } + return mDisplayName; +} + +void LLItemBridge::buildDisplayName(LLInventoryItem* item, std::string& name) +{ + if(item) + { + name.assign(item->getName()); + } + else + { + name.assign(LLStringUtil::null); + } +} + +LLFontGL::StyleFlags LLItemBridge::getLabelStyle() const +{ + U8 font = LLFontGL::NORMAL; + + if( gAgentWearables.isWearingItem( mUUID ) ) + { + // llinfos << "BOLD" << llendl; + font |= LLFontGL::BOLD; + } + + const LLViewerInventoryItem* item = getItem(); + if (item && item->getIsLinkType()) + { + font |= LLFontGL::ITALIC; + } + return (LLFontGL::StyleFlags)font; +} + +std::string LLItemBridge::getLabelSuffix() const +{ + // String table is loaded before login screen and inventory items are + // loaded after login, so LLTrans should be ready. + static std::string NO_COPY =LLTrans::getString("no_copy"); + static std::string NO_MOD = LLTrans::getString("no_modify"); + static std::string NO_XFER = LLTrans::getString("no_transfer"); + static std::string LINK = LLTrans::getString("link"); + static std::string BROKEN_LINK = LLTrans::getString("broken_link"); + std::string suffix; + LLInventoryItem* item = getItem(); + if(item) + { + // it's a bit confusing to put nocopy/nomod/etc on calling cards. + if(LLAssetType::AT_CALLINGCARD != item->getType() + && item->getPermissions().getOwner() == gAgent.getID()) + { + BOOL broken_link = LLAssetType::lookupIsLinkType(item->getType()); + if (broken_link) return BROKEN_LINK; + + BOOL link = item->getIsLinkType(); + if (link) return LINK; + + BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID()); + if (!copy) + { + suffix += NO_COPY; + } + BOOL mod = item->getPermissions().allowModifyBy(gAgent.getID()); + if (!mod) + { + suffix += NO_MOD; + } + BOOL xfer = item->getPermissions().allowOperationBy(PERM_TRANSFER, + gAgent.getID()); + if (!xfer) + { + suffix += NO_XFER; + } + } + } + return suffix; +} + +time_t LLItemBridge::getCreationDate() const +{ + LLViewerInventoryItem* item = getItem(); + if (item) + { + return item->getCreationDate(); + } + return 0; +} + + +BOOL LLItemBridge::isItemRenameable() const +{ + LLViewerInventoryItem* item = getItem(); + if(item) + { + // (For now) Don't allow calling card rename since that may confuse users as to + // what the calling card points to. + if (item->getInventoryType() == LLInventoryType::IT_CALLINGCARD) + { + return FALSE; + } + return (item->getPermissions().allowModifyBy(gAgent.getID())); + } + return FALSE; +} + +BOOL LLItemBridge::renameItem(const std::string& new_name) +{ + if(!isItemRenameable()) + return FALSE; + LLPreview::dirty(mUUID); + LLInventoryModel* model = getInventoryModel(); + if(!model) + return FALSE; + LLViewerInventoryItem* item = getItem(); + if(item && (item->getName() != new_name)) + { + LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); + new_item->rename(new_name); + buildDisplayName(new_item, mDisplayName); + new_item->updateServer(FALSE); + model->updateItem(new_item); + + model->notifyObservers(); + } + // return FALSE because we either notified observers (& therefore + // rebuilt) or we didn't update. + return FALSE; +} + + +BOOL LLItemBridge::removeItem() +{ + if(!isItemRemovable()) + { + return FALSE; + } + // move it to the trash + LLPreview::hide(mUUID, TRUE); + LLInventoryModel* model = getInventoryModel(); + if(!model) return FALSE; + const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); + LLViewerInventoryItem* item = getItem(); + + // if item is not already in trash + if(item && !model->isObjectDescendentOf(mUUID, trash_id)) + { + // move to trash, and restamp + LLInvFVBridge::changeItemParent(model, item, trash_id, TRUE); + // delete was successful + return TRUE; + } + else + { + // tried to delete already item in trash (should purge?) + return FALSE; + } +} + +BOOL LLItemBridge::isItemCopyable() const +{ + LLViewerInventoryItem* item = getItem(); + if (item) + { + // can't copy worn objects. DEV-15183 + LLVOAvatarSelf *avatarp = gAgent.getAvatarObject(); + if( !avatarp ) + { + return FALSE; + } + + if(avatarp->isWearingAttachment(mUUID)) + { + return FALSE; + } + + // All items can be copied, not all can be pasted. + // The only time an item can't be copied is if it's a link + // return (item->getPermissions().allowCopyBy(gAgent.getID())); + if (item->getIsLinkType()) + { + return FALSE; + } + return TRUE; + } + return FALSE; +} +BOOL LLItemBridge::copyToClipboard() const +{ + if(isItemCopyable()) + { + LLInventoryClipboard::instance().add(mUUID); + return TRUE; + } + return FALSE; +} + +LLViewerInventoryItem* LLItemBridge::getItem() const +{ + LLViewerInventoryItem* item = NULL; + LLInventoryModel* model = getInventoryModel(); + if(model) + { + item = (LLViewerInventoryItem*)model->getItem(mUUID); + } + return item; +} + +BOOL LLItemBridge::isItemPermissive() const +{ + LLViewerInventoryItem* item = getItem(); + if(item) + { + U32 mask = item->getPermissions().getMaskBase(); + if((mask & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) + { + return TRUE; + } + } + return FALSE; +} + +bool LLItemBridge::isAddAction(std::string action) const +{ + return ("wear" == action || "attach" == action || "activate" == action); +} + +bool LLItemBridge::isRemoveAction(std::string action) const +{ + return ("take_off" == action || "detach" == action || "deactivate" == action); +} + +// +=================================================+ +// | LLFolderBridge | +// +=================================================+ + +LLFolderBridge* LLFolderBridge::sSelf=NULL; + +// Can be moved to another folder +BOOL LLFolderBridge::isItemMovable() const +{ + LLInventoryObject* obj = getInventoryObject(); + if(obj) + { + return (!LLFolderType::lookupIsProtectedType(((LLInventoryCategory*)obj)->getPreferredType())); + } + return FALSE; +} + +void LLFolderBridge::selectItem() +{ +} + + +// Iterate through a folder's children to determine if +// all the children are removable. +class LLIsItemRemovable : public LLFolderViewFunctor +{ +public: + LLIsItemRemovable() : mPassed(TRUE) {} + virtual void doFolder(LLFolderViewFolder* folder) + { + mPassed &= folder->getListener()->isItemRemovable(); + } + virtual void doItem(LLFolderViewItem* item) + { + mPassed &= item->getListener()->isItemRemovable(); + } + BOOL mPassed; +}; + +// Can be destroyed (or moved to trash) +BOOL LLFolderBridge::isItemRemovable() +{ + LLInventoryModel* model = getInventoryModel(); + if(!model) + { + return FALSE; + } + + if(!model->isObjectDescendentOf(mUUID, gInventory.getRootFolderID())) + { + return FALSE; + } + + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); + if( !avatar ) + { + return FALSE; + } + + LLInventoryCategory* category = model->getCategory(mUUID); + if( !category ) + { + return FALSE; + } + // Allow protected types to be removed, but issue a warning. + /* + if(LLFolderType::lookupIsProtectedType(category->getPreferredType())) + { + return FALSE; + } + */ + + LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get()); + LLFolderViewFolder* folderp = dynamic_cast<LLFolderViewFolder*>(panel ? panel->getRootFolder()->getItemByID(mUUID) : NULL); + if (folderp) + { + LLIsItemRemovable folder_test; + folderp->applyFunctorToChildren(folder_test); + if (!folder_test.mPassed) + { + return FALSE; + } + } + return TRUE; +} + +BOOL LLFolderBridge::isUpToDate() const +{ + LLInventoryModel* model = getInventoryModel(); + if(!model) return FALSE; + LLViewerInventoryCategory* category = (LLViewerInventoryCategory*)model->getCategory(mUUID); + if( !category ) + { + return FALSE; + } + + return category->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN; +} + +BOOL LLFolderBridge::isItemCopyable() const +{ + return TRUE; +} + +BOOL LLFolderBridge::copyToClipboard() const +{ + if(isItemCopyable()) + { + LLInventoryClipboard::instance().add(mUUID); + return TRUE; + } + return FALSE; +} + +BOOL LLFolderBridge::isClipboardPasteable() const +{ + if ( ! LLInvFVBridge::isClipboardPasteable() ) + return FALSE; + + // Don't allow pasting duplicates to the Calling Card/Friends subfolders, see bug EXT-1599 + if ( LLFriendCardsManager::instance().isCategoryInFriendFolder( getCategory() ) ) + { + LLInventoryModel* model = getInventoryModel(); + if ( !model ) + { + return FALSE; + } + + LLDynamicArray<LLUUID> objects; + LLInventoryClipboard::instance().retrieve(objects); + const LLViewerInventoryCategory *current_cat = getCategory(); + + // Search for the direct descendent of current Friends subfolder among all pasted items, + // and return false if is found. + for(S32 i = objects.count() - 1; i >= 0; --i) + { + const LLUUID &obj_id = objects.get(i); + if ( LLFriendCardsManager::instance().isObjDirectDescendentOfCategory(model->getObject(obj_id), current_cat) ) + { + return FALSE; + } + } + + } + return TRUE; +} + +BOOL LLFolderBridge::isClipboardPasteableAsLink() const +{ + // Check normal paste-as-link permissions + if (!LLInvFVBridge::isClipboardPasteableAsLink()) + { + return FALSE; + } + + const LLInventoryModel* model = getInventoryModel(); + if (!model) + { + return FALSE; + } + + const LLViewerInventoryCategory *current_cat = getCategory(); + if (current_cat) + { + const BOOL is_in_friend_folder = LLFriendCardsManager::instance().isCategoryInFriendFolder( current_cat ); + const LLUUID ¤t_cat_id = current_cat->getUUID(); + LLDynamicArray<LLUUID> objects; + LLInventoryClipboard::instance().retrieve(objects); + S32 count = objects.count(); + for(S32 i = 0; i < count; i++) + { + const LLUUID &obj_id = objects.get(i); + const LLInventoryCategory *cat = model->getCategory(obj_id); + if (cat) + { + const LLUUID &cat_id = cat->getUUID(); + // Don't allow recursive pasting + if ((cat_id == current_cat_id) || + model->isObjectDescendentOf(current_cat_id, cat_id)) + { + return FALSE; + } + } + // Don't allow pasting duplicates to the Calling Card/Friends subfolders, see bug EXT-1599 + if ( is_in_friend_folder ) + { + // If object is direct descendent of current Friends subfolder than return false. + // Note: We can't use 'const LLInventoryCategory *cat', because it may be null + // in case type of obj_id is LLInventoryItem. + if ( LLFriendCardsManager::instance().isObjDirectDescendentOfCategory(model->getObject(obj_id), current_cat) ) + { + return FALSE; + } + } + } + } + return TRUE; + +} + +BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, + BOOL drop) +{ + // This should never happen, but if an inventory item is incorrectly parented, + // the UI will get confused and pass in a NULL. + if(!inv_cat) return FALSE; + + LLInventoryModel* model = getInventoryModel(); + if(!model) return FALSE; + + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); + if(!avatar) return FALSE; + + // cannot drag categories into library + if(!isAgentInventory()) + { + return FALSE; + } + + // check to make sure source is agent inventory, and is represented there. + LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); + BOOL is_agent_inventory = (model->getCategory(inv_cat->getUUID()) != NULL) + && (LLToolDragAndDrop::SOURCE_AGENT == source); + + BOOL accept = FALSE; + S32 i; + LLInventoryModel::cat_array_t descendent_categories; + LLInventoryModel::item_array_t descendent_items; + if(is_agent_inventory) + { + const LLUUID& cat_id = inv_cat->getUUID(); + + // Is the destination the trash? + const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); + BOOL move_is_into_trash = (mUUID == trash_id) + || model->isObjectDescendentOf(mUUID, trash_id); + BOOL is_movable = (!LLFolderType::lookupIsProtectedType(inv_cat->getPreferredType())); + const LLUUID current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); + BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); + BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT); + if (move_is_into_current_outfit || move_is_into_outfit) + { + // BAP - restrictions? + is_movable = true; + } + + if (mUUID == gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE)) + { + is_movable = FALSE; // It's generally movable but not into Favorites folder. EXT-1604 + } + + if( is_movable ) + { + gInventory.collectDescendents( cat_id, descendent_categories, descendent_items, FALSE ); + + for( i = 0; i < descendent_categories.count(); i++ ) + { + LLInventoryCategory* category = descendent_categories[i]; + if(LLFolderType::lookupIsProtectedType(category->getPreferredType())) + { + // ...can't move "special folders" like Textures + is_movable = FALSE; + break; + } + } + + if( is_movable ) + { + if( move_is_into_trash ) + { + for( i = 0; i < descendent_items.count(); i++ ) + { + LLInventoryItem* item = descendent_items[i]; + if( (item->getType() == LLAssetType::AT_CLOTHING) || + (item->getType() == LLAssetType::AT_BODYPART) ) + { + if( gAgentWearables.isWearingItem( item->getUUID() ) ) + { + is_movable = FALSE; // It's generally movable, but not into the trash! + break; + } + } + else + if( item->getType() == LLAssetType::AT_OBJECT ) + { + if( avatar->isWearingAttachment( item->getUUID() ) ) + { + is_movable = FALSE; // It's generally movable, but not into the trash! + break; + } + } + } + } + } + } + + + accept = is_movable + && (mUUID != cat_id) // Can't move a folder into itself + && (mUUID != inv_cat->getParentUUID()) // Avoid moves that would change nothing + && !(model->isObjectDescendentOf(mUUID, cat_id)); // Avoid circularity + if(accept && drop) + { + // Look for any gestures and deactivate them + if (move_is_into_trash) + { + for (i = 0; i < descendent_items.count(); i++) + { + LLInventoryItem* item = descendent_items[i]; + if (item->getType() == LLAssetType::AT_GESTURE + && LLGestureManager::instance().isGestureActive(item->getUUID())) + { + LLGestureManager::instance().deactivateGesture(item->getUUID()); + } + } + } + // if target is an outfit or current outfit folder we use link + if (move_is_into_current_outfit || move_is_into_outfit) + { + if (inv_cat->getPreferredType() == LLFolderType::FT_NONE) + { + if (move_is_into_current_outfit) + { + // traverse category and add all contents to currently worn. + BOOL append = true; + LLAppearanceManager::instance().wearInventoryCategory(inv_cat, false, append); + } + else + { + // Recursively create links in target outfit. + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + gInventory.collectDescendents(inv_cat->getUUID(), cats, items, LLInventoryModel::EXCLUDE_TRASH); + LLAppearanceManager::instance().linkAll(mUUID,items,NULL); + } + } + else + { +#if SUPPORT_ENSEMBLES + // BAP - should skip if dup. + if (move_is_into_current_outfit) + { + LLAppearanceManager::instance().addEnsembleLink(inv_cat); + } + else + { + LLPointer<LLInventoryCallback> cb = NULL; + link_inventory_item( + gAgent.getID(), + inv_cat->getUUID(), + mUUID, + inv_cat->getName(), + LLAssetType::AT_LINK_FOLDER, + cb); + } +#endif + } + } + else + { + + // Reparent the folder and restamp children if it's moving + // into trash. + LLInvFVBridge::changeCategoryParent( + model, + (LLViewerInventoryCategory*)inv_cat, + mUUID, + move_is_into_trash); + } + } + } + else if(LLToolDragAndDrop::SOURCE_WORLD == source) + { + // content category has same ID as object itself + LLUUID object_id = inv_cat->getUUID(); + LLUUID category_id = mUUID; + accept = move_inv_category_world_to_agent(object_id, category_id, drop); + } + return accept; +} + +void warn_move_inventory(LLViewerObject* object, LLMoveInv* move_inv) +{ + const char* dialog = NULL; + if (object->flagScripted()) + { + dialog = "MoveInventoryFromScriptedObject"; + } + else + { + dialog = "MoveInventoryFromObject"; + } + LLNotificationsUtil::add(dialog, LLSD(), LLSD(), boost::bind(move_task_inventory_callback, _1, _2, move_inv)); +} + +// Move/copy all inventory items from the Contents folder of an in-world +// object to the agent's inventory, inside a given category. +BOOL move_inv_category_world_to_agent(const LLUUID& object_id, + const LLUUID& category_id, + BOOL drop, + void (*callback)(S32, void*), + void* user_data) +{ + // Make sure the object exists. If we allowed dragging from + // anonymous objects, it would be possible to bypass + // permissions. + // content category has same ID as object itself + LLViewerObject* object = gObjectList.findObject(object_id); + if(!object) + { + llinfos << "Object not found for drop." << llendl; + return FALSE; + } + + // this folder is coming from an object, as there is only one folder in an object, the root, + // we need to collect the entire contents and handle them as a group + InventoryObjectList inventory_objects; + object->getInventoryContents(inventory_objects); + + if (inventory_objects.empty()) + { + llinfos << "Object contents not found for drop." << llendl; + return FALSE; + } + + BOOL accept = TRUE; + BOOL is_move = FALSE; + + // coming from a task. Need to figure out if the person can + // move/copy this item. + InventoryObjectList::iterator it = inventory_objects.begin(); + InventoryObjectList::iterator end = inventory_objects.end(); + for ( ; it != end; ++it) + { + // coming from a task. Need to figure out if the person can + // move/copy this item. + LLPermissions perm(((LLInventoryItem*)((LLInventoryObject*)(*it)))->getPermissions()); + if((perm.allowCopyBy(gAgent.getID(), gAgent.getGroupID()) + && perm.allowTransferTo(gAgent.getID()))) +// || gAgent.isGodlike()) + { + accept = TRUE; + } + else if(object->permYouOwner()) + { + // If the object cannot be copied, but the object the + // inventory is owned by the agent, then the item can be + // moved from the task to agent inventory. + is_move = TRUE; + accept = TRUE; + } + else + { + accept = FALSE; + break; + } + } + + if(drop && accept) + { + it = inventory_objects.begin(); + InventoryObjectList::iterator first_it = inventory_objects.begin(); + LLMoveInv* move_inv = new LLMoveInv; + move_inv->mObjectID = object_id; + move_inv->mCategoryID = category_id; + move_inv->mCallback = callback; + move_inv->mUserData = user_data; + + for ( ; it != end; ++it) + { + two_uuids_t two(category_id, (*it)->getUUID()); + move_inv->mMoveList.push_back(two); + } + + if(is_move) + { + // Callback called from within here. + warn_move_inventory(object, move_inv); + } + else + { + LLNotification::Params params("MoveInventoryFromObject"); + params.functor.function(boost::bind(move_task_inventory_callback, _1, _2, move_inv)); + LLNotifications::instance().forceResponse(params, 0); + } + } + return accept; +} + +bool LLFindCOFValidItems::operator()(LLInventoryCategory* cat, + LLInventoryItem* item) +{ + // Valid COF items are: + // - links to wearables (body parts or clothing) + // - links to attachments + // - links to gestures + // - links to ensemble folders + LLViewerInventoryItem *linked_item = ((LLViewerInventoryItem*)item)->getLinkedItem(); // BAP - safe? + if (linked_item) + { + LLAssetType::EType type = linked_item->getType(); + return (type == LLAssetType::AT_CLOTHING || + type == LLAssetType::AT_BODYPART || + type == LLAssetType::AT_GESTURE || + type == LLAssetType::AT_OBJECT); + } + else + { + LLViewerInventoryCategory *linked_category = ((LLViewerInventoryItem*)item)->getLinkedCategory(); // BAP - safe? + // BAP remove AT_NONE support after ensembles are fully working? + return (linked_category && + ((linked_category->getPreferredType() == LLFolderType::FT_NONE) || + (LLFolderType::lookupIsEnsembleType(linked_category->getPreferredType())))); + } +} + + +bool LLFindWearables::operator()(LLInventoryCategory* cat, + LLInventoryItem* item) +{ + if(item) + { + if((item->getType() == LLAssetType::AT_CLOTHING) + || (item->getType() == LLAssetType::AT_BODYPART)) + { + return TRUE; + } + } + return FALSE; +} + + + +//Used by LLFolderBridge as callback for directory recursion. +class LLRightClickInventoryFetchObserver : public LLInventoryFetchObserver +{ +public: + LLRightClickInventoryFetchObserver() : + mCopyItems(false) + { }; + LLRightClickInventoryFetchObserver(const LLUUID& cat_id, bool copy_items) : + mCatID(cat_id), + mCopyItems(copy_items) + { }; + virtual void done() + { + // we've downloaded all the items, so repaint the dialog + LLFolderBridge::staticFolderOptionsMenu(); + + gInventory.removeObserver(this); + delete this; + } + + +protected: + LLUUID mCatID; + bool mCopyItems; + +}; + +//Used by LLFolderBridge as callback for directory recursion. +class LLRightClickInventoryFetchDescendentsObserver : public LLInventoryFetchDescendentsObserver +{ +public: + LLRightClickInventoryFetchDescendentsObserver(bool copy_items) : mCopyItems(copy_items) {} + ~LLRightClickInventoryFetchDescendentsObserver() {} + virtual void done(); +protected: + bool mCopyItems; +}; + +void LLRightClickInventoryFetchDescendentsObserver::done() +{ + // Avoid passing a NULL-ref as mCompleteFolders.front() down to + // gInventory.collectDescendents() + if( mCompleteFolders.empty() ) + { + llwarns << "LLRightClickInventoryFetchDescendentsObserver::done with empty mCompleteFolders" << llendl; + dec_busy_count(); + gInventory.removeObserver(this); + delete this; + return; + } + + // What we do here is get the complete information on the items in + // the library, and set up an observer that will wait for that to + // happen. + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; + gInventory.collectDescendents(mCompleteFolders.front(), + cat_array, + item_array, + LLInventoryModel::EXCLUDE_TRASH); + S32 count = item_array.count(); +#if 0 // HACK/TODO: Why? + // This early causes a giant menu to get produced, and doesn't seem to be needed. + if(!count) + { + llwarns << "Nothing fetched in category " << mCompleteFolders.front() + << llendl; + dec_busy_count(); + gInventory.removeObserver(this); + delete this; + return; + } +#endif + + LLRightClickInventoryFetchObserver* outfit; + outfit = new LLRightClickInventoryFetchObserver(mCompleteFolders.front(), mCopyItems); + LLInventoryFetchObserver::item_ref_t ids; + for(S32 i = 0; i < count; ++i) + { + ids.push_back(item_array.get(i)->getUUID()); + } + + // clean up, and remove this as an observer since the call to the + // outfit could notify observers and throw us into an infinite + // loop. + dec_busy_count(); + gInventory.removeObserver(this); + delete this; + + // increment busy count and either tell the inventory to check & + // call done, or add this object to the inventory for observation. + inc_busy_count(); + + // do the fetch + outfit->fetchItems(ids); + outfit->done(); //Not interested in waiting and this will be right 99% of the time. +//Uncomment the following code for laggy Inventory UI. +/* if(outfit->isEverythingComplete()) + { + // everything is already here - call done. + outfit->done(); + } + else + { + // it's all on it's way - add an observer, and the inventory + // will call done for us when everything is here. + gInventory.addObserver(outfit); + }*/ +} + + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInventoryWearObserver +// +// Observer for "copy and wear" operation to support knowing +// when the all of the contents have been added to inventory. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLInventoryCopyAndWearObserver : public LLInventoryObserver +{ +public: + LLInventoryCopyAndWearObserver(const LLUUID& cat_id, int count) :mCatID(cat_id), mContentsCount(count), mFolderAdded(FALSE) {} + virtual ~LLInventoryCopyAndWearObserver() {} + virtual void changed(U32 mask); + +protected: + LLUUID mCatID; + int mContentsCount; + BOOL mFolderAdded; +}; + + + +void LLInventoryCopyAndWearObserver::changed(U32 mask) +{ + if((mask & (LLInventoryObserver::ADD)) != 0) + { + if (!mFolderAdded) + { + const std::set<LLUUID>& changed_items = gInventory.getChangedIDs(); + + std::set<LLUUID>::const_iterator id_it = changed_items.begin(); + std::set<LLUUID>::const_iterator id_end = changed_items.end(); + for (;id_it != id_end; ++id_it) + { + if ((*id_it) == mCatID) + { + mFolderAdded = TRUE; + break; + } + } + } + + if (mFolderAdded) + { + LLViewerInventoryCategory* category = gInventory.getCategory(mCatID); + + if (NULL == category) + { + llwarns << "gInventory.getCategory(" << mCatID + << ") was NULL" << llendl; + } + else + { + if (category->getDescendentCount() == + mContentsCount) + { + gInventory.removeObserver(this); + LLAppearanceManager::instance().wearInventoryCategory(category, FALSE, TRUE); + delete this; + } + } + } + + } +} + + + +void LLFolderBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) +{ + if ("open" == action) + { + openItem(); + return; + } + else if ("paste" == action) + { + pasteFromClipboard(); + return; + } + else if ("paste_link" == action) + { + pasteLinkFromClipboard(); + return; + } + else if ("properties" == action) + { + showProperties(); + return; + } + else if ("replaceoutfit" == action) + { + modifyOutfit(FALSE); + return; + } +#if SUPPORT_ENSEMBLES + else if ("wearasensemble" == action) + { + LLInventoryModel* model = getInventoryModel(); + if(!model) return; + LLViewerInventoryCategory* cat = getCategory(); + if(!cat) return; + LLAppearanceManager::instance().addEnsembleLink(cat,true); + return; + } +#endif + else if ("addtooutfit" == action) + { + modifyOutfit(TRUE); + return; + } + else if ("copy" == action) + { + copyToClipboard(); + return; + } + else if ("removefromoutfit" == action) + { + LLInventoryModel* model = getInventoryModel(); + if(!model) return; + LLViewerInventoryCategory* cat = getCategory(); + if(!cat) return; + + remove_inventory_category_from_avatar ( cat ); + return; + } + else if ("purge" == action) + { + purgeItem(model, mUUID); + return; + } + else if ("restore" == action) + { + restoreItem(); + return; + } +} + +void LLFolderBridge::openItem() +{ + lldebugs << "LLFolderBridge::openItem()" << llendl; + LLInventoryModel* model = getInventoryModel(); + if(!model) return; + if(mUUID.isNull()) return; + bool fetching_inventory = model->fetchDescendentsOf(mUUID); + // Only change folder type if we have the folder contents. + if (!fetching_inventory) + { + // Disabling this for now, it's causing crash when new items are added to folders + // since folder type may change before new item item has finished processing. + // determineFolderType(); + } +} + +void LLFolderBridge::closeItem() +{ + determineFolderType(); +} + +void LLFolderBridge::determineFolderType() +{ + if (isUpToDate()) + { + LLInventoryModel* model = getInventoryModel(); + LLViewerInventoryCategory* category = model->getCategory(mUUID); + category->determineFolderType(); + } +} + +BOOL LLFolderBridge::isItemRenameable() const +{ + LLViewerInventoryCategory* cat = (LLViewerInventoryCategory*)getCategory(); + if(cat && !LLFolderType::lookupIsProtectedType(cat->getPreferredType()) + && (cat->getOwnerID() == gAgent.getID())) + { + return TRUE; + } + return FALSE; +} + +void LLFolderBridge::restoreItem() +{ + LLViewerInventoryCategory* cat; + cat = (LLViewerInventoryCategory*)getCategory(); + if(cat) + { + LLInventoryModel* model = getInventoryModel(); + const LLUUID new_parent = model->findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(cat->getType())); + // do not restamp children on restore + LLInvFVBridge::changeCategoryParent(model, cat, new_parent, FALSE); + } +} + +LLFolderType::EType LLFolderBridge::getPreferredType() const +{ + LLFolderType::EType preferred_type = LLFolderType::FT_NONE; + LLViewerInventoryCategory* cat = getCategory(); + if(cat) + { + preferred_type = cat->getPreferredType(); + } + + return preferred_type; +} + +// Icons for folders are based on the preferred type +LLUIImagePtr LLFolderBridge::getIcon() const +{ + LLFolderType::EType preferred_type = LLFolderType::FT_NONE; + LLViewerInventoryCategory* cat = getCategory(); + if(cat) + { + preferred_type = cat->getPreferredType(); + } + return getIcon(preferred_type); +} + +LLUIImagePtr LLFolderBridge::getIcon(LLFolderType::EType preferred_type) +{ + // we only have one folder image now + return LLUI::getUIImage("Inv_FolderClosed"); + /*case LLAssetType::AT_MESH: + control = "inv_folder_mesh.tga"; + break;*/ +} + +BOOL LLFolderBridge::renameItem(const std::string& new_name) +{ + if(!isItemRenameable()) + return FALSE; + LLInventoryModel* model = getInventoryModel(); + if(!model) + return FALSE; + LLViewerInventoryCategory* cat = getCategory(); + if(cat && (cat->getName() != new_name)) + { + LLPointer<LLViewerInventoryCategory> new_cat = new LLViewerInventoryCategory(cat); + new_cat->rename(new_name); + new_cat->updateServer(FALSE); + model->updateCategory(new_cat); + + model->notifyObservers(); + } + // return FALSE because we either notified observers (& therefore + // rebuilt) or we didn't update. + return FALSE; +} + +BOOL LLFolderBridge::removeItem() +{ + if(!isItemRemovable()) + { + return FALSE; + } + const LLViewerInventoryCategory *cat = getCategory(); + + LLSD payload; + LLSD args; + args["FOLDERNAME"] = cat->getName(); + + LLNotification::Params params("ConfirmDeleteProtectedCategory"); + params.payload(payload).substitutions(args).functor.function(boost::bind(&LLFolderBridge::removeItemResponse, this, _1, _2)); + //params.functor.function(boost::bind(&LLFolderBridge::removeItemResponse, this, _1, _2)); + /* + LLNotification::Params params("ChangeLindenEstate"); + params.functor.function(boost::bind(&LLPanelEstateInfo::callbackChangeLindenEstate, this, _1, _2)); + */ + if (LLFolderType::lookupIsProtectedType(cat->getPreferredType())) + { + LLNotifications::instance().add(params); + } + else + { + LLNotifications::instance().forceResponse(params, 0); + } + return TRUE; +} + +bool LLFolderBridge::removeItemResponse(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotification::getSelectedOption(notification, response); + + // if they choose delete, do it. Otherwise, don't do anything + if(option == 0) + { + // move it to the trash + LLPreview::hide(mUUID); + LLInventoryModel* model = getInventoryModel(); + if(!model) return FALSE; + + const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); + + // Look for any gestures and deactivate them + LLInventoryModel::cat_array_t descendent_categories; + LLInventoryModel::item_array_t descendent_items; + gInventory.collectDescendents( mUUID, descendent_categories, descendent_items, FALSE ); + + S32 i; + for (i = 0; i < descendent_items.count(); i++) + { + LLInventoryItem* item = descendent_items[i]; + if (item->getType() == LLAssetType::AT_GESTURE + && LLGestureManager::instance().isGestureActive(item->getUUID())) + { + LLGestureManager::instance().deactivateGesture(item->getUUID()); + } + } + + // go ahead and do the normal remove if no 'last calling + // cards' are being removed. + LLViewerInventoryCategory* cat = getCategory(); + if(cat) + { + LLInvFVBridge::changeCategoryParent(model, cat, trash_id, TRUE); + } + return TRUE; + } + return FALSE; +} + +void LLFolderBridge::pasteFromClipboard() +{ + LLInventoryModel* model = getInventoryModel(); + if(model && isClipboardPasteable()) + { + LLInventoryItem* item = NULL; + LLDynamicArray<LLUUID> objects; + LLInventoryClipboard::instance().retrieve(objects); + S32 count = objects.count(); + const LLUUID parent_id(mUUID); + for(S32 i = 0; i < count; i++) + { + item = model->getItem(objects.get(i)); + if (item) + { + if(LLInventoryClipboard::instance().isCutMode()) + { + // move_inventory_item() is not enough, + //we have to update inventory locally too + changeItemParent(model, dynamic_cast<LLViewerInventoryItem*>(item), parent_id, FALSE); + } + else + { + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + parent_id, + std::string(), + LLPointer<LLInventoryCallback>(NULL)); + } + } + } + } +} + +void LLFolderBridge::pasteLinkFromClipboard() +{ + const LLInventoryModel* model = getInventoryModel(); + if(model) + { + LLDynamicArray<LLUUID> objects; + LLInventoryClipboard::instance().retrieve(objects); + S32 count = objects.count(); + LLUUID parent_id(mUUID); + for(S32 i = 0; i < count; i++) + { + const LLUUID &object_id = objects.get(i); +#if SUPPORT_ENSEMBLES + if (LLInventoryCategory *cat = model->getCategory(object_id)) + { + link_inventory_item( + gAgent.getID(), + cat->getUUID(), + parent_id, + cat->getName(), + LLAssetType::AT_LINK_FOLDER, + LLPointer<LLInventoryCallback>(NULL)); + } + else +#endif + if (LLInventoryItem *item = model->getItem(object_id)) + { + link_inventory_item( + gAgent.getID(), + item->getLinkedUUID(), + parent_id, + item->getName(), + LLAssetType::AT_LINK, + LLPointer<LLInventoryCallback>(NULL)); + } + } + } +} + +void LLFolderBridge::staticFolderOptionsMenu() +{ + if (!sSelf) return; + sSelf->folderOptionsMenu(); +} + +bool isInOutfitsSidePanel(LLPanel *panel) +{ + LLInventoryPanel *my_panel = dynamic_cast<LLInventoryPanel*>(panel); + LLPanelOutfitsInventory *outfit_panel = + dynamic_cast<LLPanelOutfitsInventory*>(LLSideTray::getInstance()->getPanel("panel_outfits_inventory")); + if (!outfit_panel) + return false; + return outfit_panel->isAccordionPanel(my_panel); + + //LLInventoryPanel *outfit_inv_panel = outfit_panel ? outfit_panel->getActivePanel(): NULL; + //return (my_panel && (my_panel == outfit_inv_panel)); +} + +void LLFolderBridge::folderOptionsMenu() +{ + std::vector<std::string> disabled_items; + + LLInventoryModel* model = getInventoryModel(); + if(!model) return; + + const LLInventoryCategory* category = model->getCategory(mUUID); + LLFolderType::EType type = category->getPreferredType(); + const bool is_default_folder = category && LLFolderType::lookupIsProtectedType(type); + // BAP change once we're no longer treating regular categories as ensembles. + const bool is_ensemble = category && (type == LLFolderType::FT_NONE || + LLFolderType::lookupIsEnsembleType(type)); + const bool is_sidepanel = isInOutfitsSidePanel(mInventoryPanel.get()); + + // calling card related functionality for folders. + + if (is_sidepanel) + { + mItems.clear(); + mItems.push_back("Rename"); + mItems.push_back("Delete"); + } + + // Only enable calling-card related options for non-default folders. + if (!is_sidepanel && !is_default_folder) + { + LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD); + if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard)) + { + mItems.push_back(std::string("Calling Card Separator")); + mItems.push_back(std::string("Conference Chat Folder")); + mItems.push_back(std::string("IM All Contacts In Folder")); + } + } + + // wearables related functionality for folders. + //is_wearable + LLFindWearables is_wearable; + LLIsType is_object( LLAssetType::AT_OBJECT ); + LLIsType is_gesture( LLAssetType::AT_GESTURE ); + + if (mWearables || + checkFolderForContentsOfType(model, is_wearable) || + checkFolderForContentsOfType(model, is_object) || + checkFolderForContentsOfType(model, is_gesture) ) + { + mItems.push_back(std::string("Folder Wearables Separator")); + + // Only enable add/replace outfit for non-default folders. + if (!is_default_folder) + { + mItems.push_back(std::string("Add To Outfit")); + mItems.push_back(std::string("Replace Outfit")); + } + if (is_ensemble) + { + mItems.push_back(std::string("Wear As Ensemble")); + } + mItems.push_back(std::string("Remove From Outfit")); + } + hide_context_entries(*mMenu, mItems, disabled_items); + + // Reposition the menu, in case we're adding items to an existing menu. + mMenu->needsArrange(); + mMenu->arrangeAndClear(); +} + +BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& is_type) +{ + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; + model->collectDescendentsIf(mUUID, + cat_array, + item_array, + LLInventoryModel::EXCLUDE_TRASH, + is_type); + return ((item_array.count() > 0) ? TRUE : FALSE ); +} + +// Flags unused +void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + mItems.clear(); + mDisabledItems.clear(); + + lldebugs << "LLFolderBridge::buildContextMenu()" << llendl; +// std::vector<std::string> disabled_items; + LLInventoryModel* model = getInventoryModel(); + if(!model) return; + const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); + const LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); + + mItems.clear(); //adding code to clear out member Items (which means Items should not have other data here at this point) + mDisabledItems.clear(); //adding code to clear out disabled members from previous + if (lost_and_found_id == mUUID) + { + // This is the lost+found folder. + mItems.push_back(std::string("Empty Lost And Found")); + } + + if(trash_id == mUUID) + { + // This is the trash. + mItems.push_back(std::string("Empty Trash")); + } + else if(model->isObjectDescendentOf(mUUID, trash_id)) + { + // This is a folder in the trash. + mItems.clear(); // clear any items that used to exist + mItems.push_back(std::string("Purge Item")); + if (!isItemRemovable()) + { + mDisabledItems.push_back(std::string("Purge Item")); + } + + mItems.push_back(std::string("Restore Item")); + } + else if(isAgentInventory()) // do not allow creating in library + { + LLViewerInventoryCategory *cat = getCategory(); + // BAP removed protected check to re-enable standard ops in untyped folders. + // Not sure what the right thing is to do here. + if (!isCOFFolder() && cat /*&& + LLAssetType::lookupIsProtectedCategoryType(cat->getPreferredType())*/) + { + // Do not allow to create 2-level subfolder in the Calling Card/Friends folder. EXT-694. + if (!LLFriendCardsManager::instance().isCategoryInFriendFolder(cat)) + mItems.push_back(std::string("New Folder")); + mItems.push_back(std::string("New Script")); + mItems.push_back(std::string("New Note")); + mItems.push_back(std::string("New Gesture")); + mItems.push_back(std::string("New Clothes")); + mItems.push_back(std::string("New Body Parts")); + mItems.push_back(std::string("Change Type")); + + LLViewerInventoryCategory *cat = getCategory(); + if (cat && LLFolderType::lookupIsProtectedType(cat->getPreferredType())) + { + mDisabledItems.push_back(std::string("Change Type")); + } + + getClipboardEntries(false, mItems, mDisabledItems, flags); + } + else + { + // Want some but not all of the items from getClipboardEntries for outfits. + if (cat && cat->getPreferredType()==LLFolderType::FT_OUTFIT) + { + mItems.push_back(std::string("Rename")); + mItems.push_back(std::string("Delete")); + } + } + + //Added by spatters to force inventory pull on right-click to display folder options correctly. 07-17-06 + mCallingCards = mWearables = FALSE; + + LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD); + if (checkFolderForContentsOfType(model, is_callingcard)) + { + mCallingCards=TRUE; + } + + LLFindWearables is_wearable; + LLIsType is_object( LLAssetType::AT_OBJECT ); + LLIsType is_gesture( LLAssetType::AT_GESTURE ); + + if (checkFolderForContentsOfType(model, is_wearable) || + checkFolderForContentsOfType(model, is_object) || + checkFolderForContentsOfType(model, is_gesture) ) + { + mWearables=TRUE; + } + + mMenu = &menu; + sSelf = this; + LLRightClickInventoryFetchDescendentsObserver* fetch = new LLRightClickInventoryFetchDescendentsObserver(FALSE); + + LLInventoryFetchDescendentsObserver::folder_ref_t folders; + LLViewerInventoryCategory* category = (LLViewerInventoryCategory*)model->getCategory(mUUID); + if (category) + { + folders.push_back(category->getUUID()); + } + fetch->fetchDescendents(folders); + inc_busy_count(); + if(fetch->isEverythingComplete()) + { + // everything is already here - call done. + fetch->done(); + } + else + { + // it's all on it's way - add an observer, and the inventory + // will call done for us when everything is here. + gInventory.addObserver(fetch); + } + } + else + { + mItems.push_back(std::string("--no options--")); + mDisabledItems.push_back(std::string("--no options--")); + } + hide_context_entries(menu, mItems, mDisabledItems); +} + +BOOL LLFolderBridge::hasChildren() const +{ + LLInventoryModel* model = getInventoryModel(); + if(!model) return FALSE; + LLInventoryModel::EHasChildren has_children; + has_children = gInventory.categoryHasChildren(mUUID); + return has_children != LLInventoryModel::CHILDREN_NO; +} + +BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data) +{ + //llinfos << "LLFolderBridge::dragOrDrop()" << llendl; + BOOL accept = FALSE; + switch(cargo_type) + { + case DAD_TEXTURE: + case DAD_SOUND: + case DAD_CALLINGCARD: + case DAD_LANDMARK: + case DAD_SCRIPT: + case DAD_OBJECT: + case DAD_NOTECARD: + case DAD_CLOTHING: + case DAD_BODYPART: + case DAD_ANIMATION: + case DAD_GESTURE: + case DAD_LINK: + case DAD_MESH: + accept = dragItemIntoFolder((LLInventoryItem*)cargo_data, + drop); + break; + case DAD_CATEGORY: + if (LLFriendCardsManager::instance().isAnyFriendCategory(mUUID)) + { + accept = FALSE; + } + else + { + accept = dragCategoryIntoFolder((LLInventoryCategory*)cargo_data, drop); + } + break; + default: + break; + } + return accept; +} + +LLViewerInventoryCategory* LLFolderBridge::getCategory() const +{ + LLViewerInventoryCategory* cat = NULL; + LLInventoryModel* model = getInventoryModel(); + if(model) + { + cat = (LLViewerInventoryCategory*)model->getCategory(mUUID); + } + return cat; +} + + +// static +void LLFolderBridge::pasteClipboard(void* user_data) +{ + LLFolderBridge* self = (LLFolderBridge*)user_data; + if(self) self->pasteFromClipboard(); +} + +void LLFolderBridge::createNewCategory(void* user_data) +{ + LLFolderBridge* bridge = (LLFolderBridge*)user_data; + if(!bridge) return; + LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(bridge->mInventoryPanel.get()); + if (!panel) return; + LLInventoryModel* model = panel->getModel(); + if(!model) return; + LLUUID id; + id = model->createNewCategory(bridge->getUUID(), + LLFolderType::FT_NONE, + LLStringUtil::null); + model->notifyObservers(); + + // At this point, the bridge has probably been deleted, but the + // view is still there. + panel->setSelection(id, TAKE_FOCUS_YES); +} + +void LLFolderBridge::createNewShirt(void* user_data) +{ + LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_SHIRT); +} + +void LLFolderBridge::createNewPants(void* user_data) +{ + LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_PANTS); +} + +void LLFolderBridge::createNewShoes(void* user_data) +{ + LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_SHOES); +} + +void LLFolderBridge::createNewSocks(void* user_data) +{ + LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_SOCKS); +} + +void LLFolderBridge::createNewJacket(void* user_data) +{ + LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_JACKET); +} + +void LLFolderBridge::createNewSkirt(void* user_data) +{ + LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_SKIRT); +} + +void LLFolderBridge::createNewGloves(void* user_data) +{ + LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_GLOVES); +} + +void LLFolderBridge::createNewUndershirt(void* user_data) +{ + LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_UNDERSHIRT); +} + +void LLFolderBridge::createNewUnderpants(void* user_data) +{ + LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_UNDERPANTS); +} + +void LLFolderBridge::createNewShape(void* user_data) +{ + LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_SHAPE); +} + +void LLFolderBridge::createNewSkin(void* user_data) +{ + LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_SKIN); +} + +void LLFolderBridge::createNewHair(void* user_data) +{ + LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_HAIR); +} + +void LLFolderBridge::createNewEyes(void* user_data) +{ + LLFolderBridge::createWearable((LLFolderBridge*)user_data, WT_EYES); +} + +// static +void LLFolderBridge::createWearable(LLFolderBridge* bridge, EWearableType type) +{ + if(!bridge) return; + LLUUID parent_id = bridge->getUUID(); + createWearable(parent_id, type); +} + +// Separate function so can be called by global menu as well as right-click +// menu. +// static +void LLFolderBridge::createWearable(const LLUUID &parent_id, EWearableType type) +{ + LLWearable* wearable = LLWearableList::instance().createNewWearable(type); + LLAssetType::EType asset_type = wearable->getAssetType(); + LLInventoryType::EType inv_type = LLInventoryType::IT_WEARABLE; + create_inventory_item(gAgent.getID(), gAgent.getSessionID(), + parent_id, wearable->getTransactionID(), wearable->getName(), + wearable->getDescription(), asset_type, inv_type, wearable->getType(), + wearable->getPermissions().getMaskNextOwner(), + LLPointer<LLInventoryCallback>(NULL)); +} + +void LLFolderBridge::modifyOutfit(BOOL append) +{ + LLInventoryModel* model = getInventoryModel(); + if(!model) return; + LLViewerInventoryCategory* cat = getCategory(); + if(!cat) return; + + // BAP - was: + // wear_inventory_category_on_avatar( cat, append ); + LLAppearanceManager::instance().wearInventoryCategory( cat, FALSE, append ); +} + +// helper stuff +bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, LLMoveInv* move_inv) +{ + LLFloaterOpenObject::LLCatAndWear* cat_and_wear = (LLFloaterOpenObject::LLCatAndWear* )move_inv->mUserData; + LLViewerObject* object = gObjectList.findObject(move_inv->mObjectID); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + if(option == 0 && object) + { + if (cat_and_wear && cat_and_wear->mWear) + { + InventoryObjectList inventory_objects; + object->getInventoryContents(inventory_objects); + int contents_count = inventory_objects.size()-1; //subtract one for containing folder + + LLInventoryCopyAndWearObserver* inventoryObserver = new LLInventoryCopyAndWearObserver(cat_and_wear->mCatID, contents_count); + gInventory.addObserver(inventoryObserver); + } + + two_uuids_list_t::iterator move_it; + for (move_it = move_inv->mMoveList.begin(); + move_it != move_inv->mMoveList.end(); + ++move_it) + { + object->moveInventory(move_it->first, move_it->second); + } + + // update the UI. + dialog_refresh_all(); + } + + if (move_inv->mCallback) + { + move_inv->mCallback(option, move_inv->mUserData); + } + + delete move_inv; + return false; +} + +/* +Next functions intended to reorder items in the inventory folder and save order on server +Is now used for Favorites folder. + +*TODO: refactoring is needed with Favorites Bar functionality. Probably should be moved in LLInventoryModel +*/ +void saveItemsOrder(LLInventoryModel::item_array_t& items) +{ + int sortField = 0; + + // current order is saved by setting incremental values (1, 2, 3, ...) for the sort field + for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i) + { + LLViewerInventoryItem* item = *i; + + item->setSortField(++sortField); + item->setComplete(TRUE); + item->updateServer(FALSE); + + gInventory.updateItem(item); + } + + gInventory.notifyObservers(); +} + +LLInventoryModel::item_array_t::iterator findItemByUUID(LLInventoryModel::item_array_t& items, const LLUUID& id) +{ + LLInventoryModel::item_array_t::iterator result = items.end(); + + for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i) + { + if ((*i)->getUUID() == id) + { + result = i; + break; + } + } + + return result; +} + +void updateItemsOrder(LLInventoryModel::item_array_t& items, const LLUUID& srcItemId, const LLUUID& destItemId) +{ + LLViewerInventoryItem* srcItem = gInventory.getItem(srcItemId); + LLViewerInventoryItem* destItem = gInventory.getItem(destItemId); + + items.erase(findItemByUUID(items, srcItem->getUUID())); + items.insert(findItemByUUID(items, destItem->getUUID()), srcItem); +} + +BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, + BOOL drop) +{ + LLInventoryModel* model = getInventoryModel(); + if(!model || !inv_item) return FALSE; + + // cannot drag into library + if(!isAgentInventory()) + { + return FALSE; + } + + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); + if(!avatar) return FALSE; + + LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); + BOOL accept = FALSE; + LLViewerObject* object = NULL; + if(LLToolDragAndDrop::SOURCE_AGENT == source) + { + + BOOL is_movable = TRUE; + switch( inv_item->getActualType() ) + { + case LLAssetType::AT_CATEGORY: + is_movable = !LLFolderType::lookupIsProtectedType(((LLInventoryCategory*)inv_item)->getPreferredType()); + break; + default: + break; + } + + const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); + BOOL move_is_into_trash = (mUUID == trash_id) || model->isObjectDescendentOf(mUUID, trash_id); + const LLUUID current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); + BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); + BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT); + + if(is_movable && move_is_into_trash) + { + switch(inv_item->getType()) + { + case LLAssetType::AT_CLOTHING: + case LLAssetType::AT_BODYPART: + is_movable = !gAgentWearables.isWearingItem(inv_item->getUUID()); + break; + + case LLAssetType::AT_OBJECT: + is_movable = !avatar->isWearingAttachment(inv_item->getUUID()); + break; + default: + break; + } + } + + if ( is_movable ) + { + // Don't allow creating duplicates in the Calling Card/Friends + // subfolders, see bug EXT-1599. Check is item direct descendent + // of target folder and forbid item's movement if it so. + // Note: isItemDirectDescendentOfCategory checks if + // passed category is in the Calling Card/Friends folder + is_movable = ! LLFriendCardsManager::instance() + .isObjDirectDescendentOfCategory (inv_item, getCategory()); + } + + const LLUUID& favorites_id = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE); + const LLUUID& landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK); + const BOOL folder_allows_reorder = ((mUUID == landmarks_id) || (mUUID == favorites_id)); + + // we can move item inside a folder only if this folder is Favorites. See EXT-719 + accept = is_movable && ((mUUID != inv_item->getParentUUID()) || folder_allows_reorder); + if(accept && drop) + { + if (inv_item->getType() == LLAssetType::AT_GESTURE + && LLGestureManager::instance().isGestureActive(inv_item->getUUID()) && move_is_into_trash) + { + LLGestureManager::instance().deactivateGesture(inv_item->getUUID()); + } + // If an item is being dragged between windows, unselect + // everything in the active window so that we don't follow + // the selection to its new location (which is very + // annoying). + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); + if (active_panel) + { + LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get()); + if (active_panel && (panel != active_panel)) + { + active_panel->unSelectAll(); + } + } + + // if dragging from/into favorites folder only reorder items + if ((mUUID == inv_item->getParentUUID()) && folder_allows_reorder) + { + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + LLIsType is_type(LLAssetType::AT_LANDMARK); + model->collectDescendentsIf(mUUID, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_type); + + LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get()); + LLFolderViewItem* itemp = panel ? panel->getRootFolder()->getDraggingOverItem() : NULL; + if (itemp) + { + LLUUID srcItemId = inv_item->getUUID(); + LLUUID destItemId = itemp->getListener()->getUUID(); + + // update order + updateItemsOrder(items, srcItemId, destItemId); + + saveItemsOrder(items); + } + } + else if (favorites_id == mUUID) // if target is the favorites folder we use copy + { + copy_inventory_item( + gAgent.getID(), + inv_item->getPermissions().getOwner(), + inv_item->getUUID(), + mUUID, + std::string(), + LLPointer<LLInventoryCallback>(NULL)); + } + else if (move_is_into_current_outfit || move_is_into_outfit) + { + // BAP - should skip if dup. + if (move_is_into_current_outfit) + { + LLAppearanceManager::instance().addCOFItemLink(inv_item); + } + else + { + LLPointer<LLInventoryCallback> cb = NULL; + link_inventory_item( + gAgent.getID(), + inv_item->getLinkedUUID(), + mUUID, + inv_item->getName(), + LLAssetType::AT_LINK, + cb); + } + } + else + { + // restamp if the move is into the trash. + LLInvFVBridge::changeItemParent( + model, + (LLViewerInventoryItem*)inv_item, + mUUID, + move_is_into_trash); + } + } + } + else if(LLToolDragAndDrop::SOURCE_WORLD == source) + { + // Make sure the object exists. If we allowed dragging from + // anonymous objects, it would be possible to bypass + // permissions. + object = gObjectList.findObject(inv_item->getParentUUID()); + if(!object) + { + llinfos << "Object not found for drop." << llendl; + return FALSE; + } + + // coming from a task. Need to figure out if the person can + // move/copy this item. + LLPermissions perm(inv_item->getPermissions()); + BOOL is_move = FALSE; + if((perm.allowCopyBy(gAgent.getID(), gAgent.getGroupID()) + && perm.allowTransferTo(gAgent.getID()))) +// || gAgent.isGodlike()) + + { + accept = TRUE; + } + else if(object->permYouOwner()) + { + // If the object cannot be copied, but the object the + // inventory is owned by the agent, then the item can be + // moved from the task to agent inventory. + is_move = TRUE; + accept = TRUE; + } + if(drop && accept) + { + LLMoveInv* move_inv = new LLMoveInv; + move_inv->mObjectID = inv_item->getParentUUID(); + two_uuids_t item_pair(mUUID, inv_item->getUUID()); + move_inv->mMoveList.push_back(item_pair); + move_inv->mCallback = NULL; + move_inv->mUserData = NULL; + if(is_move) + { + warn_move_inventory(object, move_inv); + } + else + { + LLNotification::Params params("MoveInventoryFromObject"); + params.functor.function(boost::bind(move_task_inventory_callback, _1, _2, move_inv)); + LLNotifications::instance().forceResponse(params, 0); + } + } + + } + else if(LLToolDragAndDrop::SOURCE_NOTECARD == source) + { + accept = TRUE; + if(drop) + { + copy_inventory_from_notecard(LLToolDragAndDrop::getInstance()->getObjectID(), + LLToolDragAndDrop::getInstance()->getSourceID(), inv_item); + } + } + else if(LLToolDragAndDrop::SOURCE_LIBRARY == source) + { + LLViewerInventoryItem* item = (LLViewerInventoryItem*)inv_item; + if(item && item->isComplete()) + { + accept = TRUE; + if(drop) + { + copy_inventory_item( + gAgent.getID(), + inv_item->getPermissions().getOwner(), + inv_item->getUUID(), + mUUID, + std::string(), + LLPointer<LLInventoryCallback>(NULL)); + } + } + } + else + { + llwarns << "unhandled drag source" << llendl; + } + return accept; +} + +// +=================================================+ +// | LLScriptBridge (DEPRECTED) | +// +=================================================+ + +LLUIImagePtr LLScriptBridge::getIcon() const +{ + return get_item_icon(LLAssetType::AT_SCRIPT, LLInventoryType::IT_LSL, 0, FALSE); +} + +// +=================================================+ +// | LLTextureBridge | +// +=================================================+ + +LLUIImagePtr LLTextureBridge::getIcon() const +{ + return get_item_icon(LLAssetType::AT_TEXTURE, mInvType, 0, FALSE); +} + +void LLTextureBridge::openItem() +{ + LLViewerInventoryItem* item = getItem(); + + if (item) + { + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); + } +} + +void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + lldebugs << "LLTextureBridge::buildContextMenu()" << llendl; + std::vector<std::string> items; + std::vector<std::string> disabled_items; + if(isInTrash()) + { + items.push_back(std::string("Purge Item")); + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Purge Item")); + } + + items.push_back(std::string("Restore Item")); + } + else + { + items.push_back(std::string("Open")); + items.push_back(std::string("Properties")); + + getClipboardEntries(true, items, disabled_items, flags); + + items.push_back(std::string("Texture Separator")); + items.push_back(std::string("Save As")); + } + hide_context_entries(menu, items, disabled_items); +} + +// virtual +void LLTextureBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) +{ + if ("save_as" == action) + { + LLFloaterReg::showInstance("preview_texture", LLSD(mUUID), TAKE_FOCUS_YES); + LLPreviewTexture* preview_texture = LLFloaterReg::findTypedInstance<LLPreviewTexture>("preview_texture", mUUID); + if (preview_texture) + { + preview_texture->openToSave(); + } + } + else LLItemBridge::performAction(folder, model, action); +} + +// +=================================================+ +// | LLSoundBridge | +// +=================================================+ + +LLUIImagePtr LLSoundBridge::getIcon() const +{ + return get_item_icon(LLAssetType::AT_SOUND, LLInventoryType::IT_SOUND, 0, FALSE); +} + +void LLSoundBridge::openItem() +{ + LLViewerInventoryItem* item = getItem(); + + if (item) + { + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); + } +/* +// Changed this back to the way it USED to work: +// only open the preview dialog through the contextual right-click menu +// double-click just plays the sound + + LLViewerInventoryItem* item = getItem(); + if(item) + { + openSoundPreview((void*)this); + //send_uuid_sound_trigger(item->getAssetUUID(), 1.0); + } +*/ +} + +void LLSoundBridge::previewItem() +{ + LLViewerInventoryItem* item = getItem(); + if(item) + { + send_sound_trigger(item->getAssetUUID(), 1.0); + } +} + +void LLSoundBridge::openSoundPreview(void* which) +{ + LLSoundBridge *me = (LLSoundBridge *)which; + LLFloaterReg::showInstance("preview_sound", LLSD(me->mUUID), TAKE_FOCUS_YES); +} + +void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + lldebugs << "LLSoundBridge::buildContextMenu()" << llendl; + std::vector<std::string> items; + std::vector<std::string> disabled_items; + + if(isInTrash()) + { + items.push_back(std::string("Purge Item")); + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Purge Item")); + } + + items.push_back(std::string("Restore Item")); + } + else + { + items.push_back(std::string("Sound Open")); + items.push_back(std::string("Properties")); + + getClipboardEntries(true, items, disabled_items, flags); + } + + items.push_back(std::string("Sound Separator")); + items.push_back(std::string("Sound Play")); + + hide_context_entries(menu, items, disabled_items); +} + +// +=================================================+ +// | LLLandmarkBridge | +// +=================================================+ + +LLLandmarkBridge::LLLandmarkBridge(LLInventoryPanel* inventory, const LLUUID& uuid, U32 flags/* = 0x00*/) : +LLItemBridge(inventory, uuid) +{ + mVisited = FALSE; + if (flags & LLInventoryItem::II_FLAGS_LANDMARK_VISITED) + { + mVisited = TRUE; + } +} + +LLUIImagePtr LLLandmarkBridge::getIcon() const +{ + return get_item_icon(LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, mVisited, FALSE); +} + +void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + std::vector<std::string> items; + std::vector<std::string> disabled_items; + + lldebugs << "LLLandmarkBridge::buildContextMenu()" << llendl; + if(isInTrash()) + { + items.push_back(std::string("Purge Item")); + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Purge Item")); + } + + items.push_back(std::string("Restore Item")); + } + else + { + items.push_back(std::string("Landmark Open")); + items.push_back(std::string("Properties")); + + getClipboardEntries(true, items, disabled_items, flags); + } + + items.push_back(std::string("Landmark Separator")); + items.push_back(std::string("About Landmark")); + + // Disable "About Landmark" menu item for + // multiple landmarks selected. Only one landmark + // info panel can be shown at a time. + if ((flags & FIRST_SELECTED_ITEM) == 0) + { + disabled_items.push_back(std::string("About Landmark")); + } + + hide_context_entries(menu, items, disabled_items); +} + +// Convenience function for the two functions below. +void teleport_via_landmark(const LLUUID& asset_id) +{ + gAgent.teleportViaLandmark( asset_id ); + + // we now automatically track the landmark you're teleporting to + // because you'll probably arrive at a telehub instead + LLFloaterWorldMap* floater_world_map = LLFloaterWorldMap::getInstance(); + if( floater_world_map ) + { + floater_world_map->trackLandmark( asset_id ); + } +} + +// virtual +void LLLandmarkBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) +{ + if ("teleport" == action) + { + LLViewerInventoryItem* item = getItem(); + if(item) + { + teleport_via_landmark(item->getAssetUUID()); + } + } + else if ("about" == action) + { + LLViewerInventoryItem* item = getItem(); + if(item) + { + LLSD key; + key["type"] = "landmark"; + key["id"] = item->getUUID(); + + LLSideTray::getInstance()->showPanel("panel_places", key); + } + } + else + { + LLItemBridge::performAction(folder, model, action); + } +} + +static bool open_landmark_callback(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + LLUUID asset_id = notification["payload"]["asset_id"].asUUID(); + if (option == 0) + { + teleport_via_landmark(asset_id); + } + + return false; +} +static LLNotificationFunctorRegistration open_landmark_callback_reg("TeleportFromLandmark", open_landmark_callback); + + +void LLLandmarkBridge::openItem() +{ + LLViewerInventoryItem* item = getItem(); + + if (item) + { + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); + } +/* + LLViewerInventoryItem* item = getItem(); + if( item ) + { + // Opening (double-clicking) a landmark immediately teleports, + // but warns you the first time. + // open_landmark(item); + LLSD payload; + payload["asset_id"] = item->getAssetUUID(); + LLNotificationsUtil::add("TeleportFromLandmark", LLSD(), payload); + } +*/ +} + + +// +=================================================+ +// | LLCallingCardObserver | +// +=================================================+ +void LLCallingCardObserver::changed(U32 mask) +{ + mBridgep->refreshFolderViewItem(); +} + +// +=================================================+ +// | LLCallingCardBridge | +// +=================================================+ + +LLCallingCardBridge::LLCallingCardBridge( LLInventoryPanel* inventory, const LLUUID& uuid ) : + LLItemBridge(inventory, uuid) +{ + mObserver = new LLCallingCardObserver(this); + LLAvatarTracker::instance().addObserver(mObserver); +} + +LLCallingCardBridge::~LLCallingCardBridge() +{ + LLAvatarTracker::instance().removeObserver(mObserver); + delete mObserver; +} + +void LLCallingCardBridge::refreshFolderViewItem() +{ + LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get()); + LLFolderViewItem* itemp = panel ? panel->getRootFolder()->getItemByID(mUUID) : NULL; + if (itemp) + { + itemp->refresh(); + } +} + +// virtual +void LLCallingCardBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) +{ + if ("begin_im" == action) + { + LLViewerInventoryItem *item = getItem(); + if (item && (item->getCreatorUUID() != gAgent.getID()) && + (!item->getCreatorUUID().isNull())) + { + std::string callingcard_name; + gCacheName->getFullName(item->getCreatorUUID(), callingcard_name); + LLUUID session_id = gIMMgr->addSession(callingcard_name, IM_NOTHING_SPECIAL, item->getCreatorUUID()); + if (session_id != LLUUID::null) + { + LLIMFloater::show(session_id); + } + } + } + else if ("lure" == action) + { + LLViewerInventoryItem *item = getItem(); + if (item && (item->getCreatorUUID() != gAgent.getID()) && + (!item->getCreatorUUID().isNull())) + { + LLAvatarActions::offerTeleport(item->getCreatorUUID()); + } + } + else LLItemBridge::performAction(folder, model, action); +} + +LLUIImagePtr LLCallingCardBridge::getIcon() const +{ + BOOL online = FALSE; + LLViewerInventoryItem* item = getItem(); + if(item) + { + online = LLAvatarTracker::instance().isBuddyOnline(item->getCreatorUUID()); + } + return get_item_icon(LLAssetType::AT_CALLINGCARD, LLInventoryType::IT_CALLINGCARD, online, FALSE); +} + +std::string LLCallingCardBridge::getLabelSuffix() const +{ + LLViewerInventoryItem* item = getItem(); + if( item && LLAvatarTracker::instance().isBuddyOnline(item->getCreatorUUID()) ) + { + return LLItemBridge::getLabelSuffix() + " (online)"; + } + else + { + return LLItemBridge::getLabelSuffix(); + } +} + +void LLCallingCardBridge::openItem() +{ + LLViewerInventoryItem* item = getItem(); + + if (item) + { + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); + } +/* + LLViewerInventoryItem* item = getItem(); + if(item && !item->getCreatorUUID().isNull()) + { + LLAvatarActions::showProfile(item->getCreatorUUID()); + } +*/ +} + +void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + lldebugs << "LLCallingCardBridge::buildContextMenu()" << llendl; + std::vector<std::string> items; + std::vector<std::string> disabled_items; + + if(isInTrash()) + { + items.push_back(std::string("Purge Item")); + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Purge Item")); + } + + items.push_back(std::string("Restore Item")); + } + else + { + items.push_back(std::string("Open")); + items.push_back(std::string("Properties")); + + getClipboardEntries(true, items, disabled_items, flags); + + LLInventoryItem* item = getItem(); + BOOL good_card = (item + && (LLUUID::null != item->getCreatorUUID()) + && (item->getCreatorUUID() != gAgent.getID())); + BOOL user_online = (LLAvatarTracker::instance().isBuddyOnline(item->getCreatorUUID())); + items.push_back(std::string("Send Instant Message Separator")); + items.push_back(std::string("Send Instant Message")); + items.push_back(std::string("Offer Teleport...")); + items.push_back(std::string("Conference Chat")); + + if (!good_card) + { + disabled_items.push_back(std::string("Send Instant Message")); + } + if (!good_card || !user_online) + { + disabled_items.push_back(std::string("Offer Teleport...")); + disabled_items.push_back(std::string("Conference Chat")); + } + } + hide_context_entries(menu, items, disabled_items); +} + +BOOL LLCallingCardBridge::dragOrDrop(MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data) +{ + LLViewerInventoryItem* item = getItem(); + BOOL rv = FALSE; + if(item) + { + // check the type + switch(cargo_type) + { + case DAD_TEXTURE: + case DAD_SOUND: + case DAD_LANDMARK: + case DAD_SCRIPT: + case DAD_CLOTHING: + case DAD_OBJECT: + case DAD_NOTECARD: + case DAD_BODYPART: + case DAD_ANIMATION: + case DAD_GESTURE: + case DAD_MESH: + { + LLInventoryItem* inv_item = (LLInventoryItem*)cargo_data; + const LLPermissions& perm = inv_item->getPermissions(); + if(gInventory.getItem(inv_item->getUUID()) + && perm.allowOperationBy(PERM_TRANSFER, gAgent.getID())) + { + rv = TRUE; + if(drop) + { + LLToolDragAndDrop::giveInventory(item->getCreatorUUID(), + (LLInventoryItem*)cargo_data); + } + } + else + { + // It's not in the user's inventory (it's probably in + // an object's contents), so disallow dragging it here. + // You can't give something you don't yet have. + rv = FALSE; + } + break; + } + case DAD_CATEGORY: + { + LLInventoryCategory* inv_cat = (LLInventoryCategory*)cargo_data; + if( gInventory.getCategory( inv_cat->getUUID() ) ) + { + rv = TRUE; + if(drop) + { + LLToolDragAndDrop::giveInventoryCategory( + item->getCreatorUUID(), + inv_cat); + } + } + else + { + // It's not in the user's inventory (it's probably in + // an object's contents), so disallow dragging it here. + // You can't give something you don't yet have. + rv = FALSE; + } + break; + } + default: + break; + } + } + return rv; +} + +BOOL LLCallingCardBridge::removeItem() +{ + if (LLFriendCardsManager::instance().isItemInAnyFriendsList(getItem())) + { + LLAvatarActions::removeFriendDialog(getItem()->getCreatorUUID()); + return FALSE; + } + else + { + return LLItemBridge::removeItem(); + } +} +// +=================================================+ +// | LLNotecardBridge | +// +=================================================+ + +LLUIImagePtr LLNotecardBridge::getIcon() const +{ + return get_item_icon(LLAssetType::AT_NOTECARD, LLInventoryType::IT_NOTECARD, 0, FALSE); +} + +void LLNotecardBridge::openItem() +{ + LLViewerInventoryItem* item = getItem(); + + if (item) + { + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); + } + +/* + LLViewerInventoryItem* item = getItem(); + if (item) + { + LLFloaterReg::showInstance("preview_notecard", LLSD(item->getUUID()), TAKE_FOCUS_YES); + } +*/ +} + + +// +=================================================+ +// | LLGestureBridge | +// +=================================================+ + +LLUIImagePtr LLGestureBridge::getIcon() const +{ + return get_item_icon(LLAssetType::AT_GESTURE, LLInventoryType::IT_GESTURE, 0, FALSE); +} + +LLFontGL::StyleFlags LLGestureBridge::getLabelStyle() const +{ + if( LLGestureManager::instance().isGestureActive(mUUID) ) + { + return LLFontGL::BOLD; + } + else + { + return LLFontGL::NORMAL; + } +} + +std::string LLGestureBridge::getLabelSuffix() const +{ + if( LLGestureManager::instance().isGestureActive(mUUID) ) + { + return LLItemBridge::getLabelSuffix() + " (active)"; + } + else + { + return LLItemBridge::getLabelSuffix(); + } +} + +// virtual +void LLGestureBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) +{ + if (isAddAction(action)) + { + LLGestureManager::instance().activateGesture(mUUID); + + LLViewerInventoryItem* item = gInventory.getItem(mUUID); + if (!item) return; + + // Since we just changed the suffix to indicate (active) + // the server doesn't need to know, just the viewer. + gInventory.updateItem(item); + gInventory.notifyObservers(); + } + else if (isRemoveAction(action)) + { + LLGestureManager::instance().deactivateGesture(mUUID); + + LLViewerInventoryItem* item = gInventory.getItem(mUUID); + if (!item) return; + + // Since we just changed the suffix to indicate (active) + // the server doesn't need to know, just the viewer. + gInventory.updateItem(item); + gInventory.notifyObservers(); + } + else LLItemBridge::performAction(folder, model, action); +} + +void LLGestureBridge::openItem() +{ + LLViewerInventoryItem* item = getItem(); + + if (item) + { + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); + } +/* + LLViewerInventoryItem* item = getItem(); + if (item) + { + LLPreviewGesture* preview = LLPreviewGesture::show(mUUID, LLUUID::null); + preview->setFocus(TRUE); + } +*/ +} + +BOOL LLGestureBridge::removeItem() +{ + // Force close the preview window, if it exists + LLGestureManager::instance().deactivateGesture(mUUID); + return LLItemBridge::removeItem(); +} + +void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + lldebugs << "LLGestureBridge::buildContextMenu()" << llendl; + std::vector<std::string> items; + std::vector<std::string> disabled_items; + if(isInTrash()) + { + items.push_back(std::string("Purge Item")); + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Purge Item")); + } + + items.push_back(std::string("Restore Item")); + } + else + { + items.push_back(std::string("Open")); + items.push_back(std::string("Properties")); + + getClipboardEntries(true, items, disabled_items, flags); + + items.push_back(std::string("Gesture Separator")); + if (LLGestureManager::instance().isGestureActive(getUUID())) + { + items.push_back(std::string("Deactivate")); + } + else + { + items.push_back(std::string("Activate")); + } + } + hide_context_entries(menu, items, disabled_items); +} + +// +=================================================+ +// | LLAnimationBridge | +// +=================================================+ + +LLUIImagePtr LLAnimationBridge::getIcon() const +{ + return get_item_icon(LLAssetType::AT_ANIMATION, LLInventoryType::IT_ANIMATION, 0, FALSE); +} + +void LLAnimationBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + std::vector<std::string> items; + std::vector<std::string> disabled_items; + + lldebugs << "LLAnimationBridge::buildContextMenu()" << llendl; + if(isInTrash()) + { + items.push_back(std::string("Purge Item")); + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Purge Item")); + } + + items.push_back(std::string("Restore Item")); + } + else + { + items.push_back(std::string("Animation Open")); + items.push_back(std::string("Properties")); + + getClipboardEntries(true, items, disabled_items, flags); + } + + items.push_back(std::string("Animation Separator")); + items.push_back(std::string("Animation Play")); + items.push_back(std::string("Animation Audition")); + + hide_context_entries(menu, items, disabled_items); + +} + +// virtual +void LLAnimationBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) +{ + if ((action == "playworld") || (action == "playlocal")) + { + if (getItem()) + { + LLPreviewAnim::e_activation_type activate = LLPreviewAnim::NONE; + if ("playworld" == action) activate = LLPreviewAnim::PLAY; + if ("playlocal" == action) activate = LLPreviewAnim::AUDITION; + + LLPreviewAnim* preview = LLFloaterReg::showTypedInstance<LLPreviewAnim>("preview_anim", LLSD(mUUID)); + if (preview) + { + preview->activate(activate); + } + } + } + else + { + LLItemBridge::performAction(folder, model, action); + } +} + +void LLAnimationBridge::openItem() +{ + LLViewerInventoryItem* item = getItem(); + + if (item) + { + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); + } +/* + LLViewerInventoryItem* item = getItem(); + if (item) + { + LLFloaterReg::showInstance("preview_anim", LLSD(mUUID), TAKE_FOCUS_YES); + } +*/ +} + +// +=================================================+ +// | LLObjectBridge | +// +=================================================+ + +// static +LLUUID LLObjectBridge::sContextMenuItemID; + +LLObjectBridge::LLObjectBridge(LLInventoryPanel* inventory, const LLUUID& uuid, LLInventoryType::EType type, U32 flags) : +LLItemBridge(inventory, uuid), mInvType(type) +{ + mAttachPt = (flags & 0xff); // low bye of inventory flags + + mIsMultiObject = ( flags & LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS ) ? TRUE: FALSE; +} + +LLUIImagePtr LLObjectBridge::getIcon() const +{ + return get_item_icon(LLAssetType::AT_OBJECT, mInvType, mAttachPt, mIsMultiObject ); +} + +LLInventoryObject* LLObjectBridge::getObject() const +{ + LLInventoryObject* object = NULL; + LLInventoryModel* model = getInventoryModel(); + if(model) + { + object = (LLInventoryObject*)model->getObject(mUUID); + } + return object; +} + +// virtual +void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) +{ + if (isAddAction(action)) + { + LLUUID object_id = mUUID; + LLViewerInventoryItem* item; + item = (LLViewerInventoryItem*)gInventory.getItem(object_id); + if(item && gInventory.isObjectDescendentOf(object_id, gInventory.getRootFolderID())) + { + rez_attachment(item, NULL); + } + else if(item && item->isComplete()) + { + // must be in library. copy it to our inventory and put it on. + LLPointer<LLInventoryCallback> cb = new RezAttachmentCallback(0); + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + LLUUID::null, + std::string(), + cb); + } + gFocusMgr.setKeyboardFocus(NULL); + } + else if (isRemoveAction(action)) + { + LLInventoryItem* item = gInventory.getItem(mUUID); + if(item) + { + gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); + gMessageSystem->nextBlockFast(_PREHASH_ObjectData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + gMessageSystem->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID()); + gMessageSystem->sendReliable( gAgent.getRegion()->getHost()); + } + // this object might have been selected, so let the selection manager know it's gone now + LLViewerObject *found_obj = gObjectList.findObject(item->getLinkedUUID()); + if (found_obj) + { + LLSelectMgr::getInstance()->remove(found_obj); + } + } + else LLItemBridge::performAction(folder, model, action); +} + +void LLObjectBridge::openItem() +{ + LLViewerInventoryItem* item = getItem(); + + if (item) + { + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); + } + + LLSD key; + key["id"] = mUUID; + LLSideTray::getInstance()->showPanel("sidepanel_inventory", key); + + // Disable old properties floater; this is replaced by the sidepanel. + /* + LLFloaterReg::showInstance("properties", mUUID); + */ +} + +LLFontGL::StyleFlags LLObjectBridge::getLabelStyle() const +{ + U8 font = LLFontGL::NORMAL; + + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); + if( avatar && avatar->isWearingAttachment( mUUID ) ) + { + font |= LLFontGL::BOLD; + } + + LLInventoryItem* item = getItem(); + if (item && item->getIsLinkType()) + { + font |= LLFontGL::ITALIC; + } + + return (LLFontGL::StyleFlags)font; +} + +std::string LLObjectBridge::getLabelSuffix() const +{ + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); + if( avatar && avatar->isWearingAttachment( mUUID ) ) + { + std::string attachment_point_name = avatar->getAttachedPointName(mUUID); + + // e.g. "(worn on ...)" / "(attached to ...)" + LLStringUtil::format_map_t args; + args["[ATTACHMENT_POINT]"] = attachment_point_name.c_str(); + return LLItemBridge::getLabelSuffix() + LLTrans::getString("WornOnAttachmentPoint", args); + } + else + { + return LLItemBridge::getLabelSuffix(); + } +} + +void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment) +{ + LLSD payload; + payload["item_id"] = item->getLinkedUUID(); // Wear the base object in case this is a link. + + S32 attach_pt = 0; + if (gAgent.getAvatarObject() && attachment) + { + for (LLVOAvatar::attachment_map_t::iterator iter = gAgent.getAvatarObject()->mAttachmentPoints.begin(); + iter != gAgent.getAvatarObject()->mAttachmentPoints.end(); ++iter) + { + if (iter->second == attachment) + { + attach_pt = iter->first; + break; + } + } + } + + payload["attachment_point"] = attach_pt; + +#if !ENABLE_MULTIATTACHMENTS + if (attachment && attachment->getNumObjects() > 0) + { + LLNotificationsUtil::add("ReplaceAttachment", LLSD(), payload, confirm_replace_attachment_rez); + } + else +#endif + { + LLNotifications::instance().forceResponse(LLNotification::Params("ReplaceAttachment").payload(payload), 0/*YES*/); + } +} + +bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& response) +{ + LLVOAvatar *avatarp = gAgent.getAvatarObject(); + + if (!avatarp->canAttachMoreObjects()) + { + LLSD args; + args["MAX_ATTACHMENTS"] = llformat("%d", MAX_AGENT_ATTACHMENTS); + LLNotificationsUtil::add("MaxAttachmentsOnOutfit", args); + return false; + } + + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0/*YES*/) + { + LLViewerInventoryItem* itemp = gInventory.getItem(notification["payload"]["item_id"].asUUID()); + + if (itemp) + { + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_RezSingleAttachmentFromInv); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast(_PREHASH_ObjectData); + msg->addUUIDFast(_PREHASH_ItemID, itemp->getUUID()); + msg->addUUIDFast(_PREHASH_OwnerID, itemp->getPermissions().getOwner()); + U8 attachment_pt = notification["payload"]["attachment_point"].asInteger(); +#if ENABLE_MULTIATTACHMENTS + attachment_pt |= ATTACHMENT_ADD; +#endif + msg->addU8Fast(_PREHASH_AttachmentPt, attachment_pt); + pack_permissions_slam(msg, itemp->getFlags(), itemp->getPermissions()); + msg->addStringFast(_PREHASH_Name, itemp->getName()); + msg->addStringFast(_PREHASH_Description, itemp->getDescription()); + msg->sendReliable(gAgent.getRegion()->getHost()); + } + } + return false; +} +static LLNotificationFunctorRegistration confirm_replace_attachment_rez_reg("ReplaceAttachment", confirm_replace_attachment_rez); + +void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + std::vector<std::string> items; + std::vector<std::string> disabled_items; + if(isInTrash()) + { + items.push_back(std::string("Purge Item")); + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Purge Item")); + } + + items.push_back(std::string("Restore Item")); + } + else + { + items.push_back(std::string("Properties")); + + LLInventoryItem *item = getItem(); + getClipboardEntries(true, items, disabled_items, flags); + + LLObjectBridge::sContextMenuItemID = mUUID; + + if(item) + { + LLVOAvatarSelf* avatarp = gAgent.getAvatarObject(); + if( !avatarp ) + { + return; + } + + if( avatarp->isWearingAttachment( mUUID ) ) + { + items.push_back(std::string("Detach From Yourself")); + } + else + if( !isInTrash() && !isLinkedObjectInTrash() && !isLinkedObjectMissing()) + { + items.push_back(std::string("Attach Separator")); + items.push_back(std::string("Object Wear")); + items.push_back(std::string("Attach To")); + items.push_back(std::string("Attach To HUD")); + // commented out for DEV-32347 + //items.push_back(std::string("Restore to Last Position")); + + if (!avatarp->canAttachMoreObjects()) + { + disabled_items.push_back(std::string("Object Wear")); + disabled_items.push_back(std::string("Attach To")); + disabled_items.push_back(std::string("Attach To HUD")); + } + LLMenuGL* attach_menu = menu.findChildMenuByName("Attach To", TRUE); + LLMenuGL* attach_hud_menu = menu.findChildMenuByName("Attach To HUD", TRUE); + LLVOAvatar *avatarp = gAgent.getAvatarObject(); + if (attach_menu + && (attach_menu->getChildCount() == 0) + && attach_hud_menu + && (attach_hud_menu->getChildCount() == 0) + && avatarp) + { + for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin(); + iter != avatarp->mAttachmentPoints.end(); ) + { + LLVOAvatar::attachment_map_t::iterator curiter = iter++; + LLViewerJointAttachment* attachment = curiter->second; + LLMenuItemCallGL::Params p; + std::string submenu_name = attachment->getName(); + if (LLTrans::getString(submenu_name) != "") + { + p.name = (" ")+LLTrans::getString(submenu_name)+" "; + } + else + { + p.name = submenu_name; + } + LLSD cbparams; + cbparams["index"] = curiter->first; + cbparams["label"] = attachment->getName(); + p.on_click.function_name = "Inventory.AttachObject"; + p.on_click.parameter = LLSD(attachment->getName()); + p.on_enable.function_name = "Attachment.Label"; + p.on_enable.parameter = cbparams; + LLView* parent = attachment->getIsHUDAttachment() ? attach_hud_menu : attach_menu; + LLUICtrlFactory::create<LLMenuItemCallGL>(p, parent); + } + } + } + } + } + hide_context_entries(menu, items, disabled_items); +} + +BOOL LLObjectBridge::renameItem(const std::string& new_name) +{ + if(!isItemRenameable()) + return FALSE; + LLPreview::dirty(mUUID); + LLInventoryModel* model = getInventoryModel(); + if(!model) + return FALSE; + LLViewerInventoryItem* item = getItem(); + if(item && (item->getName() != new_name)) + { + LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); + new_item->rename(new_name); + buildDisplayName(new_item, mDisplayName); + new_item->updateServer(FALSE); + model->updateItem(new_item); + + model->notifyObservers(); + + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); + if( avatar ) + { + LLViewerObject* obj = avatar->getWornAttachment( item->getUUID() ); + if( obj ) + { + LLSelectMgr::getInstance()->deselectAll(); + LLSelectMgr::getInstance()->addAsIndividual( obj, SELECT_ALL_TES, FALSE ); + LLSelectMgr::getInstance()->selectionSetObjectName( new_name ); + LLSelectMgr::getInstance()->deselectAll(); + } + } + } + // return FALSE because we either notified observers (& therefore + // rebuilt) or we didn't update. + return FALSE; +} + +// +=================================================+ +// | LLLSLTextBridge | +// +=================================================+ + +LLUIImagePtr LLLSLTextBridge::getIcon() const +{ + return get_item_icon(LLAssetType::AT_SCRIPT, LLInventoryType::IT_LSL, 0, FALSE); +} + +void LLLSLTextBridge::openItem() +{ + LLViewerInventoryItem* item = getItem(); + + if (item) + { + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); + } + /* + LLViewerInventoryItem* item = getItem(); + if (item) + { + LLFloaterReg::showInstance("preview_script", LLSD(mUUID), TAKE_FOCUS_YES); + } + */ +} + +// +=================================================+ +// | LLWearableBridge | +// +=================================================+ + +// *NOTE: hack to get from avatar inventory to avatar +void wear_inventory_item_on_avatar( LLInventoryItem* item ) +{ + if(item) + { + lldebugs << "wear_inventory_item_on_avatar( " << item->getName() + << " )" << llendl; + + LLAppearanceManager::instance().addCOFItemLink(item); + } +} + +void wear_add_inventory_item_on_avatar( LLInventoryItem* item ) +{ + if(item) + { + lldebugs << "wear_add_inventory_item_on_avatar( " << item->getName() + << " )" << llendl; + + LLWearableList::instance().getAsset(item->getAssetUUID(), + item->getName(), + item->getType(), + LLWearableBridge::onWearAddOnAvatarArrived, + new LLUUID(item->getUUID())); + } +} + +void remove_inventory_category_from_avatar( LLInventoryCategory* category ) +{ + if(!category) return; + lldebugs << "remove_inventory_category_from_avatar( " << category->getName() + << " )" << llendl; + + + if( gFloaterCustomize ) + { + gFloaterCustomize->askToSaveIfDirty( + boost::bind(remove_inventory_category_from_avatar_step2, _1, category->getUUID())); + } + else + { + remove_inventory_category_from_avatar_step2(TRUE, category->getUUID() ); + } +} + +struct OnRemoveStruct +{ + LLUUID mUUID; + OnRemoveStruct(const LLUUID& uuid): + mUUID(uuid) + { + } +}; + +void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_id) +{ + + // Find all the wearables that are in the category's subtree. + lldebugs << "remove_inventory_category_from_avatar_step2()" << llendl; + if(proceed) + { + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; + LLFindWearables is_wearable; + gInventory.collectDescendentsIf(category_id, + cat_array, + item_array, + LLInventoryModel::EXCLUDE_TRASH, + is_wearable); + S32 i; + S32 wearable_count = item_array.count(); + + LLInventoryModel::cat_array_t obj_cat_array; + LLInventoryModel::item_array_t obj_item_array; + LLIsType is_object( LLAssetType::AT_OBJECT ); + gInventory.collectDescendentsIf(category_id, + obj_cat_array, + obj_item_array, + LLInventoryModel::EXCLUDE_TRASH, + is_object); + S32 obj_count = obj_item_array.count(); + + // Find all gestures in this folder + LLInventoryModel::cat_array_t gest_cat_array; + LLInventoryModel::item_array_t gest_item_array; + LLIsType is_gesture( LLAssetType::AT_GESTURE ); + gInventory.collectDescendentsIf(category_id, + gest_cat_array, + gest_item_array, + LLInventoryModel::EXCLUDE_TRASH, + is_gesture); + S32 gest_count = gest_item_array.count(); + + if (wearable_count > 0) //Loop through wearables. If worn, remove. + { + for(i = 0; i < wearable_count; ++i) + { + LLViewerInventoryItem *item = item_array.get(i); + if (item->getType() == LLAssetType::AT_BODYPART) + continue; + if (gAgent.isTeen() && item->isWearableType() && + (item->getWearableType() == WT_UNDERPANTS || item->getWearableType() == WT_UNDERSHIRT)) + continue; + if( gAgentWearables.isWearingItem (item->getLinkedUUID()) ) + { + LLWearableList::instance().getAsset(item->getAssetUUID(), + item->getName(), + item->getType(), + LLWearableBridge::onRemoveFromAvatarArrived, + new OnRemoveStruct(item->getLinkedUUID())); + } + } + } + + if (obj_count > 0) + { + for(i = 0; i < obj_count; ++i) + { + LLViewerInventoryItem *obj_item = obj_item_array.get(i); + gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); + gMessageSystem->nextBlockFast(_PREHASH_ObjectData ); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); + gMessageSystem->addUUIDFast(_PREHASH_ItemID, obj_item->getLinkedUUID() ); + + gMessageSystem->sendReliable( gAgent.getRegion()->getHost() ); + + // this object might have been selected, so let the selection manager know it's gone now + LLViewerObject *found_obj = gObjectList.findObject( obj_item->getLinkedUUID()); + if (found_obj) + { + LLSelectMgr::getInstance()->remove(found_obj); + } + } + } + + if (gest_count > 0) + { + for(i = 0; i < gest_count; ++i) + { + LLViewerInventoryItem *gest_item = gest_item_array.get(i); + if ( LLGestureManager::instance().isGestureActive( gest_item->getLinkedUUID()) ) + { + LLGestureManager::instance().deactivateGesture( gest_item->getLinkedUUID() ); + gInventory.updateItem( gest_item ); + gInventory.notifyObservers(); + } + + } + } + } +} + +BOOL LLWearableBridge::renameItem(const std::string& new_name) +{ + if( gAgentWearables.isWearingItem( mUUID ) ) + { + gAgentWearables.setWearableName( mUUID, new_name ); + } + return LLItemBridge::renameItem(new_name); +} + +std::string LLWearableBridge::getLabelSuffix() const +{ + if( gAgentWearables.isWearingItem( mUUID ) ) + { + // e.g. "(worn)" + return LLItemBridge::getLabelSuffix() + LLTrans::getString("worn"); + } + else + { + return LLItemBridge::getLabelSuffix(); + } +} + +LLUIImagePtr LLWearableBridge::getIcon() const +{ + return get_item_icon(mAssetType, mInvType, mWearableType, FALSE); +} + +// virtual +void LLWearableBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) +{ + if (isAddAction(action)) + { + wearOnAvatar(); + } + else if ("wear_add" == action) + { + wearAddOnAvatar(); + } + else if ("edit" == action) + { + editOnAvatar(); + return; + } + else if (isRemoveAction(action)) + { + if(gAgentWearables.isWearingItem(mUUID)) + { + LLViewerInventoryItem* item = getItem(); + if (item) + { + LLWearableList::instance().getAsset(item->getAssetUUID(), + item->getName(), + item->getType(), + LLWearableBridge::onRemoveFromAvatarArrived, + new OnRemoveStruct(mUUID)); + } + } + } + else LLItemBridge::performAction(folder, model, action); +} + +void LLWearableBridge::openItem() +{ + LLViewerInventoryItem* item = getItem(); + + if (item) + { + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); + } + /* + if( isInTrash() ) + { + LLNotificationsUtil::add("CannotWearTrash"); + } + else if(isAgentInventory()) + { + if( !gAgentWearables.isWearingItem( mUUID ) ) + { + wearOnAvatar(); + } + } + else + { + // must be in the inventory library. copy it to our inventory + // and put it on right away. + LLViewerInventoryItem* item = getItem(); + if(item && item->isComplete()) + { + LLPointer<LLInventoryCallback> cb = new WearOnAvatarCallback(); + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + LLUUID::null, + std::string(), + cb); + } + else if(item) + { + // *TODO: We should fetch the item details, and then do + // the operation above. + LLNotificationsUtil::add("CannotWearInfoNotComplete"); + } + } + */ +} + +void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + lldebugs << "LLWearableBridge::buildContextMenu()" << llendl; + std::vector<std::string> items; + std::vector<std::string> disabled_items; + if(isInTrash()) + { + items.push_back(std::string("Purge Item")); + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Purge Item")); + } + + items.push_back(std::string("Restore Item")); + } + else + { // FWIW, it looks like SUPPRESS_OPEN_ITEM is not set anywhere + BOOL can_open = ((flags & SUPPRESS_OPEN_ITEM) != SUPPRESS_OPEN_ITEM); + + // If we have clothing, don't add "Open" as it's the same action as "Wear" SL-18976 + LLViewerInventoryItem* item = getItem(); + if (can_open && item) + { + can_open = (item->getType() != LLAssetType::AT_CLOTHING) && + (item->getType() != LLAssetType::AT_BODYPART); + } + if (isLinkedObjectMissing()) + { + can_open = FALSE; + } + if (can_open) + { + items.push_back(std::string("Open")); + } + + items.push_back(std::string("Properties")); + + getClipboardEntries(true, items, disabled_items, flags); + + items.push_back(std::string("Wearable Separator")); + + items.push_back(std::string("Wearable Wear")); + items.push_back(std::string("Wearable Add")); + items.push_back(std::string("Wearable Edit")); + + if ((flags & FIRST_SELECTED_ITEM) == 0) + { + disabled_items.push_back(std::string("Wearable Edit")); + } + // Don't allow items to be worn if their baseobj is in the trash. + if (isLinkedObjectInTrash() || isLinkedObjectMissing()) + { + disabled_items.push_back(std::string("Wearable Wear")); + disabled_items.push_back(std::string("Wearable Add")); + disabled_items.push_back(std::string("Wearable Edit")); + } + + // Disable wear and take off based on whether the item is worn. + if(item) + { + switch (item->getType()) + { + case LLAssetType::AT_CLOTHING: + items.push_back(std::string("Take Off")); + case LLAssetType::AT_BODYPART: + if (gAgentWearables.isWearingItem(item->getUUID())) + { + disabled_items.push_back(std::string("Wearable Wear")); + disabled_items.push_back(std::string("Wearable Add")); + } + else + { + disabled_items.push_back(std::string("Take Off")); + } + break; + default: + break; + } + } + } + hide_context_entries(menu, items, disabled_items); +} + +// Called from menus +// static +BOOL LLWearableBridge::canWearOnAvatar(void* user_data) +{ + LLWearableBridge* self = (LLWearableBridge*)user_data; + if(!self) return FALSE; + if(!self->isAgentInventory()) + { + LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->getItem(); + if(!item || !item->isComplete()) return FALSE; + } + return (!gAgentWearables.isWearingItem(self->mUUID)); +} + +// Called from menus +// static +void LLWearableBridge::onWearOnAvatar(void* user_data) +{ + LLWearableBridge* self = (LLWearableBridge*)user_data; + if(!self) return; + self->wearOnAvatar(); +} + +void LLWearableBridge::wearOnAvatar() +{ + // Don't wear anything until initial wearables are loaded, can + // destroy clothing items. + if (!gAgentWearables.areWearablesLoaded()) + { + LLNotificationsUtil::add("CanNotChangeAppearanceUntilLoaded"); + return; + } + + LLViewerInventoryItem* item = getItem(); + if(item) + { + if(!isAgentInventory()) + { + LLPointer<LLInventoryCallback> cb = new WearOnAvatarCallback(); + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + LLUUID::null, + std::string(), + cb); + } + else + { + wear_inventory_item_on_avatar(item); + } + } +} + +void LLWearableBridge::wearAddOnAvatar() +{ + // Don't wear anything until initial wearables are loaded, can + // destroy clothing items. + if (!gAgentWearables.areWearablesLoaded()) + { + LLNotificationsUtil::add("CanNotChangeAppearanceUntilLoaded"); + return; + } + + LLViewerInventoryItem* item = getItem(); + if(item) + { + if(!isAgentInventory()) + { + LLPointer<LLInventoryCallback> cb = new WearOnAvatarCallback(); + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + LLUUID::null, + std::string(), + cb); + } + else + { + wear_add_inventory_item_on_avatar(item); + } + } +} + +// static +void LLWearableBridge::onWearOnAvatarArrived( LLWearable* wearable, void* userdata ) +{ + LLUUID* item_id = (LLUUID*) userdata; + if(wearable) + { + LLViewerInventoryItem* item = NULL; + item = (LLViewerInventoryItem*)gInventory.getItem(*item_id); + if(item) + { + if(item->getAssetUUID() == wearable->getAssetID()) + { + gAgentWearables.setWearableItem(item, wearable); + gInventory.notifyObservers(); + //self->getFolderItem()->refreshFromRoot(); + } + else + { + llinfos << "By the time wearable asset arrived, its inv item already pointed to a different asset." << llendl; + } + } + } + delete item_id; +} + +// static +// BAP remove the "add" code path once everything is fully COF-ified. +void LLWearableBridge::onWearAddOnAvatarArrived( LLWearable* wearable, void* userdata ) +{ + LLUUID* item_id = (LLUUID*) userdata; + if(wearable) + { + LLViewerInventoryItem* item = NULL; + item = (LLViewerInventoryItem*)gInventory.getItem(*item_id); + if(item) + { + if(item->getAssetUUID() == wearable->getAssetID()) + { + bool do_append = true; + gAgentWearables.setWearableItem(item, wearable, do_append); + gInventory.notifyObservers(); + //self->getFolderItem()->refreshFromRoot(); + } + else + { + llinfos << "By the time wearable asset arrived, its inv item already pointed to a different asset." << llendl; + } + } + } + delete item_id; +} + +// static +BOOL LLWearableBridge::canEditOnAvatar(void* user_data) +{ + LLWearableBridge* self = (LLWearableBridge*)user_data; + if(!self) return FALSE; + + return (gAgentWearables.isWearingItem(self->mUUID)); +} + +// static +void LLWearableBridge::onEditOnAvatar(void* user_data) +{ + LLWearableBridge* self = (LLWearableBridge*)user_data; + if(self) + { + self->editOnAvatar(); + } +} + +void LLWearableBridge::editOnAvatar() +{ + const LLWearable* wearable = gAgentWearables.getWearableFromItemID(mUUID); + if( wearable ) + { + // Set the tab to the right wearable. + if (gFloaterCustomize) + gFloaterCustomize->setCurrentWearableType( wearable->getType() ); + + if( CAMERA_MODE_CUSTOMIZE_AVATAR != gAgent.getCameraMode() ) + { + // Start Avatar Customization + gAgent.changeCameraToCustomizeAvatar(); + } + } +} + +// static +BOOL LLWearableBridge::canRemoveFromAvatar(void* user_data) +{ + LLWearableBridge* self = (LLWearableBridge*)user_data; + if( self && (LLAssetType::AT_BODYPART != self->mAssetType) ) + { + return gAgentWearables.isWearingItem( self->mUUID ); + } + return FALSE; +} + +// static +void LLWearableBridge::onRemoveFromAvatar(void* user_data) +{ + LLWearableBridge* self = (LLWearableBridge*)user_data; + if(!self) return; + if(gAgentWearables.isWearingItem(self->mUUID)) + { + LLViewerInventoryItem* item = self->getItem(); + if (item) + { + LLUUID parent_id = item->getParentUUID(); + LLWearableList::instance().getAsset(item->getAssetUUID(), + item->getName(), + item->getType(), + onRemoveFromAvatarArrived, + new OnRemoveStruct(LLUUID(self->mUUID))); + } + } +} + +// static +void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable, + void* userdata) +{ + OnRemoveStruct *on_remove_struct = (OnRemoveStruct*) userdata; + const LLUUID &item_id = gInventory.getLinkedItemID(on_remove_struct->mUUID); + if(wearable) + { + if( gAgentWearables.isWearingItem( item_id ) ) + { + EWearableType type = wearable->getType(); + + if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR || type==WT_EYES ) ) //&& + //!((!gAgent.isTeen()) && ( type==WT_UNDERPANTS || type==WT_UNDERSHIRT )) ) + { + // MULTI_WEARABLE: FIXME HACK - always remove all + bool do_remove_all = false; + gAgentWearables.removeWearable( type, do_remove_all, 0 ); + } + } + } + + // Find and remove this item from the COF. + LLInventoryModel::item_array_t items = gInventory.collectLinkedItems(item_id, LLAppearanceManager::instance().getCOF()); + llassert(items.size() == 1); // Should always have one and only one item linked to this in the COF. + for (LLInventoryModel::item_array_t::const_iterator iter = items.begin(); + iter != items.end(); + ++iter) + { + const LLViewerInventoryItem *linked_item = (*iter); + const LLUUID &item_id = linked_item->getUUID(); + gInventory.purgeObject(item_id); + } + gInventory.notifyObservers(); + + delete on_remove_struct; +} + + +// +=================================================+ +// | LLMeshBridge | +// +=================================================+ + +LLUIImagePtr LLMeshBridge::getIcon() const +{ + return get_item_icon(LLAssetType::AT_MESH, LLInventoryType::IT_MESH, 0, FALSE); +} + +void LLMeshBridge::openItem() +{ + LLViewerInventoryItem* item = getItem(); + + if (item) + { + // open mesh + } +} + +void LLMeshBridge::previewItem() +{ + LLViewerInventoryItem* item = getItem(); + if(item) + { + // preview mesh + } +} + + +void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + lldebugs << "LLMeshBridge::buildContextMenu()" << llendl; + std::vector<std::string> items; + std::vector<std::string> disabled_items; + + if(isInTrash()) + { + items.push_back(std::string("Purge Item")); + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Purge Item")); + } + + items.push_back(std::string("Restore Item")); + } + else + { + items.push_back(std::string("Properties")); + + getClipboardEntries(true, items, disabled_items, flags); + } + + + hide_context_entries(menu, items, disabled_items); +} + + + +LLInvFVBridgeAction* LLInvFVBridgeAction::createAction(LLAssetType::EType asset_type, + const LLUUID& uuid,LLInventoryModel* model) +{ + LLInvFVBridgeAction* action = NULL; + switch(asset_type) + { + case LLAssetType::AT_TEXTURE: + action = new LLTextureBridgeAction(uuid,model); + break; + + case LLAssetType::AT_SOUND: + action = new LLSoundBridgeAction(uuid,model); + break; + + case LLAssetType::AT_LANDMARK: + action = new LLLandmarkBridgeAction(uuid,model); + break; + + case LLAssetType::AT_CALLINGCARD: + action = new LLCallingCardBridgeAction(uuid,model); + break; + + case LLAssetType::AT_OBJECT: + action = new LLObjectBridgeAction(uuid,model); + break; + + case LLAssetType::AT_NOTECARD: + action = new LLNotecardBridgeAction(uuid,model); + break; + + case LLAssetType::AT_ANIMATION: + action = new LLAnimationBridgeAction(uuid,model); + break; + + case LLAssetType::AT_GESTURE: + action = new LLGestureBridgeAction(uuid,model); + break; + + case LLAssetType::AT_LSL_TEXT: + action = new LLLSLTextBridgeAction(uuid,model); + break; + + case LLAssetType::AT_CLOTHING: + case LLAssetType::AT_BODYPART: + action = new LLWearableBridgeAction(uuid,model); + + break; + + case LLAssetType::AT_MESH: + action = new LLMeshBridgeAction(uuid,model); + break; + + + + default: + break; + } + return action; +} + +//static +void LLInvFVBridgeAction::doAction(LLAssetType::EType asset_type, + const LLUUID& uuid,LLInventoryModel* model) +{ + LLInvFVBridgeAction* action = createAction(asset_type,uuid,model); + if(action) + { + action->doIt(); + delete action; + } +} + +//static +void LLInvFVBridgeAction::doAction(const LLUUID& uuid, LLInventoryModel* model) +{ + LLAssetType::EType asset_type = model->getItem(uuid)->getType(); + LLInvFVBridgeAction* action = createAction(asset_type,uuid,model); + if(action) + { + action->doIt(); + delete action; + } +} + +LLViewerInventoryItem* LLInvFVBridgeAction::getItem() const +{ + if(mModel) + return (LLViewerInventoryItem*)mModel->getItem(mUUID); + return NULL; +} + +//virtual +void LLTextureBridgeAction::doIt() +{ + if (getItem()) + { + LLFloaterReg::showInstance("preview_texture", LLSD(mUUID), TAKE_FOCUS_YES); + } + + LLInvFVBridgeAction::doIt(); +} + +//virtual +void LLSoundBridgeAction::doIt() +{ + LLViewerInventoryItem* item = getItem(); + if(item) + { + LLFloaterReg::showInstance("preview_sound", LLSD(mUUID), TAKE_FOCUS_YES); + } + + LLInvFVBridgeAction::doIt(); +} + + +//virtual +void LLLandmarkBridgeAction::doIt() +{ + LLViewerInventoryItem* item = getItem(); + if( item ) + { + // Opening (double-clicking) a landmark immediately teleports, + // but warns you the first time. + LLSD payload; + payload["asset_id"] = item->getAssetUUID(); + LLNotificationsUtil::add("TeleportFromLandmark", LLSD(), payload); + } + + LLInvFVBridgeAction::doIt(); +} + + +//virtual +void LLCallingCardBridgeAction::doIt() +{ + LLViewerInventoryItem* item = getItem(); + if(item && item->getCreatorUUID().notNull()) + { + LLAvatarActions::showProfile(item->getCreatorUUID()); + } + + LLInvFVBridgeAction::doIt(); +} + +//virtual +void +LLNotecardBridgeAction::doIt() +{ + LLViewerInventoryItem* item = getItem(); + if (item) + { + LLFloaterReg::showInstance("preview_notecard", LLSD(item->getUUID()), TAKE_FOCUS_YES); + } + + LLInvFVBridgeAction::doIt(); +} + +//virtual +void LLGestureBridgeAction::doIt() +{ + LLViewerInventoryItem* item = getItem(); + if (item) + { + LLPreviewGesture* preview = LLPreviewGesture::show(mUUID, LLUUID::null); + preview->setFocus(TRUE); + } + + LLInvFVBridgeAction::doIt(); +} + +//virtual +void LLAnimationBridgeAction::doIt() +{ + LLViewerInventoryItem* item = getItem(); + if (item) + { + LLFloaterReg::showInstance("preview_anim", LLSD(mUUID), TAKE_FOCUS_YES); + } + + LLInvFVBridgeAction::doIt(); +} + + +//virtual +void LLObjectBridgeAction::doIt() +{ + LLFloaterReg::showInstance("properties", mUUID); + + LLInvFVBridgeAction::doIt(); +} + + +//virtual +void LLLSLTextBridgeAction::doIt() +{ + LLViewerInventoryItem* item = getItem(); + if (item) + { + LLFloaterReg::showInstance("preview_script", LLSD(mUUID), TAKE_FOCUS_YES); + } + + LLInvFVBridgeAction::doIt(); +} + + +BOOL LLWearableBridgeAction::isInTrash() const +{ + if(!mModel) return FALSE; + const LLUUID trash_id = mModel->findCategoryUUIDForType(LLFolderType::FT_TRASH); + return mModel->isObjectDescendentOf(mUUID, trash_id); +} + +BOOL LLWearableBridgeAction::isAgentInventory() const +{ + if(!mModel) return FALSE; + if(gInventory.getRootFolderID() == mUUID) return TRUE; + return mModel->isObjectDescendentOf(mUUID, gInventory.getRootFolderID()); +} + +void LLWearableBridgeAction::wearOnAvatar() +{ + // Don't wear anything until initial wearables are loaded, can + // destroy clothing items. + if (!gAgentWearables.areWearablesLoaded()) + { + LLNotificationsUtil::add("CanNotChangeAppearanceUntilLoaded"); + return; + } + + LLViewerInventoryItem* item = getItem(); + if(item) + { + if(!isAgentInventory()) + { + LLPointer<LLInventoryCallback> cb = new WearOnAvatarCallback(); + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + LLUUID::null, + std::string(), + cb); + } + else + { + wear_inventory_item_on_avatar(item); + } + } +} + +//virtual +void LLWearableBridgeAction::doIt() +{ + if(isInTrash()) + { + LLNotificationsUtil::add("CannotWearTrash"); + } + else if(isAgentInventory()) + { + if(!gAgentWearables.isWearingItem(mUUID)) + { + wearOnAvatar(); + } + } + else + { + // must be in the inventory library. copy it to our inventory + // and put it on right away. + LLViewerInventoryItem* item = getItem(); + if(item && item->isComplete()) + { + LLPointer<LLInventoryCallback> cb = new WearOnAvatarCallback(); + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + LLUUID::null, + std::string(), + cb); + } + else if(item) + { + // *TODO: We should fetch the item details, and then do + // the operation above. + LLNotificationsUtil::add("CannotWearInfoNotComplete"); + } + } + + LLInvFVBridgeAction::doIt(); +} + +//virtual +void LLMeshBridgeAction::doIt() +{ + LLViewerInventoryItem* item = getItem(); + if(item) + { + // do it + } + + LLInvFVBridgeAction::doIt(); +} + +// +=================================================+ +// | LLLinkItemBridge | +// +=================================================+ +// For broken links + +std::string LLLinkItemBridge::sPrefix("Link: "); + + +LLUIImagePtr LLLinkItemBridge::getIcon() const +{ + if (LLViewerInventoryItem *item = getItem()) + { + return get_item_icon(item->getActualType(), item->getInventoryType(), 0, FALSE); + } + return get_item_icon(LLAssetType::AT_LINK, LLInventoryType::IT_NONE, 0, FALSE); +} + +void LLLinkItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + // *TODO: Translate + lldebugs << "LLLink::buildContextMenu()" << llendl; + std::vector<std::string> items; + std::vector<std::string> disabled_items; + + items.push_back(std::string("Find Original")); + disabled_items.push_back(std::string("Find Original")); + + if(isInTrash()) + { + items.push_back(std::string("Purge Item")); + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Purge Item")); + } + + items.push_back(std::string("Restore Item")); + } + else + { + items.push_back(std::string("Properties")); + items.push_back(std::string("Delete")); + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Delete")); + } + } + hide_context_entries(menu, items, disabled_items); +} + + +// +=================================================+ +// | LLLinkBridge | +// +=================================================+ +// For broken links. + +std::string LLLinkFolderBridge::sPrefix("Link: "); + + +LLUIImagePtr LLLinkFolderBridge::getIcon() const +{ + LLFolderType::EType preferred_type = LLFolderType::FT_NONE; + if (LLViewerInventoryItem *item = getItem()) + { + if (const LLViewerInventoryCategory* cat = item->getLinkedCategory()) + { + preferred_type = cat->getPreferredType(); + } + } + return LLFolderBridge::getIcon(preferred_type); +} + +void LLLinkFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + // *TODO: Translate + lldebugs << "LLLink::buildContextMenu()" << llendl; + std::vector<std::string> items; + std::vector<std::string> disabled_items; + + if(isInTrash()) + { + items.push_back(std::string("Purge Item")); + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Purge Item")); + } + + items.push_back(std::string("Restore Item")); + } + else + { + items.push_back(std::string("Find Original")); + items.push_back(std::string("Delete")); + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Delete")); + } + } + hide_context_entries(menu, items, disabled_items); +} + +void LLLinkFolderBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) +{ + if ("goto" == action) + { + gotoItem(folder); + return; + } + LLItemBridge::performAction(folder,model,action); +} + +void LLLinkFolderBridge::gotoItem(LLFolderView *folder) +{ + const LLUUID &cat_uuid = getFolderID(); + if (!cat_uuid.isNull()) + { + if (LLFolderViewItem *base_folder = folder->getItemByID(cat_uuid)) + { + if (LLInventoryModel* model = getInventoryModel()) + { + model->fetchDescendentsOf(cat_uuid); + } + base_folder->setOpen(TRUE); + folder->setSelectionFromRoot(base_folder,TRUE); + folder->scrollToShowSelection(); + } + } +} + +const LLUUID &LLLinkFolderBridge::getFolderID() const +{ + if (LLViewerInventoryItem *link_item = getItem()) + { + if (const LLViewerInventoryCategory *cat = link_item->getLinkedCategory()) + { + const LLUUID& cat_uuid = cat->getUUID(); + return cat_uuid; + } + } + return LLUUID::null; +} diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 53fa577587..ce5594be84 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -156,7 +156,6 @@ public: virtual std::string getLabelSuffix() const { return LLStringUtil::null; } virtual void openItem() {} virtual void closeItem() {} - virtual void gotoItem(LLFolderView *folder) {} // for links virtual void previewItem() {openItem();} virtual void showProperties(); virtual BOOL isItemRenameable() const { return TRUE; } @@ -193,6 +192,7 @@ protected: BOOL isInTrash() const; BOOL isLinkedObjectInTrash() const; // Is this obj or its baseobj in the trash? + BOOL isLinkedObjectMissing() const; // Is this a linked obj whose baseobj is not in inventory? BOOL isAgentInventory() const; // false if lost or in the inventory library BOOL isCOFFolder() const; // true if COF or descendent of. @@ -242,7 +242,6 @@ public: virtual void restoreItem(); virtual void restoreToWorld(); virtual void gotoItem(LLFolderView *folder); - virtual LLUIImagePtr getIcon() const; virtual const std::string& getDisplayName() const; virtual std::string getLabelSuffix() const; @@ -261,6 +260,9 @@ public: virtual void clearDisplayName() { mDisplayName.clear(); } LLViewerInventoryItem* getItem() const; + + bool isAddAction(std::string action) const; + bool isRemoveAction(std::string action) const; protected: virtual BOOL isItemPermissive() const; diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 085c96c93d..4c5e4d5607 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -44,6 +44,19 @@ // linden library includes #include "lltrans.h" +LLInventoryFilter::FilterOps::FilterOps() : + mFilterObjectTypes(0xffffffffffffffffULL), + mFilterCategoryTypes(0xffffffffffffffffULL), + mMinDate(time_min()), + mMaxDate(time_max()), + mHoursAgo(0), + mShowFolderState(SHOW_NON_EMPTY_FOLDERS), + mPermissions(PERM_NONE), + mFilterTypes(FILTERTYPE_OBJECT), + mFilterUUID(LLUUID::null) +{ +} + ///---------------------------------------------------------------------------- /// Class LLInventoryFilter ///---------------------------------------------------------------------------- @@ -52,14 +65,6 @@ LLInventoryFilter::LLInventoryFilter(const std::string& name) mModified(FALSE), mNeedTextRebuild(TRUE) { - mFilterOps.mFilterTypes = 0xffffffffffffffffULL; - mFilterOps.mMinDate = time_min(); - mFilterOps.mMaxDate = time_max(); - mFilterOps.mHoursAgo = 0; - mFilterOps.mShowFolderState = SHOW_NON_EMPTY_FOLDERS; - mFilterOps.mPermissions = PERM_NONE; - mFilterOps.mFilterForCategories = FALSE; - mOrder = SO_FOLDERS_BY_NAME; // This gets overridden by a pref immediately mSubStringMatchOffset = 0; @@ -81,11 +86,17 @@ LLInventoryFilter::~LLInventoryFilter() { } -BOOL LLInventoryFilter::check(LLFolderViewItem* item) +BOOL LLInventoryFilter::check(const LLFolderViewItem* item) { - time_t earliest; + // If it's a folder and we're showing all folders, return TRUE automatically. + const BOOL is_folder = (dynamic_cast<const LLFolderViewFolder*>(item) != NULL); + if (is_folder && (mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS)) + { + return TRUE; + } - earliest = time_corrected() - mFilterOps.mHoursAgo * 3600; + const U16 HOURS_TO_SECONDS = 3600; + time_t earliest = time_corrected() - mFilterOps.mHoursAgo * HOURS_TO_SECONDS; if (mFilterOps.mMinDate > time_min() && mFilterOps.mMinDate < earliest) { earliest = mFilterOps.mMinDate; @@ -94,59 +105,73 @@ BOOL LLInventoryFilter::check(LLFolderViewItem* item) { earliest = 0; } - LLFolderViewEventListener* listener = item->getListener(); + + const LLFolderViewEventListener* listener = item->getListener(); mSubStringMatchOffset = mFilterSubString.size() ? item->getSearchableLabel().find(mFilterSubString) : std::string::npos; - bool passed_type = false; - if (mFilterOps.mFilterForCategories) + const BOOL passed_filtertype = checkAgainstFilterType(item); + const BOOL passed = passed_filtertype && + (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos) && + ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions) && + (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate); + + return passed; +} + +BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) +{ + const LLFolderViewEventListener* listener = item->getListener(); + if (!listener) return FALSE; + + const LLInventoryType::EType object_type = listener->getInventoryType(); + const LLUUID object_id = listener->getUUID(); + const LLInventoryObject *object = gInventory.getObject(object_id); + + if (!object) return FALSE; + + const U32 filterTypes = mFilterOps.mFilterTypes; + + // Pass if this item's type is of the correct filter type + if (filterTypes & FILTERTYPE_OBJECT) { - // Pass if this item is a category of the filter type, or - // if its parent is a category of the filter type. - LLUUID uuid = listener->getUUID(); - if (listener->getInventoryType() != LLInventoryType::IT_CATEGORY) + // If it has no type, pass it, unless it's a link. + if (object_type == LLInventoryType::IT_NONE) { - const LLInventoryObject *obj = gInventory.getObject(uuid); - uuid = obj->getParentUUID(); - } - LLViewerInventoryCategory *cat = gInventory.getCategory(uuid); - if (cat) - { - passed_type |= ((1LL << cat->getPreferredType() & mFilterOps.mFilterTypes) != U64(0)); + if (object->getIsLinkType()) + return FALSE; } + if ((1LL << object_type & mFilterOps.mFilterObjectTypes) == U64(0)) + return FALSE; } - else + + // Pass if this item is a category of the filter type, or + // if its parent is a category of the filter type. + if (filterTypes & FILTERTYPE_CATEGORY) { - LLInventoryType::EType type = listener->getInventoryType(); - passed_type |= ((1LL << type & mFilterOps.mFilterTypes) != U64(0)); - if (type == LLInventoryType::IT_NONE) + LLUUID cat_id = object_id; + if (listener->getInventoryType() != LLInventoryType::IT_CATEGORY) { - const LLInventoryObject *obj = gInventory.getObject(listener->getUUID()); - if (obj && obj->getIsLinkType()) - { - passed_type = FALSE; - } - else - { - passed_type = TRUE; - } + cat_id = object->getParentUUID(); } + const LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id); + if (!cat) + return FALSE; + if ((1LL << cat->getPreferredType() & mFilterOps.mFilterCategoryTypes) == U64(0)) + return FALSE; } - BOOL passed = passed_type - && (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos) - && ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions) - && (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate); - - BOOL is_folder = (dynamic_cast<LLFolderViewFolder*>(item) != NULL); - if (is_folder && mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS) + // Pass if this item is the target UUID or if it links to the target UUID + if (filterTypes & FILTERTYPE_UUID) { - passed = TRUE; + if (object->getLinkedUUID() != mFilterOps.mFilterUUID) + return FALSE; } - return passed; + return TRUE; } -const std::string LLInventoryFilter::getFilterSubString(BOOL trim) + +const std::string& LLInventoryFilter::getFilterSubString(BOOL trim) const { return mFilterSubString; } @@ -157,9 +182,9 @@ std::string::size_type LLInventoryFilter::getStringMatchOffset() const } // has user modified default filter params? -BOOL LLInventoryFilter::isNotDefault() +BOOL LLInventoryFilter::isNotDefault() const { - return mFilterOps.mFilterTypes != mDefaultFilterOps.mFilterTypes + return mFilterOps.mFilterObjectTypes != mDefaultFilterOps.mFilterObjectTypes || mFilterSubString.size() || mFilterOps.mPermissions != mDefaultFilterOps.mPermissions || mFilterOps.mMinDate != mDefaultFilterOps.mMinDate @@ -167,9 +192,9 @@ BOOL LLInventoryFilter::isNotDefault() || mFilterOps.mHoursAgo != mDefaultFilterOps.mHoursAgo; } -BOOL LLInventoryFilter::isActive() +BOOL LLInventoryFilter::isActive() const { - return mFilterOps.mFilterTypes != 0xffffffffffffffffULL + return mFilterOps.mFilterObjectTypes != 0xffffffffffffffffULL || mFilterSubString.size() || mFilterOps.mPermissions != PERM_NONE || mFilterOps.mMinDate != time_min() @@ -177,7 +202,7 @@ BOOL LLInventoryFilter::isActive() || mFilterOps.mHoursAgo != 0; } -BOOL LLInventoryFilter::isModified() +BOOL LLInventoryFilter::isModified() const { return mModified; } @@ -189,15 +214,43 @@ BOOL LLInventoryFilter::isModifiedAndClear() return ret; } -void LLInventoryFilter::setFilterTypes(U64 types, BOOL filter_for_categories) +void LLInventoryFilter::setFilterObjectTypes(U64 types) +{ + if (mFilterOps.mFilterObjectTypes != types) + { + // keep current items only if no type bits getting turned off + BOOL fewer_bits_set = (mFilterOps.mFilterObjectTypes & ~types); + BOOL more_bits_set = (~mFilterOps.mFilterObjectTypes & types); + + mFilterOps.mFilterObjectTypes = types; + if (more_bits_set && fewer_bits_set) + { + // neither less or more restrive, both simultaneously + // so we need to filter from scratch + setModified(FILTER_RESTART); + } + else if (more_bits_set) + { + // target is only one of all requested types so more type bits == less restrictive + setModified(FILTER_LESS_RESTRICTIVE); + } + else if (fewer_bits_set) + { + setModified(FILTER_MORE_RESTRICTIVE); + } + } + mFilterOps.mFilterTypes |= FILTERTYPE_OBJECT; +} + +void LLInventoryFilter::setFilterCategoryTypes(U64 types) { - if (mFilterOps.mFilterTypes != types) + if (mFilterOps.mFilterCategoryTypes != types) { // keep current items only if no type bits getting turned off - BOOL fewer_bits_set = (mFilterOps.mFilterTypes & ~types); - BOOL more_bits_set = (~mFilterOps.mFilterTypes & types); + BOOL fewer_bits_set = (mFilterOps.mFilterCategoryTypes & ~types); + BOOL more_bits_set = (~mFilterOps.mFilterCategoryTypes & types); - mFilterOps.mFilterTypes = types; + mFilterOps.mFilterCategoryTypes = types; if (more_bits_set && fewer_bits_set) { // neither less or more restrive, both simultaneously @@ -214,7 +267,21 @@ void LLInventoryFilter::setFilterTypes(U64 types, BOOL filter_for_categories) setModified(FILTER_MORE_RESTRICTIVE); } } - mFilterOps.mFilterForCategories = filter_for_categories; + mFilterOps.mFilterTypes |= FILTERTYPE_CATEGORY; +} + +void LLInventoryFilter::setFilterUUID(const LLUUID& object_id) +{ + if (mFilterOps.mFilterUUID == LLUUID::null) + { + setModified(FILTER_MORE_RESTRICTIVE); + } + else + { + setModified(FILTER_RESTART); + } + mFilterOps.mFilterUUID = object_id; + mFilterOps.mFilterTypes = FILTERTYPE_UUID; } void LLInventoryFilter::setFilterSubString(const std::string& string) @@ -222,9 +289,11 @@ void LLInventoryFilter::setFilterSubString(const std::string& string) if (mFilterSubString != string) { // hitting BACKSPACE, for example - BOOL less_restrictive = mFilterSubString.size() >= string.size() && !mFilterSubString.substr(0, string.size()).compare(string); + const BOOL less_restrictive = mFilterSubString.size() >= string.size() && !mFilterSubString.substr(0, string.size()).compare(string); + // appending new characters - BOOL more_restrictive = mFilterSubString.size() < string.size() && !string.substr(0, mFilterSubString.size()).compare(mFilterSubString); + const BOOL more_restrictive = mFilterSubString.size() < string.size() && !string.substr(0, mFilterSubString.size()).compare(mFilterSubString); + mFilterSubString = string; LLStringUtil::toUpper(mFilterSubString); LLStringUtil::trimHead(mFilterSubString); @@ -241,6 +310,14 @@ void LLInventoryFilter::setFilterSubString(const std::string& string) { setModified(FILTER_RESTART); } + + // Cancel out UUID once the search string is modified + if (mFilterOps.mFilterTypes == FILTERTYPE_UUID) + { + mFilterOps.mFilterTypes &= ~FILTERTYPE_UUID; + mFilterOps.mFilterUUID == LLUUID::null; + setModified(FILTER_RESTART); + } } } @@ -298,12 +375,18 @@ void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl) } } -BOOL LLInventoryFilter::isSinceLogoff() +BOOL LLInventoryFilter::isSinceLogoff() const { return (mFilterOps.mMinDate == (time_t)mLastLogoff) && (mFilterOps.mMaxDate == time_max()); } +void LLInventoryFilter::clearModified() +{ + mModified = FALSE; + mFilterBehavior = FILTER_NONE; +} + void LLInventoryFilter::setHoursAgo(U32 hours) { if (mFilterOps.mHoursAgo != hours) @@ -417,12 +500,12 @@ void LLInventoryFilter::setModified(EFilterBehavior behavior) } } -BOOL LLInventoryFilter::isFilterWith(LLInventoryType::EType t) +BOOL LLInventoryFilter::isFilterObjectTypesWith(LLInventoryType::EType t) const { - return mFilterOps.mFilterTypes & (1LL << t); + return mFilterOps.mFilterObjectTypes & (1LL << t); } -std::string LLInventoryFilter::getFilterText() +const std::string& LLInventoryFilter::getFilterText() { if (!mNeedTextRebuild) { @@ -437,7 +520,7 @@ std::string LLInventoryFilter::getFilterText() S32 num_filter_types = 0; mFilterText.clear(); - if (isFilterWith(LLInventoryType::IT_ANIMATION)) + if (isFilterObjectTypesWith(LLInventoryType::IT_ANIMATION)) { //filtered_types += " Animations,"; filtered_types += LLTrans::getString("Animations"); @@ -452,7 +535,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_CALLINGCARD)) + if (isFilterObjectTypesWith(LLInventoryType::IT_CALLINGCARD)) { //filtered_types += " Calling Cards,"; filtered_types += LLTrans::getString("Calling Cards"); @@ -466,7 +549,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_WEARABLE)) + if (isFilterObjectTypesWith(LLInventoryType::IT_WEARABLE)) { //filtered_types += " Clothing,"; filtered_types += LLTrans::getString("Clothing"); @@ -480,7 +563,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_GESTURE)) + if (isFilterObjectTypesWith(LLInventoryType::IT_GESTURE)) { //filtered_types += " Gestures,"; filtered_types += LLTrans::getString("Gestures"); @@ -494,7 +577,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_LANDMARK)) + if (isFilterObjectTypesWith(LLInventoryType::IT_LANDMARK)) { //filtered_types += " Landmarks,"; filtered_types += LLTrans::getString("Landmarks"); @@ -508,7 +591,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_NOTECARD)) + if (isFilterObjectTypesWith(LLInventoryType::IT_NOTECARD)) { //filtered_types += " Notecards,"; filtered_types += LLTrans::getString("Notecards"); @@ -522,7 +605,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_OBJECT) && isFilterWith(LLInventoryType::IT_ATTACHMENT)) + if (isFilterObjectTypesWith(LLInventoryType::IT_OBJECT) && isFilterObjectTypesWith(LLInventoryType::IT_ATTACHMENT)) { //filtered_types += " Objects,"; filtered_types += LLTrans::getString("Objects"); @@ -536,7 +619,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_LSL)) + if (isFilterObjectTypesWith(LLInventoryType::IT_LSL)) { //filtered_types += " Scripts,"; filtered_types += LLTrans::getString("Scripts"); @@ -550,7 +633,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_SOUND)) + if (isFilterObjectTypesWith(LLInventoryType::IT_SOUND)) { //filtered_types += " Sounds,"; filtered_types += LLTrans::getString("Sounds"); @@ -564,7 +647,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_TEXTURE)) + if (isFilterObjectTypesWith(LLInventoryType::IT_TEXTURE)) { //filtered_types += " Textures,"; filtered_types += LLTrans::getString("Textures"); @@ -578,7 +661,7 @@ std::string LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (isFilterWith(LLInventoryType::IT_SNAPSHOT)) + if (isFilterObjectTypesWith(LLInventoryType::IT_SNAPSHOT)) { //filtered_types += " Snapshots,"; filtered_types += LLTrans::getString("Snapshots"); @@ -619,9 +702,9 @@ std::string LLInventoryFilter::getFilterText() return mFilterText; } -void LLInventoryFilter::toLLSD(LLSD& data) +void LLInventoryFilter::toLLSD(LLSD& data) const { - data["filter_types"] = (LLSD::Integer)getFilterTypes(); + data["filter_types"] = (LLSD::Integer)getFilterObjectTypes(); data["min_date"] = (LLSD::Integer)getMinDate(); data["max_date"] = (LLSD::Integer)getMaxDate(); data["hours_ago"] = (LLSD::Integer)getHoursAgo(); @@ -636,7 +719,7 @@ void LLInventoryFilter::fromLLSD(LLSD& data) { if(data.has("filter_types")) { - setFilterTypes((U32)data["filter_types"].asInteger()); + setFilterObjectTypes((U32)data["filter_types"].asInteger()); } if(data.has("min_date") && data.has("max_date")) @@ -674,3 +757,71 @@ void LLInventoryFilter::fromLLSD(LLSD& data) setDateRangeLastLogoff((bool)data["since_logoff"].asBoolean()); } } + +U32 LLInventoryFilter::getFilterObjectTypes() const +{ + return mFilterOps.mFilterObjectTypes; +} + +BOOL LLInventoryFilter::hasFilterString() const +{ + return mFilterSubString.size() > 0; +} + +PermissionMask LLInventoryFilter::getFilterPermissions() const +{ + return mFilterOps.mPermissions; +} + +time_t LLInventoryFilter::getMinDate() const +{ + return mFilterOps.mMinDate; +} + +time_t LLInventoryFilter::getMaxDate() const +{ + return mFilterOps.mMaxDate; +} +U32 LLInventoryFilter::getHoursAgo() const +{ + return mFilterOps.mHoursAgo; +} +LLInventoryFilter::EFolderShow LLInventoryFilter::getShowFolderState() const +{ + return mFilterOps.mShowFolderState; +} +U32 LLInventoryFilter::getSortOrder() const +{ + return mOrder; +} +const std::string& LLInventoryFilter::getName() const +{ + return mName; +} + +void LLInventoryFilter::setFilterCount(S32 count) +{ + mFilterCount = count; +} +S32 LLInventoryFilter::getFilterCount() const +{ + return mFilterCount; +} + +void LLInventoryFilter::decrementFilterCount() +{ + mFilterCount--; +} + +S32 LLInventoryFilter::getCurrentGeneration() const +{ + return mFilterGeneration; +} +S32 LLInventoryFilter::getMinRequiredGeneration() const +{ + return mMinRequiredGeneration; +} +S32 LLInventoryFilter::getMustPassGeneration() const +{ + return mMustPassGeneration; +} diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index b803df110b..d65fb8f27c 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -33,30 +33,38 @@ #ifndef LLINVENTORYFILTER_H #define LLINVENTORYFILTER_H -// lots of includes here #include "llinventorytype.h" -#include "llpermissionsflags.h" // PermissionsMask +#include "llpermissionsflags.h" class LLFolderViewItem; class LLInventoryFilter { public: - typedef enum e_folder_show + enum EFolderShow { SHOW_ALL_FOLDERS, SHOW_NON_EMPTY_FOLDERS, SHOW_NO_FOLDERS - } EFolderShow; + }; - typedef enum e_filter_behavior + enum EFilterBehavior { FILTER_NONE, // nothing to do, already filtered FILTER_RESTART, // restart filtering from scratch FILTER_LESS_RESTRICTIVE, // existing filtered items will certainly pass this filter FILTER_MORE_RESTRICTIVE // if you didn't pass the previous filter, you definitely won't pass this one - } EFilterBehavior; + }; + + enum EFilterType + { + FILTERTYPE_NONE = 0, + FILTERTYPE_OBJECT = 1, // normal default search-by-object-type + FILTERTYPE_CATEGORY = 2, // search by folder type + FILTERTYPE_UUID = 4 // find the object with UUID and any links to it + }; + // REFACTOR: Change this to an enum. static const U32 SO_DATE = 1; static const U32 SO_FOLDERS_BY_NAME = 2; static const U32 SO_SYSTEM_FOLDERS_TO_TOP = 4; @@ -64,89 +72,121 @@ public: LLInventoryFilter(const std::string& name); virtual ~LLInventoryFilter(); - void setFilterTypes(U64 types, BOOL filter_for_categories = FALSE); // if filter_for_categories is true, operate on folder preferred asset type - U32 getFilterTypes() const { return mFilterOps.mFilterTypes; } - - void setFilterSubString(const std::string& string); - const std::string getFilterSubString(BOOL trim = FALSE); - - void setFilterPermissions(PermissionMask perms); - PermissionMask getFilterPermissions() const { return mFilterOps.mPermissions; } - - void setDateRange(time_t min_date, time_t max_date); - void setDateRangeLastLogoff(BOOL sl); - time_t getMinDate() const { return mFilterOps.mMinDate; } - time_t getMaxDate() const { return mFilterOps.mMaxDate; } - - void setHoursAgo(U32 hours); - U32 getHoursAgo() const { return mFilterOps.mHoursAgo; } - - void setShowFolderState( EFolderShow state); - EFolderShow getShowFolderState() { return mFilterOps.mShowFolderState; } - - void setSortOrder(U32 order); - U32 getSortOrder() { return mOrder; } - - BOOL check(LLFolderViewItem* item); + // +-------------------------------------------------------------------+ + // + Execution And Results + // +-------------------------------------------------------------------+ + BOOL check(const LLFolderViewItem* item); + BOOL checkAgainstFilterType(const LLFolderViewItem* item); std::string::size_type getStringMatchOffset() const; - BOOL isActive(); - BOOL isNotDefault(); - BOOL isModified(); - BOOL isModifiedAndClear(); - BOOL isSinceLogoff(); - bool hasFilterString() { return mFilterSubString.size() > 0; } - void clearModified() { mModified = FALSE; mFilterBehavior = FILTER_NONE; } - const std::string getName() const { return mName; } - std::string getFilterText(); - void setFilterCount(S32 count) { mFilterCount = count; } - S32 getFilterCount() { return mFilterCount; } - void decrementFilterCount() { mFilterCount--; } + // +-------------------------------------------------------------------+ + // + Parameters + // +-------------------------------------------------------------------+ + void setFilterObjectTypes(U64 types); + U32 getFilterObjectTypes() const; + BOOL isFilterObjectTypesWith(LLInventoryType::EType t) const; + void setFilterCategoryTypes(U64 types); + void setFilterUUID(const LLUUID &object_id); + + void setFilterSubString(const std::string& string); + const std::string& getFilterSubString(BOOL trim = FALSE) const; + BOOL hasFilterString() const; + + void setFilterPermissions(PermissionMask perms); + PermissionMask getFilterPermissions() const; + + void setDateRange(time_t min_date, time_t max_date); + void setDateRangeLastLogoff(BOOL sl); + time_t getMinDate() const; + time_t getMaxDate() const; + + void setHoursAgo(U32 hours); + U32 getHoursAgo() const; + + void setShowFolderState( EFolderShow state); + EFolderShow getShowFolderState() const; + + void setSortOrder(U32 order); + U32 getSortOrder() const; + + // +-------------------------------------------------------------------+ + // + Status + // +-------------------------------------------------------------------+ + BOOL isActive() const; + BOOL isModified() const; + BOOL isModifiedAndClear(); + BOOL isSinceLogoff() const; + void clearModified(); + const std::string& getName() const; + const std::string& getFilterText(); + //RN: this is public to allow system to externally force a global refilter + void setModified(EFilterBehavior behavior = FILTER_RESTART); + + // +-------------------------------------------------------------------+ + // + Count + // +-------------------------------------------------------------------+ + void setFilterCount(S32 count); + S32 getFilterCount() const; + void decrementFilterCount(); + + // +-------------------------------------------------------------------+ + // + Default + // +-------------------------------------------------------------------+ + BOOL isNotDefault() const; + void markDefault(); + void resetDefault(); + + // +-------------------------------------------------------------------+ + // + Generation + // +-------------------------------------------------------------------+ + S32 getCurrentGeneration() const; + S32 getMinRequiredGeneration() const; + S32 getMustPassGeneration() const; + + // +-------------------------------------------------------------------+ + // + Conversion + // +-------------------------------------------------------------------+ + void toLLSD(LLSD& data) const; + void fromLLSD(LLSD& data); - void markDefault(); - void resetDefault(); +private: + struct FilterOps + { + FilterOps(); + U32 mFilterTypes; - BOOL isFilterWith(LLInventoryType::EType t); + U64 mFilterObjectTypes; // For _ITEM + U64 mFilterCategoryTypes; // For _ITEM + LLUUID mFilterUUID; // for UUID - S32 getCurrentGeneration() const { return mFilterGeneration; } - S32 getMinRequiredGeneration() const { return mMinRequiredGeneration; } - S32 getMustPassGeneration() const { return mMustPassGeneration; } + time_t mMinDate; + time_t mMaxDate; + U32 mHoursAgo; + EFolderShow mShowFolderState; + PermissionMask mPermissions; + }; - //RN: this is public to allow system to externally force a global refilter - void setModified(EFilterBehavior behavior = FILTER_RESTART); + U32 mOrder; + U32 mLastLogoff; - void toLLSD(LLSD& data); - void fromLLSD(LLSD& data); + FilterOps mFilterOps; + FilterOps mDefaultFilterOps; -protected: - struct filter_ops - { - U64 mFilterTypes; - BOOL mFilterForCategories; - time_t mMinDate; - time_t mMaxDate; - U32 mHoursAgo; - EFolderShow mShowFolderState; - PermissionMask mPermissions; - }; - filter_ops mFilterOps; - filter_ops mDefaultFilterOps; std::string::size_type mSubStringMatchOffset; - std::string mFilterSubString; - U32 mOrder; - const std::string mName; - S32 mFilterGeneration; - S32 mMustPassGeneration; - S32 mMinRequiredGeneration; - S32 mFilterCount; - S32 mNextFilterGeneration; - EFilterBehavior mFilterBehavior; + std::string mFilterSubString; + const std::string mName; -private: - U32 mLastLogoff; - BOOL mModified; - BOOL mNeedTextRebuild; - std::string mFilterText; + S32 mFilterGeneration; + S32 mMustPassGeneration; + S32 mMinRequiredGeneration; + S32 mNextFilterGeneration; + + S32 mFilterCount; + EFilterBehavior mFilterBehavior; + + BOOL mModified; + BOOL mNeedTextRebuild; + std::string mFilterText; }; #endif diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 95cc68ddbe..9916a2351c 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -34,32 +34,9 @@ #ifndef LL_LLINVENTORYFUNCTIONS_H #define LL_LLINVENTORYFUNCTIONS_H -#include "llassetstorage.h" -#include "lldarray.h" -#include "llfloater.h" -#include "llinventory.h" -#include "llinventoryfilter.h" +#include "llinventorytype.h" #include "llfolderview.h" -#include "llinventorymodel.h" -#include "lluictrlfactory.h" -#include <set> - - -class LLFolderViewItem; -class LLInventoryFilter; -class LLInventoryModel; -class LLInventoryPanel; -class LLInvFVBridge; -class LLInventoryFVBridgeBuilder; -class LLMenuBarGL; -class LLCheckBoxCtrl; -class LLSpinCtrl; -class LLScrollContainer; -class LLTextBox; -class LLIconCtrl; -class LLSaveFolderState; -class LLFilterEditor; -class LLTabContainer; +#include "llfolderviewitem.h" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 9e37c5be38..fb9be1e04f 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -36,10 +36,11 @@ #include "llagent.h" #include "llagentwearables.h" #include "llinventorypanel.h" -#include "llfloaterinventory.h" #include "llinventorybridge.h" #include "llinventoryfunctions.h" #include "llinventoryobserver.h" +#include "llinventorypanel.h" +#include "llnotificationsutil.h" #include "llwindow.h" #include "llviewercontrol.h" #include "llpreview.h" @@ -210,6 +211,25 @@ BOOL LLInventoryModel::isObjectDescendentOf(const LLUUID& obj_id, return FALSE; } +const LLViewerInventoryCategory *LLInventoryModel::getFirstNondefaultParent(const LLUUID& obj_id) const +{ + const LLInventoryObject* obj = getObject(obj_id); + const LLUUID& parent_id = obj->getParentUUID(); + while (!parent_id.isNull()) + { + const LLViewerInventoryCategory *cat = getCategory(parent_id); + if (!cat) break; + const LLFolderType::EType folder_type = cat->getPreferredType(); + if (folder_type != LLFolderType::FT_NONE && + folder_type != LLFolderType::FT_ROOT_INVENTORY && + !LLFolderType::lookupIsEnsembleType(folder_type)) + { + return cat; + } + } + return NULL; +} + // Get the object by id. Returns NULL if not found. LLInventoryObject* LLInventoryModel::getObject(const LLUUID& id) const { @@ -870,46 +890,48 @@ void LLInventoryModel::moveObject(const LLUUID& object_id, const LLUUID& cat_id) // Delete a particular inventory object by ID. void LLInventoryModel::deleteObject(const LLUUID& id) { - // Disabling this; let users manually purge linked objects. - // purgeLinkedObjects(id); lldebugs << "LLInventoryModel::deleteObject()" << llendl; LLPointer<LLInventoryObject> obj = getObject(id); - if(obj) + if (!obj) { - lldebugs << "Deleting inventory object " << id << llendl; - mLastItem = NULL; - LLUUID parent_id = obj->getParentUUID(); - mCategoryMap.erase(id); - mItemMap.erase(id); - //mInventory.erase(id); - item_array_t* item_list = getUnlockedItemArray(parent_id); - if(item_list) - { - LLViewerInventoryItem* item = (LLViewerInventoryItem*)((LLInventoryObject*)obj); - item_list->removeObj(item); - } - cat_array_t* cat_list = getUnlockedCatArray(parent_id); - if(cat_list) - { - LLViewerInventoryCategory* cat = (LLViewerInventoryCategory*)((LLInventoryObject*)obj); - cat_list->removeObj(cat); - } - item_list = getUnlockedItemArray(id); - if(item_list) - { - delete item_list; - mParentChildItemTree.erase(id); - } - cat_list = getUnlockedCatArray(id); - if(cat_list) - { - delete cat_list; - mParentChildCategoryTree.erase(id); - } - addChangedMask(LLInventoryObserver::REMOVE, id); - obj = NULL; // delete obj - gInventory.notifyObservers(); + llwarns << "Deleting non-existent object [ id: " << id << " ] " << llendl; + return; } + + lldebugs << "Deleting inventory object " << id << llendl; + mLastItem = NULL; + LLUUID parent_id = obj->getParentUUID(); + mCategoryMap.erase(id); + mItemMap.erase(id); + //mInventory.erase(id); + item_array_t* item_list = getUnlockedItemArray(parent_id); + if(item_list) + { + LLViewerInventoryItem* item = (LLViewerInventoryItem*)((LLInventoryObject*)obj); + item_list->removeObj(item); + } + cat_array_t* cat_list = getUnlockedCatArray(parent_id); + if(cat_list) + { + LLViewerInventoryCategory* cat = (LLViewerInventoryCategory*)((LLInventoryObject*)obj); + cat_list->removeObj(cat); + } + item_list = getUnlockedItemArray(id); + if(item_list) + { + delete item_list; + mParentChildItemTree.erase(id); + } + cat_list = getUnlockedCatArray(id); + if(cat_list) + { + delete cat_list; + mParentChildCategoryTree.erase(id); + } + addChangedMask(LLInventoryObserver::REMOVE, id); + obj = NULL; // delete obj + updateLinkedObjectsFromPurge(id); + gInventory.notifyObservers(); } // Delete a particular inventory item by ID, and remove it from the server. @@ -925,26 +947,23 @@ void LLInventoryModel::purgeObject(const LLUUID &id) } } -void LLInventoryModel::purgeLinkedObjects(const LLUUID &id) +void LLInventoryModel::updateLinkedObjectsFromPurge(const LLUUID &baseobj_id) { - LLInventoryObject* objectp = getObject(id); - if (!objectp) return; - - if (objectp->getIsLinkType()) - { - return; - } + LLInventoryModel::item_array_t item_array = collectLinkedItems(baseobj_id); - LLInventoryModel::item_array_t item_array = collectLinkedItems(id); - - for (LLInventoryModel::item_array_t::iterator iter = item_array.begin(); + // REBUILD is expensive, so clear the current change list first else + // everything else on the changelist will also get rebuilt. + gInventory.notifyObservers(); + for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin(); iter != item_array.end(); iter++) { - LLViewerInventoryItem *linked_item = (*iter); - if (linked_item->getUUID() == id) continue; - purgeObject(linked_item->getUUID()); + const LLViewerInventoryItem *linked_item = (*iter); + const LLUUID &item_id = linked_item->getUUID(); + if (item_id == baseobj_id) continue; + addChangedMask(LLInventoryObserver::REBUILD, item_id); } + gInventory.notifyObservers(); } // This is a method which collects the descendents of the id @@ -3047,10 +3066,10 @@ void LLInventoryModel::processUpdateInventoryFolder(LLMessageSystem* msg, gInventory.notifyObservers(); // *HACK: Do the 'show' logic for a new item in the inventory. - LLFloaterInventory* view = LLFloaterInventory::getActiveInventory(); - if(view) + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); + if (active_panel) { - view->getPanel()->setSelection(lastfolder->getUUID(), TAKE_FOCUS_NO); + active_panel->setSelection(lastfolder->getUUID(), TAKE_FOCUS_NO); } } @@ -3419,7 +3438,7 @@ void LLInventoryModel::processMoveInventoryItem(LLMessageSystem* msg, void**) bool LLInventoryModel::callbackEmptyFolderType(const LLSD& notification, const LLSD& response, LLFolderType::EType preferred_type) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) // YES { const LLUUID folder_id = findCategoryUUIDForType(preferred_type); @@ -3433,7 +3452,7 @@ void LLInventoryModel::emptyFolderType(const std::string notification, LLFolderT { if (!notification.empty()) { - LLNotifications::instance().add(notification, LLSD(), LLSD(), + LLNotificationsUtil::add(notification, LLSD(), LLSD(), boost::bind(&LLInventoryModel::callbackEmptyFolderType, this, _1, _2, preferred_type)); } else diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 50f54cb842..b744d821c7 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -82,6 +82,8 @@ public: // These are used a lot... typedef LLDynamicArray<LLPointer<LLViewerInventoryCategory> > cat_array_t; typedef LLDynamicArray<LLPointer<LLViewerInventoryItem> > item_array_t; + typedef std::set<LLUUID> changed_items_t; + // construction & destruction LLInventoryModel(); ~LLInventoryModel(); @@ -106,10 +108,12 @@ public: // Accessors // - // This is a convenience function to check if one object has a - // parent chain up to the category specified by UUID. + // Check if one object has a parent chain up to the category specified by UUID. BOOL isObjectDescendentOf(const LLUUID& obj_id, const LLUUID& cat_id) const; + // Get whatever special folder this object is a child of, if any. + const LLViewerInventoryCategory *getFirstNondefaultParent(const LLUUID& obj_id) const; + // Get the object by id. Returns NULL if not found. // * WARNING: use the pointer returned for read operations - do // not modify the object values in place or you will break stuff. @@ -214,9 +218,9 @@ public: void deleteObject(const LLUUID& id); // delete a particular inventory object by ID, and delete it from - // the server. Also purges linked items via purgeLinkedObjects. + // the server. Also updates linked items. void purgeObject(const LLUUID& id); - void purgeLinkedObjects(const LLUUID& id); + void updateLinkedObjectsFromPurge(const LLUUID& baseobj_id); // This is a method which collects the descendants of the id // provided. If the category is not found, no action is @@ -269,7 +273,7 @@ public: // that the next notify will include that notification. void addChangedMask(U32 mask, const LLUUID& referent); - const std::set<LLUUID>& getChangedIDs() { return mChangedItemIDs; } + const changed_items_t& getChangedIDs() const { return mChangedItemIDs; } // This method to prepares a set of mock inventory which provides // minimal functionality before the actual arrival of inventory. @@ -451,7 +455,6 @@ protected: private: // Variables used to track what has changed since the last notify. U32 mModifyMask; - typedef std::set<LLUUID> changed_items_t; changed_items_t mChangedItemIDs; std::map<LLUUID, bool> mCategoryLock; diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 06f4b36df3..2d9ea21b5f 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -55,7 +55,7 @@ #include "lldbstrings.h" #include "llviewerstats.h" #include "llmutelist.h" -#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llcallbacklist.h" #include "llpreview.h" #include "llviewercontrol.h" @@ -63,6 +63,15 @@ #include "llsdutil.h" #include <deque> +LLInventoryObserver::LLInventoryObserver() +{ +} + +// virtual +LLInventoryObserver::~LLInventoryObserver() +{ +} + void LLInventoryCompletionObserver::changed(U32 mask) { // scan through the incomplete items and move or erase them as diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index 73b25a8ed0..99e6dbe3c8 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -56,14 +56,16 @@ public: { NONE = 0, LABEL = 1, // name changed - INTERNAL = 2, // internal change, eg, asset uuid different + INTERNAL = 2, // internal change (e.g. asset uuid different) ADD = 4, // something added REMOVE = 8, // something deleted - STRUCTURE = 16, // structural change, eg, item or folder moved - CALLING_CARD = 32, // online, grant status, cancel, etc change + STRUCTURE = 16, // structural change (eg item or folder moved) + CALLING_CARD = 32, // (eg online, grant status, cancel) + REBUILD = 64, // item UI changed (eg item type different) ALL = 0xffffffff }; - virtual ~LLInventoryObserver() {}; + LLInventoryObserver(); + virtual ~LLInventoryObserver(); virtual void changed(U32 mask) = 0; std::string mMessageName; // used by Agent Inventory Service only. [DEV-20328] }; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 0c893dddd6..54f528de8d 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -31,20 +31,22 @@ */ #include "llviewerprecompiledheaders.h" +#include "llinventorypanel.h" #include <utility> // for std::pair<> -#include "llinventorypanel.h" - #include "llagent.h" #include "llagentwearables.h" #include "llappearancemgr.h" +#include "llfloaterinventory.h" #include "llfloaterreg.h" +#include "llimfloater.h" #include "llimview.h" #include "llinventorybridge.h" +#include "llsidepanelinventory.h" +#include "llsidetray.h" #include "llscrollcontainer.h" #include "llviewerfoldertype.h" -#include "llimfloater.h" #include "llvoavatarself.h" static LLDefaultChildRegistry::Register<LLInventoryPanel> r("inventory_panel"); @@ -65,7 +67,10 @@ class LLInventoryPanelObserver : public LLInventoryObserver public: LLInventoryPanelObserver(LLInventoryPanel* ip) : mIP(ip) {} virtual ~LLInventoryPanelObserver() {} - virtual void changed(U32 mask); + virtual void changed(U32 mask) + { + mIP->modelChanged(mask); + } protected: LLInventoryPanel* mIP; }; @@ -109,7 +114,7 @@ BOOL LLInventoryPanel::postBuild() mCommitCallbackRegistrar.pushScope(); // registered as a widget; need to push callback scope ourselves - // create root folder + // Create root folder { LLRect folder_rect(0, 0, @@ -128,7 +133,7 @@ BOOL LLInventoryPanel::postBuild() mFolders->setCallbackRegistrar(&mCommitCallbackRegistrar); - // scroller + // Scroller { LLRect scroller_view_rect = getRect(); scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom); @@ -139,23 +144,21 @@ BOOL LLInventoryPanel::postBuild() p.reserve_scroll_corner(true); p.tab_stop(true); mScroller = LLUICtrlFactory::create<LLScrollContainer>(p); + addChild(mScroller); + mScroller->addChild(mFolders); + mFolders->setScrollContainer(mScroller); } - addChild(mScroller); - mScroller->addChild(mFolders); - - mFolders->setScrollContainer(mScroller); - // set up the callbacks from the inventory we're viewing, and then - // build everything. + // Set up the callbacks from the inventory we're viewing, and then build everything. mInventoryObserver = new LLInventoryPanelObserver(this); mInventory->addObserver(mInventoryObserver); - // build view of inventory if we need default full hierarchy and inventory ready, otherwise wait for modelChanged() callback + // Build view of inventory if we need default full hierarchy and inventory ready, + // otherwise wait for idle callback. if (mBuildDefaultHierarchy && mInventory->isInventoryUsable() && !mViewsInitialized) { initializeViews(); } - gIdleCallbacks.addFunction(onIdle, (void*)this); if (mSortOrderSetting != INHERIT_SORT_ORDER) @@ -166,14 +169,13 @@ BOOL LLInventoryPanel::postBuild() { setSortOrder(gSavedSettings.getU32(DEFAULT_SORT_ORDER)); } - mFolders->setSortOrder(mFolders->getFilter()->getSortOrder()); + mFolders->setSortOrder(getFilter()->getSortOrder()); return TRUE; } LLInventoryPanel::~LLInventoryPanel() { - // should this be a global setting? if (mFolders) { U32 sort_order = mFolders->getSortOrder(); @@ -189,39 +191,44 @@ LLInventoryPanel::~LLInventoryPanel() mScroller = NULL; } -LLMemType mt(LLMemType::MTYPE_INVENTORY_FROM_XML); // ! BUG ! Should this be removed? void LLInventoryPanel::draw() { - // select the desired item (in case it wasn't loaded when the selection was requested) + // Select the desired item (in case it wasn't loaded when the selection was requested) mFolders->updateSelection(); LLPanel::draw(); } LLInventoryFilter* LLInventoryPanel::getFilter() { - if (mFolders) return mFolders->getFilter(); + if (mFolders) + { + return mFolders->getFilter(); + } return NULL; } -void LLInventoryPanel::setFilterTypes(U64 filter_types, BOOL filter_for_categories) +void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType filter_type) { - mFolders->getFilter()->setFilterTypes(filter_types, filter_for_categories); -} + if (filter_type == LLInventoryFilter::FILTERTYPE_OBJECT) + getFilter()->setFilterObjectTypes(types); + if (filter_type == LLInventoryFilter::FILTERTYPE_CATEGORY) + getFilter()->setFilterCategoryTypes(types); +} void LLInventoryPanel::setFilterPermMask(PermissionMask filter_perm_mask) { - mFolders->getFilter()->setFilterPermissions(filter_perm_mask); + getFilter()->setFilterPermissions(filter_perm_mask); } void LLInventoryPanel::setFilterSubString(const std::string& string) { - mFolders->getFilter()->setFilterSubString(string); + getFilter()->setFilterSubString(string); } void LLInventoryPanel::setSortOrder(U32 order) { - mFolders->getFilter()->setSortOrder(order); - if (mFolders->getFilter()->isModified()) + getFilter()->setSortOrder(order); + if (getFilter()->isModified()) { mFolders->setSortOrder(order); // try to keep selection onscreen, even if it wasn't to start with @@ -231,151 +238,170 @@ void LLInventoryPanel::setSortOrder(U32 order) void LLInventoryPanel::setSinceLogoff(BOOL sl) { - mFolders->getFilter()->setDateRangeLastLogoff(sl); + getFilter()->setDateRangeLastLogoff(sl); } void LLInventoryPanel::setHoursAgo(U32 hours) { - mFolders->getFilter()->setHoursAgo(hours); + getFilter()->setHoursAgo(hours); } void LLInventoryPanel::setShowFolderState(LLInventoryFilter::EFolderShow show) { - mFolders->getFilter()->setShowFolderState(show); + getFilter()->setShowFolderState(show); } LLInventoryFilter::EFolderShow LLInventoryPanel::getShowFolderState() { - return mFolders->getFilter()->getShowFolderState(); + return getFilter()->getShowFolderState(); } -static LLFastTimer::DeclareTimer FTM_REFRESH("Inventory Refresh"); - void LLInventoryPanel::modelChanged(U32 mask) { + static LLFastTimer::DeclareTimer FTM_REFRESH("Inventory Refresh"); LLFastTimer t2(FTM_REFRESH); bool handled = false; - if (!mViewsInitialized) - { - return; - } + if (!mViewsInitialized) return; - if (mask & LLInventoryObserver::LABEL) - { - handled = true; - // label change - empty out the display name for each object - // in this change set. - const std::set<LLUUID>& changed_items = gInventory.getChangedIDs(); - std::set<LLUUID>::const_iterator id_it = changed_items.begin(); - std::set<LLUUID>::const_iterator id_end = changed_items.end(); - LLFolderViewItem* view = NULL; - LLInvFVBridge* bridge = NULL; - for (;id_it != id_end; ++id_it) + const LLInventoryModel* model = getModel(); + if (!model) return; + + const LLInventoryModel::changed_items_t& changed_items = model->getChangedIDs(); + if (changed_items.empty()) return; + + for (LLInventoryModel::changed_items_t::const_iterator items_iter = changed_items.begin(); + items_iter != changed_items.end(); + ++items_iter) + { + const LLUUID& item_id = (*items_iter); + const LLInventoryObject* model_item = model->getObject(item_id); + LLFolderViewItem* view_item = mFolders->getItemByID(item_id); + + ////////////////////////////// + // LABEL Operation + // Empty out the display name for relabel. + if (mask & LLInventoryObserver::LABEL) { - view = mFolders->getItemByID(*id_it); - if(view) + handled = true; + if (view_item) { - // request refresh on this item (also flags for filtering) - bridge = (LLInvFVBridge*)view->getListener(); + // Request refresh on this item (also flags for filtering) + LLInvFVBridge* bridge = (LLInvFVBridge*)view_item->getListener(); if(bridge) { // Clear the display name first, so it gets properly re-built during refresh() bridge->clearDisplayName(); } - view->refresh(); + view_item->refresh(); } } - } - // We don't really care which of these masks the item is actually flagged with, since the masks - // may not be accurate (e.g. in the main inventory panel, I move an item from My Inventory into - // Landmarks; this is a STRUCTURE change for that panel but is an ADD change for the Landmarks - // panel). What's relevant is that the item and UI are probably out of sync and thus need to be - // resynchronized. - if (mask & (LLInventoryObserver::STRUCTURE | - LLInventoryObserver::ADD | - LLInventoryObserver::REMOVE)) - { - handled = true; - // Record which folders are open by uuid. - LLInventoryModel* model = getModel(); - if (model) + ////////////////////////////// + // REBUILD Operation + // Destroy and regenerate the UI. + if (mask & LLInventoryObserver::REBUILD) { - const std::set<LLUUID>& changed_items = gInventory.getChangedIDs(); + handled = true; + if (model_item && view_item) + { + view_item->destroyView(); + } + buildNewViews(item_id); + } - std::set<LLUUID>::const_iterator id_it = changed_items.begin(); - std::set<LLUUID>::const_iterator id_end = changed_items.end(); - for (;id_it != id_end; ++id_it) + ////////////////////////////// + // INTERNAL Operation + // This could be anything. For now, just refresh the item. + if (mask & LLInventoryObserver::INTERNAL) + { + if (view_item) { - // sync view with model - LLInventoryObject* model_item = model->getObject(*id_it); - LLFolderViewItem* view_item = mFolders->getItemByID(*id_it); + view_item->refresh(); + } + } + + // We don't typically care which of these masks the item is actually flagged with, since the masks + // may not be accurate (e.g. in the main inventory panel, I move an item from My Inventory into + // Landmarks; this is a STRUCTURE change for that panel but is an ADD change for the Landmarks + // panel). What's relevant is that the item and UI are probably out of sync and thus need to be + // resynchronized. + if (mask & (LLInventoryObserver::STRUCTURE | + LLInventoryObserver::ADD | + LLInventoryObserver::REMOVE)) + { + handled = true; - // Item exists in memory but a UI element hasn't been created for it. - if (model_item && !view_item) + ////////////////////////////// + // ADD Operation + // Item exists in memory but a UI element hasn't been created for it. + if (model_item && !view_item) + { + // Add the UI element for this item. + buildNewViews(item_id); + // Select any newly created object that has the auto rename at top of folder root set. + if(mFolders->getRoot()->needsAutoRename()) { - // Add the UI element for this item. - buildNewViews(*id_it); - // Select any newly created object that has the auto rename at top of folder root set. - if(mFolders->getRoot()->needsAutoRename()) - { - setSelection(*id_it, FALSE); - } + setSelection(item_id, FALSE); } + } - // This item already exists in both memory and UI. It was probably moved - // around in the panel's directory structure (i.e. reparented). - if (model_item && view_item) + ////////////////////////////// + // STRUCTURE Operation + // This item already exists in both memory and UI. It was probably reparented. + if (model_item && view_item) + { + // Don't process the item if it's hanging from the root, since its + // model_item's parent will be NULL. + if (view_item->getRoot() != view_item->getParent()) { - // Don't process the item if it's hanging from the root, since its - // model_item's parent will be NULL. - if (view_item->getRoot() != view_item->getParent()) + LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolders->getItemByID(model_item->getParentUUID()); + // Item has been moved. + if (view_item->getParentFolder() != new_parent) { - LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolders->getItemByID(model_item->getParentUUID()); - // Item has been moved. - if (view_item->getParentFolder() != new_parent) + if (new_parent != NULL) + { + // Item is to be moved and we found its new parent in the panel's directory, so move the item's UI. + view_item->getParentFolder()->extractItem(view_item); + view_item->addToFolder(new_parent, mFolders); + } + else { - if (new_parent != NULL) - { - // Item is to be moved and we found its new parent in the panel's directory, so move the item's UI. - view_item->getParentFolder()->extractItem(view_item); - view_item->addToFolder(new_parent, mFolders); - } - else - { - // Item is to be moved outside the panel's directory (e.g. moved to trash for a panel that - // doesn't include trash). Just remove the item's UI. - view_item->destroyView(); - } + // Item is to be moved outside the panel's directory (e.g. moved to trash for a panel that + // doesn't include trash). Just remove the item's UI. + view_item->destroyView(); } } } - - // This item has been removed from memory, but its associated UI element still exists. - if (!model_item && view_item) - { - // Remove the item's UI. - view_item->destroyView(); - } + } + + ////////////////////////////// + // REMOVE Operation + // This item has been removed from memory, but its associated UI element still exists. + if (!model_item && view_item) + { + // Remove the item's UI. + view_item->destroyView(); } } } + /* I don't think we need this code, but not positive -- Seraph if (!handled) { - // it's a small change that only requires a refresh. + // It's a small change that only requires a refresh. // *TODO: figure out a more efficient way to do the refresh // since it is expensive on large inventories mFolders->refresh(); } + */ } // static void LLInventoryPanel::onIdle(void *userdata) { LLInventoryPanel *self = (LLInventoryPanel*)userdata; - // inventory just initialized, do complete build + // Inventory just initialized, do complete build if (!self->mViewsInitialized && gInventory.isInventoryUsable()) { self->initializeViews(); @@ -388,8 +414,7 @@ void LLInventoryPanel::onIdle(void *userdata) void LLInventoryPanel::initializeViews() { - if (!gInventory.isInventoryUsable()) - return; + if (!gInventory.isInventoryUsable()) return; // Determine the root folder in case specified, and // build the views starting with that folder. @@ -412,7 +437,7 @@ void LLInventoryPanel::initializeViews() void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) { - // Destroy the old view for this ID so we can rebuild it + // Destroy the old view for this ID so we can rebuild it. LLFolderViewItem* old_view = mFolders->getItemByID(id); if (old_view && id.notNull()) { @@ -437,21 +462,21 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) } else if ((mStartFolderID != LLUUID::null) && (!gInventory.isObjectDescendentOf(id, mStartFolderID))) { - // This item exists outside the inventory's hierarchy, - // so don't add it. + // This item exists outside the inventory's hierarchy, so don't add it. return; } if (objectp->getType() <= LLAssetType::AT_NONE || objectp->getType() >= LLAssetType::AT_COUNT) { - llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " << - ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() << llendl; + llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " + << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() + << llendl; return; } - if (objectp->getType() == LLAssetType::AT_CATEGORY && - objectp->getActualType() != LLAssetType::AT_LINK_FOLDER) + if ((objectp->getType() == LLAssetType::AT_CATEGORY) && + (objectp->getActualType() != LLAssetType::AT_LINK_FOLDER)) { LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(objectp->getType(), objectp->getType(), @@ -471,9 +496,8 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) folderp->setItemSortOrder(mFolders->getSortOrder()); itemp = folderp; - // Hide the root folder, so we can show the contents of a folder - // flat but still have the parent folder present for listener-related - // operations. + // Hide the root folder, so we can show the contents of a folder flat + // but still have the parent folder present for listener-related operations. if (id == mStartFolderID) { folderp->setDontShowInHierarchy(TRUE); @@ -482,7 +506,7 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) } else { - // Build new view for item + // Build new view for item. LLInventoryItem* item = (LLInventoryItem*)objectp; LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(item->getType(), item->getActualType(), @@ -518,23 +542,26 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) { LLViewerInventoryCategory::cat_array_t* categories; LLViewerInventoryItem::item_array_t* items; - mInventory->lockDirectDescendentArrays(id, categories, items); + if(categories) { - S32 count = categories->count(); - for(S32 i = 0; i < count; ++i) + for (LLViewerInventoryCategory::cat_array_t::const_iterator cat_iter = categories->begin(); + cat_iter != categories->end(); + ++cat_iter) { - LLInventoryCategory* cat = categories->get(i); + const LLViewerInventoryCategory* cat = (*cat_iter); buildNewViews(cat->getUUID()); } } + if(items) { - S32 count = items->count(); - for(S32 i = 0; i < count; ++i) + for (LLViewerInventoryItem::item_array_t::const_iterator item_iter = items->begin(); + item_iter != items->end(); + ++item_iter) { - LLInventoryItem* item = items->get(i); + const LLViewerInventoryItem* item = (*item_iter); buildNewViews(item->getUUID()); } } @@ -562,39 +589,6 @@ void LLInventoryPanel::defaultOpenInventory() } } -struct LLConfirmPurgeData -{ - LLUUID mID; - LLInventoryModel* mModel; -}; - -class LLIsNotWorn : public LLInventoryCollectFunctor -{ -public: - LLIsNotWorn() {} - virtual ~LLIsNotWorn() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item) - { - return !gAgentWearables.isWearingItem(item->getUUID()); - } -}; - -class LLOpenFolderByID : public LLFolderViewFunctor -{ -public: - LLOpenFolderByID(const LLUUID& id) : mID(id) {} - virtual ~LLOpenFolderByID() {} - virtual void doFolder(LLFolderViewFolder* folder) - { - if (folder->getListener() && folder->getListener()->getUUID() == mID) folder->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP); - } - virtual void doItem(LLFolderViewItem* item) {} -protected: - const LLUUID& mID; -}; - - void LLInventoryPanel::openSelected() { LLFolderViewItem* folder_item = mFolders->getCurSelectedItem(); @@ -659,7 +653,6 @@ void LLInventoryPanel::onFocusReceived() LLPanel::onFocusReceived(); } - void LLInventoryPanel::openAllFolders() { mFolders->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_DOWN); @@ -696,8 +689,6 @@ void LLInventoryPanel::onSelectionChange(const std::deque<LLFolderViewItem*>& it // Seraph - Put determineFolderType in here for ensemble typing? } -//---------------------------------------------------------------------------- - void LLInventoryPanel::doToSelected(const LLSD& userdata) { mFolders->doToSelected(&gInventory, userdata); @@ -855,55 +846,70 @@ bool LLInventoryPanel::attachObject(const LLSD& userdata) return true; } +BOOL LLInventoryPanel::getSinceLogoff() +{ + return getFilter()->isSinceLogoff(); +} -//---------------------------------------------------------------------------- - -// static DEBUG ONLY: +// DEBUG ONLY +// static void LLInventoryPanel::dumpSelectionInformation(void* user_data) { LLInventoryPanel* iv = (LLInventoryPanel*)user_data; iv->mFolders->dumpSelectionInformation(); } -BOOL LLInventoryPanel::getSinceLogoff() +BOOL is_inventorysp_active() { - return mFolders->getFilter()->isSinceLogoff(); + if (!LLSideTray::getInstance()->isPanelActive("sidepanel_inventory")) return FALSE; + LLSidepanelInventory *inventorySP = dynamic_cast<LLSidepanelInventory *>(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); + if (!inventorySP) return FALSE; + return inventorySP->isMainInventoryPanelActive(); } -void example_param_block_usage() +// static +LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) { - LLInventoryPanel::Params param_block; - param_block.name(std::string("inventory")); - - param_block.sort_order_setting(LLInventoryPanel::RECENTITEMS_SORT_ORDER); - param_block.allow_multi_select(true); - param_block.filter(LLInventoryPanel::Filter() - .sort_order(1) - .types(0xffff0000)); - param_block.inventory(&gInventory); - param_block.has_border(true); - - LLUICtrlFactory::create<LLInventoryPanel>(param_block); - - param_block = LLInventoryPanel::Params(); - param_block.name(std::string("inventory")); - - //LLSD param_block_sd; - //param_block_sd["sort_order_setting"] = LLInventoryPanel::RECENTITEMS_SORT_ORDER; - //param_block_sd["allow_multi_select"] = true; - //param_block_sd["filter"]["sort_order"] = 1; - //param_block_sd["filter"]["types"] = (S32)0xffff0000; - //param_block_sd["has_border"] = true; - - //LLInitParam::LLSDParser(param_block_sd).parse(param_block); - - LLUICtrlFactory::create<LLInventoryPanel>(param_block); -} + // A. If the inventory side panel is open, use that preferably. + if (is_inventorysp_active()) + { + LLSidepanelInventory *inventorySP = dynamic_cast<LLSidepanelInventory *>(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); + if (inventorySP) + { + return inventorySP->getActivePanel(); + } + } + + // B. Iterate through the inventory floaters and return whichever is on top. + LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory"); + S32 z_min = S32_MAX; + LLInventoryPanel* res = NULL; + for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) + { + LLFloaterInventory* iv = dynamic_cast<LLFloaterInventory*>(*iter); + if (iv && iv->getVisible()) + { + S32 z_order = gFloaterView->getZOrder(iv); + if (z_order < z_min) + { + res = iv->getPanel(); + z_min = z_order; + } + } + } + if (res) return res; + + // C. If no panels are open and we don't want to force open a panel, then just abort out. + if (!auto_open) return NULL; + + // D. Open the inventory side panel and use that. + LLSD key; + LLSidepanelInventory *sidepanel_inventory = + dynamic_cast<LLSidepanelInventory *>(LLSideTray::getInstance()->showPanel("sidepanel_inventory", key)); + if (sidepanel_inventory) + { + return sidepanel_inventory->getActivePanel(); + } -// +=================================================+ -// | LLInventoryPanelObserver | -// +=================================================+ -void LLInventoryPanelObserver::changed(U32 mask) -{ - mIP->modelChanged(mask); + return NULL; } diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index fd23b375fa..cbbd433c1d 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -126,8 +126,8 @@ public: void setSelectCallback(const LLFolderView::signal_t::slot_type& cb) { if (mFolders) mFolders->setSelectCallback(cb); } void clearSelection(); LLInventoryFilter* getFilter(); - void setFilterTypes(U64 filter, BOOL filter_for_categories = FALSE); // if filter_for_categories is true, operate on folder preferred asset type - U32 getFilterTypes() const { return mFolders->getFilterTypes(); } + void setFilterTypes(U64 filter, LLInventoryFilter::EFilterType = LLInventoryFilter::FILTERTYPE_OBJECT); + U32 getFilterObjectTypes() const { return mFolders->getFilterObjectTypes(); } void setFilterPermMask(PermissionMask filter_perm_mask); U32 getFilterPermMask() const { return mFolders->getFilterPermissions(); } void setFilterSubString(const std::string& string); @@ -162,11 +162,10 @@ public: static void onIdle(void* user_data); -private: + // Find whichever inventory panel is active / on top. + // "Auto_open" determines if we open an inventory panel if none are open. + static LLInventoryPanel *getActiveInventoryPanel(BOOL auto_open = TRUE); - // Given the id and the parent, build all of the folder views. - void rebuildViewsFor(const LLUUID& id); - virtual void buildNewViews(const LLUUID& id); // made virtual to support derived classes. EXT-719 protected: void defaultOpenInventory(); // open the first level of inventory @@ -192,12 +191,15 @@ protected: //-------------------------------------------------------------------- public: BOOL getIsViewsInitialized() const { return mViewsInitialized; } -private: + const LLUUID& getStartFolderID() const { return mStartFolderID; } +protected: // Builds the UI. Call this once the inventory is usable. void initializeViews(); + void rebuildViewsFor(const LLUUID& id); // Given the id and the parent, build all of the folder views. + virtual void buildNewViews(const LLUUID& id); +private: BOOL mBuildDefaultHierarchy; // default inventory hierarchy should be created in postBuild() BOOL mViewsInitialized; // Views have been generated - // UUID of category from which hierarchy should be built. Set with the // "start_folder" xml property. Default is LLUUID::null that means total Inventory hierarchy. std::string mStartFolderString; diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp index d50b68b624..08d56f8b9f 100644 --- a/indra/newview/lllandmarkactions.cpp +++ b/indra/newview/lllandmarkactions.cpp @@ -39,7 +39,7 @@ #include "lllandmark.h" #include "llparcel.h" -#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llagent.h" #include "llagentui.h" @@ -267,7 +267,7 @@ void LLLandmarkActions::createLandmarkHere( } if (!canCreateLandmarkHere()) { - LLNotifications::instance().add("CannotCreateLandmarkNotOwner"); + LLNotificationsUtil::add("CannotCreateLandmarkNotOwner"); return; } @@ -420,5 +420,5 @@ void copy_slurl_to_clipboard_callback(const std::string& slurl) gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(slurl)); LLSD args; args["SLURL"] = slurl; - LLNotifications::instance().add("CopySLURL", args); + LLNotificationsUtil::add("CopySLURL", args); } diff --git a/indra/newview/lllandmarklist.cpp b/indra/newview/lllandmarklist.cpp index 83e694951b..d613cf6ba4 100644 --- a/indra/newview/lllandmarklist.cpp +++ b/indra/newview/lllandmarklist.cpp @@ -146,12 +146,12 @@ void LLLandmarkList::processGetAssetReply( if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ) { LL_WARNS("Landmarks") << "Missing Landmark" << LL_ENDL; - //LLNotifications::instance().add("LandmarkMissing"); + //LLNotificationsUtil::add("LandmarkMissing"); } else { LL_WARNS("Landmarks") << "Unable to load Landmark" << LL_ENDL; - //LLNotifications::instance().add("UnableToLoadLandmark"); + //LLNotificationsUtil::add("UnableToLoadLandmark"); } gLandmarkList.mBadList.insert(uuid); diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 6b28edf0b6..758d8ff903 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -158,8 +158,10 @@ LLLocationInputCtrl::Params::Params() add_landmark_image_disabled("add_landmark_image_disabled"), add_landmark_image_hover("add_landmark_image_hover"), add_landmark_image_selected("add_landmark_image_selected"), + add_landmark_hpad("add_landmark_hpad", 0), icon_hpad("icon_hpad", 0), add_landmark_button("add_landmark_button"), + for_sale_button("for_sale_button"), info_button("info_button"), voice_icon("voice_icon"), fly_icon("fly_icon"), @@ -174,9 +176,11 @@ LLLocationInputCtrl::Params::Params() LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) : LLComboBox(p), mIconHPad(p.icon_hpad), - mInfoBtn(NULL), + mAddLandmarkHPad(p.add_landmark_hpad), mLocationContextMenu(NULL), mAddLandmarkBtn(NULL), + mForSaleBtn(NULL), + mInfoBtn(NULL), mLandmarkImageOn(NULL), mLandmarkImageOff(NULL) { @@ -237,33 +241,56 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) mAddLandmarkBtn = LLUICtrlFactory::create<LLButton>(al_params); enableAddLandmarkButton(true); addChild(mAddLandmarkBtn); + + LLButton::Params for_sale_button = p.for_sale_button; + for_sale_button.tool_tip = LLTrans::getString("LocationCtrlForSaleTooltip"); + for_sale_button.click_callback.function( + boost::bind(&LLLocationInputCtrl::onForSaleButtonClicked, this)); + mForSaleBtn = LLUICtrlFactory::create<LLButton>( for_sale_button ); + addChild(mForSaleBtn); // Parcel property icons + // Must be mouse-opaque so cursor stays as an arrow when hovering to + // see tooltip. LLIconCtrl::Params voice_icon = p.voice_icon; + voice_icon.tool_tip = LLTrans::getString("LocationCtrlVoiceTooltip"); + voice_icon.mouse_opaque = true; mParcelIcon[VOICE_ICON] = LLUICtrlFactory::create<LLIconCtrl>(voice_icon); addChild(mParcelIcon[VOICE_ICON]); LLIconCtrl::Params fly_icon = p.fly_icon; + fly_icon.tool_tip = LLTrans::getString("LocationCtrlFlyTooltip"); + fly_icon.mouse_opaque = true; mParcelIcon[FLY_ICON] = LLUICtrlFactory::create<LLIconCtrl>(fly_icon); addChild(mParcelIcon[FLY_ICON]); LLIconCtrl::Params push_icon = p.push_icon; + push_icon.tool_tip = LLTrans::getString("LocationCtrlPushTooltip"); + push_icon.mouse_opaque = true; mParcelIcon[PUSH_ICON] = LLUICtrlFactory::create<LLIconCtrl>(push_icon); addChild(mParcelIcon[PUSH_ICON]); LLIconCtrl::Params build_icon = p.build_icon; + build_icon.tool_tip = LLTrans::getString("LocationCtrlBuildTooltip"); + build_icon.mouse_opaque = true; mParcelIcon[BUILD_ICON] = LLUICtrlFactory::create<LLIconCtrl>(build_icon); addChild(mParcelIcon[BUILD_ICON]); LLIconCtrl::Params scripts_icon = p.scripts_icon; + scripts_icon.tool_tip = LLTrans::getString("LocationCtrlScriptsTooltip"); + scripts_icon.mouse_opaque = true; mParcelIcon[SCRIPTS_ICON] = LLUICtrlFactory::create<LLIconCtrl>(scripts_icon); addChild(mParcelIcon[SCRIPTS_ICON]); LLIconCtrl::Params damage_icon = p.damage_icon; + damage_icon.tool_tip = LLTrans::getString("LocationCtrlDamageTooltip"); + damage_icon.mouse_opaque = true; mParcelIcon[DAMAGE_ICON] = LLUICtrlFactory::create<LLIconCtrl>(damage_icon); addChild(mParcelIcon[DAMAGE_ICON]); LLTextBox::Params damage_text = p.damage_text; + damage_text.tool_tip = LLTrans::getString("LocationCtrlDamageTooltip"); + damage_text.mouse_opaque = true; mDamageText = LLUICtrlFactory::create<LLTextBox>(damage_text); addChild(mDamageText); @@ -462,7 +489,12 @@ void LLLocationInputCtrl::draw() void LLLocationInputCtrl::onInfoButtonClicked() { - LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "agent")); + LLSideTray::getInstance()->showPanel("panel_places", LLSD().with("type", "agent")); +} + +void LLLocationInputCtrl::onForSaleButtonClicked() +{ + handle_buy_land(); } void LLLocationInputCtrl::onAddLandmarkButtonClicked() @@ -479,7 +511,7 @@ void LLLocationInputCtrl::onAddLandmarkButtonClicked() } else { - LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "create_landmark")); + LLSideTray::getInstance()->showPanel("panel_places", LLSD().with("type", "create_landmark")); } } @@ -605,17 +637,30 @@ void LLLocationInputCtrl::refreshLocation() setText(location_name); } +// returns new right edge +static S32 layout_widget(LLUICtrl* widget, S32 right) +{ + if (widget->getVisible()) + { + LLRect rect = widget->getRect(); + rect.mLeft = right - rect.getWidth(); + rect.mRight = right; + widget->setRect( rect ); + right -= rect.getWidth(); + } + return right; +} + void LLLocationInputCtrl::refreshParcelIcons() { // Our "cursor" moving right to left - S32 x = mAddLandmarkBtn->getRect().mLeft - mIconHPad; + S32 x = mAddLandmarkBtn->getRect().mLeft; static LLUICachedControl<bool> show_properties("NavBarShowParcelProperties", false); if (show_properties) { LLViewerParcelMgr* vpm = LLViewerParcelMgr::getInstance(); - // *TODO buy - //bool allow_buy = vpm->canAgentBuyParcel( vpm->getAgentParcel(), false); + bool allow_buy = vpm->canAgentBuyParcel( vpm->getAgentParcel(), false); bool allow_voice = vpm->allowAgentVoice(); bool allow_fly = vpm->allowAgentFly(); bool allow_push = vpm->allowAgentPush(); @@ -624,6 +669,7 @@ void LLLocationInputCtrl::refreshParcelIcons() bool allow_damage = vpm->allowAgentDamage(); // Most icons are "block this ability" + mForSaleBtn->setVisible(allow_buy); mParcelIcon[VOICE_ICON]->setVisible( !allow_voice ); mParcelIcon[FLY_ICON]->setVisible( !allow_fly ); mParcelIcon[PUSH_ICON]->setVisible( !allow_push ); @@ -632,28 +678,22 @@ void LLLocationInputCtrl::refreshParcelIcons() mParcelIcon[DAMAGE_ICON]->setVisible( allow_damage ); mDamageText->setVisible(allow_damage); - // Slide the parcel icons rect from right to left, adjusting rectangles of - // visible icons. Assumes all icon rects are the same. + x = layout_widget(mForSaleBtn, x); + // Padding goes to left of both landmark star and for sale btn + x -= mAddLandmarkHPad; + + // Slide the parcel icons rect from right to left, adjusting rectangles for (S32 i = 0; i < ICON_COUNT; ++i) { - LLIconCtrl* icon = mParcelIcon[i]; - if (icon->getVisible()) - { - LLRect r = icon->getRect(); - r.mLeft = x - r.getWidth(); - r.mRight = x; - icon->setRect( r ); - x -= r.getWidth() + mIconHPad; - } + x = layout_widget(mParcelIcon[i], x); + x -= mIconHPad; } - LLRect text_rect = mDamageText->getRect(); - text_rect.mLeft = x - text_rect.getWidth(); - text_rect.mRight = x; - mDamageText->setRect(text_rect); - x -= text_rect.getWidth() + mIconHPad; + x = layout_widget(mDamageText, x); + x -= mIconHPad; } else { + mForSaleBtn->setVisible(false); for (S32 i = 0; i < ICON_COUNT; ++i) { mParcelIcon[i]->setVisible(false); @@ -664,8 +704,6 @@ void LLLocationInputCtrl::refreshParcelIcons() S32 left_pad, right_pad; mTextEntry->getTextPadding(&left_pad, &right_pad); right_pad = mTextEntry->getRect().mRight - x; - llinfos << "JAMESDEBUG text entry rect " << mTextEntry->getRect() - << " x " << x << " left_pad " << left_pad << " right_pad " << right_pad << llendl; mTextEntry->setTextPadding(left_pad, right_pad); } @@ -822,12 +860,12 @@ void LLLocationInputCtrl::onLocationContextMenuItemClicked(const LLSD& userdata) if(!landmark) { - LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "create_landmark")); + LLSideTray::getInstance()->showPanel("panel_places", LLSD().with("type", "create_landmark")); } else { LLSideTray::getInstance()->showPanel("panel_places", - LLSD().insert("type", "landmark").insert("id",landmark->getUUID())); + LLSD().with("type", "landmark").with("id",landmark->getUUID())); } } else if (item == "cut") @@ -874,7 +912,7 @@ bool LLLocationInputCtrl::onLocationContextMenuItemEnabled(const LLSD& userdata) } else if (item == "can_select_all") { - return mTextEntry->canSelectAll(); + return mTextEntry->canSelectAll() && (mTextEntry->getLength() > 0); } else if(item == "show_coordinates") { diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h index 3bd23e80a9..0211062b05 100644 --- a/indra/newview/lllocationinputctrl.h +++ b/indra/newview/lllocationinputctrl.h @@ -65,8 +65,10 @@ public: add_landmark_image_disabled, add_landmark_image_hover, add_landmark_image_selected; - Optional<S32> icon_hpad; + Optional<S32> icon_hpad, + add_landmark_hpad; Optional<LLButton::Params> add_landmark_button, + for_sale_button, info_button; Optional<LLIconCtrl::Params> voice_icon, fly_icon, @@ -130,6 +132,7 @@ private: void onLocationPrearrange(const LLSD& data); void onTextEditorRightClicked(S32 x, S32 y, MASK mask); void onLandmarkLoaded(LLLandmark* lm); + void onForSaleButtonClicked(); void onAddLandmarkButtonClicked(); void onAgentParcelChange(); // callbacks @@ -138,8 +141,10 @@ private: LLMenuGL* mLocationContextMenu; LLButton* mAddLandmarkBtn; + LLButton* mForSaleBtn; LLButton* mInfoBtn; - S32 mIconHPad; + S32 mIconHPad; // pad between all icons + S32 mAddLandmarkHPad; // pad to left of landmark star enum EParcelIcon { diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 941ccc227c..33fd3e3bf1 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -32,15 +32,59 @@ #include "llviewerprecompiledheaders.h" +#include "llagent.h" +#include "llagentui.h" #include "lllogchat.h" -#include "llappviewer.h" #include "llfloaterchat.h" #include "lltrans.h" #include "llviewercontrol.h" -#include "llsdserialize.h" + +#include <boost/algorithm/string/trim.hpp> +#include <boost/algorithm/string/replace.hpp> +#include <boost/regex.hpp> +#include <boost/regex/v4/match_results.hpp> const S32 LOG_RECALL_SIZE = 2048; +const static std::string IM_TIME("time"); +const static std::string IM_TEXT("message"); +const static std::string IM_FROM("from"); +const static std::string IM_FROM_ID("from_id"); +const static std::string IM_SEPARATOR(": "); + +const static std::string NEW_LINE("\n"); +const static std::string NEW_LINE_SPACE_PREFIX("\n "); +const static std::string TWO_SPACES(" "); +const static std::string MULTI_LINE_PREFIX(" "); + +//viewer 1.23 may have used "You" for Agent's entries +const static std::string YOU("You"); + +/** + * Chat log lines - timestamp and name are optional but message text is mandatory. + * + * Typical plain text chat log lines: + * + * SuperCar: You aren't the owner + * [2:59] SuperCar: You aren't the owner + * [2009/11/20 3:00] SuperCar: You aren't the owner + * Katar Ivercourt is Offline + * [3:00] Katar Ivercourt is Offline + * [2009/11/20 3:01] Corba ProductEngine is Offline + */ +const static boost::regex TIMESTAMP_AND_STUFF("^(\\[\\d{4}/\\d{1,2}/\\d{1,2}\\s+\\d{1,2}:\\d{2}\\]\\s+|\\[\\d{1,2}:\\d{2}\\]\\s+)?(.*)$"); + +/** + * Regular expression suitable to match names like + * "You", "Second Life", "Igor ProductEngine", "Object", "Mega House" + */ +const static boost::regex NAME_AND_TEXT("(You:|Second Life:|[^\\s:]+\\s*[:]{1}|\\S+\\s+[^\\s:]+[:]{1})?(\\s*)(.*)"); + +const static int IDX_TIMESTAMP = 1; +const static int IDX_STUFF = 2; +const static int IDX_NAME = 1; +const static int IDX_TEXT = 3; + //static std::string LLLogChat::makeLogFileName(std::string filename) { @@ -77,12 +121,12 @@ std::string LLLogChat::timestamp(bool withdate) +LLTrans::getString ("TimeMonth")+"]/[" +LLTrans::getString ("TimeDay")+"] [" +LLTrans::getString ("TimeHour")+"]:[" - +LLTrans::getString ("TimeMin")+"] "; + +LLTrans::getString ("TimeMin")+"]"; } else { timeStr = "[" + LLTrans::getString("TimeHour") + "]:[" - + LLTrans::getString ("TimeMin")+"] "; + + LLTrans::getString ("TimeMin")+"]"; } LLStringUtil::format (timeStr, substitution); @@ -118,7 +162,7 @@ void LLLogChat::saveHistory(const std::string& filename, item["from_id"] = from_id; item["message"] = line; - file << LLSDOStreamer <LLSDNotationFormatter>(item) << std::endl; + file << LLChatLogFormatter(item) << std::endl; file.close(); } @@ -154,9 +198,6 @@ void LLLogChat::loadHistory(const std::string& filename, void (*callback)(ELogLi } } - // the parser's destructor is protected so we cannot create in the stack. - LLPointer<LLSDParser> parser = new LLSDNotationParser(); - while ( fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr) ) { len = strlen(buffer) - 1; /*Flawfinder: ignore*/ @@ -167,7 +208,8 @@ void LLLogChat::loadHistory(const std::string& filename, void (*callback)(ELogLi LLSD item; std::string line(buffer); std::istringstream iss(line); - if (parser->parse(iss, item, line.length()) == LLSDParser::PARSE_FAILURE) + + if (!LLChatLogParser::parse(line, item)) { item["message"] = line; callback(LOG_LINE, item, userdata); @@ -187,3 +229,197 @@ void LLLogChat::loadHistory(const std::string& filename, void (*callback)(ELogLi fclose(fptr); } } + +void append_to_last_message(std::list<LLSD>& messages, const std::string& line) +{ + if (!messages.size()) return; + + std::string im_text = messages.back()[IM_TEXT].asString(); + im_text.append(line); + messages.back()[IM_TEXT] = im_text; +} + +void LLLogChat::loadAllHistory(const std::string& session_name, std::list<LLSD>& messages) +{ + if (session_name.empty()) + { + llwarns << "Session name is Empty!" << llendl; + return ; + } + + LLFILE* fptr = LLFile::fopen(makeLogFileName(session_name), "r"); /*Flawfinder: ignore*/ + if (!fptr) return; //No previous conversation with this name. + + char buffer[LOG_RECALL_SIZE]; /*Flawfinder: ignore*/ + char *bptr; + S32 len; + bool firstline = TRUE; + + if (fseek(fptr, (LOG_RECALL_SIZE - 1) * -1 , SEEK_END)) + { //File is smaller than recall size. Get it all. + firstline = FALSE; + if (fseek(fptr, 0, SEEK_SET)) + { + fclose(fptr); + return; + } + } + + while (fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr)) + { + len = strlen(buffer) - 1; /*Flawfinder: ignore*/ + for (bptr = (buffer + len); (*bptr == '\n' || *bptr == '\r') && bptr>buffer; bptr--) *bptr='\0'; + + if (firstline) + { + firstline = FALSE; + continue; + } + + std::string line(buffer); + + //updated 1.23 plaint text log format requires a space added before subsequent lines in a multilined message + if (' ' == line[0]) + { + line.erase(0, MULTI_LINE_PREFIX.length()); + append_to_last_message(messages, '\n' + line); + } + else if (0 == len && ('\n' == line[0] || '\r' == line[0])) + { + //to support old format's multilined messages with new lines used to divide paragraphs + append_to_last_message(messages, line); + } + else + { + LLSD item; + if (!LLChatLogParser::parse(line, item)) + { + item[IM_TEXT] = line; + } + messages.push_back(item); + } + } + fclose(fptr); +} + +//*TODO mark object's names in a special way so that they will be distinguishable form avatar name +//which are more strict by its nature (only firstname and secondname) +//Example, an object's name can be writen like "Object <actual_object's_name>" +void LLChatLogFormatter::format(const LLSD& im, std::ostream& ostr) const +{ + if (!im.isMap()) + { + llwarning("invalid LLSD type of an instant message", 0); + return; + } + + if (im[IM_TIME].isDefined()) + { + std::string timestamp = im[IM_TIME].asString(); + boost::trim(timestamp); + ostr << '[' << timestamp << ']' << TWO_SPACES; + } + + //*TODO mark object's names in a special way so that they will be distinguishable form avatar name + //which are more strict by its nature (only firstname and secondname) + //Example, an object's name can be writen like "Object <actual_object's_name>" + if (im[IM_FROM].isDefined()) + { + std::string from = im[IM_FROM].asString(); + boost::trim(from); + if (from.size()) + { + ostr << from << IM_SEPARATOR; + } + } + + if (im[IM_TEXT].isDefined()) + { + std::string im_text = im[IM_TEXT].asString(); + + //multilined text will be saved with prepended spaces + boost::replace_all(im_text, NEW_LINE, NEW_LINE_SPACE_PREFIX); + ostr << im_text; + } +} + +bool LLChatLogParser::parse(std::string& raw, LLSD& im) +{ + if (!raw.length()) return false; + + im = LLSD::emptyMap(); + + //matching a timestamp + boost::match_results<std::string::const_iterator> matches; + if (!boost::regex_match(raw, matches, TIMESTAMP_AND_STUFF)) return false; + + bool has_timestamp = matches[IDX_TIMESTAMP].matched; + if (has_timestamp) + { + //timestamp was successfully parsed + std::string timestamp = matches[IDX_TIMESTAMP]; + boost::trim(timestamp); + timestamp.erase(0, 1); + timestamp.erase(timestamp.length()-1, 1); + im[IM_TIME] = timestamp; + } + else + { + //timestamp is optional + im[IM_TIME] = ""; + } + + bool has_stuff = matches[IDX_STUFF].matched; + if (!has_stuff) + { + return false; //*TODO should return false or not? + } + + //matching a name and a text + std::string stuff = matches[IDX_STUFF]; + boost::match_results<std::string::const_iterator> name_and_text; + if (!boost::regex_match(stuff, name_and_text, NAME_AND_TEXT)) return false; + + bool has_name = name_and_text[IDX_NAME].matched; + std::string name = name_and_text[IDX_NAME]; + + //we don't need a name/text separator + if (has_name && name.length() && name[name.length()-1] == ':') + { + name.erase(name.length()-1, 1); + } + + if (!has_name || name == SYSTEM_FROM) + { + //name is optional too + im[IM_FROM] = SYSTEM_FROM; + im[IM_FROM_ID] = LLUUID::null; + } + + if (!has_name) + { + //text is mandatory + im[IM_TEXT] = stuff; + return true; //parse as a message from Second Life + } + + bool has_text = name_and_text[IDX_TEXT].matched; + if (!has_text) return false; + + //for parsing logs created in very old versions of a viewer + if (name == "You") + { + std::string agent_name; + LLAgentUI::buildFullname(agent_name); + im[IM_FROM] = agent_name; + im[IM_FROM_ID] = gAgentID; + } + else + { + im[IM_FROM] = name; + } + + + im[IM_TEXT] = name_and_text[IDX_TEXT]; + return true; //parsed name and message text, maybe have a timestamp too +} diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h index e252cd7d41..3d3f5c4458 100644 --- a/indra/newview/lllogchat.h +++ b/indra/newview/lllogchat.h @@ -51,11 +51,66 @@ public: const LLUUID& from_id, const std::string& line); + /** @deprecated @see loadAllHistory() */ static void loadHistory(const std::string& filename, void (*callback)(ELogLineType, const LLSD&, void*), void* userdata); + + static void loadAllHistory(const std::string& session_name, std::list<LLSD>& messages); private: static std::string cleanFileName(std::string filename); }; +/** + * Formatter for the plain text chat log files + */ +class LLChatLogFormatter +{ +public: + LLChatLogFormatter(const LLSD& im) : mIM(im) {} + virtual ~LLChatLogFormatter() {}; + + friend std::ostream& operator<<(std::ostream& str, const LLChatLogFormatter& formatter) + { + formatter.format(formatter.mIM, str); + return str; + } + +protected: + + /** + * Format an instant message to a stream + * Timestamps and sender names are required + * New lines of multilined messages are prepended with a space + */ + void format(const LLSD& im, std::ostream& ostr) const; + + LLSD mIM; +}; + +/** + * Parser for the plain text chat log files + */ +class LLChatLogParser +{ +public: + + /** + * Parse a line from the plain text chat log file + * General plain text log format is like: "[timestamp] [name]: [message]" + * [timestamp] and [name] are optional + * Examples of plain text chat log lines: + * "[2009/11/20 2:53] Igor ProductEngine: howdy" + * "Igor ProductEngine: howdy" + * "Dserduk ProductEngine is Online" + * + * @return false if failed to parse mandatory data - message text + */ + static bool parse(std::string& raw, LLSD& im); + +protected: + LLChatLogParser(); + virtual ~LLChatLogParser() {}; +}; + #endif diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 932a3d8a83..765b504afe 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -1440,7 +1440,7 @@ void LLManipTranslate::renderSnapGuides() LLVector3 help_text_pos = selection_center_start + (snap_offset_meters_up * 3.f * mSnapOffsetAxis); const LLFontGL* big_fontp = LLFontGL::getFontSansSerif(); - std::string help_text = "Move mouse cursor over ruler to snap"; + std::string help_text = "Move mouse cursor over ruler"; LLColor4 help_text_color = LLColor4::white; help_text_color.mV[VALPHA] = clamp_rescale(mHelpTextTimer.getElapsedTimeF32(), sHelpTextVisibleTime, sHelpTextVisibleTime + sHelpTextFadeTime, line_alpha, 0.f); hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 2376a3581d..f32866b1fe 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -45,7 +45,7 @@ #include "llviewermedia.h" #include "llviewertexture.h" #include "llviewerwindow.h" -#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llweb.h" #include "llrender.h" #include "llpluginclassmedia.h" @@ -839,7 +839,7 @@ void LLMediaCtrl::convertInputCoords(S32& x, S32& y) // static bool LLMediaCtrl::onClickLinkExternalTarget(const LLSD& notification, const LLSD& response ) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if ( 0 == option ) { // open in external browser because we don't support @@ -969,7 +969,7 @@ void LLMediaCtrl::onClickLinkHref( LLPluginClassMedia* self ) mExternalUrl = url; LLSD payload; payload["external_url"] = mExternalUrl; - LLNotifications::instance().add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget); + LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget); return; } } diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index 36cf2c1aa8..b520bc1c2d 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -298,7 +298,7 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags) if ((mute.mType == LLMute::AGENT) && isLinden(mute.mName) && (flags & LLMute::flagTextChat || flags == 0)) { - LLNotifications::instance().add("MuteLinden"); + LLNotifications::instance().add("MuteLinden", LLSD(), LLSD()); return FALSE; } @@ -517,7 +517,7 @@ void notify_automute_callback(const LLUUID& agent_id, const std::string& first_n args["FIRST"] = first_name; args["LAST"] = last_name; - LLNotificationPtr notif_ptr = LLNotifications::instance().add(notif_name, args); + LLNotificationPtr notif_ptr = LLNotifications::instance().add(notif_name, args, LLSD()); if (notif_ptr) { std::string message = notif_ptr->getMessage(); diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index 41376c4c09..e65b7d8a0c 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -561,7 +561,7 @@ void LLNavigationBar::handleLoginComplete() void LLNavigationBar::invokeSearch(std::string search_text) { - LLFloaterReg::showInstance("search", LLSD().insert("category", "all").insert("id", LLSD(search_text))); + LLFloaterReg::showInstance("search", LLSD().with("category", "all").with("id", LLSD(search_text))); } void LLNavigationBar::clearHistoryCache() diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 80a6cc343f..3a1ae5bf46 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -54,9 +54,11 @@ #include "llstylemap.h" #include "lldraghandle.h" -#include "lltrans.h" + #include "llbottomtray.h" #include "llnearbychatbar.h" +#include "llfloaterreg.h" +#include "lltrans.h" static const S32 RESIZE_BAR_THICKNESS = 3; @@ -130,7 +132,23 @@ void LLNearbyChat::applySavedVariables() } } -void LLNearbyChat::addMessage(const LLChat& chat) +std::string appendTime() +{ + time_t utc_time; + utc_time = time_corrected(); + std::string timeStr ="["+ LLTrans::getString("TimeHour")+"]:[" + +LLTrans::getString("TimeMin")+"] "; + + LLSD substitution; + + substitution["datetime"] = (S32) utc_time; + LLStringUtil::format (timeStr, substitution); + + return timeStr; +} + + +void LLNearbyChat::addMessage(const LLChat& chat,bool archive) { if (chat.mChatType == CHAT_TYPE_DEBUG_MSG) { @@ -150,12 +168,16 @@ void LLNearbyChat::addMessage(const LLChat& chat) return; } } + + LLChat& tmp_chat = const_cast<LLChat&>(chat); + + if(tmp_chat.mTimeStr.empty()) + tmp_chat.mTimeStr = appendTime(); + + bool use_plain_text_chat_history = gSavedSettings.getBOOL("PlainTextChatHistory"); if (!chat.mMuted) { - std::string message = chat.mText; - std::string prefix = message.substr(0, 4); - if (chat.mChatStyle == CHAT_STYLE_IRC) { LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); @@ -168,23 +190,22 @@ void LLNearbyChat::addMessage(const LLChat& chat) append_style_params.readonly_color(txt_color); append_style_params.font.name(font_name); append_style_params.font.size(font_size); - if (chat.mFromName.size() > 0) - { - append_style_params.font.style = "ITALIC"; - LLChat add_chat=chat; - add_chat.mText = chat.mFromName + " "; - mChatHistory->appendMessage(add_chat, false, append_style_params); - } - - message = message.substr(3); append_style_params.font.style = "ITALIC"; - mChatHistory->appendText(message, FALSE, append_style_params); + + mChatHistory->appendMessage(chat, use_plain_text_chat_history, append_style_params); } else { - mChatHistory->appendMessage(chat); + mChatHistory->appendMessage(chat,use_plain_text_chat_history); } } + + if(archive) + { + mMessageArchive.push_back(chat); + if(mMessageArchive.size()>200) + mMessageArchive.erase(mMessageArchive.begin()); + } } void LLNearbyChat::onNearbySpeakers() @@ -206,13 +227,23 @@ bool LLNearbyChat::onNearbyChatCheckContextMenuItem(const LLSD& userdata) return false; } -void LLNearbyChat::onOpen(const LLSD& key ) +void LLNearbyChat::setVisible(BOOL visible) { - LLNotificationsUI::LLScreenChannelBase* chat_channel = LLNotificationsUI::LLChannelManager::getInstance()->findChannelByID(LLUUID(gSavedSettings.getString("NearByChatChannelUUID"))); - if(chat_channel) + if(visible) { - chat_channel->removeToastsFromChannel(); + LLNotificationsUI::LLScreenChannelBase* chat_channel = LLNotificationsUI::LLChannelManager::getInstance()->findChannelByID(LLUUID(gSavedSettings.getString("NearByChatChannelUUID"))); + if(chat_channel) + { + chat_channel->removeToastsFromChannel(); + } } + + LLDockableFloater::setVisible(visible); +} + +void LLNearbyChat::onOpen(const LLSD& key ) +{ + LLDockableFloater::onOpen(key); } void LLNearbyChat::setRect (const LLRect &rect) @@ -224,3 +255,37 @@ void LLNearbyChat::getAllowedRect(LLRect& rect) { rect = gViewerWindow->getWorldViewRectScaled(); } + +void LLNearbyChat::updateChatHistoryStyle() +{ + mChatHistory->clear(); + for(std::vector<LLChat>::iterator it = mMessageArchive.begin();it!=mMessageArchive.end();++it) + { + addMessage(*it,false); + } +} + +//static +void LLNearbyChat::processChatHistoryStyleUpdate(const LLSD& newvalue) +{ + LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); + if(nearby_chat) + nearby_chat->updateChatHistoryStyle(); +} + + +//////////////////////////////////////////////////////////////////////////////// +// +void LLNearbyChat::onFocusReceived() +{ + setBackgroundOpaque(true); + LLPanel::onFocusReceived(); +} + +//////////////////////////////////////////////////////////////////////////////// +// +void LLNearbyChat::onFocusLost() +{ + setBackgroundOpaque(false); + LLPanel::onFocusLost(); +} diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h index 561c2d3677..938b77df7a 100644 --- a/indra/newview/llnearbychat.h +++ b/indra/newview/llnearbychat.h @@ -47,14 +47,24 @@ public: ~LLNearbyChat(); BOOL postBuild (); - void addMessage (const LLChat& message); + void addMessage (const LLChat& message,bool archive = true); void onNearbyChatContextMenuItemClicked(const LLSD& userdata); bool onNearbyChatCheckContextMenuItem(const LLSD& userdata); + // focus overrides + /*virtual*/ void onFocusLost(); + /*virtual*/ void onFocusReceived(); + /*virtual*/ void onOpen (const LLSD& key); + /*virtual*/ void setVisible(BOOL visible); + virtual void setRect (const LLRect &rect); + virtual void updateChatHistoryStyle(); + + static void processChatHistoryStyleUpdate(const LLSD& newvalue); + private: virtual void applySavedVariables(); @@ -66,6 +76,8 @@ private: private: LLHandle<LLView> mPopupMenuHandle; LLChatHistory* mChatHistory; + + std::vector<LLChat> mMessageArchive; }; #endif diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 74a75d0369..169560f688 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -52,8 +52,6 @@ using namespace LLNotificationsUI; LLToastPanelBase* createToastPanel() { LLNearbyChatToastPanel* item = LLNearbyChatToastPanel::createInstance(); - static S32 chat_item_width = 304; - item->setWidth(chat_item_width); return item; } @@ -169,6 +167,29 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification) //look in pool. if there is any message if(mStopProcessing) return; + + /* + find last toast and check ID + */ + + if(m_active_toasts.size()) + { + LLUUID fromID = notification["from_id"].asUUID(); // agent id or object id + LLToast* toast = m_active_toasts[0]; + LLNearbyChatToastPanel* panel = dynamic_cast<LLNearbyChatToastPanel*>(toast->getPanel()); + + if(panel && panel->messageID() == fromID && panel->canAddText()) + { + panel->addMessage(notification); + toast->reshapeToPanel(); + toast->resetTimer(); + + arrangeToasts(); + return; + } + } + + if(m_toast_pool.empty()) { @@ -297,6 +318,8 @@ void LLNearbyChatHandler::initChannel() mChannel->init(channel_right_bound - channel_width, channel_right_bound); } + + void LLNearbyChatHandler::processChat(const LLChat& chat_msg) { if(chat_msg.mMuted == TRUE) @@ -306,6 +329,22 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg) if(chat_msg.mText.empty()) return;//don't process empty messages + + LLChat& tmp_chat = const_cast<LLChat&>(chat_msg); + + if (tmp_chat.mChatStyle == CHAT_STYLE_IRC) + { + if(!tmp_chat.mFromName.empty()) + tmp_chat.mText = tmp_chat.mFromName + " " + tmp_chat.mText.substr(3); + else + tmp_chat.mText = tmp_chat.mText.substr(3); + } + + { + //sometimes its usefull to have no name at all... + //if(tmp_chat.mFromName.empty() && tmp_chat.mFromID!= LLUUID::null) + // tmp_chat.mFromName = tmp_chat.mFromID.asString(); + } LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); nearby_chat->addMessage(chat_msg); diff --git a/indra/newview/llnotificationalerthandler.cpp b/indra/newview/llnotificationalerthandler.cpp index 5c11bc7310..c3df4cbaf4 100644 --- a/indra/newview/llnotificationalerthandler.cpp +++ b/indra/newview/llnotificationalerthandler.cpp @@ -34,6 +34,8 @@ #include "llviewerprecompiledheaders.h" // must be first include #include "llnotificationhandler.h" + +#include "llnotifications.h" #include "lltoastnotifypanel.h" #include "llviewercontrol.h" #include "llviewerwindow.h" diff --git a/indra/newview/llnotificationgrouphandler.cpp b/indra/newview/llnotificationgrouphandler.cpp index b7466ec6d4..6889931956 100644 --- a/indra/newview/llnotificationgrouphandler.cpp +++ b/indra/newview/llnotificationgrouphandler.cpp @@ -38,6 +38,7 @@ #include "llviewercontrol.h" #include "llviewerwindow.h" #include "llnotificationmanager.h" +#include "llnotifications.h" using namespace LLNotificationsUI; @@ -87,6 +88,8 @@ bool LLGroupHandler::processNotification(const LLSD& notify) if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change") { + LLHandlerUtil::logGroupNoticeToIMGroup(notification); + LLPanel* notify_box = new LLToastGroupNotifyPanel(notification); LLToast::Params p; p.notif_id = notification->getID(); diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h index 42cc7cacc2..da8928321a 100644 --- a/indra/newview/llnotificationhandler.h +++ b/indra/newview/llnotificationhandler.h @@ -36,9 +36,10 @@ #include "llwindow.h" -#include "llnotifications.h" +//#include "llnotificationsutil.h" #include "llchannelmanager.h" #include "llchat.h" +#include "llnotificationptr.h" namespace LLNotificationsUI { @@ -256,6 +257,33 @@ protected: void onRejectToast(LLUUID& id); }; +class LLHandlerUtil +{ +public: + /** + * Checks sufficient conditions to log notification message to IM session. + */ + static bool canLogToIM(const LLNotificationPtr& notification); + + /** + * Writes notification message to IM session. + */ + static void logToIM(const EInstantMessage& session_type, + const std::string& session_name, const std::string& from_name, + const std::string& message, const LLUUID& session_owner_id, + const LLUUID& from_id); + + /** + * Writes notification message to IM p2p session. + */ + static void logToIMP2P(const LLNotificationPtr& notification); + + /** + * Writes group notice notification message to IM group session. + */ + static void logGroupNoticeToIMGroup(const LLNotificationPtr& notification); +}; + } #endif diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp new file mode 100644 index 0000000000..857b7e9796 --- /dev/null +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -0,0 +1,130 @@ +/** + * @file llnotificationofferhandler.cpp + * @brief Provides set of utility methods for notifications processing. + * + * $LicenseInfo:firstyear=2000&license=viewergpl$ + * + * Copyright (c) 2000-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + + +#include "llviewerprecompiledheaders.h" // must be first include + +#include "llnotificationhandler.h" +#include "llnotifications.h" +#include "llimview.h" +#include "llagent.h" + +using namespace LLNotificationsUI; + +const static std::string GRANTED_MODIFY_RIGHTS("GrantedModifyRights"), + REVOKED_MODIFY_RIGHTS("RevokedModifyRights"), OBJECT_GIVE_ITEM( + "ObjectGiveItem"), OBJECT_GIVE_ITEM_UNKNOWN_USER( + "ObjectGiveItemUnknownUser"), PAYMENT_RECIVED("PaymentRecived"); + +// static +bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification) +{ + return GRANTED_MODIFY_RIGHTS == notification->getName() + || REVOKED_MODIFY_RIGHTS == notification->getName() + || PAYMENT_RECIVED == notification->getName(); +} + +// static +void LLHandlerUtil::logToIM(const EInstantMessage& session_type, + const std::string& session_name, const std::string& from_name, + const std::string& message, const LLUUID& session_owner_id, + const LLUUID& from_id) +{ + LLUUID session_id = LLIMMgr::computeSessionID(session_type, + session_owner_id); + LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession( + session_id); + if (session == NULL) + { + LLIMModel::instance().logToFile(session_name, from_name, from_id, message); + } + else + { + // store active session id + const LLUUID & active_session_id = + LLIMModel::instance().getActiveSessionID(); + + // set searched session as active to avoid IM toast popup + LLIMModel::instance().setActiveSessionID(session_id); + + LLIMModel::instance().addMessage(session_id, from_name, from_id, + message); + + // restore active session id + LLIMModel::instance().setActiveSessionID(active_session_id); + } +} + +// static +void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification) +{ + const std::string + name = + notification->getSubstitutions().has("NAME") ? notification->getSubstitutions()["NAME"] + : notification->getSubstitutions()["[NAME]"]; + + // don't create IM p2p session with objects, it's necessary condition to log + if (notification->getName() != OBJECT_GIVE_ITEM && notification->getName() + != OBJECT_GIVE_ITEM_UNKNOWN_USER) + { + LLUUID from_id = notification->getPayload()["from_id"]; + + logToIM(IM_NOTHING_SPECIAL, name, name, notification->getMessage(), + from_id, from_id); + } +} + +// static +void LLHandlerUtil::logGroupNoticeToIMGroup( + const LLNotificationPtr& notification) +{ + + const LLSD& payload = notification->getPayload(); + LLGroupData groupData; + if (!gAgent.getGroupData(payload["group_id"].asUUID(), groupData)) + { + llwarns + << "Group notice for unkown group: " + << payload["group_id"].asUUID() << llendl; + } + + const std::string group_name = groupData.mName; + const std::string sender_name = payload["sender_name"].asString(); + + // we can't retrieve sender id from group notice system message, so try to lookup it from cache + LLUUID sender_id; + gCacheName->getUUID(sender_name, sender_id); + + logToIM(IM_SESSION_GROUP_START, group_name, sender_name, payload["message"], + payload["group_id"], sender_id); +} + diff --git a/indra/newview/llnotificationmanager.cpp b/indra/newview/llnotificationmanager.cpp index 1083cf3634..66bc217d15 100644 --- a/indra/newview/llnotificationmanager.cpp +++ b/indra/newview/llnotificationmanager.cpp @@ -36,9 +36,11 @@ #include "llnotificationmanager.h" + #include "llnearbychathandler.h" +#include "llnotifications.h" -#include "boost/bind.hpp" +#include <boost/bind.hpp> using namespace LLNotificationsUI; diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index 0a595765a9..4f353bf6a5 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -37,9 +37,9 @@ #include "lltoastnotifypanel.h" #include "llviewercontrol.h" #include "llviewerwindow.h" -#include "llimview.h" -#include "llimfloater.h" #include "llnotificationmanager.h" +#include "llnotifications.h" +#include "llscriptfloater.h" using namespace LLNotificationsUI; @@ -91,46 +91,44 @@ bool LLOfferHandler::processNotification(const LLSD& notify) if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change") { - // add message to IM - const std::string - name = - notification->getSubstitutions().has("NAME") ? notification->getSubstitutions()["NAME"] - : notification->getSubstitutions()["[NAME]"]; - - // don't create IM session with objects - if (notification->getName() != "ObjectGiveItem" - && notification->getName() != "ObjectGiveItemUnknownUser") + LLHandlerUtil::logToIMP2P(notification); + + if( notification->getPayload().has("give_inventory_notification") + && !notification->getPayload()["give_inventory_notification"] ) { - LLUUID from_id = notification->getPayload()["from_id"]; - LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, - from_id); - if (!LLIMMgr::instance().hasSession(session_id)) - { - session_id = LLIMMgr::instance().addSession(name, - IM_NOTHING_SPECIAL, from_id); - } - LLIMMgr::instance().addMessage(session_id, LLUUID(), name, - notification->getMessage()); + // This is an original inventory offer, so add a script floater + LLScriptFloaterManager::instance().onAddNotification(notification->getID()); + } + else + { + LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification); + + LLToast::Params p; + p.notif_id = notification->getID(); + p.notification = notification; + p.panel = notify_box; + p.on_delete_toast = boost::bind(&LLOfferHandler::onDeleteToast, this, _1); + + LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel); + if(channel) + channel->addToast(p); + + // send a signal to the counter manager + mNewNotificationSignal(); } - - LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification); - - LLToast::Params p; - p.notif_id = notification->getID(); - p.notification = notification; - p.panel = notify_box; - p.on_delete_toast = boost::bind(&LLOfferHandler::onDeleteToast, this, _1); - - LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel); - if(channel) - channel->addToast(p); - - // send a signal to the counter manager - mNewNotificationSignal(); } else if (notify["sigtype"].asString() == "delete") { - mChannel->killToastByNotificationID(notification->getID()); + if( notification->getPayload().has("give_inventory_notification") + && !notification->getPayload()["give_inventory_notification"] ) + { + // Remove original inventory offer script floater + LLScriptFloaterManager::instance().onRemoveNotification(notification->getID()); + } + else + { + mChannel->killToastByNotificationID(notification->getID()); + } } return true; diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index f01f2e4441..c7261199e3 100644 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -38,12 +38,14 @@ #include "llviewercontrol.h" #include "llviewerwindow.h" #include "llnotificationmanager.h" +#include "llnotifications.h" #include "llscriptfloater.h" using namespace LLNotificationsUI; static const std::string SCRIPT_DIALOG ("ScriptDialog"); static const std::string SCRIPT_DIALOG_GROUP ("ScriptDialogGroup"); +static const std::string SCRIPT_LOAD_URL ("LoadWebPage"); //-------------------------------------------------------------------------- LLScriptHandler::LLScriptHandler(e_notification_type type, const LLSD& id) @@ -94,7 +96,12 @@ bool LLScriptHandler::processNotification(const LLSD& notify) if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change") { - if(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName()) + if (LLHandlerUtil::canLogToIM(notification)) + { + LLHandlerUtil::logToIMP2P(notification); + } + + if(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName() || SCRIPT_LOAD_URL == notification->getName()) { LLScriptFloaterManager::getInstance()->onAddNotification(notification->getID()); } @@ -120,7 +127,7 @@ bool LLScriptHandler::processNotification(const LLSD& notify) } else if (notify["sigtype"].asString() == "delete") { - if(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName()) + if(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName() || SCRIPT_LOAD_URL == notification->getName()) { LLScriptFloaterManager::getInstance()->onRemoveNotification(notification->getID()); } diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp index b962fa2184..95f5ec801c 100644 --- a/indra/newview/llnotificationtiphandler.cpp +++ b/indra/newview/llnotificationtiphandler.cpp @@ -36,6 +36,7 @@ #include "llfloaterreg.h" #include "llnearbychat.h" #include "llnotificationhandler.h" +#include "llnotifications.h" #include "lltoastnotifypanel.h" #include "llviewercontrol.h" #include "llviewerwindow.h" diff --git a/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp index ea24638b6d..67e048885f 100644 --- a/indra/newview/lloverlaybar.cpp +++ b/indra/newview/lloverlaybar.cpp @@ -349,14 +349,8 @@ void LLOverlayBar::toggleMediaPlay(void*) //static void LLOverlayBar::toggleMusicPlay(void*) { - if (!gOverlayBar) - { - return; - } - - if (gOverlayBar->mMusicState != PLAYING) + if (gAudiop->isInternetStreamPlaying() != 1) { - gOverlayBar->mMusicState = PLAYING; // desired state if (gAudiop) { LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); @@ -381,7 +375,6 @@ void LLOverlayBar::toggleMusicPlay(void*) //} else { - gOverlayBar->mMusicState = STOPPED; // desired state if (gAudiop) { gAudiop->stopInternetStream(); diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index f29a7b25a7..eb9cb10d56 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -40,6 +40,7 @@ #include "llcombobox.h" #include "lldateutil.h" // ageFromDate() #include "llimview.h" +#include "llnotificationsutil.h" #include "lltexteditor.h" #include "lltexturectrl.h" #include "lltoggleablemenu.h" @@ -47,6 +48,9 @@ #include "llscrollcontainer.h" #include "llavatariconctrl.h" #include "llweb.h" +#include "llfloaterworldmap.h" +#include "llfloaterreg.h" +#include "llnotificationsutil.h" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLDropTarget @@ -149,6 +153,8 @@ BOOL LLPanelAvatarNotes::postBuild() childSetCommitCallback("call", boost::bind(&LLPanelAvatarNotes::onCallButtonClick, this), NULL); childSetCommitCallback("teleport", boost::bind(&LLPanelAvatarNotes::onTeleportButtonClick, this), NULL); childSetCommitCallback("share", boost::bind(&LLPanelAvatarNotes::onShareButtonClick, this), NULL); + childSetCommitCallback("show_on_map_btn", (boost::bind( + &LLPanelAvatarNotes::onMapButtonClick, this)), NULL); LLTextEditor* te = getChild<LLTextEditor>("notes_edit"); te->setCommitCallback(boost::bind(&LLPanelAvatarNotes::onCommitNotes,this)); @@ -194,6 +200,46 @@ void LLPanelAvatarNotes::onCommitNotes() LLAvatarPropertiesProcessor::getInstance()-> sendNotes(getAvatarId(),notes); } +void LLPanelAvatarNotes::rightsConfirmationCallback(const LLSD& notification, + const LLSD& response, S32 rights) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) + { + LLAvatarPropertiesProcessor::getInstance()->sendFriendRights( + getAvatarId(), rights); + } + else + { + childSetValue("objects_check", + childGetValue("objects_check").asBoolean() ? FALSE : TRUE); + } +} + +void LLPanelAvatarNotes::confirmModifyRights(bool grant, S32 rights) +{ + std::string first, last; + LLSD args; + if (gCacheName->getName(getAvatarId(), first, last)) + { + args["FIRST_NAME"] = first; + args["LAST_NAME"] = last; + } + + if (grant) + { + LLNotificationsUtil::add("GrantModifyRights", args, LLSD(), + boost::bind(&LLPanelAvatarNotes::rightsConfirmationCallback, this, + _1, _2, rights)); + } + else + { + LLNotificationsUtil::add("RevokeModifyRights", args, LLSD(), + boost::bind(&LLPanelAvatarNotes::rightsConfirmationCallback, this, + _1, _2, rights)); + } +} + void LLPanelAvatarNotes::onCommitRights() { S32 rights = 0; @@ -205,7 +251,22 @@ void LLPanelAvatarNotes::onCommitRights() if(childGetValue("objects_check").asBoolean()) rights |= LLRelationship::GRANT_MODIFY_OBJECTS; - LLAvatarPropertiesProcessor::getInstance()->sendFriendRights(getAvatarId(),rights); + const LLRelationship* buddy_relationship = + LLAvatarTracker::instance().getBuddyInfo(getAvatarId()); + bool allow_modify_objects = childGetValue("objects_check").asBoolean(); + + // if modify objects checkbox clicked + if (buddy_relationship->isRightGrantedTo( + LLRelationship::GRANT_MODIFY_OBJECTS) != allow_modify_objects) + { + confirmModifyRights(allow_modify_objects, rights); + } + // only one checkbox can trigger commit, so store the rest of rights + else + { + LLAvatarPropertiesProcessor::getInstance()->sendFriendRights( + getAvatarId(), rights); + } } void LLPanelAvatarNotes::processProperties(void* data, EAvatarProcessorType type) @@ -310,6 +371,7 @@ void LLPanelProfileTab::onOpen(const LLSD& key) // Update data even if we are viewing same avatar profile as some data might been changed. setAvatarId(key.asUUID()); updateData(); + updateButtons(); } void LLPanelProfileTab::scrollToTop() @@ -319,6 +381,22 @@ void LLPanelProfileTab::scrollToTop() scrollContainer->goToTop(); } +void LLPanelProfileTab::onMapButtonClick() +{ + std::string name; + gCacheName->getFullName(getAvatarId(), name); + gFloaterWorldMap->trackAvatar(getAvatarId(), name); + LLFloaterReg::showInstance("world_map"); +} + +void LLPanelProfileTab::updateButtons() +{ + bool enable_map_btn = LLAvatarTracker::instance().isBuddyOnline(getAvatarId()) + && gAgent.isGodlike() || is_agent_mappable(getAvatarId()); + + childSetEnabled("show_on_map_btn", enable_map_btn); +} + ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -337,6 +415,8 @@ BOOL LLPanelAvatarProfile::postBuild() childSetCommitCallback("teleport",(boost::bind(&LLPanelAvatarProfile::onTeleportButtonClick,this)),NULL); childSetCommitCallback("overflow_btn", boost::bind(&LLPanelAvatarProfile::onOverflowButtonClicked, this), NULL); childSetCommitCallback("share",(boost::bind(&LLPanelAvatarProfile::onShareButtonClick,this)),NULL); + childSetCommitCallback("show_on_map_btn", (boost::bind( + &LLPanelAvatarProfile::onMapButtonClick, this)), NULL); LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; registrar.add("Profile.Pay", boost::bind(&LLPanelAvatarProfile::pay, this)); @@ -450,20 +530,19 @@ void LLPanelAvatarProfile::processGroupProperties(const LLAvatarGroups* avatar_g for(; it_end != it; ++it) { LLAvatarGroups::LLGroupData group_data = *it; - - // Check if there is no duplicates for this group - if (std::find(mGroups.begin(), mGroups.end(), group_data.group_name) == mGroups.end()) - mGroups.push_back(group_data.group_name); + mGroups[group_data.group_name] = group_data.group_id; } // Creating string, containing group list std::string groups = ""; - for (group_list_t::const_iterator it = mGroups.begin(); it != mGroups.end(); ++it) + for (group_map_t::iterator it = mGroups.begin(); it != mGroups.end(); ++it) { if (it != mGroups.begin()) groups += ", "; - groups += *it; + + std::string group_url="[secondlife:///app/group/" + it->second.asString() + "/about " + it->first + "]"; + groups += group_url; } childSetValue("sl_groups", groups); @@ -684,7 +763,7 @@ void LLPanelMyProfile::onStatusChanged() { gAgent.clearAFK(); gAgent.setBusy(); - LLNotifications::instance().add("BusyModeSet"); + LLNotificationsUtil::add("BusyModeSet"); } } diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index 527e1c0d34..b19c5cca49 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -106,6 +106,10 @@ protected: */ void scrollToTop(); + virtual void onMapButtonClick(); + + virtual void updateButtons(); + private: LLUUID mAvatarId; @@ -188,8 +192,8 @@ protected: private: - typedef std::list<std::string> group_list_t; - group_list_t mGroups; + typedef std::map< std::string,LLUUID> group_map_t; + group_map_t mGroups; LLToggleableMenu* mProfileMenu; }; @@ -256,6 +260,9 @@ protected: */ void fillRightsData(); + void rightsConfirmationCallback(const LLSD& notification, + const LLSD& response, S32 rights); + void confirmModifyRights(bool grant, S32 rights); void onCommitRights(); void onCommitNotes(); diff --git a/indra/newview/llpanelblockedlist.cpp b/indra/newview/llpanelblockedlist.cpp index 60d0f07285..ae703ebd8e 100644 --- a/indra/newview/llpanelblockedlist.cpp +++ b/indra/newview/llpanelblockedlist.cpp @@ -32,12 +32,14 @@ #include "llviewerprecompiledheaders.h" +#include "llpanelblockedlist.h" + +// library include #include "llfloater.h" #include "llfloaterreg.h" +#include "llnotificationsutil.h" #include "llscrolllistctrl.h" -#include "llpanelblockedlist.h" - // project include #include "llfloateravatarpicker.h" #include "llsidetray.h" @@ -102,7 +104,7 @@ void LLPanelBlockedList::selectBlocked(const LLUUID& mute_id) void LLPanelBlockedList::showPanelAndSelect(const LLUUID& idToSelect) { - LLSideTray::getInstance()->showPanel("panel_block_list_sidetray", LLSD().insert(BLOCKED_PARAM_NAME, idToSelect)); + LLSideTray::getInstance()->showPanel("panel_block_list_sidetray", LLSD().with(BLOCKED_PARAM_NAME, idToSelect)); } @@ -199,7 +201,7 @@ void LLPanelBlockedList::callbackBlockByName(const std::string& text) BOOL success = LLMuteList::getInstance()->add(mute); if (!success) { - LLNotifications::instance().add("MuteByNameFailed"); + LLNotificationsUtil::add("MuteByNameFailed"); } } diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 67a2704501..70d92442ad 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -41,6 +41,8 @@ #include "lldir.h" #include "lldispatcher.h" #include "llfloaterreg.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llparcel.h" #include "lltabcontainer.h" #include "message.h" @@ -310,12 +312,12 @@ BOOL LLPanelClassified::titleIsValid() const std::string& name = mNameEditor->getText(); if (name.empty()) { - LLNotifications::instance().add("BlankClassifiedName"); + LLNotificationsUtil::add("BlankClassifiedName"); return FALSE; } if (!isalnum(name[0])) { - LLNotifications::instance().add("ClassifiedMustBeAlphanumeric"); + LLNotificationsUtil::add("ClassifiedMustBeAlphanumeric"); return FALSE; } @@ -334,7 +336,7 @@ void LLPanelClassified::apply() bool LLPanelClassified::saveCallback(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch(option) { @@ -370,7 +372,7 @@ BOOL LLPanelClassified::canClose() LLSD args; args["NAME"] = mNameEditor->getText(); - LLNotifications::instance().add("ClassifiedSave", args, LLSD(), boost::bind(&LLPanelClassified::saveCallback, this, _1, _2)); + LLNotificationsUtil::add("ClassifiedSave", args, LLSD(), boost::bind(&LLPanelClassified::saveCallback, this, _1, _2)); return FALSE; } @@ -795,7 +797,7 @@ void LLPanelClassified::onClickUpdate(void* data) if(self->mMatureCombo->getCurrentIndex() == DECLINE_TO_STATE) { // Tell user about it - LLNotifications::instance().add("SetClassifiedMature", + LLNotificationsUtil::add("SetClassifiedMature", LLSD(), LLSD(), boost::bind(&LLPanelClassified::confirmMature, self, _1, _2)); @@ -809,7 +811,7 @@ void LLPanelClassified::onClickUpdate(void* data) // Callback from a dialog indicating response to mature notification bool LLPanelClassified::confirmMature(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); // 0 == Yes // 1 == No @@ -864,7 +866,7 @@ void LLPanelClassified::callbackGotPriceForListing(S32 option, std::string text, std::string price_text = llformat("%d", MINIMUM_PRICE_FOR_LISTING); args["MIN_PRICE"] = price_text; - LLNotifications::instance().add("MinClassifiedPrice", args); + LLNotificationsUtil::add("MinClassifiedPrice", args); return; } @@ -874,7 +876,7 @@ void LLPanelClassified::callbackGotPriceForListing(S32 option, std::string text, LLSD args; args["AMOUNT"] = llformat("%d", price_for_listing); - LLNotifications::instance().add("PublishClassified", args, LLSD(), + LLNotificationsUtil::add("PublishClassified", args, LLSD(), boost::bind(&LLPanelClassified::confirmPublish, self, _1, _2)); } @@ -901,7 +903,7 @@ void LLPanelClassified::resetDirty() // invoked from callbackConfirmPublish bool LLPanelClassified::confirmPublish(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); // Option 0 = publish if (option != 0) return false; diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index 61f2396168..2cb3967685 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -43,7 +43,7 @@ #include "llviewermessage.h" #include "llviewerwindow.h" #include "llappviewer.h" -#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llfloaterreg.h" #include "llfloater.h" #include "llgroupactions.h" @@ -245,7 +245,7 @@ void LLPanelGroup::onBtnCreate() { LLSD args; args["MESSAGE"] = apply_mesg; - LLNotifications::instance().add("GenericAlert", args); + LLNotificationsUtil::add("GenericAlert", args); } } @@ -441,7 +441,7 @@ bool LLPanelGroup::apply(LLPanelGroupTab* tab) { LLSD args; args["MESSAGE"] = apply_mesg; - LLNotifications::instance().add("GenericAlert", args); + LLNotificationsUtil::add("GenericAlert", args); } return false; } diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index a1d54367c9..31dfdde887 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -48,6 +48,7 @@ #include "lllineeditor.h" #include "llnamebox.h" #include "llnamelistctrl.h" +#include "llnotificationsutil.h" #include "llscrolllistitem.h" #include "llspinctrl.h" #include "lltextbox.h" @@ -360,7 +361,7 @@ bool LLPanelGroupGeneral::apply(std::string& mesg) if(mComboMature && mComboMature->getCurrentIndex() == DECLINE_TO_STATE) { - LLNotifications::instance().add("SetGroupMature", LLSD(), LLSD(), + LLNotificationsUtil::add("SetGroupMature", LLSD(), LLSD(), boost::bind(&LLPanelGroupGeneral::confirmMatureApply, this, _1, _2)); return false; } @@ -379,7 +380,7 @@ bool LLPanelGroupGeneral::apply(std::string& mesg) return false; } - LLNotifications::instance().add("CreateGroupCost", LLSD(), LLSD(), boost::bind(&LLPanelGroupGeneral::createGroupCallback, this, _1, _2)); + LLNotificationsUtil::add("CreateGroupCost", LLSD(), LLSD(), boost::bind(&LLPanelGroupGeneral::createGroupCallback, this, _1, _2)); return false; } @@ -459,7 +460,7 @@ void LLPanelGroupGeneral::cancel() // invoked from callbackConfirmMature bool LLPanelGroupGeneral::confirmMatureApply(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); // 0 == Yes // 1 == No // 2 == Cancel @@ -482,7 +483,7 @@ bool LLPanelGroupGeneral::confirmMatureApply(const LLSD& notification, const LLS { LLSD args; args["MESSAGE"] = mesg; - LLNotifications::instance().add("GenericAlert", args); + LLNotificationsUtil::add("GenericAlert", args); } return ret; @@ -491,7 +492,7 @@ bool LLPanelGroupGeneral::confirmMatureApply(const LLSD& notification, const LLS // static bool LLPanelGroupGeneral::createGroupCallback(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch(option) { case 0: diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index c5eaa34204..375ee0fdc4 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -40,6 +40,7 @@ #include "llgroupactions.h" #include "llgroupmgr.h" #include "llnamelistctrl.h" +#include "llnotificationsutil.h" #include "llscrolllistitem.h" #include "llspinctrl.h" #include "lltextbox.h" @@ -164,7 +165,7 @@ void LLPanelGroupInvite::impl::submitInvitations() { LLSD args; args["MESSAGE"] = mOwnerWarning; - LLNotifications::instance().add("GenericAlertYesCancel", args, LLSD(), boost::bind(&LLPanelGroupInvite::impl::inviteOwnerCallback, this, _1, _2)); + LLNotificationsUtil::add("GenericAlertYesCancel", args, LLSD(), boost::bind(&LLPanelGroupInvite::impl::inviteOwnerCallback, this, _1, _2)); return; // we'll be called again if user confirms } } @@ -190,7 +191,7 @@ void LLPanelGroupInvite::impl::submitInvitations() { LLSD msg; msg["MESSAGE"] = mAlreadyInGroup; - LLNotifications::instance().add("GenericAlert", msg); + LLNotificationsUtil::add("GenericAlert", msg); } //then close @@ -199,7 +200,7 @@ void LLPanelGroupInvite::impl::submitInvitations() bool LLPanelGroupInvite::impl::inviteOwnerCallback(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch(option) { diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 4b205b4e0c..516020797d 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -58,7 +58,7 @@ #include "roles_constants.h" #include "llviewerwindow.h" #include "llviewermessage.h" -#include "llnotifications.h" +#include "llnotificationsutil.h" static LLRegisterPanelClassWrapper<LLPanelGroupNotices> t_panel_group_notices("panel_group_notices"); @@ -305,6 +305,9 @@ BOOL LLPanelGroupNotices::postBuild() void LLPanelGroupNotices::activate() { + if(mNoticesList) + mNoticesList->deleteAllItems(); + BOOL can_send = gAgent.hasPowerInGroup(mGroupID,GP_NOTICES_SEND); BOOL can_receive = gAgent.hasPowerInGroup(mGroupID,GP_NOTICES_RECEIVE); @@ -373,7 +376,7 @@ void LLPanelGroupNotices::onClickSendMessage(void* data) if (self->mCreateSubject->getText().empty()) { // Must supply a subject - LLNotifications::instance().add("MustSpecifyGroupNoticeSubject"); + LLNotificationsUtil::add("MustSpecifyGroupNoticeSubject"); return; } send_group_notice( @@ -511,6 +514,9 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) S32 i=0; S32 count = msg->getNumberOfBlocks("Data"); + + mNoticesList->setEnabled(TRUE); + for (;i<count;++i) { msg->getUUID("Data","NoticeID",id,i); diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 7b5b232ad2..b6c58808ae 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -42,6 +42,8 @@ #include "lliconctrl.h" #include "lllineeditor.h" #include "llnamelistctrl.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llnotify.h" #include "llpanelgrouproles.h" #include "llscrolllistctrl.h" @@ -231,7 +233,7 @@ BOOL LLPanelGroupRoles::attemptTransition() LLSD args; args["NEEDS_APPLY_MESSAGE"] = mesg; args["WANT_APPLY_MESSAGE"] = mWantApplyMesg; - LLNotifications::instance().add("PanelGroupApply", args, LLSD(), + LLNotificationsUtil::add("PanelGroupApply", args, LLSD(), boost::bind(&LLPanelGroupRoles::handleNotifyCallback, this, _1, _2)); mHasModal = TRUE; // We need to reselect the current tab, since it isn't finished. @@ -275,7 +277,7 @@ void LLPanelGroupRoles::transitionToTab() bool LLPanelGroupRoles::handleNotifyCallback(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); mHasModal = FALSE; switch (option) { @@ -291,7 +293,7 @@ bool LLPanelGroupRoles::handleNotifyCallback(const LLSD& notification, const LLS mHasModal = TRUE; LLSD args; args["MESSAGE"] = apply_mesg; - LLNotifications::instance().add("GenericAlert", args, LLSD(), boost::bind(&LLPanelGroupRoles::onModalClose, this, _1, _2)); + LLNotificationsUtil::add("GenericAlert", args, LLSD(), boost::bind(&LLPanelGroupRoles::onModalClose, this, _1, _2)); } // Skip switching tabs. break; @@ -1100,10 +1102,33 @@ void LLPanelGroupMembersSubTab::handleEjectMembers() mMembersList->deleteSelectedItems(); + sendEjectNotifications(mGroupID, selected_members); + LLGroupMgr::getInstance()->sendGroupMemberEjects(mGroupID, selected_members); } +void LLPanelGroupMembersSubTab::sendEjectNotifications(const LLUUID& group_id, const std::vector<LLUUID>& selected_members) +{ + LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(group_id); + + if (group_data) + { + for (std::vector<LLUUID>::const_iterator i = selected_members.begin(); i != selected_members.end(); ++i) + { + LLSD args; + std::string name; + + gCacheName->getFullName(*i, name); + + args["AVATAR_NAME"] = name; + args["GROUP_NAME"] = group_data->mName; + + LLNotifications::instance().add(LLNotification::Params("EjectAvatarFromGroup").substitutions(args)); + } + } +} + void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id, LLRoleMemberChangeType type) { @@ -1279,7 +1304,7 @@ bool LLPanelGroupMembersSubTab::apply(std::string& mesg) { mHasModal = TRUE; args["ROLE_NAME"] = rd.mRoleName; - LLNotifications::instance().add("AddGroupOwnerWarning", + LLNotificationsUtil::add("AddGroupOwnerWarning", args, LLSD(), boost::bind(&LLPanelGroupMembersSubTab::addOwnerCB, this, _1, _2)); @@ -1304,7 +1329,7 @@ bool LLPanelGroupMembersSubTab::apply(std::string& mesg) bool LLPanelGroupMembersSubTab::addOwnerCB(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); mHasModal = FALSE; if (0 == option) @@ -1543,9 +1568,6 @@ void LLPanelGroupMembersSubTab::updateMembers() mPendingMemberUpdate = FALSE; // Rebuild the members list. - mMembersList->deleteAllItems(); - - lldebugs << "LLPanelGroupMembersSubTab::updateMembers()" << llendl; LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) @@ -1562,7 +1584,12 @@ void LLPanelGroupMembersSubTab::updateMembers() { return; } - + + //cleanup list only for first iretation + if(mMemberProgress == gdatap->mMembers.begin()) + mMembersList->deleteAllItems(); + + LLGroupMgrGroupData::member_list_t::iterator end = gdatap->mMembers.end(); S32 i = 0; @@ -2126,7 +2153,7 @@ void LLPanelGroupRolesSubTab::handleActionCheck(LLUICtrl* ctrl, bool force) { warning = "AssignDangerousAbilityWarning"; } - LLNotifications::instance().add(warning, args, LLSD(), boost::bind(&LLPanelGroupRolesSubTab::addActionCB, this, _1, _2, check)); + LLNotificationsUtil::add(warning, args, LLSD(), boost::bind(&LLPanelGroupRolesSubTab::addActionCB, this, _1, _2, check)); } else { @@ -2154,7 +2181,7 @@ bool LLPanelGroupRolesSubTab::addActionCB(const LLSD& notification, const LLSD& mHasModal = FALSE; - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) { // User clicked "Yes" @@ -2300,7 +2327,7 @@ void LLPanelGroupRolesSubTab::handleDeleteRole() { LLSD args; args["MESSAGE"] = mRemoveEveryoneTxt; - LLNotifications::instance().add("GenericAlert", args); + LLNotificationsUtil::add("GenericAlert", args); return; } diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index b6e2245e70..bb3c9096cf 100644 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -170,6 +170,7 @@ public: static void onEjectMembers(void*); void handleEjectMembers(); + void sendEjectNotifications(const LLUUID& group_id, const std::vector<LLUUID>& selected_members); static void onRoleCheck(LLUICtrl* check, void* user_data); void handleRoleCheck(const LLUUID& role_id, diff --git a/indra/newview/llpanelhome.cpp b/indra/newview/llpanelhome.cpp new file mode 100644 index 0000000000..de7a85836d --- /dev/null +++ b/indra/newview/llpanelhome.cpp @@ -0,0 +1,112 @@ +/** +* @file llpanelhome.cpp +* @author Martin Reddy +* @brief The Home side tray panel +* +* $LicenseInfo:firstyear=2009&license=viewergpl$ +* +* Copyright (c) 2009, Linden Research, Inc. +* +* Second Life Viewer Source Code +* The source code in this file ("Source Code") is provided by Linden Lab +* to you under the terms of the GNU General Public License, version 2.0 +* ("GPL"), unless you have obtained a separate licensing agreement +* ("Other License"), formally executed by you and Linden Lab. Terms of +* the GPL can be found in doc/GPL-license.txt in this distribution, or +* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 +* +* There are special exceptions to the terms and conditions of the GPL as +* it is applied to this Source Code. View the full text of the exception +* in the file doc/FLOSS-exception.txt in this software distribution, or +* online at +* http://secondlifegrid.net/programs/open_source/licensing/flossexception +* +* By copying, modifying or distributing this software, you acknowledge +* that you have read and understood your obligations described above, +* and agree to abide by those obligations. +* +* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO +* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, +* COMPLETENESS OR PERFORMANCE. +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" +#include "llpanelhome.h" + +#include "llmediactrl.h" + +static LLRegisterPanelClassWrapper<LLPanelHome> t_people("panel_sidetray_home"); + +LLPanelHome::LLPanelHome() : + LLPanel(), + LLViewerMediaObserver(), + mBrowser(NULL), + mFirstView(true) +{ +} + +void LLPanelHome::onOpen(const LLSD& key) +{ + // display the home page the first time we open the panel + // *NOTE: this seems to happen during login. Can we avoid that? + if (mFirstView && mBrowser) + { + mBrowser->navigateHome(); + } + mFirstView = false; +} + +BOOL LLPanelHome::postBuild() +{ + mBrowser = getChild<LLMediaCtrl>("browser"); + if (mBrowser) + { + mBrowser->addObserver(this); + mBrowser->setTrusted(true); + mBrowser->setHomePageUrl("http://www.secondlife.com/"); + + childSetAction("back", onClickBack, this); + childSetAction("forward", onClickForward, this); + childSetAction("home", onClickHome, this); + } + + return TRUE; +} + +//static +void LLPanelHome::onClickBack(void* user_data) +{ + LLPanelHome *self = (LLPanelHome*)user_data; + if (self && self->mBrowser) + { + self->mBrowser->navigateBack(); + } +} + +//static +void LLPanelHome::onClickForward(void* user_data) +{ + LLPanelHome *self = (LLPanelHome*)user_data; + if (self && self->mBrowser) + { + self->mBrowser->navigateForward(); + } +} + +//static +void LLPanelHome::onClickHome(void* user_data) +{ + LLPanelHome *self = (LLPanelHome*)user_data; + if (self && self->mBrowser) + { + self->mBrowser->navigateHome(); + } +} + +void LLPanelHome::handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event) +{ + // update back/forward button state + childSetEnabled("back", mBrowser->canNavigateBack()); + childSetEnabled("forward", mBrowser->canNavigateForward()); +} diff --git a/indra/newview/llpanelhome.h b/indra/newview/llpanelhome.h new file mode 100644 index 0000000000..b5ca48b23f --- /dev/null +++ b/indra/newview/llpanelhome.h @@ -0,0 +1,68 @@ +/** +* @file llpanelhome.h +* @author Martin Reddy +* @brief The Home side tray panel +* +* $LicenseInfo:firstyear=2009&license=viewergpl$ +* +* Copyright (c) 2009, Linden Research, Inc. +* +* Second Life Viewer Source Code +* The source code in this file ("Source Code") is provided by Linden Lab +* to you under the terms of the GNU General Public License, version 2.0 +* ("GPL"), unless you have obtained a separate licensing agreement +* ("Other License"), formally executed by you and Linden Lab. Terms of +* the GPL can be found in doc/GPL-license.txt in this distribution, or +* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 +* +* There are special exceptions to the terms and conditions of the GPL as +* it is applied to this Source Code. View the full text of the exception +* in the file doc/FLOSS-exception.txt in this software distribution, or +* online at +* http://secondlifegrid.net/programs/open_source/licensing/flossexception +* +* By copying, modifying or distributing this software, you acknowledge +* that you have read and understood your obligations described above, +* and agree to abide by those obligations. +* +* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO +* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, +* COMPLETENESS OR PERFORMANCE. +* $/LicenseInfo$ +*/ + +#ifndef LL_LLPANELHOME_H +#define LL_LLPANELHOME_H + +#include "llpanel.h" +#include "llsd.h" +#include "llviewermediaobserver.h" + +class LLMediaCtrl; + +/** + * Base class for web-based Home side tray + */ +class LLPanelHome : + public LLPanel, + public LLViewerMediaObserver +{ +public: + LLPanelHome(); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + + static void onClickBack(void* user_data); + static void onClickForward(void* user_data); + static void onClickHome(void* user_data); + +private: + // inherited from LLViewerMediaObserver + /*virtual*/ void handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event); + + LLMediaCtrl *mBrowser; + bool mFirstView; +}; + +#endif //LL_LLPANELHOME_H diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index fa6d16cfb1..8c19865550 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -32,6 +32,8 @@ #include "llviewerprecompiledheaders.h" +#include "llfloaterreg.h" + #include "llpanelimcontrolpanel.h" #include "llagent.h" @@ -58,7 +60,7 @@ void LLPanelChatControlPanel::onEndCallButtonClicked() void LLPanelChatControlPanel::onOpenVoiceControlsClicked() { - // TODO: implement Voice Control Panel opening + LLFloaterReg::showInstance("voice_controls"); } void LLPanelChatControlPanel::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state) @@ -69,6 +71,11 @@ void LLPanelChatControlPanel::onVoiceChannelStateChanged(const LLVoiceChannel::E childSetVisible("call_btn", ! is_call_started); } +LLPanelChatControlPanel::~LLPanelChatControlPanel() +{ + mVoiceChannelStateChangeConnection.disconnect(); +} + BOOL LLPanelChatControlPanel::postBuild() { childSetAction("call_btn", boost::bind(&LLPanelChatControlPanel::onCallButtonClicked, this)); @@ -111,7 +118,9 @@ void LLPanelChatControlPanel::setSessionId(const LLUUID& session_id) mSessionId = session_id; LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionId); if(voice_channel) - voice_channel->setStateChangedCallback(boost::bind(&LLPanelChatControlPanel::onVoiceChannelStateChanged, this, _1, _2)); + { + mVoiceChannelStateChangeConnection = voice_channel->setStateChangedCallback(boost::bind(&LLPanelChatControlPanel::onVoiceChannelStateChanged, this, _1, _2)); + } } LLPanelIMControlPanel::LLPanelIMControlPanel() @@ -120,6 +129,7 @@ LLPanelIMControlPanel::LLPanelIMControlPanel() LLPanelIMControlPanel::~LLPanelIMControlPanel() { + LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarID, this); } BOOL LLPanelIMControlPanel::postBuild() @@ -169,7 +179,9 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) LLIMModel& im_model = LLIMModel::instance(); + LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarID, this); mAvatarID = im_model.getOtherParticipantID(session_id); + LLAvatarTracker::instance().addParticularFriendObserver(mAvatarID, this); // Disable "Add friend" button for friends. childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(mAvatarID)); @@ -198,6 +210,12 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) } } +//virtual +void LLPanelIMControlPanel::changed(U32 mask) +{ + childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(mAvatarID)); +} + void LLPanelIMControlPanel::nameUpdatedCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) { if ( id == mAvatarID ) diff --git a/indra/newview/llpanelimcontrolpanel.h b/indra/newview/llpanelimcontrolpanel.h index 7bfc432ef2..871779b273 100644 --- a/indra/newview/llpanelimcontrolpanel.h +++ b/indra/newview/llpanelimcontrolpanel.h @@ -35,6 +35,7 @@ #include "llpanel.h" #include "llvoicechannel.h" +#include "llcallingcard.h" class LLSpeakerMgr; class LLAvatarList; @@ -46,7 +47,7 @@ public: LLPanelChatControlPanel() : mSessionId(LLUUID()), mInitialized(false) {}; - ~LLPanelChatControlPanel() {}; + ~LLPanelChatControlPanel(); virtual BOOL postBuild(); virtual void draw(); @@ -63,10 +64,13 @@ public: private: LLUUID mSessionId; bool mInitialized; + + // connection to voice channel state change signal + boost::signals2::connection mVoiceChannelStateChangeConnection; }; -class LLPanelIMControlPanel : public LLPanelChatControlPanel +class LLPanelIMControlPanel : public LLPanelChatControlPanel, LLFriendObserver { public: LLPanelIMControlPanel(); @@ -76,6 +80,9 @@ public: void setSessionId(const LLUUID& session_id); + // LLFriendObserver trigger + virtual void changed(U32 mask); + protected: void nameUpdatedCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index e24fa14e1e..d731da0ec7 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -67,28 +67,6 @@ static const std::string TRASH_BUTTON_NAME = "trash_btn"; // helper functions static void filter_list(LLInventorySubTreePanel* inventory_list, const std::string& string); -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLLandmarksPanelObserver -// -// Bridge to support knowing when the inventory has changed to update -// landmarks accordions visibility. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLLandmarksPanelObserver : public LLInventoryObserver -{ -public: - LLLandmarksPanelObserver(LLLandmarksPanel* lp) : mLP(lp) {} - virtual ~LLLandmarksPanelObserver() {} - /*virtual*/ void changed(U32 mask); - -private: - LLLandmarksPanel* mLP; -}; - -void LLLandmarksPanelObserver::changed(U32 mask) -{ - mLP->updateFilteredAccordions(); -} - LLLandmarksPanel::LLLandmarksPanel() : LLPanelPlacesTab() , mFavoritesInventoryPanel(NULL) @@ -99,18 +77,12 @@ LLLandmarksPanel::LLLandmarksPanel() , mListCommands(NULL) , mGearFolderMenu(NULL) , mGearLandmarkMenu(NULL) - , mDirtyFilter(false) { - mInventoryObserver = new LLLandmarksPanelObserver(this); - gInventory.addObserver(mInventoryObserver); - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_landmarks.xml"); } LLLandmarksPanel::~LLLandmarksPanel() { - if (gInventory.containsObserver(mInventoryObserver)) - gInventory.removeObserver(mInventoryObserver); } BOOL LLLandmarksPanel::postBuild() @@ -137,39 +109,35 @@ BOOL LLLandmarksPanel::postBuild() // virtual void LLLandmarksPanel::onSearchEdit(const std::string& string) { - static std::string prev_string(""); - - if (prev_string == string) return; - // show all folders in Landmarks Accordion for empty filter - mLandmarksInventoryPanel->setShowFolderState(string.empty() ? - LLInventoryFilter::SHOW_ALL_FOLDERS : - LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS - ); - - filter_list(mFavoritesInventoryPanel, string); - filter_list(mLandmarksInventoryPanel, string); - filter_list(mMyInventoryPanel, string); - filter_list(mLibraryInventoryPanel, string); - - prev_string = string; - mDirtyFilter = true; + if (mLandmarksInventoryPanel->getFilter()) + { + mLandmarksInventoryPanel->setShowFolderState(string.empty() ? + LLInventoryFilter::SHOW_ALL_FOLDERS : + LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS + ); + } // give FolderView a chance to be refreshed. So, made all accordions visible for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) { LLAccordionCtrlTab* tab = *iter; - tab->setVisible(true); + tab->setVisible(TRUE); // expand accordion to see matched items in each one. See EXT-2014. tab->changeOpenClose(false); - // refresh all accordions to display their contents in case of less restrictive filter LLInventorySubTreePanel* inventory_list = dynamic_cast<LLInventorySubTreePanel*>(tab->getAccordionView()); if (NULL == inventory_list) continue; - LLFolderView* fv = inventory_list->getRootFolder(); - fv->refresh(); + + if (inventory_list->getFilter()) + { + filter_list(inventory_list, string); + } } + + if (sFilterSubString != string) + sFilterSubString = string; } // virtual @@ -255,31 +223,6 @@ void LLLandmarksPanel::onSelectorButtonClicked() } } -void LLLandmarksPanel::updateFilteredAccordions() -{ - LLInventoryPanel* inventory_list = NULL; - LLAccordionCtrlTab* accordion_tab = NULL; - for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) - { - accordion_tab = *iter; - inventory_list = dynamic_cast<LLInventorySubTreePanel*> (accordion_tab->getAccordionView()); - if (NULL == inventory_list) continue; - LLFolderView* fv = inventory_list->getRootFolder(); - - bool has_descendants = fv->hasFilteredDescendants(); - - accordion_tab->setVisible(has_descendants); - } - - // we have to arrange accordion tabs for cases when filter string is less restrictive but - // all items are still filtered. - static LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("landmarks_accordion"); - accordion->arrange(); - - // now filter state is applied to accordion tabs - mDirtyFilter = false; -} - ////////////////////////////////////////////////////////////////////////// // PROTECTED METHODS ////////////////////////////////////////////////////////////////////////// @@ -391,7 +334,12 @@ void LLLandmarksPanel::initLandmarksInventoryPanel() initLandmarksPanel(mLandmarksInventoryPanel); - mLandmarksInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_ALL_FOLDERS); + // Check if mLandmarksInventoryPanel is properly initialized and has a Filter created. + // In case of a dummy widget getFilter() will return NULL. + if (mLandmarksInventoryPanel->getFilter()) + { + mLandmarksInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_ALL_FOLDERS); + } // subscribe to have auto-rename functionality while creating New Folder mLandmarksInventoryPanel->setSelectCallback(boost::bind(&LLInventoryPanel::onSelectionChange, mLandmarksInventoryPanel, _1, _2)); @@ -419,6 +367,11 @@ void LLLandmarksPanel::initLibraryInventoryPanel() void LLLandmarksPanel::initLandmarksPanel(LLInventorySubTreePanel* inventory_list) { + // In case of a dummy widget further we have no Folder View widget and no Filter, + // so further initialization leads to crash. + if (!inventory_list->getFilter()) + return; + inventory_list->setFilterTypes(0x1 << LLInventoryType::IT_LANDMARK); inventory_list->setSelectCallback(boost::bind(&LLLandmarksPanel::onSelectionChange, this, inventory_list, _1, _2)); @@ -432,6 +385,8 @@ void LLLandmarksPanel::initLandmarksPanel(LLInventorySubTreePanel* inventory_lis root_folder->setupMenuHandle(LLInventoryType::IT_LANDMARK, mGearLandmarkMenu->getHandle()); } + root_folder->setParentLandmarksPanel(this); + // save initial folder state to avoid incorrect work while switching between Landmarks & Teleport History tabs // See EXT-1609. inventory_list->saveFolderState(); @@ -440,6 +395,7 @@ void LLLandmarksPanel::initLandmarksPanel(LLInventorySubTreePanel* inventory_lis void LLLandmarksPanel::initAccordion(const std::string& accordion_tab_name, LLInventorySubTreePanel* inventory_list) { LLAccordionCtrlTab* accordion_tab = getChild<LLAccordionCtrlTab>(accordion_tab_name); + mAccordionTabs.push_back(accordion_tab); accordion_tab->setDropDownStateChangedCallback( boost::bind(&LLLandmarksPanel::onAccordionExpandedCollapsed, this, _2, inventory_list)); @@ -457,6 +413,19 @@ void LLLandmarksPanel::onAccordionExpandedCollapsed(const LLSD& param, LLInvento mCurrentSelectedList = NULL; updateVerbs(); } + + // Start background fetch, mostly for My Inventory and Library + if (expanded) + { + const LLUUID &cat_id = inventory_list->getStartFolderID(); + // Just because the category itself has been fetched, doesn't mean its child folders have. + /* + if (!gInventory.isCategoryComplete(cat_id)) + */ + { + gInventory.startBackgroundFetch(cat_id); + } + } } void LLLandmarksPanel::deselectOtherThan(const LLInventorySubTreePanel* inventory_list) @@ -580,11 +549,11 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const if(landmark) { LLSideTray::getInstance()->showPanel("panel_places", - LLSD().insert("type", "landmark").insert("id",landmark->getUUID())); + LLSD().with("type", "landmark").with("id",landmark->getUUID())); } else { - LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "create_landmark")); + LLSideTray::getInstance()->showPanel("panel_places", LLSD().with("type", "create_landmark")); } } else if ("category" == command_name) @@ -730,13 +699,14 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const { return canSelectedBeModified(command_name); } - else if ( "sort_by_date" == command_name) - { - return mSortByDate; - } else if("create_pick" == command_name) { - return !LLAgentPicksInfo::getInstance()->isPickLimitReached(); + std::set<LLUUID> selection; + if ( mCurrentSelectedList && mCurrentSelectedList->getRootFolder()->getSelectionList(selection) ) + { + return ( 1 == selection.size() && !LLAgentPicksInfo::getInstance()->isPickLimitReached() ); + } + return false; } else { @@ -770,6 +740,46 @@ void LLLandmarksPanel::onCustomAction(const LLSD& userdata) } } +void LLLandmarksPanel::updateFilteredAccordions() +{ + LLInventoryPanel* inventory_list = NULL; + LLAccordionCtrlTab* accordion_tab = NULL; +// bool needs_arrange = false; + + for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) + { + accordion_tab = *iter; + + accordion_tab->setVisible(TRUE); + + inventory_list = dynamic_cast<LLInventorySubTreePanel*> (accordion_tab->getAccordionView()); + if (NULL == inventory_list) continue; + + // This doesn't seem to work correctly. Disabling for now. -Seraph + /* + LLFolderView* fv = inventory_list->getRootFolder(); + + // arrange folder view contents to draw its descendants if it has any + fv->arrangeFromRoot(); + + bool has_descendants = fv->hasFilteredDescendants(); + if (!has_descendants) + needs_arrange = true; + + accordion_tab->setVisible(has_descendants); + */ + accordion_tab->setVisible(TRUE); + } + + // we have to arrange accordion tabs for cases when filter string is less restrictive but + // all items are still filtered. +// if (needs_arrange) +// { + static LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("landmarks_accordion"); + accordion->arrange(); +// } +} + /* Processes such actions: cut/rename/delete/paste actions @@ -882,12 +892,7 @@ bool LLLandmarksPanel::handleDragAndDropToTrash(BOOL drop, EDragAndDropType carg void LLLandmarksPanel::doIdle(void* landmarks_panel) { LLLandmarksPanel* panel = (LLLandmarksPanel* ) landmarks_panel; - - if (panel->mDirtyFilter) - { - panel->updateFilteredAccordions(); - } - + panel->updateFilteredAccordions(); } void LLLandmarksPanel::doShowOnMap(LLLandmark* landmark) diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index c65abc178b..bee141d051 100644 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -46,7 +46,6 @@ class LLAccordionCtrlTab; class LLFolderViewItem; class LLMenuGL; class LLInventoryPanel; -class LLInventoryObserver; class LLInventorySubTreePanel; class LLLandmarksPanel : public LLPanelPlacesTab, LLRemoteParcelInfoObserver @@ -63,13 +62,10 @@ public: void onSelectionChange(LLInventorySubTreePanel* inventory_list, const std::deque<LLFolderViewItem*> &items, BOOL user_action); void onSelectorButtonClicked(); - - /** - * Updates accordions according to filtered items in lists. - * - * It hides accordion for empty lists - */ - void updateFilteredAccordions(); + void setCurrentSelectedList(LLInventorySubTreePanel* inventory_list) + { + mCurrentSelectedList = inventory_list; + } protected: /** @@ -111,6 +107,13 @@ private: void onCustomAction(const LLSD& command_name); /** + * Updates accordions according to filtered items in lists. + * + * It hides accordion for empty lists + */ + void updateFilteredAccordions(); + + /** * Determines if selected item can be modified via context/gear menu. * * It validates Places Landmarks rules first. And then LLFolderView permissions. @@ -148,11 +151,9 @@ private: LLMenuGL* mGearFolderMenu; LLMenuGL* mMenuAdd; LLInventorySubTreePanel* mCurrentSelectedList; - LLInventoryObserver* mInventoryObserver; LLPanel* mListCommands; bool mSortByDate; - bool mDirtyFilter; typedef std::vector<LLAccordionCtrlTab*> accordion_tabs_t; accordion_tabs_t mAccordionTabs; diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index ec0f8e303c..4bae6af12e 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -51,6 +51,7 @@ #include "llfloaterpreference.h" #include "llfocusmgr.h" #include "lllineeditor.h" +#include "llnotificationsutil.h" #include "llstartup.h" #include "lltextbox.h" #include "llui.h" @@ -190,7 +191,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, gViewerWindow->getRootView()->addChildInBack(this); // Logo - mLogoImage = LLUI::getUIImage("startup_logo.j2c"); + mLogoImage = LLUI::getUIImage("startup_logo"); LLUICtrlFactory::getInstance()->buildPanel(this, "panel_login.xml"); @@ -225,6 +226,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLComboBox* combo = getChild<LLComboBox>("start_location_combo"); + LLURLSimString::setString(gSavedSettings.getString("LoginLocation")); std::string sim_string = LLURLSimString::sInstance.mSimString; if (!sim_string.empty()) { @@ -892,14 +894,29 @@ void LLPanelLogin::onClickConnect(void *) LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo"); std::string combo_text = combo->getSimple(); - if (first.empty() || last.empty()) + bool has_first_and_last = !(first.empty() || last.empty()); + bool has_location = false; + + if(combo_text=="<Type region name>" || combo_text =="") + { + // *NOTE: Mani - Location field is not always committed by this point! + // This may be duplicate work, but better than not doing the work! + LLURLSimString::sInstance.setString(""); + } + else + { + // *NOTE: Mani - Location field is not always committed by this point! + LLURLSimString::sInstance.setString(combo_text); + has_location = true; + } + + if(!has_first_and_last) { - LLNotifications::instance().add("MustHaveAccountToLogIn"); + LLNotificationsUtil::add("MustHaveAccountToLogIn"); } - else if( (combo_text=="<Type region name>" || combo_text =="") - && LLURLSimString::sInstance.mSimString =="") + else if(!has_location) { - LLNotifications::instance().add("StartRegionEmpty"); + LLNotificationsUtil::add("StartRegionEmpty"); } else { @@ -913,7 +930,7 @@ void LLPanelLogin::onClickConnect(void *) // static bool LLPanelLogin::newAccountAlertCallback(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) { llinfos << "Going to account creation URL" << llendl; @@ -954,7 +971,7 @@ void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data) { if (gKeyboard->getKeyDown(KEY_CAPSLOCK) && sCapslockDidNotification == FALSE) { - LLNotifications::instance().add("CapsKeyOn"); + LLNotificationsUtil::add("CapsKeyOn"); sCapslockDidNotification = TRUE; } } diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 74c1420cf3..9fd92725dc 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -653,7 +653,7 @@ void LLFloaterInventoryFinder::updateElementsFromFilter() return; // Get data needed for filter display - U32 filter_types = mFilter->getFilterTypes(); + U32 filter_types = mFilter->getFilterObjectTypes(); std::string filter_string = mFilter->getFilterSubString(); LLInventoryFilter::EFolderShow show_folders = mFilter->getShowFolderState(); U32 hours = mFilter->getHoursAgo(); @@ -966,6 +966,46 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) preview_texture->openToSave(); } } + // This doesn't currently work, since the viewer can't change an assetID an item. + if (command_name == "regenerate_link") + { + LLInventoryPanel *active_panel = getActivePanel(); + LLFolderViewItem* current_item = active_panel->getRootFolder()->getCurSelectedItem(); + if (!current_item) + { + return; + } + const LLUUID item_id = current_item->getListener()->getUUID(); + LLViewerInventoryItem *item = gInventory.getItem(item_id); + item->regenerateLink(); + active_panel->setSelection(item_id, TAKE_FOCUS_NO); + } + if (command_name == "find_original") + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) + { + return; + } + current_item->getListener()->performAction(getActivePanel()->getRootFolder(), getActivePanel()->getModel(), "goto"); + } + + if (command_name == "find_links") + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) + { + return; + } + const LLUUID& item_id = current_item->getListener()->getUUID(); + const std::string &item_name = current_item->getListener()->getName(); + LLInventoryFilter *filter = mActivePanel->getFilter(); + filter->setFilterSubString(item_name); + mFilterEditor->setText(item_name); + mFilterEditor->setFocus(TRUE); + filter->setFilterUUID(item_id); + filter->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); + } } BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) @@ -1001,6 +1041,45 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) } return FALSE; } + if (command_name == "find_original") + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) return FALSE; + const LLUUID& item_id = current_item->getListener()->getUUID(); + const LLViewerInventoryItem *item = gInventory.getItem(item_id); + if (item && item->getIsLinkType() && !item->getIsBrokenLink()) + { + return TRUE; + } + return FALSE; + } + + if (command_name == "find_links") + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) return FALSE; + const LLUUID& item_id = current_item->getListener()->getUUID(); + const LLInventoryObject *obj = gInventory.getObject(item_id); + if (obj && !obj->getIsLinkType() && LLAssetType::lookupCanLink(obj->getType())) + { + return TRUE; + } + return FALSE; + } + // This doesn't currently work, since the viewer can't change an assetID an item. + if (command_name == "regenerate_link") + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) return FALSE; + const LLUUID& item_id = current_item->getListener()->getUUID(); + const LLViewerInventoryItem *item = gInventory.getItem(item_id); + if (item && item->getIsBrokenLink()) + { + return TRUE; + } + return FALSE; + } + return TRUE; } diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp index 9b1f71a9a9..3fa0e7bf8f 100644 --- a/indra/newview/llpanelmediasettingsgeneral.cpp +++ b/indra/newview/llpanelmediasettingsgeneral.cpp @@ -32,12 +32,17 @@ #include "llviewerprecompiledheaders.h" -#include "llagent.h" #include "llpanelmediasettingsgeneral.h" + +// library includes #include "llcombobox.h" #include "llcheckboxctrl.h" +#include "llnotificationsutil.h" #include "llspinctrl.h" #include "lluictrlfactory.h" + +// project includes +#include "llagent.h" #include "llviewerwindow.h" #include "llviewermedia.h" #include "llsdutil.h" @@ -54,6 +59,8 @@ #include "llfloatermediasettings.h" #include "llfloatertools.h" #include "lltrans.h" +#include "lltextbox.h" +#include "llpanelmediasettingssecurity.h" const char *CHECKERBOARD_DATA_URL = "data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22100%%22 height=%22100%%22 %3E%3Cdefs%3E%3Cpattern id=%22checker%22 patternUnits=%22userSpaceOnUse%22 x=%220%22 y=%220%22 width=%22128%22 height=%22128%22 viewBox=%220 0 128 128%22 %3E%3Crect x=%220%22 y=%220%22 width=%2264%22 height=%2264%22 fill=%22#ddddff%22 /%3E%3Crect x=%2264%22 y=%2264%22 width=%2264%22 height=%2264%22 fill=%22#ddddff%22 /%3E%3C/pattern%3E%3C/defs%3E%3Crect x=%220%22 y=%220%22 width=%22100%%22 height=%22100%%22 fill=%22url(#checker)%22 /%3E%3C/svg%3E"; @@ -93,10 +100,12 @@ BOOL LLPanelMediaSettingsGeneral::postBuild() mHomeURL = getChild< LLLineEditor >( LLMediaEntry::HOME_URL_KEY ); mWidthPixels = getChild< LLSpinCtrl >( LLMediaEntry::WIDTH_PIXELS_KEY ); mPreviewMedia = getChild<LLMediaCtrl>("preview_media"); + mFailWhiteListText = getChild<LLTextBox>( "home_fails_whitelist_label" ); // watch commit action for HOME URL childSetCommitCallback( LLMediaEntry::HOME_URL_KEY, onCommitHomeURL, this); childSetCommitCallback( "current_url_reset_btn",onBtnResetCurrentUrl, this); + // interrogates controls and updates widgets as required updateMediaPreview(); @@ -116,6 +125,11 @@ void LLPanelMediaSettingsGeneral::draw() // housekeeping LLPanel::draw(); + // TODO: we need to call this repeatedly until the floater panels are fully + // created but once we have a valid answer, we should stop looking here - the + // commit callback will handle it + checkHomeUrlPassesWhitelist(); + // enable/disable pixel values image entry based on auto scale checkbox if ( mAutoScale->getValue().asBoolean() == false ) { @@ -245,10 +259,6 @@ void LLPanelMediaSettingsGeneral::initValues( void* userdata, const LLSD& media_ LLPanelMediaSettingsGeneral *self =(LLPanelMediaSettingsGeneral *)userdata; self->mMediaEditable = editable; - //llinfos << "---------------" << llendl; - //llinfos << ll_pretty_print_sd(media_settings) << llendl; - //llinfos << "---------------" << llendl; - if ( LLPanelMediaSettingsGeneral::isMultiple() ) { self->clearValues(self, self->mMediaEditable); @@ -311,7 +321,7 @@ void LLPanelMediaSettingsGeneral::initValues( void* userdata, const LLSD& media_ data_set[ i ].ctrl_ptr->setTentative( media_settings[ tentative_key ].asBoolean() ); }; }; - + // interrogates controls and updates widgets as required self->updateMediaPreview(); } @@ -350,20 +360,35 @@ void LLPanelMediaSettingsGeneral::onClose(bool app_quitting) } //////////////////////////////////////////////////////////////////////////////// +// +void LLPanelMediaSettingsGeneral::checkHomeUrlPassesWhitelist() +{ + // parent floater has not constructed the security panel yet + if ( mParent->getPanelSecurity() == 0 ) + return; + + std::string home_url = getHomeUrl(); + if ( home_url.empty() || mParent->getPanelSecurity()->urlPassesWhiteList( home_url ) ) + { + // Home URL is empty or passes the white list so hide the warning message + mFailWhiteListText->setVisible( false ); + } + else + { + // Home URL does not pass the white list so show the warning message + mFailWhiteListText->setVisible( true ); + }; +} + +//////////////////////////////////////////////////////////////////////////////// // static void LLPanelMediaSettingsGeneral::onCommitHomeURL( LLUICtrl* ctrl, void *userdata ) { LLPanelMediaSettingsGeneral* self =(LLPanelMediaSettingsGeneral *)userdata; - // check url user is trying to enter for home URL will pass whitelist - // and decline to accept it if it doesn't. - std::string home_url = self->mHomeURL->getValue().asString(); - if ( ! self->mParent->passesWhiteList( home_url ) ) - { - LLNotifications::instance().add("WhiteListInvalidatesHomeUrl"); - return; - }; - + // check home url passes whitelist and display warning if not + self->checkHomeUrlPassesWhitelist(); + self->updateMediaPreview(); } @@ -387,19 +412,19 @@ void LLPanelMediaSettingsGeneral::preApply() // void LLPanelMediaSettingsGeneral::getValues( LLSD &fill_me_in ) { - fill_me_in[LLMediaEntry::AUTO_LOOP_KEY] = mAutoLoop->getValue(); - fill_me_in[LLMediaEntry::AUTO_PLAY_KEY] = mAutoPlay->getValue(); - fill_me_in[LLMediaEntry::AUTO_SCALE_KEY] = mAutoScale->getValue(); - fill_me_in[LLMediaEntry::AUTO_ZOOM_KEY] = mAutoZoom->getValue(); - fill_me_in[LLMediaEntry::CONTROLS_KEY] = mControls->getCurrentIndex(); + fill_me_in[LLMediaEntry::AUTO_LOOP_KEY] = (LLSD::Boolean)mAutoLoop->getValue(); + fill_me_in[LLMediaEntry::AUTO_PLAY_KEY] = (LLSD::Boolean)mAutoPlay->getValue(); + fill_me_in[LLMediaEntry::AUTO_SCALE_KEY] = (LLSD::Boolean)mAutoScale->getValue(); + fill_me_in[LLMediaEntry::AUTO_ZOOM_KEY] = (LLSD::Boolean)mAutoZoom->getValue(); + fill_me_in[LLMediaEntry::CONTROLS_KEY] = (LLSD::Integer)mControls->getCurrentIndex(); //Don't fill in current URL: this is only supposed to get changed via navigate // fill_me_in[LLMediaEntry::CURRENT_URL_KEY] = mCurrentURL->getValue(); - fill_me_in[LLMediaEntry::HEIGHT_PIXELS_KEY] = mHeightPixels->getValue(); + fill_me_in[LLMediaEntry::HEIGHT_PIXELS_KEY] = (LLSD::Integer)mHeightPixels->getValue(); // Don't fill in the home URL if it is the special "Multiple Media" string! if (LLTrans::getString("Multiple Media") != mHomeURL->getValue()) - fill_me_in[LLMediaEntry::HOME_URL_KEY] = mHomeURL->getValue(); - fill_me_in[LLMediaEntry::FIRST_CLICK_INTERACT_KEY] = mFirstClick->getValue(); - fill_me_in[LLMediaEntry::WIDTH_PIXELS_KEY] = mWidthPixels->getValue(); + fill_me_in[LLMediaEntry::HOME_URL_KEY] = (LLSD::String)mHomeURL->getValue(); + fill_me_in[LLMediaEntry::FIRST_CLICK_INTERACT_KEY] = (LLSD::Boolean)mFirstClick->getValue(); + fill_me_in[LLMediaEntry::WIDTH_PIXELS_KEY] = (LLSD::Integer)mWidthPixels->getValue(); } //////////////////////////////////////////////////////////////////////////////// @@ -456,7 +481,7 @@ bool LLPanelMediaSettingsGeneral::navigateHomeSelectedFace(bool only_if_current_ selected_objects->getSelectedTEValue( &functor_navigate_media, all_face_media_navigated ); // Note: we don't update the 'current URL' field until the media data itself changes - + return all_face_media_navigated; } @@ -472,7 +497,6 @@ const std::string LLPanelMediaSettingsGeneral::getHomeUrl() void LLPanelMediaSettingsGeneral::updateCurrentUrl() { // Get the current URL from the selection - const LLMediaEntry default_media_data; std::string value_str = default_media_data.getCurrentURL(); struct functor_getter_current_url : public LLSelectedTEGetFunctor< std::string > diff --git a/indra/newview/llpanelmediasettingsgeneral.h b/indra/newview/llpanelmediasettingsgeneral.h index f8b8f0d224..7782b25d63 100644 --- a/indra/newview/llpanelmediasettingsgeneral.h +++ b/indra/newview/llpanelmediasettingsgeneral.h @@ -42,6 +42,7 @@ class LLLineEditor; class LLSpinCtrl; class LLTextureCtrl; class LLMediaCtrl; +class LLTextBox; class LLFloaterMediaSettings; class LLPanelMediaSettingsGeneral : public LLPanel @@ -87,6 +88,8 @@ private: static bool isMultiple(); + void checkHomeUrlPassesWhitelist(); + LLComboBox* mControls; LLCheckBoxCtrl* mAutoLoop; LLCheckBoxCtrl* mFirstClick; @@ -98,6 +101,7 @@ private: LLLineEditor* mHomeURL; LLLineEditor* mCurrentURL; LLMediaCtrl* mPreviewMedia; + LLTextBox* mFailWhiteListText; }; #endif // LL_LLPANELMEDIAMEDIASETTINGSGENERAL_H diff --git a/indra/newview/llpanelmediasettingssecurity.cpp b/indra/newview/llpanelmediasettingssecurity.cpp index 1a772e4eff..d87c7608d5 100644 --- a/indra/newview/llpanelmediasettingssecurity.cpp +++ b/indra/newview/llpanelmediasettingssecurity.cpp @@ -31,10 +31,13 @@ */ #include "llviewerprecompiledheaders.h" -#include "llfloaterreg.h" + #include "llpanelmediasettingssecurity.h" + +#include "llfloaterreg.h" #include "llpanelcontents.h" #include "llcheckboxctrl.h" +#include "llnotificationsutil.h" #include "llscrolllistctrl.h" #include "llscrolllistitem.h" #include "lluictrlfactory.h" @@ -43,8 +46,10 @@ #include "llsdutil.h" #include "llselectmgr.h" #include "llmediaentry.h" +#include "lltextbox.h" #include "llfloaterwhitelistentry.h" #include "llfloatermediasettings.h" + //////////////////////////////////////////////////////////////////////////////// // LLPanelMediaSettingsSecurity::LLPanelMediaSettingsSecurity() : @@ -52,9 +57,9 @@ LLPanelMediaSettingsSecurity::LLPanelMediaSettingsSecurity() : { mCommitCallbackRegistrar.add("Media.whitelistAdd", boost::bind(&LLPanelMediaSettingsSecurity::onBtnAdd, this)); mCommitCallbackRegistrar.add("Media.whitelistDelete", boost::bind(&LLPanelMediaSettingsSecurity::onBtnDel, this)); + // build dialog from XML LLUICtrlFactory::getInstance()->buildPanel(this, "panel_media_settings_security.xml"); - } //////////////////////////////////////////////////////////////////////////////// @@ -63,6 +68,7 @@ BOOL LLPanelMediaSettingsSecurity::postBuild() { mEnableWhiteList = getChild< LLCheckBoxCtrl >( LLMediaEntry::WHITELIST_ENABLE_KEY ); mWhiteListList = getChild< LLScrollListCtrl >( LLMediaEntry::WHITELIST_KEY ); + mHomeUrlFailsWhiteListText = getChild<LLTextBox>( "home_url_fails_whitelist" ); setDefaultBtn("whitelist_add"); @@ -81,30 +87,6 @@ void LLPanelMediaSettingsSecurity::draw() { // housekeeping LLPanel::draw(); - - // if list is empty, disable DEL button and checkbox to enable use of list - if ( mWhiteListList->isEmpty() ) - { - childSetEnabled( "whitelist_del", false ); - childSetEnabled( LLMediaEntry::WHITELIST_KEY, false ); - childSetEnabled( LLMediaEntry::WHITELIST_ENABLE_KEY, false ); - } - else - { - childSetEnabled( "whitelist_del", true ); - childSetEnabled( LLMediaEntry::WHITELIST_KEY, true ); - childSetEnabled( LLMediaEntry::WHITELIST_ENABLE_KEY, true ); - }; - - // if nothing is selected, disable DEL button - if ( mWhiteListList->getSelectedValue().asString().empty() ) - { - childSetEnabled( "whitelist_del", false ); - } - else - { - childSetEnabled( "whitelist_del", true ); - }; } //////////////////////////////////////////////////////////////////////////////// @@ -176,9 +158,8 @@ void LLPanelMediaSettingsSecurity::initValues( void* userdata, const LLSD& media LLSD::array_iterator iter = url_list.beginArray(); while( iter != url_list.endArray() ) { - // TODO: is iter guaranteed to be valid here? - std::string url = *iter; - list->addSimpleElement( url ); + std::string entry = *iter; + self->addWhiteListEntry( entry ); ++iter; }; }; @@ -210,18 +191,21 @@ void LLPanelMediaSettingsSecurity::preApply() // void LLPanelMediaSettingsSecurity::getValues( LLSD &fill_me_in ) { - fill_me_in[LLMediaEntry::WHITELIST_ENABLE_KEY] = mEnableWhiteList->getValue(); + fill_me_in[LLMediaEntry::WHITELIST_ENABLE_KEY] = (LLSD::Boolean)mEnableWhiteList->getValue(); // iterate over white list and extract items - std::vector< LLScrollListItem* > white_list_items = mWhiteListList->getAllData(); - std::vector< LLScrollListItem* >::iterator iter = white_list_items.begin(); + std::vector< LLScrollListItem* > whitelist_items = mWhiteListList->getAllData(); + std::vector< LLScrollListItem* >::iterator iter = whitelist_items.begin(); + // *NOTE: need actually set the key to be an emptyArray(), or the merge // we do with this LLSD will think there's nothing to change. fill_me_in[LLMediaEntry::WHITELIST_KEY] = LLSD::emptyArray(); - while( iter != white_list_items.end() ) + while( iter != whitelist_items.end() ) { - std::string white_list_url = (*iter)->getValue().asString(); - fill_me_in[ LLMediaEntry::WHITELIST_KEY ].append( white_list_url ); + LLScrollListCell* cell = (*iter)->getColumn( ENTRY_COLUMN ); + std::string whitelist_url = cell->getValue().asString(); + + fill_me_in[ LLMediaEntry::WHITELIST_KEY ].append( whitelist_url ); ++iter; }; } @@ -257,11 +241,8 @@ const std::string LLPanelMediaSettingsSecurity::makeValidUrl( const std::string& /////////////////////////////////////////////////////////////////////////////// // wrapper for testing a URL against the whitelist. We grab entries from -// white list list box widget and build a list to test against. Can also -// optionally pass the URL that you are trying to add to the widget since -// it won't be added until this call returns. -bool LLPanelMediaSettingsSecurity::passesWhiteList( const std::string& added_url, - const std::string& test_url ) +// white list list box widget and build a list to test against. +bool LLPanelMediaSettingsSecurity::urlPassesWhiteList( const std::string& test_url ) { // the checkUrlAgainstWhitelist(..) function works on a vector // of strings for the white list entries - in this panel, the white list @@ -270,20 +251,18 @@ bool LLPanelMediaSettingsSecurity::passesWhiteList( const std::string& added_url whitelist_strings.clear(); // may not be required - I forget what the spec says. // step through whitelist widget entries and grab them as strings - std::vector< LLScrollListItem* > white_list_items = mWhiteListList->getAllData(); - std::vector< LLScrollListItem* >::iterator iter = white_list_items.begin(); - while( iter != white_list_items.end() ) + std::vector< LLScrollListItem* > whitelist_items = mWhiteListList->getAllData(); + std::vector< LLScrollListItem* >::iterator iter = whitelist_items.begin(); + while( iter != whitelist_items.end() ) { - const std::string whitelist_url = (*iter)->getValue().asString(); + LLScrollListCell* cell = (*iter)->getColumn( ENTRY_COLUMN ); + std::string whitelist_url = cell->getValue().asString(); + whitelist_strings.push_back( whitelist_url ); ++iter; }; - // add in the URL that might be added to the whitelist so we can test that too - if ( added_url.length() ) - whitelist_strings.push_back( added_url ); - // possible the URL is just a fragment so we validize it const std::string valid_url = makeValidUrl( test_url ); @@ -293,32 +272,68 @@ bool LLPanelMediaSettingsSecurity::passesWhiteList( const std::string& added_url /////////////////////////////////////////////////////////////////////////////// // -void LLPanelMediaSettingsSecurity::addWhiteListItem(const std::string& url) +void LLPanelMediaSettingsSecurity::updateWhitelistEnableStatus() +{ + // get the value for home URL and make it a valid URL + const std::string valid_url = makeValidUrl( mParent->getHomeUrl() ); + + // now check to see if the home url passes the whitelist in its entirity + if ( urlPassesWhiteList( valid_url ) ) + { + mEnableWhiteList->setEnabled( true ); + mHomeUrlFailsWhiteListText->setVisible( false ); + } + else + { + mEnableWhiteList->set( false ); + mEnableWhiteList->setEnabled( false ); + mHomeUrlFailsWhiteListText->setVisible( true ); + }; +} + +/////////////////////////////////////////////////////////////////////////////// +// Add an entry to the whitelist scrollbox and indicate if the current +// home URL passes this entry or not using an icon +void LLPanelMediaSettingsSecurity::addWhiteListEntry( const std::string& entry ) { - // grab home URL from the general panel (via the parent floater) + // grab the home url std::string home_url( "" ); if ( mParent ) home_url = mParent->getHomeUrl(); - // if the home URL is blank (user hasn't entered it yet) then - // don't bother to check if it passes the white list - if ( home_url.empty() ) - { - mWhiteListList->addSimpleElement( url ); - return; - }; + // try to make a valid URL based on what the user entered - missing scheme for example + const std::string valid_url = makeValidUrl( home_url ); - // if the URL passes the white list, add it - if ( passesWhiteList( url, home_url ) ) + // check the home url against this single whitelist entry + std::vector< std::string > whitelist_entries; + whitelist_entries.push_back( entry ); + bool home_url_passes_entry = LLMediaEntry::checkUrlAgainstWhitelist( valid_url, whitelist_entries ); + + // build an icon cell based on whether or not the home url pases it or not + LLSD row; + if ( home_url_passes_entry || home_url.empty() ) { - mWhiteListList->addSimpleElement( url ); + row[ "columns" ][ ICON_COLUMN ][ "type" ] = "icon"; + row[ "columns" ][ ICON_COLUMN ][ "value" ] = ""; + row[ "columns" ][ ICON_COLUMN ][ "width" ] = 20; } else - // display a message indicating you can't do that { - LLNotifications::instance().add("WhiteListInvalidatesHomeUrl"); + row[ "columns" ][ ICON_COLUMN ][ "type" ] = "icon"; + row[ "columns" ][ ICON_COLUMN ][ "value" ] = "parcel_color_EXP"; + row[ "columns" ][ ICON_COLUMN ][ "width" ] = 20; }; -} + + // always add in the entry itself + row[ "columns" ][ ENTRY_COLUMN ][ "type" ] = "text"; + row[ "columns" ][ ENTRY_COLUMN ][ "value" ] = entry; + + // add to the white list scroll box + mWhiteListList->addElement( row ); + + // update whitelist enable checkbox based on whether the home url passes the whitelist + updateWhitelistEnableStatus(); +}; /////////////////////////////////////////////////////////////////////////////// // static @@ -334,6 +349,9 @@ void LLPanelMediaSettingsSecurity::onBtnDel( void* userdata ) LLPanelMediaSettingsSecurity *self =(LLPanelMediaSettingsSecurity *)userdata; self->mWhiteListList->deleteSelectedItems(); + + // contents of whitelist changed so recheck it against home url + self->updateWhitelistEnableStatus(); } //////////////////////////////////////////////////////////////////////////////// @@ -342,4 +360,3 @@ void LLPanelMediaSettingsSecurity::setParent( LLFloaterMediaSettings* parent ) { mParent = parent; }; - diff --git a/indra/newview/llpanelmediasettingssecurity.h b/indra/newview/llpanelmediasettingssecurity.h index 638664e59d..937bfb1bf9 100644 --- a/indra/newview/llpanelmediasettingssecurity.h +++ b/indra/newview/llpanelmediasettingssecurity.h @@ -37,6 +37,7 @@ class LLCheckBoxCtrl; class LLScrollListCtrl; +class LLTextBox; class LLFloaterMediaSettings; class LLPanelMediaSettingsSecurity : public LLPanel @@ -58,18 +59,27 @@ public: static void initValues( void* userdata, const LLSD& media_settings,bool editable ); static void clearValues( void* userdata, bool editable); - void addWhiteListItem(const std::string& url); + void addWhiteListEntry( const std::string& url ); void setParent( LLFloaterMediaSettings* parent ); + bool urlPassesWhiteList( const std::string& test_url ); const std::string makeValidUrl( const std::string& src_url ); - bool passesWhiteList( const std::string& added_url, const std::string& test_url ); protected: LLFloaterMediaSettings* mParent; private: + enum ColumnIndex + { + ICON_COLUMN = 0, + ENTRY_COLUMN = 1, + }; + LLCheckBoxCtrl* mEnableWhiteList; LLScrollListCtrl* mWhiteListList; - + LLTextBox* mHomeUrlFailsWhiteListText; + + void updateWhitelistEnableStatus(); + static void onBtnAdd(void*); static void onBtnDel(void*); }; diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 7a7372af6e..11c65a39f9 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -42,6 +42,7 @@ #include "llpanelobjectinventory.h" #include "llmenugl.h" +#include "llnotificationsutil.h" #include "roles_constants.h" #include "llagent.h" @@ -49,6 +50,7 @@ #include "llfloaterbuycurrency.h" #include "llfloaterreg.h" #include "llinventorybridge.h" +#include "llinventoryfilter.h" #include "llinventoryfunctions.h" #include "llpreviewanim.h" #include "llpreviewgesture.h" @@ -207,7 +209,7 @@ void LLTaskInvFVBridge::buyItem() LLViewerObject* obj; if( ( obj = gObjectList.findObject( mPanel->getTaskUUID() ) ) && obj->isAttachment() ) { - LLNotifications::instance().add("Cannot_Purchase_an_Attachment"); + LLNotificationsUtil::add("Cannot_Purchase_an_Attachment"); llinfos << "Attempt to purchase an attachment" << llendl; delete inv; } @@ -219,9 +221,9 @@ void LLTaskInvFVBridge::buyItem() if (sale_info.getSaleType() != LLSaleInfo::FS_CONTENTS) { U32 next_owner_mask = perm.getMaskNextOwner(); - args["MODIFYPERM"] = LLNotifications::instance().getGlobalString((next_owner_mask & PERM_MODIFY) ? "PermYes" : "PermNo"); - args["COPYPERM"] = LLNotifications::instance().getGlobalString((next_owner_mask & PERM_COPY) ? "PermYes" : "PermNo"); - args["RESELLPERM"] = LLNotifications::instance().getGlobalString((next_owner_mask & PERM_TRANSFER) ? "PermYes" : "PermNo"); + args["MODIFYPERM"] = LLTrans::getString((next_owner_mask & PERM_MODIFY) ? "PermYes" : "PermNo"); + args["COPYPERM"] = LLTrans::getString((next_owner_mask & PERM_COPY) ? "PermYes" : "PermNo"); + args["RESELLPERM"] = LLTrans::getString((next_owner_mask & PERM_TRANSFER) ? "PermYes" : "PermNo"); } std::string alertdesc; @@ -243,7 +245,7 @@ void LLTaskInvFVBridge::buyItem() payload["task_id"] = inv->mTaskID; payload["item_id"] = inv->mItemID; payload["type"] = inv->mType; - LLNotifications::instance().add(alertdesc, args, payload, LLTaskInvFVBridge::commitBuyItem); + LLNotificationsUtil::add(alertdesc, args, payload, LLTaskInvFVBridge::commitBuyItem); } } @@ -263,7 +265,7 @@ S32 LLTaskInvFVBridge::getPrice() // static bool LLTaskInvFVBridge::commitBuyItem(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if(0 == option) { LLViewerObject* object = gObjectList.findObject(notification["payload"]["task_id"].asUUID()); @@ -423,7 +425,7 @@ BOOL LLTaskInvFVBridge::isItemRemovable() bool remove_task_inventory_callback(const LLSD& notification, const LLSD& response, LLPanelObjectInventory* panel) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLViewerObject* object = gObjectList.findObject(notification["payload"]["task_id"].asUUID()); if(option == 0 && object) { @@ -468,7 +470,7 @@ BOOL LLTaskInvFVBridge::removeItem() LLSD payload; payload["task_id"] = mPanel->getTaskUUID(); payload["inventory_ids"].append(mUUID); - LLNotifications::instance().add("RemoveItemWarn", LLSD(), payload, boost::bind(&remove_task_inventory_callback, _1, _2, mPanel)); + LLNotificationsUtil::add("RemoveItemWarn", LLSD(), payload, boost::bind(&remove_task_inventory_callback, _1, _2, mPanel)); return FALSE; } } @@ -498,7 +500,7 @@ void LLTaskInvFVBridge::removeBatch(LLDynamicArray<LLFolderViewEventListener*>& LLTaskInvFVBridge* itemp = (LLTaskInvFVBridge*)batch[i]; payload["inventory_ids"].append(itemp->getUUID()); } - LLNotifications::instance().add("RemoveItemWarn", LLSD(), payload, boost::bind(&remove_task_inventory_callback, _1, _2, mPanel)); + LLNotificationsUtil::add("RemoveItemWarn", LLSD(), payload, boost::bind(&remove_task_inventory_callback, _1, _2, mPanel)); } else @@ -1170,7 +1172,7 @@ void LLTaskLSLBridge::openItem() } else { - LLNotifications::instance().add("CannotOpenScriptObjectNoMod"); + LLNotificationsUtil::add("CannotOpenScriptObjectNoMod"); } } @@ -1812,6 +1814,7 @@ void LLPanelObjectInventory::updateInventory() mFolders->requestArrange(); mInventoryNeedsUpdate = FALSE; + LLEditMenuHandler::gEditMenuHandler = mFolders; } // *FIX: This is currently a very expensive operation, because we have @@ -2056,3 +2059,22 @@ void LLPanelObjectInventory::idle(void* user_data) self->updateInventory(); } } + +void LLPanelObjectInventory::onFocusLost() +{ + // inventory no longer handles cut/copy/paste/delete + if (LLEditMenuHandler::gEditMenuHandler == mFolders) + { + LLEditMenuHandler::gEditMenuHandler = NULL; + } + + LLPanel::onFocusLost(); +} + +void LLPanelObjectInventory::onFocusReceived() +{ + // inventory now handles cut/copy/paste/delete + LLEditMenuHandler::gEditMenuHandler = mFolders; + + LLPanel::onFocusReceived(); +} diff --git a/indra/newview/llpanelobjectinventory.h b/indra/newview/llpanelobjectinventory.h index 6722bb212e..bc339ece35 100644 --- a/indra/newview/llpanelobjectinventory.h +++ b/indra/newview/llpanelobjectinventory.h @@ -74,6 +74,9 @@ public: virtual void deleteAllChildren(); virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg); + /*virtual*/ void onFocusLost(); + /*virtual*/ void onFocusReceived(); + static void idle(void* user_data); protected: diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 5af26c1ad9..6aba8c0ebb 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -144,16 +144,13 @@ void LLPanelOutfitsInventory::onNew() { const std::string& outfit_name = LLViewerFolderType::lookupNewCategoryName(LLFolderType::FT_OUTFIT); LLUUID outfit_folder = gAgentWearables.makeNewOutfitLinks(outfit_name); - - getRootFolder()->setSelectionByID(outfit_folder, TRUE); - getRootFolder()->setNeedsAutoRename(TRUE); } void LLPanelOutfitsInventory::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action) { updateListCommands(); updateParent(); - if (getRootFolder()->needsAutoRename()) + if (getRootFolder()->needsAutoRename() && items.size()) { getRootFolder()->startRenamingSelectedItem(); getRootFolder()->setNeedsAutoRename(FALSE); @@ -356,7 +353,7 @@ void LLPanelOutfitsInventory::initAccordionPanels() mAccordionPanels.resize(2); LLInventoryPanel *myoutfits_panel = getChild<LLInventoryPanel>("outfitslist_accordionpanel"); - myoutfits_panel->setFilterTypes(1LL << LLFolderType::FT_OUTFIT, TRUE); + myoutfits_panel->setFilterTypes(1LL << LLFolderType::FT_OUTFIT, LLInventoryFilter::FILTERTYPE_CATEGORY); myoutfits_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); mAccordionPanels[0] = myoutfits_panel; mActivePanel = myoutfits_panel; diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index 7769a7d172..aa0ab4efbc 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -65,10 +65,12 @@ public: // Otherwise, return NULL. LLFolderViewEventListener* getCorrectListenerForAction(); void setParent(LLSidepanelAppearance *parent); + + LLFolderView* getRootFolder(); + protected: void updateParent(); bool getIsCorrectType(const LLFolderViewEventListener *listenerp) const; - LLFolderView* getRootFolder(); private: LLSidepanelAppearance* mParent; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index e6b6ec64bd..1743df52fc 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -73,6 +73,8 @@ static const std::string FRIENDS_TAB_NAME = "friends_panel"; static const std::string GROUP_TAB_NAME = "groups_panel"; static const std::string RECENT_TAB_NAME = "recent_panel"; +static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; + /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator { @@ -467,7 +469,7 @@ LLPanelPeople::~LLPanelPeople() } -void LLPanelPeople::onFriendsAccordionExpandedCollapsed(const LLSD& param, LLAvatarList* avatar_list) +void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list) { if(!avatar_list) { @@ -477,6 +479,7 @@ void LLPanelPeople::onFriendsAccordionExpandedCollapsed(const LLSD& param, LLAva bool expanded = param.asBoolean(); + setAccordionCollapsedByUser(ctrl, !expanded); if(!expanded) { avatar_list->resetSelection(); @@ -550,11 +553,11 @@ BOOL LLPanelPeople::postBuild() LLAccordionCtrlTab* accordion_tab = getChild<LLAccordionCtrlTab>("tab_all"); accordion_tab->setDropDownStateChangedCallback( - boost::bind(&LLPanelPeople::onFriendsAccordionExpandedCollapsed, this, _2, mAllFriendList)); + boost::bind(&LLPanelPeople::onFriendsAccordionExpandedCollapsed, this, _1, _2, mAllFriendList)); accordion_tab = getChild<LLAccordionCtrlTab>("tab_online"); accordion_tab->setDropDownStateChangedCallback( - boost::bind(&LLPanelPeople::onFriendsAccordionExpandedCollapsed, this, _2, mOnlineFriendList)); + boost::bind(&LLPanelPeople::onFriendsAccordionExpandedCollapsed, this, _1, _2, mOnlineFriendList)); buttonSetAction("view_profile_btn", boost::bind(&LLPanelPeople::onViewProfileButtonClicked, this)); buttonSetAction("group_info_btn", boost::bind(&LLPanelPeople::onGroupInfoButtonClicked, this)); @@ -760,7 +763,13 @@ void LLPanelPeople::updateButtons() LLPanel* cur_panel = mTabContainer->getCurrentPanel(); if (cur_panel) + { cur_panel->childSetEnabled("add_friend_btn", !is_friend); + if (friends_tab_active) + { + cur_panel->childSetEnabled("del_btn", multiple_selected); + } + } } buttonSetEnabled("teleport_btn", friends_tab_active && item_selected && isFriendOnline(selected_uuids.front())); @@ -931,6 +940,9 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string) mRecentList->setNameFilter(mFilterSubString); mGroupList->setNameFilter(mFilterSubString); + setAccordionCollapsedByUser("tab_online", false); + setAccordionCollapsedByUser("tab_all", false); + showFriendsAccordionsIfNeeded(); } @@ -1286,7 +1298,7 @@ void LLPanelPeople::notifyChildren(const LLSD& info) if (container->getCurrentPanelIndex() > 0) { // if not on the default panel, switch to it - container->onOpen(LLSD().insert(LLSideTrayPanelContainer::PARAM_SUB_PANEL_NAME, getName())); + container->onOpen(LLSD().with(LLSideTrayPanelContainer::PARAM_SUB_PANEL_NAME, getName())); } else LLSideTray::getInstance()->collapseSideBar(); @@ -1309,8 +1321,12 @@ void LLPanelPeople::showAccordion(const std::string name, bool show) tab->setVisible(show); if(show) { - // expand accordion - tab->changeOpenClose(false); + // don't expand accordion if it was collapsed by user + if(!isAccordionCollapsedByUser(tab)) + { + // expand accordion + tab->changeOpenClose(false); + } } } @@ -1342,3 +1358,44 @@ void LLPanelPeople::onFriendListRefreshComplete(LLUICtrl*ctrl, const LLSD& param LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("friends_accordion"); accordion->arrange(); } + +void LLPanelPeople::setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool collapsed) +{ + if(!acc_tab) + { + llwarns << "Invalid parameter" << llendl; + return; + } + + LLSD param = acc_tab->getValue(); + param[COLLAPSED_BY_USER] = collapsed; + acc_tab->setValue(param); +} + +void LLPanelPeople::setAccordionCollapsedByUser(const std::string& name, bool collapsed) +{ + setAccordionCollapsedByUser(getChild<LLUICtrl>(name), collapsed); +} + +bool LLPanelPeople::isAccordionCollapsedByUser(LLUICtrl* acc_tab) +{ + if(!acc_tab) + { + llwarns << "Invalid parameter" << llendl; + return false; + } + + LLSD param = acc_tab->getValue(); + if(!param.has(COLLAPSED_BY_USER)) + { + return false; + } + return param[COLLAPSED_BY_USER].asBoolean(); +} + +bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) +{ + return isAccordionCollapsedByUser(getChild<LLUICtrl>(name)); +} + +// EOF diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index d9dd76f3ac..5ac5bcc1d7 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -127,7 +127,7 @@ private: const std::vector<LLUUID>& ids, void*); - void onFriendsAccordionExpandedCollapsed(const LLSD& param, LLAvatarList* avatar_list); + void onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list); void showAccordion(const std::string name, bool show); @@ -135,6 +135,11 @@ private: void onFriendListRefreshComplete(LLUICtrl*ctrl, const LLSD& param); + void setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool collapsed); + void setAccordionCollapsedByUser(const std::string& name, bool collapsed); + bool isAccordionCollapsedByUser(LLUICtrl* acc_tab); + bool isAccordionCollapsedByUser(const std::string& name); + LLFilterEditor* mFilterEditor; LLTabContainer* mTabContainer; LLAvatarList* mOnlineFriendList; diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index 7dea5eaf67..57f3d86d53 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -97,7 +97,7 @@ LLContextMenu* NearbyMenu::createMenu() registrar.add("Avatar.Profile", boost::bind(&LLAvatarActions::showProfile, id)); registrar.add("Avatar.AddFriend", boost::bind(&LLAvatarActions::requestFriendshipDialog, id)); registrar.add("Avatar.IM", boost::bind(&LLAvatarActions::startIM, id)); - registrar.add("Avatar.Call", boost::bind(&LLAvatarActions::startIM, id)); // *TODO: unimplemented + registrar.add("Avatar.Call", boost::bind(&LLAvatarActions::startCall, id)); registrar.add("Avatar.OfferTeleport", boost::bind(&NearbyMenu::offerTeleport, this)); registrar.add("Avatar.ShowOnMap", boost::bind(&LLAvatarActions::startIM, id)); // *TODO: unimplemented registrar.add("Avatar.Share", boost::bind(&LLAvatarActions::startIM, id)); // *TODO: unimplemented @@ -117,7 +117,7 @@ LLContextMenu* NearbyMenu::createMenu() // registrar.add("Avatar.AddFriend", boost::bind(&LLAvatarActions::requestFriendshipDialog, mUUIDs)); // *TODO: unimplemented registrar.add("Avatar.IM", boost::bind(&LLAvatarActions::startConference, mUUIDs)); - // registrar.add("Avatar.Call", boost::bind(&LLAvatarActions::startConference, mUUIDs)); // *TODO: unimplemented + registrar.add("Avatar.Call", boost::bind(&LLAvatarActions::startAdhocCall, mUUIDs)); // registrar.add("Avatar.Share", boost::bind(&LLAvatarActions::startIM, mUUIDs)); // *TODO: unimplemented // registrar.add("Avatar.Pay", boost::bind(&LLAvatarActions::pay, mUUIDs)); // *TODO: unimplemented enable_registrar.add("Avatar.EnableItem", boost::bind(&NearbyMenu::enableContextMenuItem, this, _2)); diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index d8e0d91d88..6a29d76aad 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -36,13 +36,16 @@ #include "llpanelpermissions.h" +// library includes #include "lluuid.h" #include "llpermissions.h" #include "llcategory.h" #include "llclickaction.h" #include "llfocusmgr.h" +#include "llnotificationsutil.h" #include "llstring.h" +// project includes #include "llviewerwindow.h" #include "llresmgr.h" #include "lltextbox.h" @@ -891,7 +894,7 @@ void LLPanelPermissions::cbGroupID(LLUUID group_id) bool callback_deed_to_group(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) { LLUUID group_id; @@ -907,7 +910,7 @@ bool callback_deed_to_group(const LLSD& notification, const LLSD& response) void LLPanelPermissions::onClickDeedToGroup(void* data) { - LLNotifications::instance().add( "DeedObjectToGroup", LLSD(), LLSD(), callback_deed_to_group); + LLNotificationsUtil::add( "DeedObjectToGroup", LLSD(), LLSD(), callback_deed_to_group); } ///---------------------------------------------------------------------------- @@ -1084,7 +1087,7 @@ void LLPanelPermissions::onCommitClickAction(LLUICtrl* ctrl, void*) LLSelectMgr::getInstance()->selectGetSaleInfo(sale_info); if (!sale_info.isForSale()) { - LLNotifications::instance().add("CantSetBuyObject"); + LLNotificationsUtil::add("CantSetBuyObject"); // Set click action back to its old value U8 click_action = 0; @@ -1102,7 +1105,7 @@ void LLPanelPermissions::onCommitClickAction(LLUICtrl* ctrl, void*) if (!can_pay) { // Warn, but do it anyway. - LLNotifications::instance().add("ClickActionNotPayable"); + LLNotificationsUtil::add("ClickActionNotPayable"); } } LLSelectMgr::getInstance()->selectionSetClickAction(click_action); diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index da0c8d5020..541361324a 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -558,6 +558,11 @@ void LLPanelPickEdit::initTexturePickerMouseEvents() text_icon = getChild<LLIconCtrl>(XML_BTN_ON_TXTR); mSnapshotCtrl->setMouseEnterCallback(boost::bind(&LLPanelPickEdit::onTexturePickerMouseEnter, this, _1)); mSnapshotCtrl->setMouseLeaveCallback(boost::bind(&LLPanelPickEdit::onTexturePickerMouseLeave, this, _1)); + + // *WORKAROUND: Needed for EXT-1625: enabling save button each time when picker is opened, even if + // texture wasn't changed (see Steve's comment). + mSnapshotCtrl->setMouseDownCallback(boost::bind(&LLPanelPickEdit::enableSaveButton, this, true)); + text_icon->setVisible(FALSE); } diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 10b90b08d7..cc6e88a9d2 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -32,12 +32,15 @@ #include "llviewerprecompiledheaders.h" +#include "llpanelpicks.h" + #include "llagent.h" #include "llagentpicksinfo.h" #include "llavatarconstants.h" #include "llflatlistview.h" #include "llfloaterreg.h" #include "llfloaterworldmap.h" +#include "llnotificationsutil.h" #include "lltexturectrl.h" #include "lltoggleablemenu.h" #include "llviewergenericmessage.h" // send_generic_message @@ -47,7 +50,6 @@ #include "llaccordionctrl.h" #include "llaccordionctrltab.h" -#include "llpanelpicks.h" #include "llavatarpropertiesprocessor.h" #include "llpanelavatar.h" #include "llpanelprofile.h" @@ -59,7 +61,6 @@ static const std::string XML_BTN_DELETE = "trash_btn"; static const std::string XML_BTN_INFO = "info_btn"; static const std::string XML_BTN_TELEPORT = "teleport_btn"; static const std::string XML_BTN_SHOW_ON_MAP = "show_on_map_btn"; -static const std::string XML_BTN_OVERFLOW = "overflow_btn"; static const std::string PICK_ID("pick_id"); static const std::string PICK_CREATOR_ID("pick_creator_id"); @@ -111,7 +112,6 @@ LLPanelPicks::LLPanelPicks() mClassifiedsList(NULL), mPanelPickInfo(NULL), mPanelPickEdit(NULL), - mOverflowMenu(NULL), mPlusMenu(NULL), mPicksAccTab(NULL), mClassifiedsAccTab(NULL), @@ -271,7 +271,6 @@ BOOL LLPanelPicks::postBuild() childSetAction(XML_BTN_TELEPORT, boost::bind(&LLPanelPicks::onClickTeleport, this)); childSetAction(XML_BTN_SHOW_ON_MAP, boost::bind(&LLPanelPicks::onClickMap, this)); childSetAction(XML_BTN_INFO, boost::bind(&LLPanelPicks::onClickInfo, this)); - childSetAction(XML_BTN_OVERFLOW, boost::bind(&LLPanelPicks::onOverflowButtonClicked, this)); mPicksAccTab = getChild<LLAccordionCtrlTab>("tab_picks"); mPicksAccTab->setDropDownStateChangedCallback(boost::bind(&LLPanelPicks::onAccordionStateChanged, this, mPicksAccTab)); @@ -289,10 +288,6 @@ BOOL LLPanelPicks::postBuild() registar.add("Pick.Delete", boost::bind(&LLPanelPicks::onClickDelete, this)); mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_picks.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - LLUICtrl::CommitCallbackRegistry::ScopedRegistrar overflow_registar; - overflow_registar.add("PicksList.Overflow", boost::bind(&LLPanelPicks::onOverflowMenuItemClicked, this, _2)); - mOverflowMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_picks_overflow.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - LLUICtrl::CommitCallbackRegistry::ScopedRegistrar plus_registar; plus_registar.add("Picks.Plus.Action", boost::bind(&LLPanelPicks::onPlusMenuItemClicked, this, _2)); mPlusMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_picks_plus.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); @@ -300,24 +295,6 @@ BOOL LLPanelPicks::postBuild() return TRUE; } -void LLPanelPicks::onOverflowMenuItemClicked(const LLSD& param) -{ - std::string value = param.asString(); - - if("info" == value) - { - onClickInfo(); - } - else if("teleport" == value) - { - onClickTeleport(); - } - else if("map" == value) - { - onClickMap(); - } -} - void LLPanelPicks::onPlusMenuItemClicked(const LLSD& param) { std::string value = param.asString(); @@ -346,23 +323,6 @@ void LLPanelPicks::onAccordionStateChanged(const LLAccordionCtrlTab* acc_tab) updateButtons(); } -void LLPanelPicks::onOverflowButtonClicked() -{ - if (!mOverflowMenu->toggleVisibility()) - return; - - LLView* btn = getChild<LLView>(XML_BTN_OVERFLOW); - - if (mOverflowMenu->getButtonRect().isEmpty()) - { - mOverflowMenu->setButtonRect(btn); - } - mOverflowMenu->updateParent(LLMenuGL::sMenuContainer); - - LLRect rect = btn->getRect(); - LLMenuGL::showPopup(this, mOverflowMenu, rect.mRight, rect.mTop); -} - void LLPanelPicks::onOpen(const LLSD& key) { const LLUUID id(key.asUUID()); @@ -431,7 +391,7 @@ void LLPanelPicks::onClickDelete() { LLSD args; args["PICK"] = value[PICK_NAME]; - LLNotifications::instance().add("DeleteAvatarPick", args, LLSD(), boost::bind(&LLPanelPicks::callbackDeletePick, this, _1, _2)); + LLNotificationsUtil::add("DeleteAvatarPick", args, LLSD(), boost::bind(&LLPanelPicks::callbackDeletePick, this, _1, _2)); return; } @@ -440,14 +400,14 @@ void LLPanelPicks::onClickDelete() { LLSD args; args["NAME"] = value[CLASSIFIED_NAME]; - LLNotifications::instance().add("DeleteClassified", args, LLSD(), boost::bind(&LLPanelPicks::callbackDeleteClassified, this, _1, _2)); + LLNotificationsUtil::add("DeleteClassified", args, LLSD(), boost::bind(&LLPanelPicks::callbackDeleteClassified, this, _1, _2)); return; } } bool LLPanelPicks::callbackDeletePick(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLSD pick_value = mPicksList->getSelectedValue(); if (0 == option) @@ -461,7 +421,7 @@ bool LLPanelPicks::callbackDeletePick(const LLSD& notification, const LLSD& resp bool LLPanelPicks::callbackDeleteClassified(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLSD value = mClassifiedsList->getSelectedValue(); if (0 == option) @@ -475,7 +435,7 @@ bool LLPanelPicks::callbackDeleteClassified(const LLSD& notification, const LLSD bool LLPanelPicks::callbackTeleport( const LLSD& notification, const LLSD& response ) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) { @@ -540,7 +500,7 @@ void LLPanelPicks::onDoubleClickPickItem(LLUICtrl* item) LLSD args; args["PICK"] = pick_value[PICK_NAME]; - LLNotifications::instance().add("TeleportToPick", args, LLSD(), boost::bind(&LLPanelPicks::callbackTeleport, this, _1, _2)); + LLNotificationsUtil::add("TeleportToPick", args, LLSD(), boost::bind(&LLPanelPicks::callbackTeleport, this, _1, _2)); } void LLPanelPicks::onDoubleClickClassifiedItem(LLUICtrl* item) @@ -550,7 +510,7 @@ void LLPanelPicks::onDoubleClickClassifiedItem(LLUICtrl* item) LLSD args; args["CLASSIFIED"] = value[CLASSIFIED_NAME]; - LLNotifications::instance().add("TeleportToClassified", args, LLSD(), boost::bind(&LLPanelPicks::callbackTeleport, this, _1, _2)); + LLNotificationsUtil::add("TeleportToClassified", args, LLSD(), boost::bind(&LLPanelPicks::callbackTeleport, this, _1, _2)); } void LLPanelPicks::updateButtons() @@ -566,7 +526,6 @@ void LLPanelPicks::updateButtons() childSetEnabled(XML_BTN_INFO, has_selected); childSetEnabled(XML_BTN_TELEPORT, has_selected); childSetEnabled(XML_BTN_SHOW_ON_MAP, has_selected); - childSetEnabled(XML_BTN_OVERFLOW, has_selected); } void LLPanelPicks::setProfilePanel(LLPanelProfile* profile_panel) diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index b17b6d6fe9..21794d56b2 100644 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -86,13 +86,14 @@ public: // parent panels failed to work (picks related code was in my profile panel) void setProfilePanel(LLPanelProfile* profile_panel); +protected: + /*virtual*/void updateButtons(); + private: void onClickDelete(); void onClickTeleport(); void onClickMap(); - void onOverflowMenuItemClicked(const LLSD& param); - void onOverflowButtonClicked(); void onPlusMenuItemClicked(const LLSD& param); void onListCommit(const LLFlatListView* f_list); @@ -125,7 +126,6 @@ private: bool callbackDeleteClassified(const LLSD& notification, const LLSD& response); bool callbackTeleport(const LLSD& notification, const LLSD& response); - void updateButtons(); virtual void onDoubleClickPickItem(LLUICtrl* item); virtual void onDoubleClickClassifiedItem(LLUICtrl* item); @@ -147,7 +147,6 @@ private: LLPanelClassifiedInfo* mPanelClassifiedInfo; LLPanelClassifiedEdit* mPanelClassifiedEdit; LLPanelPickEdit* mPanelPickEdit; - LLToggleableMenu* mOverflowMenu; LLToggleableMenu* mPlusMenu; LLAccordionCtrlTab* mPicksAccTab; diff --git a/indra/newview/llpanelplace.cpp b/indra/newview/llpanelplace.cpp index 61e18195b8..71d763b562 100644 --- a/indra/newview/llpanelplace.cpp +++ b/indra/newview/llpanelplace.cpp @@ -46,6 +46,7 @@ #include "llbutton.h" #include "llfloaterworldmap.h" #include "lllineeditor.h" +#include "llnotificationsutil.h" #include "lluiconstants.h" #include "lltextbox.h" #include "lltexteditor.h" @@ -401,13 +402,13 @@ void LLPanelPlace::onClickAuction(void* data) LLSD args; args["AUCTION_ID"] = self->mAuctionID; - LLNotifications::instance().add("GoToAuctionPage", args); + LLNotificationsUtil::add("GoToAuctionPage", args); } /* // static bool LLPanelPlace::callbackAuctionWebPage(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) { std::string url; diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 257a21ca15..f7f3c5830d 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -43,7 +43,7 @@ #include "llcombobox.h" #include "llfiltereditor.h" #include "llfloaterreg.h" -#include "llnotifications.h" +#include "llnotificationsutil.h" #include "lltabcontainer.h" #include "lltexteditor.h" #include "lltrans.h" @@ -118,7 +118,6 @@ static LLRegisterPanelClassWrapper<LLPanelPlaces> t_places("panel_places"); LLPanelPlaces::LLPanelPlaces() : LLPanel(), - mFilterSubString(LLStringUtil::null), mActivePanel(NULL), mFilterEditor(NULL), mPlaceProfile(NULL), @@ -262,6 +261,10 @@ void LLPanelPlaces::onOpen(const LLSD& key) } mLandmarkInfo->displayParcelInfo(LLUUID(), mPosGlobal); + + // Disable Save button because there is no item to save yet. + // The button will be enabled in onLandmarkLoaded callback. + mSaveBtn->setEnabled(FALSE); } else if (mPlaceInfoType == LANDMARK_INFO_TYPE) { @@ -381,20 +384,24 @@ void LLPanelPlaces::onLandmarkLoaded(LLLandmark* landmark) landmark->getRegionID(region_id); landmark->getGlobalPos(mPosGlobal); mLandmarkInfo->displayParcelInfo(region_id, mPosGlobal); + + mSaveBtn->setEnabled(TRUE); } void LLPanelPlaces::onFilterEdit(const std::string& search_string, bool force_filter) { - if (force_filter || mFilterSubString != search_string) + if (!mActivePanel) + return; + + if (force_filter || mActivePanel->getFilterSubString() != search_string) { - mFilterSubString = search_string; + std::string string = search_string; // Searches are case-insensitive - LLStringUtil::toUpper(mFilterSubString); - LLStringUtil::trimHead(mFilterSubString); + LLStringUtil::toUpper(string); + LLStringUtil::trimHead(string); - if (mActivePanel) - mActivePanel->onSearchEdit(mFilterSubString); + mActivePanel->onSearchEdit(string); } } @@ -404,7 +411,7 @@ void LLPanelPlaces::onTabSelected() if (!mActivePanel) return; - onFilterEdit(mFilterSubString, true); + onFilterEdit(mActivePanel->getFilterSubString(), true); mActivePanel->updateVerbs(); } @@ -417,7 +424,7 @@ void LLPanelPlaces::onTeleportButtonClicked() { LLSD payload; payload["asset_id"] = mItem->getAssetUUID(); - LLNotifications::instance().add("TeleportFromLandmark", LLSD(), payload); + LLNotificationsUtil::add("TeleportFromLandmark", LLSD(), payload); } else if (mPlaceInfoType == AGENT_INFO_TYPE || mPlaceInfoType == REMOTE_PLACE_INFO_TYPE || @@ -815,7 +822,7 @@ void LLPanelPlaces::changedInventory(U32 mask) // Filter applied to show all items. if (mActivePanel) - mActivePanel->onSearchEdit(mFilterSubString); + mActivePanel->onSearchEdit(mActivePanel->getFilterSubString()); // we don't need to monitor inventory changes anymore, // so remove the observer @@ -906,5 +913,5 @@ static void onSLURLBuilt(std::string& slurl) LLSD args; args["SLURL"] = slurl; - LLNotifications::instance().add("CopySLURL", args); + LLNotificationsUtil::add("CopySLURL", args); } diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index 0d97353b66..5f9aed6357 100644 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -120,10 +120,6 @@ private: // be available (hence zero) LLVector3d mPosGlobal; - // Search string for filtering landmarks and teleport - // history locations - std::string mFilterSubString; - // Information type currently shown in Place Information panel std::string mPlaceInfoType; diff --git a/indra/newview/llpanelplacestab.cpp b/indra/newview/llpanelplacestab.cpp index 42c871a41a..9806b8c64d 100644 --- a/indra/newview/llpanelplacestab.cpp +++ b/indra/newview/llpanelplacestab.cpp @@ -33,14 +33,17 @@ #include "llpanelplacestab.h" -#include "llwindow.h" +#include "llbutton.h" +#include "llnotificationsutil.h" -#include "llnotifications.h" +#include "llwindow.h" -#include "llbutton.h" +#include "llpanelplaces.h" #include "llslurl.h" #include "llworldmap.h" +std::string LLPanelPlacesTab::sFilterSubString = LLStringUtil::null; + bool LLPanelPlacesTab::isTabVisible() { LLUICtrl* parent = getParentUICtrl(); @@ -82,5 +85,5 @@ void LLPanelPlacesTab::onRegionResponse(const LLVector3d& landmark_global_pos, LLSD args; args["SLURL"] = sl_url; - LLNotifications::instance().add("CopySLURL", args); + LLNotificationsUtil::add("CopySLURL", args); } diff --git a/indra/newview/llpanelplacestab.h b/indra/newview/llpanelplacestab.h index 458694d766..ce77a42259 100644 --- a/indra/newview/llpanelplacestab.h +++ b/indra/newview/llpanelplacestab.h @@ -34,7 +34,7 @@ #include "llpanel.h" -#include "llpanelplaces.h" +class LLPanelPlaces; class LLPanelPlacesTab : public LLPanel { @@ -55,9 +55,16 @@ public: const std::string& url, const LLUUID& snapshot_id, bool teleport); + + const std::string& getFilterSubString() { return sFilterSubString; } + void setFilterSubString(const std::string& string) { sFilterSubString = string; } + protected: LLButton* mTeleportBtn; LLButton* mShowOnMapBtn; + + // Search string for filtering landmarks and teleport history locations + static std::string sFilterSubString; }; #endif //LL_LLPANELPLACESTAB_H diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 71c1b0cbb9..aa2b7d4554 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -54,6 +54,7 @@ #include "llpanelprimmediacontrols.h" #include "llpluginclassmedia.h" #include "llprogressbar.h" +#include "llsliderctrl.h" #include "llstring.h" #include "llviewercontrol.h" #include "llviewerparcelmgr.h" @@ -63,13 +64,11 @@ #include "llweb.h" #include "llwindow.h" +#include "llfloatertools.h" // to enable hide if build tools are up + glh::matrix4f glh_get_current_modelview(); glh::matrix4f glh_get_current_projection(); -const F32 ZOOM_NEAR_PADDING = 1.0f; -const F32 ZOOM_MEDIUM_PADDING = 1.15f; -const F32 ZOOM_FAR_PADDING = 1.5f; - // Warning: make sure these two match! const LLPanelPrimMediaControls::EZoomLevel LLPanelPrimMediaControls::kZoomLevels[] = { ZOOM_NONE, ZOOM_MEDIUM }; const int LLPanelPrimMediaControls::kNumZoomLevels = 2; @@ -86,7 +85,14 @@ LLPanelPrimMediaControls::LLPanelPrimMediaControls() : mUpdateSlider(true), mClearFaceOnFade(false), mCurrentRate(0.0), - mMovieDuration(0.0) + mMovieDuration(0.0), + mTargetObjectID(LLUUID::null), + mTargetObjectFace(0), + mTargetImplID(LLUUID::null), + mTargetObjectNormal(LLVector3::zero), + mZoomObjectID(LLUUID::null), + mZoomObjectFace(0), + mVolumeSliderVisible(false) { mCommitCallbackRegistrar.add("MediaCtrl.Close", boost::bind(&LLPanelPrimMediaControls::onClickClose, this)); mCommitCallbackRegistrar.add("MediaCtrl.Back", boost::bind(&LLPanelPrimMediaControls::onClickBack, this)); @@ -103,7 +109,9 @@ LLPanelPrimMediaControls::LLPanelPrimMediaControls() : mCommitCallbackRegistrar.add("MediaCtrl.JumpProgress", boost::bind(&LLPanelPrimMediaControls::onCommitSlider, this)); mCommitCallbackRegistrar.add("MediaCtrl.CommitVolumeUp", boost::bind(&LLPanelPrimMediaControls::onCommitVolumeUp, this)); mCommitCallbackRegistrar.add("MediaCtrl.CommitVolumeDown", boost::bind(&LLPanelPrimMediaControls::onCommitVolumeDown, this)); + mCommitCallbackRegistrar.add("MediaCtrl.Volume", boost::bind(&LLPanelPrimMediaControls::onCommitVolumeSlider, this)); mCommitCallbackRegistrar.add("MediaCtrl.ToggleMute", boost::bind(&LLPanelPrimMediaControls::onToggleMute, this)); + mCommitCallbackRegistrar.add("MediaCtrl.ShowVolumeSlider", boost::bind(&LLPanelPrimMediaControls::showVolumeSlider, this)); mCommitCallbackRegistrar.add("MediaCtrl.SkipBack", boost::bind(&LLPanelPrimMediaControls::onClickSkipBack, this)); mCommitCallbackRegistrar.add("MediaCtrl.SkipForward", boost::bind(&LLPanelPrimMediaControls::onClickSkipForward, this)); @@ -145,13 +153,20 @@ BOOL LLPanelPrimMediaControls::postBuild() mVolumeBtn = getChild<LLButton>("media_volume_button"); mVolumeUpCtrl = getChild<LLUICtrl>("volume_up"); mVolumeDownCtrl = getChild<LLUICtrl>("volume_down"); + mVolumeSliderCtrl = getChild<LLSliderCtrl>("volume_slider"); mWhitelistIcon = getChild<LLIconCtrl>("media_whitelist_flag"); mSecureLockIcon = getChild<LLIconCtrl>("media_secure_lock_flag"); mMediaControlsStack = getChild<LLLayoutStack>("media_controls"); mLeftBookend = getChild<LLUICtrl>("left_bookend"); mRightBookend = getChild<LLUICtrl>("right_bookend"); mBackgroundImage = LLUI::getUIImage(getString("control_background_image_name")); + mVolumeSliderBackgroundImage = LLUI::getUIImage(getString("control_background_image_name")); LLStringUtil::convertToF32(getString("skip_step"), mSkipStep); + LLStringUtil::convertToS32(getString("min_width"), mMinWidth); + LLStringUtil::convertToS32(getString("min_height"), mMinHeight); + LLStringUtil::convertToF32(getString("zoom_near_padding"), mZoomNearPadding); + LLStringUtil::convertToF32(getString("zoom_medium_padding"), mZoomMediumPadding); + LLStringUtil::convertToF32(getString("zoom_far_padding"), mZoomFarPadding); // These are currently removed...but getChild creates a "dummy" widget. // This class handles them missing. @@ -257,13 +272,10 @@ LLPluginClassMedia* LLPanelPrimMediaControls::getTargetMediaPlugin() void LLPanelPrimMediaControls::updateShape() { - const S32 MIN_HUD_WIDTH=400; - const S32 MIN_HUD_HEIGHT=120; - LLViewerMediaImpl* media_impl = getTargetMediaImpl(); LLViewerObject* objectp = getTargetObject(); - if(!media_impl) + if(!media_impl || gFloaterTools->getVisible()) { setVisible(FALSE); return; @@ -279,7 +291,7 @@ void LLPanelPrimMediaControls::updateShape() bool can_navigate = parcel->getMediaAllowNavigate(); bool enabled = false; - bool is_zoomed = (mCurrentZoom != ZOOM_NONE); + bool is_zoomed = (mCurrentZoom != ZOOM_NONE) && (mTargetObjectID == mZoomObjectID) && (mTargetObjectFace == mZoomObjectFace); // There is no such thing as "has_focus" being different from normal controls set // anymore (as of user feedback from bri 10/09). So we cheat here and force 'has_focus' // to 'true' (or, actually, we use a setting) @@ -292,11 +304,13 @@ void LLPanelPrimMediaControls::updateShape() LLMediaEntry *media_data = objectp->getTE(mTargetObjectFace)->getMediaData(); if (media_data && NULL != dynamic_cast<LLVOVolume*>(objectp)) { - // Don't show the media HUD if we do not have permissions + // Don't show the media controls if we do not have permissions enabled = dynamic_cast<LLVOVolume*>(objectp)->hasMediaPermission(media_data, LLVOVolume::MEDIA_PERM_CONTROL); mini_controls = (LLMediaEntry::MINI == media_data->getControls()); } + const bool is_hud = objectp->isHUDAttachment(); + // // Set the state of the buttons // @@ -309,7 +323,7 @@ void LLPanelPrimMediaControls::updateShape() mStopCtrl->setVisible(false); mHomeCtrl->setVisible(has_focus); mZoomCtrl->setVisible(!is_zoomed); - mUnzoomCtrl->setVisible(has_focus && is_zoomed); + mUnzoomCtrl->setVisible(is_zoomed); mOpenCtrl->setVisible(true); mMediaAddressCtrl->setVisible(has_focus && !mini_controls); mMediaPlaySliderPanel->setVisible(has_focus && !mini_controls); @@ -319,8 +333,8 @@ void LLPanelPrimMediaControls::updateShape() mWhitelistIcon->setVisible(!mini_controls && (media_data)?media_data->getWhiteListEnable():false); // Disable zoom if HUD - mZoomCtrl->setEnabled(!objectp->isHUDAttachment()); - mUnzoomCtrl->setEnabled(!objectp->isHUDAttachment()); + mZoomCtrl->setEnabled(!is_hud); + mUnzoomCtrl->setEnabled(!is_hud); mSecureLockIcon->setVisible(false); mCurrentURL = media_impl->getCurrentMediaURL(); @@ -332,13 +346,12 @@ void LLPanelPrimMediaControls::updateShape() if(media_plugin && media_plugin->pluginSupportsMediaTime()) { - mReloadCtrl->setEnabled(FALSE); - mReloadCtrl->setVisible(FALSE); + mReloadCtrl->setEnabled(false); + mReloadCtrl->setVisible(false); mMediaStopCtrl->setVisible(has_focus); - mHomeCtrl->setVisible(FALSE); - // No nav controls - mBackCtrl->setVisible(FALSE); - mFwdCtrl->setEnabled(FALSE); + mHomeCtrl->setVisible(has_focus); + mBackCtrl->setVisible(false); + mFwdCtrl->setVisible(false); mMediaAddressCtrl->setVisible(false); mMediaAddressCtrl->setEnabled(false); mMediaPlaySliderPanel->setVisible(has_focus && !mini_controls); @@ -352,6 +365,8 @@ void LLPanelPrimMediaControls::updateShape() mVolumeUpCtrl->setVisible(has_focus); mVolumeDownCtrl->setVisible(has_focus); mVolumeCtrl->setEnabled(has_focus); + mVolumeSliderCtrl->setEnabled(has_focus && mVolumeSliderVisible); + mVolumeSliderCtrl->setVisible(has_focus && mVolumeSliderVisible); mWhitelistIcon->setVisible(false); mSecureLockIcon->setVisible(false); @@ -408,6 +423,7 @@ void LLPanelPrimMediaControls::updateShape() mVolumeUpCtrl->setEnabled(TRUE); mVolumeDownCtrl->setEnabled(TRUE); } + mVolumeSliderCtrl->setValue(volume); switch(result) { @@ -416,7 +432,6 @@ void LLPanelPrimMediaControls::updateShape() mPlayCtrl->setVisible(FALSE); mPauseCtrl->setEnabled(TRUE); mPauseCtrl->setVisible(has_focus); - mMediaStopCtrl->setEnabled(TRUE); break; case LLPluginClassMediaOwner::MEDIA_PAUSED: @@ -425,7 +440,6 @@ void LLPanelPrimMediaControls::updateShape() mPauseCtrl->setVisible(FALSE); mPlayCtrl->setEnabled(TRUE); mPlayCtrl->setVisible(has_focus); - mMediaStopCtrl->setEnabled(FALSE); break; } } @@ -455,9 +469,11 @@ void LLPanelPrimMediaControls::updateShape() mVolumeCtrl->setVisible(FALSE); mVolumeUpCtrl->setVisible(FALSE); mVolumeDownCtrl->setVisible(FALSE); + mVolumeSliderCtrl->setVisible(FALSE); mVolumeCtrl->setEnabled(FALSE); mVolumeUpCtrl->setEnabled(FALSE); mVolumeDownCtrl->setEnabled(FALSE); + mVolumeSliderCtrl->setEnabled(FALSE); if (mMediaPanelScroll) { @@ -508,12 +524,10 @@ void LLPanelPrimMediaControls::updateShape() { mMediaProgressPanel->setVisible(true); mMediaProgressBar->setPercent(media_plugin->getProgressPercent()); - gFocusMgr.setTopCtrl(mMediaProgressPanel); } - else if (mMediaProgressPanel->getVisible()) + else { mMediaProgressPanel->setVisible(false); - gFocusMgr.setTopCtrl(NULL); } } @@ -549,78 +563,80 @@ void LLPanelPrimMediaControls::updateShape() // // Calculate position and shape of the controls // + LLVector3 min, max; + glh::matrix4f mat = glh_get_current_projection()*glh_get_current_modelview(); std::vector<LLVector3>::iterator vert_it; std::vector<LLVector3>::iterator vert_end; std::vector<LLVector3> vect_face; - + LLVolume* volume = objectp->getVolume(); - + if (volume) { const LLVolumeFace& vf = volume->getVolumeFace(mTargetObjectFace); - + const LLVector3* ext = vf.mExtents; - + LLVector3 center = (ext[0]+ext[1])*0.5f; LLVector3 size = (ext[1]-ext[0])*0.5f; LLVector3 vert[] = - { - center + size.scaledVec(LLVector3(1,1,1)), - center + size.scaledVec(LLVector3(-1,1,1)), - center + size.scaledVec(LLVector3(1,-1,1)), - center + size.scaledVec(LLVector3(-1,-1,1)), - center + size.scaledVec(LLVector3(1,1,-1)), - center + size.scaledVec(LLVector3(-1,1,-1)), - center + size.scaledVec(LLVector3(1,-1,-1)), - center + size.scaledVec(LLVector3(-1,-1,-1)), - }; - + { + center + size.scaledVec(LLVector3(1,1,1)), + center + size.scaledVec(LLVector3(-1,1,1)), + center + size.scaledVec(LLVector3(1,-1,1)), + center + size.scaledVec(LLVector3(-1,-1,1)), + center + size.scaledVec(LLVector3(1,1,-1)), + center + size.scaledVec(LLVector3(-1,1,-1)), + center + size.scaledVec(LLVector3(1,-1,-1)), + center + size.scaledVec(LLVector3(-1,-1,-1)), + }; + LLVOVolume* vo = (LLVOVolume*) objectp; - + for (U32 i = 0; i < 8; i++) { - vect_face.push_back(vo->volumePositionToAgent(vert[i])); + vect_face.push_back(vo->volumePositionToAgent(vert[i])); } } vert_it = vect_face.begin(); vert_end = vect_face.end(); - - LLVector3 min = LLVector3(1,1,1); - LLVector3 max = LLVector3(-1,-1,-1); + + min = LLVector3(1,1,1); + max = LLVector3(-1,-1,-1); for(; vert_it != vert_end; ++vert_it) { // project silhouette vertices into screen space glh::vec3f screen_vert = glh::vec3f(vert_it->mV); mat.mult_matrix_vec(screen_vert); - + // add to screenspace bounding box update_min_max(min, max, LLVector3(screen_vert.v)); } - - LLCoordGL screen_min; - screen_min.mX = llround((F32)gViewerWindow->getWorldViewWidthRaw() * (min.mV[VX] + 1.f) * 0.5f); - screen_min.mY = llround((F32)gViewerWindow->getWorldViewHeightRaw() * (min.mV[VY] + 1.f) * 0.5f); + + LLCoordGL screen_min; + screen_min.mX = llround((F32)gViewerWindow->getWorldViewWidthScaled() * (min.mV[VX] + 1.f) * 0.5f); + screen_min.mY = llround((F32)gViewerWindow->getWorldViewHeightScaled() * (min.mV[VY] + 1.f) * 0.5f); LLCoordGL screen_max; - screen_max.mX = llround((F32)gViewerWindow->getWorldViewWidthRaw() * (max.mV[VX] + 1.f) * 0.5f); - screen_max.mY = llround((F32)gViewerWindow->getWorldViewHeightRaw() * (max.mV[VY] + 1.f) * 0.5f); + screen_max.mX = llround((F32)gViewerWindow->getWorldViewWidthScaled() * (max.mV[VX] + 1.f) * 0.5f); + screen_max.mY = llround((F32)gViewerWindow->getWorldViewHeightScaled() * (max.mV[VY] + 1.f) * 0.5f); // grow panel so that screenspace bounding box fits inside "media_region" element of HUD LLRect media_controls_rect; + S32 volume_slider_height = mVolumeSliderCtrl->getRect().getHeight() - /*fudge*/ 2; getParent()->screenRectToLocal(LLRect(screen_min.mX, screen_max.mY, screen_max.mX, screen_min.mY), &media_controls_rect); media_controls_rect.mLeft -= mMediaRegion->getRect().mLeft; - media_controls_rect.mBottom -= mMediaRegion->getRect().mBottom; + media_controls_rect.mBottom -= mMediaRegion->getRect().mBottom - volume_slider_height; media_controls_rect.mTop += getRect().getHeight() - mMediaRegion->getRect().mTop; media_controls_rect.mRight += getRect().getWidth() - mMediaRegion->getRect().mRight; - - LLRect old_hud_rect = media_controls_rect; + // keep all parts of HUD on-screen media_controls_rect.intersectWith(getParent()->getLocalRect()); - + // clamp to minimum size, keeping centered media_controls_rect.setCenterAndSize(media_controls_rect.getCenterX(), media_controls_rect.getCenterY(), - llmax(MIN_HUD_WIDTH, media_controls_rect.getWidth()), llmax(MIN_HUD_HEIGHT, media_controls_rect.getHeight())); + llmax(mMinWidth, media_controls_rect.getWidth()), llmax(mMinHeight, media_controls_rect.getHeight())); setShape(media_controls_rect, true); @@ -681,6 +697,7 @@ void LLPanelPrimMediaControls::draw() setVisible(FALSE); mClearFaceOnFade = false; + mVolumeSliderVisible = false; mTargetImplID = LLUUID::null; mTargetObjectID = LLUUID::null; mTargetObjectFace = 0; @@ -692,16 +709,29 @@ void LLPanelPrimMediaControls::draw() // Assumes layout_stack is a direct child of this panel mMediaControlsStack->updateLayout(); LLRect icon_area = mMediaControlsStack->getRect(); + + // adjust to ignore space from volume slider + icon_area.mTop -= mVolumeSliderCtrl->getRect().getHeight(); // adjust to ignore space from left bookend padding icon_area.mLeft += mLeftBookend->getRect().getWidth(); // ignore space from right bookend padding icon_area.mRight -= mRightBookend->getRect().getWidth(); - - // get UI image + + // draw control background UI image mBackgroundImage->draw( icon_area, UI_VERTEX_COLOR % alpha); + // draw volume slider background UI image + if (mVolumeSliderCtrl->getVisible()) + { + LLRect volume_slider_rect = mVolumeSliderCtrl->getRect(); + // For some reason the rect is not in the right place (??) + // This translates the bg to under the slider + volume_slider_rect.translate(mVolumeSliderCtrl->getParent()->getRect().mLeft, icon_area.getHeight()); + mVolumeSliderBackgroundImage->draw(volume_slider_rect, UI_VERTEX_COLOR % alpha); + } + { LLViewDrawContext context(alpha); LLPanel::draw(); @@ -968,17 +998,17 @@ void LLPanelPrimMediaControls::updateZoom() } case ZOOM_FAR: { - zoom_padding = ZOOM_FAR_PADDING; + zoom_padding = mZoomFarPadding; break; } case ZOOM_MEDIUM: { - zoom_padding = ZOOM_MEDIUM_PADDING; + zoom_padding = mZoomMediumPadding; break; } case ZOOM_NEAR: { - zoom_padding = ZOOM_NEAR_PADDING; + zoom_padding = mZoomNearPadding; break; } default: @@ -988,9 +1018,16 @@ void LLPanelPrimMediaControls::updateZoom() } } - if (zoom_padding > 0.0f) + if (zoom_padding > 0.0f) + { LLViewerMediaFocus::setCameraZoom(getTargetObject(), mTargetObjectNormal, zoom_padding); + } + + // Remember the object ID/face we zoomed into, so we can update the zoom icon appropriately + mZoomObjectID = mTargetObjectID; + mZoomObjectFace = mTargetObjectFace; } + void LLPanelPrimMediaControls::onScrollUp(void* user_data) { LLPanelPrimMediaControls* this_panel = static_cast<LLPanelPrimMediaControls*> (user_data); @@ -1180,6 +1217,16 @@ void LLPanelPrimMediaControls::onCommitVolumeDown() } } +void LLPanelPrimMediaControls::onCommitVolumeSlider() +{ + focusOnTarget(); + + LLViewerMediaImpl* media_impl = getTargetMediaImpl(); + if (media_impl) + { + media_impl->setVolume(mVolumeSliderCtrl->getValueF32()); + } +} void LLPanelPrimMediaControls::onToggleMute() { @@ -1201,3 +1248,7 @@ void LLPanelPrimMediaControls::onToggleMute() } } +void LLPanelPrimMediaControls::showVolumeSlider() +{ + mVolumeSliderVisible = true; +} diff --git a/indra/newview/llpanelprimmediacontrols.h b/indra/newview/llpanelprimmediacontrols.h index accfb72a04..06163051a5 100644 --- a/indra/newview/llpanelprimmediacontrols.h +++ b/indra/newview/llpanelprimmediacontrols.h @@ -40,6 +40,7 @@ class LLCoordWindow; class LLIconCtrl; class LLLayoutStack; class LLProgressBar; +class LLSliderCtrl; class LLViewerMediaImpl; class LLPanelPrimMediaControls : public LLPanel @@ -106,7 +107,9 @@ private: void onCommitVolumeUp(); void onCommitVolumeDown(); + void onCommitVolumeSlider(); void onToggleMute(); + void showVolumeSlider(); static void onScrollUp(void* user_data); static void onScrollUpHeld(void* user_data); @@ -153,13 +156,20 @@ private: LLButton *mVolumeBtn; LLUICtrl *mVolumeUpCtrl; LLUICtrl *mVolumeDownCtrl; + LLSliderCtrl *mVolumeSliderCtrl; LLIconCtrl *mWhitelistIcon; LLIconCtrl *mSecureLockIcon; LLLayoutStack *mMediaControlsStack; LLUICtrl *mLeftBookend; LLUICtrl *mRightBookend; LLUIImage* mBackgroundImage; + LLUIImage* mVolumeSliderBackgroundImage; F32 mSkipStep; + S32 mMinWidth; + S32 mMinHeight; + F32 mZoomNearPadding; + F32 mZoomMediumPadding; + F32 mZoomFarPadding; LLUICtrl *mMediaPanelScroll; LLButton *mScrollUpCtrl; @@ -190,6 +200,11 @@ private: S32 mTargetObjectFace; LLUUID mTargetImplID; LLVector3 mTargetObjectNormal; + + LLUUID mZoomObjectID; + S32 mZoomObjectFace; + + bool mVolumeSliderVisible; }; #endif // LL_PANELPRIMMEDIACONTROLS_H diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 4d152a13f3..1830d00f68 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -68,7 +68,7 @@ public: if (verb == "inspect") { - LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", avatar_id)); + LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", avatar_id)); return true; } diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 67d0e13786..523487fa14 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -41,6 +41,7 @@ #include "llaccordionctrl.h" #include "llaccordionctrltab.h" #include "llflatlistview.h" +#include "llnotificationsutil.h" #include "lltextbox.h" #include "llviewermenu.h" #include "llviewerinventory.h" @@ -51,6 +52,8 @@ // Used to limit time spent for items list update per frame. static const U32 ADD_LIMIT = 50; +static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; + class LLTeleportHistoryFlatItem : public LLPanel { public: @@ -217,7 +220,6 @@ void LLTeleportHistoryPanel::ContextMenu::onCopyToClipboard() LLTeleportHistoryPanel::LLTeleportHistoryPanel() : LLPanelPlacesTab(), - mFilterSubString(LLStringUtil::null), mDirty(true), mCurrentItem(0), mTeleportHistory(NULL), @@ -253,6 +255,10 @@ BOOL LLTeleportHistoryPanel::postBuild() LLAccordionCtrlTab* tab = (LLAccordionCtrlTab*)*iter; tab->setRightMouseDownCallback(boost::bind(&LLTeleportHistoryPanel::onAccordionTabRightClick, this, _1, _2, _3, _4)); tab->setDisplayChildren(false); + tab->setDropDownStateChangedCallback(boost::bind(&LLTeleportHistoryPanel::onAccordionExpand, this, _1, _2)); + + // All accordion tabs are collapsed initially + setAccordionCollapsedByUser(tab, true); mItemContainers.put(tab); @@ -269,10 +275,18 @@ BOOL LLTeleportHistoryPanel::postBuild() // Open first 2 accordion tabs if (mItemContainers.size() > 1) - mItemContainers.get(mItemContainers.size() - 1)->setDisplayChildren(true); + { + LLAccordionCtrlTab* tab = mItemContainers.get(mItemContainers.size() - 1); + tab->setDisplayChildren(true); + setAccordionCollapsedByUser(tab, false); + } if (mItemContainers.size() > 2) - mItemContainers.get(mItemContainers.size() - 2)->setDisplayChildren(true); + { + LLAccordionCtrlTab* tab = mItemContainers.get(mItemContainers.size() - 2); + tab->setDisplayChildren(true); + setAccordionCollapsedByUser(tab, false); + } } getChild<LLPanel>("bottom_panel")->childSetAction("gear_btn",boost::bind(&LLTeleportHistoryPanel::onGearButtonClicked, this)); @@ -302,9 +316,9 @@ void LLTeleportHistoryPanel::draw() // virtual void LLTeleportHistoryPanel::onSearchEdit(const std::string& string) { - if (mFilterSubString != string) + if (sFilterSubString != string) { - mFilterSubString = string; + sFilterSubString = string; showTeleportHistory(); } } @@ -467,8 +481,8 @@ void LLTeleportHistoryPanel::refresh() std::string landmark_title = items[mCurrentItem].mTitle; LLStringUtil::toUpper(landmark_title); - std::string::size_type match_offset = mFilterSubString.size() ? landmark_title.find(mFilterSubString) : std::string::npos; - bool passed = mFilterSubString.size() == 0 || match_offset != std::string::npos; + std::string::size_type match_offset = sFilterSubString.size() ? landmark_title.find(sFilterSubString) : std::string::npos; + bool passed = sFilterSubString.size() == 0 || match_offset != std::string::npos; if (!passed) { @@ -490,6 +504,18 @@ void LLTeleportHistoryPanel::refresh() LLAccordionCtrlTab* tab = mItemContainers.get(mItemContainers.size() - 1 - tab_idx); tab->setVisible(true); + // Expand all accordion tabs when filtering + if(!mFilterSubString.empty()) + { + tab->setDisplayChildren(true); + } + // Restore each tab's expand state when not filtering + else + { + bool collapsed = isAccordionCollapsedByUser(tab); + tab->setDisplayChildren(!collapsed); + } + curr_flat_view = getFlatListViewFromTab(tab); } @@ -722,13 +748,13 @@ void LLTeleportHistoryPanel::onCollapseAllFolders() void LLTeleportHistoryPanel::onClearTeleportHistory() { - LLNotifications::instance().add("ConfirmClearTeleportHistory", LLSD(), LLSD(), boost::bind(&LLTeleportHistoryPanel::onClearTeleportHistoryDialog, this, _1, _2)); + LLNotificationsUtil::add("ConfirmClearTeleportHistory", LLSD(), LLSD(), boost::bind(&LLTeleportHistoryPanel::onClearTeleportHistoryDialog, this, _1, _2)); } bool LLTeleportHistoryPanel::onClearTeleportHistoryDialog(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) { @@ -774,3 +800,26 @@ void LLTeleportHistoryPanel::onGearButtonClicked() LLMenuGL::showPopup(this, menu, menu_x, menu_y); } +void LLTeleportHistoryPanel::setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool collapsed) +{ + LLSD param = acc_tab->getValue(); + param[COLLAPSED_BY_USER] = collapsed; + acc_tab->setValue(param); +} + +bool LLTeleportHistoryPanel::isAccordionCollapsedByUser(LLUICtrl* acc_tab) +{ + LLSD param = acc_tab->getValue(); + if(!param.has("acc_collapsed")) + { + return false; + } + return param[COLLAPSED_BY_USER].asBoolean(); +} + +void LLTeleportHistoryPanel::onAccordionExpand(LLUICtrl* ctrl, const LLSD& param) +{ + bool expanded = param.asBoolean(); + // Save accordion tab state to restore it in refresh() + setAccordionCollapsedByUser(ctrl, !expanded); +} diff --git a/indra/newview/llpanelteleporthistory.h b/indra/newview/llpanelteleporthistory.h index a31ff34cb6..f646fea355 100644 --- a/indra/newview/llpanelteleporthistory.h +++ b/indra/newview/llpanelteleporthistory.h @@ -98,6 +98,10 @@ private: LLFlatListView* getFlatListViewFromTab(LLAccordionCtrlTab *); void onGearButtonClicked(); + void setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool collapsed); + bool isAccordionCollapsedByUser(LLUICtrl* acc_tab); + void onAccordionExpand(LLUICtrl* ctrl, const LLSD& param); + LLTeleportHistoryStorage* mTeleportHistory; LLAccordionCtrl* mHistoryAccordion; diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 4ee9cba69c..13f195a1be 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -47,10 +47,11 @@ #if LL_MSVC #pragma warning (disable : 4355) // 'this' used in initializer list: yes, intentionally #endif -LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list): +LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list, bool use_context_menu/* = true*/): mSpeakerMgr(data_source), mAvatarList(avatar_list), mSortOrder(E_SORT_BY_NAME) +, mParticipantListMenu(NULL) { mSpeakerAddListener = new SpeakerAddListener(*this); mSpeakerRemoveListener = new SpeakerRemoveListener(*this); @@ -63,13 +64,20 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av mSpeakerMgr->addListener(mSpeakerModeratorListener, "update_moderator"); mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData")); - mAvatarList->setDoubleClickCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, mAvatarList)); - mAvatarList->setRefreshCompleteCallback(boost::bind(&LLParticipantList::onAvatarListRefreshed, this, _1, _2)); + mAvatarListDoubleClickConnection = mAvatarList->setDoubleClickCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, mAvatarList)); + mAvatarListRefreshConnection = mAvatarList->setRefreshCompleteCallback(boost::bind(&LLParticipantList::onAvatarListRefreshed, this, _1, _2)); // Set onAvatarListDoubleClicked as default on_return action. - mAvatarList->setReturnCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, mAvatarList)); + mAvatarListReturnConnection = mAvatarList->setReturnCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, mAvatarList)); - mParticipantListMenu = new LLParticipantListMenu(*this); - mAvatarList->setContextMenu(mParticipantListMenu); + if (use_context_menu) + { + mParticipantListMenu = new LLParticipantListMenu(*this); + mAvatarList->setContextMenu(mParticipantListMenu); + } + else + { + mAvatarList->setContextMenu(NULL); + } //Lets fill avatarList with existing speakers LLAvatarList::uuid_vector_t& group_members = mAvatarList->getIDs(); @@ -79,17 +87,22 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av for(LLSpeakerMgr::speaker_list_t::iterator it = speaker_list.begin(); it != speaker_list.end(); it++) { const LLPointer<LLSpeaker>& speakerp = *it; - group_members.push_back(speakerp->mID); + addAvatarIDExceptAgent(group_members, speakerp->mID); if ( speakerp->mIsModerator ) { mModeratorList.insert(speakerp->mID); } } + mAvatarList->setDirty(true); sort(); } LLParticipantList::~LLParticipantList() { + mAvatarListDoubleClickConnection.disconnect(); + mAvatarListRefreshConnection.disconnect(); + mAvatarListReturnConnection.disconnect(); + delete mParticipantListMenu; mParticipantListMenu = NULL; } @@ -183,7 +196,7 @@ bool LLParticipantList::onAddItemEvent(LLPointer<LLOldEvents::LLEvent> event, co return true; } - group_members.push_back(uu_id); + addAvatarIDExceptAgent(group_members, uu_id); // Mark AvatarList as dirty one mAvatarList->setDirty(); sort(); @@ -251,6 +264,15 @@ void LLParticipantList::sort() } } +// static +void LLParticipantList::addAvatarIDExceptAgent(std::vector<LLUUID>& existing_list, const LLUUID& avatar_id) +{ + if (gAgent.getID() != avatar_id) + { + existing_list.push_back(avatar_id); + } +} + // // LLParticipantList::SpeakerAddListener // diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index 5e26c39fc8..86b38f5f1e 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -43,7 +43,7 @@ class LLParticipantList { LOG_CLASS(LLParticipantList); public: - LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list); + LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list, bool use_context_menu = true); ~LLParticipantList(); void setSpeakingIndicatorsVisible(BOOL visible); @@ -132,6 +132,11 @@ class LLParticipantList void onAvatarListDoubleClicked(LLAvatarList* list); void onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param); + /** + * Adds specified avatar ID to the existing list if it is not Agent's ID + */ + static void addAvatarIDExceptAgent(std::vector<LLUUID>& existing_list, const LLUUID& avatar_id); + LLSpeakerMgr* mSpeakerMgr; LLAvatarList* mAvatarList; @@ -146,4 +151,9 @@ class LLParticipantList LLParticipantListMenu* mParticipantListMenu; EParticipantSortOrder mSortOrder; + + // boost::connections + boost::signals2::connection mAvatarListDoubleClickConnection; + boost::signals2::connection mAvatarListRefreshConnection; + boost::signals2::connection mAvatarListReturnConnection; }; diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 3d2c529dda..30cb21c83c 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -43,6 +43,7 @@ #include "lldir.h" #include "llfloaterreg.h" #include "llmultigesture.h" +#include "llnotificationsutil.h" #include "llvfile.h" // newview @@ -254,7 +255,7 @@ BOOL LLPreviewGesture::canClose() else { // Bring up view-modal dialog: Save changes? Yes, No, Cancel - LLNotifications::instance().add("SaveChanges", LLSD(), LLSD(), + LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(), boost::bind(&LLPreviewGesture::handleSaveChangesDialog, this, _1, _2) ); return FALSE; } @@ -283,7 +284,7 @@ void LLPreviewGesture::onVisibilityChange ( const LLSD& new_visibility ) bool LLPreviewGesture::handleSaveChangesDialog(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch(option) { case 0: // "Yes" @@ -1054,14 +1055,14 @@ void LLPreviewGesture::saveIfNeeded() if (dp.getCurrentSize() > 1000) { - LLNotifications::instance().add("GestureSaveFailedTooManySteps"); + LLNotificationsUtil::add("GestureSaveFailedTooManySteps"); delete gesture; gesture = NULL; } else if (!ok) { - LLNotifications::instance().add("GestureSaveFailedTryAgain"); + LLNotificationsUtil::add("GestureSaveFailedTryAgain"); delete gesture; gesture = NULL; } @@ -1200,7 +1201,7 @@ void LLPreviewGesture::onSaveComplete(const LLUUID& asset_uuid, void* user_data, } else { - LLNotifications::instance().add("GestureSaveFailedObjectNotFound"); + LLNotificationsUtil::add("GestureSaveFailedObjectNotFound"); } } @@ -1216,7 +1217,7 @@ void LLPreviewGesture::onSaveComplete(const LLUUID& asset_uuid, void* user_data, llwarns << "Problem saving gesture: " << status << llendl; LLSD args; args["REASON"] = std::string(LLAssetStorage::getErrorString(status)); - LLNotifications::instance().add("GestureSaveFailedReason", args); + LLNotificationsUtil::add("GestureSaveFailedReason", args); } delete info; info = NULL; diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index ce81077d80..5d675fcda6 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -43,6 +43,7 @@ #include "llfloaterreg.h" #include "llinventorymodel.h" #include "lllineeditor.h" +#include "llnotificationsutil.h" #include "llnotify.h" #include "llresmgr.h" #include "roles_constants.h" @@ -153,7 +154,7 @@ BOOL LLPreviewNotecard::canClose() else { // Bring up view-modal dialog: Save changes? Yes, No, Cancel - LLNotifications::instance().add("SaveChanges", LLSD(), LLSD(), boost::bind(&LLPreviewNotecard::handleSaveChangesDialog,this, _1, _2)); + LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(), boost::bind(&LLPreviewNotecard::handleSaveChangesDialog,this, _1, _2)); return FALSE; } @@ -330,15 +331,15 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs, if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) { - LLNotifications::instance().add("NotecardMissing"); + LLNotificationsUtil::add("NotecardMissing"); } else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status) { - LLNotifications::instance().add("NotecardNoPermissions"); + LLNotificationsUtil::add("NotecardNoPermissions"); } else { - LLNotifications::instance().add("UnableToLoadNotecard"); + LLNotificationsUtil::add("UnableToLoadNotecard"); } llwarns << "Problem loading notecard: " << status << llendl; @@ -493,7 +494,7 @@ void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data } else { - LLNotifications::instance().add("SaveNotecardFailObjectNotFound"); + LLNotificationsUtil::add("SaveNotecardFailObjectNotFound"); } } // Perform item copy to inventory @@ -519,7 +520,7 @@ void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data llwarns << "Problem saving notecard: " << status << llendl; LLSD args; args["REASON"] = std::string(LLAssetStorage::getErrorString(status)); - LLNotifications::instance().add("SaveNotecardFailReason", args); + LLNotificationsUtil::add("SaveNotecardFailReason", args); } std::string uuid_string; @@ -532,7 +533,7 @@ void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data bool LLPreviewNotecard::handleSaveChangesDialog(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch(option) { case 0: // "Yes" diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 4e4711f8fb..0362fdbf56 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -45,7 +45,7 @@ #include "llkeyboard.h" #include "lllineeditor.h" #include "llhelp.h" - +#include "llnotificationsutil.h" #include "llresmgr.h" #include "llscrollbar.h" #include "llscrollcontainer.h" @@ -618,14 +618,14 @@ BOOL LLScriptEdCore::canClose() else { // Bring up view-modal dialog: Save changes? Yes, No, Cancel - LLNotifications::instance().add("SaveChanges", LLSD(), LLSD(), boost::bind(&LLScriptEdCore::handleSaveChangesDialog, this, _1, _2)); + LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(), boost::bind(&LLScriptEdCore::handleSaveChangesDialog, this, _1, _2)); return FALSE; } } bool LLScriptEdCore::handleSaveChangesDialog(const LLSD& notification, const LLSD& response ) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch( option ) { case 0: // "Yes" @@ -798,7 +798,7 @@ void LLScriptEdCore::onBtnUndoChanges() { if( !mEditor->tryToRevertToPristineState() ) { - LLNotifications::instance().add("ScriptCannotUndo", LLSD(), LLSD(), boost::bind(&LLScriptEdCore::handleReloadFromServerDialog, this, _1, _2)); + LLNotificationsUtil::add("ScriptCannotUndo", LLSD(), LLSD(), boost::bind(&LLScriptEdCore::handleReloadFromServerDialog, this, _1, _2)); } } @@ -827,7 +827,7 @@ void LLScriptEdCore::onErrorList(LLUICtrl*, void* user_data) bool LLScriptEdCore::handleReloadFromServerDialog(const LLSD& notification, const LLSD& response ) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch( option ) { case 0: // "Yes" @@ -1281,7 +1281,7 @@ void LLPreviewLSL::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32 llwarns << "Problem saving script: " << status << llendl; LLSD args; args["REASON"] = std::string(LLAssetStorage::getErrorString(status)); - LLNotifications::instance().add("SaveScriptFailReason", args); + LLNotificationsUtil::add("SaveScriptFailReason", args); } delete info; } @@ -1319,7 +1319,7 @@ void LLPreviewLSL::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_d llwarns << "Problem saving LSL Bytecode (Preview)" << llendl; LLSD args; args["REASON"] = std::string(LLAssetStorage::getErrorString(status)); - LLNotifications::instance().add("SaveBytecodeFailReason", args); + LLNotificationsUtil::add("SaveBytecodeFailReason", args); } delete instance_uuid; } @@ -1364,15 +1364,15 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) { - LLNotifications::instance().add("ScriptMissing"); + LLNotificationsUtil::add("ScriptMissing"); } else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status) { - LLNotifications::instance().add("ScriptNoPermissions"); + LLNotificationsUtil::add("ScriptNoPermissions"); } else { - LLNotifications::instance().add("UnableToLoadScript"); + LLNotificationsUtil::add("UnableToLoadScript"); } preview->mAssetStatus = PREVIEW_ASSET_ERROR; @@ -1605,15 +1605,15 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id, if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) { - LLNotifications::instance().add("ScriptMissing"); + LLNotificationsUtil::add("ScriptMissing"); } else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status) { - LLNotifications::instance().add("ScriptNoPermissions"); + LLNotificationsUtil::add("ScriptNoPermissions"); } else { - LLNotifications::instance().add("UnableToLoadScript"); + LLNotificationsUtil::add("UnableToLoadScript"); } instance->mAssetStatus = PREVIEW_ASSET_ERROR; } @@ -1698,7 +1698,7 @@ void LLLiveLSLEditor::onRunningCheckboxClicked( LLUICtrl*, void* userdata ) else { runningCheckbox->set(!running); - LLNotifications::instance().add("CouldNotStartStopScript"); + LLNotificationsUtil::add("CouldNotStartStopScript"); } } @@ -1721,7 +1721,7 @@ void LLLiveLSLEditor::onReset(void *userdata) } else { - LLNotifications::instance().add("CouldNotStartStopScript"); + LLNotificationsUtil::add("CouldNotStartStopScript"); } } @@ -1814,7 +1814,7 @@ void LLLiveLSLEditor::saveIfNeeded() LLViewerObject* object = gObjectList.findObject(mObjectUUID); if(!object) { - LLNotifications::instance().add("SaveScriptFailObjectNotFound"); + LLNotificationsUtil::add("SaveScriptFailObjectNotFound"); return; } @@ -1822,7 +1822,7 @@ void LLLiveLSLEditor::saveIfNeeded() { // $NOTE: While the error message may not be exactly correct, // it's pretty close. - LLNotifications::instance().add("SaveScriptFailObjectNotFound"); + LLNotificationsUtil::add("SaveScriptFailObjectNotFound"); return; } @@ -2023,7 +2023,7 @@ void LLLiveLSLEditor::onSaveTextComplete(const LLUUID& asset_uuid, void* user_da llwarns << "Unable to save text for a script." << llendl; LLSD args; args["REASON"] = std::string(LLAssetStorage::getErrorString(status)); - LLNotifications::instance().add("CompileQueueSaveText", args); + LLNotificationsUtil::add("CompileQueueSaveText", args); } else { @@ -2082,7 +2082,7 @@ void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* use LLSD args; args["REASON"] = std::string(LLAssetStorage::getErrorString(status)); - LLNotifications::instance().add("CompileQueueSaveBytecode", args); + LLNotificationsUtil::add("CompileQueueSaveBytecode", args); } std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,asset_uuid.asString()); diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 41cf402d6f..698f6152b4 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -43,6 +43,7 @@ #include "llfloaterreg.h" #include "llimagetga.h" #include "llinventory.h" +#include "llnotificationsutil.h" #include "llresmgr.h" #include "lltrans.h" #include "lltextbox.h" @@ -352,13 +353,13 @@ void LLPreviewTexture::onFileLoadedForSave(BOOL success, { LLSD args; args["FILE"] = self->mSaveFileName; - LLNotifications::instance().add("CannotEncodeFile", args); + LLNotificationsUtil::add("CannotEncodeFile", args); } else if( !image_tga->save( self->mSaveFileName ) ) { LLSD args; args["FILE"] = self->mSaveFileName; - LLNotifications::instance().add("CannotWriteFile", args); + LLNotificationsUtil::add("CannotWriteFile", args); } else { @@ -371,7 +372,7 @@ void LLPreviewTexture::onFileLoadedForSave(BOOL success, if( self && !success ) { - LLNotifications::instance().add("CannotDownloadFile"); + LLNotificationsUtil::add("CannotDownloadFile"); } } diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index bdea6ff459..088884178b 100644 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -37,9 +37,11 @@ #include "llchannelmanager.h" #include "llchiclet.h" #include "llfloaterreg.h" +#include "llnotifications.h" #include "llscreenchannel.h" #include "lltoastnotifypanel.h" #include "llviewerwindow.h" +#include "llimfloater.h" ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -60,15 +62,15 @@ LLUUID notification_id_to_object_id(const LLUUID& notification_id) ////////////////////////////////////////////////////////////////////////// LLScriptFloater::LLScriptFloater(const LLSD& key) -: LLTransientDockableFloater(NULL, true, key) +: LLDockableFloater(NULL, true, key) , mScriptForm(NULL) -, mObjectId(key.asUUID()) { } bool LLScriptFloater::toggle(const LLUUID& object_id) { - LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", object_id); + LLUUID notification_id = LLScriptFloaterManager::getInstance()->findNotificationId(object_id); + LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", notification_id); // show existing floater if(floater) @@ -95,7 +97,10 @@ bool LLScriptFloater::toggle(const LLUUID& object_id) LLScriptFloater* LLScriptFloater::show(const LLUUID& object_id) { - LLScriptFloater* floater = LLFloaterReg::showTypedInstance<LLScriptFloater>("script_floater", object_id); + LLUUID notification_id = LLScriptFloaterManager::getInstance()->findNotificationId(object_id); + + LLScriptFloater* floater = LLFloaterReg::showTypedInstance<LLScriptFloater>("script_floater", notification_id); + floater->setObjectId(object_id); floater->createForm(object_id); if (floater->getDockControl() == NULL) @@ -154,19 +159,22 @@ void LLScriptFloater::createForm(const LLUUID& object_id) void LLScriptFloater::onClose(bool app_quitting) { - LLScriptFloaterManager::getInstance()->removeNotificationByObjectId(getObjectId()); + if(getObjectId().notNull()) + { + LLScriptFloaterManager::getInstance()->removeNotificationByObjectId(getObjectId()); + } } void LLScriptFloater::setDocked(bool docked, bool pop_on_undock /* = true */) { - LLTransientDockableFloater::setDocked(docked, pop_on_undock); + LLDockableFloater::setDocked(docked, pop_on_undock); hideToastsIfNeeded(); } void LLScriptFloater::setVisible(BOOL visible) { - LLTransientDockableFloater::setVisible(visible); + LLDockableFloater::setVisible(visible); hideToastsIfNeeded(); } @@ -204,18 +212,29 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) script_notification_map_t::iterator it = mNotifications.find(object_id); if(it != mNotifications.end()) { - onRemoveNotification(notification_id); + onRemoveNotification(it->second.notification_id); } LLNotificationData nd = {notification_id}; mNotifications.insert(std::make_pair(object_id, nd)); - LLBottomTray::getInstance()->getChicletPanel()->createChiclet<LLScriptChiclet>(object_id); + // Create inventory offer chiclet for offer type notifications + LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id); + if( notification && notification->getType() == "offer" ) + { + LLBottomTray::instance().getChicletPanel()->createChiclet<LLInvOfferChiclet>(object_id); + } + else + { + LLBottomTray::getInstance()->getChicletPanel()->createChiclet<LLScriptChiclet>(object_id); + } + + toggleScriptFloater(object_id); } void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id) { - LLUUID object_id = notification_id_to_object_id(notification_id); + LLUUID object_id = findObjectId(notification_id); if(object_id.isNull()) { llwarns << "Invalid notification, no object id" << llendl; @@ -228,22 +247,24 @@ void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id) LLUUID channel_id(gSavedSettings.getString("NotificationChannelUUID")); LLScreenChannel* channel = dynamic_cast<LLScreenChannel*> (LLChannelManager::getInstance()->findChannelByID(channel_id)); - if(channel) + LLUUID n_toast_id = findNotificationToastId(object_id); + if(channel && n_toast_id.notNull()) { - channel->killToastByNotificationID(findNotificationToastId(object_id)); + channel->killToastByNotificationID(n_toast_id); } - mNotifications.erase(object_id); - // remove related chiclet LLBottomTray::getInstance()->getChicletPanel()->removeChiclet(object_id); // close floater - LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", object_id); + LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", notification_id); if(floater) { + floater->setObjectId(LLUUID::null); floater->closeFloater(); } + + mNotifications.erase(object_id); } void LLScriptFloaterManager::removeNotificationByObjectId(const LLUUID& object_id) @@ -288,6 +309,22 @@ void LLScriptFloaterManager::setNotificationToastId(const LLUUID& object_id, con } } +LLUUID LLScriptFloaterManager::findObjectId(const LLUUID& notification_id) +{ + if(notification_id.notNull()) + { + script_notification_map_t::const_iterator it = mNotifications.begin(); + for(; mNotifications.end() != it; ++it) + { + if(notification_id == it->second.notification_id) + { + return it->first; + } + } + } + return LLUUID::null; +} + LLUUID LLScriptFloaterManager::findNotificationId(const LLUUID& object_id) { script_notification_map_t::const_iterator it = mNotifications.find(object_id); diff --git a/indra/newview/llscriptfloater.h b/indra/newview/llscriptfloater.h index 0e1a7f36b7..8b5a266691 100644 --- a/indra/newview/llscriptfloater.h +++ b/indra/newview/llscriptfloater.h @@ -43,6 +43,9 @@ class LLToastNotifyPanel; */ class LLScriptFloaterManager : public LLSingleton<LLScriptFloaterManager> { + // *TODO + // LLScriptFloaterManager and LLScriptFloater will need some refactoring after we + // know how script notifications should look like. public: /** @@ -69,6 +72,8 @@ public: */ void toggleScriptFloater(const LLUUID& object_id); + LLUUID findObjectId(const LLUUID& notification_id); + LLUUID findNotificationId(const LLUUID& object_id); LLUUID findNotificationToastId(const LLUUID& object_id); @@ -102,7 +107,7 @@ private: * LLScriptFloater will create script form based on notification data and * will auto fit the form. */ -class LLScriptFloater : public LLTransientDockableFloater +class LLScriptFloater : public LLDockableFloater { public: @@ -125,6 +130,8 @@ public: const LLUUID& getObjectId() { return mObjectId; } + void setObjectId(const LLUUID& id) { mObjectId = id; } + /** * Close notification if script floater is closed. */ @@ -154,8 +161,6 @@ protected: */ static void hideToastsIfNeeded(); - void setObjectId(const LLUUID& id) { mObjectId = id; } - private: LLToastNotifyPanel* mScriptForm; LLUUID mObjectId; diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index e0e4dcb45d..d965b3031e 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -33,6 +33,7 @@ #include "llviewerprecompiledheaders.h" // file include +#define LLSELECTMGR_CPP #include "llselectmgr.h" // library includes @@ -41,6 +42,7 @@ #include "lleconomy.h" #include "llgl.h" #include "llrender.h" +#include "llnotifications.h" #include "llpermissions.h" #include "llpermissionsflags.h" #include "lltrans.h" @@ -174,6 +176,8 @@ LLObjectSelection *get_null_object_selection() return sNullSelection; } +// Build time optimization, generate this function once here +template class LLSelectMgr* LLSingleton<class LLSelectMgr>::getInstance(); //----------------------------------------------------------------------------- // LLSelectMgr() //----------------------------------------------------------------------------- diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 73bd7b805d..2d377f1ec0 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -324,6 +324,11 @@ private: typedef LLSafeHandle<LLObjectSelection> LLObjectSelectionHandle; +// Build time optimization, generate this once in .cpp file +#ifndef LLSELECTMGR_CPP +extern template class LLSelectMgr* LLSingleton<class LLSelectMgr>::getInstance(); +#endif + class LLSelectMgr : public LLEditMenuHandler, public LLSingleton<LLSelectMgr> { public: diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 824def3d92..ca7a3b663a 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -128,10 +128,6 @@ void LLSidepanelInventory::onOpen(const LLSD& key) mTaskPanel->setObjectSelection(LLSelectMgr::getInstance()->getSelection()); showTaskInfoPanel(); } - if (key.has("select")) - { - mPanelMainInventory->getPanel()->setSelection(key["select"].asUUID(), TAKE_FOCUS_NO); - } } void LLSidepanelInventory::onInfoButtonClicked() @@ -277,3 +273,21 @@ LLInventoryItem *LLSidepanelInventory::getSelectedItem() LLInventoryItem *item = gInventory.getItem(item_id); return item; } + +LLInventoryPanel *LLSidepanelInventory::getActivePanel() +{ + if (!getVisible()) + { + return NULL; + } + if (mInventoryPanel->getVisible()) + { + return mPanelMainInventory->getActivePanel(); + } + return NULL; +} + +BOOL LLSidepanelInventory::isMainInventoryPanelActive() const +{ + return mInventoryPanel->getVisible(); +} diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 6aa9cc745f..231cdac9e1 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -36,6 +36,7 @@ class LLFolderViewItem; class LLInventoryItem; +class LLInventoryPanel; class LLPanelMainInventory; class LLSidepanelItemInfo; class LLSidepanelTaskInfo; @@ -49,6 +50,9 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); + LLInventoryPanel* getActivePanel(); // Returns an active inventory panel, if any. + BOOL isMainInventoryPanelActive() const; + protected: // Tracks highlighted (selected) item in inventory panel. LLInventoryItem *getSelectedItem(); diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 5081c33f8e..ad6428e515 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -159,6 +159,7 @@ void LLSidepanelItemInfo::refresh() setIsEditing(FALSE); return; } + mEditBtn->setEnabled(FALSE); } if (!getIsEditing()) @@ -868,7 +869,11 @@ void LLSidepanelItemInfo::updateVerbs() const LLPermissions& perm = item->getPermissions(); BOOL is_modifiable = gAgent.allowOperation(PERM_MODIFY, perm, GP_OBJECT_MANIPULATE); - mEditBtn->setEnabled(is_modifiable); + + const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); + bool item_in_trash = item->getUUID() == trash_id || gInventory.isObjectDescendentOf(item->getUUID(), trash_id); + mEditBtn->setEnabled(is_modifiable && !item_in_trash); + } } diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 4396cce545..09e067b5f9 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -41,6 +41,7 @@ #include "llcategory.h" #include "llclickaction.h" #include "llfocusmgr.h" +#include "llnotificationsutil.h" #include "llstring.h" #include "llviewerwindow.h" @@ -865,7 +866,7 @@ void LLSidepanelTaskInfo::cbGroupID(LLUUID group_id) static bool callback_deed_to_group(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) { LLUUID group_id; @@ -881,7 +882,7 @@ static bool callback_deed_to_group(const LLSD& notification, const LLSD& respons void LLSidepanelTaskInfo::onClickDeedToGroup() { - LLNotifications::instance().add( "DeedObjectToGroup", LLSD(), LLSD(), callback_deed_to_group); + LLNotificationsUtil::add( "DeedObjectToGroup", LLSD(), LLSD(), callback_deed_to_group); } ///---------------------------------------------------------------------------- @@ -1014,7 +1015,7 @@ void LLSidepanelTaskInfo::onCommitClickAction(U8 click_action) LLSelectMgr::getInstance()->selectGetSaleInfo(sale_info); if (!sale_info.isForSale()) { - LLNotifications::instance().add("CantSetBuyObject"); + LLNotificationsUtil::add("CantSetBuyObject"); // Set click action back to its old value U8 click_action = 0; @@ -1032,7 +1033,7 @@ void LLSidepanelTaskInfo::onCommitClickAction(U8 click_action) if (!can_pay) { // Warn, but do it anyway. - LLNotifications::instance().add("ClickActionNotPayable"); + LLNotificationsUtil::add("ClickActionNotPayable"); } } LLSelectMgr::getInstance()->selectionSetClickAction(click_action); diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index ee5fa46c9c..a1af2e5411 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -66,37 +66,6 @@ static const std::string TAB_PANEL_CAPTION_TITLE_BOX = "sidetray_tab_title"; LLSideTray* LLSideTray::sInstance = 0; -class LLSideTrayInfoPanel: public LLPanel -{ - -public: - LLSideTrayInfoPanel():LLPanel() - { - setBorderVisible(true); - } - - BOOL handleHover(S32 x, S32 y, MASK mask) - { - getWindow()->setCursor(UI_CURSOR_HAND); - return TRUE; - } - - BOOL handleMouseUp(S32 x, S32 y, MASK mask) - { - std::string name = getName(); - onCommit(); - LLSideTray::getInstance()->selectTabByName(name); - return LLPanel::handleMouseUp(x,y,mask); - } - void reshape (S32 width, S32 height, BOOL called_from_parent ) - { - return LLPanel::reshape(width, height, called_from_parent); - } - -}; - -static LLRegisterPanelClassWrapper<LLSideTrayInfoPanel> t_people("panel_sidetray_home_info"); - LLSideTray* LLSideTray::getInstance() { if (!sInstance) @@ -159,6 +128,7 @@ public: void onOpen (const LLSD& key); + LLPanel *getPanel(); private: std::string mTabTitle; std::string mImage; @@ -230,11 +200,17 @@ void LLSideTrayTab::reshape (S32 width, S32 height, BOOL called_from_parent ) void LLSideTrayTab::onOpen (const LLSD& key) { - LLPanel* panel = dynamic_cast<LLPanel*>(mMainPanel); + LLPanel *panel = getPanel(); if(panel) panel->onOpen(key); } +LLPanel* LLSideTrayTab::getPanel() +{ + LLPanel* panel = dynamic_cast<LLPanel*>(mMainPanel); + return panel; +} + LLSideTrayTab* LLSideTrayTab::createInstance () { LLSideTrayTab::Params tab_params; @@ -583,6 +559,17 @@ void LLSideTray::expandSideBar() mActiveTab->onOpen(key); reflectCollapseChange(); + + + std::string name = mActiveTab->getName(); + std::map<std::string,LLButton*>::const_iterator btn_it = + mTabButtons.find(name); + if (btn_it != mTabButtons.end()) + { + LLButton* btn = btn_it->second; + btn->setImageOverlay( mActiveTab->mImageSelected ); + } + } void LLSideTray::highlightFocused() @@ -673,6 +660,23 @@ LLPanel* LLSideTray::getPanel (const std::string& panel_name) return NULL; } +LLPanel* LLSideTray::getActivePanel() +{ + if (mActiveTab && !mCollapsed) + { + return mActiveTab->getPanel(); + } + return NULL; +} + +bool LLSideTray::isPanelActive(const std::string& panel_name) +{ + LLPanel *panel = getActivePanel(); + if (!panel) return false; + return (panel->getName() == panel_name); +} + + // *TODO: Eliminate magic constants. static const S32 fake_offset = 132; static const S32 fake_top_offset = 18; diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index 7321574681..cf2f6992d5 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -100,7 +100,8 @@ public: * get the panel (don't show it or do anything else with it) */ LLPanel* getPanel (const std::string& panel_name); - + LLPanel* getActivePanel (); + bool isPanelActive (const std::string& panel_name); /* * collapse SideBar, hiding visible tab and moving tab buttons * to the right corner of the screen diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp index 54f776ca6a..5edc4804ca 100644 --- a/indra/newview/llspeakbutton.cpp +++ b/indra/newview/llspeakbutton.cpp @@ -32,19 +32,14 @@ #include "llviewerprecompiledheaders.h" // must be first include -#include "llagent.h" -#include "llbottomtray.h" +#include "llbutton.h" #include "llfloaterreg.h" -#include "llvoiceclient.h" -#include "llvoicecontrolpanel.h" -#include "lltransientfloatermgr.h" -#include "llavatariconctrl.h" -#include "llbutton.h" -#include "llpanel.h" -#include "lltextbox.h" +#include "llagent.h" +#include "llbottomtray.h" +#include "llcallfloater.h" #include "lloutputmonitorctrl.h" -#include "llgroupmgr.h" +#include "lltransientfloatermgr.h" #include "llspeakbutton.h" @@ -72,7 +67,6 @@ void LLSpeakButton::draw() LLSpeakButton::LLSpeakButton(const Params& p) : LLUICtrl(p) -, mPrivateCallPanel(NULL) , mOutputMonitor(NULL) , mSpeakBtn(NULL) , mShowBtn(NULL) @@ -102,8 +96,8 @@ LLSpeakButton::LLSpeakButton(const Params& p) addChild(mShowBtn); LLTransientFloaterMgr::getInstance()->addControlView(mShowBtn); - mShowBtn->setClickedCallback(boost::bind(&LLSpeakButton::onClick_ShowBtn, this)); - mShowBtn->setToggleState(FALSE); +// mShowBtn->setClickedCallback(boost::bind(&LLSpeakButton::onClick_ShowBtn, this)); +// mShowBtn->setToggleState(FALSE); static const S32 MONITOR_RIGHT_PAD = 2; @@ -175,42 +169,3 @@ void LLSpeakButton::onMouseUp_SpeakBtn() gVoiceClient->inputUserControlState(down); } -void LLSpeakButton::onClick_ShowBtn() -{ - if(!mShowBtn->getToggleState()) - { - mPrivateCallPanel->onClickClose(mPrivateCallPanel); - delete mPrivateCallPanel; - mPrivateCallPanel = NULL; - mShowBtn->setToggleState(FALSE); - return; - } - - S32 x = mSpeakBtn->getRect().mLeft; - S32 y = 0; - - localPointToScreen(x, y, &x, &y); - - mPrivateCallPanel = new LLVoiceControlPanel; - getRootView()->addChild(mPrivateCallPanel); - - y = LLBottomTray::getInstance()->getRect().getHeight() + mPrivateCallPanel->getRect().getHeight(); - - LLRect rect; - rect.setLeftTopAndSize(x, y, mPrivateCallPanel->getRect().getWidth(), mPrivateCallPanel->getRect().getHeight()); - mPrivateCallPanel->setRect(rect); - - - LLAvatarListItem* item = new LLAvatarListItem(); - item->showLastInteractionTime(false); - item->showInfoBtn(true); - item->showSpeakingIndicator(true); - item->reshape(mPrivateCallPanel->getRect().getWidth(), item->getRect().getHeight(), FALSE); - - mPrivateCallPanel->addItem(item); - mPrivateCallPanel->setVisible(TRUE); - mPrivateCallPanel->setFrontmost(TRUE); - - mShowBtn->setToggleState(TRUE); -} - diff --git a/indra/newview/llspeakbutton.h b/indra/newview/llspeakbutton.h index 424ee5357a..6660b50240 100644 --- a/indra/newview/llspeakbutton.h +++ b/indra/newview/llspeakbutton.h @@ -36,7 +36,7 @@ #include "llinitparam.h" #include "lluictrl.h" -class LLVoiceControlPanel; +class LLCallFloater; class LLButton; class LLOutputMonitorCtrl; @@ -86,12 +86,10 @@ protected: void onMouseDown_SpeakBtn(); void onMouseUp_SpeakBtn(); - void onClick_ShowBtn(); - private: LLButton* mSpeakBtn; LLButton* mShowBtn; - LLVoiceControlPanel* mPrivateCallPanel; + LLHandle<LLFloater> mPrivateCallPanel; LLOutputMonitorCtrl* mOutputMonitor; }; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 736be67710..58df2ffb19 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -59,6 +59,7 @@ #include "llfloaterreg.h" #include "llfocusmgr.h" #include "llhttpsender.h" +#include "llimfloater.h" #include "lllocationhistory.h" #include "llimageworker.h" #include "llloginflags.h" @@ -66,6 +67,8 @@ #include "llmemorystream.h" #include "llmessageconfig.h" #include "llmoveview.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llteleporthistory.h" #include "llregionhandle.h" #include "llsd.h" @@ -99,7 +102,6 @@ #include "llfeaturemanager.h" #include "llfirstuse.h" #include "llfloaterchat.h" -#include "llfloatergesture.h" #include "llfloaterhud.h" #include "llfloaterland.h" #include "llfloaterpreference.h" @@ -297,23 +299,6 @@ namespace }; } -class LLGestureInventoryFetchObserver : public LLInventoryFetchObserver -{ -public: - LLGestureInventoryFetchObserver() {} - virtual void done() - { - // we've downloaded all the items, so repaint the dialog - LLFloaterGesture* floater = LLFloaterReg::findTypedInstance<LLFloaterGesture>("gestures"); - if (floater) - { - floater->refreshAll(); - } - gInventory.removeObserver(this); - delete this; - } -}; - void update_texture_fetch() { LLAppViewer::getTextureCache()->update(1); // unpauses the texture cache thread @@ -444,16 +429,16 @@ bool idle_startup() if (LLFeatureManager::getInstance()->isSafe()) { - LLNotifications::instance().add("DisplaySetToSafe"); + LLNotificationsUtil::add("DisplaySetToSafe"); } else if ((gSavedSettings.getS32("LastFeatureVersion") < LLFeatureManager::getInstance()->getVersion()) && (gSavedSettings.getS32("LastFeatureVersion") != 0)) { - LLNotifications::instance().add("DisplaySetToRecommended"); + LLNotificationsUtil::add("DisplaySetToRecommended"); } else if (!gViewerWindow->getInitAlert().empty()) { - LLNotifications::instance().add(gViewerWindow->getInitAlert()); + LLNotificationsUtil::add(gViewerWindow->getInitAlert()); } gSavedSettings.setS32("LastFeatureVersion", LLFeatureManager::getInstance()->getVersion()); @@ -498,7 +483,7 @@ bool idle_startup() { std::string diagnostic = "Could not start address resolution system"; LL_WARNS("AppInit") << diagnostic << LL_ENDL; - LLAppViewer::instance()->earlyExit("LoginFailedNoNetwork", LLSD().insert("DIAGNOSTIC", diagnostic)); + LLAppViewer::instance()->earlyExit("LoginFailedNoNetwork", LLSD().with("DIAGNOSTIC", diagnostic)); } // @@ -569,7 +554,7 @@ bool idle_startup() { std::string diagnostic = llformat(" Error: %d", gMessageSystem->getErrorCode()); LL_WARNS("AppInit") << diagnostic << LL_ENDL; - LLAppViewer::instance()->earlyExit("LoginFailedNoNetwork", LLSD().insert("DIAGNOSTIC", diagnostic)); + LLAppViewer::instance()->earlyExit("LoginFailedNoNetwork", LLSD().with("DIAGNOSTIC", diagnostic)); } #if LL_WINDOWS @@ -592,7 +577,7 @@ bool idle_startup() } else { - LLAppViewer::instance()->earlyExit("MessageTemplateNotFound", LLSD().insert("PATH", message_template_path)); + LLAppViewer::instance()->earlyExit("MessageTemplateNotFound", LLSD().with("PATH", message_template_path)); } if(gMessageSystem && gMessageSystem->isOK()) @@ -1156,7 +1141,7 @@ bool idle_startup() LLSD args; args["ERROR_MESSAGE"] = emsg.str(); LL_INFOS("LLStartup") << "Notification: " << args << LL_ENDL; - LLNotifications::instance().add("ErrorMessage", args, LLSD(), login_alert_done); + LLNotificationsUtil::add("ErrorMessage", args, LLSD(), login_alert_done); } //setup map of datetime strings to codes and slt & local time offset from utc @@ -1179,7 +1164,7 @@ bool idle_startup() LLSD args; args["ERROR_MESSAGE"] = emsg.str(); LL_INFOS("LLStartup") << "Notification: " << args << LL_ENDL; - LLNotifications::instance().add("ErrorMessage", args, LLSD(), login_alert_done); + LLNotificationsUtil::add("ErrorMessage", args, LLSD(), login_alert_done); transition_back_to_login_panel(emsg.str()); show_connect_box = true; } @@ -1823,11 +1808,8 @@ bool idle_startup() item_ids.push_back(item_id); } } - - LLGestureInventoryFetchObserver* fetch = new LLGestureInventoryFetchObserver(); - fetch->fetchItems(item_ids); - // deletes itself when done - gInventory.addObserver(fetch); + // no need to add gesture to inventory observer, it's already made in constructor + LLGestureManager::instance().fetchItems(item_ids); } } gDisplaySwapBuffers = TRUE; @@ -1899,7 +1881,7 @@ bool idle_startup() { msg = "AvatarMovedLast"; } - LLNotifications::instance().add(msg); + LLNotificationsUtil::add(msg); } } @@ -1984,7 +1966,7 @@ bool idle_startup() // initial outfit, but if the load hasn't started // already then something is wrong so fall back // to generic outfits. JC - LLNotifications::instance().add("WelcomeChooseSex", LLSD(), LLSD(), + LLNotificationsUtil::add("WelcomeChooseSex", LLSD(), LLSD(), callback_choose_gender); LLStartUp::setStartupState( STATE_CLEANUP ); return TRUE; @@ -1992,7 +1974,7 @@ bool idle_startup() if (wearables_time > MAX_WEARABLES_TIME) { - LLNotifications::instance().add("ClothingLoading"); + LLNotificationsUtil::add("ClothingLoading"); LLViewerStats::getInstance()->incStat(LLViewerStats::ST_WEARABLES_TOO_LONG); LLStartUp::setStartupState( STATE_CLEANUP ); return TRUE; @@ -2104,6 +2086,8 @@ bool idle_startup() LLAgentPicksInfo::getInstance()->requestNumberOfPicks(); + LLIMFloater::initIMFloater(); + return TRUE; } @@ -2318,12 +2302,12 @@ bool is_hex_string(U8* str, S32 len) void show_first_run_dialog() { - LLNotifications::instance().add("FirstRun", LLSD(), LLSD(), first_run_dialog_callback); + LLNotificationsUtil::add("FirstRun", LLSD(), LLSD(), first_run_dialog_callback); } bool first_run_dialog_callback(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) { LL_DEBUGS("AppInit") << "First run dialog cancelling" << LL_ENDL; @@ -2346,7 +2330,7 @@ void set_startup_status(const F32 frac, const std::string& string, const std::st bool login_alert_status(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); // Buttons switch( option ) { @@ -2380,7 +2364,7 @@ void use_circuit_callback(void**, S32 result) { // Make sure user knows something bad happened. JC LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL; - LLNotifications::instance().add("LoginPacketNeverReceived", LLSD(), LLSD(), login_alert_status); + LLNotificationsUtil::add("LoginPacketNeverReceived", LLSD(), LLSD(), login_alert_status); reset_login(); } else @@ -2585,7 +2569,7 @@ const S32 OPT_FEMALE = 1; bool callback_choose_gender(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch(option) { case OPT_MALE: diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index b649a0c38e..4915720036 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -42,6 +42,7 @@ #include "llfloaterbuycurrency.h" #include "llfloaterchat.h" #include "llfloaterlagmeter.h" +#include "llfloatervolumepulldown.h" #include "llfloaterregioninfo.h" #include "llfloaterscriptdebug.h" #include "llhudicon.h" @@ -72,12 +73,14 @@ #include "llfocusmgr.h" #include "llappviewer.h" #include "lltrans.h" + // library includes #include "imageids.h" #include "llfloaterreg.h" #include "llfontgl.h" #include "llrect.h" #include "llerror.h" +#include "llnotificationsutil.h" #include "llparcel.h" #include "llstring.h" #include "message.h" @@ -157,6 +160,7 @@ LLStatusBar::LLStatusBar(const LLRect& rect) mBtnVolume = getChild<LLButton>( "volume_btn" ); mBtnVolume->setClickedCallback( onClickVolume, this ); + mBtnVolume->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterVolume, this)); gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2)); @@ -201,7 +205,6 @@ LLStatusBar::LLStatusBar(const LLRect& rect) addChild(mSGPacketLoss); childSetActionTextbox("stat_btn", onClickStatGraph); - } LLStatusBar::~LLStatusBar() @@ -242,7 +245,6 @@ BOOL LLStatusBar::handleRightMouseDown(S32 x, S32 y, MASK mask) BOOL LLStatusBar::postBuild() { - gMenuBarView->setRightMouseDownCallback(boost::bind(&show_navbar_context_menu, _1, _2, _3)); return TRUE; @@ -496,7 +498,7 @@ static void onClickBuyCurrency(void* data) static void onClickHealth(void* ) { - LLNotifications::instance().add("NotSafe"); + LLNotificationsUtil::add("NotSafe"); } static void onClickScriptDebug(void*) @@ -504,6 +506,13 @@ static void onClickScriptDebug(void*) LLFloaterScriptDebug::show(LLUUID::null); } +//static +void LLStatusBar::onMouseEnterVolume(LLUICtrl* ctrl) +{ + // show the master volume pull-down + LLFloaterReg::showInstance("volume_pulldown"); +} + static void onClickVolume(void* data) { // toggle the master mute setting diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index bdaacce981..f77cc1acb8 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -47,6 +47,7 @@ class LLUICtrl; class LLUUID; class LLFrameTimer; class LLStatGraph; +class LLPanelVolumePulldown; class LLStatusBar : public LLPanel @@ -92,8 +93,8 @@ private: void onVolumeChanged(const LLSD& newvalue); + static void onMouseEnterVolume(LLUICtrl* ctrl); static void onClickStatGraph(void* data); - private: LLTextBox *mTextHealth; diff --git a/indra/newview/llteleporthistory.cpp b/indra/newview/llteleporthistory.cpp index cc4689062e..1315887c37 100644 --- a/indra/newview/llteleporthistory.cpp +++ b/indra/newview/llteleporthistory.cpp @@ -167,7 +167,10 @@ void LLTeleportHistory::onHistoryChanged() void LLTeleportHistory::purgeItems() { - mItems.erase(mItems.begin(), mItems.end()-1); + if (mItems.size() > 0) + { + mItems.erase(mItems.begin(), mItems.end()-1); + } // reset the count mRequestedItem = -1; mCurrentItem = 0; diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index a90f3ee181..8d3dcf8a99 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -689,24 +689,24 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height ) } } + LLGLSUIDefault gls_ui; + LLGLDepthTest gls_depth(GL_FALSE, GL_FALSE); + gGL.setColorMask(true, true); + + // clear buffer area to ensure we don't pick up UI elements + { + gGL.flush(); + LLGLDisable no_alpha(GL_ALPHA_TEST); + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + gGL.color4f( 0.f, 0.f, 0.f, 1.f ); + + gl_rect_2d_simple( width, height ); + + gGL.flush(); + } + if (mIsVisible) { - LLGLSUIDefault gls_ui; - LLGLDepthTest gls_depth(GL_FALSE, GL_FALSE); - gGL.setColorMask(true, true); - - // clear buffer area to ensure we don't pick up UI elements - { - gGL.flush(); - LLGLDisable no_alpha(GL_ALPHA_TEST); - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.color4f( 0.f, 0.f, 0.f, 1.f ); - - gl_rect_2d_simple( width, height ); - - gGL.flush(); - } - // composite color layers for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) { @@ -723,6 +723,21 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height ) stop_glerror(); } + else + { + gGL.flush(); + + gGL.setSceneBlendType(LLRender::BT_REPLACE); + LLGLDisable no_alpha(GL_ALPHA_TEST); + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + gGL.color4f( 0.f, 0.f, 0.f, 0.f ); + + gl_rect_2d_simple( width, height ); + gGL.setSceneBlendType(LLRender::BT_ALPHA); + + gGL.flush(); + + } return success; } diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 9bb2a4ad0a..ef49d7f057 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -736,7 +736,8 @@ bool LLTextureFetchWorker::doWork(S32 param) } else { - llwarns << "Region not found for host: " << mHost << llendl; + // This will happen if not logged in or if a region deoes not have HTTP Texture enabled + //llwarns << "Region not found for host: " << mHost << llendl; } } if (!mUrl.empty()) @@ -943,11 +944,14 @@ bool LLTextureFetchWorker::doWork(S32 param) { llerrs << "Decode entered with invalid mFormattedImage. ID = " << mID << llendl; } + if (mLoadedDiscard < 0) + { + llerrs << "Decode entered with invalid mLoadedDiscard. ID = " << mID << llendl; + } setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); // Set priority first since Responder may change it mRawImage = NULL; mAuxImage = NULL; llassert_always(mFormattedImage.notNull()); - llassert_always(mLoadedDiscard >= 0); S32 discard = mHaveAllData ? 0 : mLoadedDiscard; U32 image_priority = LLWorkerThread::PRIORITY_NORMAL | mWorkPriority; mDecoded = FALSE; diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index f9cbdc20d6..bf485b7e65 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -36,6 +36,7 @@ #include "llbutton.h" #include "llfocusmgr.h" +#include "llnotifications.h" #include "llviewercontrol.h" using namespace LLNotificationsUI; diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index b670f47045..769b2ba122 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -37,7 +37,7 @@ #include "llpanel.h" #include "llmodaldialog.h" #include "lltimer.h" -#include "llnotifications.h" +#include "llnotificationptr.h" #include "llviewercontrol.h" diff --git a/indra/newview/lltoastalertpanel.h b/indra/newview/lltoastalertpanel.h index 840143a2a9..38a635e8a4 100644 --- a/indra/newview/lltoastalertpanel.h +++ b/indra/newview/lltoastalertpanel.h @@ -40,7 +40,7 @@ #include "lltoastpanel.h" #include "llfloater.h" #include "llui.h" -#include "llnotifications.h" +#include "llnotificationptr.h" #include "llalertdialog.h" class LLButton; diff --git a/indra/newview/lltoastgroupnotifypanel.cpp b/indra/newview/lltoastgroupnotifypanel.cpp index d1bdcb1354..eacc077a65 100644 --- a/indra/newview/lltoastgroupnotifypanel.cpp +++ b/indra/newview/lltoastgroupnotifypanel.cpp @@ -39,6 +39,7 @@ #include "llbutton.h" #include "lliconctrl.h" #include "llinventoryfunctions.h" +#include "llnotifications.h" #include "llnotify.h" #include "llviewertexteditor.h" @@ -205,7 +206,7 @@ void LLToastGroupNotifyPanel::onClickAttachment() //if attachment isn't openable - notify about saving if (!isAttachmentOpenable(mInventoryOffer->mType)) { - LLNotifications::instance().add("AttachmentSaved"); + LLNotifications::instance().add("AttachmentSaved", LLSD(), LLSD()); } mInventoryOffer = NULL; diff --git a/indra/newview/lltoastgroupnotifypanel.h b/indra/newview/lltoastgroupnotifypanel.h index e3d0ef45cb..4879000e8c 100644 --- a/indra/newview/lltoastgroupnotifypanel.h +++ b/indra/newview/lltoastgroupnotifypanel.h @@ -38,7 +38,7 @@ #include "lldarray.h" #include "lltimer.h" #include "llviewermessage.h" -#include "llnotifications.h" +#include "llnotificationptr.h" class LLButton; diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp index 9040bdb41a..f928b5f243 100644 --- a/indra/newview/lltoastimpanel.cpp +++ b/indra/newview/lltoastimpanel.cpp @@ -33,6 +33,8 @@ #include "llviewerprecompiledheaders.h" #include "lltoastimpanel.h" +#include "llnotifications.h" + const S32 LLToastIMPanel::DEFAULT_MESSAGE_MAX_LINE_COUNT = 6; //-------------------------------------------------------------------------- diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 699424ef36..6b9bff7b9e 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -33,7 +33,12 @@ #include "llviewerprecompiledheaders.h" #include "lltoastnotifypanel.h" + +// project includes #include "llviewercontrol.h" + +// library includes +#include "llnotifications.h" #include "lluiconstants.h" #include "llrect.h" #include "lltrans.h" diff --git a/indra/newview/lltoastnotifypanel.h b/indra/newview/lltoastnotifypanel.h index eea70705ec..04525387b3 100644 --- a/indra/newview/lltoastnotifypanel.h +++ b/indra/newview/lltoastnotifypanel.h @@ -35,13 +35,14 @@ #include "llpanel.h" #include "llfontgl.h" -#include "llnotifications.h" +#include "llnotificationptr.h" #include "llbutton.h" #include "lltoastpanel.h" #include "lliconctrl.h" #include "lltexteditor.h" #include "lltextbox.h" +class LLNotificationForm; /** * Toast panel for notification. @@ -68,7 +69,7 @@ protected: private: - void adjustPanelForScriptNotice(const LLNotificationFormPtr form); + void adjustPanelForScriptNotice(const boost::shared_ptr<LLNotificationForm> form); void adjustPanelForTipNotice(); // panel elements diff --git a/indra/newview/lltoastpanel.cpp b/indra/newview/lltoastpanel.cpp index ef75e06047..afb9e261b0 100644 --- a/indra/newview/lltoastpanel.cpp +++ b/indra/newview/lltoastpanel.cpp @@ -34,6 +34,8 @@ #include "lltoastpanel.h" +#include "llnotifications.h" + //static const S32 LLToastPanel::MIN_PANEL_HEIGHT = 40; // VPAD(4)*2 + ICON_HEIGHT(32) @@ -46,12 +48,19 @@ LLToastPanel::~LLToastPanel() { } +//virtual std::string LLToastPanel::getTitle() { // *TODO: create Title and localize it. If it will be required. return mNotification->getMessage(); } +//virtual +const LLUUID& LLToastPanel::getID() +{ + return mNotification->id(); +} + //snap to the message height if it is visible void LLToastPanel::snapToMessageHeight(LLTextBase* message, S32 maxLineCount) { diff --git a/indra/newview/lltoastpanel.h b/indra/newview/lltoastpanel.h index a88127b008..f1dd7d7a86 100644 --- a/indra/newview/lltoastpanel.h +++ b/indra/newview/lltoastpanel.h @@ -35,7 +35,7 @@ #include "llpanel.h" #include "lltextbox.h" -#include "llnotifications.h" +#include "llnotificationptr.h" #include <string> @@ -57,7 +57,7 @@ public: virtual ~LLToastPanel() = 0; virtual std::string getTitle(); - virtual const LLUUID& getID() { return mNotification->id();} + virtual const LLUUID& getID(); static const S32 MIN_PANEL_HEIGHT; protected: diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp index 268a18d2a2..bf6d715c31 100644 --- a/indra/newview/lltoolbar.cpp +++ b/indra/newview/lltoolbar.cpp @@ -56,6 +56,7 @@ #include "llfloaterchatterbox.h" #include "llfloaterfriends.h" #include "llfloatersnapshot.h" +#include "llinventorypanel.h" #include "lltoolmgr.h" #include "llui.h" #include "llviewermenu.h" @@ -157,12 +158,11 @@ BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, LLButton* inventory_btn = getChild<LLButton>("inventory_btn"); if (!inventory_btn) return FALSE; - LLFloaterInventory* active_inventory = LLFloaterInventory::getActiveInventory(); - LLRect button_screen_rect; inventory_btn->localRectToScreen(inventory_btn->getRect(),&button_screen_rect); - - if(active_inventory && active_inventory->getVisible()) + + const LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); + if(active_panel) { mInventoryAutoOpen = FALSE; } @@ -170,8 +170,8 @@ BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, { if (mInventoryAutoOpen) { - if (!(active_inventory && active_inventory->getVisible()) && - mInventoryAutoOpenTimer.getElapsedTimeF32() > sInventoryAutoOpenTime) + if (!active_panel && + mInventoryAutoOpenTimer.getElapsedTimeF32() > sInventoryAutoOpenTime) { LLFloaterInventory::showAgentInventory(); } diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp index 0088a6a2a4..3593064bef 100644 --- a/indra/newview/lltoolbrush.cpp +++ b/indra/newview/lltoolbrush.cpp @@ -35,9 +35,10 @@ #include "lltoolbrush.h" #include "lltoolselectland.h" +// library headers #include "llgl.h" +#include "llnotificationsutil.h" #include "llrender.h" - #include "message.h" #include "llagent.h" @@ -672,7 +673,7 @@ void LLToolBrushLand::alertNoTerraform(LLViewerRegion* regionp) LLSD args; args["REGION"] = regionp->getName(); - LLNotifications::instance().add("RegionNoTerraforming", args); + LLNotificationsUtil::add("RegionNoTerraforming", args); } diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 7dfc8cf70b..03c3900235 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -31,50 +31,37 @@ */ #include "llviewerprecompiledheaders.h" - -#include "message.h" #include "lltooldraganddrop.h" -#include "llfloaterreg.h" -#include "llinstantmessage.h" -#include "lldir.h" - +// library headers +#include "llnotificationsutil.h" +// project headers #include "llagent.h" +#include "llagentui.h" #include "llagentwearables.h" -#include "llviewercontrol.h" +#include "llappearancemgr.h" +#include "lldictionary.h" #include "llfirstuse.h" -#include "llfloater.h" +#include "llfloaterreg.h" #include "llfloatertools.h" -#include "llfocusmgr.h" #include "llgesturemgr.h" -#include "llhudeffecttrail.h" #include "llhudmanager.h" +#include "llhudeffecttrail.h" +#include "llimview.h" #include "llinventorybridge.h" -#include "llinventorymodel.h" #include "llmutelist.h" -#include "llnotify.h" #include "llpreviewnotecard.h" #include "llrecentpeople.h" +#include "llrootview.h" #include "llselectmgr.h" #include "lltoolmgr.h" #include "lltooltip.h" #include "lltrans.h" -#include "llui.h" -#include "llviewertexturelist.h" -#include "llviewerinventory.h" -#include "llviewerobject.h" #include "llviewerobjectlist.h" -#include "llviewerregion.h" #include "llviewerstats.h" #include "llviewerwindow.h" #include "llvoavatarself.h" -#include "llvolume.h" #include "llworld.h" -#include "object_flags.h" -#include "llimview.h" -#include "llrootview.h" -#include "llagentui.h" -#include "llappearancemgr.h" // MAX ITEMS is based on (sizeof(uuid)+2) * count must be < MTUBYTES // or 18 * count < 1200 => count < 1200/18 => 66. I've cut it down a @@ -355,134 +342,51 @@ void LLCategoryDropDescendentsObserver::done() delete this; } -// This array is used to more easily control what happens when a 3d -// drag and drop event occurs. Since there's an array of drop target -// and cargo type, it's implemented as an array of pointers to member -// functions which correctly carry out the actual drop. -LLToolDragAndDrop::dragOrDrop3dImpl LLToolDragAndDrop::sDragAndDrop3d[DAD_COUNT][LLToolDragAndDrop::DT_COUNT] = +LLToolDragAndDrop::DragAndDropEntry::DragAndDropEntry(dragOrDrop3dImpl f_none, + dragOrDrop3dImpl f_self, + dragOrDrop3dImpl f_avatar, + dragOrDrop3dImpl f_object, + dragOrDrop3dImpl f_land) : + LLDictionaryEntry("") +{ + mFunctions[DT_NONE] = f_none; + mFunctions[DT_SELF] = f_self; + mFunctions[DT_AVATAR] = f_avatar; + mFunctions[DT_OBJECT] = f_object; + mFunctions[DT_LAND] = f_land; +} + +LLToolDragAndDrop::dragOrDrop3dImpl LLToolDragAndDrop::LLDragAndDropDictionary::get(EDragAndDropType dad_type, LLToolDragAndDrop::EDropTarget drop_target) { - // Source: DAD_NONE - { - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_AVATAR - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_OBJECT - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_LAND - }, - // Source: DAD_TEXTURE - { - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF - &LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR - &LLToolDragAndDrop::dad3dTextureObject, // Dest: DT_OBJECT - &LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND - }, - // Source: DAD_SOUND + const DragAndDropEntry *entry = lookup(dad_type); + if (entry) { - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF - &LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR - &LLToolDragAndDrop::dad3dUpdateInventory, // Dest: DT_OBJECT - &LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND - }, - // Source: DAD_CALLINGCARD - { - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF - &LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR - &LLToolDragAndDrop::dad3dUpdateInventory, // Dest: DT_OBJECT - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_LAND - }, - // Source: DAD_LANDMARK - { - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF - &LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR - &LLToolDragAndDrop::dad3dUpdateInventory, // Dest: DT_OBJECT - &LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND - }, - // Source: DAD_SCRIPT - { - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF - &LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR - &LLToolDragAndDrop::dad3dRezScript, // Dest: DT_OBJECT - &LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND - }, - // Source: DAD_CLOTHING - { - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE - &LLToolDragAndDrop::dad3dWearItem, // Dest: DT_SELF - &LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR - &LLToolDragAndDrop::dad3dUpdateInventory, // Dest: DT_OBJECT - &LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND - }, - // Source: DAD_OBJECT - { - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE - &LLToolDragAndDrop::dad3dRezAttachmentFromInv, // Dest: DT_SELF - &LLToolDragAndDrop::dad3dGiveInventoryObject, // Dest: DT_AVATAR - &LLToolDragAndDrop::dad3dRezObjectOnObject, // Dest: DT_OBJECT - &LLToolDragAndDrop::dad3dRezObjectOnLand, // Dest: DT_LAND - }, - // Source: DAD_NOTECARD - { - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF - &LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR - &LLToolDragAndDrop::dad3dUpdateInventory, // Dest: DT_OBJECT - &LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND - }, - // Source: DAD_CATEGORY - { - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE - &LLToolDragAndDrop::dad3dWearCategory, // Dest: DT_SELF - &LLToolDragAndDrop::dad3dGiveInventoryCategory, // Dest: DT_AVATAR - &LLToolDragAndDrop::dad3dUpdateInventoryCategory, // Dest: DT_OBJECT - &LLToolDragAndDrop::dad3dNULL,//dad3dCategoryOnLand, // Dest: DT_LAND - }, - // Source: DAD_ROOT - { - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_AVATAR - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_OBJECT - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_LAND - }, - // Source: DAD_BODYPART - { - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE - &LLToolDragAndDrop::dad3dWearItem, // Dest: DT_SELF - &LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR - &LLToolDragAndDrop::dad3dUpdateInventory, // Dest: DT_OBJECT - &LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND - }, - // Source: DAD_ANIMATION + return (entry->mFunctions[(U8)drop_target]); + } + return &LLToolDragAndDrop::dad3dNULL; +} + +LLToolDragAndDrop::LLDragAndDropDictionary::LLDragAndDropDictionary() +{ + // DT_NONE DT_SELF DT_AVATAR DT_OBJECT DT_LAND + // |--------------|---------------------------|---------------------------|-------------------------------|--------------| + addEntry(DAD_NONE, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL)); + addEntry(DAD_TEXTURE, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dTextureObject, &LLToolDragAndDrop::dad3dNULL)); + addEntry(DAD_SOUND, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); + addEntry(DAD_CALLINGCARD, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); + addEntry(DAD_LANDMARK, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); + addEntry(DAD_SCRIPT, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dRezScript, &LLToolDragAndDrop::dad3dNULL)); + addEntry(DAD_CLOTHING, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dWearItem, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); + addEntry(DAD_OBJECT, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dRezAttachmentFromInv, &LLToolDragAndDrop::dad3dGiveInventoryObject, &LLToolDragAndDrop::dad3dRezObjectOnObject, &LLToolDragAndDrop::dad3dRezObjectOnLand)); + addEntry(DAD_NOTECARD, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); + addEntry(DAD_CATEGORY, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dWearCategory, &LLToolDragAndDrop::dad3dGiveInventoryCategory,&LLToolDragAndDrop::dad3dUpdateInventoryCategory, &LLToolDragAndDrop::dad3dNULL)); + addEntry(DAD_ROOT_CATEGORY, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL)); + addEntry(DAD_BODYPART, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dWearItem, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); + addEntry(DAD_ANIMATION, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); + addEntry(DAD_GESTURE, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dActivateGesture, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); + addEntry(DAD_LINK, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL)); // TODO: animation on self could play it? edit it? - { - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF - &LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR - &LLToolDragAndDrop::dad3dUpdateInventory, // Dest: DT_OBJECT - &LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND - }, - // Source: DAD_GESTURE // TODO: gesture on self could play it? edit it? - { - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE - &LLToolDragAndDrop::dad3dActivateGesture, // Dest: DT_SELF - &LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR - &LLToolDragAndDrop::dad3dUpdateInventory, // Dest: DT_OBJECT - &LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND - }, - // Source: DAD_LINK - { - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_AVATAR - &LLToolDragAndDrop::dad3dNULL, // Dest: DT_OBJECT - &LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND - }, // Source: DAD_MESH @@ -935,7 +839,7 @@ void LLToolDragAndDrop::dragOrDrop3D( S32 x, S32 y, MASK mask, BOOL drop, EAccep if (mDrop) { // don't allow drag and drop onto transparent objects - pickCallback(gViewerWindow->pickImmediate(x, y, FALSE)); + pick(gViewerWindow->pickImmediate(x, y, FALSE)); } else { @@ -948,6 +852,14 @@ void LLToolDragAndDrop::dragOrDrop3D( S32 x, S32 y, MASK mask, BOOL drop, EAccep void LLToolDragAndDrop::pickCallback(const LLPickInfo& pick_info) { + if (getInstance() != NULL) + { + getInstance()->pick(pick_info); + } +} + +void LLToolDragAndDrop::pick(const LLPickInfo& pick_info) +{ EDropTarget target = DT_NONE; S32 hit_face = -1; @@ -955,31 +867,30 @@ void LLToolDragAndDrop::pickCallback(const LLPickInfo& pick_info) LLSelectMgr::getInstance()->unhighlightAll(); // Treat attachments as part of the avatar they are attached to. - if (hit_obj) + if (hit_obj != NULL) { // don't allow drag and drop on grass, trees, etc. - if(pick_info.mPickType == LLPickInfo::PICK_FLORA) + if (pick_info.mPickType == LLPickInfo::PICK_FLORA) { - LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_NO; - gViewerWindow->getWindow()->setCursor( LLToolDragAndDrop::getInstance()->mCursor ); + mCursor = UI_CURSOR_NO; + gViewerWindow->getWindow()->setCursor( mCursor ); return; } - if(hit_obj->isAttachment() && !hit_obj->isHUDAttachment()) + if (hit_obj->isAttachment() && !hit_obj->isHUDAttachment()) { LLVOAvatar* avatar = LLVOAvatar::findAvatarFromAttachment( hit_obj ); if( !avatar ) { - LLToolDragAndDrop::getInstance()->mLastAccept = ACCEPT_NO; - LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_NO; - gViewerWindow->getWindow()->setCursor( LLToolDragAndDrop::getInstance()->mCursor ); + mLastAccept = ACCEPT_NO; + mCursor = UI_CURSOR_NO; + gViewerWindow->getWindow()->setCursor( mCursor ); return; } - hit_obj = avatar; } - if(hit_obj->isAvatar()) + if (hit_obj->isAvatar()) { if(((LLVOAvatar*) hit_obj)->isSelf()) { @@ -998,9 +909,9 @@ void LLToolDragAndDrop::pickCallback(const LLPickInfo& pick_info) hit_face = pick_info.mObjectFace; // if any item being dragged will be applied to the object under our cursor // highlight that object - for (S32 i = 0; i < (S32)LLToolDragAndDrop::getInstance()->mCargoIDs.size(); i++) + for (S32 i = 0; i < (S32)mCargoIDs.size(); i++) { - if (LLToolDragAndDrop::getInstance()->mCargoTypes[i] != DAD_OBJECT || (pick_info.mKeyMask & MASK_CONTROL)) + if (mCargoTypes[i] != DAD_OBJECT || (pick_info.mKeyMask & MASK_CONTROL)) { LLSelectMgr::getInstance()->highlightObjectAndFamily(hit_obj); break; @@ -1008,55 +919,54 @@ void LLToolDragAndDrop::pickCallback(const LLPickInfo& pick_info) } } } - else if(pick_info.mPickType == LLPickInfo::PICK_LAND) + else if (pick_info.mPickType == LLPickInfo::PICK_LAND) { target = DT_LAND; hit_face = -1; } - LLToolDragAndDrop::getInstance()->mLastAccept = ACCEPT_YES_MULTI; + mLastAccept = ACCEPT_YES_MULTI; - for (LLToolDragAndDrop::getInstance()->mCurItemIndex = 0; LLToolDragAndDrop::getInstance()->mCurItemIndex < (S32)LLToolDragAndDrop::getInstance()->mCargoIDs.size(); - LLToolDragAndDrop::getInstance()->mCurItemIndex++) + for (mCurItemIndex = 0; mCurItemIndex < (S32)mCargoIDs.size(); mCurItemIndex++) { + const S32 item_index = mCurItemIndex; + const EDragAndDropType dad_type = mCargoTypes[item_index]; // Call the right implementation function - LLToolDragAndDrop::getInstance()->mLastAccept = (EAcceptance)llmin( - (U32)LLToolDragAndDrop::getInstance()->mLastAccept, - (U32)callMemberFunction((*LLToolDragAndDrop::getInstance()), - LLToolDragAndDrop::getInstance()->sDragAndDrop3d[LLToolDragAndDrop::getInstance()->mCargoTypes[LLToolDragAndDrop::getInstance()->mCurItemIndex]][target]) - (hit_obj, hit_face, pick_info.mKeyMask, FALSE)); + mLastAccept = (EAcceptance)llmin( + (U32)mLastAccept, + (U32)callMemberFunction(*this, + LLDragAndDropDictionary::instance().get(dad_type, target)) + (hit_obj, hit_face, pick_info.mKeyMask, FALSE)); } - if (LLToolDragAndDrop::getInstance()->mDrop && - (U32)LLToolDragAndDrop::getInstance()->mLastAccept >= ACCEPT_YES_COPY_SINGLE) + if (mDrop && ((U32)mLastAccept >= ACCEPT_YES_COPY_SINGLE)) { // if target allows multi-drop or there is only one item being dropped, go ahead - if (LLToolDragAndDrop::getInstance()->mLastAccept >= ACCEPT_YES_COPY_MULTI || - LLToolDragAndDrop::getInstance()->mCargoIDs.size() == 1) + if ((mLastAccept >= ACCEPT_YES_COPY_MULTI) || (mCargoIDs.size() == 1)) { // Target accepts multi, or cargo is a single-drop - for (LLToolDragAndDrop::getInstance()->mCurItemIndex = 0; - LLToolDragAndDrop::getInstance()->mCurItemIndex < (S32)LLToolDragAndDrop::getInstance()->mCargoIDs.size(); - LLToolDragAndDrop::getInstance()->mCurItemIndex++) + for (mCurItemIndex = 0; mCurItemIndex < (S32)mCargoIDs.size(); mCurItemIndex++) { + const S32 item_index = mCurItemIndex; + const EDragAndDropType dad_type = mCargoTypes[item_index]; // Call the right implementation function - (U32)callMemberFunction((*LLToolDragAndDrop::getInstance()), - LLToolDragAndDrop::getInstance()->sDragAndDrop3d[LLToolDragAndDrop::getInstance()->mCargoTypes[LLToolDragAndDrop::getInstance()->mCurItemIndex]][target]) + (U32)callMemberFunction(*this, + LLDragAndDropDictionary::instance().get(dad_type, target)) (hit_obj, hit_face, pick_info.mKeyMask, TRUE); } } else { // Target does not accept multi, but cargo is multi - LLToolDragAndDrop::getInstance()->mLastAccept = ACCEPT_NO; + mLastAccept = ACCEPT_NO; } } - ECursorType cursor = LLToolDragAndDrop::getInstance()->acceptanceToCursor( LLToolDragAndDrop::getInstance()->mLastAccept ); + ECursorType cursor = acceptanceToCursor( mLastAccept ); gViewerWindow->getWindow()->setCursor( cursor ); - LLToolDragAndDrop::getInstance()->mLastHitPos = pick_info.mPosGlobal; - LLToolDragAndDrop::getInstance()->mLastCameraPos = gAgent.getCameraPositionGlobal(); + mLastHitPos = pick_info.mPosGlobal; + mLastCameraPos = gAgent.getCameraPositionGlobal(); } // static @@ -1081,7 +991,7 @@ BOOL LLToolDragAndDrop::handleDropTextureProtections(LLViewerObject* hit_obj, hit_obj->fetchInventoryFromServer(); LLSD args; args["ERROR_MESSAGE"] = "Unable to add texture.\nPlease wait a few seconds and try again."; - LLNotifications::instance().add("ErrorMessage", args); + LLNotificationsUtil::add("ErrorMessage", args); return FALSE; } if (hit_obj->getInventoryItemByAsset(item->getAssetUUID())) @@ -1534,14 +1444,14 @@ void LLToolDragAndDrop::giveInventory(const LLUUID& to_agent, LLSD payload; payload["agent_id"] = to_agent; payload["item_id"] = item->getUUID(); - LLNotifications::instance().add("CannotCopyWarning", LLSD(), payload, + LLNotificationsUtil::add("CannotCopyWarning", LLSD(), payload, &LLToolDragAndDrop::handleCopyProtectedItem); } } // static bool LLToolDragAndDrop::handleCopyProtectedItem(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLInventoryItem* item = NULL; switch(option) { @@ -1558,12 +1468,12 @@ bool LLToolDragAndDrop::handleCopyProtectedItem(const LLSD& notification, const } else { - LLNotifications::instance().add("CannotGiveItem"); + LLNotificationsUtil::add("CannotGiveItem"); } break; default: // no, cancel, whatever, who cares, not yes. - LLNotifications::instance().add("TransactionCancelled"); + LLNotificationsUtil::add("TransactionCancelled"); break; } return false; @@ -1659,18 +1569,18 @@ void LLToolDragAndDrop::giveInventoryCategory(const LLUUID& to_agent, } if(!complete) { - LLNotifications::instance().add("IncompleteInventory"); + LLNotificationsUtil::add("IncompleteInventory"); return; } count = items.count() + cats.count(); if(count > MAX_ITEMS) { - LLNotifications::instance().add("TooManyItems"); + LLNotificationsUtil::add("TooManyItems"); return; } else if(count == 0) { - LLNotifications::instance().add("NoItems"); + LLNotificationsUtil::add("NoItems"); return; } else @@ -1688,7 +1598,7 @@ void LLToolDragAndDrop::giveInventoryCategory(const LLUUID& to_agent, LLSD payload; payload["agent_id"] = to_agent; payload["folder_id"] = cat->getUUID(); - LLNotifications::instance().add("CannotCopyCountItems", args, payload, &LLToolDragAndDrop::handleCopyProtectedCategory); + LLNotificationsUtil::add("CannotCopyCountItems", args, payload, &LLToolDragAndDrop::handleCopyProtectedCategory); } } } @@ -1697,7 +1607,7 @@ void LLToolDragAndDrop::giveInventoryCategory(const LLUUID& to_agent, // static bool LLToolDragAndDrop::handleCopyProtectedCategory(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLInventoryCategory* cat = NULL; switch(option) { @@ -1724,12 +1634,12 @@ bool LLToolDragAndDrop::handleCopyProtectedCategory(const LLSD& notification, co } else { - LLNotifications::instance().add("CannotGiveCategory"); + LLNotificationsUtil::add("CannotGiveCategory"); } break; default: // no, cancel, whatever, who cares, not yes. - LLNotifications::instance().add("TransactionCancelled"); + LLNotificationsUtil::add("TransactionCancelled"); break; } return false; @@ -1764,12 +1674,12 @@ void LLToolDragAndDrop::commitGiveInventoryCategory(const LLUUID& to_agent, S32 count = items.count() + cats.count(); if(count > MAX_ITEMS) { - LLNotifications::instance().add("TooManyItems"); + LLNotificationsUtil::add("TooManyItems"); return; } else if(count == 0) { - LLNotifications::instance().add("NoItems"); + LLNotificationsUtil::add("NoItems"); return; } else @@ -1930,10 +1840,11 @@ BOOL LLToolDragAndDrop::isInventoryGroupGiveAcceptable(LLInventoryItem* item) EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LLInventoryItem* item) { // check the basics - if(!item || !obj) return ACCEPT_NO; + if (!item || !obj) return ACCEPT_NO; // HACK: downcast LLViewerInventoryItem* vitem = (LLViewerInventoryItem*)item; - if(!vitem->isComplete()) return ACCEPT_NO; + if (!vitem->isComplete()) return ACCEPT_NO; + if (vitem->getIsLinkType()) return ACCEPT_NO; // No giving away links // deny attempts to drop from an object onto itself. This is to // help make sure that drops that are from an object to an object @@ -1943,7 +1854,7 @@ EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LL { return ACCEPT_NO; } - + //BOOL copy = (perm.allowCopyBy(gAgent.getID(), // gAgent.getGroupID()) // && (obj->mPermModify || obj->mFlagAllowInventoryAdd)); @@ -2408,7 +2319,7 @@ EAcceptance LLToolDragAndDrop::dad3dWearItem( // destroy clothing items. if (!gAgentWearables.areWearablesLoaded()) { - LLNotifications::instance().add("CanNotChangeAppearanceUntilLoaded"); + LLNotificationsUtil::add("CanNotChangeAppearanceUntilLoaded"); return ACCEPT_NO; } @@ -2503,7 +2414,7 @@ EAcceptance LLToolDragAndDrop::dad3dWearCategory( // destroy clothing items. if (!gAgentWearables.areWearablesLoaded()) { - LLNotifications::instance().add("CanNotChangeAppearanceUntilLoaded"); + LLNotificationsUtil::add("CanNotChangeAppearanceUntilLoaded"); return ACCEPT_NO; } } @@ -2583,24 +2494,30 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { lldebugs << "LLToolDragAndDrop::dad3dUpdateInventoryCategory()" << llendl; - if (NULL==obj) + if (obj == NULL) { llwarns << "obj is NULL; aborting func with ACCEPT_NO" << llendl; return ACCEPT_NO; } - if (mSource != SOURCE_AGENT && mSource != SOURCE_LIBRARY) + if ((mSource != SOURCE_AGENT) && (mSource != SOURCE_LIBRARY)) { return ACCEPT_NO; } - if(obj->isAttachment()) return ACCEPT_NO_LOCKED; - LLViewerInventoryItem* item; - LLViewerInventoryCategory* cat; + if (obj->isAttachment()) + { + return ACCEPT_NO_LOCKED; + } + + LLViewerInventoryItem* item = NULL; + LLViewerInventoryCategory* cat = NULL; locateInventory(item, cat); - if(!cat) return ACCEPT_NO; - EAcceptance rv = ACCEPT_NO; + if (!cat) + { + return ACCEPT_NO; + } - // find all the items in the category + // Find all the items in the category LLDroppableItem droppable(!obj->permYouOwner()); LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; @@ -2610,7 +2527,7 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory( LLInventoryModel::EXCLUDE_TRASH, droppable); cats.put(cat); - if(droppable.countNoCopy() > 0) + if (droppable.countNoCopy() > 0) { llwarns << "*** Need to confirm this step" << llendl; } @@ -2624,46 +2541,57 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory( } } + EAcceptance rv = ACCEPT_NO; + // Check for accept - S32 i; - S32 count = cats.count(); - for(i = 0; i < count; ++i) + for (LLInventoryModel::cat_array_t::const_iterator cat_iter = cats.begin(); + cat_iter != cats.end(); + ++cat_iter) { - rv = gInventory.isCategoryComplete(cats.get(i)->getUUID()) ? ACCEPT_YES_MULTI : ACCEPT_NO; + const LLViewerInventoryCategory *cat = (*cat_iter); + rv = gInventory.isCategoryComplete(cat->getUUID()) ? ACCEPT_YES_MULTI : ACCEPT_NO; if(rv < ACCEPT_YES_SINGLE) { - lldebugs << "Category " << cats.get(i)->getUUID() - << "is not complete." << llendl; + lldebugs << "Category " << cat->getUUID() << "is not complete." << llendl; break; } } - if(ACCEPT_YES_COPY_SINGLE <= rv) + if (ACCEPT_YES_COPY_SINGLE <= rv) { - count = items.count(); - for(i = 0; i < count; ++i) + for (LLInventoryModel::item_array_t::const_iterator item_iter = items.begin(); + item_iter != items.end(); + ++item_iter) { - rv = willObjectAcceptInventory(root_object, items.get(i)); - if(rv < ACCEPT_YES_COPY_SINGLE) + LLViewerInventoryItem *item = (*item_iter); + /* + // Pass the base objects, not the links. + if (item && item->getIsLinkType()) { - lldebugs << "Object will not accept " - << items.get(i)->getUUID() << llendl; + item = item->getLinkedItem(); + (*item_iter) = item; + } + */ + rv = willObjectAcceptInventory(root_object, item); + if (rv < ACCEPT_YES_COPY_SINGLE) + { + lldebugs << "Object will not accept " << item->getUUID() << llendl; break; } } } - // if every item is accepted, go ahead and send it on. - if(drop && (ACCEPT_YES_COPY_SINGLE <= rv)) + // If every item is accepted, send it on + if (drop && (ACCEPT_YES_COPY_SINGLE <= rv)) { - S32 count = items.count(); LLInventoryFetchObserver::item_ref_t ids; - for(i = 0; i < count; ++i) + for (LLInventoryModel::item_array_t::const_iterator item_iter = items.begin(); + item_iter != items.end(); + ++item_iter) { - //dropInventory(root_object, items.get(i), mSource, mSourceID); - ids.push_back(items.get(i)->getUUID()); + const LLViewerInventoryItem *item = (*item_iter); + ids.push_back(item->getUUID()); } - LLCategoryDropObserver* dropper; - dropper = new LLCategoryDropObserver(obj->getID(), mSource); + LLCategoryDropObserver* dropper = new LLCategoryDropObserver(obj->getID(), mSource); dropper->fetchItems(ids); if(dropper->isEverythingComplete()) { diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h index e1536acf75..79b2bc32a3 100644 --- a/indra/newview/lltooldraganddrop.h +++ b/indra/newview/lltooldraganddrop.h @@ -33,6 +33,7 @@ #ifndef LL_TOOLDRAGANDDROP_H #define LL_TOOLDRAGANDDROP_H +#include "lldictionary.h" #include "lltool.h" #include "llview.h" #include "lluuid.h" @@ -102,6 +103,7 @@ protected: DT_COUNT = 5 }; +protected: // dragOrDrop3dImpl points to a member of LLToolDragAndDrop that // takes parameters (LLViewerObject* obj, S32 face, MASK, BOOL // drop) and returns a BOOL if drop is ok @@ -112,7 +114,9 @@ protected: EAcceptance* acceptance); void dragOrDrop3D(S32 x, S32 y, MASK mask, BOOL drop, EAcceptance* acceptance); + static void pickCallback(const LLPickInfo& pick_info); + void pick(const LLPickInfo& pick_info); protected: @@ -137,10 +141,6 @@ protected: enddrag_signal_t mEndDragSignal; - // array of pointers to functions that implement the logic to - // dragging and dropping into the simulator. - static dragOrDrop3dImpl sDragAndDrop3d[DAD_COUNT][DT_COUNT]; - protected: // 3d drop functions. these call down into the static functions // named drop<ThingToDrop> if drop is TRUE and permissions allow @@ -272,6 +272,25 @@ public: EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept); + + // Classes used for determining 3d drag and drop types. +private: + struct DragAndDropEntry : public LLDictionaryEntry + { + DragAndDropEntry(dragOrDrop3dImpl f_none, + dragOrDrop3dImpl f_self, + dragOrDrop3dImpl f_avatar, + dragOrDrop3dImpl f_object, + dragOrDrop3dImpl f_land); + dragOrDrop3dImpl mFunctions[DT_COUNT]; + }; + class LLDragAndDropDictionary : public LLSingleton<LLDragAndDropDictionary>, + public LLDictionary<EDragAndDropType, DragAndDropEntry> + { + public: + LLDragAndDropDictionary(); + dragOrDrop3dImpl get(EDragAndDropType dad_type, EDropTarget drop_target); + }; }; // utility functions diff --git a/indra/newview/lluilistener.cpp b/indra/newview/lluilistener.cpp index 8b4cfa7248..3ad9887bec 100644 --- a/indra/newview/lluilistener.cpp +++ b/indra/newview/lluilistener.cpp @@ -29,7 +29,7 @@ LLUIListener::LLUIListener(): "Invoke the operation named by [\"function\"], passing [\"parameter\"],\n" "as if from a user gesture on a menu -- or a button click.", &LLUIListener::call, - LLSD().insert("function", LLSD())); + LLSD().with("function", LLSD())); } void LLUIListener::call(const LLSD& event) const diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index 9e064d8135..46618d4026 100644 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -49,6 +49,7 @@ #include "llworldmapmessage.h" // library includes +#include "llnotificationsutil.h" #include "llsd.h" class LLURLDispatcherImpl @@ -162,7 +163,7 @@ bool LLURLDispatcherImpl::dispatchApp(const std::string& url, // (but still return true because it is a valid app SLURL) if (! handled) { - LLNotifications::instance().add("UnsupportedCommandSLURL"); + LLNotificationsUtil::add("UnsupportedCommandSLURL"); } return true; } diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index f3c64088c9..bd4f172907 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -32,6 +32,7 @@ #include "llviewerprecompiledheaders.h" +#define LLVIEWERCAMERA_CPP #include "llviewercamera.h" // Viewer includes @@ -105,6 +106,9 @@ glh::matrix4f gl_lookat(LLVector3 eye, LLVector3 center, LLVector3 up) } +// Build time optimization, generate this once in .cpp file +template class LLViewerCamera* LLSingleton<class LLViewerCamera>::getInstance(); + LLViewerCamera::LLViewerCamera() : LLCamera() { calcProjection(getFar()); diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h index 2b8a0892bf..cd67af5fef 100644 --- a/indra/newview/llviewercamera.h +++ b/indra/newview/llviewercamera.h @@ -52,6 +52,11 @@ const F32 OGL_TO_CFR_ROTATION[16] = { 0.f, 0.f, -1.f, 0.f, // -Z becomes X const BOOL FOR_SELECTION = TRUE; const BOOL NOT_FOR_SELECTION = FALSE; +// Build time optimization, generate this once in .cpp file +#ifndef LLVIEWERCAMERA_CPP +extern template class LLViewerCamera* LLSingleton<class LLViewerCamera>::getInstance(); +#endif + class LLViewerCamera : public LLCamera, public LLSingleton<LLViewerCamera> { public: diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 36d4a195e2..3678c14e35 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -38,6 +38,7 @@ #include "llviewerfloaterreg.h" #include "llcompilequeue.h" +#include "llcallfloater.h" #include "llfloaterabout.h" #include "llfloateractivespeakers.h" #include "llfloateranimpreview.h" @@ -106,6 +107,7 @@ #include "llfloateruipreview.h" #include "llfloaterurldisplay.h" #include "llfloatervoicedevicesettings.h" +#include "llfloatervolumepulldown.h" #include "llfloaterwater.h" #include "llfloaterwhitelistentry.h" #include "llfloaterwindlight.h" @@ -178,7 +180,6 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("impanel", "floater_im_session.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIMFloater>); LLFloaterReg::add("import_collada", "floater_import_collada.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterImportCollada>); LLFloaterReg::add("im_container", "floater_im_container.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIMFloaterContainer>); - LLFloaterReg::add("script_floater", "floater_script.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLScriptFloater>); LLFloaterReg::add("incoming_call", "floater_incoming_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIncomingCallDialog>); LLFloaterReg::add("inventory", "floater_inventory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInventory>); LLFloaterReg::add("inspect", "floater_inspect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInspect>); @@ -228,8 +229,13 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("telehubs", "floater_telehub.xml",&LLFloaterReg::build<LLFloaterTelehub>); LLFloaterReg::add("test_inspectors", "floater_test_inspectors.xml", &LLFloaterReg::build<LLFloaterTestInspectors>); - LLFloaterReg::add("test_list_view", "floater_test_list_view.xml",&LLFloaterReg::build<LLFloaterTestListView>); - LLFloaterReg::add("test_widgets", "floater_test_widgets.xml", &LLFloaterReg::build<LLFloater>); + //LLFloaterReg::add("test_list_view", "floater_test_list_view.xml",&LLFloaterReg::build<LLFloaterTestListView>); + LLFloaterReg::add("test_textbox", "floater_test_textbox.xml", + &LLFloaterReg::build<LLFloater>); + LLFloaterReg::add("test_text_editor", "floater_test_text_editor.xml", + &LLFloaterReg::build<LLFloater>); + LLFloaterReg::add("test_widgets", "floater_test_widgets.xml", + &LLFloaterReg::build<LLFloater>); LLFloaterReg::add("top_objects", "floater_top_objects.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTopObjects>); LLFloaterReg::add("reporter", "floater_report_abuse.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterReporter>); @@ -238,6 +244,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("script_debug", "floater_script_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterScriptDebug>); LLFloaterReg::add("script_debug_output", "floater_script_debug_panel.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterScriptDebugOutput>); + LLFloaterReg::add("script_floater", "floater_script.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLScriptFloater>); LLFloaterReg::add("sell_land", "floater_sell_land.xml", &LLFloaterSellLand::buildFloater); LLFloaterReg::add("settings_debug", "floater_settings_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSettingsDebug>); LLFloaterReg::add("stats", "floater_stats.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloater>); @@ -251,7 +258,8 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("upload_image", "floater_image_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterImagePreview>, "upload"); LLFloaterReg::add("upload_sound", "floater_sound_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSoundPreview>, "upload"); LLFloaterReg::add("upload_model", "floater_model_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterModelPreview>, "upload"); - LLFloaterReg::add("voice_call", "floater_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCall>); + LLFloaterReg::add("volume_pulldown", "floater_volume_pulldown.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterVolumePulldown>); + LLFloaterReg::add("voice_controls", "floater_voice_controls.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLCallFloater>); LLFloaterReg::add("whitelist_entry", "floater_whitelist_entry.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWhiteListEntry>); LLFloaterReg::add("world_map", "floater_world_map.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWorldMap>); diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index 6aabcb11b8..db54a79610 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -43,12 +43,14 @@ struct ViewerFolderEntry : public LLDictionaryEntry { // Constructor for non-ensembles ViewerFolderEntry(const std::string &new_category_name, // default name when creating a new category of this type - const std::string &icon_name // name of the folder icon + const std::string &icon_name, // name of the folder icon + BOOL is_quiet // folder doesn't need a UI update when changed ) : LLDictionaryEntry(empty_string), // no reverse lookup needed on non-ensembles, so just leave this blank mIconName(icon_name), - mNewCategoryName(new_category_name) + mNewCategoryName(new_category_name), + mIsQuiet(is_quiet) { mAllowedNames.clear(); } @@ -62,7 +64,8 @@ struct ViewerFolderEntry : public LLDictionaryEntry : LLDictionaryEntry(xui_name), mIconName(icon_name), - mNewCategoryName(new_category_name) + mNewCategoryName(new_category_name), + mIsQuiet(FALSE) { const std::string delims (","); LLStringUtilBase<char>::getTokens(allowed_names, mAllowedNames, delims); @@ -85,6 +88,7 @@ struct ViewerFolderEntry : public LLDictionaryEntry const std::string mNewCategoryName; typedef std::vector<std::string> name_vec_t; name_vec_t mAllowedNames; + BOOL mIsQuiet; }; class LLViewerFolderDictionary : public LLSingleton<LLViewerFolderDictionary>, @@ -100,31 +104,31 @@ LLViewerFolderDictionary::LLViewerFolderDictionary() { initEnsemblesFromFile(); - // NEW CATEGORY NAME FOLDER ICON NAME - // |-------------------------|---------------------------| - addEntry(LLFolderType::FT_TEXTURE, new ViewerFolderEntry("Textures", "inv_folder_texture.tga")); - addEntry(LLFolderType::FT_SOUND, new ViewerFolderEntry("Sounds", "inv_folder_sound.tga")); - addEntry(LLFolderType::FT_CALLINGCARD, new ViewerFolderEntry("Calling Cards", "inv_folder_callingcard.tga")); - addEntry(LLFolderType::FT_LANDMARK, new ViewerFolderEntry("Landmarks", "inv_folder_landmark.tga")); - addEntry(LLFolderType::FT_CLOTHING, new ViewerFolderEntry("Clothing", "inv_folder_clothing.tga")); - addEntry(LLFolderType::FT_OBJECT, new ViewerFolderEntry("Objects", "inv_folder_object.tga")); - addEntry(LLFolderType::FT_NOTECARD, new ViewerFolderEntry("Notecards", "inv_folder_notecard.tga")); - addEntry(LLFolderType::FT_ROOT_INVENTORY, new ViewerFolderEntry("My Inventory", "")); - addEntry(LLFolderType::FT_LSL_TEXT, new ViewerFolderEntry("Scripts", "inv_folder_script.tga")); - addEntry(LLFolderType::FT_BODYPART, new ViewerFolderEntry("Body Parts", "inv_folder_bodypart.tga")); - addEntry(LLFolderType::FT_TRASH, new ViewerFolderEntry("Trash", "inv_folder_trash.tga")); - addEntry(LLFolderType::FT_SNAPSHOT_CATEGORY, new ViewerFolderEntry("Photo Album", "inv_folder_snapshot.tga")); - addEntry(LLFolderType::FT_LOST_AND_FOUND, new ViewerFolderEntry("Lost And Found", "inv_folder_lostandfound.tga")); - addEntry(LLFolderType::FT_ANIMATION, new ViewerFolderEntry("Animations", "inv_folder_animation.tga")); - addEntry(LLFolderType::FT_GESTURE, new ViewerFolderEntry("Gestures", "inv_folder_gesture.tga")); - addEntry(LLFolderType::FT_FAVORITE, new ViewerFolderEntry("Favorite", "inv_folder_plain_closed.tga")); + // NEW CATEGORY NAME FOLDER ICON NAME QUIET? + // |-------------------------|-------------------------------|-----------| + addEntry(LLFolderType::FT_TEXTURE, new ViewerFolderEntry("Textures", "inv_folder_texture.tga", FALSE)); + addEntry(LLFolderType::FT_SOUND, new ViewerFolderEntry("Sounds", "inv_folder_sound.tga", FALSE)); + addEntry(LLFolderType::FT_CALLINGCARD, new ViewerFolderEntry("Calling Cards", "inv_folder_callingcard.tga", FALSE)); + addEntry(LLFolderType::FT_LANDMARK, new ViewerFolderEntry("Landmarks", "inv_folder_landmark.tga", FALSE)); + addEntry(LLFolderType::FT_CLOTHING, new ViewerFolderEntry("Clothing", "inv_folder_clothing.tga", FALSE)); + addEntry(LLFolderType::FT_OBJECT, new ViewerFolderEntry("Objects", "inv_folder_object.tga", FALSE)); + addEntry(LLFolderType::FT_NOTECARD, new ViewerFolderEntry("Notecards", "inv_folder_notecard.tga", FALSE)); + addEntry(LLFolderType::FT_ROOT_INVENTORY, new ViewerFolderEntry("My Inventory", "", FALSE)); + addEntry(LLFolderType::FT_LSL_TEXT, new ViewerFolderEntry("Scripts", "inv_folder_script.tga", FALSE)); + addEntry(LLFolderType::FT_BODYPART, new ViewerFolderEntry("Body Parts", "inv_folder_bodypart.tga", FALSE)); + addEntry(LLFolderType::FT_TRASH, new ViewerFolderEntry("Trash", "inv_folder_trash.tga", TRUE)); + addEntry(LLFolderType::FT_SNAPSHOT_CATEGORY, new ViewerFolderEntry("Photo Album", "inv_folder_snapshot.tga", FALSE)); + addEntry(LLFolderType::FT_LOST_AND_FOUND, new ViewerFolderEntry("Lost And Found", "inv_folder_lostandfound.tga", TRUE)); + addEntry(LLFolderType::FT_ANIMATION, new ViewerFolderEntry("Animations", "inv_folder_animation.tga", FALSE)); + addEntry(LLFolderType::FT_GESTURE, new ViewerFolderEntry("Gestures", "inv_folder_gesture.tga", FALSE)); + addEntry(LLFolderType::FT_FAVORITE, new ViewerFolderEntry("Favorite", "inv_folder_plain_closed.tga", FALSE)); - addEntry(LLFolderType::FT_CURRENT_OUTFIT, new ViewerFolderEntry("Current Outfit", "inv_folder_current_outfit.tga")); - addEntry(LLFolderType::FT_OUTFIT, new ViewerFolderEntry("New Outfit", "inv_folder_outfit.tga")); - addEntry(LLFolderType::FT_MY_OUTFITS, new ViewerFolderEntry("My Outfits", "inv_folder_my_outfits.tga")); - addEntry(LLFolderType::FT_INBOX, new ViewerFolderEntry("Inbox", "inv_folder_inbox.tga")); + addEntry(LLFolderType::FT_CURRENT_OUTFIT, new ViewerFolderEntry("Current Outfit", "inv_folder_current_outfit.tga",TRUE)); + addEntry(LLFolderType::FT_OUTFIT, new ViewerFolderEntry("New Outfit", "inv_folder_outfit.tga", TRUE)); + addEntry(LLFolderType::FT_MY_OUTFITS, new ViewerFolderEntry("My Outfits", "inv_folder_my_outfits.tga", TRUE)); + addEntry(LLFolderType::FT_INBOX, new ViewerFolderEntry("Inbox", "inv_folder_inbox.tga", FALSE)); - addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "inv_folder_plain_closed.tga")); + addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "inv_folder_plain_closed.tga", FALSE)); } bool LLViewerFolderDictionary::initEnsemblesFromFile() @@ -219,6 +223,17 @@ const std::string &LLViewerFolderType::lookupIconName(LLFolderType::EType folder return badLookup(); } +BOOL LLViewerFolderType::lookupIsQuietType(LLFolderType::EType folder_type) +{ + const ViewerFolderEntry *entry = LLViewerFolderDictionary::getInstance()->lookup(folder_type); + if (entry) + { + return entry->mIsQuiet; + } + return FALSE; +} + + const std::string &LLViewerFolderType::lookupNewCategoryName(LLFolderType::EType folder_type) { const ViewerFolderEntry *entry = LLViewerFolderDictionary::getInstance()->lookup(folder_type); diff --git a/indra/newview/llviewerfoldertype.h b/indra/newview/llviewerfoldertype.h index a6aea62b2a..dd9360da90 100644 --- a/indra/newview/llviewerfoldertype.h +++ b/indra/newview/llviewerfoldertype.h @@ -44,11 +44,13 @@ public: static const std::string& lookupXUIName(EType folder_type); // name used by the UI static LLFolderType::EType lookupTypeFromXUIName(const std::string& name); - static const std::string& lookupIconName(EType asset_type); // folder icon name + static const std::string& lookupIconName(EType folder_type); // folder icon name + static BOOL lookupIsQuietType(EType folder_type); // folder doesn't require UI update when changes have occured static const std::string& lookupNewCategoryName(EType folder_type); // default name when creating new category static LLFolderType::EType lookupTypeFromNewCategoryName(const std::string& name); // default name when creating new category static U64 lookupValidFolderTypes(const std::string& item_name); // which folders allow an item of this type? + protected: LLViewerFolderType() {} ~LLViewerFolderType() {} diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index c6ec25c1cb..5da77ecdb9 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -33,6 +33,7 @@ #include "llviewerprecompiledheaders.h" #include "llviewerinventory.h" +#include "llnotificationsutil.h" #include "message.h" #include "indra_constants.h" @@ -451,7 +452,7 @@ void LLViewerInventoryCategory::updateServer(BOOL is_new) const if (LLFolderType::lookupIsProtectedType(mPreferredType)) { - LLNotifications::instance().add("CannotModifyProtectedCategories"); + LLNotificationsUtil::add("CannotModifyProtectedCategories"); return; } @@ -475,7 +476,7 @@ void LLViewerInventoryCategory::removeFromServer( void ) // communicate that change with the server. if(LLFolderType::lookupIsProtectedType(mPreferredType)) { - LLNotifications::instance().add("CannotRemoveProtectedCategories"); + LLNotificationsUtil::add("CannotRemoveProtectedCategories"); return; } @@ -508,8 +509,13 @@ bool LLViewerInventoryCategory::fetchDescendents() // This comes from LLInventoryFilter from llfolderview.h U32 sort_order = gSavedSettings.getU32("InventorySortOrder") & 0x1; + // *NOTE: For bug EXT-2879, originally commented out + // gAgent.getRegion()->getCapability in order to use the old + // message-based system. This has been uncommented now that + // AIS folks are aware of the issue and have a fix in process. + // see ticket for details. + std::string url = gAgent.getRegion()->getCapability("WebFetchInventoryDescendents"); - if (!url.empty()) //Capability found. Build up LLSD and use it. { LLInventoryModel::startBackgroundFetch(mUUID); @@ -908,8 +914,20 @@ void link_inventory_item( } LLUUID transaction_id; - std::string desc = "Link"; + std::string desc = "Broken link"; // This should only show if the object can't find its baseobj. LLInventoryType::EType inv_type = LLInventoryType::IT_NONE; + if (dynamic_cast<const LLInventoryCategory *>(baseobj)) + { + inv_type = LLInventoryType::IT_CATEGORY; + } + else + { + const LLViewerInventoryItem *baseitem = dynamic_cast<const LLViewerInventoryItem *>(baseobj); + if (baseitem) + { + inv_type = baseitem->getInventoryType(); + } + } LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_LinkInventoryItem); @@ -1419,3 +1437,74 @@ void LLViewerInventoryItem::onCallingCardNameLookup(const LLUUID& id, const std: gInventory.notifyObservers(); } +class LLRegenerateLinkCollector : public LLInventoryCollectFunctor +{ +public: + LLRegenerateLinkCollector(const LLViewerInventoryItem *target_item) : mTargetItem(target_item) {} + virtual ~LLRegenerateLinkCollector() {} + virtual bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) + { + if (item) + { + if ((item->getName() == mTargetItem->getName()) && + (item->getInventoryType() == mTargetItem->getInventoryType()) && + (!item->getIsLinkType())) + { + return true; + } + } + return false; + } +protected: + const LLViewerInventoryItem* mTargetItem; +}; + +LLUUID find_possible_item_for_regeneration(const LLViewerInventoryItem *target_item) +{ + LLViewerInventoryCategory::cat_array_t cats; + LLViewerInventoryItem::item_array_t items; + + LLRegenerateLinkCollector candidate_matches(target_item); + gInventory.collectDescendentsIf(gInventory.getRootFolderID(), + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + candidate_matches); + for (LLViewerInventoryItem::item_array_t::const_iterator item_iter = items.begin(); + item_iter != items.end(); + ++item_iter) + { + const LLViewerInventoryItem *item = (*item_iter); + if (true) return item->getUUID(); + } + return LLUUID::null; +} + +// This currently dosen't work, because the sim does not allow us +// to change an item's assetID. +BOOL LLViewerInventoryItem::regenerateLink() +{ + const LLUUID target_item_id = find_possible_item_for_regeneration(this); + if (target_item_id.isNull()) + return FALSE; + LLViewerInventoryCategory::cat_array_t cats; + LLViewerInventoryItem::item_array_t items; + LLAssetIDMatches asset_id_matches(getAssetUUID()); + gInventory.collectDescendentsIf(gInventory.getRootFolderID(), + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + asset_id_matches); + for (LLViewerInventoryItem::item_array_t::iterator item_iter = items.begin(); + item_iter != items.end(); + item_iter++) + { + LLViewerInventoryItem *item = (*item_iter); + item->setAssetUUID(target_item_id); + item->updateServer(FALSE); + gInventory.addChangedMask(LLInventoryObserver::REBUILD, item->getUUID()); + } + gInventory.notifyObservers(); + return TRUE; +} diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index d27faffdd9..0156e7dab1 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -161,7 +161,10 @@ public: // callback void onCallingCardNameLookup(const LLUUID& id, const std::string& first_name, const std::string& last_name); - + + // If this is a broken link, try to fix it and any other identical link. + BOOL regenerateLink(); + public: BOOL mIsComplete; LLTransactionID mTransactionID; diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 8fd646ee93..f757155b94 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -538,8 +538,9 @@ void start_chat( EKeystate s ) void start_gesture( EKeystate s ) { + LLUICtrl* focus_ctrlp = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus()); if (KEYSTATE_UP == s && - !(gFocusMgr.getKeyboardFocus() && dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus())->acceptsTextInput())) + ! (focus_ctrlp && focus_ctrlp->acceptsTextInput())) { if (LLNearbyChatBar::getInstance()->getCurrentChat().empty()) { diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 9dfdf3d5b1..f6db661489 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -45,9 +45,12 @@ #include "llviewertexturelist.h" #include "llvovolume.h" #include "llpluginclassmedia.h" +#include "llviewerwindow.h" +#include "llfocusmgr.h" +#include "llcallbacklist.h" #include "llevent.h" // LLSimpleListener -#include "llnotifications.h" +#include "llnotificationsutil.h" #include "lluuid.h" #include "llkeyboard.h" #include "llmutelist.h" @@ -55,7 +58,7 @@ #include <boost/bind.hpp> // for SkinFolder listener #include <boost/signals2.hpp> -/*static*/ const char* LLViewerMedia::AUTO_PLAY_MEDIA_SETTING = "AutoPlayMedia"; +/*static*/ const char* LLViewerMedia::AUTO_PLAY_MEDIA_SETTING = "ParcelMediaAutoPlayEnable"; // Move this to its own file. @@ -171,7 +174,16 @@ public: else if(status == 404) { - // Treat 404s like an html page. + // 404 is content not found - sites often have bespoke 404 pages so + // treat them like an html page. + completeAny(status, "text/html"); + } + else + if(status == 406) + { + // 406 means the server sent something that we didn't indicate was acceptable + // Eventually we should send what we accept in the headers but for now, + // treat 406s like an html page. completeAny(status, "text/html"); } else @@ -318,6 +330,8 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s media_impl->mMediaLoop = media_entry->getAutoLoop(); media_impl->mMediaWidth = media_entry->getWidthPixels(); media_impl->mMediaHeight = media_entry->getHeightPixels(); + media_impl->mMediaAutoPlay = media_entry->getAutoPlay(); + media_impl->mMediaEntryURL = media_entry->getCurrentURL(); if (media_impl->mMediaSource) { media_impl->mMediaSource->setAutoScale(media_impl->mMediaAutoScale); @@ -325,8 +339,8 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s media_impl->mMediaSource->setSize(media_entry->getWidthPixels(), media_entry->getHeightPixels()); } - bool url_changed = (media_entry->getCurrentURL() != previous_url); - if(media_entry->getCurrentURL().empty()) + bool url_changed = (media_impl->mMediaEntryURL != previous_url); + if(media_impl->mMediaEntryURL.empty()) { if(url_changed) { @@ -341,7 +355,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s // The current media URL is not empty. // If (the media was already loaded OR the media was set to autoplay) AND this update didn't come from this agent, // do a navigate. - bool auto_play = (media_entry->getAutoPlay() && gSavedSettings.getBOOL(AUTO_PLAY_MEDIA_SETTING)); + bool auto_play = (media_impl->mMediaAutoPlay && gSavedSettings.getBOOL(AUTO_PLAY_MEDIA_SETTING)); if((was_loaded || auto_play) && !update_from_self) { @@ -363,8 +377,10 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s media_entry->getAutoLoop()); media_impl->setHomeURL(media_entry->getHomeURL()); + media_impl->mMediaAutoPlay = media_entry->getAutoPlay(); + media_impl->mMediaEntryURL = media_entry->getCurrentURL(); - if(media_entry->getAutoPlay() && gSavedSettings.getBOOL(AUTO_PLAY_MEDIA_SETTING)) + if(media_impl->mMediaAutoPlay && gSavedSettings.getBOOL(AUTO_PLAY_MEDIA_SETTING)) { needs_navigate = true; } @@ -372,21 +388,20 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s if(media_impl) { - std::string url = media_entry->getCurrentURL(); if(needs_navigate) { - media_impl->navigateTo(url, "", true, true); - lldebugs << "navigating to URL " << url << llendl; + media_impl->navigateTo(media_impl->mMediaEntryURL, "", true, true); + lldebugs << "navigating to URL " << media_impl->mMediaEntryURL << llendl; } - else if(!media_impl->mMediaURL.empty() && (media_impl->mMediaURL != url)) + else if(!media_impl->mMediaURL.empty() && (media_impl->mMediaURL != media_impl->mMediaEntryURL)) { // If we already have a non-empty media URL set and we aren't doing a navigate, update the media URL to match the media entry. - media_impl->mMediaURL = url; + media_impl->mMediaURL = media_impl->mMediaEntryURL; // If this causes a navigate at some point (such as after a reload), it should be considered server-driven so it isn't broadcast. media_impl->mNavigateServerRequest = true; - lldebugs << "updating URL in the media impl to " << url << llendl; + lldebugs << "updating URL in the media impl to " << media_impl->mMediaEntryURL << llendl; } } @@ -616,7 +631,7 @@ static bool proximity_comparitor(const LLViewerMediaImpl* i1, const LLViewerMedi ////////////////////////////////////////////////////////////////////////////////////////// // static -void LLViewerMedia::updateMedia() +void LLViewerMedia::updateMedia(void *dummy_arg) { impl_list::iterator iter = sViewerMediaImplList.begin(); impl_list::iterator end = sViewerMediaImplList.end(); @@ -659,7 +674,7 @@ void LLViewerMedia::updateMedia() LLPluginClassMedia::EPriority new_priority = LLPluginClassMedia::PRIORITY_NORMAL; - if(pimpl->isForcedUnloaded() || (impl_count_total > (int)max_instances)) + if(pimpl->isForcedUnloaded() || (impl_count_total >= (int)max_instances)) { // Never load muted or failed impls. // Hard limit on the number of instances that will be loaded at one time @@ -738,6 +753,19 @@ void LLViewerMedia::updateMedia() impl_count_total++; } + // Overrides if the window is minimized or we lost focus (taking care + // not to accidentally "raise" the priority either) + if (!gViewerWindow->getActive() /* viewer window minimized? */ + && new_priority > LLPluginClassMedia::PRIORITY_HIDDEN) + { + new_priority = LLPluginClassMedia::PRIORITY_HIDDEN; + } + else if (!gFocusMgr.getAppHasFocus() /* viewer window lost focus? */ + && new_priority > LLPluginClassMedia::PRIORITY_LOW) + { + new_priority = LLPluginClassMedia::PRIORITY_LOW; + } + pimpl->setPriority(new_priority); if(pimpl->getUsedInUI()) @@ -776,9 +804,16 @@ void LLViewerMedia::updateMedia() ////////////////////////////////////////////////////////////////////////////////////////// // static +void LLViewerMedia::initClass() +{ + gIdleCallbacks.addFunction(LLViewerMedia::updateMedia, NULL); +} + +////////////////////////////////////////////////////////////////////////////////////////// +// static void LLViewerMedia::cleanupClass() { - // This is no longer necessary, since sViewerMediaImplList is no longer smart pointers. + gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL); } ////////////////////////////////////////////////////////////////////////////////////////// @@ -821,6 +856,7 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id, mProximity(-1), mProximityDistance(0.0f), mMimeTypeProbe(NULL), + mMediaAutoPlay(false), mIsUpdated(false) { @@ -987,7 +1023,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ LL_WARNS("Plugin") << "plugin intialization failed for mime type: " << media_type << LL_ENDL; LLSD args; args["MIME_TYPE"] = media_type; - LLNotifications::instance().add("NoPlugin", args); + LLNotificationsUtil::add("NoPlugin", args); return NULL; } @@ -1281,16 +1317,36 @@ void LLViewerMediaImpl::mouseMove(S32 x, S32 y, MASK mask) } ////////////////////////////////////////////////////////////////////////////////////////// +//static +void LLViewerMediaImpl::scaleTextureCoords(const LLVector2& texture_coords, S32 *x, S32 *y) +{ + F32 texture_x = texture_coords.mV[VX]; + F32 texture_y = texture_coords.mV[VY]; + + // Deal with repeating textures by wrapping the coordinates into the range [0, 1.0) + texture_x = fmodf(texture_x, 1.0f); + if(texture_x < 0.0f) + texture_x = 1.0 + texture_x; + + texture_y = fmodf(texture_y, 1.0f); + if(texture_y < 0.0f) + texture_y = 1.0 + texture_y; + + // scale x and y to texel units. + *x = llround(texture_x * mMediaSource->getTextureWidth()); + *y = llround((1.0f - texture_y) * mMediaSource->getTextureHeight()); + + // Adjust for the difference between the actual texture height and the amount of the texture in use. + *y -= (mMediaSource->getTextureHeight() - mMediaSource->getHeight()); +} + +////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::mouseDown(const LLVector2& texture_coords, MASK mask, S32 button) { if(mMediaSource) { - // scale x and y to texel units. - S32 x = llround(texture_coords.mV[VX] * mMediaSource->getTextureWidth()); - S32 y = llround((1.0f - texture_coords.mV[VY]) * mMediaSource->getTextureHeight()); - - // Adjust for the difference between the actual texture height and the amount of the texture in use. - y -= (mMediaSource->getTextureHeight() - mMediaSource->getHeight()); + S32 x, y; + scaleTextureCoords(texture_coords, &x, &y); mouseDown(x, y, mask, button); } @@ -1300,12 +1356,8 @@ void LLViewerMediaImpl::mouseUp(const LLVector2& texture_coords, MASK mask, S32 { if(mMediaSource) { - // scale x and y to texel units. - S32 x = llround(texture_coords.mV[VX] * mMediaSource->getTextureWidth()); - S32 y = llround((1.0f - texture_coords.mV[VY]) * mMediaSource->getTextureHeight()); - - // Adjust for the difference between the actual texture height and the amount of the texture in use. - y -= (mMediaSource->getTextureHeight() - mMediaSource->getHeight()); + S32 x, y; + scaleTextureCoords(texture_coords, &x, &y); mouseUp(x, y, mask, button); } @@ -1315,12 +1367,8 @@ void LLViewerMediaImpl::mouseMove(const LLVector2& texture_coords, MASK mask) { if(mMediaSource) { - // scale x and y to texel units. - S32 x = llround(texture_coords.mV[VX] * mMediaSource->getTextureWidth()); - S32 y = llround((1.0f - texture_coords.mV[VY]) * mMediaSource->getTextureHeight()); - - // Adjust for the difference between the actual texture height and the amount of the texture in use. - y -= (mMediaSource->getTextureHeight() - mMediaSource->getHeight()); + S32 x, y; + scaleTextureCoords(texture_coords, &x, &y); mouseMove(x, y, mask); } @@ -1890,6 +1938,33 @@ void LLViewerMediaImpl::resetPreviousMediaState() mPreviousMediaTime = 0.0f; } + +////////////////////////////////////////////////////////////////////////////////////////// +// +void LLViewerMediaImpl::setDisabled(bool disabled) +{ + if(mIsDisabled != disabled) + { + // Only do this on actual state transitions. + mIsDisabled = disabled; + + if(mIsDisabled) + { + // We just disabled this media. Clear all state. + unload(); + } + else + { + // We just (re)enabled this media. Do a navigate if auto-play is in order. + if(mMediaAutoPlay && gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING)) + { + navigateTo(mMediaEntryURL, "", true, true); + } + } + + } +}; + ////////////////////////////////////////////////////////////////////////////////////////// // bool LLViewerMediaImpl::isForcedUnloaded() const @@ -1953,7 +2028,7 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla // TODO: may want a different message for this case? LLSD args; args["PLUGIN"] = LLMIMETypes::implType(mMimeType); - LLNotifications::instance().add("MediaPluginFailed", args); + LLNotificationsUtil::add("MediaPluginFailed", args); } break; @@ -1968,7 +2043,7 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla LLSD args; args["PLUGIN"] = LLMIMETypes::implType(mMimeType); // SJB: This is getting called every frame if the plugin fails to load, continuously respawining the alert! - //LLNotifications::instance().add("MediaPluginFailed", args); + //LLNotificationsUtil::add("MediaPluginFailed", args); } break; diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index ac12112ed4..713eb2710b 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -96,9 +96,10 @@ class LLViewerMedia static bool textureHasMedia(const LLUUID& texture_id); static void setVolume(F32 volume); - static void updateMedia(); + static void updateMedia(void* dummy_arg = NULL); static bool isMusicPlaying(); + static void initClass(); static void cleanupClass(); static void toggleMusicPlay(void*); @@ -185,6 +186,7 @@ public: void setHomeURL(const std::string& home_url) { mHomeURL = home_url; }; std::string getMimeType() { return mMimeType; } void scaleMouse(S32 *mouse_x, S32 *mouse_y); + void scaleTextureCoords(const LLVector2& texture_coords, S32 *x, S32 *y); void update(); void updateImagesMediaStreams(); @@ -200,7 +202,7 @@ public: bool isMediaFailed() const { return mMediaSourceFailed; }; void resetPreviousMediaState(); - void setDisabled(bool disabled) { mIsDisabled = disabled; }; + void setDisabled(bool disabled); bool isMediaDisabled() const { return mIsDisabled; }; // returns true if this instance should not be loaded (disabled, muted object, crashed, etc.) @@ -344,6 +346,8 @@ public: S32 mProximity; F64 mProximityDistance; LLMimeDiscoveryResponder *mMimeTypeProbe; + bool mMediaAutoPlay; + std::string mMediaEntryURL; private: BOOL mIsUpdated ; diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp index fd74c9c2fc..f639c841e7 100644 --- a/indra/newview/llviewermediafocus.cpp +++ b/indra/newview/llviewermediafocus.cpp @@ -138,15 +138,6 @@ void LLViewerMediaFocus::setFocusFace(LLPointer<LLViewerObject> objectp, S32 fac } else { - if(mFocusedImplID.notNull()) - { - if(mMediaControls.get()) - { - // Don't reset camera zoom by default, just tell the controls they're no longer controlling zoom. - mMediaControls.get()->resetZoomLevel(false); - } - } - if(hasFocus()) { gFocusMgr.setKeyboardFocus(NULL); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 17071ce7ff..10b997ae3a 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -31,186 +31,75 @@ */ #include "llviewerprecompiledheaders.h" - #include "llviewermenu.h" -// system library includes -#include <iostream> -#include <fstream> -#include <sstream> - // linden library includes -#include "llaudioengine.h" #include "llfloaterreg.h" -#include "indra_constants.h" -#include "llassetstorage.h" -#include "llchat.h" #include "llcombobox.h" -#include "llfeaturemanager.h" -#include "llfocusmgr.h" -#include "llfontgl.h" -#include "llinstantmessage.h" #include "llinventorypanel.h" -#include "llpermissionsflags.h" -#include "llrect.h" -#include "llsecondlifeurls.h" -#include "lltransactiontypes.h" -#include "llui.h" -#include "llview.h" -#include "llxfermanager.h" -#include "message.h" -#include "raytrace.h" -#include "llsdserialize.h" -#include "lltimer.h" -#include "llvfile.h" -#include "llvolumemgr.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" // newview includes #include "llagent.h" #include "llagentwearables.h" #include "llagentpilot.h" -#include "llbox.h" -#include "llcallingcard.h" -#include "llclipboard.h" #include "llcompilequeue.h" -#include "llconsole.h" -#include "llviewercontrol.h" #include "lldebugview.h" -#include "lldir.h" -#include "lldrawable.h" -#include "lldrawpoolalpha.h" -#include "lldrawpooltree.h" -#include "llface.h" #include "llfilepicker.h" #include "llfirstuse.h" -#include "llfloater.h" -#include "llfloaterabout.h" -#include "llfloaterbuycurrency.h" -#include "llfloateractivespeakers.h" -#include "llfloateranimpreview.h" -#include "llfloateravatartextures.h" -#include "llfloaterbuildoptions.h" -#include "llfloaterbump.h" #include "llfloaterbuy.h" #include "llfloaterbuycontents.h" #include "llfloaterbuycurrency.h" -#include "llfloaterbuyland.h" #include "llfloaterchat.h" #include "llfloatercustomize.h" -#include "llfloaterdaycycle.h" #include "llfloaterchatterbox.h" -#include "llfloaterfonttest.h" #include "llfloatergodtools.h" -#include "llfloatergroupinvite.h" -#include "llfloatergroups.h" -#include "llfloaterhud.h" -#include "llfloaterinspect.h" -#include "llfloaterlagmeter.h" #include "llfloaterland.h" -#include "llfloaterlandholdings.h" -#include "llfloatermap.h" -#include "llfloateropenobject.h" #include "llfloaterpay.h" -#include "llfloaterperms.h" -#include "llfloaterpostprocess.h" -#include "llfloaterpreference.h" -#include "llfloaterreg.h" -#include "llfloaterregioninfo.h" #include "llfloaterreporter.h" #include "llfloaterscriptdebug.h" -#include "llfloatersettingsdebug.h" -#include "llfloaterenvsettings.h" #include "llfloatertools.h" -#include "llfloaterwater.h" -#include "llfloaterwindlight.h" #include "llfloaterworldmap.h" -#include "llfloatermemleak.h" -#include "llfasttimerview.h" #include "llavataractions.h" #include "lllandmarkactions.h" -#include "llmemoryview.h" #include "llgroupmgr.h" #include "lltooltip.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" -#include "llimage.h" -#include "llimagebmp.h" -#include "llimagej2c.h" -#include "llimagetga.h" #include "llinventorybridge.h" -#include "llinventorymodel.h" -#include "llfloaterinventory.h" -#include "llkeyboard.h" #include "llpanellogin.h" #include "llpanelblockedlist.h" #include "llmenucommands.h" -#include "llmenugl.h" -#include "llmimetypes.h" #include "llmoveview.h" -#include "llmutelist.h" -#include "llnotify.h" -#include "llpanelobject.h" #include "llparcel.h" -#include "llprimitive.h" -#include "llresmgr.h" #include "llrootview.h" #include "llselectmgr.h" #include "llsidetray.h" -#include "llsky.h" #include "llstatusbar.h" -#include "llstatview.h" -#include "llstring.h" -#include "llsurfacepatch.h" -#include "llimview.h" #include "lltextureview.h" -#include "lltool.h" #include "lltoolbar.h" #include "lltoolcomp.h" -#include "lltoolfocus.h" -#include "lltoolgrab.h" #include "lltoolmgr.h" #include "lltoolpie.h" #include "lltoolselectland.h" -#include "lltrans.h" -#include "lluictrlfactory.h" -#include "lluploaddialog.h" -#include "lluserauth.h" -#include "lluuid.h" -#include "llviewercamera.h" #include "llviewergenericmessage.h" #include "llviewerhelp.h" -#include "llviewertexturelist.h" // gTextureList -#include "llviewerinventory.h" #include "llviewermenufile.h" // init_menu_file() #include "llviewermessage.h" #include "llviewernetwork.h" #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" -#include "llviewerparceloverlay.h" -#include "llviewerregion.h" #include "llviewerstats.h" -#include "llviewerwindow.h" -#include "llvoavatar.h" #include "llvoavatarself.h" -#include "llvolume.h" -#include "llweb.h" -#include "llworld.h" #include "llworldmap.h" -#include "object_flags.h" #include "pipeline.h" -#include "llappviewer.h" -#include "roles_constants.h" #include "llviewerjoystick.h" #include "llwlanimator.h" #include "llwlparammanager.h" -#include "llwaterparammanager.h" -#include "llfloaternotificationsconsole.h" #include "llfloatercamera.h" #include "lluilistener.h" - -#include "lltexlayer.h" #include "llappearancemgr.h" -#include "llimfloater.h" using namespace LLVOAvatarDefines; @@ -2938,7 +2827,7 @@ class LLAvatarReportAbuse : public view_listener_t bool callback_freeze(const LLSD& notification, const LLSD& response) { LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID(); - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option || 1 == option) { @@ -2992,14 +2881,14 @@ void handle_avatar_freeze(const LLSD& avatar_id) { LLSD args; args["AVATAR_NAME"] = fullname; - LLNotifications::instance().add("FreezeAvatarFullname", + LLNotificationsUtil::add("FreezeAvatarFullname", args, payload, callback_freeze); } else { - LLNotifications::instance().add("FreezeAvatar", + LLNotificationsUtil::add("FreezeAvatar", LLSD(), payload, callback_freeze); @@ -3039,7 +2928,7 @@ class LLAvatarDebug : public view_listener_t bool callback_eject(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (2 == option) { // Cancel button. @@ -3121,14 +3010,14 @@ void handle_avatar_eject(const LLSD& avatar_id) { LLSD args; args["AVATAR_NAME"] = fullname; - LLNotifications::instance().add("EjectAvatarFullname", + LLNotificationsUtil::add("EjectAvatarFullname", args, payload, callback_eject); } else { - LLNotifications::instance().add("EjectAvatarFullname", + LLNotificationsUtil::add("EjectAvatarFullname", LLSD(), payload, callback_eject); @@ -3141,14 +3030,14 @@ void handle_avatar_eject(const LLSD& avatar_id) { LLSD args; args["AVATAR_NAME"] = fullname; - LLNotifications::instance().add("EjectAvatarFullnameNoBan", + LLNotificationsUtil::add("EjectAvatarFullnameNoBan", args, payload, callback_eject); } else { - LLNotifications::instance().add("EjectAvatarNoBan", + LLNotificationsUtil::add("EjectAvatarNoBan", LLSD(), payload, callback_eject); @@ -3231,11 +3120,11 @@ class LLAvatarGiveCard : public view_listener_t transaction_id.generate(); msg->addUUIDFast(_PREHASH_TransactionID, transaction_id); msg->sendReliable(dest_host); - LLNotifications::instance().add("OfferedCard", args); + LLNotificationsUtil::add("OfferedCard", args); } else { - LLNotifications::instance().add("CantOfferCallingCard", old_args); + LLNotificationsUtil::add("CantOfferCallingCard", old_args); } } return true; @@ -3254,7 +3143,7 @@ void login_done(S32 which, void *user) bool callback_leave_group(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { LLMessageSystem *msg = gMessageSystem; @@ -3321,7 +3210,7 @@ void handle_buy_object(LLSaleInfo sale_info) { if(!LLSelectMgr::getInstance()->selectGetAllRootsValid()) { - LLNotifications::instance().add("UnableToBuyWhileDownloading"); + LLNotificationsUtil::add("UnableToBuyWhileDownloading"); return; } @@ -3330,7 +3219,7 @@ void handle_buy_object(LLSaleInfo sale_info) BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name); if (!owners_identical) { - LLNotifications::instance().add("CannotBuyObjectsFromDifferentOwners"); + LLNotificationsUtil::add("CannotBuyObjectsFromDifferentOwners"); return; } @@ -3340,7 +3229,7 @@ void handle_buy_object(LLSaleInfo sale_info) valid &= LLSelectMgr::getInstance()->selectGetAggregatePermissions(ag_perm); if(!valid || !sale_info.isForSale() || !perm.allowTransferTo(gAgent.getID())) { - LLNotifications::instance().add("ObjectNotForSale"); + LLNotificationsUtil::add("ObjectNotForSale"); return; } @@ -3504,12 +3393,12 @@ void set_god_level(U8 god_level) if(god_level > GOD_NOT) { args["LEVEL"] = llformat("%d",(S32)god_level); - LLNotifications::instance().add("EnteringGodMode", args); + LLNotificationsUtil::add("EnteringGodMode", args); } else { args["LEVEL"] = llformat("%d",(S32)old_god_level); - LLNotifications::instance().add("LeavingGodMode", args); + LLNotificationsUtil::add("LeavingGodMode", args); } // changing god-level can affect which menus we see @@ -3630,7 +3519,7 @@ void request_friendship(const LLUUID& dest_id) } else { - LLNotifications::instance().add("CantOfferFriendship"); + LLNotificationsUtil::add("CantOfferFriendship"); } } } @@ -3961,7 +3850,7 @@ void handle_claim_public_land(void*) { if (LLViewerParcelMgr::getInstance()->getSelectionRegion() != gAgent.getRegion()) { - LLNotifications::instance().add("ClaimPublicLand"); + LLNotificationsUtil::add("ClaimPublicLand"); return; } @@ -4157,7 +4046,7 @@ void derez_objects(EDeRezDestination dest, const LLUUID& dest_id) } else if(!error.empty()) { - LLNotifications::instance().add(error); + LLNotificationsUtil::add(error); } } @@ -4178,13 +4067,13 @@ class LLObjectReturn : public view_listener_t mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); - LLNotifications::instance().add("ReturnToOwner", LLSD(), LLSD(), boost::bind(&LLObjectReturn::onReturnToOwner, this, _1, _2)); + LLNotificationsUtil::add("ReturnToOwner", LLSD(), LLSD(), boost::bind(&LLObjectReturn::onReturnToOwner, this, _1, _2)); return true; } bool onReturnToOwner(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) { // Ignore category ID for this derez destination. @@ -4361,7 +4250,7 @@ void handle_take() bool confirm_take(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if(enable_take() && (option == 0)) { derez_objects(DRD_TAKE_INTO_AGENT_INVENTORY, notification["payload"]["folder_id"].asUUID()); @@ -4536,7 +4425,7 @@ S32 selection_price() /* bool callback_show_buy_currency(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) { llinfos << "Loading page " << LLNotifications::instance().getGlobalString("BUY_CURRENCY_URL") << llendl; @@ -4562,7 +4451,7 @@ void show_buy_currency(const char* extra) { args["EXTRA"] = extra; } - LLNotifications::instance().add("PromptGoToCurrencyPage", args);//, LLSD(), callback_show_buy_currency); + LLNotificationsUtil::add("PromptGoToCurrencyPage", args);//, LLSD(), callback_show_buy_currency); } void handle_buy() @@ -4832,7 +4721,7 @@ class LLToolsLink : public view_listener_t { if(!LLSelectMgr::getInstance()->selectGetAllRootsValid()) { - LLNotifications::instance().add("UnableToLinkWhileDownloading"); + LLNotificationsUtil::add("UnableToLinkWhileDownloading"); return true; } @@ -4843,18 +4732,18 @@ class LLToolsLink : public view_listener_t args["COUNT"] = llformat("%d", object_count); int max = MAX_CHILDREN_PER_TASK+1; args["MAX"] = llformat("%d", max); - LLNotifications::instance().add("UnableToLinkObjects", args); + LLNotificationsUtil::add("UnableToLinkObjects", args); return true; } if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() < 2) { - LLNotifications::instance().add("CannotLinkIncompleteSet"); + LLNotificationsUtil::add("CannotLinkIncompleteSet"); return true; } if(!LLSelectMgr::getInstance()->selectGetRootsModify()) { - LLNotifications::instance().add("CannotLinkModify"); + LLNotificationsUtil::add("CannotLinkModify"); return true; } LLUUID owner_id; @@ -4864,7 +4753,7 @@ class LLToolsLink : public view_listener_t // we don't actually care if you're the owner, but novices are // the most likely to be stumped by this one, so offer the // easiest and most likely solution. - LLNotifications::instance().add("CannotLinkDifferentOwners"); + LLNotificationsUtil::add("CannotLinkDifferentOwners"); return true; } LLSelectMgr::getInstance()->sendLink(); @@ -5348,7 +5237,7 @@ class LLWorldSetBusy : public view_listener_t else { gAgent.setBusy(); - LLNotifications::instance().add("BusyModeSet"); + LLNotificationsUtil::add("BusyModeSet"); } return true; } @@ -5358,7 +5247,7 @@ class LLWorldCreateLandmark : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "create_landmark")); + LLSideTray::getInstance()->showPanel("panel_places", LLSD().with("type", "create_landmark")); return true; } @@ -5464,7 +5353,7 @@ class LLAvatarAddContact : public view_listener_t bool complete_give_money(const LLSD& notification, const LLSD& response, LLObjectSelectionHandle selection) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { gAgent.clearBusy(); @@ -5626,12 +5515,7 @@ class LLShowFloater : public view_listener_t } else if (floater_name == "buy land") { - if (LLViewerParcelMgr::getInstance()->selectionEmpty()) - { - LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal()); - } - - LLViewerParcelMgr::getInstance()->startBuyLand(); + handle_buy_land(); } else if (floater_name == "script errors") { @@ -5690,7 +5574,7 @@ class LLShowSidetrayPanel : public view_listener_t bool callback_show_url(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) { LLWeb::loadURL(notification["payload"]["url"].asString()); @@ -5713,7 +5597,7 @@ class LLPromptShowURL : public view_listener_t { LLSD payload; payload["url"] = url; - LLNotifications::instance().add(alert, LLSD(), payload, callback_show_url); + LLNotificationsUtil::add(alert, LLSD(), payload, callback_show_url); } else { @@ -5730,7 +5614,7 @@ class LLPromptShowURL : public view_listener_t bool callback_show_file(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) { LLWeb::loadURL(notification["payload"]["url"]); @@ -5751,7 +5635,7 @@ class LLPromptShowFile : public view_listener_t LLSD payload; payload["url"] = file; - LLNotifications::instance().add(alert, LLSD(), payload, callback_show_file); + LLNotificationsUtil::add(alert, LLSD(), payload, callback_show_file); } else { @@ -5841,7 +5725,15 @@ BOOL enable_buy_land(void*) LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(), false); } - +void handle_buy_land() +{ + LLViewerParcelMgr* vpm = LLViewerParcelMgr::getInstance(); + if (vpm->selectionEmpty()) + { + vpm->selectParcelAt(gAgent.getPositionGlobal()); + } + vpm->startBuyLand(); +} class LLObjectAttachToAvatar : public view_listener_t { @@ -6216,6 +6108,7 @@ BOOL object_selected_and_point_valid() return (selection->getRootObjectCount() == 1) && (selection->getFirstRootObject()->getPCode() == LL_PCODE_VOLUME) && selection->getFirstRootObject()->permYouOwner() && + selection->getFirstRootObject()->flagObjectMove() && !((LLViewerObject*)selection->getFirstRootObject()->getRoot())->isAvatar() && (selection->getFirstRootObject()->getNVPair("AssetContainer") == NULL); } @@ -6322,12 +6215,12 @@ void queue_actions(LLFloaterScriptQueue* q, const std::string& msg) if ( !func.scripted ) { std::string noscriptmsg = std::string("Cannot") + msg + "SelectObjectsNoScripts"; - LLNotifications::instance().add(noscriptmsg); + LLNotificationsUtil::add(noscriptmsg); } else if ( !func.modifiable ) { std::string nomodmsg = std::string("Cannot") + msg + "SelectObjectsNoPermission"; - LLNotifications::instance().add(nomodmsg); + LLNotificationsUtil::add(nomodmsg); } else { @@ -6957,16 +6850,15 @@ void handle_grab_texture(void* data) gInventory.updateItem(item); gInventory.notifyObservers(); - LLFloaterInventory* view = LLFloaterInventory::getActiveInventory(); - // Show the preview panel for textures to let // user know that the image is now in inventory. - if(view) + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); + if(active_panel) { LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus(); - view->getPanel()->setSelection(item_id, TAKE_FOCUS_NO); - view->getPanel()->openSelected(); + active_panel->setSelection(item_id, TAKE_FOCUS_NO); + active_panel->openSelected(); //LLFloaterInventory::dumpSelectionInformation((void*)view); // restore keyboard focus gFocusMgr.setKeyboardFocus(focus_ctrl); @@ -7136,7 +7028,7 @@ void handle_save_to_xml(void*) LLFloater* frontmost = gFloaterView->getFrontmost(); if (!frontmost) { - LLNotifications::instance().add("NoFrontmostFloater"); + LLNotificationsUtil::add("NoFrontmostFloater"); return; } diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index 9a6fe03f9f..01a6b34170 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -102,6 +102,8 @@ void handle_take_copy(); void handle_look_at_selection(const LLSD& param); void handle_zoom_to_object(LLUUID object_id); +void handle_buy_land(); + // Takes avatar UUID, or if no UUID passed, uses last selected object void handle_avatar_freeze(const LLSD& avatar_id); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 2c0a41e1ff..89e16a3dd1 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -63,6 +63,7 @@ #include "llassetuploadresponders.h" #include "lleconomy.h" #include "llhttpclient.h" +#include "llnotificationsutil.h" #include "llsdserialize.h" #include "llsdutil.h" #include "llstring.h" @@ -181,7 +182,7 @@ const std::string upload_pick(void* data) // No extension LLSD args; args["FILE"] = short_name; - LLNotifications::instance().add("NoFileExtension", args); + LLNotificationsUtil::add("NoFileExtension", args); return std::string(); } else @@ -224,7 +225,7 @@ const std::string upload_pick(void* data) LLSD args; args["EXTENSION"] = ext; args["VALIDS"] = valid_extensions; - LLNotifications::instance().add("InvalidFileExtension", args); + LLNotificationsUtil::add("InvalidFileExtension", args); return std::string(); } }//end else (non-null extension) @@ -242,7 +243,7 @@ const std::string upload_pick(void* data) llinfos << error_msg << ": " << filename << llendl; LLSD args; args["FILE"] = filename; - LLNotifications::instance().add( error_msg, args ); + LLNotificationsUtil::add( error_msg, args ); return std::string(); } }//end if a wave/sound file @@ -382,7 +383,7 @@ class LLFileUploadBulk : public view_listener_t void upload_error(const std::string& error_message, const std::string& label, const std::string& filename, const LLSD& args) { llwarns << error_message << llendl; - LLNotifications::instance().add(label, args); + LLNotificationsUtil::add(label, args); if(LLFile::remove(filename) == -1) { lldebugs << "unable to remove temp file" << llendl; @@ -851,7 +852,7 @@ LLUUID upload_new_resource( llwarns << error_message << llendl; LLSD args; args["ERROR_MESSAGE"] = error_message; - LLNotifications::instance().add("ErrorMessage", args); + LLNotificationsUtil::add("ErrorMessage", args); if(LLFile::remove(filename) == -1) { lldebugs << "unable to remove temp file" << llendl; @@ -946,7 +947,7 @@ void upload_done_callback( LLSD args; args["FILE"] = LLInventoryType::lookupHumanReadable(data->mInventoryType); args["REASON"] = std::string(LLAssetStorage::getErrorString(result)); - LLNotifications::instance().add("CannotUploadReason", args); + LLNotificationsUtil::add("CannotUploadReason", args); } LLUploadDialog::modalUploadFinished(); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index deaea5a66c..f6dfe46840 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -31,72 +31,34 @@ */ #include "llviewerprecompiledheaders.h" - #include "llviewermessage.h" -#include <deque> - #include "llaudioengine.h" -#include "indra_constants.h" #include "lscript_byteformat.h" -#include "mean_collision_data.h" -#include "llfloaterbump.h" -#include "llassetstorage.h" -#include "llcachename.h" - -#include "lldbstrings.h" #include "lleconomy.h" -#include "llfilepicker.h" #include "llfloaterreg.h" -#include "llfocusmgr.h" #include "llfollowcamparams.h" -#include "llinstantmessage.h" -#include "llquantize.h" -#include "llregionflags.h" -#include "llregionhandle.h" #include "llsdserialize.h" -#include "llstring.h" -#include "llteleportflags.h" -#include "lltracker.h" #include "lltransactionflags.h" -#include "llxfermanager.h" -#include "message.h" -#include "sound_ids.h" -#include "lltimer.h" -#include "llmd5.h" #include "llagent.h" #include "llcallingcard.h" -#include "llconsole.h" -#include "llvieweraudio.h" -#include "llviewercontrol.h" -#include "lldrawpool.h" #include "llfirstuse.h" -#include "llfloateranimpreview.h" #include "llfloaterbuycurrency.h" #include "llfloaterbuyland.h" #include "llfloaterchat.h" -#include "llfloaterimagepreview.h" #include "llfloaterland.h" #include "llfloaterregioninfo.h" #include "llfloaterlandholdings.h" -#include "llurldispatcher.h" #include "llfloaterpostcard.h" #include "llfloaterpreference.h" -#include "llfollowcam.h" -#include "llgroupnotify.h" -#include "llhudeffect.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" -#include "llinventorymodel.h" #include "llinventoryobserver.h" #include "llinventorypanel.h" -#include "llfloaterinventory.h" -#include "llmenugl.h" -#include "llmoveview.h" -#include "llmutelist.h" #include "llnearbychat.h" #include "llnotifications.h" +#include "llnotificationsutil.h" #include "llnotify.h" #include "llpanelgrouplandmoney.h" #include "llpanelplaces.h" @@ -110,22 +72,12 @@ #include "llstatenums.h" #include "llstatusbar.h" #include "llimview.h" -#include "lltool.h" -#include "lltoolbar.h" -#include "lltoolmgr.h" #include "lltrans.h" -#include "llui.h" // for make_ui_sound -#include "lluploaddialog.h" -#include "llviewercamera.h" -#include "llviewerchat.h" +#include "llviewerfoldertype.h" #include "llviewergenericmessage.h" -#include "llviewerinventory.h" #include "llviewermenu.h" -#include "llviewerobject.h" #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" -#include "llviewerpartsource.h" -#include "llviewerregion.h" #include "llviewerstats.h" #include "llviewertexteditor.h" #include "llviewerthrottle.h" @@ -133,10 +85,8 @@ #include "llvlmanager.h" #include "llvoavatarself.h" #include "llvotextbubble.h" -#include "llweb.h" #include "llworld.h" #include "pipeline.h" -#include "llappviewer.h" #include "llfloaterworldmap.h" #include "llviewerdisplay.h" #include "llkeythrottle.h" @@ -145,15 +95,13 @@ #include "llpanelblockedlist.h" #include "llpanelplaceprofile.h" -#include <boost/tokenizer.hpp> -#include <boost/algorithm/string/split.hpp> +#include <boost/algorithm/string/split.hpp> // #if LL_WINDOWS // For Windows specific error handler #include "llwindebug.h" // For the invalid message handler #endif -//#include "llnearbychathistory.h" -#include "llnotificationmanager.h" +#include "llnotificationmanager.h" // // // Constants @@ -210,7 +158,7 @@ const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] = bool friendship_offer_callback(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLMessageSystem* msg = gMessageSystem; const LLSD& payload = notification["payload"]; @@ -635,7 +583,7 @@ void send_sound_trigger(const LLUUID& sound_id, F32 gain) bool join_group_response(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); BOOL delete_context_data = TRUE; bool accept_invite = false; @@ -650,7 +598,7 @@ bool join_group_response(const LLSD& notification, const LLSD& response) LLGroupActions::show(group_id); LLSD args; args["MESSAGE"] = message; - LLNotifications::instance().add("JoinGroup", args, notification["payload"]); + LLNotificationsUtil::add("JoinGroup", args, notification["payload"]); return false; } if(option == 0 && !group_id.isNull()) @@ -669,7 +617,7 @@ bool join_group_response(const LLSD& notification, const LLSD& response) LLSD args; args["NAME"] = name; args["INVITE"] = message; - LLNotifications::instance().add("JoinedTooManyGroupsMember", args, notification["payload"]); + LLNotificationsUtil::add("JoinedTooManyGroupsMember", args, notification["payload"]); } } @@ -686,7 +634,7 @@ bool join_group_response(const LLSD& notification, const LLSD& response) // asking about a fee. LLSD next_payload = notification["payload"]; next_payload["fee"] = 0; - LLNotifications::instance().add("JoinGroupCanAfford", + LLNotificationsUtil::add("JoinGroupCanAfford", args, next_payload); } @@ -877,111 +825,87 @@ bool check_offer_throttle(const std::string& from_name, bool check_only) void open_inventory_offer(const std::vector<LLUUID>& items, const std::string& from_name) { - std::vector<LLUUID>::const_iterator it = items.begin(); - std::vector<LLUUID>::const_iterator end = items.end(); - const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); - LLInventoryItem* item; - for(; it != end; ++it) - { - const LLUUID& id = *it; - item = gInventory.getItem(id); + for (std::vector<LLUUID>::const_iterator item_iter = items.begin(); + item_iter != items.end(); + ++item_iter) + { + const LLUUID& item_id = (*item_iter); + LLInventoryItem* item = gInventory.getItem(item_id); if(!item) { - LL_WARNS("Messaging") << "Unable to show inventory item: " << id << LL_ENDL; + LL_WARNS("Messaging") << "Unable to show inventory item: " << item_id << LL_ENDL; continue; } - if(gInventory.isObjectDescendentOf(id, trash_id)) + + //////////////////////////////////////////////////////////////////////////////// + // Don't highlight if it's in certain "quiet" folders which don't need UI + // notification (e.g. trash, cof, lost-and-found). + const BOOL user_is_away = gAwayTimer.getStarted(); + if(!user_is_away) { - continue; + const LLViewerInventoryCategory *parent = gInventory.getFirstNondefaultParent(item_id); + if (parent) + { + const LLFolderType::EType parent_type = parent->getPreferredType(); + if (LLViewerFolderType::lookupIsQuietType(parent_type)) + { + continue; + } + } } - LLAssetType::EType asset_type = item->getType(); - //if we are throttled, don't display them - if (check_offer_throttle(from_name, false)) + //////////////////////////////////////////////////////////////////////////////// + // Special handling for various types. + const LLAssetType::EType asset_type = item->getType(); + if (check_offer_throttle(from_name, false)) // If we are throttled, don't display { // If we opened this ourselves, focus it - BOOL take_focus = from_name.empty() ? TAKE_FOCUS_YES : TAKE_FOCUS_NO; + const BOOL take_focus = from_name.empty() ? TAKE_FOCUS_YES : TAKE_FOCUS_NO; switch(asset_type) { case LLAssetType::AT_NOTECARD: - LLFloaterReg::showInstance("preview_notecard", LLSD(id), take_focus); - break; + { + LLFloaterReg::showInstance("preview_notecard", LLSD(item_id), take_focus); + break; + } case LLAssetType::AT_LANDMARK: { LLInventoryCategory* parent_folder = gInventory.getCategory(item->getParentUUID()); LLSD args; args["LANDMARK_NAME"] = item->getName(); args["FOLDER_NAME"] = std::string(parent_folder ? parent_folder->getName() : "unknown"); - LLNotifications::instance().add("LandmarkCreated", args); + LLNotificationsUtil::add("LandmarkCreated", args); // Created landmark is passed to Places panel to allow its editing. - LLPanelPlaces *panel = dynamic_cast<LLPanelPlaces*>(LLSideTray::getInstance()->showPanel("panel_places", LLSD())); - if (panel) + LLPanelPlaces *places_panel = dynamic_cast<LLPanelPlaces*>(LLSideTray::getInstance()->showPanel("panel_places", LLSD())); + if (places_panel) { - panel->setItem(item); + places_panel->setItem(item); } } break; case LLAssetType::AT_TEXTURE: - LLFloaterReg::showInstance("preview_texture", LLSD(id), take_focus); - break; + { + LLFloaterReg::showInstance("preview_texture", LLSD(item_id), take_focus); + break; + } default: break; } } - //highlight item, if it's not in the trash or lost+found - // Don't auto-open the inventory floater - LLFloaterInventory* view = NULL; - if(gSavedSettings.getBOOL("ShowInInventory") && - asset_type != LLAssetType::AT_CALLINGCARD && - item->getInventoryType() != LLInventoryType::IT_ATTACHMENT && - !from_name.empty()) - { - view = LLFloaterInventory::showAgentInventory(); - //TODO:this should be moved to the end of method after all the checks, - //but first decide what to do with active inventory if any (EK) - LLSD key; - key["select"] = item->getUUID(); - LLSideTray::getInstance()->showPanel("sidepanel_inventory", key); - } - else - { - view = LLFloaterInventory::getActiveInventory(); - } - if(!view) - { - return; - } - - //Trash Check - const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); - if(gInventory.isObjectDescendentOf(item->getUUID(), trash_id)) - { - return; - } - const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); - //BOOL inventory_has_focus = gFocusMgr.childHasKeyboardFocus(view); - BOOL user_is_away = gAwayTimer.getStarted(); - - // don't select lost and found items if the user is active - if (gInventory.isObjectDescendentOf(item->getUUID(), lost_and_found_id) - && !user_is_away) - { - return; - } - - //Not sure about this check. Could make it easy to miss incoming items. - //don't dick with highlight while the user is working - //if(inventory_has_focus && !user_is_away) - // break; - LL_DEBUGS("Messaging") << "Highlighting" << item->getUUID() << LL_ENDL; - //highlight item - - if (view->getPanel()) - { + //////////////////////////////////////////////////////////////////////////////// + // Highlight item if it's not in the trash, lost+found, or COF + const BOOL auto_open = gSavedSettings.getBOOL("ShowInInventory") && + (asset_type != LLAssetType::AT_CALLINGCARD) && + (item->getInventoryType() != LLInventoryType::IT_ATTACHMENT) && + !from_name.empty(); + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open); + if(active_panel) + { + LL_DEBUGS("Messaging") << "Highlighting" << item_id << LL_ENDL; LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus(); - view->getPanel()->setSelection(item->getUUID(), TAKE_FOCUS_NO); + active_panel->setSelection(item_id, TAKE_FOCUS_NO); gFocusMgr.setKeyboardFocus(focus_ctrl); } } @@ -1108,7 +1032,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& { LLChat chat; std::string log_message; - S32 button = LLNotification::getSelectedOption(notification, response); + S32 button = LLNotificationsUtil::getSelectedOption(notification, response); LLInventoryObserver* opener = NULL; LLViewerInventoryCategory* catp = NULL; @@ -1239,6 +1163,10 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& gInventory.addObserver(opener); } + // Remove script dialog because there is no need in it no more. + LLUUID object_id = notification["payload"]["object_id"].asUUID(); + LLScriptFloaterManager::instance().removeNotificationByObjectId(object_id); + delete this; return false; } @@ -1413,7 +1341,11 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const { gInventory.addObserver(opener); } - + + // Remove script dialog because there is no need in it no more. + LLUUID object_id = notification["payload"]["object_id"].asUUID(); + LLScriptFloaterManager::instance().removeNotificationByObjectId(object_id); + delete this; return false; } @@ -1501,7 +1433,18 @@ void inventory_offer_handler(LLOfferInfo* info) } } + // If mObjectID is null then generate the object_id based on msg to prevent + // multiple creation of chiclets for same object. + LLUUID object_id = info->mObjectID; + if (object_id.isNull()) + object_id.generate(msg); + payload["from_id"] = info->mFromID; + // Needed by LLScriptFloaterManager to bind original notification with + // faked for toast one. + payload["object_id"] = object_id; + // Flag indicating that this notification is faked for toast. + payload["give_inventory_notification"] = FALSE; args["OBJECTFROMNAME"] = info->mFromName; args["NAME"] = info->mFromName; args["NAME_SLURL"] = LLSLURL::buildCommand("agent", info->mFromID, "about"); @@ -1542,9 +1485,16 @@ void inventory_offer_handler(LLOfferInfo* info) // In viewer 2 we're now auto receiving inventory offers and messaging as such (not sending reject messages). info->send_auto_receive_response(); } - + // Pop up inv offer notification and let the user accept (keep), or reject (and silently delete) the inventory. - LLNotifications::instance().add(p); + LLNotifications::instance().add(p); + + // Inform user that there is a script floater via toast system + { + payload["give_inventory_notification"] = TRUE; + LLNotificationPtr notification = LLNotifications::instance().add(p.payload(payload)); + LLScriptFloaterManager::getInstance()->setNotificationToastId(object_id, notification->getID()); + } } bool lure_callback(const LLSD& notification, const LLSD& response) @@ -1556,7 +1506,7 @@ bool lure_callback(const LLSD& notification, const LLSD& response) } else { - option = LLNotification::getSelectedOption(notification, response); + option = LLNotificationsUtil::getSelectedOption(notification, response); } LLUUID from_id = notification["payload"]["from_id"].asUUID(); @@ -1587,7 +1537,7 @@ static LLNotificationFunctorRegistration lure_callback_reg("TeleportOffered", lu bool goto_url_callback(const LLSD& notification, const LLSD& response) { std::string url = notification["payload"]["url"].asString(); - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if(1 == option) { LLWeb::loadURL(url); @@ -1598,7 +1548,7 @@ static LLNotificationFunctorRegistration goto_url_callback_reg("GotoURL", goto_u bool inspect_remote_object_callback(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) { LLFloaterReg::showInstance("inspect_remote_object", notification["payload"]); @@ -1686,7 +1636,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // Note: don't put the message in the IM history, even though was sent // via the IM mechanism. - LLNotifications::instance().add("SystemMessageTip",args); + LLNotificationsUtil::add("SystemMessageTip",args); break; case IM_NOTHING_SPECIAL: @@ -1758,7 +1708,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // Message to everyone from GOD args["NAME"] = name; args["MESSAGE"] = message; - LLNotifications::instance().add("GodMessage", args); + LLNotificationsUtil::add("GodMessage", args); // Treat like a system message and put in chat history. // Claim to be from a local agent so it doesn't go into @@ -1837,7 +1787,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // This is a block, modeless dialog. //*TODO: Translate args["MESSAGE"] = message; - LLNotifications::instance().add("SystemMessage", args); + LLNotificationsUtil::add("SystemMessage", args); } break; case IM_GROUP_NOTICE: @@ -1970,7 +1920,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLSD args; args["MESSAGE"] = message; - LLNotifications::instance().add("JoinGroup", args, payload, join_group_response); + LLNotificationsUtil::add("JoinGroup", args, payload, join_group_response); } } break; @@ -2047,13 +1997,13 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_INVENTORY_ACCEPTED: { args["NAME"] = name; - LLNotifications::instance().add("InventoryAccepted", args); + LLNotificationsUtil::add("InventoryAccepted", args); break; } case IM_INVENTORY_DECLINED: { args["NAME"] = name; - LLNotifications::instance().add("InventoryDeclined", args); + LLNotificationsUtil::add("InventoryDeclined", args); break; } // TODO: _DEPRECATED suffix as part of vote removal - DEV-24856 @@ -2135,7 +2085,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { payload["groupowned"] = "true"; } - LLNotifications::instance().add("ServerObjectMessage", substitutions, payload); + LLNotificationsUtil::add("ServerObjectMessage", substitutions, payload); } break; case IM_FROM_TASK_AS_ALERT: @@ -2147,7 +2097,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // Construct a viewer alert for this message. args["NAME"] = name; args["MESSAGE"] = message; - LLNotifications::instance().add("ObjectMessage", args); + LLNotificationsUtil::add("ObjectMessage", args); } break; case IM_BUSY_AUTO_RESPONSE: @@ -2184,7 +2134,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) payload["from_id"] = from_id; payload["lure_id"] = session_id; payload["godlike"] = FALSE; - LLNotifications::instance().add("TeleportOffered", args, payload); + LLNotificationsUtil::add("TeleportOffered", args, payload); } } break; @@ -2221,7 +2171,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) args["URL"] = url; LLSD payload; payload["url"] = url; - LLNotifications::instance().add("GotoURL", args, payload ); + LLNotificationsUtil::add("GotoURL", args, payload ); } break; @@ -2248,12 +2198,12 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if(message.empty()) { //support for frienship offers from clients before July 2008 - LLNotifications::instance().add("OfferFriendshipNoMessage", args, payload); + LLNotificationsUtil::add("OfferFriendshipNoMessage", args, payload); } else { args["[MESSAGE]"] = message; - LLNotifications::instance().add("OfferFriendship", args, payload); + LLNotificationsUtil::add("OfferFriendship", args, payload); } } } @@ -2273,7 +2223,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) args["NAME"] = name; LLSD payload; payload["from_id"] = from_id; - LLNotifications::instance().add("FriendshipAccepted", args, payload); + LLNotificationsUtil::add("FriendshipAccepted", args, payload); } break; @@ -2314,7 +2264,7 @@ void busy_message (LLMessageSystem* msg, LLUUID from_id) bool callingcard_offer_callback(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLUUID fid; LLUUID from_id; LLMessageSystem* msg = gMessageSystem; @@ -2393,7 +2343,7 @@ void process_offer_callingcard(LLMessageSystem* msg, void**) } else { - LLNotifications::instance().add("OfferCallingCard", args, payload); + LLNotificationsUtil::add("OfferCallingCard", args, payload); } } else @@ -2404,12 +2354,12 @@ void process_offer_callingcard(LLMessageSystem* msg, void**) void process_accept_callingcard(LLMessageSystem* msg, void**) { - LLNotifications::instance().add("CallingCardAccepted"); + LLNotificationsUtil::add("CallingCardAccepted"); } void process_decline_callingcard(LLMessageSystem* msg, void**) { - LLNotifications::instance().add("CallingCardDeclined"); + LLNotificationsUtil::add("CallingCardDeclined"); } @@ -2744,13 +2694,13 @@ public: { // Show notification that they can now teleport to landmarks. Use a random landmark from the inventory S32 random_land = ll_rand( land_items.count() - 1 ); args["NAME"] = land_items[random_land]->getName(); - LLNotifications::instance().add("TeleportToLandmark",args); + LLNotificationsUtil::add("TeleportToLandmark",args); } if ( card_items.count() > 0 ) { // Show notification that they can now contact people. Use a random calling card from the inventory S32 random_card = ll_rand( card_items.count() - 1 ); args["NAME"] = card_items[random_card]->getName(); - LLNotifications::instance().add("TeleportToPerson",args); + LLNotificationsUtil::add("TeleportToPerson",args); } gInventory.removeObserver(this); @@ -3127,7 +3077,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) LLSD args; args["URL"] = url; - LLNotifications::instance().add("ServerVersionChanged", args); + LLNotificationsUtil::add("ServerVersionChanged", args); } gLastVersionChannel = version_channel; @@ -4346,7 +4296,28 @@ void process_money_balance_reply( LLMessageSystem* msg, void** ) // *TODO: Translate LLSD args; args["MESSAGE"] = desc; - LLNotifications::instance().add("SystemMessage", args); + + // this is a marker to retrieve avatar name from server message: + // "<avatar name> paid you L$" + const std::string marker = "paid you L$"; + + // extract avatar name from system message + std::string name = desc.substr(0, desc.find(marker, 0)); + LLStringUtil::trim(name); + + // if name extracted and name cache contains avatar id send loggable notification + LLUUID from_id; + if(name.size() > 0 && gCacheName->getUUID(name, from_id)) + { + args["NAME"] = name; + LLSD payload; + payload["from_id"] = from_id; + LLNotificationsUtil::add("PaymentRecived", args, payload); + } + else + { + LLNotificationsUtil::add("SystemMessage", args); + } // Once the 'recent' container gets large enough, chop some // off the beginning. @@ -4364,7 +4335,7 @@ void process_money_balance_reply( LLMessageSystem* msg, void** ) bool handle_special_notification_callback(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) { @@ -4385,18 +4356,18 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) llsdBlock["REGIONMATURITY"] = LLViewerRegion::accessToString(regionAccess); // we're going to throw the LLSD in there in case anyone ever wants to use it - LLNotifications::instance().add(notificationID+"_Notify", llsdBlock); + LLNotificationsUtil::add(notificationID+"_Notify", llsdBlock); if (regionAccess == SIM_ACCESS_MATURE) { if (gAgent.isTeen()) { - LLNotifications::instance().add(notificationID+"_KB", llsdBlock); + LLNotificationsUtil::add(notificationID+"_KB", llsdBlock); return true; } else if (gAgent.prefersPG()) { - LLNotifications::instance().add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback); + LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback); return true; } } @@ -4404,12 +4375,12 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) { if (!gAgent.isAdult()) { - LLNotifications::instance().add(notificationID+"_KB", llsdBlock); + LLNotificationsUtil::add(notificationID+"_KB", llsdBlock); return true; } else if (gAgent.prefersPG() || gAgent.prefersMature()) { - LLNotifications::instance().add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback); + LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback); return true; } } @@ -4469,7 +4440,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) } } - LLNotifications::instance().add(notificationID, llsdBlock); + LLNotificationsUtil::add(notificationID, llsdBlock); return true; } return false; @@ -4535,14 +4506,14 @@ void process_alert_core(const std::string& message, BOOL modal) // Allow the server to spawn a named alert so that server alerts can be // translated out of English. std::string alert_name(message.substr(ALERT_PREFIX.length())); - LLNotifications::instance().add(alert_name); + LLNotificationsUtil::add(alert_name); } else if (message.find(NOTIFY_PREFIX) == 0) { // Allow the server to spawn a named notification so that server notifications can be // translated out of English. std::string notify_name(message.substr(NOTIFY_PREFIX.length())); - LLNotifications::instance().add(notify_name); + LLNotificationsUtil::add(notify_name); } else if (message[0] == '/') { @@ -4554,20 +4525,20 @@ void process_alert_core(const std::string& message, BOOL modal) S32 mins = 0; LLStringUtil::convertToS32(text.substr(18), mins); args["MINUTES"] = llformat("%d",mins); - LLNotifications::instance().add("RegionRestartMinutes", args); + LLNotificationsUtil::add("RegionRestartMinutes", args); } else if (text.substr(0,17) == "RESTART_X_SECONDS") { S32 secs = 0; LLStringUtil::convertToS32(text.substr(18), secs); args["SECONDS"] = llformat("%d",secs); - LLNotifications::instance().add("RegionRestartSeconds", args); + LLNotificationsUtil::add("RegionRestartSeconds", args); } else { std::string new_msg =LLNotifications::instance().getGlobalString(text); args["MESSAGE"] = new_msg; - LLNotifications::instance().add("SystemMessage", args); + LLNotificationsUtil::add("SystemMessage", args); } } else if (modal) @@ -4575,14 +4546,14 @@ void process_alert_core(const std::string& message, BOOL modal) LLSD args; std::string new_msg =LLNotifications::instance().getGlobalString(message); args["ERROR_MESSAGE"] = new_msg; - LLNotifications::instance().add("ErrorMessage", args); + LLNotificationsUtil::add("ErrorMessage", args); } else { LLSD args; std::string new_msg =LLNotifications::instance().getGlobalString(message); args["MESSAGE"] = new_msg; - LLNotifications::instance().add("SystemMessageTip", args); + LLNotificationsUtil::add("SystemMessageTip", args); } } @@ -4799,7 +4770,7 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp bool script_question_cb(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLMessageSystem *msg = gMessageSystem; S32 orig = notification["payload"]["questions"].asInteger(); S32 new_questions = orig; @@ -4863,10 +4834,10 @@ bool script_question_cb(const LLSD& notification, const LLSD& response) if (response["Details"]) { // respawn notification... - LLNotifications::instance().add(notification["name"], notification["substitutions"], notification["payload"]); + LLNotificationsUtil::add(notification["name"], notification["substitutions"], notification["payload"]); // ...with description on top - LLNotifications::instance().add("DebitPermissionDetails"); + LLNotificationsUtil::add("DebitPermissionDetails"); } return false; } @@ -4963,12 +4934,12 @@ void process_script_question(LLMessageSystem *msg, void **user_data) if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) { // display the caution permissions prompt - LLNotifications::instance().add(caution ? "ScriptQuestionCaution" : "ScriptQuestion", args, payload); + LLNotificationsUtil::add(caution ? "ScriptQuestionCaution" : "ScriptQuestion", args, payload); } else { // fall back to default behavior if cautions are entirely disabled - LLNotifications::instance().add("ScriptQuestion", args, payload); + LLNotificationsUtil::add("ScriptQuestion", args, payload); } } @@ -4991,7 +4962,7 @@ void container_inventory_arrived(LLViewerObject* object, gAgent.changeCameraToDefault(); } - LLFloaterInventory* view = LLFloaterInventory::getActiveInventory(); + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); if (inventory->size() > 2) { @@ -5029,9 +5000,9 @@ void container_inventory_arrived(LLViewerObject* object, } } gInventory.notifyObservers(); - if(view) + if(active_panel) { - view->getPanel()->setSelection(cat_id, TAKE_FOCUS_NO); + active_panel->setSelection(cat_id, TAKE_FOCUS_NO); } } else if (inventory->size() == 2) @@ -5065,9 +5036,9 @@ void container_inventory_arrived(LLViewerObject* object, new_item->updateServer(TRUE); gInventory.updateItem(new_item); gInventory.notifyObservers(); - if(view) + if(active_panel) { - view->getPanel()->setSelection(item_id, TAKE_FOCUS_NO); + active_panel->setSelection(item_id, TAKE_FOCUS_NO); } } @@ -5168,7 +5139,7 @@ void process_teleport_failed(LLMessageSystem *msg, void**) } } - LLNotifications::instance().add("CouldNotTeleportReason", args); + LLNotificationsUtil::add("CouldNotTeleportReason", args); // Let the interested parties know that teleport failed. LLViewerParcelMgr::getInstance()->onTeleportFailed(); @@ -5301,7 +5272,7 @@ void send_group_notice(const LLUUID& group_id, bool handle_lure_callback(const LLSD& notification, const LLSD& response) { std::string text = response["message"].asString(); - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if(0 == option) { @@ -5348,11 +5319,11 @@ void handle_lure(const std::vector<LLUUID>& ids) } if (gAgent.isGodlike()) { - LLNotifications::instance().add("OfferTeleportFromGod", edit_args, payload, handle_lure_callback); + LLNotificationsUtil::add("OfferTeleportFromGod", edit_args, payload, handle_lure_callback); } else { - LLNotifications::instance().add("OfferTeleport", edit_args, payload, handle_lure_callback); + LLNotificationsUtil::add("OfferTeleport", edit_args, payload, handle_lure_callback); } } @@ -5536,17 +5507,6 @@ void process_script_dialog(LLMessageSystem* msg, void**) notification = LLNotifications::instance().add( LLNotification::Params("ScriptDialogGroup").substitutions(args).payload(payload).form_elements(form.asLLSD())); } - - // "ScriptDialog" and "ScriptDialogGroup" are handles by LLScriptFloaterManager. - // We want to inform user that there is a script floater, lets add "ScriptToast" - LLNotification::Params p("ScriptToast"); - p.substitutions(args).payload(payload).functor.function(boost::bind( - LLScriptFloaterManager::onToastButtonClick, _1, _2)); - - notification = LLNotifications::instance().add(p); - - LLScriptFloaterManager::getInstance()->setNotificationToastId( - object_id, notification->getID()); } //--------------------------------------------------------------------------- @@ -5556,7 +5516,7 @@ std::vector<LLSD> gLoadUrlList; bool callback_load_url(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) { @@ -5601,7 +5561,7 @@ void callback_load_url_name(const LLUUID& id, const std::string& first, const st args["OBJECTNAME"] = load_url_info["object_name"].asString(); args["NAME"] = owner_name; - LLNotifications::instance().add("LoadWebPage", args, load_url_info); + LLNotificationsUtil::add("LoadWebPage", args, load_url_info); } else { @@ -5656,7 +5616,7 @@ void callback_download_complete(void** data, S32 result, LLExtStat ext_status) std::string* filepath = (std::string*)data; LLSD args; args["DOWNLOAD_PATH"] = *filepath; - LLNotifications::instance().add("FinishedRawDownload", args); + LLNotificationsUtil::add("FinishedRawDownload", args); delete filepath; } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index e491e11960..3c79045cc5 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2767,22 +2767,23 @@ void LLViewerObject::setPixelAreaAndAngle(LLAgent &agent) // I don't think there's a better way to do this without calculating distance per-poly F32 range = sqrt(dx*dx + dy*dy + dz*dz) - min_scale/2; + LLViewerCamera* camera = LLViewerCamera::getInstance(); if (range < 0.001f || isHUDAttachment()) // range == zero { mAppAngle = 180.f; - mPixelArea = (F32)LLViewerCamera::getInstance()->getScreenPixelArea(); + mPixelArea = (F32)camera->getScreenPixelArea(); } else { mAppAngle = (F32) atan2( max_scale, range) * RAD_TO_DEG; - F32 pixels_per_meter = LLViewerCamera::getInstance()->getPixelMeterRatio() / range; + F32 pixels_per_meter = camera->getPixelMeterRatio() / range; mPixelArea = (pixels_per_meter * max_scale) * (pixels_per_meter * mid_scale); - if (mPixelArea > LLViewerCamera::getInstance()->getScreenPixelArea()) + if (mPixelArea > camera->getScreenPixelArea()) { mAppAngle = 180.f; - mPixelArea = (F32)LLViewerCamera::getInstance()->getScreenPixelArea(); + mPixelArea = (F32)camera->getScreenPixelArea(); } } } diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 01b213a87d..266c40d493 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -457,6 +457,7 @@ public: inline BOOL flagAnimSource() const { return ((mFlags & FLAGS_ANIM_SOURCE) != 0); } inline BOOL flagCameraSource() const { return ((mFlags & FLAGS_CAMERA_SOURCE) != 0); } inline BOOL flagCameraDecoupled() const { return ((mFlags & FLAGS_CAMERA_DECOUPLED) != 0); } + inline BOOL flagObjectMove() const { return ((mFlags & FLAGS_OBJECT_MOVE) != 0); } bool getIncludeInSearch() const; void setIncludeInSearch(bool include_in_search); diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index f61dbb1b39..90a7ee98b9 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -43,7 +43,7 @@ #include "message.h" #include "llviewermediafocus.h" #include "llviewerparcelmediaautoplay.h" -#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llfirstuse.h" #include "llpluginclassmedia.h" #include "llviewertexture.h" @@ -111,7 +111,7 @@ void LLViewerParcelMedia::update(LLParcel* parcel) // First use warning if( ! mediaUrl.empty() && gWarningSettings.getBOOL("FirstStreamingVideo") ) { - LLNotifications::instance().add("ParcelCanPlayMedia", LLSD(), LLSD(), + LLNotificationsUtil::add("ParcelCanPlayMedia", LLSD(), LLSD(), boost::bind(callback_play_media, _1, _2, parcel)); return; @@ -167,7 +167,7 @@ void LLViewerParcelMedia::update(LLParcel* parcel) { gWarningSettings.setBOOL("QuickTimeInstalled", FALSE); - LLNotifications::instance().add("NoQuickTime" ); + LLNotificationsUtil::add("NoQuickTime" ); }; } } @@ -590,7 +590,7 @@ void LLViewerParcelMedia::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { gSavedSettings.setBOOL("AudioStreamingVideo", TRUE); diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index fcaf49c884..2fae78cdfb 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -39,6 +39,8 @@ #include "indra_constants.h" #include "llcachename.h" #include "llgl.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llparcel.h" #include "llsecondlifeurls.h" #include "message.h" @@ -520,7 +522,7 @@ LLParcelSelectionHandle LLViewerParcelMgr::selectLand(const LLVector3d &corner1, if (region != region_other) { - LLNotifications::instance().add("CantSelectLandFromMultipleRegions"); + LLNotificationsUtil::add("CantSelectLandFromMultipleRegions"); mSelected = FALSE; notifyObservers(); return NULL; @@ -943,7 +945,7 @@ void LLViewerParcelMgr::sendParcelGodForceOwner(const LLUUID& owner_id) { if (!mSelected) { - LLNotifications::instance().add("CannotSetLandOwnerNothingSelected"); + LLNotificationsUtil::add("CannotSetLandOwnerNothingSelected"); return; } @@ -958,7 +960,7 @@ void LLViewerParcelMgr::sendParcelGodForceOwner(const LLUUID& owner_id) if (!region) { // TODO: Add a force owner version of this alert. - LLNotifications::instance().add("CannotContentifyNoRegion"); + LLNotificationsUtil::add("CannotContentifyNoRegion"); return; } @@ -966,7 +968,7 @@ void LLViewerParcelMgr::sendParcelGodForceOwner(const LLUUID& owner_id) LLViewerRegion *region2 = LLWorld::getInstance()->getRegionFromPosGlobal( east_north_region_check ); if (region != region2) { - LLNotifications::instance().add("CannotSetLandOwnerMultipleRegions"); + LLNotificationsUtil::add("CannotSetLandOwnerMultipleRegions"); return; } @@ -991,7 +993,7 @@ void LLViewerParcelMgr::sendParcelGodForceOwner(const LLUUID& owner_id) bool callback_god_force_owner(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if(0 == option) { LLMessageSystem* msg = gMessageSystem; @@ -1011,13 +1013,13 @@ void LLViewerParcelMgr::sendParcelGodForceToContent() { if (!mSelected) { - LLNotifications::instance().add("CannotContentifyNothingSelected"); + LLNotificationsUtil::add("CannotContentifyNothingSelected"); return; } LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); if (!region) { - LLNotifications::instance().add("CannotContentifyNoRegion"); + LLNotificationsUtil::add("CannotContentifyNoRegion"); return; } @@ -1035,14 +1037,14 @@ void LLViewerParcelMgr::sendParcelRelease() { if (!mSelected) { - LLNotifications::instance().add("CannotReleaseLandNothingSelected"); + LLNotificationsUtil::add("CannotReleaseLandNothingSelected"); return; } LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); if (!region) { - LLNotifications::instance().add("CannotReleaseLandNoRegion"); + LLNotificationsUtil::add("CannotReleaseLandNoRegion"); return; } @@ -1097,14 +1099,14 @@ LLViewerParcelMgr::ParcelBuyInfo* LLViewerParcelMgr::setupParcelBuy( { if (!mSelected || !mCurrentParcel) { - LLNotifications::instance().add("CannotBuyLandNothingSelected"); + LLNotificationsUtil::add("CannotBuyLandNothingSelected"); return NULL; } LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); if (!region) { - LLNotifications::instance().add("CannotBuyLandNoRegion"); + LLNotificationsUtil::add("CannotBuyLandNoRegion"); return NULL; } @@ -1122,7 +1124,7 @@ LLViewerParcelMgr::ParcelBuyInfo* LLViewerParcelMgr::setupParcelBuy( if (region != region2) { - LLNotifications::instance().add("CantBuyLandAcrossMultipleRegions"); + LLNotificationsUtil::add("CantBuyLandAcrossMultipleRegions"); return NULL; } } @@ -1204,18 +1206,18 @@ void LLViewerParcelMgr::sendParcelDeed(const LLUUID& group_id) { if (!mSelected || !mCurrentParcel) { - LLNotifications::instance().add("CannotDeedLandNothingSelected"); + LLNotificationsUtil::add("CannotDeedLandNothingSelected"); return; } if(group_id.isNull()) { - LLNotifications::instance().add("CannotDeedLandNoGroup"); + LLNotificationsUtil::add("CannotDeedLandNoGroup"); return; } LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); if (!region) { - LLNotifications::instance().add("CannotDeedLandNoRegion"); + LLNotificationsUtil::add("CannotDeedLandNoRegion"); return; } @@ -2037,18 +2039,18 @@ void LLViewerParcelMgr::deedLandToGroup() gCacheName->getName(mCurrentParcel->getOwnerID(), first_name, last_name); args["FIRST_NAME"] = first_name; args["LAST_NAME"] = last_name; - LLNotifications::instance().add("DeedLandToGroupWithContribution",args, LLSD(), deedAlertCB); + LLNotificationsUtil::add("DeedLandToGroupWithContribution",args, LLSD(), deedAlertCB); } else { - LLNotifications::instance().add("DeedLandToGroup",args, LLSD(), deedAlertCB); + LLNotificationsUtil::add("DeedLandToGroup",args, LLSD(), deedAlertCB); } } // static bool LLViewerParcelMgr::deedAlertCB(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { LLParcel* parcel = LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(); @@ -2067,26 +2069,26 @@ void LLViewerParcelMgr::startReleaseLand() { if (!mSelected) { - LLNotifications::instance().add("CannotReleaseLandNothingSelected"); + LLNotificationsUtil::add("CannotReleaseLandNothingSelected"); return; } if (mRequestResult == PARCEL_RESULT_NO_DATA) { - LLNotifications::instance().add("CannotReleaseLandWatingForServer"); + LLNotificationsUtil::add("CannotReleaseLandWatingForServer"); return; } if (mRequestResult == PARCEL_RESULT_MULTIPLE) { - LLNotifications::instance().add("CannotReleaseLandSelected"); + LLNotificationsUtil::add("CannotReleaseLandSelected"); return; } if (!isParcelOwnedByAgent(mCurrentParcel, GP_LAND_RELEASE) && !(gAgent.canManageEstate())) { - LLNotifications::instance().add("CannotReleaseLandDontOwn"); + LLNotificationsUtil::add("CannotReleaseLandDontOwn"); return; } @@ -2094,7 +2096,7 @@ void LLViewerParcelMgr::startReleaseLand() LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal(parcel_center); if (!region) { - LLNotifications::instance().add("CannotReleaseLandRegionNotFound"); + LLNotificationsUtil::add("CannotReleaseLandRegionNotFound"); return; } /* @@ -2103,21 +2105,21 @@ void LLViewerParcelMgr::startReleaseLand() { LLSD args; args["REGION"] = region->getName(); - LLNotifications::instance().add("CannotReleaseLandNoTransfer", args); + LLNotificationsUtil::add("CannotReleaseLandNoTransfer", args); return; } */ if (!mCurrentParcelSelection->mWholeParcelSelected) { - LLNotifications::instance().add("CannotReleaseLandPartialSelection"); + LLNotificationsUtil::add("CannotReleaseLandPartialSelection"); return; } // Compute claim price LLSD args; args["AREA"] = llformat("%d",mCurrentParcel->getArea()); - LLNotifications::instance().add("ReleaseLandWarning", args, LLSD(), releaseAlertCB); + LLNotificationsUtil::add("ReleaseLandWarning", args, LLSD(), releaseAlertCB); } bool LLViewerParcelMgr::canAgentBuyParcel(LLParcel* parcel, bool forGroup) const @@ -2192,13 +2194,13 @@ void LLViewerParcelMgr::startDivideLand() { if (!mSelected) { - LLNotifications::instance().add("CannotDivideLandNothingSelected"); + LLNotificationsUtil::add("CannotDivideLandNothingSelected"); return; } if (mCurrentParcelSelection->mWholeParcelSelected) { - LLNotifications::instance().add("CannotDivideLandPartialSelection"); + LLNotificationsUtil::add("CannotDivideLandPartialSelection"); return; } @@ -2206,13 +2208,13 @@ void LLViewerParcelMgr::startDivideLand() payload["west_south_border"] = ll_sd_from_vector3d(mWestSouth); payload["east_north_border"] = ll_sd_from_vector3d(mEastNorth); - LLNotifications::instance().add("LandDivideWarning", LLSD(), payload, callbackDivideLand); + LLNotificationsUtil::add("LandDivideWarning", LLSD(), payload, callbackDivideLand); } // static bool LLViewerParcelMgr::callbackDivideLand(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLVector3d west_south_d = ll_vector3d_from_sd(notification["payload"]["west_south_border"]); LLVector3d east_north_d = ll_vector3d_from_sd(notification["payload"]["east_north_border"]); LLVector3d parcel_center = (west_south_d + east_north_d) / 2.0; @@ -2220,7 +2222,7 @@ bool LLViewerParcelMgr::callbackDivideLand(const LLSD& notification, const LLSD& LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal(parcel_center); if (!region) { - LLNotifications::instance().add("CannotDivideLandNoRegion"); + LLNotificationsUtil::add("CannotDivideLandNoRegion"); return false; } @@ -2249,19 +2251,19 @@ void LLViewerParcelMgr::startJoinLand() { if (!mSelected) { - LLNotifications::instance().add("CannotJoinLandNothingSelected"); + LLNotificationsUtil::add("CannotJoinLandNothingSelected"); return; } if (mCurrentParcelSelection->mWholeParcelSelected) { - LLNotifications::instance().add("CannotJoinLandEntireParcelSelected"); + LLNotificationsUtil::add("CannotJoinLandEntireParcelSelected"); return; } if (!mCurrentParcelSelection->mSelectedMultipleOwners) { - LLNotifications::instance().add("CannotJoinLandSelection"); + LLNotificationsUtil::add("CannotJoinLandSelection"); return; } @@ -2269,13 +2271,13 @@ void LLViewerParcelMgr::startJoinLand() payload["west_south_border"] = ll_sd_from_vector3d(mWestSouth); payload["east_north_border"] = ll_sd_from_vector3d(mEastNorth); - LLNotifications::instance().add("JoinLandWarning", LLSD(), payload, callbackJoinLand); + LLNotificationsUtil::add("JoinLandWarning", LLSD(), payload, callbackJoinLand); } // static bool LLViewerParcelMgr::callbackJoinLand(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLVector3d west_south_d = ll_vector3d_from_sd(notification["payload"]["west_south_border"]); LLVector3d east_north_d = ll_vector3d_from_sd(notification["payload"]["east_north_border"]); LLVector3d parcel_center = (west_south_d + east_north_d) / 2.0; @@ -2283,7 +2285,7 @@ bool LLViewerParcelMgr::callbackJoinLand(const LLSD& notification, const LLSD& r LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal(parcel_center); if (!region) { - LLNotifications::instance().add("CannotJoinLandNoRegion"); + LLNotificationsUtil::add("CannotJoinLandNoRegion"); return false; } @@ -2312,19 +2314,19 @@ void LLViewerParcelMgr::startDeedLandToGroup() { if (!mSelected || !mCurrentParcel) { - LLNotifications::instance().add("CannotDeedLandNothingSelected"); + LLNotificationsUtil::add("CannotDeedLandNothingSelected"); return; } if (mRequestResult == PARCEL_RESULT_NO_DATA) { - LLNotifications::instance().add("CannotDeedLandWaitingForServer"); + LLNotificationsUtil::add("CannotDeedLandWaitingForServer"); return; } if (mRequestResult == PARCEL_RESULT_MULTIPLE) { - LLNotifications::instance().add("CannotDeedLandMultipleSelected"); + LLNotificationsUtil::add("CannotDeedLandMultipleSelected"); return; } @@ -2332,7 +2334,7 @@ void LLViewerParcelMgr::startDeedLandToGroup() LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal(parcel_center); if (!region) { - LLNotifications::instance().add("CannotDeedLandNoRegion"); + LLNotificationsUtil::add("CannotDeedLandNoRegion"); return; } @@ -2344,7 +2346,7 @@ void LLViewerParcelMgr::startDeedLandToGroup() { LLSD args; args["REGION"] = region->getName(); - LLNotifications::instance().add("CannotDeedLandNoTransfer", args); + LLNotificationsUtil::add("CannotDeedLandNoTransfer", args); return; } } @@ -2374,7 +2376,7 @@ void LLViewerParcelMgr::reclaimParcel() // static bool LLViewerParcelMgr::releaseAlertCB(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { // Send the release message, not a force diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp index 9896adad97..9de1ef7190 100644 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -808,6 +808,7 @@ S32 LLViewerParcelOverlay::renderPropertyLines () S32 drawn = 0; F32* vertexp; U8* colorp; + bool render_hidden = LLSelectMgr::sRenderHiddenSelections && LLFloaterReg::instanceVisible("build"); const F32 PROPERTY_LINE_CLIP_DIST = 256.f; @@ -849,7 +850,7 @@ S32 LLViewerParcelOverlay::renderPropertyLines () gGL.end(); - if (LLSelectMgr::sRenderHiddenSelections && LLFloaterReg::instanceVisible("build")) + if (render_hidden) { LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_GREATER); diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index cfb8340462..841a7ccc5e 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -71,9 +71,9 @@ const F32 LLViewerPartSim::PART_ADAPT_RATE_MULT_RECIP = 1.0f/PART_ADAPT_RATE_MUL U32 LLViewerPart::sNextPartID = 1; -F32 calc_desired_size(LLVector3 pos, LLVector2 scale) +F32 calc_desired_size(LLViewerCamera* camera, LLVector3 pos, LLVector2 scale) { - F32 desired_size = (pos-LLViewerCamera::getInstance()->getOrigin()).magVec(); + F32 desired_size = (pos - camera->getOrigin()).magVec(); desired_size /= 4; return llclamp(desired_size, scale.magVec()*0.5f, PART_SIM_BOX_SIDE*2); } @@ -273,6 +273,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) LLViewerPartSim::checkParticleCount(mParticles.size()); + LLViewerCamera* camera = LLViewerCamera::getInstance(); LLViewerRegion *regionp = getRegion(); S32 end = (S32) mParticles.size(); for (S32 i = 0 ; i < (S32)mParticles.size();) @@ -394,7 +395,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) } else { - F32 desired_size = calc_desired_size(part->mPosAgent, part->mScale); + F32 desired_size = calc_desired_size(camera, part->mPosAgent, part->mScale); if (!posInGroup(part->mPosAgent, desired_size)) { // Transfer particles between groups @@ -557,7 +558,8 @@ LLViewerPartGroup *LLViewerPartSim::put(LLViewerPart* part) } else { - F32 desired_size = calc_desired_size(part->mPosAgent, part->mScale); + LLViewerCamera* camera = LLViewerCamera::getInstance(); + F32 desired_size = calc_desired_size(camera, part->mPosAgent, part->mScale); S32 count = (S32) mViewerPartGroups.size(); for (S32 i = 0; i < count; i++) diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h index bb317aeb5f..86f59b6e2f 100644 --- a/indra/newview/llviewerprecompiledheaders.h +++ b/indra/newview/llviewerprecompiledheaders.h @@ -233,4 +233,7 @@ // In skinning-7, llui.h dependencies are changing too often. //#include "llui.h" +// llxuixml +#include "llinitparam.h" + #endif diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index dd310a8813..569ceea431 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -50,6 +50,7 @@ #include "llmemorystream.h" #include "llmenugl.h" #include "llnotecard.h" +#include "llnotificationsutil.h" #include "llnotify.h" #include "llpanelplaces.h" #include "llpreview.h" @@ -1182,13 +1183,13 @@ void LLViewerTextEditor::showUnsavedAlertDialog( LLInventoryItem* item ) LLSD payload; payload["item_id"] = item->getUUID(); payload["notecard_id"] = mNotecardInventoryID; - LLNotifications::instance().add( "ConfirmNotecardSave", LLSD(), payload, LLViewerTextEditor::onNotecardDialog); + LLNotificationsUtil::add( "ConfirmNotecardSave", LLSD(), payload, LLViewerTextEditor::onNotecardDialog); } // static bool LLViewerTextEditor::onNotecardDialog(const LLSD& notification, const LLSD& response ) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if( option == 0 ) { LLPreviewNotecard* preview = LLFloaterReg::findTypedInstance<LLPreviewNotecard>("preview_notecard", notification["payload"]["notecard_id"]);; @@ -1208,13 +1209,13 @@ void LLViewerTextEditor::showCopyToInvDialog( LLInventoryItem* item, llwchar wc LLUUID item_id = item->getUUID(); payload["item_id"] = item_id; payload["item_wc"] = LLSD::Integer(wc); - LLNotifications::instance().add( "ConfirmItemCopy", LLSD(), payload, + LLNotificationsUtil::add( "ConfirmItemCopy", LLSD(), payload, boost::bind(&LLViewerTextEditor::onCopyToInvDialog, this, _1, _2)); } bool LLViewerTextEditor::onCopyToInvDialog(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if( 0 == option ) { LLUUID item_id = notification["payload"]["item_id"].asUUID(); diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index dbcf563010..5be7f2945f 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -614,10 +614,6 @@ void LLViewerTextureList::updateImages(F32 max_time) didone = image->doLoadedCallbacks(); } } - if (!gNoRender && !gGLManager.mIsDisabled) - { - LLViewerMedia::updateMedia(); - } updateImagesUpdateStats(); } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 8611caa6aa..a532c9da64 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -194,6 +194,8 @@ #include "llagentui.h" #include "llwearablelist.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llnotificationmanager.h" #include "llfloaternotificationsconsole.h" @@ -1009,6 +1011,7 @@ BOOL LLViewerWindow::handleActivate(LLWindow *window, BOOL activated) else { mActive = FALSE; + if (gSavedSettings.getBOOL("AllowIdleAFK")) { gAgent.setAFK(); @@ -1415,10 +1418,12 @@ void LLViewerWindow::initBase() // placeholder widget that controls where "world" is rendered mWorldViewPlaceholder = main_view->getChildView("world_view_rect")->getHandle(); + mNonSideTrayView = main_view->getChildView("non_side_tray_view")->getHandle(); + mFloaterViewHolder = main_view->getChildView("floater_view_holder")->getHandle(); // Constrain floaters to inside the menu and status bar regions. - gFloaterView = getRootView()->getChild<LLFloaterView>("Floater View"); - gSnapshotFloaterView = getRootView()->getChild<LLSnapshotFloaterView>("Snapshot Floater View"); + gFloaterView = main_view->getChild<LLFloaterView>("Floater View"); + gSnapshotFloaterView = main_view->getChild<LLSnapshotFloaterView>("Snapshot Floater View"); // Console llassert( !gConsole ); @@ -3240,8 +3245,7 @@ LLPickInfo LLViewerWindow::pickImmediate(S32 x, S32 y_from_bot, BOOL pick_trans } else { - llwarns << "List of last picks is empty" << llendl; - llwarns << "Using stub pick" << llendl; + lldebugs << "List of last picks is empty: Using stub pick" << llendl; mLastPick = LLPickInfo(); } @@ -4546,7 +4550,7 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size, LLSD args; args["RESX"] = llformat("%d",size.mX); args["RESY"] = llformat("%d",size.mY); - LLNotifications::instance().add("ResolutionSwitchFail", args); + LLNotificationsUtil::add("ResolutionSwitchFail", args); size = old_size; // for reshape below } diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 747fd3b253..1d564a1338 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -298,7 +298,8 @@ public: void updateKeyboardFocus(); void updateWorldViewRect(bool use_full_window=false); - + LLView* getNonSideTrayView() { return mNonSideTrayView.get(); } + LLView* getFloaterViewHolder() { return mFloaterViewHolder.get(); } BOOL handleKey(KEY key, MASK mask); void handleScrollWheel (S32 clicks); @@ -459,6 +460,8 @@ protected: std::string mInitAlert; // Window / GL initialization requires an alert LLHandle<LLView> mWorldViewPlaceholder; // widget that spans the portion of screen dedicated to rendering the 3d world + LLHandle<LLView> mNonSideTrayView; // parent of world view + bottom bar, etc...everything but the side tray + LLHandle<LLView> mFloaterViewHolder; // container for floater_view class LLDebugText* mDebugText; // Internal class for debug text diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9882dcd6af..93b0ad4a5b 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3621,6 +3621,16 @@ void LLVOAvatar::updateVisibility() mVisible = visible; } +// private +bool LLVOAvatar::shouldAlphaMask() +{ + const bool should_alpha_mask = mSupportsAlphaLayers && !LLDrawPoolAlpha::sShowDebugAlpha // Don't alpha mask if "Highlight Transparent" checked + && !LLDrawPoolAvatar::sSkipTransparent; + + return should_alpha_mask; + +} + //----------------------------------------------------------------------------- // renderSkinned() //----------------------------------------------------------------------------- @@ -3754,9 +3764,8 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) if (pass == AVATAR_RENDER_PASS_SINGLE) { - const bool should_alpha_mask = mSupportsAlphaLayers && !LLDrawPoolAlpha::sShowDebugAlpha // Don't alpha mask if "Highlight Transparent" checked - && !LLDrawPoolAvatar::sSkipTransparent; + bool should_alpha_mask = shouldAlphaMask(); LLGLState test(GL_ALPHA_TEST, should_alpha_mask); if (should_alpha_mask) @@ -3868,11 +3877,21 @@ U32 LLVOAvatar::renderRigid() return 0; } + bool should_alpha_mask = shouldAlphaMask(); + LLGLState test(GL_ALPHA_TEST, should_alpha_mask); + + if (should_alpha_mask) + { + gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); + } + if (isTextureVisible(TEX_EYES_BAKED) || mIsDummy) { num_indices += mMeshLOD[MESH_ID_EYEBALL_LEFT]->render(mAdjustedPixelArea, TRUE, mIsDummy); num_indices += mMeshLOD[MESH_ID_EYEBALL_RIGHT]->render(mAdjustedPixelArea, TRUE, mIsDummy); } + + gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); return num_indices; } @@ -5943,6 +5962,9 @@ void LLVOAvatar::updateMeshTextures() } + // Turn on alpha masking correctly for yourself and other avatars on 1.23+ + mSupportsAlphaLayers = isSelf() || is_layer_baked[BAKED_HAIR]; + // Baked textures should be requested from the sim this avatar is on. JC const LLHost target_host = getObjectHost(); if (!target_host.isOk()) @@ -5980,8 +6002,7 @@ void LLVOAvatar::updateMeshTextures() } } else if (mBakedTextureDatas[i].mTexLayerSet - && !other_culled - && (i != BAKED_HAIR || is_layer_baked[i] || isSelf())) // ! BACKWARDS COMPATIBILITY ! workaround for old viewers. + && !other_culled) { mBakedTextureDatas[i].mTexLayerSet->createComposite(); mBakedTextureDatas[i].mTexLayerSet->setUpdatesEnabled( TRUE ); @@ -5992,9 +6013,10 @@ void LLVOAvatar::updateMeshTextures() } } } - - // ! BACKWARDS COMPATIBILITY ! - // Workaround for viewing avatars from old viewers that haven't baked hair textures. + + // set texture and color of hair manually if we are not using a baked image. + // This can happen while loading hair for yourself, or for clients that did not + // bake a hair texture. Still needed for yourself after 1.22 is depricated. if (!is_layer_baked[BAKED_HAIR] || self_customizing) { const LLColor4 color = mTexHairColor ? mTexHairColor->getColor() : LLColor4(1,1,1,1); @@ -6006,8 +6028,6 @@ void LLVOAvatar::updateMeshTextures() } } - // Turn on alpha masking correctly for yourself and other avatars on 1.23+ - mSupportsAlphaLayers = isSelf() || is_layer_baked[BAKED_HAIR]; for (LLVOAvatarDictionary::BakedTextures::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin(); baked_iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end(); @@ -6510,7 +6530,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } - if( !mFirstTEMessageReceived ) + if( !is_first_appearance_message ) { onFirstTEMessageReceived(); } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 4b3e850e7a..a5815df20a 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -347,6 +347,8 @@ public: BOOL mIsDummy; // for special views S32 mSpecialRenderMode; // special lighting private: + bool shouldAlphaMask(); + BOOL mNeedsSkin; // avatar has been animated and verts have not been updated S32 mUpdatePeriod; S32 mNumInitFaces; //number of faces generated when creating the avatar drawable, does not inculde splitted faces due to long vertex buffer. diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index f3e787ae7e..7d6401acde 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -918,9 +918,9 @@ void LLVOAvatarSelf::updateAttachmentVisibility(U32 camera_mode) //----------------------------------------------------------------------------- // updatedWearable( EWearableType type ) // forces an update to any baked textures relevant to type. -// Should be called only on saving the wearable +// will force an upload of the resulting bake if the second parameter is TRUE //----------------------------------------------------------------------------- -void LLVOAvatarSelf::wearableUpdated( EWearableType type ) +void LLVOAvatarSelf::wearableUpdated( EWearableType type, BOOL upload_result ) { for (LLVOAvatarDictionary::BakedTextures::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin(); baked_iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end(); @@ -939,7 +939,7 @@ void LLVOAvatarSelf::wearableUpdated( EWearableType type ) { if (mBakedTextureDatas[index].mTexLayerSet) { - invalidateComposite(mBakedTextureDatas[index].mTexLayerSet, TRUE); + invalidateComposite(mBakedTextureDatas[index].mTexLayerSet, upload_result); } break; } diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index e376e5e9ef..6bf4ef5496 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -270,7 +270,7 @@ protected: public: /*virtual*/ BOOL isWearingWearableType(EWearableType type) const; - void wearableUpdated(EWearableType type); + void wearableUpdated(EWearableType type, BOOL upload_result); protected: U32 getNumWearables(LLVOAvatarDefines::ETextureIndex i) const; diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index f33a5cc818..e311f07912 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -38,7 +38,7 @@ #include "llviewercontrol.h" #include "llagent.h" -#include "llnotifications.h" +#include "llnotificationsutil.h" #include "lldrawable.h" #include "llface.h" #include "llsky.h" @@ -211,7 +211,7 @@ void LLVOGrass::initClass() { LLSD args; args["SPECIES"] = err; - LLNotifications::instance().add("ErrorUndefinedGrasses", args); + LLNotificationsUtil::add("ErrorUndefinedGrasses", args); } for (S32 i = 0; i < GRASS_MAX_BLADES; ++i) diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 8f63df8c29..608060174a 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -37,6 +37,7 @@ #include "llfloaterreg.h" #include "llimview.h" #include "llnotifications.h" +#include "llnotificationsutil.h" #include "llpanel.h" #include "llrecentpeople.h" #include "llviewercontrol.h" @@ -81,13 +82,13 @@ void LLVoiceCallCapResponder::error(U32 status, const std::string& reason) if ( 403 == status ) { //403 == no ability - LLNotifications::instance().add( + LLNotificationsUtil::add( "VoiceNotAllowed", channelp->getNotifyArgs()); } else { - LLNotifications::instance().add( + LLNotificationsUtil::add( "VoiceCallGenericError", channelp->getNotifyArgs()); } @@ -159,13 +160,13 @@ void LLVoiceChannel::setChannelInfo( { if (mURI.empty()) { - LLNotifications::instance().add("VoiceChannelJoinFailed", mNotifyArgs); + LLNotificationsUtil::add("VoiceChannelJoinFailed", mNotifyArgs); llwarns << "Received empty URI for channel " << mSessionName << llendl; deactivate(); } else if (mCredentials.empty()) { - LLNotifications::instance().add("VoiceChannelJoinFailed", mNotifyArgs); + LLNotificationsUtil::add("VoiceChannelJoinFailed", mNotifyArgs); llwarns << "Received empty credentials for channel " << mSessionName << llendl; deactivate(); } @@ -209,7 +210,7 @@ void LLVoiceChannel::handleStatusChange(EStatusType type) { case STATUS_LOGIN_RETRY: //mLoginNotificationHandle = LLNotifyBox::showXml("VoiceLoginRetry")->getHandle(); - LLNotifications::instance().add("VoiceLoginRetry"); + LLNotificationsUtil::add("VoiceLoginRetry"); break; case STATUS_LOGGED_IN: //if (!mLoginNotificationHandle.isDead()) @@ -227,7 +228,7 @@ void LLVoiceChannel::handleStatusChange(EStatusType type) { // if forceably removed from channel // update the UI and revert to default channel - LLNotifications::instance().add("VoiceChannelDisconnected", mNotifyArgs); + LLNotificationsUtil::add("VoiceChannelDisconnected", mNotifyArgs); deactivate(); } mIgnoreNextSessionLeave = FALSE; @@ -407,28 +408,6 @@ void LLVoiceChannel::doSetState(const EState& new_state) mStateChangedCallback(old_state, mState); } -void LLVoiceChannel::toggleCallWindowIfNeeded(EState state) -{ - LLFloaterCall* floater = dynamic_cast<LLFloaterCall*>(LLFloaterReg::getInstance("voice_call", mSessionID)); - if (!floater) - return; - - if (state == STATE_CONNECTED) - { - floater->init(mSessionID); - floater->openFloater(mSessionID); - } - // By checking that current state is CONNECTED we make sure that the call window - // has been shown, hence there's something to hide. This helps when user presses - // the "End call" button right after initiating the call. - // *TODO: move this check to LLFloaterCall? - else if (state == STATE_HUNG_UP && mState == STATE_CONNECTED) - { - floater->reset(); - floater->closeFloater(); - } -} - //static void LLVoiceChannel::initClass() { @@ -619,7 +598,7 @@ void LLVoiceChannelGroup::handleError(EStatusType status) // notification if (!notify.empty()) { - LLNotificationPtr notification = LLNotifications::instance().add(notify, mNotifyArgs); + LLNotificationPtr notification = LLNotificationsUtil::add(notify, mNotifyArgs); // echo to im window gIMMgr->addMessage(mSessionID, LLUUID::null, SYSTEM_FROM, notification->getMessage()); } @@ -629,9 +608,6 @@ void LLVoiceChannelGroup::handleError(EStatusType status) void LLVoiceChannelGroup::setState(EState state) { - // HACK: Open/close the call window if needed. - toggleCallWindowIfNeeded(state); - switch(state) { case STATE_RINGING: @@ -725,7 +701,7 @@ void LLVoiceChannelProximal::handleError(EStatusType status) // notification if (!notify.empty()) { - LLNotifications::instance().add(notify, mNotifyArgs); + LLNotificationsUtil::add(notify, mNotifyArgs); } LLVoiceChannel::handleError(status); @@ -749,6 +725,8 @@ LLVoiceChannelP2P::LLVoiceChannelP2P(const LLUUID& session_id, const std::string mReceivedCall(FALSE) { // make sure URI reflects encoded version of other user's agent id + // *NOTE: in case of Avaline call generated SIP URL will be incorrect. + // But it will be overridden in LLVoiceChannelP2P::setSessionHandle() called when agent accepts call setURI(LLVoiceClient::getInstance()->sipURIFromID(other_user_id)); } @@ -765,12 +743,12 @@ void LLVoiceChannelP2P::handleStatusChange(EStatusType type) if (mState == STATE_RINGING) { // other user declined call - LLNotifications::instance().add("P2PCallDeclined", mNotifyArgs); + LLNotificationsUtil::add("P2PCallDeclined", mNotifyArgs); } else { // other user hung up - LLNotifications::instance().add("VoiceChannelDisconnectedP2P", mNotifyArgs); + LLNotificationsUtil::add("VoiceChannelDisconnectedP2P", mNotifyArgs); } deactivate(); } @@ -788,7 +766,7 @@ void LLVoiceChannelP2P::handleError(EStatusType type) switch(type) { case ERROR_NOT_AVAILABLE: - LLNotifications::instance().add("P2PCallNoAnswer", mNotifyArgs); + LLNotificationsUtil::add("P2PCallNoAnswer", mNotifyArgs); break; default: break; @@ -866,6 +844,10 @@ void LLVoiceChannelP2P::setSessionHandle(const std::string& handle, const std::s } else { + LL_WARNS("Voice") << "incoming SIP URL is not provided. Channel may not work properly." << LL_ENDL; + // In case of incoming AvaLine call generated URI will be differ from original one. + // This is because Avatar-2-Avatar URI is based on avatar UUID but Avaline is not. + // See LLVoiceClient::sessionAddedEvent() -> setUUIDFromStringHash() setURI(LLVoiceClient::getInstance()->sipURIFromID(mOtherUserID)); } @@ -879,9 +861,6 @@ void LLVoiceChannelP2P::setSessionHandle(const std::string& handle, const std::s void LLVoiceChannelP2P::setState(EState state) { - // *HACK: Open/close the call window if needed. - toggleCallWindowIfNeeded(state); - llinfos << "P2P CALL STATE CHANGE: incoming=" << int(mReceivedCall) << " oldstate=" << mState << " newstate=" << state << llendl; if (mReceivedCall) // incoming call diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h index 639585de55..1bed329ba2 100644 --- a/indra/newview/llvoicechannel.h +++ b/indra/newview/llvoicechannel.h @@ -52,7 +52,7 @@ public: STATE_CONNECTED } EState; - typedef boost::function<void(const EState& old_state, const EState& new_state)> state_changed_callback_t; + typedef boost::signals2::signal<void(const EState& old_state, const EState& new_state)> state_changed_signal_t; // on current channel changed signal typedef boost::function<void(const LLUUID& session_id)> channel_changed_callback_t; @@ -78,7 +78,8 @@ public: virtual BOOL callStarted(); const std::string& getSessionName() const { return mSessionName; } - void setStateChangedCallback(state_changed_callback_t callback) { mStateChangedCallback = callback; } + boost::signals2::connection setStateChangedCallback(const state_changed_signal_t::slot_type& callback) + { return mStateChangedCallback.connect(callback); } const LLUUID getSessionID() { return mSessionID; } EState getState() { return mState; } @@ -100,7 +101,6 @@ protected: * Use this method if you want mStateChangedCallback to be executed while state is changed */ void doSetState(const EState& state); - void toggleCallWindowIfNeeded(EState state); void setURI(std::string uri); std::string mURI; @@ -124,7 +124,7 @@ protected: static BOOL sSuspended; private: - state_changed_callback_t mStateChangedCallback; + state_changed_signal_t mStateChangedCallback; }; class LLVoiceChannelGroup : public LLVoiceChannel @@ -175,6 +175,9 @@ public: void setSessionHandle(const std::string& handle, const std::string &inURI); + // returns TRUE if call is incoming and FALSE otherwise + BOOL isIncomingCall() { return mReceivedCall; } + protected: virtual void setState(EState state); diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 479cf5a04d..7e1e7c940f 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -35,8 +35,11 @@ #include <boost/tokenizer.hpp> +// library includes +#include "llnotificationsutil.h" #include "llsdutil.h" +// project includes #include "llvoavatar.h" #include "llbufferstream.h" #include "llfile.h" @@ -60,6 +63,7 @@ #include "llparcel.h" #include "llviewerparcelmgr.h" #include "llfirstuse.h" +#include "lltrans.h" #include "llviewerwindow.h" #include "llviewercamera.h" #include "llvoavatarself.h" @@ -1158,11 +1162,12 @@ LLVoiceClient::LLVoiceClient() : mVoiceEnabled(false), mWriteInProgress(false), - mLipSyncEnabled(false), - mAPIVersion("Unknown") + mLipSyncEnabled(false) { gVoiceClient = this; + mAPIVersion = LLTrans::getString("NotConnected"); + #if LL_DARWIN || LL_LINUX || LL_SOLARIS // HACK: THIS DOES NOT BELONG HERE // When the vivox daemon dies, the next write attempt on our socket generates a SIGPIPE, which kills us. @@ -7051,7 +7056,7 @@ class LLViewerRequiredVoiceVersion : public LLHTTPNode if (!sAlertedUser) { //sAlertedUser = TRUE; - LLNotifications::instance().add("VoiceVersionMismatch"); + LLNotificationsUtil::add("VoiceVersionMismatch"); gSavedSettings.setBOOL("EnableVoiceChat", FALSE); // toggles listener } } diff --git a/indra/newview/llvoicevisualizer.cpp b/indra/newview/llvoicevisualizer.cpp index e777d7362f..4794cab32e 100644 --- a/indra/newview/llvoicevisualizer.cpp +++ b/indra/newview/llvoicevisualizer.cpp @@ -369,8 +369,9 @@ void LLVoiceVisualizer::render() //------------------------------------------------------------- // create coordinates of the geometry for the dot //------------------------------------------------------------- - LLVector3 l = LLViewerCamera::getInstance()->getLeftAxis() * DOT_SIZE; - LLVector3 u = LLViewerCamera::getInstance()->getUpAxis() * DOT_SIZE; + LLViewerCamera* camera = LLViewerCamera::getInstance(); + LLVector3 l = camera->getLeftAxis() * DOT_SIZE; + LLVector3 u = camera->getUpAxis() * DOT_SIZE; LLVector3 bottomLeft = mSoundSymbol.mPosition + l - u; LLVector3 bottomRight = mSoundSymbol.mPosition - l - u; @@ -496,8 +497,8 @@ void LLVoiceVisualizer::render() F32 width = i * WAVE_WIDTH_SCALE * mSoundSymbol.mWaveExpansion[i]; F32 height = i * WAVE_HEIGHT_SCALE * mSoundSymbol.mWaveExpansion[i]; - LLVector3 l = LLViewerCamera::getInstance()->getLeftAxis() * width; - LLVector3 u = LLViewerCamera::getInstance()->getUpAxis() * height; + LLVector3 l = camera->getLeftAxis() * width; + LLVector3 u = camera->getUpAxis() * height; LLVector3 bottomLeft = mSoundSymbol.mPosition + l - u; LLVector3 bottomRight = mSoundSymbol.mPosition - l - u; diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 9dd0b598dc..139d2fbd88 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -386,6 +386,7 @@ void LLParticlePartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_co mFaceList.clear(); + LLViewerCamera* camera = LLViewerCamera::getInstance(); for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i) { LLDrawable* drawablep = *i; @@ -415,7 +416,7 @@ void LLParticlePartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_co } count++; - facep->mDistance = (facep->mCenterLocal - LLViewerCamera::getInstance()->getOrigin()) * LLViewerCamera::getInstance()->getAtAxis(); + facep->mDistance = (facep->mCenterLocal - camera->getOrigin()) * camera->getAtAxis(); obj->mDepth += facep->mDistance; mFaceList.push_back(facep); diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 235e10f716..24f1c4bd24 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -55,7 +55,7 @@ #include "noise.h" #include "pipeline.h" #include "llspatialpartition.h" -#include "llnotifications.h" +#include "llnotificationsutil.h" extern LLPipeline gPipeline; @@ -257,7 +257,7 @@ void LLVOTree::initClass() { LLSD args; args["SPECIES"] = err; - LLNotifications::instance().add("ErrorUndefinedTrees", args); + LLNotificationsUtil::add("ErrorUndefinedTrees", args); } }; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index a67624197a..7debfb9186 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -632,6 +632,7 @@ void LLVOVolume::updateTextureVirtualSize() const S32 num_faces = mDrawable->getNumFaces(); F32 min_vsize=999999999.f, max_vsize=0.f; + LLViewerCamera* camera = LLViewerCamera::getInstance(); for (S32 i = 0; i < num_faces; i++) { LLFace* face = mDrawable->getFace(i); @@ -648,7 +649,7 @@ void LLVOVolume::updateTextureVirtualSize() if (isHUDAttachment()) { - F32 area = (F32) LLViewerCamera::getInstance()->getScreenPixelArea(); + F32 area = (F32) camera->getScreenPixelArea(); vsize = area; imagep->setBoostLevel(LLViewerTexture::BOOST_HUD); face->setPixelArea(area); // treat as full screen @@ -719,9 +720,9 @@ void LLVOVolume::updateTextureVirtualSize() //if the sculpty very close to the view point, load first { - LLVector3 lookAt = getPositionAgent() - LLViewerCamera::getInstance()->getOrigin(); + LLVector3 lookAt = getPositionAgent() - camera->getOrigin(); F32 dist = lookAt.normVec() ; - F32 cos_angle_to_view_dir = lookAt * LLViewerCamera::getInstance()->getXAxis() ; + F32 cos_angle_to_view_dir = lookAt * camera->getXAxis() ; mSculptTexture->setAdditionalDecodePriority(0.8f * LLFace::calcImportanceToCamera(cos_angle_to_view_dir, dist)) ; } } @@ -757,7 +758,7 @@ void LLVOVolume::updateTextureVirtualSize() F32 rad = getLightRadius(); mLightTexture->addTextureStats(gPipeline.calcPixelArea(getPositionAgent(), LLVector3(rad,rad,rad), - *LLViewerCamera::getInstance())); + *camera)); } } @@ -1179,6 +1180,20 @@ void LLVOVolume::regenFaces() facep->setTEOffset(i); facep->setTexture(getTEImage(i)); facep->setViewerObject(this); + + // If the face had media on it, this will have broken the link between the LLViewerMediaTexture and the face. + // Re-establish the link. + if((int)mMediaImplList.size() > i) + { + if(mMediaImplList[i]) + { + LLViewerMediaTexture* media_tex = LLViewerTextureManager::findMediaTexture(mMediaImplList[i]->getMediaTextureID()) ; + if(media_tex) + { + media_tex->addMediaToFace(facep) ; + } + } + } } if (!count_changed) diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index d92da4ef44..0405b9d28b 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -36,6 +36,7 @@ #include "llagentwearables.h" #include "llfloatercustomize.h" #include "lllocaltextureobject.h" +#include "llnotificationsutil.h" #include "llviewertexturelist.h" #include "llinventorymodel.h" #include "llinventoryobserver.h" @@ -703,7 +704,7 @@ void LLWearable::removeFromAvatar( EWearableType type, BOOL upload_bake ) } avatar->updateVisualParams(); - avatar->wearableUpdated(type); + avatar->wearableUpdated(type, TRUE); // if( upload_bake ) // { @@ -1093,6 +1094,16 @@ void LLWearable::setLabelUpdated() const gInventory.addChangedMask(LLInventoryObserver::LABEL, getItemID()); } +void LLWearable::refreshName() +{ + LLUUID item_id = getItemID(); + LLInventoryItem* item = gInventory.getItem(item_id); + if( item ) + { + mName = item->getName(); + } +} + struct LLWearableSaveData { EWearableType mType; @@ -1122,7 +1133,7 @@ void LLWearable::saveNewAsset() const LLSD args; args["NAME"] = mName; - LLNotifications::instance().add("CannotSaveWearableOutOfSpace", args); + LLNotificationsUtil::add("CannotSaveWearableOutOfSpace", args); return; } @@ -1170,7 +1181,7 @@ void LLWearable::onSaveNewAssetComplete(const LLUUID& new_asset_id, void* userda llwarns << buffer << " Status: " << status << llendl; LLSD args; args["NAME"] = type_name; - LLNotifications::instance().add("CannotSaveToAssetStore", args); + LLNotificationsUtil::add("CannotSaveToAssetStore", args); } // Delete temp file diff --git a/indra/newview/llwearable.h b/indra/newview/llwearable.h index 43ffa12420..82d388ab7e 100644 --- a/indra/newview/llwearable.h +++ b/indra/newview/llwearable.h @@ -133,6 +133,10 @@ public: // Something happened that requires the wearable's label to be updated (e.g. worn/unworn). void setLabelUpdated() const; + // the wearable was worn. make sure the name of the wearable object matches the LLViewerInventoryItem, + // not the wearable asset itself. + void refreshName(); + private: typedef std::map<S32, LLLocalTextureObject*> te_map_t; typedef std::map<S32, LLVisualParam *> visual_param_index_map_t; diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index 9bde85dcaf..31047413ef 100644 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -40,6 +40,7 @@ #include "llvoavatar.h" #include "llviewerinventory.h" #include "llviewerstats.h" +#include "llnotificationsutil.h" #include "llnotify.h" #include "llinventorymodel.h" #include "lltrans.h" @@ -187,16 +188,16 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID args["TYPE"] =LLTrans::getString(LLAssetType::lookupHumanReadable(data->mAssetType)); if (isNewWearable) { - LLNotifications::instance().add("InvalidWearable"); + LLNotificationsUtil::add("InvalidWearable"); } else if (data->mName.empty()) { - LLNotifications::instance().add("FailedToFindWearableUnnamed", args); + LLNotificationsUtil::add("FailedToFindWearableUnnamed", args); } else { args["DESC"] = data->mName; - LLNotifications::instance().add("FailedToFindWearable", args); + LLNotificationsUtil::add("FailedToFindWearable", args); } } // Always call callback; wearable will be NULL if we failed diff --git a/indra/newview/llwldaycycle.cpp b/indra/newview/llwldaycycle.cpp index 7f0c1a13f3..fcc43c2b1f 100644 --- a/indra/newview/llwldaycycle.cpp +++ b/indra/newview/llwldaycycle.cpp @@ -35,7 +35,7 @@ #include "llwldaycycle.h" #include "llsdserialize.h" #include "llwlparammanager.h" -#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llxmlnode.h" #include <map> @@ -85,7 +85,7 @@ void LLWLDayCycle::loadDayCycle(const std::string & fileName) // alert the user LLSD args; args["SKY"] = day_data[i][1].asString(); - LLNotifications::instance().add("WLMissingSky", args); + LLNotificationsUtil::add("WLMissingSky", args); continue; } diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 60b1e59645..e6857ea780 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -1728,20 +1728,20 @@ BOOL LLWorldMapView::handleDoubleClick( S32 x, S32 y, MASK mask ) id.toString(uuid_str); uuid_str = uuid_str.substr(28); sscanf(uuid_str.c_str(), "%X", &event_id); - LLFloaterReg::showInstance("search", LLSD().insert("category", "events").insert("id", event_id)); + LLFloaterReg::showInstance("search", LLSD().with("category", "events").with("id", event_id)); break; } case MAP_ITEM_LAND_FOR_SALE: case MAP_ITEM_LAND_FOR_SALE_ADULT: { LLFloaterReg::hideInstance("world_map"); - LLFloaterReg::showInstance("search", LLSD().insert("category", "destinations").insert("id", id)); + LLFloaterReg::showInstance("search", LLSD().with("category", "destinations").with("id", id)); break; } case MAP_ITEM_CLASSIFIED: { LLFloaterReg::hideInstance("world_map"); - LLFloaterReg::showInstance("search", LLSD().insert("category", "classifieds").insert("id", id)); + LLFloaterReg::showInstance("search", LLSD().with("category", "classifieds").with("id", id)); break; } default: diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index f2087ef16c..610804c5eb 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3764,9 +3764,10 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects, BOOL render gGL.setColorMask(true, false); gPipeline.resetDrawOrders(); + LLViewerCamera* camera = LLViewerCamera::getInstance(); for (std::set<LLViewerObject*>::iterator iter = objects.begin(); iter != objects.end(); ++iter) { - stateSort((*iter)->mDrawable, *LLViewerCamera::getInstance()); + stateSort((*iter)->mDrawable, *camera); } LLMemType mt(LLMemType::MTYPE_PIPELINE_RENDER_SELECT); @@ -6250,6 +6251,7 @@ void LLPipeline::renderDeferredLighting() { LLFastTimer ftm(FTM_RENDER_DEFERRED); + LLViewerCamera* camera = LLViewerCamera::getInstance(); { LLGLDepthTest depth(GL_TRUE); mDeferredDepth.copyContents(mDeferredScreen, 0, 0, mDeferredScreen.getWidth(), mDeferredScreen.getHeight(), @@ -6643,7 +6645,7 @@ void LLPipeline::renderDeferredLighting() continue; } - if (LLViewerCamera::getInstance()->AABBInFrustumNoFarClip(center, LLVector3(s,s,s)) == 0) + if (camera->AABBInFrustumNoFarClip(center, LLVector3(s,s,s)) == 0) { continue; } @@ -6667,12 +6669,12 @@ void LLPipeline::renderDeferredLighting() v[18] = c[0]+s; v[19] = c[1]+s; v[20] = c[2]-s; // 6 - 0110 v[21] = c[0]+s; v[22] = c[1]+s; v[23] = c[2]+s; // 7 - 0111 - if (LLViewerCamera::getInstance()->getOrigin().mV[0] > c[0] + s + 0.2f || - LLViewerCamera::getInstance()->getOrigin().mV[0] < c[0] - s - 0.2f || - LLViewerCamera::getInstance()->getOrigin().mV[1] > c[1] + s + 0.2f || - LLViewerCamera::getInstance()->getOrigin().mV[1] < c[1] - s - 0.2f || - LLViewerCamera::getInstance()->getOrigin().mV[2] > c[2] + s + 0.2f || - LLViewerCamera::getInstance()->getOrigin().mV[2] < c[2] - s - 0.2f) + if (camera->getOrigin().mV[0] > c[0] + s + 0.2f || + camera->getOrigin().mV[0] < c[0] - s - 0.2f || + camera->getOrigin().mV[1] > c[1] + s + 0.2f || + camera->getOrigin().mV[1] < c[1] - s - 0.2f || + camera->getOrigin().mV[2] > c[2] + s + 0.2f || + camera->getOrigin().mV[2] < c[2] - s - 0.2f) { //draw box if camera is outside box if (render_local) { @@ -6687,7 +6689,7 @@ void LLPipeline::renderDeferredLighting() glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], s*s); glColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f); glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8, - GL_UNSIGNED_BYTE, get_box_fan_indices(LLViewerCamera::getInstance(), center)); + GL_UNSIGNED_BYTE, get_box_fan_indices(camera, center)); stop_glerror(); } } @@ -6752,7 +6754,7 @@ void LLPipeline::renderDeferredLighting() glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], s*s); glColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f); glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8, - GL_UNSIGNED_BYTE, get_box_fan_indices(LLViewerCamera::getInstance(), center)); + GL_UNSIGNED_BYTE, get_box_fan_indices(camera, center)); } gDeferredSpotLightProgram.disableTexture(LLViewerShaderMgr::DEFERRED_PROJECTION); unbindDeferredShader(gDeferredSpotLightProgram); @@ -7207,6 +7209,10 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); glClearColor(0,0,0,0); mWaterRef.bindTarget(); + gGL.setColorMask(true, true); + mWaterRef.clear(); + gGL.setColorMask(true, false); + mWaterRef.getViewport(gGLViewport); stop_glerror(); @@ -7239,6 +7245,21 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) U32 ref_mask = 0; if (LLDrawPoolWater::sNeedsDistortionUpdate) { + //initial sky pass (no user clip plane) + { //mask out everything but the sky + U32 tmp = mRenderTypeMask; + mRenderTypeMask = tmp & ((1 << LLPipeline::RENDER_TYPE_SKY) | + (1 << LLPipeline::RENDER_TYPE_WL_SKY)); + static LLCullResult result; + updateCull(camera, result); + stateSort(camera, result); + mRenderTypeMask = tmp & ((1 << LLPipeline::RENDER_TYPE_SKY) | + (1 << LLPipeline::RENDER_TYPE_CLOUDS) | + (1 << LLPipeline::RENDER_TYPE_WL_SKY)); + renderGeom(camera, TRUE); + mRenderTypeMask = tmp; + } + U32 mask = mRenderTypeMask; mRenderTypeMask &= ~((1<<LLPipeline::RENDER_TYPE_WATER) | (1<<LLPipeline::RENDER_TYPE_GROUND) | @@ -7276,22 +7297,6 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) mRenderTypeMask = mask; } - //initial sky pass (no user clip plane) - { //mask out everything but the sky - U32 tmp = mRenderTypeMask; - mRenderTypeMask = tmp & ((1 << LLPipeline::RENDER_TYPE_SKY) | - (1 << LLPipeline::RENDER_TYPE_WL_SKY)); - static LLCullResult result; - updateCull(camera, result); - stateSort(camera, result); - mRenderTypeMask = tmp & ((1 << LLPipeline::RENDER_TYPE_SKY) | - (1 << LLPipeline::RENDER_TYPE_CLOUDS) | - (1 << LLPipeline::RENDER_TYPE_WL_SKY)); - renderGeom(camera, TRUE); - mRenderTypeMask = tmp; - } - - if (LLDrawPoolWater::sNeedsDistortionUpdate) { mRenderTypeMask = ref_mask; @@ -8698,7 +8703,8 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) sShadowRender = TRUE; sImpostorRender = TRUE; - markVisible(avatar->mDrawable, *LLViewerCamera::getInstance()); + LLViewerCamera* viewer_camera = LLViewerCamera::getInstance(); + markVisible(avatar->mDrawable, *viewer_camera); LLVOAvatar::sUseImpostors = FALSE; LLVOAvatar::attachment_map_t::iterator iter; @@ -8713,7 +8719,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) { if (LLViewerObject* attached_object = (*attachment_iter)) { - markVisible(attached_object->mDrawable->getSpatialBridge(), *LLViewerCamera::getInstance()); + markVisible(attached_object->mDrawable->getSpatialBridge(), *viewer_camera); } } } @@ -8723,9 +8729,9 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) const LLVector3* ext = avatar->mDrawable->getSpatialExtents(); LLVector3 pos(avatar->getRenderPosition()+avatar->getImpostorOffset()); - LLCamera camera = *LLViewerCamera::getInstance(); + LLCamera camera = *viewer_camera; - camera.lookAt(LLViewerCamera::getInstance()->getOrigin(), pos, LLViewerCamera::getInstance()->getUpAxis()); + camera.lookAt(viewer_camera->getOrigin(), pos, viewer_camera->getUpAxis()); LLVector2 tdim; @@ -8768,7 +8774,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) glClearStencil(0); // get the number of pixels per angle - F32 pa = gViewerWindow->getWindowHeightRaw() / (RAD_TO_DEG * LLViewerCamera::getInstance()->getView()); + F32 pa = gViewerWindow->getWindowHeightRaw() / (RAD_TO_DEG * viewer_camera->getView()); //get resolution based on angle width and height of impostor (double desired resolution to prevent aliasing) U32 resY = llmin(nhpo2((U32) (fov*pa)), (U32) 512); diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index eb8ec00bb9..acb3262093 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -81,7 +81,7 @@ <color name="AgentChatColor" - reference="LtGray" /> + reference="White" /> <color name="AlertBoxColor" value="0.24 0.24 0.24 1" /> @@ -270,10 +270,10 @@ reference="White" /> <color name="FilterBackgroundColor" - reference="DkGray" /> + reference="MouseGray" /> <color name="FilterTextColor" - value="1 0.78 0.27 1" /> + value="0.38 0.69 0.57 1" /> <color name="FloaterButtonImageColor" reference="LtGray" /> @@ -459,7 +459,7 @@ value="0 0.5 0 1" /> <color name="MenuPopupBgColor" - reference="DkGray_66" /> + reference="DkGray2" /> <color name="MultiSliderDisabledThumbColor" reference="Unused?" /> @@ -669,7 +669,7 @@ reference="LtGray" /> <color name="UserChatColor" - reference="LtGray" /> + reference="White" /> <color name="llOwnerSayChatColor" reference="LtGray" /> @@ -684,5 +684,8 @@ <color name="SysWellItemSelected" value="0.3 0.3 0.3 1.0" /> + <color + name="ChatToastAgentNameColor" + reference="EmphasisColor" /> </colors> diff --git a/indra/newview/skins/default/textures/icon_event_adult.tga b/indra/newview/skins/default/textures/icon_event_adult.tga Binary files differindex c344fb1e78..f548126e5a 100644 --- a/indra/newview/skins/default/textures/icon_event_adult.tga +++ b/indra/newview/skins/default/textures/icon_event_adult.tga diff --git a/indra/newview/skins/default/textures/icon_top_pick.tga b/indra/newview/skins/default/textures/icon_top_pick.tga Binary files differindex 7fe119a818..0b34882d2f 100644 --- a/indra/newview/skins/default/textures/icon_top_pick.tga +++ b/indra/newview/skins/default/textures/icon_top_pick.tga diff --git a/indra/newview/skins/default/textures/icons/Inv_LinkFolder.png b/indra/newview/skins/default/textures/icons/Inv_LinkFolder.png Binary files differnew file mode 100644 index 0000000000..73a708782c --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Inv_LinkFolder.png diff --git a/indra/newview/skins/default/textures/icons/Inv_LinkItem.png b/indra/newview/skins/default/textures/icons/Inv_LinkItem.png Binary files differnew file mode 100644 index 0000000000..73a708782c --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Inv_LinkItem.png diff --git a/indra/newview/skins/default/textures/map_avatar_16.tga b/indra/newview/skins/default/textures/map_avatar_16.tga Binary files differindex ce129e3590..f59e9e9193 100644 --- a/indra/newview/skins/default/textures/map_avatar_16.tga +++ b/indra/newview/skins/default/textures/map_avatar_16.tga diff --git a/indra/newview/skins/default/textures/map_avatar_8.tga b/indra/newview/skins/default/textures/map_avatar_8.tga Binary files differindex 28552f2237..8500eadeba 100644 --- a/indra/newview/skins/default/textures/map_avatar_8.tga +++ b/indra/newview/skins/default/textures/map_avatar_8.tga diff --git a/indra/newview/skins/default/textures/map_event.tga b/indra/newview/skins/default/textures/map_event.tga Binary files differindex c229b379a2..2c06d08fd2 100644 --- a/indra/newview/skins/default/textures/map_event.tga +++ b/indra/newview/skins/default/textures/map_event.tga diff --git a/indra/newview/skins/default/textures/map_event_adult.tga b/indra/newview/skins/default/textures/map_event_adult.tga Binary files differindex c344fb1e78..f548126e5a 100644 --- a/indra/newview/skins/default/textures/map_event_adult.tga +++ b/indra/newview/skins/default/textures/map_event_adult.tga diff --git a/indra/newview/skins/default/textures/map_event_mature.tga b/indra/newview/skins/default/textures/map_event_mature.tga Binary files differindex 61c879bc92..71067c0dfd 100644 --- a/indra/newview/skins/default/textures/map_event_mature.tga +++ b/indra/newview/skins/default/textures/map_event_mature.tga diff --git a/indra/newview/skins/default/textures/map_home.tga b/indra/newview/skins/default/textures/map_home.tga Binary files differindex 7478de371a..acaaa3db44 100644 --- a/indra/newview/skins/default/textures/map_home.tga +++ b/indra/newview/skins/default/textures/map_home.tga diff --git a/indra/newview/skins/default/textures/map_infohub.tga b/indra/newview/skins/default/textures/map_infohub.tga Binary files differindex d0134fa5fe..545b8e532c 100644 --- a/indra/newview/skins/default/textures/map_infohub.tga +++ b/indra/newview/skins/default/textures/map_infohub.tga diff --git a/indra/newview/skins/default/textures/map_telehub.tga b/indra/newview/skins/default/textures/map_telehub.tga Binary files differindex ef63a3eb72..545b8e532c 100644 --- a/indra/newview/skins/default/textures/map_telehub.tga +++ b/indra/newview/skins/default/textures/map_telehub.tga diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index c473790d62..3cbaa8c6ca 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -1,19 +1,19 @@ <!-- This file contains metadata about how to load, display, and scale textures for rendering in the UI. -Images do *NOT* have to appear in this file in order to use them as textures in the UI...simply refer +Images do *NOT* have to appear in this file in order to use them as textures in the UI...simply refer to them by filename (relative to textures directory). -NOTE: if you want to reuse an image file with different metadata, simply create a new texture entry +NOTE: if you want to reuse an image file with different metadata, simply create a new texture entry with the same filename but different name <texture name="MyTexture" (mandatory) - this is the name you reference the texture by in XUI. For example, <button image_unselected="MyTexture"/> file_name="images/my_texture.png" (optional) - - this is the path to the actual file asset, relative to the current skins "textures" directory. - If not supplied, the filename will be taken from the texture name itself, "MyTexture" in this case. + - this is the path to the actual file asset, relative to the current skins "textures" directory. + If not supplied, the filename will be taken from the texture name itself, "MyTexture" in this case. NOTE: you need to provide an extension on the filename (".png", ".tga", ".jpg") for us to decode the image properly preload="true" (optional, false by default) - - If true, we will attempt to load the image before displaying any UI. + - If true, we will attempt to load the image before displaying any UI. If false, we will load in the background after initializing the UI. use_mips="true" (currently unused) scale.left="1" @@ -23,8 +23,8 @@ with the same filename but different name - Specifies the segmentation for 9-slice image scaling. Specifically, the pixel offsets from the LOWER LEFT corner that define the region of the image that is stretched to make the whole image fit in the required space. In this example, if the source image is 32x16 pixels, we have defined a center region that starts one pixel up - and to the right from the bottom left corner and extends to 31 pixels right and 15 pixels up from the bottom left - corner. The end result is that the image will keep a 1 pixel border all around while stretching to fit the required + and to the right from the bottom left corner and extends to 31 pixels right and 15 pixels up from the bottom left + corner. The end result is that the image will keep a 1 pixel border all around while stretching to fit the required region. --> @@ -230,6 +230,8 @@ with the same filename but different name <texture name="Inv_Gesture" file_name="icons/Inv_Gesture.png" preload="false" /> <texture name="Inv_Gloves" file_name="icons/Inv_Gloves.png" preload="false" /> <texture name="Inv_Hair" file_name="icons/Inv_Hair.png" preload="false" /> + <texture name="Inv_LinkItem" file_name="icons/Inv_LinkItem.png" preload="false" /> + <texture name="Inv_LinkFolder" file_name="icons/Inv_LinkFolder.png" preload="false" /> <texture name="Inv_Jacket" file_name="icons/Inv_Jacket.png" preload="false" /> <texture name="Inv_LookFolderOpen" file_name="icons/Inv_LookFolderOpen.png" preload="false" /> <texture name="Inv_LookFolderClosed" file_name="icons/Inv_LookFolderClosed.png" preload="false" /> @@ -341,8 +343,8 @@ with the same filename but different name <texture name="parcel_drk_BuildNo" file_name="icons/parcel_drk_BuildNo.png" preload="false" /> <texture name="parcel_drk_Damage" file_name="icons/parcel_drk_Damage.png" preload="false" /> <texture name="parcel_drk_DamageNo" file_name="icons/parcel_drk_DamageNo.png" preload="false" /> - <texture name="parcel_drk_EVRY" file_name="icons/parcel_drk_EVRY.png" preload="false" /> - <texture name="parcel_drk_EXP" file_name="icons/parcel_drk_EXP.png" preload="false" /> + <texture name="parcel_drk_EVRY" file_name="icons/parcel_drk_EVRY.png" preload="false" /> + <texture name="parcel_drk_EXP" file_name="icons/parcel_drk_EXP.png" preload="false" /> <texture name="parcel_drk_Fly" file_name="icons/parcel_drk_Fly.png" preload="false" /> <texture name="parcel_drk_FlyNo" file_name="icons/parcel_drk_FlyNo.png" preload="false" /> <texture name="parcel_drk_ForSale" file_name="icons/parcel_drk_ForSale.png" preload="false" /> @@ -361,8 +363,8 @@ with the same filename but different name <texture name="parcel_lght_BuildNo" file_name="icons/parcel_lght_BuildNo.png" preload="false" /> <texture name="parcel_lght_Damage" file_name="icons/parcel_lght_Damage.png" preload="false" /> <texture name="parcel_lght_DamageNo" file_name="icons/parcel_lght_DamageNo.png" preload="false" /> - <texture name="parcel_lght_EVRY" file_name="icons/parcel_lght_EVRY.png" preload="false" /> - <texture name="parcel_lght_EXP" file_name="icons/parcel_lght_EXP.png" preload="false" /> + <texture name="parcel_lght_EVRY" file_name="icons/parcel_lght_EVRY.png" preload="false" /> + <texture name="parcel_lght_EXP" file_name="icons/parcel_lght_EXP.png" preload="false" /> <texture name="parcel_lght_Fly" file_name="icons/parcel_lght_Fly.png" preload="false" /> <texture name="parcel_lght_FlyNo" file_name="icons/parcel_lght_FlyNo.png" preload="false" /> <texture name="parcel_lght_ForSale" file_name="icons/parcel_lght_ForSale.png" preload="false" /> @@ -400,9 +402,12 @@ with the same filename but different name <texture name="ProgressBar" file_name="widgets/ProgressBar.png" preload="true" scale.left="4" scale.top="10" scale.right="48" scale.bottom="2" /> <texture name="ProgressTrack" file_name="widgets/ProgressTrack.png" preload="true" scale.left="4" scale.top="13" scale.right="148" scale.bottom="2" /> + <texture name="PushButton_Disabled" file_name="widgets/PushButton_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> <texture name="PushButton_Off" file_name="widgets/PushButton_Off.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> + <texture name="PushButton_On" file_name="widgets/PushButton_On.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> + <texture name="PushButton_On_Selected" file_name="widgets/PushButton_On_Selected.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> + <texture name="PushButton_On_Disabled" file_name="widgets/PushButton_On_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> <texture name="PushButton_Press" file_name="widgets/PushButton_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> - <texture name="PushButton_Disabled" file_name="widgets/PushButton_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> <texture name="PushButton_Selected" file_name="widgets/PushButton_Selected.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> <texture name="PushButton_Selected_Press" file_name="widgets/PushButton_Selected_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> <texture name="PushButton_Selected_Disabled" file_name="widgets/PushButton_Selected_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> @@ -483,6 +488,8 @@ with the same filename but different name <texture name="Snapshot_Over" file_name="bottomtray/Snapshot_Over.png" preload="false" /> <texture name="Snapshot_Press" file_name="bottomtray/Snapshot_Press.png" preload="false" /> + <texture name="startup_logo" file_name="windows/startup_logo.png" preload="true" /> + <texture name="Stepper_Down_Disabled" file_name="widgets/Stepper_Down_Disabled.png" preload="true" /> <texture name="Stepper_Down_Off" file_name="widgets/Stepper_Down_Off.png" preload="true" /> <texture name="Stepper_Down_Press" file_name="widgets/Stepper_Down_Press.png" preload="true" /> @@ -701,7 +708,6 @@ with the same filename but different name <texture name="tab_top_blue.tga" preload="false" scale.left="8" scale.top="8" scale.right="120" scale.bottom="9" /> <texture name="tab_top_selected_blue.tga" preload="false" scale.left="8" scale.top="8" scale.right="96" scale.bottom="9" /> - <texture name="startup_logo.j2c" preload="true" /> <texture name="color_swatch_alpha.tga" preload="true" /> <texture name="button_anim_pause.tga" /> diff --git a/indra/newview/skins/default/textures/windows/startup_logo.png b/indra/newview/skins/default/textures/windows/startup_logo.png Binary files differnew file mode 100644 index 0000000000..b89449692b --- /dev/null +++ b/indra/newview/skins/default/textures/windows/startup_logo.png diff --git a/indra/newview/skins/default/xui/da/floater_about.xml b/indra/newview/skins/default/xui/da/floater_about.xml index f0c9c45d04..cdf1915d5e 100644 --- a/indra/newview/skins/default/xui/da/floater_about.xml +++ b/indra/newview/skins/default/xui/da/floater_about.xml @@ -1,44 +1,81 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<floater name="floater_about" title="OM [APP_NAME]"> -<tab_container name="about_tab"> - <panel name="credits_panel"> - <text_editor name="credits_editor"> - Second Life er gjort muligt for dig af Philip, Tessa, Andrew, Cory, James, Ben, Char, Charlie, Colin, Dan, Daniel, Doug, Eric, Hamlet, Haney, Eve, Hunter, Ian, Jeff, Jennifer, Jim, John, Lee, Mark, Peter, Phoenix, Richard, Robin, Xenon, Steve, Tanya, Eddie, Avi, Frank, Bruce, Aaron, Alice, Bob, Debra, Eileen, Helen, Janet, Louie, Leviathania, Stefan, Ray, Kevin, Tom, Mikeb, MikeT, Burgess, Elena, Tracy, Bill, Todd, Ryan, Zach, Sarah, Nova, Tim, Stephanie, Michael, Evan, Nicolas, Catherine, Rachelle, Dave, Holly, Bub, Kelly, Magellan, Ramzi, Don, Sabin, Jill, Rheya, Jeska, Torley, Kona, Callum, Charity, Ventrella, Jack, Vektor, Iris, Chris, Nicole, Mick, Reuben, Blue, Babbage, Yedwab, Deana, Lauren, Brent, Pathfinder, Chadrick, Altruima, Jesse, Teeny, Monroe, Icculus, David, Tess, Lizzie, Patsy, Isaac, Lawrence, Cyn, Bo, Gia, Annette, Marius, Tbone, Jonathan, Karen, Ginsu, Satoko, Yuko, Makiko, Thomas, Harry, Seth, Alexei, Brian, Guy, Runitai, Ethan, Data, Cornelius, Kenny, Swiss, Zero, Natria, Wendy, Stephen, Teeple, Thumper, Lucy, Dee, Mia, Liana, Warren, Branka, Aura, beez, Milo, Hermia, Red, Thrax, Joe, Sally, Magenta, Mogura, Paul, Jose, Rejean, Henrik, Lexie, Amber, Logan, Xan, Nora, Morpheus, Donovan, Leyla, MichaelFrancis, Beast, Cube, Bucky, Joshua, Stryfe, Harmony, Teresa, Claudia, Walker, Glenn, Fritz, Fordak, June, Cleopetra, Jean, Ivy, Betsy, Roosevelt, Spike, Ken, Which, Tofu, Chiyo, Rob, Zee, dustin, George, Del, Matthew, Cat, Jacqui, Lightfoot, Adrian, Viola, Alfred, Noel, Irfan, Sunil, Yool, Rika, Jane, Xtreme, Frontier, a2, Neo, Siobhan, Yoz, Justin, Elle, Qarl, Benjamin, Isabel, Gulliver, Everett, Christopher, Izzy, Stephany, Garry, Sejong, Sean, Tobin, Iridium, Meta, Anthony, Jeremy, JP, Jake, Maurice, Madhavi, Leopard, Kyle, Joon, Kari, Bert, Belinda, Jon, Kristi, Bridie, Pramod, KJ, Socrates, Maria, Ivan, Aric, Yamasaki, Adreanne, Jay, MitchK, Ceren, Coco, Durl, Jenny, Periapse, Kartic, Storrs, Lotte, Sandy, Rohn, Colossus, Zen, BigPapi, Brad, Pastrami, Kurz, Mani, Neuro, Jaime, MJ, Rowan, Sgt, Elvis, Gecko, Samuel, Sardonyx, Leo, Bryan, Niko, Soft, Poppy, Rachel, Aki, Angelo, Banzai, Alexa, Sue, CeeLo, Bender, CG, Gillian, Pelle, Nick, Echo, Zara, Christine, Shamiran, Emma, Blake, Keiko, Plexus, Joppa, Sidewinder, Erica, Ashlei, Twilight, Kristen, Brett, Q, Enus, Simon, Bevis, Kraft, Kip, Chandler, Ron, LauraP, Ram, KyleJM, Scouse, Prospero, Melissa, Marty, Nat, Hamilton, Kend, Lordan, Jimmy, Kosmo, Seraph, Green, Ekim, Wiggo, JT, Rome, Doris, Miz, Benoc, Whump, Trinity, Patch, Kate, TJ, Bao, Joohwan, Christy, Sofia, Matias, Cogsworth, Johan, Oreh, Cheah, Angela, Brandy, Mango, Lan, Aleks, Gloria, Heidy, Mitchell, Space, Colton, Bambers, Einstein, Maggie, Malbers, Rose, Winnie, Stella, Milton, Rothman, Niall, Marin, Allison, Katie, Dawn, Katt, Dusty, Kalpana, Judy, Andrea, Ambroff, Infinity, Gail, Rico, Raymond, Yi, William, Christa, M, Teagan, Scout, Molly, Dante, Corr, Dynamike, Usi, Kaylee, Vidtuts, Lil, Danica, Sascha, Kelv, Jacob, Nya, Rodney, Brandon, Elsie, Blondin, Grant, Katrin, Nyx, Gabriel, Locklainn, Claire, Devin, Minerva, Monty, Austin, Bradford, Si, Keira, H, Caitlin, Dita, Makai, Jenn, Ann, Meredith, Clare, Joy, Praveen, Cody, Edmund, Ruthe, Sirena, Gayathri, Spider, FJ, Davidoff, Tian, Jennie, Louise, Oskar, Landon, Noelle, Jarv, Ingrid, Al, Sommer, Doc, Aria, Huin, Gray, Lili, Vir, DJ, Yang, T, Simone, Maestro, Scott, Charlene, Quixote, Amanda, Susan, Zed, Anne, Enkidu, Esbee, Joroan, Katelin, Roxie, Tay, Scarlet, Kevin, Johnny, Wolfgang, Andren, Bob, Howard, Merov, Rand, Ray, Michon, Newell, Galen, Dessie, Les, Michon, Jenelle, Geo, Siz, Shapiro, Pete, Calyle, Selene, Allen, Phoebe, Goldin, Kimmora, Dakota, Slaton, Lindquist, Zoey, Hari, Othello, Rohit, Sheldon, Petra, Viale, Gordon, Kaye, Pink, Ferny, Emerson, Davy, Bri, Chan, Juan, Robert, Terrence, Nathan, Carl and many others. - -Tak til følgende beboerne for at bidrage til at sikre, at dette er den bedste version til dato: able whitman, Adeon Writer, adonaira aabye, Aeron Kohime, Agathos Frascati, Aimee Trescothick, Aleric Inglewood, Alissa Sabre, Aminom Marvin, Angela Talamasca, Aralara Rajal, Armin Weatherwax, Ashrilyn Hayashida, Athanasius Skytower, Aura Dirval, Barney Boomslang, Biancaluce Robbiani, Biker Offcourse, Borg Capalini, Bulli Schumann, catherine pfeffer, Chalice Yao, Corre Porta, Court Goodman, Cummere Mayo, Dale Innis, Darien Caldwell, Darjeeling Schoonhoven, Daten Thielt, dimentox travanti, Dirk Talamasca, Drew Dwi, Duckless Vandyke, Elanthius Flagstaff, Electro Burnstein, emiley tomsen, Escort DeFarge, Eva Rau, Ezian Ecksol, Fire Centaur, Fluf Fredriksson, Francisco Koolhoven, Frontera Thor, Frungi Stastny, Gally Young, gearsawe stonecutter, Gigs Taggart, Gordon Wendt, Gudmund Shepherd, Gypsy Paz, Harleen Gretzky, Henri Beauchamp, Inma Rau, Irene Muni, Iskar Ariantho, Jacek Antonelli, JB Kraft, Jessicka Graves, Joeseph Albanese, Joshua Philgarlic, Khyota Wulluf, kirstenlee Cinquetti, Latif Khalifa, Lex Neva, Lilibeth Andree, Lisa Lowe, Lunita Savira, Loosey Demonia, lum pfohl, Marcos Fonzarelli, MartinRJ Fayray, Marusame Arai, Matthew Dowd, Maya Remblai, McCabe Maxsted, Meghan Dench, Melchoir Tokhes, Menos Short, Michelle2 Zenovka, Mimika Oh, Minerva Memel, Mm Alder, Ochi Wolfe, Omei Turnbull, Pesho Replacement, Phantom Ninetails, phoenixflames kukulcan, Polo Gufler, prez pessoa, princess niven, Prokofy Neva, Qie Niangao, Rem Beattie, RodneyLee Jessop, Saijanai Kuhn, Seg Baphomet, Sergen Davies, Shirley Marquez, SignpostMarv Martin, Sindy Tsure, Sira Arbizu, Skips Jigsaw, Sougent Harrop, Spritely Pixel, Squirrel Wood, StarSong Bright, Subversive Writer, Sugarcult Dagger, Sylumm Grigorovich, Tammy Nowotny, Tanooki Darkes, Tayra Dagostino, Theoretical Chemistry, Thickbrick Sleaford, valerie rosewood, Vex Streeter, Vixen Heron, Whoops Babii, Winter Ventura, Xiki Luik, Yann Dufaux, Yina Yao, Yukinoroh Kamachi, Zolute Infinity, Zwagoth Klaar - - - -I get by with a little help from my friends. --Richard Starkey - </text_editor> - </panel> - <panel name="licenses_panel"> - <text_editor name="credits_editor"> - 3Dconnexion SDK Copyright (C) 1992-2007 3Dconnexion - APR Copyright (C) 2000-2004 The Apache Software Foundation - cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se) - DBus/dbus-glib Copyright (C) 2002, 2003 CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc. - expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd. - FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org). - GL Copyright (C) 1999-2004 Brian Paul. - Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited. - jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW) - jpeglib Copyright (C) 1991-1998, Thomas G. Lane. - ogg/vorbis Copyright (C) 2001, Xiphophorus - OpenSSL Copyright (C) 1998-2002 The OpenSSL Project. - SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga - SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - xmlrpc-epi Copyright (C) 2000 Epinions, Inc. - zlib Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler. - google-perftools Copyright (c) 2005, Google Inc. - -Alle rettigheder forbeholdes. Se licenses.txt for detaljer. - -Voice chat Audio coding: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C) - </text_editor> - </panel> -</tab_container> - <string name="you_are_at"> - Du er ved [POSITION] - </string> -</floater> +<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_about" title="OM [APP_NAME]">
+ <floater.string name="AboutHeader">
+ [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2] ([VIEWER_VERSION_3]) [BUILD_DATE] [BUILD_TIME] ([CHANNEL])
+[[VIEWER_RELEASE_NOTES_URL] [ReleaseNotes]]
+ </floater.string>
+ <floater.string name="AboutCompiler">
+ Bygget med [COMPILER] version [COMPILER_VERSION]
+ </floater.string>
+ <floater.string name="AboutPosition">
+ Du er ved [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] i [REGION] lokaliseret på [HOSTNAME] ([HOSTIP])
+[SERVER_VERSION]
+[[SERVER_RELEASE_NOTES_URL] [ReleaseNotes]]
+ </floater.string>
+ <floater.string name="AboutSystem">
+ CPU: [CPU]
+Memory: [MEMORY_MB] MB
+OS Version: [OS_VERSION]
+Grafik kort mærke: [GRAPHICS_CARD_VENDOR]
+Grafik kort: [GRAPHICS_CARD]
+ </floater.string>
+ <floater.string name="AboutDriver">
+ Windows Graphics Driver Version: [GRAPHICS_DRIVER_VERSION]
+ </floater.string>
+ <floater.string name="AboutLibs">
+ OpenGL Version: [OPENGL_VERSION]
+
+libcurl Version: [LIBCURL_VERSION]
+J2C Decoder Version: [J2C_VERSION]
+Audio Driver Version: [AUDIO_DRIVER_VERSION]
+Qt Webkit Version: [QT_WEBKIT_VERSION]
+Vivox Version: [VIVOX_VERSION]
+ </floater.string>
+ <floater.string name="none">
+ (ingen)
+ </floater.string>
+ <floater.string name="AboutTraffic">
+ Pakker tabt: [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1]%)
+ </floater.string>
+ <tab_container name="about_tab">
+ <panel label="Info" name="support_panel">
+ <button label="Kopiér til udklipsholder" name="copy_btn"/>
+ </panel>
+ <panel label="Tak til" name="credits_panel">
+ <text_editor name="credits_editor">
+ Second Life er gjort muligt for dig af Philip, Tessa, Andrew, Cory, James, Ben, Char, Charlie, Colin, Dan, Daniel, Doug, Eric, Hamlet, Haney, Eve, Hunter, Ian, Jeff, Jennifer, Jim, John, Lee, Mark, Peter, Phoenix, Richard, Robin, Xenon, Steve, Tanya, Eddie, Avi, Frank, Bruce, Aaron, Alice, Bob, Debra, Eileen, Helen, Janet, Louie, Leviathania, Stefan, Ray, Kevin, Tom, Mikeb, MikeT, Burgess, Elena, Tracy, Bill, Todd, Ryan, Zach, Sarah, Nova, Tim, Stephanie, Michael, Evan, Nicolas, Catherine, Rachelle, Dave, Holly, Bub, Kelly, Magellan, Ramzi, Don, Sabin, Jill, Rheya, Jeska, Torley, Kona, Callum, Charity, Ventrella, Jack, Vektor, Iris, Chris, Nicole, Mick, Reuben, Blue, Babbage, Yedwab, Deana, Lauren, Brent, Pathfinder, Chadrick, Altruima, Jesse, Teeny, Monroe, Icculus, David, Tess, Lizzie, Patsy, Isaac, Lawrence, Cyn, Bo, Gia, Annette, Marius, Tbone, Jonathan, Karen, Ginsu, Satoko, Yuko, Makiko, Thomas, Harry, Seth, Alexei, Brian, Guy, Runitai, Ethan, Data, Cornelius, Kenny, Swiss, Zero, Natria, Wendy, Stephen, Teeple, Thumper, Lucy, Dee, Mia, Liana, Warren, Branka, Aura, beez, Milo, Hermia, Red, Thrax, Joe, Sally, Magenta, Mogura, Paul, Jose, Rejean, Henrik, Lexie, Amber, Logan, Xan, Nora, Morpheus, Donovan, Leyla, MichaelFrancis, Beast, Cube, Bucky, Joshua, Stryfe, Harmony, Teresa, Claudia, Walker, Glenn, Fritz, Fordak, June, Cleopetra, Jean, Ivy, Betsy, Roosevelt, Spike, Ken, Which, Tofu, Chiyo, Rob, Zee, dustin, George, Del, Matthew, Cat, Jacqui, Lightfoot, Adrian, Viola, Alfred, Noel, Irfan, Sunil, Yool, Rika, Jane, Xtreme, Frontier, a2, Neo, Siobhan, Yoz, Justin, Elle, Qarl, Benjamin, Isabel, Gulliver, Everett, Christopher, Izzy, Stephany, Garry, Sejong, Sean, Tobin, Iridium, Meta, Anthony, Jeremy, JP, Jake, Maurice, Madhavi, Leopard, Kyle, Joon, Kari, Bert, Belinda, Jon, Kristi, Bridie, Pramod, KJ, Socrates, Maria, Ivan, Aric, Yamasaki, Adreanne, Jay, MitchK, Ceren, Coco, Durl, Jenny, Periapse, Kartic, Storrs, Lotte, Sandy, Rohn, Colossus, Zen, BigPapi, Brad, Pastrami, Kurz, Mani, Neuro, Jaime, MJ, Rowan, Sgt, Elvis, Gecko, Samuel, Sardonyx, Leo, Bryan, Niko, Soft, Poppy, Rachel, Aki, Angelo, Banzai, Alexa, Sue, CeeLo, Bender, CG, Gillian, Pelle, Nick, Echo, Zara, Christine, Shamiran, Emma, Blake, Keiko, Plexus, Joppa, Sidewinder, Erica, Ashlei, Twilight, Kristen, Brett, Q, Enus, Simon, Bevis, Kraft, Kip, Chandler, Ron, LauraP, Ram, KyleJM, Scouse, Prospero, Melissa, Marty, Nat, Hamilton, Kend, Lordan, Jimmy, Kosmo, Seraph, Green, Ekim, Wiggo, JT, Rome, Doris, Miz, Benoc, Whump, Trinity, Patch, Kate, TJ, Bao, Joohwan, Christy, Sofia, Matias, Cogsworth, Johan, Oreh, Cheah, Angela, Brandy, Mango, Lan, Aleks, Gloria, Heidy, Mitchell, Space, Colton, Bambers, Einstein, Maggie, Malbers, Rose, Winnie, Stella, Milton, Rothman, Niall, Marin, Allison, Katie, Dawn, Katt, Dusty, Kalpana, Judy, Andrea, Ambroff, Infinity, Gail, Rico, Raymond, Yi, William, Christa, M, Teagan, Scout, Molly, Dante, Corr, Dynamike, Usi, Kaylee, Vidtuts, Lil, Danica, Sascha, Kelv, Jacob, Nya, Rodney, Brandon, Elsie, Blondin, Grant, Katrin, Nyx, Gabriel, Locklainn, Claire, Devin, Minerva, Monty, Austin, Bradford, Si, Keira, H, Caitlin, Dita, Makai, Jenn, Ann, Meredith, Clare, Joy, Praveen, Cody, Edmund, Ruthe, Sirena, Gayathri, Spider, FJ, Davidoff, Tian, Jennie, Louise, Oskar, Landon, Noelle, Jarv, Ingrid, Al, Sommer, Doc, Aria, Huin, Gray, Lili, Vir, DJ, Yang, T, Simone, Maestro, Scott, Charlene, Quixote, Amanda, Susan, Zed, Anne, Enkidu, Esbee, Joroan, Katelin, Roxie, Tay, Scarlet, Kevin, Johnny, Wolfgang, Andren, Bob, Howard, Merov, Rand, Ray, Michon, Newell, Galen, Dessie, Les, Michon, Jenelle, Geo, Siz, Shapiro, Pete, Calyle, Selene, Allen, Phoebe, Goldin, Kimmora, Dakota, Slaton, Lindquist, Zoey, Hari, Othello, Rohit, Sheldon, Petra, Viale, Gordon, Kaye, Pink, Ferny, Emerson, Davy, Bri, Chan, Juan, Robert, Terrence, Nathan, Carl and many others.
+
+Tak til følgende beboerne for at bidrage til at sikre, at dette er den bedste version til dato: able whitman, Adeon Writer, adonaira aabye, Aeron Kohime, Agathos Frascati, Aimee Trescothick, Aleric Inglewood, Alissa Sabre, Aminom Marvin, Angela Talamasca, Aralara Rajal, Armin Weatherwax, Ashrilyn Hayashida, Athanasius Skytower, Aura Dirval, Barney Boomslang, Biancaluce Robbiani, Biker Offcourse, Borg Capalini, Bulli Schumann, catherine pfeffer, Chalice Yao, Corre Porta, Court Goodman, Cummere Mayo, Dale Innis, Darien Caldwell, Darjeeling Schoonhoven, Daten Thielt, dimentox travanti, Dirk Talamasca, Drew Dwi, Duckless Vandyke, Elanthius Flagstaff, Electro Burnstein, emiley tomsen, Escort DeFarge, Eva Rau, Ezian Ecksol, Fire Centaur, Fluf Fredriksson, Francisco Koolhoven, Frontera Thor, Frungi Stastny, Gally Young, gearsawe stonecutter, Gigs Taggart, Gordon Wendt, Gudmund Shepherd, Gypsy Paz, Harleen Gretzky, Henri Beauchamp, Inma Rau, Irene Muni, Iskar Ariantho, Jacek Antonelli, JB Kraft, Jessicka Graves, Joeseph Albanese, Joshua Philgarlic, Khyota Wulluf, kirstenlee Cinquetti, Latif Khalifa, Lex Neva, Lilibeth Andree, Lisa Lowe, Lunita Savira, Loosey Demonia, lum pfohl, Marcos Fonzarelli, MartinRJ Fayray, Marusame Arai, Matthew Dowd, Maya Remblai, McCabe Maxsted, Meghan Dench, Melchoir Tokhes, Menos Short, Michelle2 Zenovka, Mimika Oh, Minerva Memel, Mm Alder, Ochi Wolfe, Omei Turnbull, Pesho Replacement, Phantom Ninetails, phoenixflames kukulcan, Polo Gufler, prez pessoa, princess niven, Prokofy Neva, Qie Niangao, Rem Beattie, RodneyLee Jessop, Saijanai Kuhn, Seg Baphomet, Sergen Davies, Shirley Marquez, SignpostMarv Martin, Sindy Tsure, Sira Arbizu, Skips Jigsaw, Sougent Harrop, Spritely Pixel, Squirrel Wood, StarSong Bright, Subversive Writer, Sugarcult Dagger, Sylumm Grigorovich, Tammy Nowotny, Tanooki Darkes, Tayra Dagostino, Theoretical Chemistry, Thickbrick Sleaford, valerie rosewood, Vex Streeter, Vixen Heron, Whoops Babii, Winter Ventura, Xiki Luik, Yann Dufaux, Yina Yao, Yukinoroh Kamachi, Zolute Infinity, Zwagoth Klaar
+
+
+
+I get by with a little help from my friends. --Richard Starkey
+ </text_editor>
+ </panel>
+ <panel label="Licenser" name="licenses_panel">
+ <text_editor name="credits_editor">
+ 3Dconnexion SDK Copyright (C) 1992-2007 3Dconnexion
+ APR Copyright (C) 2000-2004 The Apache Software Foundation
+ cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se)
+ DBus/dbus-glib Copyright (C) 2002, 2003 CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc.
+ expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
+ FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org).
+ GL Copyright (C) 1999-2004 Brian Paul.
+ Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited.
+ jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW)
+ jpeglib Copyright (C) 1991-1998, Thomas G. Lane.
+ ogg/vorbis Copyright (C) 2001, Xiphophorus
+ OpenSSL Copyright (C) 1998-2002 The OpenSSL Project.
+ SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
+ SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
+ zlib Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler.
+ google-perftools Copyright (c) 2005, Google Inc.
+
+Alle rettigheder forbeholdes. Se licenses.txt for detaljer.
+
+Voice chat Audio coding: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C)
+ </text_editor>
+ </panel>
+ </tab_container>
+</floater>
diff --git a/indra/newview/skins/default/xui/da/floater_buy_currency.xml b/indra/newview/skins/default/xui/da/floater_buy_currency.xml index a2b6dec91c..d1fca8984d 100644 --- a/indra/newview/skins/default/xui/da/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/da/floater_buy_currency.xml @@ -29,7 +29,7 @@ 1234 </line_editor> <text name="currency_est"> - for ca. US$ [USD] + for ca. [LOCALAMOUNT] </text> <text name="getting_data"> Henter data... @@ -63,6 +63,6 @@ og prøv igen. <button label="Annullér" name="cancel_btn" /> <button label="Køb" name="buy_btn" /> <string name="buy_currency"> - Køb L$ [LINDENS] for ca. US$ [USD] + Køb L$ [LINDENS] for ca. [LOCALAMOUNT] </string> </floater> diff --git a/indra/newview/skins/default/xui/da/floater_mute_object.xml b/indra/newview/skins/default/xui/da/floater_mute_object.xml index 4145918b49..edda8b44e9 100644 --- a/indra/newview/skins/default/xui/da/floater_mute_object.xml +++ b/indra/newview/skins/default/xui/da/floater_mute_object.xml @@ -1,12 +1,14 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<floater name="mute by name" title="BLOKER OBJEKT VIA NAVN"> - <text name="message"> - Blokering via navn har ikke betydning for lyde. -Du skal skrive det præcise navn på objektet. - </text> - <line_editor name="object_name"> - Objekt navn - </line_editor> - <button label="OK" name="OK" /> - <button label="Annullér" name="Cancel" /> -</floater> +<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="mute by name" title="BLOKÉR OBJEKT VIA NAVN">
+ <text name="message">
+ Blokér et objekt:
+ </text>
+ <line_editor name="object_name">
+ Objekt navn
+ </line_editor>
+ <text name="note">
+ * Blokérer kun tekst fra objekt, ikke lyde
+ </text>
+ <button label="OK" name="OK"/>
+ <button label="Annullér" name="Cancel"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/da/floater_report_abuse.xml b/indra/newview/skins/default/xui/da/floater_report_abuse.xml index 6f1e2884eb..b249fc5654 100644 --- a/indra/newview/skins/default/xui/da/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/da/floater_report_abuse.xml @@ -1,103 +1,103 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="floater_report_abuse" title="RAPPORTÉR MISBRUG"> - <texture_picker label="" name="screenshot"/> - <check_box label="Inkludér billede" name="screen_check"/> - <text name="reporter_title"> - Anmelder: - </text> - <text name="reporter_field"> - Loremipsum Dolorsitamut - </text> - <text name="sim_title"> - Region: - </text> - <text name="sim_field"> - Region navn - </text> - <text name="pos_title"> - Position: - </text> - <text name="pos_field"> - {128.1, 128.1, 15.4} - </text> - <text name="select_object_label"> - Klik på knappen derefter objektet: - </text> - <button label="" label_selected="" name="pick_btn" tool_tip="Objekt vælger - Identificér et objekt denne rapport omhandler"/> - <text name="object_name_label"> - Navn: - </text> - <text name="object_name" left_delta="64" width="140"> - Consetetur Sadipscing - </text> - <text name="owner_name_label"> - Ejer: - </text> - <text name="owner_name" left_delta="64"> - Hendrerit Vulputate - </text> - <combo_box name="category_combo" tool_tip="Kategori -- Vælg en kategori der passer bedst på denne rapport"> - <combo_box.item name="Select_category" label="Vælg kategori"/> - <combo_box.item name="Age__Age_play" label="Alder > Falsk alder"/> - <combo_box.item name="Age__Adult_resident_on_Teen_Second_Life" label="Alder > Voksen beboer på Teen Second Life"/> - <combo_box.item name="Age__Underage_resident_outside_of_Teen_Second_Life" label="Alder > Mindreårig beboer udenfor Teen Second Life"/> - <combo_box.item name="Assault__Combat_sandbox___unsafe_area" label="Overfald > Kamp sandkasse / Usikkert område"/> - <combo_box.item name="Assault__Safe_area" label="Overfald > Sikkert område"/> - <combo_box.item name="Assault__Weapons_testing_sandbox" label="Overfald > Sandkasse til våbentest"/> - <combo_box.item name="Commerce__Failure_to_deliver_product_or_service" label="Handel > Vare eller ydelse ikke leveret"/> - <combo_box.item name="Disclosure__Real_world_information" label="Offentliggørelse > Om oplysninger i den virkelige verden"/> - <combo_box.item name="Disclosure__Remotely_monitoring chat" label="Offentliggørelse > Fjernaflytning af chat"/> - <combo_box.item name="Disclosure__Second_Life_information_chat_IMs" label="Offentliggørelse > Information/chat/IM fra Second Life"/> - <combo_box.item name="Disturbing_the_peace__Unfair_use_of_region_resources" label="Forstyrrelse af fred > Unfair brug af region ressourcer"/> - <combo_box.item name="Disturbing_the_peace__Excessive_scripted_objects" label="Forstyrrelse af fred > Overdreven brug af objekter med script"/> - <combo_box.item name="Disturbing_the_peace__Object_littering" label="Forstyrrelse af fred > Object affald"/> - <combo_box.item name="Disturbing_the_peace__Repetitive_spam" label="Forstyrring af fred > Gentagen spam"/> - <combo_box.item name="Disturbing_the_peace__Unwanted_advert_spam" label="Forstyrrelse af fred > Uønsket reklame spam"/> - <combo_box.item name="Fraud__L$" label="Bedrageri > L$"/> - <combo_box.item name="Fraud__Land" label="Bedrageri > Land"/> - <combo_box.item name="Fraud__Pyramid_scheme_or_chain_letter" label="Bedrageri > Pyramide spil eller kædebreve"/> - <combo_box.item name="Fraud__US$" label="Bedrageri > US$"/> - <combo_box.item name="Harassment__Advert_farms___visual_spam" label="Chikane > reklame farm / billedeligt spam"/> - <combo_box.item name="Harassment__Defaming_individuals_or_groups" label="Chikane > Injurier/bagvask enkeltpersoner eller grupper"/> - <combo_box.item name="Harassment__Impeding_movement" label="Chikane > Hindre bevægelse"/> - <combo_box.item name="Harassment__Sexual_harassment" label="Chikane > Sex chikane"/> - <combo_box.item name="Harassment__Solicting_inciting_others_to_violate_ToS" label="Chikane > Opfordrer/kræver at andre overtræder licensbetingelser"/> - <combo_box.item name="Harassment__Verbal_abuse" label="Chikane > Verbalt chikane"/> - <combo_box.item name="Indecency__Broadly_offensive_content_or_conduct" label="Uanstændighed > Meget stødende indhold eller adfærd"/> - <combo_box.item name="Indecency__Inappropriate_avatar_name" label="Uanstændighed > Upassende avatar navn"/> - <combo_box.item name="Indecency__Mature_content_in_PG_region" label="Usømmelighed > Upassende inhold eller opførsel i en 'PG' region"/> - <combo_box.item name="Indecency__Inappropriate_content_in_Mature_region" label="Usømmelighed > Upassende inhold eller opførsel i en 'Mature' region"/> - <combo_box.item name="Intellectual_property_infringement_Content_Removal" label="Krænkelse af intellektuelle ejendomsrettigheder > Indholds fjernelse"/> - <combo_box.item name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit" label="Krænkelse af intellektuelle ejendomsrettigheder > CopyBot eller omgåelse af rettighedsbeskyttelse"/> - <combo_box.item name="Intolerance" label="Intolerance"/> - <combo_box.item name="Land__Abuse_of_sandbox_resources" label="Land > Misbrug af sandkasse resourcer"/> - <combo_box.item name="Land__Encroachment__Objects_textures" label="Land > Overgreb > Objekter/teksturer"/> - <combo_box.item name="Land__Encroachment__Particles" label="Land > Overgreb > Partikler"/> - <combo_box.item name="Land__Encroachment__Trees_plants" label="Land > Overgreb > Træer/planter"/> - <combo_box.item name="Wagering_gambling" label="Væddemål/gambling"/> - <combo_box.item name="Other" label="Andet"/> - </combo_box> - <text name="abuser_name_title"> - Udøvers navn: - </text> - <button label="Vælg beboer" label_selected="" name="select_abuser" tool_tip="Vælg navnet på udøveren fra denne liste"/> - <check_box label="Kender ikke udøvers navn" name="omit_abuser_name" tool_tip="Afkryds her, hvis du ikke kender navn på udøvers"/> - <text name="abuser_name_title2"> - Sted for misbrug/overgreb: - </text> - <text name="sum_title"> - Opsummering: - </text> - <text name="dscr_title"> - Detaljer: - </text> - <text name="bug_aviso"> - Vær venligst præcis omkring dato, sted, overgrebets -natur, relevant chat/IM og vælg objekt hvis muligt. - </text> - <text name="incomplete_title"> - Note: Ufuldstændige rapporter vil ikke blive undersøgt. - </text> - <button label="Annullér" label_selected="Annullér" name="cancel_btn"/> - <button label="Rapporter misbrug" label_selected="Rapporter misbrug" name="send_btn"/> -</floater> +<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_report_abuse" title="RAPPORTÉR MISBRUG">
+ <floater.string name="Screenshot">
+ Screenshot
+ </floater.string>
+ <check_box label="Inkludér billede" name="screen_check"/>
+ <text name="reporter_title">
+ Anmelder:
+ </text>
+ <text name="reporter_field">
+ Loremipsum Dolorsitamut Longnamez
+ </text>
+ <text name="sim_title">
+ Region:
+ </text>
+ <text name="sim_field">
+ Region navn
+ </text>
+ <text name="pos_title">
+ Position:
+ </text>
+ <text name="pos_field">
+ {128.1, 128.1, 15.4}
+ </text>
+ <text name="select_object_label">
+ Klik på knappen derefter objektet:
+ </text>
+ <button label="" label_selected="" name="pick_btn" tool_tip="Objekt vælger - Identificér et objekt denne rapport omhandler"/>
+ <text name="object_name_label">
+ Navn:
+ </text>
+ <text left_delta="64" name="object_name" width="140">
+ Consetetur Sadipscing
+ </text>
+ <text name="owner_name_label">
+ Ejer:
+ </text>
+ <text left_delta="64" name="owner_name">
+ Hendrerit Vulputate Kamawashi Longname
+ </text>
+ <combo_box name="category_combo" tool_tip="Kategori -- Vælg en kategori der passer bedst på denne rapport">
+ <combo_box.item label="Vælg kategori" name="Select_category"/>
+ <combo_box.item label="Alder > Falsk alder" name="Age__Age_play"/>
+ <combo_box.item label="Alder > Voksen beboer på Teen Second Life" name="Age__Adult_resident_on_Teen_Second_Life"/>
+ <combo_box.item label="Alder > Mindreårig beboer udenfor Teen Second Life" name="Age__Underage_resident_outside_of_Teen_Second_Life"/>
+ <combo_box.item label="Overfald > Kamp sandkasse / Usikkert område" name="Assault__Combat_sandbox___unsafe_area"/>
+ <combo_box.item label="Overfald > Sikkert område" name="Assault__Safe_area"/>
+ <combo_box.item label="Overfald > Sandkasse til våbentest" name="Assault__Weapons_testing_sandbox"/>
+ <combo_box.item label="Handel > Vare eller ydelse ikke leveret" name="Commerce__Failure_to_deliver_product_or_service"/>
+ <combo_box.item label="Offentliggørelse > Om oplysninger i den virkelige verden" name="Disclosure__Real_world_information"/>
+ <combo_box.item label="Offentliggørelse > Fjernaflytning af chat" name="Disclosure__Remotely_monitoring chat"/>
+ <combo_box.item label="Offentliggørelse > Information/chat/IM fra Second Life" name="Disclosure__Second_Life_information_chat_IMs"/>
+ <combo_box.item label="Forstyrrelse af fred > Unfair brug af region ressourcer" name="Disturbing_the_peace__Unfair_use_of_region_resources"/>
+ <combo_box.item label="Forstyrrelse af fred > Overdreven brug af objekter med script" name="Disturbing_the_peace__Excessive_scripted_objects"/>
+ <combo_box.item label="Forstyrrelse af fred > Object affald" name="Disturbing_the_peace__Object_littering"/>
+ <combo_box.item label="Forstyrring af fred > Gentagen spam" name="Disturbing_the_peace__Repetitive_spam"/>
+ <combo_box.item label="Forstyrrelse af fred > Uønsket reklame spam" name="Disturbing_the_peace__Unwanted_advert_spam"/>
+ <combo_box.item label="Bedrageri > L$" name="Fraud__L$"/>
+ <combo_box.item label="Bedrageri > Land" name="Fraud__Land"/>
+ <combo_box.item label="Bedrageri > Pyramide spil eller kædebreve" name="Fraud__Pyramid_scheme_or_chain_letter"/>
+ <combo_box.item label="Bedrageri > US$" name="Fraud__US$"/>
+ <combo_box.item label="Chikane > reklame farm / billedeligt spam" name="Harassment__Advert_farms___visual_spam"/>
+ <combo_box.item label="Chikane > Injurier/bagvask enkeltpersoner eller grupper" name="Harassment__Defaming_individuals_or_groups"/>
+ <combo_box.item label="Chikane > Hindre bevægelse" name="Harassment__Impeding_movement"/>
+ <combo_box.item label="Chikane > Sex chikane" name="Harassment__Sexual_harassment"/>
+ <combo_box.item label="Chikane > Opfordrer/kræver at andre overtræder licensbetingelser" name="Harassment__Solicting_inciting_others_to_violate_ToS"/>
+ <combo_box.item label="Chikane > Verbalt chikane" name="Harassment__Verbal_abuse"/>
+ <combo_box.item label="Uanstændighed > Meget stødende indhold eller adfærd" name="Indecency__Broadly_offensive_content_or_conduct"/>
+ <combo_box.item label="Uanstændighed > Upassende avatar navn" name="Indecency__Inappropriate_avatar_name"/>
+ <combo_box.item label="Usømmelighed > Upassende inhold eller opførsel i en 'PG' region" name="Indecency__Mature_content_in_PG_region"/>
+ <combo_box.item label="Usømmelighed > Upassende inhold eller opførsel i en 'Mature' region" name="Indecency__Inappropriate_content_in_Mature_region"/>
+ <combo_box.item label="Krænkelse af intellektuelle ejendomsrettigheder > Indholds fjernelse" name="Intellectual_property_infringement_Content_Removal"/>
+ <combo_box.item label="Krænkelse af intellektuelle ejendomsrettigheder > CopyBot eller omgåelse af rettighedsbeskyttelse" name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit"/>
+ <combo_box.item label="Intolerance" name="Intolerance"/>
+ <combo_box.item label="Land > Misbrug af sandkasse resourcer" name="Land__Abuse_of_sandbox_resources"/>
+ <combo_box.item label="Land > Overgreb > Objekter/teksturer" name="Land__Encroachment__Objects_textures"/>
+ <combo_box.item label="Land > Overgreb > Partikler" name="Land__Encroachment__Particles"/>
+ <combo_box.item label="Land > Overgreb > Træer/planter" name="Land__Encroachment__Trees_plants"/>
+ <combo_box.item label="Væddemål/gambling" name="Wagering_gambling"/>
+ <combo_box.item label="Andet" name="Other"/>
+ </combo_box>
+ <text name="abuser_name_title">
+ Udøvers navn:
+ </text>
+ <button label="Vælg beboer" label_selected="" name="select_abuser" tool_tip="Vælg navnet på udøveren fra denne liste"/>
+ <text name="abuser_name_title2">
+ Sted for misbrug/overgreb:
+ </text>
+ <text name="sum_title">
+ Opsummering:
+ </text>
+ <text name="dscr_title">
+ Detaljer:
+ </text>
+ <text name="bug_aviso">
+ Vær venligst så præcis som muligt
+ </text>
+ <text name="incomplete_title">
+ * Note: Ufuldstændige rapporter vil ikke blive undersøgt.
+ </text>
+ <button label="Rapporter misbrug" label_selected="Rapporter misbrug" name="send_btn"/>
+ <button label="Annullér" label_selected="Annullér" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/da/floater_stats.xml b/indra/newview/skins/default/xui/da/floater_stats.xml new file mode 100644 index 0000000000..06b795c3b9 --- /dev/null +++ b/indra/newview/skins/default/xui/da/floater_stats.xml @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Statistics" title="STATISTIK">
+ <scroll_container name="statistics_scroll">
+ <container_view name="statistics_view">
+ <stat_view label="Grundlæggende" name="basic">
+ <stat_bar label="FPS" name="fps"/>
+ <stat_bar label="Båndbredde" name="bandwidth"/>
+ <stat_bar label="Pakketab" name="packet_loss"/>
+ <stat_bar label="Ping Sim" name="ping"/>
+ </stat_view>
+ <stat_view label="Avanceret" name="advanced">
+ <stat_view label="Render" name="render">
+ <stat_bar label="KTris tegnet" name="ktrisframe"/>
+ <stat_bar label="KTris tegnet" name="ktrissec"/>
+ <stat_bar label="Total antal objekter" name="objs"/>
+ <stat_bar label="Nye objekter" name="newobjs"/>
+ </stat_view>
+ <stat_view label="Texture" name="texture">
+ <stat_bar label="Count" name="numimagesstat"/>
+ <stat_bar label="Raw Count" name="numrawimagesstat"/>
+ <stat_bar label="GL Mem" name="gltexmemstat"/>
+ <stat_bar label="Formatted Mem" name="formattedmemstat"/>
+ <stat_bar label="Raw Mem" name="rawmemstat"/>
+ <stat_bar label="Bound Mem" name="glboundmemstat"/>
+ </stat_view>
+ <stat_view label="Netværk" name="network">
+ <stat_bar label="Packets In" name="packetsinstat"/>
+ <stat_bar label="Packets Out" name="packetsoutstat"/>
+ <stat_bar label="Objekter" name="objectkbitstat"/>
+ <stat_bar label="Texture" name="texturekbitstat"/>
+ <stat_bar label="Asset" name="assetkbitstat"/>
+ <stat_bar label="Layers" name="layerskbitstat"/>
+ <stat_bar label="Actual In" name="actualinkbitstat"/>
+ <stat_bar label="Actual Out" name="actualoutkbitstat"/>
+ <stat_bar label="VFS Pending Ops" name="vfspendingoperations"/>
+ </stat_view>
+ </stat_view>
+ <stat_view label="Simulator" name="sim">
+ <stat_bar label="Time Dilation" name="simtimedilation"/>
+ <stat_bar label="Sim FPS" name="simfps"/>
+ <stat_bar label="Physics FPS" name="simphysicsfps"/>
+ <stat_view label="Physics Details" name="physicsdetail">
+ <stat_bar label="Pinned Objects" name="physicspinnedtasks"/>
+ <stat_bar label="Low LOD Objects" name="physicslodtasks"/>
+ <stat_bar label="Memory Allocated" name="physicsmemoryallocated"/>
+ <stat_bar label="Agent Updates/Sec" name="simagentups"/>
+ <stat_bar label="Main Agents" name="simmainagents"/>
+ <stat_bar label="Child Agents" name="simchildagents"/>
+ <stat_bar label="Objects" name="simobjects"/>
+ <stat_bar label="Active Objects" name="simactiveobjects"/>
+ <stat_bar label="Active Scripts" name="simactivescripts"/>
+ <stat_bar label="Script Events" name="simscripteps"/>
+ <stat_bar label="Packets In" name="siminpps"/>
+ <stat_bar label="Packets Out" name="simoutpps"/>
+ <stat_bar label="Pending Downloads" name="simpendingdownloads"/>
+ <stat_bar label="Pending Uploads" name="simpendinguploads"/>
+ <stat_bar label="Total Unacked Bytes" name="simtotalunackedbytes"/>
+ </stat_view>
+ <stat_view label="Time (ms)" name="simperf">
+ <stat_bar label="Total Frame Time" name="simframemsec"/>
+ <stat_bar label="Net Time" name="simnetmsec"/>
+ <stat_bar label="Physics Time" name="simsimphysicsmsec"/>
+ <stat_bar label="Simulation Time" name="simsimothermsec"/>
+ <stat_bar label="Agent Time" name="simagentmsec"/>
+ <stat_bar label="Images Time" name="simimagesmsec"/>
+ <stat_bar label="Script Time" name="simscriptmsec"/>
+ </stat_view>
+ </stat_view>
+ </container_view>
+ </scroll_container>
+</floater>
diff --git a/indra/newview/skins/default/xui/da/menu_inventory.xml b/indra/newview/skins/default/xui/da/menu_inventory.xml index fd5ebe5c82..b24fd80607 100644 --- a/indra/newview/skins/default/xui/da/menu_inventory.xml +++ b/indra/newview/skins/default/xui/da/menu_inventory.xml @@ -1,66 +1,82 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<menu name="Popup"> - <menu_item_call label="Køb" name="Task Buy" /> - <menu_item_call label="åben" name="Task Open" /> - <menu_item_call label="Afspil" name="Task Play" /> - <menu_item_call label="Egenskaber" name="Task Properties" /> - <menu_item_call label="Omdøb" name="Task Rename" /> - <menu_item_call label="Slet" name="Task Remove" /> - <menu_item_call label="Tøm papirkurv" name="Empty Trash" /> - <menu_item_call label="Tøm 'Lost and found'" name="Empty Lost And Found" /> - <menu_item_call label="Ny mappe" name="New Folder" /> - <menu_item_call label="Nyt script" name="New Script" /> - <menu_item_call label="Ny note" name="New Note" /> - <menu_item_call label="Ny bevægelse" name="New Gesture" /> - <menu name="New Clothes"> - <menu_item_call label="Ny trøje" name="New Shirt" /> - <menu_item_call label="Nye bukser" name="New Pants" /> - <menu_item_call label="Nye sko" name="New Shoes" /> - <menu_item_call label="Nye strømper" name="New Socks" /> - <menu_item_call label="Ny jakke" name="New Jacket" /> - <menu_item_call label="Ny nederdel" name="New Skirt" /> - <menu_item_call label="Nye handsker" name="New Gloves" /> - <menu_item_call label="Ny undertrøje" name="New Undershirt" /> - <menu_item_call label="Nye underbukser" name="New Underpants" /> - </menu> - <menu name="New Body Parts"> - <menu_item_call label="Ny figur" name="New Shape" /> - <menu_item_call label="Nyt hud" name="New Skin" /> - <menu_item_call label="Nyt hår" name="New Hair" /> - <menu_item_call label="Nye øjne" name="New Eyes" /> - </menu> - <menu_item_call label="Teleport" name="Landmark Open" /> - <menu_item_call label="åben" name="Animation Open" /> - <menu_item_call label="åben" name="Sound Open" /> - <menu_item_call label="Slet ting" name="Purge Item" /> - <menu_item_call label="Genskab ting" name="Restore Item" /> - <menu_item_call label="åben" name="Open" /> - <menu_item_call label="Egenskaber" name="Properties" /> - <menu_item_call label="Omdøb" name="Rename" /> - <menu_item_call label="Kopiér asset UUID" name="Copy Asset UUID" /> - <menu_item_call label="Kopiér" name="Copy" /> - <menu_item_call label="Indsæt" name="Paste" /> - <menu_item_call label="Slet" name="Delete" /> - <menu_item_call label="Tag ting af" name="Take Off Items" /> - <menu_item_call label="Tilføj til påklædning" name="Add To Outfit" /> - <menu_item_call label="Erstat påklædning" name="Replace Outfit" /> - <menu_item_call label="start konference chat" name="Conference Chat Folder" /> - <menu_item_call label="Afspil" name="Sound Play" /> - <menu_item_call label="Om landemærke" name="Teleport To Landmark" /> - <menu_item_call label="Afspil offentligt" name="Animation Play" /> - <menu_item_call label="Afspil lokalt" name="Animation Audition" /> - <menu_item_call label="Send privat besked (IM)" name="Send Instant Message" /> - <menu_item_call label="Tilbyd teleport..." name="Offer Teleport..." /> - <menu_item_call label="start konference Chat" name="Conference Chat" /> - <menu_item_call label="Aktivér" name="Activate" /> - <menu_item_call label="Deaktivér" name="Deactivate" /> - <menu_item_call label="Tag af dig selv" name="Detach From Yourself" /> - <menu_item_call label="Tilbage til sidste position" name="Restore to Last Position"/> - <menu_item_call label="Tag på" name="Object Wear" /> - <menu label="Vedhæft" name="Attach To" /> - <menu label="Vedhæft til HUD" name="Attach To HUD" /> - <menu_item_call label="Redigér" name="Wearable Edit" /> - <menu_item_call label="Tag på" name="Wearable Wear" /> - <menu_item_call label="Tag af" name="Take Off" /> - <menu_item_call label="--ingen valg--" name="--no options--" /> -</menu> +<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<menu name="Popup">
+ <menu_item_call label="Køb" name="Task Buy"/>
+ <menu_item_call label="åben" name="Task Open"/>
+ <menu_item_call label="Afspil" name="Task Play"/>
+ <menu_item_call label="Egenskaber" name="Task Properties"/>
+ <menu_item_call label="Omdøb" name="Task Rename"/>
+ <menu_item_call label="Slet" name="Task Remove"/>
+ <menu_item_call label="Tøm papirkurv" name="Empty Trash"/>
+ <menu_item_call label="Tøm 'Lost and found'" name="Empty Lost And Found"/>
+ <menu_item_call label="Ny mappe" name="New Folder"/>
+ <menu_item_call label="Nyt script" name="New Script"/>
+ <menu_item_call label="Ny note" name="New Note"/>
+ <menu_item_call label="Ny bevægelse" name="New Gesture"/>
+ <menu label="Nyt tøj" name="New Clothes">
+ <menu_item_call label="Ny trøje" name="New Shirt"/>
+ <menu_item_call label="Nye bukser" name="New Pants"/>
+ <menu_item_call label="Nye sko" name="New Shoes"/>
+ <menu_item_call label="Nye strømper" name="New Socks"/>
+ <menu_item_call label="Ny jakke" name="New Jacket"/>
+ <menu_item_call label="Ny nederdel" name="New Skirt"/>
+ <menu_item_call label="Nye handsker" name="New Gloves"/>
+ <menu_item_call label="Ny undertrøje" name="New Undershirt"/>
+ <menu_item_call label="Nye underbukser" name="New Underpants"/>
+ <menu_item_call label="Nyt alpha lag" name="New Alpha Mask"/>
+ <menu_item_call label="Ny tatovering" name="New Tattoo"/>
+ </menu>
+ <menu label="Nye kropsdele" name="New Body Parts">
+ <menu_item_call label="Ny figur" name="New Shape"/>
+ <menu_item_call label="Nyt hud" name="New Skin"/>
+ <menu_item_call label="Nyt hår" name="New Hair"/>
+ <menu_item_call label="Nye øjne" name="New Eyes"/>
+ </menu>
+ <menu label="Ændre type" name="Change Type">
+ <menu_item_call label="Standard" name="Default"/>
+ <menu_item_call label="Handsker" name="Gloves"/>
+ <menu_item_call label="Jakke" name="Jacket"/>
+ <menu_item_call label="Bukser" name="Pants"/>
+ <menu_item_call label="Kropsbygning" name="Shape"/>
+ <menu_item_call label="Sko" name="Shoes"/>
+ <menu_item_call label="Trøje" name="Shirt"/>
+ <menu_item_call label="Nederdel" name="Skirt"/>
+ <menu_item_call label="Underbukser" name="Underpants"/>
+ <menu_item_call label="Undertrøje" name="Undershirt"/>
+ </menu>
+ <menu_item_call label="Teleport" name="Landmark Open"/>
+ <menu_item_call label="åben" name="Animation Open"/>
+ <menu_item_call label="åben" name="Sound Open"/>
+ <menu_item_call label="Slet ting" name="Purge Item"/>
+ <menu_item_call label="Genskab ting" name="Restore Item"/>
+ <menu_item_call label="Gå til link" name="Goto Link"/>
+ <menu_item_call label="åben" name="Open"/>
+ <menu_item_call label="Egenskaber" name="Properties"/>
+ <menu_item_call label="Omdøb" name="Rename"/>
+ <menu_item_call label="Kopiér asset UUID" name="Copy Asset UUID"/>
+ <menu_item_call label="Kopiér" name="Copy"/>
+ <menu_item_call label="Indsæt" name="Paste"/>
+ <menu_item_call label="Sæt ind som link" name="Paste As Link"/>
+ <menu_item_call label="Slet" name="Delete"/>
+ <menu_item_call label="Tag ting af" name="Take Off Items"/>
+ <menu_item_call label="Tilføj til påklædning" name="Add To Outfit"/>
+ <menu_item_call label="Erstat påklædning" name="Replace Outfit"/>
+ <menu_item_call label="start konference chat" name="Conference Chat Folder"/>
+ <menu_item_call label="Afspil" name="Sound Play"/>
+ <menu_item_call label="Om landemærke" name="About Landmark"/>
+ <menu_item_call label="Afspil offentligt" name="Animation Play"/>
+ <menu_item_call label="Afspil lokalt" name="Animation Audition"/>
+ <menu_item_call label="Send privat besked (IM)" name="Send Instant Message"/>
+ <menu_item_call label="Tilbyd teleport..." name="Offer Teleport..."/>
+ <menu_item_call label="start konference Chat" name="Conference Chat"/>
+ <menu_item_call label="Aktivér" name="Activate"/>
+ <menu_item_call label="Deaktivér" name="Deactivate"/>
+ <menu_item_call label="Gem som" name="Save As"/>
+ <menu_item_call label="Tag af dig selv" name="Detach From Yourself"/>
+ <menu_item_call label="Tag på" name="Object Wear"/>
+ <menu label="Vedhæft" name="Attach To"/>
+ <menu label="Vedhæft til HUD" name="Attach To HUD"/>
+ <menu_item_call label="Redigér" name="Wearable Edit"/>
+ <menu_item_call label="Tag på" name="Wearable Wear"/>
+ <menu_item_call label="Tag af" name="Take Off"/>
+ <menu_item_call label="--ingen valg--" name="--no options--"/>
+</menu>
diff --git a/indra/newview/skins/default/xui/da/menu_inventory_add.xml b/indra/newview/skins/default/xui/da/menu_inventory_add.xml new file mode 100644 index 0000000000..b2a144c9f0 --- /dev/null +++ b/indra/newview/skins/default/xui/da/menu_inventory_add.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<menu name="menu_inventory_add">
+ <menu label="Hent" name="upload">
+ <menu_item_call label="Billede (L$[COST])..." name="Upload Image"/>
+ <menu_item_call label="Lyd (L$[COST])..." name="Upload Sound"/>
+ <menu_item_call label="Animation (L$[COST])..." name="Upload Animation"/>
+ <menu_item_call label="Hent mange (L$[COST] pr. fil)..." name="Bulk Upload"/>
+ </menu>
+ <menu_item_call label="Ny mappe" name="New Folder"/>
+ <menu_item_call label="Nyt script" name="New Script"/>
+ <menu_item_call label="Ny note" name="New Note"/>
+ <menu_item_call label="Ny bevægelse" name="New Gesture"/>
+ <menu label="Nyt tøj" name="New Clothes">
+ <menu_item_call label="Ny trøje" name="New Shirt"/>
+ <menu_item_call label="Nye bukser" name="New Pants"/>
+ <menu_item_call label="Nye sko" name="New Shoes"/>
+ <menu_item_call label="Nye strømper" name="New Socks"/>
+ <menu_item_call label="Ny jakke" name="New Jacket"/>
+ <menu_item_call label="Ny nederdel" name="New Skirt"/>
+ <menu_item_call label="Nye handsker" name="New Gloves"/>
+ <menu_item_call label="Ny undertrøje" name="New Undershirt"/>
+ <menu_item_call label="Nye underbukser" name="New Underpants"/>
+ <menu_item_call label="Nyt alpha lag" name="New Alpha"/>
+ <menu_item_call label="Ny tatovering" name="New Tattoo"/>
+ </menu>
+ <menu label="Nye kropsdele" name="New Body Parts">
+ <menu_item_call label="Ny kropsbygning" name="New Shape"/>
+ <menu_item_call label="Ny hud" name="New Skin"/>
+ <menu_item_call label="Nyt hår" name="New Hair"/>
+ <menu_item_call label="Nye øjne" name="New Eyes"/>
+ </menu>
+</menu>
diff --git a/indra/newview/skins/default/xui/da/menu_picks.xml b/indra/newview/skins/default/xui/da/menu_picks.xml new file mode 100644 index 0000000000..a47ef49ca0 --- /dev/null +++ b/indra/newview/skins/default/xui/da/menu_picks.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<context_menu name="Picks">
+ <menu_item_call label="Info" name="pick_info"/>
+ <menu_item_call label="Redigér" name="pick_edit"/>
+ <menu_item_call label="Teleportér" name="pick_teleport"/>
+ <menu_item_call label="Vis på kort" name="pick_map"/>
+ <menu_item_call label="Slet" name="pick_delete"/>
+</context_menu>
diff --git a/indra/newview/skins/default/xui/da/menu_places_gear_landmark.xml b/indra/newview/skins/default/xui/da/menu_places_gear_landmark.xml new file mode 100644 index 0000000000..ed00c91508 --- /dev/null +++ b/indra/newview/skins/default/xui/da/menu_places_gear_landmark.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<menu name="menu_ladmark_gear">
+ <menu_item_call label="Teleportér" name="teleport"/>
+ <menu_item_call label="Mere information" name="more_info"/>
+ <menu_item_call label="Vis på kort" name="show_on_map"/>
+ <menu_item_call label="Tilføj landemærke" name="add_landmark"/>
+ <menu_item_call label="Tilføj mappe" name="add_folder"/>
+ <menu_item_call label="Klip" name="cut"/>
+ <menu_item_call label="Kopiér landemærke" name="copy_landmark"/>
+ <menu_item_call label="Kopiér SLurl" name="copy_slurl"/>
+ <menu_item_call label="Sæt ind" name="paste"/>
+ <menu_item_call label="Omdøb" name="rename"/>
+ <menu_item_call label="Slet" name="delete"/>
+ <menu_item_call label="Åben alle mapper" name="expand_all"/>
+ <menu_item_call label="Luk alle mapper" name="collapse_all"/>
+ <menu_item_check label="Sortér efter dato" name="sort_by_date"/>
+ <menu_item_call label="Opret favorit" name="create_pick"/>
+</menu>
diff --git a/indra/newview/skins/default/xui/da/panel_block_list_sidetray.xml b/indra/newview/skins/default/xui/da/panel_block_list_sidetray.xml new file mode 100644 index 0000000000..d16f7535fc --- /dev/null +++ b/indra/newview/skins/default/xui/da/panel_block_list_sidetray.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="block_list_panel">
+ <text name="title_text">
+ Blokérede avatarer
+ </text>
+ <scroll_list name="blocked" tool_tip="Vis liste over blokerede avatarer"/>
+ <button label="Blokér beboer..." label_selected="Blokér beboer..." name="Block resident..." tool_tip="Vælg en beboer der skal blokeres"/>
+ <button label="Blokér objekt via navn..." label_selected="Blokér objekt via navn..." name="Block object by name..."/>
+ <button label="Fjern blokering" label_selected="Fjern blokering" name="Unblock" tool_tip="Fjern beboer fra liste med blokeringer"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/da/panel_edit_profile.xml b/indra/newview/skins/default/xui/da/panel_edit_profile.xml index b4d0fa20ef..a8a02a34b7 100644 --- a/indra/newview/skins/default/xui/da/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/da/panel_edit_profile.xml @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <panel name="edit_profile_panel"> <string name="CaptionTextAcctInfo"> - [ACCTTYPE] [PAYMENTINFO] [AGEVERIFICATION] + [ACCTTYPE] +[PAYMENTINFO] [AGEVERIFICATION] </string> <string name="AcctTypeResident" value="Beboer" /> diff --git a/indra/newview/skins/default/xui/da/panel_group_roles.xml b/indra/newview/skins/default/xui/da/panel_group_roles.xml index 5c2fd356d8..99f5bac89d 100644 --- a/indra/newview/skins/default/xui/da/panel_group_roles.xml +++ b/indra/newview/skins/default/xui/da/panel_group_roles.xml @@ -1,161 +1,121 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel label="Medlemmer & roller" name="roles_tab"> - <string name="default_needs_apply_text"> - Der er ændringer her, der ikke er gemt. - </string> - <string name="want_apply_text"> - Vil du gemme disse ændringer? - </string> - <button label="?" name="help_button" /> - <panel name="members_header"> - <text name="static"> - Medlemmer & roller - </text> - <text name="static2" width="400"> - Gruppemedlemmer får tildelt roller med rettigheder. Disse indstillinger kan -let tilpasses efter ønske, så gruppen kan vokse og blive mere fleksibel. - </text> - </panel> - <panel name="roles_header"> - <text name="static"> - Roller - </text> - <text name="role_properties_modifiable" width="400"> - Vælg en rolle nedenfor. Du kan ændre dens navn, beskrivelse og medlemstitel. - </text> - <text name="role_properties_not_modifiable" width="400"> - Vælg rolle forneden for at se dens egenskaber, medlemmer og rettigheder. - </text> - <text name="role_actions_modifiable"> - Du kan også tildele rettigheder til rollen. - </text> - <text name="role_actions_not_modifiable"> - Du kan se, men ikke ændre, tildelte rettigheder. - </text> - </panel> - <panel name="actions_header"> - <text name="static"> - Rettigheder - </text> - <text name="static2"> - Du kan se en rettigheds beskrivelse og hvilke roller og medlemmer, -der har denne rettighed. - </text> - </panel> - <tab_container name="roles_tab_container"> - <panel label="Medlemmer" name="members_sub_tab" tool_tip="Medlemmer"> - <button label="Søg" name="search_button" /> - <button label="Vis alle" name="show_all_button" /> - <name_list name="member_list"> - <column label="Medlemsnavn" name="name" /> - <column label="Doneret leje" name="donated" /> - <column label="Sidst på den" name="online" /> - </name_list> - <button label="Invitér nyt medlem..." name="member_invite"/> - <button label="Udmeld" name="member_eject" /> - <string name="help_text"> - Du kan tilføje eller fjerne roller, der er tildelt medlemmerne. -Vælg flere medlemmer ved at holde Ctrl-tasten nede og -klik på deres navne. - </string> - </panel> - <panel label="Roller" name="roles_sub_tab"> - <button label="Søg" name="search_button" /> - <button label="Vis alle" name="show_all_button" /> - <scroll_list name="role_list"> - <column label="Rollenavn" name="name" /> - <column label="Titel" name="title" /> - <column label="Medlemmer" name="members" /> - </scroll_list> - <button label="Opret ny rolle..." name="role_create" /> - <button label="Slet rolle" name="role_delete" /> - <string name="help_text"> - Roller har en titel og en tilladelsesliste med rettigheder, -som medlemmerne kan bruge. Medlemmer kan høre til -en eller flere roller. En gruppe kan have op til 10 roller, -inkluderet alle- og ejerroller. - </string> - <string name="cant_delete_role"> - 'Alle-' og 'Ejerroller' er specielle og kan ikke slettes. - </string> - </panel> - <panel label="Rettigheder" name="actions_sub_tab"> - <button label="Søg" name="search_button" /> - <button label="Vis alle" name="show_all_button" /> - <scroll_list name="action_list" tool_tip="Vælg en rettighed for at se flere detaljer"> - <column label="" name="icon" /> - <column label="" name="action" /> - </scroll_list> - <string name="help_text"> - Rettigheder giver medlemmer i roller mulighed for at gøre specifikke -ting i denne gruppe. Der er en bred vifte af rettigheder. - </string> - </panel> - </tab_container> - <panel name="members_footer"> - <text name="static"> - Tildelte roller - </text> - <text name="static2"> - Tilladte rettigheder - </text> - <scroll_list name="member_assigned_roles"> - <column label="" name="checkbox" /> - <column label="" name="role" /> - </scroll_list> - <scroll_list name="member_allowed_actions" - tool_tip="For detaljer om hver tilladte rettighed, se rettighedsfanebladet."> - <column label="" name="icon" /> - <column label="" name="action" /> - </scroll_list> - </panel> - <panel name="roles_footer"> - <text name="static"> - Navn - </text> - <text name="static2"> - Beskrivelse - </text> - <line_editor name="role_name"> - Ansatte - </line_editor> - <text name="static3"> - Titel - </text> - <line_editor name="role_title"> - (venter) - </line_editor> - <text_editor name="role_description"> - (venter) - </text_editor> - <text name="static4"> - Tildelte medlemmer - </text> - <text name="static5" - tool_tip="A list of Abilities the currently selected role can perform."> - Tilladte rettigheder - </text> - <check_box label="Medlemmer er synlige" name="role_visible_in_list" - tool_tip=" Angiver om medlemmer med denne rolle er synlige i fanen 'Generelt' for avatarer uden for gruppen." /> - <scroll_list name="role_allowed_actions" - tool_tip="For detaljer om hver rettighed se under rettigheder fanebladet."> - <column label="" name="icon" /> - <column label="" name="checkbox" /> - <column label="" name="action" /> - </scroll_list> - </panel> - <panel name="actions_footer"> - <text name="static"> - Beskrivelse - </text> - <text_editor name="action_description"> - Denne rettigheder 'Udmeld medlemmer fra denne gruppe'. Kun en ejer kan udmelde en anden ejer. - </text_editor> - <text name="static2"> - Roller med rettighed - </text> - <text name="static3"> - Medlemmer med rettighed - </text> - </panel> -</panel> +<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel label="Medlemmer & roller" name="roles_tab">
+ <panel.string name="default_needs_apply_text">
+ Der er ændringer her, der ikke er gemt.
+ </panel.string>
+ <panel.string name="want_apply_text">
+ Vil du gemme disse ændringer?
+ </panel.string>
+ <tab_container name="roles_tab_container">
+ <panel label="MEDLEMMER" name="members_sub_tab" tool_tip="Medlemmer">
+ <panel.string name="help_text">
+ Du kan tilføje eller fjerne roller, der er tildelt medlemmerne.
+Vælg flere medlemmer ved at holde Ctrl-tasten nede og
+klik på deres navne.
+ </panel.string>
+ <filter_editor label="Filtrér medlemmer" name="filter_input"/>
+ <name_list name="member_list">
+ <name_list.columns label="Medlemsnavn" name="name"/>
+ <name_list.columns label="Doneret leje" name="donated"/>
+ <name_list.columns label="Sidst på den" name="online"/>
+ </name_list>
+ <button label="Invitér nyt medlem" name="member_invite"/>
+ <button label="Udmeld" name="member_eject"/>
+ </panel>
+ <panel label="ROLLER" name="roles_sub_tab">
+ <panel.string name="help_text">
+ Roller har en titel og en tilladelsesliste med rettigheder,
+som medlemmerne kan bruge. Medlemmer kan høre til
+en eller flere roller. En gruppe kan have op til 10 roller,
+inkluderet alle- og ejerroller.
+ </panel.string>
+ <panel.string name="cant_delete_role">
+ 'Alle-' og 'Ejerroller' er specielle og kan ikke slettes.
+ </panel.string>
+ <panel.string name="power_folder_icon">
+ Inv_FolderClosed
+ </panel.string>
+ <filter_editor label="Filtrér roller" name="filter_input"/>
+ <scroll_list name="role_list">
+ <scroll_list.columns label="Rollenavn" name="name"/>
+ <scroll_list.columns label="Titel" name="title"/>
+ <scroll_list.columns label="Medlemmer" name="members"/>
+ </scroll_list>
+ <button label="Opret ny rolle" name="role_create"/>
+ <button label="Slet rolle" name="role_delete"/>
+ </panel>
+ <panel label="RETTIGHEDER" name="actions_sub_tab" tool_tip="Du kan se beskrivelse af rettighed og hvilke roller og medlemmer der har denne rettighed.">
+ <panel.string name="help_text">
+ Rettigheder giver medlemmer i roller mulighed for at gøre specifikke
+ting i denne gruppe. Der er en bred vifte af rettigheder.
+ </panel.string>
+ <filter_editor label="Filtrér rettigheder" name="filter_input"/>
+ <scroll_list name="action_list" tool_tip="Vælg en rettighed for at se flere detaljer">
+ <scroll_list.columns label="" name="icon"/>
+ <scroll_list.columns label="" name="action"/>
+ </scroll_list>
+ </panel>
+ </tab_container>
+ <panel name="members_footer">
+ <text name="static">
+ Tildelte roller
+ </text>
+ <scroll_list name="member_assigned_roles">
+ <scroll_list.columns label="" name="checkbox"/>
+ <scroll_list.columns label="" name="role"/>
+ </scroll_list>
+ <text name="static2">
+ Tilladte rettigheder
+ </text>
+ <scroll_list name="member_allowed_actions" tool_tip="For detaljer om hver tilladte rettighed, se rettighedsfanebladet.">
+ <scroll_list.columns label="" name="icon"/>
+ <scroll_list.columns label="" name="action"/>
+ </scroll_list>
+ </panel>
+ <panel name="roles_footer">
+ <text name="static">
+ Navn
+ </text>
+ <line_editor name="role_name">
+ Ansatte
+ </line_editor>
+ <text name="static3">
+ Titel
+ </text>
+ <line_editor name="role_title">
+ (venter)
+ </line_editor>
+ <text name="static2">
+ Beskrivelse
+ </text>
+ <text_editor name="role_description">
+ (venter)
+ </text_editor>
+ <text name="static4">
+ Tildelte roller
+ </text>
+ <check_box label="Medlemmer er synlige" name="role_visible_in_list" tool_tip="Angiver om medlemmer med denne rolle er synlige i fanen 'Generelt' for avatarer uden for gruppen."/>
+ <text name="static5" tool_tip="A list of Abilities the currently selected role can perform.">
+ Tilladte rettigheder
+ </text>
+ <scroll_list name="role_allowed_actions" tool_tip="For detaljer om hver rettighed se under rettigheder fanebladet.">
+ <scroll_list.columns label="" name="icon"/>
+ <scroll_list.columns label="" name="checkbox"/>
+ <scroll_list.columns label="" name="action"/>
+ </scroll_list>
+ </panel>
+ <panel name="actions_footer">
+ <text name="static">
+ Beskrivelse
+ </text>
+ <text_editor name="action_description">
+ Denne rettigheder 'Udmeld medlemmer fra denne gruppe'. Kun en ejer kan udmelde en anden ejer.
+ </text_editor>
+ <text name="static2">
+ Roller med rettighed
+ </text>
+ <text name="static3">
+ Medlemmer med rettighed
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/da/panel_login.xml b/indra/newview/skins/default/xui/da/panel_login.xml index 1c5b013104..fbef93de69 100644 --- a/indra/newview/skins/default/xui/da/panel_login.xml +++ b/indra/newview/skins/default/xui/da/panel_login.xml @@ -1,37 +1,38 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel name="panel_login"> - <string name="real_url"> - http://secondlife.com/app/login/ - </string> - <string name="forgot_password_url"> - http://secondlife.com/account/request.php - </string> - <text name="first_name_text"> - Fornavn: - </text> - <text name="last_name_text"> - Efternavn: - </text> - <text name="password_text"> - Password: - </text> - <text name="start_location_text"> - Start lokation: - </text> - <combo_box name="start_location_combo"> - <combo_box.item name="MyHome" label="Hjem" /> - <combo_box.item name="MyLastLocation" label="Min sidste lokation" /> - <combo_box.item name="Typeregionname" label="<Skriv navn på region>" /> - </combo_box> - <check_box label="Husk password" name="remember_check" /> - <button label="Log ind" label_selected="Log ind" name="connect_btn" /> - <text name="create_new_account_text"> - Opret bruger - </text> - <text name="forgot_password_text"> - Glemt navn eller password? - </text> - <text name="channel_text"> - [VERSION] - </text> -</panel> +<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_login">
+ <panel.string name="real_url">
+ http://secondlife.com/app/login/
+ </panel.string>
+ <panel.string name="forgot_password_url">
+ http://secondlife.com/account/request.php
+ </panel.string>
+ <panel name="login_widgets">
+ <text name="first_name_text">
+ Fornavn:
+ </text>
+ <line_editor name="first_name_edit" tool_tip="[SECOND_LIFE] Fornavn"/>
+ <text name="last_name_text">
+ Efternavn:
+ </text>
+ <line_editor name="last_name_edit" tool_tip="[SECOND_LIFE] Efternavn"/>
+ <text name="password_text">
+ Password:
+ </text>
+ <button label="Log Ind" label_selected="Log Ind" name="connect_btn"/>
+ <text name="start_location_text">
+ Start lokation:
+ </text>
+ <combo_box name="start_location_combo">
+ <combo_box.item label="Min sidste lokation" name="MyLastLocation"/>
+ <combo_box.item label="Hjem" name="MyHome"/>
+ <combo_box.item label="<Skriv navn på region>" name="Typeregionname"/>
+ </combo_box>
+ <check_box label="Husk password" name="remember_check"/>
+ <text name="create_new_account_text">
+ Opret bruger
+ </text>
+ <text name="forgot_password_text">
+ Glemt navn eller password?
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/da/panel_main_inventory.xml b/indra/newview/skins/default/xui/da/panel_main_inventory.xml new file mode 100644 index 0000000000..e0f99bee93 --- /dev/null +++ b/indra/newview/skins/default/xui/da/panel_main_inventory.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel label="Ting" name="main inventory panel">
+ <panel.string name="Title">
+ Ting
+ </panel.string>
+ <filter_editor label="Filter" name="inventory search editor"/>
+ <tab_container name="inventory filter tabs">
+ <inventory_panel label="Alle ting" name="All Items"/>
+ <inventory_panel label="Nye ting" name="Recent Items"/>
+ </tab_container>
+ <panel name="bottom_panel">
+ <button name="options_gear_btn" tool_tip="Vis flere valgmuligheder"/>
+ <button name="add_btn" tool_tip="Opret ny genstand"/>
+ <dnd_button name="trash_btn" tool_tip="Fjern valgt genstand"/>
+ </panel>
+ <menu_bar name="Inventory Menu">
+ <menu label="Filer" name="File">
+ <menu_item_call label="Åben" name="Open"/>
+ <menu label="Send fil" name="upload">
+ <menu_item_call label="Billede (L$[COST])..." name="Upload Image"/>
+ <menu_item_call label="Lyd (L$[COST])..." name="Upload Sound"/>
+ <menu_item_call label="Animation (L$[COST])..." name="Upload Animation"/>
+ <menu_item_call label="Flere filer (L$[COST] pr. fil)..." name="Bulk Upload"/>
+ </menu>
+ <menu_item_call label="Nyt vindue" name="New Window"/>
+ <menu_item_call label="Vis filtre" name="Show Filters"/>
+ <menu_item_call label="Nulstil filtre" name="Reset Current"/>
+ <menu_item_call label="Luk alle mapper" name="Close All Folders"/>
+ <menu_item_call label="Tøm papirkurv" name="Empty Trash"/>
+ <menu_item_call label="Tøm fundne genstande" name="Empty Lost And Found"/>
+ </menu>
+ <menu label="Opret" name="Create">
+ <menu_item_call label="Ny mappe" name="New Folder"/>
+ <menu_item_call label="Nyt script" name="New Script"/>
+ <menu_item_call label="Ny note" name="New Note"/>
+ <menu_item_call label="Ny bevægelse" name="New Gesture"/>
+ <menu label="Nyt tøj" name="New Clothes">
+ <menu_item_call label="Ny trøje" name="New Shirt"/>
+ <menu_item_call label="Nye bukser" name="New Pants"/>
+ <menu_item_call label="Nye sko" name="New Shoes"/>
+ <menu_item_call label="Nye strømper" name="New Socks"/>
+ <menu_item_call label="Ny jakke" name="New Jacket"/>
+ <menu_item_call label="Ny nederdel" name="New Skirt"/>
+ <menu_item_call label="Nye handsker" name="New Gloves"/>
+ <menu_item_call label="Ny undertrøje" name="New Undershirt"/>
+ <menu_item_call label="Nye underbukser" name="New Underpants"/>
+ <menu_item_call label="Nyt alpha lag" name="New Alpha"/>
+ <menu_item_call label="Ny tatovering" name="New Tattoo"/>
+ </menu>
+ <menu label="Nye kropsdele" name="New Body Parts">
+ <menu_item_call label="Ny kropsbygning" name="New Shape"/>
+ <menu_item_call label="Ny hud" name="New Skin"/>
+ <menu_item_call label="Nyt hår" name="New Hair"/>
+ <menu_item_call label="Nye øjne" name="New Eyes"/>
+ </menu>
+ </menu>
+ <menu label="Sortér" name="Sort">
+ <menu_item_check label="Efter navn" name="By Name"/>
+ <menu_item_check label="Efter dato" name="By Date"/>
+ <menu_item_check label="Altid mapper efter navn" name="Folders Always By Name"/>
+ <menu_item_check label="System-mapper i toppen" name="System Folders To Top"/>
+ </menu>
+ </menu_bar>
+</panel>
diff --git a/indra/newview/skins/default/xui/da/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/da/panel_preferences_advanced.xml index d3d017914d..e8f30c185d 100644 --- a/indra/newview/skins/default/xui/da/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/da/panel_preferences_advanced.xml @@ -1,12 +1,48 @@ -<?xml version="1.0" encoding="utf-8"?> -<panel name="advanced"> - <text name="AspectRatioLabel1" tool_tip="bredde / højde"> - Format: - </text> - <combo_box name="aspect_ratio" tool_tip="bredde/ højde"> - <combo_box.item label="4:3 (Standard CRT)" name="item1"/> - <combo_box.item label="5:4 (1280x1024 LCD)" name="item2"/> - <combo_box.item label="8:5 (Widescreen)" name="item3"/> - <combo_box.item label="16:9 (Widescreen)" name="item4"/> - </combo_box> -</panel> +<?xml version="1.0" encoding="utf-8"?>
+<panel name="advanced">
+ <panel.string name="resolution_format">
+ [RES_X] x [RES_Y]
+ </panel.string>
+ <panel.string name="aspect_ratio_text">
+ [NUM]:[DEN]
+ </panel.string>
+ <check_box label="Talebobler" name="bubble_text_chat"/>
+ <color_swatch name="background" tool_tip="Vælg farve for talebobler"/>
+ <slider label="Gennemsigtighed" name="bubble_chat_opacity"/>
+ <text name="AspectRatioLabel1" tool_tip="bredde / højde">
+ Format
+ </text>
+ <combo_box name="aspect_ratio" tool_tip="bredde/ højde">
+ <combo_box.item label="4:3 (Standard CRT)" name="item1"/>
+ <combo_box.item label="5:4 (1280x1024 LCD)" name="item2"/>
+ <combo_box.item label="8:5 (Widescreen)" name="item3"/>
+ <combo_box.item label="16:9 (Widescreen)" name="item4"/>
+ </combo_box>
+ <check_box label="Registrér automatisk" name="aspect_auto_detect"/>
+ <text name="heading1">
+ Kamera:
+ </text>
+ <slider label="Synsvinkel" name="camera_fov"/>
+ <slider label="Distance" name="camera_offset_scale"/>
+ <text name="heading2">
+ Automatisk positionering for:
+ </text>
+ <check_box label="Byg/Redigér" name="edit_camera_movement" tool_tip="Benyt automatisk kamera positionering ved start og slut af editerings modus"/>
+ <check_box label="Udseende" name="appearance_camera_movement" tool_tip="Benyt automatisk kamera positionering ved redigering"/>
+ <text name="heading3">
+ Avatarer:
+ </text>
+ <check_box label="Vis avatar i førsteperson" name="first_person_avatar_visible"/>
+ <check_box label="Piletaster bruges altid til bevægelse" name="arrow_keys_move_avatar_check"/>
+ <check_box label="Tast-tast-hold for at løbe" name="tap_tap_hold_to_run"/>
+ <check_box label="Bevæg avatarlæber når der tales" name="enable_lip_sync"/>
+ <check_box label="Vis scriptfejl" name="show_script_errors"/>
+ <radio_group name="show_location">
+ <radio_item label="I chat" name="0"/>
+ <radio_item label="I et vindue" name="1"/>
+ </radio_group>
+ <check_box label="Knap til aktivering af mikrofon:" name="push_to_talk_toggle_check" tool_tip="I walkie-talkie-modus sendes stemme kun når knappen er trykket ned, ellers vil tryk på knap tænde og slukke mikrofon."/>
+ <line_editor label="Brug walkie-talkie modus" name="modifier_combo"/>
+ <button label="Angiv taste" name="set_voice_hotkey_button"/>
+ <button label="Midterste museknap" name="set_voice_middlemouse_button"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/da/panel_preferences_alerts.xml b/indra/newview/skins/default/xui/da/panel_preferences_alerts.xml index c7a49ef307..cc3972238e 100644 --- a/indra/newview/skins/default/xui/da/panel_preferences_alerts.xml +++ b/indra/newview/skins/default/xui/da/panel_preferences_alerts.xml @@ -1,20 +1,14 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel label="Popups" name="popups" title="Popups"> - <text name="dont_show_label"> - Vis ikke disse popups: - </text> - <button label="Aktivér denne popup" name="enable_popup" /> - <button label="Aktivér alle popups..." name="reset_dialogs_btn" - tool_tip="Viser alle de valgfrie popups og 'første gangs' beskeder." /> - <text name="show_label"> - Vis disse popups: - </text> - <button label="Deaktivér alle disse popups..." name="skip_dialogs_btn" - tool_tip="Viser ingen af de valgfrie popups og 'første gangs' beskeder." /> - <text name="text_box2" width="310"> - Ved tilbud om tekstdokumenter, teksturer og landemærker: - </text> - <check_box label="Accepter automatisk" name="accept_new_inventory" /> - <check_box label="Vis automatisk efter accept" name="show_new_inventory" /> - <check_box label="Vis nye objekter i beholdning automatisk" name="show_in_inventory" /> -</panel> +<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel label="Popups" name="popups" title="Popups">
+ <text name="tell_me_label">
+ Vis mig når:
+ </text>
+ <check_box label="Når jeg bruger eller får L$" name="notify_money_change_checkbox"/>
+ <check_box label="Når mine venner logger af eller på" name="friends_online_notify_checkbox"/>
+ <text name="show_label">
+ Vis altid disse beskeder:
+ </text>
+ <text name="dont_show_label">
+ Vis aldrig disse beskeder:
+ </text>
+</panel>
diff --git a/indra/newview/skins/default/xui/da/panel_preferences_chat.xml b/indra/newview/skins/default/xui/da/panel_preferences_chat.xml index dee42b4de5..b141998451 100644 --- a/indra/newview/skins/default/xui/da/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/da/panel_preferences_chat.xml @@ -1,61 +1,42 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel label="Tekst chat" name="chat"> - <text name="text_box"> - Chat skriftstørrelse: - </text> - <radio_group name="chat_font_size"> - <radio_item name="radio" label="Lille" /> - <radio_item name="radio2" label="Mellem" /> - <radio_item name="radio3" label="Stor" /> - </radio_group> - <color_swatch label="Dig" name="user"/> - <text name="text_box1"> - Dig - </text> - <color_swatch label="Andre" name="agent"/> - <text name="text_box2"> - Andre - </text> - <color_swatch label="IM" name="im"/> - <text name="text_box3"> - IM - </text> - <color_swatch label="System" name="system"/> - <text name="text_box4"> - System - </text> - <color_swatch label="Fejl" name="script_error"/> - <text name="text_box5"> - Fejl - </text> - <color_swatch label="Objekter" name="objects"/> - <text name="text_box6"> - Objekter - </text> - <color_swatch label="Ejer" name="owner"/> - <text name="text_box7"> - Ejer - </text> - <color_swatch label="Bobler" name="background"/> - <text name="text_box8"> - Bobler - </text> - <color_swatch label="URL'er" name="links"/> - <text name="text_box9"> - URL'er - </text> - <check_box label="Vis script fejl og advarsler i almindelig chat" - name="script_errors_as_chat" /> - <spinner label="Udfas chat efter" name="fade_chat_time" label_width="90" width="140" /> - <spinner left="350" name="max_chat_count"/> - <slider label="Gennemsigtighed" name="console_opacity" /> - <check_box label="Brug fuldskærms bredde (Kræver genstart)" - name="chat_full_width_check" /> - <check_box label="Luk chat efter tryk på enter" name="close_chat_on_return_check" /> - <check_box label="Piletaster flytter altid figur under chat" - name="arrow_keys_move_avatar_check" /> - <check_box label="Vis klokkeslæt i lokal chat" name="show_timestamps_check" /> - <check_box label="Afspil skrive animation ved chat" name="play_typing_animation" /> - <check_box label="Vis chat bobler" name="bubble_text_chat" /> - <slider label="Gennemsigtighed" name="bubble_chat_opacity" /> -</panel> +<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel label="Tekst chat" name="chat">
+ <radio_group name="chat_font_size">
+ <radio_item label="Lille" name="radio"/>
+ <radio_item label="Mellem" name="radio2"/>
+ <radio_item label="Stor" name="radio3"/>
+ </radio_group>
+ <color_swatch label="Dig" name="user"/>
+ <text name="text_box1">
+ Dig
+ </text>
+ <color_swatch label="Andre" name="agent"/>
+ <text name="text_box2">
+ Andre
+ </text>
+ <color_swatch label="IM" name="im"/>
+ <text name="text_box3">
+ IM
+ </text>
+ <color_swatch label="System" name="system"/>
+ <text name="text_box4">
+ System
+ </text>
+ <color_swatch label="Fejl" name="script_error"/>
+ <text name="text_box5">
+ Fejl
+ </text>
+ <color_swatch label="Objekter" name="objects"/>
+ <text name="text_box6">
+ Objekter
+ </text>
+ <color_swatch label="Ejer" name="owner"/>
+ <text name="text_box7">
+ Ejer
+ </text>
+ <color_swatch label="URL'er" name="links"/>
+ <text name="text_box9">
+ URL'er
+ </text>
+ <check_box initial_value="true" label="Afspil skrive animation ved chat" name="play_typing_animation"/>
+ <check_box label="Send e-mail til mig når jeg modtager IM og er offline" name="send_im_to_email"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/da/panel_preferences_sound.xml b/indra/newview/skins/default/xui/da/panel_preferences_sound.xml index d50c05a192..c032e414c1 100644 --- a/indra/newview/skins/default/xui/da/panel_preferences_sound.xml +++ b/indra/newview/skins/default/xui/da/panel_preferences_sound.xml @@ -1,40 +1,38 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel label="Lyd & video" name="Preference Media panel"> - <slider label="Generel" name="System Volume"/> - <slider label="Omgivelser" name="Wind Volume"/> - <slider label="Effekter" name="SFX Volume"/> - <slider label="Media" name="Media Volume"/> - <slider label="Brugerflade" name="UI Volume"/> - <slider label="Musik" name="Music Volume"/> - <slider label="Tale" name="Voice Volume"/> - <text_editor name="voice_unavailable"> - Stemme chat er ikke tilgængelig - </text_editor> - <check_box label="Aktivér stemme chat" name="enable_voice_check"/> - <radio_group name="ear_location"> - <radio_item name="0" label="Hør stemmer fra kamera position" /> - <radio_item name="1" label="Hør stemmer fra avatar position" /> - </radio_group> - <button label="Enheds Indstillinger" name="device_settings_btn"/> - <text name="muting_text"> - Lydstyrke: - </text> - <text name="streaming_prefs_text"> - Streaming indstillinger: - </text> - <text name="audio_prefs_text"> - Lyd indstillinger: - </text> - <panel label="Lydstyrke" name="Volume Panel" /> - <check_box label="Afspil musik når det er muligt" - name="streaming_music" /> - <check_box label="Afspil video når det er muligt" - name="streaming_video" /> - <check_box label="Afspil automatisk medie" name="auto_streaming_video" /> - <check_box label="Sluk lyd når vinduet er minimeret" name="mute_when_minimized" /> - <slider label="Doppler effekt" name="Doppler Effect" /> - <slider label="Rækkevidde" name="Distance Factor" /> - <slider label="Styrkefald/afstand" name="Rolloff Factor" /> - <spinner label="Penge lydstyrke" name="L$ Change Threshold" /> - <spinner label="Livspoint lydstyrke" name="Health Change Threshold" /> -</panel> +<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel label="Lyde" name="Preference Media panel">
+ <slider label="Generel" name="System Volume"/>
+ <check_box initial_value="true" label="Sluk lyd når vinduet er minimeret" name="mute_when_minimized"/>
+ <slider label="Omgivelser" name="Wind Volume"/>
+ <slider label="Knapper" name="UI Volume"/>
+ <slider label="Media" name="Media Volume"/>
+ <slider label="Effekter" name="SFX Volume"/>
+ <slider label="Musik" name="Music Volume"/>
+ <check_box label="Tale" name="enable_voice_check"/>
+ <slider label="Tale" name="Voice Volume"/>
+ <text name="Listen from">
+ Hør stemmer fra:
+ </text>
+ <radio_group name="ear_location">
+ <radio_item label="Kamera position" name="0"/>
+ <radio_item label="Avatar position" name="1"/>
+ </radio_group>
+ <button label="Input/Output enheder" name="device_settings_btn"/>
+ <panel label="Enhedsopsætning" name="device_settings_panel">
+ <panel.string name="default_text">
+ Standard
+ </panel.string>
+ <text name="Input">
+ Input
+ </text>
+ <text name="My volume label">
+ Min lydstyrke:
+ </text>
+ <slider_bar initial_value="1.0" name="mic_volume_slider" tool_tip="Ændre lydstyrke med denne skyder"/>
+ <text name="wait_text">
+ Vent venligst
+ </text>
+ <text name="Output">
+ Output
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/da/panel_world_map.xml b/indra/newview/skins/default/xui/da/panel_world_map.xml index d2ae3ab116..f8bdaa9953 100644 --- a/indra/newview/skins/default/xui/da/panel_world_map.xml +++ b/indra/newview/skins/default/xui/da/panel_world_map.xml @@ -1,51 +1,57 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="world_map"> - <panel.string name="world_map_north"> - N - </panel.string> - <panel.string name="world_map_east"> - Ø - </panel.string> - <panel.string name="world_map_west"> - V - </panel.string> - <panel.string name="world_map_south"> - S - </panel.string> - <panel.string name="world_map_southeast"> - SØ - </panel.string> - <panel.string name="world_map_northeast"> - NØ - </panel.string> - <panel.string name="world_map_southwest"> - SV - </panel.string> - <panel.string name="world_map_northwest"> - NV - </panel.string> - <text label="N" name="floater_map_north" text="N"> - N - </text> - <text label="Ø" name="floater_map_east" text="Ø"> - Ø - </text> - <text label="V" name="floater_map_west" text="V"> - V - </text> - <text label="S" name="floater_map_south" text="S"> - S - </text> - <text label="SØ" name="floater_map_southeast" text="SØ"> - SØ - </text> - <text label="NØ" name="floater_map_northeast" text="NØ"> - NØ - </text> - <text label="SV" name="floater_map_southwest" text="SV"> - SV - </text> - <text label="NV" name="floater_map_northwest" text="NV"> - NV - </text> -</panel> +<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="world_map">
+ <panel.string name="Loading">
+ Henter...
+ </panel.string>
+ <panel.string name="InvalidLocation">
+ Ugyldig lokation
+ </panel.string>
+ <panel.string name="world_map_north">
+ N
+ </panel.string>
+ <panel.string name="world_map_east">
+ Ø
+ </panel.string>
+ <panel.string name="world_map_west">
+ V
+ </panel.string>
+ <panel.string name="world_map_south">
+ S
+ </panel.string>
+ <panel.string name="world_map_southeast">
+ SØ
+ </panel.string>
+ <panel.string name="world_map_northeast">
+ NØ
+ </panel.string>
+ <panel.string name="world_map_southwest">
+ SV
+ </panel.string>
+ <panel.string name="world_map_northwest">
+ NV
+ </panel.string>
+ <text label="N" name="floater_map_north" text="N">
+ N
+ </text>
+ <text label="Ø" name="floater_map_east" text="Ø">
+ Ø
+ </text>
+ <text label="V" name="floater_map_west" text="V">
+ V
+ </text>
+ <text label="S" name="floater_map_south" text="S">
+ S
+ </text>
+ <text label="SØ" name="floater_map_southeast" text="SØ">
+ SØ
+ </text>
+ <text label="NØ" name="floater_map_northeast" text="NØ">
+ NØ
+ </text>
+ <text label="SV" name="floater_map_southwest" text="SV">
+ SV
+ </text>
+ <text label="NV" name="floater_map_northwest" text="NV">
+ NV
+ </text>
+</panel>
diff --git a/indra/newview/skins/default/xui/da/strings.xml b/indra/newview/skins/default/xui/da/strings.xml index 945833d57a..155714363e 100644 --- a/indra/newview/skins/default/xui/da/strings.xml +++ b/indra/newview/skins/default/xui/da/strings.xml @@ -1,654 +1,3242 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<!-- This file contains strings that used to be hardcoded in the source. - It is only for those strings which do not belong in a floater. - For example, the strings used in avatar chat bubbles, and strings - that are returned from one component and may appear in many places--> -<strings> - <string name="LoginInProgress"> - Logger p. [APP_NAME] kan virke laast. Vent venligst. - </string> - <string name="LoginAuthenticating"> - Validerer adgang - </string> - <string name="LoginMaintenance"> - Udfører konto vedligeholdelse... - </string> - <string name="LoginAttempt"> - Tidligere forsø på login fejlede. Logger på, forsøg [NUMBER] - </string> - <string name="LoginPrecaching"> - verden... - </string> - <string name="LoginInitializingBrowser"> - Klargør indbyggede web browser... - </string> - <string name="LoginInitializingMultimedia"> - Klargør multimedia... - </string> - <string name="LoginVerifyingCache"> - Verificérer cache filer (kan tage 60-90 sekunder)... - </string> - <string name="LoginProcessingResponse"> - Behandler svar... - </string> - <string name="LoginInitializingWorld"> - Initialiserer verden... - </string> - <string name="LoginDecodingImages"> - Behandler billeder... - </string> - <string name="LoginInitializingQuicktime"> - Initialiserer QuickTime... - </string> - <string name="LoginQuicktimeNotFound"> - QuickTime ikke fundet- kunne derfor ikke initialisere. - </string> - <string name="LoginQuicktimeOK"> - QuickTime initialiseret. - </string> - <string name="LoginWaitingForRegionHandshake"> - Venter på svar fra region... - </string> - <string name="LoginConnectingToRegion"> - Tilslutter til region... - </string> - <string name="LoginDownloadingClothing"> - Henter tøj... - </string> - <string name="AgentLostConnection"> - Denne region kan have problemer. Tjek venligst din forbindelse til internettet. - </string> - <string name="TooltipPerson"> - Person - </string> - <string name="TooltipNoName"> - (intet navn) - </string> - <string name="TooltipOwner"> - Ejer: - </string> - <string name="TooltipPublic"> - Offentlig - </string> - <string name="TooltipIsGroup"> - (Gruppe) - </string> - <string name="TooltipFlagScript"> - Script - </string> - <string name="TooltipFlagPhysics"> - Fysik - </string> - <string name="TooltipFlagTouch"> - Rør - </string> - <string name="TooltipFlagL$"> - L$ - </string> - <string name="TooltipFlagDropInventory"> - Drop beholdning - </string> - <string name="TooltipFlagPhantom"> - Fantom - </string> - <string name="TooltipFlagTemporary"> - Temporær - </string> - <string name="TooltipFlagRightClickMenu"> - (Højre-klik for menu) - </string> - <string name="TooltipFreeToCopy"> - Kan kopieres - </string> - <string name="TooltipForSaleL$"> - Til salg: L$[AMOUNT] - </string> - <string name="TooltipForSaleMsg"> - Til salg: [MESSAGE] - </string> - <string name="TooltipFlagGroupBuild"> - Gruppe byg - </string> - <string name="TooltipFlagNoBuild"> - Må ikke bygge - </string> - <string name="TooltipFlagNoEdit"> - Gruppe byg - </string> - <string name="TooltipFlagNotSafe"> - Ikke sikker område - </string> - <string name="TooltipFlagNoFly"> - Ingen flyvning - </string> - <string name="TooltipFlagGroupScripts"> - Gruppe scripts - </string> - <string name="TooltipFlagNoScripts"> - Ingen Scripts - </string> - <string name="TooltipLand"> - Land: - </string> - <string name="TooltipMustSingleDrop"> - Kun et enkelt element kan trækkes ind her - </string> - <string name="RetrievingData"> - Henter... - </string> - <string name="ReleaseNotes"> - Noter om version - </string> - <string name="LoadingData"> - Henter... - </string> - <string name="AvatarNameNobody"> - (ingen) - </string> - <string name="AvatarNameWaiting"> - (venter) - </string> - <string name="AvatarNameHippos"> - (hippos) - </string> - <string name="GroupNameNone"> - (ingen) - </string> - <string name="AssetErrorNone"> - Ingen fejl - </string> - <string name="AssetErrorRequestFailed"> - Element forespørgsel: fejlede - </string> - <string name="AssetErrorNonexistentFile"> - Element forespørgsel: fil findes ikke - </string> - <string name="AssetErrorNotInDatabase"> - Element forespørgsel: element ikke fundet i database - </string> - <string name="AssetErrorEOF"> - Slutning af fil - </string> - <string name="AssetErrorCannotOpenFile"> - Kan ikke åbne fil - </string> - <string name="AssetErrorFileNotFound"> - Fil ikke fundet - </string> - <string name="AssetErrorTCPTimeout"> - Tidsgrænse overskredet ved filhentning - </string> - <string name="AssetErrorCircuitGone"> - Forbindelsen mistet - </string> - <string name="AssetErrorPriceMismatch"> - [APP_NAME] klient og server er uenige om prisen - </string> - <string name="AssetErrorUnknownStatus"> - Ukendt status - </string> - <string name="AvatarEditingApparance"> - (Ændrer udseende) - </string> - <string name="AvatarAway"> - Væk - </string> - <string name="AvatarBusy"> - Optaget - </string> - <string name="AvatarMuted"> - Blokeret - </string> - <string name="anim_express_afraid"> - Bange - </string> - <string name="anim_express_anger"> - Vred - </string> - <string name="anim_away"> - Væk - </string> - <string name="anim_backflip"> - Baglæns salto - </string> - <string name="anim_express_laugh"> - Hjertelig latter - </string> - <string name="anim_express_toothsmile"> - Stort smil - </string> - <string name="anim_blowkiss"> - Sende kys - </string> - <string name="anim_express_bored"> - Keder sig - </string> - <string name="anim_bow"> - Buk - </string> - <string name="anim_clap"> - Klap - </string> - <string name="anim_courtbow"> - Højtideligt buk - </string> - <string name="anim_express_cry"> - Græd - </string> - <string name="anim_dance1"> - Dans 1 - </string> - <string name="anim_dance2"> - Dans 2 - </string> - <string name="anim_dance3"> - Dans 3 - </string> - <string name="anim_dance4"> - Dans 4 - </string> - <string name="anim_dance5"> - Dans 5 - </string> - <string name="anim_dance6"> - Dans 6 - </string> - <string name="anim_dance7"> - Dans 7 - </string> - <string name="anim_dance8"> - Dans 8 - </string> - <string name="anim_express_disdain"> - Foragt - </string> - <string name="anim_drink"> - Drik - </string> - <string name="anim_express_embarrased"> - Flov - </string> - <string name="anim_angry_fingerwag"> - Løftet finger - </string> - <string name="anim_fist_pump"> - Knytnæve - </string> - <string name="anim_yoga_float"> - Svævende yoga - </string> - <string name="anim_express_frown"> - Mistroisk - </string> - <string name="anim_impatient"> - Utålmodig - </string> - <string name="anim_jumpforjoy"> - Glædeshop - </string> - <string name="anim_kissmybutt"> - Kys min r.. - </string> - <string name="anim_express_kiss"> - Kys - </string> - <string name="anim_laugh_short"> - Grin - </string> - <string name="anim_musclebeach"> - Bodybuilder - </string> - <string name="anim_no_unhappy"> - Nej (sur) - </string> - <string name="anim_no_head"> - Nej - </string> - <string name="anim_nyanya"> - Æv-bæv - </string> - <string name="anim_punch_onetwo"> - Et-to slag - </string> - <string name="anim_express_open_mouth"> - Åben mund - </string> - <string name="anim_peace"> - Peace - </string> - <string name="anim_point_you"> - Peg på andre - </string> - <string name="anim_point_me"> - Peg på dig selv - </string> - <string name="anim_punch_l"> - Slå venstre - </string> - <string name="anim_punch_r"> - Slå højre - </string> - <string name="anim_rps_countdown"> - SSP - Tæl - </string> - <string name="anim_rps_paper"> - SSP - Papir - </string> - <string name="anim_rps_rock"> - SSP - Sten - </string> - <string name="anim_rps_scissors"> - SSP - Saks - </string> - <string name="anim_express_repulsed"> - Misfornøjet - </string> - <string name="anim_kick_roundhouse_r"> - Karatepark - </string> - <string name="anim_express_sad"> - Ked af det - </string> - <string name="anim_salute"> - Honnør - </string> - <string name="anim_shout"> - Råb - </string> - <string name="anim_express_shrug"> - Skuldertræk - </string> - <string name="anim_express_smile"> - Smil - </string> - <string name="anim_smoke_idle"> - Ryg - </string> - <string name="anim_smoke_inhale"> - Indhalér - </string> - <string name="anim_smoke_throw_down"> - Smid cigaret - </string> - <string name="anim_express_surprise"> - Overrasket - </string> - <string name="anim_sword_strike_r"> - Sværdslag - </string> - <string name="anim_angry_tantrum"> - Ekstatisk - </string> - <string name="anim_express_tongue_out"> - Tunge ud - </string> - <string name="anim_hello"> - Vink - </string> - <string name="anim_whisper"> - Knib øje i - </string> - <string name="anim_whistle"> - Pift - </string> - <string name="anim_express_wink"> - Blink - </string> - <string name="anim_wink_hollywood"> - Blink (Hollywood) - </string> - <string name="anim_express_worry"> - Bekymret - </string> - <string name="anim_yes_happy"> - Ja (glad) - </string> - <string name="anim_yes_head"> - Ja - </string> - <string name="texture_loading"> - Henter... - </string> - <string name="worldmap_offline"> - Offline - </string> - <string name="whisper"> - hvisker: - </string> - <string name="shout"> - råber: - </string> - <string name="SIM_ACCESS_PG"> - PG - </string> - <string name="SIM_ACCESS_MATURE"> - Mature - </string> - <string name="SIM_ACCESS_ADULT"> - Adult - </string> - <string name="SIM_ACCESS_DOWN"> - logget af - </string> - <string name="SIM_ACCESS_MIN"> - Ukendt - </string> - <string name="land_type_unknown"> - (ukendt) - </string> - <string name="covenant_never_modified">Sidst ændret: (aldrig)</string> - <string name="covenant_modified">Sidst ændret: </string> - <string name="all_files"> - Alle filer - </string> - <string name="sound_files"> - Lyde - </string> - <string name="animation_files"> - Animationer - </string> - <string name="image_files"> - Billeder - </string> - <string name="save_file_verb"> - Gem - </string> - <string name="load_file_verb"> - Hent - </string> - <string name="targa_image_files"> - Targa billeder - </string> - <string name="bitmap_image_files"> - Bitmap billeder - </string> - <string name="avi_movie_file"> - AVI film fil - </string> - <string name="xaf_animation_file"> - XAF Anim Fil - </string> - <string name="xml_file"> - XML Fil - </string> - <string name="dot_raw_file"> - RAW Fil - </string> - <string name="compressed_image_files"> - Komprimerede billeder - </string> - <string name="load_files"> - Hent filer - </string> - <string name="choose_the_directory"> - Vælg bibliotek - </string> - <string name="accel-mac-control"> - ⌃ - </string> - <string name="accel-mac-command"> - ⌘ - </string> - <string name="accel-mac-option"> - ⌥ - </string> - <string name="accel-mac-shift"> - ⇧ - </string> - <string name="accel-win-control"> - Ctrl+ - </string> - <string name="accel-win-alt"> - Alt+ - </string> - <string name="accel-win-shift"> - Shift+ - </string> - <string name="GraphicsQualityLow"> - Lav - </string> - <string name="GraphicsQualityMid"> - Middel - </string> - <string name="GraphicsQualityHigh"> - Høj - </string> - - <!-- PARCEL_CATEGORY_UI_STRING --> - <string name="Linden Location">Linden sted</string> - <string name="Adult">Adult</string> - <string name="Arts&Culture">Kunst & kultur</string> - <string name="Business">Business</string> - <string name="Educational">Uddannelse</string> - <string name="Gaming">Spil</string> - <string name="Hangout">Afslapning</string> - <string name="Newcomer Friendly">Nybegynder venligt</string> - <string name="Parks&Nature">Parker & natur</string> - <string name="Residential">Beboelse</string> - <string name="Shopping">Indkøb</string> - <string name="Other">Andet</string> - - <string name="ringing"> - Forbinder til stemmechat... - </string> - <string name="connected"> - Forbundet - </string> - <string name="unavailable"> - Stemmechat er ikke tilladt hvor du befinder dig - </string> - <string name="hang_up"> - Stemme chat er afbrudt - </string> - <string name="ScriptQuestionCautionChatGranted"> - '[OBJECTNAME]', en genstand, ejet af '[OWNERNAME]', lokaliseret i [REGIONNAME] på [REGIONPOS], har fået tilladelse til: [PERMISSIONS]. - </string> - <string name="ScriptQuestionCautionChatDenied"> - '[OBJECTNAME]', en genstand, ejet af '[OWNERNAME]', lokaliseret i [REGIONNAME] på [REGIONPOS], er afvist tilladelse til: [PERMISSIONS]. - </string> - <string name="ScriptTakeMoney"> - Tag Linden dollars (L$) fra dig - </string> - <string name="ActOnControlInputs"> - Reagér på dine kontrol-taster - </string> - <string name="RemapControlInputs"> - Ændre dine kontrol-taster - </string> - <string name="AnimateYourAvatar"> - Animér din avatar - </string> - <string name="AttachToYourAvatar"> - Sæt på din avatar - </string> - <string name="ReleaseOwnership"> - Fjern ejerskabet og sæt til offentlig - </string> - <string name="LinkAndDelink"> - Sammenkæd og adskil andre genstande - </string> - <string name="AddAndRemoveJoints"> - Tilføj og fjern sammenkødninger med andre genstande - </string> - <string name="ChangePermissions"> - Ændre dens tilladelser - </string> - <string name="TrackYourCamera"> - Spor dit kamera - </string> - <string name="ControlYourCamera"> - Kontrollér dit kamera - </string> - <string name="only_user_message"> - Du er den eneste deltager i denne samtale - </string> - <string name="offline_message"> - [FIRST] [LAST] er ikke logget på. - </string> - <string name="invite_message"> - Tryk på [BUTTON NAME] knappen for at acceptére/tilslutte til denne stemme chat. - </string> - <string name="muted_message"> - Du har blokeret denne beboer. Hvis du starter en samtale vil denne blokering automatisk blive fjernet. - </string> - <string name="generic_request_error"> - Kunne ikke etablere forbindelse, prøv igen senere - </string> - <string name="insufficient_perms_error"> - Du har ikke de fornødne rettigheder. - </string> - <string name="session_does_not_exist_error"> - Denne samtale er lukket ned - </string> - <string name="no_ability_error"> - Du har ikke den mulighed. - </string> - <string name="no_ability"> - Du har ikke den mulighed. - </string> - <string name="not_a_mod_error"> - Du er ikke moderator for denne samtale. - </string> - <string name="muted_error"> - Du er blevet "blokeret". - </string> - <string name="add_session_event"> - Ikke muligt at tilføge brugere til samtale med [RECIPIENT]. - </string> - <string name="message_session_event"> - Ikke muligt at sende din besked til samtalen med [RECIPIENT]. - </string> - <string name="removed_from_group"> - Du er blevet fjernet fra gruppen. - </string> - <string name="close_on_no_ability"> - Du har ikke længere mulighed for at deltage i samtalen - </string> - <string name="AcctTypeResident"> - Beboer - </string> - <string name="AcctTypeTrial"> - På prøve - </string> - <string name="AcctTypeCharterMember"> - æresmedlem - </string> - <string name="AcctTypeEmployee"> - Linden Lab medarbejder - </string> - <string name="PaymentInfoUsed"> - Betalende medlem - </string> - <string name="PaymentInfoOnFile"> - Registreret betalende - </string> - <string name="NoPaymentInfoOnFile"> - Ingen betalingsinfo - </string> - <string name="AgeVerified"> - Alders-checket - </string> - <string name="NotAgeVerified"> - Ikke alders-checket - </string> -</strings> +<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<!-- This file contains strings that used to be hardcoded in the source.
+ It is only for those strings which do not belong in a floater.
+ For example, the strings used in avatar chat bubbles, and strings
+ that are returned from one component and may appear in many places-->
+<strings>
+ <string name="SUPPORT_SITE">
+ Second Life Support Portal
+ </string>
+ <string name="StartupDetectingHardware">
+ Detekterer hardware...
+ </string>
+ <string name="StartupLoading">
+ Indlæser
+ </string>
+ <string name="LoginInProgress">
+ Logger p. [APP_NAME] kan virke laast. Vent venligst.
+ </string>
+ <string name="LoginInProgressNoFrozen">
+ Logger på...
+ </string>
+ <string name="LoginAuthenticating">
+ Validerer adgang
+ </string>
+ <string name="LoginMaintenance">
+ Udfører konto vedligeholdelse...
+ </string>
+ <string name="LoginAttempt">
+ Tidligere forsø på login fejlede. Logger på, forsøg [NUMBER]
+ </string>
+ <string name="LoginPrecaching">
+ verden...
+ </string>
+ <string name="LoginInitializingBrowser">
+ Klargør indbyggede web browser...
+ </string>
+ <string name="LoginInitializingMultimedia">
+ Klargør multimedia...
+ </string>
+ <string name="LoginInitializingFonts">
+ Indlæser fonts...
+ </string>
+ <string name="LoginVerifyingCache">
+ Checker cache filer (kan tage 60-90 sekunder)...
+ </string>
+ <string name="LoginProcessingResponse">
+ Behandler svar ...
+ </string>
+ <string name="LoginInitializingWorld">
+ Initialiserer verden...
+ </string>
+ <string name="LoginDecodingImages">
+ Behandler billeder...
+ </string>
+ <string name="LoginInitializingQuicktime">
+ Initialiserer QuickTime...
+ </string>
+ <string name="LoginQuicktimeNotFound">
+ QuickTime ikke fundet- kunne derfor ikke initialisere.
+ </string>
+ <string name="LoginQuicktimeOK">
+ QuickTime initialiseret.
+ </string>
+ <string name="LoginWaitingForRegionHandshake">
+ Venter på svar fra region...
+ </string>
+ <string name="LoginConnectingToRegion">
+ Tilslutter til region...
+ </string>
+ <string name="LoginDownloadingClothing">
+ Henter tøj...
+ </string>
+ <string name="LoginFailedNoNetwork">
+ Netværksfejl: Kunne ikke etablere forbindelse, check venligst din netværksforbindelse.
+ </string>
+ <string name="Quit">
+ Afslut
+ </string>
+ <string name="AgentLostConnection">
+ Denne region kan have problemer. Tjek venligst din forbindelse til internettet.
+ </string>
+ <string name="TooltipPerson">
+ Person
+ </string>
+ <string name="TooltipNoName">
+ (intet navn)
+ </string>
+ <string name="TooltipOwner">
+ Ejer:
+ </string>
+ <string name="TooltipPublic">
+ Offentlig
+ </string>
+ <string name="TooltipIsGroup">
+ (Gruppe)
+ </string>
+ <string name="TooltipForSaleL$">
+ Til salg: L$[AMOUNT]
+ </string>
+ <string name="TooltipFlagGroupBuild">
+ Gruppe byg
+ </string>
+ <string name="TooltipFlagNoBuild">
+ Må ikke bygge
+ </string>
+ <string name="TooltipFlagNoEdit">
+ Gruppe byg
+ </string>
+ <string name="TooltipFlagNotSafe">
+ Ikke sikker område
+ </string>
+ <string name="TooltipFlagNoFly">
+ Ingen flyvning
+ </string>
+ <string name="TooltipFlagGroupScripts">
+ Gruppe scripts
+ </string>
+ <string name="TooltipFlagNoScripts">
+ Ingen Scripts
+ </string>
+ <string name="TooltipLand">
+ Land:
+ </string>
+ <string name="TooltipMustSingleDrop">
+ Kun et enkelt element kan trækkes ind her
+ </string>
+ <string name="TooltipHttpUrl">
+ Klik for at se denne hjemmeside
+ </string>
+ <string name="TooltipSLURL">
+ Klik for at se information om denne lokation
+ </string>
+ <string name="TooltipAgentUrl">
+ Klik for at denne beboers profil
+ </string>
+ <string name="TooltipGroupUrl">
+ Klik for at se denne gruppes beskrivelse
+ </string>
+ <string name="TooltipEventUrl">
+ Klik for at se beskrivelse af denne event
+ </string>
+ <string name="TooltipClassifiedUrl">
+ Klik for at se denne annonce
+ </string>
+ <string name="TooltipParcelUrl">
+ Klik for at se beskrivelse for denne parcel
+ </string>
+ <string name="TooltipTeleportUrl">
+ Klik for at teleportere til denne lokation
+ </string>
+ <string name="TooltipObjectIMUrl">
+ Klik for at se beskrivelse for dette objekt
+ </string>
+ <string name="TooltipMapUrl">
+ Klik for at se denne lokation på kortet
+ </string>
+ <string name="TooltipSLAPP">
+ Klik for at starte secondlife:// kommando
+ </string>
+ <string name="CurrentURL" value=" Nuværende URL: [CurrentURL]"/>
+ <string name="SLurlLabelTeleport">
+ Teleportér til
+ </string>
+ <string name="SLurlLabelShowOnMap">
+ Vis kort for
+ </string>
+ <string name="BUTTON_CLOSE_DARWIN">
+ Luk (⌘W)
+ </string>
+ <string name="BUTTON_CLOSE_WIN">
+ Luk (Ctrl+W)
+ </string>
+ <string name="BUTTON_RESTORE">
+ Gendan
+ </string>
+ <string name="BUTTON_MINIMIZE">
+ Minimér
+ </string>
+ <string name="BUTTON_TEAR_OFF">
+ Løsriv
+ </string>
+ <string name="BUTTON_DOCK">
+ Fastgør
+ </string>
+ <string name="BUTTON_UNDOCK">
+ Frigør
+ </string>
+ <string name="BUTTON_HELP">
+ Vis hjælp
+ </string>
+ <string name="Searching">
+ Søger...
+ </string>
+ <string name="NoneFound">
+ Intet fundet.
+ </string>
+ <string name="RetrievingData">
+ Henter...
+ </string>
+ <string name="ReleaseNotes">
+ Noter om version
+ </string>
+ <string name="LoadingData">
+ Henter...
+ </string>
+ <string name="AvatarNameNobody">
+ (ingen)
+ </string>
+ <string name="AvatarNameWaiting">
+ (venter)
+ </string>
+ <string name="AvatarNameHippos">
+ (hippos)
+ </string>
+ <string name="GroupNameNone">
+ (ingen)
+ </string>
+ <string name="AssetErrorNone">
+ Ingen fejl
+ </string>
+ <string name="AssetErrorRequestFailed">
+ Element forespørgsel: fejlede
+ </string>
+ <string name="AssetErrorNonexistentFile">
+ Element forespørgsel: fil findes ikke
+ </string>
+ <string name="AssetErrorNotInDatabase">
+ Element forespørgsel: element ikke fundet i database
+ </string>
+ <string name="AssetErrorEOF">
+ Slutning af fil
+ </string>
+ <string name="AssetErrorCannotOpenFile">
+ Kan ikke åbne fil
+ </string>
+ <string name="AssetErrorFileNotFound">
+ Fil ikke fundet
+ </string>
+ <string name="AssetErrorTCPTimeout">
+ Tidsgrænse overskredet ved filhentning
+ </string>
+ <string name="AssetErrorCircuitGone">
+ Forbindelsen mistet
+ </string>
+ <string name="AssetErrorPriceMismatch">
+ [APP_NAME] klient og server er uenige om prisen
+ </string>
+ <string name="AssetErrorUnknownStatus">
+ Ukendt status
+ </string>
+ <string name="texture">
+ tekstur
+ </string>
+ <string name="sound">
+ lyd
+ </string>
+ <string name="calling card">
+ visitkort
+ </string>
+ <string name="landmark">
+ landemærke
+ </string>
+ <string name="legacy script">
+ ældre script
+ </string>
+ <string name="clothing">
+ tøj
+ </string>
+ <string name="object">
+ objekt
+ </string>
+ <string name="note card">
+ note
+ </string>
+ <string name="folder">
+ mappe
+ </string>
+ <string name="root">
+ rod
+ </string>
+ <string name="lsl2 script">
+ LSL2 script
+ </string>
+ <string name="lsl bytecode">
+ LSL bytecode
+ </string>
+ <string name="tga texture">
+ tga texture
+ </string>
+ <string name="body part">
+ kropsdel
+ </string>
+ <string name="snapshot">
+ foto
+ </string>
+ <string name="lost and found">
+ Fundne genstande
+ </string>
+ <string name="targa image">
+ targa billede
+ </string>
+ <string name="trash">
+ Papirkurv
+ </string>
+ <string name="jpeg image">
+ jpeg billede
+ </string>
+ <string name="animation">
+ animation
+ </string>
+ <string name="gesture">
+ bevægelse
+ </string>
+ <string name="simstate">
+ simstate
+ </string>
+ <string name="favorite">
+ favorit
+ </string>
+ <string name="symbolic link">
+ link
+ </string>
+ <string name="AvatarAway">
+ Væk
+ </string>
+ <string name="AvatarBusy">
+ Optaget
+ </string>
+ <string name="AvatarMuted">
+ Blokeret
+ </string>
+ <string name="anim_express_afraid">
+ Bange
+ </string>
+ <string name="anim_express_anger">
+ Vred
+ </string>
+ <string name="anim_away">
+ Væk
+ </string>
+ <string name="anim_backflip">
+ Baglæns salto
+ </string>
+ <string name="anim_express_laugh">
+ Hjertelig latter
+ </string>
+ <string name="anim_express_toothsmile">
+ Stort smil
+ </string>
+ <string name="anim_blowkiss">
+ Sende kys
+ </string>
+ <string name="anim_express_bored">
+ Keder sig
+ </string>
+ <string name="anim_bow">
+ Buk
+ </string>
+ <string name="anim_clap">
+ Klap
+ </string>
+ <string name="anim_courtbow">
+ Højtideligt buk
+ </string>
+ <string name="anim_express_cry">
+ Græd
+ </string>
+ <string name="anim_dance1">
+ Dans 1
+ </string>
+ <string name="anim_dance2">
+ Dans 2
+ </string>
+ <string name="anim_dance3">
+ Dans 3
+ </string>
+ <string name="anim_dance4">
+ Dans 4
+ </string>
+ <string name="anim_dance5">
+ Dans 5
+ </string>
+ <string name="anim_dance6">
+ Dans 6
+ </string>
+ <string name="anim_dance7">
+ Dans 7
+ </string>
+ <string name="anim_dance8">
+ Dans 8
+ </string>
+ <string name="anim_express_disdain">
+ Foragt
+ </string>
+ <string name="anim_drink">
+ Drik
+ </string>
+ <string name="anim_express_embarrased">
+ Flov
+ </string>
+ <string name="anim_angry_fingerwag">
+ Løftet finger
+ </string>
+ <string name="anim_fist_pump">
+ Knytnæve
+ </string>
+ <string name="anim_yoga_float">
+ Svævende yoga
+ </string>
+ <string name="anim_express_frown">
+ Mistroisk
+ </string>
+ <string name="anim_impatient">
+ Utålmodig
+ </string>
+ <string name="anim_jumpforjoy">
+ Glædeshop
+ </string>
+ <string name="anim_kissmybutt">
+ Kys min r..
+ </string>
+ <string name="anim_express_kiss">
+ Kys
+ </string>
+ <string name="anim_laugh_short">
+ Grin
+ </string>
+ <string name="anim_musclebeach">
+ Bodybuilder
+ </string>
+ <string name="anim_no_unhappy">
+ Nej (sur)
+ </string>
+ <string name="anim_no_head">
+ Nej
+ </string>
+ <string name="anim_nyanya">
+ Æv-bæv
+ </string>
+ <string name="anim_punch_onetwo">
+ Et-to slag
+ </string>
+ <string name="anim_express_open_mouth">
+ Åben mund
+ </string>
+ <string name="anim_peace">
+ Peace
+ </string>
+ <string name="anim_point_you">
+ Peg på andre
+ </string>
+ <string name="anim_point_me">
+ Peg på dig selv
+ </string>
+ <string name="anim_punch_l">
+ Slå venstre
+ </string>
+ <string name="anim_punch_r">
+ Slå højre
+ </string>
+ <string name="anim_rps_countdown">
+ SSP - Tæl
+ </string>
+ <string name="anim_rps_paper">
+ SSP - Papir
+ </string>
+ <string name="anim_rps_rock">
+ SSP - Sten
+ </string>
+ <string name="anim_rps_scissors">
+ SSP - Saks
+ </string>
+ <string name="anim_express_repulsed">
+ Misfornøjet
+ </string>
+ <string name="anim_kick_roundhouse_r">
+ Karatepark
+ </string>
+ <string name="anim_express_sad">
+ Ked af det
+ </string>
+ <string name="anim_salute">
+ Honnør
+ </string>
+ <string name="anim_shout">
+ Råb
+ </string>
+ <string name="anim_express_shrug">
+ Skuldertræk
+ </string>
+ <string name="anim_express_smile">
+ Smil
+ </string>
+ <string name="anim_smoke_idle">
+ Ryg
+ </string>
+ <string name="anim_smoke_inhale">
+ Indhalér
+ </string>
+ <string name="anim_smoke_throw_down">
+ Smid cigaret
+ </string>
+ <string name="anim_express_surprise">
+ Overrasket
+ </string>
+ <string name="anim_sword_strike_r">
+ Sværdslag
+ </string>
+ <string name="anim_angry_tantrum">
+ Ekstatisk
+ </string>
+ <string name="anim_express_tongue_out">
+ Tunge ud
+ </string>
+ <string name="anim_hello">
+ Vink
+ </string>
+ <string name="anim_whisper">
+ Knib øje i
+ </string>
+ <string name="anim_whistle">
+ Pift
+ </string>
+ <string name="anim_express_wink">
+ Blink
+ </string>
+ <string name="anim_wink_hollywood">
+ Blink (Hollywood)
+ </string>
+ <string name="anim_express_worry">
+ Bekymret
+ </string>
+ <string name="anim_yes_happy">
+ Ja (glad)
+ </string>
+ <string name="anim_yes_head">
+ Ja
+ </string>
+ <string name="texture_loading">
+ Indlæser...
+ </string>
+ <string name="worldmap_offline">
+ Offline
+ </string>
+ <string name="worldmap_results_none_found">
+ Ingen fundet.
+ </string>
+ <string name="Ok">
+ OK
+ </string>
+ <string name="Premature end of file">
+ Fil slutter for tidligt
+ </string>
+ <string name="ST_NO_JOINT">
+ Kan ikke funde ROOT eller JOINT.
+ </string>
+ <string name="whisper">
+ hvisker:
+ </string>
+ <string name="shout">
+ råber:
+ </string>
+ <string name="ringing">
+ Forbinder til stemmechat...
+ </string>
+ <string name="connected">
+ Forbundet
+ </string>
+ <string name="unavailable">
+ Stemmechat er ikke tilladt hvor du befinder dig
+ </string>
+ <string name="hang_up">
+ Stemme chat er afbrudt
+ </string>
+ <string name="ScriptQuestionCautionChatGranted">
+ '[OBJECTNAME]', en genstand, ejet af '[OWNERNAME]', lokaliseret i [REGIONNAME] på [REGIONPOS], har fået tilladelse til: [PERMISSIONS].
+ </string>
+ <string name="ScriptQuestionCautionChatDenied">
+ '[OBJECTNAME]', en genstand, ejet af '[OWNERNAME]', lokaliseret i [REGIONNAME] på [REGIONPOS], er afvist tilladelse til: [PERMISSIONS].
+ </string>
+ <string name="ScriptTakeMoney">
+ Tag Linden dollars (L$) fra dig
+ </string>
+ <string name="ActOnControlInputs">
+ Reagér på dine kontrol-taster
+ </string>
+ <string name="RemapControlInputs">
+ Ændre dine kontrol-taster
+ </string>
+ <string name="AnimateYourAvatar">
+ Animér din avatar
+ </string>
+ <string name="AttachToYourAvatar">
+ Sæt på din avatar
+ </string>
+ <string name="ReleaseOwnership">
+ Fjern ejerskabet og sæt til offentlig
+ </string>
+ <string name="LinkAndDelink">
+ Sammenkæd og adskil andre genstande
+ </string>
+ <string name="AddAndRemoveJoints">
+ Tilføj og fjern sammenkødninger med andre genstande
+ </string>
+ <string name="ChangePermissions">
+ Ændre dens tilladelser
+ </string>
+ <string name="TrackYourCamera">
+ Spor dit kamera
+ </string>
+ <string name="ControlYourCamera">
+ Kontrollér dit kamera
+ </string>
+ <string name="SIM_ACCESS_PG">
+ PG
+ </string>
+ <string name="SIM_ACCESS_MATURE">
+ Mature
+ </string>
+ <string name="SIM_ACCESS_ADULT">
+ Adult
+ </string>
+ <string name="SIM_ACCESS_DOWN">
+ logget af
+ </string>
+ <string name="SIM_ACCESS_MIN">
+ Ukendt
+ </string>
+ <string name="land_type_unknown">
+ (ukendt)
+ </string>
+ <string name="all_files">
+ Alle filer
+ </string>
+ <string name="sound_files">
+ Lyde
+ </string>
+ <string name="animation_files">
+ Animationer
+ </string>
+ <string name="image_files">
+ Billeder
+ </string>
+ <string name="save_file_verb">
+ Gem
+ </string>
+ <string name="load_file_verb">
+ Hent
+ </string>
+ <string name="targa_image_files">
+ Targa billeder
+ </string>
+ <string name="bitmap_image_files">
+ Bitmap billeder
+ </string>
+ <string name="avi_movie_file">
+ AVI film fil
+ </string>
+ <string name="xaf_animation_file">
+ XAF Anim Fil
+ </string>
+ <string name="xml_file">
+ XML Fil
+ </string>
+ <string name="dot_raw_file">
+ RAW Fil
+ </string>
+ <string name="compressed_image_files">
+ Komprimerede billeder
+ </string>
+ <string name="load_files">
+ Hent filer
+ </string>
+ <string name="choose_the_directory">
+ Vælg bibliotek
+ </string>
+ <string name="AvatarSetNotAway">
+ Sæt "til stede"
+ </string>
+ <string name="AvatarSetAway">
+ Sæt "væk"
+ </string>
+ <string name="AvatarSetNotBusy">
+ Sæt "ledig"
+ </string>
+ <string name="AvatarSetBusy">
+ Sæt "optaget"
+ </string>
+ <string name="shape">
+ Form
+ </string>
+ <string name="skin">
+ Hud
+ </string>
+ <string name="hair">
+ Hår
+ </string>
+ <string name="eyes">
+ Øjne
+ </string>
+ <string name="shirt">
+ Trøje
+ </string>
+ <string name="pants">
+ Bukser
+ </string>
+ <string name="shoes">
+ Sko
+ </string>
+ <string name="socks">
+ Strømper
+ </string>
+ <string name="jacket">
+ Jakke
+ </string>
+ <string name="gloves">
+ Handsker
+ </string>
+ <string name="undershirt">
+ Undertrøje
+ </string>
+ <string name="underpants">
+ Underbukser
+ </string>
+ <string name="skirt">
+ Nederdel
+ </string>
+ <string name="alpha">
+ Alpha
+ </string>
+ <string name="tattoo">
+ Tatovering
+ </string>
+ <string name="invalid">
+ ugyldig
+ </string>
+ <string name="next">
+ Næste
+ </string>
+ <string name="ok">
+ OK
+ </string>
+ <string name="GroupNotifyGroupNotice">
+ Gruppe besked
+ </string>
+ <string name="GroupNotifyGroupNotices">
+ Gruppe besked
+ </string>
+ <string name="GroupNotifySentBy">
+ Sendt af
+ </string>
+ <string name="GroupNotifyAttached">
+ Vedhæftet:
+ </string>
+ <string name="GroupNotifyViewPastNotices">
+ Se tidligere beskeder eller slå modtagelse af beskeder fra her.
+ </string>
+ <string name="GroupNotifyOpenAttachment">
+ Åben vedhæng
+ </string>
+ <string name="GroupNotifySaveAttachment">
+ Gem vedhæng
+ </string>
+ <string name="TeleportOffer">
+ Teleport tilbud
+ </string>
+ <string name="StartUpNotification">
+ %d nye besked modtaget mens du var væk...
+ </string>
+ <string name="StartUpNotifications">
+ %d nye beskeder modtaget mens du var væk......
+ </string>
+ <string name="OverflowInfoChannelString">
+ Du har %d mere besked(er)
+ </string>
+ <string name="BodyPartsRightArm">
+ Højre arm
+ </string>
+ <string name="BodyPartsHead">
+ Hoved
+ </string>
+ <string name="BodyPartsLeftArm">
+ Venstre arm
+ </string>
+ <string name="BodyPartsLeftLeg">
+ Venstre ben
+ </string>
+ <string name="BodyPartsTorso">
+ Overkrop
+ </string>
+ <string name="BodyPartsRightLeg">
+ Højre ben
+ </string>
+ <string name="GraphicsQualityLow">
+ Lav
+ </string>
+ <string name="GraphicsQualityMid">
+ Middel
+ </string>
+ <string name="GraphicsQualityHigh">
+ Høj
+ </string>
+ <string name="LeaveMouselook">
+ Tryk ESC for at skift til normalt udsyn
+ </string>
+ <string name="InventoryNoMatchingItems">
+ No matching items found in inventory.
+ </string>
+ <string name="InventoryNoTexture">
+ Du har ikke en kopi af denne
+tekstur i din beholdning.
+ </string>
+ <string name="no_transfer" value=" (ikke overdragbar)"/>
+ <string name="no_modify" value=" (ikke redigere)"/>
+ <string name="no_copy" value=" (ikke kopiere)"/>
+ <string name="worn" value=" (båret)"/>
+ <string name="link" value=" (sammenkæde)"/>
+ <string name="broken_link" value=" (brudt_kæde)""/>
+ <string name="LoadingContents">
+ Henter indhold...
+ </string>
+ <string name="NoContents">
+ Intet indhold
+ </string>
+ <string name="WornOnAttachmentPoint" value=" (båret på [ATTACHMENT_POINT])"/>
+ <string name="Chat" value=" Chat : "/>
+ <string name="Sound" value=" Lyd : "/>
+ <string name="Wait" value=" --- Vent : "/>
+ <string name="AnimFlagStop" value=" Stop Animation : "/>
+ <string name="AnimFlagStart" value=" Start Animation : "/>
+ <string name="Wave" value=" Vink "/>
+ <string name="HelloAvatar" value=" Hej, avatar! "/>
+ <string name="ViewAllGestures" value=" Se alle >>"/>
+ <string name="Animations" value=" Animationer,"/>
+ <string name="Calling Cards" value=" Visitkort,"/>
+ <string name="Clothing" value=" Tøj,"/>
+ <string name="Gestures" value=" Bevægelser,"/>
+ <string name="Landmarks" value=" Landemærker,"/>
+ <string name="Notecards" value=" Note,"/>
+ <string name="Objects" value=" Objekter,"/>
+ <string name="Scripts" value=" Scripts,"/>
+ <string name="Sounds" value=" Lyde,"/>
+ <string name="Textures" value=" Teksturer,"/>
+ <string name="Snapshots" value=" Fotos,"/>
+ <string name="No Filters" value="Nej "/>
+ <string name="Since Logoff" value=" - Siden log ud"/>
+ <string name="InvFolder My Inventory">
+ Min beholdning
+ </string>
+ <string name="InvFolder My Favorites">
+ Mine favoritter
+ </string>
+ <string name="InvFolder Library">
+ Bibliotek
+ </string>
+ <string name="InvFolder Textures">
+ Teksturer
+ </string>
+ <string name="InvFolder Sounds">
+ Lyde
+ </string>
+ <string name="InvFolder Calling Cards">
+ Visitkort
+ </string>
+ <string name="InvFolder Landmarks">
+ Landemærker
+ </string>
+ <string name="InvFolder Scripts">
+ Scripts
+ </string>
+ <string name="InvFolder Clothing">
+ Tøj
+ </string>
+ <string name="InvFolder Objects">
+ Objekter
+ </string>
+ <string name="InvFolder Notecards">
+ Noter
+ </string>
+ <string name="InvFolder New Folder">
+ Ny mappe
+ </string>
+ <string name="InvFolder Inventory">
+ Beholdning
+ </string>
+ <string name="InvFolder Uncompressed Images">
+ Ukomprimerede billeder
+ </string>
+ <string name="InvFolder Body Parts">
+ Kropsdele
+ </string>
+ <string name="InvFolder Trash">
+ Papirkurv
+ </string>
+ <string name="InvFolder Photo Album">
+ Fotoalbum
+ </string>
+ <string name="InvFolder Lost And Found">
+ Fundne genstande
+ </string>
+ <string name="InvFolder Uncompressed Sounds">
+ Ukomprimerede lyde
+ </string>
+ <string name="InvFolder Animations">
+ Animationer
+ </string>
+ <string name="InvFolder Gestures">
+ Bevægelser
+ </string>
+ <string name="InvFolder favorite">
+ Favoritter
+ </string>
+ <string name="InvFolder Current Outfit">
+ Nuværende sæt
+ </string>
+ <string name="InvFolder My Outfits">
+ Mine sæt
+ </string>
+ <string name="InvFolder Friends">
+ Venner
+ </string>
+ <string name="InvFolder All">
+ Alle
+ </string>
+ <string name="Buy">
+ Køb
+ </string>
+ <string name="BuyforL$">
+ Køb for L$
+ </string>
+ <string name="Stone">
+ Sten
+ </string>
+ <string name="Metal">
+ Metal
+ </string>
+ <string name="Glass">
+ Glas
+ </string>
+ <string name="Wood">
+ Træ
+ </string>
+ <string name="Flesh">
+ Kød
+ </string>
+ <string name="Plastic">
+ Plastik
+ </string>
+ <string name="Rubber">
+ Gummi
+ </string>
+ <string name="Light">
+ Lys
+ </string>
+ <string name="KBShift">
+ Shift
+ </string>
+ <string name="KBCtrl">
+ Ctrl
+ </string>
+ <string name="Chest">
+ Bryst
+ </string>
+ <string name="Skull">
+ Hovedskal
+ </string>
+ <string name="Left Shoulder">
+ Venstre skulder
+ </string>
+ <string name="Right Shoulder">
+ Højre skulder
+ </string>
+ <string name="Left Hand">
+ Venstre hånd
+ </string>
+ <string name="Right Hand">
+ Højre hånd
+ </string>
+ <string name="Left Foot">
+ Venstre fod
+ </string>
+ <string name="Right Foot">
+ Højre fod
+ </string>
+ <string name="Spine">
+ Rygsøjle
+ </string>
+ <string name="Pelvis">
+ Bækken
+ </string>
+ <string name="Mouth">
+ Mund
+ </string>
+ <string name="Chin">
+ Hage
+ </string>
+ <string name="Left Ear">
+ Venstre øre
+ </string>
+ <string name="Right Ear">
+ Højre øre
+ </string>
+ <string name="Left Eyeball">
+ Venstre øje
+ </string>
+ <string name="Right Eyeball">
+ Højre øje
+ </string>
+ <string name="Nose">
+ Næse
+ </string>
+ <string name="R Upper Arm">
+ H overarm
+ </string>
+ <string name="R Forearm">
+ H underarm
+ </string>
+ <string name="L Upper Arm">
+ V overarm
+ </string>
+ <string name="L Forearm">
+ V underarm
+ </string>
+ <string name="Right Hip">
+ Højre hofte
+ </string>
+ <string name="R Upper Leg">
+ Højre lår
+ </string>
+ <string name="R Lower Leg">
+ H underben
+ </string>
+ <string name="Left Hip">
+ Venstre hofte
+ </string>
+ <string name="L Upper Leg">
+ Venstre lår
+ </string>
+ <string name="L Lower Leg">
+ V underben
+ </string>
+ <string name="Stomach">
+ Mave
+ </string>
+ <string name="Left Pec">
+ Venstre bryst
+ </string>
+ <string name="Right Pec">
+ Højre bryst
+ </string>
+ <string name="YearsMonthsOld">
+ [AGEYEARS] [AGEMONTHS] gammel
+ </string>
+ <string name="YearsOld">
+ [AGEYEARS] gammel
+ </string>
+ <string name="MonthsOld">
+ [AGEMONTHS] gammel
+ </string>
+ <string name="WeeksOld">
+ [AGEWEEKS] gammel
+ </string>
+ <string name="DaysOld">
+ [AGEDAYS] gammel
+ </string>
+ <string name="TodayOld">
+ Med fra i dag
+ </string>
+ <string name="AgeYearsA">
+ [COUNT] år
+ </string>
+ <string name="AgeYearsB">
+ [COUNT] år
+ </string>
+ <string name="AgeYearsC">
+ [COUNT] år
+ </string>
+ <string name="AgeMonthsA">
+ [COUNT] måned
+ </string>
+ <string name="AgeMonthsB">
+ [COUNT] måneder
+ </string>
+ <string name="AgeMonthsC">
+ [COUNT] måneder
+ </string>
+ <string name="AgeWeeksA">
+ [COUNT] uge
+ </string>
+ <string name="AgeWeeksB">
+ [COUNT] uger
+ </string>
+ <string name="AgeWeeksC">
+ [COUNT] uger
+ </string>
+ <string name="AgeDaysA">
+ [COUNT] dag
+ </string>
+ <string name="AgeDaysB">
+ [COUNT] dage
+ </string>
+ <string name="AgeDaysC">
+ [COUNT] dage
+ </string>
+ <string name="GroupMembersA">
+ [COUNT] medlem
+ </string>
+ <string name="GroupMembersB">
+ [COUNT] medlemmer
+ </string>
+ <string name="GroupMembersC">
+ [COUNT] medlemmer
+ </string>
+ <string name="AcctTypeResident">
+ Beboer
+ </string>
+ <string name="AcctTypeTrial">
+ På prøve
+ </string>
+ <string name="AcctTypeCharterMember">
+ Æresmedlemmer
+ </string>
+ <string name="AcctTypeEmployee">
+ Linden Lab medarbejder
+ </string>
+ <string name="PaymentInfoUsed">
+ Betalende medlem
+ </string>
+ <string name="PaymentInfoOnFile">
+ Betalingsinfo registreret
+ </string>
+ <string name="NoPaymentInfoOnFile">
+ Ingen betalingsinfo
+ </string>
+ <string name="AgeVerified">
+ Alders-checket
+ </string>
+ <string name="NotAgeVerified">
+ Ikke alders-checket
+ </string>
+ <string name="Center 2">
+ Center 2
+ </string>
+ <string name="Top Right">
+ Øverst højre
+ </string>
+ <string name="Top">
+ Top
+ </string>
+ <string name="Top Left">
+ Øverst venstre
+ </string>
+ <string name="Center">
+ Centrum
+ </string>
+ <string name="Bottom Left">
+ Nederst venstre
+ </string>
+ <string name="Bottom">
+ Nederst midt
+ </string>
+ <string name="Bottom Right">
+ nederst højre
+ </string>
+ <string name="CompileQueueDownloadedCompiling">
+ Hentet, kompilerer nu
+ </string>
+ <string name="CompileQueueScriptNotFound">
+ Script ikke fundet på server.
+ </string>
+ <string name="CompileQueueProblemDownloading">
+ Problem ved download
+ </string>
+ <string name="CompileQueueInsufficientPermDownload">
+ Ikke rettigheder til at downloade script.
+ </string>
+ <string name="CompileQueueInsufficientPermFor">
+ Ikke nok rettigheder til at
+ </string>
+ <string name="CompileQueueUnknownFailure">
+ Ukendt fejl ved download
+ </string>
+ <string name="CompileQueueTitle">
+ Rekompilering fremskridt
+ </string>
+ <string name="CompileQueueStart">
+ Rekompilér
+ </string>
+ <string name="ResetQueueTitle">
+ Nulstil fremskridt
+ </string>
+ <string name="ResetQueueStart">
+ nulstil
+ </string>
+ <string name="RunQueueTitle">
+ Sæt "running" fremskridt
+ </string>
+ <string name="RunQueueStart">
+ sæt til "running"
+ </string>
+ <string name="NotRunQueueTitle">
+ Sæt "Not Running" fremskridt
+ </string>
+ <string name="NotRunQueueStart">
+ sæt til "not running"
+ </string>
+ <string name="CompileSuccessful">
+ Kompleret uden fejl!
+ </string>
+ <string name="CompileSuccessfulSaving">
+ Kompileret uden fejl, gemmer...
+ </string>
+ <string name="SaveComplete">
+ Gemt.
+ </string>
+ <string name="ObjectOutOfRange">
+ Script ("object out of range")
+ </string>
+ <string name="GodToolsObjectOwnedBy">
+ Objekt [OBJECT] ejet af [OWNER]
+ </string>
+ <string name="GroupsNone">
+ ingen
+ </string>
+ <string name="Group" value=" (gruppe)"/>
+ <string name="Unknown">
+ (ukendt)
+ </string>
+ <string name="SummaryForTheWeek" value="Opsummering for denne uge, begyndende med "/>
+ <string name="NextStipendDay" value="Næste stipendie dag er "/>
+ <string name="GroupIndividualShare" value=" Gruppe Individuel Delt"/>
+ <string name="Balance">
+ Balance
+ </string>
+ <string name="Credits">
+ Kredit
+ </string>
+ <string name="Debits">
+ Debet
+ </string>
+ <string name="Total">
+ Total
+ </string>
+ <string name="NoGroupDataFound">
+ Ingen gruppedata fundet for gruppe
+ </string>
+ <string name="IMParentEstate">
+ overordnet estate
+ </string>
+ <string name="IMMainland">
+ mainland
+ </string>
+ <string name="IMTeen">
+ teen
+ </string>
+ <string name="RegionInfoError">
+ fejl
+ </string>
+ <string name="RegionInfoAllEstatesOwnedBy">
+ alle estates ejet af [OWNER]
+ </string>
+ <string name="RegionInfoAllEstatesYouOwn">
+ alle estates du ejer
+ </string>
+ <string name="RegionInfoAllEstatesYouManage">
+ alle estates du administrerer for [OWNER]
+ </string>
+ <string name="RegionInfoAllowedResidents">
+ Godkendte beboere: ([ALLOWEDAGENTS], max. [MAXACCESS])
+ </string>
+ <string name="RegionInfoAllowedGroups">
+ Godkendte grupper: ([ALLOWEDGROUPS], max. [MAXACCESS])
+ </string>
+ <string name="CursorPos">
+ Linie [LINE], Kolonne [COLUMN]
+ </string>
+ <string name="PanelDirCountFound">
+ [COUNT] fundet
+ </string>
+ <string name="PanelContentsNewScript">
+ Nyt script
+ </string>
+ <string name="MuteByName">
+ (efter navn)
+ </string>
+ <string name="MuteAgent">
+ (beboer)
+ </string>
+ <string name="MuteObject">
+ (objekt)
+ </string>
+ <string name="MuteGroup">
+ (gruppe)
+ </string>
+ <string name="RegionNoCovenant">
+ Der er ingen regler for dette estate.
+ </string>
+ <string name="RegionNoCovenantOtherOwner">
+ Der er ingen regler for dette estate. Land på dette estate sælges af estate ejeren, ikke af Linden Lab. Kontakt venligst estate ejeren for detaljer om salg.
+ </string>
+ <string name="covenant_last_modified">
+ Sidst ændret:
+ </string>
+ <string name="none_text" value=" (ingen) "/>
+ <string name="never_text" value=" (aldrig) "/>
+ <string name="GroupOwned">
+ Gruppe ejet
+ </string>
+ <string name="Public">
+ Offentlig
+ </string>
+ <string name="ClassifiedClicksTxt">
+ Klik: [TELEPORT] teleport, [MAP] kort, [PROFILE] profil
+ </string>
+ <string name="ClassifiedUpdateAfterPublish">
+ (vil blive opdateret efter offentliggørelse)
+ </string>
+ <string name="MultiPreviewTitle">
+ Vis først
+ </string>
+ <string name="MultiPropertiesTitle">
+ Egenskaber
+ </string>
+ <string name="InvOfferAnObjectNamed">
+ Et objekt med navnet
+ </string>
+ <string name="InvOfferOwnedByGroup">
+ ejet af gruppen
+ </string>
+ <string name="InvOfferOwnedByUnknownGroup">
+ ejet af en ukendt gruppe
+ </string>
+ <string name="InvOfferOwnedBy">
+ ejet af
+ </string>
+ <string name="InvOfferOwnedByUnknownUser">
+ ejet af en ukendt bruger
+ </string>
+ <string name="InvOfferGaveYou">
+ gav dig
+ </string>
+ <string name="InvOfferYouDecline">
+ Du afslår
+ </string>
+ <string name="InvOfferFrom">
+ fra
+ </string>
+ <string name="GroupMoneyTotal">
+ Total
+ </string>
+ <string name="GroupMoneyBought">
+ købt
+ </string>
+ <string name="GroupMoneyPaidYou">
+ betalte dig
+ </string>
+ <string name="GroupMoneyPaidInto">
+ betalt til
+ </string>
+ <string name="GroupMoneyBoughtPassTo">
+ købte adgang til
+ </string>
+ <string name="GroupMoneyPaidFeeForEvent">
+ betalte gebyr for event
+ </string>
+ <string name="GroupMoneyPaidPrizeForEvent">
+ betalte prisen for event
+ </string>
+ <string name="GroupMoneyBalance">
+ Balance
+ </string>
+ <string name="GroupMoneyCredits">
+ Kredit
+ </string>
+ <string name="GroupMoneyDebits">
+ Debet
+ </string>
+ <string name="ViewerObjectContents">
+ Indhold
+ </string>
+ <string name="AcquiredItems">
+ Anskaffede genstande
+ </string>
+ <string name="Cancel">
+ Annullér
+ </string>
+ <string name="UploadingCosts">
+ Uploader [%s] omkostninger
+ </string>
+ <string name="UnknownFileExtension">
+ Ukendt fil efternavn [.%s]
+Forventet .wav, .tga, .bmp, .jpg, .jpeg, or .bvh
+ </string>
+ <string name="AddLandmarkNavBarMenu">
+ Tilføj landemærke...
+ </string>
+ <string name="EditLandmarkNavBarMenu">
+ Redigér landemærke...
+ </string>
+ <string name="accel-mac-control">⌃</string>
+ <string name="accel-mac-command">⌘</string>
+ <string name="accel-mac-option">⌥</string>
+ <string name="accel-mac-shift">⇧</string>
+ <string name="accel-win-control">
+ Ctrl+
+ </string>
+ <string name="accel-win-alt">
+ Alt+
+ </string>
+ <string name="accel-win-shift">
+ Shift+
+ </string>
+ <string name="FileSaved">
+ Fil gemt
+ </string>
+ <string name="Receiving">
+ Modtager
+ </string>
+ <string name="AM">
+ AM
+ </string>
+ <string name="PM">
+ PM
+ </string>
+ <string name="PST">
+ PST
+ </string>
+ <string name="PDT">
+ PDT
+ </string>
+ <string name="Forward">
+ Fremad
+ </string>
+ <string name="Left">
+ Venstre
+ </string>
+ <string name="Right">
+ Højre
+ </string>
+ <string name="Back">
+ Bagud
+ </string>
+ <string name="North">
+ Nord
+ </string>
+ <string name="South">
+ Syd
+ </string>
+ <string name="West">
+ Vest
+ </string>
+ <string name="East">
+ Øst
+ </string>
+ <string name="Up">
+ Op
+ </string>
+ <string name="Down">
+ Ned
+ </string>
+ <string name="Any Category">
+ Enhver kategori
+ </string>
+ <string name="Shopping">
+ Shopping
+ </string>
+ <string name="Land Rental">
+ Land til leje
+ </string>
+ <string name="Property Rental">
+ Grunde til leje
+ </string>
+ <string name="Special Attraction">
+ Speciel attraktion
+ </string>
+ <string name="New Products">
+ Nye produkter
+ </string>
+ <string name="Employment">
+ Jobs
+ </string>
+ <string name="Wanted">
+ Søges
+ </string>
+ <string name="Service">
+ Service
+ </string>
+ <string name="Personal">
+ Personlig
+ </string>
+ <string name="None">
+ Ingen
+ </string>
+ <string name="Linden Location">
+ Linden sted
+ </string>
+ <string name="Adult">
+ Adult
+ </string>
+ <string name="Arts&Culture">
+ Kunst & kultur
+ </string>
+ <string name="Business">
+ Business
+ </string>
+ <string name="Educational">
+ Uddannelse
+ </string>
+ <string name="Gaming">
+ Spil
+ </string>
+ <string name="Hangout">
+ Afslapning
+ </string>
+ <string name="Newcomer Friendly">
+ Nybegynder venligt
+ </string>
+ <string name="Parks&Nature">
+ Parker & natur
+ </string>
+ <string name="Residential">
+ Beboelse
+ </string>
+ <string name="Stage">
+ Fase
+ </string>
+ <string name="Other">
+ Andet
+ </string>
+ <string name="Any">
+ Enhver
+ </string>
+ <string name="You">
+ Dig
+ </string>
+ <string name="Multiple Media">
+ Flere medietyper
+ </string>
+ <string name="Play Media">
+ Afspil/Pause medie
+ </string>
+ <string name="MBCmdLineError">
+ Der opstod en fejl ved afvikling af kommandolinie.
+Se venligst: http://wiki.secondlife.com/wiki/Client_parameters
+Fejl:
+ </string>
+ <string name="MBCmdLineUsg">
+ [APP_NAME] Kommando linie brug:
+ </string>
+ <string name="MBUnableToAccessFile">
+ [APP_NAME] kan ikke få adgang til fil den/det skal bruge.
+
+Dette kan skyldes at du har flere kopier kørende eller operativsystemet tror at filen allerede er åben.
+Hvis fejlen bliver ved, genstart computer og prøv igen.
+Hvis fejlen stadig bliver ved, kan det være nødvendigt at afinstallere [APP_NAME] og installere igen.
+ </string>
+ <string name="MBFatalError">
+ Fatal fejl
+ </string>
+ <string name="MBRequiresAltiVec">
+ [APP_NAME] kræver en processor med AltiVec (G4 eller nyere).
+ </string>
+ <string name="MBAlreadyRunning">
+ [APP_NAME] kører allerede.
+Undersøg din "task bar" for at se efter minimeret version af programmet.
+Hvis fejlen fortsætter, prøv at genstarte din computer.
+ </string>
+ <string name="MBFrozenCrashed">
+ [APP_NAME] ser ud til at være "frosset" eller gået ned tidligere.
+Ønsker du at sende en fejlrapport?
+ </string>
+ <string name="MBAlert">
+ Besked
+ </string>
+ <string name="MBNoDirectX">
+ [APP_NAME] kan ikke detektere DirectX 9.0b eller nyere.
+[APP_NAME] benytte DirectX til at detektere hardware og/eller forældede drivere der kan give problemer med stabilitet, dårlig hastighed eller nedbrud. Selvom du kan køre [APP_NAME] uden det, anbefaler vi meget at køre med DirectX 9.0b.
+
+Ønsker du at fortsætte?
+ </string>
+ <string name="MBWarning">
+ Advarsel
+ </string>
+ <string name="MBNoAutoUpdate">
+ Automatisk opdatering er endnu ikke implementeret på Linux.
+Hent venligst den nyeste version på www.secondlife.com.
+ </string>
+ <string name="MBRegClassFailed">
+ RegisterClass fejlede
+ </string>
+ <string name="MBError">
+ Fejl
+ </string>
+ <string name="MBFullScreenErr">
+ Ikke muligt at køre i fuldskærm med [WIDTH] x [HEIGHT].
+Afvikler i vindue.
+ </string>
+ <string name="MBDestroyWinFailed">
+ Nedlukningsfejl ved lukning af vindue (DestroyWindow() fejlede)
+ </string>
+ <string name="MBShutdownErr">
+ Fejl ved nedlukning
+ </string>
+ <string name="MBDevContextErr">
+ Kan ikke oprette "GL device context"
+ </string>
+ <string name="MBPixelFmtErr">
+ Kan ikke finde passende "pixel format"
+ </string>
+ <string name="MBPixelFmtDescErr">
+ Kan ikke finde "pixel format" beskrivelse
+ </string>
+ <string name="MBTrueColorWindow">
+ [APP_NAME] kræver "True Color (32-bit)" for at kunne køre.
+Gå venligst til din computers skærmopsætning og sæt "color mode" til 32-bit.
+ </string>
+ <string name="MBAlpha">
+ [APP_NAME] kan ikke køre, da den ikke kan finde en "8 bit alpha channel". Normalt skyldes dette et problem med en video driver.
+Venligst undersøg om du har de nyeste drivere til dit videokort installeret.
+Din skærm skal også være sat op til at køre "True Color (32-bit)" i din displayopsætning.
+Hvis du bliver ved med at modtage denne besked, kontakt [SUPPORT_SITE].
+ </string>
+ <string name="MBPixelFmtSetErr">
+ Kan ikke sætte "pixel format"
+ </string>
+ <string name="MBGLContextErr">
+ Kan ikke oprette "GL rendering context"
+ </string>
+ <string name="MBGLContextActErr">
+ Kan ikke aktivere "GL rendering context"
+ </string>
+ <string name="MBVideoDrvErr">
+ [APP_NAME] kan ikke afvikles da driverne til dit videokort ikke blev installeret korrekt, er forældede, eller du benytter hardware der ikke er supporteret. Undersøg venligst om du har installeret de nyeste drivere til dit grafikkort, og selv om du har de nyeste, prøv at geninstallere dem.
+
+Hvis du bliver ved med at modtage denne besked, kontakt venligst [SUPPORT_SITE].
+ </string>
+ <string name="5 O'Clock Shadow">
+ Skægstubbe
+ </string>
+ <string name="All White">
+ Helt hvidt
+ </string>
+ <string name="Anime Eyes">
+ Store øjne
+ </string>
+ <string name="Arced">
+ Spidst
+ </string>
+ <string name="Arm Length">
+ Armængde
+ </string>
+ <string name="Attached">
+ Vedhæftet
+ </string>
+ <string name="Attached Earlobes">
+ Vedhæftede øreflipper
+ </string>
+ <string name="Back Bangs">
+ Nakkehår
+ </string>
+ <string name="Back Bangs Down">
+ Nakkehår langt
+ </string>
+ <string name="Back Bangs Up">
+ Nakkehår kort
+ </string>
+ <string name="Back Fringe">
+ Nakkehår
+ </string>
+ <string name="Back Hair">
+ Volumen
+ </string>
+ <string name="Back Hair Down">
+ Volumen nedad
+ </string>
+ <string name="Back Hair Up">
+ Volumen op
+ </string>
+ <string name="Baggy">
+ Posede
+ </string>
+ <string name="Bangs">
+ Pandehår
+ </string>
+ <string name="Bangs Down">
+ Pandehår ned
+ </string>
+ <string name="Bangs Up">
+ Pandehår op
+ </string>
+ <string name="Beady Eyes">
+ Stikkende øjne
+ </string>
+ <string name="Belly Size">
+ Mave størrelse
+ </string>
+ <string name="Big">
+ Stor
+ </string>
+ <string name="Big Butt">
+ Stor bagdel
+ </string>
+ <string name="Big Eyeball">
+ Store øjenæbler
+ </string>
+ <string name="Big Hair Back">
+ Stort hår: Bag
+ </string>
+ <string name="Big Hair Front">
+ Stort hår: Foran
+ </string>
+ <string name="Big Hair Top">
+ Stort hår: Top
+ </string>
+ <string name="Big Head">
+ Stort hovede
+ </string>
+ <string name="Big Pectorals">
+ Store brystmuskler
+ </string>
+ <string name="Big Spikes">
+ Store spikes
+ </string>
+ <string name="Black">
+ Sort
+ </string>
+ <string name="Blonde">
+ Blond
+ </string>
+ <string name="Blonde Hair">
+ Blondt hår
+ </string>
+ <string name="Blush">
+ Rødmen
+ </string>
+ <string name="Blush Color">
+ Rødme farve
+ </string>
+ <string name="Blush Opacity">
+ Rødme gennemsigtighed
+ </string>
+ <string name="Body Definition">
+ Kropskontur
+ </string>
+ <string name="Body Fat">
+ Kropsfedt
+ </string>
+ <string name="Body Freckles">
+ Fregner på kroppen
+ </string>
+ <string name="Body Thick">
+ Tyk krop
+ </string>
+ <string name="Body Thickness">
+ Kropstykkelse
+ </string>
+ <string name="Body Thin">
+ Tynd krop
+ </string>
+ <string name="Bow Legged">
+ Hjulbenet
+ </string>
+ <string name="Breast Buoyancy">
+ Bryst tyngdepåvirkning
+ </string>
+ <string name="Breast Cleavage">
+ Kavalergang
+ </string>
+ <string name="Breast Size">
+ Bryststørrelse
+ </string>
+ <string name="Bridge Width">
+ Bredde næseryg
+ </string>
+ <string name="Broad">
+ Bred
+ </string>
+ <string name="Brow Size">
+ Størrelse øjenbryn
+ </string>
+ <string name="Bug Eyes">
+ Udstående øjne
+ </string>
+ <string name="Bugged Eyes">
+ Udstående øjne
+ </string>
+ <string name="Bulbous">
+ Kartoffelnæse
+ </string>
+ <string name="Bulbous Nose">
+ Kartoffelnæse
+ </string>
+ <string name="Bushy Eyebrows">
+ Buskede øjenbryn
+ </string>
+ <string name="Bushy Hair">
+ Busket hår
+ </string>
+ <string name="Butt Size">
+ Størrelse bagdel
+ </string>
+ <string name="bustle skirt">
+ Tournure
+ </string>
+ <string name="no bustle">
+ Ingen tournure
+ </string>
+ <string name="more bustle">
+ Mere tournure
+ </string>
+ <string name="Chaplin">
+ Chaplin
+ </string>
+ <string name="Cheek Bones">
+ Kindben
+ </string>
+ <string name="Chest Size">
+ Bryst størrelse
+ </string>
+ <string name="Chin Angle">
+ Hage form
+ </string>
+ <string name="Chin Cleft">
+ Hagekløft
+ </string>
+ <string name="Chin Curtains">
+ Hageskæg
+ </string>
+ <string name="Chin Depth">
+ Hage dybde
+ </string>
+ <string name="Chin Heavy">
+ Stort forneden
+ </string>
+ <string name="Chin In">
+ Vigende hage
+ </string>
+ <string name="Chin Out">
+ Hage frem
+ </string>
+ <string name="Chin-Neck">
+ Hals under hage
+ </string>
+ <string name="Clear">
+ Slet
+ </string>
+ <string name="Cleft">
+ Kløft
+ </string>
+ <string name="Close Set Eyes">
+ Tætsiddende øjne
+ </string>
+ <string name="Closed">
+ Lukket
+ </string>
+ <string name="Closed Back">
+ Lukket bagtil
+ </string>
+ <string name="Closed Front">
+ Lukket foran
+ </string>
+ <string name="Closed Left">
+ Lukket til venstre
+ </string>
+ <string name="Closed Right">
+ Lukket til højre
+ </string>
+ <string name="Coin Purse">
+ Lille
+ </string>
+ <string name="Collar Back">
+ Krave bagtil
+ </string>
+ <string name="Collar Front">
+ Krave foran
+ </string>
+ <string name="Corner Down">
+ Nedadvendt
+ </string>
+ <string name="Corner Normal">
+ Normalt
+ </string>
+ <string name="Corner Up">
+ Opadvendt
+ </string>
+ <string name="Creased">
+ Rynket
+ </string>
+ <string name="Crooked Nose">
+ Skæv næse
+ </string>
+ <string name="Cropped Hair">
+ Kort hår
+ </string>
+ <string name="Cuff Flare">
+ Svaj
+ </string>
+ <string name="Dark">
+ Mørk
+ </string>
+ <string name="Dark Green">
+ Mørkegrøn
+ </string>
+ <string name="Darker">
+ Mørkere
+ </string>
+ <string name="Deep">
+ Dyb
+ </string>
+ <string name="Default Heels">
+ Standard hæle
+ </string>
+ <string name="Default Toe">
+ Standard snude
+ </string>
+ <string name="Dense">
+ Tæt
+ </string>
+ <string name="Dense hair">
+ Tæt hår
+ </string>
+ <string name="Double Chin">
+ Dobbelthage
+ </string>
+ <string name="Downturned">
+ Peger nedad
+ </string>
+ <string name="Duffle Bag">
+ Stort
+ </string>
+ <string name="Ear Angle">
+ Øre vinkel
+ </string>
+ <string name="Ear Size">
+ Øre størrelse
+ </string>
+ <string name="Ear Tips">
+ Ørespidser
+ </string>
+ <string name="Egg Head">
+ Ovalt hovede
+ </string>
+ <string name="Eye Bags">
+ Poser under øjne
+ </string>
+ <string name="Eye Color">
+ Øjenfarve
+ </string>
+ <string name="Eye Depth">
+ Øjendybde
+ </string>
+ <string name="Eye Lightness">
+ Øjennuance
+ </string>
+ <string name="Eye Opening">
+ Øjenåbning
+ </string>
+ <string name="Eye Pop">
+ Øjensymmetri
+ </string>
+ <string name="Eye Size">
+ Øjenstørrelse
+ </string>
+ <string name="Eye Spacing">
+ Øjenafstand
+ </string>
+ <string name="Eyeball Size">
+ Størrelse øjenæble
+ </string>
+ <string name="Eyebrow Arc">
+ Bue på øjenbryn
+ </string>
+ <string name="Eyebrow Density">
+ Tæthed øjenbryn
+ </string>
+ <string name="Eyebrow Height">
+ Højde på øjenbryn
+ </string>
+ <string name="Eyebrow Points">
+ Løftede øjenbryn
+ </string>
+ <string name="Eyebrow Size">
+ Størrelse øjenbryn
+ </string>
+ <string name="Eyelash Length">
+ Længde øjenvipper
+ </string>
+ <string name="Eyeliner">
+ Eyeliner
+ </string>
+ <string name="Eyeliner Color">
+ Eyeliner farve
+ </string>
+ <string name="Eyes Back">
+ Dybtliggende øjne
+ </string>
+ <string name="Eyes Bugged">
+ Udstående øjne
+ </string>
+ <string name="Eyes Forward">
+ Øjne fremme
+ </string>
+ <string name="Eyes Long Head">
+ Eyes Long Head
+ </string>
+ <string name="Eyes Shear Left Up">
+ Eyes Shear Left Up
+ </string>
+ <string name="Eyes Shear Right Up">
+ Eyes Shear Right Up
+ </string>
+ <string name="Eyes Short Head">
+ Eyes Short Head
+ </string>
+ <string name="Eyes Spread">
+ Stor afstand
+ </string>
+ <string name="Eyes Sunken">
+ Indsunkne øjne
+ </string>
+ <string name="Eyes Together">
+ Tætsiddende
+ </string>
+ <string name="Face Shear">
+ Ansigts symmetri
+ </string>
+ <string name="Facial Definition">
+ Ansigtskonturer
+ </string>
+ <string name="Far Set Eyes">
+ Stor afstand mellem øjne
+ </string>
+ <string name="Fat">
+ Tyk
+ </string>
+ <string name="Fat Head">
+ Tykt hovede
+ </string>
+ <string name="Fat Lips">
+ Tykke læber
+ </string>
+ <string name="Fat Lower">
+ Tyk nedre
+ </string>
+ <string name="Fat Lower Lip">
+ Tyk underlæbe
+ </string>
+ <string name="Fat Torso">
+ Tyk overkrop
+ </string>
+ <string name="Fat Upper">
+ Tyk øvre
+ </string>
+ <string name="Fat Upper Lip">
+ Tyk overlæbe
+ </string>
+ <string name="Female">
+ Kvinde
+ </string>
+ <string name="Fingerless">
+ Fingerløse
+ </string>
+ <string name="Fingers">
+ Fingre
+ </string>
+ <string name="Flared Cuffs">
+ Stor vidde
+ </string>
+ <string name="Flat">
+ Flad
+ </string>
+ <string name="Flat Butt">
+ Flad bagdel
+ </string>
+ <string name="Flat Head">
+ Fladt hovede
+ </string>
+ <string name="Flat Toe">
+ Flad snude
+ </string>
+ <string name="Foot Size">
+ Størrelse fod
+ </string>
+ <string name="Forehead Angle">
+ Pande vinkel
+ </string>
+ <string name="Forehead Heavy">
+ Stort foroven
+ </string>
+ <string name="Freckles">
+ Fregner
+ </string>
+ <string name="Front Bangs Down">
+ Pandehår - ned
+ </string>
+ <string name="Front Bangs Up">
+ Pandehår - op
+ </string>
+ <string name="Front Fringe">
+ Frynser foran
+ </string>
+ <string name="Front Hair">
+ Hår foran
+ </string>
+ <string name="Front Hair Down">
+ Hår foran - ned
+ </string>
+ <string name="Front Hair Up">
+ Hår foran - op
+ </string>
+ <string name="Full Back">
+ Langt ud bagtil
+ </string>
+ <string name="Full Eyeliner">
+ Meget eyeliner
+ </string>
+ <string name="Full Front">
+ Langt frem fortil
+ </string>
+ <string name="Full Hair Sides">
+ Hår i siderne
+ </string>
+ <string name="Full Sides">
+ Meget hår
+ </string>
+ <string name="Glossy">
+ Skinnende
+ </string>
+ <string name="Glove Fingers">
+ Fingre i handsker
+ </string>
+ <string name="Glove Length">
+ Handskelængde
+ </string>
+ <string name="Hair">
+ Hår
+ </string>
+ <string name="Hair Back">
+ Hår: Bagtil
+ </string>
+ <string name="Hair Front">
+ Hår: Foran
+ </string>
+ <string name="Hair Sides">
+ Hår: Siderne
+ </string>
+ <string name="Hair Sweep">
+ Strøget hår
+ </string>
+ <string name="Hair Thickess">
+ Hår tykkelse
+ </string>
+ <string name="Hair Thickness">
+ Hår tykkelse
+ </string>
+ <string name="Hair Tilt">
+ Hældning
+ </string>
+ <string name="Hair Tilted Left">
+ mest hår venstre
+ </string>
+ <string name="Hair Tilted Right">
+ Mest hår højre
+ </string>
+ <string name="Hair Volume">
+ Hår: Volumen
+ </string>
+ <string name="Hand Size">
+ Størrelse hånd
+ </string>
+ <string name="Handlebars">
+ Cykelstyr
+ </string>
+ <string name="Head Length">
+ Længde på hovede
+ </string>
+ <string name="Head Shape">
+ Hovedform
+ </string>
+ <string name="Head Size">
+ Hovedstørrelse
+ </string>
+ <string name="Head Stretch">
+ Hovedhøjde
+ </string>
+ <string name="Heel Height">
+ Hælhøjde
+ </string>
+ <string name="Heel Shape">
+ Hælform
+ </string>
+ <string name="Height">
+ Højde
+ </string>
+ <string name="High">
+ Høj
+ </string>
+ <string name="High Heels">
+ Hæje hæle
+ </string>
+ <string name="High Jaw">
+ Høj kæbe
+ </string>
+ <string name="High Platforms">
+ Høje såle
+ </string>
+ <string name="High and Tight">
+ Høj og tæt
+ </string>
+ <string name="Higher">
+ Højere
+ </string>
+ <string name="Hip Length">
+ Hoftelængde
+ </string>
+ <string name="Hip Width">
+ Hoftebredde
+ </string>
+ <string name="In">
+ Inde
+ </string>
+ <string name="In Shdw Color">
+ Indre skygge farve
+ </string>
+ <string name="In Shdw Opacity">
+ Indre skygge gennemsigtighed
+ </string>
+ <string name="Inner Eye Corner">
+ Inderste del af øje
+ </string>
+ <string name="Inner Eye Shadow">
+ Inderste øjenskygge
+ </string>
+ <string name="Inner Shadow">
+ Indre skygge
+ </string>
+ <string name="Jacket Length">
+ Jakkelængde
+ </string>
+ <string name="Jacket Wrinkles">
+ Jakkerynker
+ </string>
+ <string name="Jaw Angle">
+ Kæbevinkel
+ </string>
+ <string name="Jaw Jut">
+ Kæbefremspring
+ </string>
+ <string name="Jaw Shape">
+ Kæbeform
+ </string>
+ <string name="Join">
+ Saml
+ </string>
+ <string name="Jowls">
+ Kindehud
+ </string>
+ <string name="Knee Angle">
+ Knævinkel
+ </string>
+ <string name="Knock Kneed">
+ Kalveknæet
+ </string>
+ <string name="Large">
+ Stor
+ </string>
+ <string name="Large Hands">
+ Store hænder
+ </string>
+ <string name="Left Part">
+ Venstre side
+ </string>
+ <string name="Leg Length">
+ Benlængde
+ </string>
+ <string name="Leg Muscles">
+ Benmuskler
+ </string>
+ <string name="Less">
+ Mindre
+ </string>
+ <string name="Less Body Fat">
+ Mindre kropsfedt
+ </string>
+ <string name="Less Curtains">
+ Mindre
+ </string>
+ <string name="Less Freckles">
+ Færre fregner
+ </string>
+ <string name="Less Full">
+ Mindre
+ </string>
+ <string name="Less Gravity">
+ Mindre
+ </string>
+ <string name="Less Love">
+ Mindre bildæk
+ </string>
+ <string name="Less Muscles">
+ Færre muskler
+ </string>
+ <string name="Less Muscular">
+ Mindre muskuløs
+ </string>
+ <string name="Less Rosy">
+ Mindre rosa
+ </string>
+ <string name="Less Round">
+ Mindre rund
+ </string>
+ <string name="Less Saddle">
+ Mindre
+ </string>
+ <string name="Less Square">
+ Mindre
+ </string>
+ <string name="Less Volume">
+ Mindre
+ </string>
+ <string name="Less soul">
+ Mindre
+ </string>
+ <string name="Lighter">
+ Lettere
+ </string>
+ <string name="Lip Cleft">
+ Læbekløft
+ </string>
+ <string name="Lip Cleft Depth">
+ Dybde læbekløft
+ </string>
+ <string name="Lip Fullness">
+ Fyldige læber
+ </string>
+ <string name="Lip Pinkness">
+ Lyserøde læber
+ </string>
+ <string name="Lip Ratio">
+ Læbeproportioner
+ </string>
+ <string name="Lip Thickness">
+ Læbetykkelse
+ </string>
+ <string name="Lip Width">
+ Læbebredde
+ </string>
+ <string name="Lipgloss">
+ Lipgloss
+ </string>
+ <string name="Lipstick">
+ Læbestift
+ </string>
+ <string name="Lipstick Color">
+ Læbestift farve
+ </string>
+ <string name="Long">
+ Lang
+ </string>
+ <string name="Long Head">
+ Langt hovede
+ </string>
+ <string name="Long Hips">
+ Lange hofter
+ </string>
+ <string name="Long Legs">
+ Bange ben
+ </string>
+ <string name="Long Neck">
+ Lang hals
+ </string>
+ <string name="Long Pigtails">
+ Lange rottehaler
+ </string>
+ <string name="Long Ponytail">
+ Lang hestehale
+ </string>
+ <string name="Long Torso">
+ Lang overkrop
+ </string>
+ <string name="Long arms">
+ Lange arme
+ </string>
+ <string name="Longcuffs">
+ Longcuffs
+ </string>
+ <string name="Loose Pants">
+ Løse bukser
+ </string>
+ <string name="Loose Shirt">
+ Løs trøje
+ </string>
+ <string name="Loose Sleeves">
+ Løse ærmer
+ </string>
+ <string name="Love Handles">
+ Bildæk
+ </string>
+ <string name="Low">
+ Lav
+ </string>
+ <string name="Low Heels">
+ Flade hæle
+ </string>
+ <string name="Low Jaw">
+ Lav kæbe
+ </string>
+ <string name="Low Platforms">
+ Flade såler
+ </string>
+ <string name="Low and Loose">
+ Lav og løs
+ </string>
+ <string name="Lower">
+ Nedre
+ </string>
+ <string name="Lower Bridge">
+ Nedre næseryg
+ </string>
+ <string name="Lower Cheeks">
+ Nedre kinder
+ </string>
+ <string name="Male">
+ Mand
+ </string>
+ <string name="Middle Part">
+ Midterste del
+ </string>
+ <string name="More">
+ Mere
+ </string>
+ <string name="More Blush">
+ Mere rødmen
+ </string>
+ <string name="More Body Fat">
+ Mere kropsfedt
+ </string>
+ <string name="More Curtains">
+ Mere
+ </string>
+ <string name="More Eyeshadow">
+ Mere øjenskygge
+ </string>
+ <string name="More Freckles">
+ Flere fregner
+ </string>
+ <string name="More Full">
+ Mere
+ </string>
+ <string name="More Gravity">
+ More
+ </string>
+ <string name="More Lipstick">
+ Mere læbestift
+ </string>
+ <string name="More Love">
+ Mere bildæk
+ </string>
+ <string name="More Lower Lip">
+ Mere underlæbe
+ </string>
+ <string name="More Muscles">
+ Flere muskler
+ </string>
+ <string name="More Muscular">
+ Mere muskuløs
+ </string>
+ <string name="More Rosy">
+ Mere rosa
+ </string>
+ <string name="More Round">
+ Mere rund
+ </string>
+ <string name="More Saddle">
+ Mere
+ </string>
+ <string name="More Sloped">
+ Mere skrå
+ </string>
+ <string name="More Square">
+ Mere firkantet
+ </string>
+ <string name="More Upper Lip">
+ Mere overlæbe
+ </string>
+ <string name="More Vertical">
+ Mere lodret
+ </string>
+ <string name="More Volume">
+ Mere
+ </string>
+ <string name="More soul">
+ Mere
+ </string>
+ <string name="Moustache">
+ Overskæg
+ </string>
+ <string name="Mouth Corner">
+ Mundvige
+ </string>
+ <string name="Mouth Position">
+ Position mund
+ </string>
+ <string name="Mowhawk">
+ Intet hår
+ </string>
+ <string name="Muscular">
+ Muskuløs
+ </string>
+ <string name="Mutton Chops">
+ Lange
+ </string>
+ <string name="Nail Polish">
+ Neglelak
+ </string>
+ <string name="Nail Polish Color">
+ Neglelak farve
+ </string>
+ <string name="Narrow">
+ Smal
+ </string>
+ <string name="Narrow Back">
+ Smal bagtil
+ </string>
+ <string name="Narrow Front">
+ Smal fortil
+ </string>
+ <string name="Narrow Lips">
+ Smalle læber
+ </string>
+ <string name="Natural">
+ Naturlig
+ </string>
+ <string name="Neck Length">
+ Halslængde
+ </string>
+ <string name="Neck Thickness">
+ Halstykkelse
+ </string>
+ <string name="No Blush">
+ Ingen rødmen
+ </string>
+ <string name="No Eyeliner">
+ Ingen eyeliner
+ </string>
+ <string name="No Eyeshadow">
+ Ingen øjenskygge
+ </string>
+ <string name="No Heels">
+ Ingen hæle
+ </string>
+ <string name="No Lipgloss">
+ Ingen lipgloss
+ </string>
+ <string name="No Lipstick">
+ Ingen læbestift
+ </string>
+ <string name="No Part">
+ Ingen dele
+ </string>
+ <string name="No Polish">
+ Ingen lak
+ </string>
+ <string name="No Red">
+ Ingen rød
+ </string>
+ <string name="No Spikes">
+ Ingen spikes
+ </string>
+ <string name="No White">
+ Ingen hvid
+ </string>
+ <string name="No Wrinkles">
+ Ingen rynker
+ </string>
+ <string name="Normal Lower">
+ Normal nedre
+ </string>
+ <string name="Normal Upper">
+ Normal øvre
+ </string>
+ <string name="Nose Left">
+ Højre
+ </string>
+ <string name="Nose Right">
+ Venstre
+ </string>
+ <string name="Nose Size">
+ Næse størrelse
+ </string>
+ <string name="Nose Thickness">
+ Næse tykkelse
+ </string>
+ <string name="Nose Tip Angle">
+ Næsetip vinkel
+ </string>
+ <string name="Nose Tip Shape">
+ Næsetip form
+ </string>
+ <string name="Nose Width">
+ Næse bredde
+ </string>
+ <string name="Nostril Division">
+ Næsebor adskillelse
+ </string>
+ <string name="Nostril Width">
+ Næsebor bredde
+ </string>
+ <string name="Old">
+ Gammel
+ </string>
+ <string name="Opaque">
+ Uigennemsigtig
+ </string>
+ <string name="Open">
+ Åben
+ </string>
+ <string name="Open Back">
+ Åben bagtil
+ </string>
+ <string name="Open Front">
+ Åben foran
+ </string>
+ <string name="Open Left">
+ Åben til venstre
+ </string>
+ <string name="Open Right">
+ Åben til højre
+ </string>
+ <string name="Orange">
+ Orange
+ </string>
+ <string name="Out">
+ Ud
+ </string>
+ <string name="Out Shdw Color">
+ Ydre skygge farve
+ </string>
+ <string name="Out Shdw Opacity">
+ Ydre skygge uigennemsigtighed
+ </string>
+ <string name="Outer Eye Corner">
+ Yderste del af øje
+ </string>
+ <string name="Outer Eye Shadow">
+ Ydre øjenskygge
+ </string>
+ <string name="Outer Shadow">
+ Ydre skygge
+ </string>
+ <string name="Overbite">
+ Overbid
+ </string>
+ <string name="Package">
+ Skridt
+ </string>
+ <string name="Painted Nails">
+ Malede negle
+ </string>
+ <string name="Pale">
+ Bleg
+ </string>
+ <string name="Pants Crotch">
+ Bukser skridt
+ </string>
+ <string name="Pants Fit">
+ Pasform bukser
+ </string>
+ <string name="Pants Length">
+ Bukser - længde
+ </string>
+ <string name="Pants Waist">
+ Bukser - vidde
+ </string>
+ <string name="Pants Wrinkles">
+ Bukser - rynker
+ </string>
+ <string name="Part">
+ Skilning
+ </string>
+ <string name="Part Bangs">
+ Skilning
+ </string>
+ <string name="Pectorals">
+ Brystmuskler
+ </string>
+ <string name="Pigment">
+ Pigmentering
+ </string>
+ <string name="Pigtails">
+ Rottehaler
+ </string>
+ <string name="Pink">
+ Pink
+ </string>
+ <string name="Pinker">
+ Mere pink
+ </string>
+ <string name="Platform Height">
+ Højde sål
+ </string>
+ <string name="Platform Width">
+ Bredde sål
+ </string>
+ <string name="Pointy">
+ Spids
+ </string>
+ <string name="Pointy Heels">
+ Spidse hæle
+ </string>
+ <string name="Pointy Toe">
+ Spids snude
+ </string>
+ <string name="Ponytail">
+ Hestehale
+ </string>
+ <string name="Poofy Skirt">
+ Strutskørt
+ </string>
+ <string name="Pop Left Eye">
+ Forstør venstre øje
+ </string>
+ <string name="Pop Right Eye">
+ Forstør højre øje
+ </string>
+ <string name="Puffy">
+ Posede
+ </string>
+ <string name="Puffy Eyelids">
+ Posede øjenlåg
+ </string>
+ <string name="Rainbow Color">
+ Regnbue farver
+ </string>
+ <string name="Red Hair">
+ Rødt hår
+ </string>
+ <string name="Red Skin">
+ Rød hud
+ </string>
+ <string name="Regular">
+ Almindelig
+ </string>
+ <string name="Regular Muscles">
+ Almindelige muskler
+ </string>
+ <string name="Right Part">
+ Højre skildning
+ </string>
+ <string name="Rosy Complexion">
+ Rosa teint
+ </string>
+ <string name="Round">
+ Rund
+ </string>
+ <string name="Round Forehead">
+ Rund pande
+ </string>
+ <string name="Ruddiness">
+ Rødmossethed
+ </string>
+ <string name="Ruddy">
+ Rødmosset
+ </string>
+ <string name="Rumpled Hair">
+ Krøllet hår
+ </string>
+ <string name="Saddle Bags">
+ Ridebukselår
+ </string>
+ <string name="Saddlebags">
+ Ridebukselår
+ </string>
+ <string name="Scrawny">
+ Radmager
+ </string>
+ <string name="Scrawny Leg">
+ Magert ben
+ </string>
+ <string name="Separate">
+ Separat
+ </string>
+ <string name="Shading">
+ Skygger
+ </string>
+ <string name="Shadow hair">
+ Skygge hår
+ </string>
+ <string name="Shallow">
+ Lille
+ </string>
+ <string name="Shear Back">
+ Afklippet bagi
+ </string>
+ <string name="Shear Face">
+ Skævt ansigt
+ </string>
+ <string name="Shear Front">
+ "Måne"
+ </string>
+ <string name="Shear Left">
+ Venstre
+ </string>
+ <string name="Shear Left Up">
+ Venstre op
+ </string>
+ <string name="Shear Right">
+ Højre
+ </string>
+ <string name="Shear Right Up">
+ Højre op
+ </string>
+ <string name="Sheared Back">
+ Afklippet bagtil
+ </string>
+ <string name="Sheared Front">
+ Måne
+ </string>
+ <string name="Shift Left">
+ Mod venstre
+ </string>
+ <string name="Shift Mouth">
+ Flyt mund
+ </string>
+ <string name="Shift Right">
+ Mod højre
+ </string>
+ <string name="Shirt Bottom">
+ Trøje - bund
+ </string>
+ <string name="Shirt Fit">
+ Trøje - pasform
+ </string>
+ <string name="Shirt Wrinkles">
+ Trøje - rynker
+ </string>
+ <string name="Shoe Height">
+ Sko højde
+ </string>
+ <string name="Short">
+ Kort
+ </string>
+ <string name="Short Arms">
+ Korte arme
+ </string>
+ <string name="Short Legs">
+ Korte ben
+ </string>
+ <string name="Short Neck">
+ Kort hals
+ </string>
+ <string name="Short Pigtails">
+ Korte rottehaler
+ </string>
+ <string name="Short Ponytail">
+ Kort hestehale
+ </string>
+ <string name="Short Sideburns">
+ Korte
+ </string>
+ <string name="Short Torso">
+ Kort overkrop
+ </string>
+ <string name="Short hips">
+ Korte hofter
+ </string>
+ <string name="Shoulders">
+ Skuldre
+ </string>
+ <string name="Side Bangs">
+ Sidehår
+ </string>
+ <string name="Side Bangs Down">
+ Ned
+ </string>
+ <string name="Side Bangs Up">
+ Op
+ </string>
+ <string name="Side Fringe">
+ Side frynser
+ </string>
+ <string name="Sideburns">
+ Bakkenbarter
+ </string>
+ <string name="Sides Hair">
+ Sidehår
+ </string>
+ <string name="Sides Hair Down">
+ Ned
+ </string>
+ <string name="Sides Hair Up">
+ Op
+ </string>
+ <string name="Skinny">
+ Tynd
+ </string>
+ <string name="Skinny Neck">
+ Tynd hals
+ </string>
+ <string name="Skirt Fit">
+ Omfang
+ </string>
+ <string name="Skirt Length">
+ Længde nederdel
+ </string>
+ <string name="Slanted Forehead">
+ Skrånende pande
+ </string>
+ <string name="Sleeve Length">
+ Ærmelængde
+ </string>
+ <string name="Sleeve Looseness">
+ Ærmer - stramhed
+ </string>
+ <string name="Slit Back">
+ Slids: Bag
+ </string>
+ <string name="Slit Front">
+ Slids: Foran
+ </string>
+ <string name="Slit Left">
+ Slids: Venstre
+ </string>
+ <string name="Slit Right">
+ Slids: Højre
+ </string>
+ <string name="Small">
+ Lille
+ </string>
+ <string name="Small Hands">
+ Små hænder
+ </string>
+ <string name="Small Head">
+ Lille hovede
+ </string>
+ <string name="Smooth">
+ Glat
+ </string>
+ <string name="Smooth Hair">
+ Glat hår
+ </string>
+ <string name="Socks Length">
+ Strømper - længde
+ </string>
+ <string name="Some">
+ Nogen
+ </string>
+ <string name="Soulpatch">
+ Soulpatch
+ </string>
+ <string name="Sparse">
+ Sparsomt
+ </string>
+ <string name="Spiked Hair">
+ Hår med "spikes"
+ </string>
+ <string name="Square">
+ Firkantet
+ </string>
+ <string name="Square Toe">
+ Firkantet snude
+ </string>
+ <string name="Squash Head">
+ Bredt hovede
+ </string>
+ <string name="Squash/Stretch Head">
+ Sammentryk/stræk hovede
+ </string>
+ <string name="Stretch Head">
+ Stræk hovede
+ </string>
+ <string name="Sunken">
+ Indsunket
+ </string>
+ <string name="Sunken Chest">
+ Indsunket bryst
+ </string>
+ <string name="Sunken Eyes">
+ Dybtliggende øjne
+ </string>
+ <string name="Sweep Back">
+ Stryge tilbage
+ </string>
+ <string name="Sweep Forward">
+ Stryge fremad
+ </string>
+ <string name="Swept Back">
+ Tilbagestrøget
+ </string>
+ <string name="Swept Back Hair">
+ Tilbagestrøget hår
+ </string>
+ <string name="Swept Forward">
+ Fremadstrøget
+ </string>
+ <string name="Swept Forward Hair">
+ Fremadstrøget hår
+ </string>
+ <string name="Tall">
+ Høj
+ </string>
+ <string name="Taper Back">
+ Indsnævring bag
+ </string>
+ <string name="Taper Front">
+ Indsnævring foran
+ </string>
+ <string name="Thick Heels">
+ Brede hæle
+ </string>
+ <string name="Thick Neck">
+ Bred nakke
+ </string>
+ <string name="Thick Toe">
+ Bred snude
+ </string>
+ <string name="Thickness">
+ Tykkelse
+ </string>
+ <string name="Thin">
+ Tynd
+ </string>
+ <string name="Thin Eyebrows">
+ Tynde øjenbryn
+ </string>
+ <string name="Thin Lips">
+ Tynde læber
+ </string>
+ <string name="Thin Nose">
+ Tynd næse
+ </string>
+ <string name="Tight Chin">
+ Stram hage
+ </string>
+ <string name="Tight Cuffs">
+ Smalle bukseben
+ </string>
+ <string name="Tight Pants">
+ Stramme bukser
+ </string>
+ <string name="Tight Shirt">
+ Stram trøje
+ </string>
+ <string name="Tight Skirt">
+ Stram nederdel
+ </string>
+ <string name="Tight Sleeves">
+ Stramme ærmer
+ </string>
+ <string name="Tilt Left">
+ Hæld til venstre
+ </string>
+ <string name="Tilt Right">
+ Hæld til højre
+ </string>
+ <string name="Toe Shape">
+ Sko form
+ </string>
+ <string name="Toe Thickness">
+ Tykkelse af snud
+ </string>
+ <string name="Torso Length">
+ Overkrop - længde
+ </string>
+ <string name="Torso Muscles">
+ Overkrop - muskler
+ </string>
+ <string name="Torso Scrawny">
+ Overkrop - mager
+ </string>
+ <string name="Unattached">
+ Ikke vedhæftet
+ </string>
+ <string name="Uncreased">
+ Glat
+ </string>
+ <string name="Underbite">
+ Underbid
+ </string>
+ <string name="Unnatural">
+ Unaturlig
+ </string>
+ <string name="Upper Bridge">
+ Øverste næseryg
+ </string>
+ <string name="Upper Cheeks">
+ Øvre kinder
+ </string>
+ <string name="Upper Chin Cleft">
+ Øvre hagekløft
+ </string>
+ <string name="Upper Eyelid Fold">
+ Øvre øjenlåg
+ </string>
+ <string name="Upturned">
+ Opadvendt
+ </string>
+ <string name="Very Red">
+ Meget rød
+ </string>
+ <string name="Waist Height">
+ Talje højde
+ </string>
+ <string name="Well-Fed">
+ Velnæret
+ </string>
+ <string name="White Hair">
+ Hvidt hår
+ </string>
+ <string name="Wide">
+ Bred
+ </string>
+ <string name="Wide Back">
+ Bredt
+ </string>
+ <string name="Wide Front">
+ Bredt
+ </string>
+ <string name="Wide Lips">
+ Brede læber
+ </string>
+ <string name="Wild">
+ Vildt
+ </string>
+ <string name="Wrinkles">
+ Rynker
+ </string>
+ <string name="LocationCtrlAddLandmarkTooltip">
+ Tilføj til mine landemærker
+ </string>
+ <string name="LocationCtrlEditLandmarkTooltip">
+ Rediger mit landemærke
+ </string>
+ <string name="LocationCtrlInfoBtnTooltip">
+ Se yderligere information om nuværende lokation
+ </string>
+ <string name="LocationCtrlComboBtnTooltip">
+ Min lokationshistorik
+ </string>
+ <string name="UpdaterWindowTitle">
+ [APP_NAME] Opdatér
+ </string>
+ <string name="UpdaterNowUpdating">
+ Opdaterer nu [APP_NAME]...
+ </string>
+ <string name="UpdaterNowInstalling">
+ Installerer [APP_NAME]...
+ </string>
+ <string name="UpdaterUpdatingDescriptive">
+ Din [APP_NAME] klient bliver opdateret til nyeste version. Dette kan tage noget tid, så venligst vær tålmodig.
+ </string>
+ <string name="UpdaterProgressBarTextWithEllipses">
+ Download færdig...
+ </string>
+ <string name="UpdaterProgressBarText">
+ Downloader opdatering
+ </string>
+ <string name="UpdaterFailDownloadTitle">
+ Download af opdatering fejlede
+ </string>
+ <string name="UpdaterFailUpdateDescriptive">
+ Der opstod en fejl ved opdatering af [APP_NAME]. Hent venligst den nyeste version fra www.secondlife.com.
+ </string>
+ <string name="UpdaterFailInstallTitle">
+ Installation af opdatering fejlede
+ </string>
+ <string name="UpdaterFailStartTitle">
+ Opstart af klient fejlede
+ </string>
+ <string name="IM_logging_string">
+ -- Logning af IM aktiveret --
+ </string>
+ <string name="IM_typing_start_string">
+ [NAME] skriver...
+ </string>
+ <string name="Unnamed">
+ (Uden navn)
+ </string>
+ <string name="IM_moderated_chat_label">
+ (Modereret: Stemmer deaktiveret)
+ </string>
+ <string name="IM_unavailable_text_label">
+ Tekst chat er ikke tilgængelig i denne samtale.
+ </string>
+ <string name="IM_muted_text_label">
+ Din tekst chat er blevet deaktiveret af en gruppe moderator.
+ </string>
+ <string name="IM_default_text_label">
+ Klik her for privat besked (IM).
+ </string>
+ <string name="IM_to_label">
+ Til
+ </string>
+ <string name="IM_moderator_label">
+ (Moderator)
+ </string>
+ <string name="only_user_message">
+ Du er den eneste deltager i denne samtale
+ </string>
+ <string name="offline_message">
+ [FIRST] [LAST] er ikke logget på.
+ </string>
+ <string name="invite_message">
+ Tryk på [BUTTON NAME] knappen for at acceptére/tilslutte til denne stemme chat.
+ </string>
+ <string name="muted_message">
+ Du har blokeret denne beboer. Hvis du starter en samtale vil denne blokering automatisk blive fjernet.
+ </string>
+ <string name="generic_request_error">
+ Kunne ikke etablere forbindelse, prøv igen senere
+ </string>
+ <string name="insufficient_perms_error">
+ Du har ikke de fornødne rettigheder.
+ </string>
+ <string name="session_does_not_exist_error">
+ Denne samtale er lukket ned
+ </string>
+ <string name="no_ability_error">
+ Du har ikke den mulighed.
+ </string>
+ <string name="no_ability">
+ Du har ikke den mulighed.
+ </string>
+ <string name="not_a_mod_error">
+ Du er ikke moderator for denne samtale.
+ </string>
+ <string name="muted_error">
+ Du er blevet "blokeret".
+ </string>
+ <string name="add_session_event">
+ Ikke muligt at tilføge brugere til samtale med [RECIPIENT].
+ </string>
+ <string name="message_session_event">
+ Ikke muligt at sende din besked til samtalen med [RECIPIENT].
+ </string>
+ <string name="removed_from_group">
+ Du er blevet fjernet fra gruppen.
+ </string>
+ <string name="close_on_no_ability">
+ Du har ikke længere mulighed for at deltage i samtalen
+ </string>
+</strings>
diff --git a/indra/newview/skins/default/xui/da/teleport_strings.xml b/indra/newview/skins/default/xui/da/teleport_strings.xml index cc75abbb26..680806c8ac 100644 --- a/indra/newview/skins/default/xui/da/teleport_strings.xml +++ b/indra/newview/skins/default/xui/da/teleport_strings.xml @@ -1,81 +1,79 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<teleport_messages> - <message_set name="errors"> - <message name="invalid_tport"> - Der er problemer med at håndtere din teleport. Det kan være nødvendigt at logge ud og ind for at kunne skifte teleportere. -Hvis du bliver ved med at have problemet kan du checke teknisk support på: -www.secondlife.com/support - </message> - <message name="invalid_region_handoff"> - Problem registreret i forbindelse med skift til ny region. Det kan være nødvendigt at logge ud og ind for at kunne skifte regioner. -Hvis du bliver ved med at have problemet kan du checke teknisk support på: -www.secondlife.com/support - </message> - <message name="blocked_tport"> - Beklager, teleport er blokeret lige nu. Prøv igen senere. -Hvis du stadig ikke kan teleporte, prøv venligst at logge ud og ligge ind for at løse dette problem. - </message> - <message name="nolandmark_tport"> - Beklager, systemet kunne ikke finde landmærke destinationen. - </message> - <message name="timeout_tport"> - Beklager, systemet kunne ikke fuldføre teleport forbindelse. -Prøv igen om lidt. - </message> - <message name="noaccess_tport"> - Beklager, du har ikke adgang til denne teleport destination. - </message> - <message name="missing_attach_tport"> - Dine vedhæng er ikke ankommet endnu. Prøv at vente lidt endnu eller log ud og ind igen før du prøver at teleporte igen. - </message> - <message name="too_many_uploads_tport"> - Tekniske problemer hindrer at din teleport kan gennemføres. -Prøv venligst igen om lidt eller vælg et mindre travlt område. - </message> - <message name="expired_tport"> - Beklager, men systemet kunne ikke fuldføre din teleport i rimelig tid. Prøv venligst igen om lidt. - </message> - <message name="expired_region_handoff"> - Beklager, men systemet kunne ikke fuldføre skift til anden region i rimelig tid. Prøv venligst igen om lidt. - </message> - <message name="no_host"> - Ikke muligt at fine teleport destination. Destinationen kan være midlertidig utilgængelig eller findes ikke mere. -Prøv evt. igen om lidt. - </message> - <message name="no_inventory_host"> - Beholdningssystemet er ikke tilgængelig lige nu. - </message> - </message_set> - <message_set name="progress"> - <message name="sending_dest"> - Sender til destination. - </message> - <message name="redirecting"> - Omdirigerer til en anden lokation. - </message> - <message name="relaying"> - Overfører til destination. - </message> - <message name="sending_home"> - Sender forespørgsel på hjem-position. - </message> - <message name="sending_landmark"> - Semder anmodning om landmærke. - </message> - <message name="completing"> - Fuldfører teleport. - </message> - <message name="resolving"> - Finder destination. - </message> - <message name="contacting"> - Kontakter ny region. - </message> - <message name="arriving"> - Ankommer... - </message> - <message name="requesting"> - Anmoder om teleport... - </message> - </message_set> -</teleport_messages> +<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<teleport_messages>
+ <message_set name="errors">
+ <message name="invalid_tport">
+ Der er problemer med at håndtere din teleport. Det kan være nødvendigt at logge ud og ind for at kunne skifte teleportere.
+Hvis du bliver ved med at have problemet kan du checke teknisk support på: [SUPPORT_SITE].
+ </message>
+ <message name="invalid_region_handoff">
+ Problem registreret i forbindelse med skift til ny region. Det kan være nødvendigt at logge ud og ind for at kunne skifte regioner.
+Hvis du bliver ved med at have problemet kan du checke teknisk support på: [SUPPORT_SITE].
+ </message>
+ <message name="blocked_tport">
+ Beklager, teleport er blokeret lige nu. Prøv igen senere.
+Hvis du stadig ikke kan teleporte, prøv venligst at logge ud og ligge ind for at løse dette problem.
+ </message>
+ <message name="nolandmark_tport">
+ Beklager, systemet kunne ikke finde landmærke destinationen.
+ </message>
+ <message name="timeout_tport">
+ Beklager, systemet kunne ikke fuldføre teleport forbindelse.
+Prøv igen om lidt.
+ </message>
+ <message name="noaccess_tport">
+ Beklager, du har ikke adgang til denne teleport destination.
+ </message>
+ <message name="missing_attach_tport">
+ Dine vedhæng er ikke ankommet endnu. Prøv at vente lidt endnu eller log ud og ind igen før du prøver at teleporte igen.
+ </message>
+ <message name="too_many_uploads_tport">
+ Tekniske problemer hindrer at din teleport kan gennemføres.
+Prøv venligst igen om lidt eller vælg et mindre travlt område.
+ </message>
+ <message name="expired_tport">
+ Beklager, men systemet kunne ikke fuldføre din teleport i rimelig tid. Prøv venligst igen om lidt.
+ </message>
+ <message name="expired_region_handoff">
+ Beklager, men systemet kunne ikke fuldføre skift til anden region i rimelig tid. Prøv venligst igen om lidt.
+ </message>
+ <message name="no_host">
+ Ikke muligt at fine teleport destination. Destinationen kan være midlertidig utilgængelig eller findes ikke mere.
+Prøv evt. igen om lidt.
+ </message>
+ <message name="no_inventory_host">
+ Beholdningssystemet er ikke tilgængelig lige nu.
+ </message>
+ </message_set>
+ <message_set name="progress">
+ <message name="sending_dest">
+ Sender til destination.
+ </message>
+ <message name="redirecting">
+ Omdirigerer til en anden lokation.
+ </message>
+ <message name="relaying">
+ Overfører til destination.
+ </message>
+ <message name="sending_home">
+ Sender forespørgsel på hjem-position.
+ </message>
+ <message name="sending_landmark">
+ Semder anmodning om landmærke.
+ </message>
+ <message name="completing">
+ Fuldfører teleport.
+ </message>
+ <message name="resolving">
+ Finder destination.
+ </message>
+ <message name="contacting">
+ Kontakter ny region.
+ </message>
+ <message name="arriving">
+ Ankommer...
+ </message>
+ <message name="requesting">
+ Anmoder om teleport...
+ </message>
+ </message_set>
+</teleport_messages>
diff --git a/indra/newview/skins/default/xui/de/floater_buy_currency.xml b/indra/newview/skins/default/xui/de/floater_buy_currency.xml index 05750a1782..56b7868c33 100644 --- a/indra/newview/skins/default/xui/de/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/de/floater_buy_currency.xml @@ -29,7 +29,7 @@ 1234 </line_editor> <text name="currency_est"> - für ca. [USD] US$ + für ca. [LOCALAMOUNT] </text> <text name="getting_data"> Daten werden geladen... @@ -63,6 +63,6 @@ Kaufen Sie mehr. <button label="Kaufen" name="buy_btn" /> <button label="Abbrechen" name="cancel_btn" /> <text name="buy_currency"> - [LINDENS] L$ für ca. [USD] US$ kaufen + [LINDENS] L$ für ca. [LOCALAMOUNT] kaufen </text> </floater> diff --git a/indra/newview/skins/default/xui/en/alert_line_editor.xml b/indra/newview/skins/default/xui/en/alert_line_editor.xml index ab708adb06..97991153d8 100644 --- a/indra/newview/skins/default/xui/en/alert_line_editor.xml +++ b/indra/newview/skins/default/xui/en/alert_line_editor.xml @@ -7,5 +7,5 @@ ignore_tab="true" max_length="254" text_pad_right="0" - text_pad_left="0" + text_pad_left="2" mouse_opaque="true"/> diff --git a/indra/newview/skins/default/xui/en/floater_aaa.xml b/indra/newview/skins/default/xui/en/floater_aaa.xml index 4bbd561882..f89ad2f997 100644 --- a/indra/newview/skins/default/xui/en/floater_aaa.xml +++ b/indra/newview/skins/default/xui/en/floater_aaa.xml @@ -1,10 +1,54 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater - height="768" + legacy_header_height="18" + can_minimize="false" + can_tear_off="false" + can_resize="true" + can_drag_on_left="false" + can_close="true" + can_dock="true" + bevel_style="in" + height="300" layout="topleft" - name="floater_aaa" - can_resize="true" - width="1024"> - <string name="Nudge Parabuild">2</string> - <panel filename="main_view.xml" follows="all" width="1024" height="768" top="0"/> + name="Test Floater" + save_rect="true" + title="TEST FLOATER" + save_dock_state="true" + save_visibility="true" + single_instance="true" + width="320"> + <string name="nudge_parabuild">Nudge 1</string> + <chat_history + allow_html="true" + bg_readonly_color="ChatHistoryBgColor" + bg_writeable_color="ChatHistoryBgColor" + border_visible="false" + follows="all" + font="SansSerif" + left="1" + top="20" + layout="topleft" + height="260" + name="chat_history" + parse_highlights="true" + text_color="ChatHistoryTextColor" + text_readonly_color="ChatHistoryTextColor" + width="320"> +Really long line that is long enough to wrap once with jyg descenders. +Really long line that is long enough to wrap once with jyg descenders. +Really long line that is long enough to wrap once with jyg descenders. +Really long line that is long enough to wrap once with jyg descenders. +Really long line that is long enough to wrap once with jyg descenders. +Really long line that is long enough to wrap once with jyg descenders. +Really long line that is long enough to wrap once with jyg descenders. +Really long line that is long enough to wrap once with jyg descenders. +Really long line that is long enough to wrap once with jyg descenders. +Really long line that is long enough to wrap once with jyg descenders. +Really long line that is long enough to wrap once with jyg descenders. +Really long line that is long enough to wrap once with jyg descenders. +Really long line that is long enough to wrap once with jyg descenders. +Really long line that is long enough to wrap once with jyg descenders. +Really long line that is long enough to wrap once with jyg descenders. +Really long line that is long enough to wrap once with jyg descenders. + </chat_history> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 4f1024f56d..d1fd42bdd9 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -7,7 +7,7 @@ help_topic="floaterland" save_rect="true" title="ABOUT LAND" - width="460"> + width="490"> <floater.string name="Minutes"> [MINUTES] minutes @@ -25,25 +25,25 @@ remaining </floater.string> <tab_container - follows="left|top|right|bottom" - height="400" + follows="all" + height="410" layout="topleft" - left="1" + left="0" name="landtab" tab_position="top" - top="20" - width="459"> + tab_height="25" + tab_min_width="67" + top="10" + width="489"> <panel - border="true" - follows="left|top|right|bottom" - height="380" - label="General" + border="false" + follows="all" + label="GENERAL" layout="topleft" - left="1" + left="0" help_topic="land_general_tab" name="land_general_panel" - top="-31" - width="458"> + top="0"> <panel.string name="new users only"> New users only @@ -74,11 +74,11 @@ </panel.string> <panel.string name="profile_text"> - Profile... + Profile </panel.string> <panel.string name="info_text"> - Info... + Info </panel.string> <panel.string name="public_text"> @@ -95,7 +95,6 @@ <panel.string name="no_selection_text"> No parcel selected. -Go to World menu > About Land or select another parcel to show its details. </panel.string> <text type="string" @@ -103,32 +102,29 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left="4" + left="10" name="Name:" - top="4" - width="92"> + top="10" + width="100"> Name: </text> <line_editor - border_style="line" - border_thickness="1" - follows="left|top|right" + follows="left|top" height="16" layout="topleft" left_pad="2" max_length="63" name="Name" top_delta="0" - width="350" /> + width="365" /> <text type="string" length="1" follows="left|top" height="16" layout="topleft" - left="4" + left="10" name="Description:" - top="24" width="100"> Description: </text> @@ -136,10 +132,10 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top|right" height="52" layout="topleft" - left_delta="92" + left_pad="2" name="Description" top_delta="0" - width="350" + width="365" word_wrap="true" /> <text type="string" @@ -147,10 +143,10 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left="4" + left="10" name="LandType" top="84" - width="92"> + width="100"> Type: </text> <text @@ -159,7 +155,7 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left_delta="92" + left_pad="2" name="LandTypeText" top_delta="0" width="250"> @@ -171,10 +167,9 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left="4" + left="10" name="ContentRating" - top="104" - width="92"> + width="100"> Rating: </text> <text @@ -183,7 +178,7 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left_delta="92" + left_pad="2" name="ContentRatingText" top_delta="0" width="250"> @@ -195,10 +190,10 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left="4" + left="10" name="Owner:" top="124" - width="92"> + width="100"> Owner: </text> <text @@ -207,71 +202,84 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left_delta="92" + left_pad="5" name="OwnerText" - top_delta="0" - width="250"> + width="240"> Leyla Linden </text> - <button + <button + follows="right" + height="16" + image_pressed="Info_Press" + image_unselected="Info_Over" + left_pad="3" + name="info_btn" + top_delta="-2" + width="16" /> + <!-- <button follows="left|top" height="16" - label="Profile..." - label_selected="Profile..." + label="Profile" layout="topleft" left_pad="4" name="Profile..." - top_delta="0" - width="90" /> + width="90" />--> <text type="string" length="1" follows="left|top" height="16" layout="topleft" - left="4" + left="10" name="Group:" - top="144" - width="92"> + width="100"> Group: </text> + <!--TODO: HOOK UP GROUP ICON--> <text enabled="false" follows="left|top" height="16" + left_pad="5" layout="topleft" - left_delta="92" name="GroupText" - top_delta="2" - width="250" /> + width="240" /> + <button + follows="right" + height="16" + image_pressed="Info_Press" + image_unselected="Info_Over" + left_pad="3" + name="info_btn" + top_delta="-2" + width="16" /> <button follows="left|top" - height="16" - label="Set..." - label_selected="Set..." + height="23" + label="Set" layout="topleft" left_pad="4" + right="-10" name="Set..." - top_delta="-2" - width="90" /> + width="50" /> <check_box enabled="false" - height="16" + height="23" label="Allow Deed to Group" layout="topleft" left="96" name="check deed" tool_tip="A group officer can deed this land to the group, so it will be supported by the group's land allocation." top="164" - width="116" /> + width="146" /> <button enabled="false" follows="left|top" - height="16" - label="Deed..." - label_selected="Deed..." + height="23S" + label="Deed" layout="topleft" - left_pad="138" + left_pad="2" + right="-10" name="Deed..." tool_tip="You may only deed land if you are an officer in the selected group." top_delta="0" @@ -284,7 +292,6 @@ Go to World menu > About Land or select another parcel to show its details. left="96" name="check contrib" tool_tip="When the land is deeded to the group, the former owner contributes enough land allocation to support it." - top="184" width="199" /> <text type="string" @@ -292,10 +299,9 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left="4" + left="10" name="For Sale:" - top="204" - width="92"> + width="100"> For Sale: </text> <text @@ -304,11 +310,10 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left_delta="92" + left_pad="2" name="Not for sale." - top_delta="0" width="186"> - Not for sale. + Not for sale </text> <text type="string" @@ -318,9 +323,8 @@ Go to World menu > About Land or select another parcel to show its details. layout="topleft" left_delta="0" name="For Sale: Price L$[PRICE]." - top_delta="0" width="226"> - Price: L$[PRICE] (L$[PRICE_PER_SQM]/m²). + Price: L$[PRICE] (L$[PRICE_PER_SQM]/m²) </text> <text enabled="false" @@ -329,17 +333,16 @@ Go to World menu > About Land or select another parcel to show its details. layout="topleft" left_delta="0" name="SalePending" - top_pad="4" - width="344" /> + top_pad="6" + width="324" /> <button follows="left|top" - height="20" - label="Sell Land..." - label_selected="Sell Land..." + height="23" + label="Sell Land" layout="topleft" - left_delta="199" + left_pad="5" + right="-10" name="Sell Land..." - top_delta="0" width="145" /> <text type="string" @@ -349,7 +352,7 @@ Go to World menu > About Land or select another parcel to show its details. layout="topleft" left_delta="-199" name="For sale to" - top_delta="0" + top_delta="6" width="186"> For sale to: [BUYER] </text> @@ -361,9 +364,9 @@ Go to World menu > About Land or select another parcel to show its details. layout="topleft" left_delta="0" name="Sell with landowners objects in parcel." - top_pad="4" + top_pad="8" width="186"> - Objects included in sale. + Objects included in sale </text> <text type="string" @@ -375,17 +378,17 @@ Go to World menu > About Land or select another parcel to show its details. name="Selling with no objects in parcel." top_delta="0" width="186"> - Objects not included in sale. + Objects not included in sale </text> <button follows="left|top" - height="20" + height="23" label="Cancel Land Sale" label_selected="Cancel Land Sale" layout="topleft" - left="295" + right="-10" name="Cancel Land Sale" - top="228" + left_pad="5" width="145" /> <text type="string" @@ -393,10 +396,10 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left="4" + left="10" name="Claimed:" top="268" - width="92"> + width="100"> Claimed: </text> <text @@ -405,7 +408,7 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left_delta="92" + left_pad="2" name="DateClaimText" top_delta="0" width="186"> @@ -417,10 +420,10 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left="4" + left="10" name="PriceLabel" top="288" - width="92"> + width="100"> Area: </text> <text @@ -429,7 +432,7 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left_delta="92" + left_pad="2" name="PriceText" top_delta="0" width="186"> @@ -441,10 +444,10 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left="4" + left="10" name="Traffic:" top="308" - width="92"> + width="100"> Traffic: </text> <text @@ -453,7 +456,7 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left_delta="92" + left_pad="2" name="DwellText" top_delta="0" width="186"> @@ -462,31 +465,28 @@ Go to World menu > About Land or select another parcel to show its details. <button enabled="false" follows="left|top" - height="20" - label="Buy Land..." - label_selected="Buy Land..." + height="23" + label="Buy Land" layout="topleft" - left="155" + left_delta="82" name="Buy Land..." top="328" width="100" /> <button enabled="false" follows="left|top" - height="20" - label="Buy For Group..." - label_selected="Buy For Group..." + height="23" + label="Buy For Group" layout="topleft" - left="260" + right="-10" name="Buy For Group..." top="352" width="180" /> <button enabled="false" follows="left|top" - height="20" - label="Buy Pass..." - label_selected="Buy Pass..." + height="23" + label="Buy Pass" layout="topleft" left_delta="-105" name="Buy Pass..." @@ -495,30 +495,27 @@ Go to World menu > About Land or select another parcel to show its details. width="100" /> <button follows="left|top" - height="20" - label="Abandon Land..." - label_selected="Abandon Land..." + height="23" + label="Abandon Land" layout="topleft" - left="260" + right="-10" name="Abandon Land..." top="328" width="180" /> <button follows="left|top" - height="20" - label="Reclaim Land..." - label_selected="Reclaim Land..." + height="23" + label="Reclaim Land" layout="topleft" left_delta="0" name="Reclaim Land..." - top_delta="-48" + top_delta="-50" width="180" /> <button enabled="false" follows="left|top" - height="20" - label="Linden Sale..." - label_selected="Linden Sale..." + height="23" + label="Linden Sale" layout="topleft" left_delta="0" name="Linden Sale..." @@ -528,15 +525,13 @@ Go to World menu > About Land or select another parcel to show its details. </panel> <panel border="true" - follows="left|top|right|bottom" - height="380" - label="Covenant" + follows="all" + label="COVENANT" layout="topleft" - left_delta="-1" + left="0" + top="0" help_topic="land_covenant_tab" - name="land_covenant_panel" - top_delta="-47" - width="458"> + name="land_covenant_panel"> <panel.string name="can_resell"> Purchased land in this region may be resold. @@ -557,13 +552,12 @@ Go to World menu > About Land or select another parcel to show its details. type="string" length="1" follows="left|top" - font="SansSerif" - height="20" + height="16" layout="topleft" - left="5" + left="10" mouse_opaque="false" name="estate_section_lbl" - top="0" + top="10" width="100"> Estate: </text> @@ -571,38 +565,24 @@ Go to World menu > About Land or select another parcel to show its details. type="string" length="1" follows="left|top" - height="20" + height="16" layout="topleft" - left="10" - mouse_opaque="false" - name="estate_name_lbl" - top="20" - width="100"> - Name: - </text> - <text - type="string" - length="1" - follows="left|top" - height="20" - layout="topleft" - left_pad="10" + left_pad="0" mouse_opaque="false" name="estate_name_text" top_delta="0" - width="150"> + width="260"> mainland </text> <text type="string" length="1" follows="left|top" - height="20" + height="16" layout="topleft" left="10" mouse_opaque="false" name="estate_owner_lbl" - top="40" width="100"> Owner: </text> @@ -610,55 +590,52 @@ Go to World menu > About Land or select another parcel to show its details. type="string" length="1" follows="left|top" - height="20" + height="16" layout="topleft" - left_pad="10" + left_pad="0" mouse_opaque="false" name="estate_owner_text" - top_delta="0" - width="150"> + width="300"> (none) </text> <text_editor type="string" length="1" enabled="false" - follows="left|top|right|bottom" - handle_edit_keys_directly="true" - height="115" + follows="all" + handle_edit_keys_directly="true" + height="200" layout="topleft" - left_delta="0" + left="10" max_length="65535" name="covenant_editor" - top_delta="20" - width="330" + width="470" word_wrap="true"> There is no Covenant provided for this Estate. </text_editor> <text type="string" length="1" - follows="left|top" - height="20" + follows="right|top" + height="16" + halign="right" layout="topleft" - left_delta="0" + right="-10" + top_pad="0" mouse_opaque="false" name="covenant_timestamp_text" - top_pad="55" - width="250"> + width="460"> Last Modified Wed Dec 31 16:00:00 1969 </text> <text type="string" length="1" follows="left|top" - font="SansSerif" - height="20" + height="16" layout="topleft" - left="5" + left="10" mouse_opaque="false" name="region_section_lbl" - top="250" width="100"> Region: </text> @@ -666,38 +643,23 @@ Go to World menu > About Land or select another parcel to show its details. type="string" length="1" follows="left|top" - height="20" - layout="topleft" - left="10" - mouse_opaque="false" - name="region_name_lbl" - top="270" - width="100"> - Name: - </text> - <text - type="string" - length="1" - follows="left|top" - height="20" + height="16" layout="topleft" left_pad="10" mouse_opaque="false" name="region_name_text" - top_delta="0" width="150"> - leyla + EricaVille </text> <text type="string" length="1" follows="left|top" - height="20" + height="16" layout="topleft" left="10" mouse_opaque="false" name="region_landtype_lbl" - top="290" width="100"> Type: </text> @@ -705,12 +667,11 @@ Go to World menu > About Land or select another parcel to show its details. type="string" length="1" follows="left|top" - height="20" + height="16" layout="topleft" left_pad="10" mouse_opaque="false" name="region_landtype_text" - top_delta="0" width="150"> Mainland / Homestead </text> @@ -718,12 +679,11 @@ Go to World menu > About Land or select another parcel to show its details. type="string" length="1" follows="left|top" - height="20" + height="16" layout="topleft" left="10" mouse_opaque="false" name="region_maturity_lbl" - top="310" width="100"> Rating: </text> @@ -731,12 +691,11 @@ Go to World menu > About Land or select another parcel to show its details. type="string" length="1" follows="left|top" - height="20" + height="16" layout="topleft" left_pad="10" mouse_opaque="false" name="region_maturity_text" - top_delta="0" width="150"> Adult </text> @@ -744,12 +703,11 @@ Go to World menu > About Land or select another parcel to show its details. type="string" length="1" follows="left|top" - height="20" + height="16" layout="topleft" left="10" mouse_opaque="false" name="resellable_lbl" - top="330" width="100"> Resale: </text> @@ -757,12 +715,11 @@ Go to World menu > About Land or select another parcel to show its details. type="string" length="1" follows="left|top" - height="20" + height="16" layout="topleft" left_pad="10" mouse_opaque="false" name="resellable_clause" - top_delta="0" width="330"> Land in this region may not be resold. </text> @@ -770,12 +727,11 @@ Go to World menu > About Land or select another parcel to show its details. type="string" length="1" follows="left|top" - height="20" + height="30" layout="topleft" left="10" mouse_opaque="false" name="changeable_lbl" - top="350" width="100"> Subdivide: </text> @@ -788,22 +744,20 @@ Go to World menu > About Land or select another parcel to show its details. left_pad="10" mouse_opaque="false" name="changeable_clause" - top_delta="0" + word_wrap="true" width="330"> Land in this region may not be joined/subdivided. </text> </panel> <panel border="true" - follows="left|top|right|bottom" - height="380" - label="Objects" + follows="all" + label="OBJECTS" layout="topleft" - left_delta="0" + left="0" + top="0" help_topic="land_objects_tab" - name="land_objects_panel" - top_delta="-47" - width="458"> + name="land_objects_panel"> <panel.string name="objects_available_text"> [COUNT] out of [MAX] ([AVAILABLE] available) @@ -818,7 +772,7 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left="4" + left="10" name="parcel_object_bonus" top="4" visible="false" @@ -835,7 +789,7 @@ Go to World menu > About Land or select another parcel to show its details. name="Simulator primitive usage:" top_pad="4" width="364"> - Simulator primitive usage: + Primative usage: </text> <text type="string" @@ -855,11 +809,11 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left="4" + left="10" name="Primitives parcel supports:" top="44" width="152"> - Primitives parcel supports: + Prims parcel supports: </text> <text type="string" @@ -879,11 +833,11 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left="4" + left="10" name="Primitives on parcel:" top="64" width="152"> - Primitives on parcel: + Prims on parcel: </text> <text type="string" @@ -925,7 +879,7 @@ Go to World menu > About Land or select another parcel to show its details. bottom="100" enabled="false" follows="left|top" - height="16" + height="20" label="Show" label_selected="Show" layout="topleft" @@ -936,9 +890,8 @@ Go to World menu > About Land or select another parcel to show its details. bottom="100" enabled="false" follows="left|top" - height="16" - label="Return..." - label_selected="Return..." + height="20" + label="Return" layout="topleft" name="ReturnOwner..." right="-10" @@ -972,8 +925,8 @@ Go to World menu > About Land or select another parcel to show its details. bottom="120" enabled="false" follows="left|top" - height="16" label="Show" + height="20" label_selected="Show" layout="topleft" name="ShowGroup" @@ -983,9 +936,8 @@ Go to World menu > About Land or select another parcel to show its details. bottom="120" enabled="false" follows="left|top" - height="16" - label="Return..." - label_selected="Return..." + height="20" + label="Return" layout="topleft" name="ReturnGroup..." right="-10" @@ -1019,7 +971,7 @@ Go to World menu > About Land or select another parcel to show its details. bottom="140" enabled="false" follows="left|top" - height="16" + height="20" label="Show" label_selected="Show" layout="topleft" @@ -1030,9 +982,8 @@ Go to World menu > About Land or select another parcel to show its details. bottom="140" enabled="false" follows="left|top" - height="16" - label="Return..." - label_selected="Return..." + height="20" + label="Return" layout="topleft" name="ReturnOther..." right="-10" @@ -1068,7 +1019,7 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left="4" + left="10" name="Autoreturn" top="164" width="294"> @@ -1091,44 +1042,43 @@ Go to World menu > About Land or select another parcel to show its details. follows="left|top" height="16" layout="topleft" - left="4" + left="10" name="Object Owners:" top="184" width="104"> Object Owners: </text> - <button - follows="left|top" - height="16" - label="Refresh List" - label_selected="Refresh List" - layout="topleft" - left_delta="104" - name="Refresh List" - top_delta="0" - width="106" /> + <button + follows="top|right" + height="20" + image_overlay="Refresh_Off" + layout="topleft" + name="Refresh List" + left_pad="5" + right="-183" + tool_tip="Refresh Object List" + width="20" /> <button enabled="false" follows="left|top" - height="16" - label="Return objects..." - label_selected="Return objects..." + height="20" + label="Return Objects" layout="topleft" left_pad="6" name="Return objects..." top_delta="0" + right="-10" width="164" /> <name_list column_padding="0" draw_heading="true" - follows="left|top|right|bottom" - height="165" + follows="all" + height="190" layout="topleft" - left="4" + left="10" name="owner list" name_column="name" - top="210" - width="450"> + width="470"> <name_list.columns label="Type" name="type" @@ -1153,15 +1103,13 @@ Go to World menu > About Land or select another parcel to show its details. </panel> <panel border="true" - follows="left|top|right|bottom" - height="333" - label="Options" + follows="all" + label="OPTIONS" layout="topleft" - left_delta="0" help_topic="land_options_tab" name="land_options_panel" - top_delta="31" - width="458"> + left="0" + top="0"> <panel.string name="search_enabled_tooltip"> Let people see this parcel in search results @@ -1177,7 +1125,7 @@ Only large parcels can be listed in search. </panel.string> <panel.string name="mature_check_mature"> - Mature Content + Moderate Content </panel.string> <panel.string name="mature_check_adult"> @@ -1185,7 +1133,7 @@ Only large parcels can be listed in search. </panel.string> <panel.string name="mature_check_mature_tooltip"> - Your parcel information or content is considered mature. + Your parcel information or content is considered moderate. </panel.string> <panel.string name="mature_check_adult_tooltip"> @@ -1207,11 +1155,12 @@ Only large parcels can be listed in search. type="string" length="1" follows="left|top" + text_color="white" height="16" layout="topleft" - left="4" + left="10" name="allow_label" - top="4" + top="10" width="278"> Allow other residents to: </text> @@ -1222,44 +1171,40 @@ Only large parcels can be listed in search. left="14" name="edit land check" tool_tip="If checked, anyone can terraform your land. It is best to leave this unchecked, as you can always edit your own land." - top="24" - width="268" /> + top_pad="4" + width="147i" /> <check_box height="16" label="Fly" layout="topleft" - left_delta="0" name="check fly" tool_tip="If checked, Residents can fly on your land. If unchecked, they can only fly into and over your land." - top_pad="4" - width="268" /> + left_pad="4" + width="150" /> <text type="string" length="1" follows="left|top" height="16" layout="topleft" - left="178" + left="14" name="allow_label2" - top="24" - width="104"> - Create Objects: + width="150"> + Build: </text> <check_box height="16" - label="All Residents" + label="Everyone" layout="topleft" - left_delta="92" + left_pad="2" name="edit objects check" - top_delta="0" - width="104" /> + width="120" /> <check_box height="16" label="Group" layout="topleft" - left_delta="100" + left_pad="2" name="edit group objects check" - top_delta="0" width="70" /> <text type="string" @@ -1267,17 +1212,16 @@ Only large parcels can be listed in search. follows="left|top" height="16" layout="topleft" - left="178" + left="14" name="allow_label3" - top="44" - width="124"> + width="150"> Object Entry: </text> <check_box height="16" - label="All Residents" + label="Everyone" layout="topleft" - left_delta="92" + left_pad="2" name="all object entry check" top_delta="0" width="120" /> @@ -1285,7 +1229,7 @@ Only large parcels can be listed in search. height="16" label="Group" layout="topleft" - left_delta="100" + left_pad="2" name="group object entry check" top_delta="0" width="70" /> @@ -1295,17 +1239,16 @@ Only large parcels can be listed in search. follows="left|top" height="16" layout="topleft" - left="178" + left="14" name="allow_label4" - top="64" - width="124"> + width="150"> Run Scripts: </text> <check_box height="16" - label="All Residents" + label="Everyone" layout="topleft" - left_delta="92" + left_pad="2" name="check other scripts" top_delta="0" width="120" /> @@ -1313,19 +1256,19 @@ Only large parcels can be listed in search. height="16" label="Group" layout="topleft" - left_delta="100" + left_pad="2" name="check group scripts" top_delta="0" width="70" /> <text type="string" + text_color="white" length="1" follows="left|top" height="16" layout="topleft" - left="4" + left="10" name="land_options_label" - top="84" width="278"> Land Options: </text> @@ -1336,33 +1279,31 @@ Only large parcels can be listed in search. left="14" name="check safe" tool_tip="If checked, sets the land to Safe, disabling damage combat. If cleared, damage combat is enabled." - top="104" - width="268" /> + top_pad="5" + width="200" /> <check_box height="16" label="No Pushing" layout="topleft" - left_delta="164" + left_pad="5" name="PushRestrictCheck" tool_tip="Prevents scripts from pushing. Checking this option may be useful for preventing disruptive behavior on your land." top_delta="0" width="119" /> <check_box height="16" - label="Show Place in Search (L$30/week) under" + label="Show Place in Search (L$30/week)" layout="topleft" left="14" name="ShowDirectoryCheck" tool_tip="Let people see this parcel in search results" - top="124" - width="268" /> + width="430" /> <combo_box enabled="false" - height="18" + height="20" layout="topleft" - left_delta="241" + left="30" name="land category with adult" - top_delta="-2" visible="false" width="130"> <combo_box.item @@ -1420,11 +1361,10 @@ Only large parcels can be listed in search. </combo_box> <combo_box enabled="false" - height="18" + height="20" layout="topleft" - left_delta="0" + left="30" name="land category" - top_delta="0" visible="false" width="130"> <combo_box.item @@ -1478,12 +1418,12 @@ Only large parcels can be listed in search. </combo_box> <check_box height="16" - label="Mature Content" + label="Moderate Content" layout="topleft" left="14" name="MatureCheck" + top="177" tool_tip=" " - top="144" width="107" /> <text type="string" @@ -1491,74 +1431,75 @@ Only large parcels can be listed in search. follows="left|top" height="16" layout="topleft" - left="4" + left="10" name="Snapshot:" - top="164" - width="278"> + text_color="white" + top="220" + width="200"> Snapshot: </text> <texture_picker follows="left|top" - height="135" + height="150" layout="topleft" - left_delta="72" + left="14" name="snapshot_ctrl" tool_tip="Click to choose a picture" - top_delta="0" - width="180" /> + width="195" /> <text type="string" length="1" follows="left|top" - height="16" + height="30" layout="topleft" - left="4" + left="220" + top="180" + text_color="white" name="landing_point" - top="287" - width="278"> + word_wrap="true" + width="200"> Landing Point: [LANDING] </text> <button - follows="left|top" - height="16" + follows="right|top" + height="23" label="Set" label_selected="Set" layout="topleft" - left_delta="232" name="Set" + right="-68" tool_tip="Sets the landing point where visitors arrive. Sets to your avatar's location inside this parcel." - top_delta="0" width="50" /> <button - follows="left|top" - height="16" + follows="right|top" + height="23" label="Clear" label_selected="Clear" layout="topleft" left_pad="5" name="Clear" tool_tip="Clear the landing point" - top_delta="0" + right="-10" width="50" /> <text type="string" length="1" + text_color="white" follows="left|top" height="16" layout="topleft" - left="4" + left="220" + top_pad="10" name="Teleport Routing: " - top="307" - width="278"> + width="200"> Teleport Routing: </text> <combo_box - height="18" + height="23" layout="topleft" - left_delta="116" name="landing type" + top_pad="3" tool_tip="Teleport Routing -- select how to handle teleports onto your land" - top_delta="0" width="120"> <combo_box.item enabled="true" @@ -1579,34 +1520,31 @@ Only large parcels can be listed in search. </panel> <panel border="true" - follows="left|top|right|bottom" - height="363" - label="Media" + follows="all" + label="MEDIA" layout="topleft" - left_delta="0" + left="0" + top="0" help_topic="land_media_tab" - name="land_media_panel" - top_delta="1" - width="458"> + name="land_media_panel"> <text type="string" length="1" follows="left|top" - height="16" + height="20" layout="topleft" left="10" name="with media:" - top="9" - width="65"> + top="10" + width="100"> Type: </text> <combo_box - height="18" + height="20" layout="topleft" - left_pad="5" + left_pad="0" name="media type" tool_tip="Specify if the URL is a movie, web page, or other media" - top_delta="-2" width="120" /> <text follows="left|top" @@ -1614,79 +1552,70 @@ Only large parcels can be listed in search. layout="topleft" left_pad="10" name="mime_type" - top_delta="2" width="200" /> <text type="string" length="1" follows="left|top" - height="16" + height="20" layout="topleft" left="10" name="at URL:" - top="29" - width="65"> + width="100"> Home URL: </text> <line_editor - bottom_delta="0" follows="left|top" - height="16" + height="20" layout="topleft" - left="80" + left_pad="0" max_length="255" name="media_url" - right="-80" select_on_focus="true" - text_readonly_color="0.576471 0.662745 0.835294 1" /> + width="300" /> <button - follows="left|top" - height="16" - label="Set..." - label_selected="Set..." + follows="right|top" + height="22" + label="Set" layout="topleft" - left_pad="8" + left_pad="5" + right="-10" name="set_media_url" - top_delta="0" - width="60" /> + width="50" /> <text type="string" length="1" follows="left|top" - height="16" + height="20" layout="topleft" left="10" name="CurrentURL:" - top="49" - width="65"> + width="100"> Current URL: </text> + <button + follows="top|right" + height="20" + image_overlay="Refresh_Off" + layout="topleft" + name="reset_media_url" + left_pad="0" + tool_tip="Refresh URL" + width="20" /> <text follows="left|top" height="16" layout="topleft" - left_pad="5" + left_pad="10" name="current_url" - top_delta="0" width="300" /> - <button - follows="left|top" - height="16" - label="Reset..." - label_selected="Reset..." - layout="topleft" - left_pad="6" - name="reset_media_url" - top_delta="0" - width="60" /> <check_box height="16" label="Hide URL" layout="topleft" - left="100" + left="110" name="hide_media_url" tool_tip="Checking this option will hide the media url to any non-authorized viewers of this parcel information. Note this is not available for HTML types." - top="89" width="200" /> <text type="string" @@ -1696,23 +1625,20 @@ Only large parcels can be listed in search. layout="topleft" left="10" name="Description:" - top="49" width="364"> Description: </text> <line_editor - border_style="line" - border_thickness="1" - bottom_delta="0" follows="left|top" - height="16" + height="20" layout="topleft" - left="80" + left="110" max_length="255" name="url_description" - right="-80" select_on_focus="true" - tool_tip="Text displayed next to play/load button" /> + tool_tip="Text displayed next to play/load button" + top_delta="10" + width="300" /> <text type="string" length="1" @@ -1721,10 +1647,10 @@ Only large parcels can be listed in search. layout="topleft" left="10" name="Media texture:" - top="69" - width="364"> - Replace -Texture: + top_pad="10" + width="364" + word_wrap="true"> + Replace Texture: </text> <texture_picker allow_no_texture="true" @@ -1732,46 +1658,44 @@ Texture: follows="left|top" height="80" layout="topleft" - left_delta="70" + left="110" name="media texture" tool_tip="Click to choose a picture" - top_delta="0" + top_delta="10" width="64" /> <text type="string" length="1" follows="left|top" - height="16" + height="80" layout="topleft" - left_delta="75" + left_pad="8" name="replace_texture_help" - top="85" - width="270"> - Objects using this texture will show the movie or - web page after you click the play arrow. + width="300" + word_wrap="true"> + Objects using this texture will show the movie or web page after you click the play arrow. - Select the thumbnail to choose a different texture. +Select the thumbnail to choose a different texture. </text> <check_box height="16" label="Auto scale" layout="topleft" - left_delta="70" + left="110" name="media_auto_scale" + top_pad="0" tool_tip="Checking this option will scale the content for this parcel automatically. It may be slightly slower and lower quality visually but no other texture scaling or alignment will be required." - top_delta="0" width="200" /> <text type="string" length="1" follows="left|top" - height="16" + height="20" layout="topleft" - left="85" + left="10" name="media_size" tool_tip="Size to render Web media, leave 0 for default." - top="185" - width="85"> + width="100"> Size: </text> <spinner @@ -1779,11 +1703,11 @@ Texture: enabled="false" follows="left|top" halign="right" - height="16" + height="20" increment="1" initial_value="0" layout="topleft" - left_delta="65" + left_pad="0" max_val="1024" name="media_size_width" tool_tip="Size to render Web media, leave 0 for default." @@ -1794,7 +1718,7 @@ Texture: enabled="false" follows="left|top" halign="right" - height="16" + height="20" increment="1" initial_value="0" layout="topleft" @@ -1811,7 +1735,7 @@ Texture: follows="left|top" height="16" layout="topleft" - left_delta="70" + left_pad="5" name="pixels" right="-10"> pixels @@ -1824,15 +1748,15 @@ Texture: layout="topleft" left="10" name="Options:" - top="237" - width="292"> + top_pad="8" + width="100"> Options: </text> <check_box height="16" label="Loop" layout="topleft" - left_delta="70" + left_pad="0" name="media_loop" tool_tip="Play media in a loop. When the media has finished playing, it will restart from the beginning." top_delta="0" @@ -1840,15 +1764,13 @@ Texture: </panel> <panel border="true" - follows="left|top|right|bottom" - height="363" - label="Audio" + follows="all" + label="SOUND" layout="topleft" - left_delta="0" + left="0" + top="0" help_topic="land_audio_tab" - name="land_audio_panel" - top_delta="1" - width="458"> + name="land_audio_panel"> <text type="string" length="1" @@ -1856,21 +1778,19 @@ Texture: height="16" layout="topleft" left="10" + top="10" name="MusicURL:" - top="225" width="364"> Music URL: </text> <line_editor - border_style="line" - border_thickness="1" - bottom_delta="0" follows="left|top" - height="16" + height="20" layout="topleft" - left="80" + left="100" max_length="255" name="music_url" + top_pad="0" right="-15" select_on_focus="true" /> <text @@ -1881,17 +1801,16 @@ Texture: layout="topleft" left="10" name="Sound:" - top="265" - width="364"> + top_pad="10" + width="100"> Sound: </text> <check_box height="16" label="Restrict gesture and object sounds to this parcel" layout="topleft" - left_delta="70" name="check sound local" - top_delta="0" + left_pad="0" width="292" /> <text type="string" @@ -1902,47 +1821,42 @@ Texture: left="10" mouse_opaque="false" name="Voice settings:" - top="305" - width="364"> + top_pad="10" + width="100"> Voice: </text> <check_box - height="54" + height="16" label="Enable Voice" layout="topleft" - left="80" + left_pad="0" name="parcel_enable_voice_channel" - top="267" - width="463" /> + width="300" /> <check_box enabled="false" - height="54" + height="16" label="Enable Voice (established by the Estate)" layout="topleft" - left_delta="0" + left="110" name="parcel_enable_voice_channel_is_estate_disabled" - top_delta="0" - width="463" /> + width="300" /> <check_box - height="54" + height="16" label="Restrict Voice to this parcel" layout="topleft" - left="100" + left="110" name="parcel_enable_voice_channel_parcel" - top="287" - width="443" /> + width="300" /> </panel> <panel border="true" - follows="left|top|right|bottom" - height="333" - label="Access" + follows="all" + label="ACCESS" layout="topleft" - left_delta="0" + left="0" + top="0" help_topic="land_access_tab" - name="land_access_panel" - top_delta="31" - width="458"> + name="land_access_panel"> <panel.string name="estate_override"> One or more of these options is set at the estate level @@ -1951,13 +1865,13 @@ Texture: type="string" length="1" follows="left|top" - font="SansSerif" - height="20" + height="16" layout="topleft" - left="8" + left="10" name="Limit access to this parcel to:" - top="4" - width="278"> + text_color="White" + top="10" + width="400"> Access To This Parcel </text> <check_box @@ -2012,7 +1926,7 @@ Texture: width="278" /> <check_box enabled="false" - height="16" + height="22" label="Sell passes to:" layout="topleft" left_delta="0" @@ -2021,7 +1935,7 @@ Texture: top_pad="4" width="120" /> <combo_box - height="16" + height="20" layout="topleft" left_pad="22" name="pass_combo" @@ -2039,7 +1953,7 @@ Texture: <spinner enabled="false" follows="left|top" - height="16" + height="22" increment="1" initial_value="10" label="Price in L$:" @@ -2049,12 +1963,12 @@ Texture: max_val="500" min_val="1" name="PriceSpin" - top="149" - width="180" /> + top_pad="5" + width="200" /> <spinner enabled="false" follows="left|top" - height="16" + height="22" increment="0.25" initial_value="1" label="Hours of access:" @@ -2064,8 +1978,15 @@ Texture: max_val="24" min_val="0.01" name="HoursSpin" - top_pad="4" - width="180" /> + top_pad="5" + width="200" /> + <panel + name="Allowed_layout_panel" + follows="top|left" + left="10" + height="170" + top_pad="8" + width="240"> <text type="string" length="1" @@ -2073,45 +1994,48 @@ Texture: height="16" label="Always Allow" layout="topleft" - left="20" + left="0" name="AllowedText" - top="204" - width="195"> + top="0" + width="230"> Allowed Residents </text> <name_list column_padding="0" follows="top|bottom" heading_height="14" - height="80" + height="120" layout="topleft" - left_delta="0" + left="0" multi_select="true" name="AccessList" tool_tip="([LISTED] listed, [MAX] max)" - top_pad="4" - width="195" /> + width="240" /> <button follows="bottom" - font="SansSerifSmall" - height="16" - label="Add..." - label_selected="Add..." + height="23" + label="Add" layout="topleft" - left_delta="5" + left="0" name="add_allowed" - top="308" - width="80" /> + width="100" /> <button follows="bottom" - height="16" + height="23" label="Remove" label_selected="Remove" layout="topleft" - left_pad="20" + left_pad="10" name="remove_allowed" - top_delta="0" - width="80" /> + right="-1" + width="100" /> + </panel> + <panel + name="Banned_layout_panel" + follows="top|right" + height="170" + width="240" + left_pad="8"> <text type="string" length="1" @@ -2119,45 +2043,43 @@ Texture: height="16" label="Ban" layout="topleft" - left="240" + left="0" name="BanCheck" - top="204" - width="195"> + top="0" + width="200"> Banned Residents </text> <name_list column_padding="0" follows="top|bottom" heading_height="14" - height="80" + height="120" layout="topleft" - left_delta="0" + left="0" multi_select="true" name="BannedList" tool_tip="([LISTED] listed, [MAX] max)" - top_pad="4" - width="195" /> + width="240" /> <button follows="bottom" - height="16" - label="Add..." - label_selected="Add..." + height="23" + label="Add" layout="topleft" - left_delta="5" + left="0" name="add_banned" - top="308" - width="80" /> + width="100" /> <button enabled="false" follows="bottom" - height="16" + height="23" label="Remove" label_selected="Remove" layout="topleft" - left_pad="20" + left_pad="10" name="remove_banned" - top_delta="0" - width="80" /> + right="-1" + width="100" /> + </panel> </panel> </tab_container> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_animation_preview.xml b/indra/newview/skins/default/xui/en/floater_animation_preview.xml index 41b1f99d41..a8f875754e 100644 --- a/indra/newview/skins/default/xui/en/floater_animation_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_animation_preview.xml @@ -2,7 +2,7 @@ <floater legacy_header_height="18" can_minimize="false" - height="556" + height="610" layout="topleft" name="Animation Preview" help_topic="animation_preview" @@ -452,28 +452,38 @@ Maximum animation length is [MAX_LENGTH] seconds. width="200" /> <button follows="top|right" - height="28" - image_selected="button_anim_play_selected.tga" - image_unselected="button_anim_play.tga" + height="23" + image_overlay="Play_Over" + image_unselected="SegmentedBtn_Left_Off" + image_selected="SegmentedBtn_Left_On_Selected" + image_disabled_selected="SegmentedBtn_Left_Selected_Disabled" + image_disabled="SegmentedBtn_Left_Disabled" + image_pressed="SegmentedBtn_Left_Press" + image_pressed_selected="SegmentedBtn_Left_Selected_Press" layout="topleft" left="10" name="play_btn" tool_tip="Play/pause your animation" top_pad="0" - width="28" /> + width="23" /> <button follows="top|right" - height="28" - image_selected="button_anim_stop_selected.tga" - image_unselected="button_anim_stop.tga" + height="23" + image_overlay="StopReload_Over" + image_unselected="SegmentedBtn_Right_Off" + image_selected="SegmentedBtn_Right_On_Selected" + image_disabled_selected="SegmentedBtn_Right_Selected_Disabled" + image_disabled="SegmentedBtn_Right_Disabled" + image_pressed="SegmentedBtn_Right_Press" + image_pressed_selected="SegmentedBtn_Right_Selected_Press" layout="topleft" - left_pad="4" name="stop_btn" tool_tip="Stop animation playback" top_delta="0" - width="28" /> + left_delta="23" + width="23" /> <slider - left_pad="0" + left_pad="10" follows="top|right" height="23" width="200" @@ -498,21 +508,21 @@ Maximum animation length is [MAX_LENGTH] seconds. We recommend BVH files exported from Poser 4. </text> <button - bottom="546" - follows="bottom|right" + top="580" + follows="bottom|left" height="23" - label="Cancel" + label="Upload (L$[AMOUNT])" layout="topleft" - name="cancel_btn" - right="265" - width="123" /> + left="10" + name="ok_btn" + width="128" /> <button + top="580" follows="bottom|left" height="23" - label="Upload (L$[AMOUNT])" + label="Cancel" layout="topleft" - left_delta="-129" - name="ok_btn" - top_delta="0" - width="123" /> + name="cancel_btn" + left="142" + width="128" /> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_bulk_perms.xml b/indra/newview/skins/default/xui/en/floater_bulk_perms.xml index 7ae079f553..53ae24fe3f 100644 --- a/indra/newview/skins/default/xui/en/floater_bulk_perms.xml +++ b/indra/newview/skins/default/xui/en/floater_bulk_perms.xml @@ -154,7 +154,7 @@ image_name="Inv_Texture" mouse_opaque="true" name="icon_texture" - tool_top="Textures" + tool_tip="Textures" left_pad="2" /> <button diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml index 69f9f6a2f8..d378b427f1 100644 --- a/indra/newview/skins/default/xui/en/floater_camera.xml +++ b/indra/newview/skins/default/xui/en/floater_camera.xml @@ -12,6 +12,7 @@ help_topic="camera_floater" save_rect="true" save_visibility="true" + single_instance="true" width="150"> <floater.string name="rotate_tooltip"> diff --git a/indra/newview/skins/default/xui/en/floater_help_browser.xml b/indra/newview/skins/default/xui/en/floater_help_browser.xml index f50ff01230..55a6179afb 100644 --- a/indra/newview/skins/default/xui/en/floater_help_browser.xml +++ b/indra/newview/skins/default/xui/en/floater_help_browser.xml @@ -43,6 +43,7 @@ left="0" name="browser" top="0" + start_url="data:text/html,%3Chtml%3E%3Cbody bgcolor=%22#2A2A2A%22%3E%3C/body%3E%3C/html%3E" width="570" /> <button follows="bottom|left" diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml index cf6a4e45bd..cd297af99d 100644 --- a/indra/newview/skins/default/xui/en/floater_im_container.xml +++ b/indra/newview/skins/default/xui/en/floater_im_container.xml @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<multi_floater
-background_visible="true"
-bg_color="yellow"
+ can_minimize="false"
can_resize="true"
height="390"
layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/floater_inventory.xml b/indra/newview/skins/default/xui/en/floater_inventory.xml index 98815d4e5a..4434f5b421 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory.xml @@ -11,7 +11,7 @@ help_topic="inventory" save_rect="true" save_visibility="true" - single_instance="true" + single_instance="false" title="INVENTORY" width="467"> <floater.string diff --git a/indra/newview/skins/default/xui/en/floater_land_holdings.xml b/indra/newview/skins/default/xui/en/floater_land_holdings.xml index e3751f2bd9..06c766f744 100644 --- a/indra/newview/skins/default/xui/en/floater_land_holdings.xml +++ b/indra/newview/skins/default/xui/en/floater_land_holdings.xml @@ -42,7 +42,6 @@ </scroll_list> <button height="23" - font="SansSerif" label="Teleport" label_selected="Teleport" layout="topleft" @@ -53,7 +52,6 @@ width="80" /> <button height="23" - font="SansSerif" label="Map" label_selected="Map" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml index d8534bfe0b..c8aab2c1e0 100644 --- a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml +++ b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml @@ -1,5 +1,12 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater + border_visible = "false" + border_drop_shadow_visible = "false" + drop_shadow_visible = "false" + border = "false" + bg_opaque_image="Inspector_Background" + bg_alpha_image="Toast_Background" + bg_alpha_color="0 0 0 0" legacy_header_height="18" can_minimize="false" can_tear_off="false" @@ -22,13 +29,15 @@ bg_readonly_color="ChatHistoryBgColor" bg_writeable_color="ChatHistoryBgColor" follows="all" - left="1" + left="5" top="20" layout="topleft" - height="280" + height="275" name="chat_history" parse_highlights="true" text_color="ChatHistoryTextColor" text_readonly_color="ChatHistoryTextColor" - width="320" /> + right_widget_pad="5" + left_widget_pad="0" + width="315" /> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_preview_gesture.xml b/indra/newview/skins/default/xui/en/floater_preview_gesture.xml index 4f3978a5e3..8cc2c91ef5 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_gesture.xml @@ -173,7 +173,6 @@ <button follows="top|left" height="20" - font="SansSerifSmall" label="Add >>" layout="topleft" left_pad="10" @@ -205,7 +204,6 @@ <button follows="top|left" height="20" - font="SansSerifSmall" label="Up" layout="topleft" left_pad="10" @@ -215,7 +213,6 @@ <button follows="top|left" height="20" - font="SansSerifSmall" label="Down" layout="topleft" left_delta="0" @@ -225,7 +222,6 @@ <button follows="top|left" height="20" - font="SansSerifSmall" label="Remove" layout="topleft" left_delta="0" diff --git a/indra/newview/skins/default/xui/en/floater_report_abuse.xml b/indra/newview/skins/default/xui/en/floater_report_abuse.xml index 91ca3ef27a..f1a75bfcb4 100644 --- a/indra/newview/skins/default/xui/en/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/en/floater_report_abuse.xml @@ -309,7 +309,7 @@ name="Indecency__Mature_content_in_PG_region" value="60" /> <combo_box.item - label="Indecency > Inappropriate content or conduct in a Mature region" + label="Indecency > Inappropriate content or conduct in a Moderate region" name="Indecency__Inappropriate_content_in_Mature_region" value="69" /> <combo_box.item diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml index d9498586af..c5d6f885d3 100644 --- a/indra/newview/skins/default/xui/en/floater_search.xml +++ b/indra/newview/skins/default/xui/en/floater_search.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater - legacy_header_height="18" + legacy_header_height="13" can_resize="true" - height="512" + height="646" layout="topleft" min_height="140" min_width="467" @@ -11,7 +11,7 @@ save_rect="true" single_instance="true" title="FIND" - width="620"> + width="670"> <floater.string name="search_url"> http://eniac21.lindenlab.com:10001/viewer @@ -25,21 +25,20 @@ Done </floater.string> <layout_stack - bottom="512" + bottom="641" follows="left|right|top|bottom" layout="topleft" left="10" name="stack1" top="20" - width="600"> + width="650"> <layout_panel - height="12" layout="topleft" left_delta="0" - name="external_controls" top_delta="0" + name="browser_layout" user_resize="false" - width="570"> + width="650"> <web_browser bottom="-10" follows="left|right|top|bottom" @@ -47,7 +46,9 @@ left="0" name="browser" top="0" - width="570" /> + start_url="data:text/html,%3Chtml%3E%3Cbody bgcolor=%22#2A2A2A%22%3E%3C/body%3E%3C/html%3E" + height="600" + width="650" /> <text follows="bottom|left" height="16" diff --git a/indra/newview/skins/default/xui/en/floater_select_key.xml b/indra/newview/skins/default/xui/en/floater_select_key.xml index 31d133ff9b..af4fdff044 100644 --- a/indra/newview/skins/default/xui/en/floater_select_key.xml +++ b/indra/newview/skins/default/xui/en/floater_select_key.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater legacy_header_height="18" - border="true" + border="false" can_close="false" can_minimize="false" height="100" diff --git a/indra/newview/skins/default/xui/en/floater_test_line_editor.xml b/indra/newview/skins/default/xui/en/floater_test_line_editor.xml index 0531b52e5a..fe6ec91709 100644 --- a/indra/newview/skins/default/xui/en/floater_test_line_editor.xml +++ b/indra/newview/skins/default/xui/en/floater_test_line_editor.xml @@ -2,7 +2,7 @@ <floater legacy_header_height="18" can_resize="true" - height="400" + height="500" layout="topleft" name="floater_test_line_editor" help_topic="floater_test_line_editor" @@ -62,6 +62,34 @@ width="200"> Disabled red-text line editor </line_editor> + <line_editor + height="20" + left_delta="0" + name="left_pad_editor" + text_pad_left="25" + top_pad="10" + width="200"> + 25 px left text padding + </line_editor> + <line_editor + height="20" + left_delta="0" + name="left_pad_editor" + text_pad_right="75" + top_pad="10" + width="200"> + 75 px right text padding + </line_editor> + <line_editor + height="20" + left_delta="0" + name="left_pad_editor" + text_pad_left="25" + text_pad_right="75" + top_pad="10" + width="200"> + 25 px left 75 px right text padding + </line_editor> <!-- "search_editor" is a specialized line_editor that shows read-only help text until the user clicks in the widget. --> <search_editor diff --git a/indra/newview/skins/default/xui/en/floater_test_list_view.xml b/indra/newview/skins/default/xui/en/floater_test_list_view.xml index 1d2086d9bc..247c705687 100644 --- a/indra/newview/skins/default/xui/en/floater_test_list_view.xml +++ b/indra/newview/skins/default/xui/en/floater_test_list_view.xml @@ -7,27 +7,5 @@ name="floater_test_list_view" help_topic="floater_test_list_view" width="400"> - <list_view - height="300" - left="10" - name="test_list_view" - top="28" - width="300" /> - <button - name="test_1_btn" - label="Test 1" - top="350" - left="10" - height="20" - width="80" - commit_callback.function="TestListView.Test1" /> - <button - name="test_2_btn" - label="Test 2" - top_delta="0" - left_pad="10" - height="20" - width="80" - commit_callback.function="TestListView.Test2" /> - + <!-- intentionally empty --> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_test_text_editor.xml b/indra/newview/skins/default/xui/en/floater_test_text_editor.xml new file mode 100644 index 0000000000..b0aa5c7c4f --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_test_text_editor.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + legacy_header_height="18" + can_resize="true" + height="600" + layout="topleft" + name="floater_test_text_editor" + width="800"> + <text_editor + height="50" + follows="top|left|bottom" + layout="topleft" + left="10" + name="test_text_editor" + tool_tip="text editor" + top="25" + width="200"> + Text Editor + </text_editor> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_test_textbox.xml b/indra/newview/skins/default/xui/en/floater_test_textbox.xml index 3aeb7c93e7..8fc2677cbe 100644 --- a/indra/newview/skins/default/xui/en/floater_test_textbox.xml +++ b/indra/newview/skins/default/xui/en/floater_test_textbox.xml @@ -2,11 +2,11 @@ <floater legacy_header_height="18" can_resize="true" - height="450" + height="600" layout="topleft" name="floater_test_textbox" help_topic="floater_test_textbox" - width="600"> + width="800"> <text type="string" length="1" @@ -21,128 +21,233 @@ Third line of multiple lines Fourth line of multiple lines Fifth line of multiple lines </text> - <text - top_pad="10" - left="10" - right="-10" - height="20" - follows="top|left" - font.name="SansSerifSmall" - name="test_text10" - tool_tip="text"> - SansSerifSmall -The 华文细黑 brown fox ヒラキjumped over the lazy dog. - </text> - <text - top_pad="10" - left="10" - right="-10" - height="25" - follows="top|left" - font.name="SansSerifMedium" - name="test_text11" - tool_tip="text"> - SansSerif -The 华文细黑 brown fox ヒラキjumped over the lazy dog. - </text> - <text - top_pad="10" - left="10" - right="-10" - follows="top|left" - height="26" - font.name="SansSerifLarge" - name="test_text12" - tool_tip="text"> - SansSerifLarge -The 华文细黑 brown fox ヒラキjumped over the lazy dog. - </text> - <text - top_pad="10" - left="10" - height="35" - right="-10" - follows="top|left" - font.name="SansSerifHuge" - name="test_text13" - tool_tip="text"> - SansSerifHuge -The 华文细黑 brown fox ヒラキjumped over the lazy dog. - </text> - <text - type="string" - length="1" - font="SansSerif" - font.style="BOLD" - height="10" - layout="topleft" - left_delta="0" - top_pad="40" - width="300"> - SansSerif BOLD - </text> - <text - type="string" - length="1" - font="SansSerif" - font.style="BOLD|UNDERLINE" - height="10" - layout="topleft" - left_delta="0" - top_pad="10" - width="300"> - SansSerif BOLD UNDERLINE - </text> - <text - type="string" - length="1" - bottom="390" - label="N" + <text + clip_partial="true" + top_pad="10" + left="10" + width="267" + height="28" + layout="topleft" + follows="right|left" + text_color="white" + use_ellipses="true" + word_wrap="true" + mouse_opaque="false" + name="title" > + This text has word_wrap set true, use_ellipses set true, and clip_partial set true, so it should wrap around, spilling over to the last line, then clip the last partial line and show ellipses to indicate there is more text + </text> + + <text + font="SansSerif" + font.style="BOLD" + height="10" layout="topleft" - left="10" - name="right_aligned_text" - width="380" - halign="right" - top_pad="10"> + left_delta="0" + top_pad="10" + width="300"> + SansSerif BOLD + </text> + <text + font="SansSerif" + font.style="BOLD|UNDERLINE" + height="10" + layout="topleft" + left_delta="0" + top_pad="10" + width="300"> + SansSerif BOLD UNDERLINE + </text> + <text + bottom="390" + left="10" + name="right_aligned_text" + width="300" + halign="right" + top_pad="10"> Right aligned text </text> <text - type="string" - length="1" bottom="390" - label="N" - layout="topleft" left="10" name="centered_text" - width="380" + width="300" halign="center" top_pad="10"> Centered text </text> <text - type="string" - length="1" - height="60" - label="N" - layout="topleft" left="10" name="left_aligned_text" - width="380" + width="300" halign="left" top_pad="10"> Left aligned text </text> <text - type="string" - length="1" - bottom="390" - label="N" - layout="topleft" + left="10" + name="v_pad_text" + height="40" + width="300" + halign="left" + top_pad="10" + v_pad="10"> + v_pad = 10, height = 40 + </text> + <text + left="10" + name="v_pad_text" + height="40" + width="300" + halign="left" + top_pad="10" + h_pad="30"> + h_pad = 30, height = 40 + </text> + <text + top_pad="10" + left="10" + right="-10" + height="20" + follows="top|left" + font.name="SansSerifSmall" + name="test_text10" + tool_tip="text"> + SansSerifSmall + The 华文细黑 brown fox ヒラキjumped over the lazy dog. + </text> + <text + top_pad="10" + left="10" + right="-10" + height="25" + follows="top|left" + font.name="SansSerifMedium" + name="test_text11" + tool_tip="text"> + SansSerif + The 华文细黑 brown fox ヒラキjumped over the lazy dog. + </text> + <text + top_pad="10" left="10" - name="floater_map_north" - right="30" - top="370"> - N + right="-10" + follows="top|left" + height="26" + font.name="SansSerifLarge" + name="test_text12" + tool_tip="text"> + SansSerifLarge + The 华文细黑 brown fox ヒラキjumped over the lazy dog. </text> + <text + top_pad="10" + left="10" + height="35" + right="-10" + follows="top|left" + font.name="SansSerifHuge" + name="test_text13" + tool_tip="text"> + SansSerifHuge + The 华文细黑 brown fox ヒラキjumped over the lazy dog. + </text> + +<!-- next column --> + <text_editor + height="50" + follows="top|left|bottom" + left="400" + name="test_text_editor" + tool_tip="text editor" + top="25" + width="200"> + Text Editor + </text_editor> + <text_editor + height="50" + follows="top|left|bottom" + left_delta="0" + name="long_text_editor" + tool_tip="text editor" + top_pad="10" + width="200"> +Text Editor +with multiple +lines of text +and hence a +scroll bar + </text_editor> + <text_editor + height="50" + follows="top|left|bottom" + left_delta="0" + max_length="65536" + name="blob_text_editor" + tool_tip="text editor" + top_pad="10" + width="200" + word_wrap="true"> +Second Life is brought to you by Philip, Tessa, Andrew, Cory, James, Ben, Char, Charlie, Colin, Dan, Daniel, Doug, Eric, Hamlet, Haney, Eve, Hunter, Ian, Jeff, Jennifer, Jim, John, Lee, Mark, Peter, Phoenix, Richard, Robin, Xenon, Steve, Tanya, Eddie, Avi, Frank, Bruce, Aaron, Alice, Bob, Debra, Eileen, Helen, Janet, Louie, Leviathania, Stefan, Ray, Kevin, Tom, Mikeb, MikeT, Burgess, Elena, Tracy, Bill, Todd, Ryan, Zach, Sarah, Nova, Tim, Stephanie, Michael, Evan, Nicolas, Catherine, Rachelle, Dave, Holly, Bub, Kelly, Magellan, Ramzi, Don, Sabin, Jill, Rheya, Jeska, Torley, Kona, Callum, Charity, Ventrella, Jack, Vektor, Iris, Chris, Nicole, Mick, Reuben, Blue, Babbage, Yedwab, Deana, Lauren, Brent, Pathfinder, Chadrick, Altruima, Jesse, Teeny, Monroe, Icculus, David, Tess, Lizzie, Patsy, Isaac, Lawrence, Cyn, Bo, Gia, Annette, Marius, Tbone, Jonathan, Karen, Ginsu, Satoko, Yuko, Makiko, Thomas, Harry, Seth, Alexei, Brian, Guy, Runitai, Ethan, Data, Cornelius, Kenny, Swiss, Zero, Natria, Wendy, Stephen, Teeple, Thumper, Lucy, Dee, Mia, Liana, Warren, Branka, Aura, beez, Milo, Hermia, Red, Thrax, Joe, Sally, Magenta, Mogura, Paul, Jose, Rejean, Henrik, Lexie, Amber, Logan, Xan, Nora, Morpheus, Donovan, Leyla, MichaelFrancis, Beast, Cube, Bucky, Joshua, Stryfe, Harmony, Teresa, Claudia, Walker, Glenn, Fritz, Fordak, June, Cleopetra, Jean, Ivy, Betsy, Roosevelt, Spike, Ken, Which, Tofu, Chiyo, Rob, Zee, dustin, George, Del, Matthew, Cat, Jacqui, Lightfoot, Adrian, Viola, Alfred, Noel, Irfan, Sunil, Yool, Rika, Jane, Xtreme, Frontier, a2, Neo, Siobhan, Yoz, Justin, Elle, Qarl, Benjamin, Isabel, Gulliver, Everett, Christopher, Izzy, Stephany, Garry, Sejong, Sean, Tobin, Iridium, Meta, Anthony, Jeremy, JP, Jake, Maurice, Madhavi, Leopard, Kyle, Joon, Kari, Bert, Belinda, Jon, Kristi, Bridie, Pramod, KJ, Socrates, Maria, Ivan, Aric, Yamasaki, Adreanne, Jay, MitchK, Ceren, Coco, Durl, Jenny, Periapse, Kartic, Storrs, Lotte, Sandy, Rohn, Colossus, Zen, BigPapi, Brad, Pastrami, Kurz, Mani, Neuro, Jaime, MJ, Rowan, Sgt, Elvis, Gecko, Samuel, Sardonyx, Leo, Bryan, Niko, Soft, Poppy, Rachel, Aki, Angelo, Banzai, Alexa, Sue, CeeLo, Bender, CG, Gillian, Pelle, Nick, Echo, Zara, Christine, Shamiran, Emma, Blake, Keiko, Plexus, Joppa, Sidewinder, Erica, Ashlei, Twilight, Kristen, Brett, Q, Enus, Simon, Bevis, Kraft, Kip, Chandler, Ron, LauraP, Ram, KyleJM, Scouse, Prospero, Melissa, Marty, Nat, Hamilton, Kend, Lordan, Jimmy, Kosmo, Seraph, Green, Ekim, Wiggo, JT, Rome, Doris, Miz, Benoc, Whump, Trinity, Patch, Kate, TJ, Bao, Joohwan, Christy, Sofia, Matias, Cogsworth, Johan, Oreh, Cheah, Angela, Brandy, Mango, Lan, Aleks, Gloria, Heidy, Mitchell, Space, Colton, Bambers, Einstein, Maggie, Malbers, Rose, Winnie, Stella, Milton, Rothman, Niall, Marin, Allison, Katie, Dawn, Katt, Dusty, Kalpana, Judy, Andrea, Ambroff, Infinity, Gail, Rico, Raymond, Yi, William, Christa, M, Teagan, Scout, Molly, Dante, Corr, Dynamike, Usi, Kaylee, Vidtuts, Lil, Danica, Sascha, Kelv, Jacob, Nya, Rodney, Brandon, Elsie, Blondin, Grant, Katrin, Nyx, Gabriel, Locklainn, Claire, Devin, Minerva, Monty, Austin, Bradford, Si, Keira, H, Caitlin, Dita, Makai, Jenn, Ann, Meredith, Clare, Joy, Praveen, Cody, Edmund, Ruthe, Sirena, Gayathri, Spider, FJ, Davidoff, Tian, Jennie, Louise, Oskar, Landon, Noelle, Jarv, Ingrid, Al, Sommer, Doc, Aria, Huin, Gray, Lili, Vir, DJ, Yang, T, Simone, Maestro, Scott, Charlene, Quixote, Amanda, Susan, Zed, Anne, Enkidu, Esbee, Joroan, Katelin, Roxie, Tay, Scarlet, Kevin, Johnny, Wolfgang, Andren, Bob, Howard, Merov, Rand, Ray, Michon, Newell, Galen, Dessie, Les and many others. + </text_editor> + <text_editor + height="50" + follows="top|left|bottom" + font="Monospace" + left_delta="0" + name="monospace_text_editor" + tool_tip="text editor" + top_pad="10" + width="200"> +Text Editor +with multiple +lines of text +and hence a +scroll bar gjyrrr + </text_editor> + <text_editor + border_visible="true" + height="50" + follows="top|left|bottom" + font="Monospace" + left_delta="0" + name="monospace_text_editor" + tool_tip="text editor" + top_pad="10" + width="200"> +Text Editor +with multiple +lines of text +and hence a +scroll bar gjyrrr + </text_editor> + <text_editor + height="50" + follows="top|left|bottom" + font="SansSerif" + left_delta="0" + name="sansserif_text_editor" + tool_tip="text editor" + top_pad="10" + width="200"> +Text Editor +with multiple +lines of text +and hence a +scroll bar gjyrrr + </text_editor> + <text + height="40" + follows="top|left|bottom" + layout="topleft" + name="test_text_box" + tool_tip="text box" + top_pad="5" + width="200"> +Text box +with +multiple lines +and too many lines +to actually fit + </text> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 56833f3eee..6675f4c02c 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -303,7 +303,7 @@ name="checkbox snap to grid" width="134" /> <combo_box - height="19" + height="23" layout="topleft" follows="left|top" name="combobox grid mode" @@ -2341,16 +2341,16 @@ even though the user gets a free copy. left="10" name="tex gen" top_pad="5" - width="87"> + width="85"> Mapping </text> <combo_box - height="22" + height="23" layout="topleft" left_delta="0" name="combobox texgen" top_pad="4" - width="60"> + width="85"> <combo_box.item label="Default" name="Default" @@ -2367,18 +2367,18 @@ even though the user gets a free copy. height="10" layout="topleft" name="label shininess" - left_pad="5" + left_pad="4" top_pad="-36" - width="60"> + width="85"> Shininess </text> <combo_box - height="22" + height="23" layout="topleft" left_delta="0" name="combobox shininess" top_pad="4" - width="60"> + width="85"> <combo_box.item label="None" name="None" @@ -2402,19 +2402,19 @@ even though the user gets a free copy. follows="left|top" height="10" layout="topleft" - left_pad="5" + left_pad="4" name="label bumpiness" top_pad="-36" - width="87"> + width="85"> Bumpiness </text> <combo_box - height="22" + height="23" layout="topleft" left_delta="0" name="combobox bumpiness" top_pad="4" - width="87"> + width="85"> <combo_box.item label="None" name="None" @@ -2607,7 +2607,7 @@ even though the user gets a free copy. width="170" /> <button follows="left|top" - height="19" + height="23" label="Apply" label_selected="Apply" layout="topleft" @@ -2742,13 +2742,14 @@ even though the user gets a free copy. decouple_texture_size="true" /> <button follows="left|top" - height="19" + height="23" label="Align" label_selected="Align Media" layout="topleft" left="10" name="button align" top_pad="5" + tool_tip="Align media texture (must load first)" width="100" /> </panel> </panel> @@ -2783,7 +2784,7 @@ even though the user gets a free copy. width="130" /> <panel_inventory_object follows="left|top" - height="210" + height="325" layout="topleft" left="10" name="contents_inventory" diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml new file mode 100644 index 0000000000..1ebc51f504 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml @@ -0,0 +1,166 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="270" + layout="topleft" + min_height="146" + min_width="190" + name="floater_voice_controls" + title="Voice Controls" + save_visibility="true" + single_instance="true" + width="282"> + <string + name="title_nearby"> + NEARBY VOICE + </string> + <string + name="title_group"> + Group Call with [GROUP] + </string> + <string + name="title_adhoc"> + Conference Call + </string> + <string + name="title_peer_2_peer"> + Call with [NAME] + </string> + <string + name="no_one_near"> + No one near + </string> + <panel + bevel_style="in" + follows="left|right|top" + height="62" + layout="topleft" + left="0" + name="control_panel" + width="282"> + <panel + height="18" + follows="top|left|right" + layout="topleft" + left="10" + name="my_panel" + width="263"> + <avatar_icon + enabled="false" + follows="left|top" + height="18" + default_icon_name="Generic_Person" + layout="topleft" + left="0" + name="user_icon" + top="0" + width="18" /> + <text + follows="top|left|right" + font="SansSerifSmallBold" + height="16" + layout="topleft" + left_pad="10" + name="user_text" + text_color="white" + top="4" + use_ellipses="true" + value="Mya Avatar:" + width="210" /> + <output_monitor + auto_update="true" + draw_border="false" + follows="right" + height="16" + layout="topleft" + name="speaking_indicator" + right="-1" + top="2" + visible="true" + width="20" /> + </panel> + <layout_stack + animate="false" + bottom="10" + clip="false" + follows="left|right|top" + height="24" + layout="bottomleft" + orientation="horizontal" + width="262"> + <layout_panel + auto_resize="false" + follows="left" + layout="topleft" + min_width="24" + name="microphone_icon_panel" + top="0" + user_resize="false" + width="24"> + <icon + height="24" + image_name="Microphone_On" + layout="topleft" + name="Microphone_On" + top="0" + width="24" /> + </layout_panel> + <layout_panel + layout="topleft" + name="volume_slider_panel" + top="0" + user_resize="false" + width="138"> + <slider_bar + control_name="AudioLevelMic" + follows="left|right|top" + height="24" + increment="0.05" + layout="topleft" + left="0" + max_val="2" + name="volume_slider_bar" + tool_tip="Master Volume" + top="0" + value="0.75" + width="138" /> + </layout_panel> + <layout_panel + auto_resize="false" + layout="topleft" + min_width="100" + name="leave_btn_panel" + top="0" + user_resize="false" + visible="false" + width="100"> + <button + follows="left|right|top" + height="24" + label="Leave Call" + left="0" + name="leave_call_btn" + top="0" + width="100" /> + </layout_panel> + </layout_stack> + </panel> + <avatar_list + follows="all" + height="197" + ignore_online_status="true" + layout="topleft" + left="0" + multi_select="true" + name="speakers_list" + width="282" /> + <panel + filename="panel_avatar_list_item.xml" + follows="left|right|top" + height="24" + layout="topleft" + left="0" + name="non_avatar_caller" + top="70" + width="282" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml index e3db0972ec..9c11a88c34 100644 --- a/indra/newview/skins/default/xui/en/floater_world_map.xml +++ b/indra/newview/skins/default/xui/en/floater_world_map.xml @@ -4,7 +4,7 @@ can_resize="true" center_horiz="true" center_vert="true" - height="600" + height="535" layout="topleft" min_height="520" min_width="520" @@ -17,388 +17,493 @@ width="800"> <panel filename="panel_world_map.xml" - follows="left|top|right|bottom" - height="565" + follows="all" + height="500" layout="topleft" - left="15" + left="10" name="objects_mapview" top="25" width="542" /> - <icon - follows="top|right" - height="16" - image_name="map_avatar_16.tga" - layout="topleft" - left="-230" - mouse_opaque="true" - name="self" - top="34" - width="16" /> + <panel + name="layout_panel_1" + height="22" + width="238" + follows="right|top" + top="25" + left_pad="5" + background_visible="true" + bg_alpha_color="DkGray2"> <text + text_color="White" + font="SansSerifLarge" type="string" length="1" follows="top|right" + halign="left" height="16" layout="topleft" - left_pad="4" - name="you_label" - top_delta="0" - width="145"> - You + left="15" + name="events_label" + top="3" + width="215"> + Legend </text> - <icon - follows="top|right" - height="16" - image_name="map_home.tga" + </panel> +<panel + follows="right|top" + height="126" + top_pad="0" + width="238"> +<button + follows="right|top" + height="22" + image_overlay="map_avatar_16.tga" + scale_image="true" + left="4" layout="topleft" - left_delta="50" - mouse_opaque="true" - name="home" - top_delta="0" - width="16" /> - <text + name="Show My Location" + tool_tip="Center map on your avatar's location" + top="6" + width="24" > + <button.commit_callback + function="WMap.ShowAgent" /> + </button> + <text type="string" length="1" follows="top|right" - height="16" + halign="left" + height="13" + top_delta="6" + left_pad="5" layout="topleft" - left_pad="4" - name="home_label" - top_delta="0" - width="145"> - Home + name="person_label" + width="90"> + Me </text> - <icon - color="0.5 0.25 1 1" + <check_box + control_name="MapShowPeople" follows="top|right" height="16" - image_name="legend.tga" layout="topleft" - left="-230" + left="3" + name="people_chk" + top_pad="9" + width="22" /> + <icon + color="0 1 0 1" + follows="top|right" + height="8" + image_name="map_avatar_8.tga" + layout="topleft" + left_pad="3" mouse_opaque="true" - name="square2" - top="54" - width="16" /> - <text + name="person" + top_delta="3" + width="8" /> + <text type="string" length="1" follows="top|right" + halign="left" height="16" + top_delta="-2" + left_pad="7" layout="topleft" - left_pad="4" - name="auction_label" - top_delta="0" - width="145"> - Auction + name="person_label" + width="90"> + Person </text> - <icon - color="1 1 0.25 1" + <check_box + control_name="MapShowInfohubs" follows="top|right" height="16" - image_name="legend.tga" layout="topleft" - left_delta="50" + left="3" + name="infohub_chk" + top_pad="3" + width="22" /> + <icon + follows="top|right" + height="16" + image_name="map_infohub.tga" + layout="topleft" + left_pad="0" mouse_opaque="true" - name="square" + name="infohub" top_delta="0" width="16" /> - <text + <text type="string" length="1" follows="top|right" + halign="left" height="16" + top_delta="2" + left_pad="3" layout="topleft" - left_pad="4" - name="land_for_sale_label" - top_delta="0" - width="145"> - Land For Sale + name="infohub_label" + width="90"> + Infohub </text> - <button + <check_box + control_name="MapShowLandForSale" follows="top|right" height="16" - label="Go Home" - label_selected="Go Home" layout="topleft" - left="-90" - name="Go Home" - tool_tip="Teleport to your home" - top="34" - width="88" > - <button.commit_callback - function="WMap.GoHome" /> - </button> + left="3" + name="land_for_sale_chk" + top_pad="2" + width="22" /> <icon - color="0 1 0 1" follows="top|right" - height="8" - image_name="map_avatar_8.tga" + height="16" + image_name="icon_for_sale.tga" layout="topleft" - left="-226" mouse_opaque="true" - name="person" - top="84" - width="8" /> - <check_box - control_name="MapShowPeople" + name="landforsale" + top_delta="0" + left_pad="0" + width="16" /> + <text + type="string" + length="1" follows="top|right" + halign="left" height="16" - label="Resident" + top_delta="2" + left_pad="3" layout="topleft" - left_pad="8" - name="people_chk" - top_delta="-4" - width="110" /> + name="land_sale_label" + width="90"> + Land Sale + </text> <icon + color="1 1 0.25 1" follows="top|right" height="16" - image_name="map_infohub.tga" + image_name="legend.tga" layout="topleft" - left="-230" mouse_opaque="true" - name="infohub" - top="100" + name="square2" + left="41" + top_pad="-2" width="16" /> - <check_box - control_name="MapShowInfohubs" + <text + type="string" + length="1" follows="top|right" height="16" - label="Infohub" layout="topleft" - left_pad="4" - name="infohub_chk" - top_delta="0" - width="110" /> - <icon + left_pad="0" + name="auction_label" + top_delta="3" + width="100"> + by owner + </text> + <icon + color="0.5 0.25 1 1" follows="top|right" height="16" - image_name="map_telehub.tga" + image_name="legend.tga" layout="topleft" - left="-230" mouse_opaque="true" - name="telehub" - top="120" + name="square2" + left="41" + top_pad="-3" width="16" /> - <check_box - control_name="MapShowTelehubs" + <text + type="string" + length="1" follows="top|right" height="16" - label="Telehub" layout="topleft" - left_pad="4" - name="telehub_chk" - top_delta="0" - width="110" /> - <icon + left_pad="0" + name="auction_label" + top_delta="3" + width="170"> + land auction + </text> + + <button follows="top|right" - height="16" - image_name="icon_for_sale.tga" + height="22" + image_overlay="map_home.tga" + scale_image="true" + label_color="White" layout="topleft" - left="-230" - mouse_opaque="true" - name="landforsale" - top="140" - width="16" /> - <check_box - control_name="MapShowLandForSale" + left="136" + top="6" + name="Go Home" + tool_tip="Teleport home" + width="24" > + <button.commit_callback + function="WMap.GoHome" /> + </button> + <text + type="string" + length="1" follows="top|right" - height="16" - label="Land for Sale" + halign="left" + height="13" + top_delta="6" + left_pad="5" layout="topleft" - left_pad="4" - name="land_for_sale_chk" - top_delta="0" - width="110" /> + name="Home_label" + width="70"> + Home + </text> <text type="string" length="1" follows="top|right" + halign="left" height="16" layout="topleft" - left="-104" + left="137" name="events_label" - top="80" - width="145"> + top_pad="9" + width="66"> Events: </text> - <icon + + <check_box + control_name="MapShowEvents" + follows="top|right" + height="16" + layout="topleft" + left="135" + top_pad="1" + name="event_chk" + width="22" /> + <icon follows="top|right" height="16" image_name="map_event.tga" layout="topleft" - left="-92" mouse_opaque="true" name="event" - top="100" + left_pad="0" width="16" /> + <text + type="string" + length="1" + follows="top|right" + halign="left" + height="16" + top_delta="2" + left_pad="3" + layout="topleft" + name="pg_label" + width="60"> + PG + </text> + <check_box - control_name="MapShowEvents" + control_name="ShowMatureEvents" follows="top|right" height="16" - label="PG" + initial_value="true" layout="topleft" - left_pad="4" - name="event_chk" - top_delta="0" - width="55" /> + left="135" + name="event_mature_chk" + top_pad="3" + width="22" /> <icon follows="top|right" height="16" image_name="map_event_mature.tga" layout="topleft" - left="-92" mouse_opaque="true" name="events_mature_icon" - top="120" + top_delta="0" + left_pad="0" width="16" /> + <text + type="string" + length="1" + follows="top|right" + halign="left" + height="16" + top_delta="2" + left_pad="3" + layout="topleft" + name="mature_label" + width="66"> + Mature + </text> + <check_box - control_name="ShowMatureEvents" + control_name="ShowAdultEvents" follows="top|right" height="16" - initial_value="true" - label="Mature" layout="topleft" - left_pad="4" - name="event_mature_chk" - top_delta="0" - width="55" /> + left="135" + name="event_adult_chk" + top_pad="3" + width="22" /> <icon follows="top|right" height="16" image_name="map_event_adult.tga" layout="topleft" - left="-92" + left_pad="0" mouse_opaque="true" name="events_adult_icon" - top="140" + top_delta="0" width="16" /> - <check_box - control_name="ShowAdultEvents" + <text + type="string" + length="1" follows="top|right" + halign="left" height="16" - label="Adult" + top_delta="2" + left_pad="3" layout="topleft" - left_pad="4" - name="event_adult_chk" - top_delta="0" - width="55" /> - <icon - color="0.5 0 0 1" + name="pg_label" + width="66"> + Adult + </text> +</panel> + + + <panel + follows="right|top" + height="22" + top_pad="0" + width="238" + background_visible="true" + bg_alpha_color="DkGray2"> + <text + text_color="White" + font="SansSerifLarge" + type="string" + length="1" follows="top|right" + halign="left" height="16" - image_name="map_track_16.tga" layout="topleft" - left="-230" - mouse_opaque="true" - name="avatar_icon" - top="164" - width="16" /> + left="15" + name="find_on_map_label" + top="3" + width="215"> + Find on Map + </text> + </panel> + + <panel + follows="right|top|bottom" + height="270" + top_pad="0" + width="238"> + <icon + color="0.5 0 0 1" + follows="top|right" + height="16" + image_name="map_track_16.tga" + layout="topleft" + left="5" + top="11" + mouse_opaque="true" + name="friends_icon" + width="16" /> <combo_box allow_text_entry="true" follows="top|right" - height="20" + height="23" label="Online Friends" layout="topleft" - left_pad="4" + top_delta="-4" + left_pad="5" max_chars="60" name="friend combo" - tool_tip="Friend to show on map" - top_delta="-4" - width="202"> + tool_tip="Show friends on map" + width="182"> <combo_box.item - label="Online Friends" + label="My Friends Online" name="item1" value="None" /> <combo_box.commit_callback function="WMap.AvatarCombo"/> </combo_box> - <icon + <icon color="0.5 0 0 1" follows="top|right" height="16" image_name="map_track_16.tga" layout="topleft" - left="-230" + left="5" + top_pad="8" mouse_opaque="true" name="landmark_icon" - top="189" width="16" /> <combo_box allow_text_entry="true" follows="top|right" - height="20" - label="Landmarks" + height="23" + label="My Landmarks" layout="topleft" - left_pad="4" + top_delta="-3" + left_pad="5" max_chars="64" name="landmark combo" tool_tip="Landmark to show on map" - top_delta="-4" - width="202"> + width="182"> <combo_box.item - label="Landmarks" + label="My Landmarks" name="item1" value="None" /> <combo_box.commit_callback function="WMap.Landmark"/> </combo_box> - <icon + <icon color="0.5 0 0 1" follows="top|right" height="16" image_name="map_track_16.tga" layout="topleft" - left="-230" + left="5" + top_pad="7" mouse_opaque="true" - name="location_icon" - top="214" + name="region_icon" width="16" /> - <line_editor + <search_editor follows="top|right" - height="20" - label="Search by Region Name" + search_button_visible="false" + height="22" + text_readonly_color="DkGray" + label="Regions by Name" layout="topleft" - left_pad="4" + top_delta="-2" + left_pad="5" name="location" select_on_focus="true" tool_tip="Type the name of a region" - top_delta="-4" - width="140" /> - <button + width="152" /> + <button follows="top|right" - height="20" - label="Search" + height="23" + label="Find" layout="topleft" - left_pad="5" + left_pad="2" + top_delta="-1" name="DoSearch" tool_tip="Search for region" - top_delta="0" - width="60"> + width="58"> <button.commit_callback function="WMap.Location" /> - </button> - <text - type="string" - length="1" - follows="top|right" - font="SansSerif" - height="16" - layout="topleft" - left="-230" - name="search_label" - top="234" - width="222"> - Search Results: - </text> + </button> <scroll_list draw_stripes="false" - follows="top|right|bottom" - height="200" + bg_writeable_color="MouseGray" + follows="all" + height="115" layout="topleft" - left_delta="0" + left="28" name="search_results" - top_pad="10" - width="222" + top_pad="5" + width="209" sort_column="1"> <scroll_list.columns label="" @@ -407,35 +512,87 @@ <scroll_list.columns label="" name="sim_name" - width="206" /> + width="193" /> <scroll_list.commit_callback function="WMap.SearchResult" /> </scroll_list> - <text + <button + follows="right|bottom" + height="23" + label="Teleport" + layout="topleft" + left="25" + name="Teleport" + tool_tip="Teleport to selected location" + top_pad="7" + width="104"> + <button.commit_callback + function="WMap.Teleport" /> + </button> + <button + follows="right|bottom" + height="23" + label="Copy SLurl" + layout="topleft" + left_pad="5" + name="copy_slurl" + tool_tip="Copies current location as SLurl to be used on the web." + top_delta="0" + width="104"> + <button.commit_callback + function="WMap.CopySLURL" /> + </button> + <!-- <button + follows="right|bottom" + height="23" + label="Clear" + layout="topleft" + left="10" + name="Clear" + tool_tip="Stop tracking" + top_pad="5" + width="105"> + <button.commit_callback + function="WMap.Clear" /> + </button>--> + <button + enabled="false" + follows="right|bottom" + height="23" + label="Show Selection" + left="25" + top_pad="5" + name="Show Destination" + tool_tip="Center map on selected location" + width="213"> + <button.commit_callback + function="WMap.ShowTarget" /> + </button> + +<!-- <text type="string" length="1" follows="bottom|right" - font="SansSerif" + halign="left" height="16" - layout="topleft" - left_delta="0" - name="location_label" top_pad="4" - width="98"> + left="25" + layout="topleft" + name="land_sale_label" + width="250"> Location: </text> - <spinner + <spinner decimal_digits="0" follows="bottom|right" - height="16" increment="1" initial_value="128" layout="topleft" - left_delta="70" + top_pad="0" + left="25" max_val="255" name="spin x" tool_tip="X coordinate of location to show on map" - top_delta="0" width="48"> <spinner.commit_callback function="WMap.CommitLocation" /> @@ -459,7 +616,6 @@ <spinner decimal_digits="0" follows="bottom|right" - height="16" increment="1" initial_value="0" layout="topleft" @@ -471,89 +627,58 @@ width="48"> <spinner.commit_callback function="WMap.CommitLocation" /> - </spinner> - <button - follows="right|bottom" - height="20" - label="Teleport" - label_selected="Teleport" - layout="topleft" - left="-230" - name="Teleport" - tool_tip="Teleport to selected location" - top="494" - width="90"> - <button.commit_callback - function="WMap.Teleport" /> - </button> - <button - follows="right|bottom" - height="20" - label="Show Destination" - label_selected="Show Destination" - layout="topleft" - left_pad="10" - name="Show Destination" - tool_tip="Center map on selected location" - top_delta="0" - width="125"> - <button.commit_callback - function="WMap.ShowTarget" /> - </button> - <button - follows="right|bottom" - height="20" - label="Clear" - label_selected="Clear" - layout="topleft" - left="-230" - name="Clear" - tool_tip="Stop tracking" - top="518" - width="90"> - <button.commit_callback - function="WMap.Clear" /> - </button> - <button - follows="right|bottom" - height="20" - label="Show My Location" - label_selected="Show My Location" + </spinner>--> + </panel> + <panel + follows="right|bottom" + height="22" + top_pad="0" + width="238" + background_visible="true" + bg_alpha_color="DkGray2"> + <text + text_color="White" + font="SansSerifLarge" + type="string" + length="1" + follows="top|right" + halign="left" + height="16" layout="topleft" - left_pad="10" - name="Show My Location" - tool_tip="Center map on your avatar's location" - top_delta="0" - width="125" > - <button.commit_callback - function="WMap.ShowAgent" /> - </button> - <button - enabled="false" - follows="bottom|right" - height="20" - label="Copy SLurl to clipboard" + left="15" + name="zoom_label" + top="3" + width="210"> + Zoom + </text> + </panel> + <panel + follows="right|bottom" + height="30" + min_height="30" + top_pad="0" + width="238"> + <icon + follows="left|bottom" + height="16" + image_name="Zoom_Off" layout="topleft" - left="-230" - name="copy_slurl" - tool_tip="Copies current location as SLurl to be used on the web." - top="542" - width="222"> - <button.commit_callback - function="WMap.CopySLURL" /> - </button> + left="20" + mouse_opaque="true" + name="zoom_icon" + top_pad="7" + width="16" /> <slider - follows="right|bottom" + follows="left|bottom" height="16" increment="0.2" - initial_value="48.5029" - label="Zoom" + initial_value="-2" + left_pad="0" layout="topleft" - left_delta="0" max_val="0" min_val="-8" name="zoom slider" show_text="false" - top_pad="8" - width="222" /> + width="200" /> + </panel> </floater> diff --git a/indra/newview/skins/default/xui/en/inspect_avatar.xml b/indra/newview/skins/default/xui/en/inspect_avatar.xml index dd3cf079db..8349f594d9 100644 --- a/indra/newview/skins/default/xui/en/inspect_avatar.xml +++ b/indra/newview/skins/default/xui/en/inspect_avatar.xml @@ -19,7 +19,7 @@ <!-- Allowed fields include: [BORN_ON] ("12/3/2008") [SL_PROFILE] (Second Life profile), - [RW_PROFILE] (real world profile), + [RW_PROFILE] (real world profile), [ACCTTYPE] ("Resident"), [PAYMENTINFO] ("Payment Info on File"), [AGE] ("1 year 2 months") @@ -32,10 +32,6 @@ name="Details"> [SL_PROFILE] </string> - <string - name="Partner"> - Partner: [PARTNER] - </string> <text follows="all" font="SansSerifLarge" @@ -52,31 +48,20 @@ height="16" left="8" name="user_subtitle" - font="SansSerifSmall" - text_color="White" + font="SansSerifSmall" + text_color="White" value="11 Months, 3 days old" width="175" use_ellipses="true" /> <text follows="all" - height="25" - left="8" + height="35" + left="8" name="user_details" word_wrap="true" top_pad="6" width="220">This is my second life description and I really think it is great. </text> - <text - follows="all" - height="13" - left="8" - name="user_partner" - top_pad="3" - width="220" - use_ellipses="true" - word_wrap="false"> - Erica Linden - </text> <slider follows="top|left" height="23" @@ -113,8 +98,9 @@ name="avatar_icon" top="10" width="38" /> - <!-- Overlapping buttons for default actions - llinspectavatar.cpp makes visible the most likely default action --> +<!-- Overlapping buttons for default actions + llinspectavatar.cpp makes visible the most likely default action +--> <button follows="bottom|left" height="20" @@ -131,9 +117,8 @@ top_delta="0" name="im_btn" width="80" - commit_callback.function="InspectAvatar.IM" - /> - <button + commit_callback.function="InspectAvatar.IM"/> + <button follows="top|left" height="20" label="More" @@ -153,7 +138,7 @@ right="-5" top_delta="0" width="35" /> - <menu_button + <menu_button follows="top|left" height="20" image_overlay="OptionsMenu_Off" diff --git a/indra/newview/skins/default/xui/en/inspect_group.xml b/indra/newview/skins/default/xui/en/inspect_group.xml index f48af2f97e..37ae5a64d7 100644 --- a/indra/newview/skins/default/xui/en/inspect_group.xml +++ b/indra/newview/skins/default/xui/en/inspect_group.xml @@ -4,106 +4,101 @@ Single instance - only have one at a time, recycle it each spawn --> <floater - legacy_header_height="18" + legacy_header_height="25" bevel_style="in" bg_opaque_image="Inspector_Background" can_close="false" can_minimize="false" - height="138" + height="158" layout="topleft" name="inspect_group" single_instance="true" sound_flags="0" visible="true" - width="245"> + width="228"> <string name="PrivateGroup">Private group</string> <string name="FreeToJoin">Free to join</string> <string name="CostToJoin">L$[AMOUNT] to join</string> <string name="YouAreMember">You are a member</string> <text follows="all" - font="SansSerifLargeBold" - height="18" + font="SansSerifLarge" + height="16" left="8" name="group_name" - top="5" - text_color="white" + top="10" + text_color="White" use_ellipses="true" - width="240" + width="175" word_wrap="false"> Grumpity's Grumpy Group of Moose </text> <text follows="all" - font="SansSerifSmallBold" + font="SansSerifSmall" text_color="White" - height="18" + height="16" left="8" name="group_subtitle" use_ellipses="true" - top_pad="0" - width="170"> + width="175"> 123 members </text> <text follows="all" - height="50" + height="45" left="8" name="group_details" - top_pad="0" - width="170" + use_ellipses="true" + top_pad="6" + width="220" word_wrap="true"> A group of folks charged with creating a room with a moose. Fear the moose! Fear it! And the mongoose too! </text> <text follows="all" - height="15" + height="13" left="8" name="group_cost" - top_pad="2" - width="170"> + top_pad="13" + width="220"> L$123 to join </text> <icon follows="all" height="38" - right="-25" + right="-10" mouse_opaque="true" name="group_icon" - top="24" - width="38" /> - <!-- Must be tab_stop="true" so something can hold focus even when the - other buttons are disabled or invisible, otherwise inspector closes --> - <button - follows="top|left" - height="18" - image_disabled="ForwardArrow_Disabled" - image_selected="ForwardArrow_Press" - image_unselected="ForwardArrow_Off" - name="view_profile_btn" - right="-8" - top="35" - left_delta="110" - tab_stop="true" - width="18" - commit_callback.function="InspectGroup.ViewProfile" /> + top="10" + width="38" + bevel_style="in" /> <button follows="bottom|left" height="23" label="Join" left="8" - top="246" + top="286" name="join_btn" - width="100" + width="103" commit_callback.function="InspectGroup.Join"/> <button follows="bottom|left" height="23" label="Leave" left="8" - top="246" + top="286" name="leave_btn" - width="100" + width="103" commit_callback.function="InspectGroup.Leave"/> + <button + follows="bottom|left" + height="23" + label="View Profile" + name="view_profile_btn" + top="286" + left="117" + width="103" + commit_callback.function="InspectGroup.ViewProfile" /> </floater> diff --git a/indra/newview/skins/default/xui/en/inspect_remote_object.xml b/indra/newview/skins/default/xui/en/inspect_remote_object.xml index 07c684d904..b5f2abf52a 100644 --- a/indra/newview/skins/default/xui/en/inspect_remote_object.xml +++ b/indra/newview/skins/default/xui/en/inspect_remote_object.xml @@ -71,7 +71,6 @@ </text> <button follows="top|left" - font="SansSerif" height="20" label="Map" left="10" @@ -80,7 +79,6 @@ width="75" /> <button follows="top|left" - font="SansSerif" height="20" label="Block" left_pad="5" @@ -89,7 +87,6 @@ width="75" /> <button follows="top|left" - font="SansSerif" height="20" label="Close" right="-10" diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml index 3bf7f50a2c..a11ebf5af8 100644 --- a/indra/newview/skins/default/xui/en/main_view.xml +++ b/indra/newview/skins/default/xui/en/main_view.xml @@ -10,22 +10,16 @@ <layout_stack border_size="0" follows="all" mouse_opaque="false" - height="768" + height="749" name="menu_stack" orientation="vertical" - top="0"> + top="19"> <layout_panel auto_resize="false" - height="84" + height="65" mouse_opaque="false" - name="nav_and_status_bar_region" + name="nav_bar_container" width="1024" visible="false"> - <panel follows="left|right|bottom" - left="0" - name="nav_bar_container" - right="1024" - top="19" - height="65"/> </layout_panel> <layout_panel auto_resize="true" follows="all" @@ -48,7 +42,7 @@ height="500" layout="topleft" mouse_opaque="false" - name="main_view" + name="non_side_tray_view" user_resize="true" width="500"> <view bottom="500" @@ -104,19 +98,29 @@ min_width="333" mouse_opaque="false" name="side_tray_container" - user_resize="true" + user_resize="false" visible="false" width="333"/> </layout_stack> - <floater_view follows="all" + <panel follows="all" height="500" left="0" mouse_opaque="false" - name="Floater View" + name="floater_view_holder" tab_group="-1" tab_stop="false" top="0" - width="1024"/> + width="1024"> + <floater_view follows="all" + height="500" + left="0" + mouse_opaque="false" + name="Floater View" + tab_group="-1" + tab_stop="false" + top="0" + width="1024"/> + </panel> <debug_view follows="all" left="0" top="0" diff --git a/indra/newview/skins/default/xui/en/menu_bottomtray.xml b/indra/newview/skins/default/xui/en/menu_bottomtray.xml index a7abb223ba..7ef91a1d85 100644 --- a/indra/newview/skins/default/xui/en/menu_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/menu_bottomtray.xml @@ -52,4 +52,57 @@ function="CheckControl" parameter="ShowSnapshotButton" /> </menu_item_check> + <menu_item_separator + name="Separator" /> + <menu_item_call + label="Cut" + name="NearbyChatBar_Cut"> + <menu_item_call.on_click + function="NearbyChatBar.Action" + parameter="cut" /> + <menu_item_call.on_enable + function="NearbyChatBar.EnableMenuItem" + parameter="can_cut" /> + </menu_item_call> + <menu_item_call + label="Copy" + name="NearbyChatBar_Copy"> + <menu_item_call.on_click + function="NearbyChatBar.Action" + parameter="copy" /> + <menu_item_call.on_enable + function="NearbyChatBar.EnableMenuItem" + parameter="can_copy" /> + </menu_item_call> + <menu_item_call + label="Paste" + name="NearbyChatBar_Paste"> + <menu_item_call.on_click + function="NearbyChatBar.Action" + parameter="paste" /> + <menu_item_call.on_enable + function="NearbyChatBar.EnableMenuItem" + parameter="can_paste" /> + </menu_item_call> + <menu_item_call + label="Delete" + name="NearbyChatBar_Delete"> + <menu_item_call.on_click + function="NearbyChatBar.Action" + parameter="delete" /> + <menu_item_call.on_enable + function="NearbyChatBar.EnableMenuItem" + parameter="can_delete" /> + </menu_item_call> + <menu_item_call + label="Select All" + name="NearbyChatBar_Select_All"> + <menu_item_call.on_click + function="NearbyChatBar.Action" + parameter="select_all" /> + <menu_item_call.on_enable + function="NearbyChatBar.EnableMenuItem" + parameter="can_select_all" /> + </menu_item_call> + </menu> diff --git a/indra/newview/skins/default/xui/en/menu_imchiclet_adhoc.xml b/indra/newview/skins/default/xui/en/menu_imchiclet_adhoc.xml new file mode 100644 index 0000000000..eb5e31b57d --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_imchiclet_adhoc.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu + height="101" + layout="topleft" + left="100" + mouse_opaque="false" + name="IMChiclet AdHoc Menu" + top="724" + visible="false" + width="128"> + <menu_item_call + label="End Session" + layout="topleft" + name="End Session"> + <menu_item_call.on_click + function="IMChicletMenu.Action" + parameter="end" /> + </menu_item_call> +</menu> diff --git a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml index 435a3e6d34..4e6a07d020 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml @@ -76,7 +76,9 @@ function="Inventory.GearDefault.Custom.Action" parameter="empty_lostnfound" /> </menu_item_call> - <menu_item_call + <menu_item_separator + layout="topleft" /> + <menu_item_call label="Save Texture As" layout="topleft" name="Save Texture As"> @@ -87,4 +89,26 @@ function="Inventory.GearDefault.Enable" parameter="save_texture" /> </menu_item_call> + <menu_item_call + label="Find Original" + layout="topleft" + name="Find Original"> + <on_click + function="Inventory.GearDefault.Custom.Action" + parameter="find_original" /> + <on_enable + function="Inventory.GearDefault.Enable" + parameter="find_original" /> + </menu_item_call> + <menu_item_call + label="Find All Links" + layout="topleft" + name="Find All Links"> + <on_click + function="Inventory.GearDefault.Custom.Action" + parameter="find_links" /> + <on_enable + function="Inventory.GearDefault.Enable" + parameter="find_links" /> + </menu_item_call> </menu> diff --git a/indra/newview/skins/default/xui/en/menu_login.xml b/indra/newview/skins/default/xui/en/menu_login.xml index 07940e18b6..a22dc80f4e 100644 --- a/indra/newview/skins/default/xui/en/menu_login.xml +++ b/indra/newview/skins/default/xui/en/menu_login.xml @@ -185,21 +185,42 @@ <menu_item_call.on_click function="Advanced.ShowSideTray" /> </menu_item_call> + <menu + label="UI Tests" + name="UI Tests" + tear_off="true"> + <menu_item_call + label="Textbox" + name="Textbox" + shortcut="control|1"> + <menu_item_call.on_click + function="ShowFloater" + parameter="test_textbox" /> + </menu_item_call> + <menu_item_call + label="Text Editor" + name="Text Editor" + shortcut="control|2"> + <menu_item_call.on_click + function="ShowFloater" + parameter="test_text_editor" /> + </menu_item_call> <menu_item_call - label="Widget Test" - name="Widget Test" + label="Widgets" + name="Widgets" shortcut="control|shift|T"> - <menu_item_call.on_click - function="ShowFloater" - parameter="test_widgets" /> + <menu_item_call.on_click + function="ShowFloater" + parameter="test_widgets" /> </menu_item_call> <menu_item_call - label="Inspectors Test" - name="Inspectors Test"> - <menu_item_call.on_click - function="ShowFloater" - parameter="test_inspectors" /> + label="Inspectors" + name="Inspectors"> + <menu_item_call.on_click + function="ShowFloater" + parameter="test_inspectors" /> </menu_item_call> + </menu> <menu_item_check label="Reg In Client Test (restart)" name="Reg In Client Test (restart)"> diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby.xml b/indra/newview/skins/default/xui/en/menu_people_nearby.xml index 643336cf6c..c3a2540b2e 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml @@ -27,7 +27,6 @@ function="Avatar.IM" /> </menu_item_call> <menu_item_call - enabled="false" label="Call" layout="topleft" name="Call"> diff --git a/indra/newview/skins/default/xui/en/menu_text_editor.xml b/indra/newview/skins/default/xui/en/menu_text_editor.xml index 7c9e6f0796..ecd96088e7 100644 --- a/indra/newview/skins/default/xui/en/menu_text_editor.xml +++ b/indra/newview/skins/default/xui/en/menu_text_editor.xml @@ -32,10 +32,10 @@ function="Edit.EnablePaste" /> </menu_item_call> <menu_item_call - label="Delete" - layout="topleft" - name="Delete" - shortcut="Del"> + label="Delete" + layout="topleft" + name="Delete" + shortcut="Del"> <menu_item_call.on_click function="Edit.Delete" /> <menu_item_call.on_enable diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index fc4f163734..3a9e76f7a7 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -373,17 +373,17 @@ <menu_item_call.on_enable function="World.EnableSetHomeLocation" /> </menu_item_call> - <menu_item_call - label="Teleport Home" - layout="topleft" - name="Teleport Home" - shortcut="control|shift|H"> - <menu_item_call.on_click - function="World.TeleportHome" /> - <menu_item_call.on_enable - function="World.EnableTeleportHome" /> - </menu_item_call> </menu> + <menu_item_call + label="Home" + layout="topleft" + name="Teleport Home" + shortcut="control|shift|H"> + <menu_item_call.on_click + function="World.TeleportHome" /> + <menu_item_call.on_enable + function="World.EnableTeleportHome" /> + </menu_item_call> <menu_item_check label="Mini-Map" layout="topleft" @@ -3268,6 +3268,17 @@ </menu> <menu_item_separator layout="topleft" /> + <menu_item_check + label="HTTP Textures" + layout="topleft" + name="HTTP Textures"> + <menu_item_check.on_check + function="CheckControl" + parameter="ImagePipelineUseHTTP" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="ImagePipelineUseHTTP" /> + </menu_item_check> <menu_item_call label="Compress Images" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 4c0e1e2288..c2bc2e0d85 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -586,20 +586,7 @@ To place the media on only one face, choose Select Texture and click on the desi notext="Cancel" yestext="OK"/> </notification> - - <notification - icon="alertmodal.tga" - name="WhiteListInvalidatesHomeUrl" - type="alertmodal"> -Adding this entry to the whitelist will invalidate the home URL you -specified for this instance of media. You are not allowed to do this -so the entry cannot be added to the whitelist. - <usetemplate - name="okbutton" - yestext="Ok"/> - </notification> - - + <notification icon="alertmodal.tga" name="MustBeInParcel" @@ -1172,6 +1159,13 @@ Eject [AVATAR_NAME] from your land? <notification icon="alertmodal.tga" + name="EjectAvatarFromGroup" + type="notify"> +You ejected [AVATAR_NAME] from group [GROUP_NAME] + </notification> + + <notification + icon="alertmodal.tga" name="AcquireErrorTooManyObjects" type="alertmodal"> ACQUIRE ERROR: Too many objects selected. @@ -2375,15 +2369,15 @@ Please choose the male or female avatar. You can change your mind later. <notification icon="alertmodal.tga" name="GrantedModifyRights" - type="alertmodal"> -[FIRST_NAME] [LAST_NAME] has given you permission to edit their objects. + type="notify"> +[NAME] has given you permission to edit their objects. </notification> <notification icon="alertmodal.tga" name="RevokedModifyRights" - type="alertmodal"> -Your privilege to modify [FIRST_NAME] [LAST_NAME]'s objects has been revoked + type="notify"> +Your privilege to modify [NAME]'s objects has been revoked </notification> <notification @@ -3486,7 +3480,7 @@ Publish this classified now for L$[AMOUNT]? icon="alertmodal.tga" name="SetClassifiedMature" type="alertmodal"> -Does this classified contain Mature content? +Does this classified contain Moderate content? <usetemplate canceltext="Cancel" name="yesnocancelbuttons" @@ -3498,7 +3492,7 @@ Does this classified contain Mature content? icon="alertmodal.tga" name="SetGroupMature" type="alertmodal"> -Does this group contain Mature content? +Does this group contain Moderate content? <usetemplate canceltext="Cancel" name="yesnocancelbuttons" @@ -4574,7 +4568,7 @@ Some terms in your search query were excluded due to content restrictions as cla icon="notifytip.tga" name="NoContentToSearch" type="notifytip"> -Please select at least one type of content to search (PG, Mature, or Adult). +Please select at least one type of content to search (General, Moderate, or Adult). </notification> <notification @@ -4604,6 +4598,13 @@ Please select at least one type of content to search (PG, Mature, or Adult). <notification icon="notify.tga" + name="PaymentRecived" + type="notify"> +[MESSAGE] + </notification> + + <notification + icon="notify.tga" name="EventNotification" type="notify"> Event Notification: @@ -5776,6 +5777,25 @@ Server Error: Media update or get failed. yestext="OK"/> </notification> + <notification + icon="alertmodal.tga" + name="TextChatIsMutedByModerator" + type="alertmodal"> +Your text chat has been muted by moderator. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="VoiceIsMutedByModerator" + type="alertmodal"> +Your voice has been muted by moderator. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> <notification icon="alertmodal.tga" @@ -5788,7 +5808,7 @@ Are you sure you want to delete your teleport history? yestext="OK"/> </notification> - <notification + <notification icon="alertmodal.tga" name="UploadCostConfirmation" type="alertmodal"> @@ -5845,13 +5865,6 @@ If you continue to have problems, please visit the [SUPPORT_SITE]. - Your system memory does not meet the minimum requirements. </global> - <global name="PermYes"> -Yes - </global> - - <global name="PermNo"> -No - </global> <!-- this is alert string from server. the name needs to match entire the server string, and needs to be changed whenever the server string changes --> <global name="You can only set your 'Home Location' on your land or at a mainland Infohub."> diff --git a/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml b/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml index 368ab17689..f5fce65c73 100644 --- a/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml +++ b/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml @@ -48,7 +48,6 @@ visible="false" width="100" /> <button - enabled="false" follows="all" bottom="10" height="20" diff --git a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml index 2eaa3a94ee..45f9d9c7b6 100644 --- a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml @@ -7,6 +7,18 @@ name="avatar_list_item" top="0" width="320"> + <!-- + Strings used to localize last interaction time. + See last_interaction textbox below. + --> + <string name="FormatSeconds">[COUNT]s</string> + <string name="FormatMinutes">[COUNT]m</string> + <string name="FormatHours">[COUNT]h</string> + <string name="FormatDays">[COUNT]d</string> + <string name="FormatWeeks">[COUNT]w</string> + <string name="FormatMonths">[COUNT]mon</string> + <string name="FormatYears">[COUNT]y</string> + <icon follows="top|right|left" height="24" diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index da8006d545..ec3f7ea7c5 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -72,7 +72,13 @@ left="0" name="talk" top="4" - width="100" /> + width="100"> + <show_button> + <show_button.init_callback + function="Button.SetDockableFloaterToggle" + parameter="voice_controls" /> + </show_button> + </talk_button> </layout_panel> <icon auto_resize="false" diff --git a/indra/newview/skins/default/xui/en/panel_chat_header.xml b/indra/newview/skins/default/xui/en/panel_chat_header.xml index c1090a1686..3e6ea84bf2 100644 --- a/indra/newview/skins/default/xui/en/panel_chat_header.xml +++ b/indra/newview/skins/default/xui/en/panel_chat_header.xml @@ -8,7 +8,7 @@ label="im_header" layout="topleft" name="im_header" - width="300"> + width="310"> <avatar_icon follows="left" height="18" @@ -20,19 +20,21 @@ top="3" width="18" /> <text_editor - v_pad = "0" - read_only = "true" - follows="left|right" - font.style="BOLD" - height="12" - layout="topleft" - left_pad="5" - right="-60" - name="user_name" - text_color="white" - top="8" - use_ellipses="true" - value="Ericag Vader" /> + allow_scroll="false" + v_pad = "0" + read_only = "true" + follows="left|right" + font.style="BOLD" + height="12" + layout="topleft" + left_pad="5" + right="-60" + name="user_name" + text_color="white" + bg_readonly_color="black" + top="8" + use_ellipses="true" + value="Ericag Vader" /> <text font="SansSerifSmall" follows="right" diff --git a/indra/newview/skins/default/xui/en/panel_chat_item.xml b/indra/newview/skins/default/xui/en/panel_chat_item.xml index 2b29796f0a..34c6e02684 100644 --- a/indra/newview/skins/default/xui/en/panel_chat_item.xml +++ b/indra/newview/skins/default/xui/en/panel_chat_item.xml @@ -2,70 +2,26 @@ <!-- All our XML is utf-8 encoded. --> <panel name="instant_message" - width="300" + width="315" height="180" follows="all"> - <panel - width="290" - height="24" - background_visible="true" - background_opaque="false" - bg_alpha_color="Black" - left="5" - name="msg_caption"> - <avatar_icon - follows="left" - height="18" - image_name="Generic_Person" - layout="topleft" - left="3" - mouse_opaque="true" - name="avatar_icon" - top="3" - width="18" /> - <text - font.style="BOLD" - height="12" - layout="topleft" - left_pad="5" - top="7" - text_color="white" - word_wrap="false" - use_ellipses="true" - mouse_opaque="true" - name="sender_name" - width="150"> - Jerry Knight - </text> - <!-- <icon top="22" left="215" width="15" height="15" follows="top|right" - image_name="icn_voice-pvtfocus.tga" visible="false" name="msg_inspector" />--> - <!--<icon top="22" left="215" width="10" height="10" follows="top|right" - image_name="speaking_indicator.tga" name="msg_icon"/>--> - <text - font="SansSerifSmall" - follows="right|top" - halign="right" - height="13" - layout="topleft" - right="-10" - left="205" - mouse_opaque="true" - name="msg_time" - top="8" - value="23:30" - width="50" - word_wrap="true" /> - </panel> + <avatar_icon + follows="left|top" + height="18" + image_name="Generic_Person" + layout="topleft" + left="3" + mouse_opaque="true" + name="avatar_icon" + top="3" + width="18" /> <text_chat - top="-35" - left="10" - right="-10" + top="5" + left="30" height="120" - follows="left|right|bottom" text_color="white" word_wrap="true" mouse_opaque="true" name="msg_text"> - To be or not to be, that is the question. Tis a far far better thing I do than I have ever done. Tis a far far better place I go, than I have ever been. </text_chat> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_classified.xml b/indra/newview/skins/default/xui/en/panel_classified.xml index 18d12aef70..9622313786 100644 --- a/indra/newview/skins/default/xui/en/panel_classified.xml +++ b/indra/newview/skins/default/xui/en/panel_classified.xml @@ -111,11 +111,11 @@ name="select_mature" value="Select" /> <combo_box.item - label="Mature Content" + label="Moderate Content" name="mature" value="Mature" /> <combo_box.item - label="PG Content" + label="General Content" name="pg" value="PG" /> </combo_box> diff --git a/indra/newview/skins/default/xui/en/panel_classified_info.xml b/indra/newview/skins/default/xui/en/panel_classified_info.xml index df889e87c3..5c594d3f14 100644 --- a/indra/newview/skins/default/xui/en/panel_classified_info.xml +++ b/indra/newview/skins/default/xui/en/panel_classified_info.xml @@ -11,11 +11,11 @@ width="333"> <panel.string name="type_mature"> - Mature + Moderate </panel.string> <panel.string name="type_pg"> - PG Content + General Content </panel.string> <button follows="top|right" diff --git a/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml b/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml index ee333be0cb..b881719e3a 100644 --- a/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml @@ -12,24 +12,24 @@ follows="all" height="85" image_name="ListItem_Over" - right="-3" + right="-2" mouse_opaque="false" name="hovered_icon" top="1" scale_image="true" visible="false" - width="307"/> + width="308"/> <icon follows="all" height="85" image_name="ListItem_Select" - right="-3" + right="-2" mouse_opaque="false" name="selected_icon" top="1" scale_image="true" visible="false" - width="307"/> + width="308"/> <texture_picker allow_no_texture="true" border_enabled="true" @@ -47,37 +47,34 @@ width="90" /> <text follows="top|left|right" - font="SansSerifSmallBold" - height="16" + font="SansSerifSmall" + height="15" layout="topleft" left="110" name="name" text_color="white" top="9" - use_ellipses="false" - width="197" + use_ellipses="true" + width="193" word_wrap="false" /> <expandable_text follows="top|left|right" font="SansSerifSmall" - height="40" + height="55" layout="topleft" - left="110" + left="103" name="description" - top_pad="3" + top_pad="0" width="178" word_wrap="true" /> <button - follows="top|right" - height="16" - image_selected="BuyArrow_Press" - image_pressed="BuyArrow_Press" - image_unselected="BuyArrow_Press" + follows="right" + height="20" + image_overlay="ForwardArrow_Off" layout="topleft" + left_pad="5" + right="-8" name="info_chevron" - picture_style="true" - right="-7" - tab_stop="false" - top="27" - width="16" /> + top_delta="15" + width="20" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_edit_classified.xml b/indra/newview/skins/default/xui/en/panel_edit_classified.xml index 2f3277804f..b5760e977f 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_classified.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_classified.xml @@ -189,12 +189,12 @@ <combo_item name="mature_ci" value="Mature"> - Mature Content + Moderate Content </combo_item> <combo_item name="pg_ci" value="PG"> - PG Content + General Content </combo_item> </combo_box> <spinner diff --git a/indra/newview/skins/default/xui/en/panel_group_control_panel.xml b/indra/newview/skins/default/xui/en/panel_group_control_panel.xml index 41b210557e..889f29fc53 100644 --- a/indra/newview/skins/default/xui/en/panel_group_control_panel.xml +++ b/indra/newview/skins/default/xui/en/panel_group_control_panel.xml @@ -61,7 +61,6 @@ width="125"/> <button - enabled="false" bottom="10" follows="all" height="20" diff --git a/indra/newview/skins/default/xui/en/panel_group_general.xml b/indra/newview/skins/default/xui/en/panel_group_general.xml index 4c30db4034..043edd10e1 100644 --- a/indra/newview/skins/default/xui/en/panel_group_general.xml +++ b/indra/newview/skins/default/xui/en/panel_group_general.xml @@ -1,14 +1,12 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <panel follows="all" - height="378" + height="395" label="General" class="panel_group_general" layout="topleft" - left="0" - top="0" name="general_tab" - width="310"> + width="323"> <panel.string name="help_text"> The General tab contains general information about this group, a list of members, general Group Preferences and member options. @@ -32,7 +30,7 @@ Hover your mouse over the options for more help. max_length="511" name="charter" top="5" - width="305" + right="-1" word_wrap="true"> Group Charter </text_editor> @@ -41,12 +39,12 @@ Hover your mouse over the options for more help. draw_heading="true" follows="left|top" heading_height="20" - height="130" + height="156" layout="topleft" left="0" + right="-1" name="visible_members" - top_pad="2" - width="310"> + top_pad="2"> <name_list.columns label="Member" name="name" @@ -71,15 +69,15 @@ Hover your mouse over the options for more help. follows="left|top" height="20" layout="topleft" - left_delta="0" + left="5" + right="-5" name="active_title" tool_tip="Sets the title that appears in your avatar's name tag when this group is active." - top_pad="2" - width="300" /> + top_pad="2" /> <check_box height="16" font="SansSerifSmall" - label="Receive notices" + label="Receive group notices" layout="topleft" left="5" name="receive_notices" @@ -101,12 +99,12 @@ Hover your mouse over the options for more help. border="true" bg_alpha_color="FloaterUnfocusBorderColor" follows="left|top" - height="90" + height="88" layout="topleft" - left="5" + left="2" + right="-1" name="preferences_container" - top_pad="5" - width="300"> + top_pad="2"> <check_box follows="right|top" height="16" @@ -132,41 +130,43 @@ Hover your mouse over the options for more help. halign="left" height="16" increment="1" - label_width="20" + label_width="15" label="L$" layout="topleft" right="-10" max_val="99999" - left_pad="2" + left_pad="0" name="spin_enrollment_fee" tool_tip="New members must pay this fee to join the group when Enrollment Fee is checked." width="100" /> - <check_box - height="16" - initial_value="true" - label="Show in search" - layout="topleft" - left="10" - name="show_in_group_list" - tool_tip="Let people see this group in search results" - top_pad="4" - width="300" /> - <combo_box + <combo_box + follows="left|top" height="20" layout="topleft" - left_delta="0" + left="10" name="group_mature_check" - tool_tip="Sets whether your group information is considered mature" - top_pad="2" + tool_tip="Sets whether your group information is considered moderate" + top_pad="0" width="190"> <combo_box.item - label="PG Content" + label="General Content" name="pg" value="Not Mature" /> <combo_box.item - label="Mature Content" + label="Moderate Content" name="mature" value="Mature" /> </combo_box> + <check_box + follows="left|top" + height="16" + initial_value="true" + label="Show in search" + layout="topleft" + left="10" + name="show_in_group_list" + tool_tip="Let people see this group in search results" + top_pad="4" + width="300" /> </panel> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml index 0a5812882d..0a3fd1699f 100644 --- a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml +++ b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml @@ -76,7 +76,6 @@ visible="false" width="100" /> <button - enabled="false" bottom="10" height="20" label="Voice Controls" diff --git a/indra/newview/skins/default/xui/en/panel_landmarks.xml b/indra/newview/skins/default/xui/en/panel_landmarks.xml index 4b91dc6294..c52b0c83d0 100644 --- a/indra/newview/skins/default/xui/en/panel_landmarks.xml +++ b/indra/newview/skins/default/xui/en/panel_landmarks.xml @@ -6,6 +6,7 @@ layout="topleft" left="0" width="380" + help_topic="panel_landmarks" border="true" background_visible="true" bg_alpha_color="DkGray2" diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index a9a02e8fc7..efe26d3887 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -6,7 +6,7 @@ left="0" name="panel_login" top="600" - width="800"> + width="996"> <panel.string name="create_account_url"> http://join.secondlife.com/ @@ -27,128 +27,123 @@ border_visible="false" bottom="600" follows="all" - hide_loading="true" + hide_loading="true" left="0" name="login_html" start_url="" top="0" height="600" - width="800"/> + width="996" /> <panel follows="left|bottom|right" name="login_widgets" layout="topleft" - left="0" - top="0"> + top="519" + width="996" + height="80"> <text follows="left|bottom" - font="SansSerif" + font="SansSerifSmall" height="16" - left="32" + left="20" name="first_name_text" - top="530" - width="120"> - First Name: + top="20" + width="150"> + Name: </text> <line_editor follows="left|bottom" - font="SansSerif" handle_edit_keys_directly="true" - height="20" + height="22" + label="First" left_delta="0" max_length="31" name="first_name_edit" select_on_focus="true" tool_tip="[SECOND_LIFE] First Name" - top_pad="2" - width="120" /> - <text - follows="left|bottom" - font="SansSerif" - height="16" - left="164" - name="last_name_text" - top="530" - width="120"> - Last Name: - </text> + top_pad="0" + width="135" /> <line_editor follows="left|bottom" - font="SansSerif" handle_edit_keys_directly="true" - height="20" - left_delta="0" + height="22" + label="Last" + left_pad="8" max_length="31" name="last_name_edit" select_on_focus="true" tool_tip="[SECOND_LIFE] Last Name" - top_pad="2" - width="120" /> - <text + top_delta="0" + width="135" /> + <text follows="left|bottom" - font="SansSerif" - height="16" - left="296" + font="SansSerifSmall" + height="15" + left_pad="8" name="password_text" - top="530" - width="120"> + top="20" + width="150"> Password: </text> <line_editor follows="left|bottom" - font="SansSerif" handle_edit_keys_directly="true" - height="20" - left_delta="0" + height="22" + left="304" max_length="16" name="password_edit" select_on_focus="true" - top_pad="2" - width="120" /> + top_pad="1" + width="135" /> + <check_box + control_name="RememberPassword" + follows="left|bottom" + font="SansSerifSmall" + height="16" + label="Remember" + left_pad="20" + top="20" + name="remember_check" + width="150" /> <button follows="left|bottom" height="23" + image_unselected="PushButton_On" + image_selected="PushButton_On_Selected" label="Log In" - label_selected="Log In" + label_color="White" layout="topleft" - left="425" + left="462" name="connect_btn" - top="546" - width="100" /> - <combo_box - allow_text_entry="true" - follows="left|bottom" - height="23" - layout="topleft" - left_pad="5" - name="server_combo" - width="100" /> - <text - follows="left|bottom" - font="SansSerif" - height="16" - left="32" + top="35" + width="90" /> + <text + follows="right|bottom" + font="SansSerifSmall" + height="15" + halign="right" + left_pad="10" + right="-240" name="start_location_text" - top="576" - width="95"> - Start location: + top="20" + width="130"> + Starting location: </text> <combo_box allow_text_entry="true" control_name="LoginLocation" - follows="left|bottom" + follows="right|bottom" height="23" - left_pad="0" max_chars="128" + top_pad="0" name="start_location_combo" - top_delta="-2" - width="155"> + width="135"> <combo_box.item - label="My Last Location" + label="My last location" name="MyLastLocation" value="last" /> <combo_box.item - label="My Home" + label="My home" name="MyHome" value="home" /> <combo_box.item @@ -156,43 +151,49 @@ name="Typeregionname" value="" /> </combo_box> - <check_box - control_name="RememberPassword" - follows="left|bottom" - height="16" - label="Remember password" - left_pad="10" - name="remember_check" - top_delta="3" - width="138" /> + <combo_box + allow_text_entry="true" + font="SansSerifSmall" + follows="right|bottom" + height="23" + layout="topleft" + top_pad="2" + name="server_combo" + width="135" + visible="false" /> <text follows="right|bottom" + font="SansSerifSmall" + text_color="EmphasisColor" halign="right" height="16" - left="-210" + top="17" + left_pad="10" + right="-10" name="create_new_account_text" - top="539" - width="200"> - Create a new account + width="180"> + Sign up for account </text> <text follows="right|bottom" + font="SansSerifSmall" + text_color="EmphasisColor" halign="right" height="16" - left_delta="0" name="forgot_password_text" - top_pad="4" - width="200"> + top_pad="2" + width="180"> Forgot your name or password? </text> <text follows="right|bottom" + font="SansSerifSmall" halign="right" - height="16" - left="-310" + height="28" + top_pad="2" name="channel_text" - top="579" - width="300"> + width="180" + word_wrap="true"> [VERSION] </text> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml index 1c756e9472..94a54f08e4 100644 --- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml @@ -14,7 +14,7 @@ Things </panel.string> <filter_editor - text_pad_left="12" + text_pad_left="14" follows="left|top|right" font="SanSerif" height="20" diff --git a/indra/newview/skins/default/xui/en/panel_media_settings_general.xml b/indra/newview/skins/default/xui/en/panel_media_settings_general.xml index e00f654750..b82a435b41 100644 --- a/indra/newview/skins/default/xui/en/panel_media_settings_general.xml +++ b/indra/newview/skins/default/xui/en/panel_media_settings_general.xml @@ -10,17 +10,27 @@ name="Media Settings General" help_topic = "media_settings_general" width="365"> - - <text - bottom_delta="-17" - follows="top|left" - height="15" - left="10" + + <text + bottom_delta="-25" + follows="top|left" + height="15" + left="10" name="home_label"> Home URL: </text> + <text + visible="false" + bottom_delta="0" + follows="top|left" + height="15" + left_delta="64" + text_color="red" + name="home_fails_whitelist_label"> + (This URL does not pass the specified whitelist) + </text> <line_editor - bottom_delta="-21" + bottom_delta="-24" enabled="true" follows="left|top" font="SansSerif" @@ -221,12 +231,23 @@ width="50" /> <text bottom_delta="0" follows="top|left" height="15" left_delta="60" name="X_label"> - X + X </text> - <spinner bottom_delta="0" - decimal_digits="0" enabled="true" follows="left|top" height="16" - increment="1" initial_val="256" label="" label_width="0" - left_delta="20" max_val="2048" min_val="0" mouse_opaque="true" - name="height_pixels" width="50" /> + <spinner + bottom_delta="0" + decimal_digits="0" + enabled="true" + follows="left|top" + height="16" + increment="1" + initial_val="256" + label="" + label_width="0" + left_delta="20" + max_val="2048" + min_val="0" + mouse_opaque="true" + name="height_pixels" + width="50" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_media_settings_security.xml b/indra/newview/skins/default/xui/en/panel_media_settings_security.xml index a26f74844e..7d9350b45f 100644 --- a/indra/newview/skins/default/xui/en/panel_media_settings_security.xml +++ b/indra/newview/skins/default/xui/en/panel_media_settings_security.xml @@ -30,8 +30,28 @@ name="whitelist" width="315" enabled="true" /> + <icon + bottom_delta="-23" + right="-35" + width="16" + height="16" + image_name="parcel_color_EXP" + mouse_opaque="true" + follows="top|left" + name="parcel_color_EXP" + /> + <text + visible="true" + follows="top|left" + height="15" + left="30" + bottom_delta="0" + text_color="0.4 0.4 0.4 1.0" + name="home_url_fails_some_items_in_whitelist"> + Entries that the home URL fails against are marked: + </text> <button - bottom_delta="-30" + bottom_delta="-36" follows="top|left" height="20" label="Add" @@ -54,4 +74,17 @@ <button.commit_callback function="Media.whitelistDelete"/> </button> + <text + visible="true" + bottom_delta="-75" + follows="top|left" + height="40" + left="30" + text_color="0.6 0.0 0.0 1.0" + name="home_url_fails_whitelist"> +Warning: the home URL specified in the General tab +fails to pass this whitelist. It has been disabled +until a valid entry has been added. + </text> + </panel> diff --git a/indra/newview/skins/default/xui/en/panel_my_profile.xml b/indra/newview/skins/default/xui/en/panel_my_profile.xml index fe3e010cf9..3c87331199 100644 --- a/indra/newview/skins/default/xui/en/panel_my_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_my_profile.xml @@ -416,6 +416,7 @@ left="10" label="Edit Profile" name="edit_profile_btn" + tool_tip="Edit your personal information" width="130" /> <button follows="bottom|right" @@ -423,6 +424,7 @@ label="Edit Appearance" left_pad="10" name="edit_appearance_btn" + tool_tip="Create/edit your appearance: physical data, clothes and etc." right="-10" width="130" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml index bf33b752d9..e8e4a9dbb2 100644 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -153,8 +153,16 @@ layout="topleft" left="0" name="favorite" - image_drag_indication="Arrow_Down" - chevron_button_tool_tip="Show more of My Favorites" - bottom="62" - width="590" /> + image_drag_indication="arrow_down.tga" + bottom="62" + width="590"> + <chevron_button name=">>" + image_unselected="TabIcon_Close_Off" + image_selected="TabIcon_Close_Off" + tab_stop="false" + follows="left|bottom" + tool_tip="Show more of My Favorites" + width="15" + height="15"/> + </favorites_bar> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml index d805209bf5..51997a2813 100644 --- a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml @@ -17,7 +17,7 @@ <accordion_tab layout="topleft" name="tab_outfits" - title="Outfits bar"> + title="Outfits"> <inventory_panel allow_multi_select="true" border="true" @@ -33,7 +33,7 @@ <accordion_tab layout="topleft" name="tab_cof" - title="Current Outfit bar"> + title="Current Outfit"> <inventory_panel allow_multi_select="true" border="true" diff --git a/indra/newview/skins/default/xui/en/panel_picks.xml b/indra/newview/skins/default/xui/en/panel_picks.xml index ca84c9147b..52bc72fe86 100644 --- a/indra/newview/skins/default/xui/en/panel_picks.xml +++ b/indra/newview/skins/default/xui/en/panel_picks.xml @@ -27,6 +27,7 @@ There are no picks/classifieds here </text> <accordion + fit_parent="true" follows="all" height="465" layout="topleft" @@ -105,7 +106,7 @@ layout="topleft" left_pad="15" name="new_btn" - tool_tip="Create new pick at current location" + tool_tip="Create new pick or classified at current location" top="5" width="18" /> <button @@ -137,6 +138,7 @@ left="5" name="info_btn" tab_stop="false" + tool_tip="Show pic information" top="0" width="55" /> <button @@ -148,6 +150,7 @@ left_pad="5" name="teleport_btn" tab_stop="false" + tool_tip="Teleport to the corresponding area" top="0" width="77" /> <button @@ -159,18 +162,8 @@ left_pad="5" name="show_on_map_btn" tab_stop="false" + tool_tip="Show corresponding area on the world map" top="0" width="50" /> - <button - enabled="false" - follows="bottom|right" - height="25" - label="▼" - layout="topleft" - name="overflow_btn" - right="-10" - tab_stop="false" - top="0" - width="30" /> </panel> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_place_profile.xml b/indra/newview/skins/default/xui/en/panel_place_profile.xml index 9ab5c6b4f7..3f5da66dce 100644 --- a/indra/newview/skins/default/xui/en/panel_place_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_place_profile.xml @@ -602,7 +602,7 @@ layout="topleft" left_pad="10" name="region_rating" - value="Explicit" + value="Adult" width="159" /> <text follows="left|top" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index 0ac0521b10..6a61953319 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -319,7 +319,6 @@ Avatars: bottom_delta="0" enabled_control="EnableVoiceChat" follows="left" - font="SansSerif" halign="center" height="20" label="Middle Mouse Button" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml index fac0d5c60f..3aa5d3fae4 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -318,4 +318,37 @@ name="plain_text_chat_history" top_pad="5" width="400" /> + <text + left="30" + height="20" + width="300" + top_pad="20"> + Show IMs in: + </text> + <radio_group + height="30" + layout="topleft" + left="30" + control_name="ChatWindow" + name="chat_window" + top_pad="10" + tool_tip="Show chat in multiple windows(by default) or in one multi-tabbed window (requires restart)" + width="331"> + <radio_item + height="16" + label="Multiple windows" + layout="topleft" + left="0" + name="radio" + top="0" + width="150" /> + <radio_item + height="16" + label="One window" + layout="topleft" + left_delta="145" + name="radio2" + top_delta="0" + width="150" /> + </radio_group> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml index 6bb937e3c6..ee9bfbae93 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -143,15 +143,15 @@ top_pad="-10" width="170"> <combo_box.item - label="PG, Mature and Adult" + label="General, Moderate, Adult" name="Desired_Adult" value="42" /> <combo_box.item - label="PG and Mature" + label="General and Moderate" name="Desired_Mature" value="21" /> <combo_box.item - label="PG" + label="General" name="Desired_PG" value="13" /> </combo_box> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml index 23832ba120..29e9b476eb 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml @@ -78,7 +78,7 @@ top_pad="10" width="350" /> <check_box - control_name="AutoPlayMedia" + control_name="ParcelMediaAutoPlayEnable" height="16" label="Allow Media Autoplay" layout="topleft" @@ -86,15 +86,6 @@ name="autoplay_enabled" top_pad="10" width="350" /> - <check_box - control_name="ParcelMediaAutoPlayEnable" - height="16" - label="Automatically Play Parcel Media" - layout="topleft" - left="30" - name="parcel_autoplay_enabled" - top_pad="10" - width="350" /> <text type="string" length="1" diff --git a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml index af4c01185a..e21de31498 100644 --- a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml +++ b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml @@ -3,28 +3,33 @@ follows="left|right|top|bottom" name="MediaControls" background_visible="false" - height="192" + height="200" layout="topleft" mouse_opaque="false" width="800"> <string name="control_background_image_name">Inspector_Background</string> <string name="skip_step">0.2</string> + <string name="min_width">400</string> + <string name="min_height">120</string> + <string name="zoom_near_padding">1.0</string> + <string name="zoom_medium_padding">1.25</string> + <string name="zoom_far_padding">1.5</string> <panel name="media_region" - bottom="125" + height="100" follows="left|right|top|bottom" layout="topleft" mouse_opaque="false" - top="20" /> + top="0" /> <layout_stack name="media_controls" follows="left|right" animate="false" - height="32" + height="75" layout="topleft" left="0" orientation="horizontal" - top="128"> + top="100"> <!-- outer layout_panels center the inner one --> <layout_panel name="left_bookend" @@ -234,20 +239,6 @@ layout="topleft" width="190" min_width="90"> - <!-- - RE-ENABLE THIS WHEN WE HAVE A HISTORY DROP-DOWN AGAIN - -<combo_box -name="media_address_url" -allow_text_entry="true" -height="22" -layout="topleft" -max_chars="1024" -tool_tip = "Media URL" -<combo_box.commit_callback -function="MediaCtrl.CommitURL" /> -</combo_box> - --> <line_editor name="media_address_url" follows="left|right" @@ -304,17 +295,18 @@ function="MediaCtrl.CommitURL" /> user_resize="false" follows="left|right|top|bottom" layout="topleft" + height="16" min_width="100" width="200"> <slider_bar name="media_play_slider" follows="left|right|top" - height="22" - increment="0.05" + height="20" + bottom="88" + increment="0.01" initial_value="0.5" layout="topleft" tool_tip="Movie play progress" - top="8" min_width="100" width="200"> <slider_bar.commit_callback @@ -375,7 +367,8 @@ function="MediaCtrl.CommitURL" /> auto_resize="false" user_resize="false" layout="topleft" - height="22" + top="-50" + height="72" min_width="22" width="22"> <!-- Note: this is not quite right either...the mute button is not the --> @@ -393,138 +386,30 @@ function="MediaCtrl.CommitURL" /> layout="topleft" scale_image="false" tool_tip="Mute This Media" - top_delta="18" + top="118" min_width="22" width="22" > <button.commit_callback function="MediaCtrl.ToggleMute" /> + <button.mouseenter_callback + function="MediaCtrl.ShowVolumeSlider" /> </button> - </layout_panel> - <!-- We do not have a design yet for "volume", so this is a temporary --> - <!-- solution. See DEV-42827. --> - <layout_panel - name="volume_up" - auto_resize="false" - user_resize="false" - layout="topleft" - min_width="14" - height="14" - width="14"> - <button - image_overlay="media_btn_scrollup.png" - image_disabled="PushButton_Disabled" - image_disabled_selected="PushButton_Disabled" - image_selected="PushButton_Selected" - image_unselected="PushButton_Off" - hover_glow_amount="0.15" - top="-5" - height="14" - layout="topleft" - tool_tip="Volume up" - scale_image="true" - min_width="14" - width="14" > - <button.commit_callback - function="MediaCtrl.CommitVolumeUp" /> - </button> - </layout_panel> - <layout_panel - name="volume_down" - auto_resize="false" - user_resize="false" - layout="topleft" - min_width="14" - height="14" - width="14"> - <button - image_overlay="media_btn_scrolldown.png" - image_disabled="PushButton_Disabled" - image_disabled_selected="PushButton_Disabled" - image_selected="PushButton_Selected" - image_unselected="PushButton_Off" - hover_glow_amount="0.15" - layout="topleft" - tool_tip="Volume down" - scale_image="true" - top="-5" - height="14" - min_width="14" - width="14"> - <button.commit_callback - function="MediaCtrl.CommitVolumeDown" /> - </button> - </layout_panel> - <!-- Scroll pad --> - <!-- This was removed from the design, but is still here because it is --> - <!-- complex, and recreating it would be hard. In case the design --> - <!-- changes, here it lies: --> - <!-- - <layout_panel - name="media_panel_scroll" - auto_resize="false" - user_resize="false" - height="32" - follows="left|right|top|bottom" - layout="topleft" - min_width="32" - width="32"> - <icon - height="32" - image_name="media_panel_scrollbg.png" - layout="topleft" - top="0" - min_width="32" - width="32" /> - <button - name="scrollup" - height="8" - image_selected="media_btn_scrollup.png" - image_unselected="media_btn_scrollup.png" - layout="topleft" - tool_tip="Scroll up" - scale_image="false" - left="12" - top_delta="4" - min_width="8" - width="8" /> - <button - name="scrollleft" - height="8" - image_selected="media_btn_scrollleft.png" - image_unselected="media_btn_scrollleft.png" - layout="topleft" - left="3" - tool_tip="Scroll left" - scale_image="false" - top="12" - min_width="8" - width="8" /> - <button - name="scrollright" - height="8" - image_selected="media_btn_scrollright.png" - image_unselected="media_btn_scrollright.png" - layout="topleft" - left_pad="9" - tool_tip="Scroll right" - scale_image="false" - top_delta="0" - min_width="8" - width="8" /> - <button - name="scrolldown" - height="8" - image_selected="media_btn_scrolldown.png" - image_unselected="media_btn_scrolldown.png" + <slider + orientation="vertical" + left="0" + top="-2" + height="50" layout="topleft" - left="12" - tool_tip="Scroll down" - scale_image="false" - top="20" - min_width="8" - width="8" /> + increment="0.01" + initial_value="0.5" + name="volume_slider" + tool_tip="Media Volume" + show_text="false" + volume="true"> + <slider.commit_callback + function="MediaCtrl.Volume"/> + </slider> </layout_panel> - --> <panel height="28" layout="topleft" @@ -619,12 +504,12 @@ function="MediaCtrl.CommitURL" /> </layout_stack> <layout_stack follows="left|right|bottom" - height="32" + height="20" layout="topleft" animate="false" left="0" orientation="horizontal" - top="150"> + top="170"> <!-- outer layout_panels center the inner one --> <layout_panel width="0" @@ -632,7 +517,7 @@ function="MediaCtrl.CommitURL" /> user_resize="false" /> <panel name="media_progress_indicator" - height="22" + height="20" layout="topleft" left="0" top="0" @@ -644,6 +529,7 @@ function="MediaCtrl.CommitURL" /> name="media_progress_bar" color_bar="1 1 1 0.96" follows="left|right|top" + top="5" height="8" layout="topleft" left="0" diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml index 947bb67152..6be203ef9c 100644 --- a/indra/newview/skins/default/xui/en/panel_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_profile.xml @@ -287,7 +287,7 @@ mouse_opaque="false" name="add_friend" top="5" - width="76" /> + width="77" /> <button follows="bottom|left" height="19" @@ -296,7 +296,7 @@ name="im" top="5" left_pad="5" - width="31" /> + width="33" /> <button follows="bottom|left" height="19" @@ -315,7 +315,7 @@ name="show_on_map_btn" top="5" left_pad="5" - width="42" /> + width="44" /> <button follows="bottom|left" height="19" @@ -324,7 +324,7 @@ name="teleport" left_pad="5" top="5" - width="64" /> + width="67" /> <button follows="bottom|right" height="19" diff --git a/indra/newview/skins/default/xui/en/panel_region_general.xml b/indra/newview/skins/default/xui/en/panel_region_general.xml index 42c6319699..79d8f3a0ee 100644 --- a/indra/newview/skins/default/xui/en/panel_region_general.xml +++ b/indra/newview/skins/default/xui/en/panel_region_general.xml @@ -171,7 +171,7 @@ </text> <combo_box height="20" - label="Mature" + label="Moderate" layout="topleft" left_delta="100" name="access_combo" @@ -182,11 +182,11 @@ name="Adult" value="42" /> <combo_box.item - label="Mature" + label="Moderate" name="Mature" value="21" /> <combo_box.item - label="PG" + label="General" name="PG" value="13" /> </combo_box> diff --git a/indra/newview/skins/default/xui/en/panel_region_general_layout.xml b/indra/newview/skins/default/xui/en/panel_region_general_layout.xml index bffd84877f..525c5aa8e7 100644 --- a/indra/newview/skins/default/xui/en/panel_region_general_layout.xml +++ b/indra/newview/skins/default/xui/en/panel_region_general_layout.xml @@ -171,7 +171,7 @@ </text> <combo_box height="20" - label="Mature" + label="Moderate" layout="topleft" left_delta="100" name="access_combo" @@ -182,11 +182,11 @@ name="Adult" value="42" /> <combo_box.item - label="Mature" + label="Moderate" name="Mature" value="21" /> <combo_box.item - label="PG" + label="General" name="PG" value="13" /> </combo_box> diff --git a/indra/newview/skins/default/xui/en/panel_side_tray.xml b/indra/newview/skins/default/xui/en/panel_side_tray.xml index 95242a9639..63b7112c17 100644 --- a/indra/newview/skins/default/xui/en/panel_side_tray.xml +++ b/indra/newview/skins/default/xui/en/panel_side_tray.xml @@ -23,6 +23,7 @@ background_visible="true" > <panel + class="panel_sidetray_home" name="panel_home" filename="panel_sidetray_home_tab.xml" label="home" diff --git a/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml b/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml index 9839075862..4b841b0a09 100644 --- a/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml +++ b/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml @@ -1,265 +1,92 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<!-- Part of side tray, see that XML file for panel config --> +<!-- the web-based Home panel of the side tray --> <panel follows="all" - height="560" + height="570" + min_height="350" label="home_tab" + help_topic="sidetray_home" layout="topleft" + top="0" + left="0" name="home_tab" width="333"> - <scroll_container - color="DkGray" + <layout_stack follows="all" + height="550" layout="topleft" - left="0" - name="profile_scroll" - opaque="true" - height="560" - width="333" - top="0"> - <panel - background_visible="true" - height="560" - layout="topleft" - name="profile_scroll_panel" - top="0" - left="0" - width="311"> - <panel - background_visible="true" - bg_alpha_color="DkGray2" - class="panel_sidetray_home_info" - follows="left|top|right" - height="90" - layout="topleft" - left="15" - top="17" - name="sidebar_people" - width="303"> - <text - follows="left|right|top" - font="SansSerifBigBold" - height="30" - layout="topleft" - left="10" - mouse_opaque="false" - name="tab_name" - text_color="EmphasisColor" - top="10" - value="People" - width="200" - word_wrap="true" /> - <icon - follows="top|right" - height="20" - layout="topleft" - name="tab_icon" - right="-10" - top="10" - image_name="TabIcon_People_Selected" - width="20" /> - <text - follows="left|right|bottom" - height="90" - layout="topleft" - left="10" - mouse_opaque="false" - name="tab_description" - right="-10" - text_color="white" - top="40" - word_wrap="true"> - Find your friends, your groups, contacts and people nearby. - </text> - </panel> - <panel - background_visible="true" - bg_alpha_color="DkGray2" - class="panel_sidetray_home_info" - follows="left|top|right" - height="90" - layout="topleft" - left="15" - top_pad="15" - name="sidebar_places" - width="303"> - <text - follows="left|right|top" - font="SansSerifBigBold" - height="30" - layout="topleft" - left="10" - mouse_opaque="false" - name="tab_name" - text_color="EmphasisColor" - top="10" - value="Places" - width="200" - word_wrap="true" /> - <icon - follows="top|right" - height="20" - layout="topleft" - name="tab_icon" - right="-10" - top="10" - width="20" - image_name="TabIcon_Places_Selected"/> - <text - follows="all" - height="90" - layout="topleft" - left="10" - mouse_opaque="false" - name="tab_description" - right="-10" - text_color="white" - top="40" - word_wrap="true"> - Find places to go and places you've visited before. - </text> - </panel> - <panel - background_visible="true" - bg_alpha_color="DkGray2" - class="panel_sidetray_home_info" - follows="left|top|right" - height="90" - layout="topleft" - left="15" - top_pad="15" - name="sidebar_me" - width="303"> - <text - follows="left|right|top" - font="SansSerifBigBold" - height="30" - layout="topleft" - left="10" - mouse_opaque="false" - name="tab_name" - text_color="EmphasisColor" - top="10" - value="My Profile" - width="200" - word_wrap="true" /> - <icon - follows="top|right" - height="20" - layout="topleft" - name="tab_icon" - right="-10" - top="10" - width="20" - image_name="TabIcon_Me_Selected"/> - <text - follows="all" - height="90" - layout="topleft" - left="10" - mouse_opaque="false" - name="tab_description" - right="-10" - text_color="white" - top="40" - word_wrap="true"> - Edit your public profile. - </text> - </panel> - <panel - background_visible="true" - bg_alpha_color="DkGray2" - class="panel_sidetray_home_info" - follows="left|top|right" - height="90" + left="10" + name="stack" + top_pad="10" + width="313"> + <layout_panel + auto_resize="false" + height="20" layout="topleft" - left="15" - top_pad="15" - name="sidebar_appearance" - width="303"> - <text - follows="left|right|top" - font="SansSerifBigBold" - height="30" - layout="topleft" - left="10" - mouse_opaque="false" - name="tab_name" - text_color="EmphasisColor" - top="10" - value="My Appearance" - width="200" - word_wrap="true" /> - <icon - follows="top|right" - height="20" - layout="topleft" - name="tab_icon" - right="-10" - top="10" - width="20" - image_name="TabIcon_Appearance_Selected"/> - <text - follows="all" - height="90" - layout="topleft" - left="10" - mouse_opaque="false" - name="tab_description" - right="-10" - text_color="white" - top="40" - word_wrap="true"> - Change your appearance and current look. - </text> - </panel> - <panel - background_visible="true" - bg_alpha_color="DkGray2" - class="panel_sidetray_home_info" - follows="left|top|right" - height="90" + left="0" + name="nav_controls" + top="0" + user_resize="false" + width="313"> + <button + follows="left|top" + enabled="false" + height="20" + label="Back" + layout="topleft" + tab_stop="false" + left="0" + name="back" + top="0" + width="70"> + <button.commit_callback + function="MediaBrowser.Back" /> + </button> + <button + follows="left|top" + height="20" + enabled="false" + label="Forward" + layout="topleft" + tab_stop="false" + left_pad="3" + name="forward" + top_delta="0" + width="70"> + <button.commit_callback + function="MediaBrowser.Forward" /> + </button> + <button + follows="left|top" + height="20" + label="Home" + layout="topleft" + tab_stop="false" + left_pad="2" + name="home" + top_delta="0" + width="70"> + <button.commit_callback + function="MediaBrowser.Home" /> + </button> + </layout_panel> + <layout_panel + height="530" layout="topleft" - left="15" - top_pad="15" - name="sidebar_inventory" - width="303"> - <text - follows="left|right|top" - font="SansSerifBigBold" - height="30" - layout="topleft" - left="10" - mouse_opaque="false" - name="tab_name" - text_color="EmphasisColor" - top="10" - value="My Inventory" - width="200" - word_wrap="true" /> - <icon - follows="top|right" - height="20" - layout="topleft" - name="tab_icon" - right="-10" - top="10" - width="20" - image_name="TabIcon_Things_Selected"/> - <text - follows="all" - height="90" - layout="topleft" - left="10" - mouse_opaque="false" - name="tab_description" - right="-10" - text_color="white" - top="40" - word_wrap="true"> - Browse your inventory. - </text> - </panel> - </panel> - </scroll_container> + left_delta="0" + name="browser_layout" + top_delta="0" + width="313"> + <web_browser + border_visible="false" + follows="all" + height="530" + layout="topleft" + left="0" + name="browser" + start_url="data:text/html,%3Chtml%3E%3Cbody bgcolor=%22#2A2A2A%22 text=%22eeeeee%22%3E %3Ch3%3E %0D%0A%0D%0ALoading... %3C/h3%3E %3C/body%3E%3C/html%3E" + top="0" + width="313" /> + </layout_panel> + </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml index 65bc48265d..5dcee9e965 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -42,28 +42,27 @@ <button auto_resize="true" halign="right" - follows="right|bottom" + follows="right|top" image_selected="BuyArrow_Over" image_unselected="BuyArrow_Off" image_pressed="BuyArrow_Press" height="16" - left="-200" + right="-120" name="buycurrency" pad_right="20px" tool_tip="My Balance: Click to buy more L$" - top="1" + top="0" width="90" /> <text type="string" - length="1" font="SansSerifSmall" text_readonly_color="TimeTextColor" follows="right|bottom" halign="right" height="16" - top="5" + top="4" layout="topleft" - left_pad="-5" + left_pad="-7" name="TimeText" text_color="TimeTextColor" tool_tip="Current time (Pacific)" @@ -76,11 +75,22 @@ image_selected="parcel_drk_VoiceNo" image_unselected="parcel_drk_Voice" is_toggle="true" - left_pad="5" + left_pad="18" top="1" name="volume_btn" tool_tip="Global Volume Control" width="16" /> + <panel + class="panel_volume_pulldown" + follows="all" + height="533" + layout="topleft" + left="0" + name="volume_pulldown" + top="5" + visible="false" + width="313" /> + <text enabled="true" follows="right|bottom" diff --git a/indra/newview/skins/default/xui/en/panel_sys_well_item.xml b/indra/newview/skins/default/xui/en/panel_sys_well_item.xml index ccb57b6552..2822f7b841 100644 --- a/indra/newview/skins/default/xui/en/panel_sys_well_item.xml +++ b/indra/newview/skins/default/xui/en/panel_sys_well_item.xml @@ -14,6 +14,7 @@ background_visible="true" bg_alpha_color="0.0 0.0 0.0 0.0" > <text + clip_partial="true" top="2" left="10" width="267" diff --git a/indra/newview/skins/default/xui/en/panel_teleport_history.xml b/indra/newview/skins/default/xui/en/panel_teleport_history.xml index 01204ba779..32fc9fce01 100644 --- a/indra/newview/skins/default/xui/en/panel_teleport_history.xml +++ b/indra/newview/skins/default/xui/en/panel_teleport_history.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <panel name="Teleport History" bottom="0" height="326" left="0" width="380" + help_topic="panel_teleport_history" border="true" follows="left|top|right|bottom"> <accordion follows="left|top|right|bottom" diff --git a/indra/newview/skins/default/xui/en/panel_toast.xml b/indra/newview/skins/default/xui/en/panel_toast.xml index f16329f8d7..6479fc91ca 100644 --- a/indra/newview/skins/default/xui/en/panel_toast.xml +++ b/indra/newview/skins/default/xui/en/panel_toast.xml @@ -5,30 +5,31 @@ <floater legacy_header_height="18" - name="toast" - title="" - visible="false" - layout="topleft" - height="40" - width="305" - left="0" - top="0" - follows="right|bottom" - bg_opaque_image="Toast_Background" - bg_alpha_image="Toast_Background" - can_minimize="false" - can_tear_off="false" - can_resize="false" - can_drag_on_left="false" - can_close="false" - can_dock="false" - border_visible = "false" - border_drop_shadow_visible = "false" - drop_shadow_visible = "false" - border = "false" - > + name="toast" + title="" + visible="false" + layout="topleft" + height="40" + width="305" + left="0" + top="0" + follows="right|bottom" + bg_opaque_image="Toast_Background" + bg_alpha_image="Toast_Background" + can_minimize="false" + can_tear_off="false" + can_resize="false" + can_drag_on_left="false" + can_close="false" + can_dock="false" + border_visible = "false" + border_drop_shadow_visible = "false" + drop_shadow_visible = "false" + border = "false" +> <!-- Don't remove this wiget! It is needed for Overflow and Start-Up toasts!--> <text + clip_partial="true" visible="false" follows="left|top|right|bottom" font="SansSerifBold" @@ -39,6 +40,7 @@ word_wrap="true" text_color="white" top="5" + use_ellipses="true" width="260"> Toast text; </text> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 518ec3aea7..883215a269 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -267,10 +267,11 @@ <string name="ChangePermissions">Change its permissions</string> <string name="TrackYourCamera">Track your camera</string> <string name="ControlYourCamera">Control your camera</string> + <string name="NotConnected">Not Connected</string> <!-- Sim Access labels --> - <string name="SIM_ACCESS_PG">PG</string> - <string name="SIM_ACCESS_MATURE">Mature</string> + <string name="SIM_ACCESS_PG">General</string> + <string name="SIM_ACCESS_MATURE">Moderate</string> <string name="SIM_ACCESS_ADULT">Adult</string> <string name="SIM_ACCESS_DOWN">Offline</string> <string name="SIM_ACCESS_MIN">Unknown</string> @@ -1819,6 +1820,9 @@ this texture in your inventory <string name="LoadingContents">Loading contents...</string> <string name="NoContents">No contents</string> <string name="WornOnAttachmentPoint" value=" (worn on [ATTACHMENT_POINT])" /> + <!-- Inventory permissions --> + <string name="PermYes">Yes</string> + <string name="PermNo">No</string> <!-- Gestures labels --> <!-- use value="" because they have preceding spaces --> @@ -2261,22 +2265,17 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="Attached">Attached</string> <string name="Attached Earlobes">Attached Earlobes</string> -<string name="Back Bangs">Back Bangs</string> -<string name="Back Bangs Down">Back Bangs Down</string> -<string name="Back Bangs Up">Back Bangs Up</string> + <string name="Back Fringe">Back Fringe</string> -<string name="Back Hair">Back Hair</string> -<string name="Back Hair Down">Back Hair Down</string> -<string name="Back Hair Up">Back Hair Up</string> + <string name="Baggy">Baggy</string> <string name="Bangs">Bangs</string> -<string name="Bangs Down">Bangs Down</string> -<string name="Bangs Up">Bangs Up</string> + <string name="Beady Eyes">Beady Eyes</string> <string name="Belly Size">Belly Size</string> <string name="Big">Big</string> <string name="Big Butt">Big Butt</string> -<string name="Big Eyeball">Big Eyeball</string> + <string name="Big Hair Back">Big Hair: Back</string> <string name="Big Hair Front">Big Hair: Front</string> <string name="Big Hair Top">Big Hair: Top</string> @@ -2346,20 +2345,20 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="Corner Down">Corner Down</string> -<string name="Corner Normal">Corner Normal</string> + <string name="Corner Up">Corner Up</string> <string name="Creased">Creased</string> <string name="Crooked Nose">Crooked Nose</string> -<string name="Cropped Hair">Cropped Hair</string> + <string name="Cuff Flare">Cuff Flare</string> <string name="Dark">Dark</string> <string name="Dark Green">Dark Green</string> <string name="Darker">Darker</string> <string name="Deep">Deep</string> <string name="Default Heels">Default Heels</string> -<string name="Default Toe">Default Toe</string> + <string name="Dense">Dense</string> -<string name="Dense hair">Dense hair</string> + <string name="Double Chin">Double Chin</string> <string name="Downturned">Downturned</string> <string name="Duffle Bag">Duffle Bag</string> @@ -2375,7 +2374,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="Eye Pop">Eye Pop</string> <string name="Eye Size">Eye Size</string> <string name="Eye Spacing">Eye Spacing</string> -<string name="Eyeball Size">Eyeball Size</string> + <string name="Eyebrow Arc">Eyebrow Arc</string> <string name="Eyebrow Density">Eyebrow Density</string> @@ -2386,27 +2385,22 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="Eyelash Length">Eyelash Length</string> <string name="Eyeliner">Eyeliner</string> <string name="Eyeliner Color">Eyeliner Color</string> -<string name="Eyes Back">Eyes Back</string> + <string name="Eyes Bugged">Eyes Bugged</string> -<string name="Eyes Forward">Eyes Forward</string> -<string name="Eyes Long Head">Eyes Long Head</string> + + <string name="Eyes Shear Left Up">Eyes Shear Left Up</string> <string name="Eyes Shear Right Up">Eyes Shear Right Up</string> -<string name="Eyes Short Head">Eyes Short Head</string> -<string name="Eyes Spread">Eyes Spread</string> -<string name="Eyes Sunken">Eyes Sunken</string> -<string name="Eyes Together">Eyes Together</string> + + + + <string name="Face Shear">Face Shear</string> <string name="Facial Definition">Facial Definition</string> <string name="Far Set Eyes">Far Set Eyes</string> -<string name="Fat">Fat</string> -<string name="Fat Head">Fat Head</string> + <string name="Fat Lips">Fat Lips</string> -<string name="Fat Lower">Fat Lower</string> -<string name="Fat Lower Lip">Fat Lower Lip</string> -<string name="Fat Torso">Fat Torso</string> -<string name="Fat Upper">Fat Upper</string> -<string name="Fat Upper Lip">Fat Upper Lip</string> + <string name="Female">Female</string> <string name="Fingerless">Fingerless</string> <string name="Fingers">Fingers</string> @@ -2419,12 +2413,9 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="Forehead Angle">Forehead Angle</string> <string name="Forehead Heavy">Forehead Heavy</string> <string name="Freckles">Freckles</string> -<string name="Front Bangs Down">Front Bangs Down</string> -<string name="Front Bangs Up">Front Bangs Up</string> + <string name="Front Fringe">Front Fringe</string> -<string name="Front Hair">Front Hair</string> -<string name="Front Hair Down">Front Hair Down</string> -<string name="Front Hair Up">Front Hair Up</string> + <string name="Full Back">Full Back</string> <string name="Full Eyeliner">Full Eyeliner</string> <string name="Full Front">Full Front</string> @@ -2523,7 +2514,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="Long Ponytail">Long Ponytail</string> <string name="Long Torso">Long Torso</string> <string name="Long arms">Long arms</string> -<string name="Longcuffs">Longcuffs</string> + <string name="Loose Pants">Loose Pants</string> <string name="Loose Shirt">Loose Shirt</string> @@ -2583,7 +2574,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="No Blush">No Blush</string> <string name="No Eyeliner">No Eyeliner</string> <string name="No Eyeshadow">No Eyeshadow</string> -<string name="No Heels">No Heels</string> + <string name="No Lipgloss">No Lipgloss</string> <string name="No Lipstick">No Lipstick</string> <string name="No Part">No Part</string> @@ -2604,7 +2595,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="Nostril Division">Nostril Division</string> <string name="Nostril Width">Nostril Width</string> -<string name="Old">Old</string> + <string name="Opaque">Opaque</string> <string name="Open">Open</string> <string name="Open Back">Open Back</string> @@ -2641,7 +2632,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="Platform Width">Platform Width</string> <string name="Pointy">Pointy</string> <string name="Pointy Heels">Pointy Heels</string> -<string name="Pointy Toe">Pointy Toe</string> + <string name="Ponytail">Ponytail</string> <string name="Poofy Skirt">Poofy Skirt</string> <string name="Pop Left Eye">Pop Left Eye</string> @@ -2650,30 +2641,30 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="Puffy Eyelids">Puffy Eyelids</string> <string name="Rainbow Color">Rainbow Color</string> <string name="Red Hair">Red Hair</string> -<string name="Red Skin">Red Skin</string> + <string name="Regular">Regular</string> -<string name="Regular Muscles">Regular Muscles</string> + <string name="Right Part">Right Part</string> <string name="Rosy Complexion">Rosy Complexion</string> <string name="Round">Round</string> -<string name="Round Forehead">Round Forehead</string> + <string name="Ruddiness">Ruddiness</string> <string name="Ruddy">Ruddy</string> <string name="Rumpled Hair">Rumpled Hair</string> <string name="Saddle Bags">Saddle Bags</string> -<string name="Saddlebags">Saddlebags</string> -<string name="Scrawny">Scrawny</string> + + <string name="Scrawny Leg">Scrawny Leg</string> <string name="Separate">Separate</string> -<string name="Shading">Shading</string> -<string name="Shadow hair">Shadow hair</string> + + <string name="Shallow">Shallow</string> <string name="Shear Back">Shear Back</string> <string name="Shear Face">Shear Face</string> <string name="Shear Front">Shear Front</string> -<string name="Shear Left">Shear Left</string> + <string name="Shear Left Up">Shear Left Up</string> -<string name="Shear Right">Shear Right</string> + <string name="Shear Right Up">Shear Right Up</string> <string name="Sheared Back">Sheared Back</string> <string name="Sheared Front">Sheared Front</string> @@ -2697,16 +2688,14 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="Short Torso">Short Torso</string> <string name="Short hips">Short hips</string> <string name="Shoulders">Shoulders</string> -<string name="Side Bangs">Side Bangs</string> -<string name="Side Bangs Down">Side Bangs Down</string> -<string name="Side Bangs Up">Side Bangs Up</string> + <string name="Side Fringe">Side Fringe</string> <string name="Sideburns">Sideburns</string> <string name="Sides Hair">Sides Hair</string> <string name="Sides Hair Down">Sides Hair Down</string> <string name="Sides Hair Up">Sides Hair Up</string> -<string name="Skinny">Skinny</string> + <string name="Skinny Neck">Skinny Neck</string> <string name="Skirt Fit">Skirt Fit</string> <string name="Skirt Length">Skirt Length</string> @@ -2727,7 +2716,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="Smooth Hair">Smooth Hair</string> <string name="Socks Length">Socks Length</string> -<string name="Some">Some</string> + <string name="Soulpatch">Soulpatch</string> <string name="Sparse">Sparse</string> @@ -2735,24 +2724,21 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="Square">Square</string> <string name="Square Toe">Square Toe</string> <string name="Squash Head">Squash Head</string> -<string name="Squash/Stretch Head">Squash/Stretch Head</string> + <string name="Stretch Head">Stretch Head</string> <string name="Sunken">Sunken</string> <string name="Sunken Chest">Sunken Chest</string> <string name="Sunken Eyes">Sunken Eyes</string> <string name="Sweep Back">Sweep Back</string> <string name="Sweep Forward">Sweep Forward</string> -<string name="Swept Back">Swept Back</string> -<string name="Swept Back Hair">Swept Back Hair</string> -<string name="Swept Forward">Swept Forward</string> -<string name="Swept Forward Hair">Swept Forward Hair</string> + <string name="Tall">Tall</string> <string name="Taper Back">Taper Back</string> <string name="Taper Front">Taper Front</string> <string name="Thick Heels">Thick Heels</string> <string name="Thick Neck">Thick Neck</string> <string name="Thick Toe">Thick Toe</string> -<string name="Thickness">Thickness</string> + <string name="Thin">Thin</string> <string name="Thin Eyebrows">Thin Eyebrows</string> <string name="Thin Lips">Thin Lips</string> @@ -2763,8 +2749,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="Tight Shirt">Tight Shirt</string> <string name="Tight Skirt">Tight Skirt</string> <string name="Tight Sleeves">Tight Sleeves</string> -<string name="Tilt Left">Tilt Left</string> -<string name="Tilt Right">Tilt Right</string> + <string name="Toe Shape">Toe Shape</string> <string name="Toe Thickness">Toe Thickness</string> <string name="Torso Length">Torso Length</string> @@ -2793,11 +2778,19 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="Wild">Wild</string> <string name="Wrinkles">Wrinkles</string> - <!-- Favorites Bar --> + <!-- Navigation bar location input control. + Strings are here because widget xml is not localizable --> <string name="LocationCtrlAddLandmarkTooltip">Add to My Landmarks</string> <string name="LocationCtrlEditLandmarkTooltip">Edit My Landmark</string> <string name="LocationCtrlInfoBtnTooltip">See more info about the current location</string> <string name="LocationCtrlComboBtnTooltip">My location history</string> + <string name="LocationCtrlForSaleTooltip">Buy this land</string> + <string name="LocationCtrlVoiceTooltip">Voice not available here</string> + <string name="LocationCtrlFlyTooltip">Flying not allowed</string> + <string name="LocationCtrlPushTooltip">No pushing</string> + <string name="LocationCtrlBuildTooltip">Building/dropping objects not allowed</string> + <string name="LocationCtrlScriptsTooltip">Scripts not allowed</string> + <string name="LocationCtrlDamageTooltip">Health</string> <!-- Strings used by the (currently Linux) auto-updater app --> <string name="UpdaterWindowTitle"> diff --git a/indra/newview/skins/default/xui/en/widgets/accordion_tab.xml b/indra/newview/skins/default/xui/en/widgets/accordion_tab.xml index 08c337455c..9990324d03 100644 --- a/indra/newview/skins/default/xui/en/widgets/accordion_tab.xml +++ b/indra/newview/skins/default/xui/en/widgets/accordion_tab.xml @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <accordion_tab - font="SansSerifBold" header_bg_color="DkGray2" header_collapse_img="Accordion_ArrowClosed_Off" header_collapse_img_pressed="Accordion_ArrowClosed_Press" @@ -10,5 +9,6 @@ header_image_over="Accordion_Over" header_image_pressed="Accordion_Press" header_image_expanded="Accordion_Selected" - header_text_color="LtGray" + header_text_color="LtGray" + font="SansSerif" /> diff --git a/indra/newview/skins/default/xui/en/widgets/button.xml b/indra/newview/skins/default/xui/en/widgets/button.xml index 7c54e618ef..28ed560543 100644 --- a/indra/newview/skins/default/xui/en/widgets/button.xml +++ b/indra/newview/skins/default/xui/en/widgets/button.xml @@ -15,6 +15,7 @@ image_color="ButtonImageColor" image_color_disabled="ButtonImageColor" flash_color="ButtonFlashBgColor" + font="SansSerifSmall" hover_glow_amount="0.15" halign="center" scale_image="true"> diff --git a/indra/newview/skins/default/xui/en/widgets/chat_history.xml b/indra/newview/skins/default/xui/en/widgets/chat_history.xml index 32916c0816..2be37d222a 100644 --- a/indra/newview/skins/default/xui/en/widgets/chat_history.xml +++ b/indra/newview/skins/default/xui/en/widgets/chat_history.xml @@ -15,4 +15,5 @@ track_bottom="true" name="chat_history" type="string" - word_wrap="true" />
\ No newline at end of file + word_wrap="true" + font="SansSerif"/> diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_script.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_script.xml index 5011bf6a61..e5af961a56 100644 --- a/indra/newview/skins/default/xui/en/widgets/chiclet_script.xml +++ b/indra/newview/skins/default/xui/en/widgets/chiclet_script.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<chiclet_script
- name="script_chiclet">
+ name="script_chiclet"
+ font="SansSerif">
<icon
name="chiclet_icon"
follows="all"
diff --git a/indra/newview/skins/default/xui/en/widgets/filter_editor.xml b/indra/newview/skins/default/xui/en/widgets/filter_editor.xml index ec8395a7c5..0e34243349 100644 --- a/indra/newview/skins/default/xui/en/widgets/filter_editor.xml +++ b/indra/newview/skins/default/xui/en/widgets/filter_editor.xml @@ -2,7 +2,7 @@ <filter_editor clear_button_visible="true" search_button_visible="true" - text_pad_left="5" + text_pad_left="7" select_on_focus="true" background_image="TextField_Search_Off" background_image_disabled="TextField_Search_Disabled" diff --git a/indra/newview/skins/default/xui/en/widgets/floater.xml b/indra/newview/skins/default/xui/en/widgets/floater.xml index 6660fbf1a8..b2bd9c38c9 100644 --- a/indra/newview/skins/default/xui/en/widgets/floater.xml +++ b/indra/newview/skins/default/xui/en/widgets/floater.xml @@ -1,10 +1,28 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <!-- See also settings.xml UIFloater* settings for configuration --> -<floater name="floater" - bg_opaque_color="FloaterFocusBackgroundColor" - bg_alpha_color="FloaterDefaultBackgroundColor" - bg_opaque_image="Window_Foreground" - bg_alpha_image="Window_Background" - background_visible="true" - background_opaque="false" - header_height="25" /> +<floater + name="floater" + bg_opaque_color="FloaterFocusBackgroundColor" + bg_alpha_color="FloaterDefaultBackgroundColor" + bg_opaque_image="Window_Foreground" + bg_alpha_image="Window_Background" + background_visible="true" + background_opaque="false" + header_height="25" + top="0" + left="0" + close_image="Icon_Close_Foreground" + restore_image="Icon_Restore_Foreground" + minimize_image="Icon_Minimize_Foreground" + tear_off_image="tearoffbox.tga" + dock_image="Icon_Dock_Foreground" + undock_image="Icon_Undock_Foreground" + help_image="Icon_Help_Foreground" + close_pressed_image="Icon_Close_Press" + restore_pressed_image="Icon_Restore_Press" + minimize_pressed_image="Icon_Minimize_Press" + tear_off_pressed_image="tearoff_pressed.tga" + dock_pressed_image="Icon_Dock_Press" + undock_pressed_image="Icon_Undock_Press" + help_pressed_image="Icon_Help_Press" + /> diff --git a/indra/newview/skins/default/xui/en/widgets/line_editor.xml b/indra/newview/skins/default/xui/en/widgets/line_editor.xml index 546fbd9b47..a21e3f2645 100644 --- a/indra/newview/skins/default/xui/en/widgets/line_editor.xml +++ b/indra/newview/skins/default/xui/en/widgets/line_editor.xml @@ -8,6 +8,7 @@ ignore_tab="true" cursor_color="TextCursorColor" text_color="TextFgColor" + text_pad_left="2" text_readonly_color="TextFgReadOnlyColor" text_tentative_color="TextFgTentativeColor" highlight_color="EmphasisColor" diff --git a/indra/newview/skins/default/xui/en/widgets/location_input.xml b/indra/newview/skins/default/xui/en/widgets/location_input.xml index 17b1479ec4..0e2700cb80 100644 --- a/indra/newview/skins/default/xui/en/widgets/location_input.xml +++ b/indra/newview/skins/default/xui/en/widgets/location_input.xml @@ -11,6 +11,7 @@ add_landmark_image_disabled="Favorite_Star_Off" add_landmark_image_hover="Favorite_Star_Over" add_landmark_image_selected="Favorite_Star_Press" + add_landmark_hpad="12" icon_hpad="2" allow_text_entry="true" list_position="below" @@ -19,6 +20,8 @@ follows="left|top" allow_new_values="true" > + <!-- *NOTE: Tooltips are in strings.xml so they can be localized. + See LocationCtrlAddLandmarkTooltip etc. --> <info_button name="Place Information" width="16" height="16" @@ -38,39 +41,55 @@ scale_image="false" top="19" left="-3" /> + <for_sale_button + name="for_sale_btn" + image_unselected="parcel_lght_ForSale" + image_selected="parcel_lght_ForSale" + width="22" + height="18" + follows="right|top" + scale_image="false" + top="21" + /> <voice_icon + enabled="true" name="voice_icon" width="22" height="18" - top="21" + top="21" + follows="right|top" image_name="parcel_lght_VoiceNo" /> <fly_icon name="fly_icon" width="22" height="18" - top="21" + top="21" + follows="right|top" image_name="parcel_lght_FlyNo" /> <push_icon name="push_icon" width="22" height="18" - top="21" + top="21" + follows="right|top" image_name="parcel_lght_PushNo" /> <build_icon name="build_icon" width="22" height="18" - top="21" + top="21" + follows="right|top" image_name="parcel_lght_BuildNo" /> <scripts_icon name="scripts_icon" width="22" height="18" - top="21" + top="21" + follows="right|top" image_name="parcel_lght_ScriptsNo" /> <!-- NOTE: Placeholder icon, there is no dark grayscale version --> @@ -78,15 +97,17 @@ name="damage_icon" width="22" height="18" - top="21" + top="21" + follows="right|top" image_name="parcel_lght_Damage" /> <!-- Default text color is invisible on top of nav bar background --> <damage_text name="damage_text" - width="50" + width="35" height="18" top="16" + follows="right|top" halign="right" font="SansSerifSmall" text_color="TextFgColor" @@ -98,7 +119,7 @@ <combo_list bg_writeable_color="MenuDefaultBgColor" page_lines="10" scroll_bar_bg_visible="true" /> <combo_editor name="Combo Text Entry" - text_pad_left="20" + text_pad_left="22" select_on_focus="false" font="SansSerifSmall" bevel_style="none" diff --git a/indra/newview/skins/default/xui/en/widgets/menu_item.xml b/indra/newview/skins/default/xui/en/widgets/menu_item.xml index 2bbaa6233f..c65244ae22 100644 --- a/indra/newview/skins/default/xui/en/widgets/menu_item.xml +++ b/indra/newview/skins/default/xui/en/widgets/menu_item.xml @@ -1,4 +1,3 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <!-- Use this for the top-level menu styling --> -<menu_item> -</menu_item> +<menu_item font="SansSerif" /> diff --git a/indra/newview/skins/default/xui/en/widgets/radio_item.xml b/indra/newview/skins/default/xui/en/widgets/radio_item.xml index dd848f3acd..3ddf18b2cb 100644 --- a/indra/newview/skins/default/xui/en/widgets/radio_item.xml +++ b/indra/newview/skins/default/xui/en/widgets/radio_item.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<radio_item follows="left|top"> +<radio_item follows="left|top" font="SansSerif"> <radio_item.label_text name="Radio Item label"/> <radio_item.check_button name="Radio control button" image_unselected="RadioButton_Off" diff --git a/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml b/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml index 56204201ef..c2a70d4b39 100644 --- a/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml +++ b/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml @@ -13,7 +13,7 @@ <combo_editor name="child1" select_on_focus="true" - text_pad_left="28" + text_pad_left="30" background_image="TextField_Search_Off" background_image_disabled="TextField_Search_Disabled" background_image_focused="TextField_Search_Active"/> diff --git a/indra/newview/skins/default/xui/en/widgets/search_editor.xml b/indra/newview/skins/default/xui/en/widgets/search_editor.xml index 9a79243b03..f644a710b2 100644 --- a/indra/newview/skins/default/xui/en/widgets/search_editor.xml +++ b/indra/newview/skins/default/xui/en/widgets/search_editor.xml @@ -2,7 +2,7 @@ <search_editor clear_button_visible="false" search_button_visible="true" - text_pad_left="4" + text_pad_left="6" select_on_focus="true" background_image="TextField_Search_Off" background_image_disabled="TextField_Search_Disabled" diff --git a/indra/newview/skins/default/xui/en/widgets/slider_bar.xml b/indra/newview/skins/default/xui/en/widgets/slider_bar.xml index 706c89f5ed..89d5950e98 100644 --- a/indra/newview/skins/default/xui/en/widgets/slider_bar.xml +++ b/indra/newview/skins/default/xui/en/widgets/slider_bar.xml @@ -8,4 +8,5 @@ track_image_horizontal="SliderTrack_Horiz" track_image_vertical="SliderTrack_Vert" track_highlight_horizontal_image="SliderTrack_Horiz" - track_highlight_vertical_image="SliderTrack_Vert" /> + track_highlight_vertical_image="SliderTrack_Vert" + font="SansSerif" /> diff --git a/indra/newview/skins/default/xui/en/widgets/spinner.xml b/indra/newview/skins/default/xui/en/widgets/spinner.xml index 7d1a5118cb..ab3f8df5f8 100644 --- a/indra/newview/skins/default/xui/en/widgets/spinner.xml +++ b/indra/newview/skins/default/xui/en/widgets/spinner.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <spinner text_enabled_color="LabelTextColor" text_disabled_color="LabelDisabledColor" + font="SansSerif" decimal_digits="3" label_width="40" > <spinner.up_button name="SpinCtrl Up" diff --git a/indra/newview/skins/default/xui/en/widgets/textbase.xml b/indra/newview/skins/default/xui/en/widgets/textbase.xml index 6dd92ea34b..f4dc192bc3 100644 --- a/indra/newview/skins/default/xui/en/widgets/textbase.xml +++ b/indra/newview/skins/default/xui/en/widgets/textbase.xml @@ -1,2 +1,3 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<textbase/> +<textbase clip_partial="false" + font="SansSerif"/> diff --git a/indra/newview/skins/default/xui/en/widgets/ui_ctrl.xml b/indra/newview/skins/default/xui/en/widgets/ui_ctrl.xml index 2f72ad65a1..f4dbb8f404 100644 --- a/indra/newview/skins/default/xui/en/widgets/ui_ctrl.xml +++ b/indra/newview/skins/default/xui/en/widgets/ui_ctrl.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <!-- Global settings for all widgets ("UI Controls") --> +<!-- The params in this file aren't currently getting loaded in OSX --> <ui_ctrl - font="SansSerif" /> diff --git a/indra/newview/skins/default/xui/es/floater_buy_currency.xml b/indra/newview/skins/default/xui/es/floater_buy_currency.xml index af542acbce..eb25493adc 100644 --- a/indra/newview/skins/default/xui/es/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/es/floater_buy_currency.xml @@ -29,7 +29,7 @@ 1234 </line_editor> <text name="currency_est" width="138" left_delta="68"> - L$ por, aprox., [USD] US$ + por, aprox., [LOCALAMOUNT] </text> <text name="getting_data"> Obteniendo los datos... @@ -63,6 +63,6 @@ Aumente la cantidad a comprar. <button label="Cancelar" name="cancel_btn"/> <button label="Comprar" name="buy_btn"/> <string name="buy_currency"> - Compre [LINDENS] L$ por, aprox., [USD] US$ + Compre [LINDENS] L$ por, aprox., [LOCALAMOUNT] </string> </floater> diff --git a/indra/newview/skins/default/xui/fr/floater_animation_preview.xml b/indra/newview/skins/default/xui/fr/floater_animation_preview.xml index 4417006fc6..a4ad14294e 100644 --- a/indra/newview/skins/default/xui/fr/floater_animation_preview.xml +++ b/indra/newview/skins/default/xui/fr/floater_animation_preview.xml @@ -114,12 +114,13 @@ La longueur maximale est de [MAX_LENGTH] secondes. </text> <spinner label="Priorité" name="priority" tool_tip="Contrôle quelles animations peuvent êtres écrasées par cette animation."/> <check_box label="Boucle" left="6" name="loop_check" tool_tip="Joue cette animation en boucle."/> - <spinner label="Début (%)" label_width="55" left="76" name="loop_in_point" tool_tip="Définit le moment de l'animation où la boucle repart." width="105"/> - <spinner label="Fin (%)" left="195" name="loop_out_point" tool_tip="Définit le moment de l'animation où la boucle finit."/> - <text name="hand_label" width="110"> - Mouvement de main + <spinner label="Début (%)" label_width="65" name="loop_in_point" tool_tip="Définit le moment de l'animation où la boucle repart." width="105"/> + <spinner label="Fin (%)" name="loop_out_point" tool_tip="Définit le moment de l'animation où la boucle finit."/> + <text name="hand_label"> + Mouvement de +main </text> - <combo_box label="" left_delta="116" name="hand_pose_combo" tool_tip="Contrôle le mouvement des mains au cours de l'animation" width="124"> + <combo_box label="" name="hand_pose_combo" tool_tip="Contrôle le mouvement des mains au cours de l'animation"> <combo_box.item label="Doigts écartés" name="Spread"/> <combo_box.item label="Détendues" name="Relaxed"/> <combo_box.item label="Pointer (les deux)" name="PointBoth"/> @@ -137,7 +138,7 @@ La longueur maximale est de [MAX_LENGTH] secondes. <text name="emote_label"> Expression </text> - <combo_box label="" left_delta="116" name="emote_combo" tool_tip="Contrôle l'expression du visage au cours de l'animation." width="124"> + <combo_box label="" name="emote_combo" tool_tip="Contrôle l'expression du visage au cours de l'animation."> <combo_box.item label="None]" name="[None]"/> <combo_box.item label="Aaaaah" name="Aaaaah"/> <combo_box.item label="Effrayé" name="Afraid"/> @@ -159,27 +160,25 @@ La longueur maximale est de [MAX_LENGTH] secondes. <combo_box.item label="Clin d'œil" name="Wink"/> <combo_box.item label="Soucis" name="Worry"/> </combo_box> - <text name="preview_label" width="110"> - Prévisualiser pendant + <text name="preview_label"> + Prévisualiser +pendant </text> - <combo_box label="" left_delta="116" name="preview_base_anim" tool_tip="Utilisez cette option pour tester votre animation pendant que votre avatar fait des choses banales." width="124"> + <combo_box label="" name="preview_base_anim" tool_tip="Utilisez cette option pour tester votre animation pendant que votre avatar fait des choses banales."> <combo_box.item label="Debout" name="Standing"/> <combo_box.item label="En train de marcher" name="Walking"/> <combo_box.item label="Assis" name="Sitting"/> <combo_box.item label="En train de voler" name="Flying"/> </combo_box> - <spinner label="Transition -début (s)" label_width="65" name="ease_in_time" tool_tip="Durée (en secondes) pendant laquelle l'animation s'intègre au mouvement."/> - <spinner label="Transition -fin (s)" label_width="65" left="160" name="ease_out_time" tool_tip="Durée (en secondes) pendant laquelle l'animation disparaît du mouvement." width="125"/> - <button bottom_delta="-48" label="" name="play_btn" tool_tip="Jouer/Arrêter votre animation."/> + <spinner label="Transition début (s)" name="ease_in_time" tool_tip="Durée (en secondes) pendant laquelle l'animation s'intègre au mouvement."/> + <spinner label="Transition fin (s)" name="ease_out_time" tool_tip="Durée (en secondes) pendant laquelle l'animation disparaît du mouvement." /> + <button label="" name="play_btn" tool_tip="Jouer/Arrêter votre animation."/> <button label="" name="stop_btn" tool_tip="Arrêter le playback"/> <slider label="" name="playback_slider"/> <text name="bad_animation_text"> Impossible de lire le fichier d'animation. -Nous recommandons les fichiers BVH extraits de -Poser 4. +Nous recommandons les fichiers BVH extraits de Poser 4. </text> <button label="Annuler" name="cancel_btn"/> <button label="Charger ([AMOUNT] L$)" name="ok_btn"/> diff --git a/indra/newview/skins/default/xui/fr/floater_buy_currency.xml b/indra/newview/skins/default/xui/fr/floater_buy_currency.xml index 9112d30be2..603b7587b4 100644 --- a/indra/newview/skins/default/xui/fr/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/fr/floater_buy_currency.xml @@ -29,7 +29,7 @@ 1234 </line_editor> <text name="currency_est" width="138" left_delta="68"> - L$ pour environ [USD] US$ + pour environ [LOCALAMOUNT] </text> <text name="getting_data" width="138"> Obtention des données... @@ -64,6 +64,6 @@ Veuillez saisir un montant plus élevé. <button label="Acheter" name="buy_btn"/> <button label="Annuler" name="cancel_btn"/> <string name="buy_currency"> - Acheter [LINDENS] L$ pour environ [USD] US$ + Acheter [LINDENS] L$ pour environ [LOCALAMOUNT] </string> </floater> diff --git a/indra/newview/skins/default/xui/fr/floater_world_map.xml b/indra/newview/skins/default/xui/fr/floater_world_map.xml index 1f76202dee..ddb868b04a 100644 --- a/indra/newview/skins/default/xui/fr/floater_world_map.xml +++ b/indra/newview/skins/default/xui/fr/floater_world_map.xml @@ -1,71 +1,68 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="worldmap" title="CARTE DU MONDE"> - <tab_container name="maptab" width="955"> - <panel label="Objets" name="objects_mapview" width="953"/> - <panel label="Terrain" name="terrain_mapview" width="953"/> - </tab_container> - <icon left="973" name="self"/> + <panel name="objects_mapview" width="542"/> + <icon name="self" left="-270"/> <text name="you_label"> Vous </text> - <icon left="1033" name="home"/> + <icon name="home"/> <text name="home_label"> Domicile </text> - <icon left="973" name="square2"/> + <icon name="square2" left="-270"/> <text name="auction_label"> Terrain aux enchères </text> - <icon left="1105" name="square"/> + <icon name="square" left_delta="130"/> <text name="land_for_sale_label"> Terrain à vendre </text> - <button label="Aller chez moi" label_selected="Aller chez moi" name="Go Home" tool_tip="Vous téléporte à votre domicile"/> - <icon left="977" name="person"/> + <button left="-120" width="108" label="Aller chez moi" label_selected="Aller chez moi" name="Go Home" tool_tip="Vous téléporte à votre domicile"/> + <icon left="-262" name="person"/> <check_box label="Résident" name="people_chk"/> - <icon left="973" name="infohub"/> + <icon left="-266" name="infohub"/> <check_box label="Infohub" name="infohub_chk"/> - <icon left="973" name="telehub"/> + <icon left="-266" name="telehub"/> <check_box label="Téléhub" name="telehubchk"/> - <icon left="973" name="landforsale"/> + <icon left="-266" name="landforsale"/> <check_box label="Terrain à vendre" name="land_for_sale_chk"/> - <text name="events_label" left="1099"> + <text name="events_label" left="-144"> Événements : </text> - <icon left="1121" name="event"/> + <icon left="-132" name="event"/> <check_box label="PG" name="event_chk"/> - <icon left="1121" name="events_mature_icon"/> + <icon left="-132" name="events_mature_icon"/> <check_box label="Mature" name="event_mature_chk"/> - <icon left="1121" name="events_adult_icon"/> + <icon left="-132" name="events_adult_icon"/> <check_box label="Adult" name="event_adult_chk"/> - <icon left="973" name="avatar_icon"/> + <icon left="-270" name="avatar_icon"/> <combo_box label="Amis connectés" name="friend combo" tool_tip="Ami à afficher sur la carte" width="232"> <combo_box.item name="item1" label="Amis connectés" /> </combo_box> - <icon left="973" name="landmark_icon"/> + <icon left="-270" name="landmark_icon"/> <combo_box label="Repères" name="landmark combo" tool_tip="Repère à afficher sur la carte" width="232"> <combo_box.item name="item1" label="Repères" /> </combo_box> - <icon left="973" name="location_icon"/> + <icon left="-270" name="location_icon"/> <line_editor label="Rechercher par nom de région" name="location" tool_tip="Saisissez le nom d'une région" width="155"/> <button label="Rechercher" label_selected=">" left_delta="160" name="DoSearch" tool_tip="Recherchez sur la carte" width="75"/> - <text left="973" name="search_label"> + <text left="-270" name="search_label"> Résultats de la recherche : </text> - <scroll_list left="973" name="search_results" width="252"> + <scroll_list left="-270" name="search_results" width="252"> <column label="" name="icon"/> <column label="" name="sim_name"/> </scroll_list> - <text left="973" name="location_label"> + <text left="-270" name="location_label"> Emplacement : </text> - <spinner left="1078" name="spin x" tool_tip="Coordonnées des X du lieu à afficher sur la carte"/> + <spinner left_delta="100" name="spin x" tool_tip="Coordonnées des X du lieu à afficher sur la carte"/> <spinner name="spin y" tool_tip="Coordonnées des Y du lieu à afficher sur la carte"/> <spinner name="spin z" tool_tip="Coordonnées des Z du lieu à afficher sur la carte"/> <button label="Téléporter" label_selected="Téléporter" left="-270" name="Teleport" tool_tip="Téléporter à l'endroit sélectionné"/> <button label="Afficher la destination" label_selected="Afficher la destination" name="Show Destination" tool_tip="Centrer la carte sur l'endroit sélectionné" width="165"/> <button label="Effacer" label_selected="Effacer" left="-270" name="Clear" tool_tip="Arrêter de suivre"/> <button label="Afficher mon emplacement" label_selected="Afficher mon emplacement" name="Show My Location" tool_tip="Centrer la carte sur l'emplacement de votre avatar" width="165"/> - <button label="Copier la SLurl dans le presse-papiers" left="-270" name="copy_slurl" tool_tip="Copier l'emplacement actuel comme SLurl pour l'utiliser sur le Web." width="262"/> + <button label="Copier la SLurl dans le presse-papiers" left="-270" name="copy_slurl" tool_tip="Copier l'emplacement actuel comme SLurl pour l'utiliser sur le Web." /> <slider label="Zoom" left="-270" name="zoom slider"/> </floater> diff --git a/indra/newview/skins/default/xui/it/floater_buy_currency.xml b/indra/newview/skins/default/xui/it/floater_buy_currency.xml index 6b881683f1..a22850bc4b 100644 --- a/indra/newview/skins/default/xui/it/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/it/floater_buy_currency.xml @@ -29,7 +29,7 @@ 1234 </line_editor> <text name="currency_est"> - L$ per circa [USD]US$ + per circa [LOCALAMOUNT] </text> <text name="getting_data"> Dati in ricezione... @@ -64,6 +64,6 @@ Devi aumentare l'importo da acquistare. <button label="Cancella" name="cancel_btn"/> <button label="Acquista" name="buy_btn"/> <string name="buy_currency"> - acquistare [LINDENS] L$ per circa [USD] US$ + acquistare [LINDENS]L$ per circa [LOCALAMOUNT] </string> </floater> diff --git a/indra/newview/skins/default/xui/ja/floater_buy_currency.xml b/indra/newview/skins/default/xui/ja/floater_buy_currency.xml index 9d5aea612b..35516301fc 100644 --- a/indra/newview/skins/default/xui/ja/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/ja/floater_buy_currency.xml @@ -29,7 +29,7 @@ 1234 </line_editor> <text name="currency_est"> - 約US$ [USD] + 約[LOCALAMOUNT] </text> <text name="getting_data" left_delta="3"> データを取得しています... @@ -63,6 +63,6 @@ <button label="購入" name="buy_btn" /> <button label="取り消し" name="cancel_btn" /> <text name="buy_currency"> - 約US$ [USD]でL$ [LINDENS]を購入 + 約[LOCALAMOUNT]でL$ [LINDENS]を購入 </text> </floater> diff --git a/indra/newview/skins/default/xui/nl/floater_buy_currency.xml b/indra/newview/skins/default/xui/nl/floater_buy_currency.xml index b6fc743abe..6ee5cc5341 100644 --- a/indra/newview/skins/default/xui/nl/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/nl/floater_buy_currency.xml @@ -29,7 +29,7 @@ 1234 </line_editor> <text name="currency_est" left_delta="80"> - voor ong. US$ [USD] + voor ong. [LOCALAMOUNT] </text> <text name="getting_data"> Data ophalen… @@ -63,6 +63,6 @@ Verhoog de hoeveelheid die gekocht moet worden. <button label="Annuleren" name="cancel_btn"/> <button label="Kopen" name="buy_btn"/> <string name="buy_currency"> - Koop L$ [LINDENS] voor ong. US$ [USD] + Koop L$ [LINDENS] voor ong. [LOCALAMOUNT] </string> </floater> diff --git a/indra/newview/skins/default/xui/nl/role_actions.xml b/indra/newview/skins/default/xui/nl/role_actions.xml new file mode 100644 index 0000000000..1f0a6e4235 --- /dev/null +++ b/indra/newview/skins/default/xui/nl/role_actions.xml @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<role_actions> + <action_set description="Deze Mogelijkheden regelen het toevoegen en verwijderen van Groepsleden, en om aan te geven dat nieuwe Leden lid kunnen worden zonder uitnodiging." name="Membership"> + <action description="Personen uitnodigen voor deze Groep" longdescription="Personen uitnodigen voor deze Groep door de 'Uitnodigen Nieuwe Leden...' knop in de leden & Rollen tab > Leden sub-tab." name="member invite"/> + <action description="Leden uit deze Groep zetten" longdescription="Leden uit deze Groep zetten door de 'Uit Groep Zetten' knop in de leden tab & Rollen tab > Leden sub-tab. Een Eigenaar kan iedereen uit de groep zetten behalve een andere Eigenaar. Als je geen Eigenaar bent, kan een Lid worden uitgezet als, en alleen als, het Lid deel uitmaakt van de Iedereen Rol, en NIET van andere Rollen. Om Leden uit Rollen te verwijderen, moet je de 'Leden uit Rollen Verwijderen' mogelijkheid hebben." name="member eject"/> + <action description="Selecteer 'Vrije Toegang' en wijzig 'Contibutie Bijdrage'" longdescription="Selecteer 'Vrije Toegang' zodat nieuwe Leden lid kunnen worden zonder uitnodiging, en wijzig 'Contributie Bijdrage' in de Groep Voorkeuren sectie van de Algemene tab." name="member options"/> + </action_set> + <action_set description="Deze Mogelijkheden regelen het toevoegen, verwijderen, en wijzigen van Groepsrollen, toevoegen en verwijderen van Leden in Rollen, en toewijzen van Mogelijkheden aan Rollen." name="Roles"> + <action description="Creëren nieuwe Rollen" longdescription="Creëren nieuwe Rollen in de Leden & Rollen tab > Rollen sub-tab." name="role create"/> + <action description="Verwijderen Rollen" longdescription="Verwijderen Rollen in de Leden & Rollen tab > Rollen sub-tab." name="role delete"/> + <action description="Wijzigen Rol-naam, titel, beschrijving, en of de Rol leden publiekelijk zichtbaar zijn" longdescription="Wijzigen Rol-naam, titel, beschrijving, en of de Rol leden publiekelijk zichtbaar zijn. Dit kan worden gedaan onderaan de de Leden & Rollen tab > Rollen sub-tab na de selectie van een rol." name="role properties"/> + <action description="Toewijzen Leden aan Toewijzers Rollen" longdescription="Toewijzen Leden aan Rollen in de Toegewezen Rollen sectie van de Leden & Rol tab > Leden sub-tab. Een Lid met deze Mogelijkheid kan alleen Leden toevoegen aan een Rol waartoe men zelf al behoort." name="role assign member limited"/> + <action description="Toewijzen Leden aan Alle Rollen" longdescription="Toewijzen van Leden aan Alle Rollen in the Toegewezen Rollen sectie van de Leden & Rollen tab > Leden sub-tab. *WAARSCHUWING* Ieder Lid in een Rol met deze Mogelijkheid kan zichzelf--en ieder ander niet-Eigenaar Lid--toewijzen aan rollen met meer rechten dan zijzelf op dat moment hebben, hierdoor ontstaat de mogelijkheid om zichzelf bijna-Eigenaar rechten toewijzen. Wees er zeker van en controleer voordat deze Mogelijkheid wordt toegekend." name="role assign member"/> + <action description="Verwijderen Leden uit Rollen" longdescription="Verwijderen Leden uit Rollen in the Toegewezen Rollen sectie van de Leden & Rollen tab > Leden sub-tab. Eigenaars kunnen niet worcen verwijderd." name="role remove member"/> + <action description="Toewijzen en Verwijderen Mogelijkheden in Rollen" longdescription="Toewijzen en Verwijderen Mogelijkheden in Rollen in de Toegestane Mogelijkheden van de Leden & Rollen tab > Leden sub-tab. *WAARSCHUWING* Ieder Lid in een Rol met deze Mogelijkheid kan kan zichzelf--en ieder ander niet-Eigenaar Lid--toewijzen aan rollen met meer rechten dan zijzelf op dat moment hebben, hierdoor ontstaat de mogelijkheid om zichzelf bijna-Eigenaar rechten toewijzen. Wees er zeker van en controleer voordat deze Mogelijkheid wordt toegekend." name="role change actions"/> + </action_set> + <action_set description="Deze Mogelijkheden regelen het wijzigen van de Groepsidentiteit, zoals het veranderen van publieke zichtbaarheid, charter en insigne." name="Group Identity"> + <action description="Wijzigen Charter, Insigne, en 'Toon in zoeken'" longdescription="Wijzigen Charter, Insigne, en 'Toon in zoeken'. Dit kan worden gedaan in de Algemeen tab." name="group change identity"/> + </action_set> + <action_set description="Deze Mogelijkheden regelen het overdragen, wijzigen, en verkopen van land dat in bezit is van deze groep. Om naar het Over Land venster te gaan, rechts-klik de grond selecteer 'Over Land...', of klik op de perceel info in de menubalk." name="Parcel Management"> + <action description="Land overdragen en land kopen voor groep" longdescription="Land overdragen en land kopen voor groep. Dit kan worden gedaan in Over Land > Algemeen tab." name="land deed"/> + <action description="Land overdragen aan Govenor Linden" longdescription="Land overdragen aan Govenor Linden. *WAARSCHUWING* Ieder Lid in een Rol met deze Mogelijkheid kan land in eigendom van de groep laten vervallen in Over Land > Algemeen tab, teruggeven in Linden eigendom zonder verkoop! Wees er zeker van en controleer voordat deze Mogelijkheid wordt toegekend." name="land release"/> + <action description="Activeer land te koop info" longdescription="Activeer land te koop info. *WAARSCHUWING* Ieder Lid in een Rol met deze Mogelijkheid kan land in eigendom van de groep verkopen in Over Land > Algemeen tab als ze dat willen! Wees er zeker van en controleer voordat deze Mogelijkheid wordt toegekend." name="land set sale info"/> + <action description="Opdelen en samenvoegen van percelen" longdescription="Opdelen en samenvoegen van percelen. Dit kan worden gedaan door rechts klikken op de grond, 'Terrein Bewerken, en de muis te slepen naar het land om een selectie te maken. Om te verdelen, selecteer wat je wil splitsen en klik 'Opdelen...'. Om samen te voegen, selecteer twee of meer aaneengesloten percelen en klik 'Samenvoegen...'." name="land divide join"/> + </action_set> + <action_set description="Deze Mogelijkheden regelen het veranderen van de perceelnaam en publicatie instelling, zichtbaarheid in 'Tonen in zoeken', en landingspunt & TP routering." name="Parcel Identity"> + <action description="Selecteer 'Tonen in zoeken' en instellen categorie" longdescription="Selecteer 'Tonen in zoeken' en instellen van de categorie voor een perceel in Over Land > Opties tab." name="land find places"/> + <action description="Veranderen perceel naam, omschrijving, en 'Tonen in zoeken' instellingen" longdescription="Veranderen perceel naam, omschrijving en 'Tonen in zoeken' instellingen. Dit kan worden gedaan in Overland > Opties tab." name="land change identity"/> + <action description="Instellen landingsplaats en instellen teleport routering" longdescription="Op een perceel in groepseigendom, Leden in een Rol met die mogelijkheid kunnen een landingsplaats instellen om te bepalen waar inkomende teleports aankomen, en ook een teleport routering instelling voor meer controle. Dit kan worden gedaan in About Land > Opties tab." name="land set landing point"/> + </action_set> + <action_set description="Deze Mogelijkheden regelen het aanpassen van perceel opties, zoals 'Maak Objecten', 'Bewerken Terrein', en muziek & media instellingen." name="Parcel Settings"> + <action description="Veranderen muziek & media instellingen" longdescription="Veranderen streaming muziek en film instellingen in Over Land> Media tab." name="land change media"/> + <action description="Instellen 'Bewerken Terrein'" longdescription="Instellen 'Bewerken Terrein'. *WAARSCHUWING* Over Land > Opties tab > Bewerken Terrein staat toe dat iedereen de vorm van het terrein kan aanpassen, en Linden planten kan plaatsen en verplaatsen. Wees er zeker van en controleer voordat deze Mogelijkheid wordt toegekend. Bewerken terrein kan worden aangezet in Over Land> Opties tab." name="land edit"/> + <action description="Instellen diversen Over Land > Optie instellingen" longdescription="Instellen 'Veilig (geen letsel)', 'Vliegen' and andere Inwoners toestaan om: 'Objecten te maken', 'Terrein te bewerken', en 'Scripts uit te voeren' op land in groepseigendom in Over Land > Opties tab." name="land options"/> + </action_set> + <action_set description="Deze Mogelijkheden regelend de toestemming voor leden om beperkingen te omzeilen op percelen in groepseigendom." name="Parcel Powers"> + <action description="'Bewerken Terrein' altijd toestaan" longdescription="Leden in een Rol met deze Mogelijkheid kunnen terrein bewerken op een perceel in groepseigendom, zelfs als de optie uitstaat in Over Land > Opties tab." name="land allow edit land"/> + <action description="'Vliegen' altijd toestaan" longdescription="Leden in een Rol met deze Mogelijkheid kunnen vliegen op een perceel in groepseigendom, zelfs als de optie uitstaat in Over Land > Opties tab." name="land allow fly"/> + <action description="'Maak Objecten' altijd toestaan" longdescription="Leden in een Rol met deze Mogelijkheid kunnen objecten maken op een perceel in groepseigendom, zelfs als de optie uitstaat in Over Land > Opties tab." name="land allow create"/> + <action description="'Maak Landmarkering' altijd toestaan" longdescription="Leden in een Rol met deze Mogelijkheid kunnen een landmarkering maken op een perceel in groepseigendom, zelfs als de optie uitstaat in Over Land > Opties tab." name="land allow landmark"/> + <action description="Toestaan 'Thuis hier Instellen' op land in groepseigendom" longdescription="Leden in een Rol met deze Mogelijkheid kunnen gebruik maken van Wereld menu > Thuis hier Instellen op een perceel afgestaan aan deze groep." name="land allow set home"/> + </action_set> + <action_set description="Deze Mogelijkheden regelen het toestaan of beperken van toegang van percelen in groepseigendom, inclusief het bevriezen en verbannen van Inwoners." name="Parcel Access"> + <action description="Beheren perceel Toegang lijsten" longdescription="Beheren perceel Toegang lijsten in Over Land > Toegang tab." name="land manage allowed"/> + <action description="Beheren perceel Verbannen lijst" longdescription="Beheren perceel Verbannen lijst in Over Land > Verbannen tab." name="land manage banned"/> + <action description="Veranderen perceel 'Verkoop toegangspassen...' instellingen" longdescription="Verandere perceel 'Verkoop toegangspassen...'instellingen" name="land manage passes"/> + <action description="Uitwerpen en bevriezen Inwoners op percelen" longdescription="Leden in een Rol met deze mogelijkheid kunnen een onwelkome Inwoners aanpakken op een perceel in groepseigendom door een rechter-klik op deze inwoner > en 'Uitwerpen...'of 'Bevriezen...'te selecteren." name="land admin"/> + </action_set> + <action_set description="Deze Mogelijkheden regelen de toestemming voor leden om objecten te retourneren en Linden planten te plaatsen en te verplaatsen. Dit is nuttig voor Leden om rommel op te ruimen en landschappen te maken, echter het moet ook met omzichtigheid worden gebruikt, omdat er geen herstelfunktie is voor retourneren objecten." name="Parcel Content"> + <action description="Retourneren objecten in groepseigendom" longdescription="Retourneren van objecten die in eigendom zijn van de groep op percelen in groepseigendom in Over Land > Objecten tab." name="land return group owned"/> + <action description="Retourneren objecten toegewezen aan de groep" longdescriotion="Retourneren van objecten die aan de groep zijn toegewezen op percelen in groepseigendom in Over Land > Objecten tab." name="land return group set"/> + <action description="Retourneren objecten die niet van de groep zijn" longdescription="Retourneren objecten die niet van de groep zijn op percelen in groepeigendom in Over Land > Objecten tab." name="land return non group"/> + <action description="Landschappen maken met Linden planten" longdescription="Landschappen maken om Linden bomen, planten en grassen te plaatsen en te verplaatsen. Deze opties zijn te vinden in de inventaris Library > Objects folder of ze kunnen worden gemaakt via de Bouwen knop." name="land gardening"/> + </action_set> + <action_set description="Deze Mogelijkheden regelen het afstaan, wijzigen, en verkopen van objecten in groepseigendom. Deze veranderingen worden gedaan in Bewerken Gereedschap > Algemeen tab. Rechts-klik een object en selecteer Bewerken om de instellingen ervan te bekijken." name="Object Management"> + <action description="Overdragen objecten aan groep" longdescription="Overdragen objecten aan groep in de Bewerkings Hulpmiddelen > Algemeen tab." name="object deed"/> + <action description="Manipuleren (verplaatsen, copieren, wijzigen) van objecten in groepseigendom" longdescription="Manipuleren (verplaatsen, copieren, wijzigen) van objecten in groepseigendom in de Bewerkings Hulpmiddelen > Algemeen tab." name="object manipulate"/> + <action description="Te koop zetten van objecten in groepseigendom" longdescription="Te koop zetten van objecten in groepseigendom in de Bewerkings Hulpmiddelen > Algemeen tab." name="object set sale"/> + </action_set> + <action_set description="Deze Mogelijkheden regelen dat Leden groepsverplichtingen betalen en groepsdividenden ontvangen, en toegang beperken tot de financiele historie van de groep." name="Accounting"> + <action description="Betalen groepsverplichtingen en ontvangen van groepsdividenden" longdescription="Leden in een Rol met deze mogelijkheid betalen groepsverplichtingen en ontvangen groepsdividenden automatisch. Dit betekent dat ze een deel ontvangen van de verkoop van land in groepseigendom die dagelijks worden verdeeld, maar ook dat ze bijdragen aan zaken zoals lijstbijdrage voor het perceel." name="accounting accountable"/> + </action_set> + <action_set description="Deze Mogelijkheden regelen de toestemming dat Leden Groepsberichten kunnen versturen, ontvangen en inzien." name="Notices"> + <action description="Versturen Berichten" longdescription="Leden in een Rol met deze Mogelijkheid kunnen Berichten versturen in Groep Informatie > Berichten tab." name="notices send"/> + <action description="Ontvangen Berichten en inzien van oude Berichten" longdescription="Leden in een Rol met deze Mogelijkheid kunnen Berichten ontvangen en oude Berichten inzien in Groep Informatie > Berichten tab." name="notices receive"/> + </action_set> + <action_set description="Deze Mogelijkheden regelen de toestemming dat Leden Voorstellen kunnen maken, Voorstellen kunnen inzien, en het stemverloop kunnen bekijken." name="Proposals"> + <action description="Maken Voorstellen" longdescription="Leden in een Rol met deze Mogelijkheid kunnen Voorstellen maken waarop kan worden gestemd in Groep Informatie > Voorstellen tab." name="proposal start"/> + <action description="Stemmen op Voorstellen" longdescription="Leden in een Rol met deze Mogelijkheid kunnen stemmen op Voorstellen in Groep Informatie > Voorstellen tab." name="proposal vote"/> + </action_set> + <action_set description="Deze Mogelijkheden regelen de toegang (en de beperking ervan) tot groep chat sessies en groep voice chat." name="Chat"> + <action description="Deelname aan Groep Chat" longdescription="Leden in een Rol met deze Mogelijkheid kunnen deelnemen aan groep chat sessies, zowel voor tekst als voice." name="join group chat"/> + <action description="Deelname aan Groep Voice Chat" longdescription="Leden in een Rol met deze Mogelijkheid kunnen deelnemen aan groep voice chat sessies. OPMERKING: De Deelname Group Chat is vereist om toegang te krijgen to de voice chat sessie." name="join voice chat"/> + <action description="Modereren Groep Chat" longdescription="Leden in een Rol met deze Mogelijkheid kunnen toegang en deelname controleren in groep voice en tekst chat sessies." name="moderate group chat"/> + </action_set> +</role_actions>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/pl/floater_buy_currency.xml b/indra/newview/skins/default/xui/pl/floater_buy_currency.xml index b0b8935433..5e59482883 100755 --- a/indra/newview/skins/default/xui/pl/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/pl/floater_buy_currency.xml @@ -29,7 +29,7 @@ 1234 </line_editor> <text name="currency_est"> - L$ za [USD]US$ + za [LOCALAMOUNT] </text> <text name="getting_data"> Otrzymywanie danych... @@ -64,6 +64,6 @@ Proszę zwiększyć ilość. <button label="Anuluj" name="cancel_btn" /> <button label="Kup" name="buy_btn" /> <string name="buy_currency"> - Kup [LINDENS]L$ za [USD]US$ + Kup [LINDENS]L$ za [LOCALAMOUNT] </string> </floater> diff --git a/indra/newview/skins/default/xui/pt/floater_buy_currency.xml b/indra/newview/skins/default/xui/pt/floater_buy_currency.xml index ceeb070c4e..aac8438fdc 100644 --- a/indra/newview/skins/default/xui/pt/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/pt/floater_buy_currency.xml @@ -29,7 +29,7 @@ 1234 </line_editor> <text name="currency_est" left_delta="72"> - por aproxim. US$ [USD] + por aproxim. [LOCALAMOUNT] </text> <text name="getting_data"> Obtendo dados... @@ -63,6 +63,6 @@ Aumente a quantidade de compra. <button label="Fechar" name="cancel_btn"/> <button label="Adquirir" name="buy_btn"/> <string name="buy_currency"> - Comprar L$ [LINDENS] por aproximadamente US$ [USD] + Comprar L$ [LINDENS] por aproxim. [LOCALAMOUNT] </string> </floater> diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 7112f97c08..801ca3bf72 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -278,10 +278,12 @@ class WindowsManifest(ViewerManifest): # Vivox runtimes self.path("SLVoice.exe") - self.path("alut.dll") self.path("vivoxsdk.dll") self.path("ortp.dll") - self.path("wrap_oal.dll") + self.path("libsndfile-1.dll") + self.path("zlib1.dll") + self.path("vivoxplatform.dll") + self.path("vivoxoal.dll") # For google-perftools tcmalloc allocator. try: @@ -543,10 +545,11 @@ class DarwinManifest(ViewerManifest): self.path("zh-Hans.lproj") # SLVoice and vivox lols - self.path("vivox-runtime/universal-darwin/libalut.dylib", "libalut.dylib") - self.path("vivox-runtime/universal-darwin/libopenal.dylib", "libopenal.dylib") + self.path("vivox-runtime/universal-darwin/libsndfile.dylib", "libsndfile.dylib") + self.path("vivox-runtime/universal-darwin/libvivoxoal.dylib", "libvivoxoal.dylib") self.path("vivox-runtime/universal-darwin/libortp.dylib", "libortp.dylib") self.path("vivox-runtime/universal-darwin/libvivoxsdk.dylib", "libvivoxsdk.dylib") + self.path("vivox-runtime/universal-darwin/libvivoxplatform.dylib", "libvivoxplatform.dylib") self.path("vivox-runtime/universal-darwin/SLVoice", "SLVoice") libdir = "../../libraries/universal-darwin/lib_release" @@ -845,7 +848,10 @@ class Linux_i686Manifest(LinuxManifest): self.end_prefix() if self.prefix(src="vivox-runtime/i686-linux", dst="lib"): self.path("libortp.so") + self.path("libsndfile.so.1") + self.path("libvivoxoal.so.1") self.path("libvivoxsdk.so") + self.path("libvivoxplatform.so") self.end_prefix("lib") class Linux_x86_64Manifest(LinuxManifest): diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index cc9fa598f2..c1360987a5 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -119,8 +119,10 @@ get_target_property(TEST_EXE test LOCATION) IF(WINDOWS) set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}) +ELSEIF(DARWIN) + set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources:/usr/lib) ELSE(WINDOWS) - set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}:/usr/lib) + set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}:/usr/lib) ENDIF(WINDOWS) LL_TEST_COMMAND("${LD_LIBRARY_PATH}" diff --git a/indra/test/llevents_tut.cpp b/indra/test/llevents_tut.cpp index 31130c3c79..e58b10ce07 100644 --- a/indra/test/llevents_tut.cpp +++ b/indra/test/llevents_tut.cpp @@ -21,6 +21,7 @@ #define testable public #include "llevents.h" #undef testable +#include "lllistenerwrapper.h" // STL headers // std headers #include <iostream> @@ -639,6 +640,33 @@ namespace tut heaptest.post(2); } + template<> template<> + void events_object::test<15>() + { + // This test ensures that using an LLListenerWrapper subclass doesn't + // block Boost.Signals2 from recognizing a bound LLEventTrackable + // subclass. + set_test_name("listen(llwrap<LLLogListener>(boost::bind(...TempTrackableListener ref...)))"); + bool live = false; + LLEventPump& heaptest(pumps.obtain("heaptest")); + LLBoundListener connection; + { + TempTrackableListener tempListener("temp", live); + ensure("TempTrackableListener constructed", live); + connection = heaptest.listen(tempListener.getName(), + llwrap<LLLogListener>( + boost::bind(&TempTrackableListener::call, + boost::ref(tempListener), _1))); + heaptest.post(1); + check_listener("received", tempListener, 1); + } // presumably this will make tempListener go away? + // verify that + ensure("TempTrackableListener destroyed", ! live); + ensure("implicit disconnect", ! connection.connected()); + // now just make sure we don't blow up trying to access a freed object! + heaptest.post(2); + } + class TempSharedListener: public TempListener, public boost::enable_shared_from_this<TempSharedListener> { @@ -649,7 +677,7 @@ namespace tut }; template<> template<> - void events_object::test<15>() + void events_object::test<16>() { set_test_name("listen(boost::bind(...TempSharedListener ref...))"); #if 0 diff --git a/indra/test/llsdutil_tut.cpp b/indra/test/llsdutil_tut.cpp index d125bb0005..aebb1f9770 100644 --- a/indra/test/llsdutil_tut.cpp +++ b/indra/test/llsdutil_tut.cpp @@ -207,7 +207,7 @@ namespace tut map.insert("Date", LLSD::Date()); map.insert("URI", LLSD::URI()); map.insert("Binary", LLSD::Binary()); - map.insert("Map", LLSD().insert("foo", LLSD())); + map.insert("Map", LLSD().with("foo", LLSD())); // Only an empty array can be constructed on the fly LLSD array; array.append(LLSD()); diff --git a/indra/viewer_components/login/tests/lllogin_test.cpp b/indra/viewer_components/login/tests/lllogin_test.cpp index 99ea796ad0..69a8424e87 100644 --- a/indra/viewer_components/login/tests/lllogin_test.cpp +++ b/indra/viewer_components/login/tests/lllogin_test.cpp @@ -29,6 +29,20 @@ #include "llevents.h" #include "stringize.h" +#if LL_WINDOWS +#define skipwin(arg) skip(arg) +#define skipmac(arg) +#define skiplinux(arg) +#elif LL_DARWIN +#define skipwin(arg) +#define skipmac(arg) skip(arg) +#define skiplinux(arg) +#elif LL_LINUX +#define skipwin(arg) +#define skipmac(arg) +#define skiplinux(arg) skip(arg) +#endif + /***************************************************************************** * Helper classes *****************************************************************************/ @@ -416,8 +430,7 @@ namespace tut ensure_equals("Failed to offline", listener.lastEvent()["state"].asString(), "offline"); } -/* - template<> template<> + template<> template<> void llviewerlogin_object::test<5>() { DEBUG; @@ -452,5 +465,4 @@ namespace tut ensure_equals("SRV Failure", listener.lastEvent()["change"].asString(), "fail.login"); } -*/ } |