diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2019-11-12 15:40:14 +0000 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2019-11-12 15:40:14 +0000 |
commit | 38d8eaba3e6e17dd39c9e9904852c14c95179783 (patch) | |
tree | 0703ba92d765b6d324eefa0d6a0de8fc6910f8cd | |
parent | 63f82fc44b721b0ec437845d41b5a2055a44be68 (diff) | |
parent | 78bdf57ad6610b34389226bf941ba736ca0c2225 (diff) |
merge
460 files changed, 8009 insertions, 6747 deletions
@@ -551,3 +551,8 @@ a3143db58a0f6b005232bf9018e7fef17ff9ec90 6.1.0-release ec09daf1899c1c01c4ba0ba950fae572f2a612a8 6.2.2-release ab2ec5c5423b277d23fd0511ce50c15123ff2e03 6.2.3-release 67297f9902857e357570c44722ad84de3aff974e 6.2.4-release +9777aec6dc4a30a24537297ac040861ce16b82ae 6.3.0-release +ece699718f163921717bb95a6131e94af4c4138f 6.3.1-release +07f5d5bc9faebb45695853d40a9549773db816c0 6.3.2-release +d9a4bd15e2c852953d6c8e84d6f3b7ca442c0e7f 6.3.3-release +4033b3f57e76f087235145a3016886ccdc87ffa3 6.3.4-release diff --git a/autobuild.xml b/autobuild.xml index 5f072512c1..88db33e317 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -2918,7 +2918,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <key>license</key> <string>Mixed</string> <key>license_file</key> - <string>LICENSES/slvoice.txt</string> + <string>LICENSES/vivox_licenses.txt</string> <key>name</key> <string>slvoice</string> <key>platforms</key> @@ -2940,9 +2940,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <key>archive</key> <map> <key>hash</key> - <string>a605ec940768c878527d3b8f2ff61288</string> + <string>f824d586ab5de6edd14ef6828e9e4b66</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/21421/157284/slvoice-4.9.0002.30313.517593-darwin64-517593.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/44719/395040/slvoice-4.10.0000.32327.5fc3fe7c.531581-darwin64-531581.tar.bz2</string> </map> <key>name</key> <string>darwin64</string> @@ -2976,9 +2976,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <key>archive</key> <map> <key>hash</key> - <string>5a78539626b5f23522d0b466247f48b4</string> + <string>1941c17c81905f23b4928288bcf719fb</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/21422/157291/slvoice-4.9.0002.30313.517593-windows-517593.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/44720/395047/slvoice-4.10.0000.32327.5fc3fe7c.531581-windows-531581.tar.bz2</string> </map> <key>name</key> <string>windows</string> @@ -2988,16 +2988,16 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <key>archive</key> <map> <key>hash</key> - <string>1f8e09c053c00d9dc44ea74568e63dc1</string> + <string>baa6cdc8e8762d5519996ed9faa0bf3f</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/21423/157298/slvoice-4.9.0002.30313.517593-windows64-517593.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/44721/395056/slvoice-4.10.0000.32327.5fc3fe7c.531581-windows64-531581.tar.bz2</string> </map> <key>name</key> <string>windows64</string> </map> </map> <key>version</key> - <string>4.9.0002.30313.517593</string> + <string>4.10.0000.32327.5fc3fe7c.531581</string> </map> <key>tut</key> <map> @@ -3138,9 +3138,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <key>archive</key> <map> <key>hash</key> - <string>aaf04f5ed1d28477781d976dc04871ee</string> + <string>42066e2447c7a3359784438d16510992</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/31904/266163/viewer_manager-2.0.524157-darwin64-524157.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/40539/348124/viewer_manager-2.0.529188-darwin64-529188.tar.bz2</string> </map> <key>name</key> <string>darwin64</string> @@ -3162,9 +3162,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <key>archive</key> <map> <key>hash</key> - <string>4604624f11b215b052f4a840f4da4bf8</string> + <string>ca230428635ce13cb7ace0f9522f8546</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/31906/266177/viewer_manager-2.0.524157-windows-524157.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/40538/348130/viewer_manager-2.0.529188-windows-529188.tar.bz2</string> </map> <key>name</key> <string>windows</string> @@ -3175,7 +3175,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <key>source_type</key> <string>hg</string> <key>version</key> - <string>2.0.524157</string> + <string>2.0.529188</string> </map> <key>vlc-bin</key> <map> diff --git a/doc/contributions.txt b/doc/contributions.txt index 466dffded7..ca2e63cf9f 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1073,6 +1073,7 @@ Nicky Dasmijn MAINT-6665 SL-10291 SL-10293 + SL-11061 Nicky Perian OPEN-1 STORM-1087 @@ -1447,6 +1448,7 @@ Tonya Souther STORM-1905 BUG-3875 BUG-3968 + OPEN-345 Torben Trautman TouchaHoney Perhaps TraductoresAnonimos Alter diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 6c20a813ba..62a8f3f003 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -3,8 +3,8 @@ # cmake_minimum_required should appear before any # other commands to guarantee full compatibility # with the version specified -## prior to 3.4, the Windows manifest handling was missing -cmake_minimum_required(VERSION 3.4.0 FATAL_ERROR) +## 3.8 added VS_DEBUGGER_WORKING_DIRECTORY support +cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR) set(ROOT_PROJECT_NAME "SecondLife" CACHE STRING "The root project/makefile/solution name. Defaults to SecondLife.") @@ -83,6 +83,12 @@ add_dependencies(viewer secondlife-bin) add_subdirectory(${VIEWER_PREFIX}doxygen EXCLUDE_FROM_ALL) +# sets the 'startup project' for debugging from visual studio. +set_property( + DIRECTORY ${VIEWER_PREFIX} + PROPERTY VS_STARTUP_PROJECT secondlife-bin + ) + if (LL_TESTS) # Define after the custom targets are created so # individual apps can add themselves as dependencies diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 40fc706a99..03da30649a 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -151,6 +151,8 @@ endif (LINUX) if (DARWIN) + # Warnings should be fatal -- thanks, Nicky Perian, for spotting reversed default + set(CLANG_DISABLE_FATAL_WARNINGS OFF) set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}") set(DARWIN_extra_cstar_flags "-Wno-unused-local-typedef -Wno-deprecated-declarations") diff --git a/indra/cmake/BuildPackagesInfo.cmake b/indra/cmake/BuildPackagesInfo.cmake index 93461cea95..4314cca33d 100644 --- a/indra/cmake/BuildPackagesInfo.cmake +++ b/indra/cmake/BuildPackagesInfo.cmake @@ -8,7 +8,7 @@ include(Python) # building in an IDE, it probably isn't. Set it explicitly using # run_build_test.py. add_custom_command(OUTPUT packages-info.txt - COMMENT Generating packages-info.txt for the about box + COMMENT "Generating packages-info.txt for the about box" MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/../autobuild.xml DEPENDS ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py ${CMAKE_SOURCE_DIR}/../autobuild.xml diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index dde53835fb..c73a1fdb47 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -17,17 +17,16 @@ if(WINDOWS) #******************************* # VIVOX - *NOTE: no debug version - set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") - set(vivox_files - SLVoice.exe - ) + set(vivox_lib_dir "${ARCH_PREBUILT_DIRS_RELEASE}") + set(slvoice_src_dir "${ARCH_PREBUILT_BIN_RELEASE}") + set(slvoice_files SLVoice.exe ) if (ADDRESS_SIZE EQUAL 64) - list(APPEND vivox_files + list(APPEND vivox_libs vivoxsdk_x64.dll ortp_x64.dll ) else (ADDRESS_SIZE EQUAL 64) - list(APPEND vivox_files + list(APPEND vivox_libs vivoxsdk.dll ortp.dll ) @@ -169,11 +168,10 @@ elseif(DARWIN) set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/Resources") set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release/Resources") - set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") - set(vivox_files - SLVoice + set(vivox_lib_dir "${ARCH_PREBUILT_DIRS_RELEASE}") + set(slvoice_files SLVoice) + set(vivox_libs libortp.dylib - libvivoxplatform.dylib libvivoxsdk.dylib ) set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}") @@ -206,15 +204,15 @@ elseif(LINUX) set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}") set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}") - set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") - set(vivox_files + set(vivox_lib_dir "${ARCH_PREBUILT_DIRS_RELEASE}") + set(vivox_libs libsndfile.so.1 libortp.so libvivoxoal.so.1 - libvivoxplatform.so libvivoxsdk.so - SLVoice - ) + ) + set(slvoice_files SLVoice) + # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables # or ARCH_PREBUILT_DIRS set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}") @@ -251,8 +249,8 @@ elseif(LINUX) else(WINDOWS) message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...") - set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux") - set(vivox_files "") + set(vivox_lib_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux") + set(vivox_libs "") # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables # or ARCH_PREBUILT_DIRS set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/debug") @@ -275,39 +273,36 @@ endif(WINDOWS) ################################################################ copy_if_different( - ${vivox_src_dir} + ${vivox_lib_dir} "${SHARED_LIB_STAGING_DIR_DEBUG}" out_targets - ${vivox_files} + ${vivox_libs} ) set(third_party_targets ${third_party_targets} ${out_targets}) copy_if_different( - ${vivox_src_dir} + ${slvoice_src_dir} + "${SHARED_LIB_STAGING_DIR_RELEASE}" + out_targets + ${slvoice_files} + ) +copy_if_different( + ${vivox_lib_dir} "${SHARED_LIB_STAGING_DIR_RELEASE}" out_targets - ${vivox_files} + ${vivox_libs} ) + set(third_party_targets ${third_party_targets} ${out_targets}) copy_if_different( - ${vivox_src_dir} + ${vivox_lib_dir} "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}" out_targets - ${vivox_files} + ${vivox_libs} ) set(third_party_targets ${third_party_targets} ${out_targets}) - - -#copy_if_different( -# ${debug_src_dir} -# "${SHARED_LIB_STAGING_DIR_DEBUG}" -# out_targets -# ${debug_files} -# ) -#set(third_party_targets ${third_party_targets} ${out_targets}) - copy_if_different( ${release_src_dir} "${SHARED_LIB_STAGING_DIR_RELEASE}" diff --git a/indra/lib/python/indra/util/llmanifest.py b/indra/lib/python/indra/util/llmanifest.py index 2e6cf53912..4bc70b2ca4 100755 --- a/indra/lib/python/indra/util/llmanifest.py +++ b/indra/lib/python/indra/util/llmanifest.py @@ -27,6 +27,7 @@ THE SOFTWARE. $/LicenseInfo$ """ +from collections import namedtuple, defaultdict import commands import errno import filecmp @@ -312,6 +313,8 @@ class LLManifestRegistry(type): if match: cls.manifests[match.group(1).lower()] = cls +MissingFile = namedtuple("MissingFile", ("pattern", "tried")) + class LLManifest(object): __metaclass__ = LLManifestRegistry manifests = {} @@ -333,7 +336,8 @@ class LLManifest(object): self.dst_prefix = [args['dest']] self.created_paths = [] self.package_name = "Unknown" - + self.missing = [] + def default_channel(self): return self.args.get('channel', None) == RELEASE_CHANNEL @@ -592,6 +596,40 @@ class LLManifest(object): def package_action(self, src, dst): pass + def finish(self): + """ + generic finish, always called before the ${action}_finish() methods + """ + # Collecting MissingFile instances in self.missing, and checking that + # here, is intended to minimize the number of (potentially lengthy) + # build cycles a developer must run in order to fix missing-files + # errors. The manifest processing is necessarily the last step in a + # build, and if we only caught a single missing file error per run, + # the developer would need to run a build for each additional missing- + # file error until all were resolved. This way permits the developer + # to resolve them all at once. + if self.missing: + print '*' * 72 + print "Missing files:" + # Instead of just dumping each missing file and all the places we + # looked for it, group by common sets of places we looked. Use a + # set to store the 'tried' directories, to avoid mismatches due to + # reordering -- but since we intend to use the set of 'tried' + # directories as a dict key, it must be a frozenset. + organize = defaultdict(set) + for missingfile in self.missing: + organize[frozenset(missingfile.tried)].add(missingfile.pattern) + # Now dump all the patterns sought in each group of 'tried' + # directories. + for tried, patterns in organize.items(): + print " Could not find in:" + for dir in sorted(tried): + print " %s" % dir + for pattern in sorted(patterns): + print " %s" % pattern + print '*' * 72 + raise MissingError('%s patterns could not be found' % len(self.missing)) + def copy_finish(self): pass @@ -825,17 +863,23 @@ class LLManifest(object): return count try_prefixes = [self.get_src_prefix(), self.get_artwork_prefix(), self.get_build_prefix()] - tried=[] - count=0 - while not count and try_prefixes: - pfx = try_prefixes.pop(0) + for pfx in try_prefixes: try: count = try_path(os.path.join(pfx, src)) except MissingError: - tried.append(pfx) - if not try_prefixes: - # no more prefixes left to try - print "unable to find '%s'; looked in:\n %s" % (src, '\n '.join(tried)) + # if we produce MissingError, just try the next prefix + continue + # If we actually found nonzero files, stop looking + if count: + break + else: + # no more prefixes left to try + print("\nunable to find '%s'; looked in:\n %s" % (src, '\n '.join(try_prefixes))) + self.missing.append(MissingFile(pattern=src, tried=try_prefixes)) + # At this point 'count' might never have been successfully + # assigned! Even if it was, though, we can be sure it is 0. + return 0 + print "%d files" % count # Let caller check whether we processed as many files as expected. In @@ -846,6 +890,8 @@ class LLManifest(object): self.actions = actions self.construct() # perform finish actions + # generic finish first + self.finish() for action in self.actions: methodname = action + "_finish" method = getattr(self, methodname, None) diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 38cda2e2f1..e60037b739 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -1482,6 +1482,21 @@ BOOL LLAvatarAppearance::teToColorParams( ETextureIndex te, U32 *param_name ) param_name[0] = 1071; //"tattoo_red"; param_name[1] = 1072; //"tattoo_green"; param_name[2] = 1073; //"tattoo_blue"; + break; + case TEX_HEAD_UNIVERSAL_TATTOO: + case TEX_UPPER_UNIVERSAL_TATTOO: + case TEX_LOWER_UNIVERSAL_TATTOO: + case TEX_SKIRT_TATTOO: + case TEX_HAIR_TATTOO: + case TEX_EYES_TATTOO: + case TEX_LEFT_ARM_TATTOO: + case TEX_LEFT_LEG_TATTOO: + case TEX_AUX1_TATTOO: + case TEX_AUX2_TATTOO: + case TEX_AUX3_TATTOO: + param_name[0] = 1238; //"tattoo_universal_red"; + param_name[1] = 1239; //"tattoo_universal_green"; + param_name[2] = 1240; //"tattoo_universal_blue"; break; default: diff --git a/indra/llappearance/llavatarappearancedefines.cpp b/indra/llappearance/llavatarappearancedefines.cpp index b5282d4f6f..c72943bb82 100644 --- a/indra/llappearance/llavatarappearancedefines.cpp +++ b/indra/llappearance/llavatarappearancedefines.cpp @@ -26,9 +26,10 @@ #include "linden_common.h" #include "llavatarappearancedefines.h" +#include "indra_constants.h" -const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH = 512; -const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT = 512; +const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH = 1024; +const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT = 1024; const S32 LLAvatarAppearanceDefines::IMPOSTOR_PERIOD = 2; using namespace LLAvatarAppearanceDefines; @@ -65,12 +66,30 @@ LLAvatarAppearanceDictionary::Textures::Textures() addEntry(TEX_UPPER_TATTOO, new TextureEntry("upper_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); addEntry(TEX_LOWER_TATTOO, new TextureEntry("lower_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); + addEntry(TEX_HEAD_UNIVERSAL_TATTOO, new TextureEntry("head_universal_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_UPPER_UNIVERSAL_TATTOO, new TextureEntry("upper_universal_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_LOWER_UNIVERSAL_TATTOO, new TextureEntry("lower_universal_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_SKIRT_TATTOO, new TextureEntry("skirt_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_HAIR_TATTOO, new TextureEntry("hair_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_EYES_TATTOO, new TextureEntry("eyes_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_LEFT_ARM_TATTOO, new TextureEntry("leftarm_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_LEFT_LEG_TATTOO, new TextureEntry("leftleg_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_AUX1_TATTOO, new TextureEntry("aux1_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_AUX2_TATTOO, new TextureEntry("aux2_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_AUX3_TATTOO, new TextureEntry("aux3_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + + addEntry(TEX_HEAD_BAKED, new TextureEntry("head-baked", FALSE, BAKED_HEAD, "head")); addEntry(TEX_UPPER_BAKED, new TextureEntry("upper-baked", FALSE, BAKED_UPPER, "upper")); addEntry(TEX_LOWER_BAKED, new TextureEntry("lower-baked", FALSE, BAKED_LOWER, "lower")); addEntry(TEX_EYES_BAKED, new TextureEntry("eyes-baked", FALSE, BAKED_EYES, "eyes")); addEntry(TEX_HAIR_BAKED, new TextureEntry("hair-baked", FALSE, BAKED_HAIR, "hair")); addEntry(TEX_SKIRT_BAKED, new TextureEntry("skirt-baked", FALSE, BAKED_SKIRT, "skirt")); + addEntry(TEX_LEFT_ARM_BAKED, new TextureEntry("leftarm-baked", FALSE, BAKED_LEFT_ARM, "leftarm")); + addEntry(TEX_LEFT_LEG_BAKED, new TextureEntry("leftleg-baked", FALSE, BAKED_LEFT_LEG, "leftleg")); + addEntry(TEX_AUX1_BAKED, new TextureEntry("aux1-baked", FALSE, BAKED_AUX1, "aux1")); + addEntry(TEX_AUX2_BAKED, new TextureEntry("aux2-baked", FALSE, BAKED_AUX2, "aux2")); + addEntry(TEX_AUX3_BAKED, new TextureEntry("aux3-baked", FALSE, BAKED_AUX3, "aux3")); } LLAvatarAppearanceDictionary::BakedTextures::BakedTextures() @@ -78,35 +97,60 @@ LLAvatarAppearanceDictionary::BakedTextures::BakedTextures() // Baked textures addEntry(BAKED_HEAD, new BakedEntry(TEX_HEAD_BAKED, "head", "a4b9dc38-e13b-4df9-b284-751efb0566ff", - 3, TEX_HEAD_BODYPAINT, TEX_HEAD_TATTOO, TEX_HEAD_ALPHA, - 5, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN, LLWearableType::WT_HAIR, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA)); + 4, TEX_HEAD_BODYPAINT, TEX_HEAD_TATTOO, TEX_HEAD_ALPHA, TEX_HEAD_UNIVERSAL_TATTOO, + 6, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN, LLWearableType::WT_HAIR, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA, LLWearableType::WT_UNIVERSAL)); addEntry(BAKED_UPPER, new BakedEntry(TEX_UPPER_BAKED, "upper_body", "5943ff64-d26c-4a90-a8c0-d61f56bd98d4", - 7, TEX_UPPER_SHIRT,TEX_UPPER_BODYPAINT, TEX_UPPER_JACKET, - TEX_UPPER_GLOVES, TEX_UPPER_UNDERSHIRT, TEX_UPPER_TATTOO, TEX_UPPER_ALPHA, - 8, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN, LLWearableType::WT_SHIRT, LLWearableType::WT_JACKET, LLWearableType::WT_GLOVES, LLWearableType::WT_UNDERSHIRT, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA)); + 8, TEX_UPPER_SHIRT,TEX_UPPER_BODYPAINT, TEX_UPPER_JACKET, + TEX_UPPER_GLOVES, TEX_UPPER_UNDERSHIRT, TEX_UPPER_TATTOO, TEX_UPPER_ALPHA, TEX_UPPER_UNIVERSAL_TATTOO, + 9, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN, LLWearableType::WT_SHIRT, LLWearableType::WT_JACKET, LLWearableType::WT_GLOVES, LLWearableType::WT_UNDERSHIRT, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA, LLWearableType::WT_UNIVERSAL)); addEntry(BAKED_LOWER, new BakedEntry(TEX_LOWER_BAKED, "lower_body", "2944ee70-90a7-425d-a5fb-d749c782ed7d", - 8, TEX_LOWER_PANTS,TEX_LOWER_BODYPAINT,TEX_LOWER_SHOES, TEX_LOWER_SOCKS, - TEX_LOWER_JACKET, TEX_LOWER_UNDERPANTS, TEX_LOWER_TATTOO, TEX_LOWER_ALPHA, - 9, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN, LLWearableType::WT_PANTS, LLWearableType::WT_SHOES, LLWearableType::WT_SOCKS, LLWearableType::WT_JACKET, LLWearableType::WT_UNDERPANTS, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA)); + 9, TEX_LOWER_PANTS,TEX_LOWER_BODYPAINT,TEX_LOWER_SHOES, TEX_LOWER_SOCKS, + TEX_LOWER_JACKET, TEX_LOWER_UNDERPANTS, TEX_LOWER_TATTOO, TEX_LOWER_ALPHA, TEX_LOWER_UNIVERSAL_TATTOO, + 10, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN, LLWearableType::WT_PANTS, LLWearableType::WT_SHOES, LLWearableType::WT_SOCKS, LLWearableType::WT_JACKET, LLWearableType::WT_UNDERPANTS, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA, LLWearableType::WT_UNIVERSAL)); addEntry(BAKED_EYES, new BakedEntry(TEX_EYES_BAKED, "eyes", "27b1bc0f-979f-4b13-95fe-b981c2ba9788", - 2, TEX_EYES_IRIS, TEX_EYES_ALPHA, - 2, LLWearableType::WT_EYES, LLWearableType::WT_ALPHA)); + 3, TEX_EYES_IRIS, TEX_EYES_TATTOO, TEX_EYES_ALPHA, + 3, LLWearableType::WT_EYES, LLWearableType::WT_UNIVERSAL, LLWearableType::WT_ALPHA)); addEntry(BAKED_SKIRT, new BakedEntry(TEX_SKIRT_BAKED, "skirt", "03e7e8cb-1368-483b-b6f3-74850838ba63", - 1, TEX_SKIRT, - 1, LLWearableType::WT_SKIRT)); + 2, TEX_SKIRT, TEX_SKIRT_TATTOO, + 2, LLWearableType::WT_SKIRT, LLWearableType::WT_UNIVERSAL )); addEntry(BAKED_HAIR, new BakedEntry(TEX_HAIR_BAKED, "hair", "a60e85a9-74e8-48d8-8a2d-8129f28d9b61", - 2, TEX_HAIR, TEX_HAIR_ALPHA, - 2, LLWearableType::WT_HAIR, LLWearableType::WT_ALPHA)); + 3, TEX_HAIR, TEX_HAIR_TATTOO, TEX_HAIR_ALPHA, + 3, LLWearableType::WT_HAIR, LLWearableType::WT_UNIVERSAL, LLWearableType::WT_ALPHA)); + + addEntry(BAKED_LEFT_ARM, new BakedEntry(TEX_LEFT_ARM_BAKED, + "leftarm", "9f39febf-22d7-0087-79d1-e9e8c6c9ed19", + 1, TEX_LEFT_ARM_TATTOO, + 1, LLWearableType::WT_UNIVERSAL)); + + addEntry(BAKED_LEFT_LEG, new BakedEntry(TEX_LEFT_LEG_BAKED, + "leftleg", "054a7a58-8ed5-6386-0add-3b636fb28b78", + 1, TEX_LEFT_LEG_TATTOO, + 1, LLWearableType::WT_UNIVERSAL)); + + addEntry(BAKED_AUX1, new BakedEntry(TEX_AUX1_BAKED, + "aux1", "790c11be-b25c-c17e-b4d2-6a4ad786b752", + 1, TEX_AUX1_TATTOO, + 1, LLWearableType::WT_UNIVERSAL)); + + addEntry(BAKED_AUX2, new BakedEntry(TEX_AUX2_BAKED, + "aux2", "d78c478f-48c7-5928-5864-8d99fb1f521e", + 1, TEX_AUX2_TATTOO, + 1, LLWearableType::WT_UNIVERSAL)); + + addEntry(BAKED_AUX3, new BakedEntry(TEX_AUX3_BAKED, + "aux3", "6a95dd53-edd9-aac8-f6d3-27ed99f3c3eb", + 1, TEX_AUX3_TATTOO, + 1, LLWearableType::WT_UNIVERSAL)); } LLAvatarAppearanceDictionary::MeshEntries::MeshEntries() @@ -265,3 +309,113 @@ LLWearableType::EType LLAvatarAppearanceDictionary::getTEWearableType(ETextureIn { return getInstance()->getTexture(index)->mWearableType; } + +// static +BOOL LLAvatarAppearanceDictionary::isBakedImageId(const LLUUID& id) +{ + if ((id == IMG_USE_BAKED_EYES) || (id == IMG_USE_BAKED_HAIR) || (id == IMG_USE_BAKED_HEAD) || (id == IMG_USE_BAKED_LOWER) || (id == IMG_USE_BAKED_SKIRT) || (id == IMG_USE_BAKED_UPPER) + || (id == IMG_USE_BAKED_LEFTARM) || (id == IMG_USE_BAKED_LEFTLEG) || (id == IMG_USE_BAKED_AUX1) || (id == IMG_USE_BAKED_AUX2) || (id == IMG_USE_BAKED_AUX3) ) + { + return TRUE; + } + + return FALSE; +} + +// static +EBakedTextureIndex LLAvatarAppearanceDictionary::assetIdToBakedTextureIndex(const LLUUID& id) +{ + if (id == IMG_USE_BAKED_EYES) + { + return BAKED_EYES; + } + else if (id == IMG_USE_BAKED_HAIR) + { + return BAKED_HAIR; + } + else if (id == IMG_USE_BAKED_HEAD) + { + return BAKED_HEAD; + } + else if (id == IMG_USE_BAKED_LOWER) + { + return BAKED_LOWER; + } + else if (id == IMG_USE_BAKED_SKIRT) + { + return BAKED_SKIRT; + } + else if (id == IMG_USE_BAKED_UPPER) + { + return BAKED_UPPER; + } + else if (id == IMG_USE_BAKED_LEFTARM) + { + return BAKED_LEFT_ARM; + } + else if (id == IMG_USE_BAKED_LEFTLEG) + { + return BAKED_LEFT_LEG; + } + else if (id == IMG_USE_BAKED_AUX1) + { + return BAKED_AUX1; + } + else if (id == IMG_USE_BAKED_AUX2) + { + return BAKED_AUX2; + } + else if (id == IMG_USE_BAKED_AUX3) + { + return BAKED_AUX3; + } + + return BAKED_NUM_INDICES; +} + +//static +LLUUID LLAvatarAppearanceDictionary::localTextureIndexToMagicId(ETextureIndex t) +{ + LLUUID id = LLUUID::null; + + switch (t) + { + case LLAvatarAppearanceDefines::TEX_HEAD_BAKED: + id = IMG_USE_BAKED_HEAD; + break; + case LLAvatarAppearanceDefines::TEX_UPPER_BAKED: + id = IMG_USE_BAKED_UPPER; + break; + case LLAvatarAppearanceDefines::TEX_LOWER_BAKED: + id = IMG_USE_BAKED_LOWER; + break; + case LLAvatarAppearanceDefines::TEX_EYES_BAKED: + id = IMG_USE_BAKED_EYES; + break; + case LLAvatarAppearanceDefines::TEX_SKIRT_BAKED: + id = IMG_USE_BAKED_SKIRT; + break; + case LLAvatarAppearanceDefines::TEX_HAIR_BAKED: + id = IMG_USE_BAKED_HAIR; + break; + case LLAvatarAppearanceDefines::TEX_LEFT_ARM_BAKED: + id = IMG_USE_BAKED_LEFTARM; + break; + case LLAvatarAppearanceDefines::TEX_LEFT_LEG_BAKED: + id = IMG_USE_BAKED_LEFTLEG; + break; + case LLAvatarAppearanceDefines::TEX_AUX1_BAKED: + id = IMG_USE_BAKED_AUX1; + break; + case LLAvatarAppearanceDefines::TEX_AUX2_BAKED: + id = IMG_USE_BAKED_AUX2; + break; + case LLAvatarAppearanceDefines::TEX_AUX3_BAKED: + id = IMG_USE_BAKED_AUX3; + break; + default: + break; + } + + return id; +} diff --git a/indra/llappearance/llavatarappearancedefines.h b/indra/llappearance/llavatarappearancedefines.h index d6223bb4d2..5663d24293 100644 --- a/indra/llappearance/llavatarappearancedefines.h +++ b/indra/llappearance/llavatarappearancedefines.h @@ -78,6 +78,22 @@ enum ETextureIndex TEX_HEAD_TATTOO, TEX_UPPER_TATTOO, TEX_LOWER_TATTOO, + TEX_HEAD_UNIVERSAL_TATTOO, + TEX_UPPER_UNIVERSAL_TATTOO, + TEX_LOWER_UNIVERSAL_TATTOO, + TEX_SKIRT_TATTOO, + TEX_HAIR_TATTOO, + TEX_EYES_TATTOO, + TEX_LEFT_ARM_TATTOO, + TEX_LEFT_LEG_TATTOO, + TEX_AUX1_TATTOO, + TEX_AUX2_TATTOO, + TEX_AUX3_TATTOO, + TEX_LEFT_ARM_BAKED, // Pre-composited + TEX_LEFT_LEG_BAKED, // Pre-composited + TEX_AUX1_BAKED, // Pre-composited + TEX_AUX2_BAKED, // Pre-composited + TEX_AUX3_BAKED, // Pre-composited TEX_NUM_INDICES }; @@ -89,6 +105,11 @@ enum EBakedTextureIndex BAKED_EYES, BAKED_SKIRT, BAKED_HAIR, + BAKED_LEFT_ARM, + BAKED_LEFT_LEG, + BAKED_AUX1, + BAKED_AUX2, + BAKED_AUX3, BAKED_NUM_INDICES }; @@ -223,6 +244,10 @@ public: // Given a texture entry, determine which wearable type owns it. static LLWearableType::EType getTEWearableType(ETextureIndex index); + static BOOL isBakedImageId(const LLUUID& id); + static EBakedTextureIndex assetIdToBakedTextureIndex(const LLUUID& id); + static LLUUID localTextureIndexToMagicId(ETextureIndex t); + }; // End LLAvatarAppearanceDictionary } // End namespace LLAvatarAppearanceDefines diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index 3f2fcce429..186986bf9c 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -1581,8 +1581,8 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC // nSight doesn't support use of glReadPixels if (!LLRender::sNsightDebugSupport) { - glReadPixels(x, y, width, height, GL_ALPHA, GL_UNSIGNED_BYTE, alpha_data); - } + glReadPixels(x, y, width, height, GL_ALPHA, GL_UNSIGNED_BYTE, alpha_data); + } } getTexLayerSet()->getAvatarAppearance()->dirtyMesh(); diff --git a/indra/llappearance/llwearabletype.cpp b/indra/llappearance/llwearabletype.cpp index cd602b43b4..6b7dc41ffd 100644 --- a/indra/llappearance/llwearabletype.cpp +++ b/indra/llappearance/llwearabletype.cpp @@ -29,18 +29,6 @@ #include "llinventorytype.h" #include "llinventorydefines.h" -static LLTranslationBridge* sTrans = NULL; - -// static -void LLWearableType::initClass(LLTranslationBridge* trans) -{ - sTrans = trans; -} - -void LLWearableType::cleanupClass() -{ - delete sTrans; -} struct WearableEntry : public LLDictionaryEntry { @@ -53,7 +41,7 @@ struct WearableEntry : public LLDictionaryEntry LLDictionaryEntry(name), mAssetType(assetType), mDefaultNewName(default_new_name), - mLabel(sTrans->getString(name)), + mLabel(LLWearableType::getInstance()->mTrans->getString(name)), mIconName(iconName), mDisableCameraSwitch(disable_camera_switch), mAllowMultiwear(allow_multiwear) @@ -68,7 +56,7 @@ struct WearableEntry : public LLDictionaryEntry BOOL mAllowMultiwear; }; -class LLWearableDictionary : public LLSingleton<LLWearableDictionary>, +class LLWearableDictionary : public LLParamSingleton<LLWearableDictionary>, public LLDictionary<LLWearableType::EType, WearableEntry> { LLSINGLETON(LLWearableDictionary); @@ -91,6 +79,7 @@ LLWearableDictionary::LLWearableDictionary() addEntry(LLWearableType::WT_SKIRT, new WearableEntry("skirt", "New Skirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SKIRT, FALSE, TRUE)); addEntry(LLWearableType::WT_ALPHA, new WearableEntry("alpha", "New Alpha", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_ALPHA, FALSE, TRUE)); addEntry(LLWearableType::WT_TATTOO, new WearableEntry("tattoo", "New Tattoo", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_TATTOO, FALSE, TRUE)); + addEntry(LLWearableType::WT_UNIVERSAL, new WearableEntry("universal", "New Universal", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNIVERSAL, FALSE, TRUE)); addEntry(LLWearableType::WT_PHYSICS, new WearableEntry("physics", "New Physics", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PHYSICS, TRUE, TRUE)); @@ -98,6 +87,27 @@ LLWearableDictionary::LLWearableDictionary() addEntry(LLWearableType::WT_NONE, new WearableEntry("none", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryType::ICONNAME_NONE, FALSE, FALSE)); } + +// class LLWearableType + +LLWearableType::LLWearableType(LLTranslationBridge* trans) +{ + mTrans = trans; +} + +LLWearableType::~LLWearableType() +{ + delete mTrans; +} + +void LLWearableType::initSingleton() +{ + // To make sure all wrapping functions will crash without initing LLWearableType; + LLWearableDictionary::initParamSingleton(); + + // Todo: consider merging LLWearableType and LLWearableDictionary +} + // static LLWearableType::EType LLWearableType::typeNameToType(const std::string& type_name) { diff --git a/indra/llappearance/llwearabletype.h b/indra/llappearance/llwearabletype.h index 519d5b92a2..80bb9a10b4 100644 --- a/indra/llappearance/llwearabletype.h +++ b/indra/llappearance/llwearabletype.h @@ -42,8 +42,12 @@ public: }; -class LLWearableType +class LLWearableType : public LLParamSingleton<LLWearableType> { + LLSINGLETON(LLWearableType, LLTranslationBridge* trans); + ~LLWearableType(); + friend struct WearableEntry; + void initSingleton(); public: enum EType { @@ -63,15 +67,15 @@ public: WT_ALPHA = 13, WT_TATTOO = 14, WT_PHYSICS = 15, - WT_COUNT = 16, + WT_UNIVERSAL = 16, + WT_COUNT = 17, WT_INVALID = 255, WT_NONE = -1, }; - static void initClass(LLTranslationBridge* trans); // initializes static members - static void cleanupClass(); // initializes static members - + // Most methods are wrappers for dictionary, but if LLWearableType is not initialized, + // they will crash. Whole LLWearableType is just wrapper for convinient calls. static const std::string& getTypeName(EType type); static const std::string& getTypeDefaultNewName(EType type); static const std::string& getTypeLabel(EType type); @@ -80,11 +84,12 @@ public: static LLInventoryType::EIconName getIconName(EType type); static BOOL getDisableCameraSwitch(EType type); static BOOL getAllowMultiwear(EType type); - static EType inventoryFlagsToWearableType(U32 flags); + + static EType inventoryFlagsToWearableType(U32 flags); protected: - LLWearableType() {} - ~LLWearableType() {} + + LLTranslationBridge* mTrans; }; #endif // LL_LLWEARABLETYPE_H diff --git a/indra/llaudio/llvorbisencode.h b/indra/llaudio/llvorbisencode.h index 6b22a2cb59..7372765075 100644 --- a/indra/llaudio/llvorbisencode.h +++ b/indra/llaudio/llvorbisencode.h @@ -40,7 +40,7 @@ const S32 LLVORBISENC_UNSUPPORTED_WORD_SIZE = 9; // unsupported word size const S32 LLVORBISENC_CLIP_TOO_LONG = 10; // source file is too long const S32 LLVORBISENC_CHUNK_SIZE_ERR = 11; // chunk size is wrong -const F32 LLVORBIS_CLIP_MAX_TIME = 10.0f; +const F32 LLVORBIS_CLIP_MAX_TIME = 30.0f; const U8 LLVORBIS_CLIP_MAX_CHANNELS = 2; const U32 LLVORBIS_CLIP_SAMPLE_RATE = 44100; const U32 LLVORBIS_CLIP_MAX_SAMPLES_PER_CHANNEL = (U32)(LLVORBIS_CLIP_MAX_TIME * LLVORBIS_CLIP_SAMPLE_RATE); diff --git a/indra/llcommon/indra_constants.cpp b/indra/llcommon/indra_constants.cpp index 7ea42a3fc0..e13176e8fa 100644 --- a/indra/llcommon/indra_constants.cpp +++ b/indra/llcommon/indra_constants.cpp @@ -72,3 +72,15 @@ const LLUUID TERRAIN_ROCK_DETAIL ("53a2f406-4895-1d13-d541-d2e3b86bc19c"); // V const LLUUID DEFAULT_WATER_NORMAL ("822ded49-9a6c-f61c-cb89-6df54f42cdf4"); // VIEWER +const LLUUID IMG_USE_BAKED_HEAD ("5a9f4a74-30f2-821c-b88d-70499d3e7183"); +const LLUUID IMG_USE_BAKED_UPPER ("ae2de45c-d252-50b8-5c6e-19f39ce79317"); +const LLUUID IMG_USE_BAKED_LOWER ("24daea5f-0539-cfcf-047f-fbc40b2786ba"); +const LLUUID IMG_USE_BAKED_EYES ("52cc6bb6-2ee5-e632-d3ad-50197b1dcb8a"); +const LLUUID IMG_USE_BAKED_SKIRT ("43529ce8-7faa-ad92-165a-bc4078371687"); +const LLUUID IMG_USE_BAKED_HAIR ("09aac1fb-6bce-0bee-7d44-caac6dbb6c63"); +const LLUUID IMG_USE_BAKED_LEFTARM ("ff62763f-d60a-9855-890b-0c96f8f8cd98"); +const LLUUID IMG_USE_BAKED_LEFTLEG ("8e915e25-31d1-cc95-ae08-d58a47488251"); +const LLUUID IMG_USE_BAKED_AUX1 ("9742065b-19b5-297c-858a-29711d539043"); +const LLUUID IMG_USE_BAKED_AUX2 ("03642e83-2bd1-4eb9-34b4-4c47ed586d2d"); +const LLUUID IMG_USE_BAKED_AUX3 ("edd51b77-fc10-ce7a-4b3d-011dfc349e4f"); + diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index c0213d7c16..0fbf4b966b 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -206,6 +206,18 @@ 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; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_HEAD; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_UPPER; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_LOWER; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_EYES; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_SKIRT; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_HAIR; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_LEFTARM; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_LEFTLEG; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_AUX1; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_AUX2; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_AUX3; + LL_COMMON_API extern const LLUUID DEFAULT_WATER_NORMAL; diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 2024d707da..d463fc9d65 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -199,14 +199,10 @@ private: friend BlockTimer timeThisBlock(BlockTimerStatHandle&); BlockTimer(BlockTimerStatHandle& timer); -#if !defined(MSC_VER) || MSC_VER < 1700 - // Visual Studio 2010 has a bug where capturing an object returned by value - // into a local reference requires access to the copy constructor at the call site. - // This appears to be fixed in 2012. -public: -#endif + // no-copy - BlockTimer(const BlockTimer& other) {}; + BlockTimer(const BlockTimer& other); + BlockTimer& operator=(const BlockTimer& other); private: U64 mStartTime; diff --git a/indra/llcommon/llmortician.cpp b/indra/llcommon/llmortician.cpp index 287f096eae..93c7d520f2 100644 --- a/indra/llcommon/llmortician.cpp +++ b/indra/llcommon/llmortician.cpp @@ -37,6 +37,42 @@ LLMortician::~LLMortician() sGraveyard.remove(this); } +U32 LLMortician::logClass(std::stringstream &str) +{ + U32 size = sGraveyard.size(); + str << "Mortician graveyard count: " << size; + str << " Zealous: " << (sDestroyImmediate ? "True" : "False"); + if (size == 0) + { + return size; + } + str << " Output:\n"; + std::list<LLMortician*>::iterator iter = sGraveyard.begin(); + std::list<LLMortician*>::iterator end = sGraveyard.end(); + while (iter!=end) + { + LLMortician* dead = *iter; + iter++; + // Be as detailed and safe as possible to figure out issues + str << "Pointer: " << dead; + if (dead) + { + try + { + str << " Is dead: " << (dead->isDead() ? "True" : "False"); + str << " Name: " << typeid(*dead).name(); + } + catch (...) + { + + } + } + str << "\n"; + } + str << "--------------------------------------------"; + return size; +} + void LLMortician::updateClass() { while (!sGraveyard.empty()) diff --git a/indra/llcommon/llmortician.h b/indra/llcommon/llmortician.h index 9517e2db5e..41cb49fab1 100644 --- a/indra/llcommon/llmortician.h +++ b/indra/llcommon/llmortician.h @@ -34,6 +34,8 @@ class LL_COMMON_API LLMortician { public: LLMortician() { mIsDead = FALSE; } + static U32 graveyardCount() { return sGraveyard.size(); }; + static U32 logClass(std::stringstream &str); static void updateClass(); virtual ~LLMortician(); void die(); diff --git a/indra/llcommon/llsingleton.cpp b/indra/llcommon/llsingleton.cpp index 9fbd78a000..c45c144570 100644 --- a/indra/llcommon/llsingleton.cpp +++ b/indra/llcommon/llsingleton.cpp @@ -134,12 +134,6 @@ LLSingletonBase::list_t& LLSingletonBase::get_initializing() return LLSingletonBase::MasterList::instance().get_initializing_(); } -//static -LLSingletonBase::list_t& LLSingletonBase::get_initializing_from(MasterList* master) -{ - return master->get_initializing_(); -} - LLSingletonBase::~LLSingletonBase() {} void LLSingletonBase::push_initializing(const char* name) @@ -156,7 +150,7 @@ void LLSingletonBase::pop_initializing() if (list.empty()) { logerrs("Underflow in stack of currently-initializing LLSingletons at ", - demangle(typeid(*this).name()).c_str(), "::getInstance()"); + classname(this).c_str(), "::getInstance()"); } // Now we know list.back() exists: capture it @@ -178,14 +172,39 @@ void LLSingletonBase::pop_initializing() if (back != this) { logerrs("Push/pop mismatch in stack of currently-initializing LLSingletons: ", - demangle(typeid(*this).name()).c_str(), "::getInstance() trying to pop ", - demangle(typeid(*back).name()).c_str()); + classname(this).c_str(), "::getInstance() trying to pop ", + classname(back).c_str()); } // log AFTER popping so logging singletons don't cry circularity log_initializing("Popping", typeid(*back).name()); } +void LLSingletonBase::reset_initializing(list_t::size_type size) +{ + // called for cleanup in case the LLSingleton subclass constructor throws + // an exception + + // The tricky thing about this, the reason we have a separate method + // instead of just calling pop_initializing(), is (hopefully remote) + // possibility that the exception happened *before* the + // push_initializing() call in LLSingletonBase's constructor. So only + // remove the stack top if in fact we've pushed something more than the + // previous size. + list_t& list(get_initializing()); + + while (list.size() > size) + { + list.pop_back(); + } + + // as in pop_initializing() + if (list.empty()) + { + MasterList::instance().cleanup_initializing_(); + } +} + //static void LLSingletonBase::log_initializing(const char* verb, const char* name) { @@ -197,7 +216,7 @@ void LLSingletonBase::log_initializing(const char* verb, const char* name) ri != rend; ++ri) { LLSingletonBase* sb(*ri); - LL_CONT << ' ' << demangle(typeid(*sb).name()); + LL_CONT << ' ' << classname(sb); } LL_ENDL; } @@ -231,7 +250,7 @@ void LLSingletonBase::capture_dependency(list_t& initializing, EInitState initSt // 'found' is an iterator; *found is an LLSingletonBase*; **found // is the actual LLSingletonBase instance. LLSingletonBase* foundp(*found); - out << demangle(typeid(*foundp).name()) << " -> "; + out << classname(foundp) << " -> "; } // We promise to capture dependencies from both the constructor // and the initSingleton() method, so an LLSingleton's instance @@ -245,7 +264,7 @@ void LLSingletonBase::capture_dependency(list_t& initializing, EInitState initSt if (initState == CONSTRUCTING) { logerrs("LLSingleton circularity in Constructor: ", out.str().c_str(), - demangle(typeid(*this).name()).c_str(), ""); + classname(this).c_str(), ""); } else if (it_next == initializing.end()) { @@ -256,14 +275,14 @@ void LLSingletonBase::capture_dependency(list_t& initializing, EInitState initSt // Example: LLNotifications singleton initializes default channels. // Channels register themselves with singleton once done. logdebugs("LLSingleton circularity: ", out.str().c_str(), - demangle(typeid(*this).name()).c_str(), ""); + classname(this).c_str(), ""); } else { // Actual circularity with other singleton (or single singleton is used extensively). // Dependency can be unclear. logwarns("LLSingleton circularity: ", out.str().c_str(), - demangle(typeid(*this).name()).c_str(), ""); + classname(this).c_str(), ""); } } else @@ -276,8 +295,8 @@ void LLSingletonBase::capture_dependency(list_t& initializing, EInitState initSt if (current->mDepends.insert(this).second) { // only log the FIRST time we hit this dependency! - logdebugs(demangle(typeid(*current).name()).c_str(), - " depends on ", demangle(typeid(*this).name()).c_str()); + logdebugs(classname(current).c_str(), + " depends on ", classname(this).c_str()); } } } @@ -336,19 +355,19 @@ void LLSingletonBase::cleanupAll() sp->mCleaned = true; logdebugs("calling ", - demangle(typeid(*sp).name()).c_str(), "::cleanupSingleton()"); + classname(sp).c_str(), "::cleanupSingleton()"); try { sp->cleanupSingleton(); } catch (const std::exception& e) { - logwarns("Exception in ", demangle(typeid(*sp).name()).c_str(), + logwarns("Exception in ", classname(sp).c_str(), "::cleanupSingleton(): ", e.what()); } catch (...) { - logwarns("Unknown exception in ", demangle(typeid(*sp).name()).c_str(), + logwarns("Unknown exception in ", classname(sp).c_str(), "::cleanupSingleton()"); } } @@ -363,7 +382,7 @@ void LLSingletonBase::deleteAll() { // Capture the class name first: in case of exception, don't count on // being able to extract it later. - const std::string name = demangle(typeid(*sp).name()); + const std::string name = classname(sp); try { // Call static method through instance function pointer. @@ -440,7 +459,17 @@ void LLSingletonBase::logerrs(const char* p1, const char* p2, const char* p3, co log(LLError::LEVEL_ERROR, p1, p2, p3, p4); // The other important side effect of LL_ERRS() is // https://www.youtube.com/watch?v=OMG7paGJqhQ (emphasis on OMG) - LLError::crashAndLoop(std::string()); + std::ostringstream out; + out << p1 << p2 << p3 << p4; + auto crash = LLError::getFatalFunction(); + if (crash) + { + crash(out.str()); + } + else + { + LLError::crashAndLoop(out.str()); + } } std::string LLSingletonBase::demangle(const char* mangled) diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h index 859e271e26..0da6d548ab 100644 --- a/indra/llcommon/llsingleton.h +++ b/indra/llcommon/llsingleton.h @@ -31,6 +31,18 @@ #include <vector> #include <typeinfo> +#if LL_WINDOWS +#pragma warning (push) +#pragma warning (disable:4265) +#endif +// warning C4265: 'std::_Pad' : class has virtual functions, but destructor is not virtual + +#include <mutex> + +#if LL_WINDOWS +#pragma warning (pop) +#endif + class LLSingletonBase: private boost::noncopyable { public: @@ -43,7 +55,6 @@ private: // This, on the other hand, is a stack whose top indicates the LLSingleton // currently being initialized. static list_t& get_initializing(); - static list_t& get_initializing_from(MasterList*); // Produce a vector<LLSingletonBase*> of master list, in dependency order. typedef std::vector<LLSingletonBase*> vec_t; static vec_t dep_sort(); @@ -57,10 +68,11 @@ protected: typedef enum e_init_state { UNINITIALIZED = 0, // must be default-initialized state - CONSTRUCTING, - INITIALIZING, - INITIALIZED, - DELETED + CONSTRUCTING, // within DERIVED_TYPE constructor + CONSTRUCTED, // finished DERIVED_TYPE constructor + INITIALIZING, // within DERIVED_TYPE::initSingleton() + INITIALIZED, // normal case + DELETED // deleteSingleton() or deleteAll() called } EInitState; // Define tag<T> to pass to our template constructor. You can't explicitly @@ -100,6 +112,9 @@ protected: // That being the case, we control exactly when it happens -- and we can // pop the stack immediately thereafter. void pop_initializing(); + // Remove 'this' from the init stack in case of exception in the + // LLSingleton subclass constructor. + static void reset_initializing(list_t::size_type size); private: // logging static void log_initializing(const char* verb, const char* name); @@ -115,6 +130,10 @@ protected: static void logwarns(const char* p1, const char* p2="", const char* p3="", const char* p4=""); static std::string demangle(const char* mangled); + template <typename T> + static std::string classname() { return demangle(typeid(T).name()); } + template <typename T> + static std::string classname(T* ptr) { return demangle(typeid(*ptr).name()); } // Default methods in case subclass doesn't declare them. virtual void initSingleton() {} @@ -178,7 +197,15 @@ struct LLSingleton_manage_master void remove(LLSingletonBase* sb) { sb->remove_master(); } void push_initializing(LLSingletonBase* sb) { sb->push_initializing(typeid(T).name()); } void pop_initializing (LLSingletonBase* sb) { sb->pop_initializing(); } - LLSingletonBase::list_t& get_initializing(T*) { return LLSingletonBase::get_initializing(); } + // used for init stack cleanup in case an LLSingleton subclass constructor + // throws an exception + void reset_initializing(LLSingletonBase::list_t::size_type size) + { + LLSingletonBase::reset_initializing(size); + } + // For any LLSingleton subclass except the MasterList, obtain the init + // stack from the MasterList singleton instance. + LLSingletonBase::list_t& get_initializing() { return LLSingletonBase::get_initializing(); } }; // But for the specific case of LLSingletonBase::MasterList, don't. @@ -189,9 +216,14 @@ struct LLSingleton_manage_master<LLSingletonBase::MasterList> void remove(LLSingletonBase*) {} void push_initializing(LLSingletonBase*) {} void pop_initializing (LLSingletonBase*) {} - LLSingletonBase::list_t& get_initializing(LLSingletonBase::MasterList* instance) + // since we never pushed, no need to clean up + void reset_initializing(LLSingletonBase::list_t::size_type size) {} + LLSingletonBase::list_t& get_initializing() { - return LLSingletonBase::get_initializing_from(instance); + // The MasterList shouldn't depend on any other LLSingletons. We'd + // get into trouble if we tried to recursively engage that machinery. + static LLSingletonBase::list_t sDummyList; + return sDummyList; } }; @@ -201,10 +233,19 @@ LLSingletonBase::LLSingletonBase(tag<DERIVED_TYPE>): mCleaned(false), mDeleteSingleton(NULL) { - // Make this the currently-initializing LLSingleton. + // This is the earliest possible point at which we can push this new + // instance onto the init stack. LLSingleton::constructSingleton() can't + // do it before calling the constructor, because it doesn't have an + // instance pointer until the constructor returns. Fortunately this + // constructor is guaranteed to be called before any subclass constructor. + // Make this new instance the currently-initializing LLSingleton. LLSingleton_manage_master<DERIVED_TYPE>().push_initializing(this); } +// forward declare for friend directive within LLSingleton +template <typename DERIVED_TYPE> +class LLParamSingleton; + /** * LLSingleton implements the getInstance() method part of the Singleton * pattern. It can't make the derived class constructors protected, though, so @@ -270,9 +311,94 @@ template <typename DERIVED_TYPE> class LLSingleton : public LLSingletonBase { private: - static DERIVED_TYPE* constructSingleton() + // Allow LLParamSingleton subclass -- but NOT DERIVED_TYPE itself -- to + // access our private members. + friend class LLParamSingleton<DERIVED_TYPE>; + + // LLSingleton only supports a nullary constructor. However, the specific + // purpose for its subclass LLParamSingleton is to support Singletons + // requiring constructor arguments. constructSingleton() supports both use + // cases. + template <typename... Args> + static void constructSingleton(Args&&... args) + { + auto prev_size = LLSingleton_manage_master<DERIVED_TYPE>().get_initializing().size(); + // getInstance() calls are from within constructor + sData.mInitState = CONSTRUCTING; + try + { + sData.mInstance = new DERIVED_TYPE(std::forward<Args>(args)...); + // we have called constructor, have not yet called initSingleton() + sData.mInitState = CONSTRUCTED; + } + catch (const std::exception& err) + { + // LLSingletonBase might -- or might not -- have pushed the new + // instance onto the init stack before the exception. Reset the + // init stack to its previous size BEFORE logging so log-machinery + // LLSingletons don't record a dependency on DERIVED_TYPE! + LLSingleton_manage_master<DERIVED_TYPE>().reset_initializing(prev_size); + logwarns("Error constructing ", classname<DERIVED_TYPE>().c_str(), + ": ", err.what()); + // There isn't a separate EInitState value meaning "we attempted + // to construct this LLSingleton subclass but could not," so use + // DELETED. That seems slightly more appropriate than UNINITIALIZED. + sData.mInitState = DELETED; + // propagate the exception + throw; + } + } + + static void finishInitializing() + { + // getInstance() calls are from within initSingleton() + sData.mInitState = INITIALIZING; + try + { + // initialize singleton after constructing it so that it can + // reference other singletons which in turn depend on it, thus + // breaking cyclic dependencies + sData.mInstance->initSingleton(); + sData.mInitState = INITIALIZED; + + // pop this off stack of initializing singletons + pop_initializing(); + } + catch (const std::exception& err) + { + // pop this off stack of initializing singletons here, too -- + // BEFORE logging, so log-machinery LLSingletons don't record a + // dependency on DERIVED_TYPE! + pop_initializing(); + logwarns("Error in ", classname<DERIVED_TYPE>().c_str(), + "::initSingleton(): ", err.what()); + // and get rid of the instance entirely + deleteSingleton(); + // propagate the exception + throw; + } + } + + static void pop_initializing() { - return new DERIVED_TYPE(); + // route through LLSingleton_manage_master so we Do The Right Thing + // (namely, nothing) for MasterList + LLSingleton_manage_master<DERIVED_TYPE>().pop_initializing(sData.mInstance); + } + + // Without this 'using' declaration, the static method we're declaring + // here would hide the base-class method we want it to call. + using LLSingletonBase::capture_dependency; + static void capture_dependency() + { + // By this point, if DERIVED_TYPE was pushed onto the initializing + // stack, it has been popped off. So the top of that stack, if any, is + // an LLSingleton that directly depends on DERIVED_TYPE. If + // getInstance() was called by another LLSingleton, rather than from + // vanilla application code, record the dependency. + sData.mInstance->capture_dependency( + LLSingleton_manage_master<DERIVED_TYPE>().get_initializing(), + sData.mInitState); } // We know of no way to instruct the compiler that every subclass @@ -285,34 +411,17 @@ private: // subclass body. virtual void you_must_use_LLSINGLETON_macro() = 0; - // stores pointer to singleton instance - struct SingletonLifetimeManager + // The purpose of this struct is to engage the C++11 guarantee that static + // variables declared in function scope are initialized exactly once, even + // if multiple threads concurrently reach the same declaration. + // https://en.cppreference.com/w/cpp/language/storage_duration#Static_local_variables + // Since getInstance() declares a static instance of SingletonInitializer, + // only the first call to getInstance() calls constructSingleton(). + struct SingletonInitializer { - SingletonLifetimeManager() - { - construct(); - } - - static void construct() - { - sData.mInitState = CONSTRUCTING; - sData.mInstance = constructSingleton(); - sData.mInitState = INITIALIZING; - } - - ~SingletonLifetimeManager() + SingletonInitializer() { - // The dependencies between LLSingletons, and the arbitrary order - // of static-object destruction, mean that we DO NOT WANT this - // destructor to delete this LLSingleton. This destructor will run - // without regard to any other LLSingleton whose cleanup might - // depend on its existence. If you want to clean up LLSingletons, - // call LLSingletonBase::deleteAll() sometime before static-object - // destruction begins. That method will properly honor cross- - // LLSingleton dependencies. Otherwise we simply leak LLSingleton - // instances at shutdown. Since the whole process is terminating - // anyway, that's not necessarily a bad thing; it depends on what - // resources your LLSingleton instances are managing. + constructSingleton(); } }; @@ -363,64 +472,59 @@ public: static void deleteSingleton() { delete sData.mInstance; - sData.mInstance = NULL; - sData.mInitState = DELETED; + // SingletonData state handled by destructor, above } static DERIVED_TYPE* getInstance() { - static SingletonLifetimeManager sLifeTimeMgr; + // call constructSingleton() only the first time we get here + static SingletonInitializer sInitializer; switch (sData.mInitState) { case UNINITIALIZED: // should never be uninitialized at this point logerrs("Uninitialized singleton ", - demangle(typeid(DERIVED_TYPE).name()).c_str()); + classname<DERIVED_TYPE>().c_str()); return NULL; case CONSTRUCTING: + // here if DERIVED_TYPE's constructor (directly or indirectly) + // calls DERIVED_TYPE::getInstance() logerrs("Tried to access singleton ", - demangle(typeid(DERIVED_TYPE).name()).c_str(), + classname<DERIVED_TYPE>().c_str(), " from singleton constructor!"); return NULL; - case INITIALIZING: - // go ahead and flag ourselves as initialized so we can be - // reentrant during initialization - sData.mInitState = INITIALIZED; - // initialize singleton after constructing it so that it can - // reference other singletons which in turn depend on it, thus - // breaking cyclic dependencies - sData.mInstance->initSingleton(); - // pop this off stack of initializing singletons - LLSingleton_manage_master<DERIVED_TYPE>().pop_initializing(sData.mInstance); + case CONSTRUCTED: + // first time through: set to CONSTRUCTED by + // constructSingleton(), called by sInitializer's constructor; + // still have to call initSingleton() + finishInitializing(); break; + case INITIALIZING: + // here if DERIVED_TYPE::initSingleton() (directly or indirectly) + // calls DERIVED_TYPE::getInstance(): go ahead and allow it case INITIALIZED: + // normal subsequent calls break; case DELETED: + // called after deleteSingleton() logwarns("Trying to access deleted singleton ", - demangle(typeid(DERIVED_TYPE).name()).c_str(), + classname<DERIVED_TYPE>().c_str(), " -- creating new instance"); - SingletonLifetimeManager::construct(); - // same as first time construction - sData.mInitState = INITIALIZED; - sData.mInstance->initSingleton(); - // pop this off stack of initializing singletons - LLSingleton_manage_master<DERIVED_TYPE>().pop_initializing(sData.mInstance); + // This recovery sequence is NOT thread-safe! We would need a + // recursive_mutex a la LLParamSingleton. + constructSingleton(); + finishInitializing(); break; } - // By this point, if DERIVED_TYPE was pushed onto the initializing - // stack, it has been popped off. So the top of that stack, if any, is - // an LLSingleton that directly depends on DERIVED_TYPE. If this call - // came from another LLSingleton, rather than from vanilla application - // code, record the dependency. - sData.mInstance->capture_dependency( - LLSingleton_manage_master<DERIVED_TYPE>().get_initializing(sData.mInstance), - sData.mInitState); + // record the dependency, if any: check if we got here from another + // LLSingleton's constructor or initSingleton() method + capture_dependency(); return sData.mInstance; } @@ -460,6 +564,173 @@ private: template<typename T> typename LLSingleton<T>::SingletonData LLSingleton<T>::sData; + +/** + * LLParamSingleton<T> is like LLSingleton<T>, except in the following ways: + * + * * It is NOT instantiated on demand (instance() or getInstance()). You must + * first call initParamSingleton(constructor args...). + * * Before initParamSingleton(), calling instance() or getInstance() dies with + * LL_ERRS. + * * initParamSingleton() may be called only once. A second call dies with + * LL_ERRS. + * * However, distinct initParamSingleton() calls can be used to engage + * different constructors, as long as only one such call is executed at + * runtime. + * * Unlike LLSingleton, an LLParamSingleton cannot be "revived" by an + * instance() or getInstance() call after deleteSingleton(). + * + * Importantly, though, each LLParamSingleton subclass does participate in the + * dependency-ordered LLSingletonBase::deleteAll() processing. + */ +template <typename DERIVED_TYPE> +class LLParamSingleton : public LLSingleton<DERIVED_TYPE> +{ +private: + typedef LLSingleton<DERIVED_TYPE> super; + // Use a recursive_mutex in case of constructor circularity. With a + // non-recursive mutex, that would result in deadlock rather than the + // logerrs() call in getInstance(). + typedef std::recursive_mutex mutex_t; + +public: + using super::deleteSingleton; + using super::instanceExists; + using super::wasDeleted; + + // Passes arguments to DERIVED_TYPE's constructor and sets appropriate states + template <typename... Args> + static void initParamSingleton(Args&&... args) + { + // In case racing threads both call initParamSingleton() at the same + // time, serialize them. One should initialize; the other should see + // mInitState already set. + std::unique_lock<mutex_t> lk(getMutex()); + // For organizational purposes this function shouldn't be called twice + if (super::sData.mInitState != super::UNINITIALIZED) + { + super::logerrs("Tried to initialize singleton ", + super::template classname<DERIVED_TYPE>().c_str(), + " twice!"); + } + else + { + super::constructSingleton(std::forward<Args>(args)...); + super::finishInitializing(); + } + } + + static DERIVED_TYPE* getInstance() + { + // In case racing threads call getInstance() at the same moment as + // initParamSingleton(), serialize the calls. + std::unique_lock<mutex_t> lk(getMutex()); + + switch (super::sData.mInitState) + { + case super::UNINITIALIZED: + super::logerrs("Uninitialized param singleton ", + super::template classname<DERIVED_TYPE>().c_str()); + break; + + case super::CONSTRUCTING: + super::logerrs("Tried to access param singleton ", + super::template classname<DERIVED_TYPE>().c_str(), + " from singleton constructor!"); + break; + + case super::CONSTRUCTED: + // Should never happen!? The CONSTRUCTED state is specifically to + // navigate through LLSingleton::SingletonInitializer getting + // constructed (once) before LLSingleton::getInstance()'s switch + // on mInitState. But our initParamSingleton() method calls + // constructSingleton() and then calls finishInitializing(), which + // immediately sets INITIALIZING. Why are we here? + super::logerrs("Param singleton ", + super::template classname<DERIVED_TYPE>().c_str(), + "::initSingleton() not yet called"); + break; + + case super::INITIALIZING: + // As with LLSingleton, explicitly permit circular calls from + // within initSingleton() + case super::INITIALIZED: + // for any valid call, capture dependencies + super::capture_dependency(); + return super::sData.mInstance; + + case super::DELETED: + super::logerrs("Trying to access deleted param singleton ", + super::template classname<DERIVED_TYPE>().c_str()); + break; + } + + // should never actually get here; this is to pacify the compiler, + // which assumes control might return from logerrs() + return nullptr; + } + + // instance() is replicated here so it calls + // LLParamSingleton::getInstance() rather than LLSingleton::getInstance() + // -- avoid making getInstance() virtual + static DERIVED_TYPE& instance() + { + return *getInstance(); + } + +private: + // sMutex must be a function-local static rather than a static member. One + // of the essential features of LLSingleton and friends is that they must + // support getInstance() even when the containing module's static + // variables have not yet been runtime-initialized. A mutex requires + // construction. A static class member might not yet have been + // constructed. + // + // We could store a dumb mutex_t*, notice when it's NULL and allocate a + // heap mutex -- but that's vulnerable to race conditions. And we can't + // defend the dumb pointer with another mutex. + // + // We could store a std::atomic<mutex_t*> -- but a default-constructed + // std::atomic<T> does not contain a valid T, even a default-constructed + // T! Which means std::atomic, too, requires runtime initialization. + // + // But a function-local static is guaranteed to be initialized exactly + // once, the first time control reaches that declaration. + static mutex_t& getMutex() + { + static mutex_t sMutex; + return sMutex; + } +}; + +/** + * Initialization locked singleton, only derived class can decide when to initialize. + * Starts locked. + * For cases when singleton has a dependency onto something or. + * + * LLLockedSingleton is like an LLParamSingleton with a nullary constructor. + * It cannot be instantiated on demand (instance() or getInstance() call) -- + * it must be instantiated by calling construct(). However, it does + * participate in dependency-ordered LLSingletonBase::deleteAll() processing. + */ +template <typename DT> +class LLLockedSingleton : public LLParamSingleton<DT> +{ + typedef LLParamSingleton<DT> super; + +public: + using super::deleteSingleton; + using super::getInstance; + using super::instance; + using super::instanceExists; + using super::wasDeleted; + + static void construct() + { + super::initParamSingleton(); + } +}; + /** * Use LLSINGLETON(Foo); at the start of an LLSingleton<Foo> subclass body * when you want to declare an out-of-line constructor: @@ -484,13 +755,13 @@ typename LLSingleton<T>::SingletonData LLSingleton<T>::sData; * file, use 'inline' (unless it's a template class) to avoid duplicate-symbol * errors at link time. */ -#define LLSINGLETON(DERIVED_CLASS) \ +#define LLSINGLETON(DERIVED_CLASS, ...) \ private: \ /* implement LLSingleton pure virtual method whose sole purpose */ \ /* is to remind people to use this macro */ \ virtual void you_must_use_LLSINGLETON_macro() {} \ friend class LLSingleton<DERIVED_CLASS>; \ - DERIVED_CLASS() + DERIVED_CLASS(__VA_ARGS__) /** * Use LLSINGLETON_EMPTY_CTOR(Foo); at the start of an LLSingleton<Foo> diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 30bec3a6f8..b619a9e48c 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -1735,7 +1735,8 @@ bool LLStringUtilBase<T>::startsWith( const string_type& substr) { if(string.empty() || (substr.empty())) return false; - if(0 == string.find(substr)) return true; + if (substr.length() > string.length()) return false; + if (0 == string.compare(0, substr.length(), substr)) return true; return false; } @@ -1746,9 +1747,11 @@ bool LLStringUtilBase<T>::endsWith( const string_type& substr) { if(string.empty() || (substr.empty())) return false; - std::string::size_type idx = string.rfind(substr); - if(std::string::npos == idx) return false; - return (idx == (string.size() - substr.size())); + size_t sub_len = substr.length(); + size_t str_len = string.length(); + if (sub_len > str_len) return false; + if (0 == string.compare(str_len - sub_len, sub_len, substr)) return true; + return false; } // static diff --git a/indra/llcommon/lluri.cpp b/indra/llcommon/lluri.cpp index 758b98e143..9942bc0cf8 100644 --- a/indra/llcommon/lluri.cpp +++ b/indra/llcommon/lluri.cpp @@ -173,6 +173,19 @@ namespace "-._~"; return s; } + const std::string path() + { + static const std::string s = + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789" + "$-_.+" + "!*'()," + "{}|\\^~[]`" + "<>#%" + ";/?:@&="; + return s; + } const std::string sub_delims() { static const std::string s = "!$&'()*+,;="; @@ -187,6 +200,12 @@ namespace { return LLURI::escape(s, unreserved() + ":@!$'()*+,"); } // sub_delims - "&;=" + ":@" std::string escapeQueryValue(const std::string& s) { return LLURI::escape(s, unreserved() + ":@!$'()*+,="); } // sub_delims - "&;" + ":@" + std::string escapeUriQuery(const std::string& s) + { return LLURI::escape(s, unreserved() + ":@?&$;*+=%/"); } + std::string escapeUriData(const std::string& s) + { return LLURI::escape(s, unreserved() + "%"); } + std::string escapeUriPath(const std::string& s) + { return LLURI::escape(s, path()); } } //static @@ -202,6 +221,85 @@ std::string LLURI::escape(const std::string& str) return escape(str, default_allowed, true); } +//static +std::string LLURI::escapePathAndData(const std::string &str) +{ + std::string result; + + const std::string data_marker = "data:"; + if (str.compare(0, data_marker.length(), data_marker) == 0) + { + // This is not url, but data, data part needs to be properly escaped + // data part is separated by ',' from header. Minimal data uri is "data:," + // See "data URI scheme" + size_t separator = str.find(','); + if (separator != std::string::npos) + { + size_t header_size = separator + 1; + std::string header = str.substr(0, header_size); + // base64 is url-safe + if (header.find("base64") != std::string::npos) + { + // assume url-safe data + result = str; + } + else + { + std::string data = str.substr(header_size, str.length() - header_size); + + // Notes: File can be partially pre-escaped, that's why escaping ignores '%' + // It somewhat limits user from displaying strings like "%20" in text + // but that's how viewer worked for a while and user can double-escape it + + + // Header doesn't need escaping + result = header + escapeUriData(data); + } + } + } + else + { + // try processing it as path with query separator + // The query component is indicated by the first question + // mark("?") character and terminated by a number sign("#") + size_t delim_pos = str.find('?'); + if (delim_pos == std::string::npos) + { + // alternate separator + delim_pos = str.find(';'); + } + + if (delim_pos != std::string::npos) + { + size_t path_size = delim_pos + 1; + std::string query; + std::string fragment; + + size_t fragment_pos = str.find('#'); + if (fragment_pos != std::string::npos) + { + query = str.substr(path_size, fragment_pos - path_size); + fragment = str.substr(fragment_pos); + } + else + { + query = str.substr(path_size); + } + + std::string path = str.substr(0, path_size); + + result = escapeUriPath(path) + escapeUriQuery(query) + escapeUriPath(fragment); + } + } + + if (result.empty()) + { + // Not a known scheme or no data part, try just escaping as Uri path + result = escapeUriPath(str); + } + return result; +} + LLURI::LLURI() { } diff --git a/indra/llcommon/lluri.h b/indra/llcommon/lluri.h index 9e44cc7da2..b8fca0ca51 100644 --- a/indra/llcommon/lluri.h +++ b/indra/llcommon/lluri.h @@ -158,6 +158,14 @@ public: bool is_allowed_sorted = false); /** + * @brief Break string into data part and path or sheme + * and escape path (if present) and data. + * Data part is not allowed to have path related symbols + * @param str The raw URI to escape. + */ + static std::string escapePathAndData(const std::string &str); + + /** * @brief unescape an escaped URI string. * * @param str The escped URI to unescape. diff --git a/indra/llcommon/tests/lleventcoro_test.cpp b/indra/llcommon/tests/lleventcoro_test.cpp index a459d17fb8..fa02d2bb1a 100644 --- a/indra/llcommon/tests/lleventcoro_test.cpp +++ b/indra/llcommon/tests/lleventcoro_test.cpp @@ -506,16 +506,10 @@ namespace tut replyName = waiter.getName0(); errorName = waiter.getName1(); WrapLLErrs capture; - try - { - result = waiter.suspendWithLog(); - debug("no exception"); - } - catch (const WrapLLErrs::FatalException& e) - { - debug(STRINGIZE("exception " << e.what())); - threw = e.what(); - } + threw = capture.catch_llerrs([&waiter, &debug](){ + result = waiter.suspendWithLog(); + debug("no exception"); + }); } END } @@ -762,18 +756,13 @@ namespace tut { LLCoroEventPumps waiter; WrapLLErrs capture; - try - { - result = waiter.postAndSuspendWithLog( - LLSDMap("value", 31)("fail", LLSD()), - immediateAPI.getPump(), "reply", "error"); - debug("no exception"); - } - catch (const WrapLLErrs::FatalException& e) - { - debug(STRINGIZE("exception " << e.what())); - threw = e.what(); - } + threw = capture.catch_llerrs( + [&waiter, &debug](){ + result = waiter.postAndSuspendWithLog( + LLSDMap("value", 31)("fail", LLSD()), + immediateAPI.getPump(), "reply", "error"); + debug("no exception"); + }); } END } diff --git a/indra/llcommon/tests/lleventdispatcher_test.cpp b/indra/llcommon/tests/lleventdispatcher_test.cpp index 5a4df81bf1..a181d5c941 100644 --- a/indra/llcommon/tests/lleventdispatcher_test.cpp +++ b/indra/llcommon/tests/lleventdispatcher_test.cpp @@ -22,6 +22,7 @@ #include "llsdutil.h" #include "stringize.h" #include "tests/wrapllerrs.h" +#include "../test/catch_and_store_what_in.h" #include <map> #include <string> @@ -630,16 +631,9 @@ namespace tut void call_exc(const std::string& func, const LLSD& args, const std::string& exc_frag) { - std::string threw; - try - { - work(func, args); - } - catch (const std::runtime_error& e) - { - cout << "*** " << e.what() << '\n'; - threw = e.what(); - } + std::string threw = catch_what<std::runtime_error>([this, &func, &args](){ + work(func, args); + }); ensure_has(threw, exc_frag); } @@ -717,15 +711,9 @@ namespace tut LLSD attempts(LLSDArray(17)(LLSDMap("pi", 3.14)("two", 2))); foreach(LLSD ae, inArray(attempts)) { - std::string threw; - try - { - work.add("freena_err", "freena", freena, ae); - } - catch (const std::exception& e) - { - threw = e.what(); - } + std::string threw = catch_what<std::exception>([this, &ae](){ + work.add("freena_err", "freena", freena, ae); + }); ensure_has(threw, "must be an array"); } } @@ -734,15 +722,9 @@ namespace tut void object::test<2>() { set_test_name("map-style registration with badly-formed defaults"); - std::string threw; - try - { - work.add("freena_err", "freena", freena, LLSDArray("a")("b"), 17); - } - catch (const std::exception& e) - { - threw = e.what(); - } + std::string threw = catch_what<std::exception>([this](){ + work.add("freena_err", "freena", freena, LLSDArray("a")("b"), 17); + }); ensure_has(threw, "must be a map or an array"); } @@ -750,17 +732,11 @@ namespace tut void object::test<3>() { set_test_name("map-style registration with too many array defaults"); - std::string threw; - try - { - work.add("freena_err", "freena", freena, - LLSDArray("a")("b"), - LLSDArray(17)(0.9)("gack")); - } - catch (const std::exception& e) - { - threw = e.what(); - } + std::string threw = catch_what<std::exception>([this](){ + work.add("freena_err", "freena", freena, + LLSDArray("a")("b"), + LLSDArray(17)(0.9)("gack")); + }); ensure_has(threw, "shorter than"); } @@ -768,17 +744,11 @@ namespace tut void object::test<4>() { set_test_name("map-style registration with too many map defaults"); - std::string threw; - try - { - work.add("freena_err", "freena", freena, - LLSDArray("a")("b"), - LLSDMap("b", 17)("foo", 3.14)("bar", "sinister")); - } - catch (const std::exception& e) - { - threw = e.what(); - } + std::string threw = catch_what<std::exception>([this](){ + work.add("freena_err", "freena", freena, + LLSDArray("a")("b"), + LLSDMap("b", 17)("foo", 3.14)("bar", "sinister")); + }); ensure_has(threw, "nonexistent params"); ensure_has(threw, "foo"); ensure_has(threw, "bar"); @@ -1039,16 +1009,9 @@ namespace tut // We don't have a comparable helper function for the one-arg // operator() method, and it's not worth building one just for this // case. Write it out. - std::string threw; - try - { - work(LLSDMap("op", "freek")); - } - catch (const std::runtime_error& e) - { - cout << "*** " << e.what() << "\n"; - threw = e.what(); - } + std::string threw = catch_what<std::runtime_error>([this](){ + work(LLSDMap("op", "freek")); + }); ensure_has(threw, "bad"); ensure_has(threw, "op"); ensure_has(threw, "freek"); diff --git a/indra/llcommon/tests/lleventfilter_test.cpp b/indra/llcommon/tests/lleventfilter_test.cpp index eb98b12ef5..1875013794 100644 --- a/indra/llcommon/tests/lleventfilter_test.cpp +++ b/indra/llcommon/tests/lleventfilter_test.cpp @@ -350,15 +350,9 @@ namespace tut // Now let the timer expire. filter.forceTimeout(); // Notice the timeout. - std::string threw; - try - { - mainloop.post(17); - } - catch (const WrapLLErrs::FatalException& e) - { - threw = e.what(); - } + std::string threw = capture.catch_llerrs([this](){ + mainloop.post(17); + }); ensure_contains("errorAfter() timeout exception", threw, "timeout"); // Timing out cancels the timer. Verify that. listener0.reset(0); diff --git a/indra/llcommon/tests/llinstancetracker_test.cpp b/indra/llcommon/tests/llinstancetracker_test.cpp index c7d4b8a06b..d94fc0c56d 100644 --- a/indra/llcommon/tests/llinstancetracker_test.cpp +++ b/indra/llcommon/tests/llinstancetracker_test.cpp @@ -198,14 +198,9 @@ namespace tut { WrapLLErrs wrapper; Keyed::instance_iter i(Keyed::beginInstances()); - try - { - delete keyed; - } - catch (const WrapLLErrs::FatalException& e) - { - what = e.what(); - } + what = wrapper.catch_llerrs([&keyed](){ + delete keyed; + }); } ensure(! what.empty()); } @@ -219,14 +214,9 @@ namespace tut { WrapLLErrs wrapper; Keyed::key_iter i(Keyed::beginKeys()); - try - { - delete keyed; - } - catch (const WrapLLErrs::FatalException& e) - { - what = e.what(); - } + what = wrapper.catch_llerrs([&keyed](){ + delete keyed; + }); } ensure(! what.empty()); } @@ -240,14 +230,9 @@ namespace tut { WrapLLErrs wrapper; Unkeyed::instance_iter i(Unkeyed::beginInstances()); - try - { - delete unkeyed; - } - catch (const WrapLLErrs::FatalException& e) - { - what = e.what(); - } + what = wrapper.catch_llerrs([&unkeyed](){ + delete unkeyed; + }); } ensure(! what.empty()); } diff --git a/indra/llcommon/tests/lllazy_test.cpp b/indra/llcommon/tests/lllazy_test.cpp index 32a717f4fc..542306ee22 100644 --- a/indra/llcommon/tests/lllazy_test.cpp +++ b/indra/llcommon/tests/lllazy_test.cpp @@ -38,6 +38,7 @@ #include <boost/lambda/bind.hpp> // other Linden headers #include "../test/lltut.h" +#include "../test/catch_and_store_what_in.h" namespace bll = boost::lambda; @@ -200,15 +201,9 @@ namespace tut void lllazy_object::test<2>() { TestNeedsTesting tnt; - std::string threw; - try - { - tnt.toolate(); - } - catch (const LLLazyCommon::InstanceChange& e) - { - threw = e.what(); - } + std::string threw = catch_what<LLLazyCommon::InstanceChange>([&tnt](){ + tnt.toolate(); + }); ensure_contains("InstanceChange exception", threw, "replace LLLazy instance"); } diff --git a/indra/llcommon/tests/llleap_test.cpp b/indra/llcommon/tests/llleap_test.cpp index 45648536c4..bf0a74d10d 100644 --- a/indra/llcommon/tests/llleap_test.cpp +++ b/indra/llcommon/tests/llleap_test.cpp @@ -23,7 +23,7 @@ #include "../test/lltut.h" #include "../test/namedtempfile.h" #include "../test/catch_and_store_what_in.h" -#include "wrapllerrs.h" +#include "wrapllerrs.h" // CaptureLog #include "llevents.h" #include "llprocess.h" #include "llstring.h" @@ -290,12 +290,9 @@ namespace tut void object::test<6>() { set_test_name("empty plugin vector"); - std::string threw; - try - { - LLLeap::create("empty", StringVec()); - } - CATCH_AND_STORE_WHAT_IN(threw, LLLeap::Error) + std::string threw = catch_what<LLLeap::Error>([](){ + LLLeap::create("empty", StringVec()); + }); ensure_contains("LLLeap::Error", threw, "no plugin"); // try the suppress-exception variant ensure("bad launch returned non-NULL", ! LLLeap::create("empty", StringVec(), false)); @@ -308,12 +305,9 @@ namespace tut // Synthesize bogus executable name std::string BADPYTHON(PYTHON.substr(0, PYTHON.length()-1) + "x"); CaptureLog log; - std::string threw; - try - { - LLLeap::create("bad exe", BADPYTHON); - } - CATCH_AND_STORE_WHAT_IN(threw, LLLeap::Error) + std::string threw = catch_what<LLLeap::Error>([&BADPYTHON](){ + LLLeap::create("bad exe", BADPYTHON); + }); ensure_contains("LLLeap::create() didn't throw", threw, "failed"); log.messageWith("failed"); log.messageWith(BADPYTHON); diff --git a/indra/llcommon/tests/llprocess_test.cpp b/indra/llcommon/tests/llprocess_test.cpp index 5c87cdabd9..222d832084 100644 --- a/indra/llcommon/tests/llprocess_test.cpp +++ b/indra/llcommon/tests/llprocess_test.cpp @@ -25,8 +25,6 @@ #include <boost/function.hpp> #include <boost/algorithm/string/find_iterator.hpp> #include <boost/algorithm/string/finder.hpp> -//#include <boost/lambda/lambda.hpp> -//#include <boost/lambda/bind.hpp> // other Linden headers #include "../test/lltut.h" #include "../test/namedtempfile.h" @@ -35,7 +33,7 @@ #include "llsdutil.h" #include "llevents.h" #include "llstring.h" -#include "wrapllerrs.h" +#include "wrapllerrs.h" // CaptureLog #if defined(LL_WINDOWS) #define sleep(secs) _sleep((secs) * 1000) @@ -45,8 +43,7 @@ #include <sys/wait.h> #endif -//namespace lambda = boost::lambda; - std::string apr_strerror_helper(apr_status_t rv) +std::string apr_strerror_helper(apr_status_t rv) { char errbuf[256]; apr_strerror(rv, errbuf, sizeof(errbuf)); @@ -960,12 +957,9 @@ namespace tut #define CATCH_IN(THREW, EXCEPTION, CODE) \ do \ { \ - (THREW).clear(); \ - try \ - { \ - CODE; \ - } \ - CATCH_AND_STORE_WHAT_IN(THREW, EXCEPTION) \ + (THREW) = catch_what<EXCEPTION>([&](){ \ + CODE; \ + }); \ ensure("failed to throw " #EXCEPTION ": " #CODE, ! (THREW).empty()); \ } while (0) diff --git a/indra/llcommon/tests/llsingleton_test.cpp b/indra/llcommon/tests/llsingleton_test.cpp index 56886bc73f..75ddff9d7d 100644 --- a/indra/llcommon/tests/llsingleton_test.cpp +++ b/indra/llcommon/tests/llsingleton_test.cpp @@ -29,7 +29,8 @@ #include "llsingleton.h" #include "../test/lltut.h" - +#include "wrapllerrs.h" +#include "llsd.h" // Capture execution sequence by appending to log string. std::string sLog; @@ -198,4 +199,134 @@ namespace tut TESTS(A, B, 4, 5, 6, 7) TESTS(B, A, 8, 9, 10, 11) + +#define PARAMSINGLETON(cls) \ + class cls: public LLParamSingleton<cls> \ + { \ + LLSINGLETON(cls, const LLSD::String& str): mDesc(str) {} \ + cls(LLSD::Integer i): mDesc(i) {} \ + \ + public: \ + std::string desc() const { return mDesc.asString(); } \ + \ + private: \ + LLSD mDesc; \ + } + + // Declare two otherwise-identical LLParamSingleton classes so we can + // validly initialize each using two different constructors. If we tried + // to test that with a single LLParamSingleton class within the same test + // program, we'd get 'trying to use deleted LLParamSingleton' errors. + PARAMSINGLETON(PSing1); + PARAMSINGLETON(PSing2); + + template<> template<> + void singleton_object_t::test<12>() + { + set_test_name("LLParamSingleton"); + + WrapLLErrs catcherr; + // query methods + ensure("false positive on instanceExists()", ! PSing1::instanceExists()); + ensure("false positive on wasDeleted()", ! PSing1::wasDeleted()); + // try to reference before initializing + std::string threw = catcherr.catch_llerrs([](){ + (void)PSing1::instance(); + }); + ensure_contains("too-early instance() didn't throw", threw, "Uninitialized"); + // getInstance() behaves the same as instance() + threw = catcherr.catch_llerrs([](){ + (void)PSing1::getInstance(); + }); + ensure_contains("too-early getInstance() didn't throw", threw, "Uninitialized"); + // initialize using LLSD::String constructor + PSing1::initParamSingleton("string"); + ensure_equals(PSing1::instance().desc(), "string"); + ensure("false negative on instanceExists()", PSing1::instanceExists()); + // try to initialize again + threw = catcherr.catch_llerrs([](){ + PSing1::initParamSingleton("again"); + }); + ensure_contains("second ctor(string) didn't throw", threw, "twice"); + // try to initialize using the other constructor -- should be + // well-formed, but illegal at runtime + threw = catcherr.catch_llerrs([](){ + PSing1::initParamSingleton(17); + }); + ensure_contains("other ctor(int) didn't throw", threw, "twice"); + PSing1::deleteSingleton(); + ensure("false negative on wasDeleted()", PSing1::wasDeleted()); + threw = catcherr.catch_llerrs([](){ + (void)PSing1::instance(); + }); + ensure_contains("accessed deleted LLParamSingleton", threw, "deleted"); + } + + template<> template<> + void singleton_object_t::test<13>() + { + set_test_name("LLParamSingleton alternate ctor"); + + WrapLLErrs catcherr; + // We don't have to restate all the tests for PSing1. Only test validly + // using the other constructor. + PSing2::initParamSingleton(17); + ensure_equals(PSing2::instance().desc(), "17"); + // can't do it twice + std::string threw = catcherr.catch_llerrs([](){ + PSing2::initParamSingleton(34); + }); + ensure_contains("second ctor(int) didn't throw", threw, "twice"); + // can't use the other constructor either + threw = catcherr.catch_llerrs([](){ + PSing2::initParamSingleton("string"); + }); + ensure_contains("other ctor(string) didn't throw", threw, "twice"); + } + + class CircularPCtor: public LLParamSingleton<CircularPCtor> + { + LLSINGLETON(CircularPCtor) + { + // never mind indirection, just go straight for the circularity + (void)instance(); + } + }; + + template<> template<> + void singleton_object_t::test<14>() + { + set_test_name("Circular LLParamSingleton constructor"); + WrapLLErrs catcherr; + std::string threw = catcherr.catch_llerrs([](){ + CircularPCtor::initParamSingleton(); + }); + ensure_contains("constructor circularity didn't throw", threw, "constructor"); + } + + class CircularPInit: public LLParamSingleton<CircularPInit> + { + LLSINGLETON_EMPTY_CTOR(CircularPInit); + public: + virtual void initSingleton() + { + // never mind indirection, just go straight for the circularity + CircularPInit *pt = getInstance(); + if (!pt) + { + throw; + } + } + }; + + template<> template<> + void singleton_object_t::test<15>() + { + set_test_name("Circular LLParamSingleton initSingleton()"); + WrapLLErrs catcherr; + std::string threw = catcherr.catch_llerrs([](){ + CircularPInit::initParamSingleton(); + }); + ensure("initSingleton() circularity threw", threw.empty()); + } } diff --git a/indra/llcommon/tests/lluri_test.cpp b/indra/llcommon/tests/lluri_test.cpp index 4c64f15ca7..1a4c6641b9 100644 --- a/indra/llcommon/tests/lluri_test.cpp +++ b/indra/llcommon/tests/lluri_test.cpp @@ -383,6 +383,41 @@ namespace tut ensure_equals("query", u.query(), "redirect-http-hack=secondlife:///app/login?first_name=Callum&last_name=Linden&location=specify&grid=vaak®ion=/Morris/128/128&web_login_key=efaa4795-c2aa-4c58-8966-763c27931e78"); ensure_equals("query map element", u.queryMap()["redirect-http-hack"].asString(), "secondlife:///app/login?first_name=Callum&last_name=Linden&location=specify&grid=vaak®ion=/Morris/128/128&web_login_key=efaa4795-c2aa-4c58-8966-763c27931e78"); } + + template<> template<> + void URITestObject::test<20>() + { + set_test_name("escapePathAndData uri test"); + + // Basics scheme:[//authority]path[?query][#fragment] + ensure_equals(LLURI::escapePathAndData("dirname?query"), + "dirname?query"); + ensure_equals(LLURI::escapePathAndData("dirname?query=data"), + "dirname?query=data"); + ensure_equals(LLURI::escapePathAndData("host://dirname/subdir name?query#fragment"), + "host://dirname/subdir%20name?query#fragment"); + ensure_equals(LLURI::escapePathAndData("host://dirname/subdir name?query=some@>data#fragment"), + "host://dirname/subdir%20name?query=some@%3Edata#fragment"); + ensure_equals(LLURI::escapePathAndData("host://dir[name/subdir name?query=some[data#fra[gment"), + "host://dir[name/subdir%20name?query=some%5Bdata#fra[gment"); + ensure_equals(LLURI::escapePathAndData("mailto:zero@ll.com"), + "mailto:zero@ll.com"); + // pre-escaped + ensure_equals(LLURI::escapePathAndData("host://dirname/subdir%20name"), + "host://dirname/subdir%20name"); + + // data:[<mediatype>][;base64],<data> + ensure_equals(LLURI::escapePathAndData("data:,Hello, World!"), + "data:,Hello%2C%20World%21"); + ensure_equals(LLURI::escapePathAndData("data:text/html,<h1>Hello, World!</h1>"), + "data:text/html,%3Ch1%3EHello%2C%20World%21%3C%2Fh1%3E"); + // pre-escaped + ensure_equals(LLURI::escapePathAndData("data:text/html,%3Ch1%3EHello%2C%20World!</h1>"), + "data:text/html,%3Ch1%3EHello%2C%20World%21%3C%2Fh1%3E"); + // assume that base64 does not need escaping + ensure_equals(LLURI::escapePathAndData("data:image;base64,SGVs/bG8sIFd/vcmxkIQ%3D%3D!-&*?="), + "data:image;base64,SGVs/bG8sIFd/vcmxkIQ%3D%3D!-&*?="); + } } diff --git a/indra/llcommon/tests/wrapllerrs.h b/indra/llcommon/tests/wrapllerrs.h index 08fbf19b1c..b07d5afbd8 100644 --- a/indra/llcommon/tests/wrapllerrs.h +++ b/indra/llcommon/tests/wrapllerrs.h @@ -37,6 +37,7 @@ #include "llerrorcontrol.h" #include "llexception.h" #include "stringize.h" +#include "../test/catch_and_store_what_in.h" #include <boost/bind.hpp> #include <boost/noncopyable.hpp> #include <boost/shared_ptr.hpp> @@ -81,6 +82,31 @@ struct WrapLLErrs LLTHROW(FatalException(message)); } + /// Convenience wrapper for catch_what<FatalException>() + // + // The implementation makes it clear that this function need not be a + // member; it could easily be a free function. It is a member because it + // makes no sense to attempt to catch FatalException unless there is a + // WrapLLErrs instance in scope. Without a live WrapLLErrs instance, any + // LL_ERRS() reached by code within 'func' would terminate the test + // program instead of throwing FatalException. + // + // We were tempted to introduce a free function, likewise accepting + // arbitrary 'func', that would instantiate WrapLLErrs and then call + // catch_llerrs() on that instance. We decided against it, for this + // reason: on extending a test function containing a single call to that + // free function, a maintainer would most likely make additional calls to + // that free function, instead of switching to an explicit WrapLLErrs + // declaration with several calls to its catch_llerrs() member function. + // Even a construct such as WrapLLErrs().catch_llerrs(...) would make the + // object declaration more visible; it's not unreasonable to expect a + // maintainer to extend that by naming and reusing the WrapLLErrs instance. + template <typename FUNC> + std::string catch_llerrs(FUNC func) + { + return catch_what<FatalException>(func); + } + std::string error; LLError::SettingsStoragePtr mPriorErrorSettings; LLError::FatalFunction mPriorFatal; diff --git a/indra/llcorehttp/_httplibcurl.cpp b/indra/llcorehttp/_httplibcurl.cpp index abd304f6a5..975ce8a4d5 100644 --- a/indra/llcorehttp/_httplibcurl.cpp +++ b/indra/llcorehttp/_httplibcurl.cpp @@ -355,7 +355,8 @@ bool HttpLibcurl::completeRequest(CURLM * multi_handle, CURL * handle, CURLcode } if (op->mStatus) { - int http_status(HTTP_OK); + // note: CURLINFO_RESPONSE_CODE requires a long - https://curl.haxx.se/libcurl/c/CURLINFO_RESPONSE_CODE.html + long http_status(HTTP_OK); if (handle) { diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 680fbf548f..9dea876114 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -583,39 +583,29 @@ static void bilinear_scale(const U8 *src, U32 srcW, U32 srcH, U32 srcCh, U32 src // LLImage //--------------------------------------------------------------------------- -//static -std::string LLImage::sLastErrorMessage; -LLMutex* LLImage::sMutex = NULL; -bool LLImage::sUseNewByteRange = false; -S32 LLImage::sMinimalReverseByteRangePercent = 75; - -//static -void LLImage::initClass(bool use_new_byte_range, S32 minimal_reverse_byte_range_percent) +LLImage::LLImage(bool use_new_byte_range, S32 minimal_reverse_byte_range_percent) { - sUseNewByteRange = use_new_byte_range; - sMinimalReverseByteRangePercent = minimal_reverse_byte_range_percent; - sMutex = new LLMutex(); + mMutex = new LLMutex(); + mUseNewByteRange = use_new_byte_range; + mMinimalReverseByteRangePercent = minimal_reverse_byte_range_percent; } -//static -void LLImage::cleanupClass() +LLImage::~LLImage() { - delete sMutex; - sMutex = NULL; + delete mMutex; + mMutex = NULL; } -//static -const std::string& LLImage::getLastError() +const std::string& LLImage::getLastErrorMessage() { static const std::string noerr("No Error"); - return sLastErrorMessage.empty() ? noerr : sLastErrorMessage; + return mLastErrorMessage.empty() ? noerr : mLastErrorMessage; } -//static -void LLImage::setLastError(const std::string& message) +void LLImage::setLastErrorMessage(const std::string& message) { - LLMutexLock m(sMutex); - sLastErrorMessage = message; + LLMutexLock m(mMutex); + mLastErrorMessage = message; } //--------------------------------------------------------------------------- diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index 8ec49d3f0f..9f8d061293 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -30,6 +30,7 @@ #include "lluuid.h" #include "llstring.h" #include "llpointer.h" +#include "llsingleton.h" #include "lltrace.h" const S32 MIN_IMAGE_MIP = 2; // 4x4, only used for expand/contract power of 2 @@ -88,23 +89,25 @@ typedef enum e_image_codec //============================================================================ // library initialization class -class LLImage +class LLImage : public LLParamSingleton<LLImage> { + LLSINGLETON(LLImage, bool use_new_byte_range = false, S32 minimal_reverse_byte_range_percent = 75); + ~LLImage(); public: - static void initClass(bool use_new_byte_range = false, S32 minimal_reverse_byte_range_percent = 75); - static void cleanupClass(); - static const std::string& getLastError(); - static void setLastError(const std::string& message); - - static bool useNewByteRange() { return sUseNewByteRange; } - static S32 getReverseByteRangePercent() { return sMinimalReverseByteRangePercent; } - -protected: - static LLMutex* sMutex; - static std::string sLastErrorMessage; - static bool sUseNewByteRange; - static S32 sMinimalReverseByteRangePercent; + const std::string& getLastErrorMessage(); + static const std::string& getLastError() { return getInstance()->getLastErrorMessage(); }; + void setLastErrorMessage(const std::string& message); + static void setLastError(const std::string& message) { getInstance()->setLastErrorMessage(message); } + + bool useNewByteRange() { return mUseNewByteRange; } + S32 getReverseByteRangePercent() { return mMinimalReverseByteRangePercent; } + +private: + LLMutex* mMutex; + std::string mLastErrorMessage; + bool mUseNewByteRange; + S32 mMinimalReverseByteRangePercent; }; //============================================================================ diff --git a/indra/llimage/llimagebmp.cpp b/indra/llimage/llimagebmp.cpp index 867b2bb47b..90b7272efa 100644 --- a/indra/llimage/llimagebmp.cpp +++ b/indra/llimage/llimagebmp.cpp @@ -181,7 +181,7 @@ bool LLImageBMP::updateData() } } else - if( 12 <= header.mSize && 64 <= header.mSize ) + if( 12 <= header.mSize && header.mSize <= 64 ) { setLastError("OS/2 2.x BMP files are not supported"); return false; diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index 4bff21610f..71cab0554d 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -281,7 +281,7 @@ S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 r S32 bytes; S32 new_bytes = (S32) (sqrt((F32)(w*h))*(F32)(comp)*rate*1000.f/layer_factor); S32 old_bytes = (S32)((F32)(w*h*comp)*rate); - bytes = (LLImage::useNewByteRange() && (new_bytes < old_bytes) ? new_bytes : old_bytes); + bytes = (LLImage::getInstance()->useNewByteRange() && (new_bytes < old_bytes) ? new_bytes : old_bytes); bytes = llmax(bytes, calcHeaderSizeJ2C()); return bytes; } @@ -322,7 +322,7 @@ S32 LLImageJ2C::calcDiscardLevelBytes(S32 bytes) { S32 bytes_needed = calcDataSize(discard_level); // Use TextureReverseByteRange percent (see settings.xml) of the optimal size to qualify as correct rendering for the given discard level - if (bytes >= (bytes_needed*LLImage::getReverseByteRangePercent()/100)) + if (bytes >= (bytes_needed*LLImage::getInstance()->getReverseByteRangePercent()/100)) { break; } diff --git a/indra/llinventory/llinventorytype.h b/indra/llinventory/llinventorytype.h index 891ab217fd..034cee5f45 100644 --- a/indra/llinventory/llinventorytype.h +++ b/indra/llinventory/llinventorytype.h @@ -101,6 +101,7 @@ public: ICONNAME_CLOTHING_SKIRT, ICONNAME_CLOTHING_ALPHA, ICONNAME_CLOTHING_TATTOO, + ICONNAME_CLOTHING_UNIVERSAL, ICONNAME_ANIMATION, ICONNAME_GESTURE, diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h index 280d2653d3..0e2f62f9db 100644 --- a/indra/llmath/lloctree.h +++ b/indra/llmath/lloctree.h @@ -401,7 +401,7 @@ public: child->insert(data); } } - else + else if (parent) { //it's not in here, give it to the root OCT_ERRS << "Octree insertion failed, starting over from root!" << LL_ENDL; @@ -416,6 +416,13 @@ public: node->insert(data); } + else + { + // It's not in here, and we are root. + // LLOctreeRoot::insert() should have expanded + // root by now, something is wrong + OCT_ERRS << "Octree insertion failed! Root expansion failed." << LL_ENDL; + } return false; } @@ -763,10 +770,15 @@ public: { LLOctreeNode<T>::insert(data); } - else + else if (node->isInside(data->getPositionGroup())) { node->insert(data); } + else + { + // calling node->insert(data) will return us to root + OCT_ERRS << "Failed to insert data at child node" << LL_ENDL; + } } else if (this->getChildCount() == 0) { diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index ba1a2a035e..6a287f0cc5 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -49,101 +49,22 @@ #include <map> #include <set> -namespace LLAvatarNameCache -{ - use_display_name_signal_t mUseDisplayNamesSignal; - - // Cache starts in a paused state until we can determine if the - // current region supports display names. - bool sRunning = false; - - // Use the People API (modern) for fetching name if true. Use the old legacy protocol if false. - // For testing, there's a UsePeopleAPI setting that can be flipped (must restart viewer). - bool sUsePeopleAPI = true; - - // Base lookup URL for name service. - // On simulator, loaded from indra.xml - // On viewer, usually a simulator capability (at People API team's request) - // Includes the trailing slash, like "http://pdp60.lindenlab.com:8000/agents/" - std::string sNameLookupURL; - - // Accumulated agent IDs for next query against service - typedef std::set<LLUUID> ask_queue_t; - ask_queue_t sAskQueue; - - // Agent IDs that have been requested, but with no reply. - // Maps agent ID to frame time request was made. - typedef std::map<LLUUID, F64> pending_queue_t; - pending_queue_t sPendingQueue; - - // Callbacks to fire when we received a name. - // May have multiple callbacks for a single ID, which are - // represented as multiple slots bound to the signal. - // Avoid copying signals via pointers. - typedef std::map<LLUUID, callback_signal_t*> signal_map_t; - signal_map_t sSignalMap; - - // The cache at last, i.e. avatar names we know about. - typedef std::map<LLUUID, LLAvatarName> cache_t; - cache_t sCache; - - // Send bulk lookup requests a few times a second at most. - // Only need per-frame timing resolution. - LLFrameTimer sRequestTimer; - - // Maximum time an unrefreshed cache entry is allowed. - const F64 MAX_UNREFRESHED_TIME = 20.0 * 60.0; - - // Time when unrefreshed cached names were checked last. - static F64 sLastExpireCheck; - - // Time-to-live for a temp cache entry. - const F64 TEMP_CACHE_ENTRY_LIFETIME = 60.0; - - LLCore::HttpRequest::ptr_t sHttpRequest; - LLCore::HttpHeaders::ptr_t sHttpHeaders; - LLCore::HttpOptions::ptr_t sHttpOptions; - LLCore::HttpRequest::policy_t sHttpPolicy; - LLCore::HttpRequest::priority_t sHttpPriority; - - //----------------------------------------------------------------------- - // Internal methods - //----------------------------------------------------------------------- - - // Handle name response off network. - void processName(const LLUUID& agent_id, - const LLAvatarName& av_name); - - void requestNamesViaCapability(); - - // Legacy name system callbacks - void legacyNameCallback(const LLUUID& agent_id, - const std::string& full_name, - bool is_group); - void legacyNameFetch(const LLUUID& agent_id, - const std::string& full_name, - bool is_group); - - void requestNamesViaLegacy(); - - // Do a single callback to a given slot - void fireSignal(const LLUUID& agent_id, - const callback_slot_t& slot, - const LLAvatarName& av_name); - - // Is a request in-flight over the network? - bool isRequestPending(const LLUUID& agent_id); - // Erase expired names from cache - void eraseUnrefreshed(); +// Time-to-live for a temp cache entry. +const F64 TEMP_CACHE_ENTRY_LIFETIME = 60.0; +// Maximum time an unrefreshed cache entry is allowed. +const F64 MAX_UNREFRESHED_TIME = 20.0 * 60.0; - bool expirationFromCacheControl(const LLSD& headers, F64 *expires); +// Send bulk lookup requests a few times a second at most. +// Only need per-frame timing resolution. +static LLFrameTimer sRequestTimer; - // This is a coroutine. - void requestAvatarNameCache_(std::string url, std::vector<LLUUID> agentIds); - - void handleAvNameCacheSuccess(const LLSD &data, const LLSD &httpResult); -} +// static to avoid unnessesary dependencies +LLCore::HttpRequest::ptr_t sHttpRequest; +LLCore::HttpHeaders::ptr_t sHttpHeaders; +LLCore::HttpOptions::ptr_t sHttpOptions; +LLCore::HttpRequest::policy_t sHttpPolicy; +LLCore::HttpRequest::priority_t sHttpPriority; /* Sample response: <?xml version="1.0"?> @@ -187,6 +108,30 @@ namespace LLAvatarNameCache // Coroutine for sending and processing avatar name cache requests. // Do not call directly. See documentation in lleventcoro.h and llcoro.h for // further explanation. + +LLAvatarNameCache::LLAvatarNameCache() +{ + // Will be set to running later + // For now fail immediate lookups and query async ones. + mRunning = false; + + mUsePeopleAPI = true; + + sHttpRequest = LLCore::HttpRequest::ptr_t(new LLCore::HttpRequest()); + sHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()); + sHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()); + sHttpPolicy = LLCore::HttpRequest::DEFAULT_POLICY_ID; + sHttpPriority = 0; +} + +LLAvatarNameCache::~LLAvatarNameCache() +{ + sHttpRequest.reset(); + sHttpHeaders.reset(); + sHttpOptions.reset(); + mCache.clear(); +} + void LLAvatarNameCache::requestAvatarNameCache_(std::string url, std::vector<LLUUID> agentIds) { LL_DEBUGS("AvNameCache") << "Entering coroutine " << LLCoros::instance().getName() @@ -205,7 +150,7 @@ void LLAvatarNameCache::requestAvatarNameCache_(std::string url, std::vector<LLU { bool success = true; - LLCoreHttpUtil::HttpCoroutineAdapter httpAdapter("NameCache", LLAvatarNameCache::sHttpPolicy); + LLCoreHttpUtil::HttpCoroutineAdapter httpAdapter("NameCache", sHttpPolicy); LLSD results = httpAdapter.getAndSuspend(sHttpRequest, url); LL_DEBUGS() << results << LL_ENDL; @@ -233,12 +178,12 @@ void LLAvatarNameCache::requestAvatarNameCache_(std::string url, std::vector<LLU for ( ; it != agentIds.end(); ++it) { const LLUUID& agent_id = *it; - LLAvatarNameCache::handleAgentError(agent_id); + LLAvatarNameCache::getInstance()->handleAgentError(agent_id); } return; } - LLAvatarNameCache::handleAvNameCacheSuccess(results, httpResults); + LLAvatarNameCache::getInstance()->handleAvNameCacheSuccess(results, httpResults); } catch (...) @@ -300,15 +245,15 @@ void LLAvatarNameCache::handleAvNameCacheSuccess(const LLSD &data, const LLSD &h } } LL_DEBUGS("AvNameCache") << "LLAvatarNameResponder::result " - << LLAvatarNameCache::sCache.size() << " cached names" + << LLAvatarNameCache::mCache.size() << " cached names" << LL_ENDL; } // Provide some fallback for agents that return errors void LLAvatarNameCache::handleAgentError(const LLUUID& agent_id) { - std::map<LLUUID,LLAvatarName>::iterator existing = sCache.find(agent_id); - if (existing == sCache.end()) + std::map<LLUUID,LLAvatarName>::iterator existing = mCache.find(agent_id); + if (existing == mCache.end()) { // there is no existing cache entry, so make a temporary name from legacy LL_WARNS("AvNameCache") << "LLAvatarNameCache get legacy for agent " @@ -322,7 +267,7 @@ void LLAvatarNameCache::handleAgentError(const LLUUID& agent_id) // been returned by the get method, there is no need to signal anyone // Clear this agent from the pending list - LLAvatarNameCache::sPendingQueue.erase(agent_id); + LLAvatarNameCache::mPendingQueue.erase(agent_id); LLAvatarName& av_name = existing->second; LL_DEBUGS("AvNameCache") << "LLAvatarNameCache use cache for agent " << agent_id << LL_ENDL; @@ -341,19 +286,19 @@ void LLAvatarNameCache::processName(const LLUUID& agent_id, const LLAvatarName& } // Add to the cache - sCache[agent_id] = av_name; + mCache[agent_id] = av_name; // Suppress request from the queue - sPendingQueue.erase(agent_id); + mPendingQueue.erase(agent_id); // Signal everyone waiting on this name - signal_map_t::iterator sig_it = sSignalMap.find(agent_id); - if (sig_it != sSignalMap.end()) + signal_map_t::iterator sig_it = mSignalMap.find(agent_id); + if (sig_it != mSignalMap.end()) { callback_signal_t* signal = sig_it->second; (*signal)(agent_id, av_name); - sSignalMap.erase(agent_id); + mSignalMap.erase(agent_id); delete signal; signal = NULL; @@ -379,16 +324,16 @@ void LLAvatarNameCache::requestNamesViaCapability() U32 ids = 0; ask_queue_t::const_iterator it; - while(!sAskQueue.empty()) + while(!mAskQueue.empty()) { - it = sAskQueue.begin(); + it = mAskQueue.begin(); LLUUID agent_id = *it; - sAskQueue.erase(it); + mAskQueue.erase(it); if (url.empty()) { // ...starting new request - url += sNameLookupURL; + url += mNameLookupURL; url += "?ids="; ids = 1; } @@ -402,7 +347,7 @@ void LLAvatarNameCache::requestNamesViaCapability() agent_ids.push_back(agent_id); // mark request as pending - sPendingQueue[agent_id] = now; + mPendingQueue[agent_id] = now; if (url.size() > NAME_URL_SEND_THRESHOLD) { @@ -432,7 +377,7 @@ void LLAvatarNameCache::legacyNameCallback(const LLUUID& agent_id, // Retrieve the name and set it to never (or almost never...) expire: when we are using the legacy // protocol, we do not get an expiration date for each name and there's no reason to ask the // data again and again so we set the expiration time to the largest value admissible. - std::map<LLUUID,LLAvatarName>::iterator av_record = sCache.find(agent_id); + std::map<LLUUID,LLAvatarName>::iterator av_record = LLAvatarNameCache::getInstance()->mCache.find(agent_id); LLAvatarName& av_name = av_record->second; av_name.setExpires(MAX_UNREFRESHED_TIME); } @@ -451,7 +396,7 @@ void LLAvatarNameCache::legacyNameFetch(const LLUUID& agent_id, av_name.fromString(full_name); // Add to cache: we're still using the new cache even if we're using the old (legacy) protocol. - processName(agent_id, av_name); + LLAvatarNameCache::getInstance()->processName(agent_id, av_name); } void LLAvatarNameCache::requestNamesViaLegacy() @@ -460,15 +405,15 @@ void LLAvatarNameCache::requestNamesViaLegacy() F64 now = LLFrameTimer::getTotalSeconds(); std::string full_name; ask_queue_t::const_iterator it; - for (S32 requests = 0; !sAskQueue.empty() && requests < MAX_REQUESTS; ++requests) + for (S32 requests = 0; !mAskQueue.empty() && requests < MAX_REQUESTS; ++requests) { - it = sAskQueue.begin(); + it = mAskQueue.begin(); LLUUID agent_id = *it; - sAskQueue.erase(it); + mAskQueue.erase(it); // Mark as pending first, just in case the callback is immediately // invoked below. This should never happen in practice. - sPendingQueue[agent_id] = now; + mPendingQueue[agent_id] = now; LL_DEBUGS("AvNameCache") << "agent " << agent_id << LL_ENDL; @@ -477,26 +422,6 @@ void LLAvatarNameCache::requestNamesViaLegacy() } } -void LLAvatarNameCache::initClass(bool running, bool usePeopleAPI) -{ - sRunning = running; - sUsePeopleAPI = usePeopleAPI; - - sHttpRequest = LLCore::HttpRequest::ptr_t(new LLCore::HttpRequest()); - sHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()); - sHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()); - sHttpPolicy = LLCore::HttpRequest::DEFAULT_POLICY_ID; - sHttpPriority = 0; -} - -void LLAvatarNameCache::cleanupClass() -{ - sHttpRequest.reset(); - sHttpHeaders.reset(); - sHttpOptions.reset(); - sCache.clear(); -} - bool LLAvatarNameCache::importFile(std::istream& istr) { LLSD data; @@ -517,9 +442,9 @@ bool LLAvatarNameCache::importFile(std::istream& istr) { agent_id.set(it->first); av_name.fromLLSD( it->second ); - sCache[agent_id] = av_name; + mCache[agent_id] = av_name; } - LL_INFOS("AvNameCache") << "LLAvatarNameCache loaded " << sCache.size() << LL_ENDL; + LL_INFOS("AvNameCache") << "LLAvatarNameCache loaded " << mCache.size() << LL_ENDL; // Some entries may have expired since the cache was stored, // but they will be flushed in the first call to eraseUnrefreshed // from LLAvatarNameResponder::idle @@ -531,9 +456,9 @@ void LLAvatarNameCache::exportFile(std::ostream& ostr) { LLSD agents; F64 max_unrefreshed = LLFrameTimer::getTotalSeconds() - MAX_UNREFRESHED_TIME; - LL_INFOS("AvNameCache") << "LLAvatarNameCache at exit cache has " << sCache.size() << LL_ENDL; - cache_t::const_iterator it = sCache.begin(); - for ( ; it != sCache.end(); ++it) + LL_INFOS("AvNameCache") << "LLAvatarNameCache at exit cache has " << mCache.size() << LL_ENDL; + cache_t::const_iterator it = mCache.begin(); + for ( ; it != mCache.end(); ++it) { const LLUUID& agent_id = it->first; const LLAvatarName& av_name = it->second; @@ -552,23 +477,28 @@ void LLAvatarNameCache::exportFile(std::ostream& ostr) void LLAvatarNameCache::setNameLookupURL(const std::string& name_lookup_url) { - sNameLookupURL = name_lookup_url; + mNameLookupURL = name_lookup_url; } bool LLAvatarNameCache::hasNameLookupURL() { - return !sNameLookupURL.empty(); + return !mNameLookupURL.empty(); +} + +void LLAvatarNameCache::setUsePeopleAPI(bool use_api) +{ + mUsePeopleAPI = use_api; } bool LLAvatarNameCache::usePeopleAPI() { - return hasNameLookupURL() && sUsePeopleAPI; + return hasNameLookupURL() && mUsePeopleAPI; } void LLAvatarNameCache::idle() { // By convention, start running at first idle() call - sRunning = true; + mRunning = true; // *TODO: Possibly re-enabled this based on People API load measurements // 100 ms is the threshold for "user speed" operations, so we can @@ -579,7 +509,7 @@ void LLAvatarNameCache::idle() return; } - if (!sAskQueue.empty()) + if (!mAskQueue.empty()) { if (usePeopleAPI()) { @@ -592,7 +522,7 @@ void LLAvatarNameCache::idle() } } - if (sAskQueue.empty()) + if (mAskQueue.empty()) { // cleared the list, reset the request timer. sRequestTimer.resetWithExpiry(SECS_BETWEEN_REQUESTS); @@ -607,8 +537,8 @@ bool LLAvatarNameCache::isRequestPending(const LLUUID& agent_id) bool isPending = false; const F64 PENDING_TIMEOUT_SECS = 5.0 * 60.0; - pending_queue_t::const_iterator it = sPendingQueue.find(agent_id); - if (it != sPendingQueue.end()) + pending_queue_t::const_iterator it = mPendingQueue.find(agent_id); + if (it != mPendingQueue.end()) { // in the list of requests in flight, retry if too old F64 expire_time = LLFrameTimer::getTotalSeconds() - PENDING_TIMEOUT_SECS; @@ -622,11 +552,11 @@ void LLAvatarNameCache::eraseUnrefreshed() F64 now = LLFrameTimer::getTotalSeconds(); F64 max_unrefreshed = now - MAX_UNREFRESHED_TIME; - if (!sLastExpireCheck || sLastExpireCheck < max_unrefreshed) + if (!mLastExpireCheck || mLastExpireCheck < max_unrefreshed) { - sLastExpireCheck = now; + mLastExpireCheck = now; S32 expired = 0; - for (cache_t::iterator it = sCache.begin(); it != sCache.end();) + for (cache_t::iterator it = mCache.begin(); it != mCache.end();) { const LLAvatarName& av_name = it->second; if (av_name.mExpires < max_unrefreshed) @@ -635,7 +565,7 @@ void LLAvatarNameCache::eraseUnrefreshed() << " user '" << av_name.getAccountName() << "' " << "expired " << now - av_name.mExpires << " secs ago" << LL_ENDL; - sCache.erase(it++); + mCache.erase(it++); expired++; } else @@ -644,19 +574,24 @@ void LLAvatarNameCache::eraseUnrefreshed() } } LL_INFOS("AvNameCache") << "LLAvatarNameCache expired " << expired << " cached avatar names, " - << sCache.size() << " remaining" << LL_ENDL; + << mCache.size() << " remaining" << LL_ENDL; } } +//static, wrapper +bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name) +{ + return LLAvatarNameCache::getInstance()->getName(agent_id, av_name); +} // fills in av_name if it has it in the cache, even if expired (can check expiry time) // returns bool specifying if av_name was filled, false otherwise -bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name) +bool LLAvatarNameCache::getName(const LLUUID& agent_id, LLAvatarName *av_name) { - if (sRunning) + if (mRunning) { // ...only do immediate lookups when cache is running - std::map<LLUUID,LLAvatarName>::iterator it = sCache.find(agent_id); - if (it != sCache.end()) + std::map<LLUUID,LLAvatarName>::iterator it = mCache.find(agent_id); + if (it != mCache.end()) { *av_name = it->second; @@ -667,7 +602,7 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name) { LL_DEBUGS("AvNameCache") << "LLAvatarNameCache refresh agent " << agent_id << LL_ENDL; - sAskQueue.insert(agent_id); + mAskQueue.insert(agent_id); } } @@ -678,7 +613,7 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name) if (!isRequestPending(agent_id)) { LL_DEBUGS("AvNameCache") << "LLAvatarNameCache queue request for agent " << agent_id << LL_ENDL; - sAskQueue.insert(agent_id); + mAskQueue.insert(agent_id); } return false; @@ -693,15 +628,21 @@ void LLAvatarNameCache::fireSignal(const LLUUID& agent_id, signal(agent_id, av_name); } +// static, wrapper LLAvatarNameCache::callback_connection_t LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot) { + return LLAvatarNameCache::getInstance()->getNameCallback(agent_id, slot); +} + +LLAvatarNameCache::callback_connection_t LLAvatarNameCache::getNameCallback(const LLUUID& agent_id, callback_slot_t slot) +{ callback_connection_t connection; - if (sRunning) + if (mRunning) { // ...only do immediate lookups when cache is running - std::map<LLUUID,LLAvatarName>::iterator it = sCache.find(agent_id); - if (it != sCache.end()) + std::map<LLUUID,LLAvatarName>::iterator it = mCache.find(agent_id); + if (it != mCache.end()) { const LLAvatarName& av_name = it->second; @@ -717,17 +658,17 @@ LLAvatarNameCache::callback_connection_t LLAvatarNameCache::get(const LLUUID& ag // schedule a request if (!isRequestPending(agent_id)) { - sAskQueue.insert(agent_id); + mAskQueue.insert(agent_id); } // always store additional callback, even if request is pending - signal_map_t::iterator sig_it = sSignalMap.find(agent_id); - if (sig_it == sSignalMap.end()) + signal_map_t::iterator sig_it = mSignalMap.find(agent_id); + if (sig_it == mSignalMap.end()) { // ...new callback for this id callback_signal_t* signal = new callback_signal_t(); connection = signal->connect(slot); - sSignalMap[agent_id] = signal; + mSignalMap[agent_id] = signal; } else { @@ -760,20 +701,20 @@ void LLAvatarNameCache::setUseUsernames(bool use) void LLAvatarNameCache::erase(const LLUUID& agent_id) { - sCache.erase(agent_id); + mCache.erase(agent_id); } void LLAvatarNameCache::insert(const LLUUID& agent_id, const LLAvatarName& av_name) { // *TODO: update timestamp if zero? - sCache[agent_id] = av_name; + mCache[agent_id] = av_name; } LLUUID LLAvatarNameCache::findIdByName(const std::string& name) { std::map<LLUUID, LLAvatarName>::iterator it; - std::map<LLUUID, LLAvatarName>::iterator end = sCache.end(); - for (it = sCache.begin(); it != end; ++it) + std::map<LLUUID, LLAvatarName>::iterator end = mCache.end(); + for (it = mCache.begin(); it != end; ++it) { if (it->second.getUserName() == name) { diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h index 63e067c939..ba89d569f3 100644 --- a/indra/llmessage/llavatarnamecache.h +++ b/indra/llmessage/llavatarnamecache.h @@ -29,21 +29,20 @@ #define LLAVATARNAMECACHE_H #include "llavatarname.h" // for convenience +#include "llsingleton.h" #include <boost/signals2.hpp> +#include <set> class LLSD; class LLUUID; -namespace LLAvatarNameCache +class LLAvatarNameCache : public LLSingleton<LLAvatarNameCache> { + LLSINGLETON(LLAvatarNameCache); + ~LLAvatarNameCache(); +public: typedef boost::signals2::signal<void (void)> use_display_name_signal_t; - // Until the cache is set running, immediate lookups will fail and - // async lookups will be queued. This allows us to block requests - // until we know if the first region supports display names. - void initClass(bool running, bool usePeopleAPI); - void cleanupClass(); - // Import/export the name cache to file. bool importFile(std::istream& istr); void exportFile(std::ostream& ostr); @@ -55,6 +54,7 @@ namespace LLAvatarNameCache // Do we have a valid lookup URL, i.e. are we trying to use the // more recent display name lookup system? bool hasNameLookupURL(); + void setUsePeopleAPI(bool use_api); bool usePeopleAPI(); // Periodically makes a batch request for display names not already in @@ -63,7 +63,8 @@ namespace LLAvatarNameCache // If name is in cache, returns true and fills in provided LLAvatarName // otherwise returns false. - bool get(const LLUUID& agent_id, LLAvatarName *av_name); + static bool get(const LLUUID& agent_id, LLAvatarName *av_name); + bool getName(const LLUUID& agent_id, LLAvatarName *av_name); // Callback types for get() below typedef boost::signals2::signal< @@ -74,7 +75,8 @@ namespace LLAvatarNameCache // Fetches name information and calls callbacks. // If name information is in cache, callbacks will be called immediately. - callback_connection_t get(const LLUUID& agent_id, callback_slot_t slot); + static callback_connection_t get(const LLUUID& agent_id, callback_slot_t slot); + callback_connection_t getNameCallback(const LLUUID& agent_id, callback_slot_t slot); // Set display name: flips the switch and triggers the callbacks. void setUseDisplayNames(bool use); @@ -100,7 +102,83 @@ namespace LLAvatarNameCache F64 nameExpirationFromHeaders(const LLSD& headers); void addUseDisplayNamesCallback(const use_display_name_signal_t::slot_type& cb); -} + +private: + // Handle name response off network. + void processName(const LLUUID& agent_id, + const LLAvatarName& av_name); + + void requestNamesViaCapability(); + + // Legacy name system callbacks + static void legacyNameCallback(const LLUUID& agent_id, + const std::string& full_name, + bool is_group); + static void legacyNameFetch(const LLUUID& agent_id, + const std::string& full_name, + bool is_group); + + void requestNamesViaLegacy(); + + // Do a single callback to a given slot + void fireSignal(const LLUUID& agent_id, + const callback_slot_t& slot, + const LLAvatarName& av_name); + + // Is a request in-flight over the network? + bool isRequestPending(const LLUUID& agent_id); + + // Erase expired names from cache + void eraseUnrefreshed(); + + bool expirationFromCacheControl(const LLSD& headers, F64 *expires); + + // This is a coroutine. + static void requestAvatarNameCache_(std::string url, std::vector<LLUUID> agentIds); + + void handleAvNameCacheSuccess(const LLSD &data, const LLSD &httpResult); + +private: + + use_display_name_signal_t mUseDisplayNamesSignal; + + // Cache starts in a paused state until we can determine if the + // current region supports display names. + bool mRunning; + + // Use the People API (modern) for fetching name if true. Use the old legacy protocol if false. + // For testing, there's a UsePeopleAPI setting that can be flipped (must restart viewer). + bool mUsePeopleAPI; + + // Base lookup URL for name service. + // On simulator, loaded from indra.xml + // On viewer, usually a simulator capability (at People API team's request) + // Includes the trailing slash, like "http://pdp60.lindenlab.com:8000/agents/" + std::string mNameLookupURL; + + // Accumulated agent IDs for next query against service + typedef std::set<LLUUID> ask_queue_t; + ask_queue_t mAskQueue; + + // Agent IDs that have been requested, but with no reply. + // Maps agent ID to frame time request was made. + typedef std::map<LLUUID, F64> pending_queue_t; + pending_queue_t mPendingQueue; + + // Callbacks to fire when we received a name. + // May have multiple callbacks for a single ID, which are + // represented as multiple slots bound to the signal. + // Avoid copying signals via pointers. + typedef std::map<LLUUID, callback_signal_t*> signal_map_t; + signal_map_t mSignalMap; + + // The cache at last, i.e. avatar names we know about. + typedef std::map<LLUUID, LLAvatarName> cache_t; + cache_t mCache; + + // Time when unrefreshed cached names were checked last. + F64 mLastExpireCheck; +}; // Parse a cache-control header to get the max-age delta-seconds. // Returns true if header has max-age param and it parses correctly. diff --git a/indra/llmessage/lliosocket.cpp b/indra/llmessage/lliosocket.cpp index b15b98db80..7caf0766b7 100644 --- a/indra/llmessage/lliosocket.cpp +++ b/indra/llmessage/lliosocket.cpp @@ -265,7 +265,7 @@ LLSocket::~LLSocket() void LLSocket::setBlocking(S32 timeout) { // set up the socket options - ll_apr_warn_status(apr_socket_timeout_set(mSocket, timeout)); + ll_apr_warn_status(apr_socket_timeout_set(mSocket, timeout)); // Sets both receive and send timeout SO_RCVTIMEO, SO_SNDTIMEO ll_apr_warn_status(apr_socket_opt_set(mSocket, APR_SO_NONBLOCK, 0)); ll_apr_warn_status(apr_socket_opt_set(mSocket, APR_SO_SNDBUF, LL_SEND_BUFFER_SIZE)); ll_apr_warn_status(apr_socket_opt_set(mSocket, APR_SO_RCVBUF, LL_RECV_BUFFER_SIZE)); diff --git a/indra/llmessage/llproxy.cpp b/indra/llmessage/llproxy.cpp index 5730a36267..950599217f 100644 --- a/indra/llmessage/llproxy.cpp +++ b/indra/llmessage/llproxy.cpp @@ -403,8 +403,11 @@ LLSocks5AuthType LLProxy::getSelectedAuthMethod() const //static void LLProxy::cleanupClass() { - getInstance()->stopSOCKSProxy(); - deleteSingleton(); + if (instanceExists()) + { + getInstance()->stopSOCKSProxy(); + deleteSingleton(); + } } /** @@ -473,7 +476,8 @@ static apr_status_t tcp_blocking_handshake(LLSocket::ptr_t handle, char * dataou rv = apr_socket_send(apr_socket, dataout, &outlen); if (APR_SUCCESS != rv) { - LL_WARNS("Proxy") << "Error sending data to proxy control channel, status: " << rv << LL_ENDL; + char buf[MAX_STRING]; + LL_WARNS("Proxy") << "Error sending data to proxy control channel, status: " << rv << " " << apr_strerror(rv, buf, MAX_STRING) << LL_ENDL; ll_apr_warn_status(rv); } else if (expected_len != outlen) @@ -483,13 +487,16 @@ static apr_status_t tcp_blocking_handshake(LLSocket::ptr_t handle, char * dataou rv = -1; } + ms_sleep(1); + if (APR_SUCCESS == rv) { expected_len = maxinlen; rv = apr_socket_recv(apr_socket, datain, &maxinlen); if (rv != APR_SUCCESS) { - LL_WARNS("Proxy") << "Error receiving data from proxy control channel, status: " << rv << LL_ENDL; + char buf[MAX_STRING]; + LL_WARNS("Proxy") << "Error receiving data from proxy control channel, status: " << rv << " " << apr_strerror(rv, buf, MAX_STRING) << LL_ENDL; ll_apr_warn_status(rv); } else if (expected_len < maxinlen) diff --git a/indra/llmessage/tests/llareslistener_test.cpp b/indra/llmessage/tests/llareslistener_test.cpp index c04696c86b..254185cbd0 100644 --- a/indra/llmessage/tests/llareslistener_test.cpp +++ b/indra/llmessage/tests/llareslistener_test.cpp @@ -138,15 +138,9 @@ namespace tut WrapLLErrs capture; LLSD request; request["op"] = "foo"; - std::string threw; - try - { - LLEventPumps::instance().obtain("LLAres").post(request); - } - catch (const WrapLLErrs::FatalException& e) - { - threw = e.what(); - } + std::string threw = capture.catch_llerrs([&request](){ + LLEventPumps::instance().obtain("LLAres").post(request); + }); ensure_contains("LLAresListener bad op", threw, "bad"); } @@ -157,15 +151,9 @@ namespace tut WrapLLErrs capture; LLSD request; request["op"] = "rewriteURI"; - std::string threw; - try - { - LLEventPumps::instance().obtain("LLAres").post(request); - } - catch (const WrapLLErrs::FatalException& e) - { - threw = e.what(); - } + std::string threw = capture.catch_llerrs([&request](){ + LLEventPumps::instance().obtain("LLAres").post(request); + }); ensure_contains("LLAresListener bad req", threw, "missing"); ensure_contains("LLAresListener bad req", threw, "reply"); ensure_contains("LLAresListener bad req", threw, "uri"); @@ -179,15 +167,9 @@ namespace tut LLSD request; request["op"] = "rewriteURI"; request["reply"] = "nonexistent"; - std::string threw; - try - { - LLEventPumps::instance().obtain("LLAres").post(request); - } - catch (const WrapLLErrs::FatalException& e) - { - threw = e.what(); - } + std::string threw = capture.catch_llerrs([&request](){ + LLEventPumps::instance().obtain("LLAres").post(request); + }); ensure_contains("LLAresListener bad req", threw, "missing"); ensure_contains("LLAresListener bad req", threw, "uri"); ensure_does_not_contain("LLAresListener bad req", threw, "reply"); @@ -201,15 +183,9 @@ namespace tut LLSD request; request["op"] = "rewriteURI"; request["uri"] = "foo.bar.com"; - std::string threw; - try - { - LLEventPumps::instance().obtain("LLAres").post(request); - } - catch (const WrapLLErrs::FatalException& e) - { - threw = e.what(); - } + std::string threw = capture.catch_llerrs([&request](){ + LLEventPumps::instance().obtain("LLAres").post(request); + }); ensure_contains("LLAresListener bad req", threw, "missing"); ensure_contains("LLAresListener bad req", threw, "reply"); ensure_does_not_contain("LLAresListener bad req", threw, "uri"); diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index 27d1bee9bd..a0987b35d8 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -1040,14 +1040,26 @@ S32 LLPrimitive::packTEField(U8 *cur_ptr, U8 *data_ptr, U8 data_size, U8 last_fa } //assign exception faces to cur_ptr - if (exception_faces >= (0x1 << 7)) + if (exception_faces >= ((U64)0x1 << 7)) { - if (exception_faces >= (0x1 << 14)) + if (exception_faces >= ((U64)0x1 << 14)) { - if (exception_faces >= (0x1 << 21)) + if (exception_faces >= ((U64)0x1 << 21)) { - if (exception_faces >= (0x1 << 28)) + if (exception_faces >= ((U64)0x1 << 28)) { + if (exception_faces >= ((U64)0x1 << 35)) + { + if (exception_faces >= ((U64)0x1 << 42)) + { + if (exception_faces >= ((U64)0x1 << 49)) + { + *cur_ptr++ = (U8)(((exception_faces >> 49) & 0x7F) | 0x80); + } + *cur_ptr++ = (U8)(((exception_faces >> 42) & 0x7F) | 0x80); + } + *cur_ptr++ = (U8)(((exception_faces >> 35) & 0x7F) | 0x80); + } *cur_ptr++ = (U8)(((exception_faces >> 28) & 0x7F) | 0x80); } *cur_ptr++ = (U8)(((exception_faces >> 21) & 0x7F) | 0x80); @@ -1056,6 +1068,7 @@ S32 LLPrimitive::packTEField(U8 *cur_ptr, U8 *data_ptr, U8 data_size, U8 last_fa } *cur_ptr++ = (U8)(((exception_faces >> 7) & 0x7F) | 0x80); } + *cur_ptr++ = (U8)(exception_faces & 0x7F); @@ -1115,7 +1128,7 @@ S32 LLPrimitive::unpackTEField(U8 *cur_ptr, U8 *buffer_end, U8 *data_ptr, U8 dat // Includes information about image ID, color, scale S,T, offset S,T and rotation BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const { - const U32 MAX_TES = 32; + const U32 MAX_TES = 45; U8 image_ids[MAX_TES*16]; U8 colors[MAX_TES*4]; @@ -1200,7 +1213,7 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const BOOL LLPrimitive::packTEMessage(LLDataPacker &dp) const { - const U32 MAX_TES = 32; + const U32 MAX_TES = 45; U8 image_ids[MAX_TES*16]; U8 colors[MAX_TES*4]; @@ -1313,6 +1326,8 @@ S32 LLPrimitive::parseTEMessage(LLMessageSystem* mesgsys, char const* block_name mesgsys->getBinaryDataFast(block_name, _PREHASH_TextureEntry, tec.packed_buffer, 0, block_num, LLTEContents::MAX_TE_BUFFER); } + + tec.face_count = llmin((U32)getNumTEs(),(U32)LLTEContents::MAX_TES); U8 *cur_ptr = tec.packed_buffer; @@ -1385,6 +1400,8 @@ S32 LLPrimitive::applyParsedTEMessage(LLTEContents& tec) retval |= setTEColor(i, color); + + } return retval; @@ -1403,7 +1420,7 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp) { // use a negative block_num to indicate a single-block read (a non-variable block) S32 retval = 0; - const U32 MAX_TES = 32; + const U32 MAX_TES = 45; // Avoid construction of 32 UUIDs per call static LLUUID image_ids[MAX_TES]; diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h index c138c2ac2b..6fd433c337 100644 --- a/indra/llprimitive/llprimitive.h +++ b/indra/llprimitive/llprimitive.h @@ -319,7 +319,7 @@ public: // - Vir struct LLTEContents { - static const U32 MAX_TES = 32; + static const U32 MAX_TES = 45; U8 image_data[MAX_TES*16]; U8 colors[MAX_TES*4]; diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index ab668dc192..c41730ebaa 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -157,7 +157,7 @@ void ft_close_cb(FT_Stream stream) { } #endif -BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, S32 components, BOOL is_fallback) +BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, S32 components, BOOL is_fallback, S32 face_n) { // Don't leak face objects. This is also needed to deal with // changed font file names. @@ -168,40 +168,8 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v } int error; - #ifdef LL_WINDOWS - pFileStream = new llifstream(filename, std::ios::binary); - if (pFileStream->is_open()) - { - std::streampos beg = pFileStream->tellg(); - pFileStream->seekg(0, std::ios::end); - std::streampos end = pFileStream->tellg(); - std::size_t file_size = end - beg; - pFileStream->seekg(0, std::ios::beg); - - pFtStream = new LLFT_Stream(); - pFtStream->base = 0; - pFtStream->pos = 0; - pFtStream->size = file_size; - pFtStream->descriptor.pointer = pFileStream; - pFtStream->read = ft_read_cb; - pFtStream->close = ft_close_cb; - - FT_Open_Args args; - args.flags = FT_OPEN_STREAM; - args.stream = (FT_StreamRec*)pFtStream; - - error = FT_Open_Face(gFTLibrary, - &args, - 0, - &mFTFace); - } - else - { - delete pFileStream; - pFileStream = NULL; - return FALSE; - } + error = ftOpenFace(filename, face_n); #else error = FT_New_Face( gFTLibrary, filename.c_str(), @@ -212,11 +180,7 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v if (error) { #ifdef LL_WINDOWS - pFileStream->close(); - delete pFileStream; - delete pFtStream; - pFileStream = NULL; - pFtStream = NULL; + clearFontStreams(); #endif return FALSE; } @@ -235,11 +199,7 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v // Clean up freetype libs. FT_Done_Face(mFTFace); #ifdef LL_WINDOWS - pFileStream->close(); - delete pFileStream; - delete pFtStream; - pFileStream = NULL; - pFtStream = NULL; + clearFontStreams(); #endif mFTFace = NULL; return FALSE; @@ -285,18 +245,88 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v if(mFTFace->style_flags & FT_STYLE_FLAG_BOLD) { mStyle |= LLFontGL::BOLD; - mStyle &= ~LLFontGL::NORMAL; } if(mFTFace->style_flags & FT_STYLE_FLAG_ITALIC) { mStyle |= LLFontGL::ITALIC; - mStyle &= ~LLFontGL::NORMAL; } return TRUE; } +S32 LLFontFreetype::getNumFaces(const std::string& filename) +{ + if (mFTFace) + { + FT_Done_Face(mFTFace); + mFTFace = NULL; + } + + S32 num_faces = 1; + +#ifdef LL_WINDOWS + int error = ftOpenFace(filename, 0); + + if (error) + { + return 0; + } + else + { + num_faces = mFTFace->num_faces; + } + + FT_Done_Face(mFTFace); + clearFontStreams(); + mFTFace = NULL; +#endif + + return num_faces; +} + +#ifdef LL_WINDOWS +S32 LLFontFreetype::ftOpenFace(const std::string& filename, S32 face_n) +{ + S32 error = -1; + pFileStream = new llifstream(filename, std::ios::binary); + if (pFileStream->is_open()) + { + std::streampos beg = pFileStream->tellg(); + pFileStream->seekg(0, std::ios::end); + std::streampos end = pFileStream->tellg(); + std::size_t file_size = end - beg; + pFileStream->seekg(0, std::ios::beg); + + pFtStream = new LLFT_Stream(); + pFtStream->base = 0; + pFtStream->pos = 0; + pFtStream->size = file_size; + pFtStream->descriptor.pointer = pFileStream; + pFtStream->read = ft_read_cb; + pFtStream->close = ft_close_cb; + + FT_Open_Args args; + args.flags = FT_OPEN_STREAM; + args.stream = (FT_StreamRec*)pFtStream; + error = FT_Open_Face(gFTLibrary, &args, face_n, &mFTFace); + } + return error; +} + +void LLFontFreetype::clearFontStreams() +{ + if (pFileStream) + { + pFileStream->close(); + } + delete pFileStream; + delete pFtStream; + pFileStream = NULL; + pFtStream = NULL; +} +#endif + void LLFontFreetype::setFallbackFonts(const font_vector_t &font) { mFallbackFonts = font; diff --git a/indra/llrender/llfontfreetype.h b/indra/llrender/llfontfreetype.h index aadebf5e70..1afe84e770 100644 --- a/indra/llrender/llfontfreetype.h +++ b/indra/llrender/llfontfreetype.h @@ -84,7 +84,14 @@ public: // is_fallback should be true for fallback fonts that aren't used // to render directly (Unicode backup, primarily) - BOOL loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, S32 components, BOOL is_fallback); + BOOL loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, S32 components, BOOL is_fallback, S32 face_n = 0); + + S32 getNumFaces(const std::string& filename); + +#ifdef LL_WINDOWS + S32 ftOpenFace(const std::string& filename, S32 face_n); + void clearFontStreams(); +#endif typedef std::vector<LLPointer<LLFontFreetype> > font_vector_t; diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 8cd18c5fa1..86a4c35e6d 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -89,14 +89,24 @@ void LLFontGL::destroyGL() mFontFreetype->destroyGL(); } -BOOL LLFontGL::loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, S32 components, BOOL is_fallback) +BOOL LLFontGL::loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, S32 components, BOOL is_fallback, S32 face_n) { if(mFontFreetype == reinterpret_cast<LLFontFreetype*>(NULL)) { mFontFreetype = new LLFontFreetype; } - return mFontFreetype->loadFace(filename, point_size, vert_dpi, horz_dpi, components, is_fallback); + return mFontFreetype->loadFace(filename, point_size, vert_dpi, horz_dpi, components, is_fallback, face_n); +} + +S32 LLFontGL::getNumFaces(const std::string& filename) +{ + if (mFontFreetype == reinterpret_cast<LLFontFreetype*>(NULL)) + { + mFontFreetype = new LLFontFreetype; + } + + return mFontFreetype->getNumFaces(filename); } static LLTrace::BlockTimerStatHandle FTM_RENDER_FONTS("Fonts"); @@ -860,10 +870,6 @@ void LLFontGL::destroyAllGL() U8 LLFontGL::getStyleFromString(const std::string &style) { S32 ret = 0; - if (style.find("NORMAL") != style.npos) - { - ret |= NORMAL; - } if (style.find("BOLD") != style.npos) { ret |= BOLD; @@ -883,7 +889,7 @@ U8 LLFontGL::getStyleFromString(const std::string &style) std::string LLFontGL::getStringFromStyle(U8 style) { std::string style_string; - if (style & NORMAL) + if (style == NORMAL) { style_string += "|NORMAL"; } diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h index 7d0e53f60f..10891faed9 100644 --- a/indra/llrender/llfontgl.h +++ b/indra/llrender/llfontgl.h @@ -87,7 +87,9 @@ public: void destroyGL(); - BOOL loadFace(const std::string& filename, F32 point_size, const F32 vert_dpi, const F32 horz_dpi, const S32 components, BOOL is_fallback); + BOOL loadFace(const std::string& filename, F32 point_size, const F32 vert_dpi, const F32 horz_dpi, const S32 components, BOOL is_fallback, S32 face_n = 0); + + S32 getNumFaces(const std::string& filename); S32 render(const LLWString &text, S32 begin_offset, const LLRect& rect, diff --git a/indra/llrender/llfontregistry.cpp b/indra/llrender/llfontregistry.cpp index 3c829596ce..dbe71e2882 100644 --- a/indra/llrender/llfontregistry.cpp +++ b/indra/llrender/llfontregistry.cpp @@ -44,6 +44,8 @@ using std::map; bool font_desc_init_from_xml(LLXMLNodePtr node, LLFontDescriptor& desc); bool init_from_xml(LLFontRegistry* registry, LLXMLNodePtr node); +const std::string MACOSX_FONT_PATH_LIBRARY = "/Library/Fonts/"; + LLFontDescriptor::LLFontDescriptor(): mStyle(0) { @@ -61,6 +63,16 @@ LLFontDescriptor::LLFontDescriptor(const std::string& name, } LLFontDescriptor::LLFontDescriptor(const std::string& name, + const std::string& size, + const U8 style, + const string_vec_t& file_names, + const string_vec_t& ft_collection_listections) : + LLFontDescriptor(name, size, style, file_names) +{ + mFontCollectionsList = ft_collection_listections; +} + +LLFontDescriptor::LLFontDescriptor(const std::string& name, const std::string& size, const U8 style): mName(name), @@ -162,7 +174,7 @@ LLFontDescriptor LLFontDescriptor::normalize() const if (removeSubString(new_name,"Italic")) new_style |= LLFontGL::ITALIC; - return LLFontDescriptor(new_name,new_size,new_style,getFileNames()); + return LLFontDescriptor(new_name,new_size,new_style,getFileNames(),getFontCollectionsList()); } LLFontRegistry::LLFontRegistry(bool create_gl_textures) @@ -213,6 +225,7 @@ bool LLFontRegistry::parseFontInfo(const std::string& xml_filename) success = success || init_succ; } } + //if (success) // dump(); @@ -260,6 +273,16 @@ bool font_desc_init_from_xml(LLXMLNodePtr node, LLFontDescriptor& desc) { std::string font_file_name = child->getTextContents(); desc.getFileNames().push_back(font_file_name); + + if (child->hasAttribute("load_collection")) + { + BOOL col = FALSE; + child->getAttributeBOOL("load_collection", col); + if (col) + { + desc.getFontCollectionsList().push_back(font_file_name); + } + } } else if (child->hasName("os")) { @@ -306,8 +329,15 @@ bool init_from_xml(LLFontRegistry* registry, LLXMLNodePtr node) match_file_names.insert(match_file_names.begin(), desc.getFileNames().begin(), desc.getFileNames().end()); + + string_vec_t collections_list = match_desc->getFontCollectionsList(); + collections_list.insert(collections_list.begin(), + desc.getFontCollectionsList().begin(), + desc.getFontCollectionsList().end()); + LLFontDescriptor new_desc = *match_desc; new_desc.getFileNames() = match_file_names; + new_desc.getFontCollectionsList() = collections_list; registry->mFontMap.erase(*match_desc); registry->mFontMap[new_desc] = NULL; } @@ -393,6 +423,7 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) // Build list of font names to look for. // Files specified for this font come first, followed by those from the default descriptor. string_vec_t file_names = match_desc->getFileNames(); + string_vec_t ft_collection_list = match_desc->getFontCollectionsList(); string_vec_t default_file_names; LLFontDescriptor default_desc("default",s_template_string,0); const LLFontDescriptor *match_default_desc = getMatchingFontDesc(default_desc); @@ -401,6 +432,9 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) file_names.insert(file_names.end(), match_default_desc->getFileNames().begin(), match_default_desc->getFileNames().end()); + ft_collection_list.insert(ft_collection_list.end(), + match_default_desc->getFontCollectionsList().begin(), + match_default_desc->getFontCollectionsList().end()); } // Add ultimate fallback list - generated dynamically on linux, @@ -433,39 +467,62 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) file_name_it != file_names.end(); ++file_name_it) { - LLFontGL *fontp = new LLFontGL; - std::string font_path = local_path + *file_name_it; + LLFontGL *fontp = NULL; + string_vec_t font_paths; + font_paths.push_back(local_path + *file_name_it); + font_paths.push_back(sys_path + *file_name_it); +#if LL_DARWIN + font_paths.push_back(MACOSX_FONT_PATH_LIBRARY + *file_name_it); +#endif + + bool is_ft_collection = (std::find(ft_collection_list.begin(), ft_collection_list.end(), *file_name_it) != ft_collection_list.end()); // *HACK: Fallback fonts don't render, so we can use that to suppress // creation of OpenGL textures for test apps. JC BOOL is_fallback = !is_first_found || !mCreateGLTextures; F32 extra_scale = (is_fallback)?fallback_scale:1.0; - if (!fontp->loadFace(font_path, extra_scale * point_size, - LLFontGL::sVertDPI, LLFontGL::sHorizDPI, 2, is_fallback)) + F32 point_size_scale = extra_scale * point_size; + bool is_font_loaded = false; + for(string_vec_t::iterator font_paths_it = font_paths.begin(); + font_paths_it != font_paths.end(); + ++font_paths_it) { - font_path = sys_path + *file_name_it; - - if (!fontp->loadFace(font_path, extra_scale * point_size, - LLFontGL::sVertDPI, LLFontGL::sHorizDPI, 2, is_fallback)) + fontp = new LLFontGL; + S32 num_faces = is_ft_collection ? fontp->getNumFaces(*font_paths_it) : 1; + for (S32 i = 0; i < num_faces; i++) { - LL_INFOS_ONCE("LLFontRegistry") << "Couldn't load font " << *file_name_it << " from path " << local_path << LL_ENDL; - delete fontp; - fontp = NULL; + if (fontp == NULL) + { + fontp = new LLFontGL; + } + if (fontp->loadFace(*font_paths_it, point_size_scale, + LLFontGL::sVertDPI, LLFontGL::sHorizDPI, 2, is_fallback, i)) + { + is_font_loaded = true; + if (is_first_found) + { + result = fontp; + is_first_found = false; + } + else + { + fontlist.push_back(fontp->mFontFreetype); + delete fontp; + fontp = NULL; + } + } + else + { + delete fontp; + fontp = NULL; + } } + if (is_font_loaded) break; } - - if(fontp) + if(!is_font_loaded) { - if (is_first_found) - { - result = fontp; - is_first_found = false; - } - else - { - fontlist.push_back(fontp->mFontFreetype); - delete fontp; - fontp = NULL; - } + LL_INFOS_ONCE("LLFontRegistry") << "Couldn't load font " << *file_name_it << LL_ENDL; + delete fontp; + fontp = NULL; } } diff --git a/indra/llrender/llfontregistry.h b/indra/llrender/llfontregistry.h index 177eb6c8a5..e30c81c630 100644 --- a/indra/llrender/llfontregistry.h +++ b/indra/llrender/llfontregistry.h @@ -40,6 +40,7 @@ public: LLFontDescriptor(); LLFontDescriptor(const std::string& name, const std::string& size, const U8 style); LLFontDescriptor(const std::string& name, const std::string& size, const U8 style, const string_vec_t& file_names); + LLFontDescriptor(const std::string& name, const std::string& size, const U8 style, const string_vec_t& file_names, const string_vec_t& font_collections); LLFontDescriptor normalize() const; bool operator<(const LLFontDescriptor& b) const; @@ -52,6 +53,8 @@ public: void setSize(const std::string& size) { mSize = size; } const std::vector<std::string>& getFileNames() const { return mFileNames; } std::vector<std::string>& getFileNames() { return mFileNames; } + const std::vector<std::string>& getFontCollectionsList() const { return mFontCollectionsList; } + std::vector<std::string>& getFontCollectionsList() { return mFontCollectionsList; } const U8 getStyle() const { return mStyle; } void setStyle(U8 style) { mStyle = style; } @@ -59,6 +62,7 @@ private: std::string mName; std::string mSize; string_vec_t mFileNames; + string_vec_t mFontCollectionsList; U8 mStyle; }; diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp index 4e2ebfd51e..4eb0203245 100644 --- a/indra/llrender/llrender2dutils.cpp +++ b/indra/llrender/llrender2dutils.cpp @@ -46,8 +46,6 @@ // Globals // const LLColor4 UI_VERTEX_COLOR(1.f, 1.f, 1.f, 1.f); -/*static*/ LLVector2 LLRender2D::sGLScaleFactor(1.f, 1.f); -/*static*/ LLImageProviderInterface* LLRender2D::sImageProvider = NULL; // // Functions @@ -108,10 +106,11 @@ void gl_rect_2d_offset_local( S32 left, S32 top, S32 right, S32 bottom, S32 pixe top += LLFontGL::sCurOrigin.mY; gGL.loadUIIdentity(); - gl_rect_2d(llfloor((F32)left * LLRender2D::sGLScaleFactor.mV[VX]) - pixel_offset, - llfloor((F32)top * LLRender2D::sGLScaleFactor.mV[VY]) + pixel_offset, - llfloor((F32)right * LLRender2D::sGLScaleFactor.mV[VX]) + pixel_offset, - llfloor((F32)bottom * LLRender2D::sGLScaleFactor.mV[VY]) - pixel_offset, + LLRender2D *r2d_inst = LLRender2D::getInstance(); + gl_rect_2d(llfloor((F32)left * r2d_inst->mGLScaleFactor.mV[VX]) - pixel_offset, + llfloor((F32)top * r2d_inst->mGLScaleFactor.mV[VY]) + pixel_offset, + llfloor((F32)right * r2d_inst->mGLScaleFactor.mV[VX]) + pixel_offset, + llfloor((F32)bottom * r2d_inst->mGLScaleFactor.mV[VY]) - pixel_offset, filled); gGL.popUIMatrix(); } @@ -800,7 +799,7 @@ void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LL } gGL.end(); - LLRender2D::setLineWidth(1.f); + LLRender2D::getInstance()->setLineWidth(1.f); } void gl_arc_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled, F32 start_angle, F32 end_angle) @@ -967,7 +966,7 @@ void gl_rect_2d_checkerboard(const LLRect& rect, GLfloat alpha) } else { //polygon stipple is deprecated, use "Checker" texture - LLPointer<LLUIImage> img = LLRender2D::getUIImage("Checker"); + LLPointer<LLUIImage> img = LLRender2D::getInstance()->getUIImage("Checker"); gGL.getTexUnit(0)->bind(img->getImage()); gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_WRAP); gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT); @@ -1567,25 +1566,26 @@ void gl_segmented_rect_3d_tex(const LLRectf& clip_rect, const LLRectf& center_uv } -// static -void LLRender2D::initClass(LLImageProviderInterface* image_provider, - const LLVector2* scale_factor) +LLRender2D::LLRender2D(LLImageProviderInterface* image_provider) { - sGLScaleFactor = (scale_factor == NULL) ? LLVector2(1.f, 1.f) : *scale_factor; - sImageProvider = image_provider; + mGLScaleFactor = LLVector2(1.f, 1.f); + mImageProvider = image_provider; + if(mImageProvider) + { + mImageProvider->addOnRemovalCallback(resetProvider); + } } -// static -void LLRender2D::cleanupClass() +LLRender2D::~LLRender2D() { - if(sImageProvider) + if(mImageProvider) { - sImageProvider->cleanUp(); + mImageProvider->cleanUp(); + mImageProvider->deleteOnRemovalCallback(resetProvider); } } -//static void LLRender2D::translate(F32 x, F32 y, F32 z) { gGL.translateUI(x,y,z); @@ -1594,14 +1594,12 @@ void LLRender2D::translate(F32 x, F32 y, F32 z) LLFontGL::sCurDepth += z; } -//static void LLRender2D::pushMatrix() { gGL.pushUIMatrix(); LLFontGL::sOriginStack.push_back(std::make_pair(LLFontGL::sCurOrigin, LLFontGL::sCurDepth)); } -//static void LLRender2D::popMatrix() { gGL.popUIMatrix(); @@ -1610,7 +1608,6 @@ void LLRender2D::popMatrix() LLFontGL::sOriginStack.pop_back(); } -//static void LLRender2D::loadIdentity() { gGL.loadUIIdentity(); @@ -1619,25 +1616,22 @@ void LLRender2D::loadIdentity() LLFontGL::sCurDepth = 0.f; } -//static void LLRender2D::setScaleFactor(const LLVector2 &scale_factor) { - sGLScaleFactor = scale_factor; + mGLScaleFactor = scale_factor; } -//static void LLRender2D::setLineWidth(F32 width) { gGL.flush(); - glLineWidth(width * lerp(sGLScaleFactor.mV[VX], sGLScaleFactor.mV[VY], 0.5f)); + glLineWidth(width * lerp(mGLScaleFactor.mV[VX], mGLScaleFactor.mV[VY], 0.5f)); } -//static LLPointer<LLUIImage> LLRender2D::getUIImageByID(const LLUUID& image_id, S32 priority) { - if (sImageProvider) + if (mImageProvider) { - return sImageProvider->getUIImageByID(image_id, priority); + return mImageProvider->getUIImageByID(image_id, priority); } else { @@ -1645,12 +1639,49 @@ LLPointer<LLUIImage> LLRender2D::getUIImageByID(const LLUUID& image_id, S32 prio } } -//static LLPointer<LLUIImage> LLRender2D::getUIImage(const std::string& name, S32 priority) { - if (!name.empty() && sImageProvider) - return sImageProvider->getUIImage(name, priority); + if (!name.empty() && mImageProvider) + return mImageProvider->getUIImage(name, priority); else return NULL; } +// static +void LLRender2D::resetProvider() +{ + if (LLRender2D::instanceExists) + { + LLRender2D::getInstance()->mImageProvider = NULL; + } +} + +// class LLImageProviderInterface + +LLImageProviderInterface::~LLImageProviderInterface() +{ + for (callback_list_t::iterator iter = mCallbackList.begin(); iter != mCallbackList.end();) + { + callback_list_t::iterator curiter = iter++; + (*curiter)(); + } +} + +void LLImageProviderInterface::addOnRemovalCallback(callback_t func) +{ + if (!func) + { + return; + } + mCallbackList.push_back(func); +} + +void LLImageProviderInterface::deleteOnRemovalCallback(callback_t func) +{ + callback_list_t::iterator iter = std::find(mCallbackList.begin(), mCallbackList.end(), func); + if (iter != mCallbackList.end()) + { + mCallbackList.erase(iter); + } +} + diff --git a/indra/llrender/llrender2dutils.h b/indra/llrender/llrender2dutils.h index cce3b4ed51..70ab006fd6 100644 --- a/indra/llrender/llrender2dutils.h +++ b/indra/llrender/llrender2dutils.h @@ -121,39 +121,54 @@ inline void gl_rect_2d_offset_local( const LLRect& rect, S32 pixel_offset, BOOL class LLImageProviderInterface; -class LLRender2D +class LLRender2D : public LLParamSingleton<LLRender2D> { + LLSINGLETON(LLRender2D, LLImageProviderInterface* image_provider); LOG_CLASS(LLRender2D); + ~LLRender2D(); public: - static void initClass(LLImageProviderInterface* image_provider, - const LLVector2* scale_factor); - static void cleanupClass(); + void pushMatrix(); + void popMatrix(); + void loadIdentity(); + void translate(F32 x, F32 y, F32 z = 0.0f); - static void pushMatrix(); - static void popMatrix(); - static void loadIdentity(); - static void translate(F32 x, F32 y, F32 z = 0.0f); + void setLineWidth(F32 width); + void setScaleFactor(const LLVector2& scale_factor); - static void setLineWidth(F32 width); - static void setScaleFactor(const LLVector2& scale_factor); + LLPointer<LLUIImage> getUIImageByID(const LLUUID& image_id, S32 priority = 0); + LLPointer<LLUIImage> getUIImage(const std::string& name, S32 priority = 0); - static LLPointer<LLUIImage> getUIImageByID(const LLUUID& image_id, S32 priority = 0); - static LLPointer<LLUIImage> getUIImage(const std::string& name, S32 priority = 0); + LLVector2 mGLScaleFactor; + +protected: + // since LLRender2D has no control of image provider's lifecycle + // we need a way to tell LLRender2D that provider died and + // LLRender2D needs to be updated. + static void resetProvider(); - static LLVector2 sGLScaleFactor; private: - static LLImageProviderInterface* sImageProvider; + LLImageProviderInterface* mImageProvider; }; class LLImageProviderInterface { protected: LLImageProviderInterface() {}; - virtual ~LLImageProviderInterface() {}; + virtual ~LLImageProviderInterface(); public: virtual LLPointer<LLUIImage> getUIImage(const std::string& name, S32 priority) = 0; virtual LLPointer<LLUIImage> getUIImageByID(const LLUUID& id, S32 priority) = 0; virtual void cleanUp() = 0; + + // to notify holders when pointer gets deleted + typedef void(*callback_t)(); + void addOnRemovalCallback(callback_t func); + void deleteOnRemovalCallback(callback_t func); + +private: + + typedef std::list< callback_t > callback_list_t; + callback_list_t mCallbackList; }; diff --git a/indra/llrender/lluiimage.cpp b/indra/llrender/lluiimage.cpp index 5d8f92b2e6..c8337feabb 100644 --- a/indra/llrender/lluiimage.cpp +++ b/indra/llrender/lluiimage.cpp @@ -120,12 +120,12 @@ void LLUIImage::draw3D(const LLVector3& origin_agent, const LLVector3& x_axis, c } } - LLRender2D::pushMatrix(); + LLRender2D::getInstance()->pushMatrix(); { LLVector3 rect_origin = origin_agent + (rect.mLeft * x_axis) + (rect.mBottom * y_axis); - LLRender2D::translate(rect_origin.mV[VX], - rect_origin.mV[VY], - rect_origin.mV[VZ]); + LLRender2D::getInstance()->translate(rect_origin.mV[VX], + rect_origin.mV[VY], + rect_origin.mV[VZ]); gGL.getTexUnit(0)->bind(getImage()); gGL.color4fv(color.mV); @@ -142,7 +142,7 @@ void LLUIImage::draw3D(const LLVector3& origin_agent, const LLVector3& x_axis, c rect.getWidth() * x_axis, rect.getHeight() * y_axis); - } LLRender2D::popMatrix(); + } LLRender2D::getInstance()->popMatrix(); } @@ -199,7 +199,7 @@ namespace LLInitParam return; } - LLUIImage* imagep = LLRender2D::getUIImage(name()); + LLUIImage* imagep = LLRender2D::getInstance()->getUIImage(name()); if (imagep) { updateValue(imagep); diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index eaf1284237..1034a21905 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -977,7 +977,7 @@ void LLAccordionCtrlTab::drawChild(const LLRect& root_rect,LLView* child) LLRect screen_rect; localRectToScreen(child->getRect(),&screen_rect); - if ( root_rect.overlaps(screen_rect) && LLUI::sDirtyRect.overlaps(screen_rect)) + if ( root_rect.overlaps(screen_rect) && LLUI::getInstance()->mDirtyRect.overlaps(screen_rect)) { gGL.matrixMode(LLRender::MM_MODELVIEW); LLUI::pushMatrix(); diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 6b7a8a8b86..27444b7f5b 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -90,8 +90,8 @@ LLButton::Params::Params() image_overlay_disabled_color("image_overlay_disabled_color", LLColor4::white % 0.3f), image_overlay_selected_color("image_overlay_selected_color", LLColor4::white), flash_color("flash_color"), - pad_right("pad_right", LLUI::sSettingGroups["config"]->getS32("ButtonHPad")), - pad_left("pad_left", LLUI::sSettingGroups["config"]->getS32("ButtonHPad")), + pad_right("pad_right", LLUI::getInstance()->mSettingGroups["config"]->getS32("ButtonHPad")), + pad_left("pad_left", LLUI::getInstance()->mSettingGroups["config"]->getS32("ButtonHPad")), pad_bottom("pad_bottom"), click_callback("click_callback"), mouse_down_callback("mouse_down_callback"), @@ -614,7 +614,7 @@ void LLButton::getOverlayImageSize(S32& overlay_width, S32& overlay_height) // virtual void LLButton::draw() { - static LLCachedControl<bool> sEnableButtonFlashing(*LLUI::sSettingGroups["config"], "EnableButtonFlashing", true); + static LLCachedControl<bool> sEnableButtonFlashing(*LLUI::getInstance()->mSettingGroups["config"], "EnableButtonFlashing", true); F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency(); bool pressed_by_keyboard = FALSE; @@ -628,7 +628,7 @@ void LLButton::draw() { S32 local_mouse_x ; S32 local_mouse_y; - LLUI::getMousePositionLocal(this, &local_mouse_x, &local_mouse_y); + LLUI::getInstance()->getMousePositionLocal(this, &local_mouse_x, &local_mouse_y); mouse_pressed_and_over = pointInView(local_mouse_x, local_mouse_y); } @@ -1261,10 +1261,10 @@ void LLButton::showHelp(LLUICtrl* ctrl, const LLSD& sdname) // search back through the button's parents for a panel // with a help_topic string defined std::string help_topic; - if (LLUI::sHelpImpl && + if (LLUI::getInstance()->mHelpImpl && ctrl->findHelpTopic(help_topic)) { - LLUI::sHelpImpl->showTopic(help_topic); + LLUI::getInstance()->mHelpImpl->showTopic(help_topic); return; // success } diff --git a/indra/llui/llchatentry.cpp b/indra/llui/llchatentry.cpp index dac001afab..c506576126 100644 --- a/indra/llui/llchatentry.cpp +++ b/indra/llui/llchatentry.cpp @@ -201,7 +201,7 @@ BOOL LLChatEntry::handleSpecialKey(const KEY key, const MASK mask) } else { - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } handled = TRUE; } @@ -225,7 +225,7 @@ BOOL LLChatEntry::handleSpecialKey(const KEY key, const MASK mask) } else { - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } handled = TRUE; } diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index b2ad38bddf..c7f0326ed4 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -668,7 +668,7 @@ void LLComboBox::showList() mButton->setToggleState(TRUE); mList->setVisible(TRUE); - LLUI::addPopup(this); + LLUI::getInstance()->addPopup(this); setUseBoundingRect(TRUE); // updateBoundingRect(); @@ -694,7 +694,7 @@ void LLComboBox::hideList() mList->mouseOverHighlightNthItem(-1); setUseBoundingRect(FALSE); - LLUI::removePopup(this); + LLUI::getInstance()->removePopup(this); // updateBoundingRect(); } } diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp index 26ae31cac6..5f50e46233 100644 --- a/indra/llui/llconsole.cpp +++ b/indra/llui/llconsole.cpp @@ -68,7 +68,7 @@ LLConsole::LLConsole(const LLConsole::Params& p) setFontSize(p.font_size_index); } mFadeTime = mLinePersistTime - FADE_DURATION; - setMaxLines(LLUI::sSettingGroups["config"]->getS32("ConsoleMaxLines")); + setMaxLines(LLUI::getInstance()->mSettingGroups["config"]->getS32("ConsoleMaxLines")); } void LLConsole::setLinePersistTime(F32 seconds) @@ -180,7 +180,7 @@ void LLConsole::draw() LLUIImagePtr imagep = LLUI::getUIImage("transparent"); - F32 console_opacity = llclamp(LLUI::sSettingGroups["config"]->getF32("ConsoleBackgroundOpacity"), 0.f, 1.f); + F32 console_opacity = llclamp(LLUI::getInstance()->mSettingGroups["config"]->getF32("ConsoleBackgroundOpacity"), 0.f, 1.f); LLColor4 color = LLUIColorTable::instance().getColor("ConsoleBackground"); color.mV[VALPHA] *= console_opacity; diff --git a/indra/llui/llconsole.h b/indra/llui/llconsole.h index 5ff05698b0..04f5e71609 100644 --- a/indra/llui/llconsole.h +++ b/indra/llui/llconsole.h @@ -51,7 +51,7 @@ public: Optional<F32> persist_time; Optional<S32> font_size_index; Params() - : max_lines("max_lines", LLUI::sSettingGroups["config"]->getS32("ConsoleMaxLines")), + : max_lines("max_lines", LLUI::getInstance()->mSettingGroups["config"]->getS32("ConsoleMaxLines")), persist_time("persist_time", 0.f), // forever font_size_index("font_size_index") { diff --git a/indra/llui/llflashtimer.cpp b/indra/llui/llflashtimer.cpp index 6d9c429b08..39793316f4 100644 --- a/indra/llui/llflashtimer.cpp +++ b/indra/llui/llflashtimer.cpp @@ -40,10 +40,10 @@ LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period) // By default use settings from settings.xml to be able change them via Debug settings. See EXT-5973. // Due to Timer is implemented as derived class from EventTimer it is impossible to change period // in runtime. So, both settings are made as required restart. - mFlashCount = 2 * ((count > 0) ? count : LLUI::sSettingGroups["config"]->getS32("FlashCount")); + mFlashCount = 2 * ((count > 0) ? count : LLUI::getInstance()->mSettingGroups["config"]->getS32("FlashCount")); if (mPeriod <= 0) { - mPeriod = LLUI::sSettingGroups["config"]->getF32("FlashPeriod"); + mPeriod = LLUI::getInstance()->mSettingGroups["config"]->getF32("FlashPeriod"); } } diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index a245dd8f78..42802cd339 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -215,14 +215,14 @@ void LLFloater::initClass() sButtonToolTips[i] = LLTrans::getString( sButtonToolTipsIndex[i] ); } - LLControlVariable* ctrl = LLUI::sSettingGroups["config"]->getControl("ActiveFloaterTransparency").get(); + LLControlVariable* ctrl = LLUI::getInstance()->mSettingGroups["config"]->getControl("ActiveFloaterTransparency").get(); if (ctrl) { ctrl->getSignal()->connect(boost::bind(&LLFloater::updateActiveFloaterTransparency)); updateActiveFloaterTransparency(); } - ctrl = LLUI::sSettingGroups["config"]->getControl("InactiveFloaterTransparency").get(); + ctrl = LLUI::getInstance()->mSettingGroups["config"]->getControl("InactiveFloaterTransparency").get(); if (ctrl) { ctrl->getSignal()->connect(boost::bind(&LLFloater::updateInactiveFloaterTransparency)); @@ -374,13 +374,13 @@ void LLFloater::layoutDragHandle() // static void LLFloater::updateActiveFloaterTransparency() { - sActiveControlTransparency = LLUI::sSettingGroups["config"]->getF32("ActiveFloaterTransparency"); + sActiveControlTransparency = LLUI::getInstance()->mSettingGroups["config"]->getF32("ActiveFloaterTransparency"); } // static void LLFloater::updateInactiveFloaterTransparency() { - sInactiveControlTransparency = LLUI::sSettingGroups["config"]->getF32("InactiveFloaterTransparency"); + sInactiveControlTransparency = LLUI::getInstance()->mSettingGroups["config"]->getF32("InactiveFloaterTransparency"); } void LLFloater::addResizeCtrls() @@ -579,7 +579,7 @@ std::string LLFloater::getControlName(const std::string& name, const LLSD& key) LLControlGroup* LLFloater::getControlGroup() { // Floater size, position, visibility, etc are saved in per-account settings. - return LLUI::sSettingGroups["account"]; + return LLUI::getInstance()->mSettingGroups["account"]; } void LLFloater::setVisible( BOOL visible ) @@ -592,7 +592,7 @@ void LLFloater::setVisible( BOOL visible ) if( !visible ) { - LLUI::removePopup(this); + LLUI::getInstance()->removePopup(this); if( gFocusMgr.childHasMouseCapture( this ) ) { @@ -818,7 +818,7 @@ void LLFloater::reshape(S32 width, S32 height, BOOL called_from_parent) void LLFloater::releaseFocus() { - LLUI::removePopup(this); + LLUI::getInstance()->removePopup(this); setFocus(FALSE); @@ -1771,13 +1771,13 @@ void LLFloater::onClickDock(LLFloater* self) // static void LLFloater::onClickHelp( LLFloater* self ) { - if (self && LLUI::sHelpImpl) + if (self && LLUI::getInstance()->mHelpImpl) { // find the current help context for this floater std::string help_topic; if (self->findHelpTopic(help_topic)) { - LLUI::sHelpImpl->showTopic(help_topic); + LLUI::getInstance()->mHelpImpl->showTopic(help_topic); } } } @@ -2931,7 +2931,7 @@ void LLFloaterView::syncFloaterTabOrder() if (modal_dialog) { // If we have a visible modal dialog, make sure that it has focus - LLUI::addPopup(modal_dialog); + LLUI::getInstance()->addPopup(modal_dialog); if( !gFocusMgr.childHasKeyboardFocus( modal_dialog ) ) { diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 9ef290abc0..85e07fc6a6 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -445,7 +445,7 @@ void LLFloaterReg::registerControlVariables() } } - const LLSD& exclude_list = LLUI::sSettingGroups["config"]->getLLSD("always_showable_floaters"); + const LLSD& exclude_list = LLUI::getInstance()->mSettingGroups["config"]->getLLSD("always_showable_floaters"); for (LLSD::array_const_iterator iter = exclude_list.beginArray(); iter != exclude_list.endArray(); iter++) diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp index 1b213c3418..7b0a6cbdae 100644 --- a/indra/llui/llfocusmgr.cpp +++ b/indra/llui/llfocusmgr.cpp @@ -183,7 +183,7 @@ void LLFocusMgr::releaseFocusIfNeeded( LLView* view ) } } - LLUI::removePopup(view); + LLUI::getInstance()->removePopup(view); } void LLFocusMgr::setKeyboardFocus(LLFocusableElement* new_focus, BOOL lock, BOOL keystrokes_only) @@ -481,7 +481,7 @@ void LLFocusMgr::setAppHasFocus(BOOL focus) // release focus from "top ctrl"s, which generally hides them if (!focus) { - LLUI::clearPopups(); + LLUI::getInstance()->clearPopups(); } mAppHasFocus = focus; } diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 895753aeae..b05a9807d0 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -338,7 +338,7 @@ static LLTrace::BlockTimerStatHandle FTM_FILTER("Filter Folder View"); void LLFolderView::filter( LLFolderViewFilter& filter ) { LL_RECORD_BLOCK_TIME(FTM_FILTER); - filter.resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32(mParentPanel.get()->getVisible() ? "FilterItemsMaxTimePerFrameVisible" : "FilterItemsMaxTimePerFrameUnvisible"), 1, 100)); + filter.resetTime(llclamp(LLUI::getInstance()->mSettingGroups["config"]->getS32(mParentPanel.get()->getVisible() ? "FilterItemsMaxTimePerFrameVisible" : "FilterItemsMaxTimePerFrameUnvisible"), 1, 100)); // Note: we filter the model, not the view getViewModelItem()->filter(filter); @@ -657,7 +657,7 @@ void LLFolderView::draw() closeAutoOpenedFolders(); } - if (mSearchTimer.getElapsedTimeF32() > LLUI::sSettingGroups["config"]->getF32("TypeAheadTimeout") || !mSearchString.size()) + if (mSearchTimer.getElapsedTimeF32() > LLUI::getInstance()->mSettingGroups["config"]->getF32("TypeAheadTimeout") || !mSearchString.size()) { mSearchString.clear(); } @@ -733,7 +733,7 @@ void LLFolderView::closeRenamer( void ) if (mRenamer && mRenamer->getVisible()) { // Triggers onRenamerLost() that actually closes the renamer. - LLUI::removePopup(mRenamer); + LLUI::getInstance()->removePopup(mRenamer); } } @@ -1064,7 +1064,7 @@ void LLFolderView::startRenamingSelectedItem( void ) // set focus will fail unless item is visible mRenamer->setFocus( TRUE ); mRenamer->setTopLostCallback(boost::bind(&LLFolderView::onRenamerLost, this)); - LLUI::addPopup(mRenamer); + LLUI::getInstance()->addPopup(mRenamer); } } @@ -1321,7 +1321,7 @@ BOOL LLFolderView::handleUnicodeCharHere(llwchar uni_char) } //do text search - if (mSearchTimer.getElapsedTimeF32() > LLUI::sSettingGroups["config"]->getF32("TypeAheadTimeout")) + if (mSearchTimer.getElapsedTimeF32() > LLUI::getInstance()->mSettingGroups["config"]->getF32("TypeAheadTimeout")) { mSearchString.clear(); } @@ -1803,7 +1803,7 @@ void LLFolderView::updateRenamerPosition() screenPointToLocal( x, y, &x, &y ); mRenamer->setOrigin( x, y ); - LLRect scroller_rect(0, 0, (S32)LLUI::getWindowSize().mV[VX], 0); + LLRect scroller_rect(0, 0, (S32)LLUI::getInstance()->getWindowSize().mV[VX], 0); if (mScrollContainer) { scroller_rect = mScrollContainer->getContentWindowRect(); diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 0510e472c5..2de47f1a19 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -548,7 +548,7 @@ BOOL LLFolderViewItem::handleMouseDown( S32 x, S32 y, MASK mask ) BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask ) { - static LLCachedControl<S32> drag_and_drop_threshold(*LLUI::sSettingGroups["config"],"DragAndDropDistanceThreshold", 3); + static LLCachedControl<S32> drag_and_drop_threshold(*LLUI::getInstance()->mSettingGroups["config"],"DragAndDropDistanceThreshold", 3); mIsMouseOverTitle = (y > (getRect().getHeight() - mItemHeight)); diff --git a/indra/llui/llfolderviewmodel.cpp b/indra/llui/llfolderviewmodel.cpp index 3363dc5316..3b45fb53a2 100644 --- a/indra/llui/llfolderviewmodel.cpp +++ b/indra/llui/llfolderviewmodel.cpp @@ -48,7 +48,7 @@ std::string LLFolderViewModelCommon::getStatusText() void LLFolderViewModelCommon::filter() { - getFilter().resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsMaxTimePerFrameVisible"), 1, 100)); + getFilter().resetTime(llclamp(LLUI::getInstance()->mSettingGroups["config"]->getS32("FilterItemsMaxTimePerFrameVisible"), 1, 100)); mFolderView->getViewModelItem()->filter(getFilter()); } diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 955e7089f4..4a464b3507 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -209,7 +209,7 @@ LLLayoutStack::Params::Params() open_time_constant("open_time_constant", 0.02f), close_time_constant("close_time_constant", 0.03f), resize_bar_overlap("resize_bar_overlap", 1), - border_size("border_size", LLCachedControl<S32>(*LLUI::sSettingGroups["config"], "UIResizeBarHeight", 0)), + border_size("border_size", LLCachedControl<S32>(*LLUI::getInstance()->mSettingGroups["config"], "UIResizeBarHeight", 0)), show_drag_handle("show_drag_handle", false), drag_handle_first_indent("drag_handle_first_indent", 0), drag_handle_second_indent("drag_handle_second_indent", 0), diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index ff8bf30319..3ad504d68d 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -941,7 +941,7 @@ void LLLineEditor::removeChar() } else { - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } } @@ -992,7 +992,7 @@ void LLLineEditor::addChar(const llwchar uni_char) } else { - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } getWindow()->hideCursorUntilMouseMove(); @@ -1088,7 +1088,7 @@ BOOL LLLineEditor::handleSelectionKey(KEY key, MASK mask) } else { - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } break; @@ -1104,7 +1104,7 @@ BOOL LLLineEditor::handleSelectionKey(KEY key, MASK mask) } else { - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } break; @@ -1184,7 +1184,7 @@ void LLLineEditor::cut() if( need_to_rollback ) { rollback.doRollback( this ); - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } else { @@ -1288,7 +1288,7 @@ void LLLineEditor::pasteHelper(bool is_primary) } // Truncate the clean string at the limit of what will fit clean_string = clean_string.substr(0, wchars_that_fit); - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } if (mMaxLengthChars) @@ -1300,7 +1300,7 @@ void LLLineEditor::pasteHelper(bool is_primary) clean_string = clean_string.substr(0, available_chars); } - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } mText.insert(getCursor(), clean_string); @@ -1312,7 +1312,7 @@ void LLLineEditor::pasteHelper(bool is_primary) if( need_to_rollback ) { rollback.doRollback( this ); - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } else { @@ -1376,7 +1376,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) } else { - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } } handled = TRUE; @@ -1425,7 +1425,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) } else { - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } handled = TRUE; } @@ -1452,7 +1452,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) } else { - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } handled = TRUE; } @@ -1469,7 +1469,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) } else { - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } handled = TRUE; } @@ -1486,7 +1486,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) } else { - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } handled = TRUE; } @@ -1567,7 +1567,7 @@ BOOL LLLineEditor::handleKeyHere(KEY key, MASK mask ) { rollback.doRollback(this); - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } // Notify owner if requested @@ -1623,7 +1623,7 @@ BOOL LLLineEditor::handleUnicodeCharHere(llwchar uni_char) { rollback.doRollback( this ); - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } // Notify owner if requested @@ -1674,7 +1674,7 @@ void LLLineEditor::doDelete() if( need_to_rollback ) { rollback.doRollback( this ); - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } else { @@ -2478,7 +2478,7 @@ BOOL LLLineEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect { LLRect control_rect_screen; localRectToScreen(getRect(), &control_rect_screen); - LLUI::screenRectToGL(control_rect_screen, control); + LLUI::getInstance()->screenRectToGL(control_rect_screen, control); } S32 preedit_left_column, preedit_right_column; @@ -2508,7 +2508,7 @@ BOOL LLLineEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect S32 query_local = findPixelNearestPos(query - getCursor()); S32 query_screen_x, query_screen_y; localPointToScreen(query_local, getRect().getHeight() / 2, &query_screen_x, &query_screen_y); - LLUI::screenPointToGL(query_screen_x, query_screen_y, &coord->mX, &coord->mY); + LLUI::getInstance()->screenPointToGL(query_screen_x, query_screen_y, &coord->mX, &coord->mY); } if (bounds) @@ -2524,7 +2524,7 @@ BOOL LLLineEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect LLRect preedit_rect_local(preedit_left_local, getRect().getHeight(), preedit_right_local, 0); LLRect preedit_rect_screen; localRectToScreen(preedit_rect_local, &preedit_rect_screen); - LLUI::screenRectToGL(preedit_rect_screen, bounds); + LLUI::getInstance()->screenRectToGL(preedit_rect_screen, bounds); } return TRUE; diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 92543b952e..200dd2fdca 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3263,7 +3263,7 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) menu->needsArrange(); menu->arrangeAndClear(); - LLUI::getMousePositionLocal(menu->getParent(), &mouse_x, &mouse_y); + LLUI::getInstance()->getMousePositionLocal(menu->getParent(), &mouse_x, &mouse_y); LLMenuHolderGL::sContextMenuSpawnPos.set(mouse_x,mouse_y); const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getRect(); diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp index 8cf88ad5eb..5cfa8ea973 100644 --- a/indra/llui/llmodaldialog.cpp +++ b/indra/llui/llmodaldialog.cpp @@ -105,7 +105,7 @@ void LLModalDialog::onOpen(const LLSD& key) // This is a modal dialog. It sucks up all mouse and keyboard operations. gFocusMgr.setMouseCapture( this ); - LLUI::addPopup(this); + LLUI::getInstance()->addPopup(this); setFocus(TRUE); sModalStack.push_front( this ); @@ -147,7 +147,7 @@ void LLModalDialog::setVisible( BOOL visible ) gFocusMgr.setMouseCapture( this ); // The dialog view is a root view - LLUI::addPopup(this); + LLUI::getInstance()->addPopup(this); setFocus( TRUE ); } else @@ -165,7 +165,7 @@ BOOL LLModalDialog::handleMouseDown(S32 x, S32 y, MASK mask) if (popup_menu != NULL) { S32 mx, my; - LLUI::getMousePositionScreen(&mx, &my); + LLUI::getInstance()->getMousePositionScreen(&mx, &my); LLRect menu_screen_rc = popup_menu->calcScreenRect(); if(!menu_screen_rc.pointInRect(mx, my)) { @@ -202,7 +202,7 @@ BOOL LLModalDialog::handleHover(S32 x, S32 y, MASK mask) if (popup_menu != NULL) { S32 mx, my; - LLUI::getMousePositionScreen(&mx, &my); + LLUI::getInstance()->getMousePositionScreen(&mx, &my); LLRect menu_screen_rc = popup_menu->calcScreenRect(); if(menu_screen_rc.pointInRect(mx, my)) { @@ -286,7 +286,7 @@ void LLModalDialog::draw() void LLModalDialog::centerOnScreen() { - LLVector2 window_size = LLUI::getWindowSize(); + LLVector2 window_size = LLUI::getInstance()->getWindowSize(); centerWithin(LLRect(0, 0, ll_round(window_size.mV[VX]), ll_round(window_size.mV[VY]))); } @@ -316,7 +316,7 @@ void LLModalDialog::onAppFocusGained() // This is a modal dialog. It sucks up all mouse and keyboard operations. gFocusMgr.setMouseCapture( instance ); instance->setFocus(TRUE); - LLUI::addPopup(instance); + LLUI::getInstance()->addPopup(instance); instance->centerOnScreen(); } diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 7bafd711cb..9fc6c05ead 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -130,7 +130,7 @@ bool handleIgnoredNotification(const LLSD& payload) response = pNotif->getResponseTemplate(LLNotification::WITH_DEFAULT_BUTTON); break; case LLNotificationForm::IGNORE_WITH_LAST_RESPONSE: - response = LLUI::sSettingGroups["ignores"]->getLLSD("Default" + pNotif->getName()); + response = LLUI::getInstance()->mSettingGroups["ignores"]->getLLSD("Default" + pNotif->getName()); break; case LLNotificationForm::IGNORE_SHOW_AGAIN: break; @@ -197,6 +197,7 @@ LLNotificationForm::LLNotificationForm(const std::string& name, const LLNotifica { mIgnoreMsg = p.ignore.text; + LLUI *ui_inst = LLUI::getInstance(); if (!p.ignore.save_option) { mIgnore = p.ignore.session_only ? IGNORE_WITH_DEFAULT_RESPONSE_SESSION_ONLY : IGNORE_WITH_DEFAULT_RESPONSE; @@ -205,19 +206,19 @@ LLNotificationForm::LLNotificationForm(const std::string& name, const LLNotifica { // remember last option chosen by user and automatically respond with that in the future mIgnore = IGNORE_WITH_LAST_RESPONSE; - LLUI::sSettingGroups["ignores"]->declareLLSD(std::string("Default") + name, "", std::string("Default response for notification " + name)); + ui_inst->mSettingGroups["ignores"]->declareLLSD(std::string("Default") + name, "", std::string("Default response for notification " + name)); } BOOL show_notification = TRUE; if (p.ignore.control.isProvided()) { - mIgnoreSetting = LLUI::sSettingGroups["config"]->getControl(p.ignore.control); + mIgnoreSetting = ui_inst->mSettingGroups["config"]->getControl(p.ignore.control); mInvertSetting = p.ignore.invert_control; } else { - LLUI::sSettingGroups["ignores"]->declareBOOL(name, show_notification, "Show notification with this name", LLControlVariable::PERSIST_NONDFT); - mIgnoreSetting = LLUI::sSettingGroups["ignores"]->getControl(name); + ui_inst->mSettingGroups["ignores"]->declareBOOL(name, show_notification, "Show notification with this name", LLControlVariable::PERSIST_NONDFT); + mIgnoreSetting = ui_inst->mSettingGroups["ignores"]->getControl(name); } } @@ -432,7 +433,7 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par mSoundName("") { if (p.sound.isProvided() - && LLUI::sSettingGroups["config"]->controlExists(p.sound)) + && LLUI::getInstance()->mSettingGroups["config"]->controlExists(p.sound)) { mSoundName = p.sound; } @@ -700,7 +701,7 @@ void LLNotification::respond(const LLSD& response) mForm->setIgnored(mIgnored); if (mIgnored && mForm->getIgnoreType() == LLNotificationForm::IGNORE_WITH_LAST_RESPONSE) { - LLUI::sSettingGroups["ignores"]->setLLSD("Default" + getName(), response); + LLUI::getInstance()->mSettingGroups["ignores"]->setLLSD("Default" + getName(), response); } } diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index ee90574161..00da0f5fec 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -609,7 +609,7 @@ std::string LLPanel::getString(const std::string& name, const LLStringUtil::form return formatted_string.getString(); } std::string err_str("Failed to find string " + name + " in panel " + getName()); //*TODO: Translate - if(LLUI::sSettingGroups["config"]->getBOOL("QAMode")) + if(LLUI::getInstance()->mSettingGroups["config"]->getBOOL("QAMode")) { LL_ERRS() << err_str << LL_ENDL; } @@ -628,7 +628,7 @@ std::string LLPanel::getString(const std::string& name) const return found_it->second; } std::string err_str("Failed to find string " + name + " in panel " + getName()); //*TODO: Translate - if(LLUI::sSettingGroups["config"]->getBOOL("QAMode")) + if(LLUI::getInstance()->mSettingGroups["config"]->getBOOL("QAMode")) { LL_ERRS() << err_str << LL_ENDL; } diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index 76134144a0..b3a79bc1eb 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -84,7 +84,7 @@ LLScrollbar::LLScrollbar(const Params & p) mThumbImageH(p.thumb_image_horizontal), mTrackImageV(p.track_image_vertical), mTrackImageH(p.track_image_horizontal), - mThickness(p.thickness.isProvided() ? p.thickness : LLUI::sSettingGroups["config"]->getS32("UIScrollbarSize")), + mThickness(p.thickness.isProvided() ? p.thickness : LLUI::getInstance()->mSettingGroups["config"]->getS32("UIScrollbarSize")), mBGVisible(p.bg_visible), mBGColor(p.bg_color) { @@ -488,7 +488,7 @@ void LLScrollbar::draw() S32 local_mouse_x; S32 local_mouse_y; - LLUI::getMousePositionLocal(this, &local_mouse_x, &local_mouse_y); + LLUI::getInstance()->getMousePositionLocal(this, &local_mouse_x, &local_mouse_y); BOOL other_captor = gFocusMgr.getMouseCapture() && gFocusMgr.getMouseCapture() != this; BOOL hovered = getEnabled() && !other_captor && (hasMouseCapture() || mThumbRect.pointInRect(local_mouse_x, local_mouse_y)); if (hovered) @@ -645,5 +645,5 @@ void LLScrollbar::onLineDownBtnPressed( const LLSD& data ) void LLScrollbar::setThickness(S32 thickness) { - mThickness = thickness < 0 ? LLUI::sSettingGroups["config"]->getS32("UIScrollbarSize") : thickness; + mThickness = thickness < 0 ? LLUI::getInstance()->mSettingGroups["config"]->getS32("UIScrollbarSize") : thickness; } diff --git a/indra/llui/llspellcheck.cpp b/indra/llui/llspellcheck.cpp index 7f64743e99..296ea09079 100644 --- a/indra/llui/llspellcheck.cpp +++ b/indra/llui/llspellcheck.cpp @@ -44,7 +44,6 @@ static const std::string DICT_FILE_IGNORE = "user_ignore.dic"; static const std::string DICT_FILE_MAIN = "dictionaries.xml"; static const std::string DICT_FILE_USER = "user_dictionaries.xml"; -LLSD LLSpellChecker::sDictMap; LLSpellChecker::settings_change_signal_t LLSpellChecker::sSettingsChangeSignal; LLSpellChecker::LLSpellChecker() @@ -94,10 +93,9 @@ S32 LLSpellChecker::getSuggestions(const std::string& word, std::vector<std::str return suggestions.size(); } -// static const LLSD LLSpellChecker::getDictionaryData(const std::string& dict_language) { - for (LLSD::array_const_iterator it = sDictMap.beginArray(); it != sDictMap.endArray(); ++it) + for (LLSD::array_const_iterator it = mDictMap.beginArray(); it != mDictMap.endArray(); ++it) { const LLSD& dict_entry = *it; if (dict_language == dict_entry["language"].asString()) @@ -108,14 +106,12 @@ const LLSD LLSpellChecker::getDictionaryData(const std::string& dict_language) return LLSD(); } -// static bool LLSpellChecker::hasDictionary(const std::string& dict_language, bool check_installed) { const LLSD dict_info = getDictionaryData(dict_language); return dict_info.has("language") && ( (!check_installed) || (dict_info["installed"].asBoolean()) ); } -// static void LLSpellChecker::setDictionaryData(const LLSD& dict_info) { const std::string dict_language = dict_info["language"].asString(); @@ -124,7 +120,7 @@ void LLSpellChecker::setDictionaryData(const LLSD& dict_info) return; } - for (LLSD::array_iterator it = sDictMap.beginArray(); it != sDictMap.endArray(); ++it) + for (LLSD::array_iterator it = mDictMap.beginArray(); it != mDictMap.endArray(); ++it) { LLSD& dict_entry = *it; if (dict_language == dict_entry["language"].asString()) @@ -133,7 +129,7 @@ void LLSpellChecker::setDictionaryData(const LLSD& dict_info) return; } } - sDictMap.append(dict_info); + mDictMap.append(dict_info); return; } @@ -147,14 +143,14 @@ void LLSpellChecker::refreshDictionaryMap() std::string user_filename(user_path + DICT_FILE_MAIN); llifstream user_file(user_filename.c_str(), std::ios::binary); if ( (!user_file.is_open()) - || (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(sDictMap, user_file)) - || (0 == sDictMap.size()) ) + || (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(mDictMap, user_file)) + || (0 == mDictMap.size()) ) { std::string app_filename(app_path + DICT_FILE_MAIN); llifstream app_file(app_filename.c_str(), std::ios::binary); if ( (!app_file.is_open()) - || (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(sDictMap, app_file)) - || (0 == sDictMap.size()) ) + || (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(mDictMap, app_file)) + || (0 == mDictMap.size()) ) { return; } @@ -178,7 +174,7 @@ void LLSpellChecker::refreshDictionaryMap() // Look for installed dictionaries std::string tmp_app_path, tmp_user_path; - for (LLSD::array_iterator it = sDictMap.beginArray(); it != sDictMap.endArray(); ++it) + for (LLSD::array_iterator it = mDictMap.beginArray(); it != mDictMap.endArray(); ++it) { LLSD& sdDict = *it; tmp_app_path = (sdDict.has("name")) ? app_path + sdDict["name"].asString() : LLStringUtil::null; @@ -416,7 +412,6 @@ bool LLSpellChecker::getUseSpellCheck() return (LLSpellChecker::instanceExists()) && (LLSpellChecker::instance().mHunspell); } -// static bool LLSpellChecker::canRemoveDictionary(const std::string& dict_language) { // Only user-installed inactive dictionaries can be removed @@ -426,7 +421,6 @@ bool LLSpellChecker::canRemoveDictionary(const std::string& dict_language) ( (!getUseSpellCheck()) || (!LLSpellChecker::instance().isActiveDictionary(dict_language)) ); } -// static void LLSpellChecker::removeDictionary(const std::string& dict_language) { if (!canRemoveDictionary(dict_language)) @@ -499,12 +493,3 @@ void LLSpellChecker::setUseSpellCheck(const std::string& dict_language) LLSpellChecker::instance().initHunspell(dict_language); } } - -// static -void LLSpellChecker::initClass() -{ - if (sDictMap.isUndefined()) - { - refreshDictionaryMap(); - } -} diff --git a/indra/llui/llspellcheck.h b/indra/llui/llspellcheck.h index acac589e43..f1964cc091 100644 --- a/indra/llui/llspellcheck.h +++ b/indra/llui/llspellcheck.h @@ -34,10 +34,9 @@ class Hunspell; -class LLSpellChecker : public LLSingleton<LLSpellChecker>, public LLInitClass<LLSpellChecker> +class LLSpellChecker : public LLSingleton<LLSpellChecker> { LLSINGLETON(LLSpellChecker); - friend class LLInitClass<LLSpellChecker>; ~LLSpellChecker(); public: @@ -57,26 +56,24 @@ public: bool isActiveDictionary(const std::string& dict_language) const; void setSecondaryDictionaries(dict_list_t dict_list); - static bool canRemoveDictionary(const std::string& dict_language); + bool canRemoveDictionary(const std::string& dict_language); static const std::string getDictionaryAppPath(); static const std::string getDictionaryUserPath(); - static const LLSD getDictionaryData(const std::string& dict_language); - static const LLSD& getDictionaryMap() { return sDictMap; } + const LLSD getDictionaryData(const std::string& dict_language); + const LLSD& getDictionaryMap() { return mDictMap; } static bool getUseSpellCheck(); - static bool hasDictionary(const std::string& dict_language, bool check_installed = false); - static void refreshDictionaryMap(); - static void removeDictionary(const std::string& dict_language); + bool hasDictionary(const std::string& dict_language, bool check_installed = false); + void refreshDictionaryMap(); + void removeDictionary(const std::string& dict_language); static void setUseSpellCheck(const std::string& dict_language); protected: static LLSD loadUserDictionaryMap(); - static void setDictionaryData(const LLSD& dict_info); + void setDictionaryData(const LLSD& dict_info); static void saveUserDictionaryMap(const LLSD& dict_map); public: typedef boost::signals2::signal<void()> settings_change_signal_t; static boost::signals2::connection setSettingsChangeCallback(const settings_change_signal_t::slot_type& cb); -protected: - static void initClass(); protected: Hunspell* mHunspell; @@ -84,8 +81,8 @@ protected: std::string mDictFile; dict_list_t mDictSecondary; std::vector<std::string> mIgnoreList; + LLSD mDictMap; - static LLSD sDictMap; static settings_change_signal_t sSettingsChangeSignal; }; diff --git a/indra/llui/llstatview.cpp b/indra/llui/llstatview.cpp index eda2d6047f..bb4969c81f 100644 --- a/indra/llui/llstatview.cpp +++ b/indra/llui/llstatview.cpp @@ -43,7 +43,7 @@ LLStatView::LLStatView(const LLStatView::Params& p) BOOL isopen = getDisplayChildren(); if (mSetting.length() > 0) { - isopen = LLUI::sSettingGroups["config"]->getBOOL(mSetting); + isopen = LLUI::getInstance()->mSettingGroups["config"]->getBOOL(mSetting); } setDisplayChildren(isopen); } @@ -54,7 +54,7 @@ LLStatView::~LLStatView() if (mSetting.length() > 0) { BOOL isopen = getDisplayChildren(); - LLUI::sSettingGroups["config"]->setBOOL(mSetting, isopen); + LLUI::getInstance()->mSettingGroups["config"]->setBOOL(mSetting, isopen); } } diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index a23741b6dd..22635f734e 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -3246,7 +3246,7 @@ BOOL LLNormalTextSegment::handleHover(S32 x, S32 y, MASK mask) // Only process the click if it's actually in this segment, not to the right of the end-of-line. if(mEditor.getSegmentAtLocalPos(x, y, false) == this) { - LLUI::getWindow()->setCursor(UI_CURSOR_HAND); + LLUI::getInstance()->getWindow()->setCursor(UI_CURSOR_HAND); return TRUE; } } diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index 01fe82e45d..0afd32f332 100644 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -107,7 +107,7 @@ BOOL LLTextBox::handleHover(S32 x, S32 y, MASK mask) if (!handled && mClickedCallback && mShowCursorHand) { // Clickable text boxes change the cursor to a hand - LLUI::getWindow()->setCursor(UI_CURSOR_HAND); + LLUI::getInstance()->getWindow()->setCursor(UI_CURSOR_HAND); return TRUE; } return handled; @@ -122,6 +122,7 @@ void LLTextBox::setEnabled(BOOL enabled) LLTextBase::setReadOnly(read_only); updateSegments(); } + LLTextBase::setEnabled(enabled); } void LLTextBox::setText(const LLStringExplicit& text , const LLStyle::Params& input_params ) diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 137167db2a..b1f8b00cab 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1045,7 +1045,7 @@ void LLTextEditor::removeCharOrTab() } else { - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } } @@ -1068,7 +1068,7 @@ void LLTextEditor::removeChar() } else { - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } } @@ -1315,7 +1315,7 @@ BOOL LLTextEditor::handleNavigationKey(const KEY key, const MASK mask) } else { - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } } break; @@ -1333,7 +1333,7 @@ BOOL LLTextEditor::handleNavigationKey(const KEY key, const MASK mask) } else { - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } } break; @@ -1665,7 +1665,7 @@ BOOL LLTextEditor::handleSpecialKey(const KEY key, const MASK mask) } else { - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } break; @@ -2750,7 +2750,7 @@ BOOL LLTextEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect { LLRect control_rect_screen; localRectToScreen(mVisibleTextRect, &control_rect_screen); - LLUI::screenRectToGL(control_rect_screen, control); + LLUI::getInstance()->screenRectToGL(control_rect_screen, control); } S32 preedit_left_position, preedit_right_position; @@ -2804,7 +2804,7 @@ BOOL LLTextEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect const S32 query_y = mVisibleTextRect.mTop - (current_line - first_visible_line) * line_height - line_height / 2; S32 query_screen_x, query_screen_y; localPointToScreen(query_x, query_y, &query_screen_x, &query_screen_y); - LLUI::screenPointToGL(query_screen_x, query_screen_y, &coord->mX, &coord->mY); + LLUI::getInstance()->screenPointToGL(query_screen_x, query_screen_y, &coord->mX, &coord->mY); } if (bounds) @@ -2831,7 +2831,7 @@ BOOL LLTextEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect const LLRect preedit_rect_local(preedit_left, preedit_top, preedit_right, preedit_bottom); LLRect preedit_rect_screen; localRectToScreen(preedit_rect_local, &preedit_rect_screen); - LLUI::screenRectToGL(preedit_rect_screen, bounds); + LLUI::getInstance()->screenRectToGL(preedit_rect_screen, bounds); } return TRUE; diff --git a/indra/llui/lltextutil.cpp b/indra/llui/lltextutil.cpp index f6b2ee1dc0..538508b856 100644 --- a/indra/llui/lltextutil.cpp +++ b/indra/llui/lltextutil.cpp @@ -78,7 +78,7 @@ void LLTextUtil::textboxSetGreyedVal(LLTextBox *txtbox, const LLStyle::Params& n const std::string& LLTextUtil::formatPhoneNumber(const std::string& phone_str) { - static const std::string PHONE_SEPARATOR = LLUI::sSettingGroups["config"]->getString("AvalinePhoneSeparator"); + static const std::string PHONE_SEPARATOR = LLUI::getInstance()->mSettingGroups["config"]->getString("AvalinePhoneSeparator"); static const S32 PHONE_PART_LEN = 2; static std::string formatted_phone_str; diff --git a/indra/llui/lltoggleablemenu.cpp b/indra/llui/lltoggleablemenu.cpp index ccb92ffbb2..3e56e0a589 100644 --- a/indra/llui/lltoggleablemenu.cpp +++ b/indra/llui/lltoggleablemenu.cpp @@ -55,7 +55,7 @@ boost::signals2::connection LLToggleableMenu::setVisibilityChangeCallback(const void LLToggleableMenu::onVisibilityChange (BOOL curVisibilityIn) { S32 x,y; - LLUI::getMousePositionLocal(LLUI::getRootView(), &x, &y); + LLUI::getInstance()->getMousePositionLocal(LLUI::getInstance()->getRootView(), &x, &y); // STORM-1879: also check MouseCapture to see if the button was really // clicked (otherwise the VisibilityChange was triggered via keyboard shortcut) diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index abc2b6e9ca..e6f466ec78 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -1125,7 +1125,7 @@ BOOL LLToolBarButton::handleHover(S32 x, S32 y, MASK mask) BOOL handled = FALSE; S32 mouse_distance_squared = (x - mMouseDownX) * (x - mMouseDownX) + (y - mMouseDownY) * (y - mMouseDownY); - S32 drag_threshold = LLUI::sSettingGroups["config"]->getS32("DragAndDropDistanceThreshold"); + S32 drag_threshold = LLUI::getInstance()->mSettingGroups["config"]->getS32("DragAndDropDistanceThreshold"); if (mouse_distance_squared > drag_threshold * drag_threshold && hasMouseCapture() && mStartDragItemCallback && mHandleDragItemCallback) diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index 698b128d45..422534b781 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -145,10 +145,10 @@ LLToolTip::Params::Params() wrap("wrap", true), pos("pos"), message("message"), - delay_time("delay_time", LLUI::sSettingGroups["config"]->getF32( "ToolTipDelay" )), - visible_time_over("visible_time_over", LLUI::sSettingGroups["config"]->getF32( "ToolTipVisibleTimeOver" )), - visible_time_near("visible_time_near", LLUI::sSettingGroups["config"]->getF32( "ToolTipVisibleTimeNear" )), - visible_time_far("visible_time_far", LLUI::sSettingGroups["config"]->getF32( "ToolTipVisibleTimeFar" )), + delay_time("delay_time", LLUI::getInstance()->mSettingGroups["config"]->getF32( "ToolTipDelay" )), + visible_time_over("visible_time_over", LLUI::getInstance()->mSettingGroups["config"]->getF32( "ToolTipVisibleTimeOver" )), + visible_time_near("visible_time_near", LLUI::getInstance()->mSettingGroups["config"]->getF32( "ToolTipVisibleTimeNear" )), + visible_time_far("visible_time_far", LLUI::getInstance()->mSettingGroups["config"]->getF32( "ToolTipVisibleTimeFar" )), sticky_rect("sticky_rect"), image("image"), text_color("text_color"), @@ -358,7 +358,7 @@ void LLToolTip::draw() if (mFadeTimer.getStarted()) { - F32 tool_tip_fade_time = LLUI::sSettingGroups["config"]->getF32("ToolTipFadeTime"); + F32 tool_tip_fade_time = LLUI::getInstance()->mSettingGroups["config"]->getF32("ToolTipFadeTime"); alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, tool_tip_fade_time, 1.f, 0.f); if (alpha == 0.f) { @@ -436,12 +436,12 @@ void LLToolTipMgr::createToolTip(const LLToolTip::Params& params) { LLCoordGL pos = params.pos; // try to spawn at requested position - LLUI::positionViewNearMouse(mToolTip, pos.mX, pos.mY); + LLUI::getInstance()->positionViewNearMouse(mToolTip, pos.mX, pos.mY); } else { // just spawn at mouse location - LLUI::positionViewNearMouse(mToolTip); + LLUI::getInstance()->positionViewNearMouse(mToolTip); } //...update "sticky" rect and tooltip position @@ -453,7 +453,7 @@ void LLToolTipMgr::createToolTip(const LLToolTip::Params& params) { S32 mouse_x; S32 mouse_y; - LLUI::getMousePositionLocal(gToolTipView->getParent(), &mouse_x, &mouse_y); + LLUI::getInstance()->getMousePositionLocal(gToolTipView->getParent(), &mouse_x, &mouse_y); // allow mouse a little bit of slop before changing tooltips mMouseNearRect.setCenterAndSize(mouse_x, mouse_y, 3, 3); @@ -491,7 +491,7 @@ void LLToolTipMgr::show(const LLToolTip::Params& params) // are we ready to show the tooltip? if (!mToolTipsBlocked // we haven't hit a key, moved the mouse, etc. - && LLUI::getMouseIdleTime() > params_with_defaults.delay_time) // the mouse has been still long enough + && LLUI::getInstance()->getMouseIdleTime() > params_with_defaults.delay_time) // the mouse has been still long enough { bool tooltip_changed = mLastToolTipParams.message() != params_with_defaults.message() || mLastToolTipParams.pos() != params_with_defaults.pos() @@ -563,7 +563,7 @@ void LLToolTipMgr::updateToolTipVisibility() } // hide tooltips when mouse cursor is hidden - if (LLUI::getWindow()->isCursorHidden()) + if (LLUI::getInstance()->getWindow()->isCursorHidden()) { blockToolTips(); return; @@ -574,7 +574,7 @@ void LLToolTipMgr::updateToolTipVisibility() if (toolTipVisible()) { S32 mouse_x, mouse_y; - LLUI::getMousePositionLocal(gToolTipView, &mouse_x, &mouse_y); + LLUI::getInstance()->getMousePositionLocal(gToolTipView, &mouse_x, &mouse_y); // mouse far away from tooltip tooltip_timeout = mLastToolTipParams.visible_time_far; diff --git a/indra/llui/lltransutil.cpp b/indra/llui/lltransutil.cpp index 220cee4c90..5da722a72b 100644 --- a/indra/llui/lltransutil.cpp +++ b/indra/llui/lltransutil.cpp @@ -44,7 +44,8 @@ bool LLTransUtil::parseStrings(const std::string& xml_filename, const std::set<s bool success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root, LLDir::ALL_SKINS); if (!success) { - LL_ERRS() << "Couldn't load string table " << xml_filename << LL_ENDL; + gDirUtilp->dumpCurrentDirectories(LLError::LEVEL_WARN); + LL_ERRS() << "Couldn't load string table " << xml_filename << ". Please reinstall viewer from https://secondlife.com/support/downloads/ and contact https://support.secondlife.com if issue persists after reinstall." << LL_ENDL; return false; } diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 52190a1473..656b69d3ed 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -75,19 +75,6 @@ // Language for UI construction std::map<std::string, std::string> gTranslation; std::list<std::string> gUntranslated; -/*static*/ LLUI::settings_map_t LLUI::sSettingGroups; -/*static*/ LLUIAudioCallback LLUI::sAudioCallback = NULL; -/*static*/ LLUIAudioCallback LLUI::sDeferredAudioCallback = NULL; -/*static*/ LLWindow* LLUI::sWindow = NULL; -/*static*/ LLView* LLUI::sRootView = NULL; -/*static*/ BOOL LLUI::sDirty = FALSE; -/*static*/ LLRect LLUI::sDirtyRect; -/*static*/ LLHelp* LLUI::sHelpImpl = NULL; -/*static*/ std::vector<std::string> LLUI::sXUIPaths; -/*static*/ LLFrameTimer LLUI::sMouseIdleTimer; -/*static*/ LLUI::add_popup_t LLUI::sAddPopupFunc; -/*static*/ LLUI::remove_popup_t LLUI::sRemovePopupFunc; -/*static*/ LLUI::clear_popups_t LLUI::sClearPopupsFunc; // register filter editor here static LLDefaultChildRegistry::Register<LLFilterEditor> register_filter_editor("filter_editor"); @@ -106,18 +93,19 @@ LLUUID find_ui_sound(const char * namep) { std::string name = ll_safe_string(namep); LLUUID uuid = LLUUID(NULL); - if (!LLUI::sSettingGroups["config"]->controlExists(name)) + LLUI *ui_inst = LLUI::getInstance(); + if (!ui_inst->mSettingGroups["config"]->controlExists(name)) { LL_WARNS() << "tried to make UI sound for unknown sound name: " << name << LL_ENDL; } else { - uuid = LLUUID(LLUI::sSettingGroups["config"]->getString(name)); + uuid = LLUUID(ui_inst->mSettingGroups["config"]->getString(name)); if (uuid.isNull()) { - if (LLUI::sSettingGroups["config"]->getString(name) == LLUUID::null.asString()) + if (ui_inst->mSettingGroups["config"]->getString(name) == LLUUID::null.asString()) { - if (LLUI::sSettingGroups["config"]->getBOOL("UISndDebugSpamToggle")) + if (ui_inst->mSettingGroups["config"]->getBOOL("UISndDebugSpamToggle")) { LL_INFOS() << "UI sound name: " << name << " triggered but silent (null uuid)" << LL_ENDL; } @@ -127,9 +115,9 @@ LLUUID find_ui_sound(const char * namep) LL_WARNS() << "UI sound named: " << name << " does not translate to a valid uuid" << LL_ENDL; } } - else if (LLUI::sAudioCallback != NULL) + else if (ui_inst->mAudioCallback != NULL) { - if (LLUI::sSettingGroups["config"]->getBOOL("UISndDebugSpamToggle")) + if (ui_inst->mSettingGroups["config"]->getBOOL("UISndDebugSpamToggle")) { LL_INFOS() << "UI sound name: " << name << LL_ENDL; } @@ -144,7 +132,7 @@ void make_ui_sound(const char* namep) LLUUID soundUUID = find_ui_sound(namep); if(soundUUID.notNull()) { - LLUI::sAudioCallback(soundUUID); + LLUI::getInstance()->mAudioCallback(soundUUID); } } @@ -153,30 +141,31 @@ void make_ui_sound_deferred(const char* namep) LLUUID soundUUID = find_ui_sound(namep); if(soundUUID.notNull()) { - LLUI::sDeferredAudioCallback(soundUUID); + LLUI::getInstance()->mDeferredAudioCallback(soundUUID); } } -void LLUI::initClass(const settings_map_t& settings, - LLImageProviderInterface* image_provider, - LLUIAudioCallback audio_callback, - LLUIAudioCallback deferred_audio_callback, - const LLVector2* scale_factor, - const std::string& language) +LLUI::LLUI(const settings_map_t& settings, + LLImageProviderInterface* image_provider, + LLUIAudioCallback audio_callback, + LLUIAudioCallback deferred_audio_callback) +: mSettingGroups(settings), +mAudioCallback(audio_callback), +mDeferredAudioCallback(deferred_audio_callback), +mWindow(NULL), // set later in startup +mRootView(NULL), +mDirty(FALSE), +mHelpImpl(NULL) { - LLRender2D::initClass(image_provider,scale_factor); - sSettingGroups = settings; + LLRender2D::initParamSingleton(image_provider); - if ((get_ptr_in_map(sSettingGroups, std::string("config")) == NULL) || - (get_ptr_in_map(sSettingGroups, std::string("floater")) == NULL) || - (get_ptr_in_map(sSettingGroups, std::string("ignores")) == NULL)) + if ((get_ptr_in_map(mSettingGroups, std::string("config")) == NULL) || + (get_ptr_in_map(mSettingGroups, std::string("floater")) == NULL) || + (get_ptr_in_map(mSettingGroups, std::string("ignores")) == NULL)) { LL_ERRS() << "Failure to initialize configuration groups" << LL_ENDL; } - sAudioCallback = audio_callback; - sDeferredAudioCallback = deferred_audio_callback; - sWindow = NULL; // set later in startup LLFontGL::sShadowColor = LLUIColorTable::instance().getColor("ColorDropShadow"); LLUICtrl::CommitCallbackRegistry::Registrar& reg = LLUICtrl::CommitCallbackRegistry::defaultRegistrar(); @@ -207,33 +196,26 @@ void LLUI::initClass(const settings_map_t& settings, LLCommandManager::load(); } -void LLUI::cleanupClass() -{ - SUBSYSTEM_CLEANUP(LLRender2D); -} - void LLUI::setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t& remove_popup, const clear_popups_t& clear_popups) { - sAddPopupFunc = add_popup; - sRemovePopupFunc = remove_popup; - sClearPopupsFunc = clear_popups; + mAddPopupFunc = add_popup; + mRemovePopupFunc = remove_popup; + mClearPopupsFunc = clear_popups; } -//static void LLUI::dirtyRect(LLRect rect) { - if (!sDirty) + if (!mDirty) { - sDirtyRect = rect; - sDirty = TRUE; + mDirtyRect = rect; + mDirty = TRUE; } else { - sDirtyRect.unionWith(rect); - } + mDirtyRect.unionWith(rect); + } } - -//static + void LLUI::setMousePositionScreen(S32 x, S32 y) { #if defined(LL_DARWIN) @@ -247,7 +229,6 @@ void LLUI::setMousePositionScreen(S32 x, S32 y) LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert()); } -//static void LLUI::getMousePositionScreen(S32 *x, S32 *y) { LLCoordWindow cursor_pos_window; @@ -257,7 +238,6 @@ void LLUI::getMousePositionScreen(S32 *x, S32 *y) *y = ll_round((F32)cursor_pos_gl.mY / getScaleFactor().mV[VY]); } -//static void LLUI::setMousePositionLocal(const LLView* viewp, S32 x, S32 y) { S32 screen_x, screen_y; @@ -266,7 +246,6 @@ void LLUI::setMousePositionLocal(const LLView* viewp, S32 x, S32 y) setMousePositionScreen(screen_x, screen_y); } -//static void LLUI::getMousePositionLocal(const LLView* viewp, S32 *x, S32 *y) { S32 screen_x, screen_y; @@ -280,20 +259,19 @@ void LLUI::getMousePositionLocal(const LLView* viewp, S32 *x, S32 *y) // or on Windows if the SecondLife.exe executable is run directly, the // language follows the OS language. In all cases the user can override // the language manually in preferences. JC -// static -std::string LLUI::getLanguage() +std::string LLUI::getUILanguage() { std::string language = "en"; - if (sSettingGroups["config"]) + if (mSettingGroups["config"]) { - language = sSettingGroups["config"]->getString("Language"); + language = mSettingGroups["config"]->getString("Language"); if (language.empty() || language == "default") { - language = sSettingGroups["config"]->getString("InstallLanguage"); + language = mSettingGroups["config"]->getString("InstallLanguage"); } if (language.empty() || language == "default") { - language = sSettingGroups["config"]->getString("SystemLanguage"); + language = mSettingGroups["config"]->getString("SystemLanguage"); } if (language.empty() || language == "default") { @@ -303,6 +281,13 @@ std::string LLUI::getLanguage() return language; } +// static +std::string LLUI::getLanguage() +{ + // Note: lldateutil_test redefines this function + return LLUI::getInstance()->getUILanguage(); +} + struct SubDir : public LLInitParam::Block<SubDir> { Mandatory<std::string> value; @@ -362,37 +347,32 @@ std::string LLUI::locateSkin(const std::string& filename) return ""; } -//static LLVector2 LLUI::getWindowSize() { LLCoordWindow window_rect; - sWindow->getSize(&window_rect); + mWindow->getSize(&window_rect); return LLVector2(window_rect.mX / getScaleFactor().mV[VX], window_rect.mY / getScaleFactor().mV[VY]); } -//static void LLUI::screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y) { *gl_x = ll_round((F32)screen_x * getScaleFactor().mV[VX]); *gl_y = ll_round((F32)screen_y * getScaleFactor().mV[VY]); } -//static void LLUI::glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y) { *screen_x = ll_round((F32)gl_x / getScaleFactor().mV[VX]); *screen_y = ll_round((F32)gl_y / getScaleFactor().mV[VY]); } -//static void LLUI::screenRectToGL(const LLRect& screen, LLRect *gl) { screenPointToGL(screen.mLeft, screen.mTop, &gl->mLeft, &gl->mTop); screenPointToGL(screen.mRight, screen.mBottom, &gl->mRight, &gl->mBottom); } -//static void LLUI::glRectToScreen(const LLRect& gl, LLRect *screen) { glPointToScreen(gl.mLeft, gl.mTop, &screen->mLeft, &screen->mTop); @@ -402,8 +382,8 @@ void LLUI::glRectToScreen(const LLRect& gl, LLRect *screen) LLControlGroup& LLUI::getControlControlGroup (const std::string& controlname) { - for (settings_map_t::iterator itor = sSettingGroups.begin(); - itor != sSettingGroups.end(); ++itor) + for (settings_map_t::iterator itor = mSettingGroups.begin(); + itor != mSettingGroups.end(); ++itor) { LLControlGroup* control_group = itor->second; if(control_group != NULL) @@ -413,43 +393,38 @@ LLControlGroup& LLUI::getControlControlGroup (const std::string& controlname) } } - return *sSettingGroups["config"]; // default group + return *mSettingGroups["config"]; // default group } -//static void LLUI::addPopup(LLView* viewp) { - if (sAddPopupFunc) + if (mAddPopupFunc) { - sAddPopupFunc(viewp); + mAddPopupFunc(viewp); } } -//static void LLUI::removePopup(LLView* viewp) { - if (sRemovePopupFunc) + if (mRemovePopupFunc) { - sRemovePopupFunc(viewp); + mRemovePopupFunc(viewp); } } -//static void LLUI::clearPopups() { - if (sClearPopupsFunc) + if (mClearPopupsFunc) { - sClearPopupsFunc(); + mClearPopupsFunc(); } } -//static void LLUI::reportBadKeystroke() { make_ui_sound("UISndBadKeystroke"); } - -//static + // spawn_x and spawn_y are top left corner of view in screen GL coordinates void LLUI::positionViewNearMouse(LLView* view, S32 spawn_x, S32 spawn_y) { @@ -460,7 +435,7 @@ void LLUI::positionViewNearMouse(LLView* view, S32 spawn_x, S32 spawn_y) S32 mouse_x; S32 mouse_y; - LLUI::getMousePositionScreen(&mouse_x, &mouse_y); + getMousePositionScreen(&mouse_x, &mouse_y); // If no spawn location provided, use mouse position if (spawn_x == S32_MAX || spawn_y == S32_MAX) diff --git a/indra/llui/llui.h b/indra/llui/llui.h index d7151dbee9..e1c51deba9 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -109,8 +109,16 @@ class LLImageProviderInterface; typedef void (*LLUIAudioCallback)(const LLUUID& uuid); -class LLUI +class LLUI : public LLParamSingleton<LLUI> { +public: + typedef std::map<std::string, LLControlGroup*> settings_map_t; + +private: + LLSINGLETON(LLUI , const settings_map_t &settings, + LLImageProviderInterface* image_provider, + LLUIAudioCallback audio_callback, + LLUIAudioCallback deferred_audio_callback); LOG_CLASS(LLUI); public: // @@ -232,36 +240,24 @@ public: // // Methods // - typedef std::map<std::string, LLControlGroup*> settings_map_t; typedef boost::function<void(LLView*)> add_popup_t; typedef boost::function<void(LLView*)> remove_popup_t; typedef boost::function<void(void)> clear_popups_t; - static void initClass(const settings_map_t& settings, - LLImageProviderInterface* image_provider, - LLUIAudioCallback audio_callback = NULL, - LLUIAudioCallback deferred_audio_callback = NULL, - const LLVector2 *scale_factor = NULL, - const std::string& language = LLStringUtil::null); - static void cleanupClass(); - static void setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t&, const clear_popups_t& ); - - static void pushMatrix() { LLRender2D::pushMatrix(); } - static void popMatrix() { LLRender2D::popMatrix(); } - static void loadIdentity() { LLRender2D::loadIdentity(); } - static void translate(F32 x, F32 y, F32 z = 0.0f) { LLRender2D::translate(x, y, z); } + void setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t&, const clear_popups_t& ); - static LLRect sDirtyRect; - static BOOL sDirty; - static void dirtyRect(LLRect rect); + LLRect mDirtyRect; + BOOL mDirty; + void dirtyRect(LLRect rect); // Return the ISO639 language name ("en", "ko", etc.) for the viewer UI. // http://www.loc.gov/standards/iso639-2/php/code_list.php - static std::string getLanguage(); + std::string getUILanguage(); + static std::string getLanguage(); // static for lldateutil_test compatibility //helper functions (should probably move free standing rendering helper functions here) - static LLView* getRootView() { return sRootView; } - static void setRootView(LLView* view) { sRootView = view; } + LLView* getRootView() { return mRootView; } + void setRootView(LLView* view) { mRootView = view; } /** * Walk the LLView tree to resolve a path * Paths can be discovered using Develop > XUI > Show XUI Paths @@ -287,58 +283,65 @@ public: * tree, the first "bar" anywhere under it, and "baz" * as a direct child of that */ - static const LLView* resolvePath(const LLView* context, const std::string& path); - static LLView* resolvePath(LLView* context, const std::string& path); + const LLView* resolvePath(const LLView* context, const std::string& path); + LLView* resolvePath(LLView* context, const std::string& path); static std::string locateSkin(const std::string& filename); - static void setMousePositionScreen(S32 x, S32 y); - static void getMousePositionScreen(S32 *x, S32 *y); - static void setMousePositionLocal(const LLView* viewp, S32 x, S32 y); - static void getMousePositionLocal(const LLView* viewp, S32 *x, S32 *y); - static LLVector2& getScaleFactor() { return LLRender2D::sGLScaleFactor; } - static void setScaleFactor(const LLVector2& scale_factor) { LLRender2D::setScaleFactor(scale_factor); } - static void setLineWidth(F32 width) { LLRender2D::setLineWidth(width); } - static LLPointer<LLUIImage> getUIImageByID(const LLUUID& image_id, S32 priority = 0) - { return LLRender2D::getUIImageByID(image_id, priority); } - static LLPointer<LLUIImage> getUIImage(const std::string& name, S32 priority = 0) - { return LLRender2D::getUIImage(name, priority); } - static LLVector2 getWindowSize(); - static void screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y); - static void glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y); - static void screenRectToGL(const LLRect& screen, LLRect *gl); - static void glRectToScreen(const LLRect& gl, LLRect *screen); + void setMousePositionScreen(S32 x, S32 y); + void getMousePositionScreen(S32 *x, S32 *y); + void setMousePositionLocal(const LLView* viewp, S32 x, S32 y); + void getMousePositionLocal(const LLView* viewp, S32 *x, S32 *y); + LLVector2 getWindowSize(); + void screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y); + void glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y); + void screenRectToGL(const LLRect& screen, LLRect *gl); + void glRectToScreen(const LLRect& gl, LLRect *screen); // Returns the control group containing the control name, or the default group - static LLControlGroup& getControlControlGroup (const std::string& controlname); - static F32 getMouseIdleTime() { return sMouseIdleTimer.getElapsedTimeF32(); } - static void resetMouseIdleTimer() { sMouseIdleTimer.reset(); } - static LLWindow* getWindow() { return sWindow; } + LLControlGroup& getControlControlGroup (const std::string& controlname); + F32 getMouseIdleTime() { return mMouseIdleTimer.getElapsedTimeF32(); } + void resetMouseIdleTimer() { mMouseIdleTimer.reset(); } + LLWindow* getWindow() { return mWindow; } - static void addPopup(LLView*); - static void removePopup(LLView*); - static void clearPopups(); + void addPopup(LLView*); + void removePopup(LLView*); + void clearPopups(); - static void reportBadKeystroke(); + void reportBadKeystroke(); // Ensures view does not overlap mouse cursor, but is inside // the view's parent rectangle. Used for tooltips, inspectors. // Optionally override the view's default X/Y, which are relative to the // view's parent. - static void positionViewNearMouse(LLView* view, S32 spawn_x = S32_MAX, S32 spawn_y = S32_MAX); + void positionViewNearMouse(LLView* view, S32 spawn_x = S32_MAX, S32 spawn_y = S32_MAX); + + // LLRender2D wrappers + static void pushMatrix() { LLRender2D::getInstance()->pushMatrix(); } + static void popMatrix() { LLRender2D::getInstance()->popMatrix(); } + static void loadIdentity() { LLRender2D::getInstance()->loadIdentity(); } + static void translate(F32 x, F32 y, F32 z = 0.0f) { LLRender2D::getInstance()->translate(x, y, z); } + + static LLVector2& getScaleFactor() { return LLRender2D::getInstance()->mGLScaleFactor; } + static void setScaleFactor(const LLVector2& scale_factor) { LLRender2D::getInstance()->setScaleFactor(scale_factor); } + static void setLineWidth(F32 width) { LLRender2D::getInstance()->setLineWidth(width); } + static LLPointer<LLUIImage> getUIImageByID(const LLUUID& image_id, S32 priority = 0) + { return LLRender2D::getInstance()->getUIImageByID(image_id, priority); } + static LLPointer<LLUIImage> getUIImage(const std::string& name, S32 priority = 0) + { return LLRender2D::getInstance()->getUIImage(name, priority); } // // Data // - static settings_map_t sSettingGroups; - static LLUIAudioCallback sAudioCallback; - static LLUIAudioCallback sDeferredAudioCallback; - static LLWindow* sWindow; - static LLView* sRootView; - static LLHelp* sHelpImpl; + settings_map_t mSettingGroups; + LLUIAudioCallback mAudioCallback; + LLUIAudioCallback mDeferredAudioCallback; + LLWindow* mWindow; + LLView* mRootView; + LLHelp* mHelpImpl; private: - static std::vector<std::string> sXUIPaths; - static LLFrameTimer sMouseIdleTimer; - static add_popup_t sAddPopupFunc; - static remove_popup_t sRemovePopupFunc; - static clear_popups_t sClearPopupsFunc; + std::vector<std::string> mXUIPaths; + LLFrameTimer mMouseIdleTimer; + add_popup_t mAddPopupFunc; + remove_popup_t mRemovePopupFunc; + clear_popups_t mClearPopupsFunc; }; @@ -363,7 +366,7 @@ public: LLUICachedControl(const std::string& name, const T& default_value, const std::string& comment = "Declared In Code") - : LLCachedControl<T>(LLUI::getControlControlGroup(name), name, default_value, comment) + : LLCachedControl<T>(LLUI::getInstance()->getControlControlGroup(name), name, default_value, comment) {} }; diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index cd9b52d164..63ed427ab5 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -176,7 +176,7 @@ void LLUrlEntryBase::callObservers(const std::string &id, bool LLUrlEntryBase::isLinkDisabled() const { // this allows us to have a global setting to turn off text hyperlink highlighting/action - bool globally_disabled = LLUI::sSettingGroups["config"]->getBOOL("DisableTextHyperlinkActions"); + bool globally_disabled = LLUI::getInstance()->mSettingGroups["config"]->getBOOL("DisableTextHyperlinkActions"); return globally_disabled; } diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 89ad8138d8..2a190365b3 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -816,7 +816,7 @@ LLView* LLView::childrenHandleHover(S32 x, S32 y, MASK mask) } // This call differentiates this method from childrenHandleMouseEvent(). - LLUI::sWindow->setCursor(viewp->getHoverCursor()); + LLUI::getInstance()->mWindow->setCursor(viewp->getHoverCursor()); if (viewp->handleHover(local_x, local_y, mask) || viewp->blockMouseEvent(local_x, local_y)) @@ -873,8 +873,8 @@ BOOL LLView::handleToolTip(S32 x, S32 y, MASK mask) // allow "scrubbing" over ui by showing next tooltip immediately // if previous one was still visible F32 timeout = LLToolTipMgr::instance().toolTipVisible() - ? LLUI::sSettingGroups["config"]->getF32( "ToolTipFastDelay" ) - : LLUI::sSettingGroups["config"]->getF32( "ToolTipDelay" ); + ? LLUI::getInstance()->mSettingGroups["config"]->getF32( "ToolTipFastDelay" ) + : LLUI::getInstance()->mSettingGroups["config"]->getF32( "ToolTipDelay" ); LLToolTipMgr::instance().show(LLToolTip::Params() .message(tooltip) .sticky_rect(calcScreenRect()) @@ -1142,7 +1142,7 @@ void LLView::drawChildren() { if (!mChildList.empty()) { - LLView* rootp = LLUI::getRootView(); + LLView* rootp = LLUI::getInstance()->getRootView(); ++sDepth; for (child_list_reverse_iter_t child_iter = mChildList.rbegin(); child_iter != mChildList.rend();) // ++child_iter) @@ -1158,7 +1158,7 @@ void LLView::drawChildren() if (viewp->getVisible() && viewp->getRect().isValid()) { LLRect screen_rect = viewp->calcScreenRect(); - if ( rootp->getLocalRect().overlaps(screen_rect) && LLUI::sDirtyRect.overlaps(screen_rect)) + if ( rootp->getLocalRect().overlaps(screen_rect) && LLUI::getInstance()->mDirtyRect.overlaps(screen_rect)) { LLUI::pushMatrix(); { @@ -1200,7 +1200,7 @@ void LLView::dirtyRect() parent = parent->getParent(); } - LLUI::dirtyRect(cur->calcScreenRect()); + LLUI::getInstance()->dirtyRect(cur->calcScreenRect()); } //Draw a box for debugging. @@ -2223,9 +2223,9 @@ LLControlVariable *LLView::findControl(const std::string& name) std::string control_group_key = name.substr(0, key_pos); LLControlVariable* control; // check if it's in the control group that name indicated - if(LLUI::sSettingGroups[control_group_key]) + if(LLUI::getInstance()->mSettingGroups[control_group_key]) { - control = LLUI::sSettingGroups[control_group_key]->getControl(name); + control = LLUI::getInstance()->mSettingGroups[control_group_key]->getControl(name); if (control) { return control; @@ -2233,7 +2233,7 @@ LLControlVariable *LLView::findControl(const std::string& name) } } - LLControlGroup& control_group = LLUI::getControlControlGroup(name); + LLControlGroup& control_group = LLUI::getInstance()->getControlControlGroup(name); return control_group.getControl(name); } diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 8494bb338a..e36ca7c8c6 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -498,7 +498,7 @@ public: // return query for iterating over focus roots in tab order static const LLViewQuery & getFocusRootsQuery(); - static LLWindow* getWindow(void) { return LLUI::sWindow; } + static LLWindow* getWindow(void) { return LLUI::getInstance()->mWindow; } // Set up params after XML load before calling new(), // usually to adjust layout. diff --git a/indra/llui/llviewereventrecorder.cpp b/indra/llui/llviewereventrecorder.cpp index 8754cfebbb..cb000aef74 100644 --- a/indra/llui/llviewereventrecorder.cpp +++ b/indra/llui/llviewereventrecorder.cpp @@ -44,7 +44,7 @@ LLViewerEventRecorder::LLViewerEventRecorder() { bool LLViewerEventRecorder::displayViewerEventRecorderMenuItems() { - return LLUI::sSettingGroups["config"]->getBOOL("ShowEventRecorderMenuItems"); + return LLUI::getInstance()->mSettingGroups["config"]->getBOOL("ShowEventRecorderMenuItems"); } @@ -99,7 +99,7 @@ void LLViewerEventRecorder::setMouseGlobalCoords(S32 x, S32 y) { void LLViewerEventRecorder::updateMouseEventInfo(S32 local_x, S32 local_y, S32 global_x, S32 global_y, std::string mName) { - LLView * target_view = LLUI::resolvePath(LLUI::getRootView(), xui); + LLView * target_view = LLUI::getInstance()->resolvePath(LLUI::getInstance()->getRootView(), xui); if (! target_view) { LL_DEBUGS() << "LLViewerEventRecorder::updateMouseEventInfo - xui path on file at moment is NOT valid - so DO NOT record these local coords" << LL_ENDL; return; @@ -216,7 +216,7 @@ void LLViewerEventRecorder::playbackRecording() { LLSD LeapCommand; // ivita sets this on startup, it also sends commands to the viewer to make start, stop, and playback menu items visible in viewer - LeapCommand =LLUI::sSettingGroups["config"]->getLLSD("LeapPlaybackEventsCommand"); + LeapCommand =LLUI::getInstance()->mSettingGroups["config"]->getLLSD("LeapPlaybackEventsCommand"); LL_DEBUGS() << "[VITA] launching playback - leap command is: " << LLSDXMLStreamer(LeapCommand) << LL_ENDL; LLLeap::create("", LeapCommand, false); // exception=false diff --git a/indra/llui/llviewinject.h b/indra/llui/llviewinject.h index 0de3d155c4..7f18ec6fbe 100644 --- a/indra/llui/llviewinject.h +++ b/indra/llui/llviewinject.h @@ -32,7 +32,7 @@ namespace llview public: /** * Construct TargetEvent with the desired target LLView*. (See - * LLUI::resolvePath() to obtain an LLView* given a string pathname.) + * LLUI::getInstance()->resolvePath() to obtain an LLView* given a string pathname.) * This sets up for operator(). */ TargetEvent(LLView* view); diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index 18836e54b0..2076ce334e 100644 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -1033,24 +1033,24 @@ bool LLDir::setCacheDir(const std::string &path) } } -void LLDir::dumpCurrentDirectories() +void LLDir::dumpCurrentDirectories(LLError::ELevel level) { - LL_DEBUGS("AppInit","Directories") << "Current Directories:" << LL_ENDL; - - LL_DEBUGS("AppInit","Directories") << " CurPath: " << getCurPath() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " AppName: " << getAppName() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " ExecutableFilename: " << getExecutableFilename() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " ExecutableDir: " << getExecutableDir() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " ExecutablePathAndName: " << getExecutablePathAndName() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " WorkingDir: " << getWorkingDir() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " AppRODataDir: " << getAppRODataDir() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " OSUserDir: " << getOSUserDir() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " OSUserAppDir: " << getOSUserAppDir() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " LindenUserDir: " << getLindenUserDir() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " TempDir: " << getTempDir() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " CAFile: " << getCAFile() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " SkinBaseDir: " << getSkinBaseDir() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " SkinDir: " << getSkinDir() << LL_ENDL; + LL_VLOGS(level, "AppInit","Directories") << "Current Directories:" << LL_ENDL; + + LL_VLOGS(level, "AppInit", "Directories") << " CurPath: " << getCurPath() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " AppName: " << getAppName() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " ExecutableFilename: " << getExecutableFilename() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " ExecutableDir: " << getExecutableDir() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " ExecutablePathAndName: " << getExecutablePathAndName() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " WorkingDir: " << getWorkingDir() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " AppRODataDir: " << getAppRODataDir() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " OSUserDir: " << getOSUserDir() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " OSUserAppDir: " << getOSUserAppDir() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " LindenUserDir: " << getLindenUserDir() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " TempDir: " << getTempDir() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " CAFile: " << getCAFile() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " SkinBaseDir: " << getSkinBaseDir() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " SkinDir: " << getSkinDir() << LL_ENDL; } void LLDir::append(std::string& destpath, const std::string& name) const diff --git a/indra/llvfs/lldir.h b/indra/llvfs/lldir.h index e233413a7f..38e204ef04 100644 --- a/indra/llvfs/lldir.h +++ b/indra/llvfs/lldir.h @@ -194,7 +194,7 @@ class LLDir virtual bool setCacheDir(const std::string &path); virtual void updatePerAccountChatLogsDir(); - virtual void dumpCurrentDirectories(); + virtual void dumpCurrentDirectories(LLError::ELevel level = LLError::LEVEL_DEBUG); // Utility routine std::string buildSLOSCacheDir() const; diff --git a/indra/llwindow/llappdelegate-objc.h b/indra/llwindow/llappdelegate-objc.h index 6daf1ac55b..0b38647b4a 100644 --- a/indra/llwindow/llappdelegate-objc.h +++ b/indra/llwindow/llappdelegate-objc.h @@ -46,3 +46,6 @@ - (void) languageUpdated; - (bool) romanScript; @end + +@interface LLApplication : NSApplication +@end diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 33eed7227a..1990499459 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -509,15 +509,6 @@ attributedStringInfo getSegments(NSAttributedString *str) { [[self inputContext] handleEvent:theEvent]; } - - // OS X intentionally does not send us key-up information on cmd-key combinations. - // This behaviour is not a bug, and only applies to cmd-combinations (no others). - // Since SL assumes we receive those, we fake it here. - if (mModifiers & NSCommandKeyMask && !mHasMarkedText) - { - eventData.mKeyEvent = NativeKeyEventData::KEYUP; - callKeyUp(&eventData, [theEvent keyCode], mModifiers); - } } - (void)flagsChanged:(NSEvent *)theEvent diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index 10bd3cbb91..99af161102 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -110,9 +110,9 @@ void glSwapBuffers(void* context); CGLContextObj getCGLContextObj(GLViewRef view); unsigned long getVramSize(GLViewRef view); float getDeviceUnitSize(GLViewRef view); -const CGPoint getContentViewBoundsPosition(NSWindowRef window); -const CGSize getContentViewBoundsSize(NSWindowRef window); -const CGSize getDeviceContentViewSize(NSWindowRef window, GLViewRef view); +CGPoint getContentViewBoundsPosition(NSWindowRef window); +CGSize getContentViewBoundsSize(NSWindowRef window); +CGSize getDeviceContentViewSize(NSWindowRef window, GLViewRef view); void getWindowSize(NSWindowRef window, float* size); void setWindowSize(NSWindowRef window, int width, int height); void getCursorPos(NSWindowRef window, float* pos); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 8fece7c5c7..f895c17643 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -258,17 +258,17 @@ float getDeviceUnitSize(GLViewRef view) return [(LLOpenGLView*)view convertSizeToBacking:NSMakeSize(1, 1)].width; } -const CGPoint getContentViewBoundsPosition(NSWindowRef window) +CGPoint getContentViewBoundsPosition(NSWindowRef window) { return [[(LLNSWindow*)window contentView] bounds].origin; } -const CGSize getContentViewBoundsSize(NSWindowRef window) +CGSize getContentViewBoundsSize(NSWindowRef window) { return [[(LLNSWindow*)window contentView] bounds].size; } -const CGSize getDeviceContentViewSize(NSWindowRef window, GLViewRef view) +CGSize getDeviceContentViewSize(NSWindowRef window, GLViewRef view) { return [(NSOpenGLView*)view convertRectToBacking:[[(LLNSWindow*)window contentView] bounds]].size; } diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 6dec131a34..3554f90be8 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -382,7 +382,10 @@ void callWindowFocus() void callWindowUnfocus() { - gWindowImplementation->getCallbacks()->handleFocusLost(gWindowImplementation); + if ( gWindowImplementation && gWindowImplementation->getCallbacks() ) + { + gWindowImplementation->getCallbacks()->handleFocusLost(gWindowImplementation); + } } void callWindowHide() diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 985bd79d13..e05f507506 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -741,6 +741,17 @@ void LLWindowWin32::restore() SetFocus(mWindowHandle); } +bool destroy_window_handler(HWND &hWnd) +{ + __try + { + return DestroyWindow(hWnd); + } + __except (EXCEPTION_EXECUTE_HANDLER) + { + return false; + } +} // close() destroys all OS-specific code associated with a window. // Usually called from LLWindowManager::destroyWindow() @@ -814,7 +825,7 @@ void LLWindowWin32::close() ShowWindow(mWindowHandle, SW_HIDE); // This causes WM_DESTROY to be sent *immediately* - if (!DestroyWindow(mWindowHandle)) + if (!destroy_window_handler(mWindowHandle)) { OSMessageBox(mCallbacks->translateString("MBDestroyWinFailed"), mCallbacks->translateString("MBShutdownErr"), diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 2a8eb20af9..eead92fd8e 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -531,7 +531,12 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } // now we can set page zoom factor - mCEFLib->setPageZoom(message_in.getValueReal("factor")); + F32 factor = (F32)message_in.getValueReal("factor"); +#if LL_DARWIN + //temporary fix for SL-10473: issue with displaying checkboxes on Mojave + factor*=1.001; +#endif + mCEFLib->setPageZoom(factor); // Plugin gets to decide the texture parameters to use. mDepth = 4; @@ -736,6 +741,10 @@ void MediaPluginCEF::receiveMessage(const char* message_string) if (message_name == "set_page_zoom_factor") { F32 factor = (F32)message_in.getValueReal("factor"); +#if LL_DARWIN + //temporary fix for SL-10473: issue with displaying checkboxes on Mojave + factor*=1.001; +#endif mCEFLib->setPageZoom(factor); } if (message_name == "browse_stop") @@ -813,7 +822,8 @@ void MediaPluginCEF::keyEvent(dullahan::EKeyEvent key_event, LLSD native_key_dat // adding new code below in unicodeInput means we don't send ascii chars // here too or we get double key presses on a mac. bool esc_key = (event_umodchars == 27); - if (esc_key || ((unsigned char)event_chars < 0x10 || (unsigned char)event_chars >= 0x7f )) + bool tab_key_up = (event_umodchars == 9) && (key_event == dullahan::EKeyEvent::KE_KEY_UP); + if ((esc_key || ((unsigned char)event_chars < 0x10 || (unsigned char)event_chars >= 0x7f )) && !tab_key_up) { mCEFLib->nativeKeyboardEventOSX(key_event, event_modifiers, event_keycode, event_chars, diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 766dc5226c..694e89ab99 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -201,7 +201,6 @@ set(viewer_SOURCE_FILES llexperiencelog.cpp llexternaleditor.cpp llface.cpp - llfacebookconnect.cpp llfasttimerview.cpp llfavoritesbar.cpp llfeaturemanager.cpp @@ -245,7 +244,6 @@ set(viewer_SOURCE_FILES llfloaterexperiencepicker.cpp llfloaterexperienceprofile.cpp llfloaterexperiences.cpp - llfloaterfacebook.cpp llfloaterflickr.cpp llfloaterfonttest.cpp llfloatergesture.cpp @@ -828,7 +826,6 @@ set(viewer_HEADER_FILES llexperiencelog.h llexternaleditor.h llface.h - llfacebookconnect.h llfasttimerview.h llfavoritesbar.h llfeaturemanager.h @@ -872,7 +869,6 @@ set(viewer_HEADER_FILES llfloaterexperiencepicker.h llfloaterexperienceprofile.h llfloaterexperiences.h - llfloaterfacebook.h llfloaterflickr.h llfloaterfonttest.h llfloatergesture.h @@ -1381,8 +1377,12 @@ if (DARWIN) PROPERTIES COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" # BugsplatMac is a module, imported with @import. That language feature - # demands these switches. - COMPILE_FLAGS "-fmodules -fcxx-modules" + # demands these -f switches. + # Xcode 10.2 requires that Objective-C++ headers declare nullability of + # pointer variables. As of 2019-06-26, the BugsplatMac version we're using + # does not yet do so in its own header files. This -W flag prevents fatal + # warnings. + COMPILE_FLAGS "-fmodules -fcxx-modules -Wno-nullability-completeness" ) find_library(AGL_LIBRARY AGL) @@ -1881,12 +1881,12 @@ if (WINDOWS) # sets the 'working directory' for debugging from visual studio. # Condition for version can be moved to requirements once build agents will be updated (see TOOL-3865) - if ((NOT UNATTENDED) AND (${CMAKE_VERSION} VERSION_GREATER "3.7.2")) + if (NOT UNATTENDED) set_property( TARGET ${VIEWER_BINARY_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" ) - endif ((NOT UNATTENDED) AND (${CMAKE_VERSION} VERSION_GREATER "3.7.2")) + endif (NOT UNATTENDED) if (PACKAGE) add_custom_command( @@ -2121,7 +2121,7 @@ if (DARWIN) set(MACOSX_BUNDLE_BUNDLE_VERSION "${VIEWER_SHORT_VERSION}${VIEWER_MACOSX_PHASE}${VIEWER_REVISION}") set(MACOSX_BUNDLE_COPYRIGHT "Copyright © Linden Research, Inc. 2018") set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "SecondLife.nib") - set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "NSApplication") + set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "LLApplication") # https://blog.kitware.com/upcoming-in-cmake-2-8-12-osx-rpath-support/ set(CMAKE_MACOSX_RPATH 1) diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index a6534bb333..b98d1d3fa7 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -6.2.5 +6.3.5 diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 412d3a53b3..cab0c523b2 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -228,16 +228,6 @@ is_running_function="Floater.IsOpen" is_running_parameters="snapshot" /> - <command name="facebook" - available_in_toybox="true" - icon="Command_Facebook_Icon" - label_ref="Command_Facebook_Label" - tooltip_ref="Command_Facebook_Tooltip" - execute_function="Floater.ToggleOrBringToFront" - execute_parameters="facebook" - is_running_function="Floater.IsOpen" - is_running_parameters="facebook" - /> <command name="flickr" available_in_toybox="true" icon="Command_Flickr_Icon" diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 3d4bd659f1..8f4ca6c633 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -414,5 +414,16 @@ <key>Value</key> <string>Snapshot</string> </map> + <key>ExperienceSearchMaturity</key> + <map> + <key>Comment</key> + <string>Setting for the user's preferred Max Content rating for Experiences search (Default rating is General)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <integer>2</integer> + </map> </map> </llsd> diff --git a/indra/newview/app_settings/toolbars.xml b/indra/newview/app_settings/toolbars.xml index 36e4eb91fd..eec0d81e8b 100644 --- a/indra/newview/app_settings/toolbars.xml +++ b/indra/newview/app_settings/toolbars.xml @@ -21,7 +21,6 @@ <command name="voice"/> <command name="minimap"/> <command name="snapshot"/> - <command name="facebook"/> </left_toolbar> <right_toolbar button_display_mode="icons_only"> diff --git a/indra/newview/character/aux_base.tga b/indra/newview/character/aux_base.tga Binary files differnew file mode 100644 index 0000000000..dbcaaaf2b1 --- /dev/null +++ b/indra/newview/character/aux_base.tga diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index df30f46002..2cdd86267e 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -8947,6 +8947,66 @@ <texture local_texture="hair_alpha" /> </layer> + <layer + name="hair_tattoo"> + <texture + local_texture="hair_tattoo" /> + <param + id="1211" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_hair_red" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="255, 0, 0, 255" /> + </param_color> + </param> + + <param + id="1212" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_hair_green" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 255, 0, 255" /> + </param_color> + </param> + + <param + id="1213" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_hair_blue" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 0, 255, 255" /> + </param_color> + </param> + + </layer> + </layer_set> <!-- =========================================================== --> @@ -10024,7 +10084,65 @@ render_pass="bump"> </param> </layer> + <layer + name="head_universal_tattoo"> + <texture + local_texture="head_universal_tattoo" /> + <param + id="1229" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_head_universal_red" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="255, 0, 0, 255" /> + </param_color> + </param> + + <param + id="1230" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_head_universal_green" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 255, 0, 255" /> + </param_color> + </param> + <param + id="1231" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_head_universal_blue" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 0, 255, 255" /> + </param_color> + </param> + + </layer> </layer_set> @@ -10201,7 +10319,65 @@ render_pass="bump"> </param> </layer> + <layer + name="upper_universal_tattoo"> + <texture + local_texture="upper_universal_tattoo" /> + <param + id="1232" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_upper_universal_red" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="255, 0, 0, 255" /> + </param_color> + </param> + + <param + id="1233" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_upper_universal_green" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + <value + color="0, 255, 0, 255" /> + </param_color> + </param> + + <param + id="1234" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_upper_universal_blue" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 0, 255, 255" /> + </param_color> + </param> + + </layer> <layer name="upper_undershirt bump" @@ -11453,7 +11629,65 @@ render_pass="bump"> </param> </layer> + <layer + name="lower_universal_tattoo"> + <texture + local_texture="lower_universal_tattoo" /> + <param + id="1235" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_lower_universal_red" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="255, 0, 0, 255" /> + </param_color> + </param> + + <param + id="1236" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_lower_universal_green" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 255, 0, 255" /> + </param_color> + </param> + + <param + id="1237" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_lower_universal_blue" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + <value + color="0, 0, 255, 255" /> + </param_color> + </param> + + </layer> <layer name="lower_underpants bump" render_pass="bump" @@ -12235,6 +12469,66 @@ render_pass="bump"> <texture local_texture="eyes_alpha" /> </layer> + <layer + name="eyes_tattoo"> + <texture + local_texture="eyes_tattoo" /> + <param + id="924" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_eyes_red" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="255, 0, 0, 255" /> + </param_color> + </param> + + <param + id="925" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_eyes_green" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 255, 0, 255" /> + </param_color> + </param> + + <param + id="926" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_eyes_blue" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 0, 255, 255" /> + </param_color> + </param> + + </layer> + </layer_set> @@ -12415,6 +12709,447 @@ render_pass="bump"> domain="0" /> </param> </layer> + <layer + name="skirt_tattoo"> + <texture + local_texture="skirt_tattoo" /> + <param + id="1208" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_skirt_red" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="255, 0, 0, 255" /> + </param_color> + </param> + + <param + id="1209" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_skirt_green" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 255, 0, 255" /> + </param_color> + </param> + + <param + id="1210" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_skirt_blue" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 0, 255, 255" /> + </param_color> + </param> + + </layer> + + </layer_set> + + <!-- =========================================================== --> + <layer_set + body_region="leftarm" + width="512" + height="512" + clear_alpha="false"> + <layer + name="base" + write_all_channels="true" + fixed_color = "128,128,128,255"> + <texture + tga_file="aux_base.tga" /> + </layer> + + <layer + name="leftarm_tattoo"> + <texture + local_texture="leftarm_tattoo" /> + <param + id="1214" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_leftarm_red" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="255, 0, 0, 255" /> + </param_color> + </param> + + <param + id="1215" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_leftarm_green" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 255, 0, 255" /> + </param_color> + </param> + + <param + id="1216" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_leftarm_blue" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 0, 255, 255" /> + </param_color> + </param> + + </layer> + + </layer_set> + + <!-- =========================================================== --> + <layer_set + body_region="leftleg" + width="512" + height="512" + clear_alpha="false"> + <layer + name="base" + write_all_channels="true" + fixed_color = "128,128,128,255"> + <texture + tga_file="aux_base.tga" /> + </layer> + <layer + name="leftleg_tattoo"> + <texture + local_texture="leftleg_tattoo" /> + <param + id="1217" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_leftleg_red" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="255, 0, 0, 255" /> + </param_color> + </param> + + <param + id="1218" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_leftleg_green" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 255, 0, 255" /> + </param_color> + </param> + + <param + id="1219" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_leftleg_blue" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 0, 255, 255" /> + </param_color> + </param> + + </layer> + + </layer_set> + + <!-- =========================================================== --> + <layer_set + body_region="aux1" + width="512" + height="512" + clear_alpha="false"> + + <layer + name="base" + write_all_channels="true" + fixed_color = "128,128,128,255"> + <texture + tga_file="aux_base.tga" /> + </layer> + + <layer + name="aux1_tattoo"> + <texture + local_texture="aux1_tattoo" /> + <param + id="1220" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_aux1_red" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="255, 0, 0, 255" /> + </param_color> + </param> + + <param + id="1221" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_aux1_green" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 255, 0, 255" /> + </param_color> + </param> + + <param + id="1222" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_aux1_blue" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 0, 255, 255" /> + </param_color> + </param> + + </layer> + + </layer_set> + + <!-- =========================================================== --> + <layer_set + body_region="aux2" + width="512" + height="512" + clear_alpha="false"> + + <layer + name="base" + write_all_channels="true" + fixed_color = "128,128,128,255"> + <texture + tga_file="aux_base.tga" /> + </layer> + + <layer + name="aux2_tattoo"> + <texture + local_texture="aux2_tattoo" /> + <param + id="1223" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_aux2_red" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="255, 0, 0, 255" /> + </param_color> + </param> + + <param + id="1224" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_aux2_green" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 255, 0, 255" /> + </param_color> + </param> + + <param + id="1225" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_aux2_blue" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 0, 255, 255" /> + </param_color> + </param> + + </layer> + + </layer_set> + + <!-- =========================================================== --> + <layer_set + body_region="aux3" + width="512" + height="512" + clear_alpha="false"> + + <layer + name="base" + write_all_channels="true" + fixed_color = "128,128,128,255"> + <texture + tga_file="aux_base.tga" /> + </layer> + + <layer + name="aux3_tattoo"> + <texture + local_texture="aux3_tattoo" /> + <param + id="1226" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_aux3_red" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="255, 0, 0, 255" /> + </param_color> + </param> + + <param + id="1227" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_aux3_green" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 255, 0, 255" /> + </param_color> + </param> + + <param + id="1228" + group="1" + edit_group="colorpicker_driven" + wearable="universal" + name="tattoo_aux3_blue" + value_min="0" + value_max="1" + value_default="1"> + <param_color> + <value + color="0, 0, 0, 255" /> + + <value + color="0, 0, 255, 255" /> + </param_color> + </param> + + </layer> </layer_set> @@ -15934,7 +16669,277 @@ render_pass="bump"> </param_driver> </param> + <param + id="1238" + group="2" + wearable="universal" + edit_group="colorpicker" + name="tattoo_universal_red" + value_min="0" + value_max="1" + value_default="1"> + <param_driver> + <driven + id="1229" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1232" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1235" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1208" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1211" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="924" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1214" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1217" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1220" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1223" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1226" + min1="0" + max1="1" + max2="1" + min2="1" /> + + </param_driver> + </param> + + <param + id="1239" + group="2" + wearable="universal" + edit_group="colorpicker" + name="tattoo_universal_green" + value_min="0" + value_max="1" + value_default="1"> + <param_driver> + <driven + id="1230" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1233" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1236" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1209" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1212" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="925" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1215" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1218" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1221" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1224" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1227" + min1="0" + max1="1" + max2="1" + min2="1" /> + + </param_driver> + </param> + + <param + id="1240" + group="2" + wearable="universal" + edit_group="colorpicker" + name="tattoo_universal_blue" + value_min="0" + value_max="1" + value_default="1"> + <param_driver> + <driven + id="1231" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1234" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1237" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1210" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1213" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="926" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1216" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1219" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1222" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1225" + min1="0" + max1="1" + max2="1" + min2="1" /> + + <driven + id="1228" + min1="0" + max1="1" + max2="1" + min2="1" /> + + </param_driver> + </param> <!-- ==PHYSICS PARAMETERS======================================= --> + <param id="1100" diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index d1d5301efe..8838b6d0be 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -346,6 +346,11 @@ Call CheckWillUninstallV2 # Check if Second Life is already installed StrCmp $DO_UNINSTALL_V2 "" PRESERVE_DONE
PRESERVE_DONE:
+# Viewer had "SLLauncher" for some time and we was seting "IsHostApp" for viewer, make sure to clean it up
+DeleteRegValue HKEY_CLASSES_ROOT "Applications\$VIEWER_EXE" "IsHostApp"
+DeleteRegValue HKEY_CLASSES_ROOT "Applications\$VIEWER_EXE" "NoStartPage"
+ClearErrors
+
Call RemoveProgFilesOnInst # Remove existing files to prevent certain errors when running the new version of the viewer
# This placeholder is replaced by the complete list of all the files in the installer, by viewer_manifest.py
@@ -417,7 +422,7 @@ WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info\DefaultIcon" "" '"$INSTDIR\$ # URL param must be last item passed to viewer, it ignores subsequent params to avoid parameter injection attacks.
WriteRegExpandStr HKEY_CLASSES_ROOT "x-grid-location-info\shell\open\command" "" '"$INSTDIR\$VIEWER_EXE" -url "%1"'
-WriteRegStr HKEY_CLASSES_ROOT "Applications\$VIEWER_EXE" "IsHostApp" ""
+WriteRegStr HKEY_CLASSES_ROOT "Applications\$INSTEXE" "IsHostApp" ""
##WriteRegStr HKEY_CLASSES_ROOT "Applications\${VIEWER_EXE}" "NoStartPage" ""
# Write out uninstaller
@@ -464,7 +469,7 @@ DeleteRegKey SHELL_CONTEXT "${INSTNAME_KEY}" DeleteRegKey SHELL_CONTEXT "${MSCURRVER_KEY}\Uninstall\$INSTNAME"
# BUG-2707 Remove entry that disabled SEHOP
DeleteRegKey SHELL_CONTEXT "${MSNTCURRVER_KEY}\Image File Execution Options\$VIEWER_EXE"
-##DeleteRegKey HKEY_CLASSES_ROOT "Applications\$INSTEXE"
+DeleteRegKey HKEY_CLASSES_ROOT "Applications\$INSTEXE"
DeleteRegKey HKEY_CLASSES_ROOT "Applications\${VIEWER_EXE}"
# Clean up shortcuts
diff --git a/indra/newview/installers/windows/lang_de.nsi b/indra/newview/installers/windows/lang_de.nsi Binary files differindex 8bb20476b3..eebcf027a8 100755 --- a/indra/newview/installers/windows/lang_de.nsi +++ b/indra/newview/installers/windows/lang_de.nsi diff --git a/indra/newview/installers/windows/lang_en-us.nsi b/indra/newview/installers/windows/lang_en-us.nsi Binary files differindex fd4d340816..ea680f08e4 100644 --- a/indra/newview/installers/windows/lang_en-us.nsi +++ b/indra/newview/installers/windows/lang_en-us.nsi diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index ba250fa471..31b8b90518 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -24,6 +24,7 @@ * $/LicenseInfo$ */ + #include "llviewerprecompiledheaders.h" #include "llagent.h" @@ -742,7 +743,7 @@ BOOL LLAgent::getFlying() const //----------------------------------------------------------------------------- // setFlying() //----------------------------------------------------------------------------- -void LLAgent::setFlying(BOOL fly) +void LLAgent::setFlying(BOOL fly, BOOL fail_sound) { if (isAgentAvatarValid()) { @@ -771,7 +772,10 @@ void LLAgent::setFlying(BOOL fly) // parcel doesn't let you start fly // gods can always fly // and it's OK if you're already flying - make_ui_sound("UISndBadKeystroke"); + if (fail_sound) + { + make_ui_sound("UISndBadKeystroke"); + } return; } if( !was_flying ) @@ -3706,6 +3710,23 @@ BOOL LLAgent::getHomePosGlobal( LLVector3d* pos_global ) return TRUE; } +bool LLAgent::isInHomeRegion() +{ + if(!mHaveHomePosition) + { + return false; + } + if (!getRegion()) + { + return false; + } + if (getRegion()->getHandle() != mHomeRegionHandle) + { + return false; + } + return true; +} + void LLAgent::clearVisualParams(void *data) { if (isAgentAvatarValid()) diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index b1b39b637e..5ba1083d8e 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -233,6 +233,8 @@ public: void setStartPosition(U32 location_id); // Marks current location as start, sends information to servers void setHomePosRegion(const U64& region_handle, const LLVector3& pos_region); BOOL getHomePosGlobal(LLVector3d* pos_global); + bool isInHomeRegion(); + private: void setStartPositionSuccess(const LLSD &result); @@ -337,7 +339,7 @@ private: //-------------------------------------------------------------------- public: BOOL getFlying() const; - void setFlying(BOOL fly); + void setFlying(BOOL fly, BOOL fail_sound = FALSE); static void toggleFlying(); static bool enableFlying(); BOOL canFly(); // Does this parcel allow you to fly? diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 92a3026096..0b4b848014 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1140,7 +1140,7 @@ void LLAgentCamera::updateCamera() mCameraUpVector = mCameraUpVector * gAgentAvatarp->getRenderRotation(); } - if (cameraThirdPerson() && (mFocusOnAvatar || mAllowChangeToFollow) && LLFollowCamMgr::getActiveFollowCamParams()) + if (cameraThirdPerson() && (mFocusOnAvatar || mAllowChangeToFollow) && LLFollowCamMgr::getInstance()->getActiveFollowCamParams()) { mAllowChangeToFollow = FALSE; mFocusOnAvatar = TRUE; @@ -1240,7 +1240,7 @@ void LLAgentCamera::updateCamera() // *TODO: use combined rotation of frameagent and sit object LLQuaternion avatarRotationForFollowCam = gAgentAvatarp->isSitting() ? gAgentAvatarp->getRenderRotation() : gAgent.getFrameAgent().getQuaternion(); - LLFollowCamParams* current_cam = LLFollowCamMgr::getActiveFollowCamParams(); + LLFollowCamParams* current_cam = LLFollowCamMgr::getInstance()->getActiveFollowCamParams(); if (current_cam) { mFollowCam.copyParams(*current_cam); @@ -2046,7 +2046,7 @@ void LLAgentCamera::changeCameraToMouselook(BOOL animate) // Menus should not remain open on switching to mouselook... LLMenuGL::sMenuContainer->hideMenus(); - LLUI::clearPopups(); + LLUI::getInstance()->clearPopups(); // unpause avatar animation gAgent.unpauseAnimation(); @@ -2100,7 +2100,7 @@ void LLAgentCamera::changeCameraToDefault() return; } - if (LLFollowCamMgr::getActiveFollowCamParams()) + if (LLFollowCamMgr::getInstance()->getActiveFollowCamParams()) { changeCameraToFollow(); } diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 170e4063a1..15e4de8f69 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1538,6 +1538,12 @@ void LLAgentWearables::createWearable(LLWearableType::EType type, bool wear, con { if (type == LLWearableType::WT_INVALID || type == LLWearableType::WT_NONE) return; + if (type == LLWearableType::WT_UNIVERSAL && !gAgent.getRegion()->bakesOnMeshEnabled()) + { + LL_WARNS("Inventory") << "Can't create WT_UNIVERSAL type " << LL_ENDL; + return; + } + LLViewerWearable* wearable = LLWearableList::instance().createNewWearable(type, gAgentAvatarp); LLAssetType::EType asset_type = wearable->getAssetType(); LLInventoryType::EType inv_type = LLInventoryType::IT_WEARABLE; diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 1d55537427..47fde299c7 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -342,3 +342,16 @@ struct AttachmentInfo #endif // LL_BUGSPLAT @end + +@implementation LLApplication + +- (void)sendEvent:(NSEvent *)event +{ + [super sendEvent:event]; + if ([event type] == NSKeyUp && ([event modifierFlags] & NSCommandKeyMask)) + { + [[self keyWindow] sendEvent:event]; + } +} + +@end diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 22bcbad7da..7325ec598a 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -148,7 +148,7 @@ public: { // support secondlife:///app/appearance/show, but for now we just // make all secondlife:///app/appearance SLapps behave this way - if (!LLUI::sSettingGroups["config"]->getBOOL("EnableAppearance")) + if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableAppearance")) { LLNotificationsUtil::add("NoAppearance", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); return true; diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 56e8cc8ff4..ff897ef962 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -100,7 +100,6 @@ #include "llscenemonitor.h" #include "llavatarrenderinfoaccountant.h" #include "lllocalbitmaps.h" -#include "llskinningutil.h" // Linden library includes #include "llavatarnamecache.h" @@ -774,7 +773,7 @@ bool LLAppViewer::init() // initialize LLWearableType translation bridge. // Memory will be cleaned up in ::cleanupClass() - LLWearableType::initClass(new LLUITranslationBridge()); + LLWearableType::initParamSingleton(new LLUITranslationBridge()); // initialize SSE options LLVector4a::initClass(); @@ -798,9 +797,6 @@ bool LLAppViewer::init() LL_INFOS("InitInfo") << "Configuration initialized." << LL_ENDL ; - // initialize skinning util - LLSkinningUtil::initClass(); - //set the max heap size. initMaxHeapSize() ; LLCoros::instance().setStackSize(gSavedSettings.getS32("CoroutineStackSize")); @@ -848,11 +844,10 @@ bool LLAppViewer::init() settings_map["floater"] = &gSavedSettings; // *TODO: New settings file settings_map["account"] = &gSavedPerAccountSettings; - LLUI::initClass(settings_map, + LLUI::initParamSingleton(settings_map, LLUIImageList::getInstance(), ui_audio_callback, - deferred_ui_audio_callback, - &LLUI::getScaleFactor()); + deferred_ui_audio_callback); LL_INFOS("InitInfo") << "UI initialized." << LL_ENDL ; // NOW LLUI::getLanguage() should work. gDirUtilp must know the language @@ -896,8 +891,6 @@ bool LLAppViewer::init() // LLKeyboard relies on LLUI to know what some accelerator keys are called. LLKeyboard::setStringTranslatorFunc( LLTrans::getKeyboardString ); - LLWeb::initClass(); // do this after LLUI - // Provide the text fields with callbacks for opening Urls LLUrlAction::setOpenURLCallback(boost::bind(&LLWeb::loadURL, _1, LLStringUtil::null, LLStringUtil::null)); LLUrlAction::setOpenURLInternalCallback(boost::bind(&LLWeb::loadURLInternal, _1, LLStringUtil::null, LLStringUtil::null, false)); @@ -905,7 +898,7 @@ bool LLAppViewer::init() LLUrlAction::setExecuteSLURLCallback(&LLURLDispatcher::dispatchFromTextEditor); // Let code in llui access the viewer help floater - LLUI::sHelpImpl = LLViewerHelp::getInstance(); + LLUI::getInstance()->mHelpImpl = LLViewerHelp::getInstance(); LL_INFOS("InitInfo") << "UI initialization is done." << LL_ENDL ; @@ -1211,9 +1204,6 @@ bool LLAppViewer::init() << LL_ENDL; } - LLViewerMedia::initClass(); - LL_INFOS("InitInfo") << "Viewer media initialized." << LL_ENDL ; - LLTextUtil::TextHelpers::iconCallbackCreationFunction = create_text_segment_icon_from_url_match; //EXT-7013 - On windows for some locale (Japanese) standard @@ -1253,7 +1243,7 @@ bool LLAppViewer::init() // Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be instantiated. LLVoiceChannel::initClass(); - LLVoiceClient::getInstance()->init(gServicePump); + LLVoiceClient::initParamSingleton(gServicePump); LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLFloaterIMContainer::onCurrentChannelChanged, _1), true); joystick = LLViewerJoystick::getInstance(); @@ -1750,8 +1740,6 @@ bool LLAppViewer::cleanup() gTransferManager.cleanup(); #endif - SUBSYSTEM_CLEANUP(LLLocalBitmapMgr); - // Note: this is where gWorldMap used to be deleted. // Note: this is where gHUDManager used to be deleted. @@ -1894,12 +1882,9 @@ bool LLAppViewer::cleanup() //end_messaging_system(); - SUBSYSTEM_CLEANUP(LLFollowCamMgr); - //SUBSYSTEM_CLEANUP(LLVolumeMgr); LLPrimitive::cleanupVolumeManager(); SUBSYSTEM_CLEANUP(LLWorldMapView); SUBSYSTEM_CLEANUP(LLFolderViewItem); - SUBSYSTEM_CLEANUP(LLUI); // // Shut down the VFS's AFTER the decode manager cleans up (since it cleans up vfiles). @@ -2049,13 +2034,10 @@ bool LLAppViewer::cleanup() //Note: //SUBSYSTEM_CLEANUP(LLViewerMedia) has to be put before gTextureList.shutdown() //because some new image might be generated during cleaning up media. --bao - SUBSYSTEM_CLEANUP(LLViewerMedia); - SUBSYSTEM_CLEANUP(LLViewerParcelMedia); gTextureList.shutdown(); // shutdown again in case a callback added something LLUIImageList::getInstance()->cleanUp(); // This should eventually be done in LLAppViewer - SUBSYSTEM_CLEANUP(LLImage); SUBSYSTEM_CLEANUP(LLVFSThread); SUBSYSTEM_CLEANUP(LLLFSThread); @@ -2103,8 +2085,6 @@ bool LLAppViewer::cleanup() SUBSYSTEM_CLEANUP(LLProxy); LLCore::LLHttp::cleanup(); - SUBSYSTEM_CLEANUP(LLWearableType); - LLMainLoopRepeater::instance().stop(); ll_close_fail_log(); @@ -2163,7 +2143,7 @@ bool LLAppViewer::initThreads() { static const bool enable_threads = true; - LLImage::initClass(gSavedSettings.getBOOL("TextureNewByteRange"),gSavedSettings.getS32("TextureReverseByteRange")); + LLImage::initParamSingleton(gSavedSettings.getBOOL("TextureNewByteRange"),gSavedSettings.getS32("TextureReverseByteRange")); LLVFSThread::initClass(enable_threads && false); LLLFSThread::initClass(enable_threads && false); @@ -2439,9 +2419,9 @@ bool LLAppViewer::initConfiguration() bool set_defaults = true; if(!loadSettingsFromDirectory("Default", set_defaults)) { - std::ostringstream msg; - msg << "Unable to load default settings file. The installation may be corrupted."; - OSMessageBox(msg.str(),LLStringUtil::null,OSMB_OK); + OSMessageBox( + "Unable to load default settings file. The installation may be corrupted.", + LLStringUtil::null,OSMB_OK); return false; } @@ -2562,7 +2542,7 @@ bool LLAppViewer::initConfiguration() if(gSavedSettings.getBOOL("DisableCrashLogger")) { LL_WARNS() << "Crashes will be handled by system, stack trace logs and crash logger are both disabled" << LL_ENDL; - LLAppViewer::instance()->disableCrashlogger(); + disableCrashlogger(); } // Handle initialization from settings. @@ -2579,7 +2559,7 @@ bool LLAppViewer::initConfiguration() LL_INFOS() << msg.str() << LL_ENDL; OSMessageBox( - msg.str().c_str(), + msg.str(), LLStringUtil::null, OSMB_OK); @@ -2689,7 +2669,34 @@ bool LLAppViewer::initConfiguration() ll_init_fail_log(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "test_failures.log")); } + const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent"); + if(skinfolder && LLStringUtil::null != skinfolder->getValue().asString()) + { + // Examining "Language" may not suffice -- see LLUI::getLanguage() + // logic. Unfortunately LLUI::getLanguage() doesn't yet do us much + // good because we haven't yet called LLUI::initClass(). + gDirUtilp->setSkinFolder(skinfolder->getValue().asString(), + gSavedSettings.getString("Language")); + } + + if (gSavedSettings.getBOOL("SpellCheck")) + { + std::list<std::string> dict_list; + std::string dict_setting = gSavedSettings.getString("SpellCheckDictionary"); + boost::split(dict_list, dict_setting, boost::is_any_of(std::string(","))); + if (!dict_list.empty()) + { + LLSpellChecker::setUseSpellCheck(dict_list.front()); + dict_list.pop_front(); + LLSpellChecker::instance().setSecondaryDictionaries(dict_list); + } + } + // Handle slurl use. NOTE: Don't let SL-55321 reappear. + // This initial-SLURL logic, up through the call to + // sendURLToOtherInstance(), must precede LLSplashScreen::show() -- + // because if sendURLToOtherInstance() succeeds, we take a fast exit, + // SKIPPING the splash screen and everything else. // *FIX: This init code should be made more robust to prevent // the issue SL-55321 from returning. One thought is to allow @@ -2734,6 +2741,27 @@ bool LLAppViewer::initConfiguration() } } + // NextLoginLocation is set as a side effect of LLStartUp::setStartSLURL() + std::string nextLoginLocation = gSavedSettings.getString( "NextLoginLocation" ); + if ( !nextLoginLocation.empty() ) + { + LL_DEBUGS("AppInit")<<"set start from NextLoginLocation: "<<nextLoginLocation<<LL_ENDL; + LLStartUp::setStartSLURL(LLSLURL(nextLoginLocation)); + } + else if ( ( clp.hasOption("login") || clp.hasOption("autologin")) + && gSavedSettings.getString("CmdLineLoginLocation").empty()) + { + // If automatic login from command line with --login switch + // init StartSLURL location. + std::string start_slurl_setting = gSavedSettings.getString("LoginLocation"); + LL_DEBUGS("AppInit") << "start slurl setting '" << start_slurl_setting << "'" << LL_ENDL; + LLStartUp::setStartSLURL(LLSLURL(start_slurl_setting)); + } + else + { + // the login location will be set by the login panel (see LLPanelLogin) + } + //RN: if we received a URL, hand it off to the existing instance. // don't call anotherInstanceRunning() when doing URL handoff, as // it relies on checking a marker file which will not work when running @@ -2749,30 +2777,6 @@ bool LLAppViewer::initConfiguration() } } - const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent"); - if(skinfolder && LLStringUtil::null != skinfolder->getValue().asString()) - { - // Examining "Language" may not suffice -- see LLUI::getLanguage() - // logic. Unfortunately LLUI::getLanguage() doesn't yet do us much - // good because we haven't yet called LLUI::initClass(). - gDirUtilp->setSkinFolder(skinfolder->getValue().asString(), - gSavedSettings.getString("Language")); - } - - if (gSavedSettings.getBOOL("SpellCheck")) - { - std::list<std::string> dict_list; - std::string dict_setting = gSavedSettings.getString("SpellCheckDictionary"); - boost::split(dict_list, dict_setting, boost::is_any_of(std::string(","))); - if (!dict_list.empty()) - { - LLSpellChecker::setUseSpellCheck(dict_list.front()); - dict_list.pop_front(); - LLSpellChecker::instance().setSecondaryDictionaries(dict_list); - } - } - - // Display splash screen. Must be after above check for previous // crash as this dialog is always frontmost. std::string splash_msg; @@ -2804,30 +2808,15 @@ bool LLAppViewer::initConfiguration() } LLStringUtil::truncate(gWindowTitle, 255); - //RN: if we received a URL, hand it off to the existing instance. - // don't call anotherInstanceRunning() when doing URL handoff, as - // it relies on checking a marker file which will not work when running - // out of different directories - - if (LLStartUp::getStartSLURL().isValid() && - (gSavedSettings.getBOOL("SLURLPassToOtherInstance"))) - { - if (sendURLToOtherInstance(LLStartUp::getStartSLURL().getSLURLString())) - { - // successfully handed off URL to existing instance, exit - return false; - } - } - // // Check for another instance of the app running + // This happens AFTER LLSplashScreen::show(). That may or may not be + // important. // if (mSecondInstance && !gSavedSettings.getBOOL("AllowMultipleViewers")) { - std::ostringstream msg; - msg << LLTrans::getString("MBAlreadyRunning"); OSMessageBox( - msg.str(), + LLTrans::getString("MBAlreadyRunning"), LLStringUtil::null, OSMB_OK); return false; @@ -2845,27 +2834,6 @@ bool LLAppViewer::initConfiguration() } } - // NextLoginLocation is set from the command line option - std::string nextLoginLocation = gSavedSettings.getString( "NextLoginLocation" ); - if ( !nextLoginLocation.empty() ) - { - LL_DEBUGS("AppInit")<<"set start from NextLoginLocation: "<<nextLoginLocation<<LL_ENDL; - LLStartUp::setStartSLURL(LLSLURL(nextLoginLocation)); - } - else if ( ( clp.hasOption("login") || clp.hasOption("autologin")) - && gSavedSettings.getString("CmdLineLoginLocation").empty()) - { - // If automatic login from command line with --login switch - // init StartSLURL location. - std::string start_slurl_setting = gSavedSettings.getString("LoginLocation"); - LL_DEBUGS("AppInit") << "start slurl setting '" << start_slurl_setting << "'" << LL_ENDL; - LLStartUp::setStartSLURL(LLSLURL(start_slurl_setting)); - } - else - { - // the login location will be set by the login panel (see LLPanelLogin) - } - gLastRunVersion = gSavedSettings.getString("LastRunVersion"); loadColorSettings(); @@ -2889,7 +2857,15 @@ bool LLAppViewer::initConfiguration() // keeps growing, necessitating a method all its own. void LLAppViewer::initStrings() { - LLTransUtil::parseStrings("strings.xml", default_trans_args); + std::string strings_file = "strings.xml"; + std::string strings_path_full = gDirUtilp->findSkinnedFilenameBaseLang(LLDir::XUI, strings_file); + if (strings_path_full.empty() || !LLFile::isfile(strings_path_full)) + { + // initial check to make sure files are there failed + gDirUtilp->dumpCurrentDirectories(LLError::LEVEL_WARN); + LL_ERRS() << "Viewer failed to find localization and UI files. Please reinstall viewer from https://secondlife.com/support/downloads/ and contact https://support.secondlife.com if issue persists after reinstall." << LL_ENDL; + } + LLTransUtil::parseStrings(strings_file, default_trans_args); LLTransUtil::parseLanguageStrings("language_settings.xml"); // parseStrings() sets up the LLTrans substitution table. Add this one item. @@ -3051,7 +3027,7 @@ bool LLAppViewer::initWindow() gViewerWindow->getWindow()->maximize(); } - LLUI::sWindow = gViewerWindow->getWindow(); + LLUI::getInstance()->mWindow = gViewerWindow->getWindow(); // Show watch cursor gViewerWindow->setCursor(UI_CURSOR_WAIT); @@ -3174,6 +3150,10 @@ LLSD LLAppViewer::getViewerInfo() const substitution["datetime"] = (S32)(gVFS ? gVFS->creationTime() : 0); info["VFS_TIME"] = LLTrans::getString("AboutTime", substitution); +#if LL_DARWIN + info["HIDPI"] = gHiDPISupport; +#endif + // Libraries info["J2C_VERSION"] = LLImageJ2C::getEngineInfo(); @@ -3316,6 +3296,9 @@ std::string LLAppViewer::getViewerInfoString(bool default_string) const } support << "\n" << LLTrans::getString("AboutOGL", args, default_string); support << "\n\n" << LLTrans::getString("AboutSettings", args, default_string); +#if LL_DARWIN + support << "\n" << LLTrans::getString("AboutOSXHiDPI", args, default_string); +#endif support << "\n\n" << LLTrans::getString("AboutLibs", args, default_string); if (info.has("COMPILER")) { @@ -4143,7 +4126,7 @@ bool LLAppViewer::initCache() mPurgeCache = false; BOOL read_only = mSecondInstance ? TRUE : FALSE; LLAppViewer::getTextureCache()->setReadOnly(read_only) ; - LLVOCache::getInstance()->setReadOnly(read_only); + LLVOCache::initParamSingleton(read_only); bool texture_cache_mismatch = false; if (gSavedSettings.getS32("LocalCacheVersion") != LLAppViewer::getTextureCacheVersion()) @@ -4215,7 +4198,8 @@ bool LLAppViewer::initCache() S64 extra = LLAppViewer::getTextureCache()->initCache(LL_PATH_CACHE, texture_cache_size, texture_cache_mismatch); texture_cache_size -= extra; - LLVOCache::getInstance()->initCache(LL_PATH_CACHE, gSavedSettings.getU32("CacheNumberOfRegionsForObjects"), getObjectCacheVersion()) ; + + LLVOCache::getInstance()->initCache(LL_PATH_CACHE, gSavedSettings.getU32("CacheNumberOfRegionsForObjects"), getObjectCacheVersion()); LLSplashScreen::update(LLTrans::getString("StartupInitializingVFS")); @@ -4502,10 +4486,37 @@ void LLAppViewer::saveFinalSnapshot() std::string snap_filename = gDirUtilp->getLindenUserDir(); snap_filename += gDirUtilp->getDirDelimiter(); - snap_filename += SCREEN_LAST_FILENAME; + snap_filename += LLStartUp::getScreenLastFilename(); // use full pixel dimensions of viewer window (not post-scale dimensions) - gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, TRUE); + gViewerWindow->saveSnapshot(snap_filename, + gViewerWindow->getWindowWidthRaw(), + gViewerWindow->getWindowHeightRaw(), + FALSE, + TRUE, + LLSnapshotModel::SNAPSHOT_TYPE_COLOR, + LLSnapshotModel::SNAPSHOT_FORMAT_PNG); mSavedFinalSnapshot = TRUE; + + if (gAgent.isInHomeRegion()) + { + LLVector3d home; + if (gAgent.getHomePosGlobal(&home) && dist_vec(home, gAgent.getPositionGlobal()) < 10) + { + // We are at home position or close to it, see if we need to create home screenshot + // Notes: + // 1. It might be beneficial to also replace home if file is too old + // 2. This is far from best way/place to update screenshot since location might be not fully loaded, + // but we don't have many options + std::string snap_home = gDirUtilp->getLindenUserDir(); + snap_home += gDirUtilp->getDirDelimiter(); + snap_home += LLStartUp::getScreenHomeFilename(); + if (!gDirUtilp->fileExists(snap_home)) + { + // We are at home position yet no home image exist, fix it + LLFile::copy(snap_filename, snap_home); + } + } + } } } @@ -4518,7 +4529,7 @@ void LLAppViewer::loadNameCache() llifstream name_cache_stream(filename.c_str()); if(name_cache_stream.is_open()) { - if ( ! LLAvatarNameCache::importFile(name_cache_stream)) + if ( ! LLAvatarNameCache::getInstance()->importFile(name_cache_stream)) { LL_WARNS("AppInit") << "removing invalid '" << filename << "'" << LL_ENDL; name_cache_stream.close(); @@ -4545,7 +4556,7 @@ void LLAppViewer::saveNameCache() llofstream name_cache_stream(filename.c_str()); if(name_cache_stream.is_open()) { - LLAvatarNameCache::exportFile(name_cache_stream); + LLAvatarNameCache::getInstance()->exportFile(name_cache_stream); } // real names cache @@ -5152,7 +5163,8 @@ void LLAppViewer::idleNameCache() // granted to neighbor regions before the main agent gets there. Can't // do it in the move-into-region code because cap not guaranteed to be // granted yet, for example on teleport. - bool had_capability = LLAvatarNameCache::hasNameLookupURL(); + LLAvatarNameCache *name_cache = LLAvatarNameCache::getInstance(); + bool had_capability = LLAvatarNameCache::getInstance()->hasNameLookupURL(); std::string name_lookup_url; name_lookup_url.reserve(128); // avoid a memory allocation below name_lookup_url = region->getCapability("GetDisplayNames"); @@ -5169,12 +5181,12 @@ void LLAppViewer::idleNameCache() { name_lookup_url += '/'; } - LLAvatarNameCache::setNameLookupURL(name_lookup_url); + name_cache->setNameLookupURL(name_lookup_url); } else { // Display names not available on this region - LLAvatarNameCache::setNameLookupURL( std::string() ); + name_cache->setNameLookupURL( std::string() ); } // Error recovery - did we change state? @@ -5184,7 +5196,7 @@ void LLAppViewer::idleNameCache() LLVOAvatar::invalidateNameTags(); } - LLAvatarNameCache::idle(); + name_cache->idle(); } // diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index fff2653c98..d208e135bb 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -312,12 +312,12 @@ void ll_nvapi_init(NvDRSSessionHandle hSession) #if DEBUGGING_SEH_FILTER # define WINMAIN DebuggingWinMain #else -# define WINMAIN WinMain +# define WINMAIN wWinMain #endif int APIENTRY WINMAIN(HINSTANCE hInstance, HINSTANCE hPrevInstance, - LPSTR lpCmdLine, + PWSTR pCmdLine, int nCmdShow) { const S32 MAX_HEAPS = 255; @@ -356,8 +356,8 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, // *FIX: global gIconResource = MAKEINTRESOURCE(IDI_LL_ICON); - LLAppViewerWin32* viewer_app_ptr = new LLAppViewerWin32(lpCmdLine); - + LLAppViewerWin32* viewer_app_ptr = new LLAppViewerWin32(ll_convert_wide_to_string(pCmdLine).c_str()); + gOldTerminateHandler = std::set_terminate(exceptionTerminateHandler); viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash); @@ -469,9 +469,9 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, // in a method that uses object destructors. Go figure. // This winmain just calls the real winmain inside __try. // The __except calls our exception filter function. For debugging purposes. -int APIENTRY WinMain(HINSTANCE hInstance, +int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, - LPSTR lpCmdLine, + PWSTR lpCmdLine, int nCmdShow) { __try diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 513f25e301..b0715a3afd 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -154,7 +154,7 @@ LLAvatarList::LLAvatarList(const Params& p) mLITUpdateTimer->start(); } - LLAvatarNameCache::addUseDisplayNamesCallback(boost::bind(&LLAvatarList::handleDisplayNamesOptionChanged, this)); + LLAvatarNameCache::getInstance()->addUseDisplayNamesCallback(boost::bind(&LLAvatarList::handleDisplayNamesOptionChanged, this)); } diff --git a/indra/newview/llbrowsernotification.cpp b/indra/newview/llbrowsernotification.cpp index 19747757db..0460bff1b4 100644 --- a/indra/newview/llbrowsernotification.cpp +++ b/indra/newview/llbrowsernotification.cpp @@ -50,7 +50,7 @@ bool LLBrowserNotification::processNotification(const LLNotificationPtr& notific } else if (LLViewerMediaFocus::instance().getControlsMediaID() == media_id) { - LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(media_id); + LLViewerMediaImpl* impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(media_id); if (impl) { impl->showNotification(notification); diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index d6240838b6..0b7b9cbbc7 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -58,15 +58,22 @@ LLChannelManager::LLChannelManager() //-------------------------------------------------------------------------- LLChannelManager::~LLChannelManager() { - for(std::vector<ChannelElem>::iterator it = mChannelList.begin(); it != mChannelList.end(); ++it) - { - LLScreenChannelBase* channel = it->channel.get(); - if (!channel) continue; +} - delete channel; - } +//-------------------------------------------------------------------------- +void LLChannelManager::cleanupSingleton() +{ + // Note: LLScreenChannelBase is a LLUICtrl and depends onto other singletions + // not captured by singleton-dependency, so cleanup it here instead of destructor + for (std::vector<ChannelElem>::iterator it = mChannelList.begin(); it != mChannelList.end(); ++it) + { + LLScreenChannelBase* channel = it->channel.get(); + if (!channel) continue; - mChannelList.clear(); + delete channel; + } + + mChannelList.clear(); } //-------------------------------------------------------------------------- diff --git a/indra/newview/llchannelmanager.h b/indra/newview/llchannelmanager.h index 8b9d0dda8b..8abe350196 100644 --- a/indra/newview/llchannelmanager.h +++ b/indra/newview/llchannelmanager.h @@ -46,6 +46,7 @@ class LLChannelManager : public LLSingleton<LLChannelManager> LLSINGLETON(LLChannelManager); virtual ~LLChannelManager(); + void cleanupSingleton(); public: diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index 90a5483dc9..fe14bc081f 100644 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -374,12 +374,40 @@ bool LLCommandLineParser::parseCommandLine(int argc, char **argv) bool LLCommandLineParser::parseCommandLineString(const std::string& str) { + std::string cmd_line_string(""); + if (!str.empty()) + { + bool add_last_c = true; + S32 last_c_pos = str.size() - 1; //don't get out of bounds on pos+1, last char will be processed separately + for (S32 pos = 0; pos < last_c_pos; ++pos) + { + cmd_line_string.append(&str[pos], 1); + if (str[pos] == '\\') + { + cmd_line_string.append("\\", 1); + if (str[pos + 1] == '\\') + { + ++pos; + add_last_c = (pos != last_c_pos); + } + } + } + if (add_last_c) + { + cmd_line_string.append(&str[last_c_pos], 1); + if (str[last_c_pos] == '\\') + { + cmd_line_string.append("\\", 1); + } + } + } + // Split the string content into tokens - const char* escape_chars = "\\"; - const char* separator_chars = "\r\n "; - const char* quote_chars = "\"'"; + const char* escape_chars = "\\"; + const char* separator_chars = "\r\n "; + const char* quote_chars = "\"'"; boost::escaped_list_separator<char> sep(escape_chars, separator_chars, quote_chars); - boost::tokenizer< boost::escaped_list_separator<char> > tok(str, sep); + boost::tokenizer< boost::escaped_list_separator<char> > tok(cmd_line_string, sep); std::vector<std::string> tokens; // std::copy(tok.begin(), tok.end(), std::back_inserter(tokens)); for(boost::tokenizer< boost::escaped_list_separator<char> >::iterator i = tok.begin(); diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index 0f02c23cb0..92eeebd705 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -327,10 +327,13 @@ LLControlAvatar *LLControlAvatar::createControlAvatar(LLVOVolume *obj) { LLControlAvatar *cav = (LLControlAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion(), CO_FLAG_CONTROL_AVATAR); - cav->mRootVolp = obj; + if (cav) + { + cav->mRootVolp = obj; - // Sync up position/rotation with object - cav->matchVolumeTransform(); + // Sync up position/rotation with object + cav->matchVolumeTransform(); + } return cav; } @@ -566,27 +569,49 @@ LLViewerObject* LLControlAvatar::lineSegmentIntersectRiggedAttachments(const LLV LLVector4a* normal, LLVector4a* tangent) { - LLViewerObject* hit = NULL; + if (!mRootVolp) + { + return NULL; + } - if (lineSegmentBoundingBox(start, end)) - { - LLVector4a local_end = end; - LLVector4a local_intersection; + LLViewerObject* hit = NULL; - if (mRootVolp && - mRootVolp->lineSegmentIntersect(start, local_end, face, pick_transparent, pick_rigged, face_hit, &local_intersection, tex_coord, normal, tangent)) + if (lineSegmentBoundingBox(start, end)) + { + LLVector4a local_end = end; + LLVector4a local_intersection; + if (mRootVolp->lineSegmentIntersect(start, local_end, face, pick_transparent, pick_rigged, face_hit, &local_intersection, tex_coord, normal, tangent)) { local_end = local_intersection; if (intersection) { *intersection = local_intersection; } - hit = mRootVolp; } - } - - return hit; + else + { + std::vector<LLVOVolume*> volumes; + getAnimatedVolumes(volumes); + + for (std::vector<LLVOVolume*>::iterator vol_it = volumes.begin(); vol_it != volumes.end(); ++vol_it) + { + LLVOVolume *volp = *vol_it; + if (mRootVolp != volp && volp->lineSegmentIntersect(start, local_end, face, pick_transparent, pick_rigged, face_hit, &local_intersection, tex_coord, normal, tangent)) + { + local_end = local_intersection; + if (intersection) + { + *intersection = local_intersection; + } + hit = volp; + break; + } + } + } + } + + return hit; } // virtual diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 9ccf9b98f7..f7c61efce0 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -189,16 +189,6 @@ LLConversationLog::LLConversationLog() : mAvatarNameCacheConnection(), mLoggingEnabled(false) { - if(gSavedPerAccountSettings.controlExists("KeepConversationLogTranscripts")) - { - LLControlVariable * keep_log_ctrlp = gSavedPerAccountSettings.getControl("KeepConversationLogTranscripts").get(); - S32 log_mode = keep_log_ctrlp->getValue(); - keep_log_ctrlp->getSignal()->connect(boost::bind(&LLConversationLog::enableLogging, this, _2)); - if (log_mode > 0) - { - enableLogging(log_mode); - } - } } void LLConversationLog::enableLogging(S32 log_mode) @@ -443,6 +433,20 @@ bool LLConversationLog::moveLog(const std::string &originDirectory, const std::s return true; } +void LLConversationLog::initLoggingState() +{ + if (gSavedPerAccountSettings.controlExists("KeepConversationLogTranscripts")) + { + LLControlVariable * keep_log_ctrlp = gSavedPerAccountSettings.getControl("KeepConversationLogTranscripts").get(); + S32 log_mode = keep_log_ctrlp->getValue(); + keep_log_ctrlp->getSignal()->connect(boost::bind(&LLConversationLog::enableLogging, this, _2)); + if (log_mode > 0) + { + enableLogging(log_mode); + } + } +} + std::string LLConversationLog::getFileName() { std::string filename = "conversation"; diff --git a/indra/newview/llconversationlog.h b/indra/newview/llconversationlog.h index 035cbcb945..46e46a3278 100644 --- a/indra/newview/llconversationlog.h +++ b/indra/newview/llconversationlog.h @@ -111,7 +111,6 @@ class LLConversationLog : public LLSingleton<LLConversationLog>, LLIMSessionObse { LLSINGLETON(LLConversationLog); public: - void removeConversation(const LLConversation& conversation); /** @@ -149,6 +148,12 @@ public: bool isLogEmpty() { return mConversations.empty(); } /** + * inits connection to per account settings, + * loads saved file and inits enabled state + */ + void initLoggingState(); + + /** * constructs file name in which conversations log will be saved * file name is conversation.log */ diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp index 7d2712eec7..cb5f9c8a2c 100644 --- a/indra/newview/lldonotdisturbnotificationstorage.cpp +++ b/indra/newview/lldonotdisturbnotificationstorage.cpp @@ -48,7 +48,6 @@ const char * LLDoNotDisturbNotificationStorage::offerName = "UserGiveItem"; LLDoNotDisturbNotificationStorageTimer::LLDoNotDisturbNotificationStorageTimer() : LLEventTimer(DND_TIMER) { - } LLDoNotDisturbNotificationStorageTimer::~LLDoNotDisturbNotificationStorageTimer() @@ -74,6 +73,7 @@ LLDoNotDisturbNotificationStorage::LLDoNotDisturbNotificationStorage() { nameToPayloadParameterMap[toastName] = "SESSION_ID"; nameToPayloadParameterMap[offerName] = "object_id"; + initialize(); } LLDoNotDisturbNotificationStorage::~LLDoNotDisturbNotificationStorage() diff --git a/indra/newview/lldonotdisturbnotificationstorage.h b/indra/newview/lldonotdisturbnotificationstorage.h index e6cb7835e3..c6f0bf1ab5 100644 --- a/indra/newview/lldonotdisturbnotificationstorage.h +++ b/indra/newview/lldonotdisturbnotificationstorage.h @@ -45,7 +45,7 @@ public: BOOL tick(); }; -class LLDoNotDisturbNotificationStorage : public LLSingleton<LLDoNotDisturbNotificationStorage>, public LLNotificationStorage +class LLDoNotDisturbNotificationStorage : public LLParamSingleton<LLDoNotDisturbNotificationStorage>, public LLNotificationStorage { LLSINGLETON(LLDoNotDisturbNotificationStorage); ~LLDoNotDisturbNotificationStorage(); @@ -55,7 +55,6 @@ public: static const char * toastName; static const char * offerName; - void initialize(); bool getDirty(); void resetDirty(); void saveNotifications(); @@ -66,6 +65,8 @@ public: protected: private: + void initialize(); + bool mDirty; LLDoNotDisturbNotificationStorageTimer mTimer; diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index fa9a0712fa..8ef0dd2865 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -125,7 +125,7 @@ BOOL LLViewerDynamicTexture::render() //----------------------------------------------------------------------------- void LLViewerDynamicTexture::preRender(BOOL clear_depth) { - //only images up to 512x512 are supported + //only images up to 1024*1024 are supported llassert(mFullHeight <= 512); llassert(mFullWidth <= 512); diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index d657f04457..3395777aab 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -97,7 +97,7 @@ public: /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) { mEditor.onCommit(); return TRUE; } /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) { - LLUI::getWindow()->setCursor(UI_CURSOR_HAND); + LLUI::getInstance()->getWindow()->setCursor(UI_CURSOR_HAND); return TRUE; } private: diff --git a/indra/newview/llexternaleditor.cpp b/indra/newview/llexternaleditor.cpp index 776bbf78c2..b66eb754a4 100644 --- a/indra/newview/llexternaleditor.cpp +++ b/indra/newview/llexternaleditor.cpp @@ -184,9 +184,9 @@ std::string LLExternalEditor::findCommand( cmd = override; LL_INFOS() << "Using override" << LL_ENDL; } - else if (!LLUI::sSettingGroups["config"]->getString(sSetting).empty()) + else if (!LLUI::getInstance()->mSettingGroups["config"]->getString(sSetting).empty()) { - cmd = LLUI::sSettingGroups["config"]->getString(sSetting); + cmd = LLUI::getInstance()->mSettingGroups["config"]->getString(sSetting); LL_INFOS() << "Using setting" << LL_ENDL; } else // otherwise use the path specified by the environment variable diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 912bde9986..1587903a15 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -228,12 +228,6 @@ void LLFace::destroy() mVObjp = NULL; } - -// static -void LLFace::initClass() -{ -} - void LLFace::setWorldMatrix(const LLMatrix4 &mat) { LL_ERRS() << "Faces on this drawable are not independently modifiable\n" << LL_ENDL; diff --git a/indra/newview/llface.h b/indra/newview/llface.h index a08e730e54..77861f7d2f 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -80,8 +80,6 @@ public: PARTICLE = 0x0080, }; - static void initClass(); - static void cacheFaceInVRAM(const LLVolumeFace& vf); public: diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp deleted file mode 100644 index 43b01fa2f1..0000000000 --- a/indra/newview/llfacebookconnect.cpp +++ /dev/null @@ -1,714 +0,0 @@ -/** - * @file llfacebookconnect.h - * @author Merov, Cho, Gil - * @brief Connection to Facebook Service - * - * $LicenseInfo:firstyear=2013&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2013, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llfacebookconnect.h" -#include "llflickrconnect.h" -#include "lltwitterconnect.h" - -#include "llagent.h" -#include "llcallingcard.h" // for LLAvatarTracker -#include "llcommandhandler.h" -#include "llnotificationsutil.h" -#include "llurlaction.h" -#include "llimagepng.h" -#include "llimagejpeg.h" -#include "lltrans.h" -#include "llevents.h" -#include "llviewerregion.h" -#include "llviewercontrol.h" - -#include "llfloaterwebcontent.h" -#include "llfloaterreg.h" -#include "llcorehttputil.h" - -boost::scoped_ptr<LLEventPump> LLFacebookConnect::sStateWatcher(new LLEventStream("FacebookConnectState")); -boost::scoped_ptr<LLEventPump> LLFacebookConnect::sInfoWatcher(new LLEventStream("FacebookConnectInfo")); -boost::scoped_ptr<LLEventPump> LLFacebookConnect::sContentWatcher(new LLEventStream("FacebookConnectContent")); - -// Local functions -void log_facebook_connect_error(const std::string& request, U32 status, const std::string& reason, const std::string& code, const std::string& description) -{ - // Note: 302 (redirect) is *not* an error that warrants logging - if (status != 302) - { - LL_WARNS("FacebookConnect") << request << " request failed with a " << status << " " << reason << ". Reason: " << code << " (" << description << ")" << LL_ENDL; - } -} - -void toast_user_for_facebook_success() -{ - LLSD args; - args["MESSAGE"] = LLTrans::getString("facebook_post_success"); - LLNotificationsUtil::add("FacebookConnect", args); -} - -LLCore::HttpHeaders::ptr_t get_headers() -{ - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); - // The DebugSlshareLogTag mechanism is intended to trigger slshare-service - // debug logging. slshare-service is coded to respond to an X-debug-tag - // header by engaging debug logging for that request only. This way a - // developer need not muck with the slshare-service image to engage debug - // logging. Moreover, the value of X-debug-tag is embedded in each such - // log line so the developer can quickly find the log lines pertinent to - // THIS session. - std::string logtag(gSavedSettings.getString("DebugSlshareLogTag")); - if (! logtag.empty()) - { - httpHeaders->append("X-debug-tag", logtag); - } - return httpHeaders; -} - -/////////////////////////////////////////////////////////////////////////////// -// -class LLFacebookConnectHandler : public LLCommandHandler -{ -public: - LLFacebookConnectHandler() : LLCommandHandler("fbc", UNTRUSTED_THROTTLE) { } - - bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) - { - if (tokens.size() >= 1) - { - if (tokens[0].asString() == "connect") - { - if (tokens.size() >= 2 && tokens[1].asString() == "flickr") - { - // this command probably came from the flickr_web browser, so close it - LLFloaterReg::hideInstance("flickr_web"); - - // connect to flickr - if (query_map.has("oauth_token")) - { - LLFlickrConnect::instance().connectToFlickr(query_map["oauth_token"], query_map.get("oauth_verifier")); - } - return true; - } - else if (tokens.size() >= 2 && tokens[1].asString() == "twitter") - { - // this command probably came from the twitter_web browser, so close it - LLFloaterReg::hideInstance("twitter_web"); - - // connect to twitter - if (query_map.has("oauth_token")) - { - LLTwitterConnect::instance().connectToTwitter(query_map["oauth_token"], query_map.get("oauth_verifier")); - } - return true; - } - else //if (tokens.size() >= 2 && tokens[1].asString() == "facebook") - { - // this command probably came from the fbc_web browser, so close it - LLFloaterReg::hideInstance("fbc_web"); - - // connect to facebook - if (query_map.has("code")) - { - LLFacebookConnect::instance().connectToFacebook(query_map["code"], query_map.get("state")); - } - return true; - } - } - } - return false; - } -}; -LLFacebookConnectHandler gFacebookConnectHandler; - -/////////////////////////////////////////////////////////////////////////////// -// -void LLFacebookConnect::facebookConnectCoro(std::string authCode, std::string authState) -{ - LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FacebookConnect", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - - LLSD putData; - if (!authCode.empty()) - { - putData["code"] = authCode; - } - if (!authState.empty()) - { - putData["state"] = authState; - } - - httpOpts->setWantHeaders(true); - httpOpts->setFollowRedirects(false); - - LLSD result = httpAdapter->putAndSuspend(httpRequest, getFacebookConnectURL("/connection"), putData, httpOpts, get_headers()); - - LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; - LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); - if (!status) - { - if (status == LLCore::HttpStatus(HTTP_FOUND)) - { - std::string location = httpResults[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_HEADERS][HTTP_IN_HEADER_LOCATION]; - if (location.empty()) - { - LL_WARNS("FacebookConnect") << "Missing Location header " << LL_ENDL; - } - else - { - openFacebookWeb(location); - } - } - } - else - { - LL_INFOS("FacebookConnect") << "Connect successful. " << LL_ENDL; - setConnectionState(LLFacebookConnect::FB_CONNECTED); - } - -} - -/////////////////////////////////////////////////////////////////////////////// -// -bool LLFacebookConnect::testShareStatus(LLSD &result) -{ - LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; - LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); - - if (status) - return true; - - if (status == LLCore::HttpStatus(HTTP_FOUND)) - { - std::string location = httpResults[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_HEADERS][HTTP_IN_HEADER_LOCATION]; - if (location.empty()) - { - LL_WARNS("FacebookConnect") << "Missing Location header " << LL_ENDL; - } - else - { - openFacebookWeb(location); - } - } - if (status == LLCore::HttpStatus(HTTP_NOT_FOUND)) - { - LL_DEBUGS("FacebookConnect") << "Not connected. " << LL_ENDL; - connectToFacebook(); - } - else - { - LL_WARNS("FacebookConnect") << "HTTP Status error " << status.toString() << LL_ENDL; - setConnectionState(LLFacebookConnect::FB_POST_FAILED); - log_facebook_connect_error("Share", status.getStatus(), status.toString(), - result.get("error_code"), result.get("error_description")); - } - return false; -} - -void LLFacebookConnect::facebookShareCoro(std::string route, LLSD share) -{ - LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FacebookConnect", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - - httpOpts->setWantHeaders(true); - httpOpts->setFollowRedirects(false); - - LLSD result = httpAdapter->postAndSuspend(httpRequest, getFacebookConnectURL(route, true), share, httpOpts, get_headers()); - - if (testShareStatus(result)) - { - toast_user_for_facebook_success(); - LL_DEBUGS("FacebookConnect") << "Post successful. " << LL_ENDL; - setConnectionState(LLFacebookConnect::FB_POSTED); - } -} - -void LLFacebookConnect::facebookShareImageCoro(std::string route, LLPointer<LLImageFormatted> image, std::string caption) -{ - LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FacebookConnect", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(get_headers()); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - - httpOpts->setWantHeaders(true); - httpOpts->setFollowRedirects(false); - - std::string imageFormat; - if (dynamic_cast<LLImagePNG*>(image.get())) - { - imageFormat = "png"; - } - else if (dynamic_cast<LLImageJPEG*>(image.get())) - { - imageFormat = "jpg"; - } - else - { - LL_WARNS() << "Image to upload is not a PNG or JPEG" << LL_ENDL; - return; - } - - // All this code is mostly copied from LLWebProfile::post() - static const std::string boundary = "----------------------------0123abcdefab"; - - std::string contentType = "multipart/form-data; boundary=" + boundary; - httpHeaders->append("Content-Type", contentType.c_str()); - - LLCore::BufferArray::ptr_t raw = LLCore::BufferArray::ptr_t(new LLCore::BufferArray()); // - LLCore::BufferArrayStream body(raw.get()); - - // *NOTE: The order seems to matter. - body << "--" << boundary << "\r\n" - << "Content-Disposition: form-data; name=\"caption\"\r\n\r\n" - << caption << "\r\n"; - - body << "--" << boundary << "\r\n" - << "Content-Disposition: form-data; name=\"image\"; filename=\"Untitled." << imageFormat << "\"\r\n" - << "Content-Type: image/" << imageFormat << "\r\n\r\n"; - - // Insert the image data. - // *FIX: Treating this as a string will probably screw it up ... - U8* image_data = image->getData(); - for (S32 i = 0; i < image->getDataSize(); ++i) - { - body << image_data[i]; - } - - body << "\r\n--" << boundary << "--\r\n"; - - setConnectionState(LLFacebookConnect::FB_POSTING); - - LLSD result = httpAdapter->postAndSuspend(httpRequest, getFacebookConnectURL(route, true), raw, httpOpts, httpHeaders); - - if (testShareStatus(result)) - { - toast_user_for_facebook_success(); - LL_DEBUGS("FacebookConnect") << "Post successful. " << LL_ENDL; - setConnectionState(LLFacebookConnect::FB_POSTED); - } -} - -/////////////////////////////////////////////////////////////////////////////// -// -void LLFacebookConnect::facebookDisconnectCoro() -{ - LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FacebookConnect", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - - httpOpts->setFollowRedirects(false); - - LLSD result = httpAdapter->deleteAndSuspend(httpRequest, getFacebookConnectURL("/connection"), httpOpts, get_headers()); - - LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; - LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); - if (!status && (status != LLCore::HttpStatus(HTTP_FOUND))) - { - LL_WARNS("FacebookConnect") << "Failed to disconnect:" << status.toTerseString() << LL_ENDL; - setConnectionState(LLFacebookConnect::FB_DISCONNECT_FAILED); - log_facebook_connect_error("Disconnect", status.getStatus(), status.toString(), - result.get("error_code"), result.get("error_description")); - } - else - { - LL_DEBUGS("FacebookConnect") << "Facebook Disconnect successful. " << LL_ENDL; - clearInfo(); - clearContent(); - //Notify state change - setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED); - } - -} - -/////////////////////////////////////////////////////////////////////////////// -// -void LLFacebookConnect::facebookConnectedCheckCoro(bool autoConnect) -{ - LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FacebookConnect", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - - setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS); - - httpOpts->setFollowRedirects(false); - - LLSD result = httpAdapter->getAndSuspend(httpRequest, getFacebookConnectURL("/connection", true), httpOpts, get_headers()); - - LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; - LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); - - if (!status) - { - if ( status == LLCore::HttpStatus(HTTP_NOT_FOUND) ) - { - LL_DEBUGS("FacebookConnect") << "Not connected. " << LL_ENDL; - if (autoConnect) - { - connectToFacebook(); - } - else - { - setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED); - } - } - else - { - LL_WARNS("FacebookConnect") << "Failed to test connection:" << status.toTerseString() << LL_ENDL; - - setConnectionState(LLFacebookConnect::FB_DISCONNECT_FAILED); - log_facebook_connect_error("Connected", status.getStatus(), status.toString(), - result.get("error_code"), result.get("error_description")); - } - } - else - { - LL_DEBUGS("FacebookConnect") << "Connect successful. " << LL_ENDL; - setConnectionState(LLFacebookConnect::FB_CONNECTED); - } -} - -/////////////////////////////////////////////////////////////////////////////// -// -void LLFacebookConnect::facebookConnectInfoCoro() -{ - LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FacebookConnect", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - - httpOpts->setWantHeaders(true); - httpOpts->setFollowRedirects(false); - - LLSD result = httpAdapter->getAndSuspend(httpRequest, getFacebookConnectURL("/info", true), httpOpts, get_headers()); - - LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; - LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); - - if (status == LLCore::HttpStatus(HTTP_FOUND)) - { - std::string location = httpResults[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_HEADERS][HTTP_IN_HEADER_LOCATION]; - if (location.empty()) - { - LL_WARNS("FacebookConnect") << "Missing Location header " << LL_ENDL; - } - else - { - openFacebookWeb(location); - } - } - else if (!status) - { - LL_WARNS("FacebookConnect") << "Facebook Info failed: " << status.toString() << LL_ENDL; - log_facebook_connect_error("Info", status.getStatus(), status.toString(), - result.get("error_code"), result.get("error_description")); - } - else - { - LL_INFOS("FacebookConnect") << "Facebook: Info received" << LL_ENDL; - result.erase(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS); - storeInfo(result); - } -} - -/////////////////////////////////////////////////////////////////////////////// -// -void LLFacebookConnect::facebookConnectFriendsCoro() -{ - LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FacebookConnect", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - - httpOpts->setFollowRedirects(false); - - LLSD result = httpAdapter->getAndSuspend(httpRequest, getFacebookConnectURL("/friends", true), httpOpts, get_headers()); - - LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; - LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); - - if (status == LLCore::HttpStatus(HTTP_FOUND)) - { - std::string location = httpResults[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_HEADERS][HTTP_IN_HEADER_LOCATION]; - if (location.empty()) - { - LL_WARNS("FacebookConnect") << "Missing Location header " << LL_ENDL; - } - else - { - openFacebookWeb(location); - } - } - else if (!status) - { - LL_WARNS("FacebookConnect") << "Facebook Friends failed: " << status.toString() << LL_ENDL; - log_facebook_connect_error("Info", status.getStatus(), status.toString(), - result.get("error_code"), result.get("error_description")); - } - else - { - LL_INFOS("FacebookConnect") << "Facebook: Friends received" << LL_ENDL; - result.erase(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS); - LLSD content = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_CONTENT]; - storeContent(content); - } -} - -/////////////////////////////////////////////////////////////////////////////// -// -LLFacebookConnect::LLFacebookConnect() -: mConnectionState(FB_NOT_CONNECTED), - mConnected(false), - mInfo(), - mContent(), - mRefreshInfo(false), - mRefreshContent(false), - mReadFromMaster(false) -{ -} - -void LLFacebookConnect::openFacebookWeb(std::string url) -{ - LLFloaterWebContent::Params p; - p.url(url); - p.show_chrome(true); - p.allow_back_forward_navigation(false); - p.clean_browser(true); - LLFloater *floater = LLFloaterReg::showInstance("fbc_web", p); - //the internal web browser has a bug that prevents it from gaining focus unless a mouse event occurs first (it seems). - //So when showing the internal web browser, set focus to it's containing floater "fbc_web". When a mouse event - //occurs on the "webbrowser" panel part of the floater, a mouse cursor will properly show and the "webbrowser" will gain focus. - //fbc_web floater contains the "webbrowser" panel. JIRA: ACME-744 - gFocusMgr.setKeyboardFocus( floater ); - - //LLUrlAction::openURLExternal(url); -} - -std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route, bool include_read_from_master) -{ - std::string url(""); - LLViewerRegion *regionp = gAgent.getRegion(); - if (regionp) - { - //url = "http://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY FOR TESTING - CHO - url = regionp->getCapability("FacebookConnect"); - url += route; - - if (include_read_from_master && mReadFromMaster) - { - url += "?read_from_master=true"; - } - } - return url; -} - -void LLFacebookConnect::connectToFacebook(const std::string& auth_code, const std::string& auth_state) -{ - setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS); - - LLCoros::instance().launch("LLFacebookConnect::facebookConnectCoro", - boost::bind(&LLFacebookConnect::facebookConnectCoro, this, auth_code, auth_state)); -} - -void LLFacebookConnect::disconnectFromFacebook() -{ - LLCoros::instance().launch("LLFacebookConnect::facebookDisconnectCoro", - boost::bind(&LLFacebookConnect::facebookDisconnectCoro, this)); -} - -void LLFacebookConnect::checkConnectionToFacebook(bool auto_connect) -{ - setConnectionState(LLFacebookConnect::FB_DISCONNECTING); - - LLCoros::instance().launch("LLFacebookConnect::facebookConnectedCheckCoro", - boost::bind(&LLFacebookConnect::facebookConnectedCheckCoro, this, auto_connect)); -} - -void LLFacebookConnect::loadFacebookInfo() -{ - if(mRefreshInfo) - { - LLCoros::instance().launch("LLFacebookConnect::facebookConnectInfoCoro", - boost::bind(&LLFacebookConnect::facebookConnectInfoCoro, this)); - } -} - -void LLFacebookConnect::loadFacebookFriends() -{ - if(mRefreshContent) - { - LLCoros::instance().launch("LLFacebookConnect::facebookConnectFriendsCoro", - boost::bind(&LLFacebookConnect::facebookConnectFriendsCoro, this)); - } -} - -void LLFacebookConnect::postCheckin(const std::string& location, const std::string& name, - const std::string& description, const std::string& image, const std::string& message) -{ - setConnectionState(LLFacebookConnect::FB_POSTING); - - LLSD body; - if (!location.empty()) - { - body["location"] = location; - } - if (!name.empty()) - { - body["name"] = name; - } - if (!description.empty()) - { - body["description"] = description; - } - if (!image.empty()) - { - body["image"] = image; - } - if (!message.empty()) - { - body["message"] = message; - } - - LLCoros::instance().launch("LLFacebookConnect::facebookShareCoro", - boost::bind(&LLFacebookConnect::facebookShareCoro, this, "/share/checkin", body)); -} - -void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::string& caption) -{ - setConnectionState(LLFacebookConnect::FB_POSTING); - - LLSD body; - body["image"] = image_url; - body["caption"] = caption; - - LLCoros::instance().launch("LLFacebookConnect::facebookShareCoro", - boost::bind(&LLFacebookConnect::facebookShareCoro, this, "/share/photo", body)); -} - -void LLFacebookConnect::sharePhoto(LLPointer<LLImageFormatted> image, const std::string& caption) -{ - setConnectionState(LLFacebookConnect::FB_POSTING); - - LLCoros::instance().launch("LLFacebookConnect::facebookShareImageCoro", - boost::bind(&LLFacebookConnect::facebookShareImageCoro, this, "/share/photo", image, caption)); -} - -void LLFacebookConnect::updateStatus(const std::string& message) -{ - LLSD body; - body["message"] = message; - - setConnectionState(LLFacebookConnect::FB_POSTING); - - LLCoros::instance().launch("LLFacebookConnect::facebookShareCoro", - boost::bind(&LLFacebookConnect::facebookShareCoro, this, "/share/wall", body)); -} - -void LLFacebookConnect::storeInfo(const LLSD& info) -{ - mInfo = info; - mRefreshInfo = false; - - sInfoWatcher->post(info); -} - -const LLSD& LLFacebookConnect::getInfo() const -{ - return mInfo; -} - -void LLFacebookConnect::clearInfo() -{ - mInfo = LLSD(); -} - -void LLFacebookConnect::storeContent(const LLSD& content) -{ - mContent = content; - mRefreshContent = false; - - sContentWatcher->post(content); -} - -const LLSD& LLFacebookConnect::getContent() const -{ - return mContent; -} - -void LLFacebookConnect::clearContent() -{ - mContent = LLSD(); -} - -void LLFacebookConnect::setDataDirty() -{ - mRefreshInfo = true; - mRefreshContent = true; -} - -void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState connection_state) -{ - if(connection_state == FB_CONNECTED) - { - mReadFromMaster = true; - setConnected(true); - setDataDirty(); - } - else if(connection_state == FB_NOT_CONNECTED) - { - setConnected(false); - } - else if(connection_state == FB_POSTED) - { - mReadFromMaster = false; - } - - if (mConnectionState != connection_state) - { - // set the connection state before notifying watchers - mConnectionState = connection_state; - - LLSD state_info; - state_info["enum"] = connection_state; - sStateWatcher->post(state_info); - } -} - -void LLFacebookConnect::setConnected(bool connected) -{ - mConnected = connected; -} diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h deleted file mode 100644 index 7fd4070f54..0000000000 --- a/indra/newview/llfacebookconnect.h +++ /dev/null @@ -1,116 +0,0 @@ -/** - * @file llfacebookconnect.h - * @author Merov, Cho, Gil - * @brief Connection to Facebook Service - * - * $LicenseInfo:firstyear=2013&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2013, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLFACEBOOKCONNECT_H -#define LL_LLFACEBOOKCONNECT_H - -#include "llsingleton.h" -#include "llimage.h" -#include "llcoros.h" -#include "lleventcoro.h" - -class LLEventPump; - -/** - * @class LLFacebookConnect - * - * Manages authentication to, and interaction with, a web service allowing the - * the viewer to get Facebook OpenGraph data. - */ -class LLFacebookConnect : public LLSingleton<LLFacebookConnect> -{ - LLSINGLETON(LLFacebookConnect); - ~LLFacebookConnect() {}; - LOG_CLASS(LLFacebookConnect); -public: - enum EConnectionState - { - FB_NOT_CONNECTED = 0, - FB_CONNECTION_IN_PROGRESS = 1, - FB_CONNECTED = 2, - FB_CONNECTION_FAILED = 3, - FB_POSTING = 4, - FB_POSTED = 5, - FB_POST_FAILED = 6, - FB_DISCONNECTING = 7, - FB_DISCONNECT_FAILED = 8 - }; - - void connectToFacebook(const std::string& auth_code = "", const std::string& auth_state = ""); // Initiate the complete FB connection. Please use checkConnectionToFacebook() in normal use. - void disconnectFromFacebook(); // Disconnect from the FBC service. - void checkConnectionToFacebook(bool auto_connect = false); // Check if an access token is available on the FBC service. If not, call connectToFacebook(). - - void loadFacebookInfo(); - void loadFacebookFriends(); - void postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message); - void sharePhoto(const std::string& image_url, const std::string& caption); - void sharePhoto(LLPointer<LLImageFormatted> image, const std::string& caption); - void updateStatus(const std::string& message); - - void storeInfo(const LLSD& info); - const LLSD& getInfo() const; - void clearInfo(); - void storeContent(const LLSD& content); - const LLSD& getContent() const; - void clearContent(); - void setDataDirty(); - - void setConnectionState(EConnectionState connection_state); - void setConnected(bool connected); - bool isConnected() { return mConnected; } - bool isTransactionOngoing() { return ((mConnectionState == FB_CONNECTION_IN_PROGRESS) || (mConnectionState == FB_POSTING) || (mConnectionState == FB_DISCONNECTING)); } - EConnectionState getConnectionState() { return mConnectionState; } - - void openFacebookWeb(std::string url); - -private: - - std::string getFacebookConnectURL(const std::string& route = "", bool include_read_from_master = false); - - EConnectionState mConnectionState; - BOOL mConnected; - LLSD mInfo; - LLSD mContent; - bool mRefreshInfo; - bool mRefreshContent; - bool mReadFromMaster; - - static boost::scoped_ptr<LLEventPump> sStateWatcher; - static boost::scoped_ptr<LLEventPump> sInfoWatcher; - static boost::scoped_ptr<LLEventPump> sContentWatcher; - - bool testShareStatus(LLSD &results); - void facebookConnectCoro(std::string authCode, std::string authState); - void facebookConnectedCheckCoro(bool autoConnect); - void facebookDisconnectCoro(); - void facebookShareCoro(std::string route, LLSD share); - void facebookShareImageCoro(std::string route, LLPointer<LLImageFormatted> image, std::string caption); - void facebookConnectInfoCoro(); - void facebookConnectFriendsCoro(); -}; - -#endif // LL_LLFACEBOOKCONNECT_H diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index f68e63cb96..d90f03b403 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -43,6 +43,7 @@ #include "llsdserialize.h" #include "lltooltip.h" #include "llbutton.h" +#include "llscrollbar.h" #include "llappviewer.h" #include "llviewertexturelist.h" @@ -128,7 +129,8 @@ void LLFastTimerView::setPauseState(bool pause_state) BOOL LLFastTimerView::postBuild() { LLButton& pause_btn = getChildRef<LLButton>("pause_btn"); - + mScrollBar = getChild<LLScrollbar>("scroll_vert"); + pause_btn.setCommitCallback(boost::bind(&LLFastTimerView::onPause, this)); return TRUE; } @@ -183,7 +185,7 @@ BOOL LLFastTimerView::handleDoubleClick(S32 x, S32 y, MASK mask) BOOL LLFastTimerView::handleMouseDown(S32 x, S32 y, MASK mask) { - if (x < mBarRect.mLeft) + if (x < mScrollBar->getRect().mLeft) { BlockTimerStatHandle* idp = getLegendID(y); if (idp) @@ -284,7 +286,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) } } } - else if (x < mBarRect.mLeft) + else if (x < mScrollBar->getRect().mLeft) { BlockTimerStatHandle* timer_id = getLegendID(y); if (timer_id) @@ -335,7 +337,7 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask) else { // tooltips for timer legend - if (x < mBarRect.mLeft) + if (x < mScrollBar->getRect().mLeft) { BlockTimerStatHandle* idp = getLegendID(y); if (idp) @@ -352,11 +354,19 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask) BOOL LLFastTimerView::handleScrollWheel(S32 x, S32 y, S32 clicks) { - setPauseState(true); - mScrollIndex = llclamp( mScrollIndex + clicks, - 0, - llmin((S32)mRecording.getNumRecordedPeriods(), (S32)mRecording.getNumRecordedPeriods() - MAX_VISIBLE_HISTORY)); - return TRUE; + if (x < mBarRect.mLeft) + { + // Inside mScrollBar and list of timers + mScrollBar->handleScrollWheel(x,y,clicks); + } + else + { + setPauseState(true); + mScrollIndex = llclamp(mScrollIndex + clicks, + 0, + llmin((S32)mRecording.getNumRecordedPeriods(), (S32)mRecording.getNumRecordedPeriods() - MAX_VISIBLE_HISTORY)); + } + return TRUE; } static BlockTimerStatHandle FTM_RENDER_TIMER("Timers"); @@ -1197,6 +1207,7 @@ void LLFastTimerView::drawLegend() { LLLocalClipRect clip(mLegendRect); S32 cur_line = 0; + S32 scroll_offset = 0; // element's y offset from top of the inner scroll's rect ft_display_idx.clear(); std::map<BlockTimerStatHandle*, S32> display_line; for (block_timer_tree_df_iterator_t it = LLTrace::begin_block_timer_tree_df(FTM_FRAME); @@ -1204,10 +1215,24 @@ void LLFastTimerView::drawLegend() ++it) { BlockTimerStatHandle* idp = (*it); + // Needed to figure out offsets and parenting display_line[idp] = cur_line; - ft_display_idx.push_back(idp); cur_line++; + if (scroll_offset < mScrollBar->getDocPos()) + { + // only offset for visible items + scroll_offset += TEXT_HEIGHT + 2; + if (idp->getTreeNode().mCollapsed) + { + it.skipDescendants(); + } + continue; + } + + // used for mouse clicks + ft_display_idx.push_back(idp); + // Actual draw, first bar (square), then text x = MARGIN; LLRect bar_rect(x, y, x + TEXT_HEIGHT, y - TEXT_HEIGHT); @@ -1281,11 +1306,14 @@ void LLFastTimerView::drawLegend() y -= (TEXT_HEIGHT + 2); + scroll_offset += TEXT_HEIGHT + 2; if (idp->getTreeNode().mCollapsed) { it.skipDescendants(); } } + // Recalculate scroll size + mScrollBar->setDocSize(scroll_offset - mLegendRect.getHeight()); } } diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index 3e30bd86ba..ff65f8da07 100644 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -33,6 +33,8 @@ #include "lltracerecording.h" #include <deque> +class LLScrollbar; + class LLFastTimerView : public LLFloater { public: @@ -142,6 +144,8 @@ private: mLegendRect; LLFrameTimer mHighlightTimer; LLTrace::PeriodicRecording mRecording; + + LLScrollbar* mScrollBar; }; #endif diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 8d07035b97..aa9cba0c18 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -522,7 +522,7 @@ void LLFeatureManager::cleanupFeatureTables() mMaskList.clear(); } -void LLFeatureManager::init() +void LLFeatureManager::initSingleton() { // load the tables loadFeatureTables(); diff --git a/indra/newview/llfeaturemanager.h b/indra/newview/llfeaturemanager.h index f77861a1a7..42a226cd18 100644 --- a/indra/newview/llfeaturemanager.h +++ b/indra/newview/llfeaturemanager.h @@ -100,9 +100,10 @@ class LLFeatureManager : public LLFeatureList, public LLSingleton<LLFeatureManag LLSINGLETON(LLFeatureManager); ~LLFeatureManager() {cleanupFeatureTables();} -public: // initialize this by loading feature table and gpu table - void init(); + void initSingleton(); + +public: void maskCurrentList(const std::string& name); // Mask the current feature list with the named list diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index 2e1afc68b4..1ce9fe3a7a 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -41,37 +41,6 @@ // static -std::set<std::string> LLFirstUse::sConfigVariables; - -// static -void LLFirstUse::addConfigVariable(const std::string& var) -{ - sConfigVariables.insert(var); -} - -// static -void LLFirstUse::disableFirstUse() -{ - // Set all first-use warnings to disabled - for (std::set<std::string>::iterator iter = sConfigVariables.begin(); - iter != sConfigVariables.end(); ++iter) - { - gWarningSettings.setBOOL(*iter, FALSE); - } -} - -// static -void LLFirstUse::resetFirstUse() -{ - // Set all first-use warnings to disabled - for (std::set<std::string>::iterator iter = sConfigVariables.begin(); - iter != sConfigVariables.end(); ++iter) - { - gWarningSettings.setBOOL(*iter, TRUE); - } -} - -// static void LLFirstUse::otherAvatarChatFirst(bool enable) { firstUseNotification("FirstOtherChatBeforeUser", enable, "HintChat", LLSD(), LLSD().with("target", "nearby_chat").with("direction", "top_right").with("distance", 24)); diff --git a/indra/newview/llfirstuse.h b/indra/newview/llfirstuse.h index 4c8c9d3cde..80b83580b3 100644 --- a/indra/newview/llfirstuse.h +++ b/indra/newview/llfirstuse.h @@ -78,14 +78,6 @@ class LLNotification; class LLFirstUse { public: - - // Add a config variable to be reset on resetFirstUse() - static void addConfigVariable(const std::string& var); - - // Sets all controls back to show the dialogs. - static void disableFirstUse(); - static void resetFirstUse(); - static void otherAvatarChatFirst(bool enable = true); static void speak(bool enable = true); static void sit(bool enable = true); @@ -100,7 +92,6 @@ public: protected: static void firstUseNotification(const std::string& control_var, bool enable, const std::string& notification_name, LLSD args = LLSD(), LLSD payload = LLSD()); - static std::set<std::string> sConfigVariables; static void init(); static bool processNotification(const LLSD& notify); diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp index 080d0ed8ea..ee7e6f8562 100644 --- a/indra/newview/llfloaterbvhpreview.cpp +++ b/indra/newview/llfloaterbvhpreview.cpp @@ -527,7 +527,7 @@ BOOL LLFloaterBvhPreview::handleHover(S32 x, S32 y, MASK mask) mAnimPreview->requestUpdate(); - LLUI::setMousePositionLocal(this, mLastMouseX, mLastMouseY); + LLUI::getInstance()->setMousePositionLocal(this, mLastMouseX, mLastMouseY); } if (!mPreviewRect.pointInRect(x, y) || !mAnimPreview) diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index 20d650fa37..f3406d93bb 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -351,7 +351,7 @@ LLFloaterCamera::LLFloaterCamera(const LLSD& val) mCurrMode(CAMERA_CTRL_MODE_PAN), mPrevMode(CAMERA_CTRL_MODE_PAN) { - LLHints::registerHintTarget("view_popup", getHandle()); + LLHints::getInstance()->registerHintTarget("view_popup", getHandle()); mCommitCallbackRegistrar.add("CameraPresets.ChangeView", boost::bind(&LLFloaterCamera::onClickCameraItem, _2)); } diff --git a/indra/newview/llfloaterchatvoicevolume.cpp b/indra/newview/llfloaterchatvoicevolume.cpp index 3c76a3a43c..45aea00a49 100644 --- a/indra/newview/llfloaterchatvoicevolume.cpp +++ b/indra/newview/llfloaterchatvoicevolume.cpp @@ -35,7 +35,7 @@ LLFloaterChatVoiceVolume::LLFloaterChatVoiceVolume(const LLSD& key) void LLFloaterChatVoiceVolume::onOpen(const LLSD& key) { LLInspect::onOpen(key); - LLUI::positionViewNearMouse(this); + LLUI::getInstance()->positionViewNearMouse(this); } LLFloaterChatVoiceVolume::~LLFloaterChatVoiceVolume() diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index 66198b3bf6..55561fa128 100644 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -111,7 +111,7 @@ void LLFloaterConversationPreview::setPages(std::list<LLSD>* messages, const std getChild<LLTextBox>("page_num_label")->setValue(total_page_num); mShowHistory = true; } - LLLoadHistoryThread* loadThread = LLLogChat::getLoadHistoryThread(mSessionID); + LLLoadHistoryThread* loadThread = LLLogChat::getInstance()->getLoadHistoryThread(mSessionID); if (loadThread) { loadThread->removeLoadEndSignal(boost::bind(&LLFloaterConversationPreview::setPages, this, _1, _2)); @@ -135,7 +135,7 @@ void LLFloaterConversationPreview::onOpen(const LLSD& key) return; } mOpened = true; - if (!LLLogChat::historyThreadsFinished(mSessionID)) + if (!LLLogChat::getInstance()->historyThreadsFinished(mSessionID)) { LLNotificationsUtil::add("ChatHistoryIsBusyAlert"); mHistoryThreadsBusy = true; @@ -165,15 +165,16 @@ void LLFloaterConversationPreview::onOpen(const LLSD& key) // LLDeleteHistoryThread is started in destructor std::list<LLSD>* messages = new std::list<LLSD>(); - LLLogChat::cleanupHistoryThreads(); + LLLogChat *log_chat_inst = LLLogChat::getInstance(); + log_chat_inst->cleanupHistoryThreads(); LLLoadHistoryThread* loadThread = new LLLoadHistoryThread(mChatHistoryFileName, messages, load_params); loadThread->setLoadEndSignal(boost::bind(&LLFloaterConversationPreview::setPages, this, _1, _2)); loadThread->start(); - LLLogChat::addLoadHistoryThread(mSessionID, loadThread); + log_chat_inst->addLoadHistoryThread(mSessionID, loadThread); LLDeleteHistoryThread* deleteThread = new LLDeleteHistoryThread(messages, loadThread); - LLLogChat::addDeleteHistoryThread(mSessionID, deleteThread); + log_chat_inst->addDeleteHistoryThread(mSessionID, deleteThread); mShowHistory = true; } @@ -183,7 +184,7 @@ void LLFloaterConversationPreview::onClose(bool app_quitting) mOpened = false; if (!mHistoryThreadsBusy) { - LLDeleteHistoryThread* deleteThread = LLLogChat::getDeleteHistoryThread(mSessionID); + LLDeleteHistoryThread* deleteThread = LLLogChat::getInstance()->getDeleteHistoryThread(mSessionID); if (deleteThread) { deleteThread->start(); @@ -221,7 +222,7 @@ void LLFloaterConversationPreview::showHistory() else { std::string legacy_name = gCacheName->buildLegacyName(from); - from_id = LLAvatarNameCache::findIdByName(legacy_name); + from_id = LLAvatarNameCache::getInstance()->findIdByName(legacy_name); } LLChat chat; diff --git a/indra/newview/llfloaterfacebook.cpp b/indra/newview/llfloaterfacebook.cpp deleted file mode 100644 index e84cbc289f..0000000000 --- a/indra/newview/llfloaterfacebook.cpp +++ /dev/null @@ -1,1132 +0,0 @@ -/** -* @file llfloaterfacebook.cpp -* @brief Implementation of llfloaterfacebook -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ - -#include "llviewerprecompiledheaders.h" - -#include "llfloaterfacebook.h" - -#include "llagent.h" -#include "llagentui.h" -#include "llcheckboxctrl.h" -#include "llcombobox.h" -#include "llfacebookconnect.h" -#include "llfloaterbigpreview.h" -#include "llfloaterreg.h" -#include "lliconctrl.h" -#include "llimagefiltersmanager.h" -#include "llresmgr.h" // LLLocale -#include "llsdserialize.h" -#include "llloadingindicator.h" -#include "llslurl.h" -#include "lltrans.h" -#include "llsnapshotlivepreview.h" -#include "llviewerregion.h" -#include "llviewercontrol.h" -#include "llviewermedia.h" -#include "lltabcontainer.h" -#include "llavatarlist.h" -#include "llpanelpeoplemenus.h" -#include "llaccordionctrl.h" -#include "llaccordionctrltab.h" - -static LLPanelInjector<LLFacebookStatusPanel> t_panel_status("llfacebookstatuspanel"); -static LLPanelInjector<LLFacebookPhotoPanel> t_panel_photo("llfacebookphotopanel"); -static LLPanelInjector<LLFacebookCheckinPanel> t_panel_checkin("llfacebookcheckinpanel"); -static LLPanelInjector<LLFacebookFriendsPanel> t_panel_friends("llfacebookfriendspanel"); - -const std::string DEFAULT_CHECKIN_LOCATION_URL = "http://maps.secondlife.com/"; -const std::string DEFAULT_CHECKIN_ICON_URL = "http://map.secondlife.com.s3.amazonaws.com/map_placeholder.png"; -const std::string DEFAULT_CHECKIN_QUERY_PARAMETERS = "?sourceid=slshare_checkin&utm_source=facebook&utm_medium=checkin&utm_campaign=slshare"; -const std::string DEFAULT_PHOTO_QUERY_PARAMETERS = "?sourceid=slshare_photo&utm_source=facebook&utm_medium=photo&utm_campaign=slshare"; - -const S32 MAX_QUALITY = 100; // Max quality value for jpeg images -const S32 MIN_QUALITY = 0; // Min quality value for jpeg images -const S32 TARGET_DATA_SIZE = 950000; // Size of the image (compressed) we're trying to send to Facebook - -std::string get_map_url() -{ - LLVector3d center_agent; - LLViewerRegion *regionp = gAgent.getRegion(); - if (regionp) - { - center_agent = regionp->getCenterGlobal(); - } - int x_pos = center_agent[0] / 256.0; - int y_pos = center_agent[1] / 256.0; - std::string map_url = gSavedSettings.getString("CurrentMapServerURL") + llformat("map-1-%d-%d-objects.jpg", x_pos, y_pos); - return map_url; -} - -// Compute target jpeg quality : see https://wiki.lindenlab.com/wiki/Facebook_Image_Quality for details -S32 compute_jpeg_quality(S32 width, S32 height) -{ - F32 target_compression_ratio = (F32)(width * height * 3) / (F32)(TARGET_DATA_SIZE); - S32 quality = (S32)(110.0f - (2.0f * target_compression_ratio)); - return llclamp(quality, MIN_QUALITY, MAX_QUALITY); -} - -/////////////////////////// -//LLFacebookStatusPanel////// -/////////////////////////// - -LLFacebookStatusPanel::LLFacebookStatusPanel() : - mMessageTextEditor(NULL), - mPostButton(NULL), - mCancelButton(NULL), - mAccountCaptionLabel(NULL), - mAccountNameLabel(NULL), - mPanelButtons(NULL), - mConnectButton(NULL), - mDisconnectButton(NULL) -{ - mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLFacebookStatusPanel::onConnect, this)); - mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLFacebookStatusPanel::onDisconnect, this)); - - setVisibleCallback(boost::bind(&LLFacebookStatusPanel::onVisibilityChange, this, _2)); - - mCommitCallbackRegistrar.add("SocialSharing.SendStatus", boost::bind(&LLFacebookStatusPanel::onSend, this)); -} - -BOOL LLFacebookStatusPanel::postBuild() -{ - mAccountCaptionLabel = getChild<LLTextBox>("account_caption_label"); - mAccountNameLabel = getChild<LLTextBox>("account_name_label"); - mPanelButtons = getChild<LLUICtrl>("panel_buttons"); - mConnectButton = getChild<LLUICtrl>("connect_btn"); - mDisconnectButton = getChild<LLUICtrl>("disconnect_btn"); - - mMessageTextEditor = getChild<LLUICtrl>("status_message"); - mPostButton = getChild<LLUICtrl>("post_status_btn"); - mCancelButton = getChild<LLUICtrl>("cancel_status_btn"); - - return LLPanel::postBuild(); -} - -void LLFacebookStatusPanel::draw() -{ - LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState(); - - //Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress - bool disconnecting = connection_state == LLFacebookConnect::FB_DISCONNECTING; - mDisconnectButton->setEnabled(!disconnecting); - - //Disable the 'connect' button when a connection is in progress - bool connecting = connection_state == LLFacebookConnect::FB_CONNECTION_IN_PROGRESS; - mConnectButton->setEnabled(!connecting); - - if (mMessageTextEditor && mPostButton && mCancelButton) - { - bool no_ongoing_connection = !(LLFacebookConnect::instance().isTransactionOngoing()); - std::string message = mMessageTextEditor->getValue().asString(); - mMessageTextEditor->setEnabled(no_ongoing_connection); - mCancelButton->setEnabled(no_ongoing_connection); - mPostButton->setEnabled(no_ongoing_connection && !message.empty()); - } - - LLPanel::draw(); -} - -void LLFacebookStatusPanel::onSend() -{ - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookStatusPanel"); // just in case it is already listening - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookStatusPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectStateChange, this, _1)); - - // Connect to Facebook if necessary and then post - if (LLFacebookConnect::instance().isConnected()) - { - sendStatus(); - } - else - { - LLFacebookConnect::instance().checkConnectionToFacebook(true); - } -} - -bool LLFacebookStatusPanel::onFacebookConnectStateChange(const LLSD& data) -{ - switch (data.get("enum").asInteger()) - { - case LLFacebookConnect::FB_CONNECTED: - sendStatus(); - break; - - case LLFacebookConnect::FB_POSTED: - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookStatusPanel"); - clearAndClose(); - break; - } - - return false; -} - -bool LLFacebookStatusPanel::onFacebookConnectAccountStateChange(const LLSD& data) -{ - if (LLFacebookConnect::instance().isConnected()) - { - //In process of disconnecting so leave the layout as is - if (data.get("enum").asInteger() != LLFacebookConnect::FB_DISCONNECTING) - { - showConnectedLayout(); - } - } - else - { - showDisconnectedLayout(); - } - - return false; -} - -void LLFacebookStatusPanel::sendStatus() -{ - std::string message = mMessageTextEditor->getValue().asString(); - if (!message.empty()) - { - LLFacebookConnect::instance().updateStatus(message); - } -} - -void LLFacebookStatusPanel::onVisibilityChange(BOOL visible) -{ - if (visible) - { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectAccountStateChange, this, _1)); - - LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); - LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectInfoChange, this)); - - //Connected - if (LLFacebookConnect::instance().isConnected()) - { - showConnectedLayout(); - } - //Check if connected (show disconnected layout in meantime) - else - { - showDisconnectedLayout(); - } - if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) || - (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED)) - { - LLFacebookConnect::instance().checkConnectionToFacebook(); - } - } - else - { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); - LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); - } -} - -bool LLFacebookStatusPanel::onFacebookConnectInfoChange() -{ - LLSD info = LLFacebookConnect::instance().getInfo(); - std::string clickable_name; - - //Strings of format [http://www.somewebsite.com Click Me] become clickable text - if (info.has("link") && info.has("name")) - { - clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]"; - } - - mAccountNameLabel->setText(clickable_name); - - return false; -} - -void LLFacebookStatusPanel::showConnectButton() -{ - if (!mConnectButton->getVisible()) - { - mConnectButton->setVisible(TRUE); - mDisconnectButton->setVisible(FALSE); - } -} - -void LLFacebookStatusPanel::hideConnectButton() -{ - if (mConnectButton->getVisible()) - { - mConnectButton->setVisible(FALSE); - mDisconnectButton->setVisible(TRUE); - } -} - -void LLFacebookStatusPanel::showDisconnectedLayout() -{ - mAccountCaptionLabel->setText(getString("facebook_disconnected")); - mAccountNameLabel->setText(std::string("")); - showConnectButton(); -} - -void LLFacebookStatusPanel::showConnectedLayout() -{ - LLFacebookConnect::instance().loadFacebookInfo(); - - mAccountCaptionLabel->setText(getString("facebook_connected")); - hideConnectButton(); -} - -void LLFacebookStatusPanel::onConnect() -{ - LLFacebookConnect::instance().checkConnectionToFacebook(true); -} - -void LLFacebookStatusPanel::onDisconnect() -{ - LLFacebookConnect::instance().disconnectFromFacebook(); -} - -void LLFacebookStatusPanel::clearAndClose() -{ - mMessageTextEditor->setValue(""); - - LLFloater* floater = getParentByType<LLFloater>(); - if (floater) - { - floater->closeFloater(); - } -} - -/////////////////////////// -//LLFacebookPhotoPanel/////// -/////////////////////////// - -LLFacebookPhotoPanel::LLFacebookPhotoPanel() : - mResolutionComboBox(NULL), - mRefreshBtn(NULL), - mBtnPreview(NULL), - mWorkingLabel(NULL), - mThumbnailPlaceholder(NULL), - mCaptionTextBox(NULL), - mPostButton(NULL), - mBigPreviewFloater(NULL), - mQuality(MAX_QUALITY) -{ - mCommitCallbackRegistrar.add("SocialSharing.SendPhoto", boost::bind(&LLFacebookPhotoPanel::onSend, this)); - mCommitCallbackRegistrar.add("SocialSharing.RefreshPhoto", boost::bind(&LLFacebookPhotoPanel::onClickNewSnapshot, this)); - mCommitCallbackRegistrar.add("SocialSharing.BigPreview", boost::bind(&LLFacebookPhotoPanel::onClickBigPreview, this)); -} - -LLFacebookPhotoPanel::~LLFacebookPhotoPanel() -{ - if (mPreviewHandle.get()) - { - mPreviewHandle.get()->die(); - } -} - -BOOL LLFacebookPhotoPanel::postBuild() -{ - setVisibleCallback(boost::bind(&LLFacebookPhotoPanel::onVisibilityChange, this, _2)); - - mResolutionComboBox = getChild<LLUICtrl>("resolution_combobox"); - mResolutionComboBox->setValue("[i1200,i630]"); // hardcoded defaults ftw! - mResolutionComboBox->setCommitCallback(boost::bind(&LLFacebookPhotoPanel::updateResolution, this, TRUE)); - mFilterComboBox = getChild<LLUICtrl>("filters_combobox"); - mFilterComboBox->setCommitCallback(boost::bind(&LLFacebookPhotoPanel::updateResolution, this, TRUE)); - mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn"); - mBtnPreview = getChild<LLButton>("big_preview_btn"); - mWorkingLabel = getChild<LLUICtrl>("working_lbl"); - mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder"); - mCaptionTextBox = getChild<LLUICtrl>("photo_caption"); - mPostButton = getChild<LLUICtrl>("post_photo_btn"); - mCancelButton = getChild<LLUICtrl>("cancel_photo_btn"); - mBigPreviewFloater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview")); - - // Update filter list - std::vector<std::string> filter_list = LLImageFiltersManager::getInstance()->getFiltersList(); - LLComboBox* filterbox = static_cast<LLComboBox *>(mFilterComboBox); - for (U32 i = 0; i < filter_list.size(); i++) - { - filterbox->add(filter_list[i]); - } - - return LLPanel::postBuild(); -} - -// virtual -S32 LLFacebookPhotoPanel::notify(const LLSD& info) -{ - if (info.has("snapshot-updating")) - { - // Disable the Post button and whatever else while the snapshot is not updated - // updateControls(); - return 1; - } - - if (info.has("snapshot-updated")) - { - // Enable the send/post/save buttons. - updateControls(); - - // The refresh button is initially hidden. We show it after the first update, - // i.e. after snapshot is taken - LLUICtrl * refresh_button = getRefreshBtn(); - if (!refresh_button->getVisible()) - { - refresh_button->setVisible(true); - } - return 1; - } - - return 0; -} - -void LLFacebookPhotoPanel::draw() -{ - LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get()); - - // Enable interaction only if no transaction with the service is on-going (prevent duplicated posts) - bool no_ongoing_connection = !(LLFacebookConnect::instance().isTransactionOngoing()); - mCancelButton->setEnabled(no_ongoing_connection); - mCaptionTextBox->setEnabled(no_ongoing_connection); - mResolutionComboBox->setEnabled(no_ongoing_connection); - mFilterComboBox->setEnabled(no_ongoing_connection); - mRefreshBtn->setEnabled(no_ongoing_connection); - mBtnPreview->setEnabled(no_ongoing_connection); - - // Reassign the preview floater if we have the focus and the preview exists - if (hasFocus() && isPreviewVisible()) - { - attachPreview(); - } - - // Toggle the button state as appropriate - bool preview_active = (isPreviewVisible() && mBigPreviewFloater->isFloaterOwner(getParentByType<LLFloater>())); - mBtnPreview->setToggleState(preview_active); - - // Display the thumbnail if one is available - if (previewp && previewp->getThumbnailImage()) - { - const LLRect& thumbnail_rect = mThumbnailPlaceholder->getRect(); - const S32 thumbnail_w = previewp->getThumbnailWidth(); - const S32 thumbnail_h = previewp->getThumbnailHeight(); - - // calc preview offset within the preview rect - const S32 local_offset_x = (thumbnail_rect.getWidth() - thumbnail_w) / 2; - const S32 local_offset_y = (thumbnail_rect.getHeight() - thumbnail_h) / 2; - S32 offset_x = thumbnail_rect.mLeft + local_offset_x; - S32 offset_y = thumbnail_rect.mBottom + local_offset_y; - - gGL.matrixMode(LLRender::MM_MODELVIEW); - // Apply floater transparency to the texture unless the floater is focused. - F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency(); - LLColor4 color = LLColor4::white; - gl_draw_scaled_image(offset_x, offset_y, - thumbnail_w, thumbnail_h, - previewp->getThumbnailImage(), color % alpha); - } - - // Update the visibility of the working (computing preview) label - mWorkingLabel->setVisible(!(previewp && previewp->getSnapshotUpToDate())); - - // Enable Post if we have a preview to send and no on going connection being processed - mPostButton->setEnabled(no_ongoing_connection && (previewp && previewp->getSnapshotUpToDate())); - - // Draw the rest of the panel on top of it - LLPanel::draw(); -} - -LLSnapshotLivePreview* LLFacebookPhotoPanel::getPreviewView() -{ - LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)mPreviewHandle.get(); - return previewp; -} - -void LLFacebookPhotoPanel::onVisibilityChange(BOOL visible) -{ - if (visible) - { - if (mPreviewHandle.get()) - { - LLSnapshotLivePreview* preview = getPreviewView(); - if (preview) - { - LL_DEBUGS() << "opened, updating snapshot" << LL_ENDL; - preview->updateSnapshot(TRUE); - } - } - else - { - LLRect full_screen_rect = getRootView()->getRect(); - LLSnapshotLivePreview::Params p; - p.rect(full_screen_rect); - LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p); - mPreviewHandle = previewp->getHandle(); - mQuality = MAX_QUALITY; - - previewp->setContainer(this); - previewp->setSnapshotType(LLSnapshotModel::SNAPSHOT_WEB); - previewp->setSnapshotFormat(LLSnapshotModel::SNAPSHOT_FORMAT_JPEG); - previewp->setSnapshotQuality(mQuality, false); - previewp->setThumbnailSubsampled(TRUE); // We want the preview to reflect the *saved* image - previewp->setAllowRenderUI(FALSE); // We do not want the rendered UI in our snapshots - previewp->setAllowFullScreenPreview(FALSE); // No full screen preview in SL Share mode - previewp->setThumbnailPlaceholderRect(mThumbnailPlaceholder->getRect()); - - updateControls(); - } - } -} - -void LLFacebookPhotoPanel::onClickNewSnapshot() -{ - LLSnapshotLivePreview* previewp = getPreviewView(); - if (previewp) - { - previewp->updateSnapshot(TRUE); - } -} - -void LLFacebookPhotoPanel::onClickBigPreview() -{ - // Toggle the preview - if (isPreviewVisible()) - { - LLFloaterReg::hideInstance("big_preview"); - } - else - { - attachPreview(); - LLFloaterReg::showInstance("big_preview"); - } -} - -bool LLFacebookPhotoPanel::isPreviewVisible() -{ - return (mBigPreviewFloater && mBigPreviewFloater->getVisible()); -} - -void LLFacebookPhotoPanel::attachPreview() -{ - if (mBigPreviewFloater) - { - LLSnapshotLivePreview* previewp = getPreviewView(); - mBigPreviewFloater->setPreview(previewp); - mBigPreviewFloater->setFloaterOwner(getParentByType<LLFloater>()); - } -} - -void LLFacebookPhotoPanel::onSend() -{ - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookPhotoPanel"); // just in case it is already listening - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookPhotoPanel", boost::bind(&LLFacebookPhotoPanel::onFacebookConnectStateChange, this, _1)); - - // Connect to Facebook if necessary and then post - if (LLFacebookConnect::instance().isConnected()) - { - sendPhoto(); - } - else - { - LLFacebookConnect::instance().checkConnectionToFacebook(true); - } -} - -bool LLFacebookPhotoPanel::onFacebookConnectStateChange(const LLSD& data) -{ - switch (data.get("enum").asInteger()) - { - case LLFacebookConnect::FB_CONNECTED: - sendPhoto(); - break; - - case LLFacebookConnect::FB_POSTED: - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookPhotoPanel"); - clearAndClose(); - break; - } - - return false; -} - -void LLFacebookPhotoPanel::sendPhoto() -{ - // Get the caption - std::string caption = mCaptionTextBox->getValue().asString(); - - // Get the image - LLSnapshotLivePreview* previewp = getPreviewView(); - - // Post to Facebook - LLFacebookConnect::instance().sharePhoto(previewp->getFormattedImage(), caption); - - updateControls(); -} - -void LLFacebookPhotoPanel::clearAndClose() -{ - mCaptionTextBox->setValue(""); - - LLFloater* floater = getParentByType<LLFloater>(); - if (floater) - { - floater->closeFloater(); - if (mBigPreviewFloater) - { - mBigPreviewFloater->closeOnFloaterOwnerClosing(floater); - } - } -} - -void LLFacebookPhotoPanel::updateControls() -{ - LLSnapshotLivePreview* previewp = getPreviewView(); - BOOL got_snap = previewp && previewp->getSnapshotUpToDate(); - - // *TODO: Separate maximum size for Web images from postcards - LL_DEBUGS() << "Is snapshot up-to-date? " << got_snap << LL_ENDL; - - updateResolution(FALSE); -} - -void LLFacebookPhotoPanel::updateResolution(BOOL do_update) -{ - LLComboBox* combobox = static_cast<LLComboBox *>(mResolutionComboBox); - LLComboBox* filterbox = static_cast<LLComboBox *>(mFilterComboBox); - - std::string sdstring = combobox->getSelectedValue(); - LLSD sdres; - std::stringstream sstream(sdstring); - LLSDSerialize::fromNotation(sdres, sstream, sdstring.size()); - - S32 width = sdres[0]; - S32 height = sdres[1]; - - // Note : index 0 of the filter drop down is assumed to be "No filter" in whichever locale - std::string filter_name = (filterbox->getCurrentIndex() ? filterbox->getSimple() : ""); - - LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get()); - if (previewp && combobox->getCurrentIndex() >= 0) - { - S32 original_width = 0, original_height = 0; - previewp->getSize(original_width, original_height); - - if (width == 0 || height == 0) - { - // take resolution from current window size - LL_DEBUGS() << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << LL_ENDL; - previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); - } - else - { - // use the resolution from the selected pre-canned drop-down choice - LL_DEBUGS() << "Setting preview res selected from combo: " << width << "x" << height << LL_ENDL; - previewp->setSize(width, height); - } - - checkAspectRatio(width); - - previewp->getSize(width, height); - - // Recompute quality setting - mQuality = compute_jpeg_quality(width, height); - previewp->setSnapshotQuality(mQuality, false); - - if (original_width != width || original_height != height) - { - previewp->setSize(width, height); - if (do_update) - { - previewp->updateSnapshot(TRUE); - updateControls(); - } - } - // Get the old filter, compare to the current one "filter_name" and set if changed - std::string original_filter = previewp->getFilter(); - if (original_filter != filter_name) - { - previewp->setFilter(filter_name); - if (do_update) - { - previewp->updateSnapshot(FALSE, TRUE); - updateControls(); - } - } - } -} - -void LLFacebookPhotoPanel::checkAspectRatio(S32 index) -{ - LLSnapshotLivePreview *previewp = getPreviewView(); - - BOOL keep_aspect = FALSE; - - if (0 == index) // current window size - { - keep_aspect = TRUE; - } - else // predefined resolution - { - keep_aspect = FALSE; - } - - if (previewp) - { - previewp->mKeepAspectRatio = keep_aspect; - } -} - -LLUICtrl* LLFacebookPhotoPanel::getRefreshBtn() -{ - return mRefreshBtn; -} - -//////////////////////// -//LLFacebookCheckinPanel// -//////////////////////// - -LLFacebookCheckinPanel::LLFacebookCheckinPanel() : - mMapUrl(""), - mReloadingMapTexture(false) -{ - mCommitCallbackRegistrar.add("SocialSharing.SendCheckin", boost::bind(&LLFacebookCheckinPanel::onSend, this)); -} - -BOOL LLFacebookCheckinPanel::postBuild() -{ - // Keep pointers to widgets so we don't traverse the UI hierarchy too often - mPostButton = getChild<LLUICtrl>("post_place_btn"); - mCancelButton = getChild<LLUICtrl>("cancel_place_btn"); - mMessageTextEditor = getChild<LLUICtrl>("place_caption"); - mMapLoadingIndicator = getChild<LLUICtrl>("map_loading_indicator"); - mMapPlaceholder = getChild<LLIconCtrl>("map_placeholder"); - mMapDefault = getChild<LLIconCtrl>("map_default"); - mMapCheckBox = getChild<LLCheckBoxCtrl>("add_place_view_cb"); - - return LLPanel::postBuild(); -} - -void LLFacebookCheckinPanel::draw() -{ - bool no_ongoing_connection = !(LLFacebookConnect::instance().isTransactionOngoing()); - mPostButton->setEnabled(no_ongoing_connection); - mCancelButton->setEnabled(no_ongoing_connection); - mMessageTextEditor->setEnabled(no_ongoing_connection); - mMapCheckBox->setEnabled(no_ongoing_connection); - - std::string map_url = get_map_url(); - // Did we change location? - if (map_url != mMapUrl) - { - mMapUrl = map_url; - // Load the map tile - mMapTexture = LLViewerTextureManager::getFetchedTextureFromUrl(mMapUrl, FTT_MAP_TILE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); - mMapTexture->setBoostLevel(LLGLTexture::BOOST_MAP); - mReloadingMapTexture = true; - // In the meantime, put the "loading" indicator on, hide the tile map and disable the checkbox - mMapLoadingIndicator->setVisible(true); - mMapPlaceholder->setVisible(false); - } - // Are we done loading the map tile? - if (mReloadingMapTexture && mMapTexture->isFullyLoaded()) - { - // Don't do it again next time around - mReloadingMapTexture = false; - // Convert the map texture to the appropriate image object - LLPointer<LLUIImage> ui_image = new LLUIImage(mMapUrl, mMapTexture); - // Load the map widget with the correct map tile image - mMapPlaceholder->setImage(ui_image); - // Now hide the loading indicator, bring the tile in view and reenable the checkbox with its previous value - mMapLoadingIndicator->setVisible(false); - mMapPlaceholder->setVisible(true); - } - // Show the default icon if that's the checkbox value (the real one...) - // This will hide/show the loading indicator and/or tile underneath - mMapDefault->setVisible(!(mMapCheckBox->get())); - - LLPanel::draw(); -} - -void LLFacebookCheckinPanel::onSend() -{ - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookCheckinPanel"); // just in case it is already listening - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookCheckinPanel", boost::bind(&LLFacebookCheckinPanel::onFacebookConnectStateChange, this, _1)); - - // Connect to Facebook if necessary and then post - if (LLFacebookConnect::instance().isConnected()) - { - sendCheckin(); - } - else - { - LLFacebookConnect::instance().checkConnectionToFacebook(true); - } -} - -bool LLFacebookCheckinPanel::onFacebookConnectStateChange(const LLSD& data) -{ - switch (data.get("enum").asInteger()) - { - case LLFacebookConnect::FB_CONNECTED: - sendCheckin(); - break; - - case LLFacebookConnect::FB_POSTED: - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookCheckinPanel"); - clearAndClose(); - break; - } - - return false; -} - -void LLFacebookCheckinPanel::sendCheckin() -{ - // Get the location SLURL - LLSLURL slurl; - LLAgentUI::buildSLURL(slurl); - std::string slurl_string = slurl.getSLURLString(); - - // Use a valid http:// URL if the scheme is secondlife:// - LLURI slurl_uri(slurl_string); - if (slurl_uri.scheme() == LLSLURL::SLURL_SECONDLIFE_SCHEME) - { - slurl_string = DEFAULT_CHECKIN_LOCATION_URL; - } - - // Add query parameters so Google Analytics can track incoming clicks! - slurl_string += DEFAULT_CHECKIN_QUERY_PARAMETERS; - - // Get the region name - std::string region_name(""); - LLViewerRegion *regionp = gAgent.getRegion(); - if (regionp) - { - region_name = regionp->getName(); - } - - // Get the region description - std::string description; - LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent()); - - // Optionally add the region map view - bool add_map_view = mMapCheckBox->getValue().asBoolean(); - std::string map_url = (add_map_view ? get_map_url() : DEFAULT_CHECKIN_ICON_URL); - - // Get the caption - std::string caption = mMessageTextEditor->getValue().asString(); - - // Post to Facebook - LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, map_url, caption); -} - -void LLFacebookCheckinPanel::clearAndClose() -{ - mMessageTextEditor->setValue(""); - - LLFloater* floater = getParentByType<LLFloater>(); - if (floater) - { - floater->closeFloater(); - } -} - -/////////////////////////// -//LLFacebookFriendsPanel////// -/////////////////////////// - -LLFacebookFriendsPanel::LLFacebookFriendsPanel() : - mFriendsStatusCaption(NULL), - mSecondLifeFriends(NULL), - mSuggestedFriends(NULL) -{ -} - -LLFacebookFriendsPanel::~LLFacebookFriendsPanel() -{ - LLAvatarTracker::instance().removeObserver(this); -} - -BOOL LLFacebookFriendsPanel::postBuild() -{ - mFriendsStatusCaption = getChild<LLTextBox>("facebook_friends_status"); - - mSecondLifeFriends = getChild<LLAvatarList>("second_life_friends"); - mSecondLifeFriends->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); - - mSuggestedFriends = getChild<LLAvatarList>("suggested_friends"); - mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gSuggestedFriendsContextMenu); - - setVisibleCallback(boost::bind(&LLFacebookFriendsPanel::updateFacebookList, this, _2)); - - LLAvatarTracker::instance().addObserver(this); - - return LLPanel::postBuild(); -} - -bool LLFacebookFriendsPanel::updateSuggestedFriendList() -{ - const LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); - uuid_vec_t& second_life_friends = mSecondLifeFriends->getIDs(); - second_life_friends.clear(); - uuid_vec_t& suggested_friends = mSuggestedFriends->getIDs(); - suggested_friends.clear(); - - //Add suggested friends - LLSD friends = LLFacebookConnect::instance().getContent(); - for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i) - { - LLUUID agent_id = (*i).asUUID(); - if (agent_id.notNull()) - { - bool second_life_buddy = av_tracker.isBuddy(agent_id); - if (second_life_buddy) - { - second_life_friends.push_back(agent_id); - } - else - { - //FB+SL but not SL friend - suggested_friends.push_back(agent_id); - } - } - } - - //Force a refresh when there aren't any filter matches (prevent displaying content that shouldn't display) - mSecondLifeFriends->setDirty(true, !mSecondLifeFriends->filterHasMatches()); - mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches()); - showFriendsAccordionsIfNeeded(); - - return false; -} - -void LLFacebookFriendsPanel::showFriendsAccordionsIfNeeded() -{ - // Show / hide the status text : needs to be done *before* showing / hidding the accordions - if (!mSecondLifeFriends->filterHasMatches() && !mSuggestedFriends->filterHasMatches()) - { - // Show some explanation text if the lists are empty... - mFriendsStatusCaption->setVisible(true); - if (LLFacebookConnect::instance().isConnected()) - { - //...you're connected to FB but have no friends :( - mFriendsStatusCaption->setText(getString("facebook_friends_empty")); - } - else - { - //...you're not connected to FB - mFriendsStatusCaption->setText(getString("facebook_friends_no_connected")); - } - // Hide the lists - getChild<LLAccordionCtrl>("friends_accordion")->setVisible(false); - getChild<LLAccordionCtrlTab>("tab_second_life_friends")->setVisible(false); - getChild<LLAccordionCtrlTab>("tab_suggested_friends")->setVisible(false); - } - else - { - // We have something in the lists, hide the explanatory text - mFriendsStatusCaption->setVisible(false); - - // Show the lists - LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("friends_accordion"); - accordion->setVisible(true); - - // Expand and show accordions if needed, else - hide them - getChild<LLAccordionCtrlTab>("tab_second_life_friends")->setVisible(mSecondLifeFriends->filterHasMatches()); - getChild<LLAccordionCtrlTab>("tab_suggested_friends")->setVisible(mSuggestedFriends->filterHasMatches()); - - // Rearrange accordions - accordion->arrange(); - } -} - -void LLFacebookFriendsPanel::changed(U32 mask) -{ - if (mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE)) - { - LLFacebookConnect::instance().loadFacebookFriends(); - updateFacebookList(true); - } -} - - -void LLFacebookFriendsPanel::updateFacebookList(bool visible) -{ - if (visible) - { - // We want this to be called to fetch the friends list once a connection is established - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookFriendsPanel"); - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookFriendsPanel", boost::bind(&LLFacebookFriendsPanel::onConnectedToFacebook, this, _1)); - - // We then want this to be called to update the displayed lists once the list of friends is received - LLEventPumps::instance().obtain("FacebookConnectContent").stopListening("LLFacebookFriendsPanel"); // just in case it is already listening - LLEventPumps::instance().obtain("FacebookConnectContent").listen("LLFacebookFriendsPanel", boost::bind(&LLFacebookFriendsPanel::updateSuggestedFriendList, this)); - - // Try to connect to Facebook - if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) || - (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED)) - { - LLFacebookConnect::instance().checkConnectionToFacebook(); - } - // Loads FB friends - if (LLFacebookConnect::instance().isConnected()) - { - LLFacebookConnect::instance().loadFacebookFriends(); - } - // Sort the FB friends and update the lists - updateSuggestedFriendList(); - } -} - -bool LLFacebookFriendsPanel::onConnectedToFacebook(const LLSD& data) -{ - LLSD::Integer connection_state = data.get("enum").asInteger(); - - if (connection_state == LLFacebookConnect::FB_CONNECTED) - { - LLFacebookConnect::instance().loadFacebookFriends(); - } - else if (connection_state == LLFacebookConnect::FB_NOT_CONNECTED) - { - updateSuggestedFriendList(); - } - - return false; -} - -//////////////////////// -//LLFloaterFacebook/////// -//////////////////////// - -LLFloaterFacebook::LLFloaterFacebook(const LLSD& key) : LLFloater(key), - mFacebookPhotoPanel(NULL), - mStatusErrorText(NULL), - mStatusLoadingText(NULL), - mStatusLoadingIndicator(NULL) -{ - mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterFacebook::onCancel, this)); -} - -void LLFloaterFacebook::onClose(bool app_quitting) -{ - LLFloaterBigPreview* big_preview_floater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview")); - if (big_preview_floater) - { - big_preview_floater->closeOnFloaterOwnerClosing(this); - } - LLFloater::onClose(app_quitting); -} - -void LLFloaterFacebook::onCancel() -{ - LLFloaterBigPreview* big_preview_floater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview")); - if (big_preview_floater) - { - big_preview_floater->closeOnFloaterOwnerClosing(this); - } - closeFloater(); -} - -BOOL LLFloaterFacebook::postBuild() -{ - // Keep tab of the Photo Panel - mFacebookPhotoPanel = static_cast<LLFacebookPhotoPanel*>(getChild<LLUICtrl>("panel_facebook_photo")); - // Connection status widgets - mStatusErrorText = getChild<LLTextBox>("connection_error_text"); - mStatusLoadingText = getChild<LLTextBox>("connection_loading_text"); - mStatusLoadingIndicator = getChild<LLUICtrl>("connection_loading_indicator"); - return LLFloater::postBuild(); -} - -void LLFloaterFacebook::showPhotoPanel() -{ - LLTabContainer* parent = dynamic_cast<LLTabContainer*>(mFacebookPhotoPanel->getParent()); - if (!parent) - { - LL_WARNS() << "Cannot find panel container" << LL_ENDL; - return; - } - - parent->selectTabPanel(mFacebookPhotoPanel); -} - -void LLFloaterFacebook::draw() -{ - if (mStatusErrorText && mStatusLoadingText && mStatusLoadingIndicator) - { - mStatusErrorText->setVisible(false); - mStatusLoadingText->setVisible(false); - mStatusLoadingIndicator->setVisible(false); - LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState(); - std::string status_text; - - switch (connection_state) - { - case LLFacebookConnect::FB_NOT_CONNECTED: - // No status displayed when first opening the panel and no connection done - case LLFacebookConnect::FB_CONNECTED: - // When successfully connected, no message is displayed - case LLFacebookConnect::FB_POSTED: - // No success message to show since we actually close the floater after successful posting completion - break; - case LLFacebookConnect::FB_CONNECTION_IN_PROGRESS: - // Connection loading indicator - mStatusLoadingText->setVisible(true); - status_text = LLTrans::getString("SocialFacebookConnecting"); - mStatusLoadingText->setValue(status_text); - mStatusLoadingIndicator->setVisible(true); - break; - case LLFacebookConnect::FB_POSTING: - // Posting indicator - mStatusLoadingText->setVisible(true); - status_text = LLTrans::getString("SocialFacebookPosting"); - mStatusLoadingText->setValue(status_text); - mStatusLoadingIndicator->setVisible(true); - break; - case LLFacebookConnect::FB_CONNECTION_FAILED: - // Error connecting to the service - mStatusErrorText->setVisible(true); - status_text = LLTrans::getString("SocialFacebookErrorConnecting"); - mStatusErrorText->setValue(status_text); - break; - case LLFacebookConnect::FB_POST_FAILED: - // Error posting to the service - mStatusErrorText->setVisible(true); - status_text = LLTrans::getString("SocialFacebookErrorPosting"); - mStatusErrorText->setValue(status_text); - break; - case LLFacebookConnect::FB_DISCONNECTING: - // Disconnecting loading indicator - mStatusLoadingText->setVisible(true); - status_text = LLTrans::getString("SocialFacebookDisconnecting"); - mStatusLoadingText->setValue(status_text); - mStatusLoadingIndicator->setVisible(true); - break; - case LLFacebookConnect::FB_DISCONNECT_FAILED: - // Error disconnecting from the service - mStatusErrorText->setVisible(true); - status_text = LLTrans::getString("SocialFacebookErrorDisconnecting"); - mStatusErrorText->setValue(status_text); - break; - } - } - LLFloater::draw(); -} - diff --git a/indra/newview/llfloaterfacebook.h b/indra/newview/llfloaterfacebook.h deleted file mode 100644 index a4ca666b20..0000000000 --- a/indra/newview/llfloaterfacebook.h +++ /dev/null @@ -1,185 +0,0 @@ -/** -* @file llfloaterfacebook.h -* @brief Header file for llfloaterfacebook -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ -#ifndef LL_LLFLOATERFACEBOOK_H -#define LL_LLFLOATERFACEBOOK_H - -#include "llcallingcard.h" -#include "llfloater.h" -#include "lltextbox.h" -#include "llviewertexture.h" - -class LLIconCtrl; -class LLCheckBoxCtrl; -class LLSnapshotLivePreview; -class LLAvatarList; -class LLFloaterBigPreview; - -class LLFacebookStatusPanel : public LLPanel -{ -public: - LLFacebookStatusPanel(); - BOOL postBuild(); - void draw(); - void onSend(); - bool onFacebookConnectStateChange(const LLSD& data); - bool onFacebookConnectAccountStateChange(const LLSD& data); - - void sendStatus(); - void clearAndClose(); - -private: - void onVisibilityChange(BOOL new_visibility); - bool onFacebookConnectInfoChange(); - void onConnect(); - void onUseAnotherAccount(); - void onDisconnect(); - - void showConnectButton(); - void hideConnectButton(); - void showDisconnectedLayout(); - void showConnectedLayout(); - - LLTextBox * mAccountCaptionLabel; - LLTextBox * mAccountNameLabel; - LLUICtrl * mPanelButtons; - LLUICtrl * mConnectButton; - LLUICtrl * mDisconnectButton; - LLUICtrl* mMessageTextEditor; - LLUICtrl* mPostButton; - LLUICtrl* mCancelButton; -}; - -class LLFacebookPhotoPanel : public LLPanel -{ -public: - LLFacebookPhotoPanel(); - ~LLFacebookPhotoPanel(); - - BOOL postBuild(); - void draw(); - - LLSnapshotLivePreview* getPreviewView(); - void onVisibilityChange(BOOL new_visibility); - void onClickBigPreview(); - void onClickNewSnapshot(); - void onSend(); - S32 notify(const LLSD& info); - bool onFacebookConnectStateChange(const LLSD& data); - - void sendPhoto(); - void clearAndClose(); - - void updateControls(); - void updateResolution(BOOL do_update); - void checkAspectRatio(S32 index); - LLUICtrl* getRefreshBtn(); - -private: - bool isPreviewVisible(); - void attachPreview(); - - LLHandle<LLView> mPreviewHandle; - - LLUICtrl * mResolutionComboBox; - LLUICtrl * mFilterComboBox; - LLUICtrl * mRefreshBtn; - LLUICtrl * mWorkingLabel; - LLUICtrl * mThumbnailPlaceholder; - LLUICtrl * mCaptionTextBox; - LLUICtrl * mPostButton; - LLUICtrl * mCancelButton; - LLButton * mBtnPreview; - - LLFloaterBigPreview * mBigPreviewFloater; - - S32 mQuality; // Compression quality -}; - -class LLFacebookCheckinPanel : public LLPanel -{ -public: - LLFacebookCheckinPanel(); - BOOL postBuild(); - void draw(); - void onSend(); - bool onFacebookConnectStateChange(const LLSD& data); - - void sendCheckin(); - void clearAndClose(); - -private: - std::string mMapUrl; - LLPointer<LLViewerFetchedTexture> mMapTexture; - LLUICtrl* mPostButton; - LLUICtrl* mCancelButton; - LLUICtrl* mMessageTextEditor; - LLUICtrl* mMapLoadingIndicator; - LLIconCtrl* mMapPlaceholder; - LLIconCtrl* mMapDefault; - LLCheckBoxCtrl* mMapCheckBox; - bool mReloadingMapTexture; -}; - -class LLFacebookFriendsPanel : public LLPanel, public LLFriendObserver -{ -public: - LLFacebookFriendsPanel(); - ~LLFacebookFriendsPanel(); - BOOL postBuild(); - virtual void changed(U32 mask); - -private: - bool updateSuggestedFriendList(); - void showFriendsAccordionsIfNeeded(); - void updateFacebookList(bool visible); - bool onConnectedToFacebook(const LLSD& data); - - LLTextBox * mFriendsStatusCaption; - LLAvatarList* mSecondLifeFriends; - LLAvatarList* mSuggestedFriends; -}; - -class LLFloaterFacebook : public LLFloater -{ -public: - LLFloaterFacebook(const LLSD& key); - BOOL postBuild(); - void draw(); - void onClose(bool app_quitting); - void onCancel(); - - void showPhotoPanel(); - -private: - LLFacebookPhotoPanel* mFacebookPhotoPanel; - LLTextBox* mStatusErrorText; - LLTextBox* mStatusLoadingText; - LLUICtrl* mStatusLoadingIndicator; -}; - -#endif // LL_LLFLOATERFACEBOOK_H - diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 3c428a70f3..d4b0fa85ab 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -503,7 +503,7 @@ BOOL LLFloaterImagePreview::handleHover(S32 x, S32 y, MASK mask) mSculptedPreview->refresh(); } - LLUI::setMousePositionLocal(this, mLastMouseX, mLastMouseY); + LLUI::getInstance()->setMousePositionLocal(this, mLastMouseX, mLastMouseY); } if (!mPreviewRect.pointInRect(x, y) || !mAvatarPreview || !mSculptedPreview) diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 30d05ae287..21420b122b 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -237,7 +237,7 @@ BOOL LLFloaterIMContainer::postBuild() collapseMessagesPane(gSavedPerAccountSettings.getBOOL("ConversationsMessagePaneCollapsed")); collapseConversationsPane(gSavedPerAccountSettings.getBOOL("ConversationsListPaneCollapsed"), false); - LLAvatarNameCache::addUseDisplayNamesCallback(boost::bind(&LLFloaterIMSessionTab::processChatHistoryStyleUpdate, false)); + LLAvatarNameCache::getInstance()->addUseDisplayNamesCallback(boost::bind(&LLFloaterIMSessionTab::processChatHistoryStyleUpdate, false)); mMicroChangedSignal = LLVoiceClient::getInstance()->MicroChangedCallback(boost::bind(&LLFloaterIMContainer::updateSpeakBtnState, this)); if (! mMessagesPane->isCollapsed() && ! mConversationsPane->isCollapsed()) @@ -267,7 +267,7 @@ BOOL LLFloaterIMContainer::postBuild() // We'll take care of view updates on idle gIdleCallbacks.addFunction(idle, this); // When display name option change, we need to reload all participant names - LLAvatarNameCache::addUseDisplayNamesCallback(boost::bind(&LLFloaterIMContainer::processParticipantsStyleUpdate, this)); + LLAvatarNameCache::getInstance()->addUseDisplayNamesCallback(boost::bind(&LLFloaterIMContainer::processParticipantsStyleUpdate, this)); mParticipantRefreshTimer.setTimerExpirySec(0); mParticipantRefreshTimer.start(); diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index f9efd13608..a6531ed7e1 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -228,7 +228,7 @@ void LLFloaterIMNearbyChat::loadHistory() else { std::string legacy_name = gCacheName->buildLegacyName(from); - from_id = LLAvatarNameCache::findIdByName(legacy_name); + from_id = LLAvatarNameCache::getInstance()->findIdByName(legacy_name); } LLChat chat; diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 7f2e8fd82a..3098c6d118 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -1877,6 +1877,7 @@ LLPanelLandOptions::LLPanelLandOptions(LLParcelSelectionHandle& parcel) mLandingTypeCombo(NULL), mSnapshotCtrl(NULL), mLocationText(NULL), + mSeeAvatarsText(NULL), mSetBtn(NULL), mClearBtn(NULL), mMatureCtrl(NULL), @@ -1923,6 +1924,14 @@ BOOL LLPanelLandOptions::postBuild() mSeeAvatarsCtrl = getChild<LLCheckBoxCtrl>( "SeeAvatarsCheck"); childSetCommitCallback("SeeAvatarsCheck", onCommitAny, this); + mSeeAvatarsText = getChild<LLTextBox>("allow_see_label"); + if (mSeeAvatarsText) + { + mSeeAvatarsText->setShowCursorHand(false); + mSeeAvatarsText->setSoundFlags(LLView::MOUSE_UP); + mSeeAvatarsText->setClickedCallback(boost::bind(&toggleSeeAvatars, this)); + } + mCheckShowDirectory = getChild<LLCheckBoxCtrl>( "ShowDirectoryCheck"); childSetCommitCallback("ShowDirectoryCheck", onCommitAny, this); @@ -2016,6 +2025,7 @@ void LLPanelLandOptions::refresh() mSeeAvatarsCtrl->set(TRUE); mSeeAvatarsCtrl->setEnabled(FALSE); + mSeeAvatarsText->setEnabled(FALSE); mLandingTypeCombo->setCurrentByIndex(0); mLandingTypeCombo->setEnabled(FALSE); @@ -2074,6 +2084,7 @@ void LLPanelLandOptions::refresh() mSeeAvatarsCtrl->set(parcel->getSeeAVs()); mSeeAvatarsCtrl->setEnabled(can_change_options && parcel->getHaveNewParcelLimitData()); + mSeeAvatarsText->setEnabled(can_change_options && parcel->getHaveNewParcelLimitData()); BOOL can_change_landing_point = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_SET_LANDING_POINT); @@ -2364,7 +2375,16 @@ void LLPanelLandOptions::onClickClear(void* userdata) self->refresh(); } - +void LLPanelLandOptions::toggleSeeAvatars(void* userdata) +{ + LLPanelLandOptions* self = (LLPanelLandOptions*)userdata; + if (self) + { + self->getChild<LLCheckBoxCtrl>("SeeAvatarsCheck")->toggle(); + self->getChild<LLCheckBoxCtrl>("SeeAvatarsCheck")->setBtnFocus(); + self->onCommitAny(NULL, userdata); + } +} //--------------------------------------------------------------------------- // LLPanelLandAccess //--------------------------------------------------------------------------- diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index e846d42666..0c49d78a20 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -327,6 +327,7 @@ private: static void onCommitAny(LLUICtrl* ctrl, void *userdata); static void onClickSet(void* userdata); static void onClickClear(void* userdata); + static void toggleSeeAvatars(void* userdata); private: LLCheckBoxCtrl* mCheckEditObjects; @@ -345,6 +346,7 @@ private: LLTextureCtrl* mSnapshotCtrl; LLTextBox* mLocationText; + LLTextBox* mSeeAvatarsText; LLButton* mSetBtn; LLButton* mClearBtn; diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 4f1ea4a89e..b6efc1590e 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -325,6 +325,8 @@ BOOL LLFloaterModelPreview::postBuild() childSetCommitCallback("import_scale", onImportScaleCommit, this); childSetCommitCallback("pelvis_offset", onPelvisOffsetCommit, this); + getChild<LLLineEditor>("description_form")->setKeystrokeCallback(boost::bind(&LLFloaterModelPreview::onDescriptionKeystroke, this, _1), NULL); + getChild<LLCheckBoxCtrl>("show_edges")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1)); getChild<LLCheckBoxCtrl>("show_physics")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1)); getChild<LLCheckBoxCtrl>("show_textures")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1)); @@ -520,6 +522,16 @@ void LLFloaterModelPreview::onClickCalculateBtn() mUploadBtn->setEnabled(false); } +void LLFloaterModelPreview::onDescriptionKeystroke(LLUICtrl* ctrl) +{ + // Workaround for SL-4186, server doesn't allow name changes after 'calculate' stage + LLLineEditor* input = static_cast<LLLineEditor*>(ctrl); + if (input->isDirty()) // dirty will be reset after commit + { + toggleCalculateButton(true); + } +} + //static void LLFloaterModelPreview::onImportScaleCommit(LLUICtrl*,void* userdata) { @@ -794,7 +806,7 @@ BOOL LLFloaterModelPreview::handleHover (S32 x, S32 y, MASK mask) mModelPreview->refresh(); - LLUI::setMousePositionLocal(this, mLastMouseX, mLastMouseY); + LLUI::getInstance()->setMousePositionLocal(this, mLastMouseX, mLastMouseY); } if (!mPreviewRect.pointInRect(x, y) || !mModelPreview) diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 7ec6a58ac7..edc90d1695 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -137,7 +137,9 @@ protected: friend class LLModelPreview; friend class LLMeshFilePicker; friend class LLPhysicsDecomp; - + + void onDescriptionKeystroke(LLUICtrl*); + static void onImportScaleCommit(LLUICtrl*, void*); static void onPelvisOffsetCommit(LLUICtrl*, void*); static void onUploadJointsCommit(LLUICtrl*,void*); diff --git a/indra/newview/llfloatermyscripts.cpp b/indra/newview/llfloatermyscripts.cpp index fa2de21a8f..6f9a6c9066 100644 --- a/indra/newview/llfloatermyscripts.cpp +++ b/indra/newview/llfloatermyscripts.cpp @@ -41,6 +41,7 @@ const S32 SIZE_OF_ONE_KB = 1024; LLFloaterMyScripts::LLFloaterMyScripts(const LLSD& seed) : LLFloater(seed), mGotAttachmentMemoryUsed(false), + mAttachmentDetailsRequested(false), mAttachmentMemoryMax(0), mAttachmentMemoryUsed(0), mGotAttachmentURLsUsed(false), @@ -55,12 +56,24 @@ BOOL LLFloaterMyScripts::postBuild() std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestWaiting"); getChild<LLUICtrl>("loading_text")->setValue(LLSD(msg_waiting)); - return requestAttachmentDetails(); + mAttachmentDetailsRequested = requestAttachmentDetails(); + return TRUE; } -BOOL LLFloaterMyScripts::requestAttachmentDetails() +// virtual +void LLFloaterMyScripts::onOpen(const LLSD& key) { - if (!gAgent.getRegion()) return FALSE; + if (!mAttachmentDetailsRequested) + { + mAttachmentDetailsRequested = requestAttachmentDetails(); + } + + LLFloater::onOpen(key); +} + +bool LLFloaterMyScripts::requestAttachmentDetails() +{ + if (!gAgent.getRegion()) return false; LLSD body; std::string url = gAgent.getRegion()->getCapability("AttachmentResources"); @@ -68,11 +81,11 @@ BOOL LLFloaterMyScripts::requestAttachmentDetails() { LLCoros::instance().launch("LLFloaterMyScripts::getAttachmentLimitsCoro", boost::bind(&LLFloaterMyScripts::getAttachmentLimitsCoro, this, url)); - return TRUE; + return true; } else { - return FALSE; + return false; } } @@ -284,7 +297,7 @@ void LLFloaterMyScripts::onClickRefresh(void* userdata) btn->setEnabled(false); } instance->clearList(); - instance->requestAttachmentDetails(); + instance->mAttachmentDetailsRequested = instance->requestAttachmentDetails(); } else { diff --git a/indra/newview/llfloatermyscripts.h b/indra/newview/llfloatermyscripts.h index fe33ab90ae..3c053a0223 100644 --- a/indra/newview/llfloatermyscripts.h +++ b/indra/newview/llfloatermyscripts.h @@ -36,15 +36,17 @@ public: LLFloaterMyScripts(const LLSD& seed); BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); void setAttachmentDetails(LLSD content); void setAttachmentSummary(LLSD content); - BOOL requestAttachmentDetails(); + bool requestAttachmentDetails(); void clearList(); private: void getAttachmentLimitsCoro(std::string url); bool mGotAttachmentMemoryUsed; + bool mAttachmentDetailsRequested; S32 mAttachmentMemoryMax; S32 mAttachmentMemoryUsed; diff --git a/indra/newview/llfloateroutfitsnapshot.cpp b/indra/newview/llfloateroutfitsnapshot.cpp index d80793f9e4..bfcd1b8b47 100644 --- a/indra/newview/llfloateroutfitsnapshot.cpp +++ b/indra/newview/llfloateroutfitsnapshot.cpp @@ -30,9 +30,7 @@ #include "llfloateroutfitsnapshot.h" #include "llagent.h" -#include "llfacebookconnect.h" #include "llfloaterreg.h" -#include "llfloaterfacebook.h" #include "llfloaterflickr.h" #include "llfloatertwitter.h" #include "llimagefiltersmanager.h" diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 64961fc99c..fe347a91a3 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -254,8 +254,8 @@ bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response if ( option == 0 ) // YES { // clean web - LLViewerMedia::clearAllCaches(); - LLViewerMedia::clearAllCookies(); + LLViewerMedia::getInstance()->clearAllCaches(); + LLViewerMedia::getInstance()->clearAllCookies(); // clean nav bar history LLNavigationBar::getInstance()->clearHistoryCache(); @@ -278,13 +278,13 @@ bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response void handleNameTagOptionChanged(const LLSD& newvalue) { - LLAvatarNameCache::setUseUsernames(gSavedSettings.getBOOL("NameTagShowUsernames")); + LLAvatarNameCache::getInstance()->setUseUsernames(gSavedSettings.getBOOL("NameTagShowUsernames")); LLVOAvatar::invalidateNameTags(); } void handleDisplayNamesOptionChanged(const LLSD& newvalue) { - LLAvatarNameCache::setUseDisplayNames(newvalue.asBoolean()); + LLAvatarNameCache::getInstance()->setUseDisplayNames(newvalue.asBoolean()); LLVOAvatar::invalidateNameTags(); } @@ -523,7 +523,7 @@ BOOL LLFloaterPreference::postBuild() // set 'enable' property for 'Clear log...' button changed(); - LLLogChat::setSaveHistorySignal(boost::bind(&LLFloaterPreference::onLogChatHistorySaved, this)); + LLLogChat::getInstance()->setSaveHistorySignal(boost::bind(&LLFloaterPreference::onLogChatHistorySaved, this)); LLSliderCtrl* fov_slider = getChild<LLSliderCtrl>("camera_fov"); fov_slider->setMinValue(LLViewerCamera::getInstance()->getMinView()); @@ -635,14 +635,14 @@ void LLFloaterPreference::apply() std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""); setCacheLocation(cache_location); - LLViewerMedia::setCookiesEnabled(getChild<LLUICtrl>("cookies_enabled")->getValue()); + LLViewerMedia::getInstance()->setCookiesEnabled(getChild<LLUICtrl>("cookies_enabled")->getValue()); if (hasChild("web_proxy_enabled", TRUE) &&hasChild("web_proxy_editor", TRUE) && hasChild("web_proxy_port", TRUE)) { bool proxy_enable = getChild<LLUICtrl>("web_proxy_enabled")->getValue(); std::string proxy_address = getChild<LLUICtrl>("web_proxy_editor")->getValue(); int proxy_port = getChild<LLUICtrl>("web_proxy_port")->getValue(); - LLViewerMedia::setProxyConfig(proxy_enable, proxy_address, proxy_port); + LLViewerMedia::getInstance()->setProxyConfig(proxy_enable, proxy_address, proxy_port); } if (mGotPersonalInfo) @@ -1234,7 +1234,7 @@ void LLFloaterPreference::buildPopupLists() { if (ignore == LLNotificationForm::IGNORE_WITH_LAST_RESPONSE) { - LLSD last_response = LLUI::sSettingGroups["config"]->getLLSD("Default" + templatep->mName); + LLSD last_response = LLUI::getInstance()->mSettingGroups["config"]->getLLSD("Default" + templatep->mName); if (!last_response.isUndefined()) { for (LLSD::map_const_iterator it = last_response.beginMap(); @@ -1739,7 +1739,7 @@ void LLFloaterPreference::onClickEnablePopup() LLNotificationTemplatePtr templatep = LLNotifications::instance().getTemplate(*(std::string*)((*itor)->getUserdata())); //gSavedSettings.setWarning(templatep->mName, TRUE); std::string notification_name = templatep->mName; - LLUI::sSettingGroups["ignores"]->setBOOL(notification_name, TRUE); + LLUI::getInstance()->mSettingGroups["ignores"]->setBOOL(notification_name, TRUE); } buildPopupLists(); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index d94bf3f651..960fd9620d 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -38,7 +38,7 @@ #include "llcallbacklist.h" #include "llcheckboxctrl.h" #include "llfontgl.h" -#include "llimagebmp.h" +#include "llimagepng.h" #include "llimagej2c.h" #include "llinventory.h" #include "llnotificationsutil.h" @@ -89,7 +89,7 @@ #include "llcorehttputil.h" #include "llviewerassetupload.h" -const std::string SCREEN_PREV_FILENAME = "screen_report_last.bmp"; +const std::string SCREEN_PREV_FILENAME = "screen_report_last.png"; //========================================================================= //----------------------------------------------------------------------------- @@ -872,10 +872,10 @@ void LLFloaterReporter::takeScreenshot(bool use_prev_screenshot) if(!use_prev_screenshot) { std::string screenshot_filename(gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + SCREEN_PREV_FILENAME); - LLPointer<LLImageBMP> bmp_image = new LLImageBMP; - if(bmp_image->encode(mImageRaw, 0.0f)) + LLPointer<LLImagePNG> png_image = new LLImagePNG; + if(png_image->encode(mImageRaw, 0.0f)) { - bmp_image->save(screenshot_filename); + png_image->save(screenshot_filename); } } else @@ -948,10 +948,10 @@ void LLFloaterReporter::takeNewSnapshot() { std::string screenshot_filename(gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + SCREEN_PREV_FILENAME); mPrevImageRaw = new LLImageRaw; - LLPointer<LLImageBMP> start_image_bmp = new LLImageBMP; - if(start_image_bmp->load(screenshot_filename)) + LLPointer<LLImagePNG> start_image_png = new LLImagePNG; + if(start_image_png->load(screenshot_filename)) { - if (start_image_bmp->decode(mPrevImageRaw, 0.0f)) + if (start_image_png->decode(mPrevImageRaw, 0.0f)) { LLNotificationsUtil::add("LoadPreviousReportScreenshot", LLSD(), LLSD(), boost::bind(&LLFloaterReporter::onLoadScreenshotDialog,this, _1, _2)); return; diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 66e832111b..779542cfcc 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -48,7 +48,7 @@ public: LLSearchHandler() : LLCommandHandler("search", UNTRUSTED_THROTTLE) { } bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) { - if (!LLUI::sSettingGroups["config"]->getBOOL("EnableSearch")) + if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableSearch")) { LLNotificationsUtil::add("NoSearch", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); return true; @@ -120,6 +120,7 @@ void LLFloaterSearch::onOpen(const LLSD& key) p.allow_address_entry = false; LLFloaterWebContent::onOpen(p); + mWebBrowser->setFocus(TRUE); search(p.search); } diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index a7931137b0..2798e375c7 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -28,9 +28,7 @@ #include "llfloatersnapshot.h" -#include "llfacebookconnect.h" #include "llfloaterreg.h" -#include "llfloaterfacebook.h" #include "llfloaterflickr.h" #include "llfloatertwitter.h" #include "llimagefiltersmanager.h" @@ -1242,11 +1240,10 @@ BOOL LLFloaterSnapshot::isWaitingState() BOOL LLFloaterSnapshotBase::ImplBase::updatePreviewList(bool initialized) { - LLFloaterFacebook* floater_facebook = LLFloaterReg::findTypedInstance<LLFloaterFacebook>("facebook"); LLFloaterFlickr* floater_flickr = LLFloaterReg::findTypedInstance<LLFloaterFlickr>("flickr"); LLFloaterTwitter* floater_twitter = LLFloaterReg::findTypedInstance<LLFloaterTwitter>("twitter"); - if (!initialized && !floater_facebook && !floater_flickr && !floater_twitter) + if (!initialized && !floater_flickr && !floater_twitter) return FALSE; BOOL changed = FALSE; diff --git a/indra/newview/llfloaterspellchecksettings.cpp b/indra/newview/llfloaterspellchecksettings.cpp index b87044ef5a..de5d59f484 100644 --- a/indra/newview/llfloaterspellchecksettings.cpp +++ b/indra/newview/llfloaterspellchecksettings.cpp @@ -56,7 +56,7 @@ void LLFloaterSpellCheckerSettings::draw() bool enable_remove = !sel_items.empty(); for (std::vector<LLScrollListItem*>::const_iterator sel_it = sel_items.begin(); sel_it != sel_items.end(); ++sel_it) { - enable_remove &= LLSpellChecker::canRemoveDictionary((*sel_it)->getValue().asString()); + enable_remove &= LLSpellChecker::getInstance()->canRemoveDictionary((*sel_it)->getValue().asString()); } getChild<LLUICtrl>("spellcheck_remove_btn")->setEnabled(enable_remove); } @@ -121,7 +121,7 @@ void LLFloaterSpellCheckerSettings::onClose(bool app_quitting) for (std::vector<LLScrollListItem*>::const_iterator item_it = list_items.begin(); item_it != list_items.end(); ++item_it) { const std::string language = (*item_it)->getValue().asString(); - if (LLSpellChecker::hasDictionary(language, true)) + if (LLSpellChecker::getInstance()->hasDictionary(language, true)) { list_dict.push_back(language); } @@ -164,7 +164,7 @@ void LLFloaterSpellCheckerSettings::refreshDictionaries(bool from_settings) } dict_combo->clearRows(); - const LLSD& dict_map = LLSpellChecker::getDictionaryMap(); + const LLSD& dict_map = LLSpellChecker::getInstance()->getDictionaryMap(); if (dict_map.size()) { for (LLSD::array_const_iterator dict_it = dict_map.beginArray(); dict_it != dict_map.endArray(); ++dict_it) @@ -216,7 +216,7 @@ void LLFloaterSpellCheckerSettings::refreshDictionaries(bool from_settings) for (LLSpellChecker::dict_list_t::const_iterator it = active_list.begin(); it != active_list.end(); ++it) { const std::string language = *it; - const LLSD dict = LLSpellChecker::getDictionaryData(language); + const LLSD dict = LLSpellChecker::getInstance()->getDictionaryData(language); row["value"] = language; row["columns"][0]["value"] = (!dict["user_installed"].asBoolean()) ? language : language + " " + LLTrans::getString("UserDictionary"); active_ctrl->addElement(row); @@ -380,7 +380,7 @@ void LLFloaterSpellCheckerImport::onBtnOK() custom_file_out.close(); } - LLSpellChecker::refreshDictionaryMap(); + LLSpellChecker::getInstance()->refreshDictionaryMap(); } closeFloater(false); diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index ee4fdbe9a5..0429749e11 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -514,11 +514,6 @@ void LLFloaterTools::refresh() selection_info << getString("status_selectcount", selection_args); getChild<LLTextBox>("selection_count")->setText(selection_info.str()); - - bool have_selection = !LLSelectMgr::getInstance()->getSelection()->isEmpty(); - childSetVisible("selection_count", have_selection); - childSetVisible("remaining_capacity", have_selection); - childSetVisible("selection_empty", !have_selection); } @@ -855,6 +850,18 @@ void LLFloaterTools::onOpen(const LLSD& key) { mTab->selectTabByName(panel); } + + LLTool* tool = LLToolMgr::getInstance()->getCurrentTool(); + if (tool == LLToolCompInspect::getInstance() + || tool == LLToolDragAndDrop::getInstance()) + { + // Something called floater up while it was supressed (during drag n drop, inspect), + // so it won't be getting any layout or visibility updates, update once + // further updates will come from updateLayout() + LLCoordGL select_center_screen; + MASK mask = gKeyboard->currentMask(TRUE); + updatePopup(select_center_screen, mask); + } //gMenuBarView->setItemVisible("BuildTools", TRUE); } diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index db5a192287..e67c79a3a0 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -291,8 +291,8 @@ bool LLPreviewedFloater::sShowRectangles = false; // Changes are made here LLLocalizationResetForcer::LLLocalizationResetForcer(LLFloaterUIPreview* floater, S32 ID) { - mSavedLocalization = LLUI::sSettingGroups["config"]->getString("Language"); // save current localization setting - LLUI::sSettingGroups["config"]->setString("Language", floater->getLocStr(ID));// hack language to be the one we want to preview floaters in + mSavedLocalization = LLUI::getInstance()->mSettingGroups["config"]->getString("Language"); // save current localization setting + LLUI::getInstance()->mSettingGroups["config"]->setString("Language", floater->getLocStr(ID));// hack language to be the one we want to preview floaters in // forcibly reset XUI paths with this new language gDirUtilp->setSkinFolder(gDirUtilp->getSkinFolder(), floater->getLocStr(ID)); } @@ -301,7 +301,7 @@ LLLocalizationResetForcer::LLLocalizationResetForcer(LLFloaterUIPreview* floater // Changes are reversed here LLLocalizationResetForcer::~LLLocalizationResetForcer() { - LLUI::sSettingGroups["config"]->setString("Language", mSavedLocalization); // reset language to what it was before we changed it + LLUI::getInstance()->mSettingGroups["config"]->setString("Language", mSavedLocalization); // reset language to what it was before we changed it // forcibly reset XUI paths with this new language gDirUtilp->setSkinFolder(gDirUtilp->getSkinFolder(), mSavedLocalization); } diff --git a/indra/newview/llfloatervoicevolume.cpp b/indra/newview/llfloatervoicevolume.cpp index 38446e46df..59e1f49f81 100644 --- a/indra/newview/llfloatervoicevolume.cpp +++ b/indra/newview/llfloatervoicevolume.cpp @@ -127,7 +127,7 @@ void LLFloaterVoiceVolume::onOpen(const LLSD& data) // Extract appropriate avatar id mAvatarID = data["avatar_id"]; - LLUI::positionViewNearMouse(this); + LLUI::getInstance()->positionViewNearMouse(this); getChild<LLUICtrl>("avatar_name")->setValue(""); updateVolumeControls(); diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 3b17368445..c591dfacaf 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -30,7 +30,6 @@ #include "lliconctrl.h" #include "llfloaterreg.h" #include "llhttpconstants.h" -#include "llfacebookconnect.h" #include "llflickrconnect.h" #include "lltwitterconnect.h" #include "lllayoutstack.h" @@ -235,7 +234,7 @@ void LLFloaterWebContent::preCreate(LLFloaterWebContent::Params& p) void LLFloaterWebContent::open_media(const Params& p) { - LLViewerMedia::proxyWindowOpened(p.target(), p.id()); + LLViewerMedia::getInstance()->proxyWindowOpened(p.target(), p.id()); mWebBrowser->setHomePageUrl(p.url); mWebBrowser->setTarget(p.target); mWebBrowser->navigateTo(p.url); @@ -289,17 +288,7 @@ void LLFloaterWebContent::onOpen(const LLSD& key) //virtual void LLFloaterWebContent::onClose(bool app_quitting) { - // If we close the web browsing window showing the facebook login, we need to signal to this object that the connection will not happen - // MAINT-3440 note change here to use findInstance and not getInstance - latter creates an instance if it's not there which is bad. - LLFloater* fbc_web = LLFloaterReg::findInstance("fbc_web"); - if (fbc_web == this) - { - if (!LLFacebookConnect::instance().isConnected()) - { - LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED); - } - } - // Same with Flickr + // If we close the web browsing window showing the Flickr login, we need to signal to this object that the connection will not happen // MAINT-3440 note change here to use findInstance and not getInstance - latter creates an instance if it's not there which is bad. LLFloater* flickr_web = LLFloaterReg::findInstance("flickr_web"); if (flickr_web == this) @@ -309,7 +298,7 @@ void LLFloaterWebContent::onClose(bool app_quitting) LLFlickrConnect::instance().setConnectionState(LLFlickrConnect::FLICKR_CONNECTION_FAILED); } } - // And Twitter + // Same with Twitter // MAINT-3440 note change here to use findInstance and not getInstance - latter creates an instance if it's not there which is bad. LLFloater* twitter_web = LLFloaterReg::findInstance("twitter_web"); if (twitter_web == this) @@ -319,7 +308,7 @@ void LLFloaterWebContent::onClose(bool app_quitting) LLTwitterConnect::instance().setConnectionState(LLTwitterConnect::TWITTER_CONNECTION_FAILED); } } - LLViewerMedia::proxyWindowClosed(mUUID); + LLViewerMedia::getInstance()->proxyWindowClosed(mUUID); destroy(); } @@ -380,13 +369,6 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent // The browser instance wants its window closed. closeFloater(); } - else if(event == MEDIA_EVENT_GEOMETRY_CHANGE) - { - if (mCurrentURL.find("facebook.com/dialog/oauth") == std::string::npos) // HACK to fix ACME-1317 - Cho - { - geometryChanged(self->getGeometryX(), self->getGeometryY(), self->getGeometryWidth(), self->getGeometryHeight()); - } - } else if(event == MEDIA_EVENT_STATUS_TEXT_CHANGED ) { const std::string text = self->getStatusText(); diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 1e9c9ce5e0..27197f0b06 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -122,7 +122,7 @@ public: bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { - if (!LLUI::sSettingGroups["config"]->getBOOL("EnableWorldMap")) + if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableWorldMap")) { LLNotificationsUtil::add("NoWorldMap", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); return true; @@ -160,7 +160,7 @@ public: bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { - if (!LLUI::sSettingGroups["config"]->getBOOL("EnableWorldMap")) + if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableWorldMap")) { LLNotificationsUtil::add("NoWorldMap", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); return true; diff --git a/indra/newview/llfollowcam.cpp b/indra/newview/llfollowcam.cpp index 612afc0d18..c2ea3b07c1 100644 --- a/indra/newview/llfollowcam.cpp +++ b/indra/newview/llfollowcam.cpp @@ -30,12 +30,6 @@ #include "llagent.h" //------------------------------------------------------- -// class statics -//------------------------------------------------------- -std::map<LLUUID, LLFollowCamParams*> LLFollowCamMgr::sParamMap; -std::vector<LLFollowCamParams*> LLFollowCamMgr::sParamStack; - -//------------------------------------------------------- // constants //------------------------------------------------------- const F32 FOLLOW_CAM_ZOOM_FACTOR = 0.1f; @@ -668,18 +662,20 @@ LLFollowCam::~LLFollowCam() //------------------------------------------------------- // LLFollowCamMgr //------------------------------------------------------- -//static -void LLFollowCamMgr::cleanupClass() +LLFollowCamMgr::LLFollowCamMgr() { - for (param_map_t::iterator iter = sParamMap.begin(); iter != sParamMap.end(); ++iter) - { - LLFollowCamParams* params = iter->second; - delete params; - } - sParamMap.clear(); } -//static +LLFollowCamMgr::~LLFollowCamMgr() +{ + for (param_map_t::iterator iter = mParamMap.begin(); iter != mParamMap.end(); ++iter) + { + LLFollowCamParams* params = iter->second; + delete params; + } + mParamMap.clear(); +} + void LLFollowCamMgr::setPositionLag( const LLUUID& source, F32 lag) { LLFollowCamParams* paramsp = getParamsForID(source); @@ -689,7 +685,6 @@ void LLFollowCamMgr::setPositionLag( const LLUUID& source, F32 lag) } } -//static void LLFollowCamMgr::setFocusLag( const LLUUID& source, F32 lag) { LLFollowCamParams* paramsp = getParamsForID(source); @@ -699,7 +694,6 @@ void LLFollowCamMgr::setFocusLag( const LLUUID& source, F32 lag) } } -//static void LLFollowCamMgr::setFocusThreshold( const LLUUID& source, F32 threshold) { LLFollowCamParams* paramsp = getParamsForID(source); @@ -710,7 +704,6 @@ void LLFollowCamMgr::setFocusThreshold( const LLUUID& source, F32 threshold) } -//static void LLFollowCamMgr::setPositionThreshold( const LLUUID& source, F32 threshold) { LLFollowCamParams* paramsp = getParamsForID(source); @@ -720,7 +713,6 @@ void LLFollowCamMgr::setPositionThreshold( const LLUUID& source, F32 threshold) } } -//static void LLFollowCamMgr::setDistance( const LLUUID& source, F32 distance) { LLFollowCamParams* paramsp = getParamsForID(source); @@ -730,7 +722,6 @@ void LLFollowCamMgr::setDistance( const LLUUID& source, F32 distance) } } -//static void LLFollowCamMgr::setPitch( const LLUUID& source, F32 pitch) { LLFollowCamParams* paramsp = getParamsForID(source); @@ -740,7 +731,6 @@ void LLFollowCamMgr::setPitch( const LLUUID& source, F32 pitch) } } -//static void LLFollowCamMgr::setFocusOffset( const LLUUID& source, const LLVector3& offset) { LLFollowCamParams* paramsp = getParamsForID(source); @@ -750,7 +740,6 @@ void LLFollowCamMgr::setFocusOffset( const LLUUID& source, const LLVector3& offs } } -//static void LLFollowCamMgr::setBehindnessAngle( const LLUUID& source, F32 angle) { LLFollowCamParams* paramsp = getParamsForID(source); @@ -760,7 +749,6 @@ void LLFollowCamMgr::setBehindnessAngle( const LLUUID& source, F32 angle) } } -//static void LLFollowCamMgr::setBehindnessLag( const LLUUID& source, F32 force) { LLFollowCamParams* paramsp = getParamsForID(source); @@ -770,7 +758,6 @@ void LLFollowCamMgr::setBehindnessLag( const LLUUID& source, F32 force) } } -//static void LLFollowCamMgr::setPosition( const LLUUID& source, const LLVector3 position) { LLFollowCamParams* paramsp = getParamsForID(source); @@ -780,7 +767,6 @@ void LLFollowCamMgr::setPosition( const LLUUID& source, const LLVector3 position } } -//static void LLFollowCamMgr::setFocus( const LLUUID& source, const LLVector3 focus) { LLFollowCamParams* paramsp = getParamsForID(source); @@ -790,7 +776,6 @@ void LLFollowCamMgr::setFocus( const LLUUID& source, const LLVector3 focus) } } -//static void LLFollowCamMgr::setPositionLocked( const LLUUID& source, bool locked) { LLFollowCamParams* paramsp = getParamsForID(source); @@ -800,7 +785,6 @@ void LLFollowCamMgr::setPositionLocked( const LLUUID& source, bool locked) } } -//static void LLFollowCamMgr::setFocusLocked( const LLUUID& source, bool locked ) { LLFollowCamParams* paramsp = getParamsForID(source); @@ -810,16 +794,15 @@ void LLFollowCamMgr::setFocusLocked( const LLUUID& source, bool locked ) } } -//static LLFollowCamParams* LLFollowCamMgr::getParamsForID(const LLUUID& source) { LLFollowCamParams* params = NULL; - param_map_t::iterator found_it = sParamMap.find(source); - if (found_it == sParamMap.end()) // didn't find it? + param_map_t::iterator found_it = mParamMap.find(source); + if (found_it == mParamMap.end()) // didn't find it? { params = new LLFollowCamParams(); - sParamMap[source] = params; + mParamMap[source] = params; } else { @@ -829,56 +812,51 @@ LLFollowCamParams* LLFollowCamMgr::getParamsForID(const LLUUID& source) return params; } -//static LLFollowCamParams* LLFollowCamMgr::getActiveFollowCamParams() { - if (sParamStack.empty()) + if (mParamStack.empty()) { return NULL; } - return sParamStack.back(); + return mParamStack.back(); } -//static void LLFollowCamMgr::setCameraActive( const LLUUID& source, bool active ) { LLFollowCamParams* params = getParamsForID(source); - param_stack_t::iterator found_it = std::find(sParamStack.begin(), sParamStack.end(), params); - if (found_it != sParamStack.end()) + param_stack_t::iterator found_it = std::find(mParamStack.begin(), mParamStack.end(), params); + if (found_it != mParamStack.end()) { - sParamStack.erase(found_it); + mParamStack.erase(found_it); } // put on top of stack if(active) { - sParamStack.push_back(params); + mParamStack.push_back(params); } } -//static void LLFollowCamMgr::removeFollowCamParams(const LLUUID& source) { setCameraActive(source, FALSE); LLFollowCamParams* params = getParamsForID(source); - sParamMap.erase(source); + mParamMap.erase(source); delete params; } -//static bool LLFollowCamMgr::isScriptedCameraSource(const LLUUID& source) { - param_map_t::iterator found_it = sParamMap.find(source); - return (found_it != sParamMap.end()); + param_map_t::iterator found_it = mParamMap.find(source); + return (found_it != mParamMap.end()); } -//static void LLFollowCamMgr::dump() { S32 param_count = 0; LL_INFOS() << "Scripted camera active stack" << LL_ENDL; - for (param_stack_t::iterator param_it = sParamStack.begin(); - param_it != sParamStack.end(); + for (param_stack_t::iterator param_it = mParamStack.begin(); + param_it != mParamStack.end(); ++param_it) { LL_INFOS() << param_count++ << diff --git a/indra/newview/llfollowcam.h b/indra/newview/llfollowcam.h index f4b7b2723a..7995848160 100644 --- a/indra/newview/llfollowcam.h +++ b/indra/newview/llfollowcam.h @@ -193,40 +193,40 @@ protected: };// end of FollowCam class -class LLFollowCamMgr +class LLFollowCamMgr : public LLSingleton<LLFollowCamMgr> { -public: - static void cleanupClass ( ); - - static void setPositionLag ( const LLUUID& source, F32 lag); - static void setFocusLag ( const LLUUID& source, F32 lag); - static void setFocusThreshold ( const LLUUID& source, F32 threshold); - static void setPositionThreshold ( const LLUUID& source, F32 threshold); - static void setDistance ( const LLUUID& source, F32 distance); - static void setPitch ( const LLUUID& source, F32 pitch); - static void setFocusOffset ( const LLUUID& source, const LLVector3& offset); - static void setBehindnessAngle ( const LLUUID& source, F32 angle); - static void setBehindnessLag ( const LLUUID& source, F32 lag); - static void setPosition ( const LLUUID& source, const LLVector3 position); - static void setFocus ( const LLUUID& source, const LLVector3 focus); - static void setPositionLocked ( const LLUUID& source, bool locked); - static void setFocusLocked ( const LLUUID& source, bool locked ); - - static void setCameraActive ( const LLUUID& source, bool active ); - - static LLFollowCamParams* getActiveFollowCamParams(); - static LLFollowCamParams* getParamsForID(const LLUUID& source); - static void removeFollowCamParams(const LLUUID& source); - static bool isScriptedCameraSource(const LLUUID& source); - static void dump(); + LLSINGLETON(LLFollowCamMgr); + ~LLFollowCamMgr(); +public: + void setPositionLag ( const LLUUID& source, F32 lag); + void setFocusLag ( const LLUUID& source, F32 lag); + void setFocusThreshold ( const LLUUID& source, F32 threshold); + void setPositionThreshold ( const LLUUID& source, F32 threshold); + void setDistance ( const LLUUID& source, F32 distance); + void setPitch ( const LLUUID& source, F32 pitch); + void setFocusOffset ( const LLUUID& source, const LLVector3& offset); + void setBehindnessAngle ( const LLUUID& source, F32 angle); + void setBehindnessLag ( const LLUUID& source, F32 lag); + void setPosition ( const LLUUID& source, const LLVector3 position); + void setFocus ( const LLUUID& source, const LLVector3 focus); + void setPositionLocked ( const LLUUID& source, bool locked); + void setFocusLocked ( const LLUUID& source, bool locked ); + + void setCameraActive ( const LLUUID& source, bool active ); + + LLFollowCamParams* getActiveFollowCamParams(); + LLFollowCamParams* getParamsForID(const LLUUID& source); + void removeFollowCamParams(const LLUUID& source); + bool isScriptedCameraSource(const LLUUID& source); + void dump(); protected: typedef std::map<LLUUID, LLFollowCamParams*> param_map_t; - static param_map_t sParamMap; + param_map_t mParamMap; typedef std::vector<LLFollowCamParams*> param_stack_t; - static param_stack_t sParamStack; + param_stack_t mParamStack; }; #endif //LL_FOLLOWCAM_H diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index a9b15fc8b6..fea01786f3 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -1005,7 +1005,10 @@ F32 gpu_benchmark() //number of samples to take const S32 samples = 64; - + + //time limit, allocation operations shouldn't take longer then 30 seconds, same for actual benchmark. + const F32 time_limit = 30; + ShaderProfileHelper initProfile; std::vector<LLRenderTarget> dest(count); @@ -1023,12 +1026,14 @@ F32 gpu_benchmark() gGL.setColorMask(true, true); LLGLDepthTest depth(GL_FALSE); + LLTimer alloc_timer; + alloc_timer.start(); for (U32 i = 0; i < count; ++i) { //allocate render targets and textures if (!dest[i].allocate(res, res, GL_RGBA, false, false, LLTexUnit::TT_TEXTURE, true)) { - LL_WARNS() << "Failed to allocate render target." << LL_ENDL; + LL_WARNS("Benchmark") << "Failed to allocate render target." << LL_ENDL; // abandon the benchmark test delete[] pixels; return -1.f; @@ -1040,12 +1045,20 @@ F32 gpu_benchmark() if (!texHolder.bind(i)) { // can use a dummy value mDummyTexUnit = new LLTexUnit(-1); - LL_WARNS() << "Failed to bind tex unit." << LL_ENDL; + LL_WARNS("Benchmark") << "Failed to bind tex unit." << LL_ENDL; // abandon the benchmark test delete[] pixels; return -1.f; } LLImageGL::setManualImage(GL_TEXTURE_2D, 0, GL_RGBA, res,res,GL_RGBA, GL_UNSIGNED_BYTE, pixels); + + if (alloc_timer.getElapsedTimeF32() > time_limit) + { + // abandon the benchmark test + LL_WARNS("Benchmark") << "Allocation operation took longer then 30 seconds, stopping." << LL_ENDL; + delete[] pixels; + return -1.f; + } } delete [] pixels; @@ -1055,7 +1068,7 @@ F32 gpu_benchmark() if (!buff->allocateBuffer(3, 0, true)) { - LL_WARNS() << "Failed to allocate buffer during benchmark." << LL_ENDL; + LL_WARNS("Benchmark") << "Failed to allocate buffer during benchmark." << LL_ENDL; // abandon the benchmark test return -1.f; } @@ -1065,7 +1078,7 @@ F32 gpu_benchmark() if (! buff->getVertexStrider(v)) { - LL_WARNS() << "GL LLVertexBuffer::getVertexStrider() returned false, " + LL_WARNS("Benchmark") << "GL LLVertexBuffer::getVertexStrider() returned false, " << "buff->getMappedData() is" << (buff->getMappedData()? " not" : "") << " NULL" << LL_ENDL; @@ -1086,7 +1099,8 @@ F32 gpu_benchmark() buff->setBuffer(LLVertexBuffer::MAP_VERTEX); glFinish(); - for (S32 c = -1; c < samples; ++c) + F32 time_passed = 0; // seconds + for (S32 c = -1; c < samples && time_passed < time_limit; ++c) { LLTimer timer; timer.start(); @@ -1103,6 +1117,7 @@ F32 gpu_benchmark() glFinish(); F32 time = timer.getElapsedTimeF32(); + time_passed += time; if (c >= 0) // <-- ignore the first sample as it tends to be artificially slow { @@ -1117,12 +1132,12 @@ F32 gpu_benchmark() F32 gbps = results[results.size()/2]; - LL_INFOS() << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to CPU timers" << LL_ENDL; - + LL_INFOS("Benchmark") << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to CPU timers, " << (F32)results.size() << " tests took " << time_passed << " seconds" << LL_ENDL; + #if LL_DARWIN if (gbps > 512.f) { - LL_WARNS() << "Memory bandwidth is improbably high and likely incorrect; discarding result." << LL_ENDL; + LL_WARNS("Benchmark") << "Memory bandwidth is improbably high and likely incorrect; discarding result." << LL_ENDL; //OSX is probably lying, discard result return -1.f; } @@ -1131,11 +1146,11 @@ F32 gpu_benchmark() F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f; F32 seconds = ms/1000.f; - F64 samples_drawn = res*res*count*samples; + F64 samples_drawn = res*res*count*results.size(); F32 samples_sec = (samples_drawn/1000000000.0)/seconds; gbps = samples_sec*8; - LL_INFOS() << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to ARB_timer_query" << LL_ENDL; + LL_INFOS("Benchmark") << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to ARB_timer_query, total time " << seconds << " seconds" << LL_ENDL; return gbps; } diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index 913efd6434..599790d2bb 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -55,7 +55,7 @@ public: bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) { - if (!LLUI::sSettingGroups["config"]->getBOOL("EnableGroupInfo")) + if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableGroupInfo")) { LLNotificationsUtil::add("NoGroupInfo", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); return true; diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 152d0eddcd..088d052533 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -2137,6 +2137,7 @@ void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id) static U32 lastGroupMemberRequestFrame = 0; // Have we requested the information already this frame? + // Todo: make this per group, we can invite to one group and simultaneously be checking another one if ((lastGroupMemberRequestFrame == gFrameCount) || (mMemberRequestInFlight)) return; @@ -2166,6 +2167,9 @@ void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id) return; } + LLGroupMgrGroupData* group_datap = createGroupData(group_id); //make sure group exists + group_datap->mMemberRequestID.generate(); // mark as pending + lastGroupMemberRequestFrame = gFrameCount; LLCoros::instance().launch("LLGroupMgr::groupMembersRequestCoro", diff --git a/indra/newview/llgroupmgr.h b/indra/newview/llgroupmgr.h index 940ef6eea1..cf9735e38a 100644 --- a/indra/newview/llgroupmgr.h +++ b/indra/newview/llgroupmgr.h @@ -258,6 +258,11 @@ public: bool isRoleMemberDataComplete() { return mRoleMemberDataComplete; } bool isGroupPropertiesDataComplete() { return mGroupPropertiesDataComplete; } + bool isMemberDataPending() { return mMemberRequestID.notNull(); } + bool isRoleDataPending() { return mRoleDataRequestID.notNull(); } + bool isRoleMemberDataPending() { return (mRoleMembersRequestID.notNull() || mPendingRoleMemberRequest); } + bool isGroupTitlePending() { return mTitlesRequestID.notNull(); } + bool isSingleMemberNotOwner(); F32 getAccessTime() const { return mAccessTime; } diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index 197408b40e..7271376a3c 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -240,7 +240,7 @@ void LLHintPopup::draw() } else { - LLView* targetp = LLHints::getHintTarget(mTarget).get(); + LLView* targetp = LLHints::getInstance()->getHintTarget(mTarget).get(); if (!targetp) { // target widget is no longer valid, go away @@ -349,10 +349,20 @@ void LLHintPopup::draw() } -LLRegistry<std::string, LLHandle<LLView> > LLHints::sTargetRegistry; -std::map<LLNotificationPtr, class LLHintPopup*> LLHints::sHints; +/// LLHints + +LLHints::LLHints() +{ + LLControlVariablePtr control = gSavedSettings.getControl("EnableUIHints"); + mControlConnection = control->getSignal()->connect(boost::bind(&LLHints::showHints, this, _2)); + gViewerWindow->getHintHolder()->setVisible(control->getValue().asBoolean()); +} + +LLHints::~LLHints() +{ + mControlConnection.disconnect(); +} -//static void LLHints::show(LLNotificationPtr hint) { LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams<LLHintPopup>()); @@ -365,7 +375,7 @@ void LLHints::show(LLNotificationPtr hint) { LLHintPopup* popup = new LLHintPopup(p); - sHints[hint] = popup; + mHints[hint] = popup; LLView* hint_holder = gViewerWindow->getHintHolder(); if (hint_holder) @@ -376,27 +386,24 @@ void LLHints::show(LLNotificationPtr hint) } } -//static void LLHints::hide(LLNotificationPtr hint) { - hint_map_t::iterator found_it = sHints.find(hint); - if (found_it != sHints.end()) + hint_map_t::iterator found_it = mHints.find(hint); + if (found_it != mHints.end()) { found_it->second->hide(); - sHints.erase(found_it); + mHints.erase(found_it); } } -//static void LLHints::registerHintTarget(const std::string& name, LLHandle<LLView> target) { - sTargetRegistry.defaultRegistrar().replace(name, target); + mTargetRegistry.defaultRegistrar().replace(name, target); } -//static LLHandle<LLView> LLHints::getHintTarget(const std::string& name) { - LLHandle<LLView>* handlep = sTargetRegistry.getValue(name); + LLHandle<LLView>* handlep = mTargetRegistry.getValue(name); if (handlep) { return *handlep; @@ -407,18 +414,6 @@ LLHandle<LLView> LLHints::getHintTarget(const std::string& name) } } -//static -void LLHints::initClass() -{ - sRegister.reference(); - - LLControlVariablePtr control = gSavedSettings.getControl("EnableUIHints"); - control->getSignal()->connect(boost::bind(&showHints, _2)); - gViewerWindow->getHintHolder()->setVisible(control->getValue().asBoolean()); - -} - -//staic void LLHints::showHints(const LLSD& show) { bool visible = show.asBoolean(); diff --git a/indra/newview/llhints.h b/indra/newview/llhints.h index dd6195a9ce..1f730734d0 100644 --- a/indra/newview/llhints.h +++ b/indra/newview/llhints.h @@ -32,19 +32,22 @@ #include "llinitdestroyclass.h" -class LLHints : public LLInitClass<LLHints> +class LLHints : public LLSingleton<LLHints> { + LLSINGLETON(LLHints); + ~LLHints(); public: - static void show(LLNotificationPtr hint); - static void hide(LLNotificationPtr hint); - static void registerHintTarget(const std::string& name, LLHandle<LLView> target); - static LLHandle<LLView> getHintTarget(const std::string& name); - static void initClass(); + void show(LLNotificationPtr hint); + void hide(LLNotificationPtr hint); + void registerHintTarget(const std::string& name, LLHandle<LLView> target); + LLHandle<LLView> getHintTarget(const std::string& name); private: - static LLRegistry<std::string, LLHandle<LLView> > sTargetRegistry; + LLRegistry<std::string, LLHandle<LLView> > mTargetRegistry; typedef std::map<LLNotificationPtr, class LLHintPopup*> hint_map_t; - static hint_map_t sHints; - static void showHints(const LLSD& show); + hint_map_t mHints; + void showHints(const LLSD& show); + + boost::signals2::connection mControlConnection; }; diff --git a/indra/newview/llimagefiltersmanager.cpp b/indra/newview/llimagefiltersmanager.cpp index ee6b39efac..c23cdc8103 100644 --- a/indra/newview/llimagefiltersmanager.cpp +++ b/indra/newview/llimagefiltersmanager.cpp @@ -48,7 +48,7 @@ LLImageFiltersManager::~LLImageFiltersManager() { } -// virtual static +// virtual void LLImageFiltersManager::initSingleton() { loadAllFilters(); diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index d59c301210..3606a439a6 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -695,7 +695,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, // The group notice packet does not have an AgentID. Obtain one from the name cache. // If last name is "Resident" strip it out so the cache name lookup works. std::string legacy_name = gCacheName->buildLegacyName(original_name); - agent_id = LLAvatarNameCache::findIdByName(legacy_name); + agent_id = LLAvatarNameCache::getInstance()->findIdByName(legacy_name); if (agent_id.isNull()) { diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 0f5d514660..e331a51bda 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -83,11 +83,6 @@ void startConfrenceCoro(std::string url, LLUUID tempSessionId, LLUUID creatorId, void chatterBoxInvitationCoro(std::string url, LLUUID sessionId, LLIMMgr::EInvitationType invitationType); void start_deprecated_conference_chat(const LLUUID& temp_session_id, const LLUUID& creator_id, const LLUUID& other_participant_id, const LLSD& agents_to_invite); -std::string LLCallDialogManager::sPreviousSessionlName = ""; -LLIMModel::LLIMSession::SType LLCallDialogManager::sPreviousSessionType = LLIMModel::LLIMSession::P2P_SESSION; -std::string LLCallDialogManager::sCurrentSessionlName = ""; -LLIMModel::LLIMSession* LLCallDialogManager::sSession = NULL; -LLVoiceChannel::EState LLCallDialogManager::sOldState = LLVoiceChannel::STATE_READY; const LLUUID LLOutgoingCallDialog::OCD_KEY = LLUUID("7CF78E11-0CFE-498D-ADB9-1417BF03DDB4"); // // Globals @@ -811,7 +806,7 @@ void LLIMModel::LLIMSession::addMessagesFromHistory(const std::list<LLSD>& histo { // convert it to a legacy name if we have a complete name std::string legacy_name = gCacheName->buildLegacyName(from); - from_id = LLAvatarNameCache::findIdByName(legacy_name); + from_id = LLAvatarNameCache::getInstance()->findIdByName(legacy_name); } std::string timestamp = msg[LL_IM_TIME]; @@ -1786,7 +1781,12 @@ LLIMMgr::onConfirmForceCloseError( // Class LLCallDialogManager //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LLCallDialogManager::LLCallDialogManager() +LLCallDialogManager::LLCallDialogManager(): +mPreviousSessionlName(""), +mPreviousSessionType(LLIMModel::LLIMSession::P2P_SESSION), +mCurrentSessionlName(""), +mSession(NULL), +mOldState(LLVoiceChannel::STATE_READY) { } @@ -1794,39 +1794,45 @@ LLCallDialogManager::~LLCallDialogManager() { } -void LLCallDialogManager::initClass() +void LLCallDialogManager::initSingleton() { LLVoiceChannel::setCurrentVoiceChannelChangedCallback(LLCallDialogManager::onVoiceChannelChanged); } +// static void LLCallDialogManager::onVoiceChannelChanged(const LLUUID &session_id) { + LLCallDialogManager::getInstance()->onVoiceChannelChangedInt(session_id); +} + +void LLCallDialogManager::onVoiceChannelChangedInt(const LLUUID &session_id) +{ LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(session_id); if(!session) { - sPreviousSessionlName = sCurrentSessionlName; - sCurrentSessionlName = ""; // Empty string results in "Nearby Voice Chat" after substitution + mPreviousSessionlName = mCurrentSessionlName; + mCurrentSessionlName = ""; // Empty string results in "Nearby Voice Chat" after substitution return; } - if (sSession) + if (mSession) { // store previous session type to process Avaline calls in dialogs - sPreviousSessionType = sSession->mSessionType; + mPreviousSessionType = mSession->mSessionType; } - sSession = session; + mSession = session; static boost::signals2::connection prev_channel_state_changed_connection; // disconnect previously connected callback to avoid have invalid sSession in onVoiceChannelStateChanged() prev_channel_state_changed_connection.disconnect(); prev_channel_state_changed_connection = - sSession->mVoiceChannel->setStateChangedCallback(boost::bind(LLCallDialogManager::onVoiceChannelStateChanged, _1, _2, _3, _4)); + mSession->mVoiceChannel->setStateChangedCallback(boost::bind(LLCallDialogManager::onVoiceChannelStateChanged, _1, _2, _3, _4)); - if(sCurrentSessionlName != session->mName) + if(mCurrentSessionlName != session->mName) { - sPreviousSessionlName = sCurrentSessionlName; - sCurrentSessionlName = session->mName; + mPreviousSessionlName = mCurrentSessionlName; + mCurrentSessionlName = session->mName; } if (LLVoiceChannel::getCurrentVoiceChannel()->getState() == LLVoiceChannel::STATE_CALL_STARTED && @@ -1835,14 +1841,14 @@ void LLCallDialogManager::onVoiceChannelChanged(const LLUUID &session_id) //*TODO get rid of duplicated code LLSD mCallDialogPayload; - mCallDialogPayload["session_id"] = sSession->mSessionID; - mCallDialogPayload["session_name"] = sSession->mName; - mCallDialogPayload["other_user_id"] = sSession->mOtherParticipantID; - mCallDialogPayload["old_channel_name"] = sPreviousSessionlName; - mCallDialogPayload["old_session_type"] = sPreviousSessionType; + mCallDialogPayload["session_id"] = mSession->mSessionID; + mCallDialogPayload["session_name"] = mSession->mName; + mCallDialogPayload["other_user_id"] = mSession->mOtherParticipantID; + mCallDialogPayload["old_channel_name"] = mPreviousSessionlName; + mCallDialogPayload["old_session_type"] = mPreviousSessionType; mCallDialogPayload["state"] = LLVoiceChannel::STATE_CALL_STARTED; - mCallDialogPayload["disconnected_channel_name"] = sSession->mName; - mCallDialogPayload["session_type"] = sSession->mSessionType; + mCallDialogPayload["disconnected_channel_name"] = mSession->mName; + mCallDialogPayload["session_type"] = mSession->mSessionType; LLOutgoingCallDialog* ocd = LLFloaterReg::getTypedInstance<LLOutgoingCallDialog>("outgoing_call", LLOutgoingCallDialog::OCD_KEY); if(ocd) @@ -1853,26 +1859,32 @@ void LLCallDialogManager::onVoiceChannelChanged(const LLUUID &session_id) } +// static void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state, const LLVoiceChannel::EDirection& direction, bool ended_by_agent) { + LLCallDialogManager::getInstance()->onVoiceChannelStateChangedInt(old_state, new_state, direction, ended_by_agent); +} + +void LLCallDialogManager::onVoiceChannelStateChangedInt(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state, const LLVoiceChannel::EDirection& direction, bool ended_by_agent) +{ LLSD mCallDialogPayload; LLOutgoingCallDialog* ocd = NULL; - if(sOldState == new_state) + if(mOldState == new_state) { return; } - sOldState = new_state; + mOldState = new_state; - mCallDialogPayload["session_id"] = sSession->mSessionID; - mCallDialogPayload["session_name"] = sSession->mName; - mCallDialogPayload["other_user_id"] = sSession->mOtherParticipantID; - mCallDialogPayload["old_channel_name"] = sPreviousSessionlName; - mCallDialogPayload["old_session_type"] = sPreviousSessionType; + mCallDialogPayload["session_id"] = mSession->mSessionID; + mCallDialogPayload["session_name"] = mSession->mName; + mCallDialogPayload["other_user_id"] = mSession->mOtherParticipantID; + mCallDialogPayload["old_channel_name"] = mPreviousSessionlName; + mCallDialogPayload["old_session_type"] = mPreviousSessionType; mCallDialogPayload["state"] = new_state; - mCallDialogPayload["disconnected_channel_name"] = sSession->mName; - mCallDialogPayload["session_type"] = sSession->mSessionType; + mCallDialogPayload["disconnected_channel_name"] = mSession->mName; + mCallDialogPayload["session_type"] = mSession->mSessionType; mCallDialogPayload["ended_by_agent"] = ended_by_agent; switch(new_state) @@ -1887,7 +1899,7 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat case LLVoiceChannel::STATE_HUNG_UP: // this state is coming before session is changed, so, put it into payload map - mCallDialogPayload["old_session_type"] = sSession->mSessionType; + mCallDialogPayload["old_session_type"] = mSession->mSessionType; break; case LLVoiceChannel::STATE_CONNECTED : @@ -1925,7 +1937,7 @@ LLCallDialog::LLCallDialog(const LLSD& payload) LLCallDialog::~LLCallDialog() { - LLUI::removePopup(this); + LLUI::getInstance()->removePopup(this); } BOOL LLCallDialog::postBuild() @@ -2002,7 +2014,7 @@ void LLCallDialog::onOpen(const LLSD& key) LLDockableFloater::onOpen(key); // it should be over the all floaters. EXT-5116 - LLUI::addPopup(this); + LLUI::getInstance()->addPopup(this); } void LLCallDialog::setIcon(const LLSD& session_id, const LLSD& participant_id) diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 81d3ffa1a6..2a9e4679a8 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -499,22 +499,26 @@ private: LLSD mPendingAgentListUpdates; }; -class LLCallDialogManager : public LLInitClass<LLCallDialogManager> +class LLCallDialogManager : public LLSingleton<LLCallDialogManager> { -public: - LLCallDialogManager(); + LLSINGLETON(LLCallDialogManager); ~LLCallDialogManager(); - - static void initClass(); +public: + // static for convinience static void onVoiceChannelChanged(const LLUUID &session_id); static void onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state, const LLVoiceChannel::EDirection& direction, bool ended_by_agent); +private: + void initSingleton(); + void onVoiceChannelChangedInt(const LLUUID &session_id); + void onVoiceChannelStateChangedInt(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state, const LLVoiceChannel::EDirection& direction, bool ended_by_agent); + protected: - static std::string sPreviousSessionlName; - static LLIMModel::LLIMSession::SType sPreviousSessionType; - static std::string sCurrentSessionlName; - static LLIMModel::LLIMSession* sSession; - static LLVoiceChannel::EState sOldState; + std::string mPreviousSessionlName; + LLIMModel::LLIMSession::SType mPreviousSessionType; + std::string mCurrentSessionlName; + LLIMModel::LLIMSession* mSession; + LLVoiceChannel::EState mOldState; }; class LLCallDialog : public LLDockableFloater diff --git a/indra/newview/llinspect.cpp b/indra/newview/llinspect.cpp index e6cb068613..479e8f9abf 100644 --- a/indra/newview/llinspect.cpp +++ b/indra/newview/llinspect.cpp @@ -28,7 +28,7 @@ #include "lltooltip.h" #include "llcontrol.h" // LLCachedControl -#include "llui.h" // LLUI::sSettingsGroups +#include "llui.h" // LLUI::getInstance()->mSettingsGroups #include "llviewermenu.h" LLInspect::LLInspect(const LLSD& key) @@ -45,8 +45,8 @@ LLInspect::~LLInspect() // virtual 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); + static LLCachedControl<F32> FADE_TIME(*LLUI::getInstance()->mSettingGroups["config"], "InspectorFadeTime", 1.f); + static LLCachedControl<F32> STAY_TIME(*LLUI::getInstance()->mSettingGroups["config"], "InspectorShowTime", 1.f); if (mOpenTimer.getStarted()) { LLFloater::draw(); @@ -113,7 +113,7 @@ BOOL LLInspect::handleToolTip(S32 x, S32 y, MASK mask) params.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLInspector>()); params.message = child_handler->getToolTip(); //set up delay if there is no visible tooltip at this moment - params.delay_time = LLToolTipMgr::instance().toolTipVisible() ? 0.f : LLUI::sSettingGroups["config"]->getF32( "ToolTipDelay" ); + params.delay_time = LLToolTipMgr::instance().toolTipVisible() ? 0.f : LLUI::getInstance()->mSettingGroups["config"]->getF32( "ToolTipDelay" ); LLToolTipMgr::instance().show(params); handled = TRUE; } @@ -137,7 +137,7 @@ bool LLInspect::childHasVisiblePopupMenu() LLRect floater_rc = calcScreenRect(); LLRect menu_screen_rc = child_menu->calcScreenRect(); S32 mx, my; - LLUI::getMousePositionScreen(&mx, &my); + LLUI::getInstance()->getMousePositionScreen(&mx, &my); // This works wrong if we spawn a menu near Inspector and menu overlaps Inspector. if(floater_rc.overlaps(menu_screen_rc) && menu_screen_rc.pointInRect(mx, my)) diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 88e7ad1b71..10814ac076 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -207,11 +207,11 @@ void LLInspectAvatar::onOpen(const LLSD& data) // See LLToolTipMgr::createToolTip if (data.has("pos")) { - LLUI::positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger()); + LLUI::getInstance()->positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger()); } else { - LLUI::positionViewNearMouse(this); + LLUI::getInstance()->positionViewNearMouse(this); } // Generate link to avatar profile. diff --git a/indra/newview/llinspectgroup.cpp b/indra/newview/llinspectgroup.cpp index 8332443162..fa8a53c546 100644 --- a/indra/newview/llinspectgroup.cpp +++ b/indra/newview/llinspectgroup.cpp @@ -129,11 +129,11 @@ void LLInspectGroup::onOpen(const LLSD& data) // See LLToolTipMgr::createToolTip if (data.has("pos")) { - LLUI::positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger()); + LLUI::getInstance()->positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger()); } else { - LLUI::positionViewNearMouse(this); + LLUI::getInstance()->positionViewNearMouse(this); } // can't call from constructor as widgets are not built yet diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp index 46019557f8..f78a5cc64e 100644 --- a/indra/newview/llinspectobject.cpp +++ b/indra/newview/llinspectobject.cpp @@ -202,11 +202,11 @@ void LLInspectObject::onOpen(const LLSD& data) // See LLToolTipMgr::createToolTip if (data.has("pos")) { - LLUI::positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger()); + LLUI::getInstance()->positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger()); } else { - LLUI::positionViewNearMouse(this); + LLUI::getInstance()->positionViewNearMouse(this); } // Promote hovered object to a complete selection, which will also force @@ -241,7 +241,7 @@ void LLInspectObject::onOpen(const LLSD& data) if(!mMediaEntry) return; - mMediaImpl = LLViewerMedia::getMediaImplFromTextureID(mMediaEntry->getMediaID()); + mMediaImpl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(mMediaEntry->getMediaID()); } } @@ -300,7 +300,7 @@ void LLInspectObject::update() if(!mMediaEntry) return; - mMediaImpl = LLViewerMedia::getMediaImplFromTextureID(mMediaEntry->getMediaID()); + mMediaImpl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(mMediaEntry->getMediaID()); updateMediaCurrentURL(); updateSecureBrowsing(); diff --git a/indra/newview/llinspectremoteobject.cpp b/indra/newview/llinspectremoteobject.cpp index b64df2bd47..272c8acbd5 100644 --- a/indra/newview/llinspectremoteobject.cpp +++ b/indra/newview/llinspectremoteobject.cpp @@ -116,11 +116,11 @@ void LLInspectRemoteObject::onOpen(const LLSD& data) // See LLToolTipMgr::createToolTip if (data.has("pos")) { - LLUI::positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger()); + LLUI::getInstance()->positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger()); } else { - LLUI::positionViewNearMouse(this); + LLUI::getInstance()->positionViewNearMouse(this); } } diff --git a/indra/newview/llinspecttoast.cpp b/indra/newview/llinspecttoast.cpp index 47560341e7..d0034eff13 100644 --- a/indra/newview/llinspecttoast.cpp +++ b/indra/newview/llinspecttoast.cpp @@ -110,7 +110,7 @@ void LLInspectToast::onOpen(const LLSD& notification_id) panel_rect = panel->getRect(); reshape(panel_rect.getWidth(), panel_rect.getHeight()); - LLUI::positionViewNearMouse(this); + LLUI::getInstance()->positionViewNearMouse(this); } // virtual diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 074b0c9c14..349ba6183b 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -107,6 +107,7 @@ bool move_task_inventory_callback(const LLSD& notification, const LLSD& response bool confirm_attachment_rez(const LLSD& notification, const LLSD& response); void teleport_via_landmark(const LLUUID& asset_id); static BOOL can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_current_outfit); +static bool can_move_to_my_outfits(LLInventoryModel* model, LLInventoryCategory* inv_cat, U32 wear_limit); static BOOL can_move_to_landmarks(LLInventoryItem* inv_item); static bool check_category(LLInventoryModel* model, const LLUUID& cat_id, @@ -1399,13 +1400,6 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, // Only should happen for broken links. new_listener = new LLLinkItemBridge(inventory, root, uuid); break; - case LLAssetType::AT_MESH: - if(!(inv_type == LLInventoryType::IT_MESH)) - { - LL_WARNS() << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << LL_ENDL; - } - new_listener = new LLMeshBridge(inventory, root, uuid); - break; case LLAssetType::AT_UNKNOWN: new_listener = new LLUnknownItemBridge(inventory, root, uuid); break; @@ -2101,7 +2095,9 @@ BOOL LLItemBridge::isItemCopyable() const LLViewerInventoryItem* item = getItem(); if (item) { - // Can't copy worn objects. DEV-15183 + // Can't copy worn objects. + // Worn objects are tied to their inworld conterparts + // Copy of modified worn object will return object with obsolete asset and inventory if(get_is_item_worn(mUUID)) { return FALSE; @@ -2274,7 +2270,7 @@ public: // Can be destroyed (or moved to trash) BOOL LLFolderBridge::isItemRemovable() const { - if (!get_is_category_removable(getInventoryModel(), mUUID)) + if (!get_is_category_removable(getInventoryModel(), mUUID) || isMarketplaceListingsFolder()) { return FALSE; } @@ -2290,11 +2286,6 @@ BOOL LLFolderBridge::isItemRemovable() const return FALSE; } } - - if (isMarketplaceListingsFolder() && LLMarketplaceData::instance().getActivationState(mUUID)) - { - return FALSE; - } return TRUE; } @@ -2516,9 +2507,28 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, is_movable = FALSE; // tooltip? } + + U32 max_items_to_wear = gSavedSettings.getU32("WearFolderLimit"); if (is_movable && move_is_into_outfit) { - if((mUUID == my_outifts_id) || (getCategory() && getCategory()->getPreferredType() == LLFolderType::FT_NONE)) + if (mUUID == my_outifts_id) + { + if (source != LLToolDragAndDrop::SOURCE_AGENT || move_is_from_marketplacelistings) + { + tooltip_msg = LLTrans::getString("TooltipOutfitNotInInventory"); + is_movable = false; + } + else if (can_move_to_my_outfits(model, inv_cat, max_items_to_wear)) + { + is_movable = true; + } + else + { + tooltip_msg = LLTrans::getString("TooltipCantCreateOutfit"); + is_movable = false; + } + } + else if(getCategory() && getCategory()->getPreferredType() == LLFolderType::FT_NONE) { is_movable = ((inv_cat->getPreferredType() == LLFolderType::FT_NONE) || (inv_cat->getPreferredType() == LLFolderType::FT_OUTFIT)); } @@ -2563,7 +2573,6 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } } - U32 max_items_to_wear = gSavedSettings.getU32("WearFolderLimit"); if (is_movable && move_is_into_current_outfit && descendent_items.size() > max_items_to_wear) @@ -2718,8 +2727,14 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } + if (mUUID == my_outifts_id) + { + // Category can contains objects, + // create a new folder and populate it with links to original objects + dropToMyOutfits(inv_cat); + } // if target is current outfit folder we use link - if (move_is_into_current_outfit && + else if (move_is_into_current_outfit && (inv_cat->getPreferredType() == LLFolderType::FT_NONE || inv_cat->getPreferredType() == LLFolderType::FT_OUTFIT)) { @@ -3729,12 +3744,40 @@ void LLFolderBridge::perform_pasteFromClipboard() return; } } - if (move_is_into_current_outfit || move_is_into_outfit) + if (move_is_into_outfit) + { + if (!move_is_into_my_outfits && item && can_move_to_outfit(item, move_is_into_current_outfit)) + { + dropToOutfit(item, move_is_into_current_outfit); + } + else if (move_is_into_my_outfits && LLAssetType::AT_CATEGORY == obj->getType()) + { + LLInventoryCategory* cat = model->getCategory(item_id); + U32 max_items_to_wear = gSavedSettings.getU32("WearFolderLimit"); + if (cat && can_move_to_my_outfits(model, cat, max_items_to_wear)) + { + dropToMyOutfits(cat); + } + else + { + LLNotificationsUtil::add("MyOutfitsPasteFailed"); + } + } + else + { + LLNotificationsUtil::add("MyOutfitsPasteFailed"); + } + } + else if (move_is_into_current_outfit) { if (item && can_move_to_outfit(item, move_is_into_current_outfit)) { dropToOutfit(item, move_is_into_current_outfit); } + else + { + LLNotificationsUtil::add("MyOutfitsPasteFailed"); + } } else if (move_is_into_favorites) { @@ -4680,6 +4723,46 @@ static BOOL can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_curr return TRUE; } +// Returns true if folder's content can be moved to Current Outfit or any outfit folder. +static bool can_move_to_my_outfits(LLInventoryModel* model, LLInventoryCategory* inv_cat, U32 wear_limit) +{ + LLInventoryModel::cat_array_t *cats; + LLInventoryModel::item_array_t *items; + model->getDirectDescendentsOf(inv_cat->getUUID(), cats, items); + + if (items->size() > wear_limit) + { + return false; + } + + if (items->size() == 0) + { + // Nothing to move(create) + return false; + } + + if (cats->size() > 0) + { + // We do not allow subfolders in outfits of "My Outfits" yet + return false; + } + + LLInventoryModel::item_array_t::iterator iter = items->begin(); + LLInventoryModel::item_array_t::iterator end = items->end(); + + while (iter != end) + { + LLViewerInventoryItem *item = *iter; + if (!can_move_to_outfit(item, false)) + { + return false; + } + iter++; + } + + return true; +} + // Returns TRUE if item is a landmark or a link to a landmark // and can be moved to Favorites or Landmarks folder. static BOOL can_move_to_landmarks(LLInventoryItem* inv_item) @@ -4748,6 +4831,56 @@ void LLFolderBridge::dropToOutfit(LLInventoryItem* inv_item, BOOL move_is_into_c } } +void LLFolderBridge::dropToMyOutfits(LLInventoryCategory* inv_cat) +{ + // make a folder in the My Outfits directory. + const LLUUID dest_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); + + // Note: creation will take time, so passing folder id to callback is slightly unreliable, + // but so is collecting and passing descendants' ids + inventory_func_type func = boost::bind(&LLFolderBridge::outfitFolderCreatedCallback, this, inv_cat->getUUID(), _1); + gInventory.createNewCategory(dest_id, + LLFolderType::FT_OUTFIT, + inv_cat->getName(), + func); +} + +void LLFolderBridge::outfitFolderCreatedCallback(LLUUID cat_source_id, LLUUID cat_dest_id) +{ + LLInventoryModel::cat_array_t* categories; + LLInventoryModel::item_array_t* items; + getInventoryModel()->getDirectDescendentsOf(cat_source_id, categories, items); + + LLInventoryObject::const_object_list_t link_array; + + + LLInventoryModel::item_array_t::iterator iter = items->begin(); + LLInventoryModel::item_array_t::iterator end = items->end(); + while (iter!=end) + { + const LLViewerInventoryItem* item = (*iter); + // By this point everything is supposed to be filtered, + // but there was a delay to create folder so something could have changed + LLInventoryType::EType inv_type = item->getInventoryType(); + if ((inv_type == LLInventoryType::IT_WEARABLE) || + (inv_type == LLInventoryType::IT_GESTURE) || + (inv_type == LLInventoryType::IT_ATTACHMENT) || + (inv_type == LLInventoryType::IT_OBJECT) || + (inv_type == LLInventoryType::IT_SNAPSHOT) || + (inv_type == LLInventoryType::IT_TEXTURE)) + { + link_array.push_back(LLConstPointer<LLInventoryObject>(item)); + } + iter++; + } + + if (!link_array.empty()) + { + LLPointer<LLInventoryCallback> cb = NULL; + link_inventory_array(cat_dest_id, link_array, cb); + } +} + // Callback for drop item if DAMA required... void LLFolderBridge::callback_dropItemIntoFolder(const LLSD& notification, const LLSD& response, LLInventoryItem* inv_item) { @@ -6830,58 +6963,6 @@ void LLLinkItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags) hide_context_entries(menu, items, disabled_items); } -// +=================================================+ -// | LLMeshBridge | -// +=================================================+ - -LLUIImagePtr LLMeshBridge::getIcon() const -{ - return LLInventoryIcon::getIcon(LLAssetType::AT_MESH, LLInventoryType::IT_MESH, 0, FALSE); -} - -void LLMeshBridge::openItem() -{ - LLViewerInventoryItem* item = getItem(); - - if (item) - { - // open mesh - } -} - -void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags) -{ - LL_DEBUGS() << "LLMeshBridge::buildContextMenu()" << LL_ENDL; - std::vector<std::string> items; - std::vector<std::string> disabled_items; - - if(isItemInTrash()) - { - 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 if (isMarketplaceListingsFolder()) - { - addMarketplaceContextMenuOptions(flags, items, disabled_items); - items.push_back(std::string("Properties")); - getClipboardEntries(false, items, disabled_items, flags); - } - else - { - items.push_back(std::string("Properties")); - - getClipboardEntries(true, items, disabled_items, flags); - } - - addLinkReplaceMenuOption(items, disabled_items); - hide_context_entries(menu, items, disabled_items); -} - // +=================================================+ // | LLLinkBridge | @@ -7358,8 +7439,7 @@ bool LLFolderViewGroupedItemBridge::canWearSelected(uuid_vec_t item_ids) for (uuid_vec_t::const_iterator it = item_ids.begin(); it != item_ids.end(); ++it) { LLViewerInventoryItem* item = gInventory.getItem(*it); - LLAssetType::EType asset_type = item->getType(); - if (!item || (asset_type >= LLAssetType::AT_COUNT) || (asset_type <= LLAssetType::AT_NONE)) + if (!item || (item->getType() >= LLAssetType::AT_COUNT) || (item->getType() <= LLAssetType::AT_NONE)) { return false; } diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index ce06e8fffc..0823cf8b52 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -359,6 +359,7 @@ protected: void dropToFavorites(LLInventoryItem* inv_item); void dropToOutfit(LLInventoryItem* inv_item, BOOL move_is_into_current_outfit); + void dropToMyOutfits(LLInventoryCategory* inv_cat); //-------------------------------------------------------------------- // Messy hacks for handling folder options @@ -368,6 +369,7 @@ public: static void staticFolderOptionsMenu(); protected: + void outfitFolderCreatedCallback(LLUUID cat_source_id, LLUUID cat_dest_id); void callback_pasteFromClipboard(const LLSD& notification, const LLSD& response); void perform_pasteFromClipboard(); void gatherMessage(std::string& message, S32 depth, LLError::ELevel log_level); @@ -603,23 +605,6 @@ protected: static std::string sPrefix; }; - -class LLMeshBridge : public LLItemBridge -{ - friend class LLInvFVBridge; -public: - virtual LLUIImagePtr getIcon() const; - virtual void openItem(); - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - -protected: - LLMeshBridge(LLInventoryPanel* inventory, - LLFolderView* root, - const LLUUID& uuid) : - LLItemBridge(inventory, root, uuid) {} -}; - - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInvFVBridgeAction // @@ -650,17 +635,6 @@ protected: LLInventoryModel* mModel; }; -class LLMeshBridgeAction: public LLInvFVBridgeAction -{ - friend class LLInvFVBridgeAction; -public: - virtual void doIt() ; - virtual ~LLMeshBridgeAction(){} -protected: - LLMeshBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} - -}; - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Recent Inventory Panel related classes diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 9193613e9f..16385928b4 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -58,6 +58,7 @@ LLInventoryFilter::FilterOps::FilterOps(const Params& p) mHoursAgo(p.hours_ago), mDateSearchDirection(p.date_search_direction), mShowFolderState(p.show_folder_state), + mFilterCreatorType(p.creator_type), mPermissions(p.permissions), mFilterTypes(p.types), mFilterUUID(p.uuid), @@ -78,8 +79,7 @@ LLInventoryFilter::LLInventoryFilter(const Params& p) mCurrentGeneration(0), mFirstRequiredGeneration(0), mFirstSuccessGeneration(0), - mSearchType(SEARCHTYPE_NAME), - mFilterCreatorType(FILTERCREATOR_ALL) + mSearchType(SEARCHTYPE_NAME) { // copy mFilterOps into mDefaultFilterOps markDefault(); @@ -489,7 +489,7 @@ bool LLInventoryFilter::checkAgainstCreator(const LLFolderViewModelItemInventory { if (!listener) return TRUE; const BOOL is_folder = listener->getInventoryType() == LLInventoryType::IT_CATEGORY; - switch(mFilterCreatorType) + switch (mFilterOps.mFilterCreatorType) { case FILTERCREATOR_SELF: if(is_folder) return FALSE; @@ -601,9 +601,9 @@ void LLInventoryFilter::setSearchType(ESearchType type) void LLInventoryFilter::setFilterCreator(EFilterCreatorType type) { - if(mFilterCreatorType != type) + if (mFilterOps.mFilterCreatorType != type) { - mFilterCreatorType = type; + mFilterOps.mFilterCreatorType = type; setModified(); } } @@ -1194,6 +1194,7 @@ void LLInventoryFilter::toParams(Params& params) const params.filter_ops.hours_ago = getHoursAgo(); params.filter_ops.date_search_direction = getDateSearchDirection(); params.filter_ops.show_folder_state = getShowFolderState(); + params.filter_ops.creator_type = getFilterCreatorType(); params.filter_ops.permissions = getFilterPermissions(); params.substring = getFilterSubString(); params.since_logoff = isSinceLogoff(); @@ -1216,6 +1217,7 @@ void LLInventoryFilter::fromParams(const Params& params) setHoursAgo(params.filter_ops.hours_ago); setDateSearchDirection(params.filter_ops.date_search_direction); setShowFolderState(params.filter_ops.show_folder_state); + setFilterCreator(params.filter_ops.creator_type); setFilterPermissions(params.filter_ops.permissions); setFilterSubString(params.substring); setDateRangeLastLogoff(params.since_logoff); @@ -1278,6 +1280,11 @@ LLInventoryFilter::EFolderShow LLInventoryFilter::getShowFolderState() const return mFilterOps.mShowFolderState; } +LLInventoryFilter::EFilterCreatorType LLInventoryFilter::getFilterCreatorType() const +{ + return mFilterOps.mFilterCreatorType; +} + bool LLInventoryFilter::isTimedOut() { return mFilterTime.hasExpired(); diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index 01754ed023..4a1fec8454 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -126,6 +126,7 @@ public: Optional<U32> date_search_direction; Optional<EFolderShow> show_folder_state; Optional<PermissionMask> permissions; + Optional<EFilterCreatorType> creator_type; Params() : types("filter_types", FILTERTYPE_OBJECT), @@ -138,6 +139,7 @@ public: hours_ago("hours_ago", 0), date_search_direction("date_search_direction", FILTERDATEDIRECTION_NEWER), show_folder_state("show_folder_state", SHOW_NON_EMPTY_FOLDERS), + creator_type("creator_type", FILTERCREATOR_ALL), permissions("permissions", PERM_NONE) {} }; @@ -156,8 +158,9 @@ public: U32 mHoursAgo; U32 mDateSearchDirection; - EFolderShow mShowFolderState; - PermissionMask mPermissions; + EFolderShow mShowFolderState; + PermissionMask mPermissions; + EFilterCreatorType mFilterCreatorType; }; struct Params : public LLInitParam::Block<Params> @@ -202,7 +205,6 @@ public: void setSearchType(ESearchType type); ESearchType getSearchType() { return mSearchType; } void setFilterCreator(EFilterCreatorType type); - EFilterCreatorType getFilterCreator() { return mFilterCreatorType; } void setFilterSubString(const std::string& string); const std::string& getFilterSubString(BOOL trim = FALSE) const; @@ -243,8 +245,9 @@ public: // +-------------------------------------------------------------------+ // + Presentation // +-------------------------------------------------------------------+ - void setShowFolderState( EFolderShow state); - EFolderShow getShowFolderState() const; + void setShowFolderState( EFolderShow state); + EFolderShow getShowFolderState() const; + EFilterCreatorType getFilterCreatorType() const; void setEmptyLookupMessage(const std::string& message); std::string getEmptyLookupMessage() const; @@ -324,7 +327,6 @@ private: std::string mEmptyLookupMessage; ESearchType mSearchType; - EFilterCreatorType mFilterCreatorType; }; #endif diff --git a/indra/newview/llinventoryicon.cpp b/indra/newview/llinventoryicon.cpp index d0df1c94d5..ee6e3dd384 100644 --- a/indra/newview/llinventoryicon.cpp +++ b/indra/newview/llinventoryicon.cpp @@ -83,6 +83,7 @@ LLIconDictionary::LLIconDictionary() addEntry(LLInventoryType::ICONNAME_CLOTHING_SKIRT, new IconEntry("Inv_Skirt")); addEntry(LLInventoryType::ICONNAME_CLOTHING_ALPHA, new IconEntry("Inv_Alpha")); addEntry(LLInventoryType::ICONNAME_CLOTHING_TATTOO, new IconEntry("Inv_Tattoo")); + addEntry(LLInventoryType::ICONNAME_CLOTHING_UNIVERSAL, new IconEntry("Inv_Universal")); addEntry(LLInventoryType::ICONNAME_ANIMATION, new IconEntry("Inv_Animation")); addEntry(LLInventoryType::ICONNAME_GESTURE, new IconEntry("Inv_Gesture")); diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index b140c7c38e..c49d61df31 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -888,14 +888,6 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item, U32 mask) return mask; } - // We're hiding mesh types -#if 0 - if (item->getType() == LLAssetType::AT_MESH) - { - return mask; - } -#endif - LLPointer<LLViewerInventoryItem> old_item = getItem(item->getUUID()); LLPointer<LLViewerInventoryItem> new_item; if(old_item) diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 760325b652..b8bde39bd1 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -69,9 +69,6 @@ /*=======================================*/ /* Formal declarations, constants, etc. */ /*=======================================*/ -std::list<LLLocalBitmap*> LLLocalBitmapMgr::sBitmapList; -LLLocalBitmapTimer LLLocalBitmapMgr::sTimer; -bool LLLocalBitmapMgr::sNeedsRebake; static const F32 LL_LOCAL_TIMER_HEARTBEAT = 3.0; static const BOOL LL_LOCAL_USE_MIPMAPS = true; @@ -131,7 +128,7 @@ LLLocalBitmap::~LLLocalBitmap() if(LL_LOCAL_REPLACE_ON_DEL && mValid && gAgentAvatarp) // fix for STORM-1837 { replaceIDs(mWorldID, IMG_DEFAULT); - LLLocalBitmapMgr::doRebake(); + LLLocalBitmapMgr::getInstance()->doRebake(); } // delete self from gimagelist @@ -381,6 +378,7 @@ void LLLocalBitmap::replaceIDs(LLUUID old_id, LLUUID new_id) updateUserLayers(old_id, new_id, LLWearableType::WT_SKIRT); updateUserLayers(old_id, new_id, LLWearableType::WT_SOCKS); updateUserLayers(old_id, new_id, LLWearableType::WT_TATTOO); + updateUserLayers(old_id, new_id, LLWearableType::WT_UNIVERSAL); updateUserLayers(old_id, new_id, LLWearableType::WT_UNDERPANTS); updateUserLayers(old_id, new_id, LLWearableType::WT_UNDERSHIRT); } @@ -512,7 +510,7 @@ void LLLocalBitmap::updateUserVolumes(LLUUID old_id, LLUUID new_id, U32 channel) { LLVOVolume* volobjp = (*old_texture->getVolumeList(channel))[volume_iter]; switch (channel) - { + { case LLRender::LIGHT_TEX: { if (volobjp->getLightTextureID() == old_id) @@ -526,19 +524,19 @@ void LLLocalBitmap::updateUserVolumes(LLUUID old_id, LLUUID new_id, U32 channel) LLViewerObject* object = (LLViewerObject*)volobjp; if (object) - { - if (object->isSculpted() && object->getVolume() && - object->getVolume()->getParams().getSculptID() == old_id) - { - LLSculptParams* old_params = (LLSculptParams*)object->getParameterEntry(LLNetworkData::PARAMS_SCULPT); - LLSculptParams new_params(*old_params); - new_params.setSculptTexture(new_id, (*old_params).getSculptType()); - object->setParameterEntry(LLNetworkData::PARAMS_SCULPT, new_params, TRUE); - } - } + { + if (object->isSculpted() && object->getVolume() && + object->getVolume()->getParams().getSculptID() == old_id) + { + LLSculptParams* old_params = (LLSculptParams*)object->getParameterEntry(LLNetworkData::PARAMS_SCULPT); + LLSculptParams new_params(*old_params); + new_params.setSculptTexture(new_id, (*old_params).getSculptType()); + object->setParameterEntry(LLNetworkData::PARAMS_SCULPT, new_params, TRUE); } } } + } + } } void LLLocalBitmap::updateUserLayers(LLUUID old_id, LLUUID new_id, LLWearableType::EType type) @@ -570,7 +568,7 @@ void LLLocalBitmap::updateUserLayers(LLUUID old_id, LLUUID new_id, LLWearableTyp gAgentAvatarp->setLocalTexture(reg_texind, gTextureList.getImage(new_id), FALSE, index); gAgentAvatarp->wearableUpdated(type); /* telling the manager to rebake once update cycle is fully done */ - LLLocalBitmapMgr::setNeedsRebake(); + LLLocalBitmapMgr::getInstance()->setNeedsRebake(); } } @@ -746,7 +744,7 @@ LLAvatarAppearanceDefines::ETextureIndex LLLocalBitmap::getTexIndex( case LLWearableType::WT_TATTOO: { - switch(baked_texind) + switch (baked_texind) { case LLAvatarAppearanceDefines::BAKED_HEAD: { @@ -764,6 +762,75 @@ LLAvatarAppearanceDefines::ETextureIndex LLLocalBitmap::getTexIndex( result = LLAvatarAppearanceDefines::TEX_UPPER_TATTOO; break; } + default: + { + break; + } + } + break; + + } + case LLWearableType::WT_UNIVERSAL: + { + switch (baked_texind) + { + + case LLAvatarAppearanceDefines::BAKED_SKIRT: + { + result = LLAvatarAppearanceDefines::TEX_SKIRT_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_EYES: + { + result = LLAvatarAppearanceDefines::TEX_EYES_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_HAIR: + { + result = LLAvatarAppearanceDefines::TEX_HAIR_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_LEFT_ARM: + { + result = LLAvatarAppearanceDefines::TEX_LEFT_ARM_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_LEFT_LEG: + { + result = LLAvatarAppearanceDefines::TEX_LEFT_LEG_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_AUX1: + { + result = LLAvatarAppearanceDefines::TEX_AUX1_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_AUX2: + { + result = LLAvatarAppearanceDefines::TEX_AUX2_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_AUX3: + { + result = LLAvatarAppearanceDefines::TEX_AUX3_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_UPPER: + { + result = LLAvatarAppearanceDefines::TEX_UPPER_UNIVERSAL_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_LOWER: + { + result = LLAvatarAppearanceDefines::TEX_LOWER_UNIVERSAL_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_HEAD: + { + result = LLAvatarAppearanceDefines::TEX_HEAD_UNIVERSAL_TATTOO; + break; + } + default: { @@ -835,7 +902,7 @@ bool LLLocalBitmapTimer::isRunning() BOOL LLLocalBitmapTimer::tick() { - LLLocalBitmapMgr::doUpdates(); + LLLocalBitmapMgr::getInstance()->doUpdates(); return FALSE; } @@ -844,17 +911,12 @@ BOOL LLLocalBitmapTimer::tick() /*=======================================*/ LLLocalBitmapMgr::LLLocalBitmapMgr() { - // The class is all made of static members, should i even bother instantiating? } LLLocalBitmapMgr::~LLLocalBitmapMgr() { -} - -void LLLocalBitmapMgr::cleanupClass() -{ - std::for_each(sBitmapList.begin(), sBitmapList.end(), DeletePointer()); - sBitmapList.clear(); + std::for_each(mBitmapList.begin(), mBitmapList.end(), DeletePointer()); + mBitmapList.clear(); } bool LLLocalBitmapMgr::addUnit() @@ -864,7 +926,7 @@ bool LLLocalBitmapMgr::addUnit() LLFilePicker& picker = LLFilePicker::instance(); if (picker.getMultipleOpenFiles(LLFilePicker::FFLOAD_IMAGE)) { - sTimer.stopTimer(); + mTimer.stopTimer(); std::string filename = picker.getFirstFile(); while(!filename.empty()) @@ -879,7 +941,7 @@ bool LLLocalBitmapMgr::addUnit() if (unit->getValid()) { - sBitmapList.push_back(unit); + mBitmapList.push_back(unit); add_successful = true; } else @@ -898,7 +960,7 @@ bool LLLocalBitmapMgr::addUnit() filename = picker.getNextFile(); } - sTimer.startTimer(); + mTimer.startTimer(); } return add_successful; @@ -937,10 +999,10 @@ bool LLLocalBitmapMgr::checkTextureDimensions(std::string filename) void LLLocalBitmapMgr::delUnit(LLUUID tracking_id) { - if (!sBitmapList.empty()) + if (!mBitmapList.empty()) { std::vector<LLLocalBitmap*> to_delete; - for (local_list_iter iter = sBitmapList.begin(); iter != sBitmapList.end(); iter++) + for (local_list_iter iter = mBitmapList.begin(); iter != mBitmapList.end(); iter++) { /* finding which ones we want deleted and making a separate list */ LLLocalBitmap* unit = *iter; if (unit->getTrackingID() == tracking_id) @@ -953,7 +1015,7 @@ void LLLocalBitmapMgr::delUnit(LLUUID tracking_id) del_iter != to_delete.end(); del_iter++) { /* iterating over a temporary list, hence preserving the iterator validity while deleting. */ LLLocalBitmap* unit = *del_iter; - sBitmapList.remove(unit); + mBitmapList.remove(unit); delete unit; unit = NULL; } @@ -964,7 +1026,7 @@ LLUUID LLLocalBitmapMgr::getWorldID(LLUUID tracking_id) { LLUUID world_id = LLUUID::null; - for (local_list_iter iter = sBitmapList.begin(); iter != sBitmapList.end(); iter++) + for (local_list_iter iter = mBitmapList.begin(); iter != mBitmapList.end(); iter++) { LLLocalBitmap* unit = *iter; if (unit->getTrackingID() == tracking_id) @@ -980,7 +1042,7 @@ std::string LLLocalBitmapMgr::getFilename(LLUUID tracking_id) { std::string filename = ""; - for (local_list_iter iter = sBitmapList.begin(); iter != sBitmapList.end(); iter++) + for (local_list_iter iter = mBitmapList.begin(); iter != mBitmapList.end(); iter++) { LLLocalBitmap* unit = *iter; if (unit->getTrackingID() == tracking_id) @@ -998,10 +1060,10 @@ void LLLocalBitmapMgr::feedScrollList(LLScrollListCtrl* ctrl) { ctrl->clearRows(); - if (!sBitmapList.empty()) + if (!mBitmapList.empty()) { - for (local_list_iter iter = sBitmapList.begin(); - iter != sBitmapList.end(); iter++) + for (local_list_iter iter = mBitmapList.begin(); + iter != mBitmapList.end(); iter++) { LLSD element; element["columns"][0]["column"] = "unit_name"; @@ -1022,29 +1084,29 @@ void LLLocalBitmapMgr::feedScrollList(LLScrollListCtrl* ctrl) void LLLocalBitmapMgr::doUpdates() { // preventing theoretical overlap in cases with huge number of loaded images. - sTimer.stopTimer(); - sNeedsRebake = false; + mTimer.stopTimer(); + mNeedsRebake = false; - for (local_list_iter iter = sBitmapList.begin(); iter != sBitmapList.end(); iter++) + for (local_list_iter iter = mBitmapList.begin(); iter != mBitmapList.end(); iter++) { (*iter)->updateSelf(); } doRebake(); - sTimer.startTimer(); + mTimer.startTimer(); } void LLLocalBitmapMgr::setNeedsRebake() { - sNeedsRebake = true; + mNeedsRebake = true; } void LLLocalBitmapMgr::doRebake() { /* separated that from doUpdates to insure a rebake can be called separately during deletion */ - if (sNeedsRebake) + if (mNeedsRebake) { gAgentAvatarp->forceBakeAllTextures(LL_LOCAL_SLAM_FOR_DEBUG); - sNeedsRebake = false; + mNeedsRebake = false; } } diff --git a/indra/newview/lllocalbitmaps.h b/indra/newview/lllocalbitmaps.h index ee4161fb45..f6cc1e919e 100644 --- a/indra/newview/lllocalbitmaps.h +++ b/indra/newview/lllocalbitmaps.h @@ -110,31 +110,28 @@ class LLLocalBitmapTimer : public LLEventTimer }; -class LLLocalBitmapMgr +class LLLocalBitmapMgr : public LLSingleton<LLLocalBitmapMgr> { - public: - LLLocalBitmapMgr(); - ~LLLocalBitmapMgr(); - - public: - static void cleanupClass(); - static bool addUnit(); - static void delUnit(LLUUID tracking_id); - static bool checkTextureDimensions(std::string filename); - - static LLUUID getWorldID(LLUUID tracking_id); - static std::string getFilename(LLUUID tracking_id); - - static void feedScrollList(LLScrollListCtrl* ctrl); - static void doUpdates(); - static void setNeedsRebake(); - static void doRebake(); - - private: - static std::list<LLLocalBitmap*> sBitmapList; - static LLLocalBitmapTimer sTimer; - static bool sNeedsRebake; - typedef std::list<LLLocalBitmap*>::iterator local_list_iter; + LLSINGLETON(LLLocalBitmapMgr); + ~LLLocalBitmapMgr(); +public: + bool addUnit(); + void delUnit(LLUUID tracking_id); + bool checkTextureDimensions(std::string filename); + + LLUUID getWorldID(LLUUID tracking_id); + std::string getFilename(LLUUID tracking_id); + + void feedScrollList(LLScrollListCtrl* ctrl); + void doUpdates(); + void setNeedsRebake(); + void doRebake(); + +private: + std::list<LLLocalBitmap*> mBitmapList; + LLLocalBitmapTimer mTimer; + bool mNeedsRebake; + typedef std::list<LLLocalBitmap*>::iterator local_list_iter; }; #endif diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 11bc1425f9..42b5ff3890 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -666,7 +666,7 @@ void LLLocationInputCtrl::onAgentParcelChange() void LLLocationInputCtrl::onMaturityButtonClicked() { - LLUI::sHelpImpl->showTopic(mMaturityHelpTopic); + LLUI::getInstance()->mHelpImpl->showTopic(mMaturityHelpTopic); } void LLLocationInputCtrl::onRegionBoundaryCrossed() diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 1bdeddbcfe..453bf17b11 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -209,11 +209,24 @@ LLLogChatTimeScanner::LLLogChatTimeScanner() mTimeStream.imbue(std::locale(mTimeStream.getloc(), new time_input_facet(DATE_FORMAT))); } -LLLogChat::save_history_signal_t * LLLogChat::sSaveHistorySignal = NULL; +LLLogChat::LLLogChat() +: mSaveHistorySignal(NULL) // only needed in preferences +{ + mHistoryThreadsMutex = new LLMutex(); +} -std::map<LLUUID,LLLoadHistoryThread *> LLLogChat::sLoadHistoryThreads; -std::map<LLUUID,LLDeleteHistoryThread *> LLLogChat::sDeleteHistoryThreads; -LLMutex* LLLogChat::sHistoryThreadsMutex = NULL; +LLLogChat::~LLLogChat() +{ + delete mHistoryThreadsMutex; + mHistoryThreadsMutex = NULL; + + if (mSaveHistorySignal) + { + mSaveHistorySignal->disconnect_all_slots(); + delete mSaveHistorySignal; + mSaveHistorySignal = NULL; + } +} //static @@ -338,10 +351,7 @@ void LLLogChat::saveHistory(const std::string& filename, file.close(); - if (NULL != sSaveHistorySignal) - { - (*sSaveHistorySignal)(); - } + LLLogChat::getInstance()->triggerHistorySignal(); } // static @@ -416,13 +426,12 @@ void LLLogChat::loadChatHistory(const std::string& file_name, std::list<LLSD>& m fclose(fptr); } -// static bool LLLogChat::historyThreadsFinished(LLUUID session_id) { LLMutexLock lock(historyThreadsMutex()); bool finished = true; - std::map<LLUUID,LLLoadHistoryThread *>::iterator it = sLoadHistoryThreads.find(session_id); - if (it != sLoadHistoryThreads.end()) + std::map<LLUUID,LLLoadHistoryThread *>::iterator it = mLoadHistoryThreads.find(session_id); + if (it != mLoadHistoryThreads.end()) { finished = it->second->isFinished(); } @@ -430,95 +439,93 @@ bool LLLogChat::historyThreadsFinished(LLUUID session_id) { return false; } - std::map<LLUUID,LLDeleteHistoryThread *>::iterator dit = sDeleteHistoryThreads.find(session_id); - if (dit != sDeleteHistoryThreads.end()) + std::map<LLUUID,LLDeleteHistoryThread *>::iterator dit = mDeleteHistoryThreads.find(session_id); + if (dit != mDeleteHistoryThreads.end()) { finished = finished && dit->second->isFinished(); } return finished; } -// static LLLoadHistoryThread* LLLogChat::getLoadHistoryThread(LLUUID session_id) { LLMutexLock lock(historyThreadsMutex()); - std::map<LLUUID,LLLoadHistoryThread *>::iterator it = sLoadHistoryThreads.find(session_id); - if (it != sLoadHistoryThreads.end()) + std::map<LLUUID,LLLoadHistoryThread *>::iterator it = mLoadHistoryThreads.find(session_id); + if (it != mLoadHistoryThreads.end()) { return it->second; } return NULL; } -// static LLDeleteHistoryThread* LLLogChat::getDeleteHistoryThread(LLUUID session_id) { LLMutexLock lock(historyThreadsMutex()); - std::map<LLUUID,LLDeleteHistoryThread *>::iterator it = sDeleteHistoryThreads.find(session_id); - if (it != sDeleteHistoryThreads.end()) + std::map<LLUUID,LLDeleteHistoryThread *>::iterator it = mDeleteHistoryThreads.find(session_id); + if (it != mDeleteHistoryThreads.end()) { return it->second; } return NULL; } -// static bool LLLogChat::addLoadHistoryThread(LLUUID& session_id, LLLoadHistoryThread* lthread) { LLMutexLock lock(historyThreadsMutex()); - std::map<LLUUID,LLLoadHistoryThread *>::const_iterator it = sLoadHistoryThreads.find(session_id); - if (it != sLoadHistoryThreads.end()) + std::map<LLUUID,LLLoadHistoryThread *>::const_iterator it = mLoadHistoryThreads.find(session_id); + if (it != mLoadHistoryThreads.end()) { return false; } - sLoadHistoryThreads[session_id] = lthread; + mLoadHistoryThreads[session_id] = lthread; return true; } -// static bool LLLogChat::addDeleteHistoryThread(LLUUID& session_id, LLDeleteHistoryThread* dthread) { LLMutexLock lock(historyThreadsMutex()); - std::map<LLUUID,LLDeleteHistoryThread *>::const_iterator it = sDeleteHistoryThreads.find(session_id); - if (it != sDeleteHistoryThreads.end()) + std::map<LLUUID,LLDeleteHistoryThread *>::const_iterator it = mDeleteHistoryThreads.find(session_id); + if (it != mDeleteHistoryThreads.end()) { return false; } - sDeleteHistoryThreads[session_id] = dthread; + mDeleteHistoryThreads[session_id] = dthread; return true; } -// static void LLLogChat::cleanupHistoryThreads() { LLMutexLock lock(historyThreadsMutex()); std::vector<LLUUID> uuids; - std::map<LLUUID,LLLoadHistoryThread *>::iterator lit = sLoadHistoryThreads.begin(); - for (; lit != sLoadHistoryThreads.end(); lit++) + std::map<LLUUID,LLLoadHistoryThread *>::iterator lit = mLoadHistoryThreads.begin(); + for (; lit != mLoadHistoryThreads.end(); lit++) { - if (lit->second->isFinished() && sDeleteHistoryThreads[lit->first]->isFinished()) + if (lit->second->isFinished() && mDeleteHistoryThreads[lit->first]->isFinished()) { delete lit->second; - delete sDeleteHistoryThreads[lit->first]; + delete mDeleteHistoryThreads[lit->first]; uuids.push_back(lit->first); } } std::vector<LLUUID>::iterator uuid_it = uuids.begin(); for ( ;uuid_it != uuids.end(); uuid_it++) { - sLoadHistoryThreads.erase(*uuid_it); - sDeleteHistoryThreads.erase(*uuid_it); + mLoadHistoryThreads.erase(*uuid_it); + mDeleteHistoryThreads.erase(*uuid_it); } } -//static LLMutex* LLLogChat::historyThreadsMutex() { - if (sHistoryThreadsMutex == NULL) - { - sHistoryThreadsMutex = new LLMutex(); - } - return sHistoryThreadsMutex; + return mHistoryThreadsMutex; +} + +void LLLogChat::triggerHistorySignal() +{ + if (NULL != mSaveHistorySignal) + { + (*mSaveHistorySignal)(); + } } // static @@ -596,15 +603,14 @@ void LLLogChat::getListOfTranscriptBackupFiles(std::vector<std::string>& list_of findTranscriptFiles(pattern, list_of_transcriptions); } -//static boost::signals2::connection LLLogChat::setSaveHistorySignal(const save_history_signal_t::slot_type& cb) { - if (NULL == sSaveHistorySignal) + if (NULL == mSaveHistorySignal) { - sSaveHistorySignal = new save_history_signal_t(); + mSaveHistorySignal = new save_history_signal_t(); } - return sSaveHistorySignal->connect(cb); + return mSaveHistorySignal->connect(cb); } //static diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h index fcbd38a044..b71a34ae0a 100644 --- a/indra/newview/lllogchat.h +++ b/indra/newview/lllogchat.h @@ -79,8 +79,10 @@ public: static void deleteHistory(); }; -class LLLogChat +class LLLogChat : public LLSingleton<LLLogChat> { + LLSINGLETON(LLLogChat); + ~LLLogChat(); public: // status values for callback function enum ELogLineType { @@ -107,7 +109,7 @@ public: static void loadChatHistory(const std::string& file_name, std::list<LLSD>& messages, const LLSD& load_params = LLSD()); typedef boost::signals2::signal<void ()> save_history_signal_t; - static boost::signals2::connection setSaveHistorySignal(const save_history_signal_t::slot_type& cb); + boost::signals2::connection setSaveHistorySignal(const save_history_signal_t::slot_type& cb); static bool moveTranscripts(const std::string currentDirectory, const std::string newDirectory, @@ -123,21 +125,23 @@ public: static bool isAdHocTranscriptExist(std::string file_name); static bool isTranscriptFileFound(std::string fullname); - static bool historyThreadsFinished(LLUUID session_id); - static LLLoadHistoryThread* getLoadHistoryThread(LLUUID session_id); - static LLDeleteHistoryThread* getDeleteHistoryThread(LLUUID session_id); - static bool addLoadHistoryThread(LLUUID& session_id, LLLoadHistoryThread* lthread); - static bool addDeleteHistoryThread(LLUUID& session_id, LLDeleteHistoryThread* dthread); - static void cleanupHistoryThreads(); + bool historyThreadsFinished(LLUUID session_id); + LLLoadHistoryThread* getLoadHistoryThread(LLUUID session_id); + LLDeleteHistoryThread* getDeleteHistoryThread(LLUUID session_id); + bool addLoadHistoryThread(LLUUID& session_id, LLLoadHistoryThread* lthread); + bool addDeleteHistoryThread(LLUUID& session_id, LLDeleteHistoryThread* dthread); + void cleanupHistoryThreads(); private: static std::string cleanFileName(std::string filename); - static save_history_signal_t * sSaveHistorySignal; - static std::map<LLUUID,LLLoadHistoryThread *> sLoadHistoryThreads; - static std::map<LLUUID,LLDeleteHistoryThread *> sDeleteHistoryThreads; - static LLMutex* sHistoryThreadsMutex; - static LLMutex* historyThreadsMutex(); + LLMutex* historyThreadsMutex(); + void triggerHistorySignal(); + + save_history_signal_t * mSaveHistorySignal; + std::map<LLUUID,LLLoadHistoryThread *> mLoadHistoryThreads; + std::map<LLUUID,LLDeleteHistoryThread *> mDeleteHistoryThreads; + LLMutex* mHistoryThreadsMutex; }; /** diff --git a/indra/newview/llmachineid.cpp b/indra/newview/llmachineid.cpp index b0ee8e7fcb..51127928d1 100644 --- a/indra/newview/llmachineid.cpp +++ b/indra/newview/llmachineid.cpp @@ -65,11 +65,11 @@ public: S32 LLMachineID::init() { - memset(static_unique_id,0,sizeof(static_unique_id)); + size_t len = sizeof(static_unique_id); + memset(static_unique_id, 0, len); S32 ret_code = 0; #if LL_WINDOWS # pragma comment(lib, "wbemuuid.lib") - size_t len = sizeof(static_unique_id); // algorithm to detect BIOS serial number found at: // http://msdn.microsoft.com/en-us/library/aa394077%28VS.85%29.aspx @@ -217,17 +217,27 @@ S32 LLMachineID::init() // Get the value of the Name property hr = pclsObj->Get(L"SerialNumber", 0, &vtProp, 0, 0); + if (FAILED(hr)) + { + LL_WARNS() << "Failed to get SerialNumber. Error code = 0x" << hex << hres << LL_ENDL; + pclsObj->Release(); + pclsObj = NULL; + continue; + } LL_INFOS("AppInit") << " Serial Number : " << vtProp.bstrVal << LL_ENDL; + // use characters in the returned Serial Number to create a byte array of size len BSTR serialNumber ( vtProp.bstrVal); + unsigned int serial_size = SysStringLen(serialNumber); unsigned int j = 0; - while( vtProp.bstrVal[j] != 0) + + while (j < serial_size && vtProp.bstrVal[j] != 0) { for (unsigned int i = 0; i < len; i++) { - if (vtProp.bstrVal[j] == 0) + if (j >= serial_size || vtProp.bstrVal[j] == 0) break; - + static_unique_id[i] = (unsigned int)(static_unique_id[i] + serialNumber[j]); j++; } @@ -254,16 +264,8 @@ S32 LLMachineID::init() ret_code = LLUUID::getNodeID(staticPtr); #endif has_static_unique_id = true; - return ret_code; -} - -S32 LLMachineID::getUniqueID(unsigned char *unique_id, size_t len) -{ - if (has_static_unique_id) - { - memcpy ( unique_id, &static_unique_id, len); - LL_INFOS_ONCE("AppInit") << "UniqueID: 0x"; + LL_INFOS("AppInit") << "UniqueID: 0x"; // Code between here and LL_ENDL is not executed unless the LL_DEBUGS // actually produces output for (size_t i = 0; i < len; ++i) @@ -271,11 +273,21 @@ S32 LLMachineID::getUniqueID(unsigned char *unique_id, size_t len) // Copy each char to unsigned int to hexify. Sending an unsigned // char to a std::ostream tries to represent it as a char, not // what we want here. - unsigned byte = unique_id[i]; + unsigned byte = static_unique_id[i]; LL_CONT << std::hex << std::setw(2) << std::setfill('0') << byte; } // Reset default output formatting to avoid nasty surprises! LL_CONT << std::dec << std::setw(0) << std::setfill(' ') << LL_ENDL; + + return ret_code; +} + + +S32 LLMachineID::getUniqueID(unsigned char *unique_id, size_t len) +{ + if (has_static_unique_id) + { + memcpy ( unique_id, &static_unique_id, len); return 1; } return 0; diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 92a09357c8..9248c160c6 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -386,7 +386,7 @@ BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) } else if (gSavedSettings.getBOOL("SnapToMouseCursor")) { - LLUI::setMousePositionScreen(mouse_pos.mX, mouse_pos.mY); + LLUI::getInstance()->setMousePositionScreen(mouse_pos.mX, mouse_pos.mY); x = mouse_pos.mX; y = mouse_pos.mY; } diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index a0e19f2d19..805c25508f 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -219,7 +219,7 @@ namespace LLMarketplaceImport httpHeaders->append(HTTP_OUT_HEADER_CONNECTION, "Keep-Alive"); httpHeaders->append(HTTP_OUT_HEADER_COOKIE, sMarketplaceCookie); httpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_XML); - httpHeaders->append(HTTP_OUT_HEADER_USER_AGENT, LLViewerMedia::getCurrentUserAgent()); + httpHeaders->append(HTTP_OUT_HEADER_USER_AGENT, LLViewerMedia::getInstance()->getCurrentUserAgent()); LLSD result = httpAdapter->postAndSuspend(httpRequest, url, LLSD(), httpOpts, httpHeaders); @@ -283,11 +283,11 @@ namespace LLMarketplaceImport httpHeaders->append(HTTP_OUT_HEADER_ACCEPT, "*/*"); httpHeaders->append(HTTP_OUT_HEADER_COOKIE, sMarketplaceCookie); httpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_LLSD_XML); - httpHeaders->append(HTTP_OUT_HEADER_USER_AGENT, LLViewerMedia::getCurrentUserAgent()); + httpHeaders->append(HTTP_OUT_HEADER_USER_AGENT, LLViewerMedia::getInstance()->getCurrentUserAgent()); } else { - httpHeaders = LLViewerMedia::getHttpHeaders(); + httpHeaders = LLViewerMedia::getInstance()->getHttpHeaders(); } LLSD result = httpAdapter->getAndSuspend(httpRequest, url, httpOpts, httpHeaders); diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 7f6955d08c..b399ab9bc4 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -691,7 +691,7 @@ bool LLMediaCtrl::ensureMediaSourceExists() if(mMediaSource.isNull()) { // If we don't already have a media source, try to create one. - mMediaSource = LLViewerMedia::newMediaImpl(mMediaTextureID, mTextureWidth, mTextureHeight); + mMediaSource = LLViewerMedia::getInstance()->newMediaImpl(mMediaTextureID, mTextureWidth, mTextureHeight); if ( mMediaSource ) { mMediaSource->setUsedInUI(true); @@ -1098,7 +1098,7 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) auth_request_params.substitutions = args; auth_request_params.payload = LLSD().with("media_id", mMediaTextureID); - auth_request_params.functor.function = boost::bind(&LLViewerMedia::onAuthSubmit, _1, _2); + auth_request_params.functor.function = boost::bind(&LLViewerMedia::authSubmitCallback, _1, _2); LLNotifications::instance().add(auth_request_params); }; break; @@ -1144,7 +1144,7 @@ void LLMediaCtrl::onPopup(const LLSD& notification, const LLSD& response) else { // Make sure the opening instance knows its window open request was denied, so it can clean things up. - LLViewerMedia::proxyWindowClosed(notification["payload"]["uuid"]); + LLViewerMedia::getInstance()->proxyWindowClosed(notification["payload"]["uuid"]); } } diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 38fd2d777e..31e3d408d7 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2277,6 +2277,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) instance_entry["material"] = LL_MCODE_WOOD; instance_entry["physics_shape_type"] = data.mModel[LLModel::LOD_PHYSICS].notNull() ? (U8)(LLViewerObject::PHYSICS_SHAPE_PRIM) : (U8)(LLViewerObject::PHYSICS_SHAPE_CONVEX_HULL); instance_entry["mesh"] = mesh_index[data.mBaseModel]; + instance_entry["mesh_name"] = instance.mLabel; instance_entry["face_list"] = LLSD::emptyArray(); diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index 19f238d99a..8fc356c928 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -568,7 +568,7 @@ BOOL LLPanelStandStopFlying::postBuild() mStandButton->setCommitCallback(boost::bind(&LLPanelStandStopFlying::onStandButtonClick, this)); mStandButton->setCommitCallback(boost::bind(&LLFloaterMove::enableInstance)); mStandButton->setVisible(FALSE); - LLHints::registerHintTarget("stand_btn", mStandButton->getHandle()); + LLHints::getInstance()->registerHintTarget("stand_btn", mStandButton->getHandle()); mStopFlyingButton = getChild<LLButton>("stop_fly_btn"); //mStopFlyingButton->setCommitCallback(boost::bind(&LLFloaterMove::setFlyingMode, FALSE)); @@ -670,7 +670,7 @@ LLPanelStandStopFlying* LLPanelStandStopFlying::getStandStopFlyingPanel() panel->buildFromFile("panel_stand_stop_flying.xml"); panel->setVisible(FALSE); - //LLUI::getRootView()->addChild(panel); + //LLUI::getInstance()->getRootView()->addChild(panel); LL_INFOS() << "Build LLPanelStandStopFlying panel" << LL_ENDL; diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 62e0e2d077..3209d23e43 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -34,6 +34,7 @@ #include "llcachename.h" #include "llfloater.h" #include "llfloaterreg.h" +#include "llfloatersnapshot.h" // gSnapshotFloaterView #include "llinventory.h" #include "llscrolllistitem.h" #include "llscrolllistcell.h" @@ -153,7 +154,7 @@ void LLNameListCtrl::mouseOverHighlightNthItem( S32 target_index ) bool is_mouse_over_name_cell = false; S32 mouse_x, mouse_y; - LLUI::getMousePositionLocal(this, &mouse_x, &mouse_y); + LLUI::getInstance()->getMousePositionLocal(this, &mouse_x, &mouse_y); S32 column_index = getColumnIndexFromOffset(mouse_x); LLScrollListItem* hit_item = hitItem(mouse_x, mouse_y); @@ -236,24 +237,30 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) // Spawn at right side of cell LLPointer<LLUIImage> icon = LLUI::getUIImage("Info_Small"); - LLCoordGL pos( sticky_rect.mRight - info_icon_size, sticky_rect.mTop - (sticky_rect.getHeight() - icon->getHeight())/2 ); - - // Should we show a group or an avatar inspector? - bool is_group = hit_item->isGroup(); - bool is_experience = hit_item->isExperience(); - - LLToolTip::Params params; - params.background_visible( false ); - params.click_callback( boost::bind(&LLNameListCtrl::showInspector, this, avatar_id, is_group, is_experience) ); - params.delay_time(0.0f); // spawn instantly on hover - params.image( icon ); - params.message(""); - params.padding(0); - params.pos(pos); - params.sticky_rect(sticky_rect); - - LLToolTipMgr::getInstance()->show(params); - handled = TRUE; + S32 screenX = sticky_rect.mRight - info_icon_size; + S32 screenY = sticky_rect.mTop - (sticky_rect.getHeight() - icon->getHeight()) / 2; + LLCoordGL pos(screenX, screenY); + + LLFloater* snapshot_floatr = gSnapshotFloaterView->getFrontmostClosableFloater(); + if (!snapshot_floatr || !snapshot_floatr->getRect().pointInRect(screenX + icon->getWidth(), screenY)) + { + // Should we show a group or an avatar inspector? + bool is_group = hit_item->isGroup(); + bool is_experience = hit_item->isExperience(); + + LLToolTip::Params params; + params.background_visible(false); + params.click_callback(boost::bind(&LLNameListCtrl::showInspector, this, avatar_id, is_group, is_experience)); + params.delay_time(0.0f); // spawn instantly on hover + params.image(icon); + params.message(""); + params.padding(0); + params.pos(pos); + params.sticky_rect(sticky_rect); + + LLToolTipMgr::getInstance()->show(params); + handled = TRUE; + } } } } diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index cfe2e6bf6a..179c64b5c5 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -320,7 +320,7 @@ BOOL LLNavigationBar::postBuild() LLTeleportHistory::getInstance()->setHistoryChangedCallback( boost::bind(&LLNavigationBar::onTeleportHistoryChanged, this)); - LLHints::registerHintTarget("nav_bar", getHandle()); + LLHints::getInstance()->registerHintTarget("nav_bar", getHandle()); mNavigationPanel = getChild<LLLayoutPanel>("navigation_layout_panel"); mFavoritePanel = getChild<LLLayoutPanel>("favorites_layout_panel"); diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 248c361ca4..fc1039b372 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -329,7 +329,7 @@ void LLNetMap::draw() S32 local_mouse_x; S32 local_mouse_y; //localMouse(&local_mouse_x, &local_mouse_y); - LLUI::getMousePositionLocal(this, &local_mouse_x, &local_mouse_y); + LLUI::getInstance()->getMousePositionLocal(this, &local_mouse_x, &local_mouse_y); mClosestAgentToCursor.setNull(); F32 closest_dist_squared = F32_MAX; // value will be overridden in the loop F32 min_pick_dist_squared = (mDotRadius * MIN_PICK_SCALE) * (mDotRadius * MIN_PICK_SCALE); @@ -835,7 +835,7 @@ BOOL LLNetMap::handleMouseUp( S32 x, S32 y, MASK mask ) LLRect clip_rect = getRect(); clip_rect.stretch(-8); clip_rect.clipPointToRect(mMouseDown.mX, mMouseDown.mY, local_x, local_y); - LLUI::setMousePositionLocal(this, local_x, local_y); + LLUI::getInstance()->setMousePositionLocal(this, local_x, local_y); // finish the pan mPanning = false; diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 6a58196760..9a3f1a853a 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -177,7 +177,7 @@ void LLHandlerUtil::logGroupNoticeToIMGroup( { // Legacy support and fallback method // if we can't retrieve sender id from group notice system message, try to lookup it from cache - sender_id = LLAvatarNameCache::findIdByName(sender_name); + sender_id = LLAvatarNameCache::getInstance()->findIdByName(sender_name); } logToIM(IM_SESSION_GROUP_START, group_name, sender_name, payload["message"], diff --git a/indra/newview/llnotificationhinthandler.cpp b/indra/newview/llnotificationhinthandler.cpp index f40369a2e0..f1226c53ff 100644 --- a/indra/newview/llnotificationhinthandler.cpp +++ b/indra/newview/llnotificationhinthandler.cpp @@ -40,17 +40,17 @@ LLHintHandler::LLHintHandler() void LLHintHandler::onAdd(LLNotificationPtr p) { - LLHints::show(p); + LLHints::getInstance()->show(p); } void LLHintHandler::onLoad(LLNotificationPtr p) { - LLHints::show(p); + LLHints::getInstance()->show(p); } void LLHintHandler::onDelete(LLNotificationPtr p) { - LLHints::hide(p); + LLHints::getInstance()->hide(p); } bool LLHintHandler::processNotification(const LLNotificationPtr& p) diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index fef0631fa6..ba831ab2ed 100644 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -35,7 +35,6 @@ #include "llnotificationmanager.h" #include "llnotifications.h" #include "llscriptfloater.h" -#include "llfacebookconnect.h" #include "llavatarname.h" #include "llavatarnamecache.h" diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 3a8378f8df..6573be0aaf 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -97,6 +97,7 @@ enum ESubpart { SUBPART_SKIRT, SUBPART_ALPHA, SUBPART_TATTOO, + SUBPART_UNIVERSAL, SUBPART_PHYSICS_BREASTS_UPDOWN, SUBPART_PHYSICS_BREASTS_INOUT, SUBPART_PHYSICS_BREASTS_LEFTRIGHT, @@ -241,7 +242,8 @@ LLEditWearableDictionary::Wearables::Wearables() addEntry(LLWearableType::WT_SKIRT, new WearableEntry(LLWearableType::WT_SKIRT,"edit_skirt_title","skirt_desc_text", texture_vec_t{TEX_SKIRT}, texture_vec_t{TEX_SKIRT}, subpart_vec_t{SUBPART_SKIRT})); addEntry(LLWearableType::WT_ALPHA, new WearableEntry(LLWearableType::WT_ALPHA,"edit_alpha_title","alpha_desc_text", texture_vec_t(), texture_vec_t{TEX_LOWER_ALPHA, TEX_UPPER_ALPHA, TEX_HEAD_ALPHA, TEX_EYES_ALPHA, TEX_HAIR_ALPHA}, subpart_vec_t{SUBPART_ALPHA})); addEntry(LLWearableType::WT_TATTOO, new WearableEntry(LLWearableType::WT_TATTOO,"edit_tattoo_title","tattoo_desc_text", texture_vec_t{TEX_HEAD_TATTOO}, texture_vec_t{TEX_LOWER_TATTOO, TEX_UPPER_TATTOO, TEX_HEAD_TATTOO}, subpart_vec_t{SUBPART_TATTOO})); - addEntry(LLWearableType::WT_PHYSICS, new WearableEntry(LLWearableType::WT_PHYSICS,"edit_physics_title","physics_desc_text", texture_vec_t(), texture_vec_t(), subpart_vec_t{SUBPART_PHYSICS_BREASTS_UPDOWN, SUBPART_PHYSICS_BREASTS_INOUT, SUBPART_PHYSICS_BREASTS_LEFTRIGHT, SUBPART_PHYSICS_BELLY_UPDOWN, SUBPART_PHYSICS_BUTT_UPDOWN, SUBPART_PHYSICS_BUTT_LEFTRIGHT, SUBPART_PHYSICS_ADVANCED})); + addEntry(LLWearableType::WT_UNIVERSAL, new WearableEntry(LLWearableType::WT_UNIVERSAL, "edit_universal_title", "universal_desc_text", texture_vec_t{ TEX_HEAD_UNIVERSAL_TATTOO }, texture_vec_t{ TEX_HEAD_UNIVERSAL_TATTOO, TEX_UPPER_UNIVERSAL_TATTOO, TEX_LOWER_UNIVERSAL_TATTOO, TEX_SKIRT_TATTOO, TEX_HAIR_TATTOO, TEX_EYES_TATTOO, TEX_LEFT_ARM_TATTOO, TEX_LEFT_LEG_TATTOO, TEX_AUX1_TATTOO, TEX_AUX2_TATTOO, TEX_AUX3_TATTOO }, subpart_vec_t{ SUBPART_UNIVERSAL })); + addEntry(LLWearableType::WT_PHYSICS, new WearableEntry(LLWearableType::WT_PHYSICS,"edit_physics_title","physics_desc_text", texture_vec_t(), texture_vec_t(), subpart_vec_t{SUBPART_PHYSICS_BREASTS_UPDOWN, SUBPART_PHYSICS_BREASTS_INOUT, SUBPART_PHYSICS_BREASTS_LEFTRIGHT, SUBPART_PHYSICS_BELLY_UPDOWN, SUBPART_PHYSICS_BUTT_UPDOWN, SUBPART_PHYSICS_BUTT_LEFTRIGHT, SUBPART_PHYSICS_ADVANCED})); } LLEditWearableDictionary::WearableEntry::WearableEntry(LLWearableType::EType type, @@ -294,7 +296,9 @@ LLEditWearableDictionary::Subparts::Subparts() addEntry(SUBPART_UNDERPANTS, new SubpartEntry(SUBPART_UNDERPANTS, "mPelvis", "underpants", "underpants_main_param_list", "underpants_main_tab", LLVector3d(0.f, 0.f, -0.5f), LLVector3d(-1.6f, 0.15f, -0.5f),SEX_BOTH)); addEntry(SUBPART_ALPHA, new SubpartEntry(SUBPART_ALPHA, "mPelvis", "alpha", "alpha_main_param_list", "alpha_main_tab", LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-2.5f, 0.5f, 0.8f),SEX_BOTH)); addEntry(SUBPART_TATTOO, new SubpartEntry(SUBPART_TATTOO, "mPelvis", "tattoo", "tattoo_main_param_list", "tattoo_main_tab", LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-2.5f, 0.5f, 0.8f),SEX_BOTH)); - addEntry(SUBPART_PHYSICS_BREASTS_UPDOWN, new SubpartEntry(SUBPART_PHYSICS_BREASTS_UPDOWN, "mTorso", "physics_breasts_updown", "physics_breasts_updown_param_list", "physics_breasts_updown_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_FEMALE)); + addEntry(SUBPART_UNIVERSAL, new SubpartEntry(SUBPART_UNIVERSAL, "mPelvis", "universal", "universal_main_param_list", "universal_main_tab", LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-2.5f, 0.5f, 0.8f), SEX_BOTH)); + + addEntry(SUBPART_PHYSICS_BREASTS_UPDOWN, new SubpartEntry(SUBPART_PHYSICS_BREASTS_UPDOWN, "mTorso", "physics_breasts_updown", "physics_breasts_updown_param_list", "physics_breasts_updown_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_FEMALE)); addEntry(SUBPART_PHYSICS_BREASTS_INOUT, new SubpartEntry(SUBPART_PHYSICS_BREASTS_INOUT, "mTorso", "physics_breasts_inout", "physics_breasts_inout_param_list", "physics_breasts_inout_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_FEMALE)); addEntry(SUBPART_PHYSICS_BREASTS_LEFTRIGHT, new SubpartEntry(SUBPART_PHYSICS_BREASTS_LEFTRIGHT, "mTorso", "physics_breasts_leftright", "physics_breasts_leftright_param_list", "physics_breasts_leftright_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_FEMALE)); addEntry(SUBPART_PHYSICS_BELLY_UPDOWN, new SubpartEntry(SUBPART_PHYSICS_BELLY_UPDOWN, "mTorso", "physics_belly_updown", "physics_belly_updown_param_list", "physics_belly_updown_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_BOTH)); @@ -335,6 +339,7 @@ LLEditWearableDictionary::ColorSwatchCtrls::ColorSwatchCtrls() addEntry ( TEX_UPPER_UNDERSHIRT, new PickerControlEntry (TEX_UPPER_UNDERSHIRT, "Color/Tint" )); addEntry ( TEX_LOWER_UNDERPANTS, new PickerControlEntry (TEX_LOWER_UNDERPANTS, "Color/Tint" )); addEntry ( TEX_HEAD_TATTOO, new PickerControlEntry(TEX_HEAD_TATTOO, "Color/Tint" )); + addEntry (TEX_HEAD_UNIVERSAL_TATTOO, new PickerControlEntry(TEX_HEAD_UNIVERSAL_TATTOO, "Color/Tint")); } LLEditWearableDictionary::TextureCtrls::TextureCtrls() @@ -362,6 +367,17 @@ LLEditWearableDictionary::TextureCtrls::TextureCtrls() addEntry ( TEX_LOWER_TATTOO, new PickerControlEntry (TEX_LOWER_TATTOO, "Lower Tattoo", LLUUID::null, TRUE )); addEntry ( TEX_UPPER_TATTOO, new PickerControlEntry (TEX_UPPER_TATTOO, "Upper Tattoo", LLUUID::null, TRUE )); addEntry ( TEX_HEAD_TATTOO, new PickerControlEntry (TEX_HEAD_TATTOO, "Head Tattoo", LLUUID::null, TRUE )); + addEntry ( TEX_LOWER_UNIVERSAL_TATTOO, new PickerControlEntry( TEX_LOWER_UNIVERSAL_TATTOO, "Lower Universal Tattoo", LLUUID::null, TRUE)); + addEntry ( TEX_UPPER_UNIVERSAL_TATTOO, new PickerControlEntry( TEX_UPPER_UNIVERSAL_TATTOO, "Upper Universal Tattoo", LLUUID::null, TRUE)); + addEntry ( TEX_HEAD_UNIVERSAL_TATTOO, new PickerControlEntry( TEX_HEAD_UNIVERSAL_TATTOO, "Head Universal Tattoo", LLUUID::null, TRUE)); + addEntry ( TEX_SKIRT_TATTOO, new PickerControlEntry(TEX_SKIRT_TATTOO, "Skirt Tattoo", LLUUID::null, TRUE)); + addEntry ( TEX_HAIR_TATTOO, new PickerControlEntry(TEX_HAIR_TATTOO, "Hair Tattoo", LLUUID::null, TRUE)); + addEntry ( TEX_EYES_TATTOO, new PickerControlEntry(TEX_EYES_TATTOO, "Eyes Tattoo", LLUUID::null, TRUE)); + addEntry (TEX_LEFT_ARM_TATTOO, new PickerControlEntry(TEX_LEFT_ARM_TATTOO, "Left Arm Tattoo", LLUUID::null, TRUE)); + addEntry (TEX_LEFT_LEG_TATTOO, new PickerControlEntry(TEX_LEFT_LEG_TATTOO, "Left Leg Tattoo", LLUUID::null, TRUE)); + addEntry (TEX_AUX1_TATTOO, new PickerControlEntry(TEX_AUX1_TATTOO, "Aux1 Tattoo", LLUUID::null, TRUE)); + addEntry (TEX_AUX2_TATTOO, new PickerControlEntry(TEX_AUX2_TATTOO, "Aux2 Tattoo", LLUUID::null, TRUE)); + addEntry (TEX_AUX3_TATTOO, new PickerControlEntry(TEX_AUX3_TATTOO, "Aux3 Tattoo", LLUUID::null, TRUE)); } LLEditWearableDictionary::PickerControlEntry::PickerControlEntry(ETextureIndex tex_index, @@ -739,6 +755,7 @@ BOOL LLPanelEditWearable::postBuild() mPanelSkirt = getChild<LLPanel>("edit_skirt_panel"); mPanelAlpha = getChild<LLPanel>("edit_alpha_panel"); mPanelTattoo = getChild<LLPanel>("edit_tattoo_panel"); + mPanelUniversal = getChild<LLPanel>("edit_universal_panel"); mPanelPhysics = getChild<LLPanel>("edit_physics_panel"); mTxtAvatarHeight = mPanelShape->getChild<LLTextBox>("avatar_height"); @@ -1442,6 +1459,10 @@ LLPanel* LLPanelEditWearable::getPanel(LLWearableType::EType type) case LLWearableType::WT_TATTOO: return mPanelTattoo; break; + + case LLWearableType::WT_UNIVERSAL: + return mPanelUniversal; + break; case LLWearableType::WT_PHYSICS: return mPanelPhysics; diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h index 81acc31863..43d6a3595f 100644 --- a/indra/newview/llpaneleditwearable.h +++ b/indra/newview/llpaneleditwearable.h @@ -167,6 +167,7 @@ private: LLPanel *mPanelSkirt; LLPanel *mPanelAlpha; LLPanel *mPanelTattoo; + LLPanel *mPanelUniversal; LLPanel *mPanelPhysics; typedef std::map<std::string, LLAvatarAppearanceDefines::ETextureIndex> string_texture_index_map_t; diff --git a/indra/newview/llpanelexperiencepicker.cpp b/indra/newview/llpanelexperiencepicker.cpp index a7f2dbafa2..80aeee6da1 100644 --- a/indra/newview/llpanelexperiencepicker.cpp +++ b/indra/newview/llpanelexperiencepicker.cpp @@ -89,7 +89,7 @@ BOOL LLPanelExperiencePicker::postBuild() childSetAction(BTN_PROFILE, boost::bind(&LLPanelExperiencePicker::onBtnProfile, this)); getChildView(BTN_PROFILE)->setEnabled(FALSE); - getChild<LLComboBox>(TEXT_MATURITY)->setCurrentByIndex(2); + getChild<LLComboBox>(TEXT_MATURITY)->setCurrentByIndex(gSavedPerAccountSettings.getU32("ExperienceSearchMaturity")); getChild<LLComboBox>(TEXT_MATURITY)->setCommitCallback(boost::bind(&LLPanelExperiencePicker::onMaturity, this)); getChild<LLUICtrl>(TEXT_EDIT)->setFocus(TRUE); @@ -381,6 +381,7 @@ void LLPanelExperiencePicker::filterContent() void LLPanelExperiencePicker::onMaturity() { + gSavedPerAccountSettings.setU32("ExperienceSearchMaturity", getChild<LLComboBox>(TEXT_MATURITY)->getCurrentIndex()); if(mResponse.has("experience_keys") && mResponse["experience_keys"].beginArray() != mResponse["experience_keys"].endArray()) { filterContent(); diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 8b31c5aa90..5742b5ad1a 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -979,7 +979,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) break; } - if(LLViewerMedia::textureHasMedia(id)) + if(LLViewerMedia::getInstance()->textureHasMedia(id)) { getChildView("button align")->setEnabled(editable); } @@ -1014,43 +1014,77 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) } updateAlphaControls(); - - if(texture_ctrl) + + if (texture_ctrl) { if (identical_diffuse) { - texture_ctrl->setTentative( FALSE ); - texture_ctrl->setEnabled( editable ); - texture_ctrl->setImageAssetID( id ); + texture_ctrl->setTentative(FALSE); + texture_ctrl->setEnabled(editable); + texture_ctrl->setImageAssetID(id); getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha && transparency <= 0.f); getChildView("label alphamode")->setEnabled(editable && mIsAlpha); getChildView("maskcutoff")->setEnabled(editable && mIsAlpha); getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha); + + bool allAttachments = true; + for (LLObjectSelection::iterator iter = LLSelectMgr::getInstance()->getSelection()->begin(); + iter != LLSelectMgr::getInstance()->getSelection()->end();iter++) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if (!object->isAttachment()) + { + allAttachments = false; + break; + } + } + + texture_ctrl->setBakeTextureEnabled(allAttachments); + } else if (id.isNull()) { // None selected - texture_ctrl->setTentative( FALSE ); - texture_ctrl->setEnabled( FALSE ); - texture_ctrl->setImageAssetID( LLUUID::null ); - getChildView("combobox alphamode")->setEnabled( FALSE ); - getChildView("label alphamode")->setEnabled( FALSE ); - getChildView("maskcutoff")->setEnabled( FALSE); - getChildView("label maskcutoff")->setEnabled( FALSE ); + texture_ctrl->setTentative(FALSE); + texture_ctrl->setEnabled(FALSE); + texture_ctrl->setImageAssetID(LLUUID::null); + getChildView("combobox alphamode")->setEnabled(FALSE); + getChildView("label alphamode")->setEnabled(FALSE); + getChildView("maskcutoff")->setEnabled(FALSE); + getChildView("label maskcutoff")->setEnabled(FALSE); + + texture_ctrl->setBakeTextureEnabled(false); } else { // Tentative: multiple selected with different textures - texture_ctrl->setTentative( TRUE ); - texture_ctrl->setEnabled( editable ); - texture_ctrl->setImageAssetID( id ); + texture_ctrl->setTentative(TRUE); + texture_ctrl->setEnabled(editable); + texture_ctrl->setImageAssetID(id); getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha && transparency <= 0.f); getChildView("label alphamode")->setEnabled(editable && mIsAlpha); getChildView("maskcutoff")->setEnabled(editable && mIsAlpha); getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha); + + bool allAttachments = true; + for (LLObjectSelection::iterator iter = LLSelectMgr::getInstance()->getSelection()->begin(); + iter != LLSelectMgr::getInstance()->getSelection()->end();iter++) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if (!object->isAttachment()) + { + allAttachments = false; + break; } } + texture_ctrl->setBakeTextureEnabled(allAttachments); + } + + } + if (shinytexture_ctrl) { shinytexture_ctrl->setTentative( !identical_spec ); @@ -2483,13 +2517,13 @@ struct LLPanelFaceSetMediaFunctor : public LLSelectedTEFunctor const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : NULL; if ( mep ) { - pMediaImpl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()); + pMediaImpl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(mep->getMediaID()); } if ( pMediaImpl.isNull()) { // If we didn't find face media for this face, check whether this face is showing parcel media. - pMediaImpl = LLViewerMedia::getMediaImplFromTextureID(tep->getID()); + pMediaImpl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(tep->getID()); } if ( pMediaImpl.notNull()) @@ -2640,6 +2674,16 @@ void LLPanelFace::LLSelectedTE::getTexId(LLUUID& id, bool& identical) { LLUUID get(LLViewerObject* object, S32 te_index) { + LLTextureEntry *te = object->getTE(te_index); + if (te) + { + if ((te->getID() == IMG_USE_BAKED_EYES) || (te->getID() == IMG_USE_BAKED_HAIR) || (te->getID() == IMG_USE_BAKED_HEAD) || (te->getID() == IMG_USE_BAKED_LOWER) || (te->getID() == IMG_USE_BAKED_SKIRT) || (te->getID() == IMG_USE_BAKED_UPPER) + || (te->getID() == IMG_USE_BAKED_LEFTARM) || (te->getID() == IMG_USE_BAKED_LEFTLEG) || (te->getID() == IMG_USE_BAKED_AUX1) || (te->getID() == IMG_USE_BAKED_AUX2) || (te->getID() == IMG_USE_BAKED_AUX3)) + { + return te->getID(); + } + } + LLUUID id; LLViewerTexture* image = object->getTEImage(te_index); if (image) @@ -2647,9 +2691,8 @@ void LLPanelFace::LLSelectedTE::getTexId(LLUUID& id, bool& identical) id = image->getID(); } - if (!id.isNull() && LLViewerMedia::textureHasMedia(id)) + if (!id.isNull() && LLViewerMedia::getInstance()->textureHasMedia(id)) { - LLTextureEntry *te = object->getTE(te_index); if (te) { LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID(), TEX_LIST_STANDARD) : NULL; diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index 82ea8377de..d6b66ee622 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -606,11 +606,30 @@ void LLPanelGroupInvite::updateLists() { if (!mPendingUpdate) { + // Note: this will partially fail if some requests are already in progress LLGroupMgr::getInstance()->sendGroupPropertiesRequest(mImplementation->mGroupID); LLGroupMgr::getInstance()->sendGroupRoleDataRequest(mImplementation->mGroupID); LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(mImplementation->mGroupID); LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mImplementation->mGroupID); } + else if (gdatap) + { + // restart requests that were interrupted/dropped/failed to start + if (!gdatap->isRoleDataPending() && !gdatap->isRoleDataComplete()) + { + LLGroupMgr::getInstance()->sendGroupRoleDataRequest(mImplementation->mGroupID); + } + if (!gdatap->isRoleMemberDataPending() && !gdatap->isRoleMemberDataComplete()) + { + LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(mImplementation->mGroupID); + } + // sendCapGroupMembersRequest has a per frame send limitation that could have + // interrupted previous request + if (!gdatap->isMemberDataPending() && !gdatap->isMemberDataComplete()) + { + LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mImplementation->mGroupID); + } + } mPendingUpdate = TRUE; } else diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 52a13304df..0efb234015 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -1962,6 +1962,7 @@ LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab() mRoleDescription(NULL), mMemberVisibleCheck(NULL), mDeleteRoleButton(NULL), + mCopyRoleButton(NULL), mCreateRoleButton(NULL), mFirstOpen(TRUE), mHasRoleChange(FALSE) @@ -2012,6 +2013,14 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) mCreateRoleButton->setClickedCallback(onCreateRole, this); mCreateRoleButton->setEnabled(FALSE); } + + mCopyRoleButton = + parent->getChild<LLButton>("role_copy", recurse); + if ( mCopyRoleButton ) + { + mCopyRoleButton->setClickedCallback(onCopyRole, this); + mCopyRoleButton->setEnabled(FALSE); + } mDeleteRoleButton = parent->getChild<LLButton>("role_delete", recurse); @@ -2226,6 +2235,7 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc) mRoleTitle->clear(); setFooterEnabled(FALSE); mDeleteRoleButton->setEnabled(FALSE); + mCopyRoleButton->setEnabled(FALSE); } } @@ -2336,6 +2346,7 @@ void LLPanelGroupRolesSubTab::handleRoleSelect() mSelectedRole = item->getUUID(); buildMembersList(); + mCopyRoleButton->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_ROLE_CREATE)); can_delete = can_delete && gAgent.hasPowerInGroup(mGroupID, GP_ROLE_DELETE); mDeleteRoleButton->setEnabled(can_delete); @@ -2662,6 +2673,57 @@ void LLPanelGroupRolesSubTab::handleCreateRole() } // static +void LLPanelGroupRolesSubTab::onCopyRole(void* user_data) +{ + LLPanelGroupRolesSubTab* self = static_cast<LLPanelGroupRolesSubTab*>(user_data); + if (!self) return; + + self->handleCopyRole(); +} + +void LLPanelGroupRolesSubTab::handleCopyRole() +{ + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); + + if (!gdatap) return; + + LLScrollListItem* role_item = mRolesList->getFirstSelected(); + if (!role_item || role_item->getUUID().isNull()) + { + return; + } + + LLRoleData rd; + if (!gdatap->getRoleData(role_item->getUUID(), rd)) + { + return; + } + + LLUUID new_role_id; + new_role_id.generate(); + rd.mRoleName += "(Copy)"; + gdatap->createRole(new_role_id,rd); + + mRolesList->deselectAllItems(TRUE); + LLSD row; + row["id"] = new_role_id; + row["columns"][0]["column"] = "name"; + row["columns"][0]["value"] = rd.mRoleName; + mRolesList->addElement(row, ADD_BOTTOM, this); + mRolesList->selectByID(new_role_id); + + // put focus on name field and select its contents + if(mRoleName) + { + mRoleName->setFocus(TRUE); + mRoleName->onTabInto(); + gFocusMgr.triggerFocusFlash(); + } + + notifyObservers(); +} + +// static void LLPanelGroupRolesSubTab::onDeleteRole(void* user_data) { LLPanelGroupRolesSubTab* self = static_cast<LLPanelGroupRolesSubTab*>(user_data); diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index aafbd242cb..459b77703f 100644 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -269,6 +269,9 @@ public: static void onCreateRole(void*); void handleCreateRole(); + static void onCopyRole(void*); + void handleCopyRole(); + static void onDeleteRole(void*); void handleDeleteRole(); @@ -296,6 +299,7 @@ protected: LLCheckBoxCtrl* mMemberVisibleCheck; LLButton* mDeleteRoleButton; LLButton* mCreateRoleButton; + LLButton* mCopyRoleButton; LLUUID mSelectedRole; BOOL mHasRoleChange; diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 142dea83e2..e253557797 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -178,7 +178,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, mPasswordModified = FALSE; - LLPanelLogin::sInstance = this; + sInstance = this; LLView* login_holder = gViewerWindow->getLoginPanelHolder(); if (login_holder) @@ -234,29 +234,44 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, server_choice_combo->add(LLGridManager::getInstance()->getGridLabel(), current_grid, ADD_TOP); - server_choice_combo->selectFirstItem(); + server_choice_combo->selectFirstItem(); LLSLURL start_slurl(LLStartUp::getStartSLURL()); + // The StartSLURL might have been set either by an explicit command-line + // argument (CmdLineLoginLocation) or by default. + // current_grid might have been set either by an explicit command-line + // argument (CmdLineGridChoice) or by default. + // If the grid specified by StartSLURL is the same as current_grid, the + // distinction is moot. + // If we have an explicit command-line SLURL, use that. + // If we DON'T have an explicit command-line SLURL but we DO have an + // explicit command-line grid, which is different from the default SLURL's + // -- do NOT override the explicit command-line grid with the grid from + // the default SLURL! + bool force_grid{ start_slurl.getGrid() != current_grid && + gSavedSettings.getString("CmdLineLoginLocation").empty() && + ! gSavedSettings.getString("CmdLineGridChoice").empty() }; if ( !start_slurl.isSpatial() ) // has a start been established by the command line or NextLoginLocation ? { // no, so get the preference setting std::string defaultStartLocation = gSavedSettings.getString("LoginLocation"); LL_INFOS("AppInit")<<"default LoginLocation '"<<defaultStartLocation<<"'"<<LL_ENDL; LLSLURL defaultStart(defaultStartLocation); - if ( defaultStart.isSpatial() ) + if ( defaultStart.isSpatial() && ! force_grid ) { LLStartUp::setStartSLURL(defaultStart); } else { - LL_INFOS("AppInit")<<"no valid LoginLocation, using home"<<LL_ENDL; + LL_INFOS("AppInit") << (force_grid? "--grid specified" : "no valid LoginLocation") + << ", using home" << LL_ENDL; LLSLURL homeStart(LLSLURL::SIM_LOCATION_HOME); LLStartUp::setStartSLURL(homeStart); } } - else + else if (! force_grid) { - LLPanelLogin::onUpdateStartSLURL(start_slurl); // updates grid if needed + onUpdateStartSLURL(start_slurl); // updates grid if needed } childSetAction("connect_btn", onClickConnect, this); @@ -380,7 +395,7 @@ void LLPanelLogin::setFocus(BOOL b) { if(b) { - LLPanelLogin::giveFocus(); + giveFocus(); } else { @@ -748,7 +763,10 @@ void LLPanelLogin::closePanel() { if (sInstance) { - LLPanelLogin::sInstance->getParent()->removeChild( LLPanelLogin::sInstance ); + if (LLPanelLogin::sInstance->getParent()) + { + LLPanelLogin::sInstance->getParent()->removeChild(LLPanelLogin::sInstance); + } delete sInstance; sInstance = NULL; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index db9d61c637..f63e604927 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -885,7 +885,7 @@ void LLFloaterInventoryFinder::updateElementsFromFilter() U32 hours = mFilter->getHoursAgo(); U32 date_search_direction = mFilter->getDateSearchDirection(); - LLInventoryFilter::EFilterCreatorType filter_creator = mFilter->getFilterCreator(); + LLInventoryFilter::EFilterCreatorType filter_creator = mFilter->getFilterCreatorType(); bool show_created_by_me = ((filter_creator == LLInventoryFilter::FILTERCREATOR_ALL) || (filter_creator == LLInventoryFilter::FILTERCREATOR_SELF)); bool show_created_by_others = ((filter_creator == LLInventoryFilter::FILTERCREATOR_ALL) || (filter_creator == LLInventoryFilter::FILTERCREATOR_OTHERS)); @@ -898,7 +898,6 @@ void LLFloaterInventoryFinder::updateElementsFromFilter() getChild<LLUICtrl>("check_clothing")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_WEARABLE)); getChild<LLUICtrl>("check_gesture")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_GESTURE)); getChild<LLUICtrl>("check_landmark")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_LANDMARK)); - getChild<LLUICtrl>("check_mesh")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_MESH)); getChild<LLUICtrl>("check_notecard")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_NOTECARD)); getChild<LLUICtrl>("check_object")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_OBJECT)); getChild<LLUICtrl>("check_script")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_LSL)); @@ -954,12 +953,6 @@ void LLFloaterInventoryFinder::draw() filtered_by_all_types = FALSE; } - if (!getChild<LLUICtrl>("check_mesh")->getValue()) - { - filter &= ~(0x1 << LLInventoryType::IT_MESH); - filtered_by_all_types = FALSE; - } - if (!getChild<LLUICtrl>("check_notecard")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_NOTECARD); @@ -1108,7 +1101,6 @@ void LLFloaterInventoryFinder::selectAllTypes(void* user_data) self->getChild<LLUICtrl>("check_clothing")->setValue(TRUE); self->getChild<LLUICtrl>("check_gesture")->setValue(TRUE); self->getChild<LLUICtrl>("check_landmark")->setValue(TRUE); - self->getChild<LLUICtrl>("check_mesh")->setValue(TRUE); self->getChild<LLUICtrl>("check_notecard")->setValue(TRUE); self->getChild<LLUICtrl>("check_object")->setValue(TRUE); self->getChild<LLUICtrl>("check_script")->setValue(TRUE); @@ -1128,7 +1120,6 @@ void LLFloaterInventoryFinder::selectNoTypes(void* user_data) self->getChild<LLUICtrl>("check_clothing")->setValue(FALSE); self->getChild<LLUICtrl>("check_gesture")->setValue(FALSE); self->getChild<LLUICtrl>("check_landmark")->setValue(FALSE); - self->getChild<LLUICtrl>("check_mesh")->setValue(FALSE); self->getChild<LLUICtrl>("check_notecard")->setValue(FALSE); self->getChild<LLUICtrl>("check_object")->setValue(FALSE); self->getChild<LLUICtrl>("check_script")->setValue(FALSE); diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp index 3522189842..9730f0f16d 100644 --- a/indra/newview/llpanelmediasettingsgeneral.cpp +++ b/indra/newview/llpanelmediasettingsgeneral.cpp @@ -457,7 +457,7 @@ bool LLPanelMediaSettingsGeneral::navigateHomeSelectedFace(bool only_if_current_ if (!only_if_current_is_empty || (media_data->getCurrentURL().empty() && media_data->getAutoPlay())) { viewer_media_t media_impl = - LLViewerMedia::getMediaImplFromTextureID(object->getTE(face)->getMediaData()->getMediaID()); + LLViewerMedia::getInstance()->getMediaImplFromTextureID(object->getTE(face)->getMediaData()->getMediaID()); if(media_impl) { media_impl->navigateHome(); diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index f3a2ed9408..2dca55514d 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -543,9 +543,10 @@ void LLPanelNearByMedia::refreshParcelItems() // Only show "special parcel items" if "All" or "Within" filter // (and if media is "enabled") bool should_include = (choice == MEDIA_CLASS_ALL || choice == MEDIA_CLASS_WITHIN_PARCEL); - + LLViewerMedia* media_inst = LLViewerMedia::getInstance(); + // First Parcel Media: add or remove it as necessary - if (gSavedSettings.getBOOL("AudioStreamingMedia") &&should_include && LLViewerMedia::hasParcelMedia()) + if (gSavedSettings.getBOOL("AudioStreamingMedia") && should_include && media_inst->hasParcelMedia()) { // Yes, there is parcel media. if (NULL == mParcelMediaItem) @@ -566,7 +567,7 @@ void LLPanelNearByMedia::refreshParcelItems() if (NULL != mParcelMediaItem) { std::string name, url, tooltip; - getNameAndUrlHelper(LLViewerParcelMedia::getParcelMedia(), name, url, ""); + getNameAndUrlHelper(LLViewerParcelMedia::getInstance()->getParcelMedia(), name, url, ""); if (name.empty() || name == url) { tooltip = url; @@ -575,20 +576,20 @@ void LLPanelNearByMedia::refreshParcelItems() { tooltip = name + " : " + url; } - LLViewerMediaImpl *impl = LLViewerParcelMedia::getParcelMedia(); + LLViewerMediaImpl *impl = LLViewerParcelMedia::getInstance()->getParcelMedia(); updateListItem(mParcelMediaItem, mParcelMediaName, tooltip, -2, // Proximity closer than anything else, before Parcel Audio impl == NULL || impl->isMediaDisabled(), - impl != NULL && !LLViewerParcelMedia::getURL().empty(), + impl != NULL && !LLViewerParcelMedia::getInstance()->getURL().empty(), impl != NULL && impl->isMediaTimeBased() && impl->isMediaPlaying(), MEDIA_CLASS_ALL, "parcel media"); } // Next Parcel Audio: add or remove it as necessary (don't show if disabled in prefs) - if (should_include && LLViewerMedia::hasParcelAudio() && gSavedSettings.getBOOL("AudioStreamingMusic")) + if (should_include && media_inst->hasParcelAudio() && gSavedSettings.getBOOL("AudioStreamingMusic")) { // Yes, there is parcel audio. if (NULL == mParcelAudioItem) @@ -608,10 +609,10 @@ void LLPanelNearByMedia::refreshParcelItems() // ... then update it if (NULL != mParcelAudioItem) { - bool is_playing = LLViewerMedia::isParcelAudioPlaying(); + bool is_playing = media_inst->isParcelAudioPlaying(); std::string url; - url = LLViewerMedia::getParcelAudioURL(); + url = media_inst->getParcelAudioURL(); updateListItem(mParcelAudioItem, mParcelAudioName, @@ -653,7 +654,8 @@ void LLPanelNearByMedia::refreshList() refreshParcelItems(); // Get the canonical list from LLViewerMedia - LLViewerMedia::impl_list impls = LLViewerMedia::getPriorityList(); + LLViewerMedia* media_inst = LLViewerMedia::getInstance(); + LLViewerMedia::impl_list impls = media_inst->getPriorityList(); LLViewerMedia::impl_list::iterator priority_iter; U32 enabled_count = 0; @@ -706,17 +708,17 @@ void LLPanelNearByMedia::refreshList() } mDisableAllCtrl->setEnabled((gSavedSettings.getBOOL("AudioStreamingMusic") || gSavedSettings.getBOOL("AudioStreamingMedia")) && - (LLViewerMedia::isAnyMediaShowing() || - LLViewerMedia::isParcelMediaPlaying() || - LLViewerMedia::isParcelAudioPlaying())); + (media_inst->isAnyMediaShowing() || + media_inst->isParcelMediaPlaying() || + media_inst->isParcelAudioPlaying())); mEnableAllCtrl->setEnabled( (gSavedSettings.getBOOL("AudioStreamingMusic") || gSavedSettings.getBOOL("AudioStreamingMedia")) && (disabled_count > 0 || // parcel media (if we have it, and it isn't playing, enable "start") - (LLViewerMedia::hasParcelMedia() && ! LLViewerMedia::isParcelMediaPlaying()) || + (media_inst->hasParcelMedia() && ! media_inst->isParcelMediaPlaying()) || // parcel audio (if we have it, and it isn't playing, enable "start") - (LLViewerMedia::hasParcelAudio() && ! LLViewerMedia::isParcelAudioPlaying()))); + (media_inst->hasParcelAudio() && ! media_inst->isParcelAudioPlaying()))); // Iterate over the rows in the control, updating ones whose impl exists, and deleting ones whose impl has gone away. std::vector<LLScrollListItem*> items = mMediaList->getAllData(); @@ -731,7 +733,7 @@ void LLPanelNearByMedia::refreshList() if (row_id != PARCEL_MEDIA_LIST_ITEM_UUID && row_id != PARCEL_AUDIO_LIST_ITEM_UUID) { - LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(row_id); + LLViewerMediaImpl* impl = media_inst->getMediaImplFromTextureID(row_id); if(impl) { updateListItem(item, impl); @@ -776,26 +778,26 @@ void LLPanelNearByMedia::updateColumns() void LLPanelNearByMedia::onClickEnableAll() { - LLViewerMedia::setAllMediaEnabled(true); + LLViewerMedia::getInstance()->setAllMediaEnabled(true); } void LLPanelNearByMedia::onClickDisableAll() { - LLViewerMedia::setAllMediaEnabled(false); + LLViewerMedia::getInstance()->setAllMediaEnabled(false); } void LLPanelNearByMedia::onClickEnableParcelMedia() { - if ( ! LLViewerMedia::isParcelMediaPlaying() ) + if ( ! LLViewerMedia::getInstance()->isParcelMediaPlaying() ) { - LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel()); + LLViewerParcelMedia::getInstance()->play(LLViewerParcelMgr::getInstance()->getAgentParcel()); } } void LLPanelNearByMedia::onClickDisableParcelMedia() { // This actually unloads the impl, as opposed to "stop"ping the media - LLViewerParcelMedia::stop(); + LLViewerParcelMedia::getInstance()->stop(); } void LLPanelNearByMedia::onCheckItem(LLUICtrl* ctrl, const LLUUID &row_id) @@ -832,7 +834,7 @@ bool LLPanelNearByMedia::setDisabled(const LLUUID &row_id, bool disabled) return true; } else { - LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(row_id); + LLViewerMediaImpl* impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(row_id); if(impl) { impl->setDisabled(disabled, true); @@ -853,22 +855,22 @@ void LLPanelNearByMedia::onZoomMedia(void* user_data) void LLPanelNearByMedia::onClickParcelMediaPlay() { - LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel()); + LLViewerParcelMedia::getInstance()->play(LLViewerParcelMgr::getInstance()->getAgentParcel()); } void LLPanelNearByMedia::onClickParcelMediaStop() { - if (LLViewerParcelMedia::getParcelMedia()) + if (LLViewerParcelMedia::getInstance()->getParcelMedia()) { // This stops the media playing, as opposed to unloading it like // LLViewerParcelMedia::stop() does - LLViewerParcelMedia::getParcelMedia()->stop(); + LLViewerParcelMedia::getInstance()->getParcelMedia()->stop(); } } void LLPanelNearByMedia::onClickParcelMediaPause() { - LLViewerParcelMedia::pause(); + LLViewerParcelMedia::getInstance()->pause(); } void LLPanelNearByMedia::onClickParcelAudioPlay() @@ -889,7 +891,7 @@ void LLPanelNearByMedia::onClickParcelAudioPlay() } else { - LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLViewerMedia::getParcelAudioURL()); + LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLViewerMedia::getInstance()->getParcelAudioURL()); } } @@ -981,16 +983,17 @@ void LLPanelNearByMedia::onMoreLess() void LLPanelNearByMedia::updateControls() { LLUUID selected_media_id = mMediaList->getValue().asUUID(); + LLViewerMedia* media_inst = LLViewerMedia::getInstance(); if (selected_media_id == PARCEL_AUDIO_LIST_ITEM_UUID) { - if (!LLViewerMedia::hasParcelAudio() || !gSavedSettings.getBOOL("AudioStreamingMusic")) + if (!media_inst->getInstance()->hasParcelAudio() || !gSavedSettings.getBOOL("AudioStreamingMusic")) { // disable controls if audio streaming music is disabled from preference showDisabledControls(); } else { - showTimeBasedControls(LLViewerMedia::isParcelAudioPlaying(), + showTimeBasedControls(media_inst->isParcelAudioPlaying(), false, // include_zoom false, // is_zoomed gSavedSettings.getBOOL("MuteMusic"), @@ -999,13 +1002,13 @@ void LLPanelNearByMedia::updateControls() } else if (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) { - if (!LLViewerMedia::hasParcelMedia() || !gSavedSettings.getBOOL("AudioStreamingMedia")) + if (!media_inst->hasParcelMedia() || !gSavedSettings.getBOOL("AudioStreamingMedia")) { // disable controls if audio streaming media is disabled from preference showDisabledControls(); } else { - LLViewerMediaImpl* impl = LLViewerParcelMedia::getParcelMedia(); + LLViewerMediaImpl* impl = LLViewerParcelMedia::getInstance()->getParcelMedia(); if (NULL == impl) { // Just means it hasn't started yet @@ -1021,7 +1024,7 @@ void LLPanelNearByMedia::updateControls() } else { // non-time-based parcel media - showBasicControls(LLViewerMedia::isParcelMediaPlaying(), + showBasicControls(media_inst->isParcelMediaPlaying(), false, false, impl->getVolume() == 0.0, @@ -1030,7 +1033,7 @@ void LLPanelNearByMedia::updateControls() } } else { - LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(selected_media_id); + LLViewerMediaImpl* impl = media_inst->getMediaImplFromTextureID(selected_media_id); if (NULL == impl || !gSavedSettings.getBOOL("AudioStreamingMedia")) { @@ -1116,7 +1119,7 @@ void LLPanelNearByMedia::onClickSelectedMediaPlay() if (selected_media_id != PARCEL_AUDIO_LIST_ITEM_UUID) { LLViewerMediaImpl *impl = (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) ? - ((LLViewerMediaImpl*)LLViewerParcelMedia::getParcelMedia()) : LLViewerMedia::getMediaImplFromTextureID(selected_media_id); + ((LLViewerMediaImpl*)LLViewerParcelMedia::getInstance()->getParcelMedia()) : LLViewerMedia::getInstance()->getMediaImplFromTextureID(selected_media_id); if (NULL != impl) { if (impl->isMediaTimeBased() && impl->isMediaPaused()) @@ -1127,7 +1130,7 @@ void LLPanelNearByMedia::onClickSelectedMediaPlay() } else if (impl->isParcelMedia()) { - LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel()); + LLViewerParcelMedia::getInstance()->play(LLViewerParcelMgr::getInstance()->getAgentParcel()); } } } @@ -1145,7 +1148,7 @@ void LLPanelNearByMedia::onClickSelectedMediaPause() onClickParcelMediaPause(); } else { - LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(selected_media_id); + LLViewerMediaImpl* impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(selected_media_id); if (NULL != impl && impl->isMediaTimeBased() && impl->isMediaPlaying()) { impl->pause(); @@ -1162,7 +1165,7 @@ void LLPanelNearByMedia::onClickSelectedMediaMute() } else { LLViewerMediaImpl* impl = (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) ? - ((LLViewerMediaImpl*)LLViewerParcelMedia::getParcelMedia()) : LLViewerMedia::getMediaImplFromTextureID(selected_media_id); + ((LLViewerMediaImpl*)LLViewerParcelMedia::getInstance()->getParcelMedia()) : LLViewerMedia::getInstance()->getMediaImplFromTextureID(selected_media_id); if (NULL != impl) { F32 volume = impl->getVolume(); @@ -1193,7 +1196,7 @@ void LLPanelNearByMedia::onCommitSelectedMediaVolume() } else { LLViewerMediaImpl* impl = (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) ? - ((LLViewerMediaImpl*)LLViewerParcelMedia::getParcelMedia()) : LLViewerMedia::getMediaImplFromTextureID(selected_media_id); + ((LLViewerMediaImpl*)LLViewerParcelMedia::getInstance()->getParcelMedia()) : LLViewerMedia::getInstance()->getMediaImplFromTextureID(selected_media_id); if (NULL != impl) { impl->setVolume(mVolumeSlider->getValueF32()); diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index cd1875e995..6702dae4d6 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -1122,92 +1122,6 @@ LLUIImagePtr LLTaskWearableBridge::getIcon() const } ///---------------------------------------------------------------------------- -/// Class LLTaskMeshBridge -///---------------------------------------------------------------------------- - -class LLTaskMeshBridge : public LLTaskInvFVBridge -{ -public: - LLTaskMeshBridge( - LLPanelObjectInventory* panel, - const LLUUID& uuid, - const std::string& name); - - virtual LLUIImagePtr getIcon() const; - virtual void openItem(); - virtual void performAction(LLInventoryModel* model, std::string action); - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); -}; - -LLTaskMeshBridge::LLTaskMeshBridge( - LLPanelObjectInventory* panel, - const LLUUID& uuid, - const std::string& name) : - LLTaskInvFVBridge(panel, uuid, name) -{ -} - -LLUIImagePtr LLTaskMeshBridge::getIcon() const -{ - return LLInventoryIcon::getIcon(LLAssetType::AT_MESH, LLInventoryType::IT_MESH, 0, FALSE); -} - -void LLTaskMeshBridge::openItem() -{ - // open mesh -} - - -// virtual -void LLTaskMeshBridge::performAction(LLInventoryModel* model, std::string action) -{ - if (action == "mesh action") - { - LLInventoryItem* item = findItem(); - if(item) - { - // do action - } - } - LLTaskInvFVBridge::performAction(model, action); -} - -void LLTaskMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags) -{ - LLInventoryItem* item = findItem(); - std::vector<std::string> items; - std::vector<std::string> disabled_items; - if(!item) - { - hide_context_entries(menu, items, disabled_items); - return; - } - - items.push_back(std::string("Task Open")); - if (!isItemCopyable()) - { - disabled_items.push_back(std::string("Task Open")); - } - - items.push_back(std::string("Task Properties")); - if ((flags & FIRST_SELECTED_ITEM) == 0) - { - disabled_items.push_back(std::string("Task Properties")); - } - if(isItemRenameable()) - { - items.push_back(std::string("Task Rename")); - } - if(isItemRemovable()) - { - items.push_back(std::string("Task Remove")); - } - - - hide_context_entries(menu, items, disabled_items); -} - -///---------------------------------------------------------------------------- /// LLTaskInvFVBridge impl //---------------------------------------------------------------------------- @@ -1288,11 +1202,6 @@ LLTaskInvFVBridge* LLTaskInvFVBridge::createObjectBridge(LLPanelObjectInventory* object_id, object_name); break; - case LLAssetType::AT_MESH: - new_bridge = new LLTaskMeshBridge(panel, - object_id, - object_name); - break; default: LL_INFOS() << "Unhandled inventory type (llassetstorage.h): " << (S32)type << LL_ENDL; @@ -1498,7 +1407,14 @@ void LLPanelObjectInventory::updateInventory() mIsInventoryEmpty = TRUE; } - mHaveInventory = TRUE; + mHaveInventory = !mIsInventoryEmpty || !objectp->isInventoryDirty(); + if (objectp->isInventoryDirty()) + { + // Inventory is dirty, yet we received inventoryChanged() callback. + // User changed something during ongoing request. + // Rerequest. It will clear dirty flag and won't create dupplicate requests. + objectp->requestInventory(); + } } else { @@ -1768,7 +1684,7 @@ void LLPanelObjectInventory::deleteAllChildren() BOOL LLPanelObjectInventory::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) { - if (mFolders && mHaveInventory) + if (mFolders) { LLFolderViewItem* folderp = mFolders->getNextFromChild(NULL); if (!folderp) diff --git a/indra/newview/llpanelobjectinventory.h b/indra/newview/llpanelobjectinventory.h index d700c8f4cf..7b9ecfb8f3 100644 --- a/indra/newview/llpanelobjectinventory.h +++ b/indra/newview/llpanelobjectinventory.h @@ -106,9 +106,9 @@ private: LLUUID mTaskUUID; LLUUID mAttachmentUUID; - BOOL mHaveInventory; - BOOL mIsInventoryEmpty; - BOOL mInventoryNeedsUpdate; + BOOL mHaveInventory; // 'Loading' label and used for initial request + BOOL mIsInventoryEmpty; // 'Empty' label + BOOL mInventoryNeedsUpdate; // for idle, set on changed callback LLFolderViewModelInventory mInventoryViewModel; }; diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index c5bae9c52e..1d87aa6f5d 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -467,6 +467,7 @@ BOOL LLPanelOutfitEdit::postBuild() mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("alpha"), new LLFindActualWearablesOfType(LLWearableType::WT_ALPHA))); mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("tattoo"), new LLFindActualWearablesOfType(LLWearableType::WT_TATTOO))); mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("physics"), new LLFindActualWearablesOfType(LLWearableType::WT_PHYSICS))); + mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("universal"), new LLFindActualWearablesOfType(LLWearableType::WT_UNIVERSAL))); mCurrentOutfitName = getChild<LLTextBox>("curr_outfit_name"); mStatus = getChild<LLTextBox>("status"); diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index 2cc8b65001..3c6efac0e7 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -98,6 +98,7 @@ public: LVIT_ALPHA, LVIT_TATTOO, LVIT_PHYSICS, + LVIT_UNIVERSAL, NUM_LIST_VIEW_ITEM_TYPES } EListViewItemType; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 617ca05281..be174475e1 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -54,7 +54,6 @@ #include "llcallingcard.h" // for LLAvatarTracker #include "llcallbacklist.h" #include "llerror.h" -#include "llfacebookconnect.h" #include "llfloateravatarpicker.h" #include "llfriendcard.h" #include "llgroupactions.h" @@ -537,7 +536,6 @@ public: LLPanelPeople::LLPanelPeople() : LLPanel(), - mTryToConnectToFacebook(true), mTabContainer(NULL), mOnlineFriendList(NULL), mAllFriendList(NULL), @@ -645,11 +643,9 @@ BOOL LLPanelPeople::postBuild() // updater is active only if panel is visible to user. friends_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFriendListUpdater, _2)); friends_tab->setVisibleCallback(boost::bind(&LLPanelPeople::removePicker, this)); - friends_tab->setVisibleCallback(boost::bind(&LLPanelPeople::updateFacebookList, this, _2)); mOnlineFriendList = friends_tab->getChild<LLAvatarList>("avatars_online"); mAllFriendList = friends_tab->getChild<LLAvatarList>("avatars_all"); - mSuggestedFriends = friends_tab->getChild<LLAvatarList>("suggested_friends"); mOnlineFriendList->setNoItemsCommentText(getString("no_friends_online")); mOnlineFriendList->setShowIcons("FriendsListShowIcons"); mOnlineFriendList->showPermissions("FriendsListShowPermissions"); @@ -685,7 +681,6 @@ BOOL LLPanelPeople::postBuild() mRecentList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); - mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gSuggestedFriendsContextMenu); setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false); setSortOrder(mAllFriendList, (ESortOrder)gSavedSettings.getU32("FriendsSortOrder"), false); @@ -764,7 +759,7 @@ void LLPanelPeople::updateFriendListHelpText() // Seems sometimes all_friends can be empty because of issue with Inventory loading (clear cache, slow connection...) // So, lets check all lists to avoid overlapping the text with online list. See EXT-6448. - bool any_friend_exists = mAllFriendList->filterHasMatches() || mOnlineFriendList->filterHasMatches() || mSuggestedFriends->filterHasMatches(); + bool any_friend_exists = mAllFriendList->filterHasMatches() || mOnlineFriendList->filterHasMatches(); no_friends_text->setVisible(!any_friend_exists); if (no_friends_text->getVisible()) { @@ -831,40 +826,9 @@ void LLPanelPeople::updateFriendList() mAllFriendList->setDirty(true, !mAllFriendList->filterHasMatches()); //update trash and other buttons according to a selected item updateButtons(); - updateSuggestedFriendList(); showFriendsAccordionsIfNeeded(); } -bool LLPanelPeople::updateSuggestedFriendList() -{ - const LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); - uuid_vec_t& suggested_friends = mSuggestedFriends->getIDs(); - suggested_friends.clear(); - - //Add suggested friends - LLSD friends = LLFacebookConnect::instance().getContent(); - for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i) - { - LLUUID agent_id = (*i).asUUID(); - bool second_life_buddy = agent_id.notNull() ? av_tracker.isBuddy(agent_id) : false; - - if(!second_life_buddy) - { - //FB+SL but not SL friend - if (agent_id.notNull()) - { - suggested_friends.push_back(agent_id); - } - } - } - - //Force a refresh when there aren't any filter matches (prevent displaying content that shouldn't display) - mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches()); - showFriendsAccordionsIfNeeded(); - - return false; -} - void LLPanelPeople::updateNearbyList() { if (!mNearbyList) @@ -888,51 +852,6 @@ void LLPanelPeople::updateRecentList() mRecentList->setDirty(); } -bool LLPanelPeople::onConnectedToFacebook(const LLSD& data) -{ - LLSD::Integer connection_state = data.get("enum").asInteger(); - - if (connection_state == LLFacebookConnect::FB_CONNECTED) - { - LLFacebookConnect::instance().loadFacebookFriends(); - } - else if(connection_state == LLFacebookConnect::FB_NOT_CONNECTED) - { - updateSuggestedFriendList(); - }; - - return false; -} - -void LLPanelPeople::updateFacebookList(bool visible) -{ - if (visible) - { - LLEventPumps::instance().obtain("FacebookConnectContent").stopListening("LLPanelPeople"); // just in case it is already listening - LLEventPumps::instance().obtain("FacebookConnectContent").listen("LLPanelPeople", boost::bind(&LLPanelPeople::updateSuggestedFriendList, this)); - - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLPanelPeople"); // just in case it is already listening - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLPanelPeople", boost::bind(&LLPanelPeople::onConnectedToFacebook, this, _1)); - - if (LLFacebookConnect::instance().isConnected()) - { - LLFacebookConnect::instance().loadFacebookFriends(); - } - else if(mTryToConnectToFacebook) - { - LLFacebookConnect::instance().checkConnectionToFacebook(); - mTryToConnectToFacebook = false; - } - - updateSuggestedFriendList(); - } - else - { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLPanelPeople"); - LLEventPumps::instance().obtain("FacebookConnectContent").stopListening("LLPanelPeople"); - } -} - void LLPanelPeople::updateButtons() { std::string cur_tab = getActiveTabName(); @@ -1151,11 +1070,9 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string) mOnlineFriendList->setNameFilter(filter); mAllFriendList->setNameFilter(filter); - mSuggestedFriends->setNameFilter(filter); setAccordionCollapsedByUser("tab_online", false); setAccordionCollapsedByUser("tab_all", false); - setAccordionCollapsedByUser("tab_suggested_friends", false); showFriendsAccordionsIfNeeded(); // restore accordion tabs state _after_ all manipulations @@ -1600,7 +1517,6 @@ void LLPanelPeople::showFriendsAccordionsIfNeeded() // Expand and show accordions if needed, else - hide them showAccordion("tab_online", mOnlineFriendList->filterHasMatches()); showAccordion("tab_all", mAllFriendList->filterHasMatches()); - showAccordion("tab_suggested_friends", mSuggestedFriends->filterHasMatches()); // Rearrange accordions LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("friends_accordion"); diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index c72c4fc08a..14205cebe2 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -57,8 +57,6 @@ public: // when voice is available /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); - bool mTryToConnectToFacebook; - // internals class Updater; @@ -80,10 +78,8 @@ private: // methods indirectly called by the updaters void updateFriendListHelpText(); void updateFriendList(); - bool updateSuggestedFriendList(); void updateNearbyList(); void updateRecentList(); - void updateFacebookList(bool visible); bool isItemsFreeOfFriends(const uuid_vec_t& uuids); @@ -131,8 +127,6 @@ private: void onFriendListRefreshComplete(LLUICtrl*ctrl, const LLSD& param); - bool onConnectedToFacebook(const LLSD& data); - void setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool collapsed); void setAccordionCollapsedByUser(const std::string& name, bool collapsed); bool isAccordionCollapsedByUser(LLUICtrl* acc_tab); @@ -141,7 +135,6 @@ private: LLTabContainer* mTabContainer; LLAvatarList* mOnlineFriendList; LLAvatarList* mAllFriendList; - LLAvatarList* mSuggestedFriends; LLAvatarList* mNearbyList; LLAvatarList* mRecentList; LLGroupList* mGroupList; diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index 65769ff526..42cecc9986 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -52,7 +52,6 @@ namespace LLPanelPeopleMenus PeopleContextMenu gPeopleContextMenu; NearbyPeopleContextMenu gNearbyPeopleContextMenu; -SuggestedFriendsContextMenu gSuggestedFriendsContextMenu; //== PeopleContextMenu =============================================================== @@ -413,36 +412,4 @@ void NearbyPeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags) hide_context_entries(menu, items, disabled_items); } -//== SuggestedFriendsContextMenu =============================================================== - -LLContextMenu* SuggestedFriendsContextMenu::createMenu() -{ - // set up the callbacks for all of the avatar menu items - LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; - LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; - LLContextMenu* menu; - - // Set up for one person selected menu - const LLUUID& id = mUUIDs.front(); - registrar.add("Avatar.Profile", boost::bind(&LLAvatarActions::showProfile, id)); - registrar.add("Avatar.AddFriend", boost::bind(&LLAvatarActions::requestFriendshipDialog, id)); - - // create the context menu from the XUI - menu = createFromFile("menu_people_nearby.xml"); - buildContextMenu(*menu, 0x0); - - return menu; -} - -void SuggestedFriendsContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags) -{ - menuentry_vec_t items; - menuentry_vec_t disabled_items; - - items.push_back(std::string("view_profile")); - items.push_back(std::string("add_friend")); - - hide_context_entries(menu, items, disabled_items); -} - } // namespace LLPanelPeopleMenus diff --git a/indra/newview/llpanelpeoplemenus.h b/indra/newview/llpanelpeoplemenus.h index 5ed20e0064..3bc1f8caf7 100644 --- a/indra/newview/llpanelpeoplemenus.h +++ b/indra/newview/llpanelpeoplemenus.h @@ -62,21 +62,8 @@ protected: /*virtual*/ void buildContextMenu(class LLMenuGL& menu, U32 flags); }; -/** - * Menu used in the suggested friends list. - */ -class SuggestedFriendsContextMenu : public PeopleContextMenu -{ -public: - /*virtual*/ LLContextMenu * createMenu(); - -protected: - /*virtual*/ void buildContextMenu(class LLMenuGL& menu, U32 flags); -}; - extern PeopleContextMenu gPeopleContextMenu; extern NearbyPeopleContextMenu gNearbyPeopleContextMenu; -extern SuggestedFriendsContextMenu gSuggestedFriendsContextMenu; } // namespace LLPanelPeopleMenus diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 77bc99da83..c39df3fe8b 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -84,7 +84,7 @@ public: bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { - if (!LLUI::sSettingGroups["config"]->getBOOL("EnablePicks")) + if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnablePicks")) { LLNotificationsUtil::add("NoPicks", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); return true; @@ -198,7 +198,7 @@ public: bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { - if (!LLUI::sSettingGroups["config"]->getBOOL("EnableClassifieds")) + if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableClassifieds")) { LLNotificationsUtil::add("NoClassifieds", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); return true; diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 610b3a6396..104316e253 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -563,11 +563,8 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, mSaleToText->setText(getString("anyone")); } - const U8* sign = (U8*)getString("price_text").c_str(); - const U8* sqm = (U8*)getString("area_text").c_str(); - - mSalesPriceText->setText(llformat("%s%d ", sign, parcel->getSalePrice())); - mAreaText->setText(llformat("%d %s", area, sqm)); + mSalesPriceText->setText(llformat("%s%d ", getString("price_text").c_str(), parcel->getSalePrice())); + mAreaText->setText(llformat("%d %s", area, getString("area_text").c_str())); mTrafficText->setText(llformat("%.0f", dwell)); // Can't have more than region max tasks, regardless of parcel @@ -575,10 +572,7 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, S32 primitives = llmin(ll_round(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()), (S32)region->getMaxTasks()); - const U8* available = (U8*)getString("available").c_str(); - const U8* allocated = (U8*)getString("allocated").c_str(); - - mPrimitivesText->setText(llformat("%d %s, %d %s", primitives, available, parcel->getPrimCount(), allocated)); + mPrimitivesText->setText(llformat("%d %s, %d %s", primitives, getString("available").c_str(), parcel->getPrimCount(), getString("allocated").c_str())); if (parcel->getAllowOtherScripts()) { diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 48dd45480e..961e259947 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -97,7 +97,7 @@ public: return false; } - if (!LLUI::sSettingGroups["config"]->getBOOL("EnablePlaceProfile")) + if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnablePlaceProfile")) { LLNotificationsUtil::add("NoPlaceInfo", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); return true; diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 5f413fc3c0..8105beae1b 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -267,7 +267,7 @@ void LLPanelPrimMediaControls::focusOnTarget() LLViewerMediaImpl* LLPanelPrimMediaControls::getTargetMediaImpl() { - return LLViewerMedia::getMediaImplFromTextureID(mTargetImplID); + return LLViewerMedia::getInstance()->getMediaImplFromTextureID(mTargetImplID); } LLViewerObject* LLPanelPrimMediaControls::getTargetObject() diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 8afa35efa0..5f13b223fb 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -110,7 +110,7 @@ public: if (verb == "pay") { - if (!LLUI::sSettingGroups["config"]->getBOOL("EnableAvatarPay")) + if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableAvatarPay")) { LLNotificationsUtil::add("NoAvatarPay", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); return true; diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp index 95c14e4226..23747a8efd 100644 --- a/indra/newview/llpanelsnapshotoptions.cpp +++ b/indra/newview/llpanelsnapshotoptions.cpp @@ -32,7 +32,6 @@ #include "llfloatersnapshot.h" // FIXME: create a snapshot model #include "llfloaterreg.h" -#include "llfloaterfacebook.h" #include "llfloaterflickr.h" #include "llfloatertwitter.h" @@ -59,7 +58,6 @@ private: void onSaveToEmail(); void onSaveToInventory(); void onSaveToComputer(); - void onSendToFacebook(); void onSendToTwitter(); void onSendToFlickr(); @@ -74,7 +72,6 @@ LLPanelSnapshotOptions::LLPanelSnapshotOptions() mCommitCallbackRegistrar.add("Snapshot.SaveToEmail", boost::bind(&LLPanelSnapshotOptions::onSaveToEmail, this)); mCommitCallbackRegistrar.add("Snapshot.SaveToInventory", boost::bind(&LLPanelSnapshotOptions::onSaveToInventory, this)); mCommitCallbackRegistrar.add("Snapshot.SaveToComputer", boost::bind(&LLPanelSnapshotOptions::onSaveToComputer, this)); - mCommitCallbackRegistrar.add("Snapshot.SendToFacebook", boost::bind(&LLPanelSnapshotOptions::onSendToFacebook, this)); mCommitCallbackRegistrar.add("Snapshot.SendToTwitter", boost::bind(&LLPanelSnapshotOptions::onSendToTwitter, this)); mCommitCallbackRegistrar.add("Snapshot.SendToFlickr", boost::bind(&LLPanelSnapshotOptions::onSendToFlickr, this)); LLGlobalEconomy::getInstance()->addObserver(this); @@ -138,18 +135,6 @@ void LLPanelSnapshotOptions::onSaveToComputer() openPanel("panel_snapshot_local"); } -void LLPanelSnapshotOptions::onSendToFacebook() -{ - LLFloaterReg::hideInstance("snapshot"); - - LLFloaterFacebook* facebook_floater = dynamic_cast<LLFloaterFacebook*>(LLFloaterReg::getInstance("facebook")); - if (facebook_floater) - { - facebook_floater->showPhotoPanel(); - } - LLFloaterReg::showInstance("facebook"); -} - void LLPanelSnapshotOptions::onSendToTwitter() { LLFloaterReg::hideInstance("snapshot"); diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 96dd309fa4..735eaa423d 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -383,6 +383,29 @@ void LLPanelVolume::getState( ) } } getChildView("Animated Mesh Checkbox Ctrl")->setEnabled(enabled_animated_object_box); + + //refresh any bakes + if (root_volobjp) + { + root_volobjp->refreshBakeTexture(); + + LLViewerObject::const_child_list_t& child_list = root_volobjp->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); ++iter) + { + LLViewerObject* objectp = *iter; + if (objectp) + { + objectp->refreshBakeTexture(); + } + } + + if (gAgentAvatarp) + { + gAgentAvatarp->updateMeshVisibility(); + } + } + // Flexible properties BOOL is_flexible = volobjp && volobjp->isFlexible(); @@ -953,6 +976,28 @@ void LLPanelVolume::onCommitAnimatedMeshCheckbox(LLUICtrl *, void*) { volobjp->setExtendedMeshFlags(new_flags); } + + //refresh any bakes + if (volobjp) + { + volobjp->refreshBakeTexture(); + + LLViewerObject::const_child_list_t& child_list = volobjp->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); ++iter) + { + LLViewerObject* objectp = *iter; + if (objectp) + { + objectp->refreshBakeTexture(); + } + } + + if (gAgentAvatarp) + { + gAgentAvatarp->updateMeshVisibility(); + } + } } void LLPanelVolume::onCommitIsFlexible(LLUICtrl *, void*) diff --git a/indra/newview/llpersistentnotificationstorage.cpp b/indra/newview/llpersistentnotificationstorage.cpp index 264382ae82..f95ab9928d 100644 --- a/indra/newview/llpersistentnotificationstorage.cpp +++ b/indra/newview/llpersistentnotificationstorage.cpp @@ -40,6 +40,7 @@ LLPersistentNotificationStorage::LLPersistentNotificationStorage(): LLNotificationStorage("") , mLoaded(false) { + initialize(); } LLPersistentNotificationStorage::~LLPersistentNotificationStorage() diff --git a/indra/newview/llpersistentnotificationstorage.h b/indra/newview/llpersistentnotificationstorage.h index 40c9923c74..1fb4487286 100644 --- a/indra/newview/llpersistentnotificationstorage.h +++ b/indra/newview/llpersistentnotificationstorage.h @@ -43,7 +43,7 @@ class LLSD; // be a) serializable(implement LLNotificationResponderInterface), // b) registered with LLResponderRegistry (found in llpersistentnotificationstorage.cpp). -class LLPersistentNotificationStorage : public LLSingleton<LLPersistentNotificationStorage>, public LLNotificationStorage +class LLPersistentNotificationStorage : public LLParamSingleton<LLPersistentNotificationStorage>, public LLNotificationStorage { LLSINGLETON(LLPersistentNotificationStorage); ~LLPersistentNotificationStorage(); @@ -53,11 +53,11 @@ public: void saveNotifications(); void loadNotifications(); - void initialize(); - protected: private: + void initialize(); + bool onPersistentChannelChanged(const LLSD& payload); bool mLoaded; }; diff --git a/indra/newview/llpopupview.cpp b/indra/newview/llpopupview.cpp index 153f0930c2..d1a9ca229f 100644 --- a/indra/newview/llpopupview.cpp +++ b/indra/newview/llpopupview.cpp @@ -44,13 +44,13 @@ LLPopupView::LLPopupView(const LLPopupView::Params& p) : LLPanel(p) { // register ourself as handler of UI popups - LLUI::setPopupFuncs(boost::bind(&LLPopupView::addPopup, this, _1), boost::bind(&LLPopupView::removePopup, this, _1), boost::bind(&LLPopupView::clearPopups, this)); + LLUI::getInstance()->setPopupFuncs(boost::bind(&LLPopupView::addPopup, this, _1), boost::bind(&LLPopupView::removePopup, this, _1), boost::bind(&LLPopupView::clearPopups, this)); } LLPopupView::~LLPopupView() { // set empty callback function so we can't handle popups anymore - LLUI::setPopupFuncs(LLUI::add_popup_t(), LLUI::remove_popup_t(), LLUI::clear_popups_t()); + LLUI::getInstance()->setPopupFuncs(LLUI::add_popup_t(), LLUI::remove_popup_t(), LLUI::clear_popups_t()); } void LLPopupView::draw() diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index d4a8bbdf45..1533a27469 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -32,6 +32,7 @@ #include "llagent.h" #include "lldraghandle.h" +#include "llexternaleditor.h" #include "llviewerwindow.h" #include "llbutton.h" #include "llfloaterreg.h" @@ -43,6 +44,7 @@ #include "roles_constants.h" #include "llscrollbar.h" #include "llselectmgr.h" +#include "lltrans.h" #include "llviewertexteditor.h" #include "llvfile.h" #include "llviewerinventory.h" @@ -63,7 +65,8 @@ // Default constructor LLPreviewNotecard::LLPreviewNotecard(const LLSD& key) //const LLUUID& item_id, - : LLPreview( key ) + : LLPreview( key ), + mLiveFile(NULL) { const LLInventoryItem *item = getItem(); if (item) @@ -74,13 +77,14 @@ LLPreviewNotecard::LLPreviewNotecard(const LLSD& key) //const LLUUID& item_id, LLPreviewNotecard::~LLPreviewNotecard() { + delete mLiveFile; } BOOL LLPreviewNotecard::postBuild() { - LLViewerTextEditor *ed = getChild<LLViewerTextEditor>("Notecard Editor"); - ed->setNotecardInfo(mItemUUID, mObjectID, getKey()); - ed->makePristine(); + mEditor = getChild<LLViewerTextEditor>("Notecard Editor"); + mEditor->setNotecardInfo(mItemUUID, mObjectID, getKey()); + mEditor->makePristine(); childSetAction("Save", onClickSave, this); getChildView("lock")->setVisible( FALSE); @@ -88,6 +92,8 @@ BOOL LLPreviewNotecard::postBuild() childSetAction("Delete", onClickDelete, this); getChildView("Delete")->setEnabled(false); + childSetAction("Edit", onClickEdit, this); + const LLInventoryItem* item = getItem(); childSetCommitCallback("desc", LLPreview::onText, this); @@ -408,6 +414,16 @@ void LLPreviewNotecard::onClickDelete(void* user_data) } } +// static +void LLPreviewNotecard::onClickEdit(void* user_data) +{ + LLPreviewNotecard* preview = (LLPreviewNotecard*)user_data; + if (preview) + { + preview->openInExternalEditor(); + } +} + struct LLSaveNotecardInfo { LLPreviewNotecard* mSelf; @@ -468,7 +484,7 @@ void LLPreviewNotecard::finishTaskUpload(LLUUID itemId, LLUUID newAssetId, LLUUI } } -bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem) +bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem, bool sync) { LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor"); @@ -487,7 +503,10 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem) } editor->makePristine(); - + if (sync) + { + syncExternal(); + } const LLInventoryItem* item = getItem(); // save it out to database if (item) @@ -566,6 +585,18 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem) return true; } +void LLPreviewNotecard::syncExternal() +{ + // Sync with external editor. + std::string tmp_file = getTmpFileName(); + llstat s; + if (LLFile::stat(tmp_file, &s) == 0) // file exists + { + if (mLiveFile) mLiveFile->ignoreNextUpdate(); + writeToFile(tmp_file); + } +} + void LLPreviewNotecard::deleteNotecard() { LLNotificationsUtil::add("DeleteNotecard", LLSD(), LLSD(), boost::bind(&LLPreviewNotecard::handleConfirmDeleteDialog,this, _1, _2)); @@ -714,4 +745,128 @@ bool LLPreviewNotecard::handleConfirmDeleteDialog(const LLSD& notification, cons return false; } +void LLPreviewNotecard::openInExternalEditor() +{ + delete mLiveFile; // deletes file + + // Save the notecard to a temporary file. + std::string filename = getTmpFileName(); + writeToFile(filename); + + // Start watching file changes. + mLiveFile = new LLLiveLSLFile(filename, boost::bind(&LLPreviewNotecard::onExternalChange, this, _1)); + mLiveFile->addToEventTimer(); + + // Open it in external editor. + { + LLExternalEditor ed; + LLExternalEditor::EErrorCode status; + std::string msg; + + status = ed.setCommand("LL_SCRIPT_EDITOR"); + if (status != LLExternalEditor::EC_SUCCESS) + { + if (status == LLExternalEditor::EC_NOT_SPECIFIED) // Use custom message for this error. + { + msg = LLTrans::getString("ExternalEditorNotSet"); + } + else + { + msg = LLExternalEditor::getErrorMessage(status); + } + + LLNotificationsUtil::add("GenericAlert", LLSD().with("MESSAGE", msg)); + return; + } + + status = ed.run(filename); + if (status != LLExternalEditor::EC_SUCCESS) + { + msg = LLExternalEditor::getErrorMessage(status); + LLNotificationsUtil::add("GenericAlert", LLSD().with("MESSAGE", msg)); + } + } +} + +bool LLPreviewNotecard::onExternalChange(const std::string& filename) +{ + if (!loadNotecardText(filename)) + { + return false; + } + + // Disable sync to avoid recursive load->save->load calls. + saveIfNeeded(NULL, false); + return true; +} + +bool LLPreviewNotecard::loadNotecardText(const std::string& filename) +{ + if (filename.empty()) + { + LL_WARNS() << "Empty file name" << LL_ENDL; + return false; + } + + LLFILE* file = LLFile::fopen(filename, "rb"); /*Flawfinder: ignore*/ + if (!file) + { + LL_WARNS() << "Error opening " << filename << LL_ENDL; + return false; + } + + // read in the whole file + fseek(file, 0L, SEEK_END); + size_t file_length = (size_t)ftell(file); + fseek(file, 0L, SEEK_SET); + char* buffer = new char[file_length + 1]; + size_t nread = fread(buffer, 1, file_length, file); + if (nread < file_length) + { + LL_WARNS() << "Short read" << LL_ENDL; + } + buffer[nread] = '\0'; + fclose(file); + + mEditor->setText(LLStringExplicit(buffer)); + delete[] buffer; + + return true; +} + +bool LLPreviewNotecard::writeToFile(const std::string& filename) +{ + LLFILE* fp = LLFile::fopen(filename, "wb"); + if (!fp) + { + LL_WARNS() << "Unable to write to " << filename << LL_ENDL; + return false; + } + + std::string utf8text = mEditor->getText(); + + if (utf8text.size() == 0) + { + utf8text = " "; + } + + fputs(utf8text.c_str(), fp); + fclose(fp); + return true; +} + + +std::string LLPreviewNotecard::getTmpFileName() +{ + std::string notecard_id = mObjectID.asString() + "_" + mItemUUID.asString(); + + // Use MD5 sum to make the file name shorter and not exceed maximum path length. + char notecard_id_hash_str[33]; /* Flawfinder: ignore */ + LLMD5 notecard_id_hash((const U8 *)notecard_id.c_str()); + notecard_id_hash.hex_digest(notecard_id_hash_str); + + return std::string(LLFile::tmpdir()) + "sl_notecard_" + notecard_id_hash_str + ".txt"; +} + + // EOF diff --git a/indra/newview/llpreviewnotecard.h b/indra/newview/llpreviewnotecard.h index 46a6d0ef50..d9c14815c1 100644 --- a/indra/newview/llpreviewnotecard.h +++ b/indra/newview/llpreviewnotecard.h @@ -29,6 +29,7 @@ #include "llpreview.h" #include "llassetstorage.h" +#include "llpreviewscript.h" #include "lliconctrl.h" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -47,18 +48,18 @@ public: virtual ~LLPreviewNotecard(); bool saveItem(); - void setObjectID(const LLUUID& object_id); + void setObjectID(const LLUUID& object_id) override; // llview - virtual void draw(); - virtual BOOL handleKeyHere(KEY key, MASK mask); - virtual void setEnabled( BOOL enabled ); + void draw() override; + BOOL handleKeyHere(KEY key, MASK mask) override; + void setEnabled( BOOL enabled ) override; // llfloater - virtual BOOL canClose(); + BOOL canClose() override; // llpanel - virtual BOOL postBuild(); + BOOL postBuild() override; // reach into the text editor, and grab the drag item const LLInventoryItem* getDragItem(); @@ -72,11 +73,13 @@ public: // asset system. :( void refreshFromInventory(const LLUUID& item_id = LLUUID::null); + void syncExternal(); + protected: - void updateTitleButtons(); - virtual void loadAsset(); - bool saveIfNeeded(LLInventoryItem* copyitem = NULL); + void updateTitleButtons() override; + void loadAsset() override; + bool saveIfNeeded(LLInventoryItem* copyitem = NULL, bool sync = true); void deleteNotecard(); @@ -89,6 +92,8 @@ protected: static void onClickDelete(void* data); + static void onClickEdit(void* data); + static void onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status); @@ -99,6 +104,12 @@ protected: static void finishInventoryUpload(LLUUID itemId, LLUUID newAssetId, LLUUID newItemId); static void finishTaskUpload(LLUUID itemId, LLUUID newAssetId, LLUUID taskId); + void openInExternalEditor(); + bool onExternalChange(const std::string& filename); + bool loadNotecardText(const std::string& filename); + bool writeToFile(const std::string& filename); + std::string getTmpFileName(); + protected: LLViewerTextEditor* mEditor; LLButton* mSaveBtn; @@ -106,6 +117,8 @@ protected: LLUUID mAssetID; LLUUID mObjectID; + + LLLiveLSLFile* mLiveFile; }; diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 9431914ba3..d177384b5a 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -41,7 +41,6 @@ #include "llinventorymodel.h" #include "llkeyboard.h" #include "lllineeditor.h" -#include "lllivefile.h" #include "llhelp.h" #include "llnotificationsutil.h" #include "llresmgr.h" @@ -120,22 +119,6 @@ static bool have_script_upload_cap(LLUUID& object_id) /// --------------------------------------------------------------------------- /// LLLiveLSLFile /// --------------------------------------------------------------------------- -class LLLiveLSLFile : public LLLiveFile -{ -public: - typedef boost::function<bool (const std::string& filename)> change_callback_t; - - LLLiveLSLFile(std::string file_path, change_callback_t change_cb); - ~LLLiveLSLFile(); - - void ignoreNextUpdate() { mIgnoreNextUpdate = true; } - -protected: - /*virtual*/ bool loadFile(); - - change_callback_t mOnChangeCallback; - bool mIgnoreNextUpdate; -}; LLLiveLSLFile::LLLiveLSLFile(std::string file_path, change_callback_t change_cb) : mOnChangeCallback(change_cb) @@ -902,7 +885,7 @@ bool LLScriptEdCore::handleSaveChangesDialog(const LLSD& notification, const LLS void LLScriptEdCore::onBtnHelp() { - LLUI::sHelpImpl->showTopic(HELP_LSL_PORTAL_TOPIC); + LLUI::getInstance()->mHelpImpl->showTopic(HELP_LSL_PORTAL_TOPIC); } void LLScriptEdCore::onBtnDynamicHelp() @@ -1069,7 +1052,7 @@ void LLScriptEdCore::openInExternalEditor() { if (status == LLExternalEditor::EC_NOT_SPECIFIED) // Use custom message for this error. { - msg = getString("external_editor_not_set"); + msg = LLTrans::getString("ExternalEditorNotSet"); } else { diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index 69cf9d9158..74e4c00d43 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -34,6 +34,7 @@ #include "lliconctrl.h" #include "llframetimer.h" #include "llfloatergotoline.h" +#include "lllivefile.h" #include "llsyntaxid.h" class LLLiveLSLFile; @@ -53,6 +54,23 @@ class LLScriptEdContainer; class LLFloaterGotoLine; class LLFloaterExperienceProfile; +class LLLiveLSLFile : public LLLiveFile +{ +public: + typedef boost::function<bool(const std::string& filename)> change_callback_t; + + LLLiveLSLFile(std::string file_path, change_callback_t change_cb); + ~LLLiveLSLFile(); + + void ignoreNextUpdate() { mIgnoreNextUpdate = true; } + +protected: + /*virtual*/ bool loadFile(); + + change_callback_t mOnChangeCallback; + bool mIgnoreNextUpdate; +}; + // Inner, implementation class. LLPreviewScript and LLLiveLSLEditor each own one of these. class LLScriptEdCore : public LLPanel { diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index c17b86783d..083a913ef8 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -86,7 +86,7 @@ BOOL LLProgressView::postBuild() mMediaCtrl->setVisible( false ); // hidden initially mMediaCtrl->addObserver( this ); // watch events - LLViewerMedia::setOnlyAudibleMediaTextureID(mMediaCtrl->getTextureID()); + LLViewerMedia::getInstance()->setOnlyAudibleMediaTextureID(mMediaCtrl->getTextureID()); mCancelBtn = getChild<LLButton>("cancel_btn"); mCancelBtn->setClickedCallback( LLProgressView::onCancelButtonClicked, NULL ); @@ -263,7 +263,7 @@ void LLProgressView::draw() { mFadeToWorldTimer.stop(); - LLViewerMedia::setOnlyAudibleMediaTextureID(LLUUID::null); + LLViewerMedia::getInstance()->setOnlyAudibleMediaTextureID(LLUUID::null); // Fade is complete, release focus gFocusMgr.releaseFocusIfNeeded( this ); diff --git a/indra/newview/llsaveoutfitcombobtn.cpp b/indra/newview/llsaveoutfitcombobtn.cpp index 32295cd96f..b1cb6d08d0 100644 --- a/indra/newview/llsaveoutfitcombobtn.cpp +++ b/indra/newview/llsaveoutfitcombobtn.cpp @@ -56,7 +56,7 @@ LLSaveOutfitComboBtn::LLSaveOutfitComboBtn(LLPanel* parent, bool saveAsDefaultAc void LLSaveOutfitComboBtn::showSaveMenu() { S32 x, y; - LLUI::getMousePositionLocal(mParent, &x, &y); + LLUI::getInstance()->getMousePositionLocal(mParent, &x, &y); mSaveMenu->updateParent(LLMenuGL::sMenuContainer); LLMenuGL::showPopup(mParent, mSaveMenu, x, y); diff --git a/indra/newview/llsearchableui.cpp b/indra/newview/llsearchableui.cpp index de90896548..93143eb33f 100644 --- a/indra/newview/llsearchableui.cpp +++ b/indra/newview/llsearchableui.cpp @@ -125,17 +125,13 @@ void ll::statusbar::SearchableItem::setNotHighlighted( ) } } -bool ll::statusbar::SearchableItem::hightlightAndHide( LLWString const &aFilter ) +bool ll::statusbar::SearchableItem::hightlightAndHide(LLWString const &aFilter, bool hide) { - if( mMenu && !mMenu->getVisible() && !mWasHiddenBySearch ) + if ((mMenu && !mMenu->getVisible() && !mWasHiddenBySearch) || dynamic_cast<LLMenuItemTearOffGL*>(mMenu)) return false; setNotHighlighted( ); - bool bVisible(false); - for( tSearchableItemList::iterator itr = mChildren.begin(); itr != mChildren.end(); ++itr ) - bVisible |= (*itr)->hightlightAndHide( aFilter ); - if( aFilter.empty() ) { if( mCtrl ) @@ -143,17 +139,22 @@ bool ll::statusbar::SearchableItem::hightlightAndHide( LLWString const &aFilter return true; } + bool bHighlighted(!hide); if( mLabel.find( aFilter ) != LLWString::npos ) { if( mCtrl ) mCtrl->setHighlighted( true ); - return true; + bHighlighted = true; } - if( mCtrl && !bVisible ) + bool bVisible(false); + for (tSearchableItemList::iterator itr = mChildren.begin(); itr != mChildren.end(); ++itr) + bVisible |= (*itr)->hightlightAndHide(aFilter, !bHighlighted); + + if (mCtrl && !bVisible && !bHighlighted) { mWasHiddenBySearch = true; mMenu->setVisible(FALSE); } - return bVisible; + return bVisible || bHighlighted; } diff --git a/indra/newview/llsearchableui.h b/indra/newview/llsearchableui.h index 42b2866fb6..9741557e49 100644 --- a/indra/newview/llsearchableui.h +++ b/indra/newview/llsearchableui.h @@ -107,7 +107,7 @@ namespace ll SearchableItem(); void setNotHighlighted( ); - bool hightlightAndHide( LLWString const &aFilter ); + bool hightlightAndHide( LLWString const &aFilter, bool hide = true ); }; struct SearchData diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 74022cee01..90f8f84ea4 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -96,6 +96,7 @@ #include "llviewershadermgr.h" #include "llpanelface.h" #include "llglheaders.h" +#include "llinventoryobserver.h" LLViewerObject* getSelectedParentObject(LLViewerObject *object) ; // @@ -1656,6 +1657,7 @@ void LLSelectMgr::selectionSetImage(const LLUUID& imageid) // * Can just apply the texture and be done with it. objectp->setTEImage(te, LLViewerTextureManager::getFetchedTexture(mImageID, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); } + return true; } }; @@ -1855,6 +1857,7 @@ BOOL LLSelectMgr::selectionRevertTextures() else { object->setTEImage(te, LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); + } } } @@ -3861,6 +3864,14 @@ BOOL LLSelectMgr::selectGetAggregateTexturePermissions(LLAggregatePermissions& r return TRUE; } +BOOL LLSelectMgr::isSelfAvatarSelected() +{ + if (mAllowSelectAvatar) + { + return (getSelection()->getObjectCount() == 1) && (getSelection()->getFirstRootObject() == gAgentAvatarp); + } + return FALSE; +} //-------------------------------------------------------------------- // Duplicate objects @@ -3883,6 +3894,17 @@ void LLSelectMgr::selectDuplicate(const LLVector3& offset, BOOL select_copy) make_ui_sound("UISndInvalidOp"); return; } + if (!canDuplicate()) + { + LLSelectNode* node = getSelection()->getFirstRootNode(NULL, true); + if (node) + { + LLSD args; + args["OBJ_NAME"] = node->mName; + LLNotificationsUtil::add("NoCopyPermsNoObject", args); + return; + } + } LLDuplicateData data; data.offset = offset; @@ -6762,8 +6784,28 @@ void LLSelectMgr::pauseAssociatedAvatars() mSelectedObjects->mSelectType = getSelectTypeForObject(object); + bool is_attached = false; if (mSelectedObjects->mSelectType == SELECT_TYPE_ATTACHMENT && - isAgentAvatarValid() && object->getParent() != NULL) + isAgentAvatarValid()) + { + // Selection can be obsolete, confirm that this is an attachment + LLViewerObject* parent = (LLViewerObject*)object->getParent(); + while (parent != NULL) + { + if (parent->isAvatar()) + { + is_attached = true; + break; + } + else + { + parent = (LLViewerObject*)parent->getParent(); + } + } + } + + + if (is_attached) { if (object->isAnimatedObject()) { @@ -6781,14 +6823,12 @@ void LLSelectMgr::pauseAssociatedAvatars() mPauseRequests.push_back(gAgentAvatarp->requestPause()); } } - else + else if (object && object->isAnimatedObject() && object->getControlAvatar()) { - if (object && object->isAnimatedObject() && object->getControlAvatar()) - { - // Is a non-attached animated object. Pause the control avatar. - mPauseRequests.push_back(object->getControlAvatar()->requestPause()); - } + // Is a non-attached animated object. Pause the control avatar. + mPauseRequests.push_back(object->getControlAvatar()->requestPause()); } + } } diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index ce0fee8803..3e8bfdb00e 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -714,6 +714,8 @@ public: LLPermissions* findObjectPermissions(const LLViewerObject* object); + BOOL isSelfAvatarSelected(); + void selectDelete(); // Delete on simulator void selectForceDelete(); // just delete, no into trash void selectDuplicate(const LLVector3& offset, BOOL select_copy); // Duplicate on simulator diff --git a/indra/newview/llshareavatarhandler.cpp b/indra/newview/llshareavatarhandler.cpp index 6b4f1d3dc6..142e00c3f7 100644 --- a/indra/newview/llshareavatarhandler.cpp +++ b/indra/newview/llshareavatarhandler.cpp @@ -40,7 +40,7 @@ public: bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { - if (!LLUI::sSettingGroups["config"]->getBOOL("EnableAvatarShare")) + if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableAvatarShare")) { LLNotificationsUtil::add("NoAvatarShare", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); return true; diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 689734e36a..ea7e649792 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -564,6 +564,7 @@ void LLSidepanelInventory::updateVerbs() mWearBtn->setEnabled(FALSE); mPlayBtn->setVisible(FALSE); mPlayBtn->setEnabled(FALSE); + mPlayBtn->setToolTip(std::string("")); mTeleportBtn->setVisible(FALSE); mTeleportBtn->setEnabled(FALSE); mShopBtn->setVisible(TRUE); @@ -588,11 +589,23 @@ void LLSidepanelInventory::updateVerbs() mShopBtn->setVisible(FALSE); break; case LLInventoryType::IT_SOUND: + mPlayBtn->setVisible(TRUE); + mPlayBtn->setEnabled(TRUE); + mPlayBtn->setToolTip(LLTrans::getString("InventoryPlaySoundTooltip")); + mShopBtn->setVisible(FALSE); + break; case LLInventoryType::IT_GESTURE: + mPlayBtn->setVisible(TRUE); + mPlayBtn->setEnabled(TRUE); + mPlayBtn->setToolTip(LLTrans::getString("InventoryPlayGestureTooltip")); + mShopBtn->setVisible(FALSE); + break; case LLInventoryType::IT_ANIMATION: mPlayBtn->setVisible(TRUE); mPlayBtn->setEnabled(TRUE); - mShopBtn->setVisible(FALSE); + mPlayBtn->setEnabled(TRUE); + mPlayBtn->setToolTip(LLTrans::getString("InventoryPlayAnimationTooltip")); + mShopBtn->setVisible(FALSE); break; case LLInventoryType::IT_LANDMARK: mTeleportBtn->setVisible(TRUE); diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp index 0fa4c2b114..8e1f80abfc 100644 --- a/indra/newview/llskinningutil.cpp +++ b/indra/newview/llskinningutil.cpp @@ -83,10 +83,6 @@ void dump_avatar_and_skin_state(const std::string& reason, LLVOAvatar *avatar, c } } -void LLSkinningUtil::initClass() -{ -} - U32 LLSkinningUtil::getMaxJointCount() { U32 result = LL_MAX_JOINTS_PER_MESH_OBJECT; diff --git a/indra/newview/llskinningutil.h b/indra/newview/llskinningutil.h index ccc501adc0..2c77e030aa 100644 --- a/indra/newview/llskinningutil.h +++ b/indra/newview/llskinningutil.h @@ -34,7 +34,6 @@ class LLVolumeFace; namespace LLSkinningUtil { - void initClass(); U32 getMaxJointCount(); U32 getMeshJointCount(const LLMeshSkinInfo *skin); void scrubInvalidJoints(LLVOAvatar *avatar, LLMeshSkinInfo* skin); diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index 3ef89ba920..5e2442798b 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -119,7 +119,7 @@ void LLSky::restoreGL() void LLSky::resetVertexBuffers() { - if (gSky.mVOSkyp.notNull()) + if (gSky.mVOSkyp.notNull() && gSky.mVOGroundp.notNull()) { gPipeline.resetVertexBuffers(gSky.mVOSkyp->mDrawable); gPipeline.resetVertexBuffers(gSky.mVOGroundp->mDrawable); diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index 5a40af14a3..f5fea9dece 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -34,7 +34,6 @@ #include "lleconomy.h" #include "llfloaterperms.h" #include "llfloaterreg.h" -#include "llfloaterfacebook.h" #include "llfloaterflickr.h" #include "llfloatertwitter.h" #include "llimagefilter.h" @@ -572,7 +571,7 @@ void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update) if (mThumbnailSubsampled) { - // The thumbnail is be a subsampled version of the preview (used in SL Share previews, i.e. Flickr, Twitter, Facebook) + // The thumbnail is be a subsampled version of the preview (used in SL Share previews, i.e. Flickr, Twitter) raw->resize( mPreviewImage->getWidth(), mPreviewImage->getHeight(), mPreviewImage->getComponents()); @@ -638,7 +637,7 @@ LLViewerTexture* LLSnapshotLivePreview::getBigThumbnailImage() if (raw) { - // The big thumbnail is a new filtered version of the preview (used in SL Share previews, i.e. Flickr, Twitter, Facebook) + // The big thumbnail is a new filtered version of the preview (used in SL Share previews, i.e. Flickr, Twitter) mBigThumbnailWidth = mPreviewImage->getWidth(); mBigThumbnailHeight = mPreviewImage->getHeight(); raw->resize( mBigThumbnailWidth, diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 0d99b35aee..c8c39ae00f 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -113,7 +113,7 @@ #include "llgroupmgr.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" -#include "llimagebmp.h" +#include "llimage.h" #include "llinventorybridge.h" #include "llinventorymodel.h" #include "llinventorymodelbackgroundfetch.h" @@ -162,6 +162,7 @@ #include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "llviewerstats.h" +#include "llviewerstatsrecorder.h" #include "llviewerthrottle.h" #include "llviewerwindow.h" #include "llvoavatar.h" @@ -209,8 +210,8 @@ bool gAgentMovementCompleted = false; S32 gMaxAgentGroups; -std::string SCREEN_HOME_FILENAME = "screen_home.bmp"; -std::string SCREEN_LAST_FILENAME = "screen_last.bmp"; +const std::string SCREEN_HOME_FILENAME = "screen_home%s.png"; +const std::string SCREEN_LAST_FILENAME = "screen_last%s.png"; LLPointer<LLViewerTexture> gStartTexture; @@ -348,6 +349,14 @@ bool idle_startup() // to work. gIdleCallbacks.callFunctions(); gViewerWindow->updateUI(); + + // There is a crash on updateClass, this is an attempt to get more information + if (LLMortician::graveyardCount()) + { + std::stringstream log_stream; + LLMortician::logClass(log_stream); + LL_INFOS() << log_stream.str() << LL_ENDL; + } LLMortician::updateClass(); const std::string delims (" "); @@ -893,8 +902,13 @@ bool idle_startup() LLFile::mkdir(gDirUtilp->getLindenUserDir()); // As soon as directories are ready initialize notification storages - LLPersistentNotificationStorage::getInstance()->initialize(); - LLDoNotDisturbNotificationStorage::getInstance()->initialize(); + if (!LLPersistentNotificationStorage::instanceExists()) + { + // check existance since this part of code can be reached + // twice due to login failures + LLPersistentNotificationStorage::initParamSingleton(); + LLDoNotDisturbNotificationStorage::initParamSingleton(); + } // Set PerAccountSettingsFile to the default value. gSavedSettings.setString("PerAccountSettingsFile", @@ -1220,14 +1234,13 @@ bool idle_startup() // // Initialize classes w/graphics stuff. // + LLViewerStatsRecorder::instance(); // Since textures work in threads gTextureList.doPrefetchImages(); display_startup(); LLSurface::initClasses(); display_startup(); - - LLFace::initClass(); display_startup(); LLDrawable::initClass(); @@ -1289,9 +1302,13 @@ bool idle_startup() LLStartUp::initExperiences(); display_startup(); + + // If logging should be enebled, turns it on and loads history from disk + // Note: does not happen on init of singleton because preferences can use + // this instance without logging in + LLConversationLog::getInstance()->initLoggingState(); + LLStartUp::setStartupState( STATE_MULTIMEDIA_INIT ); - - LLConversationLog::getInstance(); return FALSE; } @@ -2567,6 +2584,34 @@ bool callback_choose_gender(const LLSD& notification, const LLSD& response) return false; } +std::string get_screen_filename(const std::string& pattern) +{ + if (LLGridManager::getInstance()->isInProductionGrid()) + { + return llformat(pattern.c_str(), ""); + } + else + { + const std::string& grid_id_str = LLGridManager::getInstance()->getGridId(); + const std::string& grid_id_lower = utf8str_tolower(grid_id_str); + std::string grid = "." + grid_id_lower; + return llformat(pattern.c_str(), grid.c_str()); + } +} + +//static +std::string LLStartUp::getScreenLastFilename() +{ + return get_screen_filename(SCREEN_LAST_FILENAME); +} + +//static +std::string LLStartUp::getScreenHomeFilename() +{ + return get_screen_filename(SCREEN_HOME_FILENAME); +} + +//static void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, const std::string& gender_name ) { @@ -2660,19 +2705,32 @@ void init_start_screen(S32 location_id) LL_DEBUGS("AppInit") << "Loading startup bitmap..." << LL_ENDL; + U8 image_codec = IMG_CODEC_PNG; std::string temp_str = gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter(); if ((S32)START_LOCATION_ID_LAST == location_id) { - temp_str += SCREEN_LAST_FILENAME; + temp_str += LLStartUp::getScreenLastFilename(); } else { - temp_str += SCREEN_HOME_FILENAME; + std::string path = temp_str + LLStartUp::getScreenHomeFilename(); + + if (!gDirUtilp->fileExists(path) && LLGridManager::getInstance()->isInProductionGrid()) + { + // Fallback to old file, can be removed later + // Home image only sets when user changes home, so it will take time for users to switch to pngs + temp_str += "screen_home.bmp"; + image_codec = IMG_CODEC_BMP; + } + else + { + temp_str = path; + } } - LLPointer<LLImageBMP> start_image_bmp = new LLImageBMP; - + LLPointer<LLImageFormatted> start_image_frmted = LLImageFormatted::createFromType(image_codec); + // Turn off start screen to get around the occasional readback // driver bug if(!gSavedSettings.getBOOL("UseStartScreen")) @@ -2680,18 +2738,18 @@ void init_start_screen(S32 location_id) LL_INFOS("AppInit") << "Bitmap load disabled" << LL_ENDL; return; } - else if(!start_image_bmp->load(temp_str) ) + else if(!start_image_frmted->load(temp_str) ) { LL_WARNS("AppInit") << "Bitmap load failed" << LL_ENDL; gStartTexture = NULL; } else { - gStartImageWidth = start_image_bmp->getWidth(); - gStartImageHeight = start_image_bmp->getHeight(); + gStartImageWidth = start_image_frmted->getWidth(); + gStartImageHeight = start_image_frmted->getHeight(); LLPointer<LLImageRaw> raw = new LLImageRaw; - if (!start_image_bmp->decode(raw, 0.0f)) + if (!start_image_frmted->decode(raw, 0.0f)) { LL_WARNS("AppInit") << "Bitmap decode failed" << LL_ENDL; gStartTexture = NULL; @@ -2806,9 +2864,6 @@ void LLStartUp::multimediaInit() std::string msg = LLTrans::getString("LoginInitializingMultimedia"); set_startup_status(0.42f, msg.c_str(), gAgent.mMOTD.c_str()); display_startup(); - - // LLViewerMedia::initClass(); - LLViewerParcelMedia::initClass(); } void LLStartUp::fontInit() @@ -2836,9 +2891,10 @@ void LLStartUp::initNameCache() // Start cache in not-running state until we figure out if we have // capabilities for display name lookup - LLAvatarNameCache::initClass(false,gSavedSettings.getBOOL("UsePeopleAPI")); - LLAvatarNameCache::setUseDisplayNames(gSavedSettings.getBOOL("UseDisplayNames")); - LLAvatarNameCache::setUseUsernames(gSavedSettings.getBOOL("NameTagShowUsernames")); + LLAvatarNameCache* cache_inst = LLAvatarNameCache::getInstance(); + cache_inst->setUsePeopleAPI(gSavedSettings.getBOOL("UsePeopleAPI")); + cache_inst->setUseDisplayNames(gSavedSettings.getBOOL("UseDisplayNames")); + cache_inst->setUseUsernames(gSavedSettings.getBOOL("NameTagShowUsernames")); } @@ -2853,8 +2909,6 @@ void LLStartUp::initExperiences() void LLStartUp::cleanupNameCache() { - SUBSYSTEM_CLEANUP(LLAvatarNameCache); - delete gCacheName; gCacheName = NULL; } @@ -3543,7 +3597,7 @@ bool process_login_success_response() if(!openid_url.empty()) { std::string openid_token = response["openid_token"]; - LLViewerMedia::openIDSetup(openid_url, openid_token); + LLViewerMedia::getInstance()->openIDSetup(openid_url, openid_token); } gMaxAgentGroups = DEFAULT_MAX_AGENT_GROUPS; diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h index d434e86f82..db37207022 100644 --- a/indra/newview/llstartup.h +++ b/indra/newview/llstartup.h @@ -41,10 +41,6 @@ bool idle_startup(); void release_start_screen(); bool login_alert_done(const LLSD& notification, const LLSD& response); -// constants, variables, & enumerations -extern std::string SCREEN_HOME_FILENAME; -extern std::string SCREEN_LAST_FILENAME; - // start location constants enum EStartLocation { @@ -95,6 +91,8 @@ public: static void setStartupState( EStartupState state ); static EStartupState getStartupState() { return gStartupState; }; static std::string getStartupStateString() { return startupStateToString(gStartupState); }; + static std::string getScreenLastFilename(); // screenshot taken on exit + static std::string getScreenHomeFilename(); // screenshot taken on setting Home static void multimediaInit(); // Initialize LLViewerMedia multimedia engine. diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index f3c270a97b..9eda33d3d2 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -183,7 +183,7 @@ BOOL LLStatusBar::postBuild() mMediaToggle->setClickedCallback( &LLStatusBar::onClickMediaToggle, this ); mMediaToggle->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterNearbyMedia, this)); - LLHints::registerHintTarget("linden_balance", getChild<LLView>("balance_bg")->getHandle()); + LLHints::getInstance()->registerHintTarget("linden_balance", getChild<LLView>("balance_bg")->getHandle()); gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2)); @@ -310,16 +310,18 @@ void LLStatusBar::refresh() // update the master volume button state bool mute_audio = LLAppViewer::instance()->getMasterSystemAudioMute(); mBtnVolume->setToggleState(mute_audio); - + + LLViewerMedia* media_inst = LLViewerMedia::getInstance(); + // Disable media toggle if there's no media, parcel media, and no parcel audio // (or if media is disabled) bool button_enabled = (gSavedSettings.getBOOL("AudioStreamingMusic")||gSavedSettings.getBOOL("AudioStreamingMedia")) && - (LLViewerMedia::hasInWorldMedia() || LLViewerMedia::hasParcelMedia() || LLViewerMedia::hasParcelAudio()); + (media_inst->hasInWorldMedia() || media_inst->hasParcelMedia() || media_inst->hasParcelAudio()); mMediaToggle->setEnabled(button_enabled); // Note the "sense" of the toggle is opposite whether media is playing or not - bool any_media_playing = (LLViewerMedia::isAnyMediaPlaying() || - LLViewerMedia::isParcelMediaPlaying() || - LLViewerMedia::isParcelAudioPlaying()); + bool any_media_playing = (media_inst->isAnyMediaPlaying() || + media_inst->isParcelMediaPlaying() || + media_inst->isParcelAudioPlaying()); mMediaToggle->setValue(!any_media_playing); } @@ -501,8 +503,8 @@ void LLStatusBar::onMouseEnterPresets() mPanelPresetsPulldown->setShape(pulldown_rect); // show the master presets pull-down - LLUI::clearPopups(); - LLUI::addPopup(mPanelPresetsPulldown); + LLUI::getInstance()->clearPopups(); + LLUI::getInstance()->addPopup(mPanelPresetsPulldown); mPanelNearByMedia->setVisible(FALSE); mPanelVolumePulldown->setVisible(FALSE); mPanelPresetsPulldown->setVisible(TRUE); @@ -525,8 +527,8 @@ void LLStatusBar::onMouseEnterVolume() // show the master volume pull-down - LLUI::clearPopups(); - LLUI::addPopup(mPanelVolumePulldown); + LLUI::getInstance()->clearPopups(); + LLUI::getInstance()->addPopup(mPanelVolumePulldown); mPanelPresetsPulldown->setVisible(FALSE); mPanelNearByMedia->setVisible(FALSE); mPanelVolumePulldown->setVisible(TRUE); @@ -548,8 +550,8 @@ void LLStatusBar::onMouseEnterNearbyMedia() // show the master volume pull-down mPanelNearByMedia->setShape(nearby_media_rect); - LLUI::clearPopups(); - LLUI::addPopup(mPanelNearByMedia); + LLUI::getInstance()->clearPopups(); + LLUI::getInstance()->addPopup(mPanelNearByMedia); mPanelPresetsPulldown->setVisible(FALSE); mPanelVolumePulldown->setVisible(FALSE); @@ -578,7 +580,7 @@ void LLStatusBar::onClickMediaToggle(void* data) LLStatusBar *status_bar = (LLStatusBar*)data; // "Selected" means it was showing the "play" icon (so media was playing), and now it shows "pause", so turn off media bool pause = status_bar->mMediaToggle->getValue(); - LLViewerMedia::setAllMediaPaused(pause); + LLViewerMedia::getInstance()->setAllMediaPaused(pause); } BOOL can_afford_transaction(S32 cost) diff --git a/indra/newview/llsurfacepatch.cpp b/indra/newview/llsurfacepatch.cpp index d28a7cc048..5e056944e9 100644 --- a/indra/newview/llsurfacepatch.cpp +++ b/indra/newview/llsurfacepatch.cpp @@ -99,7 +99,7 @@ void LLSurfacePatch::dirty() } else { - LL_WARNS() << "No viewer object for this surface patch!" << LL_ENDL; + LL_WARNS("Terrain") << "No viewer object for this surface patch!" << LL_ENDL; } mDirtyZStats = TRUE; @@ -203,7 +203,7 @@ LLVector2 LLSurfacePatch::getTexCoords(const U32 x, const U32 y) const void LLSurfacePatch::eval(const U32 x, const U32 y, const U32 stride, LLVector3 *vertex, LLVector3 *normal, LLVector2 *tex0, LLVector2 *tex1) { - if (!mSurfacep || !mSurfacep->getRegion() || !mSurfacep->getGridsPerEdge()) + if (!mSurfacep || !mSurfacep->getRegion() || !mSurfacep->getGridsPerEdge() || !mVObjp) { return; // failsafe } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 1396a8546d..e2bb904eff 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -32,6 +32,7 @@ #include "llrender.h" #include "llagent.h" #include "llviewertexturelist.h" +#include "llselectmgr.h" #include "llcheckboxctrl.h" #include "llcombobox.h" #include "llbutton.h" @@ -70,6 +71,8 @@ #include "lllocalbitmaps.h" #include "llerror.h" +#include "llavatarappearancedefines.h" + static const F32 CONTEXT_CONE_IN_ALPHA = 0.0f; static const F32 CONTEXT_CONE_OUT_ALPHA = 1.f; static const F32 CONTEXT_FADE_TIME = 0.08f; @@ -118,7 +121,8 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( mOnFloaterCommitCallback(NULL), mOnFloaterCloseCallback(NULL), mSetImageAssetIDCallback(NULL), - mOnUpdateImageStatsCallback(NULL) + mOnUpdateImageStatsCallback(NULL), + mBakeTextureEnabled(FALSE) { buildFromFile("floater_texture_ctrl.xml"); mCanApplyImmediately = can_apply_immediately; @@ -136,26 +140,47 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id, bool set_selecti mNoCopyTextureSelected = FALSE; mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? mImageAssetID = image_id; - LLUUID item_id = findItemID(mImageAssetID, FALSE); - if (item_id.isNull()) + + if (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID)) { - mInventoryPanel->getRootFolder()->clearSelection(); + if ( mBakeTextureEnabled && mModeSelector->getSelectedIndex() != 2) + { + mModeSelector->setSelectedIndex(2, 0); + onModeSelect(0,this); + } } else { - LLInventoryItem* itemp = gInventory.getItem(image_id); - if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) + if (mModeSelector->getSelectedIndex() == 2) { - // no copy texture - getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE); - mNoCopyTextureSelected = TRUE; + mModeSelector->setSelectedIndex(0, 0); + onModeSelect(0,this); + } + + LLUUID item_id = findItemID(mImageAssetID, FALSE); + if (item_id.isNull()) + { + mInventoryPanel->getRootFolder()->clearSelection(); + } + else + { + LLInventoryItem* itemp = gInventory.getItem(image_id); + if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) + { + // no copy texture + getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE); + mNoCopyTextureSelected = TRUE; + } } - } - if (set_selection) - { - mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO); + if (set_selection) + { + mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO); + } } + + + } } @@ -341,6 +366,10 @@ BOOL LLFloaterTexturePicker::postBuild() mInventoryPanel = getChild<LLInventoryPanel>("inventory panel"); + mModeSelector = getChild<LLRadioGroup>("mode_selection"); + mModeSelector->setCommitCallback(onModeSelect, this); + mModeSelector->setSelectedIndex(0, 0); + if(mInventoryPanel) { U32 filter_types = 0x0; @@ -366,23 +395,22 @@ BOOL LLFloaterTexturePicker::postBuild() // don't put keyboard focus on selected item, because the selection callback // will assume that this was user input - if(!mImageAssetID.isNull()) + + + + if (!mImageAssetID.isNull()) { mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO); } } - mModeSelector = getChild<LLRadioGroup>("mode_selection"); - mModeSelector->setCommitCallback(onModeSelect, this); - mModeSelector->setSelectedIndex(0, 0); - childSetAction("l_add_btn", LLFloaterTexturePicker::onBtnAdd, this); childSetAction("l_rem_btn", LLFloaterTexturePicker::onBtnRemove, this); childSetAction("l_upl_btn", LLFloaterTexturePicker::onBtnUpload, this); mLocalScrollCtrl = getChild<LLScrollListCtrl>("l_name_list"); mLocalScrollCtrl->setCommitCallback(onLocalScrollCommit, this); - LLLocalBitmapMgr::feedScrollList(mLocalScrollCtrl); + LLLocalBitmapMgr::getInstance()->feedScrollList(mLocalScrollCtrl); mNoCopyTextureSelected = FALSE; @@ -404,6 +432,10 @@ BOOL LLFloaterTexturePicker::postBuild() LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterTexturePicker::onTextureSelect, this, _1)); + getChild<LLComboBox>("l_bake_use_texture_combo_box")->setCommitCallback(onBakeTextureSelect, this); + getChild<LLCheckBoxCtrl>("hide_base_mesh_region")->setCommitCallback(onHideBaseMeshRegionCheck, this); + + setBakeTextureEnabled(FALSE); return TRUE; } @@ -478,7 +510,24 @@ void LLFloaterTexturePicker::draw() mTexturep = NULL; if(mImageAssetID.notNull()) { - mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID); + LLPointer<LLViewerFetchedTexture> texture = NULL; + + if (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID)) + { + LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); + if (obj) + { + LLViewerTexture* viewerTexture = obj->getBakedTextureForMagicId(mImageAssetID); + texture = viewerTexture ? dynamic_cast<LLViewerFetchedTexture*>(viewerTexture) : NULL; + } + } + + if (texture.isNull()) + { + texture = LLViewerTextureManager::getFetchedTexture(mImageAssetID); + } + + mTexturep = texture; mTexturep->setBoostLevel(LLGLTexture::BOOST_PREVIEW); } @@ -694,9 +743,10 @@ void LLFloaterTexturePicker::onBtnSelect(void* userdata) if (self->mLocalScrollCtrl->getVisible() && !self->mLocalScrollCtrl->getAllSelected().empty()) { LLUUID temp_id = self->mLocalScrollCtrl->getFirstSelected()->getColumn(LOCAL_TRACKING_ID_COLUMN)->getValue().asUUID(); - local_id = LLLocalBitmapMgr::getWorldID(temp_id); + local_id = LLLocalBitmapMgr::getInstance()->getWorldID(temp_id); } } + if (self->mOnFloaterCommitCallback) { self->mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_SELECT, local_id); @@ -760,31 +810,90 @@ void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem void LLFloaterTexturePicker::onModeSelect(LLUICtrl* ctrl, void *userdata) { LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - bool mode = (self->mModeSelector->getSelectedIndex() == 0); + int mode = self->mModeSelector->getSelectedIndex(); - self->getChild<LLButton>("Default")->setVisible(mode); - self->getChild<LLButton>("Blank")->setVisible(mode); - self->getChild<LLButton>("None")->setVisible(mode); - self->getChild<LLButton>("Pipette")->setVisible(mode); - self->getChild<LLFilterEditor>("inventory search editor")->setVisible(mode); - self->getChild<LLInventoryPanel>("inventory panel")->setVisible(mode); + self->getChild<LLButton>("Default")->setVisible(mode == 0); + self->getChild<LLButton>("Blank")->setVisible(mode == 0); + self->getChild<LLButton>("None")->setVisible(mode == 0); + self->getChild<LLButton>("Pipette")->setVisible(mode == 0); + self->getChild<LLFilterEditor>("inventory search editor")->setVisible(mode == 0); + self->getChild<LLInventoryPanel>("inventory panel")->setVisible(mode == 0); /*self->getChild<LLCheckBox>("show_folders_check")->setVisible(mode); no idea under which conditions the above is even shown, needs testing. */ - self->getChild<LLButton>("l_add_btn")->setVisible(!mode); - self->getChild<LLButton>("l_rem_btn")->setVisible(!mode); - self->getChild<LLButton>("l_upl_btn")->setVisible(!mode); - self->getChild<LLScrollListCtrl>("l_name_list")->setVisible(!mode); + self->getChild<LLButton>("l_add_btn")->setVisible(mode == 1); + self->getChild<LLButton>("l_rem_btn")->setVisible(mode == 1); + self->getChild<LLButton>("l_upl_btn")->setVisible(mode == 1); + self->getChild<LLScrollListCtrl>("l_name_list")->setVisible(mode == 1); + + self->getChild<LLComboBox>("l_bake_use_texture_combo_box")->setVisible(mode == 2); + self->getChild<LLCheckBoxCtrl>("hide_base_mesh_region")->setVisible(false);// mode == 2); + + if (mode == 2) + { + self->stopUsingPipette(); + + S8 val = -1; + + LLUUID imageID = self->mImageAssetID; + if (imageID == IMG_USE_BAKED_HEAD) + { + val = 0; + } + else if (imageID == IMG_USE_BAKED_UPPER) + { + val = 1; + } + else if (imageID == IMG_USE_BAKED_LOWER) + { + val = 2; + } + else if (imageID == IMG_USE_BAKED_EYES) + { + val = 3; + } + else if (imageID == IMG_USE_BAKED_SKIRT) + { + val = 4; + } + else if (imageID == IMG_USE_BAKED_HAIR) + { + val = 5; + } + else if (imageID == IMG_USE_BAKED_LEFTARM) + { + val = 6; + } + else if (imageID == IMG_USE_BAKED_LEFTLEG) + { + val = 7; + } + else if (imageID == IMG_USE_BAKED_AUX1) + { + val = 8; + } + else if (imageID == IMG_USE_BAKED_AUX2) + { + val = 9; + } + else if (imageID == IMG_USE_BAKED_AUX3) + { + val = 10; + } + + + self->getChild<LLComboBox>("l_bake_use_texture_combo_box")->setSelectedByValue(val, TRUE); + } } // static void LLFloaterTexturePicker::onBtnAdd(void* userdata) { - if (LLLocalBitmapMgr::addUnit() == true) + if (LLLocalBitmapMgr::getInstance()->addUnit() == true) { LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - LLLocalBitmapMgr::feedScrollList(self->mLocalScrollCtrl); + LLLocalBitmapMgr::getInstance()->feedScrollList(self->mLocalScrollCtrl); } } @@ -803,13 +912,13 @@ void LLFloaterTexturePicker::onBtnRemove(void* userdata) if (list_item) { LLUUID tracking_id = list_item->getColumn(LOCAL_TRACKING_ID_COLUMN)->getValue().asUUID(); - LLLocalBitmapMgr::delUnit(tracking_id); + LLLocalBitmapMgr::getInstance()->delUnit(tracking_id); } } self->getChild<LLButton>("l_rem_btn")->setEnabled(false); self->getChild<LLButton>("l_upl_btn")->setEnabled(false); - LLLocalBitmapMgr::feedScrollList(self->mLocalScrollCtrl); + LLLocalBitmapMgr::getInstance()->feedScrollList(self->mLocalScrollCtrl); } } @@ -829,7 +938,7 @@ void LLFloaterTexturePicker::onBtnUpload(void* userdata) in the future, it might be a good idea to check the vector size and if more than one units is selected - opt for multi-image upload. */ LLUUID tracking_id = (LLUUID)self->mLocalScrollCtrl->getSelectedItemLabel(LOCAL_TRACKING_ID_COLUMN); - std::string filename = LLLocalBitmapMgr::getFilename(tracking_id); + std::string filename = LLLocalBitmapMgr::getInstance()->getFilename(tracking_id); if (!filename.empty()) { @@ -852,7 +961,7 @@ void LLFloaterTexturePicker::onLocalScrollCommit(LLUICtrl* ctrl, void* userdata) if (has_selection) { LLUUID tracking_id = (LLUUID)self->mLocalScrollCtrl->getSelectedItemLabel(LOCAL_TRACKING_ID_COLUMN); - LLUUID inworld_id = LLLocalBitmapMgr::getWorldID(tracking_id); + LLUUID inworld_id = LLLocalBitmapMgr::getInstance()->getWorldID(tracking_id); if (self->mSetImageAssetIDCallback) { self->mSetImageAssetIDCallback(inworld_id); @@ -896,6 +1005,86 @@ void LLFloaterTexturePicker::onApplyImmediateCheck(LLUICtrl* ctrl, void *user_da picker->commitIfImmediateSet(); } +//static +void LLFloaterTexturePicker::onBakeTextureSelect(LLUICtrl* ctrl, void *user_data) +{ + LLFloaterTexturePicker* self = (LLFloaterTexturePicker*)user_data; + LLComboBox* combo_box = (LLComboBox*)ctrl; + + S8 type = combo_box->getValue().asInteger(); + + LLUUID imageID = self->mDefaultImageAssetID; + if (type == 0) + { + imageID = IMG_USE_BAKED_HEAD; + } + else if (type == 1) + { + imageID = IMG_USE_BAKED_UPPER; + } + else if (type == 2) + { + imageID = IMG_USE_BAKED_LOWER; + } + else if (type == 3) + { + imageID = IMG_USE_BAKED_EYES; + } + else if (type == 4) + { + imageID = IMG_USE_BAKED_SKIRT; + } + else if (type == 5) + { + imageID = IMG_USE_BAKED_HAIR; + } + else if (type == 6) + { + imageID = IMG_USE_BAKED_LEFTARM; + } + else if (type == 7) + { + imageID = IMG_USE_BAKED_LEFTLEG; + } + else if (type == 8) + { + imageID = IMG_USE_BAKED_AUX1; + } + else if (type == 9) + { + imageID = IMG_USE_BAKED_AUX2; + } + else if (type == 10) + { + imageID = IMG_USE_BAKED_AUX3; + } + + self->setImageID(imageID); + self->mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? + + if (!self->mPreviewSettingChanged) + { + self->mCanPreview = gSavedSettings.getBOOL("TextureLivePreview"); + } + else + { + self->mPreviewSettingChanged = false; + } + + if (self->mCanPreview) + { + // only commit intentional selections, not implicit ones + self->commitIfImmediateSet(); + } +} + +//static +void LLFloaterTexturePicker::onHideBaseMeshRegionCheck(LLUICtrl* ctrl, void *user_data) +{ + //LLFloaterTexturePicker* picker = (LLFloaterTexturePicker*)user_data; + //LLCheckBoxCtrl* check_box = (LLCheckBoxCtrl*)ctrl; +} + void LLFloaterTexturePicker::updateFilterPermMask() { //mInventoryPanel->setFilterPermMask( getFilterPermMask() ); Commented out due to no-copy texture loss. @@ -951,6 +1140,28 @@ void LLFloaterTexturePicker::setLocalTextureEnabled(BOOL enabled) mModeSelector->setIndexEnabled(1,enabled); } +void LLFloaterTexturePicker::setBakeTextureEnabled(BOOL enabled) +{ + BOOL changed = (enabled != mBakeTextureEnabled); + + mBakeTextureEnabled = enabled; + mModeSelector->setIndexEnabled(2, enabled); + + if (!mBakeTextureEnabled && (mModeSelector->getSelectedIndex() == 2)) + { + mModeSelector->setSelectedIndex(0, 0); + } + + if (changed && mBakeTextureEnabled && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID)) + { + if (mModeSelector->getSelectedIndex() != 2) + { + mModeSelector->setSelectedIndex(2, 0); + } + } + onModeSelect(0, this); +} + void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te ) { LLUUID inventory_item_id = findItemID(te.getID(), TRUE); @@ -1000,7 +1211,8 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p) mImageAssetID(p.image_id), mDefaultImageAssetID(p.default_image_id), mDefaultImageName(p.default_image_name), - mFallbackImage(p.fallback_image) + mFallbackImage(p.fallback_image), + mBakeTextureEnabled(FALSE) { // Default of defaults is white image for diff tex @@ -1191,6 +1403,10 @@ void LLTextureCtrl::showPicker(BOOL take_focus) { texture_floaterp->setSetImageAssetIDCallback(boost::bind(&LLTextureCtrl::setImageAssetID, this, _1)); } + if (texture_floaterp) + { + texture_floaterp->setBakeTextureEnabled(mBakeTextureEnabled); + } LLFloater* root_floater = gFloaterView->getParentFloater(this); if (root_floater) @@ -1366,6 +1582,16 @@ void LLTextureCtrl::setImageAssetID( const LLUUID& asset_id ) } } +void LLTextureCtrl::setBakeTextureEnabled(BOOL enabled) +{ + mBakeTextureEnabled = enabled; + LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get(); + if (floaterp) + { + floaterp->setBakeTextureEnabled(enabled); + } +} + BOOL LLTextureCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, @@ -1420,7 +1646,23 @@ void LLTextureCtrl::draw() } else if (!mImageAssetID.isNull()) { - LLPointer<LLViewerFetchedTexture> texture = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, MIPMAP_YES,LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + LLPointer<LLViewerFetchedTexture> texture = NULL; + + if (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID)) + { + LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); + if (obj) + { + LLViewerTexture* viewerTexture = obj->getBakedTextureForMagicId(mImageAssetID); + texture = viewerTexture ? dynamic_cast<LLViewerFetchedTexture*>(viewerTexture) : NULL; + } + + } + + if (texture.isNull()) + { + texture = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, MIPMAP_YES, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + } texture->setBoostLevel(LLGLTexture::BOOST_PREVIEW); texture->forceToSaveRawImage(0) ; diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index 6bcf9c3a75..b2a34a37c4 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -201,6 +201,8 @@ public: LLViewerFetchedTexture* getTexture() { return mTexturep; } + void setBakeTextureEnabled(BOOL enabled); + private: BOOL allowDrop(LLInventoryItem* item); BOOL doDrop(LLInventoryItem* item); @@ -237,6 +239,7 @@ private: BOOL mShowLoadingPlaceholder; std::string mLoadingPlaceholderString; S32 mLabelWidth; + BOOL mBakeTextureEnabled; }; ////////////////////////////////////////////////////////////////////////////////////////// @@ -326,7 +329,11 @@ public: static void onBtnUpload(void* userdata); static void onLocalScrollCommit(LLUICtrl* ctrl, void* userdata); + static void onBakeTextureSelect(LLUICtrl* ctrl, void *userdata); + static void onHideBaseMeshRegionCheck(LLUICtrl* ctrl, void *userdata); + void setLocalTextureEnabled(BOOL enabled); + void setBakeTextureEnabled(BOOL enabled); protected: LLPointer<LLViewerTexture> mTexturep; @@ -368,11 +375,14 @@ private: bool mCanPreview; bool mPreviewSettingChanged; + texture_selected_callback mTextureSelectedCallback; floater_close_callback mOnFloaterCloseCallback; floater_commit_callback mOnFloaterCommitCallback; set_image_asset_id_callback mSetImageAssetIDCallback; set_on_update_image_stats_callback mOnUpdateImageStatsCallback; + + BOOL mBakeTextureEnabled; }; #endif // LL_LLTEXTURECTRL_H diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index c9133338fb..fe058024f6 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -66,6 +66,7 @@ bool LLTextureFetchDebugger::sDebuggerEnabled = false ; LLTrace::CountStatHandle<F64> LLTextureFetch::sCacheHit("texture_cache_hit"); LLTrace::CountStatHandle<F64> LLTextureFetch::sCacheAttempt("texture_cache_attempt"); +LLTrace::EventStatHandle<LLUnit<F32, LLUnits::Percent> > LLTextureFetch::sCacheHitRate("texture_cache_hits"); LLTrace::SampleStatHandle<F32Seconds> LLTextureFetch::sCacheReadLatency("texture_cache_read_latency"); LLTrace::SampleStatHandle<F32Seconds> LLTextureFetch::sTexDecodeLatency("texture_decode_latency"); @@ -1311,6 +1312,7 @@ bool LLTextureFetchWorker::doWork(S32 param) LL_DEBUGS(LOG_TXT) << mID << ": Cached. Bytes: " << mFormattedImage->getDataSize() << " Size: " << llformat("%dx%d",mFormattedImage->getWidth(),mFormattedImage->getHeight()) << " Desired Discard: " << mDesiredDiscard << " Desired Size: " << mDesiredSize << LL_ENDL; + record(LLTextureFetch::sCacheHitRate, LLUnits::Ratio::fromValue(1)); } else { @@ -1326,7 +1328,7 @@ bool LLTextureFetchWorker::doWork(S32 param) LL_DEBUGS(LOG_TXT) << mID << ": Not in Cache" << LL_ENDL; setState(LOAD_FROM_NETWORK); } - + record(LLTextureFetch::sCacheHitRate, LLUnits::Ratio::fromValue(0)); // fall through } } @@ -2407,7 +2409,11 @@ S32 LLTextureFetchWorker::callbackHttpGet(LLCore::HttpResponse * response, mLoaded = TRUE; setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); - LLViewerStatsRecorder::instance().log(0.2f); + if (LLViewerStatsRecorder::instanceExists()) + { + // Do not create this instance inside thread + LLViewerStatsRecorder::instance().log(0.2f); + } return data_size ; } diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index a01c01847e..cdf8868597 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -312,6 +312,7 @@ public: static LLTrace::SampleStatHandle<F32Seconds> sCacheReadLatency; static LLTrace::SampleStatHandle<F32Seconds> sTexDecodeLatency; static LLTrace::SampleStatHandle<F32Seconds> sTexFetchLatency; + static LLTrace::EventStatHandle<LLUnit<F32, LLUnits::Percent> > sCacheHitRate; private: LLMutex mQueueMutex; //to protect mRequestMap and mCommands only diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index b9b05966bc..870e0d94f0 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -430,7 +430,7 @@ void LLToast::setVisible(BOOL show) void LLToast::updateHoveredState() { S32 x, y; - LLUI::getMousePositionScreen(&x, &y); + LLUI::getInstance()->getMousePositionScreen(&x, &y); LLRect panel_rc = mWrapperPanel->calcScreenRect(); LLRect button_rc; diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index 495c9c1f44..941cb410fc 100644 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -45,6 +45,7 @@ #include "llrootview.h" #include "lltransientfloatermgr.h" #include "llviewercontrol.h" // for gSavedSettings +#include "llweb.h" #include <boost/algorithm/string.hpp> @@ -52,7 +53,6 @@ const S32 MAX_ALLOWED_MSG_WIDTH = 400; const F32 DEFAULT_BUTTON_DELAY = 0.5f; /*static*/ LLControlGroup* LLToastAlertPanel::sSettings = NULL; -/*static*/ LLToastAlertPanel::URLLoader* LLToastAlertPanel::sURLLoader; //----------------------------------------------------------------------------- // Private methods @@ -555,9 +555,16 @@ void LLToastAlertPanel::onButtonPressed( const LLSD& data, S32 button ) response[button_data->mButton->getName()] = true; // If we declared a URL and chose the URL option, go to the url - if (!button_data->mURL.empty() && sURLLoader != NULL) + if (!button_data->mURL.empty()) { - sURLLoader->load(button_data->mURL, button_data->mURLExternal); + if (button_data->mURLExternal) + { + LLWeb::loadURLExternal(button_data->mURL); + } + else + { + LLWeb::loadURL(button_data->mURL); + } } mNotification->respond(response); // new notification reponse diff --git a/indra/newview/lltoastalertpanel.h b/indra/newview/lltoastalertpanel.h index d1be5e018e..15bf11d42c 100644 --- a/indra/newview/lltoastalertpanel.h +++ b/indra/newview/lltoastalertpanel.h @@ -52,20 +52,6 @@ class LLToastAlertPanel public: typedef bool (*display_callback_t)(S32 modal); - class URLLoader - { - public: - virtual void load(const std::string& url, bool force_open_externally = 0) = 0; - virtual ~URLLoader() - { - } - }; - - static void setURLLoader(URLLoader* loader) - { - sURLLoader = loader; - } - public: // User's responsibility to call show() after creating these. LLToastAlertPanel( LLNotificationPtr notep, bool is_modal ); @@ -94,7 +80,6 @@ private: BOOL hasTitleBar() const; private: - static URLLoader* sURLLoader; static LLControlGroup* sSettings; struct ButtonData diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp index 392c103d7c..f9c327b46e 100644 --- a/indra/newview/lltoolcomp.cpp +++ b/indra/newview/lltoolcomp.cpp @@ -267,7 +267,7 @@ BOOL LLToolCompTranslate::handleHover(S32 x, S32 y, MASK mask) BOOL LLToolCompTranslate::handleMouseDown(S32 x, S32 y, MASK mask) { mMouseDown = TRUE; - gViewerWindow->pickAsync(x, y, mask, pickCallback, /*BOOL pick_transparent*/ TRUE); + gViewerWindow->pickAsync(x, y, mask, pickCallback, /*BOOL pick_transparent*/ TRUE, LLFloaterReg::instanceVisible("build")); return TRUE; } diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp index 596951fdfb..07f46c5fbe 100644 --- a/indra/newview/lltoolfocus.cpp +++ b/indra/newview/lltoolfocus.cpp @@ -293,12 +293,12 @@ BOOL LLToolCamera::handleMouseUp(S32 x, S32 y, MASK mask) BOOL success = LLViewerCamera::getInstance()->projectPosAgentToScreen(focus_pos, mouse_pos); if (success) { - LLUI::setMousePositionScreen(mouse_pos.mX, mouse_pos.mY); + LLUI::getInstance()->setMousePositionScreen(mouse_pos.mX, mouse_pos.mY); } } else if (mMouseSteering) { - LLUI::setMousePositionScreen(mMouseDownX, mMouseDownY); + LLUI::getInstance()->setMousePositionScreen(mMouseDownX, mMouseDownY); } else { @@ -308,7 +308,7 @@ BOOL LLToolCamera::handleMouseUp(S32 x, S32 y, MASK mask) else { // not a valid zoomable object - LLUI::setMousePositionScreen(mMouseDownX, mMouseDownY); + LLUI::getInstance()->setMousePositionScreen(mMouseDownX, mMouseDownY); } // calls releaseMouse() internally diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index f3e661e71a..3831f7d67d 100644 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -1001,7 +1001,7 @@ void LLToolGrabBase::onMouseCaptureLost() // ...move cursor "naturally", as if it had moved when hidden S32 x = mGrabPick.mMousePt.mX + mAccumDeltaX; S32 y = mGrabPick.mMousePt.mY + mAccumDeltaY; - LLUI::setMousePositionScreen(x, y); + LLUI::getInstance()->setMousePositionScreen(x, y); } else if (mHasMoved) { @@ -1011,13 +1011,13 @@ void LLToolGrabBase::onMouseCaptureLost() LLCoordGL gl_point; if (LLViewerCamera::getInstance()->projectPosAgentToScreen(grab_point_agent, gl_point)) { - LLUI::setMousePositionScreen(gl_point.mX, gl_point.mY); + LLUI::getInstance()->setMousePositionScreen(gl_point.mX, gl_point.mY); } } else { // ...move cursor back to click position - LLUI::setMousePositionScreen(mGrabPick.mMousePt.mX, mGrabPick.mMousePt.mY); + LLUI::getInstance()->setMousePositionScreen(mGrabPick.mMousePt.mX, mGrabPick.mMousePt.mY); } gViewerWindow->showCursor(); diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index f184b22ccb..54df5198c8 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -111,9 +111,64 @@ BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) mMouseOutsideSlop = FALSE; mMouseDownX = x; mMouseDownY = y; + LLTimer pick_timer; + BOOL pick_rigged = false; //gSavedSettings.getBOOL("AnimatedObjectsAllowLeftClick"); + LLPickInfo transparent_pick = gViewerWindow->pickImmediate(x, y, TRUE /*includes transparent*/, pick_rigged); + LLPickInfo visible_pick = gViewerWindow->pickImmediate(x, y, FALSE, pick_rigged); + LLViewerObject *transp_object = transparent_pick.getObject(); + LLViewerObject *visible_object = visible_pick.getObject(); + + // Current set of priorities + // 1. Transparent attachment pick + // 2. Transparent actionable pick + // 3. Visible attachment pick (e.x we click on attachment under invisible floor) + // 4. Visible actionable pick + // 5. Transparent pick (e.x. movement on transparent object/floor, our default pick) + // left mouse down always picks transparent (but see handleMouseUp). + // Also see LLToolPie::handleHover() - priorities are a bit different there. + // Todo: we need a more consistent set of rules to work with + if (transp_object == visible_object || !visible_object) + { + // Note: if transparent object is null, then visible object is also null + // since transparent pick includes non-tranpsarent one. + // !transparent_object check will be covered by transparent_object == visible_object. + mPick = transparent_pick; + } + else + { + // Select between two non-null picks + LLViewerObject *transp_parent = transp_object->getRootEdit(); + LLViewerObject *visible_parent = visible_object->getRootEdit(); + if (transp_object->isAttachment()) + { + // 1. Transparent attachment + mPick = transparent_pick; + } + else if (transp_object->getClickAction() != CLICK_ACTION_DISABLED + && (useClickAction(mask, transp_object, transp_parent) || transp_object->flagHandleTouch() || (transp_parent && transp_parent->flagHandleTouch()))) + { + // 2. Transparent actionable pick + mPick = transparent_pick; + } + else if (visible_object->isAttachment()) + { + // 3. Visible attachment pick + mPick = visible_pick; + } + else if (visible_object->getClickAction() != CLICK_ACTION_DISABLED + && (useClickAction(mask, visible_object, visible_parent) || visible_object->flagHandleTouch() || (visible_parent && visible_parent->flagHandleTouch()))) + { + // 4. Visible actionable pick + mPick = visible_pick; + } + else + { + // 5. Default: transparent + mPick = transparent_pick; + } + } + LL_INFOS() << "pick_rigged is " << (S32) pick_rigged << " pick time elapsed " << pick_timer.getElapsedTimeF32() << LL_ENDL; - //left mouse down always picks transparent (but see handleMouseUp) - mPick = gViewerWindow->pickImmediate(x, y, TRUE, FALSE); mPick.mKeyMask = mask; mMouseButtonDown = true; @@ -1130,7 +1185,7 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l const LLMediaEntry* mep = has_media ? tep->getMediaData() : NULL; if (mep) { - viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()); + viewer_media_t media_impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(mep->getMediaID()); LLPluginClassMedia* media_plugin = NULL; if (media_impl.notNull() && (media_impl->hasMedia())) @@ -1200,7 +1255,7 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, MASK mask) { - if (!LLUI::sSettingGroups["config"]->getBOOL("ShowHoverTips")) return TRUE; + if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("ShowHoverTips")) return TRUE; if (!mHoverPick.isValid()) return TRUE; LLViewerObject* hover_object = mHoverPick.getObject(); @@ -1305,7 +1360,7 @@ void LLToolPie::playCurrentMedia(const LLPickInfo& info) LLPluginClassMedia* media_plugin = NULL; - viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()); + viewer_media_t media_impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(mep->getMediaID()); if(media_impl.notNull() && media_impl->hasMedia()) { @@ -1357,7 +1412,7 @@ void LLToolPie::VisitHomePage(const LLPickInfo& info) LLPluginClassMedia* media_plugin = NULL; - viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()); + viewer_media_t media_impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(mep->getMediaID()); if(media_impl.notNull() && media_impl->hasMedia()) { @@ -1457,19 +1512,19 @@ static void handle_click_action_play() LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (!parcel) return; - LLViewerMediaImpl::EMediaStatus status = LLViewerParcelMedia::getStatus(); + LLViewerMediaImpl::EMediaStatus status = LLViewerParcelMedia::getInstance()->getStatus(); switch(status) { case LLViewerMediaImpl::MEDIA_PLAYING: - LLViewerParcelMedia::pause(); + LLViewerParcelMedia::getInstance()->pause(); break; case LLViewerMediaImpl::MEDIA_PAUSED: - LLViewerParcelMedia::start(); + LLViewerParcelMedia::getInstance()->start(); break; default: - LLViewerParcelMedia::play(parcel); + LLViewerParcelMedia::getInstance()->play(parcel); break; } } @@ -1500,7 +1555,7 @@ bool LLToolPie::handleMediaClick(const LLPickInfo& pick) if (!mep) return false; - viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()); + viewer_media_t media_impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(mep->getMediaID()); if (gSavedSettings.getBOOL("MediaOnAPrimUI")) { @@ -1554,7 +1609,7 @@ bool LLToolPie::handleMediaDblClick(const LLPickInfo& pick) if (!mep) return false; - viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()); + viewer_media_t media_impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(mep->getMediaID()); if (gSavedSettings.getBOOL("MediaOnAPrimUI")) { @@ -1609,7 +1664,7 @@ bool LLToolPie::handleMediaHover(const LLPickInfo& pick) if (mep && gSavedSettings.getBOOL("MediaOnAPrimUI")) { - viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()); + viewer_media_t media_impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(mep->getMediaID()); if(media_impl.notNull()) { @@ -1647,7 +1702,7 @@ bool LLToolPie::handleMediaMouseUp() if(mMediaMouseCaptureID.notNull()) { // Face media needs to know the mouse went up. - viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mMediaMouseCaptureID); + viewer_media_t media_impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(mMediaMouseCaptureID); if(media_impl) { // This will send a mouseUp event to the plugin using the last known mouse coordinate (from a mouseDown or mouseMove), which is what we want. @@ -1676,7 +1731,7 @@ static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp) if( face < 0 || face >= objectp->getNumTEs() ) return; // is media playing on this face? - if (LLViewerMedia::getMediaImplFromTextureID(objectp->getTE(face)->getID()) != NULL) + if (LLViewerMedia::getInstance()->getMediaImplFromTextureID(objectp->getTE(face)->getID()) != NULL) { handle_click_action_play(); return; @@ -1706,7 +1761,7 @@ static ECursorType cursor_from_parcel_media(U8 click_action) open_cursor = UI_CURSOR_TOOLMEDIAOPEN; - LLViewerMediaImpl::EMediaStatus status = LLViewerParcelMedia::getStatus(); + LLViewerMediaImpl::EMediaStatus status = LLViewerParcelMedia::getInstance()->getStatus(); switch(status) { case LLViewerMediaImpl::MEDIA_PLAYING: diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index 1936e24761..e424983cf8 100644 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -38,8 +38,12 @@ #include "llcoros.h" #include "reader.h" #include "llcorehttputil.h" +#include "llurlregistry.h" +static const std::string BING_NOTRANSLATE_OPENING_TAG("<div class=\"notranslate\">"); +static const std::string BING_NOTRANSLATE_CLOSING_TAG("</div>"); + /** * Handler of an HTTP machine translation service. * @@ -99,6 +103,8 @@ public: */ virtual bool isConfigured() const = 0; + virtual LLTranslate::EService getCurrentService() = 0; + virtual void verifyKey(const std::string &key, LLTranslate::KeyVerificationResult_fn fnc) = 0; virtual void translateMessage(LanguagePair_t fromTo, std::string msg, LLTranslate::TranslationSuccess_fn success, LLTranslate::TranslationFailure_fn failure); @@ -248,6 +254,8 @@ public: std::string& err_msg) const; /*virtual*/ bool isConfigured() const; + /*virtual*/ LLTranslate::EService getCurrentService() { return LLTranslate::EService::SERVICE_GOOGLE; } + /*virtual*/ void verifyKey(const std::string &key, LLTranslate::KeyVerificationResult_fn fnc); private: @@ -409,6 +417,8 @@ public: std::string& err_msg) const; /*virtual*/ bool isConfigured() const; + /*virtual*/ LLTranslate::EService getCurrentService() { return LLTranslate::EService::SERVICE_BING; } + /*virtual*/ void verifyKey(const std::string &key, LLTranslate::KeyVerificationResult_fn fnc); private: static std::string getAPIKey(); @@ -520,7 +530,59 @@ void LLTranslate::translateMessage(const std::string &from_lang, const std::stri { LLTranslationAPIHandler& handler = getPreferredHandler(); - handler.translateMessage(LLTranslationAPIHandler::LanguagePair_t(from_lang, to_lang), mesg, success, failure); + handler.translateMessage(LLTranslationAPIHandler::LanguagePair_t(from_lang, to_lang), addNoTranslateTags(mesg), success, failure); +} + +std::string LLTranslate::addNoTranslateTags(std::string mesg) +{ + if (getPreferredHandler().getCurrentService() != SERVICE_BING) + { + return mesg; + } + + std::string upd_msg(mesg); + LLUrlMatch match; + S32 dif = 0; + //surround all links (including SLURLs) with 'no-translate' tags to prevent unnecessary translation + while (LLUrlRegistry::instance().findUrl(mesg, match)) + { + upd_msg.insert(dif + match.getStart(), BING_NOTRANSLATE_OPENING_TAG); + upd_msg.insert(dif + BING_NOTRANSLATE_OPENING_TAG.size() + match.getEnd() + 1, BING_NOTRANSLATE_CLOSING_TAG); + mesg.erase(match.getStart(), match.getEnd() - match.getStart()); + dif += match.getEnd() - match.getStart() + BING_NOTRANSLATE_OPENING_TAG.size() + BING_NOTRANSLATE_CLOSING_TAG.size(); + } + return upd_msg; +} + +std::string LLTranslate::removeNoTranslateTags(std::string mesg) +{ + if (getPreferredHandler().getCurrentService() != SERVICE_BING) + { + return mesg; + } + std::string upd_msg(mesg); + LLUrlMatch match; + S32 opening_tag_size = BING_NOTRANSLATE_OPENING_TAG.size(); + S32 closing_tag_size = BING_NOTRANSLATE_CLOSING_TAG.size(); + S32 dif = 0; + //remove 'no-translate' tags we added to the links before + while (LLUrlRegistry::instance().findUrl(mesg, match)) + { + if (upd_msg.substr(dif + match.getStart() - opening_tag_size, opening_tag_size) == BING_NOTRANSLATE_OPENING_TAG) + { + upd_msg.erase(dif + match.getStart() - opening_tag_size, opening_tag_size); + dif -= opening_tag_size; + + if (upd_msg.substr(dif + match.getEnd() + 1, closing_tag_size) == BING_NOTRANSLATE_CLOSING_TAG) + { + upd_msg.replace(dif + match.getEnd() + 1, closing_tag_size, " "); + dif -= closing_tag_size - 1; + } + } + mesg.erase(match.getStart(), match.getUrl().size()); + dif += match.getUrl().size(); + } + return upd_msg; } /*static*/ diff --git a/indra/newview/lltranslate.h b/indra/newview/lltranslate.h index bf431cdfbb..e0722fbd83 100644 --- a/indra/newview/lltranslate.h +++ b/indra/newview/lltranslate.h @@ -91,6 +91,9 @@ public : */ static bool isTranslationConfigured(); + static std::string addNoTranslateTags(std::string mesg); + static std::string removeNoTranslateTags(std::string mesg); + private: static LLTranslationAPIHandler& getPreferredHandler(); static LLTranslationAPIHandler& getHandler(EService service); diff --git a/indra/newview/lltwitterconnect.cpp b/indra/newview/lltwitterconnect.cpp index 5d598aaebe..b2d2fa9d77 100644 --- a/indra/newview/lltwitterconnect.cpp +++ b/indra/newview/lltwitterconnect.cpp @@ -28,6 +28,7 @@ #include "llviewerprecompiledheaders.h" #include "lltwitterconnect.h" +#include "llflickrconnect.h" #include "llagent.h" #include "llcallingcard.h" // for LLAvatarTracker @@ -65,6 +66,49 @@ void toast_user_for_twitter_success() LLNotificationsUtil::add("TwitterConnect", args); } +class LLTwitterConnectHandler : public LLCommandHandler +{ +public: + LLTwitterConnectHandler() : LLCommandHandler("fbc", UNTRUSTED_THROTTLE) {} + + bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) + { + if (tokens.size() >= 1) + { + if (tokens[0].asString() == "connect") + { + if (tokens.size() >= 2 && tokens[1].asString() == "twitter") + { + // this command probably came from the twitter_web browser, so close it + LLFloaterReg::hideInstance("twitter_web"); + + // connect to twitter + if (query_map.has("oauth_token")) + { + LLTwitterConnect::instance().connectToTwitter(query_map["oauth_token"], query_map.get("oauth_verifier")); + } + return true; + } + else if (tokens.size() >= 2 && tokens[1].asString() == "flickr") + { + // this command probably came from the flickr_web browser, so close it + LLFloaterReg::hideInstance("flickr_web"); + + // connect to flickr + if (query_map.has("oauth_token")) + { + LLFlickrConnect::instance().connectToFlickr(query_map["oauth_token"], query_map.get("oauth_verifier")); + } + return true; + } + } + } + return false; + } +}; +LLTwitterConnectHandler gTwitterConnectHandler; + + /////////////////////////////////////////////////////////////////////////////// // void LLTwitterConnect::twitterConnectCoro(std::string requestToken, std::string oauthVerifier) diff --git a/indra/newview/lluilistener.cpp b/indra/newview/lluilistener.cpp index 6b2cd71d40..956f5cf187 100644 --- a/indra/newview/lluilistener.cpp +++ b/indra/newview/lluilistener.cpp @@ -84,8 +84,8 @@ void LLUIListener::getValue(const LLSD&event) const { LLSD reply = LLSD::emptyMap(); - const LLView* root = LLUI::getRootView(); - const LLView* view = LLUI::resolvePath(root, event["path"].asString()); + const LLView* root = LLUI::getInstance()->getRootView(); + const LLView* view = LLUI::getInstance()->resolvePath(root, event["path"].asString()); const LLUICtrl* ctrl(dynamic_cast<const LLUICtrl*>(view)); if (ctrl) diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index 78268944fc..a1670351f4 100644 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -47,6 +47,7 @@ // library includes #include "llnotificationsutil.h" #include "llsd.h" +#include "stringize.h" static LLURLDispatcherListener sURLDispatcherListener; @@ -187,7 +188,7 @@ bool LLURLDispatcherImpl::dispatchRegion(const LLSLURL& slurl, const std::string LLWorldMapMessage::getInstance()->sendNamedRegionRequest(slurl.getRegion(), LLURLDispatcherImpl::regionNameCallback, slurl.getSLURLString(), - LLUI::sSettingGroups["config"]->getBOOL("SLURLTeleportDirectly")); // don't teleport + LLUI::getInstance()->mSettingGroups["config"]->getBOOL("SLURLTeleportDirectly")); // don't teleport return true; } @@ -255,14 +256,23 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL& // Teleportation links are handled here because they are tightly coupled // to SLURL parsing and sim-fragment parsing -class LLTeleportHandler : public LLCommandHandler +class LLTeleportHandler : public LLCommandHandler, public LLEventAPI { public: // Teleport requests *must* come from a trusted browser // inside the app, otherwise a malicious web page could // cause a constant teleport loop. JC - LLTeleportHandler() : LLCommandHandler("teleport", UNTRUSTED_THROTTLE) { } - + LLTeleportHandler() : + LLCommandHandler("teleport", UNTRUSTED_THROTTLE), + LLEventAPI("LLTeleportHandler", "Low-level teleport API") + { + LLEventAPI::add("teleport", + "Teleport to specified [\"regionname\"] at\n" + "specified region-relative [\"x\"], [\"y\"], [\"z\"].\n" + "If [\"regionname\"] omitted, teleport to GLOBAL\n" + "coordinates [\"x\"], [\"y\"], [\"z\"].", + &LLTeleportHandler::from_event); + } bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) @@ -293,6 +303,41 @@ public: return true; } + void from_event(const LLSD& params) const + { + Response response(LLSD(), params); + if (params.has("regionname")) + { + // region specified, coordinates (if any) are region-local + LLVector3 local_pos( + params.has("x")? params["x"].asReal() : 128, + params.has("y")? params["y"].asReal() : 128, + params.has("z")? params["z"].asReal() : 0); + std::string regionname(params["regionname"]); + std::string destination(LLSLURL(regionname, local_pos).getSLURLString()); + // have to resolve region's global coordinates first + teleport_via_slapp(regionname, destination); + response["message"] = "Teleporting to " + destination; + } + else // no regionname + { + // coordinates are global, and at least (x, y) are required + if (! (params.has("x") && params.has("y"))) + { + return response.error("Specify either regionname or global (x, y)"); + } + LLVector3d global_pos(params["x"].asReal(), params["y"].asReal(), + params["z"].asReal()); + gAgent.teleportViaLocation(global_pos); + LLFloaterWorldMap* instance = LLFloaterWorldMap::getInstance(); + if (instance) + { + instance->trackLocation(global_pos); + } + response["message"] = STRINGIZE("Teleporting to global " << global_pos); + } + } + static void teleport_via_slapp(std::string region_name, std::string callback_url) { diff --git a/indra/newview/llurllineeditorctrl.cpp b/indra/newview/llurllineeditorctrl.cpp index 8a61114852..2b7e598a59 100644 --- a/indra/newview/llurllineeditorctrl.cpp +++ b/indra/newview/llurllineeditorctrl.cpp @@ -66,7 +66,7 @@ void LLURLLineEditor::cut() if( need_to_rollback ) { rollback.doRollback( this ); - LLUI::reportBadKeystroke(); + LLUI::getInstance()->reportBadKeystroke(); } else if( mKeystrokeCallback ) diff --git a/indra/newview/llurlwhitelist.cpp b/indra/newview/llurlwhitelist.cpp index 3a7285974e..b4d38f5d1e 100644 --- a/indra/newview/llurlwhitelist.cpp +++ b/indra/newview/llurlwhitelist.cpp @@ -31,8 +31,6 @@ #include <iostream> #include <fstream> -LLUrlWhiteList* LLUrlWhiteList::sInstance = 0; - /////////////////////////////////////////////////////////////////////////////// // LLUrlWhiteList::LLUrlWhiteList () : @@ -50,29 +48,6 @@ LLUrlWhiteList::~LLUrlWhiteList () } /////////////////////////////////////////////////////////////////////////////// - -//static -void LLUrlWhiteList::initClass () -{ - if ( ! sInstance ) - { - sInstance = new LLUrlWhiteList (); - } -} - -//static -void LLUrlWhiteList::cleanupClass () -{ - delete sInstance; - sInstance = NULL; -} - -LLUrlWhiteList* LLUrlWhiteList::getInstance () -{ - return sInstance; -} - -/////////////////////////////////////////////////////////////////////////////// // bool LLUrlWhiteList::load () { diff --git a/indra/newview/llurlwhitelist.h b/indra/newview/llurlwhitelist.h index b0969051a7..c2511b08fd 100644 --- a/indra/newview/llurlwhitelist.h +++ b/indra/newview/llurlwhitelist.h @@ -30,15 +30,11 @@ #include <list> -class LLUrlWhiteList +class LLUrlWhiteList : public LLSingleton<LLUrlWhiteList> { + LLSINGLETON(LLUrlWhiteList); + ~LLUrlWhiteList(); public: - virtual ~LLUrlWhiteList (); - - static void initClass(); - static void cleanupClass(); - static LLUrlWhiteList* getInstance (); - bool load (); bool save (); @@ -51,9 +47,6 @@ class LLUrlWhiteList bool getNext ( std::string& valueOut ); private: - LLUrlWhiteList (); - static LLUrlWhiteList* sInstance; - typedef std::vector < std::string > string_list_t ; bool mLoaded; diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 7ce9d858dd..cb20801756 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -463,24 +463,25 @@ void audio_update_volume(bool force_update) F32 media_volume = gSavedSettings.getF32("AudioLevelMedia"); BOOL media_muted = gSavedSettings.getBOOL("MuteMedia"); media_volume = mute_volume * master_volume * media_volume; - LLViewerMedia::setVolume( media_muted ? 0.0f : media_volume ); + LLViewerMedia::getInstance()->setVolume( media_muted ? 0.0f : media_volume ); - // Voice - if (LLVoiceClient::getInstance()) + // Voice, this is parametric singleton, it gets initialized when ready + if (LLVoiceClient::instanceExists()) { F32 voice_volume = gSavedSettings.getF32("AudioLevelVoice"); voice_volume = mute_volume * master_volume * voice_volume; BOOL voice_mute = gSavedSettings.getBOOL("MuteVoice"); - LLVoiceClient::getInstance()->setVoiceVolume(voice_mute ? 0.f : voice_volume); - LLVoiceClient::getInstance()->setMicGain(voice_mute ? 0.f : gSavedSettings.getF32("AudioLevelMic")); + LLVoiceClient *voice_inst = LLVoiceClient::getInstance(); + voice_inst->setVoiceVolume(voice_mute ? 0.f : voice_volume); + voice_inst->setMicGain(voice_mute ? 0.f : gSavedSettings.getF32("AudioLevelMic")); if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized"))) { - LLVoiceClient::getInstance()->setMuteMic(true); + voice_inst->setMuteMic(true); } else { - LLVoiceClient::getInstance()->setMuteMic(false); + voice_inst->setMuteMic(false); } } } diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 64f6123f5d..d8526e63ca 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -42,7 +42,7 @@ #include "llfeaturemanager.h" //#include "llfirstuse.h" #include "llhudmanager.h" -#include "llimagebmp.h" +#include "llimagepng.h" #include "llmemory.h" #include "llselectmgr.h" #include "llsky.h" @@ -237,6 +237,7 @@ void display_stats() static LLTrace::BlockTimerStatHandle FTM_PICK("Picking"); static LLTrace::BlockTimerStatHandle FTM_RENDER("Render"); +static LLTrace::BlockTimerStatHandle FTM_RENDER_HUD("Render HUD"); static LLTrace::BlockTimerStatHandle FTM_UPDATE_SKY("Update Sky"); static LLTrace::BlockTimerStatHandle FTM_UPDATE_DYNAMIC_TEXTURES("Update Dynamic Textures"); static LLTrace::BlockTimerStatHandle FTM_IMAGE_UPDATE("Update Images"); @@ -568,6 +569,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) if (gDisconnected) { LLAppViewer::instance()->pingMainloopTimeout("Display:Disconnected"); + LL_RECORD_BLOCK_TIME(FTM_RENDER_UI); render_ui(); swap(); } @@ -1293,7 +1295,8 @@ void render_ui(F32 zoom_factor, int subfield) { gPipeline.renderBloom(gSnapshot, zoom_factor, subfield); } - + + LL_RECORD_BLOCK_TIME(FTM_RENDER_HUD); render_hud_elements(); render_hud_attachments(); } @@ -1308,8 +1311,6 @@ void render_ui(F32 zoom_factor, int subfield) gGL.color4f(1,1,1,1); if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) { - LL_RECORD_BLOCK_TIME(FTM_RENDER_UI); - if (!gDisconnected) { render_ui_3d(); @@ -1507,9 +1508,10 @@ void render_ui_2d() if (gSavedSettings.getBOOL("RenderUIBuffer")) { - if (LLUI::sDirty) + LLUI* ui_inst = LLUI::getInstance(); + if (ui_inst->mDirty) { - LLUI::sDirty = FALSE; + ui_inst->mDirty = FALSE; LLRect t_rect; gPipeline.mUIScreen.bindTarget(); @@ -1517,25 +1519,25 @@ void render_ui_2d() { static const S32 pad = 8; - LLUI::sDirtyRect.mLeft -= pad; - LLUI::sDirtyRect.mRight += pad; - LLUI::sDirtyRect.mBottom -= pad; - LLUI::sDirtyRect.mTop += pad; + ui_inst->mDirtyRect.mLeft -= pad; + ui_inst->mDirtyRect.mRight += pad; + ui_inst->mDirtyRect.mBottom -= pad; + ui_inst->mDirtyRect.mTop += pad; LLGLEnable scissor(GL_SCISSOR_TEST); - static LLRect last_rect = LLUI::sDirtyRect; + static LLRect last_rect = ui_inst->mDirtyRect; //union with last rect to avoid mouse poop - last_rect.unionWith(LLUI::sDirtyRect); + last_rect.unionWith(ui_inst->mDirtyRect); - t_rect = LLUI::sDirtyRect; - LLUI::sDirtyRect = last_rect; + t_rect = ui_inst->mDirtyRect; + ui_inst->mDirtyRect = last_rect; last_rect = t_rect; - last_rect.mLeft = LLRect::tCoordType(last_rect.mLeft / LLUI::getScaleFactor().mV[0]); - last_rect.mRight = LLRect::tCoordType(last_rect.mRight / LLUI::getScaleFactor().mV[0]); - last_rect.mTop = LLRect::tCoordType(last_rect.mTop / LLUI::getScaleFactor().mV[1]); - last_rect.mBottom = LLRect::tCoordType(last_rect.mBottom / LLUI::getScaleFactor().mV[1]); + last_rect.mLeft = LLRect::tCoordType(last_rect.mLeft / ui_inst->getScaleFactor().mV[0]); + last_rect.mRight = LLRect::tCoordType(last_rect.mRight / ui_inst->getScaleFactor().mV[0]); + last_rect.mTop = LLRect::tCoordType(last_rect.mTop / ui_inst->getScaleFactor().mV[1]); + last_rect.mBottom = LLRect::tCoordType(last_rect.mBottom / ui_inst->getScaleFactor().mV[1]); LLRect clip_rect(last_rect); @@ -1547,7 +1549,7 @@ void render_ui_2d() gPipeline.mUIScreen.flush(); gGL.setColorMask(true, false); - LLUI::sDirtyRect = t_rect; + ui_inst->mDirtyRect = t_rect; } LLGLDisable cull(GL_CULL_FACE); @@ -1587,17 +1589,17 @@ void render_disconnected_background() LL_INFOS() << "Loading last bitmap..." << LL_ENDL; std::string temp_str; - temp_str = gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + SCREEN_LAST_FILENAME; + temp_str = gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + LLStartUp::getScreenLastFilename(); - LLPointer<LLImageBMP> image_bmp = new LLImageBMP; - if( !image_bmp->load(temp_str) ) + LLPointer<LLImagePNG> image_png = new LLImagePNG; + if( !image_png->load(temp_str) ) { //LL_INFOS() << "Bitmap load failed" << LL_ENDL; return; } LLPointer<LLImageRaw> raw = new LLImageRaw; - if (!image_bmp->decode(raw, 0.0f)) + if (!image_png->decode(raw, 0.0f)) { LL_INFOS() << "Bitmap decode failed" << LL_ENDL; gDisconnectedImagep = NULL; @@ -1605,7 +1607,7 @@ void render_disconnected_background() } U8 *rawp = raw->getData(); - S32 npixels = (S32)image_bmp->getWidth()*(S32)image_bmp->getHeight(); + S32 npixels = (S32)image_png->getWidth()*(S32)image_png->getHeight(); for (S32 i = 0; i < npixels; i++) { S32 sum = 0; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 2a61c26b30..f475ab7d66 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -67,7 +67,6 @@ #include "llfloaterexperiences.h" #include "llfloaterexperiencepicker.h" #include "llfloaterevent.h" -#include "llfloaterfacebook.h" #include "llfloaterflickr.h" #include "llfloaterfonttest.h" #include "llfloatergesture.h" @@ -353,11 +352,9 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("profile", "floater_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create); LLFloaterReg::add("how_to", "floater_how_to.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create); - LLFloaterReg::add("fbc_web", "floater_fbc_web.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create); LLFloaterReg::add("flickr_web", "floater_fbc_web.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create); LLFloaterReg::add("twitter_web", "floater_fbc_web.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create); - LLFloaterReg::add("facebook", "floater_facebook.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterFacebook>); LLFloaterReg::add("flickr", "floater_flickr.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterFlickr>); LLFloaterReg::add("twitter", "floater_twitter.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTwitter>); LLFloaterReg::add("big_preview", "floater_big_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBigPreview>); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 1ab7ec0156..9d7da115ac 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -138,6 +138,7 @@ LLLocalizedInventoryItemsDictionary::LLLocalizedInventoryItemsDictionary() mInventoryItemsDict["New Skirt"] = LLTrans::getString("New Skirt"); mInventoryItemsDict["New Alpha"] = LLTrans::getString("New Alpha"); mInventoryItemsDict["New Tattoo"] = LLTrans::getString("New Tattoo"); + mInventoryItemsDict["New Universal"] = LLTrans::getString("New Universal"); mInventoryItemsDict["New Physics"] = LLTrans::getString("New Physics"); mInventoryItemsDict["Invalid Wearable"] = LLTrans::getString("Invalid Wearable"); @@ -237,7 +238,7 @@ public: return false; } - if (!LLUI::sSettingGroups["config"]->getBOOL("EnableInventory")) + if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableInventory")) { LLNotificationsUtil::add("NoInventory", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); return true; diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index b89e1497a1..e930eb20d3 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -64,7 +64,12 @@ LLViewerKeyboard gViewerKeyboard; void agent_jump( EKeystate s ) { - if( KEYSTATE_UP == s ) return; + static BOOL first_fly_attempt(TRUE); + if (KEYSTATE_UP == s) + { + first_fly_attempt = TRUE; + return; + } F32 time = gKeyboard->getCurKeyElapsedTime(); S32 frame_count = ll_round(gKeyboard->getCurKeyElapsedFrameCount()); @@ -77,7 +82,8 @@ void agent_jump( EKeystate s ) } else { - gAgent.setFlying(TRUE); + gAgent.setFlying(TRUE, first_fly_attempt); + first_fly_attempt = FALSE; gAgent.moveUp(1); } } diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index d8745b1eca..6cfc22a4e5 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -77,12 +77,6 @@ #include <boost/bind.hpp> // for SkinFolder listener #include <boost/signals2.hpp> -/*static*/ const char* LLViewerMedia::AUTO_PLAY_MEDIA_SETTING = "ParcelMediaAutoPlayEnable"; -/*static*/ const char* LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING = "MediaShowOnOthers"; -/*static*/ const char* LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING = "MediaShowWithinParcel"; -/*static*/ const char* LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING = "MediaShowOutsideParcel"; - - class LLMediaFilePicker : public LLFilePickerThread // deletes itself when done { public: @@ -191,9 +185,6 @@ LLViewerMediaObserver::~LLViewerMediaObserver() } -LLURL LLViewerMedia::sOpenIDURL; -std::string LLViewerMedia::sOpenIDCookie; -LLPluginClassMedia* LLViewerMedia::sSpareBrowserMediaSource = NULL; static LLViewerMedia::impl_list sViewerMediaImplList; static LLViewerMedia::impl_id_map sViewerMediaTextureIDMap; static LLTimer sMediaCreateTimer; @@ -203,8 +194,6 @@ static bool sForceUpdate = false; static LLUUID sOnlyAudibleTextureID = LLUUID::null; static F64 sLowestLoadableImplInterest = 0.0f; static bool sAnyMediaShowing = false; -static bool sAnyMediaPlaying = false; -static boost::signals2::connection sTeleportFinishConnection; ////////////////////////////////////////////////////////////////////////////////////////// static void add_media_impl(LLViewerMediaImpl* media) @@ -230,7 +219,7 @@ static void remove_media_impl(LLViewerMediaImpl* media) class LLViewerMediaMuteListObserver : public LLMuteListObserver { - /* virtual */ void onChange() { LLViewerMedia::muteListChanged();} + /* virtual */ void onChange() { LLViewerMedia::getInstance()->muteListChanged();} }; static LLViewerMediaMuteListObserver sViewerMediaMuteListObserver; @@ -239,9 +228,40 @@ static bool sViewerMediaMuteListObserverInitialized = false; ////////////////////////////////////////////////////////////////////////////////////////// // LLViewerMedia - ////////////////////////////////////////////////////////////////////////////////////////// + +/*static*/ const char* LLViewerMedia::AUTO_PLAY_MEDIA_SETTING = "ParcelMediaAutoPlayEnable"; +/*static*/ const char* LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING = "MediaShowOnOthers"; +/*static*/ const char* LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING = "MediaShowWithinParcel"; +/*static*/ const char* LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING = "MediaShowOutsideParcel"; + +LLViewerMedia::LLViewerMedia(): +mAnyMediaShowing(false), +mAnyMediaPlaying(false), +mSpareBrowserMediaSource(NULL) +{ +} + +LLViewerMedia::~LLViewerMedia() +{ + gIdleCallbacks.deleteFunction(LLViewerMedia::onIdle, NULL); + mTeleportFinishConnection.disconnect(); + if (mSpareBrowserMediaSource != NULL) + { + delete mSpareBrowserMediaSource; + mSpareBrowserMediaSource = NULL; + } +} + // static +void LLViewerMedia::initSingleton() +{ + gIdleCallbacks.addFunction(LLViewerMedia::onIdle, NULL); + mTeleportFinishConnection = LLViewerParcelMgr::getInstance()-> + setTeleportFinishedCallback(boost::bind(&LLViewerMedia::onTeleportFinished, this)); +} + +////////////////////////////////////////////////////////////////////////////////////////// viewer_media_t LLViewerMedia::newMediaImpl( const LLUUID& texture_id, S32 media_width, @@ -368,7 +388,6 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s } ////////////////////////////////////////////////////////////////////////////////////////// -// static LLViewerMediaImpl* LLViewerMedia::getMediaImplFromTextureID(const LLUUID& texture_id) { LLViewerMediaImpl* result = NULL; @@ -384,7 +403,6 @@ LLViewerMediaImpl* LLViewerMedia::getMediaImplFromTextureID(const LLUUID& textur } ////////////////////////////////////////////////////////////////////////////////////////// -// static std::string LLViewerMedia::getCurrentUserAgent() { // Don't use user-visible string to avoid @@ -411,7 +429,6 @@ std::string LLViewerMedia::getCurrentUserAgent() } ////////////////////////////////////////////////////////////////////////////////////////// -// static void LLViewerMedia::updateBrowserUserAgent() { std::string user_agent = getCurrentUserAgent(); @@ -431,7 +448,6 @@ void LLViewerMedia::updateBrowserUserAgent() } ////////////////////////////////////////////////////////////////////////////////////////// -// static bool LLViewerMedia::handleSkinCurrentChanged(const LLSD& /*newvalue*/) { // gSavedSettings is already updated when this function is called. @@ -440,7 +456,6 @@ bool LLViewerMedia::handleSkinCurrentChanged(const LLSD& /*newvalue*/) } ////////////////////////////////////////////////////////////////////////////////////////// -// static bool LLViewerMedia::textureHasMedia(const LLUUID& texture_id) { impl_list::iterator iter = sViewerMediaImplList.begin(); @@ -458,7 +473,6 @@ bool LLViewerMedia::textureHasMedia(const LLUUID& texture_id) } ////////////////////////////////////////////////////////////////////////////////////////// -// static void LLViewerMedia::setVolume(F32 volume) { if(volume != sGlobalVolume || sForceUpdate) @@ -478,14 +492,12 @@ void LLViewerMedia::setVolume(F32 volume) } ////////////////////////////////////////////////////////////////////////////////////////// -// static F32 LLViewerMedia::getVolume() { return sGlobalVolume; } ////////////////////////////////////////////////////////////////////////////////////////// -// static void LLViewerMedia::muteListChanged() { // When the mute list changes, we need to check mute status on all impls. @@ -500,7 +512,6 @@ void LLViewerMedia::muteListChanged() } ////////////////////////////////////////////////////////////////////////////////////////// -// static bool LLViewerMedia::isInterestingEnough(const LLVOVolume *object, const F64 &object_interest) { bool result = false; @@ -535,6 +546,7 @@ LLViewerMedia::impl_list &LLViewerMedia::getPriorityList() return sViewerMediaImplList; } +// static // This is the predicate function used to sort sViewerMediaImplList by priority. bool LLViewerMedia::priorityComparitor(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2) { @@ -629,7 +641,12 @@ static LLTrace::BlockTimerStatHandle FTM_MEDIA_MISC("Misc"); ////////////////////////////////////////////////////////////////////////////////////////// -// static +void LLViewerMedia::onIdle(void *dummy_arg) +{ + LLViewerMedia::getInstance()->updateMedia(dummy_arg); +} + +////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMedia::updateMedia(void *dummy_arg) { LL_RECORD_BLOCK_TIME(FTM_MEDIA_UPDATE); @@ -642,8 +659,8 @@ void LLViewerMedia::updateMedia(void *dummy_arg) // removing it for now. //createSpareBrowserMediaSource(); - sAnyMediaShowing = false; - sAnyMediaPlaying = false; + mAnyMediaShowing = false; + mAnyMediaPlaying = false; impl_list::iterator iter = sViewerMediaImplList.begin(); impl_list::iterator end = sViewerMediaImplList.end(); @@ -659,10 +676,10 @@ void LLViewerMedia::updateMedia(void *dummy_arg) } // Let the spare media source actually launch - if(sSpareBrowserMediaSource) + if(mSpareBrowserMediaSource) { LL_RECORD_BLOCK_TIME(FTM_MEDIA_SPARE_IDLE); - sSpareBrowserMediaSource->idle(); + mSpareBrowserMediaSource->idle(); } { @@ -854,7 +871,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg) if (!pimpl->getUsedInUI() && pimpl->hasMedia() && (pimpl->isMediaPlaying() || !pimpl->isMediaTimeBased())) { // consider visible non-timebased media as playing - sAnyMediaPlaying = true; + mAnyMediaPlaying = true; } } @@ -899,21 +916,18 @@ void LLViewerMedia::updateMedia(void *dummy_arg) } ////////////////////////////////////////////////////////////////////////////////////////// -// static bool LLViewerMedia::isAnyMediaShowing() { - return sAnyMediaShowing; + return mAnyMediaShowing; } ////////////////////////////////////////////////////////////////////////////////////////// -// static bool LLViewerMedia::isAnyMediaPlaying() { - return sAnyMediaPlaying; + return mAnyMediaPlaying; } ////////////////////////////////////////////////////////////////////////////////////////// -// static void LLViewerMedia::setAllMediaEnabled(bool val) { // Set "tentative" autoplay first. We need to do this here or else @@ -938,7 +952,7 @@ void LLViewerMedia::setAllMediaEnabled(bool val) { if (!LLViewerMedia::isParcelMediaPlaying() && LLViewerMedia::hasParcelMedia()) { - LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel()); + LLViewerParcelMedia::getInstance()->play(LLViewerParcelMgr::getInstance()->getAgentParcel()); } static LLCachedControl<bool> audio_streaming_music(gSavedSettings, "AudioStreamingMusic", true); @@ -960,7 +974,7 @@ void LLViewerMedia::setAllMediaEnabled(bool val) } else { // This actually unloads the impl, as opposed to "stop"ping the media - LLViewerParcelMedia::stop(); + LLViewerParcelMedia::getInstance()->stop(); if (gAudiop) { LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade(); @@ -969,7 +983,6 @@ void LLViewerMedia::setAllMediaEnabled(bool val) } ////////////////////////////////////////////////////////////////////////////////////////// -// static void LLViewerMedia::setAllMediaPaused(bool val) { // Set "tentative" autoplay first. We need to do this here or else @@ -1010,7 +1023,7 @@ void LLViewerMedia::setAllMediaPaused(bool val) { if (!LLViewerMedia::isParcelMediaPlaying() && LLViewerMedia::hasParcelMedia()) { - LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel()); + LLViewerParcelMedia::getInstance()->play(LLViewerParcelMgr::getInstance()->getAgentParcel()); } static LLCachedControl<bool> audio_streaming_music(gSavedSettings, "AudioStreamingMusic", true); @@ -1032,7 +1045,7 @@ void LLViewerMedia::setAllMediaPaused(bool val) } else { // This actually unloads the impl, as opposed to "stop"ping the media - LLViewerParcelMedia::stop(); + LLViewerParcelMedia::getInstance()->stop(); if (gAudiop) { LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade(); @@ -1041,19 +1054,25 @@ void LLViewerMedia::setAllMediaPaused(bool val) } ////////////////////////////////////////////////////////////////////////////////////////// -// static bool LLViewerMedia::isParcelMediaPlaying() { - return (LLViewerMedia::hasParcelMedia() && LLViewerParcelMedia::getParcelMedia() && LLViewerParcelMedia::getParcelMedia()->hasMedia()); + viewer_media_t media = LLViewerParcelMedia::getInstance()->getParcelMedia(); + return (LLViewerMedia::hasParcelMedia() && media && media->hasMedia()); } ///////////////////////////////////////////////////////////////////////////////////////// -// static bool LLViewerMedia::isParcelAudioPlaying() { return (LLViewerMedia::hasParcelAudio() && gAudiop && LLAudioEngine::AUDIO_PLAYING == gAudiop->isInternetStreamPlaying()); } +///////////////////////////////////////////////////////////////////////////////////////// +// static +void LLViewerMedia::authSubmitCallback(const LLSD& notification, const LLSD& response) +{ + LLViewerMedia::getInstance()->onAuthSubmit(notification, response); +} + void LLViewerMedia::onAuthSubmit(const LLSD& notification, const LLSD& response) { LLViewerMediaImpl *impl = LLViewerMedia::getMediaImplFromTextureID(notification["payload"]["media_id"]); @@ -1075,7 +1094,6 @@ void LLViewerMedia::onAuthSubmit(const LLSD& notification, const LLSD& response) } ///////////////////////////////////////////////////////////////////////////////////////// -// static void LLViewerMedia::clearAllCookies() { // Clear all cookies for all plugins @@ -1092,7 +1110,6 @@ void LLViewerMedia::clearAllCookies() } ///////////////////////////////////////////////////////////////////////////////////////// -// static void LLViewerMedia::clearAllCaches() { // Clear all plugins' caches @@ -1106,7 +1123,6 @@ void LLViewerMedia::clearAllCaches() } ///////////////////////////////////////////////////////////////////////////////////////// -// static void LLViewerMedia::setCookiesEnabled(bool enabled) { // Set the "cookies enabled" flag for all loaded plugins @@ -1123,7 +1139,6 @@ void LLViewerMedia::setCookiesEnabled(bool enabled) } ///////////////////////////////////////////////////////////////////////////////////////// -// static void LLViewerMedia::setProxyConfig(bool enable, const std::string &host, int port) { // Set the proxy config for all loaded plugins @@ -1140,10 +1155,6 @@ void LLViewerMedia::setProxyConfig(bool enable, const std::string &host, int por } ///////////////////////////////////////////////////////////////////////////////////////// -// static -///////////////////////////////////////////////////////////////////////////////////////// -//// static - LLSD LLViewerMedia::getHeaders() { LLSD headers = LLSD::emptyMap(); @@ -1151,14 +1162,13 @@ LLSD LLViewerMedia::getHeaders() // *TODO: Should this be 'application/llsd+xml' ? // *TODO: Should this even be set at all? This header is only not overridden in 'GET' methods. headers[HTTP_OUT_HEADER_CONTENT_TYPE] = HTTP_CONTENT_XML; - headers[HTTP_OUT_HEADER_COOKIE] = sOpenIDCookie; + headers[HTTP_OUT_HEADER_COOKIE] = mOpenIDCookie; headers[HTTP_OUT_HEADER_USER_AGENT] = getCurrentUserAgent(); return headers; } ///////////////////////////////////////////////////////////////////////////////////////// - // static bool LLViewerMedia::parseRawCookie(const std::string raw_cookie, std::string& name, std::string& value, std::string& path, bool& httponly, bool& secure) { std::size_t name_pos = raw_cookie.find_first_of("="); @@ -1181,13 +1191,14 @@ bool LLViewerMedia::parseRawCookie(const std::string raw_cookie, std::string& na return false; } +///////////////////////////////////////////////////////////////////////////////////////// LLCore::HttpHeaders::ptr_t LLViewerMedia::getHttpHeaders() { LLCore::HttpHeaders::ptr_t headers(new LLCore::HttpHeaders); headers->append(HTTP_OUT_HEADER_ACCEPT, "*/*"); headers->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_XML); - headers->append(HTTP_OUT_HEADER_COOKIE, sOpenIDCookie); + headers->append(HTTP_OUT_HEADER_COOKIE, mOpenIDCookie); headers->append(HTTP_OUT_HEADER_USER_AGENT, getCurrentUserAgent()); return headers; @@ -1195,10 +1206,9 @@ LLCore::HttpHeaders::ptr_t LLViewerMedia::getHttpHeaders() ///////////////////////////////////////////////////////////////////////////////////////// -// static void LLViewerMedia::setOpenIDCookie(const std::string& url) { - if(!sOpenIDCookie.empty()) + if(!mOpenIDCookie.empty()) { std::string profileUrl = getProfileURL(""); @@ -1207,7 +1217,7 @@ void LLViewerMedia::setOpenIDCookie(const std::string& url) } } -/*static*/ +//static void LLViewerMedia::getOpenIDCookieCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); @@ -1229,7 +1239,7 @@ void LLViewerMedia::getOpenIDCookieCoro(std::string url) // The LLURL can give me the 'authority', which is of the form: [username[:password]@]hostname[:port] // We want just the hostname for the cookie code, but LLURL doesn't seem to have a way to extract that. // We therefore do it here. - std::string authority = sOpenIDURL.mAuthority; + std::string authority = getInstance()->mOpenIDURL.mAuthority; std::string::size_type hostStart = authority.find('@'); if (hostStart == std::string::npos) { // no username/password @@ -1246,7 +1256,8 @@ void LLViewerMedia::getOpenIDCookieCoro(std::string url) { // no port hostEnd = authority.size(); } - + + LLViewerMedia* inst = getInstance(); if (url.length()) { LLMediaCtrl* media_instance = LLFloaterReg::getInstance("destinations")->getChild<LLMediaCtrl>("destination_guide_contents"); @@ -1258,8 +1269,8 @@ void LLViewerMedia::getOpenIDCookieCoro(std::string url) std::string cookie_path = ""; bool httponly = true; bool secure = true; - if (parseRawCookie(sOpenIDCookie, cookie_name, cookie_value, cookie_path, httponly, secure) && - media_instance->getMediaPlugin()) + if (inst->parseRawCookie(inst->mOpenIDCookie, cookie_name, cookie_value, cookie_path, httponly, secure) && + media_instance->getMediaPlugin()) { // MAINT-5711 - inexplicably, the CEF setCookie function will no longer set the cookie if the // url and domain are not the same. This used to be my.sl.com and id.sl.com respectively and worked. @@ -1268,7 +1279,7 @@ void LLViewerMedia::getOpenIDCookieCoro(std::string url) // (Feels like there must be a less dirty way to construct a URL from component LLURL parts) // MAINT-6392 - Rider: Do not change, however, the original URI requested, since it is used further // down. - std::string cefUrl(std::string(sOpenIDURL.mURI) + "://" + std::string(sOpenIDURL.mAuthority)); + std::string cefUrl(std::string(inst->mOpenIDURL.mURI) + "://" + std::string(inst->mOpenIDURL.mAuthority)); media_instance->getMediaPlugin()->setCookie(cefUrl, cookie_name, cookie_value, cookie_host, cookie_path, httponly, secure); } @@ -1281,11 +1292,11 @@ void LLViewerMedia::getOpenIDCookieCoro(std::string url) // Do a web profile get so we can store the cookie httpHeaders->append(HTTP_OUT_HEADER_ACCEPT, "*/*"); - httpHeaders->append(HTTP_OUT_HEADER_COOKIE, sOpenIDCookie); - httpHeaders->append(HTTP_OUT_HEADER_USER_AGENT, getCurrentUserAgent()); + httpHeaders->append(HTTP_OUT_HEADER_COOKIE, inst->mOpenIDCookie); + httpHeaders->append(HTTP_OUT_HEADER_USER_AGENT, inst->getCurrentUserAgent()); LL_DEBUGS("MediaAuth") << "Requesting " << url << LL_ENDL; - LL_DEBUGS("MediaAuth") << "sOpenIDCookie = [" << sOpenIDCookie << "]" << LL_ENDL; + LL_DEBUGS("MediaAuth") << "sOpenIDCookie = [" << inst->mOpenIDCookie << "]" << LL_ENDL; LLSD result = httpAdapter->getRawAndSuspend(httpRequest, url, httpOpts, httpHeaders); @@ -1314,7 +1325,6 @@ void LLViewerMedia::getOpenIDCookieCoro(std::string url) } ///////////////////////////////////////////////////////////////////////////////////////// -// static void LLViewerMedia::openIDSetup(const std::string &openidUrl, const std::string &openidToken) { LL_DEBUGS("MediaAuth") << "url = \"" << openidUrl << "\", token = \"" << openidToken << "\"" << LL_ENDL; @@ -1323,7 +1333,6 @@ void LLViewerMedia::openIDSetup(const std::string &openidUrl, const std::string boost::bind(&LLViewerMedia::openIDSetupCoro, openidUrl, openidToken)); } -/*static*/ void LLViewerMedia::openIDSetupCoro(std::string openidUrl, std::string openidToken) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); @@ -1338,10 +1347,10 @@ void LLViewerMedia::openIDSetupCoro(std::string openidUrl, std::string openidTok // post the token to the url // the responder will need to extract the cookie(s). // Save the OpenID URL for later -- we may need the host when adding the cookie. - sOpenIDURL.init(openidUrl.c_str()); + getInstance()->mOpenIDURL.init(openidUrl.c_str()); // We shouldn't ever do this twice, but just in case this code gets repurposed later, clear existing cookies. - sOpenIDCookie.clear(); + getInstance()->mOpenIDCookie.clear(); httpHeaders->append(HTTP_OUT_HEADER_ACCEPT, "*/*"); httpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, "application/x-www-form-urlencoded"); @@ -1373,24 +1382,22 @@ void LLViewerMedia::openIDSetupCoro(std::string openidUrl, std::string openidTok const std::string& cookie = resultHeaders[HTTP_IN_HEADER_SET_COOKIE].asString(); // *TODO: What about bad status codes? Does this destroy previous cookies? - LLViewerMedia::openIDCookieResponse(openidUrl, cookie); + LLViewerMedia::getInstance()->openIDCookieResponse(openidUrl, cookie); LL_DEBUGS("MediaAuth") << "OpenID cookie set." << LL_ENDL; } ///////////////////////////////////////////////////////////////////////////////////////// -// static void LLViewerMedia::openIDCookieResponse(const std::string& url, const std::string &cookie) { LL_DEBUGS("MediaAuth") << "Cookie received: \"" << cookie << "\"" << LL_ENDL; - sOpenIDCookie += cookie; + mOpenIDCookie += cookie; setOpenIDCookie(url); } ///////////////////////////////////////////////////////////////////////////////////////// -// static void LLViewerMedia::proxyWindowOpened(const std::string &target, const std::string &uuid) { if(uuid.empty()) @@ -1406,7 +1413,6 @@ void LLViewerMedia::proxyWindowOpened(const std::string &target, const std::stri } ///////////////////////////////////////////////////////////////////////////////////////// -// static void LLViewerMedia::proxyWindowClosed(const std::string &uuid) { if(uuid.empty()) @@ -1422,28 +1428,26 @@ void LLViewerMedia::proxyWindowClosed(const std::string &uuid) } ///////////////////////////////////////////////////////////////////////////////////////// -// static void LLViewerMedia::createSpareBrowserMediaSource() { // If we don't have a spare browser media source, create one. // However, if PluginAttachDebuggerToPlugins is set then don't spawn a spare // SLPlugin process in order to not be confused by an unrelated gdb terminal // popping up at the moment we start a media plugin. - if (!sSpareBrowserMediaSource && !gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins")) + if (!mSpareBrowserMediaSource && !gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins")) { // The null owner will keep the browser plugin from fully initializing // (specifically, it keeps LLPluginClassMedia from negotiating a size change, // which keeps MediaPluginWebkit::initBrowserWindow from doing anything until we have some necessary data, like the background color) - sSpareBrowserMediaSource = LLViewerMediaImpl::newSourceFromMediaType(HTTP_CONTENT_TEXT_HTML, NULL, 0, 0, 1.0); + mSpareBrowserMediaSource = LLViewerMediaImpl::newSourceFromMediaType(HTTP_CONTENT_TEXT_HTML, NULL, 0, 0, 1.0); } } ///////////////////////////////////////////////////////////////////////////////////////// -// static LLPluginClassMedia* LLViewerMedia::getSpareBrowserMediaSource() { - LLPluginClassMedia* result = sSpareBrowserMediaSource; - sSpareBrowserMediaSource = NULL; + LLPluginClassMedia* result = mSpareBrowserMediaSource; + mSpareBrowserMediaSource = NULL; return result; }; @@ -1465,50 +1469,24 @@ bool LLViewerMedia::hasInWorldMedia() } ////////////////////////////////////////////////////////////////////////////////////////// -// static bool LLViewerMedia::hasParcelMedia() { - return !LLViewerParcelMedia::getURL().empty(); + return !LLViewerParcelMedia::getInstance()->getURL().empty(); } ////////////////////////////////////////////////////////////////////////////////////////// -// static bool LLViewerMedia::hasParcelAudio() { return !LLViewerMedia::getParcelAudioURL().empty(); } ////////////////////////////////////////////////////////////////////////////////////////// -// static std::string LLViewerMedia::getParcelAudioURL() { return LLViewerParcelMgr::getInstance()->getAgentParcel()->getMusicURL(); } ////////////////////////////////////////////////////////////////////////////////////////// -// static -void LLViewerMedia::initClass() -{ - gIdleCallbacks.addFunction(LLViewerMedia::updateMedia, NULL); - sTeleportFinishConnection = LLViewerParcelMgr::getInstance()-> - setTeleportFinishedCallback(boost::bind(&LLViewerMedia::onTeleportFinished)); -} - -////////////////////////////////////////////////////////////////////////////////////////// -// static -void LLViewerMedia::cleanupClass() -{ - gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL); - sTeleportFinishConnection.disconnect(); - if (sSpareBrowserMediaSource != NULL) - { - delete sSpareBrowserMediaSource; - sSpareBrowserMediaSource = NULL; - } -} - -////////////////////////////////////////////////////////////////////////////////////////// -// static void LLViewerMedia::onTeleportFinished() { // On teleport, clear this setting (i.e. set it to true) @@ -1517,9 +1495,7 @@ void LLViewerMedia::onTeleportFinished() LLViewerMediaImpl::sMimeTypesFailed.clear(); } - ////////////////////////////////////////////////////////////////////////////////////////// -// static void LLViewerMedia::setOnlyAudibleMediaTextureID(const LLUUID& texture_id) { sOnlyAudibleTextureID = texture_id; @@ -1707,11 +1683,11 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ // HACK: we always try to keep a spare running webkit plugin around to improve launch times. // If a spare was already created before PluginAttachDebuggerToPlugins was set, don't use it. - // Do not use a spare if launching with full viewer control (e.g. Facebook, Twitter and few others) + // Do not use a spare if launching with full viewer control (e.g. Twitter and few others) if ((plugin_basename == "media_plugin_cef") && !gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins") && !clean_browser) { - media_source = LLViewerMedia::getSpareBrowserMediaSource(); + media_source = LLViewerMedia::getInstance()->getSpareBrowserMediaSource(); if(media_source) { media_source->setOwner(owner); @@ -1787,7 +1763,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ media_source->enableMediaPluginDebugging( media_plugin_debugging_enabled || clean_browser); // need to set agent string here before instance created - media_source->setBrowserUserAgent(LLViewerMedia::getCurrentUserAgent()); + media_source->setBrowserUserAgent(LLViewerMedia::getInstance()->getCurrentUserAgent()); media_source->setTarget(target); @@ -1858,7 +1834,7 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type) media_source->setDisableTimeout(gSavedSettings.getBOOL("DebugPluginDisableTimeout")); media_source->setLoop(mMediaLoop); media_source->setAutoScale(mMediaAutoScale); - media_source->setBrowserUserAgent(LLViewerMedia::getCurrentUserAgent()); + media_source->setBrowserUserAgent(LLViewerMedia::getInstance()->getCurrentUserAgent()); media_source->focus(mHasFocus); media_source->setBackgroundColor(mBackgroundColor); @@ -1901,21 +1877,8 @@ void LLViewerMediaImpl::loadURI() // trim whitespace from front and back of URL - fixes EXT-5363 LLStringUtil::trim( mMediaURL ); - // *HACK: we don't know if the URI coming in is properly escaped - // (the contract doesn't specify whether it is escaped or not. - // but LLQtWebKit expects it to be, so we do our best to encode - // special characters) - // The strings below were taken right from http://www.ietf.org/rfc/rfc1738.txt - // Note especially that '%' and '/' are there. - std::string uri = LLURI::escape(mMediaURL, - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" - "0123456789" - "$-_.+" - "!*'()," - "{}|\\^~[]`" - "<>#%" - ";/?:@&=", - false); + // URI often comes unescaped + std::string uri = LLURI::escapePathAndData(mMediaURL); { // Do not log the query parts LLURI u(uri); @@ -2104,7 +2067,7 @@ void LLViewerMediaImpl::updateVolume() if(mMediaSource) { // always scale the volume by the global media volume - F32 volume = mRequestedVolume * LLViewerMedia::getVolume(); + F32 volume = mRequestedVolume * LLViewerMedia::getInstance()->getVolume(); if (mProximityCamera > 0) { @@ -3378,7 +3341,7 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla auth_request_params.substitutions = args; auth_request_params.payload = LLSD().with("media_id", mTextureId); - auth_request_params.functor.function = boost::bind(&LLViewerMedia::onAuthSubmit, _1, _2); + auth_request_params.functor.function = boost::bind(&LLViewerMedia::authSubmitCallback, _1, _2); LLNotifications::instance().add(auth_request_params); }; break; diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index e2e758befb..014f9048f0 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -70,11 +70,14 @@ private: class LLViewerMediaImpl; -class LLViewerMedia +class LLViewerMedia: public LLSingleton<LLViewerMedia> { + LLSINGLETON(LLViewerMedia); + ~LLViewerMedia(); + void initSingleton(); LOG_CLASS(LLViewerMedia); + public: - // String to get/set media autoplay in gSavedSettings static const char* AUTO_PLAY_MEDIA_SETTING; static const char* SHOW_MEDIA_ON_OTHERS_SETTING; @@ -88,91 +91,93 @@ public: // Special case early init for just web browser component // so we can show login screen. See .cpp file for details. JC - static viewer_media_t newMediaImpl(const LLUUID& texture_id, + viewer_media_t newMediaImpl(const LLUUID& texture_id, S32 media_width = 0, S32 media_height = 0, U8 media_auto_scale = false, U8 media_loop = false); - static viewer_media_t updateMediaImpl(LLMediaEntry* media_entry, const std::string& previous_url, bool update_from_self); - static LLViewerMediaImpl* getMediaImplFromTextureID(const LLUUID& texture_id); - static std::string getCurrentUserAgent(); - static void updateBrowserUserAgent(); - static bool handleSkinCurrentChanged(const LLSD& /*newvalue*/); - static bool textureHasMedia(const LLUUID& texture_id); - static void setVolume(F32 volume); + viewer_media_t updateMediaImpl(LLMediaEntry* media_entry, const std::string& previous_url, bool update_from_self); + LLViewerMediaImpl* getMediaImplFromTextureID(const LLUUID& texture_id); + std::string getCurrentUserAgent(); + void updateBrowserUserAgent(); + bool handleSkinCurrentChanged(const LLSD& /*newvalue*/); + bool textureHasMedia(const LLUUID& texture_id); + void setVolume(F32 volume); // Is any media currently "showing"? Includes Parcel Media. Does not include media in the UI. - static bool isAnyMediaShowing(); + bool isAnyMediaShowing(); // Shows if any media is playing, counts visible non time based media as playing. Does not include media in the UI. - static bool isAnyMediaPlaying(); + bool isAnyMediaPlaying(); // Set all media enabled or disabled, depending on val. Does not include media in the UI. - static void setAllMediaEnabled(bool val); + void setAllMediaEnabled(bool val); // Set all media paused(stopped for non time based) or playing, depending on val. Does not include media in the UI. - static void setAllMediaPaused(bool val); + void setAllMediaPaused(bool val); - static void updateMedia(void* dummy_arg = NULL); - - static void initClass(); - static void cleanupClass(); - - static F32 getVolume(); - static void muteListChanged(); - static bool isInterestingEnough(const LLVOVolume* object, const F64 &object_interest); + static void onIdle(void* dummy_arg = NULL); // updateMedia wrapper + void updateMedia(void* dummy_arg = NULL); + + F32 getVolume(); + void muteListChanged(); + bool isInterestingEnough(const LLVOVolume* object, const F64 &object_interest); // Returns the priority-sorted list of all media impls. - static impl_list &getPriorityList(); + impl_list &getPriorityList(); // This is the comparitor used to sort the list. static bool priorityComparitor(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2); // These are just helper functions for the convenience of others working with media - static bool hasInWorldMedia(); - static std::string getParcelAudioURL(); - static bool hasParcelMedia(); - static bool hasParcelAudio(); - static bool isParcelMediaPlaying(); - static bool isParcelAudioPlaying(); - - static void onAuthSubmit(const LLSD& notification, const LLSD& response); + bool hasInWorldMedia(); + std::string getParcelAudioURL(); + bool hasParcelMedia(); + bool hasParcelAudio(); + bool isParcelMediaPlaying(); + bool isParcelAudioPlaying(); + + static void authSubmitCallback(const LLSD& notification, const LLSD& response); // Clear all cookies for all plugins - static void clearAllCookies(); + void clearAllCookies(); // Clear all plugins' caches - static void clearAllCaches(); + void clearAllCaches(); // Set the "cookies enabled" flag for all loaded plugins - static void setCookiesEnabled(bool enabled); + void setCookiesEnabled(bool enabled); // Set the proxy config for all loaded plugins - static void setProxyConfig(bool enable, const std::string &host, int port); + void setProxyConfig(bool enable, const std::string &host, int port); - static void openIDSetup(const std::string &openid_url, const std::string &openid_token); - static void openIDCookieResponse(const std::string& url, const std::string &cookie); + void openIDSetup(const std::string &openid_url, const std::string &openid_token); + void openIDCookieResponse(const std::string& url, const std::string &cookie); - static void proxyWindowOpened(const std::string &target, const std::string &uuid); - static void proxyWindowClosed(const std::string &uuid); + void proxyWindowOpened(const std::string &target, const std::string &uuid); + void proxyWindowClosed(const std::string &uuid); - static void createSpareBrowserMediaSource(); - static LLPluginClassMedia* getSpareBrowserMediaSource(); + void createSpareBrowserMediaSource(); + LLPluginClassMedia* getSpareBrowserMediaSource(); - static void setOnlyAudibleMediaTextureID(const LLUUID& texture_id); + void setOnlyAudibleMediaTextureID(const LLUUID& texture_id); - static LLSD getHeaders(); - static LLCore::HttpHeaders::ptr_t getHttpHeaders(); + LLSD getHeaders(); + LLCore::HttpHeaders::ptr_t getHttpHeaders(); private: - static bool parseRawCookie(const std::string raw_cookie, std::string& name, std::string& value, std::string& path, bool& httponly, bool& secure); - static void setOpenIDCookie(const std::string& url); - static void onTeleportFinished(); - - static void openIDSetupCoro(std::string openidUrl, std::string openidToken); - static void getOpenIDCookieCoro(std::string url); - - static LLURL sOpenIDURL; - static std::string sOpenIDCookie; - static LLPluginClassMedia* sSpareBrowserMediaSource; + void onAuthSubmit(const LLSD& notification, const LLSD& response); + bool parseRawCookie(const std::string raw_cookie, std::string& name, std::string& value, std::string& path, bool& httponly, bool& secure); + void setOpenIDCookie(const std::string& url); + void onTeleportFinished(); + + static void openIDSetupCoro(std::string openidUrl, std::string openidToken); + static void getOpenIDCookieCoro(std::string url); + + bool mAnyMediaShowing; + bool mAnyMediaPlaying; + LLURL mOpenIDURL; + std::string mOpenIDCookie; + LLPluginClassMedia* mSpareBrowserMediaSource; + boost::signals2::connection mTeleportFinishConnection; }; // Implementation functions not exported into header file diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp index 59165c1d71..f4a64a8e55 100644 --- a/indra/newview/llviewermediafocus.cpp +++ b/indra/newview/llviewermediafocus.cpp @@ -339,12 +339,12 @@ BOOL LLViewerMediaFocus::handleKey(KEY key, MASK mask, BOOL called_from_parent) clearFocus(); } - if ( KEY_F1 == key && LLUI::sHelpImpl && mMediaControls.get()) + if ( KEY_F1 == key && LLUI::getInstance()->mHelpImpl && mMediaControls.get()) { std::string help_topic; if (mMediaControls.get()->findHelpTopic(help_topic)) { - LLUI::sHelpImpl->showTopic(help_topic); + LLUI::getInstance()->mHelpImpl->showTopic(help_topic); } } } @@ -537,7 +537,7 @@ bool LLViewerMediaFocus::isHoveringOverFace(LLPointer<LLViewerObject> objectp, S LLViewerMediaImpl* LLViewerMediaFocus::getFocusedMediaImpl() { - return LLViewerMedia::getMediaImplFromTextureID(mFocusedImplID); + return LLViewerMedia::getInstance()->getMediaImplFromTextureID(mFocusedImplID); } LLViewerObject* LLViewerMediaFocus::getFocusedObject() @@ -547,7 +547,7 @@ LLViewerObject* LLViewerMediaFocus::getFocusedObject() LLViewerMediaImpl* LLViewerMediaFocus::getHoverMediaImpl() { - return LLViewerMedia::getMediaImplFromTextureID(mHoverImplID); + return LLViewerMedia::getInstance()->getMediaImplFromTextureID(mHoverImplID); } LLViewerObject* LLViewerMediaFocus::getHoverObject() @@ -557,7 +557,7 @@ LLViewerObject* LLViewerMediaFocus::getHoverObject() void LLViewerMediaFocus::focusZoomOnMedia(LLUUID media_id) { - LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(media_id); + LLViewerMediaImpl* impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(media_id); if(impl) { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index ba68ce4cf4..dc82719109 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -54,7 +54,6 @@ #include "lldaycyclemanager.h" #include "lldebugview.h" #include "llenvmanager.h" -#include "llfacebookconnect.h" #include "llfilepicker.h" #include "llfirstuse.h" #include "llfloaterabout.h" @@ -4066,10 +4065,8 @@ void near_sit_down_point(BOOL success, void *) if (success) { gAgent.setFlying(FALSE); + gAgent.clearControlFlags(AGENT_CONTROL_STAND_UP); // might have been set by autopilot gAgent.setControlFlags(AGENT_CONTROL_SIT_ON_GROUND); - - // Might be first sit - //LLFirstUse::useSit(); } } @@ -4754,6 +4751,12 @@ void handle_take() category_id.setNull(); } + // check inbox + const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX); + if (category_id == inbox_id || gInventory.isObjectDescendentOf(category_id, inbox_id)) + { + category_id.setNull(); + } } } if(category_id.isNull()) @@ -6275,7 +6278,7 @@ void dump_inventory(void*) void handle_dump_followcam(void*) { - LLFollowCamMgr::dump(); + LLFollowCamMgr::getInstance()->dump(); } void handle_viewer_enable_message_log(void*) @@ -8653,7 +8656,6 @@ class LLWorldPostProcess : public view_listener_t void handle_flush_name_caches() { - SUBSYSTEM_CLEANUP(LLAvatarNameCache); if (gCacheName) gCacheName->clear(); } @@ -9207,7 +9209,6 @@ void initialize_menus() enable.add("Object.EnableSit", boost::bind(&enable_object_sit, _1)); view_listener_t::addMenu(new LLObjectEnableReturn(), "Object.EnableReturn"); - enable.add("Object.EnableDuplicate", boost::bind(&LLSelectMgr::canDuplicate, LLSelectMgr::getInstance())); view_listener_t::addMenu(new LLObjectEnableReportAbuse(), "Object.EnableReportAbuse"); enable.add("Avatar.EnableMute", boost::bind(&enable_object_mute)); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index e50c8ee9f0..b0ad81614a 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2415,7 +2415,7 @@ void translateSuccess(LLChat chat, LLSD toastArgs, std::string originalMsg, std: && ((detected_language.empty()) || (expectLang != detected_language)) && (LLStringUtil::compareInsensitive(translation, originalMsg) != 0)) { - chat.mText += " (" + translation + ")"; + chat.mText += " (" + LLTranslate::removeNoTranslateTags(translation) + ")"; } LLNotificationsUI::LLNotificationManager::instance().onChat(chat, toastArgs); @@ -4271,7 +4271,7 @@ void process_clear_follow_cam_properties(LLMessageSystem *mesgsys, void **user_d mesgsys->getUUIDFast(_PREHASH_ObjectData, _PREHASH_ObjectID, source_id); - LLFollowCamMgr::removeFollowCamParams(source_id); + LLFollowCamMgr::getInstance()->removeFollowCamParams(source_id); } void process_set_follow_cam_properties(LLMessageSystem *mesgsys, void **user_data) @@ -4303,7 +4303,7 @@ void process_set_follow_cam_properties(LLMessageSystem *mesgsys, void **user_dat switch(type) { case FOLLOWCAM_PITCH: - LLFollowCamMgr::setPitch(source_id, value); + LLFollowCamMgr::getInstance()->setPitch(source_id, value); break; case FOLLOWCAM_FOCUS_OFFSET_X: focus_offset.mV[VX] = value; @@ -4318,29 +4318,29 @@ void process_set_follow_cam_properties(LLMessageSystem *mesgsys, void **user_dat settingFocusOffset = true; break; case FOLLOWCAM_POSITION_LAG: - LLFollowCamMgr::setPositionLag(source_id, value); + LLFollowCamMgr::getInstance()->setPositionLag(source_id, value); break; case FOLLOWCAM_FOCUS_LAG: - LLFollowCamMgr::setFocusLag(source_id, value); + LLFollowCamMgr::getInstance()->setFocusLag(source_id, value); break; case FOLLOWCAM_DISTANCE: - LLFollowCamMgr::setDistance(source_id, value); + LLFollowCamMgr::getInstance()->setDistance(source_id, value); break; case FOLLOWCAM_BEHINDNESS_ANGLE: - LLFollowCamMgr::setBehindnessAngle(source_id, value); + LLFollowCamMgr::getInstance()->setBehindnessAngle(source_id, value); break; case FOLLOWCAM_BEHINDNESS_LAG: - LLFollowCamMgr::setBehindnessLag(source_id, value); + LLFollowCamMgr::getInstance()->setBehindnessLag(source_id, value); break; case FOLLOWCAM_POSITION_THRESHOLD: - LLFollowCamMgr::setPositionThreshold(source_id, value); + LLFollowCamMgr::getInstance()->setPositionThreshold(source_id, value); break; case FOLLOWCAM_FOCUS_THRESHOLD: - LLFollowCamMgr::setFocusThreshold(source_id, value); + LLFollowCamMgr::getInstance()->setFocusThreshold(source_id, value); break; case FOLLOWCAM_ACTIVE: //if 1, set using followcam,. - LLFollowCamMgr::setCameraActive(source_id, value != 0.f); + LLFollowCamMgr::getInstance()->setCameraActive(source_id, value != 0.f); break; case FOLLOWCAM_POSITION_X: settingPosition = true; @@ -4367,10 +4367,10 @@ void process_set_follow_cam_properties(LLMessageSystem *mesgsys, void **user_dat focus.mV[ 2 ] = value; break; case FOLLOWCAM_POSITION_LOCKED: - LLFollowCamMgr::setPositionLocked(source_id, value != 0.f); + LLFollowCamMgr::getInstance()->setPositionLocked(source_id, value != 0.f); break; case FOLLOWCAM_FOCUS_LOCKED: - LLFollowCamMgr::setFocusLocked(source_id, value != 0.f); + LLFollowCamMgr::getInstance()->setFocusLocked(source_id, value != 0.f); break; default: @@ -4380,15 +4380,15 @@ void process_set_follow_cam_properties(LLMessageSystem *mesgsys, void **user_dat if ( settingPosition ) { - LLFollowCamMgr::setPosition(source_id, position); + LLFollowCamMgr::getInstance()->setPosition(source_id, position); } if ( settingFocus ) { - LLFollowCamMgr::setFocus(source_id, focus); + LLFollowCamMgr::getInstance()->setFocus(source_id, focus); } if ( settingFocusOffset ) { - LLFollowCamMgr::setFocusOffset(source_id, focus_offset); + LLFollowCamMgr::getInstance()->setFocusOffset(source_id, focus_offset); } } //end Ventrella @@ -5107,8 +5107,8 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) // save the home location image to disk std::string snap_filename = gDirUtilp->getLindenUserDir(); snap_filename += gDirUtilp->getDirDelimiter(); - snap_filename += SCREEN_HOME_FILENAME; - gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); + snap_filename += LLStartUp::getScreenHomeFilename(); + gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE, LLSnapshotModel::SNAPSHOT_TYPE_COLOR, LLSnapshotModel::SNAPSHOT_FORMAT_PNG); } if (notificationID == "RegionRestartMinutes" || @@ -5190,8 +5190,8 @@ static void process_special_alert_messages(const std::string & message) // save the home location image to disk std::string snap_filename = gDirUtilp->getLindenUserDir(); snap_filename += gDirUtilp->getDirDelimiter(); - snap_filename += SCREEN_HOME_FILENAME; - gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); + snap_filename += LLStartUp::getScreenHomeFilename(); + gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE, LLSnapshotModel::SNAPSHOT_TYPE_COLOR, LLSnapshotModel::SNAPSHOT_FORMAT_PNG); } } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index ec1095813b..c7a77d4d2a 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -482,7 +482,7 @@ void LLViewerObject::markDead() if (flagCameraSource()) { - LLFollowCamMgr::removeFollowCamParams(mID); + LLFollowCamMgr::getInstance()->removeFollowCamParams(mID); } sNumZombieObjects++; @@ -4707,13 +4707,76 @@ void LLViewerObject::sendTEUpdate() const msg->sendReliable( regionp->getHost() ); } +LLViewerTexture* LLViewerObject::getBakedTextureForMagicId(const LLUUID& id) +{ + if (!LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(id)) + { + return NULL; + } + + LLViewerObject *root = getRootEdit(); + if (root && root->isAnimatedObject()) + { + return LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + } + + LLVOAvatar* avatar = getAvatar(); + if (avatar) + { + LLAvatarAppearanceDefines::EBakedTextureIndex texIndex = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::assetIdToBakedTextureIndex(id); + LLViewerTexture* bakedTexture = avatar->getBakedTexture(texIndex); + if (bakedTexture == NULL || bakedTexture->isMissingAsset()) + { + return LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + } + else + { + return bakedTexture; + } + } + else + { + return LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + } + +} + +void LLViewerObject::updateAvatarMeshVisibility(const LLUUID& id, const LLUUID& old_id) +{ + if (id == old_id) + { + return; + } + + if (!LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(old_id) && !LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(id)) + { + return; + } + + LLVOAvatar* avatar = getAvatar(); + if (avatar) + { + avatar->updateMeshVisibility(); + } +} + void LLViewerObject::setTE(const U8 te, const LLTextureEntry &texture_entry) { + LLUUID old_image_id; + if (getTE(te)) + { + old_image_id = getTE(te)->getID(); + } + LLPrimitive::setTE(te, texture_entry); const LLUUID& image_id = getTE(te)->getID(); - mTEImages[te] = LLViewerTextureManager::getFetchedTexture(image_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + LLViewerTexture* bakedTexture = getBakedTextureForMagicId(image_id); + mTEImages[te] = bakedTexture ? bakedTexture : LLViewerTextureManager::getFetchedTexture(image_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + + updateAvatarMeshVisibility(image_id,old_image_id); + if (getTE(te)->getMaterialParams().notNull()) { const LLUUID& norm_id = getTE(te)->getMaterialParams()->getNormalID(); @@ -4724,12 +4787,31 @@ void LLViewerObject::setTE(const U8 te, const LLTextureEntry &texture_entry) } } +void LLViewerObject::refreshBakeTexture() +{ + for (int face_index = 0; face_index < getNumTEs(); face_index++) + { + LLTextureEntry* tex_entry = getTE(face_index); + if (tex_entry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(tex_entry->getID())) + { + const LLUUID& image_id = tex_entry->getID(); + LLViewerTexture* bakedTexture = getBakedTextureForMagicId(image_id); + changeTEImage(face_index, bakedTexture); + } + } +} + void LLViewerObject::setTEImage(const U8 te, LLViewerTexture *imagep) { if (mTEImages[te] != imagep) { - mTEImages[te] = imagep; + LLUUID old_image_id = getTE(te) ? getTE(te)->getID() : LLUUID::null; + LLPrimitive::setTETexture(te, imagep->getID()); + + LLViewerTexture* baked_texture = getBakedTextureForMagicId(imagep->getID()); + mTEImages[te] = baked_texture ? baked_texture : imagep; + updateAvatarMeshVisibility(imagep->getID(), old_image_id); setChanged(TEXTURE); if (mDrawable.notNull()) { @@ -4740,13 +4822,16 @@ void LLViewerObject::setTEImage(const U8 te, LLViewerTexture *imagep) S32 LLViewerObject::setTETextureCore(const U8 te, LLViewerTexture *image) { + LLUUID old_image_id = getTE(te)->getID(); const LLUUID& uuid = image->getID(); S32 retval = 0; if (uuid != getTE(te)->getID() || uuid == LLUUID::null) { retval = LLPrimitive::setTETexture(te, uuid); - mTEImages[te] = image; + LLViewerTexture* baked_texture = getBakedTextureForMagicId(uuid); + mTEImages[te] = baked_texture ? baked_texture : image; + updateAvatarMeshVisibility(uuid,old_image_id); setChanged(TEXTURE); if (mDrawable.notNull()) { @@ -4837,7 +4922,7 @@ S32 LLViewerObject::setTETexture(const U8 te, const LLUUID& uuid) // Invalid host == get from the agent's sim LLViewerFetchedTexture *image = LLViewerTextureManager::getFetchedTexture( uuid, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost()); - return setTETextureCore(te,image); + return setTETextureCore(te, image); } S32 LLViewerObject::setTENormalMap(const U8 te, const LLUUID& uuid) diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 8b1535851e..873b300489 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -588,6 +588,10 @@ public: friend class LLViewerMediaList; public: + LLViewerTexture* getBakedTextureForMagicId(const LLUUID& id); + void updateAvatarMeshVisibility(const LLUUID& id, const LLUUID& old_id); + void refreshBakeTexture(); +public: static void unpackVector3(LLDataPackerBinaryBuffer* dp, LLVector3& value, std::string name); static void unpackUUID(LLDataPackerBinaryBuffer* dp, LLUUID& value, std::string name); static void unpackU32(LLDataPackerBinaryBuffer* dp, U32& value, std::string name); diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 932759c86d..2bf04dc204 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1383,7 +1383,11 @@ BOOL LLViewerObjectList::killObject(LLViewerObject *objectp) if (objectp) { - objectp->markDead(); // does the right thing if object already dead + // We are going to cleanup a lot of smart pointers to this object, they might be last, + // and object being NULLed while inside it's own function won't be pretty + // so create a pointer to make sure object will stay alive untill markDead() finishes + LLPointer<LLViewerObject> sp(objectp); + sp->markDead(); // does the right thing if object already dead return TRUE; } diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index d31fc0d606..b1b5275f82 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -45,31 +45,22 @@ #include "llviewertexture.h" #include "llcorehttputil.h" -// Static Variables -S32 LLViewerParcelMedia::sMediaParcelLocalID = 0; -LLUUID LLViewerParcelMedia::sMediaRegionID; -viewer_media_t LLViewerParcelMedia::sMediaImpl; - - -// static -void LLViewerParcelMedia::initClass() +LLViewerParcelMedia::LLViewerParcelMedia(): +mMediaParcelLocalID(0) { LLMessageSystem* msg = gMessageSystem; - msg->setHandlerFunc("ParcelMediaCommandMessage", processParcelMediaCommandMessage ); - msg->setHandlerFunc("ParcelMediaUpdate", processParcelMediaUpdate ); - LLViewerParcelMediaAutoPlay::initClass(); + msg->setHandlerFunc("ParcelMediaCommandMessage", parcelMediaCommandMessageHandler ); + msg->setHandlerFunc("ParcelMediaUpdate", parcelMediaUpdateHandler ); } -//static -void LLViewerParcelMedia::cleanupClass() +LLViewerParcelMedia::~LLViewerParcelMedia() { // This needs to be destroyed before global destructor time. - sMediaImpl = NULL; + mMediaImpl = NULL; } ////////////////////////////////////////////////////////////////////////////////////////// -// static void LLViewerParcelMedia::update(LLParcel* parcel) { if (/*LLViewerMedia::hasMedia()*/ true) @@ -79,7 +70,7 @@ void LLViewerParcelMedia::update(LLParcel* parcel) { if(!gAgent.getRegion()) { - sMediaRegionID = LLUUID() ; + mMediaRegionID = LLUUID() ; stop() ; LL_DEBUGS("Media") << "no agent region, bailing out." << LL_ENDL; return ; @@ -89,11 +80,11 @@ void LLViewerParcelMedia::update(LLParcel* parcel) S32 parcelid = parcel->getLocalID(); LLUUID regionid = gAgent.getRegion()->getRegionID(); - if (parcelid != sMediaParcelLocalID || regionid != sMediaRegionID) + if (parcelid != mMediaParcelLocalID || regionid != mMediaRegionID) { LL_DEBUGS("Media") << "New parcel, parcel id = " << parcelid << ", region id = " << regionid << LL_ENDL; - sMediaParcelLocalID = parcelid; - sMediaRegionID = regionid; + mMediaParcelLocalID = parcelid; + mMediaRegionID = regionid; } std::string mediaUrl = std::string ( parcel->getMediaURL () ); @@ -108,19 +99,19 @@ void LLViewerParcelMedia::update(LLParcel* parcel) LLStringUtil::trim(mediaUrl); // If no parcel media is playing, nothing left to do - if(sMediaImpl.isNull()) + if(mMediaImpl.isNull()) { return; } // Media is playing...has something changed? - else if (( sMediaImpl->getMediaURL() != mediaUrl ) - || ( sMediaImpl->getMediaTextureID() != parcel->getMediaID() ) - || ( sMediaImpl->getMimeType() != parcel->getMediaType() )) + else if (( mMediaImpl->getMediaURL() != mediaUrl ) + || ( mMediaImpl->getMediaTextureID() != parcel->getMediaID() ) + || ( mMediaImpl->getMimeType() != parcel->getMediaType() )) { // Only play if the media types are the same. - if(sMediaImpl->getMimeType() == parcel->getMediaType()) + if(mMediaImpl->getMimeType() == parcel->getMediaType()) { play(parcel); } @@ -176,30 +167,30 @@ void LLViewerParcelMedia::play(LLParcel* parcel) S32 media_width = parcel->getMediaWidth(); S32 media_height = parcel->getMediaHeight(); - if(sMediaImpl) + if(mMediaImpl) { // If the url and mime type are the same, call play again - if(sMediaImpl->getMediaURL() == media_url - && sMediaImpl->getMimeType() == mime_type - && sMediaImpl->getMediaTextureID() == placeholder_texture_id) + if(mMediaImpl->getMediaURL() == media_url + && mMediaImpl->getMimeType() == mime_type + && mMediaImpl->getMediaTextureID() == placeholder_texture_id) { LL_DEBUGS("Media") << "playing with existing url " << media_url << LL_ENDL; - sMediaImpl->play(); + mMediaImpl->play(); } // Else if the texture id's are the same, navigate and rediscover type // MBW -- This causes other state from the previous parcel (texture size, autoscale, and looping) to get re-used incorrectly. // It's also not really necessary -- just creating a new instance is fine. -// else if(sMediaImpl->getMediaTextureID() == placeholder_texture_id) +// else if(mMediaImpl->getMediaTextureID() == placeholder_texture_id) // { -// sMediaImpl->navigateTo(media_url, mime_type, true); +// mMediaImpl->navigateTo(media_url, mime_type, true); // } else { // Since the texture id is different, we need to generate a new impl // Delete the old one first so they don't fight over the texture. - sMediaImpl = NULL; + mMediaImpl = NULL; // A new impl will be created below. } @@ -208,19 +199,19 @@ void LLViewerParcelMedia::play(LLParcel* parcel) // Don't ever try to play if the media type is set to "none/none" if(stricmp(mime_type.c_str(), LLMIMETypes::getDefaultMimeType().c_str()) != 0) { - if(!sMediaImpl) + if(!mMediaImpl) { LL_DEBUGS("Media") << "new media impl with mime type " << mime_type << ", url " << media_url << LL_ENDL; // There is no media impl, make a new one - sMediaImpl = LLViewerMedia::newMediaImpl( + mMediaImpl = LLViewerMedia::getInstance()->newMediaImpl( placeholder_texture_id, media_width, media_height, media_auto_scale, media_loop); - sMediaImpl->setIsParcelMedia(true); - sMediaImpl->navigateTo(media_url, mime_type, true); + mMediaImpl->setIsParcelMedia(true); + mMediaImpl->navigateTo(media_url, mime_type, true); } //LLFirstUse::useMedia(); @@ -232,7 +223,7 @@ void LLViewerParcelMedia::play(LLParcel* parcel) // static void LLViewerParcelMedia::stop() { - if(sMediaImpl.isNull()) + if(mMediaImpl.isNull()) { return; } @@ -241,27 +232,27 @@ void LLViewerParcelMedia::stop() LLViewerMediaFocus::getInstance()->clearFocus(); // This will unload & kill the media instance. - sMediaImpl = NULL; + mMediaImpl = NULL; } // static void LLViewerParcelMedia::pause() { - if(sMediaImpl.isNull()) + if(mMediaImpl.isNull()) { return; } - sMediaImpl->pause(); + mMediaImpl->pause(); } // static void LLViewerParcelMedia::start() { - if(sMediaImpl.isNull()) + if(mMediaImpl.isNull()) { return; } - sMediaImpl->start(); + mMediaImpl->start(); //LLFirstUse::useMedia(); @@ -271,17 +262,17 @@ void LLViewerParcelMedia::start() // static void LLViewerParcelMedia::seek(F32 time) { - if(sMediaImpl.isNull()) + if(mMediaImpl.isNull()) { return; } - sMediaImpl->seek(time); + mMediaImpl->seek(time); } // static void LLViewerParcelMedia::focus(bool focus) { - sMediaImpl->focus(focus); + mMediaImpl->focus(focus); } // static @@ -289,9 +280,9 @@ LLPluginClassMediaOwner::EMediaStatus LLViewerParcelMedia::getStatus() { LLPluginClassMediaOwner::EMediaStatus result = LLPluginClassMediaOwner::MEDIA_NONE; - if(sMediaImpl.notNull() && sMediaImpl->hasMedia()) + if(mMediaImpl.notNull() && mMediaImpl->hasMedia()) { - result = sMediaImpl->getMediaPlugin()->getStatus(); + result = mMediaImpl->getMediaPlugin()->getStatus(); } return result; @@ -300,15 +291,15 @@ LLPluginClassMediaOwner::EMediaStatus LLViewerParcelMedia::getStatus() // static std::string LLViewerParcelMedia::getMimeType() { - return sMediaImpl.notNull() ? sMediaImpl->getMimeType() : LLMIMETypes::getDefaultMimeType(); + return mMediaImpl.notNull() ? mMediaImpl->getMimeType() : LLMIMETypes::getDefaultMimeType(); } //static std::string LLViewerParcelMedia::getURL() { std::string url; - if(sMediaImpl.notNull()) - url = sMediaImpl->getMediaURL(); + if(mMediaImpl.notNull()) + url = mMediaImpl->getMediaURL(); if(stricmp(LLViewerParcelMgr::getInstance()->getAgentParcel()->getMediaType().c_str(), LLMIMETypes::getDefaultMimeType().c_str()) != 0) { @@ -325,19 +316,24 @@ std::string LLViewerParcelMedia::getURL() //static std::string LLViewerParcelMedia::getName() { - if(sMediaImpl.notNull()) - return sMediaImpl->getName(); + if(mMediaImpl.notNull()) + return mMediaImpl->getName(); return ""; } viewer_media_t LLViewerParcelMedia::getParcelMedia() { - return sMediaImpl; + return mMediaImpl; } ////////////////////////////////////////////////////////////////////////////////////////// // static -void LLViewerParcelMedia::processParcelMediaCommandMessage( LLMessageSystem *msg, void ** ) +void LLViewerParcelMedia::parcelMediaCommandMessageHandler(LLMessageSystem *msg, void **) +{ + getInstance()->processParcelMediaCommandMessage(msg); +} + +void LLViewerParcelMedia::processParcelMediaCommandMessage( LLMessageSystem *msg) { // extract the agent id // LLUUID agent_id; @@ -392,7 +388,7 @@ void LLViewerParcelMedia::processParcelMediaCommandMessage( LLMessageSystem *msg if (flags & (1<<PARCEL_MEDIA_COMMAND_TIME)) { - if(sMediaImpl.isNull()) + if(mMediaImpl.isNull()) { LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); play(parcel); @@ -403,7 +399,12 @@ void LLViewerParcelMedia::processParcelMediaCommandMessage( LLMessageSystem *msg ////////////////////////////////////////////////////////////////////////////////////////// // static -void LLViewerParcelMedia::processParcelMediaUpdate( LLMessageSystem *msg, void ** ) +void LLViewerParcelMedia::parcelMediaUpdateHandler(LLMessageSystem *msg, void **) +{ + getInstance()->processParcelMediaUpdate(msg); +} + +void LLViewerParcelMedia::processParcelMediaUpdate( LLMessageSystem *msg) { LLUUID media_id; std::string media_url; diff --git a/indra/newview/llviewerparcelmedia.h b/indra/newview/llviewerparcelmedia.h index 534f65b419..779a65bdf8 100644 --- a/indra/newview/llviewerparcelmedia.h +++ b/indra/newview/llviewerparcelmedia.h @@ -37,50 +37,53 @@ class LLViewerParcelMediaNavigationObserver; // This class understands land parcels, network traffic, LSL media // transport commands, and talks to the LLViewerMedia class to actually // do playback. It allows us to remove code from LLViewerParcelMgr. -class LLViewerParcelMedia : public LLViewerMediaObserver +class LLViewerParcelMedia : public LLViewerMediaObserver, public LLSingleton<LLViewerParcelMedia> { + LLSINGLETON(LLViewerParcelMedia); + ~LLViewerParcelMedia(); LOG_CLASS(LLViewerParcelMedia); - public: - static void initClass(); - static void cleanupClass(); - - static void update(LLParcel* parcel); - // called when the agent's parcel has a new URL, or the agent has - // walked on to a new parcel with media - - static void play(LLParcel* parcel); - // user clicked play button in media transport controls - - static void stop(); - // user clicked stop button in media transport controls - - static void pause(); - static void start(); - // restart after pause - no need for all the setup - - static void focus(bool focus); - - static void seek(F32 time); - // jump to timecode time - - static LLPluginClassMediaOwner::EMediaStatus getStatus(); - static std::string getMimeType(); - static std::string getURL(); - static std::string getName(); - static viewer_media_t getParcelMedia(); - - static void processParcelMediaCommandMessage( LLMessageSystem *msg, void ** ); - static void processParcelMediaUpdate( LLMessageSystem *msg, void ** ); - static void sendMediaNavigateMessage(const std::string& url); - - // inherited from LLViewerMediaObserver - virtual void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); - - public: - static S32 sMediaParcelLocalID; - static LLUUID sMediaRegionID; - // HACK: this will change with Media on a Prim - static viewer_media_t sMediaImpl; +public: + void update(LLParcel* parcel); + // called when the agent's parcel has a new URL, or the agent has + // walked on to a new parcel with media + + void play(LLParcel* parcel); + // user clicked play button in media transport controls + + void stop(); + // user clicked stop button in media transport controls + + void pause(); + void start(); + // restart after pause - no need for all the setup + + void focus(bool focus); + + void seek(F32 time); + // jump to timecode time + + LLPluginClassMediaOwner::EMediaStatus getStatus(); + std::string getMimeType(); + std::string getURL(); + std::string getName(); + viewer_media_t getParcelMedia(); + bool hasParcelMedia() { return mMediaImpl.notNull(); } + + static void parcelMediaCommandMessageHandler( LLMessageSystem *msg, void ** ); + static void parcelMediaUpdateHandler( LLMessageSystem *msg, void ** ); + void sendMediaNavigateMessage(const std::string& url); + + // inherited from LLViewerMediaObserver + virtual void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); + +private: + void processParcelMediaCommandMessage(LLMessageSystem *msg); + void processParcelMediaUpdate(LLMessageSystem *msg); + + S32 mMediaParcelLocalID; + LLUUID mMediaRegionID; + // HACK: this will change with Media on a Prim + viewer_media_t mMediaImpl; }; diff --git a/indra/newview/llviewerparcelmediaautoplay.cpp b/indra/newview/llviewerparcelmediaautoplay.cpp index 57ee583eae..b5a76ccba2 100644 --- a/indra/newview/llviewerparcelmediaautoplay.cpp +++ b/indra/newview/llviewerparcelmediaautoplay.cpp @@ -51,29 +51,10 @@ LLViewerParcelMediaAutoPlay::LLViewerParcelMediaAutoPlay() : { } -static LLViewerParcelMediaAutoPlay *sAutoPlay = NULL; - -// static -void LLViewerParcelMediaAutoPlay::initClass() -{ - if (!sAutoPlay) - sAutoPlay = new LLViewerParcelMediaAutoPlay; -} - -// static -void LLViewerParcelMediaAutoPlay::cleanupClass() -{ - if (sAutoPlay) - delete sAutoPlay; -} - // static void LLViewerParcelMediaAutoPlay::playStarted() { - if (sAutoPlay) - { - sAutoPlay->mPlayed = TRUE; - } + LLSingleton<LLViewerParcelMediaAutoPlay>::getInstance()->mPlayed = TRUE; } BOOL LLViewerParcelMediaAutoPlay::tick() @@ -122,7 +103,7 @@ BOOL LLViewerParcelMediaAutoPlay::tick() (mTimeInParcel > AUTOPLAY_TIME) && // and if we've been here for so many seconds (!this_media_url.empty()) && // and if the parcel has media (stricmp(this_media_type.c_str(), LLMIMETypes::getDefaultMimeType().c_str()) != 0) && - (LLViewerParcelMedia::sMediaImpl.isNull())) // and if the media is not already playing + (!LLViewerParcelMedia::getInstance()->hasParcelMedia())) // and if the media is not already playing { if (this_media_texture_id.notNull()) // and if the media texture is good { @@ -144,7 +125,7 @@ BOOL LLViewerParcelMediaAutoPlay::tick() if (gSavedSettings.getBOOL("ParcelMediaAutoPlayEnable")) { // and last but not least, only play when autoplay is enabled - LLViewerParcelMedia::play(this_parcel); + LLViewerParcelMedia::getInstance()->play(this_parcel); } } diff --git a/indra/newview/llviewerparcelmediaautoplay.h b/indra/newview/llviewerparcelmediaautoplay.h index a052362829..33565307f2 100644 --- a/indra/newview/llviewerparcelmediaautoplay.h +++ b/indra/newview/llviewerparcelmediaautoplay.h @@ -31,13 +31,11 @@ #include "lluuid.h" // timer to automatically play media -class LLViewerParcelMediaAutoPlay : LLEventTimer +class LLViewerParcelMediaAutoPlay : LLEventTimer, public LLSingleton<LLViewerParcelMediaAutoPlay> { - public: - LLViewerParcelMediaAutoPlay(); + LLSINGLETON(LLViewerParcelMediaAutoPlay); +public: virtual BOOL tick(); - static void initClass(); - static void cleanupClass(); static void playStarted(); private: diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 416d5d8e2e..6cc88d0c0b 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1822,7 +1822,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use else { // Check for video - LLViewerParcelMedia::update(parcel); + LLViewerParcelMedia::getInstance()->update(parcel); // Then check for music if (gAudiop) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 4d9288f152..5b227c641b 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -2895,7 +2895,6 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("EstateAccess"); capabilityNames.append("EstateChangeInfo"); capabilityNames.append("EventQueueGet"); - capabilityNames.append("FacebookConnect"); capabilityNames.append("FlickrConnect"); capabilityNames.append("TwitterConnect"); @@ -3235,6 +3234,12 @@ bool LLViewerRegion::meshUploadEnabled() const mSimulatorFeatures["MeshUploadEnabled"].asBoolean()); } +bool LLViewerRegion::bakesOnMeshEnabled() const +{ + return (mSimulatorFeatures.has("BakesOnMeshEnabled") && + mSimulatorFeatures["BakesOnMeshEnabled"].asBoolean()); +} + bool LLViewerRegion::meshRezEnabled() const { return (mSimulatorFeatures.has("MeshRezEnabled") && diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index d5266ec873..2548ff1423 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -304,6 +304,8 @@ public: bool meshRezEnabled() const; bool meshUploadEnabled() const; + bool bakesOnMeshEnabled() const; + // has region received its simulator features list? Requires an additional query after caps received. void requestSimulatorFeatures(); void setSimulatorFeaturesReceived(bool); diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp index 66e5742911..7f7d190b92 100644 --- a/indra/newview/llviewertexlayer.cpp +++ b/indra/newview/llviewertexlayer.cpp @@ -58,6 +58,8 @@ LLViewerTexLayerSetBuffer::LLViewerTexLayerSetBuffer(LLTexLayerSet* const owner, mNeedsUpdate(TRUE), mNumLowresUpdates(0) { + mGLTexturep->setNeedsAlphaAndPickMask(FALSE); + LLViewerTexLayerSetBuffer::sGLByteCount += getSize(); mNeedsUpdateTimer.start(); } diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 7d2d6e25c7..0e181bf53d 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -239,7 +239,7 @@ public: /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) { - LLUI::getWindow()->setCursor(UI_CURSOR_HAND); + LLUI::getInstance()->getWindow()->setCursor(UI_CURSOR_HAND); return TRUE; } virtual BOOL handleToolTip(S32 x, S32 y, MASK mask ) diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 68a9994bee..305f891a86 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1219,6 +1219,7 @@ void LLViewerFetchedTexture::loadFromFastCache() F32 cachReadTime = fastCacheTimer.getElapsedTimeF32(); add(LLTextureFetch::sCacheHit, 1.0); + record(LLTextureFetch::sCacheHitRate, LLUnits::Ratio::fromValue(1)); sample(LLTextureFetch::sCacheReadLatency, cachReadTime); mFullWidth = mRawImage->getWidth() << mRawDiscardLevel; @@ -1251,6 +1252,10 @@ void LLViewerFetchedTexture::loadFromFastCache() addToCreateTexture(); } } + else + { + record(LLTextureFetch::sCacheHitRate, LLUnits::Ratio::fromValue(0)); + } } void LLViewerFetchedTexture::setForSculpt() @@ -3454,7 +3459,7 @@ void LLViewerMediaTexture::setMediaImpl() { if(!mMediaImplp) { - mMediaImplp = LLViewerMedia::getMediaImplFromTextureID(mID); + mMediaImplp = LLViewerMedia::getInstance()->getMediaImplFromTextureID(mID); } } @@ -3675,9 +3680,9 @@ void LLViewerMediaTexture::removeFace(U32 ch, LLFace* facep) } } - if(te && te->getID().notNull()) //should have a texture + if(te && te->getID().notNull()) //should have a texture but none found { - LL_ERRS() << "mTextureList texture reference number is corrupted." << LL_ENDL; + LL_ERRS() << "mTextureList texture reference number is corrupted. Texture id: " << te->getID() << " List size: " << (U32)mTextureList.size() << LL_ENDL; } } diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 4308405c64..06524847d1 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -512,7 +512,7 @@ LLViewerFetchedTexture* LLViewerTextureList::getImage(const LLUUID &image_id, if (boost_priority != LLViewerTexture::BOOST_ALM && imagep->getBoostLevel() == LLViewerTexture::BOOST_ALM) { // Workaround: we need BOOST_ALM texture for something, 'rise' to NONE - imagep->setDecodePriority(LLViewerTexture::BOOST_NONE); + imagep->setBoostLevel(LLViewerTexture::BOOST_NONE); } LLViewerFetchedTexture *texture = imagep.get(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index e4f3b9bae4..61f4ee463d 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -122,7 +122,7 @@ #include "llhudmanager.h" #include "llhudobject.h" #include "llhudview.h" -#include "llimagebmp.h" +#include "llimage.h" #include "llimagej2c.h" #include "llimageworker.h" #include "llkeyboard.h" @@ -960,7 +960,7 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mWindow->releaseMouse(); // Indicate mouse was active - LLUI::resetMouseIdleTimer(); + LLUI::getInstance()->resetMouseIdleTimer(); // Don't let the user move the mouse out of the window until mouse up. if( LLToolMgr::getInstance()->getCurrentTool()->clipMouseWhenDown() ) @@ -1295,7 +1295,7 @@ void LLViewerWindow::handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask if (mouse_point != mCurrentMousePoint) { - LLUI::resetMouseIdleTimer(); + LLUI::getInstance()->resetMouseIdleTimer(); } saveLastMouse(mouse_point); @@ -1796,8 +1796,6 @@ LLViewerWindow::LLViewerWindow(const Params& p) // LL_DEBUGS("Window") << "Loading feature tables." << LL_ENDL; - LLFeatureManager::getInstance()->init(); - // Initialize OpenGL Renderer if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") || !gGLManager.mHasVertexBufferObject) @@ -1852,7 +1850,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) rvp.mouse_opaque(false); rvp.follows.flags(FOLLOWS_NONE); mRootView = LLUICtrlFactory::create<LLRootView>(rvp); - LLUI::setRootView(mRootView); + LLUI::getInstance()->setRootView(mRootView); // Make avatar head look forward at start mCurrentMousePoint.mX = getWindowWidthScaled() / 2; @@ -2410,7 +2408,7 @@ void LLViewerWindow::setNormalControlsVisible( BOOL visible ) gStatusBar->setEnabled( visible ); } - LLNavigationBar* navbarp = LLUI::getRootView()->findChild<LLNavigationBar>("navigation_bar"); + LLNavigationBar* navbarp = LLUI::getInstance()->getRootView()->findChild<LLNavigationBar>("navigation_bar"); if (navbarp) { // when it's time to show navigation bar we need to ensure that the user wants to see it @@ -2520,7 +2518,7 @@ void LLViewerWindow::draw() if (!gSavedSettings.getBOOL("RenderUIBuffer")) { - LLUI::sDirtyRect = getWindowRectScaled(); + LLUI::getInstance()->mDirtyRect = getWindowRectScaled(); } // HACK for timecode debugging @@ -2920,7 +2918,7 @@ BOOL LLViewerWindow::handleUnicodeChar(llwchar uni_char, MASK mask) void LLViewerWindow::handleScrollWheel(S32 clicks) { - LLUI::resetMouseIdleTimer(); + LLUI::getInstance()->resetMouseIdleTimer(); LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); if( mouse_captor ) @@ -2999,7 +2997,7 @@ void LLViewerWindow::moveCursorToCenter() S32 x = getWorldViewWidthScaled() / 2; S32 y = getWorldViewHeightScaled() / 2; - LLUI::setMousePositionScreen(x, y); + LLUI::getInstance()->setMousePositionScreen(x, y); //on a forced move, all deltas get zeroed out to prevent jumping mCurrentMousePoint.set(x,y); @@ -3819,7 +3817,7 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, BOOL draw_handles = TRUE; - if (tool == LLToolCompTranslate::getInstance() && !all_selected_objects_move) + if (tool == LLToolCompTranslate::getInstance() && !all_selected_objects_move && !LLSelectMgr::getInstance()->isSelfAvatarSelected()) { draw_handles = FALSE; } @@ -4487,32 +4485,46 @@ void LLViewerWindow::movieSize(S32 new_width, S32 new_height) } } -BOOL LLViewerWindow::saveSnapshot(const std::string& filepath, S32 image_width, S32 image_height, BOOL show_ui, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type) +BOOL LLViewerWindow::saveSnapshot(const std::string& filepath, S32 image_width, S32 image_height, BOOL show_ui, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type, LLSnapshotModel::ESnapshotFormat format) { - LL_INFOS() << "Saving snapshot to: " << filepath << LL_ENDL; + LL_INFOS() << "Saving snapshot to: " << filepath << LL_ENDL; - LLPointer<LLImageRaw> raw = new LLImageRaw; - BOOL success = rawSnapshot(raw, image_width, image_height, TRUE, FALSE, show_ui, do_rebuild); + LLPointer<LLImageRaw> raw = new LLImageRaw; + BOOL success = rawSnapshot(raw, image_width, image_height, TRUE, FALSE, show_ui, do_rebuild); - if (success) - { - LLPointer<LLImageBMP> bmp_image = new LLImageBMP; - success = bmp_image->encode(raw, 0.0f); - if( success ) - { - success = bmp_image->save(filepath); - } - else - { - LL_WARNS() << "Unable to encode bmp snapshot" << LL_ENDL; - } - } - else - { - LL_WARNS() << "Unable to capture raw snapshot" << LL_ENDL; - } + if (success) + { + U8 image_codec = IMG_CODEC_BMP; + switch (format) + { + case LLSnapshotModel::SNAPSHOT_FORMAT_PNG: + image_codec = IMG_CODEC_PNG; + break; + case LLSnapshotModel::SNAPSHOT_FORMAT_JPEG: + image_codec = IMG_CODEC_JPEG; + break; + default: + image_codec = IMG_CODEC_BMP; + break; + } - return success; + LLPointer<LLImageFormatted> formated_image = LLImageFormatted::createFromType(image_codec); + success = formated_image->encode(raw, 0.0f); + if (success) + { + success = formated_image->save(filepath); + } + else + { + LL_WARNS() << "Unable to encode snapshot of format " << format << LL_ENDL; + } + } + else + { + LL_WARNS() << "Unable to capture raw snapshot" << LL_ENDL; + } + + return success; } @@ -4734,6 +4746,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei { // Required for showing the GUI in snapshots and performing bloom composite overlay // Call even if show_ui is FALSE + LL_RECORD_BLOCK_TIME(FTM_RENDER_UI); render_ui(scale_factor, subfield); swap(); } diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index d41a606f11..071a3632dd 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -347,7 +347,7 @@ public: // snapshot functionality. // perhaps some of this should move to llfloatershapshot? -MG - BOOL saveSnapshot(const std::string& filename, S32 image_width, S32 image_height, BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, LLSnapshotModel::ESnapshotLayerType type = LLSnapshotModel::SNAPSHOT_TYPE_COLOR); + BOOL saveSnapshot(const std::string& filename, S32 image_width, S32 image_height, BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, LLSnapshotModel::ESnapshotLayerType type = LLSnapshotModel::SNAPSHOT_TYPE_COLOR, LLSnapshotModel::ESnapshotFormat format = LLSnapshotModel::SNAPSHOT_FORMAT_BMP); BOOL rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_height, BOOL keep_window_aspect = TRUE, BOOL is_texture = FALSE, BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, LLSnapshotModel::ESnapshotLayerType type = LLSnapshotModel::SNAPSHOT_TYPE_COLOR, S32 max_size = MAX_SNAPSHOT_IMAGE_SIZE); BOOL thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type); diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp index c4430f4308..c63c5f6b23 100644 --- a/indra/newview/llvlcomposition.cpp +++ b/indra/newview/llvlcomposition.cpp @@ -99,6 +99,8 @@ void LLVLComposition::setDetailTextureID(S32 corner, const LLUUID& id) { return; } + // This is terrain texture, but we are not setting it as BOOST_TERRAIN + // since we will be manipulating it later as needed. mDetailTextures[corner] = LLViewerTextureManager::getFetchedTexture(id); mDetailTextures[corner]->setNoDelete() ; mRawImages[corner] = NULL; @@ -241,6 +243,7 @@ BOOL LLVLComposition::generateComposition() } mDetailTextures[i]->setBoostLevel(LLGLTexture::BOOST_TERRAIN); // in case we are at low detail mDetailTextures[i]->setMinDiscardLevel(ddiscard); + mDetailTextures[i]->addTextureStats(BASE_SIZE*BASE_SIZE); // priority return FALSE; } } @@ -287,7 +290,7 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y, { mDetailTextures[i]->destroyRawImage() ; } - LL_DEBUGS() << "cached raw data for terrain detail texture is not ready yet: " << mDetailTextures[i]->getID() << LL_ENDL; + LL_DEBUGS("Terrain") << "cached raw data for terrain detail texture is not ready yet: " << mDetailTextures[i]->getID() << " Discard: " << ddiscard << LL_ENDL; return FALSE; } @@ -323,12 +326,12 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y, if (x_end > mWidth) { - LL_WARNS() << "x end > width" << LL_ENDL; + LL_WARNS("Terrain") << "x end > width" << LL_ENDL; x_end = mWidth; } if (y_end > mWidth) { - LL_WARNS() << "y end > width" << LL_ENDL; + LL_WARNS("Terrain") << "y end > width" << LL_ENDL; y_end = mWidth; } @@ -358,7 +361,7 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y, if (tex_comps != st_comps) { - LL_WARNS() << "Base texture comps != input texture comps" << LL_ENDL; + LL_WARNS("Terrain") << "Base texture comps != input texture comps" << LL_ENDL; return FALSE; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 20fa327790..ca1216b89d 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -751,8 +751,8 @@ std::string LLVOAvatar::avString() const } else { - std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus()); - return " Avatar '" + getFullname() + "' " + viz_string + " "; + std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus()); + return " Avatar '" + getFullname() + "' " + viz_string + " "; } } @@ -829,7 +829,8 @@ BOOL LLVOAvatar::isFullyBaked() for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { if (!isTextureDefined(mBakedTextureDatas[i].mTextureIndex) - && ( (i != BAKED_SKIRT) || isWearingWearableType(LLWearableType::WT_SKIRT) ) ) + && ((i != BAKED_SKIRT) || isWearingWearableType(LLWearableType::WT_SKIRT)) + && (i != BAKED_LEFT_ARM) && (i != BAKED_LEFT_LEG) && (i != BAKED_AUX1) && (i != BAKED_AUX2) && (i != BAKED_AUX3)) { return FALSE; } @@ -1322,7 +1323,7 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) if (dist_vec(zero_pos, mPelvisp->getWorldPosition())<0.001) { // Don't use pelvis until av initialized - pos.load3(getRenderPosition().mV); + pos.load3(getRenderPosition().mV); } else { @@ -1336,16 +1337,16 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) //displayed, can give inaccurate boxes due to joints stuck at (0,0,0). if ((box_detail>=1) && !isControlAvatar()) { - for (polymesh_map_t::iterator i = mPolyMeshes.begin(); i != mPolyMeshes.end(); ++i) - { - LLPolyMesh* mesh = i->second; - for (S32 joint_num = 0; joint_num < mesh->mJointRenderData.size(); joint_num++) - { - LLVector4a trans; - trans.load3( mesh->mJointRenderData[joint_num]->mWorldMatrix->getTranslation().mV); - update_min_max(newMin, newMax, trans); - } - } + for (polymesh_map_t::iterator i = mPolyMeshes.begin(); i != mPolyMeshes.end(); ++i) + { + LLPolyMesh* mesh = i->second; + for (S32 joint_num = 0; joint_num < mesh->mJointRenderData.size(); joint_num++) + { + LLVector4a trans; + trans.load3( mesh->mJointRenderData[joint_num]->mWorldMatrix->getTranslation().mV); + update_min_max(newMin, newMax, trans); + } + } } @@ -1362,22 +1363,22 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) { float max_attachment_span = get_default_max_prim_scale() * 5.0f; - for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); - ++iter) - { - LLViewerJointAttachment* attachment = iter->second; + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); + ++iter) + { + LLViewerJointAttachment* attachment = iter->second; - if (attachment->getValid()) - { - for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); - attachment_iter != attachment->mAttachedObjects.end(); - ++attachment_iter) - { + if (attachment->getValid()) + { + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) + { // Don't we need to look at children of attached_object as well? - const LLViewerObject* attached_object = (*attachment_iter); - if (attached_object && !attached_object->isHUDAttachment()) - { + const LLViewerObject* attached_object = (*attachment_iter); + if (attached_object && !attached_object->isHUDAttachment()) + { const LLVOVolume *vol = dynamic_cast<const LLVOVolume*>(attached_object); if (vol && vol->isAnimatedObject()) { @@ -1399,33 +1400,33 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) { continue; } - LLDrawable* drawable = attached_object->mDrawable; - if (drawable && !drawable->isState(LLDrawable::RIGGED)) - { - LLSpatialBridge* bridge = drawable->getSpatialBridge(); - if (bridge) - { - const LLVector4a* ext = bridge->getSpatialExtents(); - LLVector4a distance; - distance.setSub(ext[1], ext[0]); - LLVector4a max_span(max_attachment_span); + LLDrawable* drawable = attached_object->mDrawable; + if (drawable && !drawable->isState(LLDrawable::RIGGED)) + { + LLSpatialBridge* bridge = drawable->getSpatialBridge(); + if (bridge) + { + const LLVector4a* ext = bridge->getSpatialExtents(); + LLVector4a distance; + distance.setSub(ext[1], ext[0]); + LLVector4a max_span(max_attachment_span); - S32 lt = distance.lessThan(max_span).getGatheredBits() & 0x7; + S32 lt = distance.lessThan(max_span).getGatheredBits() & 0x7; - // Only add the prim to spatial extents calculations if it isn't a megaprim. - // max_attachment_span calculated at the start of the function - // (currently 5 times our max prim size) - if (lt == 0x7) - { - update_min_max(newMin,newMax,ext[0]); - update_min_max(newMin,newMax,ext[1]); - } - } - } - } - } - } - } + // Only add the prim to spatial extents calculations if it isn't a megaprim. + // max_attachment_span calculated at the start of the function + // (currently 5 times our max prim size) + if (lt == 0x7) + { + update_min_max(newMin,newMax,ext[0]); + update_min_max(newMin,newMax,ext[1]); + } + } + } + } + } + } + } } // Stretch bounding box by rigged mesh joint boxes @@ -1949,7 +1950,7 @@ void LLVOAvatar::buildCharacter() // Currently disabled for control avatars (animated objects), enabled for all others. if (mEnableDefaultMotions) { - startDefaultMotions(); + startDefaultMotions(); } //------------------------------------------------------------------------- @@ -2066,8 +2067,8 @@ void LLVOAvatar::resetSkeleton(bool reset_animations) // Reset tweakable params to preserved state if (mLastProcessedAppearance) { - bool slam_params = true; - applyParsedAppearanceMessage(*mLastProcessedAppearance, slam_params); + bool slam_params = true; + applyParsedAppearanceMessage(*mLastProcessedAppearance, slam_params); } updateVisualParams(); @@ -2119,15 +2120,15 @@ void LLVOAvatar::releaseMeshData() LLFace* facep = mDrawable->getFace(0); if (facep) { - facep->setSize(0, 0); - for(S32 i = mNumInitFaces ; i < mDrawable->getNumFaces(); i++) - { - facep = mDrawable->getFace(i); + facep->setSize(0, 0); + for(S32 i = mNumInitFaces ; i < mDrawable->getNumFaces(); i++) + { + facep = mDrawable->getFace(i); if (facep) { - facep->setSize(0, 0); - } - } + facep->setSize(0, 0); + } + } } } @@ -2385,6 +2386,7 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU { result->setIsMissingAsset(false); } + } return result; } @@ -2770,13 +2772,13 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update) if (mDrawable.notNull()) { - mDrawable->movePartition(); - - //force a move if sitting on an active object - if (getParent() && ((LLViewerObject*) getParent())->mDrawable->isActive()) - { - gPipeline.markMoved(mDrawable, TRUE); - } + mDrawable->movePartition(); + + //force a move if sitting on an active object + if (getParent() && ((LLViewerObject*) getParent())->mDrawable->isActive()) + { + gPipeline.markMoved(mDrawable, TRUE); + } } } @@ -3539,66 +3541,67 @@ bool LLVOAvatar::isInMuteList() void LLVOAvatar::updateAppearanceMessageDebugText() { - S32 central_bake_version = -1; - if (getRegion()) - { - central_bake_version = getRegion()->getCentralBakeVersion(); - } - bool all_baked_downloaded = allBakedTexturesCompletelyDownloaded(); - bool all_local_downloaded = allLocalTexturesCompletelyDownloaded(); - std::string debug_line = llformat("%s%s - mLocal: %d, mEdit: %d, mUSB: %d, CBV: %d", - isSelf() ? (all_local_downloaded ? "L" : "l") : "-", - all_baked_downloaded ? "B" : "b", - mUseLocalAppearance, mIsEditingAppearance, - 1, central_bake_version); - std::string origin_string = bakedTextureOriginInfo(); - debug_line += " [" + origin_string + "]"; - S32 curr_cof_version = LLAppearanceMgr::instance().getCOFVersion(); - S32 last_request_cof_version = mLastUpdateRequestCOFVersion; - S32 last_received_cof_version = mLastUpdateReceivedCOFVersion; - if (isSelf()) - { - debug_line += llformat(" - cof: %d req: %d rcv:%d", - curr_cof_version, last_request_cof_version, last_received_cof_version); - if (gSavedSettings.getBOOL("DebugForceAppearanceRequestFailure")) + S32 central_bake_version = -1; + if (getRegion()) + { + central_bake_version = getRegion()->getCentralBakeVersion(); + } + bool all_baked_downloaded = allBakedTexturesCompletelyDownloaded(); + bool all_local_downloaded = allLocalTexturesCompletelyDownloaded(); + std::string debug_line = llformat("%s%s - mLocal: %d, mEdit: %d, mUSB: %d, CBV: %d", + isSelf() ? (all_local_downloaded ? "L" : "l") : "-", + all_baked_downloaded ? "B" : "b", + mUseLocalAppearance, mIsEditingAppearance, + 1, central_bake_version); + std::string origin_string = bakedTextureOriginInfo(); + debug_line += " [" + origin_string + "]"; + S32 curr_cof_version = LLAppearanceMgr::instance().getCOFVersion(); + S32 last_request_cof_version = mLastUpdateRequestCOFVersion; + S32 last_received_cof_version = mLastUpdateReceivedCOFVersion; + if (isSelf()) + { + debug_line += llformat(" - cof: %d req: %d rcv:%d", + curr_cof_version, last_request_cof_version, last_received_cof_version); + if (gSavedSettings.getBOOL("DebugForceAppearanceRequestFailure")) + { + debug_line += " FORCING ERRS"; + } + } + else + { + debug_line += llformat(" - cof rcv:%d", last_received_cof_version); + } + debug_line += llformat(" bsz-z: %.3f", mBodySize[2]); + if (mAvatarOffset[2] != 0.0f) { - debug_line += " FORCING ERRS"; + debug_line += llformat("avofs-z: %.3f", mAvatarOffset[2]); } - } - else - { - debug_line += llformat(" - cof rcv:%d", last_received_cof_version); - } - debug_line += llformat(" bsz-z: %.3f", mBodySize[2]); - if (mAvatarOffset[2] != 0.0f) - { - debug_line += llformat("avofs-z: %.3f", mAvatarOffset[2]); - } - bool hover_enabled = getRegion() && getRegion()->avatarHoverHeightEnabled(); - debug_line += hover_enabled ? " H" : " h"; - const LLVector3& hover_offset = getHoverOffset(); - if (hover_offset[2] != 0.0) - { - debug_line += llformat(" hov_z: %.3f", hover_offset[2]); + bool hover_enabled = getRegion() && getRegion()->avatarHoverHeightEnabled(); + debug_line += hover_enabled ? " H" : " h"; + const LLVector3& hover_offset = getHoverOffset(); + if (hover_offset[2] != 0.0) + { + debug_line += llformat(" hov_z: %.3f", hover_offset[2]); debug_line += llformat(" %s", (isSitting() ? "S" : "T")); - debug_line += llformat("%s", (isMotionActive(ANIM_AGENT_SIT_GROUND_CONSTRAINED) ? "G" : "-")); - } - LLVector3 ankle_right_pos_agent = mFootRightp->getWorldPosition(); - LLVector3 normal; - LLVector3 ankle_right_ground_agent = ankle_right_pos_agent; - resolveHeightAgent(ankle_right_pos_agent, ankle_right_ground_agent, normal); - F32 rightElev = llmax(-0.2f, ankle_right_pos_agent.mV[VZ] - ankle_right_ground_agent.mV[VZ]); - debug_line += llformat(" relev %.3f", rightElev); + debug_line += llformat("%s", (isMotionActive(ANIM_AGENT_SIT_GROUND_CONSTRAINED) ? "G" : "-")); + } + + LLVector3 ankle_right_pos_agent = mFootRightp->getWorldPosition(); + LLVector3 normal; + LLVector3 ankle_right_ground_agent = ankle_right_pos_agent; + resolveHeightAgent(ankle_right_pos_agent, ankle_right_ground_agent, normal); + F32 rightElev = llmax(-0.2f, ankle_right_pos_agent.mV[VZ] - ankle_right_ground_agent.mV[VZ]); + debug_line += llformat(" relev %.3f", rightElev); - LLVector3 root_pos = mRoot->getPosition(); - LLVector3 pelvis_pos = mPelvisp->getPosition(); - debug_line += llformat(" rp %.3f pp %.3f", root_pos[2], pelvis_pos[2]); + LLVector3 root_pos = mRoot->getPosition(); + LLVector3 pelvis_pos = mPelvisp->getPosition(); + debug_line += llformat(" rp %.3f pp %.3f", root_pos[2], pelvis_pos[2]); S32 is_visible = (S32) isVisible(); S32 is_m_visible = (S32) mVisible; debug_line += llformat(" v %d/%d", is_visible, is_m_visible); - addDebugText(debug_line); + addDebugText(debug_line); } LLViewerInventoryItem* getObjectInventoryItem(LLViewerObject *vobj, LLUUID asset_id) @@ -3610,7 +3613,7 @@ LLViewerInventoryItem* getObjectInventoryItem(LLViewerObject *vobj, LLUUID asset if (vobj->getInventorySerial()<=0) { vobj->requestInventory(); - } + } item = vobj->getInventoryItemByAsset(asset_id); } return item; @@ -3628,23 +3631,23 @@ LLViewerInventoryItem* recursiveGetObjectInventoryItem(LLViewerObject *vobj, LLU LLViewerObject *childp = *it; item = getObjectInventoryItem(childp, asset_id); if (item) - { + { break; } } - } + } return item; } void LLVOAvatar::updateAnimationDebugText() { - for (LLMotionController::motion_list_t::iterator iter = mMotionController.getActiveMotions().begin(); - iter != mMotionController.getActiveMotions().end(); ++iter) - { - LLMotion* motionp = *iter; - if (motionp->getMinPixelArea() < getPixelArea()) - { - std::string output; + for (LLMotionController::motion_list_t::iterator iter = mMotionController.getActiveMotions().begin(); + iter != mMotionController.getActiveMotions().end(); ++iter) + { + LLMotion* motionp = *iter; + if (motionp->getMinPixelArea() < getPixelArea()) + { + std::string output; std::string motion_name = motionp->getName(); if (motion_name.empty()) { @@ -3661,73 +3664,73 @@ void LLVOAvatar::updateAnimationDebugText() } } if (motion_name.empty()) - { - std::string name; - if (gAgent.isGodlikeWithoutAdminMenuFakery() || isSelf()) - { - name = motionp->getID().asString(); - LLVOAvatar::AnimSourceIterator anim_it = mAnimationSources.begin(); - for (; anim_it != mAnimationSources.end(); ++anim_it) - { - if (anim_it->second == motionp->getID()) - { - LLViewerObject* object = gObjectList.findObject(anim_it->first); - if (!object) - { - break; - } - if (object->isAvatar()) - { - if (mMotionController.mIsSelf) - { - // Searching inventory by asset id is really long - // so just mark as inventory - // Also item is likely to be named by LLPreviewAnim - name += "(inventory)"; - } - } - else - { - LLViewerInventoryItem* item = NULL; - if (!object->isInventoryDirty()) - { - item = object->getInventoryItemByAsset(motionp->getID()); - } - if (item) - { - name = item->getName(); - } - else if (object->isAttachment()) - { - name += "(" + getAttachmentItemName() + ")"; - } - else - { - // in-world object, name or content unknown - name += "(in-world)"; - } - } - break; - } - } - } - else - { - name = LLUUID::null.asString(); - } - output = llformat("%s - %d", - name.c_str(), - (U32)motionp->getPriority()); - } - else - { - output = llformat("%s - %d", + { + std::string name; + if (gAgent.isGodlikeWithoutAdminMenuFakery() || isSelf()) + { + name = motionp->getID().asString(); + LLVOAvatar::AnimSourceIterator anim_it = mAnimationSources.begin(); + for (; anim_it != mAnimationSources.end(); ++anim_it) + { + if (anim_it->second == motionp->getID()) + { + LLViewerObject* object = gObjectList.findObject(anim_it->first); + if (!object) + { + break; + } + if (object->isAvatar()) + { + if (mMotionController.mIsSelf) + { + // Searching inventory by asset id is really long + // so just mark as inventory + // Also item is likely to be named by LLPreviewAnim + name += "(inventory)"; + } + } + else + { + LLViewerInventoryItem* item = NULL; + if (!object->isInventoryDirty()) + { + item = object->getInventoryItemByAsset(motionp->getID()); + } + if (item) + { + name = item->getName(); + } + else if (object->isAttachment()) + { + name += "(" + getAttachmentItemName() + ")"; + } + else + { + // in-world object, name or content unknown + name += "(in-world)"; + } + } + break; + } + } + } + else + { + name = LLUUID::null.asString(); + } + output = llformat("%s - %d", + name.c_str(), + (U32)motionp->getPriority()); + } + else + { + output = llformat("%s - %d", motion_name.c_str(), - (U32)motionp->getPriority()); - } - addDebugText(output); - } - } + (U32)motionp->getPriority()); + } + addDebugText(output); + } + } } void LLVOAvatar::updateDebugText() @@ -3760,7 +3763,7 @@ void LLVOAvatar::updateDebugText() { setDebugText(mDebugText); } - mDebugText.clear(); + mDebugText.clear(); } //------------------------------------------------------------------------ @@ -3774,7 +3777,7 @@ void LLVOAvatar::updateFootstepSounds() { return; } - + //------------------------------------------------------------------------- // Find the ground under each foot, these are used for a variety // of things that follow @@ -3799,7 +3802,7 @@ void LLVOAvatar::updateFootstepSounds() if (!mInAir) { if ((leftElev < 0.0f) || (rightElev < 0.0f)) - { + { ankle_left_pos_agent = mFootLeftp->getWorldPosition(); ankle_right_pos_agent = mFootRightp->getWorldPosition(); leftElev = ankle_left_pos_agent.mV[VZ] - ankle_left_ground_agent.mV[VZ]; @@ -3828,10 +3831,10 @@ void LLVOAvatar::updateFootstepSounds() // did right foot hit the ground? if ( onGroundRight && !mWasOnGroundRight ) - { + { foot_pos_agent = ankle_right_pos_agent; playSound = TRUE; - } + } mWasOnGroundLeft = onGroundLeft; mWasOnGroundRight = onGroundRight; @@ -3920,153 +3923,153 @@ void LLVOAvatar::computeUpdatePeriod() //------------------------------------------------------------------------ void LLVOAvatar::updateOrientation(LLAgent& agent, F32 speed, F32 delta_time) { - LLQuaternion iQ; - LLVector3 upDir( 0.0f, 0.0f, 1.0f ); + LLQuaternion iQ; + LLVector3 upDir( 0.0f, 0.0f, 1.0f ); - // Compute a forward direction vector derived from the primitive rotation - // and the velocity vector. When walking or jumping, don't let body deviate - // more than 90 from the view, if necessary, flip the velocity vector. + // Compute a forward direction vector derived from the primitive rotation + // and the velocity vector. When walking or jumping, don't let body deviate + // more than 90 from the view, if necessary, flip the velocity vector. - LLVector3 primDir; - if (isSelf()) - { - primDir = agent.getAtAxis() - projected_vec(agent.getAtAxis(), agent.getReferenceUpVector()); - primDir.normalize(); - } - else - { - primDir = getRotation().getMatrix3().getFwdRow(); - } - LLVector3 velDir = getVelocity(); - velDir.normalize(); - if ( mSignaledAnimations.find(ANIM_AGENT_WALK) != mSignaledAnimations.end()) - { - F32 vpD = velDir * primDir; - if (vpD < -0.5f) - { - velDir *= -1.0f; - } - } - LLVector3 fwdDir = lerp(primDir, velDir, clamp_rescale(speed, 0.5f, 2.0f, 0.0f, 1.0f)); - if (isSelf() && gAgentCamera.cameraMouselook()) - { - // make sure fwdDir stays in same general direction as primdir - if (gAgent.getFlying()) - { - fwdDir = LLViewerCamera::getInstance()->getAtAxis(); - } - else - { - LLVector3 at_axis = LLViewerCamera::getInstance()->getAtAxis(); - LLVector3 up_vector = gAgent.getReferenceUpVector(); - at_axis -= up_vector * (at_axis * up_vector); - at_axis.normalize(); + LLVector3 primDir; + if (isSelf()) + { + primDir = agent.getAtAxis() - projected_vec(agent.getAtAxis(), agent.getReferenceUpVector()); + primDir.normalize(); + } + else + { + primDir = getRotation().getMatrix3().getFwdRow(); + } + LLVector3 velDir = getVelocity(); + velDir.normalize(); + if ( mSignaledAnimations.find(ANIM_AGENT_WALK) != mSignaledAnimations.end()) + { + F32 vpD = velDir * primDir; + if (vpD < -0.5f) + { + velDir *= -1.0f; + } + } + LLVector3 fwdDir = lerp(primDir, velDir, clamp_rescale(speed, 0.5f, 2.0f, 0.0f, 1.0f)); + if (isSelf() && gAgentCamera.cameraMouselook()) + { + // make sure fwdDir stays in same general direction as primdir + if (gAgent.getFlying()) + { + fwdDir = LLViewerCamera::getInstance()->getAtAxis(); + } + else + { + LLVector3 at_axis = LLViewerCamera::getInstance()->getAtAxis(); + LLVector3 up_vector = gAgent.getReferenceUpVector(); + at_axis -= up_vector * (at_axis * up_vector); + at_axis.normalize(); - F32 dot = fwdDir * at_axis; - if (dot < 0.f) - { - fwdDir -= 2.f * at_axis * dot; - fwdDir.normalize(); - } - } - } + F32 dot = fwdDir * at_axis; + if (dot < 0.f) + { + fwdDir -= 2.f * at_axis * dot; + fwdDir.normalize(); + } + } + } - LLQuaternion root_rotation = mRoot->getWorldMatrix().quaternion(); - F32 root_roll, root_pitch, root_yaw; - root_rotation.getEulerAngles(&root_roll, &root_pitch, &root_yaw); + LLQuaternion root_rotation = mRoot->getWorldMatrix().quaternion(); + F32 root_roll, root_pitch, root_yaw; + root_rotation.getEulerAngles(&root_roll, &root_pitch, &root_yaw); - // When moving very slow, the pelvis is allowed to deviate from the + // When moving very slow, the pelvis is allowed to deviate from the // forward direction to allow it to hold its position while the torso - // and head turn. Once in motion, it must conform however. - BOOL self_in_mouselook = isSelf() && gAgentCamera.cameraMouselook(); + // and head turn. Once in motion, it must conform however. + BOOL self_in_mouselook = isSelf() && gAgentCamera.cameraMouselook(); - LLVector3 pelvisDir( mRoot->getWorldMatrix().getFwdRow4().mV ); + LLVector3 pelvisDir( mRoot->getWorldMatrix().getFwdRow4().mV ); - static LLCachedControl<F32> s_pelvis_rot_threshold_slow(gSavedSettings, "AvatarRotateThresholdSlow", 60.0); - static LLCachedControl<F32> s_pelvis_rot_threshold_fast(gSavedSettings, "AvatarRotateThresholdFast", 2.0); + static LLCachedControl<F32> s_pelvis_rot_threshold_slow(gSavedSettings, "AvatarRotateThresholdSlow", 60.0); + static LLCachedControl<F32> s_pelvis_rot_threshold_fast(gSavedSettings, "AvatarRotateThresholdFast", 2.0); - F32 pelvis_rot_threshold = clamp_rescale(speed, 0.1f, 1.0f, s_pelvis_rot_threshold_slow, s_pelvis_rot_threshold_fast); + F32 pelvis_rot_threshold = clamp_rescale(speed, 0.1f, 1.0f, s_pelvis_rot_threshold_slow, s_pelvis_rot_threshold_fast); - if (self_in_mouselook) - { - pelvis_rot_threshold *= MOUSELOOK_PELVIS_FOLLOW_FACTOR; - } - pelvis_rot_threshold *= DEG_TO_RAD; + if (self_in_mouselook) + { + pelvis_rot_threshold *= MOUSELOOK_PELVIS_FOLLOW_FACTOR; + } + pelvis_rot_threshold *= DEG_TO_RAD; - F32 angle = angle_between( pelvisDir, fwdDir ); + F32 angle = angle_between( pelvisDir, fwdDir ); - // The avatar's root is allowed to have a yaw that deviates widely - // from the forward direction, but if roll or pitch are off even - // a little bit we need to correct the rotation. - if(root_roll < 1.f * DEG_TO_RAD - && root_pitch < 5.f * DEG_TO_RAD) - { - // smaller correction vector means pelvis follows prim direction more closely - if (!mTurning && angle > pelvis_rot_threshold*0.75f) - { - mTurning = TRUE; - } + // The avatar's root is allowed to have a yaw that deviates widely + // from the forward direction, but if roll or pitch are off even + // a little bit we need to correct the rotation. + if(root_roll < 1.f * DEG_TO_RAD + && root_pitch < 5.f * DEG_TO_RAD) + { + // smaller correction vector means pelvis follows prim direction more closely + if (!mTurning && angle > pelvis_rot_threshold*0.75f) + { + mTurning = TRUE; + } - // use tighter threshold when turning - if (mTurning) - { - pelvis_rot_threshold *= 0.4f; - } + // use tighter threshold when turning + if (mTurning) + { + pelvis_rot_threshold *= 0.4f; + } - // am I done turning? - if (angle < pelvis_rot_threshold) - { - mTurning = FALSE; - } + // am I done turning? + if (angle < pelvis_rot_threshold) + { + mTurning = FALSE; + } - LLVector3 correction_vector = (pelvisDir - fwdDir) * clamp_rescale(angle, pelvis_rot_threshold*0.75f, pelvis_rot_threshold, 1.0f, 0.0f); - fwdDir += correction_vector; - } - else - { - mTurning = FALSE; - } + LLVector3 correction_vector = (pelvisDir - fwdDir) * clamp_rescale(angle, pelvis_rot_threshold*0.75f, pelvis_rot_threshold, 1.0f, 0.0f); + fwdDir += correction_vector; + } + else + { + mTurning = FALSE; + } - // Now compute the full world space rotation for the whole body (wQv) - LLVector3 leftDir = upDir % fwdDir; - leftDir.normalize(); - fwdDir = leftDir % upDir; - LLQuaternion wQv( fwdDir, leftDir, upDir ); + // Now compute the full world space rotation for the whole body (wQv) + LLVector3 leftDir = upDir % fwdDir; + leftDir.normalize(); + fwdDir = leftDir % upDir; + LLQuaternion wQv( fwdDir, leftDir, upDir ); - if (isSelf() && mTurning) - { - if ((fwdDir % pelvisDir) * upDir > 0.f) - { - gAgent.setControlFlags(AGENT_CONTROL_TURN_RIGHT); - } - else - { - gAgent.setControlFlags(AGENT_CONTROL_TURN_LEFT); - } - } + if (isSelf() && mTurning) + { + if ((fwdDir % pelvisDir) * upDir > 0.f) + { + gAgent.setControlFlags(AGENT_CONTROL_TURN_RIGHT); + } + else + { + gAgent.setControlFlags(AGENT_CONTROL_TURN_LEFT); + } + } - // Set the root rotation, but do so incrementally so that it - // lags in time by some fixed amount. - //F32 u = LLSmoothInterpolation::getInterpolant(PELVIS_LAG); - F32 pelvis_lag_time = 0.f; - if (self_in_mouselook) - { - pelvis_lag_time = PELVIS_LAG_MOUSELOOK; - } - else if (mInAir) - { - pelvis_lag_time = PELVIS_LAG_FLYING; - // increase pelvis lag time when moving slowly - pelvis_lag_time *= clamp_rescale(mSpeedAccum, 0.f, 15.f, 3.f, 1.f); - } - else - { - pelvis_lag_time = PELVIS_LAG_WALKING; - } + // Set the root rotation, but do so incrementally so that it + // lags in time by some fixed amount. + //F32 u = LLSmoothInterpolation::getInterpolant(PELVIS_LAG); + F32 pelvis_lag_time = 0.f; + if (self_in_mouselook) + { + pelvis_lag_time = PELVIS_LAG_MOUSELOOK; + } + else if (mInAir) + { + pelvis_lag_time = PELVIS_LAG_FLYING; + // increase pelvis lag time when moving slowly + pelvis_lag_time *= clamp_rescale(mSpeedAccum, 0.f, 15.f, 3.f, 1.f); + } + else + { + pelvis_lag_time = PELVIS_LAG_WALKING; + } F32 u = llclamp((delta_time / pelvis_lag_time), 0.0f, 1.0f); - mRoot->setWorldRotation( slerp(u, mRoot->getWorldRotation(), wQv) ); + mRoot->setWorldRotation( slerp(u, mRoot->getWorldRotation(), wQv) ); } //------------------------------------------------------------------------ @@ -4128,7 +4131,7 @@ void LLVOAvatar::updateRootPositionAndRotation(LLAgent& agent, F32 speed, bool w mRoot->setWorldPosition( getPositionAgent() ); // first frame mRoot->setWorldRotation( getRotation() ); } - + //-------------------------------------------------------------------- // dont' let dT get larger than 1/5th of a second //-------------------------------------------------------------------- @@ -4366,7 +4369,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) mRoot->updateWorldMatrixChildren(); // System avatar mesh vertices need to be reskinned. - mNeedsSkin = TRUE; + mNeedsSkin = TRUE; return TRUE; } @@ -4880,14 +4883,14 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass) first_pass = FALSE; } if (isTextureVisible(TEX_HAIR_BAKED)) - { - LLViewerJoint* hair_mesh = getViewerJoint(MESH_ID_HAIR); - if (hair_mesh) - { - num_indices += hair_mesh->render(mAdjustedPixelArea, first_pass, mIsDummy); - } - first_pass = FALSE; - } + { + LLViewerJoint* hair_mesh = getViewerJoint(MESH_ID_HAIR); + if (hair_mesh) + { + num_indices += hair_mesh->render(mAdjustedPixelArea, first_pass, mIsDummy); + } + first_pass = FALSE; + } if (LLPipeline::sImpostorRender) { gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); @@ -4995,22 +4998,22 @@ U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel) gGL.flush(); } { - LLGLEnable test(GL_ALPHA_TEST); - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.f); + LLGLEnable test(GL_ALPHA_TEST); + gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.f); - gGL.color4ubv(color.mV); - gGL.getTexUnit(diffuse_channel)->bind(&mImpostor); - gGL.begin(LLRender::QUADS); - gGL.texCoord2f(0,0); - gGL.vertex3fv((pos+left-up).mV); - gGL.texCoord2f(1,0); - gGL.vertex3fv((pos-left-up).mV); - gGL.texCoord2f(1,1); - gGL.vertex3fv((pos-left+up).mV); - gGL.texCoord2f(0,1); - gGL.vertex3fv((pos+left+up).mV); - gGL.end(); - gGL.flush(); + gGL.color4ubv(color.mV); + gGL.getTexUnit(diffuse_channel)->bind(&mImpostor); + gGL.begin(LLRender::QUADS); + gGL.texCoord2f(0,0); + gGL.vertex3fv((pos+left-up).mV); + gGL.texCoord2f(1,0); + gGL.vertex3fv((pos-left-up).mV); + gGL.texCoord2f(1,1); + gGL.vertex3fv((pos-left+up).mV); + gGL.texCoord2f(0,1); + gGL.vertex3fv((pos+left+up).mV); + gGL.end(); + gGL.flush(); } return 6; @@ -5510,8 +5513,8 @@ void LLVOAvatar::processAnimationStateChanges() stopMotion(ANIM_AGENT_WALK_ADJUST); if (mEnableDefaultMotions) { - startMotion(ANIM_AGENT_FLY_ADJUST); - } + startMotion(ANIM_AGENT_FLY_ADJUST); + } } else { @@ -5523,7 +5526,7 @@ void LLVOAvatar::processAnimationStateChanges() { if (mEnableDefaultMotions) { - startMotion(ANIM_AGENT_TARGET); + startMotion(ANIM_AGENT_TARGET); } stopMotion(ANIM_AGENT_BODY_NOISE); } @@ -5532,8 +5535,8 @@ void LLVOAvatar::processAnimationStateChanges() stopMotion(ANIM_AGENT_TARGET); if (mEnableDefaultMotions) { - startMotion(ANIM_AGENT_BODY_NOISE); - } + startMotion(ANIM_AGENT_BODY_NOISE); + } } // clear all current animations @@ -5901,10 +5904,10 @@ bool LLVOAvatar::getRiggedMeshID(LLViewerObject* pVO, LLUUID& mesh_id) if (pSkinData && pSkinData->mJointNames.size() > JOINT_COUNT_REQUIRED_FOR_FULLRIG // full rig && pSkinData->mAlternateBindMatrix.size() > 0 ) - { - mesh_id = pSkinData->mMeshID; - return true; - } + { + mesh_id = pSkinData->mMeshID; + return true; + } } } return false; @@ -5913,14 +5916,14 @@ bool LLVOAvatar::getRiggedMeshID(LLViewerObject* pVO, LLUUID& mesh_id) bool LLVOAvatar::jointIsRiggedTo(const LLJoint *joint) const { if (joint) - { + { const LLJointRiggingInfoTab& tab = mJointRiggingInfoTab; S32 joint_num = joint->getJointNum(); if (joint_num < tab.size() && tab[joint_num].isRiggedTo()) - { - return true; + { + return true; + } } - } return false; } @@ -5929,25 +5932,25 @@ void LLVOAvatar::clearAttachmentOverrides() LLScopedContextString str("clearAttachmentOverrides " + getFullname()); for (S32 i=0; i<LL_CHARACTER_MAX_ANIMATED_JOINTS; i++) - { + { LLJoint *pJoint = getJoint(i); if (pJoint) { pJoint->clearAttachmentPosOverrides(); pJoint->clearAttachmentScaleOverrides(); } - } + } if (mPelvisFixups.count()>0) { mPelvisFixups.clear(); LLJoint* pJointPelvis = getJoint("mPelvis"); if (pJointPelvis) - { + { pJointPelvis->setPosition( LLVector3( 0.0f, 0.0f, 0.0f) ); } postPelvisSetRecalc(); - } + } mActiveOverrideMeshes.clear(); onActiveOverrideMeshesChanged(); @@ -5968,7 +5971,7 @@ void LLVOAvatar::rebuildAttachmentOverrides() // Handle the case that we're resetting the skeleton of an animated object. LLControlAvatar *control_av = dynamic_cast<LLControlAvatar*>(this); if (control_av) - { + { LLVOVolume *volp = control_av->mRootVolp; if (volp) { @@ -6105,9 +6108,9 @@ void LLVOAvatar::updateAttachmentOverrides() if (scale_overrides_by_joint[joint_num] != joint->m_attachmentScaleOverrides) { mismatched = true; - } } } + } if (pelvis_fixups != mPelvisFixups) { mismatched = true; @@ -6126,10 +6129,10 @@ void LLVOAvatar::updateAttachmentOverrides() void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::set<LLUUID>* meshes_seen, bool recursive) { if (vo->getAvatar() != this && vo->getAvatarAncestor() != this) - { + { LL_WARNS("Avatar") << "called with invalid avatar" << LL_ENDL; return; - } + } LLScopedContextString str("addAttachmentOverridesForObject " + getFullname()); @@ -6139,14 +6142,14 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::set<LL // Process all children if (recursive) { - LLViewerObject::const_child_list_t& children = vo->getChildren(); - for (LLViewerObject::const_child_list_t::const_iterator it = children.begin(); - it != children.end(); ++it) - { - LLViewerObject *childp = *it; + LLViewerObject::const_child_list_t& children = vo->getChildren(); + for (LLViewerObject::const_child_list_t::const_iterator it = children.begin(); + it != children.end(); ++it) + { + LLViewerObject *childp = *it; addAttachmentOverridesForObject(childp, meshes_seen, true); } - } + } LLVOVolume *vobj = dynamic_cast<LLVOVolume*>(vo); bool pelvisGotSet = false; @@ -6407,7 +6410,7 @@ void LLVOAvatar::removeAttachmentOverridesForObject(const LLUUID& mesh_id) LLJoint* pJointPelvis = getJoint("mPelvis"); const std::string av_string = avString(); for (S32 joint_num = 0; joint_num < LL_CHARACTER_MAX_ANIMATED_JOINTS; joint_num++) - { + { LLJoint *pJoint = getJoint(joint_num); if ( pJoint ) { @@ -7017,6 +7020,22 @@ const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_o LLSelectMgr::getInstance()->updatePointAt(); } + viewer_object->refreshBakeTexture(); + + + LLViewerObject::const_child_list_t& child_list = viewer_object->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); ++iter) + { + LLViewerObject* objectp = *iter; + if (objectp) + { + objectp->refreshBakeTexture(); + } + } + + updateMeshVisibility(); + return attachment; } @@ -7220,7 +7239,6 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO ) //----------------------------------------------------------------------------- BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) { - for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter) @@ -7231,12 +7249,28 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) { updateVisualComplexity(); bool is_animated_object = viewer_object->isAnimatedObject(); - cleanupAttachedMesh( viewer_object ); + cleanupAttachedMesh(viewer_object); + attachment->removeObject(viewer_object); if (!is_animated_object) { updateAttachmentOverrides(); } + viewer_object->refreshBakeTexture(); + + LLViewerObject::const_child_list_t& child_list = viewer_object->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter1 = child_list.begin(); + iter1 != child_list.end(); ++iter1) + { + LLViewerObject* objectp = *iter1; + if (objectp) + { + objectp->refreshBakeTexture(); + } + } + + updateMeshVisibility(); + LL_DEBUGS() << "Detaching object " << viewer_object->mID << " from " << attachment->getName() << LL_ENDL; return TRUE; } @@ -7329,7 +7363,7 @@ void LLVOAvatar::getOffObject() if (sit_object) { stopMotionFromSource(sit_object->getID()); - LLFollowCamMgr::setCameraActive(sit_object->getID(), FALSE); + LLFollowCamMgr::getInstance()->setCameraActive(sit_object->getID(), FALSE); LLViewerObject::const_child_list_t& child_list = sit_object->getChildren(); for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); @@ -7338,7 +7372,7 @@ void LLVOAvatar::getOffObject() LLViewerObject* child_objectp = *iter; stopMotionFromSource(child_objectp->getID()); - LLFollowCamMgr::setCameraActive(child_objectp->getID(), FALSE); + LLFollowCamMgr::getInstance()->setCameraActive(child_objectp->getID(), FALSE); } } @@ -7372,7 +7406,7 @@ void LLVOAvatar::getOffObject() if (mEnableDefaultMotions) { - startMotion(ANIM_AGENT_BODY_NOISE); + startMotion(ANIM_AGENT_BODY_NOISE); } if (isSelf()) @@ -7838,8 +7872,8 @@ bool LLVOAvatar::isTooComplex() const // yes, this leaves them vulnerable to griefing objects... their choice too_complex = ( max_render_cost > 0 && (mVisualComplexity > max_render_cost - || (max_attachment_area > 0.0f && mAttachmentSurfaceArea > max_attachment_area) - )); + || (max_attachment_area > 0.0f && mAttachmentSurfaceArea > max_attachment_area) + )); } return too_complex; @@ -7872,6 +7906,115 @@ void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color) } } + +//----------------------------------------------------------------------------- +// updateMeshVisibility() +// Hide the mesh joints if attachments are using baked textures +//----------------------------------------------------------------------------- +void LLVOAvatar::updateMeshVisibility() +{ + bool bake_flag[BAKED_NUM_INDICES]; + memset(bake_flag, 0, BAKED_NUM_INDICES*sizeof(bool)); + + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); + ++iter) + { + LLViewerJointAttachment* attachment = iter->second; + if (attachment) + { + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) + { + LLViewerObject *objectp = (*attachment_iter); + if (objectp) + { + for (int face_index = 0; face_index < objectp->getNumTEs(); face_index++) + { + LLTextureEntry* tex_entry = objectp->getTE(face_index); + bake_flag[BAKED_HEAD] |= (tex_entry->getID() == IMG_USE_BAKED_HEAD); + bake_flag[BAKED_EYES] |= (tex_entry->getID() == IMG_USE_BAKED_EYES); + bake_flag[BAKED_HAIR] |= (tex_entry->getID() == IMG_USE_BAKED_HAIR); + bake_flag[BAKED_LOWER] |= (tex_entry->getID() == IMG_USE_BAKED_LOWER); + bake_flag[BAKED_UPPER] |= (tex_entry->getID() == IMG_USE_BAKED_UPPER); + bake_flag[BAKED_SKIRT] |= (tex_entry->getID() == IMG_USE_BAKED_SKIRT); + bake_flag[BAKED_LEFT_ARM] |= (tex_entry->getID() == IMG_USE_BAKED_LEFTARM); + bake_flag[BAKED_LEFT_LEG] |= (tex_entry->getID() == IMG_USE_BAKED_LEFTLEG); + bake_flag[BAKED_AUX1] |= (tex_entry->getID() == IMG_USE_BAKED_AUX1); + bake_flag[BAKED_AUX2] |= (tex_entry->getID() == IMG_USE_BAKED_AUX2); + bake_flag[BAKED_AUX3] |= (tex_entry->getID() == IMG_USE_BAKED_AUX3); + } + } + + LLViewerObject::const_child_list_t& child_list = objectp->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter1 = child_list.begin(); + iter1 != child_list.end(); ++iter1) + { + LLViewerObject* objectchild = *iter1; + if (objectchild) + { + for (int face_index = 0; face_index < objectchild->getNumTEs(); face_index++) + { + LLTextureEntry* tex_entry = objectchild->getTE(face_index); + bake_flag[BAKED_HEAD] |= (tex_entry->getID() == IMG_USE_BAKED_HEAD); + bake_flag[BAKED_EYES] |= (tex_entry->getID() == IMG_USE_BAKED_EYES); + bake_flag[BAKED_HAIR] |= (tex_entry->getID() == IMG_USE_BAKED_HAIR); + bake_flag[BAKED_LOWER] |= (tex_entry->getID() == IMG_USE_BAKED_LOWER); + bake_flag[BAKED_UPPER] |= (tex_entry->getID() == IMG_USE_BAKED_UPPER); + bake_flag[BAKED_SKIRT] |= (tex_entry->getID() == IMG_USE_BAKED_SKIRT); + bake_flag[BAKED_LEFT_ARM] |= (tex_entry->getID() == IMG_USE_BAKED_LEFTARM); + bake_flag[BAKED_LEFT_LEG] |= (tex_entry->getID() == IMG_USE_BAKED_LEFTLEG); + bake_flag[BAKED_AUX1] |= (tex_entry->getID() == IMG_USE_BAKED_AUX1); + bake_flag[BAKED_AUX2] |= (tex_entry->getID() == IMG_USE_BAKED_AUX2); + bake_flag[BAKED_AUX3] |= (tex_entry->getID() == IMG_USE_BAKED_AUX3); + } + } + } + } + } + } + + //LL_INFOS() << "head " << bake_flag[BAKED_HEAD] << "eyes " << bake_flag[BAKED_EYES] << "hair " << bake_flag[BAKED_HAIR] << "lower " << bake_flag[BAKED_LOWER] << "upper " << bake_flag[BAKED_UPPER] << "skirt " << bake_flag[BAKED_SKIRT] << LL_ENDL; + + for (S32 i = 0; i < mMeshLOD.size(); i++) + { + LLAvatarJoint* joint = mMeshLOD[i]; + if (i == MESH_ID_HAIR) + { + joint->setVisible(!bake_flag[BAKED_HAIR], TRUE); + } + else if (i == MESH_ID_HEAD) + { + joint->setVisible(!bake_flag[BAKED_HEAD], TRUE); + } + else if (i == MESH_ID_SKIRT) + { + joint->setVisible(!bake_flag[BAKED_SKIRT], TRUE); + } + else if (i == MESH_ID_UPPER_BODY) + { + joint->setVisible(!bake_flag[BAKED_UPPER], TRUE); + } + else if (i == MESH_ID_LOWER_BODY) + { + joint->setVisible(!bake_flag[BAKED_LOWER], TRUE); + } + else if (i == MESH_ID_EYEBALL_LEFT) + { + joint->setVisible(!bake_flag[BAKED_EYES], TRUE); + } + else if (i == MESH_ID_EYEBALL_RIGHT) + { + joint->setVisible(!bake_flag[BAKED_EYES], TRUE); + } + else if (i == MESH_ID_EYELASH) + { + joint->setVisible(!bake_flag[BAKED_HEAD], TRUE); + } + } +} + //----------------------------------------------------------------------------- // updateMeshTextures() // Uses the current TE values to set the meshes' and layersets' textures. @@ -8089,6 +8232,39 @@ void LLVOAvatar::updateMeshTextures() removeMissingBakedTextures(); // May call back into this function if anything is removed call_remove_missing = true; } + + //refresh bakes on any attached objects + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); + ++iter) + { + LLViewerJointAttachment* attachment = iter->second; + + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) + { + LLViewerObject* attached_object = (*attachment_iter); + if (attached_object && !attached_object->isDead()) + { + attached_object->refreshBakeTexture(); + + LLViewerObject::const_child_list_t& child_list = attached_object->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); ++iter) + { + LLViewerObject* objectp = *iter; + if (objectp && !objectp->isDead()) + { + objectp->refreshBakeTexture(); + } + } + } + } + } + + + } // virtual @@ -8732,7 +8908,7 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte { if (!isTextureDefined(mBakedTextureDatas[baked_index].mTextureIndex) && mBakedTextureDatas[baked_index].mLastTextureID != IMG_DEFAULT - && baked_index != BAKED_SKIRT) + && baked_index != BAKED_SKIRT && baked_index != BAKED_LEFT_ARM && baked_index != BAKED_LEFT_LEG && baked_index != BAKED_AUX1 && baked_index != BAKED_AUX2 && baked_index != BAKED_AUX3) { LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using mLastTextureID " << mBakedTextureDatas[baked_index].mLastTextureID << LL_ENDL; setTEImage(mBakedTextureDatas[baked_index].mTextureIndex, @@ -8865,6 +9041,39 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte } updateMeshTextures(); + updateMeshVisibility(); + +} + +LLViewerTexture* LLVOAvatar::getBakedTexture(const U8 te) +{ + if (te < 0 || te >= BAKED_NUM_INDICES) + { + return NULL; + } + + BOOL is_layer_baked = isTextureDefined(mBakedTextureDatas[te].mTextureIndex); + + LLViewerTexLayerSet* layerset = NULL; + layerset = getTexLayerSet(te); + + + if (!isEditingAppearance() && is_layer_baked) + { + LLViewerFetchedTexture* baked_img = LLViewerTextureManager::staticCastToFetchedTexture(getImage(mBakedTextureDatas[te].mTextureIndex, 0), TRUE); + return baked_img; + } + else if (layerset && isEditingAppearance()) + { + layerset->createComposite(); + layerset->setUpdatesEnabled(TRUE); + + return layerset->getViewerComposite(); + } + + return NULL; + + } // static @@ -9100,6 +9309,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) } } } + dirtyMesh(); } @@ -9972,122 +10182,122 @@ void LLVOAvatar::accountRenderComplexityForObject( hud_complexity_list_t& hud_complexity_list) { if (attached_object && !attached_object->isHUDAttachment()) - { + { mAttachmentVisibleTriangleCount += attached_object->recursiveGetTriangleCount(); mAttachmentEstTriangleCount += attached_object->recursiveGetEstTrianglesMax(); mAttachmentSurfaceArea += attached_object->recursiveGetScaledSurfaceArea(); - textures.clear(); - const LLDrawable* drawable = attached_object->mDrawable; - if (drawable) - { - const LLVOVolume* volume = drawable->getVOVolume(); - if (volume) - { - F32 attachment_total_cost = 0; - F32 attachment_volume_cost = 0; - F32 attachment_texture_cost = 0; - F32 attachment_children_cost = 0; + textures.clear(); + const LLDrawable* drawable = attached_object->mDrawable; + if (drawable) + { + const LLVOVolume* volume = drawable->getVOVolume(); + if (volume) + { + F32 attachment_total_cost = 0; + F32 attachment_volume_cost = 0; + F32 attachment_texture_cost = 0; + F32 attachment_children_cost = 0; const F32 animated_object_attachment_surcharge = 1000; if (attached_object->isAnimatedObject()) { attachment_volume_cost += animated_object_attachment_surcharge; } - attachment_volume_cost += volume->getRenderCost(textures); + attachment_volume_cost += volume->getRenderCost(textures); - const_child_list_t children = volume->getChildren(); - for (const_child_list_t::const_iterator child_iter = children.begin(); - child_iter != children.end(); - ++child_iter) - { - LLViewerObject* child_obj = *child_iter; - LLVOVolume *child = dynamic_cast<LLVOVolume*>( child_obj ); - if (child) - { - attachment_children_cost += child->getRenderCost(textures); - } - } + const_child_list_t children = volume->getChildren(); + for (const_child_list_t::const_iterator child_iter = children.begin(); + child_iter != children.end(); + ++child_iter) + { + LLViewerObject* child_obj = *child_iter; + LLVOVolume *child = dynamic_cast<LLVOVolume*>( child_obj ); + if (child) + { + attachment_children_cost += child->getRenderCost(textures); + } + } - for (LLVOVolume::texture_cost_t::iterator volume_texture = textures.begin(); - volume_texture != textures.end(); - ++volume_texture) + for (LLVOVolume::texture_cost_t::iterator volume_texture = textures.begin(); + volume_texture != textures.end(); + ++volume_texture) + { + // add the cost of each individual texture in the linkset + attachment_texture_cost += volume_texture->second; + } + attachment_total_cost = attachment_volume_cost + attachment_texture_cost + attachment_children_cost; + LL_DEBUGS("ARCdetail") << "Attachment costs " << attached_object->getAttachmentItemID() + << " total: " << attachment_total_cost + << ", volume: " << attachment_volume_cost + << ", textures: " << attachment_texture_cost + << ", " << volume->numChildren() + << " children: " << attachment_children_cost + << LL_ENDL; + // Limit attachment complexity to avoid signed integer flipping of the wearer's ACI + cost += (U32)llclamp(attachment_total_cost, MIN_ATTACHMENT_COMPLEXITY, max_attachment_complexity); + } + } + } + if (isSelf() + && attached_object + && attached_object->isHUDAttachment() + && !attached_object->isTempAttachment() + && attached_object->mDrawable) { - // add the cost of each individual texture in the linkset - attachment_texture_cost += volume_texture->second; - } - attachment_total_cost = attachment_volume_cost + attachment_texture_cost + attachment_children_cost; - LL_DEBUGS("ARCdetail") << "Attachment costs " << attached_object->getAttachmentItemID() - << " total: " << attachment_total_cost - << ", volume: " << attachment_volume_cost - << ", textures: " << attachment_texture_cost - << ", " << volume->numChildren() - << " children: " << attachment_children_cost - << LL_ENDL; - // Limit attachment complexity to avoid signed integer flipping of the wearer's ACI - cost += (U32)llclamp(attachment_total_cost, MIN_ATTACHMENT_COMPLEXITY, max_attachment_complexity); - } - } - } - if (isSelf() - && attached_object - && attached_object->isHUDAttachment() - && !attached_object->isTempAttachment() - && attached_object->mDrawable) - { - textures.clear(); + textures.clear(); mAttachmentSurfaceArea += attached_object->recursiveGetScaledSurfaceArea(); - const LLVOVolume* volume = attached_object->mDrawable->getVOVolume(); - if (volume) - { - LLHUDComplexity hud_object_complexity; - hud_object_complexity.objectName = attached_object->getAttachmentItemName(); - hud_object_complexity.objectId = attached_object->getAttachmentItemID(); - std::string joint_name; - gAgentAvatarp->getAttachedPointName(attached_object->getAttachmentItemID(), joint_name); - hud_object_complexity.jointName = joint_name; - // get cost and individual textures - hud_object_complexity.objectsCost += volume->getRenderCost(textures); - hud_object_complexity.objectsCount++; - - LLViewerObject::const_child_list_t& child_list = attached_object->getChildren(); - for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); - iter != child_list.end(); ++iter) - { - LLViewerObject* childp = *iter; - const LLVOVolume* chld_volume = dynamic_cast<LLVOVolume*>(childp); - if (chld_volume) - { - // get cost and individual textures - hud_object_complexity.objectsCost += chld_volume->getRenderCost(textures); - hud_object_complexity.objectsCount++; - } - } + const LLVOVolume* volume = attached_object->mDrawable->getVOVolume(); + if (volume) + { + LLHUDComplexity hud_object_complexity; + hud_object_complexity.objectName = attached_object->getAttachmentItemName(); + hud_object_complexity.objectId = attached_object->getAttachmentItemID(); + std::string joint_name; + gAgentAvatarp->getAttachedPointName(attached_object->getAttachmentItemID(), joint_name); + hud_object_complexity.jointName = joint_name; + // get cost and individual textures + hud_object_complexity.objectsCost += volume->getRenderCost(textures); + hud_object_complexity.objectsCount++; + + LLViewerObject::const_child_list_t& child_list = attached_object->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); ++iter) + { + LLViewerObject* childp = *iter; + const LLVOVolume* chld_volume = dynamic_cast<LLVOVolume*>(childp); + if (chld_volume) + { + // get cost and individual textures + hud_object_complexity.objectsCost += chld_volume->getRenderCost(textures); + hud_object_complexity.objectsCount++; + } + } - hud_object_complexity.texturesCount += textures.size(); + hud_object_complexity.texturesCount += textures.size(); - for (LLVOVolume::texture_cost_t::iterator volume_texture = textures.begin(); - volume_texture != textures.end(); - ++volume_texture) - { - // add the cost of each individual texture (ignores duplicates) - hud_object_complexity.texturesCost += volume_texture->second; - LLViewerFetchedTexture *tex = LLViewerTextureManager::getFetchedTexture(volume_texture->first); - if (tex) - { - // Note: Texture memory might be incorect since texture might be still loading. - hud_object_complexity.texturesMemoryTotal += tex->getTextureMemory(); - if (tex->getOriginalHeight() * tex->getOriginalWidth() >= HUD_OVERSIZED_TEXTURE_DATA_SIZE) - { - hud_object_complexity.largeTexturesCount++; + for (LLVOVolume::texture_cost_t::iterator volume_texture = textures.begin(); + volume_texture != textures.end(); + ++volume_texture) + { + // add the cost of each individual texture (ignores duplicates) + hud_object_complexity.texturesCost += volume_texture->second; + LLViewerFetchedTexture *tex = LLViewerTextureManager::getFetchedTexture(volume_texture->first); + if (tex) + { + // Note: Texture memory might be incorect since texture might be still loading. + hud_object_complexity.texturesMemoryTotal += tex->getTextureMemory(); + if (tex->getOriginalHeight() * tex->getOriginalWidth() >= HUD_OVERSIZED_TEXTURE_DATA_SIZE) + { + hud_object_complexity.largeTexturesCount++; + } + } + } + hud_complexity_list.push_back(hud_object_complexity); } } - } - hud_complexity_list.push_back(hud_object_complexity); - } - } } // Calculations for mVisualComplexity value @@ -10257,6 +10467,11 @@ void LLVOAvatar::calcMutedAVColor() new_color = LLColor4::grey4; change_msg = " blocked: color is grey4"; } + else if (!isTooComplex()) + { + new_color = LLColor4::white; + change_msg = " simple imposter "; + } else if ( mMutedAVColor == LLColor4::white || mMutedAVColor == LLColor4::grey3 || mMutedAVColor == LLColor4::grey4 ) { // select a color based on the first byte of the agents uuid so any muted agent is always the same color diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index b603381e6d..00dccc5d12 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -617,6 +617,7 @@ public: public: /*virtual*/ LLTexLayerSet* createTexLayerSet(); // Return LLViewerTexLayerSet void releaseComponentTextures(); // ! BACKWARDS COMPATIBILITY ! + protected: static void onBakedTextureMasksLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); static void onInitialBakedTextureLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); @@ -701,6 +702,9 @@ public: void updateSexDependentLayerSets(); virtual void dirtyMesh(); // Dirty the avatar mesh void updateMeshData(); + void updateMeshVisibility(); + LLViewerTexture* getBakedTexture(const U8 te); + protected: void releaseMeshData(); virtual void restoreMeshData(); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index dcaade55a6..63ace4fe52 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1208,7 +1208,7 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) // the simulator should automatically handle permission revocation stopMotionFromSource(attachment_id); - LLFollowCamMgr::setCameraActive(viewer_object->getID(), FALSE); + LLFollowCamMgr::getInstance()->setCameraActive(viewer_object->getID(), FALSE); LLViewerObject::const_child_list_t& child_list = viewer_object->getChildren(); for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); @@ -1220,7 +1220,7 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) // permissions revocation stopMotionFromSource(child_objectp->getID()); - LLFollowCamMgr::setCameraActive(child_objectp->getID(), FALSE); + LLFollowCamMgr::getInstance()->setCameraActive(child_objectp->getID(), FALSE); } // Make sure the inventory is in sync with the avatar. diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index fb28d9bdb5..07660ca6ac 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -1045,9 +1045,9 @@ const char* object_cache_dirname = "objectcache"; const char* header_filename = "object.cache"; -LLVOCache::LLVOCache(): +LLVOCache::LLVOCache(bool read_only) : mInitialized(false), - mReadOnly(true), + mReadOnly(read_only), mNumEntries(0), mCacheSize(1) { diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h index 594d38249b..6c95541c11 100644 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -221,9 +221,9 @@ private: // //Note: LLVOCache is not thread-safe // -class LLVOCache : public LLSingleton<LLVOCache> +class LLVOCache : public LLParamSingleton<LLVOCache> { - LLSINGLETON(LLVOCache); + LLSINGLETON(LLVOCache, bool read_only); ~LLVOCache() ; private: @@ -259,15 +259,14 @@ private: typedef std::map<U64, HeaderEntryInfo*> handle_entry_map_t; public: - void initCache(ELLPath location, U32 size, U32 cache_version) ; + // We need this init to be separate from constructor, since we might construct cache, purge it, then init. + void initCache(ELLPath location, U32 size, U32 cache_version); void removeCache(ELLPath location, bool started = false) ; void readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::vocache_entry_map_t& cache_entry_map) ; void writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache, bool removal_enabled); void removeEntry(U64 handle) ; - void setReadOnly(bool read_only) {mReadOnly = read_only;} - U32 getCacheEntries() { return mNumEntries; } U32 getCacheEntriesMax() { return mCacheSize; } diff --git a/indra/newview/llvoicecallhandler.cpp b/indra/newview/llvoicecallhandler.cpp index 2050dab689..1e993d1384 100644 --- a/indra/newview/llvoicecallhandler.cpp +++ b/indra/newview/llvoicecallhandler.cpp @@ -40,7 +40,7 @@ public: bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { - if (!LLUI::sSettingGroups["config"]->getBOOL("EnableVoiceCall")) + if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableVoiceCall")) { LLNotificationsUtil::add("NoVoiceCall", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); return true; diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 5c107cc10b..d8c8cb0461 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -116,7 +116,7 @@ std::string LLVoiceClientStatusObserver::status2string(LLVoiceClientStatusObserv /////////////////////////////////////////////////////////////////////////////////////////////// -LLVoiceClient::LLVoiceClient() +LLVoiceClient::LLVoiceClient(LLPumpIO *pump) : mVoiceModule(NULL), m_servicePump(NULL), @@ -133,6 +133,7 @@ LLVoiceClient::LLVoiceClient() mDisableMic(false) { updateSettings(); + init(pump); } //--------------------------------------------------- diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index 758e9cecd7..f95b853c31 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -310,9 +310,9 @@ public: }; -class LLVoiceClient: public LLSingleton<LLVoiceClient> +class LLVoiceClient: public LLParamSingleton<LLVoiceClient> { - LLSINGLETON(LLVoiceClient); + LLSINGLETON(LLVoiceClient, LLPumpIO *pump); LOG_CLASS(LLVoiceClient); ~LLVoiceClient(); @@ -320,7 +320,6 @@ public: typedef boost::signals2::signal<void(void)> micro_changed_signal_t; micro_changed_signal_t mMicroChangedSignal; - void init(LLPumpIO *pump); // Call this once at application startup (creates connector) void terminate(); // Call this to clean up during shutdown const LLVoiceVersionInfo getVersion(); @@ -472,6 +471,8 @@ public: // Returns NULL if voice effects are not supported, or not enabled. LLVoiceEffectInterface* getVoiceEffectInterface() const; //@} +private: + void init(LLPumpIO *pump); protected: LLVoiceModuleInterface* mVoiceModule; diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 0d3f65502a..739f7bd47c 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -658,6 +658,8 @@ void LLVivoxVoiceClient::voiceControlCoro() mIsCoroutineActive = true; LLCoros::set_consuming(true); + U32 retry = 0; + while (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE) { LL_DEBUGS("Voice") << "Suspending voiceControlCoro() momentarily for teleport. Tuning: " << mTuningMode << ". Relog: " << mRelogRequested << LL_ENDL; @@ -666,7 +668,8 @@ void LLVivoxVoiceClient::voiceControlCoro() do { - if (startAndConnectSession()) + bool success = startAndConnectSession(); + if (success) { if (mTuningMode) { @@ -677,6 +680,7 @@ void LLVivoxVoiceClient::voiceControlCoro() LL_DEBUGS("Voice") << "lost channel RelogRequested=" << mRelogRequested << LL_ENDL; endAndDisconnectSession(); + retry = 0; } // if we hit this and mRelogRequested is true, that indicates @@ -689,7 +693,19 @@ void LLVivoxVoiceClient::voiceControlCoro() << LL_ENDL; if (mRelogRequested) { - LL_INFOS("Voice") << "will attempt to reconnect to voice" << LL_ENDL; + if (!success) + { + // We failed to connect, give it a bit time before retrying. + retry++; + F32 delay = llmin(5.f * (F32)retry, 60.f); + llcoro::suspendUntilTimeout(delay); + LL_INFOS("Voice") << "Voice failed to establish session after " << retry << " tries. Will attempt to reconnect." << LL_ENDL; + } + else + { + LL_INFOS("Voice") << "will attempt to reconnect to voice" << LL_ENDL; + } + while (isGatewayRunning() || gAgent.getTeleportState() != LLAgent::TELEPORT_NONE) { LL_INFOS("Voice") << "waiting for SLVoice to exit" << LL_ENDL; @@ -770,12 +786,16 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon() { #ifndef VIVOXDAEMON_REMOTEHOST // Launch the voice daemon - std::string exe_path = gDirUtilp->getAppRODataDir(); #if LL_WINDOWS + // On windows use exe (not work or RO) directory + std::string exe_path = gDirUtilp->getExecutableDir(); gDirUtilp->append(exe_path, "SLVoice.exe"); #elif LL_DARWIN + // On MAC use resource directory + std::string exe_path = gDirUtilp->getAppRODataDir(); gDirUtilp->append(exe_path, "SLVoice"); #else + std::string exe_path = gDirUtilp->getExecutableDir(); gDirUtilp->append(exe_path, "SLVoice"); #endif // See if the vivox executable exists @@ -804,6 +824,20 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon() params.args.add("-lf"); params.args.add(log_folder); + // set log file basename and .log + params.args.add("-lp"); + params.args.add("SLVoice"); + params.args.add("-ls"); + params.args.add(".log"); + + // rotate any existing log + std::string new_log = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SLVoice.log"); + std::string old_log = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SLVoice.old"); + if (gDirUtilp->fileExists(new_log)) + { + LLFile::rename(new_log, old_log); + } + std::string shutdown_timeout = gSavedSettings.getString("VivoxShutdownTimeout"); if (!shutdown_timeout.empty()) { diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 73d2aa6a5c..0a1efd564f 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -85,6 +85,7 @@ #include "llviewerinventory.h" #include "llcallstack.h" #include "llsculptidsize.h" +#include "llavatarappearancedefines.h" const F32 FORCE_SIMPLE_RENDER_AREA = 512.f; const F32 FORCE_CULL_AREA = 8.f; @@ -188,7 +189,7 @@ public: virtual bool isInterestingEnough() const { - return LLViewerMedia::isInterestingEnough(mObject, getMediaInterest()); + return LLViewerMedia::getInstance()->isInterestingEnough(mObject, getMediaInterest()); } virtual std::string getCapabilityUrl(const std::string &name) const @@ -2445,7 +2446,13 @@ S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialPa case LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE: case LLMaterial::DIFFUSE_ALPHA_MODE_MASK: { //all of them modes available only for 32 bit textures - if(GL_RGBA != img_diffuse->getPrimaryFormat()) + LLTextureEntry* tex_entry = getTE(te); + bool bIsBakedImageId = false; + if (tex_entry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(tex_entry->getID())) + { + bIsBakedImageId = true; + } + if (GL_RGBA != img_diffuse->getPrimaryFormat() && !bIsBakedImageId) { bSetDiffuseNone = true; } @@ -2698,7 +2705,7 @@ void LLVOVolume::syncMediaData(S32 texture_index, const LLSD &media_data, bool m LLUUID updating_agent = LLTextureEntry::getAgentIDFromMediaVersionString(getMediaURL()); update_from_self = (updating_agent == gAgent.getID()); } - viewer_media_t media_impl = LLViewerMedia::updateMediaImpl(mep, previous_url, update_from_self); + viewer_media_t media_impl = LLViewerMedia::getInstance()->updateMediaImpl(mep, previous_url, update_from_self); addMediaImpl(media_impl, texture_index) ; } diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index ee2270c323..e7bbee5efd 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -455,6 +455,7 @@ clothing_to_string_map_t init_clothing_string_map() w_map.insert(std::make_pair(LLWearableType::WT_SKIRT, "skirt_not_worn")); w_map.insert(std::make_pair(LLWearableType::WT_ALPHA, "alpha_not_worn")); w_map.insert(std::make_pair(LLWearableType::WT_TATTOO, "tattoo_not_worn")); + w_map.insert(std::make_pair(LLWearableType::WT_UNIVERSAL, "universal_not_worn")); w_map.insert(std::make_pair(LLWearableType::WT_PHYSICS, "physics_not_worn")); return w_map; } diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 61ec02957e..a34c5826ed 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -39,7 +39,6 @@ #include "lllogininstance.h" #include "llparcel.h" #include "llsd.h" -#include "lltoastalertpanel.h" #include "llui.h" #include "lluri.h" #include "llversioninfo.h" @@ -57,32 +56,6 @@ bool on_load_url_external_response(const LLSD& notification, const LLSD& response, bool async ); -class URLLoader : public LLToastAlertPanel::URLLoader -{ - virtual void load(const std::string& url , bool force_open_externally) - { - if (force_open_externally) - { - LLWeb::loadURLExternal(url); - } - else - { - LLWeb::loadURL(url); - } - } -}; -static URLLoader sAlertURLLoader; - - -// static -void LLWeb::initClass() -{ - LLToastAlertPanel::setURLLoader(&sAlertURLLoader); -} - - - - // static void LLWeb::loadURL(const std::string& url, const std::string& target, const std::string& uuid) { @@ -121,7 +94,7 @@ void LLWeb::loadURLExternal(const std::string& url, const std::string& uuid) void LLWeb::loadURLExternal(const std::string& url, bool async, const std::string& uuid) { // Act like the proxy window was closed, since we won't be able to track targeted windows in the external browser. - LLViewerMedia::proxyWindowClosed(uuid); + LLViewerMedia::getInstance()->proxyWindowClosed(uuid); if(gSavedSettings.getBOOL("DisableExternalBrowser")) { diff --git a/indra/newview/llweb.h b/indra/newview/llweb.h index 7149ce9baf..0426f00f27 100644 --- a/indra/newview/llweb.h +++ b/indra/newview/llweb.h @@ -46,8 +46,6 @@ public: BROWSER_INT_LL_EXT_OTHERS = 1, BROWSER_INTERNAL_ONLY = 2 }; - - static void initClass(); /// Load the given url in the operating system's web browser, async if we want to return immediately /// before browser has spawned diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp index 8dcef2c7cd..569f479a16 100644 --- a/indra/newview/llwebprofile.cpp +++ b/indra/newview/llwebprofile.cpp @@ -83,7 +83,7 @@ void LLWebProfile::setAuthCookie(const std::string& cookie) LLCore::HttpHeaders::ptr_t LLWebProfile::buildDefaultHeaders() { LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); - LLSD headers = LLViewerMedia::getHeaders(); + LLSD headers = LLViewerMedia::getInstance()->getHeaders(); for (LLSD::map_iterator it = headers.beginMap(); it != headers.endMap(); ++it) { diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index 5367262bb6..9e4297baaf 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -69,7 +69,7 @@ LLWindowListener::LLWindowListener(LLViewerWindow *window, const KeyboardGetter& std::string buttonExplain = "(button values \"LEFT\", \"MIDDLE\", \"RIGHT\")\n"; std::string paramsExplain = - "[\"path\"] is as for LLUI::resolvePath(), described in\n" + "[\"path\"] is as for LLUI::getInstance()->resolvePath(), described in\n" "http://bitbucket.org/lindenlab/viewer-release/src/tip/indra/llui/llui.h\n" "If you omit [\"path\"], you must specify both [\"x\"] and [\"y\"].\n" "If you specify [\"path\"] without both [\"x\"] and [\"y\"], will synthesize (x, y)\n" @@ -209,7 +209,7 @@ void LLWindowListener::getInfo(LLSD const & evt) if (evt.has("path")) { std::string path(evt["path"]); - LLView * target_view = LLUI::resolvePath(LLUI::getRootView(), path); + LLView * target_view = LLUI::getInstance()->resolvePath(LLUI::getInstance()->getRootView(), path); if (target_view != 0) { response.setResponse(target_view->getInfo()); @@ -230,7 +230,7 @@ void LLWindowListener::getInfo(LLSD const & evt) void LLWindowListener::getPaths(LLSD const & request) { Response response(LLSD(), request); - LLView *root(LLUI::getRootView()), *base(NULL); + LLView *root(LLUI::getInstance()->getRootView()), *base(NULL); // Capturing request["under"] as string means we conflate the case in // which there is no ["under"] key with the case in which its value is the // empty string. That seems to make sense to me. @@ -243,7 +243,7 @@ void LLWindowListener::getPaths(LLSD const & request) } else { - base = LLUI::resolvePath(root, under); + base = LLUI::getInstance()->resolvePath(root, under); if (! base) { return response.error(STRINGIZE(request["op"].asString() << " request " @@ -268,7 +268,7 @@ void LLWindowListener::keyDown(LLSD const & evt) if (evt.has("path")) { std::string path(evt["path"]); - LLView * target_view = LLUI::resolvePath(LLUI::getRootView(), path); + LLView * target_view = LLUI::getInstance()->resolvePath(LLUI::getInstance()->getRootView(), path); if (target_view == 0) { response.error(STRINGIZE(evt["op"].asString() << " request " @@ -303,7 +303,7 @@ void LLWindowListener::keyUp(LLSD const & evt) if (evt.has("path")) { std::string path(evt["path"]); - LLView * target_view = LLUI::resolvePath(LLUI::getRootView(), path); + LLView * target_view = LLUI::getInstance()->resolvePath(LLUI::getInstance()->getRootView(), path); if (target_view == 0 ) { response.error(STRINGIZE(evt["op"].asString() << " request " @@ -407,8 +407,8 @@ static void mouseEvent(const MouseFunc& func, const LLSD& request) } else // ! path.empty() { - LLView* root = LLUI::getRootView(); - LLView* target = LLUI::resolvePath(root, path); + LLView* root = LLUI::getInstance()->getRootView(); + LLView* target = LLUI::getInstance()->resolvePath(root, path); if (! target) { return response.error(STRINGIZE(request["op"].asString() << " request " diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp index 066cb9a0ac..986f167d8d 100644 --- a/indra/newview/llwlparamset.cpp +++ b/indra/newview/llwlparamset.cpp @@ -337,14 +337,19 @@ void LLWLParamSet::mix(LLWLParamSet& src, LLWLParamSet& dest, F32 weight) setStarBrightness((1 - weight) * (F32) src.getStarBrightness() + weight * (F32) dest.getStarBrightness()); - llassert(src.getSunAngle() >= - F_PI && - src.getSunAngle() <= 3 * F_PI); - llassert(dest.getSunAngle() >= - F_PI && - dest.getSunAngle() <= 3 * F_PI); - llassert(src.getEastAngle() >= 0 && - src.getEastAngle() <= 4 * F_PI); - llassert(dest.getEastAngle() >= 0 && - dest.getEastAngle() <= 4 * F_PI); + // FIXME: we have established that this assert fails + // frequently. Someone who understands the code needs to figure + // out if it matters. In the meantime, disabling the checks so we + // can stop interfering with other development. + + //llassert(src.getSunAngle() >= - F_PI && + // src.getSunAngle() <= 3 * F_PI); + //llassert(dest.getSunAngle() >= - F_PI && + // dest.getSunAngle() <= 3 * F_PI); + //llassert(src.getEastAngle() >= 0 && + // src.getEastAngle() <= 4 * F_PI); + //llassert(dest.getEastAngle() >= 0 && + // dest.getEastAngle() <= 4 * F_PI); // sun angle and east angle require some handling to make sure // they go in circles. Yes quaternions would work better. diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index cee47a591e..89f5eb86b3 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -916,10 +916,10 @@ void LLWorld::updateWaterObjects() } } - for (std::list<LLVOWater*>::iterator iter = mHoleWaterObjects.begin(); + for (std::list<LLPointer<LLVOWater> >::iterator iter = mHoleWaterObjects.begin(); iter != mHoleWaterObjects.end(); ++ iter) { - LLVOWater* waterp = *iter; + LLVOWater* waterp = (*iter).get(); gObjectList.killObject(waterp); } mHoleWaterObjects.clear(); diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h index c9ac241d5a..993fbfb2cc 100644 --- a/indra/newview/llworld.h +++ b/indra/newview/llworld.h @@ -199,7 +199,7 @@ private: // Data for "Fake" objects // - std::list<LLVOWater*> mHoleWaterObjects; + std::list<LLPointer<LLVOWater> > mHoleWaterObjects; LLPointer<LLVOWater> mEdgeWaterObjects[8]; LLPointer<LLViewerTexture> mDefaultWaterTexturep; diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 86249badaa..9bc3a2a33b 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -1622,7 +1622,7 @@ BOOL LLWorldMapView::handleMouseUp( S32 x, S32 y, MASK mask ) LLRect clip_rect = getRect(); clip_rect.stretch(-8); clip_rect.clipPointToRect(mMouseDownX, mMouseDownY, local_x, local_y); - LLUI::setMousePositionLocal(this, local_x, local_y); + LLUI::getInstance()->setMousePositionLocal(this, local_x, local_y); // finish the pan mPanning = FALSE; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index a72244929e..bd73c234a6 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4062,7 +4062,6 @@ void LLPipeline::postSort(LLCamera& camera) void render_hud_elements() { - LL_RECORD_BLOCK_TIME(FTM_RENDER_UI); gPipeline.disableLights(); LLGLDisable fog(GL_FOG); diff --git a/indra/newview/skins/default/textures/icons/Inv_Universal.png b/indra/newview/skins/default/textures/icons/Inv_Universal.png Binary files differnew file mode 100644 index 0000000000..470febb9b5 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Inv_Universal.png diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 2540ee148d..5aba0546f3 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -133,7 +133,6 @@ with the same filename but different name <texture name="Command_Chat_Icon" file_name="toolbar_icons/chat.png" preload="true" /> <texture name="Command_Compass_Icon" file_name="toolbar_icons/land.png" preload="true" /> <texture name="Command_Destinations_Icon" file_name="toolbar_icons/destinations.png" preload="true" /> - <texture name="Command_Facebook_Icon" file_name="toolbar_icons/facebook.png" preload="true" /> <texture name="Command_Flickr_Icon" file_name="toolbar_icons/flickr.png" preload="true" /> <texture name="Command_Gestures_Icon" file_name="toolbar_icons/gestures.png" preload="true" /> <texture name="Command_Grid_Status_Icon" file_name="toolbar_icons/grid_status.png" preload="true" /> @@ -205,8 +204,6 @@ with the same filename but different name <texture name="ExternalBrowser_Off" file_name="icons/ExternalBrowser_Off.png" preload="false" /> <texture name="Edit_Wrench" file_name="icons/Edit_Wrench.png" preload="false" /> - <texture name="Facebook_Icon" file_name="icons/Facebook.png" preload="false" /> - <texture name="Presets_Icon" file_name="icons/Presets_Icon.png" preload="true" /> <texture name="Favorite_Star_Active" file_name="navbar/Favorite_Star_Active.png" preload="false" /> @@ -316,6 +313,7 @@ with the same filename but different name <texture name="Inv_SysClosed" file_name="icons/Inv_SysClosed.png" preload="false" /> <texture name="Inv_SysOpen" file_name="icons/Inv_SysOpen.png" preload="false" /> <texture name="Inv_Tattoo" file_name="icons/Inv_Tattoo.png" preload="false" /> + <texture name="Inv_Universal" file_name="icons/Inv_Universal.png" preload="false" /> <texture name="Inv_Physics" file_name="icons/Inv_Physics.png" preload="false" /> <texture name="Inv_Texture" file_name="icons/Inv_Texture.png" preload="false" /> <texture name="Inv_TrashClosed" file_name="icons/Inv_TrashClosed.png" preload="false" /> @@ -592,7 +590,6 @@ with the same filename but different name <texture name="Snapshot_Email" file_name="snapshot_email.png" preload="false" /> <texture name="Snapshot_Inventory" file_name="toolbar_icons/inventory.png" preload="false" /> <texture name="Snapshot_Profile" file_name="toolbar_icons/profile.png" preload="false" /> - <texture name="Snapshot_Facebook" file_name="toolbar_icons/facebook.png" preload="false" /> <texture name="startup_logo" file_name="windows/startup_logo.png" preload="true" /> diff --git a/indra/newview/skins/default/xui/de/floater_about_land.xml b/indra/newview/skins/default/xui/de/floater_about_land.xml index 1e18ab20e8..4dd64cba2a 100644 --- a/indra/newview/skins/default/xui/de/floater_about_land.xml +++ b/indra/newview/skins/default/xui/de/floater_about_land.xml @@ -9,6 +9,12 @@ <floater.string name="maturity_icon_adult"> "Parcel_R_Dark" </floater.string> + <floater.string name="Hours"> + [HOURS] Stunden + </floater.string> + <floater.string name="Hour"> + Std. + </floater.string> <floater.string name="Minutes"> [MINUTES] Min. </floater.string> @@ -21,6 +27,9 @@ <floater.string name="Remaining"> Restzeit </floater.string> + <floater.string name="Always"> + Immer + </floater.string> <tab_container name="landtab" tab_min_width="40" width="489"> <panel label="ALLGEMEIN" name="land_general_panel"> <panel.string name="new users only"> @@ -319,18 +328,18 @@ Nur große Parzellen können in der Suche aufgeführt werden. <text name="allow_label2"> Bauen: </text> - <check_box label="Jeder" name="edit objects check"/> - <check_box label="Gruppe" name="edit group objects check"/> + <check_box label="Jeder" name="edit objects check" tool_tip="Wenn aktiviert, können Einwohner auf Ihrem Land Objekte erstellen und rezzen."/> + <check_box label="Gruppe" name="edit group objects check" tool_tip="Wenn aktiviert, können Parzellengruppen-Mitglieder auf Ihrem Land Objekte erstellen und rezzen."/> <text name="allow_label3"> Objekteintritt: </text> - <check_box label="Jeder" name="all object entry check"/> - <check_box label="Gruppe" name="group object entry check"/> + <check_box label="Jeder" name="all object entry check" tool_tip="Wenn aktiviert, können Einwohner bestehende Objekte von anderen Parzellen auf diese Parzelle verschieben."/> + <check_box label="Gruppe" name="group object entry check" tool_tip="Wenn aktiviert, können Parzellengruppen-Mitglieder bestehende Objekte von anderen Parzellen auf diese Parzelle verschieben."/> <text name="allow_label4"> Skripts ausführen: </text> - <check_box label="Jeder" name="check other scripts"/> - <check_box label="Gruppe" name="check group scripts"/> + <check_box label="Jeder" name="check other scripts" tool_tip="Wenn aktiviert, können Einwohner auf Ihrer Parzelle Skripte inklusive Anhängen ausführen."/> + <check_box label="Gruppe" name="check group scripts" tool_tip="Wenn aktiviert, können Parzellengruppen-Mitglieder auf Ihrer Parzelle Skripte inklusive Anhängen ausführen."/> <check_box label="Sicher (kein Schaden)" name="check safe" tool_tip="Falls aktiviert, wird Land auf Option „Sicher“ eingestellt, Kampfschäden sind deaktiviert. Ansonsten sind Kampfschäden aktiviert."/> <check_box label="Kein Stoßen" name="PushRestrictCheck" tool_tip="Verhindert Stoßen durch Skripte. Durch Aktivieren dieser Option verhindern Sie störendes Verhalten auf Ihrem Land."/> <check_box label="Ort in Suche anzeigen (30 L$/Woche)" name="ShowDirectoryCheck" tool_tip="Diese Parzelle in Suchergebnissen anzeigen."/> @@ -354,15 +363,15 @@ Nur große Parzellen können in der Suche aufgeführt werden. Foto: </text> <texture_picker label="" name="snapshot_ctrl" tool_tip="Klicken Sie hier, um ein Bild auszuwählen"/> - <text name="allow_label5"> - Avatare in anderen Parzellen können Avatare in dieser Parzelle sehen und mit ihnen chatten + <text name="allow_see_label"> + Avatare in anderen Parzellen können Avatare in dieser Parzelle sehen und mit ihnen chatten. </text> <check_box label="Avatare sehen" name="SeeAvatarsCheck" tool_tip="Gestattet sowohl Avataren auf anderen Parzellen, Avatare auf dieser Parzelle zu sehen und mit ihnen zu chatten, als auch Ihnen, diese Avatare auf anderen Parzellen zu sehen und mit ihnen zu chatten."/> <text name="landing_point"> Landepunkt: [LANDING] </text> - <button label="Festlegen" label_selected="Festlegen" left="234" name="Set" right="-88" tool_tip="Legt Ihren Standort als Landepunkt fest, an dem Besucher ankommen. Legt die Position Ihres Avatars innerhalb dieser Parzelle fest." width="70"/> - <button label="Löschen" label_selected="Löschen" left="312" name="Clear" tool_tip="Landepunkt löschen" width="70"/> + <button label="Festlegen" label_selected="Festlegen" name="Set" tool_tip="Legt Ihren Standort als Landepunkt fest, an dem Besucher ankommen. Legt die Position Ihres Avatars innerhalb dieser Parzelle fest." width="70"/> + <button label="Löschen" label_selected="Löschen" name="Clear" tool_tip="Landepunkt löschen" width="70"/> <text name="Teleport Routing: "> Teleport-Route: </text> @@ -433,7 +442,7 @@ Nur große Parzellen können in der Suche aufgeführt werden. <panel.string name="estate_override"> Eine oder mehrere dieser Optionen gelten auf Grundbesitzebene </panel.string> - <check_box label="Alle Besucher sind zugelassen (Bei Deaktivierung dieser Option werden Bannlinien generiert)" name="public_access"/> + <check_box label="Alle Besucher sind zugelassen" tool_tip="Bei Deaktivierung dieser Option werden Bannlinien generiert" name="public_access"/> <check_box label="Muss 18+ sein [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="Nur Einwohner, die mindestens 18 Jahre alt sind, können diese Parzelle betreten. Weitere Informationen finden Sie unter [SUPPORT_SITE]."/> <check_box label="Muss über Zahlungsinfo in Datei [ESTATE_PAYMENT_LIMIT] verfügen" name="limit_payment" tool_tip="Um diese Parzelle besuchen zu können, müssen Einwohner Zahlungsinformationen hinterlegt haben. Weitere Informationen finden Sie auf [SUPPORT_SITE]."/> <check_box label="Gruppe [GROUP] ohne Beschränkungen zulassen" name="GroupCheck" tool_tip="Gruppe im Register „Allgemein“ festlegen."/> @@ -457,9 +466,12 @@ Nur große Parzellen können in der Suche aufgeführt werden. </panel> <panel name="Banned_layout_panel"> <text label="Verbannen" name="BanCheck"> - Immer verbannt ([COUNT], max. [MAX]) + Verbannt ([COUNT], max. [MAX]) </text> - <name_list name="BannedList" tool_tip="([LISTED] aufgeführt, [MAX] max)"/> + <name_list name="BannedList" tool_tip="([LISTED] aufgeführt, [MAX] max)"> + <columns label="Name" name="name"/> + <columns label="Dauer" name="duration"/> + </name_list> <button label="Hinzufügen" name="add_banned"/> <button label="Entfernen" label_selected="Entfernen" name="remove_banned"/> </panel> diff --git a/indra/newview/skins/default/xui/de/floater_ban_duration.xml b/indra/newview/skins/default/xui/de/floater_ban_duration.xml new file mode 100644 index 0000000000..19e55f5527 --- /dev/null +++ b/indra/newview/skins/default/xui/de/floater_ban_duration.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="ban_duration" title="Verbannungsdauer"> + <text name="duration_textbox"> + Verbannungsdauer: + </text> + <radio_group name="ban_duration_radio"> + <radio_item label="Immer" name="always_radio"> + Immer + </radio_item> + <radio_item label="Temporär" name="temporary_radio"> + Temporär + </radio_item> + </radio_group> + <text name="hours_textbox"> + Stunden. + </text> + <button label="OK" name="ok_btn"/> + <button label="Abbrechen" name="cancel_btn"/> +</floater> diff --git a/indra/newview/skins/default/xui/de/floater_gesture.xml b/indra/newview/skins/default/xui/de/floater_gesture.xml index 7b35da8d5c..0a82535040 100644 --- a/indra/newview/skins/default/xui/de/floater_gesture.xml +++ b/indra/newview/skins/default/xui/de/floater_gesture.xml @@ -21,7 +21,7 @@ <button name="activate_btn" tool_tip="Ausgewählte Geste aktivieren/deaktivieren"/> <button name="del_btn" tool_tip="Diese Geste löschen"/> </panel> - <button label="Bearbeiten" name="edit_btn"/> - <button label="Abspielen" name="play_btn"/> + <button label="Bearbeiten" name="edit_btn" tool_tip="Fenster zum Bearbeiten der ausgewählten Geste öffnen."/> + <button label="Abspielen" name="play_btn" tool_tip="Ausgewählte Geste inworld ausführen."/> <button label="Stopp" name="stop_btn"/> </floater> diff --git a/indra/newview/skins/default/xui/de/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/de/floater_preferences_graphics_advanced.xml index 1361366bd5..41e8dc5ef4 100644 --- a/indra/newview/skins/default/xui/de/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/de/floater_preferences_graphics_advanced.xml @@ -43,6 +43,7 @@ <check_box label="Anisotropische Filterung (langsamer, wenn aktiviert)" name="ani"/> <check_box initial_value="true" label="OpenGL Vertex-Buffer-Objekte aktivieren" name="vbo" tool_tip="Wenn Sie über moderne Grafikhardware verfügen, können Sie durch Aktivieren dieser Option die Geschwindigkeit verbessern. Bei alter Hardware sind die VBO oft schlecht implementiert, was zu Abstürzen führen kann, wenn diese Option aktiviert ist."/> <check_box initial_value="true" label="Texturkomprimierung aktivieren (Neustart erforderlich)" name="texture compression" tool_tip="Komprimiert Texturen im Videospeicher, damit höher auflösende Texturen geladen werden können (leichte Beeinträchtigung der Farbqualität)."/> + <check_box initial_value="true" label="Unterstützung für HiDPI-Displays aktivieren (Neustart erforderlich)" name="use HiDPI" tool_tip="OpenGL für hochauflösende Darstellung aktivieren."/> <text name="antialiasing label"> Antialiasing: </text> diff --git a/indra/newview/skins/default/xui/de/floater_preview_notecard.xml b/indra/newview/skins/default/xui/de/floater_preview_notecard.xml index 14e666fd22..21419d8e10 100644 --- a/indra/newview/skins/default/xui/de/floater_preview_notecard.xml +++ b/indra/newview/skins/default/xui/de/floater_preview_notecard.xml @@ -15,6 +15,7 @@ <text_editor name="Notecard Editor"> Wird geladen... </text_editor> + <button label="Bearbeiten..." label_selected="Bearbeiten" name="Edit"/> <button label="Speichern" label_selected="Speichern" name="Save"/> <button label="Löschen" label_selected="Löschen" name="Delete"/> </floater> diff --git a/indra/newview/skins/default/xui/de/floater_report_abuse.xml b/indra/newview/skins/default/xui/de/floater_report_abuse.xml index 6999679b3f..154256b53e 100644 --- a/indra/newview/skins/default/xui/de/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/de/floater_report_abuse.xml @@ -77,7 +77,7 @@ Objekt: <combo_box.item label="Land > Unbefugte Nutzung > Objekte oder Texturen" name="Land__Encroachment__Objects_textures"/> <combo_box.item label="Land > Unbefugte Nutzung > Partikel" name="Land__Encroachment__Particles"/> <combo_box.item label="Land > Unbefugte Nutzung > Bäume/Pflanzen" name="Land__Encroachment__Trees_plants"/> - <combo_box.item label="Verstoß gegen die Spielerichtlinie" name="Wagering_gambling"/> + <combo_box.item label="Verstoß gegen die Geschicklichkeits-Spielerichtlinie" name="Wagering_gambling"/> <combo_box.item label="Sonstige" name="Other"/> </combo_box> <text name="abuser_name_title"> diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index 17ed6a5385..feb1ae23a5 100644 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -1607,7 +1607,7 @@ Ersetzen Sie die Textur [TEXTURE_NUM] mit einer Bilddatei von maximal 512x512 un [AGENT] wurden zur [LIST_TYPE]-Liste von [ESTATE] hinzugefügt. </notification> <notification name="AgentWasRemovedFromList"> - [AGENT] wurden von der [LIST_TYPE]-Liste von [ESTATE] entfernt. + [AGENT] wurde von der [LIST_TYPE]-Liste von [ESTATE] entfernt. </notification> <notification name="AgentsWereRemovedFromList"> [AGENT] wurden von der [LIST_TYPE]-Liste von [ESTATE] entfernt. diff --git a/indra/newview/skins/default/xui/de/panel_group_general.xml b/indra/newview/skins/default/xui/de/panel_group_general.xml index 9d4301de73..9fec5a242d 100644 --- a/indra/newview/skins/default/xui/de/panel_group_general.xml +++ b/indra/newview/skins/default/xui/de/panel_group_general.xml @@ -46,7 +46,7 @@ Bewegen Sie die Maus über die Optionen, um weitere Informationen anzuzeigen. <check_box label="Jeder kann beitreten" name="open_enrollement" tool_tip="Festlegen, ob der Gruppenbeitritt ohne Einladung zulässig ist."/> <check_box label="Kosten für Beitritt" name="check_enrollment_fee" tool_tip="Festlegen, ob Neumitglieder eine Beitrittsgebühr zahlen müssen"/> <spinner label="L$" name="spin_enrollment_fee" tool_tip="Wenn Beitrittsgebühr aktiviert ist, müssen neue Mitglieder diesen Betrag zahlen."/> - <combo_box name="group_mature_check" tool_tip="Legt fest, ob Ihre Gruppeninformation moderate Inhalte enthält"> + <combo_box name="group_mature_check" tool_tip="Inhaltseinstufungen kennzeichnen die in einer Gruppe zulässigen Inhalte und Verhaltensweisen"> <combo_item name="select_mature"> - Inhaltseinstufung auswählen - </combo_item> diff --git a/indra/newview/skins/default/xui/de/panel_region_access.xml b/indra/newview/skins/default/xui/de/panel_region_access.xml index 4ebc4867fb..d2448bea7e 100644 --- a/indra/newview/skins/default/xui/de/panel_region_access.xml +++ b/indra/newview/skins/default/xui/de/panel_region_access.xml @@ -14,6 +14,7 @@ <panel label="ZULÄSSIG" name="allowed_panel"> <panel label="top_panel" name="allowed_search_panel"> <filter_editor label="Zulässige Agenten suchen" name="allowed_search_input"/> + <button label="Kopieren" name="copy_allowed_list_btn"/> </panel> <text name="allow_resident_label"> Immer zugelassen: @@ -26,7 +27,8 @@ </panel> <panel label="ZULÄSSIGE GRUPPEN" name="allowed_groups_panel"> <panel label="top_panel" name="allowed_group_search_panel"> - <filter_editor label="Zulässige Gruppen Suchen" name="allowed_group_search_input"/> + <filter_editor label="Zulässige Gruppen suchen" name="allowed_group_search_input"/> + <button label="Kopieren" name="copy_allowed_group_list_btn"/> </panel> <text name="allow_group_label"> Immer zugelassene Gruppen: @@ -40,6 +42,7 @@ <panel label="VERBANNT" name="banned_panel"> <panel label="top_panel" name="banned_search_panel"> <filter_editor label="Verbannte Agenten suchen" name="banned_search_input"/> + <button label="Kopieren" name="copy_banned_list_btn"/> </panel> <text name="ban_resident_label"> Immer verbannt: diff --git a/indra/newview/skins/default/xui/de/panel_region_estate.xml b/indra/newview/skins/default/xui/de/panel_region_estate.xml index b713dd58d0..f6a5ed22f9 100644 --- a/indra/newview/skins/default/xui/de/panel_region_estate.xml +++ b/indra/newview/skins/default/xui/de/panel_region_estate.xml @@ -16,7 +16,7 @@ (unbekannt) </text> <radio_group name="externally_visible_radio"> - <radio_item label="Nur Einwohner und Gruppen zulassen, die im Reiter "Zugang" aufgelistet sind." name="estate_restricted_access"/> + <radio_item label="Nur Einwohner und Gruppen zulassen, die im Reiter "Zugang" aufgelistet sind" name="estate_restricted_access"/> <radio_item label="Alle Besucher zugelassen" name="estate_public_access"/> </radio_group> <check_box label="Muss 18+ sein" name="limit_age_verified" tool_tip="Nur Einwohner, die mindestens 18 Jahre alt sind, können diesen Grundbesitz betreten. Weitere Informationen finden Sie unter [SUPPORT_SITE]."/> diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml index 95eb88614b..0fa4ec9aff 100644 --- a/indra/newview/skins/default/xui/de/strings.xml +++ b/indra/newview/skins/default/xui/de/strings.xml @@ -75,6 +75,9 @@ Erweitertes Beleuchtungsmodell: [GPU_SHADERS] Texturspeicher: [TEXTURE_MEMORY] MB Erstellungszeit VFS (Cache): [VFS_TIME] </string> + <string name="AboutOSXHiDPI"> + HiDPI-Anzeigemodus: [HIDPI] + </string> <string name="AboutLibs"> J2C-Decoderversion: [J2C_VERSION] Audiotreiberversion: [AUDIO_DRIVER_VERSION] @@ -1477,6 +1480,15 @@ besuchen Sie bitte http://secondlife.com/support <string name="MarketplaceURL_LearnMore"> https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more </string> + <string name="InventoryPlayAnimationTooltip"> + Fenster mit Spieloptionen öffnen. + </string> + <string name="InventoryPlayGestureTooltip"> + Ausgewählte Geste inworld ausführen. + </string> + <string name="InventoryPlaySoundTooltip"> + Fenster mit Spieloptionen öffnen. + </string> <string name="InventoryOutboxNotMerchantTitle"> Jeder kann Artikel im Marktplatz verkaufen. </string> @@ -5398,9 +5410,6 @@ Setzen Sie den Editorpfad in Anführungszeichen <string name="Command_Destinations_Label"> Ziele </string> - <string name="Command_Facebook_Label"> - Facebook - </string> <string name="Command_Flickr_Label"> Flickr </string> @@ -5494,9 +5503,6 @@ Setzen Sie den Editorpfad in Anführungszeichen <string name="Command_Destinations_Tooltip"> Ziele von Interesse </string> - <string name="Command_Facebook_Tooltip"> - Auf Facebook posten - </string> <string name="Command_Flickr_Tooltip"> Auf Flickr hochladen </string> 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 d04e738b22..9f853fd960 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -163,6 +163,7 @@ layout="topleft" left_pad="2" name="Description" + spellcheck="true" top_delta="0" width="365" word_wrap="true" /> @@ -1268,6 +1269,7 @@ Only large parcels can be listed in search. layout="topleft" left_pad="2" name="edit objects check" + tool_tip="If checked, Residents can create and rez objects on your land." width="130" /> <check_box height="16" @@ -1275,6 +1277,7 @@ Only large parcels can be listed in search. layout="topleft" left_pad="2" name="edit group objects check" + tool_tip="If checked, parcel group members can create and rez objects on your land." width="70" /> <text type="string" @@ -1293,6 +1296,7 @@ Only large parcels can be listed in search. layout="topleft" left_pad="2" name="all object entry check" + tool_tip="If checked, Residents can move existing objects from other parcels onto this parcel." top_delta="0" width="130" /> <check_box @@ -1301,6 +1305,7 @@ Only large parcels can be listed in search. layout="topleft" left_pad="2" name="group object entry check" + tool_tip="If checked, parcel group members can move existing objects from other parcels onto this parcel." top_delta="0" width="70" /> <text @@ -1320,6 +1325,7 @@ Only large parcels can be listed in search. layout="topleft" left_pad="2" name="check other scripts" + tool_tip="If checked, Residents can run scripts on your parcel, including attachments." top_delta="0" width="130" /> <check_box @@ -1328,6 +1334,7 @@ Only large parcels can be listed in search. layout="topleft" left_pad="2" name="check group scripts" + tool_tip="If checked, parcel group members can run scripts on your parcel, including attachments." top_delta="0" width="70" /> <panel @@ -1466,11 +1473,12 @@ Only large parcels can be listed in search. length="1" follows="left|top" text_color="LtGray" + text_readonly_color="LabelDisabledColor" height="32" layout="topleft" left="274" top="150" - name="allow_label5" + name="allow_see_label" width="205" word_wrap="true"> Avatars on other parcels can see and chat with avatars on this parcel @@ -1908,6 +1916,7 @@ Only large parcels can be listed in search. layout="topleft" left="8" name="public_access" + tool_tip="" label="Anyone can visit (Unchecking this will create ban lines)" top_pad="10" width="278" /> diff --git a/indra/newview/skins/default/xui/en/floater_ban_duration.xml b/indra/newview/skins/default/xui/en/floater_ban_duration.xml index 5562f28877..6c537cc08d 100644 --- a/indra/newview/skins/default/xui/en/floater_ban_duration.xml +++ b/indra/newview/skins/default/xui/en/floater_ban_duration.xml @@ -28,12 +28,12 @@ draw_border="false" enabled="true" follows="left|top" - height="40" + height="47" left="20" mouse_opaque="true" name="ban_duration_radio" tab_stop="true" - width="200"> + width="150"> <radio_item type="string" follows="left|top" @@ -75,7 +75,7 @@ left_delta="70" name="hours_textbox" top_delta="5" - width="75"> + width="70"> hours. </text> diff --git a/indra/newview/skins/default/xui/en/floater_experienceprofile.xml b/indra/newview/skins/default/xui/en/floater_experienceprofile.xml index 2dfba1ac44..f275fec066 100644 --- a/indra/newview/skins/default/xui/en/floater_experienceprofile.xml +++ b/indra/newview/skins/default/xui/en/floater_experienceprofile.xml @@ -493,6 +493,7 @@ layout="topleft" left="11" name="edit_experience_description" + spellcheck="true" max_length="2048" text_color="black" right="-11" diff --git a/indra/newview/skins/default/xui/en/floater_facebook.xml b/indra/newview/skins/default/xui/en/floater_facebook.xml deleted file mode 100644 index b34d70516a..0000000000 --- a/indra/newview/skins/default/xui/en/floater_facebook.xml +++ /dev/null @@ -1,95 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> -<floater - positioning="cascading" - can_close="true" - help_topic="floater_facebook" - layout="topleft" - name="floater_facebook" - save_rect="true" - single_instance="true" - reuse_instance="true" - title="POST TO FACEBOOK" - min_height="462" - min_width="304" - height="462" - width="272"> - <tab_container - name="tabs" - tab_group="1" - tab_min_width="64" - tab_height="21" - tab_position="top" - top="7" - height="437" - follows="all" - halign="center"> - <panel - filename="panel_facebook_status.xml" - class="llfacebookstatuspanel" - follows="all" - label="STATUS" - name="panel_facebook_status"/> - <panel - filename="panel_facebook_photo.xml" - class="llfacebookphotopanel" - follows="all" - label="PHOTO" - name="panel_facebook_photo"/> - <panel - filename="panel_facebook_place.xml" - class="llfacebookcheckinpanel" - follows="all" - label="CHECK IN" - name="panel_facebook_place"/> - <panel - filename="panel_facebook_friends.xml" - class="llfacebookfriendspanel" - follows="all" - label="FRIENDS" - name="panel_facebook_friends"/> - <!--<panel - filename="panel_facebook_account.xml" - class="llfacebookaccountpanel" - follows="all" - label="ACCOUNT" - name="panel_facebook_account"/>--> - </tab_container> - <text - name="connection_error_text" - type="string" - follows="left|bottom|right" - bottom="-5" - left="10" - width="250" - height="20" - wrap="true" - halign="left" - valign="center" - text_color="DrYellow" - font="SansSerif"> - Error - </text> - <loading_indicator - follows="left|bottom" - height="24" - width="24" - name="connection_loading_indicator" - top_delta="-2" - left="10" - visible="true"/> - <text - name="connection_loading_text" - type="string" - follows="left|bottom|right" - top_delta="2" - left_pad="5" - width="250" - height="20" - wrap="true" - halign="left" - valign="center" - text_color="EmphasisColor" - font="SansSerif"> - Loading... - </text> -</floater> diff --git a/indra/newview/skins/default/xui/en/floater_fast_timers.xml b/indra/newview/skins/default/xui/en/floater_fast_timers.xml index fa7147d9ca..645003cc14 100644 --- a/indra/newview/skins/default/xui/en/floater_fast_timers.xml +++ b/indra/newview/skins/default/xui/en/floater_fast_timers.xml @@ -60,10 +60,21 @@ min_width="100"> <panel top="0" left="0" - width="220" + width="204" height="440" name="legend" follows="all"/> + <scroll_bar + top ="0" + right="-1" + height="440" + width="15" + follows="top|right|bottom" + name="scroll_vert" + orientation="vertical" + step_size="16" + doc_size="3000" + /> </layout_panel> <layout_panel name="timers_panel" auto_resize="true" diff --git a/indra/newview/skins/default/xui/en/floater_gesture.xml b/indra/newview/skins/default/xui/en/floater_gesture.xml index 200e9b9537..9f051d9f8d 100644 --- a/indra/newview/skins/default/xui/en/floater_gesture.xml +++ b/indra/newview/skins/default/xui/en/floater_gesture.xml @@ -119,6 +119,7 @@ follows="left|bottom" height="23" label="Edit" + tool_tip="Open window for editing selected gesture." layout="topleft" left="6" name="edit_btn" @@ -128,6 +129,7 @@ follows="left|bottom" height="23" label="Play" + tool_tip="Execute selected gesture in-world." layout="topleft" left_pad="6" name="play_btn" diff --git a/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml b/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml index 1b4992b4ca..ca1d299553 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml @@ -2,7 +2,7 @@ <floater legacy_header_height="18" can_minimize="false" - height="468" + height="448" layout="topleft" name="Inventory Finder" help_topic="inventory_finder" @@ -112,29 +112,12 @@ width="126" /> <icon height="16" - image_name="Inv_Mesh" - layout="topleft" - left="8" - mouse_opaque="true" - name="icon_mesh" - top="142" - width="16" /> - <check_box - height="16" - label="Meshes" - layout="topleft" - left_pad="2" - name="check_mesh" - top_delta="0" - width="126" /> - <icon - height="16" image_name="Inv_Object" layout="topleft" left="8" mouse_opaque="true" name="icon_object" - top="162" + top="142" width="16" /> <check_box height="16" @@ -151,7 +134,7 @@ left="8" mouse_opaque="true" name="icon_script" - top="182" + top="162" width="16" /> <check_box height="16" @@ -168,7 +151,7 @@ left="8" mouse_opaque="true" name="icon_sound" - top="202" + top="182" width="16" /> <check_box height="16" @@ -185,7 +168,7 @@ left="8" mouse_opaque="true" name="icon_texture" - top="222" + top="202" width="16" /> <check_box height="16" @@ -202,7 +185,7 @@ left="8" mouse_opaque="true" name="icon_snapshot" - top="242" + top="222" width="16" /> <check_box height="16" @@ -220,7 +203,7 @@ layout="topleft" left="8" name="All" - top="262" + top="242" width="100" /> <button height="20" @@ -274,7 +257,7 @@ width="260"/> <check_box height="16" - top="352" + top="332" label="Since Logoff" layout="topleft" left_delta="0" @@ -290,7 +273,7 @@ layout="topleft" left_delta="0" name="- OR -" - top="370" + top="350" width="144"> - OR - </text> @@ -298,7 +281,7 @@ height="16" layout="topleft" name="date_search_direction" - top="388" + top="368" left="8" width="270"> <radio_item @@ -368,6 +351,6 @@ layout="topleft" name="Close" right="-6" - top="434" + top="414" width="76" /> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_preferences_proxy.xml b/indra/newview/skins/default/xui/en/floater_preferences_proxy.xml index 93bfe53aae..659033efd4 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences_proxy.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences_proxy.xml @@ -58,12 +58,12 @@ label_width="95" layout="topleft" left_delta="210" - max_val="12000" + max_val="65535" min_val="10" name="web_proxy_port" top_delta="0" tool_tip="The port of the HTTP proxy you would like to use." - width="145" /> + width="150" /> <check_box control_name="Socks5ProxyEnabled" height="16" @@ -111,11 +111,11 @@ label_width="95" layout="topleft" left_delta="210" - max_val="12000" + max_val="65535" min_val="10" name="socks_proxy_port" top_delta="0" - width="145" + width="150" tool_tip="The port of the SOCKS 5 proxy you would like to use." commit_callback.function="Proxy.Change" /> <text diff --git a/indra/newview/skins/default/xui/en/floater_preview_notecard.xml b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml index 2e1c8ce670..dcbdfa8794 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_notecard.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml @@ -6,7 +6,7 @@ height="361" layout="topleft" min_height="243" - min_width="234" + min_width="330" name="preview notecard" help_topic="preview_notecard" title="NOTECARD:" @@ -77,6 +77,16 @@ word_wrap="true"> Loading... </text_editor> + <button + follows="left|bottom" + height="22" + label="Edit..." + label_selected="Edit" + layout="topleft" + left="4" + name="Edit" + top="332" + width="100" /> <button follows="right|bottom" height="22" 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 8fa5b49573..d07e3cb31b 100644 --- a/indra/newview/skins/default/xui/en/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/en/floater_report_abuse.xml @@ -246,7 +246,7 @@ name="Land__Encroachment__Objects_textures" value="63" /> <combo_box.item - label="Gaming Policy Violation" + label="Skill Gaming Policy Violation" name="Wagering_gambling" value="67" /> </combo_box> diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index e50747cb5f..832c2ee7da 100644 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -24,10 +24,6 @@ Sending Email </string> <string - name="facebook_progress_str"> - Posting to Facebook - </string> - <string name="profile_progress_str"> Posting </string> @@ -40,10 +36,6 @@ Saving to Computer </string> <string - name="facebook_succeeded_str"> - Image uploaded - </string> - <string name="profile_succeeded_str"> Image uploaded </string> @@ -60,10 +52,6 @@ Saved to Computer! </string> <string - name="facebook_failed_str"> - Failed to upload image to your Facebook timeline. - </string> - <string name="profile_failed_str"> Failed to upload image to your Profile Feed. </string> diff --git a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml index 53618b684b..d122d7491c 100644 --- a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml +++ b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml @@ -52,7 +52,7 @@ control_name="mode_selection" height="20" layout="topleft" - left="18" + left="0" top_pad="80" name="mode_selection" follows="left|top"> @@ -64,7 +64,7 @@ height="16" left="0" value="0" - width="80" /> + width="70" /> <radio_item label="Local" left_pad="0" @@ -73,7 +73,16 @@ height="16" name="local" value="1" - width="75" /> + width="50" /> + <radio_item + label="Bake" + left_pad="0" + layout="topleft" + top_delta="0" + height="16" + name="bake" + value="2" + width="50" /> </radio_group> <!-- --> @@ -83,7 +92,7 @@ follows="left|top" height="14" layout="topleft" - left_delta="-12" + left_delta="12" name="unknown" top_pad="4"> Size: [DIMENSIONS] @@ -225,7 +234,80 @@ <column name="unit_name" label="Name" dynamicwidth="true" /> <column name="unit_id_HIDDEN" label="ID" width="0" /> </scroll_list> - + +<!-- middle: bake mode --> + <combo_box + left="180" + top="30" + height="19" + top_delta="15" + layout="topleft" + follows="left|top" + name="l_bake_use_texture_combo_box" + tool_tip="Choose the bake texture" + width="118" + visible="false"> + <combo_box.item + label="None" + name="None" + value="-1" /> + <combo_box.item + label="BAKED_HEAD" + name="BAKED_HEAD" + value="0" /> + <combo_box.item + label="BAKED_UPPER" + name="BAKED_UPPER" + value="1" /> + <combo_box.item + label="BAKED_LOWER" + name="BAKED_LOWER" + value="2" /> + <combo_box.item + label="BAKED_EYES" + name="BAKED_EYES" + value="3" /> + <combo_box.item + label="BAKED_SKIRT" + name="BAKED_SKIRT" + value="4" /> + <combo_box.item + label="BAKED_HAIR" + name="BAKED_HAIR" + value="5" /> + <combo_box.item + label="BAKED_LEFTARM" + name="BAKED_LEFTARM" + value="6" /> + <combo_box.item + label="BAKED_LEFTLEG" + name="BAKED_LEFTLEG" + value="7" /> + <combo_box.item + label="BAKED_AUX1" + name="BAKED_AUX1" + value="8" /> + <combo_box.item + label="BAKED_AUX2" + name="BAKED_AUX2" + value="9" /> + <combo_box.item + label="BAKED_AUX3" + name="BAKED_AUX3" + value="10" /> + </combo_box> + <check_box + follows="left|top" + height="20" + initial_value="false" + label="Hide Base Mesh Region" + layout="topleft" + name="hide_base_mesh_region" + left_delta="0" + top_pad="10" + top_delta="0" + width="120" + visible="false"/> <!-- bottom static --> <button follows="bottom" diff --git a/indra/newview/skins/default/xui/en/fonts.xml b/indra/newview/skins/default/xui/en/fonts.xml index 8b1d50e58f..2d5263b78f 100644 --- a/indra/newview/skins/default/xui/en/fonts.xml +++ b/indra/newview/skins/default/xui/en/fonts.xml @@ -10,6 +10,8 @@ <file>simhei.ttf</file> <file>ArialUni.ttf</file> <file>msyh.ttc</file> + <file load_collection="true">Cambria.ttc</file> + <file>malgun.ttf</file> </os> <os name="Mac"> <file>ヒラギノ角ゴシック W3.ttc</file> @@ -21,6 +23,7 @@ <file>AppleSDGothicNeo-Regular.otf</file> <file>华文细黑.ttf</file> <file>PingFang.ttc</file> + <file>STIXGeneral.otf</file> </os> </font> diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index 3ea9e77a03..3bdbbb04d7 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -268,6 +268,14 @@ parameter="tattoo" /> </menu_item_call> <menu_item_call + label="New Universal" + layout="topleft" + name="New Universal"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="universal" /> + </menu_item_call> + <menu_item_call label="New Physics" layout="topleft" name="New Physics"> diff --git a/indra/newview/skins/default/xui/en/menu_inventory_add.xml b/indra/newview/skins/default/xui/en/menu_inventory_add.xml index afeb1bf226..29724b0270 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_add.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_add.xml @@ -194,6 +194,14 @@ function="Inventory.DoCreate" parameter="tattoo" /> </menu_item_call> + <menu_item_call + label="New Universal" + layout="topleft" + name="New Universal"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="universal" /> + </menu_item_call> <menu_item_call label="New Physics" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml index 7faa4f3d71..61cb74f230 100644 --- a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml @@ -175,6 +175,14 @@ function="Gear.Create" parameter="tattoo" /> </menu_item_call> + <menu_item_call + label="New Universal" + layout="topleft" + name="New Universal"> + <menu_item_call.on_click + function="Gear.Create" + parameter="universal" /> + </menu_item_call> </menu> <menu height="85" diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index cac84cfccf..7bb7b5d62c 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -307,13 +307,6 @@ </menu_item_check> <menu_item_separator/> <menu_item_call - label="Facebook..." - name="Facebook"> - <menu_item_call.on_click - function="Floater.Toggle" - parameter="facebook"/> - </menu_item_call> - <menu_item_call label="Twitter..." name="Twitter"> <menu_item_call.on_click @@ -1051,8 +1044,7 @@ shortcut="control|D"> <menu_item_call.on_click function="Object.Duplicate" /> - <menu_item_call.on_enable - function="Object.EnableDuplicate" /> + </menu_item_call> </menu> <menu @@ -1507,8 +1499,7 @@ </menu_item_call> <menu_item_call label="Set UI Size to Default" - name="Set UI Size to Default" - shortcut="control|alt|shift|R"> + name="Set UI Size to Default" shortcut="control|alt|shift|R"> <menu_item_call.on_click function="View.DefaultUISize" /> </menu_item_call> @@ -4013,6 +4004,16 @@ parameter="tattoo" /> </menu_item_call> <menu_item_call + label="Universal" + name="Universal"> + <menu_item_call.on_click + function="Edit.TakeOff" + parameter="tattoo" /> + <menu_item_call.on_enable + function="Edit.EnableTakeOff" + parameter="universal" /> + </menu_item_call> + <menu_item_call label="Physics" name="Physics"> <menu_item_call.on_click diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index b7cd6517ea..f72767cceb 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -326,6 +326,16 @@ Initialization with the Marketplace failed because of a system or network error. name="okbutton" yestext="OK"/> </notification> + + <notification + icon="OutboxStatus_Error" + name="MyOutfitsPasteFailed" + type="alertmodal"> + One or more items can't be used inside "My outfits" + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> <notification icon="OutboxStatus_Error" @@ -1775,13 +1785,6 @@ Visit [_URL] for more information? <notification icon="alertmodal.tga" - name="RunLauncher" - type="alertmodal"> - Please do not directly run the viewer executable. Update any existing shortcuts to run SL_Launcher instead. - </notification> - - <notification - icon="alertmodal.tga" name="OldGPUDriver" type="alertmodal"> There is likely a newer driver for your graphics chip. Updating graphics drivers can substantially improve performance. @@ -2393,6 +2396,7 @@ Your search terms were too short so no search was performed. icon="alertmodal.tga" name="CouldNotTeleportReason" type="alertmodal"> + <unique/> Teleport failed. [REASON] <tag>fail</tag> @@ -6705,13 +6709,6 @@ Please select at least one type of content to search (General, Moderate, or Adul [MESSAGE] </notification> - <notification - icon="notify.tga" - name="FacebookConnect" - type="notifytip"> -[MESSAGE] - </notification> - <notification icon="notify.tga" name="FlickrConnect" @@ -8639,6 +8636,7 @@ Please check your network and firewall setup. icon="alertmodal.tga" name="NoVoiceConnect" type="alertmodal"> + <unique/> We are unable to connect to the voice server: [HOSTID] diff --git a/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml b/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml index 97f1a1a658..8fa85dce5f 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml @@ -1,85 +1,98 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> - <panel - background_visible="true" - follows="all" - height="400" - layout="topleft" - left="0" - name="edit_tattoo_panel" - top_pad="10" - width="333" > - <panel - border="false" - bg_alpha_color="DkGray2" - bg_opaque_color="DkGray2" - background_visible="true" - background_opaque="true" - follows="all" - height="400" - left="10" - layout="topleft" - name="avatar_tattoo_color_panel" - top="0" - width="313" > - <texture_picker - can_apply_immediately="true" - default_image_name="Default" - follows="left|top" - height="115" - label="Head Tattoo" - layout="topleft" - left="20" - name="Head Tattoo" - tool_tip="Click to choose a picture" - top="10" - width="115" > - <texture_picker.commit_callback - function="TexturePicker.Commit" /> - </texture_picker> - <texture_picker - can_apply_immediately="true" - default_image_name="Default" - follows="left|top" - height="115" - label="Upper Tattoo" - layout="topleft" - left_pad="30" - name="Upper Tattoo" - tool_tip="Click to choose a picture" - top="10" - width="115" > - <texture_picker.commit_callback - function="TexturePicker.Commit" /> - </texture_picker> - <texture_picker - can_apply_immediately="true" - default_image_name="Default" - follows="left|top" - height="115" - label="Lower Tattoo" - layout="topleft" - left="20" - name="Lower Tattoo" - tool_tip="Click to choose a picture" - top_pad="10" - width="115" > - <texture_picker.commit_callback - function="TexturePicker.Commit" /> - </texture_picker> - <color_swatch - can_apply_immediately="true" - follows="left|top" - height="115" - label="Color/Tint" - layout="topleft" - left_pad="30" - name="Color/Tint" - tool_tip="Click to open color picker" - top_delta="0" - width="115" > - <color_swatch.commit_callback - function="ColorSwatch.Commit" /> - </color_swatch> - </panel> +<panel + background_visible="true" + follows="all" + height="400" + layout="topleft" + left="0" + name="edit_tattoo_panel" + top_pad="10" + width="333" > + <scroll_container + color="DkGray2" + follows="all" + height="400" + layout="topleft" + left="9" + name="avatar_tattoo_scroll" + opaque="true" + top_pad="10" + width="314"> + <panel + border="false" + bg_alpha_color="DkGray2" + bg_opaque_color="DkGray2" + background_visible="true" + background_opaque="true" + follows="all" + height="800" + left="10" + layout="topleft" + name="avatar_tattoo_color_panel" + top="0" + width="313" > + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="115" + label="Head Tattoo" + layout="topleft" + left="20" + name="Head Tattoo" + tool_tip="Click to choose a picture" + top="10" + width="115" > + <texture_picker.commit_callback + function="TexturePicker.Commit" /> + </texture_picker> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="115" + label="Upper Tattoo" + layout="topleft" + left_pad="30" + name="Upper Tattoo" + tool_tip="Click to choose a picture" + top="10" + width="115" > + <texture_picker.commit_callback + function="TexturePicker.Commit" /> + </texture_picker> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="115" + label="Lower Tattoo" + layout="topleft" + left="20" + name="Lower Tattoo" + tool_tip="Click to choose a picture" + top_pad="10" + width="115" > + <texture_picker.commit_callback + function="TexturePicker.Commit" /> + </texture_picker> + + + <color_swatch + can_apply_immediately="true" + follows="left|top" + height="115" + label="Color/Tint" + layout="topleft" + left_pad="30" + name="Color/Tint" + tool_tip="Click to open color picker" + top_delta="0" + width="115" > + <color_swatch.commit_callback + function="ColorSwatch.Commit" /> + </color_swatch> + </panel> + </scroll_container> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_edit_universal.xml b/indra/newview/skins/default/xui/en/panel_edit_universal.xml new file mode 100644 index 0000000000..11cabdfe6e --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_edit_universal.xml @@ -0,0 +1,231 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + background_visible="true" + follows="all" + height="400" + layout="topleft" + left="0" + name="edit_universal_panel" + top_pad="10" + width="333" > + <scroll_container + color="DkGray2" + follows="all" + height="380" + layout="topleft" + left="9" + name="avatar_universal_scroll" + opaque="true" + top_pad="10" + width="323"> + <panel + border="false" + bg_alpha_color="DkGray2" + bg_opaque_color="DkGray2" + background_visible="true" + background_opaque="true" + follows="all" + height="800" + left="10" + layout="topleft" + name="avatar_universal_color_panel" + top="0" + width="313" > + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="115" + label="Head Tattoo" + layout="topleft" + left="20" + top_pad="10" + name="Head Universal Tattoo" + tool_tip="Click to choose a picture" + + width="115" > + <texture_picker.commit_callback + function="TexturePicker.Commit" /> + </texture_picker> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="115" + label="Upper Tattoo" + layout="topleft" + left_pad="30" + top_delta="0" + name="Upper Universal Tattoo" + tool_tip="Click to choose a picture" + + width="115" > + <texture_picker.commit_callback + function="TexturePicker.Commit" /> + </texture_picker> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="115" + label="Lower Tattoo" + layout="topleft" + left="20" + top_pad="10" + name="Lower Universal Tattoo" + tool_tip="Click to choose a picture" + + width="115" > + <texture_picker.commit_callback + function="TexturePicker.Commit" /> + </texture_picker> + + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="115" + label="Skirt Tattoo" + layout="topleft" + left_pad="30" + top_delta="0" + name="Skirt Tattoo" + tool_tip="Click to choose a picture" + + width="115" > + <texture_picker.commit_callback + function="TexturePicker.Commit" /> + </texture_picker> + + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="115" + label="Hair Tattoo" + layout="topleft" + left="20" + top_pad="10" + name="Hair Tattoo" + tool_tip="Click to choose a picture" + + width="115" > + <texture_picker.commit_callback + function="TexturePicker.Commit" /> + </texture_picker> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="115" + label="Eyes Tattoo" + layout="topleft" + left_pad="30" + top_delta="0" + name="Eyes Tattoo" + tool_tip="Click to choose a picture" + + width="115" > + <texture_picker.commit_callback + function="TexturePicker.Commit" /> + </texture_picker> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="115" + label="Left Arm Tattoo" + layout="topleft" + left="20" + top_pad="10" + name="Left Arm Tattoo" + tool_tip="Click to choose a picture" + + width="115" > + <texture_picker.commit_callback + function="TexturePicker.Commit" /> + </texture_picker> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="115" + label="Left Leg Tattoo" + layout="topleft" + left_pad="30" + top_delta="0" + name="Left Leg Tattoo" + tool_tip="Click to choose a picture" + + width="115" > + <texture_picker.commit_callback + function="TexturePicker.Commit" /> + </texture_picker> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="115" + label="Aux1 Tattoo" + layout="topleft" + left="20" + top_pad="10" + name="Aux1 Tattoo" + tool_tip="Click to choose a picture" + + width="115" > + <texture_picker.commit_callback + function="TexturePicker.Commit" /> + </texture_picker> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="115" + label="Aux2 Tattoo" + layout="topleft" + left_pad="30" + top_delta="0" + name="Aux2 Tattoo" + tool_tip="Click to choose a picture" + + width="115" > + <texture_picker.commit_callback + function="TexturePicker.Commit" /> + </texture_picker> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="115" + label="Aux3 Tattoo" + layout="topleft" + left="20" + top_pad="10" + name="Aux3 Tattoo" + tool_tip="Click to choose a picture" + + width="115" > + <texture_picker.commit_callback + function="TexturePicker.Commit" /> + </texture_picker> + + <color_swatch + can_apply_immediately="true" + follows="left|top" + height="115" + label="Color/Tint" + layout="topleft" + left_pad="30" + top_delta="0" + name="Color/Tint" + tool_tip="Click to open color picker" + + width="115" > + <color_swatch.commit_callback + function="ColorSwatch.Commit" /> + </color_swatch> + </panel> + </scroll_container> +</panel> + diff --git a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml index f34b913218..dc1553e6a3 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml @@ -71,6 +71,10 @@ name="edit_tattoo_title"> Editing Tattoo </string> + <string + name="edit_universal_title"> + Editing Universal + </string> <string name="edit_physics_title"> Editing Physics @@ -135,6 +139,10 @@ name="tattoo_desc_text"> Tattoo: </string> + <string + name="universal_desc_text"> + Universal: + </string> <string name="physics_desc_text"> Physics: @@ -418,6 +426,16 @@ top="8" visible="false" width="333" /> + <panel + filename="panel_edit_universal.xml" + follows="all" + height="425" + layout="topleft" + left="0" + name="edit_universal_panel" + top="8" + visible="false" + width="333" /> <panel filename="panel_edit_physics.xml" follows="all" diff --git a/indra/newview/skins/default/xui/en/panel_facebook_friends.xml b/indra/newview/skins/default/xui/en/panel_facebook_friends.xml deleted file mode 100644 index 97994fb08b..0000000000 --- a/indra/newview/skins/default/xui/en/panel_facebook_friends.xml +++ /dev/null @@ -1,73 +0,0 @@ -<panel - height="400" - width="272" - layout="topleft" - follows="all" - name="panel_facebook_friends"> - <string - name="facebook_friends_empty" - value="You currently do not have any Facebook friends who are also Second Life residents. Ask your Facebook friends to join Second Life today!" /> - <string - name="facebook_friends_no_connected" - value="You're currently not connected to Facebook. Please go to the Status tab to connect and enable this feature." /> - <accordion - background_visible="false" - bg_alpha_color="DkGray2" - bg_opaque_color="DkGray2" - follows="all" - height="383" - layout="topleft" - left="10" - name="friends_accordion" - right="-10" - top_pad="2"> - <accordion_tab - layout="topleft" - height="173" - name="tab_second_life_friends" - title="SL friends"> - <avatar_list - ignore_online_status="true" - allow_select="true" - follows="all" - height="173" - layout="topleft" - left="0" - name="second_life_friends" - show_permissions_granted="true" - top="0" - width="272" /> - </accordion_tab> - <accordion_tab - layout="topleft" - height="173" - name="tab_suggested_friends" - title="Add these people as SL friends"> - <avatar_list - ignore_online_status="true" - allow_select="true" - follows="all" - height="173" - layout="topleft" - left="0" - name="suggested_friends" - show_permissions_granted="true" - top="0" - width="272" /> - </accordion_tab> - </accordion> - <text - layout="topleft" - word_wrap="true" - height="64" - width="250" - follows="top|left|right" - font="SansSerif" - left="10" - right="-10" - name="facebook_friends_status" - top="5" - type="string"> - Not connected to Facebook. - </text> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_facebook_photo.xml b/indra/newview/skins/default/xui/en/panel_facebook_photo.xml deleted file mode 100644 index 22e6598352..0000000000 --- a/indra/newview/skins/default/xui/en/panel_facebook_photo.xml +++ /dev/null @@ -1,168 +0,0 @@ - <panel - height="400" - width="272" - layout="topleft" - follows="all" - name="panel_facebook_photo"> - <combo_box - control_name="FacebookPhotoResolution" - follows="left|top" - layout="topleft" - top="7" - left="10" - name="resolution_combobox" - tool_tip="Image resolution" - height="21" - width="124"> - <combo_box.item - label="Current Window" - name="CurrentWindow" - value="[i0,i0]" /> - <combo_box.item - label="640x480" - name="640x480" - value="[i640,i480]" /> - <combo_box.item - label="800x600" - name="800x600" - value="[i800,i600]" /> - <combo_box.item - label="1024x768" - name="1024x768" - value="[i1024,i768]" /> - <combo_box.item - label="1200x630" - name="1200x630" - value="[i1200,i630]" /> - </combo_box> - <combo_box - control_name="FacebookPhotoFilters" - follows="left|top" - layout="topleft" - name="filters_combobox" - tool_tip="Image filters" - top="7" - left_pad="4" - height="21" - width="124"> - <combo_box.item - label="No Filter" - name="NoFilter" - value="NoFilter" /> - </combo_box> - <panel - height="150" - width="252" - visible="true" - layout="topleft" - name="thumbnail_placeholder" - top_pad="5" - follows="left|top|rith" - right="-10" - left="10"> - </panel> - <text - follows="left|top" - layout="topleft" - font="SansSerif" - text_color="EmphasisColor" - height="14" - top_pad="2" - left="10" - length="1" - halign="center" - name="working_lbl" - translate="false" - type="string" - visible="true" - width="251"> - Refreshing... - </text> - <view_border - bevel_style="in" - follows="left|top" - layout="topleft" - height="1" - left="10" - name="refresh_border" - width="250" - top_pad="0"/> - <button - follows="left|top" - layout="topleft" - height="23" - label="Refresh" - left="10" - top_pad="5" - name="new_snapshot_btn" - tool_tip="Click to refresh" - visible="true" - width="100" > - <button.commit_callback - function="SocialSharing.RefreshPhoto" /> - </button> - <button - follows="right|top" - layout="topleft" - height="23" - label="Preview" - right="-10" - top_delta="0" - name="big_preview_btn" - tool_tip="Click to toggle preview" - is_toggle="true" - visible="true" - width="100" > - <button.commit_callback - function="SocialSharing.BigPreview" /> - </button> - <text - length="1" - follows="top|left|right" - layout="topleft" - font="SansSerif" - height="16" - left="10" - name="caption_label" - top_pad="20" - type="string"> - Comment (optional): - </text> - <text_editor - follows="left|top|right|bottom" - layout="topleft" - height="87" - width="250" - left="10" - right="-10" - length="1" - max_length="700" - name="photo_caption" - type="string" - word_wrap="true"> - </text_editor> - <button - follows="left|top" - layout="topleft" - top_pad="22" - left="10" - height="23" - label="Post" - name="post_photo_btn" - width="100"> - <button.commit_callback - function="SocialSharing.SendPhoto" /> - </button> - <button - follows="right|top" - layout="topleft" - height="23" - label="Cancel" - name="cancel_photo_btn" - right="-10" - top_delta="0" - width="100"> - <button.commit_callback - function="SocialSharing.Cancel" /> - </button> - </panel> diff --git a/indra/newview/skins/default/xui/en/panel_facebook_place.xml b/indra/newview/skins/default/xui/en/panel_facebook_place.xml deleted file mode 100644 index f87b008c4e..0000000000 --- a/indra/newview/skins/default/xui/en/panel_facebook_place.xml +++ /dev/null @@ -1,113 +0,0 @@ - <panel - height="400" - width="272" - layout="topleft" - follows="all" - name="panel_facebook_place"> - <text - length="1" - follows="top|left|right" - layout="topleft" - font="SansSerif" - height="16" - left="10" - name="place_caption_label" - top="5" - type="string"> - Say something about where you are: - </text> - <text_editor - follows="top|left|right" - layout="topleft" - height="70" - width="250" - left="10" - right="-10" - length="1" - max_length="700" - name="place_caption" - type="string" - word_wrap="true"> - </text_editor> - <check_box - follows="left|top" - layout="topleft" - initial_value="false" - height="16" - top_pad="8" - width="8" - label="Include overhead view of location" - name="add_place_view_cb" - left="10"/> - <panel - follows="left|top" - layout="topleft" - height="243" - width="250" - background_visible="true" - bg_opaque_color="Black" - bg_alpha_color="Black" - top_pad="8" - left="10" - right="-12" - visible="true" - name="map_border"> - </panel> - <icon - follows="left|top" - layout="topleft" - height="243" - width="250" - image_name="Map_Placeholder_Icon" - top_delta="0" - right="-12" - left="10" - visible="true" - name="map_placeholder"> - </icon> - <icon - follows="left|top" - layout="topleft" - height="243" - width="250" - image_name="Map_Placeholder_Icon" - top_delta="0" - left="10" - right="-12" - visible="true" - name="map_default"> - </icon> - <loading_indicator - follows="left|top" - layout="topleft" - height="24" - width="24" - name="map_loading_indicator" - top_delta="116" - left="126" - visible="false"/> - <button - follows="left|bottom" - layout="topleft" - top_pad="95" - left="10" - height="23" - label="Post" - name="post_place_btn" - width="100"> - <button.commit_callback - function="SocialSharing.SendCheckin" /> - </button> - <button - follows="right|bottom" - layout="topleft" - height="23" - label="Cancel" - name="cancel_place_btn" - right="-10" - top_delta="0" - width="100"> - <button.commit_callback - function="SocialSharing.Cancel" /> - </button> - </panel> diff --git a/indra/newview/skins/default/xui/en/panel_facebook_status.xml b/indra/newview/skins/default/xui/en/panel_facebook_status.xml deleted file mode 100644 index fe0f3c9279..0000000000 --- a/indra/newview/skins/default/xui/en/panel_facebook_status.xml +++ /dev/null @@ -1,130 +0,0 @@ - <panel - height="400" - width="272" - follows="all" - layout="topleft" - name="panel_facebook_status"> - <string - name="facebook_connected" - value="You are connected to Facebook as:" /> - <string - name="facebook_disconnected" - value="Not connected to Facebook" /> - <text - layout="topleft" - length="1" - follows="top|left" - font="SansSerif" - height="16" - left="10" - name="account_caption_label" - top="5" - type="string"> - Not connected to Facebook. - </text> - <text - layout="topleft" - top_pad="2" - length="1" - follows="top|left" - font="SansSerif" - height="16" - left="10" - name="account_name_label" - parse_urls="true" - type="string"/> - <panel - layout="topleft" - follows="left|top" - name="panel_buttons" - height="60" - left="0"> - <button - layout="topleft" - follows="left|top" - top_pad="9" - left="10" - visible="true" - height="23" - label="Connect..." - name="connect_btn" - width="251"> - <commit_callback function="SocialSharing.Connect"/> - </button> - - <button - layout="topleft" - follows="left|top|right" - top_delta="0" - left="10" - right="-10" - height="23" - label="Disconnect" - name="disconnect_btn" - width="210" - visible="false"> - <commit_callback function="SocialSharing.Disconnect"/> - </button> - <text - layout="topleft" - length="1" - follows="top|left|right" - left="10" - right="-10" - height="16" - name="account_learn_more_label" - top_pad="5" - type="string"> - [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Facebook/ta-p/2149711 Learn about posting to Facebook] - </text> - </panel> - - <text - length="1" - layout="topleft" - follows="top|left|right" - font="SansSerif" - height="16" - left="10" - name="status_caption_label" - top_pad="5" - type="string"> - What's on your mind? - </text> - <text_editor - follows="left|top|right" - layout="topleft" - height="150" - width="252" - left="10" - length="1" - max_length="700" - name="status_message" - type="string" - word_wrap="true"> - </text_editor> - <button - follows="left|top" - layout="topleft" - top_pad="6" - left="10" - height="23" - label="Post" - name="post_status_btn" - width="100"> - <button.commit_callback - function="SocialSharing.SendStatus" /> - </button> - <button - follows="right|top" - layout="topleft" - height="23" - label="Cancel" - name="cancel_status_btn" - right="-10" - top_delta="0" - width="100"> - <button.commit_callback - function="SocialSharing.Cancel" /> - </button> - </panel> diff --git a/indra/newview/skins/default/xui/en/panel_flickr_photo.xml b/indra/newview/skins/default/xui/en/panel_flickr_photo.xml index 6074ab9ef6..7fb2291423 100644 --- a/indra/newview/skins/default/xui/en/panel_flickr_photo.xml +++ b/indra/newview/skins/default/xui/en/panel_flickr_photo.xml @@ -158,6 +158,7 @@ length="1" max_length="700" name="photo_description" + spellcheck="true" type="string" word_wrap="true"> </text_editor> 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 26f54bacbc..e34335a2af 100644 --- a/indra/newview/skins/default/xui/en/panel_group_general.xml +++ b/indra/newview/skins/default/xui/en/panel_group_general.xml @@ -214,7 +214,7 @@ Hover your mouse over the options for more help. layout="topleft" left="10" name="group_mature_check" - tool_tip="Sets whether your group contains information rated as Moderate" + tool_tip="Maturity ratings designate the type of content and behavior allowed in a group" top_pad="4" width="190"> <combo_item name="select_mature" value="Select"> diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml index 714d4166c0..f15f79e9aa 100644 --- a/indra/newview/skins/default/xui/en/panel_group_roles.xml +++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml @@ -212,7 +212,15 @@ clicking on their names. layout="topleft" left="0" name="role_create" - width="120" /> + width="100" /> + <button + follows="top|left" + height="23" + label="Copy Role" + layout="topleft" + left_pad="10" + name="role_copy" + width="100" /> <button height="23" follows="top|left" @@ -220,7 +228,7 @@ clicking on their names. layout="topleft" left_pad="10" name="role_delete" - width="120" /> + width="100" /> </panel> <panel border="false" diff --git a/indra/newview/skins/default/xui/en/panel_landmark_info.xml b/indra/newview/skins/default/xui/en/panel_landmark_info.xml index fd6e96b9a7..13986c4030 100644 --- a/indra/newview/skins/default/xui/en/panel_landmark_info.xml +++ b/indra/newview/skins/default/xui/en/panel_landmark_info.xml @@ -277,6 +277,7 @@ max_length="127" name="notes_editor" read_only="true" + spellcheck="true" text_readonly_color="white" text_type="ascii_with_newline" top_pad="5" diff --git a/indra/newview/skins/default/xui/en/panel_login_first.xml b/indra/newview/skins/default/xui/en/panel_login_first.xml index 213f9a6b0c..726e713595 100644 --- a/indra/newview/skins/default/xui/en/panel_login_first.xml +++ b/indra/newview/skins/default/xui/en/panel_login_first.xml @@ -111,7 +111,6 @@ combo_editor.font="SansSerifLarge" max_chars="128" top="0" - commit_on_focus_lost="false" combo_editor.prevalidate_callback="ascii" tool_tip="The username you chose when you registered, like bobsmith12 or Steller Sunshine" name="username_combo" @@ -141,7 +140,7 @@ follows="left|top" image_unselected="PushButton_Login" image_pressed="PushButton_Login_Pressed" - image_hover="PushButton_Login_Over" + image_hover_unselected="PushButton_Login_Over" label="Log In" label_color="White" font="SansSerifLarge" diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 8fc0f6f642..a47121ae99 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -367,24 +367,7 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M show_permissions_granted="true" top="0" width="307" /> - </accordion_tab> - <accordion_tab - layout="topleft" - height="173" - name="tab_suggested_friends" - title="People you may want to friend"> - <avatar_list - ignore_online_status="true" - allow_select="true" - follows="all" - height="173" - layout="topleft" - left="0" - name="suggested_friends" - show_permissions_granted="true" - top="0" - width="307" /> - </accordion_tab> + </accordion_tab> </accordion> <text follows="all" diff --git a/indra/newview/skins/default/xui/en/panel_postcard_message.xml b/indra/newview/skins/default/xui/en/panel_postcard_message.xml index 331a08b4bb..63c7259878 100644 --- a/indra/newview/skins/default/xui/en/panel_postcard_message.xml +++ b/indra/newview/skins/default/xui/en/panel_postcard_message.xml @@ -80,6 +80,7 @@ left="5" max_length="700" name="msg_form" + spellcheck="true" right="-4" top_pad="5" word_wrap="true"> diff --git a/indra/newview/skins/default/xui/en/panel_region_terrain.xml b/indra/newview/skins/default/xui/en/panel_region_terrain.xml index 5d060c0a0d..8243c2715d 100644 --- a/indra/newview/skins/default/xui/en/panel_region_terrain.xml +++ b/indra/newview/skins/default/xui/en/panel_region_terrain.xml @@ -94,6 +94,7 @@ layout="topleft" left_delta="0" name="texture_detail_0" + default_image_id="0bc58228-74a0-7e83-89bc-5c23464bcec5" top_delta="20" width="100" /> <texture_picker @@ -102,6 +103,7 @@ layout="topleft" left_pad="10" name="texture_detail_1" + default_image_id="63338ede-0037-c4fd-855b-015d77112fc8" top_delta="0" width="100" /> <texture_picker @@ -110,6 +112,7 @@ layout="topleft" left_pad="10" name="texture_detail_2" + default_image_id="303cd381-8560-7579-23f1-f0a880799740" top_delta="0" width="100" /> <texture_picker @@ -118,6 +121,7 @@ layout="topleft" left_pad="10" name="texture_detail_3" + default_image_id="53a2f406-4895-1d13-d541-d2e3b86bc19c" top_delta="0" width="100" /> <text diff --git a/indra/newview/skins/default/xui/en/panel_script_ed.xml b/indra/newview/skins/default/xui/en/panel_script_ed.xml index c56a5e17cd..ed37e9e2cc 100644 --- a/indra/newview/skins/default/xui/en/panel_script_ed.xml +++ b/indra/newview/skins/default/xui/en/panel_script_ed.xml @@ -28,10 +28,6 @@ name="Title"> Script: [NAME] </panel.string> - <panel.string - name="external_editor_not_set"> - Select an editor by setting the environment variable LL_SCRIPT_EDITOR or the ExternalEditor setting. - </panel.string> <menu_bar bg_visible="false" follows="left|top" diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml index 305cce1cbe..981b9ab881 100644 --- a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml @@ -61,23 +61,6 @@ font="SansSerif" halign="left" height="22" - image_overlay="Snapshot_Facebook" - image_overlay_alignment="left" - image_top_pad="0" - imgoverlay_label_space="10" - label="Share to Facebook" - layout="topleft" - left_delta="0" - name="send_to_facebook_btn" - top_pad="5"> - <button.commit_callback - function="Snapshot.SendToFacebook"/> - </button> - <button - follows="left|top" - font="SansSerif" - halign="left" - height="22" image_overlay="Command_Twitter_Icon" image_overlay_alignment="left" image_top_pad="0" diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml index d86cb92981..2fdbee49f0 100644 --- a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml @@ -126,6 +126,7 @@ length="1" max_length="700" name="caption" + spellcheck="true" width="200" top_pad="2" type="string" diff --git a/indra/newview/skins/default/xui/en/panel_twitter_photo.xml b/indra/newview/skins/default/xui/en/panel_twitter_photo.xml index 9a460ceead..8774d09a03 100644 --- a/indra/newview/skins/default/xui/en/panel_twitter_photo.xml +++ b/indra/newview/skins/default/xui/en/panel_twitter_photo.xml @@ -39,6 +39,7 @@ length="1" max_length="140" name="photo_status" + spellcheck="true" type="string" word_wrap="true"> </text_editor> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 1c5e51d2c8..9eedc45aa9 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -58,6 +58,9 @@ Advanced Lighting Model: [GPU_SHADERS] Texture memory: [TEXTURE_MEMORY]MB VFS (cache) creation time: [VFS_TIME] </string> + <string name="AboutOSXHiDPI"> +HiDPI display mode: [HIDPI] + </string> <string name="AboutLibs"> J2C Decoder Version: [J2C_VERSION] Audio Driver Version: [AUDIO_DRIVER_VERSION] @@ -199,13 +202,7 @@ Please try logging in again in a minute.</string> <string name="SentToInvalidRegion">You were sent to an invalid region.</string> <string name="TestingDisconnect">Testing viewer disconnect</string> - <!-- SLShare: Facebook, Flickr, and Twitter --> - <string name="SocialFacebookConnecting">Connecting to Facebook...</string> - <string name="SocialFacebookPosting">Posting...</string> - <string name="SocialFacebookDisconnecting">Disconnecting from Facebook...</string> - <string name="SocialFacebookErrorConnecting">Problem connecting to Facebook</string> - <string name="SocialFacebookErrorPosting">Problem posting to Facebook</string> - <string name="SocialFacebookErrorDisconnecting">Problem disconnecting from Facebook</string> + <!-- SLShare: Flickr and Twitter --> <string name="SocialFlickrConnecting">Connecting to Flickr...</string> <string name="SocialFlickrPosting">Posting...</string> <string name="SocialFlickrDisconnecting">Disconnecting from Flickr...</string> @@ -266,6 +263,8 @@ Please try logging in again in a minute.</string> <string name="TooltipOutboxDragActive">You can't move a listed listing</string> <string name="TooltipOutboxCannotMoveRoot">You can't move the marketplace listings root folder</string> <string name="TooltipOutboxMixedStock">All items in a stock folder must have the same type and permission</string> + <string name="TooltipOutfitNotInInventory">You can only put items or outfits from your personal inventory into "My outfits"</string> + <string name="TooltipCantCreateOutfit">One or more items can't be used inside "My outfits"</string> <string name="TooltipDragOntoOwnChild">You can't move a folder into its child</string> <string name="TooltipDragOntoSelf">You can't move a folder into itself</string> @@ -2209,6 +2208,7 @@ For AI Character: Get the closest navigable point to the point provided. <string name="skirt">Skirt</string> <string name="alpha">Alpha</string> <string name="tattoo">Tattoo</string> + <string name="universal">Universal</string> <string name="physics">Physics</string> <string name="invalid">invalid</string> <string name="none">none</string> @@ -2225,6 +2225,7 @@ For AI Character: Get the closest navigable point to the point provided. <string name="skirt_not_worn">Skirt not worn</string> <string name="alpha_not_worn">Alpha not worn</string> <string name="tattoo_not_worn">Tattoo not worn</string> + <string name="universal_not_worn">Universal not worn</string> <string name="physics_not_worn">Physics not worn</string> <string name="invalid_not_worn">invalid</string> @@ -2244,6 +2245,7 @@ For AI Character: Get the closest navigable point to the point provided. <string name="create_new_skirt">Create new skirt</string> <string name="create_new_alpha">Create new alpha</string> <string name="create_new_tattoo">Create new tattoo</string> + <string name="create_new_universal">Create new universal</string> <string name="create_new_physics">Create new physics</string> <string name="create_new_invalid">invalid</string> @@ -2299,6 +2301,9 @@ For AI Character: Get the closest navigable point to the point provided. <string name="MarketplaceURL_Dashboard">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard</string> <string name="MarketplaceURL_Imports">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/imports</string> <string name="MarketplaceURL_LearnMore">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more</string> + <string name="InventoryPlayAnimationTooltip">Open window with Play options.</string> + <string name="InventoryPlayGestureTooltip">Execute selected gesture in-world.</string> + <string name="InventoryPlaySoundTooltip">Open window with Play options.</string> <string name="InventoryOutboxNotMerchantTitle">Anyone can sell items on the Marketplace.</string> <string name="InventoryOutboxNotMerchantTooltip"></string> <string name="InventoryOutboxNotMerchant"> @@ -3650,9 +3655,6 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Drag items from inventory here </string> - <string name="facebook_post_success"> - You posted to Facebook. - </string> <string name="flickr_post_success"> You posted to Flickr. </string> @@ -3809,6 +3811,7 @@ Abuse Report</string> <string name="New Skirt">New Skirt</string> <string name="New Alpha">New Alpha</string> <string name="New Tattoo">New Tattoo</string> + <string name="New Universal">New Universal</string> <string name="New Physics">New Physics</string> <string name="Invalid Wearable">Invalid Wearable</string> <string name="New Gesture">New Gesture</string> @@ -3939,7 +3942,7 @@ Please check http://status.secondlifegrid.net to see if there is a known problem <string name="EmptyOutfitText">There are no items in this outfit</string> <!-- External editor status codes --> - <string name="ExternalEditorNotSet">Select an editor using the ExternalEditor setting.</string> + <string name="ExternalEditorNotSet">Select an editor by setting the environment variable LL_SCRIPT_EDITOR or the ExternalEditor setting.</string> <string name="ExternalEditorNotFound">Cannot find the external editor you specified. Try enclosing path to the editor with double quotes. (e.g. "/path to my/editor" "%s")</string> @@ -4084,7 +4087,6 @@ Try enclosing path to the editor with double quotes. <string name="Command_Conversations_Label">Conversations</string> <string name="Command_Compass_Label">Compass</string> <string name="Command_Destinations_Label">Destinations</string> - <string name="Command_Facebook_Label">Facebook</string> <string name="Command_Flickr_Label">Flickr</string> <string name="Command_Gestures_Label">Gestures</string> <string name="Command_Grid_Status_Label">Grid status</string> @@ -4117,7 +4119,6 @@ Try enclosing path to the editor with double quotes. <string name="Command_Conversations_Tooltip">Converse with everyone</string> <string name="Command_Compass_Tooltip">Compass</string> <string name="Command_Destinations_Tooltip">Destinations of interest</string> - <string name="Command_Facebook_Tooltip">Post to Facebook</string> <string name="Command_Flickr_Tooltip">Upload to Flickr</string> <string name="Command_Gestures_Tooltip">Gestures for your avatar</string> <string name="Command_Grid_Status_Tooltip">Show current Grid status</string> diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml index 46c1b7ff75..bfe6941a8a 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml @@ -13,16 +13,6 @@ text_pad_right="4" arrow_size="10" max_folder_item_overlap="2"> - <facebook_icon - follows="left" - height="14" - image_name="Facebook_Icon" - left="5" - bottom="6" - name="facebook_icon" - tool_tip="Facebook User" - visible="false" - width="14" /> <avatar_icon follows="left" layout="topleft" diff --git a/indra/newview/skins/default/xui/es/floater_about_land.xml b/indra/newview/skins/default/xui/es/floater_about_land.xml index b5da302762..998d2a8863 100644 --- a/indra/newview/skins/default/xui/es/floater_about_land.xml +++ b/indra/newview/skins/default/xui/es/floater_about_land.xml @@ -9,6 +9,12 @@ <floater.string name="maturity_icon_adult"> "Parcel_R_Dark" </floater.string> + <floater.string name="Hours"> + [HOURS] hrs. + </floater.string> + <floater.string name="Hour"> + hr. + </floater.string> <floater.string name="Minutes"> [MINUTES] min. </floater.string> @@ -21,6 +27,9 @@ <floater.string name="Remaining"> restantes </floater.string> + <floater.string name="Always"> + Siempre + </floater.string> <tab_container name="landtab"> <panel label="GENERAL" name="land_general_panel"> <panel.string name="new users only"> @@ -318,18 +327,18 @@ Sólo las parcelas más grandes pueden listarse en la búsqueda. <text name="allow_label2"> Crear objetos: </text> - <check_box label="Todos los residentes" name="edit objects check"/> - <check_box label="El grupo" name="edit group objects check"/> + <check_box label="Todos los residentes" name="edit objects check" tool_tip="Si se selecciona, los residentes pueden crear y colocar objetos en tu tierra."/> + <check_box label="El grupo" name="edit group objects check" tool_tip="Si se selecciona, los miembros de un grupo con parcelas pueden crear y colocar objetos en tu tierra."/> <text name="allow_label3"> Dejar objetos: </text> - <check_box label="Todos los residentes" name="all object entry check"/> - <check_box label="El grupo" name="group object entry check"/> + <check_box label="Todos los residentes" name="all object entry check" tool_tip="Si se selecciona, los Residentes pueden mover objetos existentes de otras parcelas a esta."/> + <check_box label="El grupo" name="group object entry check" tool_tip="Si se selecciona, los miembros de un grupo con parcelas pueden mover objetos existentes de otras parcelas a esta."/> <text name="allow_label4"> Ejecutar scripts: </text> - <check_box label="Todos los residentes" name="check other scripts"/> - <check_box label="El grupo" name="check group scripts"/> + <check_box label="Todos los residentes" name="check other scripts" tool_tip="Si se selecciona, los Residentes pueden correr scripts en tu parcela, incluidos adjuntos."/> + <check_box label="El grupo" name="check group scripts" tool_tip="Si se selecciona, los miembros de un grupo con parcelas pueden correr scripts en tu parcela, incluidos adjuntos."/> <check_box label="Seguro (sin daño)" name="check safe" tool_tip="Si se marca, convierte el terreno en 'seguro', desactivando el daño en combate. Si no, se activa el daño en combate."/> <check_box label="Sin 'empujones'" name="PushRestrictCheck" tool_tip="Previene scripts que empujen. Marcando esta opción prevendrá que en su terreno haya comportamientos destructivos."/> <check_box label="Mostrar el sitio en la búsqueda (30 L$/semana)" name="ShowDirectoryCheck" tool_tip="Let people see this parcel in search results"/> @@ -353,7 +362,7 @@ Sólo las parcelas más grandes pueden listarse en la búsqueda. Foto: </text> <texture_picker label="" name="snapshot_ctrl" tool_tip="Pulse para elegir una imagen"/> - <text name="allow_label5" top="170"> + <text name="allow_see_label"> Los avatares de otras parcelas pueden ver a los avatares de esta parcela y chatear con ellos </text> <check_box label="Ver los avatares" name="SeeAvatarsCheck" tool_tip="Permite que los avatares de otras parcelas vean a los avatares de ésta y chateen con ellos, y también que tú puedas verles y chatear con ellos." top="170"/> @@ -459,9 +468,12 @@ los media: </panel> <panel name="Banned_layout_panel"> <text label="Ban" name="BanCheck"> - Siempre prohibido ([COUNT], max [MAX]) + Prohibido ([COUNT], max [MAX]) </text> - <name_list name="BannedList" tool_tip="([LISTED] listados de un máx. de [MAX])"/> + <name_list name="BannedList" tool_tip="([LISTED] listados de un máx. de [MAX])"> + <columns label="Nombre" name="name"/> + <columns label="Duración" name="duration"/> + </name_list> <button label="Añadir" name="add_banned"/> <button label="Quitar" label_selected="Quitar" name="remove_banned"/> </panel> diff --git a/indra/newview/skins/default/xui/es/floater_ban_duration.xml b/indra/newview/skins/default/xui/es/floater_ban_duration.xml new file mode 100644 index 0000000000..02252ede20 --- /dev/null +++ b/indra/newview/skins/default/xui/es/floater_ban_duration.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="ban_duration" title="Duración"> + <text name="duration_textbox"> + Duración: + </text> + <radio_group name="ban_duration_radio"> + <radio_item label="Siempre" name="always_radio"> + Siempre + </radio_item> + <radio_item label="Temporario" name="temporary_radio"> + Temporario + </radio_item> + </radio_group> + <text name="hours_textbox"> + horas + </text> + <button label="Aceptar" name="ok_btn"/> + <button label="Cancelar" name="cancel_btn"/> +</floater> diff --git a/indra/newview/skins/default/xui/es/floater_gesture.xml b/indra/newview/skins/default/xui/es/floater_gesture.xml index d90de8c9f4..45fb7c6773 100644 --- a/indra/newview/skins/default/xui/es/floater_gesture.xml +++ b/indra/newview/skins/default/xui/es/floater_gesture.xml @@ -20,7 +20,7 @@ <button name="activate_btn" tool_tip="Activar/Desactivar el gesto elegido"/> <button name="del_btn" tool_tip="Borrar este gesto"/> </panel> - <button label="Editar" name="edit_btn"/> - <button label="Reproducir" name="play_btn"/> + <button label="Editar" name="edit_btn" tool_tip="Abrir la ventana para editar el gesto seleccionado."/> + <button label="Reproducir" name="play_btn" tool_tip="Realizar gesto seleccionado en el mundo."/> <button label="Parar" name="stop_btn"/> </floater> diff --git a/indra/newview/skins/default/xui/es/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/es/floater_preferences_graphics_advanced.xml index a0618521ee..b8d5824fb7 100644 --- a/indra/newview/skins/default/xui/es/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/es/floater_preferences_graphics_advanced.xml @@ -43,6 +43,7 @@ <check_box label="Filtrado anisotrópico (enlentece el dibujo)" name="ani"/> <check_box initial_value="true" label="Habilitar objetos de búfer de vértices OpenGL" name="vbo" tool_tip="Su activación en un hardware moderno aumenta el rendimiento. No obstante, la ejecución poco eficiente de los VBO en los equipos antiguos puede hacer que se bloquee la aplicación."/> <check_box initial_value="true" label="Activar la compresión de texturas (requiere reiniciar)" name="texture compression" tool_tip="Comprime las texturas en la memoria de vídeo, lo cual permite cargar texturas de una resolución más alta, pero con una cierta pérdida de calidad del color."/> + <check_box initial_value="true" label="Activar soporte para visores HiDPI (requiere reiniciar)" name="use HiDPI" tool_tip="Activar OpenGl para Dibujos de alta resolución."/> <text name="antialiasing label"> Antialiasing: </text> diff --git a/indra/newview/skins/default/xui/es/floater_preview_notecard.xml b/indra/newview/skins/default/xui/es/floater_preview_notecard.xml index d05a023279..d467aa749c 100644 --- a/indra/newview/skins/default/xui/es/floater_preview_notecard.xml +++ b/indra/newview/skins/default/xui/es/floater_preview_notecard.xml @@ -15,6 +15,7 @@ <text_editor name="Notecard Editor"> Cargando... </text_editor> + <button label="Editar..." label_selected="Editar" name="Edit"/> <button label="Guardar" label_selected="Guardar" name="Save"/> <button label="Borrar" label_selected="Borrar" name="Delete"/> </floater> diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml index eac09b767b..0a3576b799 100644 --- a/indra/newview/skins/default/xui/es/notifications.xml +++ b/indra/newview/skins/default/xui/es/notifications.xml @@ -1589,7 +1589,7 @@ Se superan en [NUM_EXCESS] los [MAX_AGENTS] permitidos en [LIST_TYPE]. [AGENT] ya está en tu lista [LIST_TYPE]. </notification> <notification name="AgentsAreAlreadyInList"> - [AGENT] ya está en tu lista [LIST_TYPE]. + [AGENT] ya están en tu lista [LIST_TYPE]. </notification> <notification name="AgentWasAddedToList"> [AGENT] fue añadido a la lista [LIST_TYPE] de [ESTATE]. diff --git a/indra/newview/skins/default/xui/es/panel_group_general.xml b/indra/newview/skins/default/xui/es/panel_group_general.xml index b00c300c85..a17814d15d 100644 --- a/indra/newview/skins/default/xui/es/panel_group_general.xml +++ b/indra/newview/skins/default/xui/es/panel_group_general.xml @@ -46,7 +46,7 @@ Deja el cursor sobre las opciones para ver más ayuda. <check_box label="Cualquiera puede entrar" name="open_enrollement" tool_tip="Configura si se permite la entrada de nuevos miembros sin ser invitados."/> <check_box label="Cuota de entrada" name="check_enrollment_fee" tool_tip="Configura si hay que pagar una cuota para entrar al grupo"/> <spinner label="L$" left_delta="130" name="spin_enrollment_fee" tool_tip="Si la opción Cuota de entrada está marcada, los nuevos miembros han de pagar esta cuota para entrar al grupo." width="60"/> - <combo_box bottom_delta="-38" name="group_mature_check" tool_tip="Establece si la información de su grupo es moderado." width="150"> + <combo_box bottom_delta="-38" name="group_mature_check" tool_tip="La calificación de contenido designa el tipo de contenido y conducta que se permiten en un grupo" width="150"> <combo_item name="select_mature"> - Selecciona el nivel de calificación - </combo_item> diff --git a/indra/newview/skins/default/xui/es/panel_region_access.xml b/indra/newview/skins/default/xui/es/panel_region_access.xml index 3177aa2ab2..a6b0ee6867 100644 --- a/indra/newview/skins/default/xui/es/panel_region_access.xml +++ b/indra/newview/skins/default/xui/es/panel_region_access.xml @@ -14,6 +14,7 @@ <panel label="PERMITIDO" name="allowed_panel"> <panel label="top_panel" name="allowed_search_panel"> <filter_editor label="Buscar agentes autorizados" name="allowed_search_input"/> + <button label="Copiar" name="copy_allowed_list_btn"/> </panel> <text name="allow_resident_label"> Siempre autorizado: @@ -27,6 +28,7 @@ <panel label="GRUPOS AUTORIZADOS:" name="allowed_groups_panel"> <panel label="top_panel" name="allowed_group_search_panel"> <filter_editor label="Buscar grupos autorizados" name="allowed_group_search_input"/> + <button label="Copiar" name="copy_allowed_group_list_btn"/> </panel> <text name="allow_group_label"> Grupos siempre autorizados: @@ -40,6 +42,7 @@ <panel label="PROHIBIDO" name="banned_panel"> <panel label="top_panel" name="banned_search_panel"> <filter_editor label="Buscar agentes prohibidos" name="banned_search_input"/> + <button label="Copiar" name="copy_banned_list_btn"/> </panel> <text name="ban_resident_label"> Siempre prohibido: diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml index 1b06675670..c9bfbd6610 100644 --- a/indra/newview/skins/default/xui/es/strings.xml +++ b/indra/newview/skins/default/xui/es/strings.xml @@ -67,6 +67,9 @@ Modelo de iluminación avanzado: [GPU_SHADERS] Memoria de textura: [TEXTURE_MEMORY]MB VFS (cache) hora de creación: [VFS_TIME] </string> + <string name="AboutOSXHiDPI"> + Modo de visualización HiDPi: [HIDPI] + </string> <string name="AboutLibs"> Versión de descodificador J2C: [J2C_VERSION] Versión del controlador audio: [AUDIO_DRIVER_VERSION] @@ -1460,6 +1463,15 @@ http://secondlife.com/support para obtener ayuda sobre cómo solucionar este pro <string name="MarketplaceURL_LearnMore"> https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more </string> + <string name="InventoryPlayAnimationTooltip"> + Abrir la ventana con las opciones del Juego + </string> + <string name="InventoryPlayGestureTooltip"> + Realizar gesto seleccionado en el mundo. + </string> + <string name="InventoryPlaySoundTooltip"> + Abrir la ventana con las opciones del Juego + </string> <string name="InventoryOutboxNotMerchantTitle"> Cualquier usuario puede vender objetos en el mercado. </string> @@ -5309,9 +5321,6 @@ Inténtalo incluyendo la ruta de acceso al editor entre comillas <string name="Command_Destinations_Label"> Destinos </string> - <string name="Command_Facebook_Label"> - Facebook - </string> <string name="Command_Flickr_Label"> Flickr </string> @@ -5405,9 +5414,6 @@ Inténtalo incluyendo la ruta de acceso al editor entre comillas <string name="Command_Destinations_Tooltip"> Destinos de interés </string> - <string name="Command_Facebook_Tooltip"> - Publicar en Facebook - </string> <string name="Command_Flickr_Tooltip"> Subir a Flickr </string> diff --git a/indra/newview/skins/default/xui/fr/floater_about_land.xml b/indra/newview/skins/default/xui/fr/floater_about_land.xml index 42d7709c99..219857eb99 100644 --- a/indra/newview/skins/default/xui/fr/floater_about_land.xml +++ b/indra/newview/skins/default/xui/fr/floater_about_land.xml @@ -9,6 +9,12 @@ <floater.string name="maturity_icon_adult"> "Parcel_R_Dark" </floater.string> + <floater.string name="Hours"> + [HEURES] hrs. + </floater.string> + <floater.string name="Hour"> + hr. + </floater.string> <floater.string name="Minutes"> [MINUTES] min </floater.string> @@ -21,6 +27,9 @@ <floater.string name="Remaining"> restantes </floater.string> + <floater.string name="Always"> + Toujours + </floater.string> <tab_container name="landtab" tab_min_width="60"> <panel label="GÉNÉRAL" name="land_general_panel"> <panel.string name="new users only"> @@ -322,18 +331,18 @@ Seules les parcelles de grande taille peuvent apparaître dans la recherche. <text name="allow_label2"> Construire : </text> - <check_box label="Tous" name="edit objects check"/> - <check_box label="Groupe" name="edit group objects check"/> + <check_box label="Tous" name="edit objects check" tool_tip="Si la case est cochée, les résidents peuvent créer et rezzer des objets sur votre terrain."/> + <check_box label="Groupe" name="edit group objects check" tool_tip="Si la case est cochée, les membres du groupe de la parcelle peuvent créer et rezzer des objets sur votre terrain."/> <text name="allow_label3"> Laisser entrer des objets : </text> - <check_box label="Tous" name="all object entry check"/> - <check_box label="Groupe" name="group object entry check"/> + <check_box label="Tous" name="all object entry check" tool_tip="Si la case est cochée, les résidents peuvent déplacer les objets des autres parcelles pour les amener sur cette parcelle."/> + <check_box label="Groupe" name="group object entry check" tool_tip="Si la case est cochée, les membres du groupe de la parcelle peuvent déplacer les objets des autres parcelles pour les amener sur cette parcelle."/> <text name="allow_label4"> Exécuter des scripts : </text> - <check_box label="Tous" name="check other scripts"/> - <check_box label="Groupe" name="check group scripts"/> + <check_box label="Tous" name="check other scripts" tool_tip="Si la case est cochée, les membres du groupe de la parcelle peuvent exécuter des scripts sur votre parcelle, y compris des pièces jointes."/> + <check_box label="Groupe" name="check group scripts" tool_tip="Si la case est cochée, les membres du groupe de la parcelle peuvent exécuter des scripts sur votre parcelle, y compris des pièces jointes."/> <check_box label="Sécurisé (pas de dégâts)" name="check safe" tool_tip="Si cette option est cochée, le terrain est sécurisé et il n'y pas de risques de dommages causés par des combats. Si elle est décochée, des dommages causés par les combats peuvent avoir lieu."/> <check_box label="Pas de bousculades" name="PushRestrictCheck" tool_tip="Empêche l'utilisation de scripts causant des bousculades. Cette option est utile pour empêcher les comportements abusifs sur votre terrain."/> <check_box label="Voir le lieu dans la recherche (30 L$/sem.)" name="ShowDirectoryCheck" tool_tip="Afficher la parcelle dans les résultats de recherche"/> @@ -357,7 +366,7 @@ Seules les parcelles de grande taille peuvent apparaître dans la recherche. Photo : </text> <texture_picker label="" name="snapshot_ctrl" tool_tip="Cliquez pour sélectionner une image"/> - <text name="allow_label5"> + <text name="allow_see_label"> Les avatars sur d'autres parcelles peuvent voir et chatter avec les avatars sur cette parcelle. </text> <check_box label="Voir les avatars" name="SeeAvatarsCheck" tool_tip="Permettre aux avatars présents sur d'autres parcelles de voir et chatter avec les avatars présents sur cette parcelle et à vous de les voir et de chatter avec eux."/> @@ -464,9 +473,12 @@ musique : </panel> <panel name="Banned_layout_panel"> <text label="Bannir" name="BanCheck"> - Toujours interdit ([COUNT], max. [MAX]) + Interdit interdit ([COUNT], max. [MAX]) </text> - <name_list name="BannedList" tool_tip="([LISTED] dans la liste, [MAX] max.)"/> + <name_list name="BannedList" tool_tip="([LISTED] dans la liste, [MAX] max.)"> + <columns label="Nom" name="name"/> + <columns label="Durée" name="duration"/> + </name_list> <button label="Ajouter" name="add_banned"/> <button label="Supprimer" label_selected="Supprimer" name="remove_banned"/> </panel> diff --git a/indra/newview/skins/default/xui/fr/floater_ban_duration.xml b/indra/newview/skins/default/xui/fr/floater_ban_duration.xml new file mode 100644 index 0000000000..2c877b81fa --- /dev/null +++ b/indra/newview/skins/default/xui/fr/floater_ban_duration.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="ban_duration" title="Durée de l'interdiction"> + <text name="duration_textbox"> + Durée de l'interdiction : + </text> + <radio_group name="ban_duration_radio"> + <radio_item label="Toujours" name="always_radio"> + Toujours + </radio_item> + <radio_item label="Temporaire" name="temporary_radio"> + Temporaire + </radio_item> + </radio_group> + <text name="hours_textbox"> + heures + </text> + <button label="OK" name="ok_btn"/> + <button label="Annuler" name="cancel_btn"/> +</floater> diff --git a/indra/newview/skins/default/xui/fr/floater_gesture.xml b/indra/newview/skins/default/xui/fr/floater_gesture.xml index 5ead1cae3a..9f4822e626 100644 --- a/indra/newview/skins/default/xui/fr/floater_gesture.xml +++ b/indra/newview/skins/default/xui/fr/floater_gesture.xml @@ -21,7 +21,7 @@ <button name="activate_btn" tool_tip="Activer/désactiver le geste sélectionné"/> <button name="del_btn" tool_tip="Supprimer ce geste"/> </panel> - <button label="Modifier" name="edit_btn"/> - <button label="Lire" name="play_btn"/> + <button label="Modifier" name="edit_btn" tool_tip="Ouvrir la fenêtre pour modifier le geste sélectionné"/> + <button label="Lire" name="play_btn" tool_tip="Exécuter le geste sélectionné dans le monde virtuel."/> <button label="Stop" name="stop_btn"/> </floater> diff --git a/indra/newview/skins/default/xui/fr/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/fr/floater_preferences_graphics_advanced.xml index 23fff3b770..fd47254934 100644 --- a/indra/newview/skins/default/xui/fr/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/fr/floater_preferences_graphics_advanced.xml @@ -43,6 +43,7 @@ <check_box label="Filtre anisotrope (plus lent quand activé)" name="ani"/> <check_box initial_value="true" label="Activer OpenGL Vertex Buffer Objects" name="vbo" tool_tip="L’activation de cette option sur le matériel récent permet un gain de performance. Cependant, les implémentations VBO pour le matériel plus ancien sont souvent médiocres et votre système risque de se planter quand cette option est activée."/> <check_box initial_value="true" label="Activer la compression des textures (redémarrage requis)" name="texture compression" tool_tip="Comprime les textures en mémoire vidéo afin de permettre de charger des textures de résolution plus élevée au prix d’une certaine qualité de couleur."/> + <check_box initial_value="true" label="Activer le support pour l'affichage en HiDPI (redémarrage requis)" name="use HiDPI" tool_tip="Activer OpenFL pour les dessins en haute résolution"/> <text name="antialiasing label"> Anti-aliasing : </text> diff --git a/indra/newview/skins/default/xui/fr/floater_preview_notecard.xml b/indra/newview/skins/default/xui/fr/floater_preview_notecard.xml index 5646ad45eb..1fc065e6c5 100644 --- a/indra/newview/skins/default/xui/fr/floater_preview_notecard.xml +++ b/indra/newview/skins/default/xui/fr/floater_preview_notecard.xml @@ -15,6 +15,7 @@ <text_editor name="Notecard Editor"> Chargement... </text_editor> + <button label="Modifier..." label_selected="Modifier" name="Edit"/> <button label="Enregistrer" label_selected="Enregistrer" name="Save"/> <button label="Supprimer" label_selected="Supprimer" name="Delete"/> </floater> diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml index 3ac2cfb69b..54f132f684 100644 --- a/indra/newview/skins/default/xui/fr/notifications.xml +++ b/indra/newview/skins/default/xui/fr/notifications.xml @@ -1572,10 +1572,10 @@ Dépasse la limite fixée à [MAX_AGENTS] [LIST_TYPE] de [NUM_EXCESS]. Impossible d’ajouter un résident banni à la liste des gérants de domaine. </notification> <notification name="ProblemBanningEstateManager"> - Impossible d'ajouter le gérant de domaine à la liste interdite. + Impossible d'ajouter le gérant de domaine [AGENT] à la liste interdite. </notification> <notification name="GroupIsAlreadyInList"> - <nolink>[GROUP]</nolink> est déjà dans la liste des groupes autorisés. + <nolink>[GROUP]</nolink> est déjà dans la liste des Groupes autorisés. </notification> <notification name="AgentIsAlreadyInList"> [AGENT] est déjà dans votre liste [LIST_TYPE]. @@ -1587,7 +1587,7 @@ Dépasse la limite fixée à [MAX_AGENTS] [LIST_TYPE] de [NUM_EXCESS]. [AGENT] a été ajouté à la liste [LIST_TYPE] de [ESTATE]. </notification> <notification name="AgentsWereAddedToList"> - [AGENT] ont été ajoutéq à la liste [LIST_TYPE] de [ESTATE]. + [AGENT] ont été ajouté à la liste [LIST_TYPE] de [ESTATE]. </notification> <notification name="AgentWasRemovedFromList"> [AGENT] a été supprimé de la liste [LIST_TYPE] de [ESTATE]. @@ -2987,7 +2987,7 @@ Si vous restez dans cette région, vous serez déconnecté(e). Si vous restez dans cette région, vous serez déconnecté(e). </notification> <notification name="LoadWebPage"> - Charger la page Web [URL] ? + Charger la page Web [URL] ? [MESSAGE] diff --git a/indra/newview/skins/default/xui/fr/panel_group_general.xml b/indra/newview/skins/default/xui/fr/panel_group_general.xml index a2655dcd45..5953e210e5 100644 --- a/indra/newview/skins/default/xui/fr/panel_group_general.xml +++ b/indra/newview/skins/default/xui/fr/panel_group_general.xml @@ -46,7 +46,7 @@ Faites glisser le pointeur de la souris sur les options pour en savoir plus. <check_box label="Inscription ouverte à tous" name="open_enrollement" tool_tip="Indique si ce groupe autorise les nouveaux membres à le rejoindre sans y être invités."/> <check_box label="Inscription payante" name="check_enrollment_fee" tool_tip="Indique s'il faut payer des frais d'inscription pour rejoindre ce groupe"/> <spinner label="L$" name="spin_enrollment_fee" tool_tip="Les nouveaux membres doivent payer ces frais pour rejoindre le groupe quand l'option Frais d'inscription est cochée."/> - <combo_box name="group_mature_check" tool_tip="Définit si votre groupe contient des informations de type Modéré" width="195"> + <combo_box name="group_mature_check" tool_tip="Il s'agit du type de contenu et de comportement autorisé au sein d'un groupe." width="195"> <combo_item name="select_mature"> - Catégorie de contenu - </combo_item> diff --git a/indra/newview/skins/default/xui/fr/panel_region_access.xml b/indra/newview/skins/default/xui/fr/panel_region_access.xml index db77f3b8f1..ab62d3247f 100644 --- a/indra/newview/skins/default/xui/fr/panel_region_access.xml +++ b/indra/newview/skins/default/xui/fr/panel_region_access.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="ACCÈS" name="Access"> +<panel label="Accès" name="Access"> <tab_container name="tabs"> <panel label="GÉRANTS DU DOMAINE" name="estate_managers_panel"> <text name="estate_manager_label"> @@ -14,6 +14,7 @@ <panel label="AUTORISÉ" name="allowed_panel"> <panel label="top_panel" name="allowed_search_panel"> <filter_editor label="Rechercher des agents autorisés" name="allowed_search_input"/> + <button label="Copier" name="copy_allowed_list_btn"/> </panel> <text name="allow_resident_label"> Toujours autorisé : @@ -27,6 +28,7 @@ <panel label="GROUPES AUTORISÉS" name="allowed_groups_panel"> <panel label="top_panel" name="allowed_group_search_panel"> <filter_editor label="Rechercher des groupes autorisés" name="allowed_group_search_input"/> + <button label="Copier" name="copy_allowed_group_list_btn"/> </panel> <text name="allow_group_label"> Groupes toujours autorisés : @@ -40,6 +42,7 @@ <panel label="INTERDIT" name="banned_panel"> <panel label="top_panel" name="banned_search_panel"> <filter_editor label="Rechercher des agents interdits" name="banned_search_input"/> + <button label="Copier" name="copy_banned_list_btn"/> </panel> <text name="ban_resident_label"> Toujours interdit : diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml index dbd5cc3bf4..959494545a 100644 --- a/indra/newview/skins/default/xui/fr/strings.xml +++ b/indra/newview/skins/default/xui/fr/strings.xml @@ -76,6 +76,9 @@ Modèle d’éclairage avancé : [GPU_SHADERS] Mémoire textures : [TEXTURE_MEMORY] Mo Heure de création VFS (cache) : [VFS_TIME] </string> + <string name="AboutOSXHiDPI"> + Mode d'affichage HiDPI : [HIDPI] + </string> <string name="AboutLibs"> J2C Decoder Version: [J2C_VERSION] Audio Driver Version: [AUDIO_DRIVER_VERSION] @@ -1478,6 +1481,15 @@ http://secondlife.com/support pour vous aider à résoudre ce problème. <string name="MarketplaceURL_LearnMore"> https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more </string> + <string name="InventoryPlayAnimationTooltip"> + Ouvrir la fenêtre avec les options Jeu + </string> + <string name="InventoryPlayGestureTooltip"> + Exécuter le geste sélectionné dans le monde virtuel. + </string> + <string name="InventoryPlaySoundTooltip"> + Ouvrir la fenêtre avec les options Jeu + </string> <string name="InventoryOutboxNotMerchantTitle"> Tout le monde peut vendre des articles sur la Place du marché. </string> @@ -5399,9 +5411,6 @@ Essayez avec le chemin d'accès à l'éditeur entre guillemets doubles <string name="Command_Destinations_Label"> Destinations </string> - <string name="Command_Facebook_Label"> - Facebook - </string> <string name="Command_Flickr_Label"> Flickr </string> @@ -5495,9 +5504,6 @@ Essayez avec le chemin d'accès à l'éditeur entre guillemets doubles <string name="Command_Destinations_Tooltip"> Destinations intéressantes </string> - <string name="Command_Facebook_Tooltip"> - Publier sur Facebook - </string> <string name="Command_Flickr_Tooltip"> Charger sur Flickr </string> diff --git a/indra/newview/skins/default/xui/it/floater_about_land.xml b/indra/newview/skins/default/xui/it/floater_about_land.xml index 67c46b6b62..0a7837e122 100644 --- a/indra/newview/skins/default/xui/it/floater_about_land.xml +++ b/indra/newview/skins/default/xui/it/floater_about_land.xml @@ -9,6 +9,12 @@ <floater.string name="maturity_icon_adult"> "Parcel_R_Dark" </floater.string> + <floater.string name="Hours"> + [HOURS] ore. + </floater.string> + <floater.string name="Hour"> + ora. + </floater.string> <floater.string name="Minutes"> [MINUTES] min </floater.string> @@ -21,6 +27,9 @@ <floater.string name="Remaining"> rimanenti </floater.string> + <floater.string name="Always"> + Sempre + </floater.string> <tab_container name="landtab"> <panel label="GENERALE" name="land_general_panel"> <panel.string name="new users only"> @@ -323,18 +332,18 @@ Solamente terreni più grandi possono essere abilitati nella ricerca. <text name="allow_label2"> Creare oggetti: </text> - <check_box label="Tutti i residenti" name="edit objects check"/> - <check_box label="Gruppo" name="edit group objects check"/> + <check_box label="Tutti i residenti" name="edit objects check" tool_tip="Se la casella è spuntata, i Residenti possono creare e rezzare oggetti sul tuo terreno."/> + <check_box label="Gruppo" name="edit group objects check" tool_tip="Se la casella è spuntata, i Residenti possono creare e rezzare oggetti sul tuo terreno."/> <text name="allow_label3"> Immissione oggetti: </text> - <check_box label="Tutti i residenti" name="all object entry check"/> - <check_box label="Gruppo" name="group object entry check"/> + <check_box label="Tutti i residenti" name="all object entry check" tool_tip="Se la casella è spuntata, i membri del lotto di gruppo possono muovere gli oggetti esistenti da altri lotti a questo."/> + <check_box label="Gruppo" name="group object entry check" tool_tip="Se la casella è spuntata, i membri del lotto di gruppo possono muovere gli oggetti esistenti da altri lotti a questo."/> <text name="allow_label4"> Avere script attivi: </text> - <check_box label="Tutti i residenti" name="check other scripts"/> - <check_box label="Gruppo" name="check group scripts"/> + <check_box label="Tutti i residenti" name="check other scripts" tool_tip="Se la casella è spuntata, i Residenti possono eseguire script sul tuo lotto, compresi gli allegati."/> + <check_box label="Gruppo" name="check group scripts" tool_tip="Se la casella è spuntata, i Residenti possono eseguire script sul tuo lotto, compresi gli allegati."/> <check_box label="Sicuro (senza danno)" name="check safe" tool_tip="Se spuntato, imposta il terreno su 'sicuro', disabilitando i danni da combattimento. Se non spuntato, viene abilitato il combattimento con danni."/> <check_box label="Nessuna spinta" name="PushRestrictCheck" tool_tip="Previeni i colpi. Selezionare questa opzione può essere utile per prevenire comportamenti dannosi sul tuo terreno."/> <check_box label="Mostra luogo nella ricerca (30 L$/settimana)" name="ShowDirectoryCheck" tool_tip="Consenti che il lotto sia visto nei risultati di ricerca"/> @@ -358,8 +367,8 @@ Solamente terreni più grandi possono essere abilitati nella ricerca. Fotografia: </text> <texture_picker label="" name="snapshot_ctrl" tool_tip="Clicca per scegliere una immagine"/> - <text name="allow_label5"> - Gli avatar su altri lotti possono vedere gli avatar su questo lotto e chattare con loro + <text name="allow_see_label"> + Gli avatar di altri lotti possono vedere gli avatar che si trovano in questo lotto e chattare con loro </text> <check_box label="Vedi avatar" name="SeeAvatarsCheck" tool_tip="Consente ad avatar in altri lotti di vedere e chattare con avatar in questo lotto e viceversa."/> <text name="landing_point"> @@ -464,9 +473,12 @@ Media: </panel> <panel name="Banned_layout_panel"> <text label="Espelli" name="BanCheck"> - Sempre esclusi ([COUNT], max [MAX]) + Espulsi ([COUNT], max [MAX]) </text> - <name_list name="BannedList" tool_tip="([LISTED] in lista, [MAX] max)"/> + <name_list name="BannedList" tool_tip="([LISTED] in lista, [MAX] max)"> + <columns label="Nome" name="name"/> + <columns label="Durata" name="duration"/> + </name_list> <button label="Aggiungi" name="add_banned"/> <button label="Rimuovi" label_selected="Rimuovi" name="remove_banned"/> </panel> diff --git a/indra/newview/skins/default/xui/it/floater_ban_duration.xml b/indra/newview/skins/default/xui/it/floater_ban_duration.xml new file mode 100644 index 0000000000..996cb82cd7 --- /dev/null +++ b/indra/newview/skins/default/xui/it/floater_ban_duration.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="ban_duration" title="Durata espulsione"> + <text name="duration_textbox"> + Durata espulsione: + </text> + <radio_group name="ban_duration_radio"> + <radio_item label="Sempre" name="always_radio"> + Sempre + </radio_item> + <radio_item label="Temporanea" name="temporary_radio"> + Temporanea + </radio_item> + </radio_group> + <text name="hours_textbox"> + ore. + </text> + <button label="Ok" name="ok_btn"/> + <button label="Annulla" name="cancel_btn"/> +</floater> diff --git a/indra/newview/skins/default/xui/it/floater_gesture.xml b/indra/newview/skins/default/xui/it/floater_gesture.xml index b9419ebc22..0382cf9a90 100644 --- a/indra/newview/skins/default/xui/it/floater_gesture.xml +++ b/indra/newview/skins/default/xui/it/floater_gesture.xml @@ -20,7 +20,7 @@ <button name="activate_btn" tool_tip="Attiva/Disattiva gesture selezionata"/> <button name="del_btn" tool_tip="Elimina questa gesture"/> </panel> - <button label="Modifica" name="edit_btn"/> - <button label="Play" name="play_btn"/> + <button label="Modifica" name="edit_btn" tool_tip="Apri la finestra per modificare il movimento selezionato."/> + <button label="Play" name="play_btn" tool_tip="Esegui il movimento selezionato nel mondo virtuale."/> <button label="Stop" name="stop_btn"/> </floater> diff --git a/indra/newview/skins/default/xui/it/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/it/floater_preferences_graphics_advanced.xml index b9fe6d76e7..3773ef3711 100644 --- a/indra/newview/skins/default/xui/it/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/it/floater_preferences_graphics_advanced.xml @@ -43,6 +43,7 @@ <check_box label="Filtro anisotropico (rallenta quando è attivato)" name="ani"/> <check_box initial_value="true" label="Attiva oggetti buffer vertici OpenGL" name="vbo" tool_tip="Se si attiva questa impostazione su hardware più recente si migliorano le prestazioni. Con la funzione attiva, l'hardware meno recente potrebbe implementare VBO in maniera errata, causando interruzioni."/> <check_box initial_value="true" label="Attiva compressione texture (richiede riavvio)" name="texture compression" tool_tip="Comprime le texture nella memoria video, consentendo il caricamento di texture a risoluzione maggiore al prezzo di una perdita di qualità del colore."/> + <check_box initial_value="true" label="Abilita assistenza per display HiDPI (riavvio necessario)" name="use HiDPI" tool_tip="Abilita OpenGL per disegni ad alta risoluzione."/> <text name="antialiasing label"> Antialiasing: </text> diff --git a/indra/newview/skins/default/xui/it/floater_preview_notecard.xml b/indra/newview/skins/default/xui/it/floater_preview_notecard.xml index 7ec229f9d3..d08bcb217b 100644 --- a/indra/newview/skins/default/xui/it/floater_preview_notecard.xml +++ b/indra/newview/skins/default/xui/it/floater_preview_notecard.xml @@ -15,6 +15,7 @@ <text_editor name="Notecard Editor"> In caricamento... </text_editor> + <button label="Modifica..." label_selected="Modifica" name="Edit"/> <button label="Salva" label_selected="Salva" name="Save"/> <button label="Elimina" label_selected="Elimina" name="Delete"/> </floater> diff --git a/indra/newview/skins/default/xui/it/floater_report_abuse.xml b/indra/newview/skins/default/xui/it/floater_report_abuse.xml index f74d84fb8f..2fad438a4e 100644 --- a/indra/newview/skins/default/xui/it/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/it/floater_report_abuse.xml @@ -76,7 +76,7 @@ <combo_box.item label="Terreno > Invasione > Oggetti o texture" name="Land__Encroachment__Objects_textures"/> <combo_box.item label="Terreno > Invasione > Particelle" name="Land__Encroachment__Particles"/> <combo_box.item label="Terreno > Invasione > Alberi/piante" name="Land__Encroachment__Trees_plants"/> - <combo_box.item label="Violazione regole del gioco" name="Wagering_gambling"/> + <combo_box.item label="Skill Violazione regole del gioco" name="Wagering_gambling"/> <combo_box.item label="Altro" name="Other"/> </combo_box> <text name="abuser_name_title"> diff --git a/indra/newview/skins/default/xui/it/notifications.xml b/indra/newview/skins/default/xui/it/notifications.xml index 07a3eb5095..d7be208c51 100644 --- a/indra/newview/skins/default/xui/it/notifications.xml +++ b/indra/newview/skins/default/xui/it/notifications.xml @@ -1574,7 +1574,7 @@ Eccede il [MAX_AGENTS] [LIST_TYPE] limite di [NUM_EXCESS]. Impossibile aggiungere il residente espulso alla lista dei gestori delle proprietà. </notification> <notification name="ProblemBanningEstateManager"> - Impossibile aggiunere il gestore della proprietà immobiliare [AGENT] all’elenco degli espulsi. + Impossibile aggiungere il gestore della proprietà immobiliare [AGENT] all’elenco degli espulsi. </notification> <notification name="GroupIsAlreadyInList"> <nolink>[GROUP]</nolink> si trova già nell’elenco dei Gruppi ammessi. @@ -1916,7 +1916,7 @@ Cambierà migliaia di regioni e produrrà seri problemi ai vari server. <usetemplate canceltext="Annulla" name="yesnocancelbuttons" notext="Tutte le proprietà" yestext="Questa proprietà"/> </notification> <notification label="Seleziona la proprietà" name="EstateBannedAgentRemove"> - Rimuovi questo Residente dall’elenco degli espulsi solo per questa proprietà immobiliare oppure per [ALL_ESTATES]? + Vuoi rimuovere questo Residente dall’elenco degli espulsi solo per questa proprietà immobiliare oppure per [ALL_ESTATES]? <usetemplate canceltext="Annulla" name="yesnocancelbuttons" notext="Tutte le proprietà" yestext="Questa proprietà"/> </notification> <notification label="Seleziona la proprietà" name="EstateManagerAdd"> diff --git a/indra/newview/skins/default/xui/it/panel_group_general.xml b/indra/newview/skins/default/xui/it/panel_group_general.xml index 49baa73811..60028e6098 100644 --- a/indra/newview/skins/default/xui/it/panel_group_general.xml +++ b/indra/newview/skins/default/xui/it/panel_group_general.xml @@ -46,7 +46,7 @@ Muovi il tuo mouse sopra le opzioni per maggiore aiuto. <check_box label="Chiunque può aderire" name="open_enrollement" tool_tip="Imposta se questo gruppo permette ai nuovi membri di aderire senza essere invitati."/> <check_box label="Quota di adesione" name="check_enrollment_fee" tool_tip="Imposta se richiedere una tassa d'iscrizione per aderire al gruppo"/> <spinner label="L$" left_delta="136" name="spin_enrollment_fee" tool_tip="I nuovi soci devono pagare questa tassa d'iscrizione quando è selezionata." width="60"/> - <combo_box name="group_mature_check" tool_tip="Imposta se le informazioni sul tuo gruppo sono da considerarsi di tipo Moderato."> + <combo_box name="group_mature_check" tool_tip="Le categorie di accesso definiscono il tipo di contenuti e di comportamenti ammessi in un gruppo"> <combo_item name="select_mature"> - Seleziona categoria di accesso - </combo_item> diff --git a/indra/newview/skins/default/xui/it/panel_region_access.xml b/indra/newview/skins/default/xui/it/panel_region_access.xml index 06ab2b40e7..7547dbe76f 100644 --- a/indra/newview/skins/default/xui/it/panel_region_access.xml +++ b/indra/newview/skins/default/xui/it/panel_region_access.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="ACCESSO" name="Access"> +<panel label="Accesso" name="Access"> <tab_container name="tabs"> <panel label="GESTORI DELLE PROPRIETÀ IMMOBILIARI" name="estate_managers_panel"> <text name="estate_manager_label"> - Gestori delle proprietà immobiliari + Gestori delle proprietà immobiliari: </text> <name_list name="estate_manager_name_list"> <columns label="Nome" name="name"/> @@ -14,9 +14,10 @@ <panel label="AMMESSO" name="allowed_panel"> <panel label="top_panel" name="allowed_search_panel"> <filter_editor label="Cerca agenti ammessi" name="allowed_search_input"/> + <button label="Copia" name="copy_allowed_list_btn"/> </panel> <text name="allow_resident_label"> - Sempre ammesso: + Sempre ammessi: </text> <name_list name="allowed_avatar_name_list"> <columns label="Nome" name="name"/> @@ -26,10 +27,11 @@ </panel> <panel label="GRUPPI AMMESSI" name="allowed_groups_panel"> <panel label="top_panel" name="allowed_group_search_panel"> - <filter_editor label="Cerca gruppi consentiti" name="allowed_group_search_input"/> + <filter_editor label="Cerca gruppi ammessi" name="allowed_group_search_input"/> + <button label="Copia" name="copy_allowed_group_list_btn"/> </panel> <text name="allow_group_label"> - Gruppi sempre consentiti: + Gruppi sempre ammessi: </text> <name_list name="allowed_group_name_list"> <columns label="Nome" name="name"/> @@ -40,6 +42,7 @@ <panel label="ESPULSI" name="banned_panel"> <panel label="top_panel" name="banned_search_panel"> <filter_editor label="Cerca agenti espulsi" name="banned_search_input"/> + <button label="Copia" name="copy_banned_list_btn"/> </panel> <text name="ban_resident_label"> Sempre espulsi: diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml index 9492d062c3..9265ce9ec6 100644 --- a/indra/newview/skins/default/xui/it/strings.xml +++ b/indra/newview/skins/default/xui/it/strings.xml @@ -73,6 +73,9 @@ Modello illuminazione avanzato: [GPU_SHADERS] Memoria texture: [TEXTURE_MEMORY]MB Data/ora creazione VFS (cache): [VFS_TIME] </string> + <string name="AboutOSXHiDPI"> + Modalità display HiDPI: [HIDPI] + </string> <string name="AboutLibs"> J2C Versione decoder: [J2C_VERSION] Versione del driver audio: [AUDIO_DRIVER_VERSION][LIBCEF_VERSION] @@ -1468,6 +1471,15 @@ http://secondlife.com/support per risolvere il problema. <string name="MarketplaceURL_LearnMore"> https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more </string> + <string name="InventoryPlayAnimationTooltip"> + Apri finestra con opzioni di Gioco. + </string> + <string name="InventoryPlayGestureTooltip"> + Esegui il movimento selezionato nel mondo virtuale. + </string> + <string name="InventoryPlaySoundTooltip"> + Apri finestra con opzioni di Gioco. + </string> <string name="InventoryOutboxNotMerchantTitle"> Chiunque può vendere oggetti nel Marketplace. </string> @@ -5314,9 +5326,6 @@ Prova a racchiudere il percorso dell'editor in doppie virgolette. <string name="Command_Destinations_Label"> Destinazioni </string> - <string name="Command_Facebook_Label"> - Facebook - </string> <string name="Command_Flickr_Label"> Flickr </string> @@ -5410,9 +5419,6 @@ Prova a racchiudere il percorso dell'editor in doppie virgolette. <string name="Command_Destinations_Tooltip"> Destinazioni interessanti </string> - <string name="Command_Facebook_Tooltip"> - Pubblica su Facebook - </string> <string name="Command_Flickr_Tooltip"> Carica su Flickr </string> diff --git a/indra/newview/skins/default/xui/ja/floater_about_land.xml b/indra/newview/skins/default/xui/ja/floater_about_land.xml index df94daad8e..d26a1b34d5 100644 --- a/indra/newview/skins/default/xui/ja/floater_about_land.xml +++ b/indra/newview/skins/default/xui/ja/floater_about_land.xml @@ -9,6 +9,12 @@ <floater.string name="maturity_icon_adult"> "Parcel_R_Dark" </floater.string> + <floater.string name="Hours"> + [HOURS] 時間 + </floater.string> + <floater.string name="Hour"> + 時間 + </floater.string> <floater.string name="Minutes"> [MINUTES] 分 </floater.string> @@ -21,6 +27,9 @@ <floater.string name="Remaining"> 残り </floater.string> + <floater.string name="Always"> + 常時 + </floater.string> <tab_container name="landtab"> <panel label="一般" name="land_general_panel"> <panel.string name="new users only"> @@ -320,18 +329,18 @@ <text name="allow_label2"> 制作: </text> - <check_box label="全員" name="edit objects check"/> - <check_box label="グループ" name="edit group objects check"/> + <check_box label="全員" name="edit objects check" tool_tip="このオプションを選択すると、住人はあなたの土地でオブジェクトの制作や rez ができます。"/> + <check_box label="グループ" name="edit group objects check" tool_tip="このオプションを選択すると、区画のグループメンバーは、あなたの土地でオブジェクトの制作や rez ができます。"/> <text name="allow_label3"> オブジェクトの進入: </text> - <check_box label="全員" name="all object entry check"/> - <check_box label="グループ" name="group object entry check"/> + <check_box label="全員" name="all object entry check" tool_tip="このオプションを選択すると、住人は他の区画にあるオブジェクトをこの区画に移動することが可能です。"/> + <check_box label="グループ" name="group object entry check" tool_tip="このオプションを選択すると、区画のグループメンバーは他の区画にあるオブジェクトをこの区画に移動することが可能です。"/> <text name="allow_label4"> スクリプトの実行: </text> - <check_box label="全員" name="check other scripts"/> - <check_box label="グループ" name="check group scripts"/> + <check_box label="全員" name="check other scripts" tool_tip="このオプションを選択すると、住人はアタッチメントなどのスクリプトをあなたの区画で実行できます。"/> + <check_box label="グループ" name="check group scripts" tool_tip="このオプションを選択すると、区画のグループメンバーは、アタッチメントなどのスクリプトをあなたの区画で実行できます。"/> <check_box label="安全(ダメージなし)" name="check safe" tool_tip="チェックを入れるとこの土地でのダメージコンバットが無効になり、「安全」に設定されます。 チェックを外すとダメージコンバットが有効になります。"/> <check_box label="プッシュ禁止" name="PushRestrictCheck" tool_tip="スクリプトによるプッシュを禁止します。 このオプションを選択することにより、あなたの土地での破壊的行動を防ぐことができます。"/> <check_box label="検索に区画を表示(週 L$ 30)" name="ShowDirectoryCheck" tool_tip="この区画を検索結果に表示します"/> @@ -355,8 +364,8 @@ スナップショット: </text> <texture_picker label="" name="snapshot_ctrl" tool_tip="写真をクリックして選択"/> - <text name="allow_label5"> - 他の区画にいるアバターがこの区画にいるアバターに会ってチャットできる + <text name="allow_see_label"> + 他の区画にいるアバターがこの区画にいるアバターに会ってチャットできます </text> <check_box label="アバターを表示" name="SeeAvatarsCheck" tool_tip="他の区画のアバターが、この区画にいるアバターに会ってチャットすることを許可し、あなたもそれらアバターに会ってチャットできるようにします。"/> <text name="landing_point"> @@ -458,9 +467,12 @@ </panel> <panel name="Banned_layout_panel"> <text label="禁止" name="BanCheck"> - 常に禁止する ([COUNT] 人、最大 [MAX] 人) + 禁止する ([COUNT] 人、最大 [MAX] 人) </text> - <name_list name="BannedList" tool_tip="(合計 [LISTED] 人、最大 [MAX] 人)"/> + <name_list name="BannedList" tool_tip="(合計 [LISTED] 人、最大 [MAX] 人)"> + <columns label="名前" name="name"/> + <columns label="期間" name="duration"/> + </name_list> <button label="追加" name="add_banned"/> <button label="削除" label_selected="削除" name="remove_banned"/> </panel> diff --git a/indra/newview/skins/default/xui/ja/floater_ban_duration.xml b/indra/newview/skins/default/xui/ja/floater_ban_duration.xml new file mode 100644 index 0000000000..a9d00b0116 --- /dev/null +++ b/indra/newview/skins/default/xui/ja/floater_ban_duration.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="ban_duration" title="禁止期間"> + <text name="duration_textbox"> + 禁止期間: + </text> + <radio_group name="ban_duration_radio"> + <radio_item label="常時" name="always_radio"> + 常時 + </radio_item> + <radio_item label="一時的" name="temporary_radio"> + 一時的 + </radio_item> + </radio_group> + <text name="hours_textbox"> + 時間 + </text> + <button label="Ok" name="ok_btn"/> + <button label="キャンセル" name="cancel_btn"/> +</floater> diff --git a/indra/newview/skins/default/xui/ja/floater_gesture.xml b/indra/newview/skins/default/xui/ja/floater_gesture.xml index 1ed5ad31db..b5b1efe386 100644 --- a/indra/newview/skins/default/xui/ja/floater_gesture.xml +++ b/indra/newview/skins/default/xui/ja/floater_gesture.xml @@ -21,7 +21,7 @@ <button name="activate_btn" tool_tip="選択したジェスチャーのアクティベートの有無"/> <button name="del_btn" tool_tip="このジェスチャーを削除"/> </panel> - <button label="編集" name="edit_btn"/> - <button label="再生" name="play_btn"/> + <button label="編集" name="edit_btn" tool_tip="選択済みのジェスチャーを編集するためにウィンドウを開ける。"/> + <button label="再生" name="play_btn" tool_tip="インワールドで選択済みのジェスチャーを実行する。"/> <button label="停止" name="stop_btn"/> </floater> diff --git a/indra/newview/skins/default/xui/ja/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/ja/floater_preferences_graphics_advanced.xml index ff7814ffb7..c28afa4c98 100644 --- a/indra/newview/skins/default/xui/ja/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/ja/floater_preferences_graphics_advanced.xml @@ -43,6 +43,7 @@ <check_box label="異方的フィルタリング (有効にすると速度が低下)" name="ani"/> <check_box initial_value="true" label="OpenGL Vertex Buffer Objects を有効化" name="vbo" tool_tip="最新のハードウェアでこのオプションを有効にするとパフォーマンスが向上します。ただし、古いハードウェアでは VBO の実装が貧弱なため、このオプションを有効にするとクラッシュする場合があります。"/> <check_box initial_value="true" label="テクスチャ圧縮の有効化 (再起動後に反映)" name="texture compression" tool_tip="ビデオメモリでテクスチャを圧縮すると、一部のカラー品質を犠牲にして、高解像度のテクスチャをロードできます。"/> + <check_box initial_value="true" label="HiDPI 表示のためにサポートを有効にする(再起動が必要)" name="use HiDPI" tool_tip="高画質の描画のために OpenGL を有効にする"/> <text name="antialiasing label"> アンチエイリアシング: </text> diff --git a/indra/newview/skins/default/xui/ja/floater_preview_notecard.xml b/indra/newview/skins/default/xui/ja/floater_preview_notecard.xml index ae8ae9f7b5..ef7e90a6bc 100644 --- a/indra/newview/skins/default/xui/ja/floater_preview_notecard.xml +++ b/indra/newview/skins/default/xui/ja/floater_preview_notecard.xml @@ -15,6 +15,7 @@ <text_editor name="Notecard Editor"> ローディング... </text_editor> + <button label="編集..." label_selected="編集" name="Edit"/> <button label="保存" label_selected="保存" name="Save"/> <button label="削除" label_selected="削除" name="Delete"/> </floater> diff --git a/indra/newview/skins/default/xui/ja/floater_report_abuse.xml b/indra/newview/skins/default/xui/ja/floater_report_abuse.xml index 7631cd7aba..4ddd0d2605 100644 --- a/indra/newview/skins/default/xui/ja/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/ja/floater_report_abuse.xml @@ -76,7 +76,7 @@ <combo_box.item label="土地 > 不法侵入 > オブジェクトまたはテクスチャ" name="Land__Encroachment__Objects_textures"/> <combo_box.item label="土地>不法侵入>パーティクル" name="Land__Encroachment__Particles"/> <combo_box.item label="土地>不法侵入>樹木/植物" name="Land__Encroachment__Trees_plants"/> - <combo_box.item label="ゲーミング ポリシー違反" name="Wagering_gambling"/> + <combo_box.item label="スキルゲーミング ポリシー違反" name="Wagering_gambling"/> <combo_box.item label="その他" name="Other"/> </combo_box> <text name="abuser_name_title"> diff --git a/indra/newview/skins/default/xui/ja/panel_group_general.xml b/indra/newview/skins/default/xui/ja/panel_group_general.xml index a1bfb67823..aab536f653 100644 --- a/indra/newview/skins/default/xui/ja/panel_group_general.xml +++ b/indra/newview/skins/default/xui/ja/panel_group_general.xml @@ -46,7 +46,7 @@ <check_box label="誰でも入会できます" name="open_enrollement" tool_tip="招待されなくても新規メンバーが加入できるかどうかを設定します。"/> <check_box label="入会費がかかります" name="check_enrollment_fee" tool_tip="入会費が必要かどうかを設定します。"/> <spinner label="L$" name="spin_enrollment_fee" tool_tip="「入会費」にチェックが入っている場合、新規メンバーは指定された入会費を支払わなければグループに入れません。"/> - <combo_box name="group_mature_check" tool_tip="あなたのグループに「Moderate」にレート設定された情報があるかどうかを設定します"> + <combo_box name="group_mature_check" tool_tip="レーティング区分は、グループ内でどのようなコンテンツや行動が許されるかを指定するものです"> <combo_item name="select_mature"> - レーティング区分を指定 - </combo_item> diff --git a/indra/newview/skins/default/xui/ja/panel_region_access.xml b/indra/newview/skins/default/xui/ja/panel_region_access.xml index c0612dd150..34809688d0 100644 --- a/indra/newview/skins/default/xui/ja/panel_region_access.xml +++ b/indra/newview/skins/default/xui/ja/panel_region_access.xml @@ -14,6 +14,7 @@ <panel label="許可" name="allowed_panel"> <panel label="top_panel" name="allowed_search_panel"> <filter_editor label="許可されたエージェントを検索" name="allowed_search_input"/> + <button label="コピー" name="copy_allowed_list_btn"/> </panel> <text name="allow_resident_label"> 常に許可: @@ -27,6 +28,7 @@ <panel label="許可されたグループ" name="allowed_groups_panel"> <panel label="top_panel" name="allowed_group_search_panel"> <filter_editor label="許可されたグループを検索" name="allowed_group_search_input"/> + <button label="コピー" name="copy_allowed_group_list_btn"/> </panel> <text name="allow_group_label"> 常に許可されたグループ: @@ -40,6 +42,7 @@ <panel label="禁止" name="banned_panel"> <panel label="top_panel" name="banned_search_panel"> <filter_editor label="禁止されたエージェントを検索" name="banned_search_input"/> + <button label="コピー" name="copy_banned_list_btn"/> </panel> <text name="ban_resident_label"> 常に禁止: diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml index 91d31faa76..1e123eb619 100644 --- a/indra/newview/skins/default/xui/ja/strings.xml +++ b/indra/newview/skins/default/xui/ja/strings.xml @@ -76,6 +76,9 @@ LOD 係数: [LOD_FACTOR] テクスチャメモリ: [TEXTURE_MEMORY]MB VFS(キャッシュ)作成時間: [VFS_TIME] </string> + <string name="AboutOSXHiDPI"> + HiDPI 表示モード: [HIDPI] + </string> <string name="AboutLibs"> J2C デコーダバージョン: [J2C_VERSION] オーディオドライババージョン: [AUDIO_DRIVER_VERSION] @@ -1477,6 +1480,15 @@ support@secondlife.com にお問い合わせください。 <string name="MarketplaceURL_LearnMore"> https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more </string> + <string name="InventoryPlayAnimationTooltip"> + [再生] オプションでウィンドウを開ける。 + </string> + <string name="InventoryPlayGestureTooltip"> + インワールドで選択済みのジェスチャーを実行する。 + </string> + <string name="InventoryPlaySoundTooltip"> + [再生] オプションでウィンドウを開ける。 + </string> <string name="InventoryOutboxNotMerchantTitle"> マーケットプレイスでは誰でもアイテムを売ることができます。 </string> @@ -5397,9 +5409,6 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ <string name="Command_Destinations_Label"> 行き先 </string> - <string name="Command_Facebook_Label"> - Facebook - </string> <string name="Command_Flickr_Label"> Flickr </string> @@ -5493,9 +5502,6 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ <string name="Command_Destinations_Tooltip"> 行ってみたい場所 </string> - <string name="Command_Facebook_Tooltip"> - Facebook へ投稿 - </string> <string name="Command_Flickr_Tooltip"> Flickr にアップロード </string> diff --git a/indra/newview/skins/default/xui/pt/floater_about_land.xml b/indra/newview/skins/default/xui/pt/floater_about_land.xml index 6039b7fd4a..ef71baa0b6 100644 --- a/indra/newview/skins/default/xui/pt/floater_about_land.xml +++ b/indra/newview/skins/default/xui/pt/floater_about_land.xml @@ -9,6 +9,12 @@ <floater.string name="maturity_icon_adult"> "Parcel_R_Dark" </floater.string> + <floater.string name="Hours"> + [HOURS] hrs. + </floater.string> + <floater.string name="Hour"> + hr. + </floater.string> <floater.string name="Minutes"> [MINUTES] min. </floater.string> @@ -21,6 +27,9 @@ <floater.string name="Remaining"> faltam </floater.string> + <floater.string name="Always"> + Sempre + </floater.string> <tab_container name="landtab"> <panel label="GERAL" name="land_general_panel"> <panel.string name="new users only"> @@ -318,18 +327,18 @@ Apenas lotes maiores podem ser listados na busca. <text name="allow_label2"> Criar objetos: </text> - <check_box label="Residentes" name="edit objects check"/> - <check_box label="Grupo" name="edit group objects check"/> + <check_box label="Residentes" name="edit objects check" tool_tip="Se verificado, os Residentes podem criar e mover objetos no seu terreno."/> + <check_box label="Grupo" name="edit group objects check" tool_tip="Se verificado, o grupo de membros do terreno podem criar e adicionar objetos no seu terreno."/> <text name="allow_label3"> Entrada de objetos: </text> - <check_box label="Residentes" name="all object entry check"/> - <check_box label="Grupo" name="group object entry check"/> + <check_box label="Residentes" name="all object entry check" tool_tip="Se verificado, os Residentes podem mover objetos existentes de outros terrenos para esse terreno."/> + <check_box label="Grupo" name="group object entry check" tool_tip="Se verificado, o grupo de membros do terreno podem mover os objetos existentes de outros terrenos para esse terreno."/> <text name="allow_label4"> Executar scripts: </text> - <check_box label="Residentes" name="check other scripts"/> - <check_box label="Grupo" name="check group scripts"/> + <check_box label="Residentes" name="check other scripts" tool_tip="Se verificado, os Residentes podem rodar scripts no seu terreno, incluindo anexos."/> + <check_box label="Grupo" name="check group scripts" tool_tip="Se verificado, o grupo de membros do terreno podem rodar scripts no seu terreno, incluindo anexos."/> <check_box label="Seguro (sem danos)" name="check safe" tool_tip="Se ativado, ajusta o terreno para Seguro, impedindo lutas com danos. Se não ativado, lutas com danos é habilitado."/> <check_box label="Proibido empurrar" name="PushRestrictCheck" tool_tip="Evita scripts que empurram. Ativar essa opção ajuda a prevenir comportamentos desordeiros no seu terreno."/> <check_box label="Mostrar terreno nos resultados de busca (L$30/semana)" name="ShowDirectoryCheck" tool_tip="Permitir que as pessoas vejam este terreno nos resultados de busca"/> @@ -353,7 +362,7 @@ Apenas lotes maiores podem ser listados na busca. Foto: </text> <texture_picker label="" name="snapshot_ctrl" tool_tip="Clique para escolher uma imagem"/> - <text name="allow_label5"> + <text name="allow_see_label"> Avatares em outros lotes podem ver e conversar com avatares neste lote </text> <check_box label="Ver avatares" name="SeeAvatarsCheck" tool_tip="Permite que os avatares em outros lotes vejam e batam papo com avatares neste lote. Você poderá vê-los e conversar com eles."/> @@ -459,9 +468,12 @@ Mídia: </panel> <panel name="Banned_layout_panel"> <text label="Ban" name="BanCheck"> - Sempre banido ([COUNT], máx: [MAX]) + Banido ([COUNT], máx: [MAX]) </text> - <name_list name="BannedList" tool_tip="(Total [LISTED], máx de [MAX])"/> + <name_list name="BannedList" tool_tip="(Total [LISTED], máx de [MAX])"> + <columns label="Nome" name="name"/> + <columns label="Duração" name="duration"/> + </name_list> <button label="Adicionar" name="add_banned"/> <button label="Tirar" label_selected="Tirar" name="remove_banned"/> </panel> diff --git a/indra/newview/skins/default/xui/pt/floater_ban_duration.xml b/indra/newview/skins/default/xui/pt/floater_ban_duration.xml new file mode 100644 index 0000000000..1b2bab88c7 --- /dev/null +++ b/indra/newview/skins/default/xui/pt/floater_ban_duration.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="ban_duration" title="Duração do banimento"> + <text name="duration_textbox"> + Duração do banimento: + </text> + <radio_group name="ban_duration_radio"> + <radio_item label="Sempre" name="always_radio"> + Sempre + </radio_item> + <radio_item label="Temporário" name="temporary_radio"> + Temporário + </radio_item> + </radio_group> + <text name="hours_textbox"> + horas. + </text> + <button label="Ok" name="ok_btn"/> + <button label="Cancelar" name="cancel_btn"/> +</floater> diff --git a/indra/newview/skins/default/xui/pt/floater_gesture.xml b/indra/newview/skins/default/xui/pt/floater_gesture.xml index 2e5b92aaf7..308d3e7d88 100644 --- a/indra/newview/skins/default/xui/pt/floater_gesture.xml +++ b/indra/newview/skins/default/xui/pt/floater_gesture.xml @@ -20,7 +20,7 @@ <button name="activate_btn" tool_tip="Ativar/Desativar gesto selecionado"/> <button name="del_btn" tool_tip="Excluir este gesto"/> </panel> - <button label="Editar" name="edit_btn"/> - <button label="Executar" name="play_btn"/> + <button label="Editar" name="edit_btn" tool_tip="Abrir janela para edição do gesto selecionado."/> + <button label="Executar" name="play_btn" tool_tip="Executar o gesto selecionado no mundo."/> <button label="Parar" name="stop_btn"/> </floater> diff --git a/indra/newview/skins/default/xui/pt/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/pt/floater_preferences_graphics_advanced.xml index 89b3781151..c5039267ca 100644 --- a/indra/newview/skins/default/xui/pt/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/pt/floater_preferences_graphics_advanced.xml @@ -43,6 +43,7 @@ <check_box label="Filtro anisotrópico (mais lento quando ativado)" name="ani"/> <check_box initial_value="true" label="Ativar Vertex Buffer Objects de OpenGL" name="vbo" tool_tip="Ativar isso em hardware moderno melhora o desempenho. Entretanto, hardwares mais antigos normalmente implantam mal os VBOs. A ativação dessa configuração pode travar sua máquina."/> <check_box initial_value="true" label="Habilitar compressão da textura (requer reinício)" name="texture compression" tool_tip="Comprime as texturas na memória de vídeo, permitindo o carregamento de texturas de maior resolução em detrimento da qualidade da cor."/> + <check_box initial_value="true" label="Habilitar suporte para exibição HiDPI (é necessário reiniciar)" name="use HiDPI" tool_tip="Habilitar o OpenGL para Desenho de alta-resolução."/> <text name="antialiasing label"> Antialiasing: </text> diff --git a/indra/newview/skins/default/xui/pt/floater_preview_notecard.xml b/indra/newview/skins/default/xui/pt/floater_preview_notecard.xml index d094c1b63a..9885ee2a23 100644 --- a/indra/newview/skins/default/xui/pt/floater_preview_notecard.xml +++ b/indra/newview/skins/default/xui/pt/floater_preview_notecard.xml @@ -15,6 +15,7 @@ <text_editor name="Notecard Editor"> Carregando... </text_editor> + <button label="Editar..." label_selected="Editar" name="Edit"/> <button label="Salvar" label_selected="Salvar" name="Save"/> <button label="Excluir" label_selected="Excluir" name="Delete"/> </floater> diff --git a/indra/newview/skins/default/xui/pt/floater_report_abuse.xml b/indra/newview/skins/default/xui/pt/floater_report_abuse.xml index f30201fc33..1429fe183c 100644 --- a/indra/newview/skins/default/xui/pt/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/pt/floater_report_abuse.xml @@ -76,7 +76,7 @@ <combo_box.item label="Terreno > Invasão > Objetos ou texturas" name="Land__Encroachment__Objects_textures"/> <combo_box.item label="Terra > Invasão > Partículas" name="Land__Encroachment__Particles"/> <combo_box.item label="Terra > Violação > Árvores/plantas" name="Land__Encroachment__Trees_plants"/> - <combo_box.item label="Violação da política sobre jogos" name="Wagering_gambling"/> + <combo_box.item label="Ignorar o jogo de violação da política" name="Wagering_gambling"/> <combo_box.item label="Outro" name="Other"/> </combo_box> <text name="abuser_name_title"> diff --git a/indra/newview/skins/default/xui/pt/notifications.xml b/indra/newview/skins/default/xui/pt/notifications.xml index 478af96e95..530a272dbb 100644 --- a/indra/newview/skins/default/xui/pt/notifications.xml +++ b/indra/newview/skins/default/xui/pt/notifications.xml @@ -1904,7 +1904,7 @@ Isto mudará milhares de regiões e fará o spaceserver soluçar. <usetemplate canceltext="Cancelar" name="yesnocancelbuttons" notext="Todas as Propriedades" yestext="Esta Propriedade"/> </notification> <notification label="Selecione a propriedade" name="EstateBannedAgentRemove"> - Remover este Residente da lista de banimento para acessar este estado somente ou para [ALL_ESTATES]? + Remover este Residente da lista de banimento para acessar esta propriedade somente ou para [ALL_ESTATES]? <usetemplate canceltext="Cancelar" name="yesnocancelbuttons" notext="Todas as Propriedades" yestext="Esta Propriedade"/> </notification> <notification label="Selecione a propriedade" name="EstateManagerAdd"> diff --git a/indra/newview/skins/default/xui/pt/panel_group_general.xml b/indra/newview/skins/default/xui/pt/panel_group_general.xml index b634ec3f64..64a7d13fdb 100644 --- a/indra/newview/skins/default/xui/pt/panel_group_general.xml +++ b/indra/newview/skins/default/xui/pt/panel_group_general.xml @@ -46,7 +46,7 @@ Para obter mais ajuda, passe o mouse sobre as opções. <check_box label="Qualquer um pode entrar" name="open_enrollement" tool_tip="Controla a entrada de novos membros, com ou sem convite."/> <check_box label="Taxa de inscrição" name="check_enrollment_fee" tool_tip="Controla a cobrança de uma taxa de associação ao grupo."/> <spinner label="L$" left_delta="120" name="spin_enrollment_fee" tool_tip="Se a opção 'Taxa de associação' estiver marcada, novos membros precisam pagar o valor definido para entrar no grupo." width="60"/> - <combo_box name="group_mature_check" tool_tip="Define se os dados do seu grupo são conteúdo moderado." width="170"> + <combo_box name="group_mature_check" tool_tip="Os níveis de maturidade determinam o tipo de conteúdo e comportamento permitidos em um grupo" width="170"> <combo_item name="select_mature"> - Selecione o nível de maturidade - </combo_item> diff --git a/indra/newview/skins/default/xui/pt/panel_region_access.xml b/indra/newview/skins/default/xui/pt/panel_region_access.xml index cc2136a459..c6273ea70d 100644 --- a/indra/newview/skins/default/xui/pt/panel_region_access.xml +++ b/indra/newview/skins/default/xui/pt/panel_region_access.xml @@ -14,6 +14,7 @@ <panel label="PERMITIDO" name="allowed_panel"> <panel label="top_panel" name="allowed_search_panel"> <filter_editor label="Buscar agentes permitidos" name="allowed_search_input"/> + <button label="Copiar" name="copy_allowed_list_btn"/> </panel> <text name="allow_resident_label"> Sempre permitido: @@ -27,6 +28,7 @@ <panel label="GRUPOS PERMITIDOS" name="allowed_groups_panel"> <panel label="top_panel" name="allowed_group_search_panel"> <filter_editor label="Buscar grupos permitidos" name="allowed_group_search_input"/> + <button label="Copiar" name="copy_allowed_group_list_btn"/> </panel> <text name="allow_group_label"> Grupos sempre permitidos: @@ -40,6 +42,7 @@ <panel label="BANIDO" name="banned_panel"> <panel label="top_panel" name="banned_search_panel"> <filter_editor label="Buscar agentes banidos" name="banned_search_input"/> + <button label="Copiar" name="copy_banned_list_btn"/> </panel> <text name="ban_resident_label"> Sempre banido: diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml index c4fbf1f4c9..cccc70a92a 100644 --- a/indra/newview/skins/default/xui/pt/strings.xml +++ b/indra/newview/skins/default/xui/pt/strings.xml @@ -67,6 +67,9 @@ Modelo avançado de luzes: [GPU_SHADERS] Memória de textura: [TEXTURE_MEMORY]MB VFS (cache) tempo de criação: [VFS_TIME] </string> + <string name="AboutOSXHiDPI"> + HiDPI modo de exibição: [HIDPI] + </string> <string name="AboutLibs"> Versão do J2C Decoder: [J2C_VERSION] Versão do driver de áudio: [AUDIO_DRIVER_VERSION] @@ -1428,6 +1431,15 @@ http://secondlife.com/support para ajuda ao resolver este problema. <string name="MarketplaceURL_LearnMore"> https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more </string> + <string name="InventoryPlayAnimationTooltip"> + Abrir a janela com as opções do Jogo. + </string> + <string name="InventoryPlayGestureTooltip"> + Executar o gesto selecionado no mundo. + </string> + <string name="InventoryPlaySoundTooltip"> + Abrir a janela com as opções do Jogo. + </string> <string name="InventoryOutboxNotMerchantTitle"> Qualquer um pode vender itens no Mercado. </string> @@ -5273,9 +5285,6 @@ Tente colocar o caminho do editor entre aspas. <string name="Command_Destinations_Label"> Destinos </string> - <string name="Command_Facebook_Label"> - Facebook - </string> <string name="Command_Flickr_Label"> Flickr </string> @@ -5369,9 +5378,6 @@ Tente colocar o caminho do editor entre aspas. <string name="Command_Destinations_Tooltip"> Destinos de interesse </string> - <string name="Command_Facebook_Tooltip"> - Publicar no Facebook - </string> <string name="Command_Flickr_Tooltip"> Carregar no Flickr </string> diff --git a/indra/newview/skins/default/xui/ru/floater_about_land.xml b/indra/newview/skins/default/xui/ru/floater_about_land.xml index 50402633f2..1ae6df76d9 100644 --- a/indra/newview/skins/default/xui/ru/floater_about_land.xml +++ b/indra/newview/skins/default/xui/ru/floater_about_land.xml @@ -9,6 +9,12 @@ <floater.string name="maturity_icon_adult"> "Parcel_R_Dark" </floater.string> + <floater.string name="Hours"> + \[HOURS] ч + </floater.string> + <floater.string name="Hour"> + ч + </floater.string> <floater.string name="Minutes"> [MINUTES] мин </floater.string> @@ -21,6 +27,9 @@ <floater.string name="Remaining"> осталось </floater.string> + <floater.string name="Always"> + Всегда + </floater.string> <tab_container name="landtab"> <panel label="ОСНОВНЫЕ" name="land_general_panel"> <panel.string name="new users only"> @@ -316,18 +325,18 @@ <text name="allow_label2"> Строительство: </text> - <check_box label="Все" name="edit objects check"/> - <check_box label="Группа" name="edit group objects check"/> + <check_box label="Все" name="edit objects check" tool_tip="Если установлен флажок, жители могут создавать и выкладывать объекты на вашей земле."/> + <check_box label="Группа" name="edit group objects check" tool_tip="Если установлен флажок, то жители могут создавать и выкладывать объекты на вашей земле."/> <text name="allow_label3"> Проникновение объектов: </text> - <check_box label="Все" name="all object entry check"/> - <check_box label="Группа" name="group object entry check"/> + <check_box label="Все" name="all object entry check" tool_tip="Если установлен флажок, то жители могут перемещать существующие объекты из других участков на этот участок."/> + <check_box label="Группа" name="group object entry check" tool_tip="Если установлен флажок, то члены группы участка могут перемещать существующие объекты из других участков на этот участок."/> <text name="allow_label4"> Запускать скрипты: </text> - <check_box label="Все" name="check other scripts"/> - <check_box label="Группа" name="check group scripts"/> + <check_box label="Все" name="check other scripts" tool_tip="Если установлен флажок, то жители могут выполнять скрипты на вашем участке, включая приложения."/> + <check_box label="Группа" name="check group scripts" tool_tip="Если установлен флажок, то члены группы могут выполнять скрипты на вашем участке, включая приложения."/> <check_box label="Безопасно (нет повреждений)" name="check safe" tool_tip="Если отмечено, то земля считается безопасной, отключены боевые повреждения. Если не отмечено, то боевые повреждения включены."/> <check_box label="Не толкать" name="PushRestrictCheck" tool_tip="Запрещает скриптам функцию толкания. Этот параметр может оказаться полезным для предотвращения нежелательного поведения на вашей земле."/> <check_box label="Показать место в поиске (L$30/неделя)" name="ShowDirectoryCheck" tool_tip="Позволить людям видеть участок в результатах поиска"/> @@ -351,7 +360,7 @@ Снимок: </text> <texture_picker name="snapshot_ctrl" tool_tip="Щелкните для выбора изображения"/> - <text name="allow_label5"> + <text name="allow_see_label"> Аватары с других участков могут видеть аватары на этом участке и общаться с ними </text> <check_box label="Видны аватары" name="SeeAvatarsCheck" tool_tip="Аватары с других участков смогут видеть аватары на этом участке и общаться с ними в чате, а вы также сможете видеть их и общаться с ними."/> @@ -454,9 +463,12 @@ </panel> <panel name="Banned_layout_panel"> <text label="Бан" name="BanCheck"> - Всегда заблокировано ([COUNT], макс. [MAX]) + Заблокировано ([COUNT], макс. [MAX]) </text> - <name_list name="BannedList" tool_tip="([LISTED] в списке, [MAX] максимум)"/> + <name_list name="BannedList" tool_tip="([LISTED] в списке, [MAX] максимум)"> + <columns label="Имя" name="name"/> + <columns label="Продолжительность" name="duration"/> + </name_list> <button label="Добавить" name="add_banned"/> <button label="Удалить" label_selected="Удалить" name="remove_banned"/> </panel> diff --git a/indra/newview/skins/default/xui/ru/floater_ban_duration.xml b/indra/newview/skins/default/xui/ru/floater_ban_duration.xml new file mode 100644 index 0000000000..c4238cfa77 --- /dev/null +++ b/indra/newview/skins/default/xui/ru/floater_ban_duration.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="ban_duration" title="Длительность запрета"> + <text name="duration_textbox"> + Длительность запрета: + </text> + <radio_group name="ban_duration_radio"> + <radio_item label="Всегда" name="always_radio"> + Всегда + </radio_item> + <radio_item label="Временно" name="temporary_radio"> + Временно + </radio_item> + </radio_group> + <text name="hours_textbox"> + часы + </text> + <button label="ОК" name="ok_btn"/> + <button label="Отмена" name="cancel_btn"/> +</floater> diff --git a/indra/newview/skins/default/xui/ru/floater_gesture.xml b/indra/newview/skins/default/xui/ru/floater_gesture.xml index 759d81b2c6..c9b85acff8 100644 --- a/indra/newview/skins/default/xui/ru/floater_gesture.xml +++ b/indra/newview/skins/default/xui/ru/floater_gesture.xml @@ -20,7 +20,7 @@ <button name="activate_btn" tool_tip="Активировать/деактивировать выбранный жест"/> <button name="del_btn" tool_tip="Удалить этот жест"/> </panel> - <button label="Изменить" name="edit_btn"/> - <button label="Проиграть" name="play_btn"/> + <button label="Изменить" name="edit_btn" tool_tip="Откройте окно для редактирования выбранного жеста."/> + <button label="Проиграть" name="play_btn" tool_tip="Выполните выбранный жест в игровом мире."/> <button label="Стоп" name="stop_btn"/> </floater> diff --git a/indra/newview/skins/default/xui/ru/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/ru/floater_preferences_graphics_advanced.xml index efad8678b6..fc6b6a173e 100644 --- a/indra/newview/skins/default/xui/ru/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/ru/floater_preferences_graphics_advanced.xml @@ -43,6 +43,7 @@ <check_box label="Анизотропная фильтрация (медленнее, если включено)" name="ani"/> <check_box initial_value="true" label="Включить объекты вершинных буферов OpenGL" name="vbo" tool_tip="Включение этого параметра на современном оборудовании даст увеличение производительности. Однако на старом оборудовании это может привести к сбою приложения."/> <check_box initial_value="true" label="Разрешить сжатие текстур (требует перезагрузки)" name="texture compression" tool_tip="Сжатие текстур в видеопамяти, что позволяет загружать текстуры большего размера за счет некоторого падения качества цвета."/> + <check_box initial_value="true" label="Активировать поддержку отображения HiDPI (требуется перезапуск)" name="use HiDPI" tool_tip="Активировать OpenGL для рисования с высоким разрешением."/> <text name="antialiasing label"> Сглаживание: </text> diff --git a/indra/newview/skins/default/xui/ru/floater_preview_notecard.xml b/indra/newview/skins/default/xui/ru/floater_preview_notecard.xml index 2f39d4a4a4..ffff72f17e 100644 --- a/indra/newview/skins/default/xui/ru/floater_preview_notecard.xml +++ b/indra/newview/skins/default/xui/ru/floater_preview_notecard.xml @@ -15,6 +15,7 @@ <text_editor name="Notecard Editor"> Загрузка... </text_editor> + <button label="Pедактировать..." label_selected="Редактировать" name="Edit"/> <button label="Сохранить" label_selected="Сохранить" name="Save"/> <button label="Удалить" label_selected="Удалить" name="Delete"/> </floater> diff --git a/indra/newview/skins/default/xui/ru/floater_report_abuse.xml b/indra/newview/skins/default/xui/ru/floater_report_abuse.xml index 67d847aa6b..3ac8cb74b4 100644 --- a/indra/newview/skins/default/xui/ru/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/ru/floater_report_abuse.xml @@ -67,7 +67,7 @@ <combo_box.item label="Земля > Посягательство > Объекты или текстуры" name="Land__Encroachment__Objects_textures"/> <combo_box.item label="Земля > Посягательство > Частицы" name="Land__Encroachment__Particles"/> <combo_box.item label="Земля > Посягательство > Деревья/растения" name="Land__Encroachment__Trees_plants"/> - <combo_box.item label="Нарушение политики игр" name="Wagering_gambling"/> + <combo_box.item label="Нарушение правил игр на ловкость" name="Wagering_gambling"/> <combo_box.item label="Другое" name="Other"/> </combo_box> <text name="abuser_name_title"> diff --git a/indra/newview/skins/default/xui/ru/panel_group_general.xml b/indra/newview/skins/default/xui/ru/panel_group_general.xml index ba38dbf89e..ee3a74103f 100644 --- a/indra/newview/skins/default/xui/ru/panel_group_general.xml +++ b/indra/newview/skins/default/xui/ru/panel_group_general.xml @@ -44,7 +44,7 @@ <check_box label="Открытая регистрация" name="open_enrollement" tool_tip="Устанавливается, если в этой группе можно зарегистрироваться без приглашения."/> <check_box label="Платная регистрация" name="check_enrollment_fee" tool_tip="Устанавливается, если в этой группе требуется оплата за вступление."/> <spinner label="L$" name="spin_enrollment_fee" tool_tip="Новые участники должны будут оплатить взнос, если регистрация платная."/> - <combo_box name="group_mature_check" tool_tip="Устанавливает, содержит ли группа информацию категории умеренной дозволенности"> + <combo_box name="group_mature_check" tool_tip="Рейтинги зрелости определяют тип контента и поведение, разрешенное в группе"> <combo_item name="select_mature"> - Выберите рейтинг зрелости - </combo_item> diff --git a/indra/newview/skins/default/xui/ru/panel_region_access.xml b/indra/newview/skins/default/xui/ru/panel_region_access.xml index 48adfbcd95..e2349f4c83 100644 --- a/indra/newview/skins/default/xui/ru/panel_region_access.xml +++ b/indra/newview/skins/default/xui/ru/panel_region_access.xml @@ -14,6 +14,7 @@ <panel label="РАЗРЕШЕННЫЕ" name="allowed_panel"> <panel label="top_panel" name="allowed_search_panel"> <filter_editor label="Поиск допущенных агентов" name="allowed_search_input"/> + <button label="Копировать" name="copy_allowed_list_btn"/> </panel> <text name="allow_resident_label"> Разрешено всегда: @@ -27,6 +28,7 @@ <panel label="ДОПУЩЕННЫЕ ГРУППЫ" name="allowed_groups_panel"> <panel label="top_panel" name="allowed_group_search_panel"> <filter_editor label="Поиск допущенных групп" name="allowed_group_search_input"/> + <button label="Копировать" name="copy_allowed_group_list_btn"/> </panel> <text name="allow_group_label"> Допуск групп всегда разрешен: @@ -40,6 +42,7 @@ <panel label="ЗАБЛОКИРОВАНЫ" name="banned_panel"> <panel label="top_panel" name="banned_search_panel"> <filter_editor label="Поиск заблокированных агентов" name="banned_search_input"/> + <button label="Копировать" name="copy_banned_list_btn"/> </panel> <text name="ban_resident_label"> Всегда заблокированы: diff --git a/indra/newview/skins/default/xui/ru/panel_region_estate.xml b/indra/newview/skins/default/xui/ru/panel_region_estate.xml index 5789058b3b..feeac0464a 100644 --- a/indra/newview/skins/default/xui/ru/panel_region_estate.xml +++ b/indra/newview/skins/default/xui/ru/panel_region_estate.xml @@ -16,7 +16,7 @@ (неизвестно) </text> <radio_group name="externally_visible_radio"> - <radio_item label="Разрешено только жителям и группам, перечисленным на вкладке доступа" name="estate_restricted_access"/> + <radio_item label="Разрешено только жителям и группам, перечисленных на вкладке доступа" name="estate_restricted_access"/> <radio_item label="Доступ открыт для всех" name="estate_public_access"/> </radio_group> <check_box label="Должен быть 18 и старше" name="limit_age_verified" tool_tip="Доступ к этому землевладению имеют только жители 18 лет и старше. Более подробная информация находится здесь: [SUPPORT_SITE]."/> diff --git a/indra/newview/skins/default/xui/ru/strings.xml b/indra/newview/skins/default/xui/ru/strings.xml index 9192ebf601..9c01de2f1b 100644 --- a/indra/newview/skins/default/xui/ru/strings.xml +++ b/indra/newview/skins/default/xui/ru/strings.xml @@ -76,6 +76,9 @@ SLURL: <nolink>[SLURL]</nolink> Память текстур: [TEXTURE_MEMORY] МБ Время создания VFS (кэш): [VFS_TIME] </string> + <string name="AboutOSXHiDPI"> + Режим отображения HiDPI: [HIDPI] + </string> <string name="AboutLibs"> Версия декодера J2C: [J2C_VERSION] Версия аудиодрайвера: [AUDIO_DRIVER_VERSION] @@ -1475,6 +1478,15 @@ support@secondlife.com. <string name="MarketplaceURL_LearnMore"> https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more </string> + <string name="InventoryPlayAnimationTooltip"> + Откройте окно с настройками игры. + </string> + <string name="InventoryPlayGestureTooltip"> + Выполните выбранный жест в игровом мире. + </string> + <string name="InventoryPlaySoundTooltip"> + Откройте окно с настройками игры. + </string> <string name="InventoryOutboxNotMerchantTitle"> Продавать вещи в торговом центре может кто угодно. </string> @@ -5405,9 +5417,6 @@ support@secondlife.com. <string name="Command_Destinations_Label"> Пункты </string> - <string name="Command_Facebook_Label"> - Facebook - </string> <string name="Command_Flickr_Label"> Flickr </string> @@ -5501,9 +5510,6 @@ support@secondlife.com. <string name="Command_Destinations_Tooltip"> Интересные места </string> - <string name="Command_Facebook_Tooltip"> - Опубликовать в Facebook - </string> <string name="Command_Flickr_Tooltip"> Загрузить на Flickr </string> diff --git a/indra/newview/skins/default/xui/tr/floater_about_land.xml b/indra/newview/skins/default/xui/tr/floater_about_land.xml index 1f4decb056..48b16e2fde 100644 --- a/indra/newview/skins/default/xui/tr/floater_about_land.xml +++ b/indra/newview/skins/default/xui/tr/floater_about_land.xml @@ -9,6 +9,12 @@ <floater.string name="maturity_icon_adult"> "Parcel_R_Dark" </floater.string> + <floater.string name="Hours"> + [HOURS] sa + </floater.string> + <floater.string name="Hour"> + sa + </floater.string> <floater.string name="Minutes"> [MINUTES] dak. </floater.string> @@ -21,6 +27,9 @@ <floater.string name="Remaining"> kaldı </floater.string> + <floater.string name="Always"> + Her zaman + </floater.string> <tab_container name="landtab"> <panel label="GENEL" name="land_general_panel"> <panel.string name="new users only"> @@ -316,18 +325,18 @@ Sadece büyük parseller aramada görünür. <text name="allow_label2"> İnşa Et: </text> - <check_box label="Herkes" name="edit objects check"/> - <check_box label="Grup" name="edit group objects check"/> + <check_box label="Herkes" name="edit objects check" tool_tip="İşaretlendiğinde, Sakinler arazinizde nesneler oluşturabilir ve nesneleri canlandırabilir."/> + <check_box label="Grup" name="edit group objects check" tool_tip="İşaretlendiğinde, parsel grubu üyeleri arazinizde nesneler oluşturabilir ve nesneleri canlandırabilir."/> <text name="allow_label3"> Nesne Girişi: </text> - <check_box label="Herkes" name="all object entry check"/> - <check_box label="Grup" name="group object entry check"/> + <check_box label="Herkes" name="all object entry check" tool_tip="İşaretlendiğinde, Sakinler mevcut nesneleri diğer parsellerden bu parsele taşıyabilir."/> + <check_box label="Grup" name="group object entry check" tool_tip="İşaretlendiğinde, parsel grubu üyeleri mevcut nesneleri diğer parsellerden bu parsele taşıyabilir."/> <text name="allow_label4"> Komut Dosyalarını Çalıştır: </text> - <check_box label="Herkes" name="check other scripts"/> - <check_box label="Grup" name="check group scripts"/> + <check_box label="Herkes" name="check other scripts" tool_tip="İşaretlendiğinde, Sakinler parselinizde aksesuarlar dahil olmak üzere komut dosyalarını çalıştırabilir."/> + <check_box label="Grup" name="check group scripts" tool_tip="İşaretlendiğinde, parsel grubu üyeleri parselinizde aksesuarlar dahil olmak üzere komut dosyalarını çalıştırabilir."/> <check_box label="Güvenli (hasar yok)" name="check safe" tool_tip="İşaretliyse, araziyi Güvenli moda getirerek hasar çarpışmasını etkinsizleştirir İşaretli değilse hasar çarpışması etkinleşir."/> <check_box label="İtme Yok" name="PushRestrictCheck" tool_tip="Komut dosyalarının itmesini önler Bu seçeneğin işaretlenmesi arazinizdeki bozucu davranışları önlemeye yardımcı olabilir."/> <check_box label="Konumu Arama sonuçlarında göster (L$30/hafta)" name="ShowDirectoryCheck" tool_tip="Arama sonuçlarında bu parsel görünsün"/> @@ -351,8 +360,8 @@ Sadece büyük parseller aramada görünür. Anlık Görüntü: </text> <texture_picker name="snapshot_ctrl" tool_tip="Bir resim seçmek için tıklayın"/> - <text name="allow_label5"> - Başka parsellerdeki avatarlar bu parseldeki avatarları görebilir ve onlarla sohbet edebilir + <text name="allow_see_label"> + Diğer parsellerdeki avatarlar bu parseldeki avatarları görebilir ve onlarla sohbet edebilir </text> <check_box label="Avatarları Gör" name="SeeAvatarsCheck" tool_tip="Diğer parsellerdeki avatarların bu parseldeki avatarları görmesine ve onlarla sohbet etmesine, sizin de onları görüp, onlarla sohbet etmenize imkan tanır."/> <text name="landing_point"> @@ -454,9 +463,12 @@ Sadece büyük parseller aramada görünür. </panel> <panel name="Banned_layout_panel"> <text label="Yasakla" name="BanCheck"> - Her zaman engellenen ([COUNT], maks. [MAX]) + Engellenen ([COUNT], maks. [MAX]) </text> - <name_list name="BannedList" tool_tip="([LISTED] listeli, [MAX] maksimum)"/> + <name_list name="BannedList" tool_tip="([LISTED] listeli, [MAX] maksimum)"> + <columns label="Ad" name="name"/> + <columns label="Süre" name="duration"/> + </name_list> <button label="Ekle" name="add_banned"/> <button label="Kaldır" label_selected="Kaldır" name="remove_banned"/> </panel> diff --git a/indra/newview/skins/default/xui/tr/floater_ban_duration.xml b/indra/newview/skins/default/xui/tr/floater_ban_duration.xml new file mode 100644 index 0000000000..22788a161a --- /dev/null +++ b/indra/newview/skins/default/xui/tr/floater_ban_duration.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="ban_duration" title="Engelleme süresi"> + <text name="duration_textbox"> + Engelleme süresi: + </text> + <radio_group name="ban_duration_radio"> + <radio_item label="Her zaman" name="always_radio"> + Her zaman + </radio_item> + <radio_item label="Geçici" name="temporary_radio"> + Geçici + </radio_item> + </radio_group> + <text name="hours_textbox"> + saat + </text> + <button label="Tamam" name="ok_btn"/> + <button label="İptal Et" name="cancel_btn"/> +</floater> diff --git a/indra/newview/skins/default/xui/tr/floater_gesture.xml b/indra/newview/skins/default/xui/tr/floater_gesture.xml index 5f5d28ad6c..c466681fd9 100644 --- a/indra/newview/skins/default/xui/tr/floater_gesture.xml +++ b/indra/newview/skins/default/xui/tr/floater_gesture.xml @@ -20,7 +20,7 @@ <button name="activate_btn" tool_tip="Seçilen mimiği Etkinleştir/Devre Dışı Bırak"/> <button name="del_btn" tool_tip="Bu mimiği sil"/> </panel> - <button label="Düzenle" name="edit_btn"/> - <button label="Oyna" name="play_btn"/> + <button label="Düzenle" name="edit_btn" tool_tip="Seçilen mimiği düzenlemek için pencere açın."/> + <button label="Oyna" name="play_btn" tool_tip="Seçilen mimiği SL dünyasında uygulayın."/> <button label="Durdur" name="stop_btn"/> </floater> diff --git a/indra/newview/skins/default/xui/tr/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/tr/floater_preferences_graphics_advanced.xml index 734ceec89f..01ada1354c 100644 --- a/indra/newview/skins/default/xui/tr/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/tr/floater_preferences_graphics_advanced.xml @@ -43,6 +43,7 @@ <check_box label="Anisotropik Filtreleme (etkinken daha yavaş)" name="ani"/> <check_box initial_value="true" label="OpenGL Vertex Tampon Nesnelerini Etkinleştir" name="vbo" tool_tip="Modern donanımlarda bunun etkinleştirilmesi performans artışı sağlar. Ancak, eski donanımlardaki VBO uygulamaları yetersizdir ve etkinleştirildiğinde bilgisayarınız çökebilir."/> <check_box initial_value="true" label="Doku Sıkıştırmasını Etkinleştir (yeniden başlatma gerektirir)" name="texture compression" tool_tip="Video bellekteki dokuları sıkıştırır, renk kalitesinde bazı kayıplar olmasına karşın daha yüksek çözünürlükte dokuların yüklenmesine imkan tanır."/> + <check_box initial_value="true" label="HiDPI görüntü desteğini etkinleştir (yeniden başlatma gerekir)" name="use HiDPI" tool_tip="Yüksek Çözünürlüklü Çizim için OpenGL'yi etkinleştirin."/> <text name="antialiasing label"> Antialiasing: </text> diff --git a/indra/newview/skins/default/xui/tr/floater_preview_notecard.xml b/indra/newview/skins/default/xui/tr/floater_preview_notecard.xml index 23391249d1..996054a8c6 100644 --- a/indra/newview/skins/default/xui/tr/floater_preview_notecard.xml +++ b/indra/newview/skins/default/xui/tr/floater_preview_notecard.xml @@ -15,6 +15,7 @@ <text_editor name="Notecard Editor"> Yükleniyor... </text_editor> + <button label="Düzenle..." label_selected="Düzenle" name="Edit"/> <button label="Kaydet" label_selected="Kaydet" name="Save"/> <button label="Sil" label_selected="Sil" name="Delete"/> </floater> diff --git a/indra/newview/skins/default/xui/tr/floater_report_abuse.xml b/indra/newview/skins/default/xui/tr/floater_report_abuse.xml index 28bacca763..de386d3bde 100644 --- a/indra/newview/skins/default/xui/tr/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/tr/floater_report_abuse.xml @@ -67,7 +67,7 @@ <combo_box.item label="Arazi > Tecavüz > Nesneler veya dokular" name="Land__Encroachment__Objects_textures"/> <combo_box.item label="Arazi > Tecavvüz > Parçacıklar" name="Land__Encroachment__Particles"/> <combo_box.item label="Arazi > Tecavvüz > Ağaçlar/bitkiler" name="Land__Encroachment__Trees_plants"/> - <combo_box.item label="Oyun Politikası İhlali" name="Wagering_gambling"/> + <combo_box.item label="Yetenek Oyunu Politikası İhlali" name="Wagering_gambling"/> <combo_box.item label="Diğer" name="Other"/> </combo_box> <text name="abuser_name_title"> diff --git a/indra/newview/skins/default/xui/tr/panel_group_general.xml b/indra/newview/skins/default/xui/tr/panel_group_general.xml index 0462026249..c666778c69 100644 --- a/indra/newview/skins/default/xui/tr/panel_group_general.xml +++ b/indra/newview/skins/default/xui/tr/panel_group_general.xml @@ -45,7 +45,7 @@ Daha fazla yardım edinmek için farenizi seçeneklerin üzerine getirin. <check_box label="Herkes katılabilir" name="open_enrollement" tool_tip="Bu grubun davet edilmeden yeni üyelerin katılmasına imkan tanıyıp tanımayacağını belirler."/> <check_box label="Katılma ücreti" name="check_enrollment_fee" tool_tip="Bu gruba katılmak için bir kayıt ücretinin gerekip gerekmeyeceğini belirler"/> <spinner label="L$" name="spin_enrollment_fee" tool_tip="Kayıt Ücreti işaretlendiğinde yeni üyeler gruba katılmak için bu ücreti ödemelidir."/> - <combo_box name="group_mature_check" tool_tip="Grubunuzun Orta seviyede içeriğe sahip olup olmadığını belirler"> + <combo_box name="group_mature_check" tool_tip="Erişkinlik dereceleri bir grupta izin verilen içerik ve davranış türlerini belirler"> <combo_item name="select_mature"> - Erişkinlik seviyesini seçin - </combo_item> diff --git a/indra/newview/skins/default/xui/tr/panel_region_access.xml b/indra/newview/skins/default/xui/tr/panel_region_access.xml index 57e721bc04..81653b1e54 100644 --- a/indra/newview/skins/default/xui/tr/panel_region_access.xml +++ b/indra/newview/skins/default/xui/tr/panel_region_access.xml @@ -14,6 +14,7 @@ <panel label="İZİN VERİLEN" name="allowed_panel"> <panel label="top_panel" name="allowed_search_panel"> <filter_editor label="İzin verilen aracıları ara" name="allowed_search_input"/> + <button label="Kopyala" name="copy_allowed_list_btn"/> </panel> <text name="allow_resident_label"> Her zaman izin verilen: @@ -27,6 +28,7 @@ <panel label="İZİN VERİLEN GRUPLAR" name="allowed_groups_panel"> <panel label="top_panel" name="allowed_group_search_panel"> <filter_editor label="İzin verilen grupları ara" name="allowed_group_search_input"/> + <button label="Kopyala" name="copy_allowed_group_list_btn"/> </panel> <text name="allow_group_label"> Her zaman izin verilen gruplar: @@ -40,6 +42,7 @@ <panel label="ENGELLENEN" name="banned_panel"> <panel label="top_panel" name="banned_search_panel"> <filter_editor label="Engellenen aracıları ara" name="banned_search_input"/> + <button label="Kopyala" name="copy_banned_list_btn"/> </panel> <text name="ban_resident_label"> Her zaman engellenen: diff --git a/indra/newview/skins/default/xui/tr/strings.xml b/indra/newview/skins/default/xui/tr/strings.xml index dddf2365ab..27f3c4d4d9 100644 --- a/indra/newview/skins/default/xui/tr/strings.xml +++ b/indra/newview/skins/default/xui/tr/strings.xml @@ -76,6 +76,9 @@ Gelişmiş Aydınlatma Modeli: [GPU_SHADERS] Doku belleği: [TEXTURE_MEMORY]MB VFS (önbellek) oluşturma saati: [VFS_TIME] </string> + <string name="AboutOSXHiDPI"> + HiDPI görüntü modu: [HIDPI] + </string> <string name="AboutLibs"> J2C Kod Çözücü Sürümü: [J2C_VERSION] Ses Sürücüsü Sürümü: [AUDIO_DRIVER_VERSION] @@ -1475,6 +1478,15 @@ http://secondlife.com/support adresini ziyaret edin. <string name="MarketplaceURL_LearnMore"> https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more </string> + <string name="InventoryPlayAnimationTooltip"> + Pencereyi Oyun seçenekleri ile birlikte açın. + </string> + <string name="InventoryPlayGestureTooltip"> + Seçilen mimiği SL dünyasında uygulayın. + </string> + <string name="InventoryPlaySoundTooltip"> + Pencereyi Oyun seçenekleri ile birlikte açın. + </string> <string name="InventoryOutboxNotMerchantTitle"> Pazaryerinde herkes öğe satabilir. </string> @@ -5406,9 +5418,6 @@ Düzenleyici yolunu çift tırnakla çevrelemeyi deneyin. <string name="Command_Destinations_Label"> Hedef Konum </string> - <string name="Command_Facebook_Label"> - Facebook - </string> <string name="Command_Flickr_Label"> Flickr </string> @@ -5502,9 +5511,6 @@ Düzenleyici yolunu çift tırnakla çevrelemeyi deneyin. <string name="Command_Destinations_Tooltip"> İlgilendiğiniz hedef konumlar </string> - <string name="Command_Facebook_Tooltip"> - Facebook'ta Yayınla - </string> <string name="Command_Flickr_Tooltip"> Flickr'a yükle </string> diff --git a/indra/newview/skins/default/xui/zh/floater_about_land.xml b/indra/newview/skins/default/xui/zh/floater_about_land.xml index badd00bc6d..1164722abf 100644 --- a/indra/newview/skins/default/xui/zh/floater_about_land.xml +++ b/indra/newview/skins/default/xui/zh/floater_about_land.xml @@ -9,6 +9,12 @@ <floater.string name="maturity_icon_adult"> "Parcel_R_Dark" </floater.string> + <floater.string name="Hours"> + [HOURS]小時 + </floater.string> + <floater.string name="Hour"> + 小時 + </floater.string> <floater.string name="Minutes"> [MINUTES] 分鐘 </floater.string> @@ -21,6 +27,9 @@ <floater.string name="Remaining"> 剩餘時間 </floater.string> + <floater.string name="Always"> + 永遠 + </floater.string> <tab_container name="landtab"> <panel label="一般" name="land_general_panel"> <panel.string name="new users only"> @@ -316,18 +325,18 @@ <text name="allow_label2"> 建造: </text> - <check_box label="任何人" name="edit objects check"/> - <check_box label="群組" name="edit group objects check"/> + <check_box label="任何人" name="edit objects check" tool_tip="如果勾選,居民可在你土地上創建並產生物件。"/> + <check_box label="群組" name="edit group objects check" tool_tip="如果勾選,地段群組成員可以在你土地上創建並產生物件。"/> <text name="allow_label3"> 物件進入: </text> - <check_box label="任何人" name="all object entry check"/> - <check_box label="群組" name="group object entry check"/> + <check_box label="任何人" name="all object entry check" tool_tip="如果勾選,居民可以從別的地段移動物件到本地段。"/> + <check_box label="群組" name="group object entry check" tool_tip="如果勾選,地段群組成員可以從別的地段移動物件到本地段。"/> <text name="allow_label4"> 執行腳本: </text> - <check_box label="任何人" name="check other scripts"/> - <check_box label="群組" name="check group scripts"/> + <check_box label="任何人" name="check other scripts" tool_tip="如果勾選,居民可以在你的地段執行腳本,包括附件。"/> + <check_box label="群組" name="check group scripts" tool_tip="如果勾選,地段群組成員可以在你的地段執行腳本,包括附件。"/> <check_box label="安全(無傷害)" name="check safe" tool_tip="若勾選,將把土地設為安全,禁絕傷害性的戰鬥。 若未勾選,則允許傷害性的戰鬥。"/> <check_box label="禁止推撞" name="PushRestrictCheck" tool_tip="禁止使用腳本推撞。 勾選這選項可有效防止你土地上出現滋事行為。"/> <check_box label="將地點刊登顯示在搜尋中(L$30 / 每週)" name="ShowDirectoryCheck" tool_tip="讓其他人可以在搜尋結果中看到這塊地段"/> @@ -351,7 +360,7 @@ 快照: </text> <texture_picker name="snapshot_ctrl" tool_tip="點按以挑選圖片"/> - <text name="allow_label5"> + <text name="allow_see_label"> 其他地段的化身可以看見本地段裡的化身,並與之交談 </text> <check_box label="察看化身" name="SeeAvatarsCheck" tool_tip="允許其他地段的化身看到本地段包括你在內的化身,並可互相交談。"/> @@ -454,9 +463,12 @@ </panel> <panel name="Banned_layout_panel"> <text label="禁止" name="BanCheck"> - 永久封鎖([COUNT],最多[MAX]) + 被封鎖([COUNT],最多[MAX]) </text> - <name_list name="BannedList" tool_tip="(已列入 [LISTED],最多可列 [MAX])"/> + <name_list name="BannedList" tool_tip="(已列入 [LISTED],最多可列 [MAX])"> + <columns label="名稱" name="name"/> + <columns label="歷時" name="duration"/> + </name_list> <button label="添加" name="add_banned"/> <button label="移除" label_selected="移除" name="remove_banned"/> </panel> diff --git a/indra/newview/skins/default/xui/zh/floater_ban_duration.xml b/indra/newview/skins/default/xui/zh/floater_ban_duration.xml new file mode 100644 index 0000000000..d8a3e8c8a0 --- /dev/null +++ b/indra/newview/skins/default/xui/zh/floater_ban_duration.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="ban_duration" title="封鎖時間長度"> + <text name="duration_textbox"> + 封鎖時間長度: + </text> + <radio_group name="ban_duration_radio"> + <radio_item label="永遠" name="always_radio"> + 永遠 + </radio_item> + <radio_item label="暫時性" name="temporary_radio"> + 暫時性 + </radio_item> + </radio_group> + <text name="hours_textbox"> + 小時 + </text> + <button label="確定" name="ok_btn"/> + <button label="取消" name="cancel_btn"/> +</floater> diff --git a/indra/newview/skins/default/xui/zh/floater_gesture.xml b/indra/newview/skins/default/xui/zh/floater_gesture.xml index e7b1ed1de3..592b410d1c 100644 --- a/indra/newview/skins/default/xui/zh/floater_gesture.xml +++ b/indra/newview/skins/default/xui/zh/floater_gesture.xml @@ -20,7 +20,7 @@ <button name="activate_btn" tool_tip="啟動/停止所選姿勢"/> <button name="del_btn" tool_tip="刪除這個姿勢"/> </panel> - <button label="編輯" name="edit_btn"/> - <button label="播放" name="play_btn"/> + <button label="編輯" name="edit_btn" tool_tip="開啓視窗以便編輯所選姿勢。"/> + <button label="播放" name="play_btn" tool_tip="在虛擬世界裡執行所選姿勢。"/> <button label="停止" name="stop_btn"/> </floater> diff --git a/indra/newview/skins/default/xui/zh/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/zh/floater_preferences_graphics_advanced.xml index 7d8160a0f0..7b127acd71 100644 --- a/indra/newview/skins/default/xui/zh/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/zh/floater_preferences_graphics_advanced.xml @@ -43,6 +43,7 @@ <check_box label="各向異性過濾(若啟用會變慢)" name="ani"/> <check_box initial_value="true" label="啟用 OpenGL 頂點緩衝物件(VBO)" name="vbo" tool_tip="在較新硬體上啟用,可提升效能。 但是,較舊硬體的 VBO 實作不佳,若啟用可能導致當機。"/> <check_box initial_value="true" label="啟用材質壓縮(須重新啟動)" name="texture compression" tool_tip="在影片記憶體中壓縮材質,讓高解析度材質可以載入,但色彩品質稍差。"/> + <check_box initial_value="true" label="啟用HiDPI顯示支援(須重新啟動)" name="use HiDPI" tool_tip="啓用OpenGL高解析度繪圖。"/> <text name="antialiasing label"> 消除鋸齒: </text> diff --git a/indra/newview/skins/default/xui/zh/floater_preview_notecard.xml b/indra/newview/skins/default/xui/zh/floater_preview_notecard.xml index 9447939801..f6b163dcd6 100644 --- a/indra/newview/skins/default/xui/zh/floater_preview_notecard.xml +++ b/indra/newview/skins/default/xui/zh/floater_preview_notecard.xml @@ -15,6 +15,7 @@ <text_editor name="Notecard Editor"> 載入中... </text_editor> + <button label="編輯…" label_selected="編輯" name="Edit"/> <button label="儲存" label_selected="儲存" name="Save"/> <button label="刪除" label_selected="刪除" name="Delete"/> </floater> diff --git a/indra/newview/skins/default/xui/zh/floater_report_abuse.xml b/indra/newview/skins/default/xui/zh/floater_report_abuse.xml index 347b40e675..2dfcfe6168 100644 --- a/indra/newview/skins/default/xui/zh/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/zh/floater_report_abuse.xml @@ -67,7 +67,7 @@ <combo_box.item label="土地 > 侵佔 > 物件或材質" name="Land__Encroachment__Objects_textures"/> <combo_box.item label="土地 > 侵佔 > 粒子" name="Land__Encroachment__Particles"/> <combo_box.item label="土地 > 侵佔 > 樹種 / 植物" name="Land__Encroachment__Trees_plants"/> - <combo_box.item label="違反遊戲規則" name="Wagering_gambling"/> + <combo_box.item label="違反技術遊戲規則" name="Wagering_gambling"/> <combo_box.item label="其他" name="Other"/> </combo_box> <text name="abuser_name_title"> diff --git a/indra/newview/skins/default/xui/zh/panel_group_general.xml b/indra/newview/skins/default/xui/zh/panel_group_general.xml index 2b16b61dd1..de81a26fed 100644 --- a/indra/newview/skins/default/xui/zh/panel_group_general.xml +++ b/indra/newview/skins/default/xui/zh/panel_group_general.xml @@ -45,7 +45,7 @@ <check_box label="任何人都可以加入" name="open_enrollement" tool_tip="設定這個群組是否允許新成員未受邀請自行加入。"/> <check_box label="加入費用" name="check_enrollment_fee" tool_tip="設定是否要徵收群組加入費"/> <spinner label="L$" name="spin_enrollment_fee" tool_tip="若勾選加入費,新成員必須支付這筆費用才能加入群組。"/> - <combo_box name="group_mature_check" tool_tip="設定你的群組是否含有被訂為適度成人分級的資訊"> + <combo_box name="group_mature_check" tool_tip="內容分級設定群組裡允許的內容類型和行爲"> <combo_item name="select_mature"> - 選擇內容分級 - </combo_item> diff --git a/indra/newview/skins/default/xui/zh/panel_region_access.xml b/indra/newview/skins/default/xui/zh/panel_region_access.xml index 7842d26321..04c67da333 100644 --- a/indra/newview/skins/default/xui/zh/panel_region_access.xml +++ b/indra/newview/skins/default/xui/zh/panel_region_access.xml @@ -14,6 +14,7 @@ <panel label="獲准" name="allowed_panel"> <panel label="top_panel" name="allowed_search_panel"> <filter_editor label="搜尋獲准的用戶" name="allowed_search_input"/> + <button label="複製" name="copy_allowed_list_btn"/> </panel> <text name="allow_resident_label"> 永遠准許: @@ -27,6 +28,7 @@ <panel label="准許的群組" name="allowed_groups_panel"> <panel label="top_panel" name="allowed_group_search_panel"> <filter_editor label="搜尋獲准的群組" name="allowed_group_search_input"/> + <button label="複製" name="copy_allowed_group_list_btn"/> </panel> <text name="allow_group_label"> 永遠准許的群組: @@ -40,6 +42,7 @@ <panel label="禁入的" name="banned_panel"> <panel label="top_panel" name="banned_search_panel"> <filter_editor label="搜尋禁入的用戶" name="banned_search_input"/> + <button label="複製" name="copy_banned_list_btn"/> </panel> <text name="ban_resident_label"> 永遠禁入: diff --git a/indra/newview/skins/default/xui/zh/strings.xml b/indra/newview/skins/default/xui/zh/strings.xml index d14eac88ef..bbbaf57501 100644 --- a/indra/newview/skins/default/xui/zh/strings.xml +++ b/indra/newview/skins/default/xui/zh/strings.xml @@ -76,6 +76,9 @@ 材質記憶體:[TEXTURE_MEMORY]MB VFS(快取)建立時間:[VFS_TIME] </string> + <string name="AboutOSXHiDPI"> + HiDPI顯示模式:[HIDPI] + </string> <string name="AboutLibs"> J2C 解碼器版本: [J2C_VERSION] 音效驅動程式版本: [AUDIO_DRIVER_VERSION] @@ -1471,6 +1474,15 @@ http://secondlife.com/support 求助解決問題。 <string name="MarketplaceURL_LearnMore"> https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more </string> + <string name="InventoryPlayAnimationTooltip"> + 開啟「Play選項」視窗。 + </string> + <string name="InventoryPlayGestureTooltip"> + 在虛擬世界裡執行所選姿勢。 + </string> + <string name="InventoryPlaySoundTooltip"> + 開啟「Play選項」視窗。 + </string> <string name="InventoryOutboxNotMerchantTitle"> 任何人都可在第二人生購物市集出售物品。 </string> @@ -5404,9 +5416,6 @@ http://secondlife.com/support 求助解決問題。 <string name="Command_Destinations_Label"> 目的地 </string> - <string name="Command_Facebook_Label"> - 臉書 - </string> <string name="Command_Flickr_Label"> Flickr </string> @@ -5500,9 +5509,6 @@ http://secondlife.com/support 求助解決問題。 <string name="Command_Destinations_Tooltip"> 你可能感興趣的目的地 </string> - <string name="Command_Facebook_Tooltip"> - 發佈到臉書 - </string> <string name="Command_Flickr_Tooltip"> 上傳到 Flickr </string> diff --git a/indra/newview/tests/llxmlrpclistener_test.cpp b/indra/newview/tests/llxmlrpclistener_test.cpp index 6e9756e7d5..dbaae7280c 100644 --- a/indra/newview/tests/llxmlrpclistener_test.cpp +++ b/indra/newview/tests/llxmlrpclistener_test.cpp @@ -88,15 +88,9 @@ namespace tut WrapLLErrs capture; LLSD request; request["uri"] = uri; - std::string threw; - try - { - pumps.obtain("LLXMLRPCTransaction").post(request); - } - catch (const WrapLLErrs::FatalException& e) - { - threw = e.what(); - } + std::string threw = capture.catch_llerrs([&pumps, &request](){ + pumps.obtain("LLXMLRPCTransaction").post(request); + }); ensure_contains("threw exception", threw, "missing params"); ensure_contains("identified missing", threw, "method"); ensure_contains("identified missing", threw, "reply"); @@ -113,15 +107,9 @@ namespace tut request["reply"] = "reply"; LLSD& params(request["params"]); params["who"]["specifically"] = "world"; // LLXMLRPCListener only handles scalar params - std::string threw; - try - { - pumps.obtain("LLXMLRPCTransaction").post(request); - } - catch (const WrapLLErrs::FatalException& e) - { - threw = e.what(); - } + std::string threw = capture.catch_llerrs([&pumps, &request](){ + pumps.obtain("LLXMLRPCTransaction").post(request); + }); ensure_contains("threw exception", threw, "unknown type"); } diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index fcb97ded8f..a4cda0ba78 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -46,7 +46,7 @@ viewer_dir = os.path.dirname(__file__) # Put it FIRST because some of our build hosts have an ancient install of # indra.util.llmanifest under their system Python! sys.path.insert(0, os.path.join(viewer_dir, os.pardir, "lib", "python")) -from indra.util.llmanifest import LLManifest, main, path_ancestors, CHANNEL_VENDOR_BASE, RELEASE_CHANNEL, ManifestError +from indra.util.llmanifest import LLManifest, main, path_ancestors, CHANNEL_VENDOR_BASE, RELEASE_CHANNEL, ManifestError, MissingError from llbase import llsd class ViewerManifest(LLManifest): @@ -145,13 +145,10 @@ class ViewerManifest(LLManifest): with self.prefix(src_dst="skins"): # include the entire textures directory recursively with self.prefix(src_dst="*/textures"): - self.path("*/*.tga") - self.path("*/*.j2c") self.path("*/*.jpg") self.path("*/*.png") self.path("*.tga") self.path("*.j2c") - self.path("*.jpg") self.path("*.png") self.path("textures.xml") self.path("*/xui/*/*.xml") @@ -171,14 +168,6 @@ class ViewerManifest(LLManifest): self.path("*/*/*.gif") - # local_assets dir (for pre-cached textures) - with self.prefix(src_dst="local_assets"): - self.path("*.j2c") - self.path("*.tga") - - # File in the newview/ directory - self.path("gpu_table.txt") - #build_data.json. Standard with exception handling is fine. If we can't open a new file for writing, we have worse problems #platform is computed above with other arg parsing build_data_dict = {"Type":"viewer","Version":'.'.join(self.args['version']), @@ -517,17 +506,6 @@ class WindowsManifest(ViewerManifest): with self.prefix(src=os.path.join(self.args['build'], os.pardir, 'sharedlibs', self.args['configuration'])): - # Get llcommon and deps. If missing assume static linkage and continue. - try: - self.path('llcommon.dll') - self.path('libapr-1.dll') - self.path('libaprutil-1.dll') - self.path('libapriconv-1.dll') - - except RuntimeError as err: - print err.message - print "Skipping llcommon.dll (assuming llcommon was linked statically)" - # Mesh 3rd party libs needed for auto LOD and collada reading try: self.path("glod.dll") @@ -552,24 +530,21 @@ class WindowsManifest(ViewerManifest): if self.args['configuration'].lower() == 'debug': self.path("msvcr120d.dll") self.path("msvcp120d.dll") - self.path("msvcr100d.dll") - self.path("msvcp100d.dll") else: self.path("msvcr120.dll") self.path("msvcp120.dll") - self.path("msvcr100.dll") - self.path("msvcp100.dll") - # Vivox runtimes - self.path("SLVoice.exe") + # SLVoice executable + with self.prefix(src=os.path.join(pkgdir, 'bin', 'release')): + self.path("SLVoice.exe") + + # Vivox libraries if (self.address_size == 64): self.path("vivoxsdk_x64.dll") self.path("ortp_x64.dll") else: self.path("vivoxsdk.dll") self.path("ortp.dll") - self.path("libsndfile-1.dll") - self.path("vivoxoal.dll") # Security self.path("ssleay32.dll") @@ -592,15 +567,6 @@ class WindowsManifest(ViewerManifest): self.path("BugSplat.dll") self.path("BugSplatRc.dll") - # For google-perftools tcmalloc allocator. - try: - if self.args['configuration'].lower() == 'debug': - self.path('libtcmalloc_minimal-debug.dll') - else: - self.path('libtcmalloc_minimal.dll') - except: - print "Skipping libtcmalloc_minimal.dll" - self.path(src="licenses-win32.txt", dst="licenses.txt") self.path("featuretable.txt") @@ -990,7 +956,7 @@ class DarwinManifest(ViewerManifest): with self.prefix(src=relpkgdir, dst=""): self.path("libndofdev.dylib") - self.path("libhunspell-1.3.0.dylib") + self.path("libhunspell-1.3.a") with self.prefix(src_dst="cursors_mac"): self.path("*.tif") @@ -1037,11 +1003,15 @@ class DarwinManifest(ViewerManifest): # (source, dest) pair to self.file_list for every expanded # file processed. Remember its size before the call. oldlen = len(self.file_list) - self.path(src, dst) - # The dest appended to self.file_list has been prepended - # with self.get_dst_prefix(). Strip it off again. - added = [os.path.relpath(d, self.get_dst_prefix()) - for s, d in self.file_list[oldlen:]] + try: + self.path(src, dst) + # The dest appended to self.file_list has been prepended + # with self.get_dst_prefix(). Strip it off again. + added = [os.path.relpath(d, self.get_dst_prefix()) + for s, d in self.file_list[oldlen:]] + except MissingError as err: + print >> sys.stderr, "Warning: "+err.msg + added = [] if not added: print "Skipping %s" % dst return added @@ -1051,18 +1021,10 @@ class DarwinManifest(ViewerManifest): # symlink from sub-app/Contents/Resources to the real .dylib. # Need to get the llcommon dll from any of the build directories as well. libfile_parent = self.get_dst_prefix() - libfile = "libllcommon.dylib" - dylibs = path_optional(self.find_existing_file(os.path.join(os.pardir, - "llcommon", - self.args['configuration'], - libfile), - os.path.join(relpkgdir, libfile)), - dst=libfile) - + dylibs=[] for libfile in ( "libapr-1.0.dylib", "libaprutil-1.0.dylib", - "libcollada14dom.dylib", "libexpat.1.dylib", "libexception_handler.dylib", "libGLOD.dylib", @@ -1073,14 +1035,14 @@ class DarwinManifest(ViewerManifest): ): dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) - # SLVoice and vivox lols, no symlinks needed + # SLVoice executable + with self.prefix(src=os.path.join(pkgdir, 'bin', 'release')): + self.path("SLVoice") + + # Vivox libraries for libfile in ( 'libortp.dylib', - 'libsndfile.dylib', - 'libvivoxoal.dylib', 'libvivoxsdk.dylib', - 'libvivoxplatform.dylib', - 'SLVoice', ): self.path2basename(relpkgdir, libfile) @@ -1575,7 +1537,6 @@ class Linux_i686_Manifest(LinuxManifest): self.path("libsndfile.so.1") #self.path("libvivoxoal.so.1") # no - we'll re-use the viewer's own OpenAL lib self.path("libvivoxsdk.so") - self.path("libvivoxplatform.so") self.strip_binaries() @@ -1596,4 +1557,9 @@ if __name__ == "__main__": dict(name='bugsplat', description="""BugSplat database to which to post crashes, if BugSplat crash reporting is desired""", default=''), ] - main(extra=extra_arguments) + try: + main(extra=extra_arguments) + except (ManifestError, MissingError) as err: + sys.exit("\nviewer_manifest.py failed: "+err.msg) + except: + raise diff --git a/indra/test/catch_and_store_what_in.h b/indra/test/catch_and_store_what_in.h index 59f8cc0085..5beba06024 100644 --- a/indra/test/catch_and_store_what_in.h +++ b/indra/test/catch_and_store_what_in.h @@ -2,7 +2,7 @@ * @file catch_and_store_what_in.h * @author Nat Goodspeed * @date 2012-02-15 - * @brief CATCH_AND_STORE_WHAT_IN() macro + * @brief catch_what() template function, CATCH_AND_STORE_WHAT_IN() macro * * $LicenseInfo:firstyear=2012&license=viewerlgpl$ * Copyright (c) 2012, Linden Research, Inc. @@ -13,6 +13,30 @@ #define LL_CATCH_AND_STORE_WHAT_IN_H /** + * In the brave new world of lambdas, we can use a nicer C++ idiom for testing + * exceptions than CATCH_AND_STORE_WHAT_IN() below, e.g.: + * + * @code + * std::string threw = catch_what<std::runtime_error>( + * [](){ throw std::runtime_error("badness"); }); + * ensure_equals(threw, "badness"); + * @endcode + */ +template <typename EXCEPTION, typename FUNC> +std::string catch_what(FUNC func) +{ + try + { + func(); + return {}; + } + catch (const EXCEPTION& err) + { + return err.what(); + } +} + +/** * Idiom useful for test programs: catch an expected exception, store its * what() string in a specified std::string variable. From there the caller * can do things like: diff --git a/indra/test/llevents_tut.cpp b/indra/test/llevents_tut.cpp index 16edab6282..3abae3e43e 100644 --- a/indra/test/llevents_tut.cpp +++ b/indra/test/llevents_tut.cpp @@ -134,17 +134,15 @@ void events_object::test<1>() per_frame.post(4); check_listener("re-blocked", listener0, 3); } // unblock - std::string threw; - try - { - // NOTE: boost::bind() saves its arguments by VALUE! If you pass - // an object instance rather than a pointer, you'll end up binding - // to an internal copy of that instance! Use boost::ref() to - // capture a reference instead. - per_frame.listen(listener0.getName(), // note bug, dup name - boost::bind(&Listener::call, boost::ref(listener1), _1)); - } - CATCH_AND_STORE_WHAT_IN(threw, LLEventPump::DupListenerName) + std::string threw = catch_what<LLEventPump::DupListenerName>( + [&per_frame, this](){ + // NOTE: boost::bind() saves its arguments by VALUE! If you pass + // an object instance rather than a pointer, you'll end up binding + // to an internal copy of that instance! Use boost::ref() to + // capture a reference instead. + per_frame.listen(listener0.getName(), // note bug, dup name + boost::bind(&Listener::call, boost::ref(listener1), _1)); + }); ensure_equals(threw, std::string("DupListenerName: " "Attempt to register duplicate listener name '") + @@ -341,15 +339,13 @@ void events_object::test<7>() ensure_equals(collector.result, make<StringVec>(list_of("Mary")("spot")("checked"))); collector.clear(); button.stopListening("spot"); - std::string threw; - try - { - button.listen("spot", - boost::bind(&Collect::add, boost::ref(collector), "spot", _1), - // after "Mary" and "checked" -- whoops! - make<NameList>(list_of("Mary")("checked"))); - } - CATCH_AND_STORE_WHAT_IN(threw, LLEventPump::Cycle) + std::string threw = catch_what<LLEventPump::Cycle>( + [&button, &collector](){ + button.listen("spot", + boost::bind(&Collect::add, boost::ref(collector), "spot", _1), + // after "Mary" and "checked" -- whoops! + make<NameList>(list_of("Mary")("checked"))); + }); // Obviously the specific wording of the exception text can // change; go ahead and change the test to match. // Establish that it contains: @@ -374,15 +370,13 @@ void events_object::test<7>() button.post(3); ensure_equals(collector.result, make<StringVec>(list_of("Mary")("checked")("yellow")("shoelaces"))); collector.clear(); - threw.clear(); - try - { - button.listen("of", - boost::bind(&Collect::add, boost::ref(collector), "of", _1), - make<NameList>(list_of("shoelaces")), - make<NameList>(list_of("yellow"))); - } - CATCH_AND_STORE_WHAT_IN(threw, LLEventPump::OrderChange) + threw = catch_what<LLEventPump::OrderChange>( + [&button, &collector](){ + button.listen("of", + boost::bind(&Collect::add, boost::ref(collector), "of", _1), + make<NameList>(list_of("shoelaces")), + make<NameList>(list_of("yellow"))); + }); // Same remarks about the specific wording of the exception. Just // ensure that it contains enough information to clarify the // problem and what must be done to resolve it. @@ -404,13 +398,11 @@ void events_object::test<8>() { // nested scope // Hand-instantiate an LLEventStream... LLEventStream bob("bob"); - std::string threw; - try - { - // then another with a duplicate name. - LLEventStream bob2("bob"); - } - CATCH_AND_STORE_WHAT_IN(threw, LLEventPump::DupPumpName) + std::string threw = catch_what<LLEventPump::DupPumpName>( + [](){ + // then another with a duplicate name. + LLEventStream bob2("bob"); + }); ensure("Caught DupPumpName", !threw.empty()); } // delete first 'bob' LLEventStream bob("bob"); // should work, previous one unregistered @@ -445,13 +437,11 @@ void events_object::test<9>() listener0.listenTo(random); eventSource("random"); check_listener("got by pump name", listener0, 17); - std::string threw; - try - { - LLListenerOrPumpName empty; - empty(17); - } - CATCH_AND_STORE_WHAT_IN(threw, LLListenerOrPumpName::Empty) + std::string threw = catch_what<LLListenerOrPumpName::Empty>( + [](){ + LLListenerOrPumpName empty; + empty(17); + }); ensure("threw Empty", !threw.empty()); } diff --git a/indra/test/test.cpp b/indra/test/test.cpp index 861ec1d942..b14c2eb255 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -37,7 +37,6 @@ #include "linden_common.h" #include "llerrorcontrol.h" #include "lltut.h" -#include "tests/wrapllerrs.h" // RecorderProxy #include "stringize.h" #include "namedtempfile.h" #include "lltrace.h" @@ -254,7 +253,7 @@ public: break; case tut::test_result::ex: ++mFailedTests; - out << "exception"; + out << "exception: " << tr.exception_typeid; break; case tut::test_result::warn: ++mFailedTests; @@ -265,7 +264,7 @@ public: out << "abnormal termination"; break; case tut::test_result::skip: - ++mSkippedTests; + ++mSkippedTests; out << "skipped known failure"; break; default: |