From a17ca8260aa4a1e414b6a19d3faeb18f914c3f31 Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Mon, 26 Oct 2009 16:08:43 -0400 Subject: Beginning work for DEV-41722 normalizing shared lib staging on all 3 platforms. Renamed CopyWinLibs.cmake to Copy3rdPartyLibs.cmake. --- indra/cmake/CMakeLists.txt | 2 +- indra/cmake/Copy3rdPartyLibs.cmake | 223 +++++++++++++++++++++++++++++++++++++ indra/llcommon/CMakeLists.txt | 4 +- 3 files changed, 225 insertions(+), 4 deletions(-) create mode 100644 indra/cmake/Copy3rdPartyLibs.cmake diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 4563b59ad2..4fc25dcc24 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -16,7 +16,7 @@ set(cmake_SOURCE_FILES CARes.cmake CURL.cmake CMakeCopyIfDifferent.cmake - CopyWinLibs.cmake + Copy3rdPartyLibs.cmake CSharpMacros.cmake DBusGlib.cmake DirectX.cmake diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake new file mode 100644 index 0000000000..8f27c70610 --- /dev/null +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -0,0 +1,223 @@ +# -*- cmake -*- + +# The copy_win_libs folder contains file lists and a script used to +# copy dlls, exes and such needed to run the SecondLife from within +# VisualStudio. + +include(CMakeCopyIfDifferent) + +if(WINDOWS) +#******************************* +# VIVOX - *NOTE: no debug version +set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-win32") +set(vivox_files + SLVoice.exe + alut.dll + vivoxsdk.dll + ortp.dll + wrap_oal.dll + ) +copy_if_different( + ${vivox_src_dir} + "${SHARED_LIB_STAGING_DIR}/Debug" + out_targets + ${vivox_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + +copy_if_different( + ${vivox_src_dir} + "${SHARED_LIB_STAGING_DIR}/Release" + out_targets + ${vivox_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + +copy_if_different( + ${vivox_src_dir} + "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo" + out_targets + ${vivox_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + +#******************************* +# Misc shared libs +set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug") +set(debug_files + openjpegd.dll + libtcmalloc_minimal-debug.dll + libapr-1.dll + libaprutil-1.dll + libapriconv-1.dll + ) +if (FMOD_SDK_DIR) + set(fmod_files fmod.dll) + copy_if_different( + ${FMOD_SDK_DIR} + "${CMAKE_CURRENT_BINARY_DIR}/Debug" + out_targets + ${fmod_files} + ) + set(all_targets ${all_targets} ${out_targets}) + copy_if_different( + ${FMOD_SDK_DIR} + "${CMAKE_CURRENT_BINARY_DIR}/Release" + out_targets + ${fmod_files} + ) + set(all_targets ${all_targets} ${out_targets}) + copy_if_different( + ${FMOD_SDK_DIR} + "${CMAKE_CURRENT_BINARY_DIR}/RelWithDbgInfo" + out_targets + ${fmod_files} + ) + set(all_targets ${all_targets} ${out_targets}) +endif (FMOD_SDK_DIR) + +copy_if_different( + ${debug_src_dir} + "${SHARED_LIB_STAGING_DIR}/Debug" + out_targets + ${debug_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + +set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release") +set(release_files + openjpeg.dll + libtcmalloc_minimal.dll + libapr-1.dll + libaprutil-1.dll + libapriconv-1.dll + ) + +copy_if_different( + ${release_src_dir} + "${SHARED_LIB_STAGING_DIR}/Release" + out_targets + ${release_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + +copy_if_different( + ${release_src_dir} + "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo" + out_targets + ${release_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + +#******************************* +# LLKDU +set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu") +if(NOT EXISTS ${internal_llkdu_path}) + if (EXISTS "${debug_src_dir}/llkdu.dll") + set(debug_llkdu_src "${debug_src_dir}/llkdu.dll") + set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR}/Debug/llkdu.dll") + ADD_CUSTOM_COMMAND( + OUTPUT ${debug_llkdu_dst} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${debug_llkdu_src} ${debug_llkdu_dst} + DEPENDS ${debug_llkdu_src} + COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR}/Debug" + ) + set(third_party_targets ${third_party_targets} $} ${debug_llkdu_dst}) + endif (EXISTS "${debug_src_dir}/llkdu.dll") + + if (EXISTS "${release_src_dir}/llkdu.dll") + set(release_llkdu_src "${release_src_dir}/llkdu.dll") + set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR}/Release/llkdu.dll") + ADD_CUSTOM_COMMAND( + OUTPUT ${release_llkdu_dst} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${release_llkdu_dst} + DEPENDS ${release_llkdu_src} + COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR}/Release" + ) + set(third_party_targets ${third_party_targets} ${release_llkdu_dst}) + + set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/llkdu.dll") + ADD_CUSTOM_COMMAND( + OUTPUT ${relwithdebinfo_llkdu_dst} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${relwithdebinfo_llkdu_dst} + DEPENDS ${release_llkdu_src} + COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo" + ) + set(third_party_targets ${third_party_targets} ${relwithdebinfo_llkdu_dst}) + endif (EXISTS "${release_src_dir}/llkdu.dll") + +endif (NOT EXISTS ${internal_llkdu_path}) + +#******************************* +# Copy MS C runtime dlls, required for packaging. +# *TODO - Adapt this to support VC9 +if (MSVC80) + FIND_PATH(debug_msvc8_redist_path msvcr80d.dll + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT + NO_DEFAULT_PATH + NO_DEFAULT_PATH + ) + + if(EXISTS ${debug_msvc8_redist_path}) + set(debug_msvc8_files + msvcr80d.dll + msvcp80d.dll + Microsoft.VC80.DebugCRT.manifest + ) + + copy_if_different( + ${debug_msvc8_redist_path} + "${SHARED_LIB_STAGING_DIR}/Debug" + out_targets + ${debug_msvc8_files} + ) + set(third_party_targets ${third_party_targets} ${out_targets}) + + endif (EXISTS ${debug_msvc8_redist_path}) + + FIND_PATH(release_msvc8_redist_path msvcr80.dll + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC80.CRT + NO_DEFAULT_PATH + NO_DEFAULT_PATH + ) + + if(EXISTS ${release_msvc8_redist_path}) + set(release_msvc8_files + msvcr80.dll + msvcp80.dll + Microsoft.VC80.CRT.manifest + ) + + copy_if_different( + ${release_msvc8_redist_path} + "${SHARED_LIB_STAGING_DIR}/Release" + out_targets + ${release_msvc8_files} + ) + set(third_party_targets ${third_party_targets} ${out_targets}) + + copy_if_different( + ${release_msvc8_redist_path} + "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo" + out_targets + ${release_msvc8_files} + ) + set(third_party_targets ${third_party_targets} ${out_targets}) + + endif (EXISTS ${release_msvc8_redist_path}) +endif (MSVC80) + +elseif(DARWIN) + +elseif(LINUX) + +else(WINDOWS) + message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...") +endif(WINDOWS) + +add_custom_target(stage_third_party_libs ALL + DEPENDS + ${third_party_targets} + ) diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index e7aaf3c984..7a7281a4a7 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -8,9 +8,7 @@ include(Linking) include(Boost) include (Pth) -if (WINDOWS) - include(CopyWinLibs) -endif (WINDOWS) +include(Copy3rdPartyLibs) include_directories( ${EXPAT_INCLUDE_DIRS} -- cgit v1.2.3 From 89e3523052a9b1ac5534e3e30fa312ef11a78f69 Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Mon, 26 Oct 2009 18:13:20 -0400 Subject: More work for DEV-41722 normalizing shared lib staging on all 3 platforms. Started refactoring Copy3rdPartyLibs.cmake to use common commands with platform specific variables. --- indra/cmake/Copy3rdPartyLibs.cmake | 177 +++++++++++++++++++++++-------------- 1 file changed, 111 insertions(+), 66 deletions(-) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 8f27c70610..cb8ed4f05f 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -7,6 +7,10 @@ include(CMakeCopyIfDifferent) if(WINDOWS) + set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug") + set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo") + set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release") + #******************************* # VIVOX - *NOTE: no debug version set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-win32") @@ -17,32 +21,11 @@ set(vivox_files ortp.dll wrap_oal.dll ) -copy_if_different( - ${vivox_src_dir} - "${SHARED_LIB_STAGING_DIR}/Debug" - out_targets - ${vivox_files} - ) -set(third_party_targets ${third_party_targets} ${out_targets}) - -copy_if_different( - ${vivox_src_dir} - "${SHARED_LIB_STAGING_DIR}/Release" - out_targets - ${vivox_files} - ) -set(third_party_targets ${third_party_targets} ${out_targets}) - -copy_if_different( - ${vivox_src_dir} - "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo" - out_targets - ${vivox_files} - ) -set(third_party_targets ${third_party_targets} ${out_targets}) #******************************* # Misc shared libs + +# *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug") set(debug_files openjpegd.dll @@ -51,6 +34,17 @@ set(debug_files libaprutil-1.dll libapriconv-1.dll ) + +# *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables +set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release") +set(release_files + openjpeg.dll + libtcmalloc_minimal.dll + libapr-1.dll + libaprutil-1.dll + libapriconv-1.dll + ) + if (FMOD_SDK_DIR) set(fmod_files fmod.dll) copy_if_different( @@ -76,38 +70,6 @@ if (FMOD_SDK_DIR) set(all_targets ${all_targets} ${out_targets}) endif (FMOD_SDK_DIR) -copy_if_different( - ${debug_src_dir} - "${SHARED_LIB_STAGING_DIR}/Debug" - out_targets - ${debug_files} - ) -set(third_party_targets ${third_party_targets} ${out_targets}) - -set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release") -set(release_files - openjpeg.dll - libtcmalloc_minimal.dll - libapr-1.dll - libaprutil-1.dll - libapriconv-1.dll - ) - -copy_if_different( - ${release_src_dir} - "${SHARED_LIB_STAGING_DIR}/Release" - out_targets - ${release_files} - ) -set(third_party_targets ${third_party_targets} ${out_targets}) - -copy_if_different( - ${release_src_dir} - "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo" - out_targets - ${release_files} - ) -set(third_party_targets ${third_party_targets} ${out_targets}) #******************************* # LLKDU @@ -115,33 +77,33 @@ set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu") if(NOT EXISTS ${internal_llkdu_path}) if (EXISTS "${debug_src_dir}/llkdu.dll") set(debug_llkdu_src "${debug_src_dir}/llkdu.dll") - set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR}/Debug/llkdu.dll") + set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR_DEBUG}/llkdu.dll") ADD_CUSTOM_COMMAND( OUTPUT ${debug_llkdu_dst} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${debug_llkdu_src} ${debug_llkdu_dst} DEPENDS ${debug_llkdu_src} - COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR}/Debug" + COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_DEBUG}" ) set(third_party_targets ${third_party_targets} $} ${debug_llkdu_dst}) endif (EXISTS "${debug_src_dir}/llkdu.dll") if (EXISTS "${release_src_dir}/llkdu.dll") set(release_llkdu_src "${release_src_dir}/llkdu.dll") - set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR}/Release/llkdu.dll") + set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELEASE}/llkdu.dll") ADD_CUSTOM_COMMAND( OUTPUT ${release_llkdu_dst} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${release_llkdu_dst} DEPENDS ${release_llkdu_src} - COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR}/Release" + COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_RELEASE}" ) set(third_party_targets ${third_party_targets} ${release_llkdu_dst}) - set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/llkdu.dll") + set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}/llkdu.dll") ADD_CUSTOM_COMMAND( OUTPUT ${relwithdebinfo_llkdu_dst} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${relwithdebinfo_llkdu_dst} DEPENDS ${release_llkdu_src} - COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo" + COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}" ) set(third_party_targets ${third_party_targets} ${relwithdebinfo_llkdu_dst}) endif (EXISTS "${release_src_dir}/llkdu.dll") @@ -168,7 +130,7 @@ if (MSVC80) copy_if_different( ${debug_msvc8_redist_path} - "${SHARED_LIB_STAGING_DIR}/Debug" + "${SHARED_LIB_STAGING_DIR_DEBUG}" out_targets ${debug_msvc8_files} ) @@ -192,7 +154,7 @@ if (MSVC80) copy_if_different( ${release_msvc8_redist_path} - "${SHARED_LIB_STAGING_DIR}/Release" + "${SHARED_LIB_STAGING_DIR_RELEASE}" out_targets ${release_msvc8_files} ) @@ -200,7 +162,7 @@ if (MSVC80) copy_if_different( ${release_msvc8_redist_path} - "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo" + "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}" out_targets ${release_msvc8_files} ) @@ -210,13 +172,96 @@ if (MSVC80) endif (MSVC80) elseif(DARWIN) - + set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/universal-darwin") + set(vivox_files + ) + # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables + set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib/debug") + set(debug_files + ) + # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables + set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib/release") + set(release_files + ) elseif(LINUX) - + set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux") + set(vivox_files + ) + # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables + set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/debug") + set(debug_files + ) + # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables + set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release") + set(release_files + ) 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 + ) + # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables + set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/debug") + set(debug_files + ) + # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables + set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release") + set(release_files + ) endif(WINDOWS) + +copy_if_different( + ${vivox_src_dir} + "${SHARED_LIB_STAGING_DIR_DEBUG}" + out_targets + ${vivox_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + +copy_if_different( + ${vivox_src_dir} + "${SHARED_LIB_STAGING_DIR_RELEASE}" + out_targets + ${vivox_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + +copy_if_different( + ${vivox_src_dir} + "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}" + out_targets + ${vivox_files} + ) +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}" + out_targets + ${release_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + +copy_if_different( + ${release_src_dir} + "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}" + out_targets + ${release_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + + add_custom_target(stage_third_party_libs ALL DEPENDS ${third_party_targets} -- cgit v1.2.3 From cddf7f19c5741272f4d1cc2b124ff77f11b873a6 Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Fri, 30 Oct 2009 18:14:58 -0400 Subject: continuing work on DEV-41722 normalizing shared lib staging. started factoring out copying into common section while file lists are initialized above in platform specific sections. --- indra/cmake/Copy3rdPartyLibs.cmake | 254 ++++++++++++++++++++++--------------- 1 file changed, 155 insertions(+), 99 deletions(-) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index cb8ed4f05f..5f9d386a4f 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -11,104 +11,59 @@ if(WINDOWS) set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo") set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release") -#******************************* -# VIVOX - *NOTE: no debug version -set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-win32") -set(vivox_files - SLVoice.exe - alut.dll - vivoxsdk.dll - ortp.dll - wrap_oal.dll - ) - -#******************************* -# Misc shared libs - -# *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables -set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug") -set(debug_files - openjpegd.dll - libtcmalloc_minimal-debug.dll - libapr-1.dll - libaprutil-1.dll - libapriconv-1.dll - ) - -# *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables -set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release") -set(release_files - openjpeg.dll - libtcmalloc_minimal.dll - libapr-1.dll - libaprutil-1.dll - libapriconv-1.dll - ) - -if (FMOD_SDK_DIR) - set(fmod_files fmod.dll) - copy_if_different( - ${FMOD_SDK_DIR} - "${CMAKE_CURRENT_BINARY_DIR}/Debug" - out_targets - ${fmod_files} - ) - set(all_targets ${all_targets} ${out_targets}) - copy_if_different( - ${FMOD_SDK_DIR} - "${CMAKE_CURRENT_BINARY_DIR}/Release" - out_targets - ${fmod_files} - ) - set(all_targets ${all_targets} ${out_targets}) - copy_if_different( - ${FMOD_SDK_DIR} - "${CMAKE_CURRENT_BINARY_DIR}/RelWithDbgInfo" - out_targets - ${fmod_files} + #******************************* + # VIVOX - *NOTE: no debug version + set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-win32") + set(vivox_files + SLVoice.exe + alut.dll + vivoxsdk.dll + ortp.dll + wrap_oal.dll ) - set(all_targets ${all_targets} ${out_targets}) -endif (FMOD_SDK_DIR) - -#******************************* -# LLKDU -set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu") -if(NOT EXISTS ${internal_llkdu_path}) - if (EXISTS "${debug_src_dir}/llkdu.dll") - set(debug_llkdu_src "${debug_src_dir}/llkdu.dll") - set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR_DEBUG}/llkdu.dll") - ADD_CUSTOM_COMMAND( - OUTPUT ${debug_llkdu_dst} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${debug_llkdu_src} ${debug_llkdu_dst} - DEPENDS ${debug_llkdu_src} - COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_DEBUG}" - ) - set(third_party_targets ${third_party_targets} $} ${debug_llkdu_dst}) - endif (EXISTS "${debug_src_dir}/llkdu.dll") + #******************************* + # Misc shared libs - if (EXISTS "${release_src_dir}/llkdu.dll") - set(release_llkdu_src "${release_src_dir}/llkdu.dll") - set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELEASE}/llkdu.dll") - ADD_CUSTOM_COMMAND( - OUTPUT ${release_llkdu_dst} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${release_llkdu_dst} - DEPENDS ${release_llkdu_src} - COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_RELEASE}" - ) - set(third_party_targets ${third_party_targets} ${release_llkdu_dst}) + # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables + set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug") + set(debug_files + openjpegd.dll + libtcmalloc_minimal-debug.dll + libapr-1.dll + libaprutil-1.dll + libapriconv-1.dll + ) - set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}/llkdu.dll") - ADD_CUSTOM_COMMAND( - OUTPUT ${relwithdebinfo_llkdu_dst} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${relwithdebinfo_llkdu_dst} - DEPENDS ${release_llkdu_src} - COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}" - ) - set(third_party_targets ${third_party_targets} ${relwithdebinfo_llkdu_dst}) - endif (EXISTS "${release_src_dir}/llkdu.dll") + # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables + set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release") + set(release_files + openjpeg.dll + libtcmalloc_minimal.dll + libapr-1.dll + libaprutil-1.dll + libapriconv-1.dll + ) -endif (NOT EXISTS ${internal_llkdu_path}) + if (FMOD_SDK_DIR) + set(fmod_files fmod.dll) + endif (FMOD_SDK_DIR) + + #******************************* + # LLKDU + set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu") + if(NOT EXISTS ${internal_llkdu_path}) + if (EXISTS "${debug_src_dir}/llkdu.dll") + set(debug_llkdu_src "${debug_src_dir}/llkdu.dll") + set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR_DEBUG}/llkdu.dll") + endif (EXISTS "${debug_src_dir}/llkdu.dll") + + if (EXISTS "${release_src_dir}/llkdu.dll") + set(release_llkdu_src "${release_src_dir}/llkdu.dll") + set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELEASE}/llkdu.dll") + set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}/llkdu.dll") + endif (EXISTS "${release_src_dir}/llkdu.dll") + endif (NOT EXISTS ${internal_llkdu_path}) #******************************* # Copy MS C runtime dlls, required for packaging. @@ -183,6 +138,25 @@ elseif(DARWIN) set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib/release") set(release_files ) + + # fmod is statically linked on darwin + set(fmod_files "") + + #******************************* + # LLKDU + set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu") + if(NOT EXISTS ${internal_llkdu_path}) + if (EXISTS "${debug_src_dir}/libllkdu.dylib") + set(debug_llkdu_src "${debug_src_dir}/libllkdu.dylib") + set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR_DEBUG}/libllkdu.dylib") + endif (EXISTS "${debug_src_dir}/libllkdu.dylib") + + if (EXISTS "${release_src_dir}/libllkdu.dylib") + set(release_llkdu_src "${release_src_dir}/libllkdu.dylib") + set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELEASE}/libllkdu.dylib") + set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}/libllkdu.dylib") + endif (EXISTS "${release_src_dir}/libllkdu.dylib") + endif (NOT EXISTS ${internal_llkdu_path}) elseif(LINUX) set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux") set(vivox_files @@ -195,19 +169,43 @@ elseif(LINUX) set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release") set(release_files ) + + if (FMOD_SDK_DIR) + set(fmod_files "libfmod-3.75.so") + endif (FMOD_SDK_DIR) + + #******************************* + # LLKDU + set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu") + if(NOT EXISTS ${internal_llkdu_path}) + if (EXISTS "${debug_src_dir}/libllkdu.so") + set(debug_llkdu_src "${debug_src_dir}/libllkdu.so") + set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR_DEBUG}/libllkdu.so") + endif (EXISTS "${debug_src_dir}/libllkdu.so") + + if (EXISTS "${release_src_dir}/libllkdu.so") + set(release_llkdu_src "${release_src_dir}/libllkdu.so") + set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELEASE}/libllkdu.so") + set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}/libllkdu.so") + endif (EXISTS "${release_src_dir}/libllkdu.so") 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_files "") # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/debug") - set(debug_files - ) + set(debug_files "") # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release") - set(release_files - ) + set(release_files "") + + set(fmod_files "") + + set(debug_llkdu_src "") + set(debug_llkdu_dst "") + set(release_llkdu_src "") + set(release_llkdu_dst "") + set(relwithdebinfo_llkdu_dst "") endif(WINDOWS) @@ -261,6 +259,64 @@ copy_if_different( ) set(third_party_targets ${third_party_targets} ${out_targets}) +if (FMOD_SDK_DIR) + copy_if_different( + ${FMOD_SDK_DIR} + "${CMAKE_CURRENT_BINARY_DIR}/Debug" + out_targets + ${fmod_files} + ) + set(all_targets ${all_targets} ${out_targets}) + copy_if_different( + ${FMOD_SDK_DIR} + "${CMAKE_CURRENT_BINARY_DIR}/Release" + out_targets + ${fmod_files} + ) + set(all_targets ${all_targets} ${out_targets}) + copy_if_different( + ${FMOD_SDK_DIR} + "${CMAKE_CURRENT_BINARY_DIR}/RelWithDbgInfo" + out_targets + ${fmod_files} + ) + set(all_targets ${all_targets} ${out_targets}) +endif (FMOD_SDK_DIR) + +#******************************* +# LLKDU +set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu") +if(NOT EXISTS ${internal_llkdu_path}) + if (EXISTS "${debug_llkdu_src}") + ADD_CUSTOM_COMMAND( + OUTPUT ${debug_llkdu_dst} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${debug_llkdu_src} ${debug_llkdu_dst} + DEPENDS ${debug_llkdu_src} + COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_DEBUG}" + ) + set(third_party_targets ${third_party_targets} $} ${debug_llkdu_dst}) + endif (EXISTS "${debug_llkdu_src}") + + if (EXISTS "${release_llkdu_src}") + ADD_CUSTOM_COMMAND( + OUTPUT ${release_llkdu_dst} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${release_llkdu_dst} + DEPENDS ${release_llkdu_src} + COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_RELEASE}" + ) + set(third_party_targets ${third_party_targets} ${release_llkdu_dst}) + + ADD_CUSTOM_COMMAND( + OUTPUT ${relwithdebinfo_llkdu_dst} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${relwithdebinfo_llkdu_dst} + DEPENDS ${release_llkdu_src} + COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}" + ) + set(third_party_targets ${third_party_targets} ${relwithdebinfo_llkdu_dst}) + endif (EXISTS "${release_llkdu_src}") + +endif (NOT EXISTS ${internal_llkdu_path}) + add_custom_target(stage_third_party_libs ALL DEPENDS -- cgit v1.2.3 From f3d13666f611c92fe175d14b3d6bb89f5841845d Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Fri, 30 Oct 2009 18:21:35 -0400 Subject: continuing work on DEV-41722 normalizing shared lib staging. fixed copy/paste error in the last commit(f5da14574943). --- indra/cmake/Copy3rdPartyLibs.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 5f9d386a4f..e7b5d097d3 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -188,6 +188,7 @@ elseif(LINUX) set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELEASE}/libllkdu.so") set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}/libllkdu.so") endif (EXISTS "${release_src_dir}/libllkdu.so") + endif(NOT EXISTS ${internal_llkdu_path}) 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") -- cgit v1.2.3 From 35469b04a0cc9225788c71f341a7d44937d880e8 Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Mon, 2 Nov 2009 13:52:44 -0500 Subject: Implemented mac staging for DEV-41722 normalizing shared lib staging. also added a bunch of comments. --- indra/cmake/Copy3rdPartyLibs.cmake | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index e7b5d097d3..9eb19b3547 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -6,6 +6,9 @@ include(CMakeCopyIfDifferent) +################################################################### +# set up platform specific lists of files that need to be copied +################################################################### if(WINDOWS) set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug") set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo") @@ -26,6 +29,7 @@ if(WINDOWS) # Misc shared 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-win32/lib/debug") set(debug_files openjpegd.dll @@ -36,6 +40,7 @@ if(WINDOWS) ) # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables + # or ARCH_PREBUILT_DIRS set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release") set(release_files openjpeg.dll @@ -127,16 +132,37 @@ if (MSVC80) endif (MSVC80) elseif(DARWIN) + set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug") + set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo") + set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release") + set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/universal-darwin") set(vivox_files + SLVoice + libalut.dylib + libopenal.dylib + libortp.dylib + libvivoxsdk.dylib ) # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables - set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib/debug") + # or ARCH_PREBUILT_DIRS + set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib_debug") set(debug_files ) # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables - set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib/release") + # or ARCH_PREBUILT_DIRS + set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib_release") set(release_files + libapr-1.0.3.7.dylib + libapr-1.0.3.8.dylib + libapr-1.dylib + libaprutil-1.0.3.8.dylib + libaprutil-1.0.3.9.dylib + libaprutil-1.dylib + libexpat.0.5.0.dylib + libexpat.dylib + libllqtwebkit.dylib + libndofdev.dylib ) # fmod is statically linked on darwin @@ -162,10 +188,12 @@ elseif(LINUX) set(vivox_files ) # *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") set(debug_files ) # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables + # or ARCH_PREBUILT_DIRS set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release") set(release_files ) @@ -194,9 +222,11 @@ else(WINDOWS) set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux") set(vivox_files "") # *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") set(debug_files "") # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables + # or ARCH_PREBUILT_DIRS set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release") set(release_files "") @@ -210,6 +240,10 @@ else(WINDOWS) endif(WINDOWS) +################################################################ +# Done building the file lists, now set up the copy commands. +################################################################ + copy_if_different( ${vivox_src_dir} "${SHARED_LIB_STAGING_DIR_DEBUG}" -- cgit v1.2.3 From 90ea3d3b35de1463a00d60a257bc5723bddf780e Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Mon, 2 Nov 2009 16:53:50 -0500 Subject: Implemented linux staging for DEV-41722 normalizing shared lib staging. --- indra/cmake/Copy3rdPartyLibs.cmake | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 9eb19b3547..995bf79406 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -184,18 +184,48 @@ elseif(DARWIN) endif (EXISTS "${release_src_dir}/libllkdu.dylib") endif (NOT EXISTS ${internal_llkdu_path}) elseif(LINUX) + # linux is weird, multiple side by side configurations aren't supported + # and we don't seem to have any debug shared libs built yet anyways... + set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}") + set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}") + set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}") + set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux") set(vivox_files + libalut.so + libopenal.so.1 + libortp.so + libvivoxsdk.so + SLVoice ) # *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") + set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib_debug") set(debug_files ) # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables # or ARCH_PREBUILT_DIRS - set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release") + set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib_release_client") + # *FIX - figure out what to do with duplicate libalut.so here -brad set(release_files + libapr-1.so + libaprutil-1.so + libatk-1.0.so + libcrypto.so + libexpat.so + libgmock_main.so + libgmock.so + libgmodule-2.0.so + libgobject-2.0.so + libgtest_main.so + libgtest.so + libopenal.so + libopenjpeg.so + libssl.so + libstacktrace.so + libtcmalloc.so + libuuid.so + libz.so ) if (FMOD_SDK_DIR) -- cgit v1.2.3 From f9c4682fb3ef489a1f22472b1295ca596626f78a Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Tue, 3 Nov 2009 18:35:36 -0500 Subject: Continuing work on DEV-41724/DEV-41725 normalizing shared lib staging. It's basically working on linux. --- indra/cmake/Copy3rdPartyLibs.cmake | 16 +++++++++------- indra/cmake/LLAddBuildTest.cmake | 13 ++++++++++--- indra/cmake/Linking.cmake | 5 ++++- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 995bf79406..b26d4cbefb 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -132,9 +132,9 @@ if (MSVC80) endif (MSVC80) elseif(DARWIN) - set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug") - set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo") - set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release") + set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug/Resources") + 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 "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/universal-darwin") set(vivox_files @@ -208,17 +208,18 @@ elseif(LINUX) set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib_release_client") # *FIX - figure out what to do with duplicate libalut.so here -brad set(release_files - libapr-1.so - libaprutil-1.so + libapr-1.so.0 + libaprutil-1.so.0 libatk-1.0.so libcrypto.so + libdb-4.2.so libexpat.so libgmock_main.so - libgmock.so + libgmock.so.0 libgmodule-2.0.so libgobject-2.0.so libgtest_main.so - libgtest.so + libgtest.so.0 libopenal.so libopenjpeg.so libssl.so @@ -226,6 +227,7 @@ elseif(LINUX) libtcmalloc.so libuuid.so libz.so + libssl.so.0.9.7 ) if (FMOD_SDK_DIR) diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index d8f64199cf..bf4d9b72a9 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -107,6 +107,8 @@ INCLUDE(GoogleMock) # Setup target ADD_EXECUTABLE(PROJECT_${project}_TEST_${name} ${${name}_test_SOURCE_FILES}) + SET_TARGET_PROPERTIES(PROJECT_${project}_TEST_${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${EXE_STAGING_DIR}) + # # Per-codefile additional / external project dep and lib dep property extraction # @@ -142,8 +144,10 @@ INCLUDE(GoogleMock) IF(WINDOWS) set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}) + ELSEIF(DARWIN) + set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources:/usr/lib) ELSE(WINDOWS) - set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}:/usr/lib) + set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}:/usr/lib) ENDIF(WINDOWS) LL_TEST_COMMAND("${LD_LIBRARY_PATH}" ${TEST_CMD}) @@ -200,6 +204,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST message(STATUS "ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})") endif(TEST_DEBUG) ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files}) + SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${EXE_STAGING_DIR}) # Add link deps to the executable if(TEST_DEBUG) @@ -230,8 +235,10 @@ FUNCTION(LL_ADD_INTEGRATION_TEST IF(WINDOWS) set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}) + ELSEIF(DARWIN) + set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources:/usr/lib) ELSE(WINDOWS) - set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}:/usr/lib) + set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}:/usr/lib) ENDIF(WINDOWS) LL_TEST_COMMAND("${LD_LIBRARY_PATH}" ${test_command}) @@ -250,4 +257,4 @@ FUNCTION(LL_ADD_INTEGRATION_TEST # Use CTEST? Not sure how to yet... # ADD_TEST(INTEGRATION_TEST_RUNNER_${testname} ${TEST_SCRIPT_CMD}) -ENDFUNCTION(LL_ADD_INTEGRATION_TEST) \ No newline at end of file +ENDFUNCTION(LL_ADD_INTEGRATION_TEST) diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 1f3553539f..cce73ba08b 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -6,6 +6,7 @@ if (NOT STANDALONE) set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release) set(ARCH_PREBUILT_DIRS_DEBUG ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/debug) set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged DLLs") + set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged executables") elseif (LINUX) if (VIEWER) set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release_client) @@ -14,12 +15,14 @@ if (NOT STANDALONE) endif (VIEWER) set(ARCH_PREBUILT_DIRS_RELEASE ${ARCH_PREBUILT_DIRS}) set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS}) - set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged .sos") + set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/lib CACHE FILEPATH "Location of staged .sos") + set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/bin CACHE FILEPATH "Location of staged executables") elseif (DARWIN) set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release) set(ARCH_PREBUILT_DIRS ${ARCH_PREBUILT_DIRS_RELEASE}) set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS_RELEASE}) set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged DLLs") + set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged executables") endif (WINDOWS) endif (NOT STANDALONE) -- cgit v1.2.3 From 4bff7b085381a514afb7e8546beaac5ad6117f9b Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Wed, 4 Nov 2009 18:50:35 -0500 Subject: Wrap-up work for DEV-41724/DEV-41725 - normalizing shared library staging on all 3 platforms. Should now work out of the box on all 3 platforms and in the debugger. --- indra/cmake/Linking.cmake | 2 +- indra/llcommon/CMakeLists.txt | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index cce73ba08b..bca99caf2a 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -22,7 +22,7 @@ if (NOT STANDALONE) set(ARCH_PREBUILT_DIRS ${ARCH_PREBUILT_DIRS_RELEASE}) set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS_RELEASE}) set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged DLLs") - set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged executables") + set(EXE_STAGING_DIR "${CMAKE_BINARY_DIR}/sharedlibs/\$(CONFIGURATION)" CACHE FILEPATH "Location of staged executables") endif (WINDOWS) endif (NOT STANDALONE) diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 7a7281a4a7..1e39a4474f 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -248,6 +248,13 @@ if(LLCOMMON_LINK_SHARED) if(NOT WINDOWS) get_target_property(LLCOMMON_PATH llcommon LOCATION) get_filename_component(LLCOMMON_FILE ${LLCOMMON_PATH} NAME) + if(DARWIN) + set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources) + else(DARWIN) + set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}) + endif(DARWIN) + + # *TODO - maybe make this a symbolic link? -brad add_custom_command( TARGET llcommon POST_BUILD COMMAND ${CMAKE_COMMAND} @@ -255,7 +262,7 @@ if(LLCOMMON_LINK_SHARED) -E copy_if_different ${LLCOMMON_PATH} - ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/${LLCOMMON_FILE} + ${SHARED_LIB_STAGING_DIR_CONFIG}/${LLCOMMON_FILE} COMMENT "Copying llcommon to the staging folder." ) endif(NOT WINDOWS) -- cgit v1.2.3 From ecd482d24b63d9658ac71d2bf4155e3ed9175bb9 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Thu, 5 Nov 2009 14:08:31 +0200 Subject: Implemented major sub-task EXT-2250 - Implement Classifieds list in Picks panel. --HG-- branch : product-engine --- indra/newview/llavatarpropertiesprocessor.cpp | 90 +++++- indra/newview/llavatarpropertiesprocessor.h | 50 ++- indra/newview/llpanelpicks.cpp | 344 +++++++++++++++++++-- indra/newview/llpanelpicks.h | 66 +++- indra/newview/llstartup.cpp | 5 +- .../skins/default/xui/en/menu_picks_plus.xml | 22 ++ .../newview/skins/default/xui/en/notifications.xml | 12 + .../default/xui/en/panel_classifieds_list_item.xml | 83 +++++ indra/newview/skins/default/xui/en/panel_picks.xml | 43 ++- 9 files changed, 685 insertions(+), 30 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/menu_picks_plus.xml create mode 100644 indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp index 73e24ca8e7..98a6a4b92a 100644 --- a/indra/newview/llavatarpropertiesprocessor.cpp +++ b/indra/newview/llavatarpropertiesprocessor.cpp @@ -158,6 +158,11 @@ void LLAvatarPropertiesProcessor::sendAvatarTexturesRequest(const LLUUID& avatar removePendingRequest(avatar_id, APT_TEXTURES); } +void LLAvatarPropertiesProcessor::sendAvatarClassifiedsRequest(const LLUUID& avatar_id) +{ + sendGenericRequest(avatar_id, APT_CLASSIFIEDS, "avatarclassifiedsrequest"); +} + void LLAvatarPropertiesProcessor::sendAvatarPropertiesUpdate(const LLAvatarData* avatar_props) { llinfos << "Sending avatarinfo update" << llendl; @@ -284,12 +289,60 @@ void LLAvatarPropertiesProcessor::processAvatarInterestsReply(LLMessageSystem* m */ } -void LLAvatarPropertiesProcessor::processAvatarClassifiedReply(LLMessageSystem* msg, void**) +void LLAvatarPropertiesProcessor::processAvatarClassifiedsReply(LLMessageSystem* msg, void**) { - // avatarclassifiedsrequest is not sent according to new UI design but - // keep this method according to resolved issues. + LLAvatarClassifieds classifieds; + + msg->getUUID(_PREHASH_AgentData, _PREHASH_AgentID, classifieds.agent_id); + msg->getUUID(_PREHASH_AgentData, _PREHASH_TargetID, classifieds.target_id); + + S32 block_count = msg->getNumberOfBlocks(_PREHASH_Data); + + for(int n = 0; n < block_count; ++n) + { + LLAvatarClassifieds::classified_data data; + + msg->getUUID(_PREHASH_Data, _PREHASH_ClassifiedID, data.classified_id, n); + msg->getString(_PREHASH_Data, _PREHASH_Name, data.name, n); + + classifieds.classifieds_list.push_back(data); + } + + LLAvatarPropertiesProcessor* self = getInstance(); + // Request processed, no longer pending + self->removePendingRequest(classifieds.target_id, APT_CLASSIFIEDS); + self->notifyObservers(classifieds.target_id,&classifieds,APT_CLASSIFIEDS); } +void LLAvatarPropertiesProcessor::processClassifiedInfoReply(LLMessageSystem* msg, void**) +{ + LLAvatarClassifiedInfo c_info; + + msg->getUUID(_PREHASH_AgentData, _PREHASH_AgentID, c_info.agent_id); + + msg->getUUID(_PREHASH_Data, _PREHASH_ClassifiedID, c_info.classified_id); + msg->getUUID(_PREHASH_Data, _PREHASH_CreatorID, c_info.creator_id); + msg->getU32(_PREHASH_Data, _PREHASH_CreationDate, c_info.creation_date); + msg->getU32(_PREHASH_Data, _PREHASH_ExpirationDate, c_info.expiration_date); + msg->getU32(_PREHASH_Data, _PREHASH_Category, c_info.category); + msg->getString(_PREHASH_Data, _PREHASH_Name, c_info.name); + msg->getString(_PREHASH_Data, _PREHASH_Desc, c_info.description); + msg->getUUID(_PREHASH_Data, _PREHASH_ParcelID, c_info.parcel_id); + msg->getU32(_PREHASH_Data, _PREHASH_ParentEstate, c_info.parent_estate); + msg->getUUID(_PREHASH_Data, _PREHASH_SnapshotID, c_info.snapshot_id); + msg->getString(_PREHASH_Data, _PREHASH_SimName, c_info.sim_name); + msg->getVector3d(_PREHASH_Data, _PREHASH_PosGlobal, c_info.pos_global); + msg->getString(_PREHASH_Data, _PREHASH_ParcelName, c_info.parcel_name); + msg->getU8(_PREHASH_Data, _PREHASH_ClassifiedFlags, c_info.classified_flags); + msg->getS32(_PREHASH_Data, _PREHASH_PriceForListing, c_info.price_for_listing); + + LLAvatarPropertiesProcessor* self = getInstance(); + // Request processed, no longer pending + self->removePendingRequest(c_info.agent_id, APT_CLASSIFIED_INFO); + self->notifyObservers(c_info.agent_id, &c_info, APT_CLASSIFIED_INFO); +} + + void LLAvatarPropertiesProcessor::processAvatarNotesReply(LLMessageSystem* msg, void**) { LLAvatarNotes avatar_notes; @@ -451,6 +504,22 @@ void LLAvatarPropertiesProcessor::sendPickDelete( const LLUUID& pick_id ) LLAgentPicksInfo::getInstance()->decrementNumberOfPicks(); } +void LLAvatarPropertiesProcessor::sendClassifiedDelete(const LLUUID& classified_id) +{ + LLMessageSystem* msg = gMessageSystem; + + msg->newMessage(_PREHASH_ClassifiedDelete); + + msg->nextBlock(_PREHASH_AgentData); + msg->addUUID(_PREHASH_AgentID, gAgent.getID()); + msg->addUUID(_PREHASH_SessionID, gAgent.getSessionID()); + + msg->nextBlock(_PREHASH_Data); + msg->addUUID(_PREHASH_ClassifiedID, classified_id); + + gAgent.sendReliableMessage(); +} + void LLAvatarPropertiesProcessor::sendPickInfoUpdate(const LLPickData* new_pick) { if (!new_pick) return; @@ -495,6 +564,21 @@ void LLAvatarPropertiesProcessor::sendPickInfoRequest(const LLUUID& creator_id, send_generic_message("pickinforequest", request_params); } +void LLAvatarPropertiesProcessor::sendClassifiedInfoRequest(const LLUUID& avatar_id, const LLUUID& classified_id) +{ + LLMessageSystem* msg = gMessageSystem; + + msg->newMessage(_PREHASH_ClassifiedInfoRequest); + msg->nextBlock(_PREHASH_AgentData); + + msg->addUUID(_PREHASH_AgentID, gAgent.getID()); + msg->addUUID(_PREHASH_SessionID, gAgent.getSessionID()); + + msg->nextBlock(_PREHASH_Data); + msg->addUUID(_PREHASH_ClassifiedID, classified_id); + + gAgent.sendReliableMessage(); +} bool LLAvatarPropertiesProcessor::isPendingRequest(const LLUUID& avatar_id, EAvatarProcessorType type) { diff --git a/indra/newview/llavatarpropertiesprocessor.h b/indra/newview/llavatarpropertiesprocessor.h index e6563024b2..3c6b4e17d9 100644 --- a/indra/newview/llavatarpropertiesprocessor.h +++ b/indra/newview/llavatarpropertiesprocessor.h @@ -53,7 +53,9 @@ enum EAvatarProcessorType APT_GROUPS, APT_PICKS, APT_PICK_INFO, - APT_TEXTURES + APT_TEXTURES, + APT_CLASSIFIEDS, + APT_CLASSIFIED_INFO }; struct LLAvatarData @@ -136,6 +138,43 @@ struct LLAvatarGroups }; }; +struct LLAvatarClassifieds +{ + LLUUID agent_id; + LLUUID target_id; + + struct classified_data; + typedef std::list classifieds_list_t; + + classifieds_list_t classifieds_list; + + struct classified_data + { + LLUUID classified_id; + std::string name; + }; +}; + +struct LLAvatarClassifiedInfo +{ + LLUUID agent_id; + LLUUID classified_id; + LLUUID creator_id; + U32 creation_date; + U32 expiration_date; + U32 category; + std::string name; + std::string description; + LLUUID parcel_id; + U32 parent_estate; + LLUUID snapshot_id; + std::string sim_name; + LLVector3d pos_global; + std::string parcel_name; + U8 classified_flags; + S32 price_for_listing; +}; + class LLAvatarPropertiesObserver { public: @@ -162,10 +201,13 @@ public: void sendAvatarNotesRequest(const LLUUID& avatar_id); void sendAvatarGroupsRequest(const LLUUID& avatar_id); void sendAvatarTexturesRequest(const LLUUID& avatar_id); + void sendAvatarClassifiedsRequest(const LLUUID& avatar_id); // Duplicate pick info requests are not suppressed. void sendPickInfoRequest(const LLUUID& creator_id, const LLUUID& pick_id); + void sendClassifiedInfoRequest(const LLUUID& avatar_id, const LLUUID& classified_id); + void sendAvatarPropertiesUpdate(const LLAvatarData* avatar_props); void sendPickInfoUpdate(const LLPickData* new_pick); @@ -176,6 +218,8 @@ public: void sendPickDelete(const LLUUID& pick_id); + void sendClassifiedDelete(const LLUUID& classified_id); + // Returns translated, human readable string for account type, such // as "Resident" or "Linden Employee". Used for profiles, inspectors. static std::string accountType(const LLAvatarData* avatar_data); @@ -189,7 +233,9 @@ public: static void processAvatarInterestsReply(LLMessageSystem* msg, void**); - static void processAvatarClassifiedReply(LLMessageSystem* msg, void**); + static void processAvatarClassifiedsReply(LLMessageSystem* msg, void**); + + static void processClassifiedInfoReply(LLMessageSystem* msg, void**); static void processAvatarGroupsReply(LLMessageSystem* msg, void**); diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 6181531f82..526c604bb4 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -45,6 +45,8 @@ #include "llviewermenu.h" #include "llregistry.h" +#include "llaccordionctrl.h" +#include "llaccordionctrltab.h" #include "llpanelpicks.h" #include "llavatarpropertiesprocessor.h" #include "llpanelavatar.h" @@ -62,6 +64,9 @@ static const std::string PICK_ID("pick_id"); static const std::string PICK_CREATOR_ID("pick_creator_id"); static const std::string PICK_NAME("pick_name"); +static const std::string CLASSIFIED_ID("classified_id"); +static const std::string CLASSIFIED_NAME("classified_name"); + static LLRegisterPanelClassWrapper t_panel_picks("panel_picks"); @@ -74,9 +79,13 @@ LLPanelPicks::LLPanelPicks() mProfilePanel(NULL), mPickPanel(NULL), mPicksList(NULL), + mClassifiedsList(NULL), mPanelPickInfo(NULL), mPanelPickEdit(NULL), - mOverflowMenu(NULL) + mOverflowMenu(NULL), + mPlusMenu(NULL), + mPicksAccTab(NULL), + mClassifiedsAccTab(NULL) { } @@ -100,6 +109,9 @@ void LLPanelPicks::updateData() { mPicksList->clear(); LLAvatarPropertiesProcessor::getInstance()->sendAvatarPicksRequest(getAvatarId()); + + mClassifiedsList->clear(); + LLAvatarPropertiesProcessor::getInstance()->sendAvatarClassifiedsRequest(getAvatarId()); } } @@ -138,13 +150,47 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) mPicksList->addItem(picture, pick_value); - picture->setDoubleClickCallback(boost::bind(&LLPanelPicks::onDoubleClickItem, this, _1)); + picture->setDoubleClickCallback(boost::bind(&LLPanelPicks::onDoubleClickPickItem, this, _1)); picture->setRightMouseUpCallback(boost::bind(&LLPanelPicks::onRightMouseUpItem, this, _1, _2, _3, _4)); picture->setMouseUpCallback(boost::bind(&LLPanelPicks::updateButtons, this)); } + showAccordion("tab_picks", mPicksList->size()); + + resetDirty(); + updateButtons(); + } + } + else if(APT_CLASSIFIEDS == type) + { + LLAvatarClassifieds* c_info = static_cast(data); + if(c_info && getAvatarId() == c_info->target_id) + { + mClassifiedsList->clear(); + + LLAvatarClassifieds::classifieds_list_t::const_iterator it = c_info->classifieds_list.begin(); + for(; c_info->classifieds_list.end() != it; ++it) + { + LLAvatarClassifieds::classified_data c_data = *it; + + LLClassifiedItem* c_item = new LLClassifiedItem(getAvatarId(), c_data.classified_id); + c_item->childSetAction("info_chevron", boost::bind(&LLPanelPicks::onClickInfo, this)); + c_item->setName(c_data.name); + + LLSD pick_value = LLSD(); + pick_value.insert(CLASSIFIED_ID, c_data.classified_id); + pick_value.insert(CLASSIFIED_NAME, c_data.name); + + mClassifiedsList->addItem(c_item, pick_value); + + c_item->setDoubleClickCallback(boost::bind(&LLPanelPicks::onDoubleClickClassifiedItem, this, _1)); + c_item->setRightMouseUpCallback(boost::bind(&LLPanelPicks::onRightMouseUpItem, this, _1, _2, _3, _4)); + c_item->setMouseUpCallback(boost::bind(&LLPanelPicks::updateButtons, this)); + } + + showAccordion("tab_classifieds", mClassifiedsList->size()); + resetDirty(); - LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this); updateButtons(); } } @@ -158,16 +204,44 @@ LLPickItem* LLPanelPicks::getSelectedPickItem() return dynamic_cast(selected_item); } +LLClassifiedItem* LLPanelPicks::getSelectedClassifiedItem() +{ + LLPanel* selected_item = mClassifiedsList->getSelectedItem(); + if (!selected_item) + { + return NULL; + } + return dynamic_cast(selected_item); +} + BOOL LLPanelPicks::postBuild() { mPicksList = getChild("picks_list"); + mClassifiedsList = getChild("classifieds_list"); + + mPicksList->setCommitOnSelectionChange(true); + mClassifiedsList->setCommitOnSelectionChange(true); + + mPicksList->setCommitCallback(boost::bind(&LLPanelPicks::onListCommit, this, mPicksList)); + mClassifiedsList->setCommitCallback(boost::bind(&LLPanelPicks::onListCommit, this, mClassifiedsList)); - childSetAction(XML_BTN_NEW, boost::bind(&LLPanelPicks::onClickNew, this)); + mPicksList->setNoItemsCommentText(getString("no_picks")); + mClassifiedsList->setNoItemsCommentText(getString("no_classifieds")); + + childSetAction(XML_BTN_NEW, boost::bind(&LLPanelPicks::onClickPlusBtn, this)); childSetAction(XML_BTN_DELETE, boost::bind(&LLPanelPicks::onClickDelete, this)); childSetAction(XML_BTN_TELEPORT, boost::bind(&LLPanelPicks::onClickTeleport, this)); childSetAction(XML_BTN_SHOW_ON_MAP, boost::bind(&LLPanelPicks::onClickMap, this)); childSetAction(XML_BTN_INFO, boost::bind(&LLPanelPicks::onClickInfo, this)); childSetAction(XML_BTN_OVERFLOW, boost::bind(&LLPanelPicks::onOverflowButtonClicked, this)); + + mPicksAccTab = getChild("tab_picks"); + mPicksAccTab->setDropDownStateChangedCallback(boost::bind(&LLPanelPicks::onAccordionStateChanged, this, mPicksAccTab)); + mPicksAccTab->setDisplayChildren(true); + + mClassifiedsAccTab = getChild("tab_classifieds"); + mClassifiedsAccTab->setDropDownStateChangedCallback(boost::bind(&LLPanelPicks::onAccordionStateChanged, this, mClassifiedsAccTab)); + mClassifiedsAccTab->setDisplayChildren(false); LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registar; registar.add("Pick.Info", boost::bind(&LLPanelPicks::onClickInfo, this)); @@ -180,6 +254,10 @@ BOOL LLPanelPicks::postBuild() LLUICtrl::CommitCallbackRegistry::ScopedRegistrar overflow_registar; overflow_registar.add("PicksList.Overflow", boost::bind(&LLPanelPicks::onOverflowMenuItemClicked, this, _2)); mOverflowMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_picks_overflow.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar plus_registar; + plus_registar.add("Picks.Plus.Action", boost::bind(&LLPanelPicks::onPlusMenuItemClicked, this, _2)); + mPlusMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_picks_plus.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); return TRUE; } @@ -202,6 +280,50 @@ void LLPanelPicks::onOverflowMenuItemClicked(const LLSD& param) } } +void LLPanelPicks::onPlusMenuItemClicked(const LLSD& param) +{ + std::string value = param.asString(); + + if("new_pick" == value) + { + createNewPick(); + } + else if("new_classified" == value) + { + createNewClassified(); + } +} + +void LLPanelPicks::onAccordionStateChanged(const LLAccordionCtrlTab* acc_tab) +{ + if(acc_tab->getDisplayChildren()) + { + if(acc_tab != mPicksAccTab && mPicksAccTab->getDisplayChildren()) + { + mPicksAccTab->setDisplayChildren(false); + } + + if(acc_tab != mClassifiedsAccTab && mClassifiedsAccTab->getDisplayChildren()) + { + mClassifiedsAccTab->setDisplayChildren(false); + } + + LLAccordionCtrl* accordion = getChild("accordion"); + accordion->arrange(); + } + + if(!mPicksAccTab->getDisplayChildren()) + { + mPicksList->resetSelection(true); + } + if(!mClassifiedsAccTab->getDisplayChildren()) + { + mClassifiedsList->resetSelection(true); + } + + updateButtons(); +} + void LLPanelPicks::onOverflowButtonClicked() { LLRect rect; @@ -250,21 +372,50 @@ void LLPanelPicks::onOpen(const LLSD& key) LLPanelProfileTab::onOpen(key); } +void LLPanelPicks::onListCommit(const LLFlatListView* f_list) +{ + // Make sure only one of the lists has selection. + if(f_list == mPicksList) + { + mClassifiedsList->resetSelection(true); + } + else if(f_list == mClassifiedsList) + { + mPicksList->resetSelection(true); + } + else + { + llwarns << "Unknown list" << llendl; + } + + updateButtons(); +} + //static void LLPanelPicks::onClickDelete() { - LLSD pick_value = mPicksList->getSelectedValue(); - if (pick_value.isUndefined()) return; + LLSD value = mPicksList->getSelectedValue(); + if (value.isDefined()) + { + LLSD args; + args["PICK"] = value[PICK_NAME]; + LLNotifications::instance().add("DeleteAvatarPick", args, LLSD(), boost::bind(&LLPanelPicks::callbackDeletePick, this, _1, _2)); + return; + } - LLSD args; - args["PICK"] = pick_value[PICK_NAME]; - LLNotifications::instance().add("DeleteAvatarPick", args, LLSD(), boost::bind(&LLPanelPicks::callbackDelete, this, _1, _2)); + value = mClassifiedsList->getSelectedValue(); + if(value.isDefined()) + { + LLSD args; + args["NAME"] = value[CLASSIFIED_NAME]; + LLNotifications::instance().add("DeleteClassified", args, LLSD(), boost::bind(&LLPanelPicks::callbackDeleteClassified, this, _1, _2)); + return; + } } -bool LLPanelPicks::callbackDelete(const LLSD& notification, const LLSD& response) +bool LLPanelPicks::callbackDeletePick(const LLSD& notification, const LLSD& response) { S32 option = LLNotification::getSelectedOption(notification, response); - LLSD pick_value = mPicksList->getSelectedValue(); if (0 == option) @@ -276,6 +427,20 @@ bool LLPanelPicks::callbackDelete(const LLSD& notification, const LLSD& response return false; } +bool LLPanelPicks::callbackDeleteClassified(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotification::getSelectedOption(notification, response); + LLSD value = mClassifiedsList->getSelectedValue(); + + if (0 == option) + { + LLAvatarPropertiesProcessor::instance().sendClassifiedDelete(value[CLASSIFIED_ID]); + mClassifiedsList->removeItemByValue(value); + } + updateButtons(); + return false; +} + bool LLPanelPicks::callbackTeleport( const LLSD& notification, const LLSD& response ) { S32 option = LLNotification::getSelectedOption(notification, response); @@ -291,9 +456,14 @@ bool LLPanelPicks::callbackTeleport( const LLSD& notification, const LLSD& respo void LLPanelPicks::onClickTeleport() { LLPickItem* pick_item = getSelectedPickItem(); - if (!pick_item) return; + LLClassifiedItem* c_item = getSelectedClassifiedItem(); + + LLVector3d pos; + if(pick_item) + pos = pick_item->getPosGlobal(); + else if(c_item) + pos = c_item->getPosGlobal(); - LLVector3d pos = pick_item->getPosGlobal(); if (!pos.isExactlyZero()) { gAgent.teleportViaLocation(pos); @@ -305,9 +475,15 @@ void LLPanelPicks::onClickTeleport() void LLPanelPicks::onClickMap() { LLPickItem* pick_item = getSelectedPickItem(); - if (!pick_item) return; + LLClassifiedItem* c_item = getSelectedClassifiedItem(); + + LLVector3d pos; + if (pick_item) + pos = pick_item->getPosGlobal(); + else if(c_item) + pos = c_item->getPosGlobal(); - LLFloaterWorldMap::getInstance()->trackLocation(pick_item->getPosGlobal()); + LLFloaterWorldMap::getInstance()->trackLocation(pos); LLFloaterReg::showInstance("world_map", "center"); } @@ -325,7 +501,7 @@ void LLPanelPicks::onRightMouseUpItem(LLUICtrl* item, S32 x, S32 y, MASK mask) } } -void LLPanelPicks::onDoubleClickItem(LLUICtrl* item) +void LLPanelPicks::onDoubleClickPickItem(LLUICtrl* item) { LLSD pick_value = mPicksList->getSelectedValue(); if (pick_value.isUndefined()) return; @@ -335,9 +511,19 @@ void LLPanelPicks::onDoubleClickItem(LLUICtrl* item) LLNotifications::instance().add("TeleportToPick", args, LLSD(), boost::bind(&LLPanelPicks::callbackTeleport, this, _1, _2)); } +void LLPanelPicks::onDoubleClickClassifiedItem(LLUICtrl* item) +{ + LLSD value = mClassifiedsList->getSelectedValue(); + if (value.isUndefined()) return; + + LLSD args; + args["CLASSIFIED"] = value[CLASSIFIED_NAME]; + LLNotifications::instance().add("TeleportToClassified", args, LLSD(), boost::bind(&LLPanelPicks::callbackTeleport, this, _1, _2)); +} + void LLPanelPicks::updateButtons() { - bool has_selected = mPicksList->numSelected(); + bool has_selected = mPicksList->numSelected() > 0 || mClassifiedsList->numSelected() > 0; if (getAvatarId() == gAgentID) { @@ -366,14 +552,41 @@ void LLPanelPicks::buildPickPanel() // } } -void LLPanelPicks::onClickNew() +void LLPanelPicks::onClickPlusBtn() +{ + LLRect rect; + childGetRect(XML_BTN_NEW, rect); + + mPlusMenu->updateParent(LLMenuGL::sMenuContainer); + mPlusMenu->setButtonRect(rect, this); + LLMenuGL::showPopup(this, mPlusMenu, rect.mLeft, rect.mTop); +} + +void LLPanelPicks::createNewPick() { createPickEditPanel(); getProfilePanel()->openPanel(mPanelPickEdit, LLSD()); } +void LLPanelPicks::createNewClassified() +{ + LLNotifications::instance().add("ClickUnimplemented"); +} + void LLPanelPicks::onClickInfo() +{ + if(mPicksList->numSelected() > 0) + { + openPickInfo(); + } + else if(mClassifiedsList->numSelected() > 0) + { + openClassifiedInfo(); + } +} + +void LLPanelPicks::openPickInfo() { LLSD selected_value = mPicksList->getSelectedValue(); if (selected_value.isUndefined()) return; @@ -392,6 +605,19 @@ void LLPanelPicks::onClickInfo() getProfilePanel()->openPanel(mPanelPickInfo, params); } +void LLPanelPicks::openClassifiedInfo() +{ + LLNotifications::instance().add("ClickUnimplemented"); +} + +void LLPanelPicks::showAccordion(const std::string& name, bool show) +{ + LLAccordionCtrlTab* tab = getChild(name); + tab->setVisible(show); + LLAccordionCtrl* acc = getChild("accordion"); + acc->arrange(); +} + void LLPanelPicks::onPanelPickClose(LLPanel* panel) { panel->setVisible(FALSE); @@ -475,7 +701,14 @@ void LLPanelPicks::onPanelPickEdit() void LLPanelPicks::onClickMenuEdit() { - onPanelPickEdit(); + if(getSelectedPickItem()) + { + onPanelPickEdit(); + } + else if(getSelectedClassifiedItem()) + { + LLNotifications::instance().add("ClickUnimplemented"); + } } inline LLPanelProfile* LLPanelPicks::getProfilePanel() @@ -610,3 +843,76 @@ void LLPickItem::setValue(const LLSD& value) if (!value.has("selected")) return; childSetVisible("selected_icon", value["selected"]); } + +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// + +LLClassifiedItem::LLClassifiedItem(const LLUUID& avatar_id, const LLUUID& classified_id) + : LLPanel() + , mAvatarId(avatar_id) + , mClassifiedId(classified_id) +{ + LLUICtrlFactory::getInstance()->buildPanel(this,"panel_classifieds_list_item.xml"); + + LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this); + LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getAvatarId(), getClassifiedId()); +} + +LLClassifiedItem::~LLClassifiedItem() +{ + LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this); +} + +void LLClassifiedItem::processProperties(void* data, EAvatarProcessorType type) +{ + if(APT_CLASSIFIED_INFO != type) + { + return; + } + + LLAvatarClassifiedInfo* c_info = static_cast(data); + if( !(c_info && c_info->agent_id == getAvatarId() + && c_info->classified_id == getClassifiedId()) ) + { + return; + } + + setName(c_info->name); + setDescription(c_info->description); + setSnapshotId(c_info->snapshot_id); + setPosGlobal(c_info->pos_global); + + LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this); +} + +BOOL LLClassifiedItem::postBuild() +{ + setMouseEnterCallback(boost::bind(&LLPanelPickInfo::childSetVisible, this, "hovered_icon", true)); + setMouseLeaveCallback(boost::bind(&LLPanelPickInfo::childSetVisible, this, "hovered_icon", false)); + return TRUE; +} + +void LLClassifiedItem::setValue(const LLSD& value) +{ + if (!value.isMap()) return;; + if (!value.has("selected")) return; + childSetVisible("selected_icon", value["selected"]); +} + +void LLClassifiedItem::setName(const std::string& name) +{ + childSetValue("name", name); +} + +void LLClassifiedItem::setDescription(const std::string& desc) +{ + childSetValue("description", desc); +} + +void LLClassifiedItem::setSnapshotId(const LLUUID& snapshot_id) +{ + childSetValue("picture", snapshot_id); +} + +//EOF diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index 06a0f0a0fd..d6321a475c 100644 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -40,6 +40,7 @@ #include "llpanelavatar.h" #include "llregistry.h" +class LLAccordionCtrlTab; class LLPanelProfile; class LLMessageSystem; class LLVector3d; @@ -47,6 +48,7 @@ class LLPanelProfileTab; class LLAgent; class LLMenuGL; class LLPickItem; +class LLClassifiedItem; class LLFlatListView; class LLPanelPickInfo; class LLPanelPickEdit; @@ -71,6 +73,7 @@ public: // returns the selected pick item LLPickItem* getSelectedPickItem(); + LLClassifiedItem* getSelectedClassifiedItem(); //*NOTE top down approch when panel toggling is done only by // parent panels failed to work (picks related code was in me profile panel) @@ -83,25 +86,39 @@ private: void onOverflowMenuItemClicked(const LLSD& param); void onOverflowButtonClicked(); + void onPlusMenuItemClicked(const LLSD& param); + + void onListCommit(const LLFlatListView* f_list); + void onAccordionStateChanged(const LLAccordionCtrlTab* acc_tab); //------------------------------------------------ // Callbacks which require panel toggling //------------------------------------------------ - void onClickNew(); + void onClickPlusBtn(); void onClickInfo(); void onPanelPickClose(LLPanel* panel); void onPanelPickSave(LLPanel* panel); void onPanelPickEdit(); void onClickMenuEdit(); + void createNewPick(); + void createNewClassified(); + + void openPickInfo(); + void openClassifiedInfo(); + + void showAccordion(const std::string& name, bool show); + void buildPickPanel(); - bool callbackDelete(const LLSD& notification, const LLSD& response); + bool callbackDeletePick(const LLSD& notification, const LLSD& response); + bool callbackDeleteClassified(const LLSD& notification, const LLSD& response); bool callbackTeleport(const LLSD& notification, const LLSD& response); void updateButtons(); - virtual void onDoubleClickItem(LLUICtrl* item); + virtual void onDoubleClickPickItem(LLUICtrl* item); + virtual void onDoubleClickClassifiedItem(LLUICtrl* item); virtual void onRightMouseUpItem(LLUICtrl* item, S32 x, S32 y, MASK mask); LLPanelProfile* getProfilePanel(); @@ -115,9 +132,14 @@ private: LLPanelProfile* mProfilePanel; LLPanelPickInfo* mPickPanel; LLFlatListView* mPicksList; + LLFlatListView* mClassifiedsList; LLPanelPickInfo* mPanelPickInfo; LLPanelPickEdit* mPanelPickEdit; LLToggleableMenu* mOverflowMenu; + LLToggleableMenu* mPlusMenu; + + LLAccordionCtrlTab* mPicksAccTab; + LLAccordionCtrlTab* mClassifiedsAccTab; }; class LLPickItem : public LLPanel, public LLAvatarPropertiesObserver @@ -189,4 +211,42 @@ protected: std::string mSimName; }; +class LLClassifiedItem : public LLPanel, public LLAvatarPropertiesObserver +{ +public: + + LLClassifiedItem(const LLUUID& avatar_id, const LLUUID& classified_id); + + virtual ~LLClassifiedItem(); + + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); + + /*virtual*/ BOOL postBuild(); + + /*virtual*/ void setValue(const LLSD& value); + + LLUUID getAvatarId() {return mAvatarId;} + + void setAvatarId(const LLUUID& avatar_id) {mAvatarId = avatar_id;} + + LLUUID getClassifiedId() {return mClassifiedId;} + + void setClassifiedId(const LLUUID& classified_id) {mClassifiedId = classified_id;} + + void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; } + + const LLVector3d& getPosGlobal() { return mPosGlobal; } + + void setName (const std::string& name); + + void setDescription(const std::string& desc); + + void setSnapshotId(const LLUUID& snapshot_id); + +private: + LLUUID mAvatarId; + LLUUID mClassifiedId; + LLVector3d mPosGlobal; +}; + #endif // LL_LLPANELPICKS_H diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 9aa74e8b9f..0ffea6d600 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2469,7 +2469,7 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFunc("AvatarPicksReply", &LLAvatarPropertiesProcessor::processAvatarPicksReply); msg->setHandlerFunc("AvatarClassifiedReply", - &LLAvatarPropertiesProcessor::processAvatarClassifiedReply); + &LLAvatarPropertiesProcessor::processAvatarClassifiedsReply); msg->setHandlerFuncFast(_PREHASH_CreateGroupReply, LLGroupMgr::processCreateGroupReply); @@ -2535,7 +2535,8 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFunc("EventInfoReply", LLPanelEvent::processEventInfoReply); msg->setHandlerFunc("PickInfoReply", &LLAvatarPropertiesProcessor::processPickInfoReply); - msg->setHandlerFunc("ClassifiedInfoReply", LLPanelClassified::processClassifiedInfoReply); +// msg->setHandlerFunc("ClassifiedInfoReply", LLPanelClassified::processClassifiedInfoReply); + msg->setHandlerFunc("ClassifiedInfoReply", LLAvatarPropertiesProcessor::processClassifiedInfoReply); msg->setHandlerFunc("ParcelInfoReply", LLRemoteParcelInfoProcessor::processParcelInfoReply); msg->setHandlerFunc("ScriptDialog", process_script_dialog); msg->setHandlerFunc("LoadURL", process_load_url); diff --git a/indra/newview/skins/default/xui/en/menu_picks_plus.xml b/indra/newview/skins/default/xui/en/menu_picks_plus.xml new file mode 100644 index 0000000000..3065239615 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_picks_plus.xml @@ -0,0 +1,22 @@ + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index babed28f10..d479acb20c 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3050,6 +3050,18 @@ Teleport to [PICK]? yestext="Teleport"/> + + Teleport to [CLASSIFIED]? + + + + + + + + + + - - + width="18" /> + + + + + + + + + + + + + + + + + + + + + + Date: Mon, 9 Nov 2009 13:17:37 +0200 Subject: fixed bug EXT-2016 Place Profile panel isn't resized --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_place_profile.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/panel_place_profile.xml b/indra/newview/skins/default/xui/en/panel_place_profile.xml index b5ae05fe6c..d3eb548207 100644 --- a/indra/newview/skins/default/xui/en/panel_place_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_place_profile.xml @@ -172,7 +172,7 @@ width="313"> Date: Mon, 9 Nov 2009 13:55:55 +0200 Subject: Fixed low bug EXT-2319 - Unable to save new Pick. --HG-- branch : product-engine --- indra/newview/llpanelpick.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index 103f041686..726c47b678 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -438,7 +438,8 @@ void LLPanelPickEdit::resetDirty() BOOL LLPanelPickEdit::isDirty() const { - if( LLPanelPickInfo::isDirty() + if( mNewPick + || LLPanelPickInfo::isDirty() || mLocationChanged || mSnapshotCtrl->isDirty() || getChild("pick_name")->isDirty() -- cgit v1.2.3 From cd328841106734938dd747e9a7fd2575cd6c1b85 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Mon, 9 Nov 2009 14:44:56 +0200 Subject: Update for major task EXT-2250 Classifieds list in Picks panel. Fixed viewing classifieds of other avatars. --HG-- branch : product-engine --- indra/newview/llavatarpropertiesprocessor.cpp | 8 ++++---- indra/newview/llavatarpropertiesprocessor.h | 4 ++-- indra/newview/llpanelpicks.cpp | 19 +++++++++++++------ indra/newview/llpanelpicks.h | 8 +++++++- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp index 98a6a4b92a..2942e436ef 100644 --- a/indra/newview/llavatarpropertiesprocessor.cpp +++ b/indra/newview/llavatarpropertiesprocessor.cpp @@ -333,13 +333,13 @@ void LLAvatarPropertiesProcessor::processClassifiedInfoReply(LLMessageSystem* ms msg->getString(_PREHASH_Data, _PREHASH_SimName, c_info.sim_name); msg->getVector3d(_PREHASH_Data, _PREHASH_PosGlobal, c_info.pos_global); msg->getString(_PREHASH_Data, _PREHASH_ParcelName, c_info.parcel_name); - msg->getU8(_PREHASH_Data, _PREHASH_ClassifiedFlags, c_info.classified_flags); + msg->getU8(_PREHASH_Data, _PREHASH_ClassifiedFlags, c_info.flags); msg->getS32(_PREHASH_Data, _PREHASH_PriceForListing, c_info.price_for_listing); LLAvatarPropertiesProcessor* self = getInstance(); // Request processed, no longer pending - self->removePendingRequest(c_info.agent_id, APT_CLASSIFIED_INFO); - self->notifyObservers(c_info.agent_id, &c_info, APT_CLASSIFIED_INFO); + self->removePendingRequest(c_info.creator_id, APT_CLASSIFIED_INFO); + self->notifyObservers(c_info.creator_id, &c_info, APT_CLASSIFIED_INFO); } @@ -564,7 +564,7 @@ void LLAvatarPropertiesProcessor::sendPickInfoRequest(const LLUUID& creator_id, send_generic_message("pickinforequest", request_params); } -void LLAvatarPropertiesProcessor::sendClassifiedInfoRequest(const LLUUID& avatar_id, const LLUUID& classified_id) +void LLAvatarPropertiesProcessor::sendClassifiedInfoRequest(const LLUUID& classified_id) { LLMessageSystem* msg = gMessageSystem; diff --git a/indra/newview/llavatarpropertiesprocessor.h b/indra/newview/llavatarpropertiesprocessor.h index 3c6b4e17d9..64964b1665 100644 --- a/indra/newview/llavatarpropertiesprocessor.h +++ b/indra/newview/llavatarpropertiesprocessor.h @@ -171,7 +171,7 @@ struct LLAvatarClassifiedInfo std::string sim_name; LLVector3d pos_global; std::string parcel_name; - U8 classified_flags; + U8 flags; S32 price_for_listing; }; @@ -206,7 +206,7 @@ public: // Duplicate pick info requests are not suppressed. void sendPickInfoRequest(const LLUUID& creator_id, const LLUUID& pick_id); - void sendClassifiedInfoRequest(const LLUUID& avatar_id, const LLUUID& classified_id); + void sendClassifiedInfoRequest(const LLUUID& classified_id); void sendAvatarPropertiesUpdate(const LLAvatarData* avatar_props); diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 88c1d17a02..78f8152b10 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -175,7 +175,7 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) LLClassifiedItem* c_item = new LLClassifiedItem(getAvatarId(), c_data.classified_id); c_item->childSetAction("info_chevron", boost::bind(&LLPanelPicks::onClickInfo, this)); - c_item->setName(c_data.name); + c_item->setClassifiedName(c_data.name); LLSD pick_value = LLSD(); pick_value.insert(CLASSIFIED_ID, c_data.classified_id); @@ -364,6 +364,9 @@ void LLPanelPicks::onOpen(const LLSD& key) if(getAvatarId() != id) { + showAccordion("tab_picks", false); + showAccordion("tab_classifieds", false); + mPicksList->goToTop(); // Set dummy value to make panel dirty and make it reload picks setValue(LLSD()); @@ -856,7 +859,7 @@ LLClassifiedItem::LLClassifiedItem(const LLUUID& avatar_id, const LLUUID& classi LLUICtrlFactory::getInstance()->buildPanel(this,"panel_classifieds_list_item.xml"); LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this); - LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getAvatarId(), getClassifiedId()); + LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId()); } LLClassifiedItem::~LLClassifiedItem() @@ -872,13 +875,12 @@ void LLClassifiedItem::processProperties(void* data, EAvatarProcessorType type) } LLAvatarClassifiedInfo* c_info = static_cast(data); - if( !(c_info && c_info->agent_id == getAvatarId() - && c_info->classified_id == getClassifiedId()) ) + if( !c_info || c_info->classified_id != getClassifiedId() ) { return; } - setName(c_info->name); + setClassifiedName(c_info->name); setDescription(c_info->description); setSnapshotId(c_info->snapshot_id); setPosGlobal(c_info->pos_global); @@ -900,7 +902,7 @@ void LLClassifiedItem::setValue(const LLSD& value) childSetVisible("selected_icon", value["selected"]); } -void LLClassifiedItem::setName(const std::string& name) +void LLClassifiedItem::setClassifiedName(const std::string& name) { childSetValue("name", name); } @@ -915,4 +917,9 @@ void LLClassifiedItem::setSnapshotId(const LLUUID& snapshot_id) childSetValue("picture", snapshot_id); } +LLUUID LLClassifiedItem::getSnapshotId() +{ + return childGetValue("picture"); +} + //EOF diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index ef7ba9e700..daf8059fee 100644 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -237,12 +237,18 @@ public: const LLVector3d& getPosGlobal() { return mPosGlobal; } - void setName (const std::string& name); + void setClassifiedName (const std::string& name); + + std::string getClassifiedName() { return childGetValue("name").asString(); } void setDescription(const std::string& desc); + std::string getDescription() { return childGetValue("description").asString(); } + void setSnapshotId(const LLUUID& snapshot_id); + LLUUID getSnapshotId(); + private: LLUUID mAvatarId; LLUUID mClassifiedId; -- cgit v1.2.3 From 0f1c5aebd5c68bcaefdcc26b9050fa19c7444d06 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Mon, 9 Nov 2009 15:02:16 +0200 Subject: Implemented low task EXT-1155 (Implement option to sort the nearby people list by distance and most recent speakers) --HG-- branch : product-engine --- indra/newview/llpanelpeople.cpp | 120 ++++++++++++++++++++- indra/newview/llpanelpeople.h | 3 + .../xui/en/menu_people_nearby_view_sort.xml | 39 +++++-- 3 files changed, 148 insertions(+), 14 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index bb6cdd2f78..b08eb27b9f 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -60,6 +60,7 @@ #include "llviewermenu.h" // for gMenuHolder #include "llvoiceclient.h" #include "llworld.h" +#include "llspeakers.h" #define FRIEND_LIST_UPDATE_TIMEOUT 0.5 #define NEARBY_LIST_UPDATE_INTERVAL 1 @@ -119,8 +120,84 @@ protected: } }; +/** Compares avatar items by distance between you and them */ +class LLAvatarItemDistanceComparator : public LLAvatarItemComparator +{ +public: + typedef std::map < LLUUID, LLVector3d > id_to_pos_map_t; + LLAvatarItemDistanceComparator() {}; + + void updateAvatarsPositions(std::vector& positions, std::vector& uuids) + { + std::vector::const_iterator + pos_it = positions.begin(), + pos_end = positions.end(); + + std::vector::const_iterator + id_it = uuids.begin(), + id_end = uuids.end(); + + LLAvatarItemDistanceComparator::id_to_pos_map_t pos_map; + + mAvatarsPositions.clear(); + + for (;pos_it != pos_end && id_it != id_end; ++pos_it, ++id_it ) + { + mAvatarsPositions[*id_it] = *pos_it; + } + }; + +protected: + virtual bool doCompare(const LLAvatarListItem* item1, const LLAvatarListItem* item2) const + { + const LLVector3d& me_pos = gAgent.getPositionGlobal(); + const LLVector3d& item1_pos = mAvatarsPositions.find(item1->getAvatarId())->second; + const LLVector3d& item2_pos = mAvatarsPositions.find(item2->getAvatarId())->second; + F32 dist1 = dist_vec(item1_pos, me_pos); + F32 dist2 = dist_vec(item2_pos, me_pos); + return dist1 < dist2; + } +private: + id_to_pos_map_t mAvatarsPositions; +}; + +/** Comparator for comparing nearby avatar items by last spoken time */ +class LLAvatarItemRecentSpeakerComparator : public LLAvatarItemNameComparator +{ +public: + LLAvatarItemRecentSpeakerComparator() {}; + virtual ~LLAvatarItemRecentSpeakerComparator() {}; + +protected: + virtual bool doCompare(const LLAvatarListItem* item1, const LLAvatarListItem* item2) const + { + LLPointer lhs = LLLocalSpeakerMgr::instance().findSpeaker(item1->getAvatarId()); + LLPointer rhs = LLLocalSpeakerMgr::instance().findSpeaker(item2->getAvatarId()); + if ( lhs.notNull() && rhs.notNull() ) + { + // Compare by last speaking time + if( lhs->mLastSpokeTime != rhs->mLastSpokeTime ) + return ( lhs->mLastSpokeTime > rhs->mLastSpokeTime ); + } + else if ( lhs.notNull() ) + { + // True if only item1 speaker info available + return true; + } + else if ( rhs.notNull() ) + { + // False if only item2 speaker info available + return false; + } + // By default compare by name. + return LLAvatarItemNameComparator::doCompare(item1, item2); + } +}; + static const LLAvatarItemRecentComparator RECENT_COMPARATOR; static const LLAvatarItemStatusComparator STATUS_COMPARATOR; +static LLAvatarItemDistanceComparator DISTANCE_COMPARATOR; +static const LLAvatarItemRecentSpeakerComparator RECENT_SPEAKER_COMPARATOR; static LLRegisterPanelClassWrapper t_people("panel_people"); @@ -434,6 +511,7 @@ BOOL LLPanelPeople::postBuild() setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false); setSortOrder(mAllFriendList, (ESortOrder)gSavedSettings.getU32("FriendsSortOrder"), false); + setSortOrder(mNearbyList, (ESortOrder)gSavedSettings.getU32("NearbyPeopleSortOrder"), false); LLPanel* groups_panel = getChild(GROUP_TAB_NAME); groups_panel->childSetAction("activate_btn", boost::bind(&LLPanelPeople::onActivateButtonClicked, this)); @@ -494,7 +572,8 @@ BOOL LLPanelPeople::postBuild() enable_registrar.add("People.Friends.ViewSort.CheckItem", boost::bind(&LLPanelPeople::onFriendsViewSortMenuItemCheck, this, _2)); enable_registrar.add("People.Recent.ViewSort.CheckItem", boost::bind(&LLPanelPeople::onRecentViewSortMenuItemCheck, this, _2)); - + enable_registrar.add("People.Nearby.ViewSort.CheckItem", boost::bind(&LLPanelPeople::onNearbyViewSortMenuItemCheck, this, _2)); + LLMenuGL* plus_menu = LLUICtrlFactory::getInstance()->createFromFile("menu_group_plus.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mGroupPlusMenuHandle = plus_menu->getHandle(); @@ -573,8 +652,13 @@ void LLPanelPeople::updateNearbyList() if (!mNearbyList) return; - LLWorld::getInstance()->getAvatars(&mNearbyList->getIDs(), NULL, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange")); + std::vector positions; + + LLWorld::getInstance()->getAvatars(&mNearbyList->getIDs(), &positions, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange")); mNearbyList->setDirty(); + + DISTANCE_COMPARATOR.updateAvatarsPositions(positions, mNearbyList->getIDs()); + LLLocalSpeakerMgr::instance().update(TRUE); } void LLPanelPeople::updateRecentList() @@ -760,6 +844,14 @@ void LLPanelPeople::setSortOrder(LLAvatarList* list, ESortOrder order, bool save list->setComparator(&RECENT_COMPARATOR); list->sort(); break; + case E_SORT_BY_RECENT_SPEAKERS: + list->setComparator(&RECENT_SPEAKER_COMPARATOR); + list->sort(); + break; + case E_SORT_BY_DISTANCE: + list->setComparator(&DISTANCE_COMPARATOR); + list->sort(); + break; default: llwarns << "Unrecognized people sort order for " << list->getName() << llendl; return; @@ -774,7 +866,7 @@ void LLPanelPeople::setSortOrder(LLAvatarList* list, ESortOrder order, bool save else if (list == mRecentList) setting = "RecentPeopleSortOrder"; else if (list == mNearbyList) - setting = "NearbyPeopleSortOrder"; // *TODO: unused by current implementation + setting = "NearbyPeopleSortOrder"; if (!setting.empty()) gSavedSettings.setU32(setting, order); @@ -1010,12 +1102,13 @@ void LLPanelPeople::onNearbyViewSortMenuItemClicked(const LLSD& userdata) { std::string chosen_item = userdata.asString(); - if (chosen_item == "sort_recent") + if (chosen_item == "sort_by_recent_speakers") { + setSortOrder(mNearbyList, E_SORT_BY_RECENT_SPEAKERS); } else if (chosen_item == "sort_name") { - mNearbyList->sortByName(); + setSortOrder(mNearbyList, E_SORT_BY_NAME); } else if (chosen_item == "view_icons") { @@ -1023,8 +1116,25 @@ void LLPanelPeople::onNearbyViewSortMenuItemClicked(const LLSD& userdata) } else if (chosen_item == "sort_distance") { + setSortOrder(mNearbyList, E_SORT_BY_DISTANCE); } } + +bool LLPanelPeople::onNearbyViewSortMenuItemCheck(const LLSD& userdata) +{ + std::string item = userdata.asString(); + U32 sort_order = gSavedSettings.getU32("NearbyPeopleSortOrder"); + + if (item == "sort_by_recent_speakers") + return sort_order == E_SORT_BY_RECENT_SPEAKERS; + if (item == "sort_name") + return sort_order == E_SORT_BY_NAME; + if (item == "sort_distance") + return sort_order == E_SORT_BY_DISTANCE; + + return false; +} + void LLPanelPeople::onRecentViewSortMenuItemClicked(const LLSD& userdata) { std::string chosen_item = userdata.asString(); diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 9bf9befe90..faed573eca 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -62,6 +62,8 @@ private: E_SORT_BY_NAME = 0, E_SORT_BY_STATUS = 1, E_SORT_BY_MOST_RECENT = 2, + E_SORT_BY_DISTANCE = 3, + E_SORT_BY_RECENT_SPEAKERS = 4, } ESortOrder; // methods indirectly called by the updaters @@ -115,6 +117,7 @@ private: bool onFriendsViewSortMenuItemCheck(const LLSD& userdata); bool onRecentViewSortMenuItemCheck(const LLSD& userdata); + bool onNearbyViewSortMenuItemCheck(const LLSD& userdata); // misc callbacks static void onAvatarPicked( diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml b/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml index c002cd078f..39f9e48609 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml @@ -2,15 +2,36 @@ - - - - - - - - - + + + + + + + + + + + + Date: Mon, 9 Nov 2009 15:43:50 +0200 Subject: Fixed normal bug EXT-2252 ([BSI] "Set to current location" button on Edit Pick panel has no effect) --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_edit_pick.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/panel_edit_pick.xml b/indra/newview/skins/default/xui/en/panel_edit_pick.xml index f4a212ba0a..d6de5af32d 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_pick.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_pick.xml @@ -53,7 +53,7 @@ layout="topleft" top="0" background_visible="false" - height="470" + height="510" left="0" width="295"> Date: Mon, 9 Nov 2009 15:54:54 +0200 Subject: Implemented major task EXT-2251 - Implement panels for creating, editing and viewing Classifieds. --HG-- branch : product-engine --- indra/newview/llavatarpropertiesprocessor.cpp | 30 ++ indra/newview/llavatarpropertiesprocessor.h | 2 + indra/newview/llpanelclassified.cpp | 490 +++++++++++++++++++++ indra/newview/llpanelclassified.h | 126 ++++++ indra/newview/llpanelpicks.cpp | 143 +++++- indra/newview/llpanelpicks.h | 10 +- indra/newview/llpanelprofile.cpp | 5 + .../skins/default/xui/en/panel_classified_info.xml | 175 ++++++++ .../skins/default/xui/en/panel_edit_classified.xml | 251 +++++++++++ 9 files changed, 1226 insertions(+), 6 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/panel_classified_info.xml create mode 100644 indra/newview/skins/default/xui/en/panel_edit_classified.xml diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp index 2942e436ef..7cda2d31e6 100644 --- a/indra/newview/llavatarpropertiesprocessor.cpp +++ b/indra/newview/llavatarpropertiesprocessor.cpp @@ -554,6 +554,36 @@ void LLAvatarPropertiesProcessor::sendPickInfoUpdate(const LLPickData* new_pick) LLAgentPicksInfo::getInstance()->requestNumberOfPicks(); } +void LLAvatarPropertiesProcessor::sendClassifiedInfoUpdate(const LLAvatarClassifiedInfo* c_data) +{ + if(!c_data) + { + return; + } + + LLMessageSystem* msg = gMessageSystem; + + msg->newMessage(_PREHASH_ClassifiedInfoUpdate); + + msg->nextBlock(_PREHASH_AgentData); + msg->addUUID(_PREHASH_AgentID, gAgent.getID()); + msg->addUUID(_PREHASH_SessionID, gAgent.getSessionID()); + + msg->nextBlock(_PREHASH_Data); + msg->addUUID(_PREHASH_ClassifiedID, c_data->classified_id); + msg->addU32(_PREHASH_Category, c_data->category); + msg->addString(_PREHASH_Name, c_data->name); + msg->addString(_PREHASH_Desc, c_data->description); + msg->addUUID(_PREHASH_ParcelID, c_data->parcel_id); + msg->addU32(_PREHASH_ParentEstate, 0); + msg->addUUID(_PREHASH_SnapshotID, c_data->snapshot_id); + msg->addVector3d(_PREHASH_PosGlobal, c_data->pos_global); + msg->addU8(_PREHASH_ClassifiedFlags, c_data->flags); + msg->addS32(_PREHASH_PriceForListing, c_data->price_for_listing); + + gAgent.sendReliableMessage(); +} + void LLAvatarPropertiesProcessor::sendPickInfoRequest(const LLUUID& creator_id, const LLUUID& pick_id) { // Must ask for a pick based on the creator id because diff --git a/indra/newview/llavatarpropertiesprocessor.h b/indra/newview/llavatarpropertiesprocessor.h index 64964b1665..716c1b8065 100644 --- a/indra/newview/llavatarpropertiesprocessor.h +++ b/indra/newview/llavatarpropertiesprocessor.h @@ -212,6 +212,8 @@ public: void sendPickInfoUpdate(const LLPickData* new_pick); + void sendClassifiedInfoUpdate(const LLAvatarClassifiedInfo* c_data); + void sendFriendRights(const LLUUID& avatar_id, S32 rights); void sendNotes(const LLUUID& avatar_id, const std::string notes); diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index a29c9752e6..b118c6813c 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -1142,3 +1142,493 @@ void LLPanelClassified::setDefaultAccessCombo() break; } } + +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// + + +std::string SET_LOCATION_NOTICE1("(will update after save)"); + +LLPanelClassifiedInfo::LLPanelClassifiedInfo() + : LLPanel() +{ +} + +LLPanelClassifiedInfo::~LLPanelClassifiedInfo() +{ +} + +// static +LLPanelClassifiedInfo* LLPanelClassifiedInfo::create() +{ + LLPanelClassifiedInfo* panel = new LLPanelClassifiedInfo(); + LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_classified_info.xml"); + return panel; +} + +BOOL LLPanelClassifiedInfo::postBuild() +{ + childSetAction("back_btn", boost::bind(&LLPanelClassifiedInfo::onExit, this), NULL); + + return TRUE; +} + +void LLPanelClassifiedInfo::setExitCallback(const commit_callback_t& cb) +{ + getChild("back_btn")->setClickedCallback(cb); +} + +void LLPanelClassifiedInfo::onOpen(const LLSD& key) +{ + LLUUID avatar_id = key["avatar_id"]; + if(avatar_id.isNull()) + { + return; + } + + if(getAvatarId().notNull()) + { + LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this); + } + + setAvatarId(avatar_id); + + resetData(); + resetControls(); + + setClassifiedId(key["classified_id"]); + setClassifiedName(key["name"]); + setDescription(key["desc"]); + setSnapshotId(key["snapshot_id"]); + + LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this); + LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId()); +} + +void LLPanelClassifiedInfo::processProperties(void* data, EAvatarProcessorType type) +{ + if(APT_CLASSIFIED_INFO == type) + { + LLAvatarClassifiedInfo* c_info = static_cast(data); + if(data && getClassifiedId() == c_info->classified_id) + { + setClassifiedName(c_info->name); + setDescription(c_info->description); + setSnapshotId(c_info->snapshot_id); + setClassifiedLocation(createLocationText(c_info->parcel_name, c_info->sim_name, c_info->pos_global)); + childSetValue("category", LLClassifiedInfo::sCategories[c_info->category]); + + bool mature = is_cf_mature(c_info->flags); + childSetValue("content_type", mature ? "Mature" : "PG Content"); + childSetValue("auto_renew", is_cf_auto_renew(c_info->flags)); + + childSetTextArg("price_for_listing", "[PRICE]", llformat("%d", c_info->price_for_listing)); + } + } +} + +void LLPanelClassifiedInfo::resetData() +{ + setClassifiedName(LLStringUtil::null); + setDescription(LLStringUtil::null); + setClassifiedLocation(LLStringUtil::null); + setClassifiedId(LLUUID::null); + setSnapshotId(LLUUID::null); + mPosGlobal.clearVec(); +} + +void LLPanelClassifiedInfo::resetControls() +{ + if(getAvatarId() == gAgent.getID()) + { + childSetEnabled("edit_btn", TRUE); + childSetVisible("edit_btn", TRUE); + } + else + { + childSetEnabled("edit_btn", FALSE); + childSetVisible("edit_btn", FALSE); + } +} + +void LLPanelClassifiedInfo::setClassifiedName(const std::string& name) +{ + childSetValue("classified_name", name); +} + +std::string LLPanelClassifiedInfo::getClassifiedName() +{ + return childGetValue("classified_name").asString(); +} + +void LLPanelClassifiedInfo::setDescription(const std::string& desc) +{ + childSetValue("classified_desc", desc); +} + +std::string LLPanelClassifiedInfo::getDescription() +{ + return childGetValue("classified_desc").asString(); +} + +void LLPanelClassifiedInfo::setClassifiedLocation(const std::string& location) +{ + childSetValue("classified_location", location); +} + +void LLPanelClassifiedInfo::setSnapshotId(const LLUUID& id) +{ + childSetValue("classified_snapshot", id); +} + +LLUUID LLPanelClassifiedInfo::getSnapshotId() +{ + return childGetValue("classified_snapshot").asUUID(); +} + +// static +std::string LLPanelClassifiedInfo::createLocationText( + const std::string& original_name, + const std::string& sim_name, + const LLVector3d& pos_global) +{ + std::string location_text; + + location_text.append(original_name); + + if (!sim_name.empty()) + { + if (!location_text.empty()) + location_text.append(", "); + location_text.append(sim_name); + } + + if (!location_text.empty()) + location_text.append(" "); + + if (!pos_global.isNull()) + { + S32 region_x = llround((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS; + S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS; + S32 region_z = llround((F32)pos_global.mdV[VZ]); + location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z)); + } + + return location_text; +} + +void LLPanelClassifiedInfo::onExit() +{ + LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this); +} + +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// + +LLPanelClassifiedEdit::LLPanelClassifiedEdit() + : LLPanelClassifiedInfo() + , mSnapshotCtrl(NULL) + , mNewClassified(false) +{ +} + +LLPanelClassifiedEdit::~LLPanelClassifiedEdit() +{ +} + +//static +LLPanelClassifiedEdit* LLPanelClassifiedEdit::create() +{ + LLPanelClassifiedEdit* panel = new LLPanelClassifiedEdit(); + LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_edit_classified.xml"); + return panel; +} + +BOOL LLPanelClassifiedEdit::postBuild() +{ + LLPanelClassifiedInfo::postBuild(); + + mSnapshotCtrl = getChild("classified_snapshot"); + mSnapshotCtrl->setOnSelectCallback(boost::bind(&LLPanelClassifiedEdit::onSnapshotChanged, this, _1)); + + LLLineEditor* line_edit = getChild("classified_name"); + line_edit->setKeystrokeCallback(boost::bind(&LLPanelClassifiedEdit::onClassifiedChanged, this), NULL); + + LLTextEditor* text_edit = getChild("classified_desc"); + text_edit->setKeystrokeCallback(boost::bind(&LLPanelClassifiedEdit::onClassifiedChanged, this)); + + LLComboBox* combobox = getChild( "category"); + LLClassifiedInfo::cat_map::iterator iter; + for (iter = LLClassifiedInfo::sCategories.begin(); + iter != LLClassifiedInfo::sCategories.end(); + iter++) + { + combobox->add(LLTrans::getString(iter->second), (void *)((intptr_t)iter->first), ADD_BOTTOM); + } + + combobox->setCurrentByIndex(0); + combobox->setCommitCallback(boost::bind(&LLPanelClassifiedEdit::onClassifiedChanged, this)); + + combobox = getChild("content_type"); + combobox->setCommitCallback(boost::bind(&LLPanelClassifiedEdit::onClassifiedChanged, this)); + + childSetCommitCallback("price_for_listing", boost::bind(&LLPanelClassifiedEdit::onClassifiedChanged, this), NULL); + childSetCommitCallback("auto_renew", boost::bind(&LLPanelClassifiedEdit::onClassifiedChanged, this), NULL); + + childSetAction("save_changes_btn", boost::bind(&LLPanelClassifiedEdit::onClickSave, this)); + childSetAction("set_to_curr_location_btn", boost::bind(&LLPanelClassifiedEdit::onClickSetLocation, this)); + + return TRUE; +} + +void LLPanelClassifiedEdit::onOpen(const LLSD& key) +{ + LLUUID classified_id = key["classified_id"]; + + if(classified_id.isNull()) + { + mNewClassified = true; + setAvatarId(gAgent.getID()); + + resetData(); + resetControls(); + + setPosGlobal(gAgent.getPositionGlobal()); + + LLUUID snapshot_id = LLUUID::null; + std::string desc; + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + + if(parcel) + { + desc = parcel->getDesc(); + snapshot_id = parcel->getSnapshotID(); + } + + std::string region_name = LLTrans::getString("ClassifiedUpdateAfterPublish"); + LLViewerRegion* region = gAgent.getRegion(); + if (region) + { + region_name = region->getName(); + } + + childSetValue("classified_name", makeClassifiedName()); + childSetValue("classified_desc", desc); + setSnapshotId(snapshot_id); + setClassifiedLocation(createLocationText(region_name, LLStringUtil::null, getPosGlobal())); + setParcelId(LLUUID::null); + + enableSaveButton(true); + } + else + { + mNewClassified = false; + + LLPanelClassifiedInfo::onOpen(key); + enableSaveButton(false); + } + + resetDirty(); +} + +void LLPanelClassifiedEdit::processProperties(void* data, EAvatarProcessorType type) +{ + if(APT_CLASSIFIED_INFO == type) + { + LLAvatarClassifiedInfo* c_info = static_cast(data); + if(data && getClassifiedId() == c_info->classified_id) + { + setClassifiedName(c_info->name); + setDescription(c_info->description); + setSnapshotId(c_info->snapshot_id); + setClassifiedLocation(createLocationText(c_info->parcel_name, c_info->sim_name, c_info->pos_global)); + getChild("category")->setCurrentByIndex(c_info->category + 1); + getChild("category")->resetDirty(); + + bool mature = is_cf_mature(c_info->flags); + bool auto_renew = is_cf_auto_renew(c_info->flags); + + getChild("content_type")->setCurrentByIndex(mature ? 0 : 1); + childSetValue("auto_renew", auto_renew); + childSetValue("price_for_listing", c_info->price_for_listing); + + resetDirty(); + } + } +} + +BOOL LLPanelClassifiedEdit::isDirty() const +{ + if(mNewClassified) + return TRUE; + + BOOL dirty = false; + + dirty |= LLPanelClassifiedInfo::isDirty(); + dirty |= mSnapshotCtrl->isDirty(); + dirty |= getChild("classified_name")->isDirty(); + dirty |= getChild("classified_desc")->isDirty(); + dirty |= getChild("category")->isDirty(); + dirty |= getChild("content_type")->isDirty(); + dirty |= getChild("auto_renew")->isDirty(); + dirty |= getChild("price_for_listing")->isDirty(); + + return dirty; +} + +void LLPanelClassifiedEdit::resetDirty() +{ + LLPanelClassifiedInfo::resetDirty(); + mSnapshotCtrl->resetDirty(); + getChild("classified_name")->resetDirty(); + getChild("classified_desc")->resetDirty(); + getChild("category")->resetDirty(); + getChild("content_type")->resetDirty(); + getChild("auto_renew")->resetDirty(); + getChild("price_for_listing")->resetDirty(); +} + +void LLPanelClassifiedEdit::setSaveCallback(const commit_callback_t& cb) +{ + getChild("save_changes_btn")->setClickedCallback(cb); +} + +void LLPanelClassifiedEdit::setCancelCallback(const commit_callback_t& cb) +{ + getChild("cancel_btn")->setClickedCallback(cb); +} + +void LLPanelClassifiedEdit::resetControls() +{ + LLPanelClassifiedInfo::resetControls(); + + getChild("category")->setCurrentByIndex(0); + getChild("content_type")->setCurrentByIndex(0); + childSetValue("auto_renew", false); + childSetValue("price_for_listing", MINIMUM_PRICE_FOR_LISTING); +} + +void LLPanelClassifiedEdit::sendUpdate() +{ + LLAvatarClassifiedInfo c_data; + + if(getClassifiedId().isNull()) + { + LLUUID id = getClassifiedId(); + id.generate(); + setClassifiedId(id); + } + + c_data.agent_id = gAgent.getID(); + c_data.classified_id = getClassifiedId(); + c_data.category = getCategory(); + c_data.name = getClassifiedName(); + c_data.description = getDescription(); + c_data.parcel_id = getParcelId(); + c_data.snapshot_id = getSnapshotId(); + c_data.pos_global = getPosGlobal(); + c_data.flags = getClassifiedFlags(); + c_data.price_for_listing = getPriceForListing(); + + LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoUpdate(&c_data); +} + +U32 LLPanelClassifiedEdit::getCategory() +{ + LLComboBox* cat_cb = getChild("category"); + return cat_cb->getCurrentIndex() + 1; +} + +U8 LLPanelClassifiedEdit::getClassifiedFlags() +{ + bool auto_renew = childGetValue("auto_renew").asBoolean(); + + LLComboBox* content_cb = getChild("content_type"); + bool mature = content_cb->getCurrentIndex() == 0; + + return pack_classified_flags_request(auto_renew, false, mature, false);; +} + +void LLPanelClassifiedEdit::enableSaveButton(bool enable) +{ + childSetEnabled("save_changes_btn", enable); +} + +std::string LLPanelClassifiedEdit::makeClassifiedName() +{ + std::string name; + + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + if(parcel) + { + name = parcel->getName(); + } + + if(!name.empty()) + return name; + + LLViewerRegion* region = gAgent.getRegion(); + if(region) + { + name = region->getName(); + } + + return name; +} + +S32 LLPanelClassifiedEdit::getPriceForListing() +{ + return childGetValue("price_for_listing").asInteger(); +} + +void LLPanelClassifiedEdit::onClickSetLocation() +{ + setPosGlobal(gAgent.getPositionGlobal()); + setParcelId(LLUUID::null); + + std::string region_name = LLTrans::getString("ClassifiedUpdateAfterPublish"); + LLViewerRegion* region = gAgent.getRegion(); + if (region) + { + region_name = region->getName(); + } + + setClassifiedLocation(createLocationText(region_name, LLStringUtil::null, getPosGlobal())); + + // mark classified as dirty + setValue(LLSD()); + + onClassifiedChanged(); +} + +void LLPanelClassifiedEdit::onSnapshotChanged(LLUICtrl* ctrl) +{ + +} + +void LLPanelClassifiedEdit::onClassifiedChanged() +{ + if(isDirty()) + { + enableSaveButton(true); + } + else + { + enableSaveButton(false); + } +} + +void LLPanelClassifiedEdit::onClickSave() +{ + sendUpdate(); + +// LLAvatarPropertiesProcessor::getInstance()->sendAvatarClassifiedsRequest(getAvatarId()); + + LLSD params; + params["action"] = "save_classified"; + notifyParent(params); +} + +//EOF diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index 417eddf460..eccc83cf53 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -198,5 +198,131 @@ private: void* mUserData; }; +#include "llavatarpropertiesprocessor.h" + +class LLPanelClassifiedInfo : public LLPanel, public LLAvatarPropertiesObserver +{ +public: + + static LLPanelClassifiedInfo* create(); + + virtual ~LLPanelClassifiedInfo(); + + virtual void setExitCallback(const commit_callback_t& cb); + + /*virtual*/ void onOpen(const LLSD& key); + + /*virtual*/ BOOL postBuild(); + + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); + + virtual void setAvatarId(const LLUUID& avatar_id) { mAvatarId = avatar_id; } + + LLUUID& getAvatarId() { return mAvatarId; } + + virtual void setSnapshotId(const LLUUID& id); + + virtual LLUUID getSnapshotId(); + + virtual void setClassifiedId(const LLUUID& id) { mClassifiedId = id; } + + virtual LLUUID& getClassifiedId() { return mClassifiedId; } + + virtual void setClassifiedName(const std::string& name); + + virtual std::string getClassifiedName(); + + virtual void setDescription(const std::string& desc); + + virtual std::string getDescription(); + + virtual void setClassifiedLocation(const std::string& location); + + virtual void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; } + + virtual LLVector3d& getPosGlobal() { return mPosGlobal; } + +protected: + + LLPanelClassifiedInfo(); + + virtual void resetData(); + + virtual void resetControls(); + + static std::string createLocationText( + const std::string& original_name, + const std::string& sim_name, + const LLVector3d& pos_global); + + void onClickMap(); + void onClickTeleport(); + void onClickBack(); + void onExit(); + +private: + + LLUUID mAvatarId; + LLUUID mClassifiedId; + LLVector3d mPosGlobal; +}; + +class LLPanelClassifiedEdit : public LLPanelClassifiedInfo +{ +public: + + static LLPanelClassifiedEdit* create(); + + virtual ~LLPanelClassifiedEdit(); + + BOOL postBuild(); + + void onOpen(const LLSD& key); + + void processProperties(void* data, EAvatarProcessorType type); + + BOOL isDirty() const; + + void resetDirty(); + + void setSaveCallback(const commit_callback_t& cb); + + void setCancelCallback(const commit_callback_t& cb); + + void resetControls(); + + virtual bool isNewClassified() { return mNewClassified; } + +protected: + + LLPanelClassifiedEdit(); + + void sendUpdate(); + + U32 getCategory(); + + void enableSaveButton(bool enable); + + std::string makeClassifiedName(); + + void setParcelId(const LLUUID& id) { mParcelId = id; } + + LLUUID getParcelId() { return mParcelId; } + + S32 getPriceForListing(); + + U8 getClassifiedFlags(); + + void onClickSetLocation(); + void onSnapshotChanged(LLUICtrl* ctrl); + void onClassifiedChanged(); + void onClickSave(); + +private: + LLTextureCtrl* mSnapshotCtrl; + + LLUUID mParcelId; + bool mNewClassified; +}; #endif // LL_LLPANELCLASSIFIED_H diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 78f8152b10..7b7667c147 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -52,6 +52,7 @@ #include "llpanelavatar.h" #include "llpanelprofile.h" #include "llpanelpick.h" +#include "llpanelclassified.h" static const std::string XML_BTN_NEW = "new_btn"; static const std::string XML_BTN_DELETE = "trash_btn"; @@ -70,6 +71,33 @@ static const std::string CLASSIFIED_NAME("classified_name"); static LLRegisterPanelClassWrapper t_panel_picks("panel_picks"); +////////////////////////////////////////////////////////////////////////// + +class LLClassifiedClickThrough : public LLDispatchHandler +{ +public: + virtual bool operator()( + const LLDispatcher* dispatcher, + const std::string& key, + const LLUUID& invoice, + const sparam_t& strings) + { + if (strings.size() != 4) + return false; + + // LLUUID classified_id(strings[0]); + // S32 teleport_clicks = atoi(strings[1].c_str()); + // S32 map_clicks = atoi(strings[2].c_str()); + // S32 profile_clicks = atoi(strings[3].c_str()); + // LLPanelClassified::setClickThrough(classified_id, teleport_clicks, + // map_clicks, + // profile_clicks, + // false); + + return true; + } +}; + //----------------------------------------------------------------------------- // LLPanelPicks //----------------------------------------------------------------------------- @@ -85,8 +113,12 @@ LLPanelPicks::LLPanelPicks() mOverflowMenu(NULL), mPlusMenu(NULL), mPicksAccTab(NULL), - mClassifiedsAccTab(NULL) + mClassifiedsAccTab(NULL), + mPanelClassifiedInfo(NULL), + mPanelClassifiedEdit(NULL) { + gGenericDispatcher.addHandler("classifiedclickthrough", + new LLClassifiedClickThrough()); } LLPanelPicks::~LLPanelPicks() @@ -574,7 +606,9 @@ void LLPanelPicks::createNewPick() void LLPanelPicks::createNewClassified() { - LLNotifications::instance().add("ClickUnimplemented"); + createClassifiedEditPanel(); + + getProfilePanel()->openPanel(mPanelClassifiedEdit, LLSD()); } void LLPanelPicks::onClickInfo() @@ -610,7 +644,21 @@ void LLPanelPicks::openPickInfo() void LLPanelPicks::openClassifiedInfo() { - LLNotifications::instance().add("ClickUnimplemented"); + LLSD selected_value = mClassifiedsList->getSelectedValue(); + if (selected_value.isUndefined()) return; + + LLClassifiedItem* c_item = getSelectedClassifiedItem(); + + createClassifiedInfoPanel(); + + LLSD params; + params["classified_id"] = c_item->getClassifiedId(); + params["avatar_id"] = c_item->getAvatarId(); + params["snapshot_id"] = c_item->getSnapshotId(); + params["name"] = c_item->getClassifiedName(); + params["desc"] = c_item->getDescription(); + + getProfilePanel()->openPanel(mPanelClassifiedInfo, params); } void LLPanelPicks::showAccordion(const std::string& name, bool show) @@ -632,6 +680,49 @@ void LLPanelPicks::onPanelPickSave(LLPanel* panel) updateButtons(); } +void LLPanelPicks::onPanelClassifiedSave(LLPanelClassifiedEdit* panel) +{ + if(panel->isNewClassified()) + { + LLClassifiedItem* c_item = new LLClassifiedItem(getAvatarId(), panel->getClassifiedId()); + + c_item->setClassifiedName(panel->getClassifiedName()); + c_item->setDescription(panel->getDescription()); + c_item->setSnapshotId(panel->getSnapshotId()); + + LLSD c_value; + c_value.insert(CLASSIFIED_ID, c_item->getClassifiedId()); + c_value.insert(CLASSIFIED_NAME, c_item->getClassifiedName()); + mClassifiedsList->addItem(c_item, c_value); + + c_item->setDoubleClickCallback(boost::bind(&LLPanelPicks::onDoubleClickClassifiedItem, this, _1)); + c_item->setRightMouseUpCallback(boost::bind(&LLPanelPicks::onRightMouseUpItem, this, _1, _2, _3, _4)); + c_item->setMouseUpCallback(boost::bind(&LLPanelPicks::updateButtons, this)); + c_item->childSetAction("info_chevron", boost::bind(&LLPanelPicks::onClickInfo, this)); + } + else + { + std::vector values; + mClassifiedsList->getValues(values); + for(size_t n = 0; n < values.size(); ++n) + { + LLUUID c_id = values[n][CLASSIFIED_ID].asUUID(); + if(panel->getClassifiedId() == c_id) + { + LLClassifiedItem* c_item = dynamic_cast( + mClassifiedsList->getItemByValue(values[n])); + + c_item->setClassifiedName(panel->getClassifiedName()); + c_item->setDescription(panel->getDescription()); + c_item->setSnapshotId(panel->getSnapshotId()); + } + } + } + + onPanelPickClose(panel); + updateButtons(); +} + void LLPanelPicks::createPickInfoPanel() { if(!mPanelPickInfo) @@ -643,6 +734,28 @@ void LLPanelPicks::createPickInfoPanel() } } +void LLPanelPicks::createClassifiedInfoPanel() +{ + if(!mPanelClassifiedInfo) + { + mPanelClassifiedInfo = LLPanelClassifiedInfo::create(); + mPanelClassifiedInfo->setExitCallback(boost::bind(&LLPanelPicks::onPanelPickClose, this, mPanelClassifiedInfo)); + mPanelClassifiedInfo->setVisible(FALSE); + } +} + +void LLPanelPicks::createClassifiedEditPanel() +{ + if(!mPanelClassifiedEdit) + { + mPanelClassifiedEdit = LLPanelClassifiedEdit::create(); + mPanelClassifiedEdit->setExitCallback(boost::bind(&LLPanelPicks::onPanelPickClose, this, mPanelClassifiedEdit)); + mPanelClassifiedEdit->setSaveCallback(boost::bind(&LLPanelPicks::onPanelClassifiedSave, this, mPanelClassifiedEdit)); + mPanelClassifiedEdit->setCancelCallback(boost::bind(&LLPanelPicks::onPanelPickClose, this, mPanelClassifiedEdit)); + mPanelClassifiedEdit->setVisible(FALSE); + } +} + void LLPanelPicks::createPickEditPanel() { if(!mPanelPickEdit) @@ -702,6 +815,28 @@ void LLPanelPicks::onPanelPickEdit() getProfilePanel()->openPanel(mPanelPickEdit, params); } +void LLPanelPicks::onPanelClassifiedEdit() +{ + LLSD selected_value = mClassifiedsList->getSelectedValue(); + if (selected_value.isUndefined()) + { + return; + } + + LLClassifiedItem* c_item = dynamic_cast(mClassifiedsList->getSelectedItem()); + + createClassifiedEditPanel(); + + LLSD params; + params["classified_id"] = c_item->getClassifiedId(); + params["avatar_id"] = c_item->getAvatarId(); + params["snapshot_id"] = c_item->getSnapshotId(); + params["name"] = c_item->getClassifiedName(); + params["desc"] = c_item->getDescription(); + + getProfilePanel()->openPanel(mPanelClassifiedEdit, params); +} + void LLPanelPicks::onClickMenuEdit() { if(getSelectedPickItem()) @@ -710,7 +845,7 @@ void LLPanelPicks::onClickMenuEdit() } else if(getSelectedClassifiedItem()) { - LLNotifications::instance().add("ClickUnimplemented"); + onPanelClassifiedEdit(); } } diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index daf8059fee..b30036c603 100644 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -53,6 +53,8 @@ class LLFlatListView; class LLPanelPickInfo; class LLPanelPickEdit; class LLToggleableMenu; +class LLPanelClassifiedInfo; +class LLPanelClassifiedEdit; class LLPanelPicks : public LLPanelProfileTab @@ -98,7 +100,9 @@ private: void onClickInfo(); void onPanelPickClose(LLPanel* panel); void onPanelPickSave(LLPanel* panel); + void onPanelClassifiedSave(LLPanelClassifiedEdit* panel); void onPanelPickEdit(); + void onPanelClassifiedEdit(); void onClickMenuEdit(); void createNewPick(); @@ -125,8 +129,8 @@ private: void createPickInfoPanel(); void createPickEditPanel(); -// void openPickEditPanel(LLPickItem* pick); -// void openPickInfoPanel(LLPickItem* pick); + void createClassifiedInfoPanel(); + void createClassifiedEditPanel(); LLMenuGL* mPopupMenu; LLPanelProfile* mProfilePanel; @@ -134,6 +138,8 @@ private: LLFlatListView* mPicksList; LLFlatListView* mClassifiedsList; LLPanelPickInfo* mPanelPickInfo; + LLPanelClassifiedInfo* mPanelClassifiedInfo; + LLPanelClassifiedEdit* mPanelClassifiedEdit; LLPanelPickEdit* mPanelPickEdit; LLToggleableMenu* mOverflowMenu; LLToggleableMenu* mPlusMenu; diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index bec670cdaa..b404c8db4c 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -199,5 +199,10 @@ void LLPanelProfile::notifyParent(const LLSD& info) onOpen(info); return; } + else if("save_classified" == action) + { + // onOpen(info); + return; + } LLPanel::notifyParent(info); } diff --git a/indra/newview/skins/default/xui/en/panel_classified_info.xml b/indra/newview/skins/default/xui/en/panel_classified_info.xml new file mode 100644 index 0000000000..b7a54a7eea --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_classified_info.xml @@ -0,0 +1,175 @@ + + + + Date: Tue, 10 Nov 2009 09:32:39 +0200 Subject: fixed normal bug EXT-1649 Groups you chatted in recently show up in the Recent People tab --HG-- branch : product-engine --- indra/newview/llrecentpeople.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/indra/newview/llrecentpeople.cpp b/indra/newview/llrecentpeople.cpp index b491c7e109..bd46b5b56a 100644 --- a/indra/newview/llrecentpeople.cpp +++ b/indra/newview/llrecentpeople.cpp @@ -33,6 +33,7 @@ #include "llviewerprecompiledheaders.h" #include "llrecentpeople.h" +#include "llgroupmgr.h" #include "llagent.h" @@ -43,12 +44,18 @@ bool LLRecentPeople::add(const LLUUID& id) if (id == gAgent.getID()) return false; - LLDate date_added = LLDate::now(); + bool is_not_group_id = LLGroupMgr::getInstance()->getGroupData(id) == NULL; - //[] instead of insert to replace existing id->date with new date value - mPeople[id] = date_added; - mChangedSignal(); - return true; + if (is_not_group_id) + { + LLDate date_added = LLDate::now(); + + //[] instead of insert to replace existing id->date with new date value + mPeople[id] = date_added; + mChangedSignal(); + } + + return is_not_group_id; } bool LLRecentPeople::contains(const LLUUID& id) const -- cgit v1.2.3 From e808f41bafed708df0bee494193cbcbfb245c620 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Tue, 10 Nov 2009 11:37:10 +0200 Subject: Fixed line endings from 4df44e70aa9d --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index fe4859ead0..97447a85c6 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -1047,8 +1047,8 @@ void LLChicletPanel::reshape(S32 width, S32 height, BOOL called_from_parent ) mLeftScrollButton->setRect(LLRect(0,scroll_button_rect.mTop,scroll_button_rect.getWidth(), scroll_button_rect.mBottom)); scroll_button_rect = mRightScrollButton->getRect(); - mRightScrollButton->setRect(LLRect(width - scroll_button_rect.getWidth(),scroll_button_rect.mTop, - width, scroll_button_rect.mBottom)); + mRightScrollButton->setRect(LLRect(width - scroll_button_rect.getWidth(),scroll_button_rect.mTop, + width, scroll_button_rect.mBottom)); mScrollArea->setRect(LLRect(scroll_button_rect.getWidth() + SCROLL_BUTTON_PAD, height, width - scroll_button_rect.getWidth() - SCROLL_BUTTON_PAD, 0)); mShowControls = width > mMinWidth; -- cgit v1.2.3 From f15767bbef4e0a87aa032e265b3a0a8d4db907e1 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Tue, 10 Nov 2009 12:43:17 +0200 Subject: merge --HG-- branch : product-engine --- indra/newview/llsidetray.cpp | 43 +++++++++++++++++++++++++++++++++++++++---- indra/newview/llsidetray.h | 2 ++ 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index a11ee05532..b25dea92cc 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -460,16 +460,51 @@ void LLSideTray::createButtons () } } +void LLSideTray::processTriState () +{ + if(mCollapsed) + expandSideBar(); + else + { + //!!!!!!!!!!!!!!!!! + //** HARDCODED!!!!! + //!!!!!!!!!!!!!!!!! + + //there is no common way to determine "default" panel for tab + //so default panels for now will be hardcoded + + //hardcoded for people tab and profile tab + + /*if(mActiveTab == getTab("sidebar_people")) + { + LLSideTrayPanelContainer* container = findChild("panel_container"); + if(container && container->getCurrentPanelIndex()>0) + { + container->onOpen(LLSD().insert("sub_panel_name","panel_people")); + } + else + collapseSideBar(); + } + else if(mActiveTab == getTab("sidebar_me")) + { + LLTabContainer* tab_container = findChild("tabs"); + if(tab_container && tab_container->getCurrentPanelIndex()>0) + tab_container->selectFirstTab(); + else + collapseSideBar(); + } + else*/ + collapseSideBar(); + } +} + void LLSideTray::onTabButtonClick(string name) { LLSideTrayTab* side_bar = getTab(name); if(side_bar == mActiveTab) { - if(mCollapsed) - expandSideBar(); - else - collapseSideBar(); + processTriState (); return; } selectTabByName (name); diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index b49251ec79..246979ac54 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -135,6 +135,8 @@ public: S32 getTrayWidth(); void resetPanelRect (); + + void processTriState (); protected: -- cgit v1.2.3 From d04539f74a2922db40a6f90f16929b29056f666b Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Tue, 10 Nov 2009 13:21:02 +0200 Subject: Update for major task EXT-2251 - Implement panels for creating, editing and viewing Classifieds. Fixed bugs, improved functionality. --HG-- branch : product-engine --- indra/newview/llpanelclassified.cpp | 73 +++++++++++----------- indra/newview/llpanelclassified.h | 24 +++---- indra/newview/llpanelpicks.cpp | 50 ++++++++++----- indra/newview/llpanelpicks.h | 4 ++ indra/newview/llpanelprofile.cpp | 6 +- .../skins/default/xui/en/panel_classified_info.xml | 8 +++ 6 files changed, 97 insertions(+), 68 deletions(-) diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index b118c6813c..f03e7da2ec 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -1147,11 +1147,9 @@ void LLPanelClassified::setDefaultAccessCombo() ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// - -std::string SET_LOCATION_NOTICE1("(will update after save)"); - LLPanelClassifiedInfo::LLPanelClassifiedInfo() : LLPanel() + , mInfoLoaded(false) { } @@ -1204,6 +1202,7 @@ void LLPanelClassifiedInfo::onOpen(const LLSD& key) LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this); LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId()); + setInfoLoaded(false); } void LLPanelClassifiedInfo::processProperties(void* data, EAvatarProcessorType type) @@ -1211,19 +1210,25 @@ void LLPanelClassifiedInfo::processProperties(void* data, EAvatarProcessorType t if(APT_CLASSIFIED_INFO == type) { LLAvatarClassifiedInfo* c_info = static_cast(data); - if(data && getClassifiedId() == c_info->classified_id) + if(c_info && getClassifiedId() == c_info->classified_id) { setClassifiedName(c_info->name); setDescription(c_info->description); setSnapshotId(c_info->snapshot_id); + setParcelId(c_info->parcel_id); setClassifiedLocation(createLocationText(c_info->parcel_name, c_info->sim_name, c_info->pos_global)); childSetValue("category", LLClassifiedInfo::sCategories[c_info->category]); + static std::string mature_str = getString("type_mature"); + static std::string pg_str = getString("type_pg"); + bool mature = is_cf_mature(c_info->flags); - childSetValue("content_type", mature ? "Mature" : "PG Content"); + childSetValue("content_type", mature ? mature_str : pg_str); childSetValue("auto_renew", is_cf_auto_renew(c_info->flags)); childSetTextArg("price_for_listing", "[PRICE]", llformat("%d", c_info->price_for_listing)); + + setInfoLoaded(true); } } } @@ -1240,6 +1245,9 @@ void LLPanelClassifiedInfo::resetData() void LLPanelClassifiedInfo::resetControls() { + childSetValue("category", LLStringUtil::null); + childSetValue("content_type", LLStringUtil::null); + if(getAvatarId() == gAgent.getID()) { childSetEnabled("edit_btn", TRUE); @@ -1327,9 +1335,12 @@ void LLPanelClassifiedInfo::onExit() ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// +static const S32 CB_ITEM_MATURE = 0; +static const S32 CB_ITEM_PG = 1; +static std::string SET_LOCATION_NOTICE("(will update after save)"); + LLPanelClassifiedEdit::LLPanelClassifiedEdit() : LLPanelClassifiedInfo() - , mSnapshotCtrl(NULL) , mNewClassified(false) { } @@ -1350,8 +1361,8 @@ BOOL LLPanelClassifiedEdit::postBuild() { LLPanelClassifiedInfo::postBuild(); - mSnapshotCtrl = getChild("classified_snapshot"); - mSnapshotCtrl->setOnSelectCallback(boost::bind(&LLPanelClassifiedEdit::onSnapshotChanged, this, _1)); + LLTextureCtrl* snapshot = getChild("classified_snapshot"); + snapshot->setOnSelectCallback(boost::bind(&LLPanelClassifiedEdit::onClassifiedChanged, this)); LLLineEditor* line_edit = getChild("classified_name"); line_edit->setKeystrokeCallback(boost::bind(&LLPanelClassifiedEdit::onClassifiedChanged, this), NULL); @@ -1365,15 +1376,12 @@ BOOL LLPanelClassifiedEdit::postBuild() iter != LLClassifiedInfo::sCategories.end(); iter++) { - combobox->add(LLTrans::getString(iter->second), (void *)((intptr_t)iter->first), ADD_BOTTOM); + combobox->add(LLTrans::getString(iter->second)); } - - combobox->setCurrentByIndex(0); - combobox->setCommitCallback(boost::bind(&LLPanelClassifiedEdit::onClassifiedChanged, this)); - combobox = getChild("content_type"); combobox->setCommitCallback(boost::bind(&LLPanelClassifiedEdit::onClassifiedChanged, this)); + childSetCommitCallback("content_type", boost::bind(&LLPanelClassifiedEdit::onClassifiedChanged, this), NULL); childSetCommitCallback("price_for_listing", boost::bind(&LLPanelClassifiedEdit::onClassifiedChanged, this), NULL); childSetCommitCallback("auto_renew", boost::bind(&LLPanelClassifiedEdit::onClassifiedChanged, this), NULL); @@ -1417,7 +1425,8 @@ void LLPanelClassifiedEdit::onOpen(const LLSD& key) childSetValue("classified_name", makeClassifiedName()); childSetValue("classified_desc", desc); setSnapshotId(snapshot_id); - setClassifiedLocation(createLocationText(region_name, LLStringUtil::null, getPosGlobal())); + setClassifiedLocation(createLocationText(SET_LOCATION_NOTICE, region_name, getPosGlobal())); + // server will set valid parcel id setParcelId(LLUUID::null); enableSaveButton(true); @@ -1431,6 +1440,7 @@ void LLPanelClassifiedEdit::onOpen(const LLSD& key) } resetDirty(); + setInfoLoaded(false); } void LLPanelClassifiedEdit::processProperties(void* data, EAvatarProcessorType type) @@ -1438,11 +1448,14 @@ void LLPanelClassifiedEdit::processProperties(void* data, EAvatarProcessorType t if(APT_CLASSIFIED_INFO == type) { LLAvatarClassifiedInfo* c_info = static_cast(data); - if(data && getClassifiedId() == c_info->classified_id) + if(c_info && getClassifiedId() == c_info->classified_id) { setClassifiedName(c_info->name); setDescription(c_info->description); setSnapshotId(c_info->snapshot_id); + // setParcelId(c_info->parcel_id); + setPosGlobal(c_info->pos_global); + setClassifiedLocation(createLocationText(c_info->parcel_name, c_info->sim_name, c_info->pos_global)); getChild("category")->setCurrentByIndex(c_info->category + 1); getChild("category")->resetDirty(); @@ -1450,11 +1463,12 @@ void LLPanelClassifiedEdit::processProperties(void* data, EAvatarProcessorType t bool mature = is_cf_mature(c_info->flags); bool auto_renew = is_cf_auto_renew(c_info->flags); - getChild("content_type")->setCurrentByIndex(mature ? 0 : 1); + getChild("content_type")->setCurrentByIndex(mature ? CB_ITEM_MATURE : CB_ITEM_PG); childSetValue("auto_renew", auto_renew); childSetValue("price_for_listing", c_info->price_for_listing); resetDirty(); + setInfoLoaded(true); } } } @@ -1467,11 +1481,11 @@ BOOL LLPanelClassifiedEdit::isDirty() const BOOL dirty = false; dirty |= LLPanelClassifiedInfo::isDirty(); - dirty |= mSnapshotCtrl->isDirty(); - dirty |= getChild("classified_name")->isDirty(); - dirty |= getChild("classified_desc")->isDirty(); - dirty |= getChild("category")->isDirty(); - dirty |= getChild("content_type")->isDirty(); + dirty |= getChild("classified_snapshot")->isDirty(); + dirty |= getChild("classified_name")->isDirty(); + dirty |= getChild("classified_desc")->isDirty(); + dirty |= getChild("category")->isDirty(); + dirty |= getChild("content_type")->isDirty(); dirty |= getChild("auto_renew")->isDirty(); dirty |= getChild("price_for_listing")->isDirty(); @@ -1481,7 +1495,7 @@ BOOL LLPanelClassifiedEdit::isDirty() const void LLPanelClassifiedEdit::resetDirty() { LLPanelClassifiedInfo::resetDirty(); - mSnapshotCtrl->resetDirty(); + getChild("classified_snapshot")->resetDirty(); getChild("classified_name")->resetDirty(); getChild("classified_desc")->resetDirty(); getChild("category")->resetDirty(); @@ -1546,7 +1560,7 @@ U8 LLPanelClassifiedEdit::getClassifiedFlags() bool auto_renew = childGetValue("auto_renew").asBoolean(); LLComboBox* content_cb = getChild("content_type"); - bool mature = content_cb->getCurrentIndex() == 0; + bool mature = content_cb->getCurrentIndex() == CB_ITEM_MATURE; return pack_classified_flags_request(auto_renew, false, mature, false);; } @@ -1595,7 +1609,7 @@ void LLPanelClassifiedEdit::onClickSetLocation() region_name = region->getName(); } - setClassifiedLocation(createLocationText(region_name, LLStringUtil::null, getPosGlobal())); + setClassifiedLocation(createLocationText(SET_LOCATION_NOTICE, region_name, getPosGlobal())); // mark classified as dirty setValue(LLSD()); @@ -1603,11 +1617,6 @@ void LLPanelClassifiedEdit::onClickSetLocation() onClassifiedChanged(); } -void LLPanelClassifiedEdit::onSnapshotChanged(LLUICtrl* ctrl) -{ - -} - void LLPanelClassifiedEdit::onClassifiedChanged() { if(isDirty()) @@ -1623,12 +1632,6 @@ void LLPanelClassifiedEdit::onClassifiedChanged() void LLPanelClassifiedEdit::onClickSave() { sendUpdate(); - -// LLAvatarPropertiesProcessor::getInstance()->sendAvatarClassifiedsRequest(getAvatarId()); - - LLSD params; - params["action"] = "save_classified"; - notifyParent(params); } //EOF diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index eccc83cf53..7e384824ab 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -208,8 +208,6 @@ public: virtual ~LLPanelClassifiedInfo(); - virtual void setExitCallback(const commit_callback_t& cb); - /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ BOOL postBuild(); @@ -218,7 +216,7 @@ public: virtual void setAvatarId(const LLUUID& avatar_id) { mAvatarId = avatar_id; } - LLUUID& getAvatarId() { return mAvatarId; } + virtual LLUUID& getAvatarId() { return mAvatarId; } virtual void setSnapshotId(const LLUUID& id); @@ -242,6 +240,16 @@ public: virtual LLVector3d& getPosGlobal() { return mPosGlobal; } + virtual void setParcelId(const LLUUID& id) { mParcelId = id; } + + virtual LLUUID getParcelId() { return mParcelId; } + + virtual bool getInfoLoaded() { return mInfoLoaded; } + + virtual void setInfoLoaded(bool loaded) { mInfoLoaded = loaded; } + + virtual void setExitCallback(const commit_callback_t& cb); + protected: LLPanelClassifiedInfo(); @@ -265,6 +273,8 @@ private: LLUUID mAvatarId; LLUUID mClassifiedId; LLVector3d mPosGlobal; + LLUUID mParcelId; + bool mInfoLoaded; }; class LLPanelClassifiedEdit : public LLPanelClassifiedInfo @@ -305,23 +315,15 @@ protected: std::string makeClassifiedName(); - void setParcelId(const LLUUID& id) { mParcelId = id; } - - LLUUID getParcelId() { return mParcelId; } - S32 getPriceForListing(); U8 getClassifiedFlags(); void onClickSetLocation(); - void onSnapshotChanged(LLUICtrl* ctrl); void onClassifiedChanged(); void onClickSave(); private: - LLTextureCtrl* mSnapshotCtrl; - - LLUUID mParcelId; bool mNewClassified; }; diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 7b7667c147..2129fe473a 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -73,9 +73,19 @@ static LLRegisterPanelClassWrapper t_panel_picks("panel_picks"); ////////////////////////////////////////////////////////////////////////// +/** + * Copy&Pasted from old LLPanelClassified. This class does nothing at the moment. + * Subscribing to "classifiedclickthrough" removes a few warnings. + */ class LLClassifiedClickThrough : public LLDispatchHandler { public: + + // "classifiedclickthrough" + // strings[0] = classified_id + // strings[1] = teleport_clicks + // strings[2] = map_clicks + // strings[3] = profile_clicks virtual bool operator()( const LLDispatcher* dispatcher, const std::string& key, @@ -85,15 +95,6 @@ public: if (strings.size() != 4) return false; - // LLUUID classified_id(strings[0]); - // S32 teleport_clicks = atoi(strings[1].c_str()); - // S32 map_clicks = atoi(strings[2].c_str()); - // S32 profile_clicks = atoi(strings[3].c_str()); - // LLPanelClassified::setClickThrough(classified_id, teleport_clicks, - // map_clicks, - // profile_clicks, - // false); - return true; } }; @@ -115,10 +116,11 @@ LLPanelPicks::LLPanelPicks() mPicksAccTab(NULL), mClassifiedsAccTab(NULL), mPanelClassifiedInfo(NULL), - mPanelClassifiedEdit(NULL) + mPanelClassifiedEdit(NULL), + mClickThroughDisp(NULL) { - gGenericDispatcher.addHandler("classifiedclickthrough", - new LLClassifiedClickThrough()); + mClickThroughDisp = new LLClassifiedClickThrough(); + gGenericDispatcher.addHandler("classifiedclickthrough", mClickThroughDisp); } LLPanelPicks::~LLPanelPicks() @@ -127,6 +129,8 @@ LLPanelPicks::~LLPanelPicks() { LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this); } + + delete mClickThroughDisp; } void* LLPanelPicks::create(void* data /* = NULL */) @@ -693,14 +697,26 @@ void LLPanelPicks::onPanelClassifiedSave(LLPanelClassifiedEdit* panel) LLSD c_value; c_value.insert(CLASSIFIED_ID, c_item->getClassifiedId()); c_value.insert(CLASSIFIED_NAME, c_item->getClassifiedName()); - mClassifiedsList->addItem(c_item, c_value); + mClassifiedsList->addItem(c_item, c_value, ADD_TOP); c_item->setDoubleClickCallback(boost::bind(&LLPanelPicks::onDoubleClickClassifiedItem, this, _1)); c_item->setRightMouseUpCallback(boost::bind(&LLPanelPicks::onRightMouseUpItem, this, _1, _2, _3, _4)); c_item->setMouseUpCallback(boost::bind(&LLPanelPicks::updateButtons, this)); c_item->childSetAction("info_chevron", boost::bind(&LLPanelPicks::onClickInfo, this)); } - else + else + { + onPanelClassifiedClose(panel); + return; + } + + onPanelPickClose(panel); + updateButtons(); +} + +void LLPanelPicks::onPanelClassifiedClose(LLPanelClassifiedInfo* panel) +{ + if(panel->getInfoLoaded()) { std::vector values; mClassifiedsList->getValues(values); @@ -739,7 +755,7 @@ void LLPanelPicks::createClassifiedInfoPanel() if(!mPanelClassifiedInfo) { mPanelClassifiedInfo = LLPanelClassifiedInfo::create(); - mPanelClassifiedInfo->setExitCallback(boost::bind(&LLPanelPicks::onPanelPickClose, this, mPanelClassifiedInfo)); + mPanelClassifiedInfo->setExitCallback(boost::bind(&LLPanelPicks::onPanelClassifiedClose, this, mPanelClassifiedInfo)); mPanelClassifiedInfo->setVisible(FALSE); } } @@ -749,9 +765,9 @@ void LLPanelPicks::createClassifiedEditPanel() if(!mPanelClassifiedEdit) { mPanelClassifiedEdit = LLPanelClassifiedEdit::create(); - mPanelClassifiedEdit->setExitCallback(boost::bind(&LLPanelPicks::onPanelPickClose, this, mPanelClassifiedEdit)); + mPanelClassifiedEdit->setExitCallback(boost::bind(&LLPanelPicks::onPanelClassifiedClose, this, mPanelClassifiedEdit)); mPanelClassifiedEdit->setSaveCallback(boost::bind(&LLPanelPicks::onPanelClassifiedSave, this, mPanelClassifiedEdit)); - mPanelClassifiedEdit->setCancelCallback(boost::bind(&LLPanelPicks::onPanelPickClose, this, mPanelClassifiedEdit)); + mPanelClassifiedEdit->setCancelCallback(boost::bind(&LLPanelPicks::onPanelClassifiedClose, this, mPanelClassifiedEdit)); mPanelClassifiedEdit->setVisible(FALSE); } } diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index b30036c603..68ad2436ee 100644 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -55,6 +55,7 @@ class LLPanelPickEdit; class LLToggleableMenu; class LLPanelClassifiedInfo; class LLPanelClassifiedEdit; +class LLClassifiedClickThrough; class LLPanelPicks : public LLPanelProfileTab @@ -101,6 +102,7 @@ private: void onPanelPickClose(LLPanel* panel); void onPanelPickSave(LLPanel* panel); void onPanelClassifiedSave(LLPanelClassifiedEdit* panel); + void onPanelClassifiedClose(LLPanelClassifiedInfo* panel); void onPanelPickEdit(); void onPanelClassifiedEdit(); void onClickMenuEdit(); @@ -146,6 +148,8 @@ private: LLAccordionCtrlTab* mPicksAccTab; LLAccordionCtrlTab* mClassifiedsAccTab; + + LLClassifiedClickThrough* mClickThroughDisp; }; class LLPickItem : public LLPanel, public LLAvatarPropertiesObserver diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index b0a71f1ebe..02f45c1b48 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -243,10 +243,6 @@ void LLPanelProfile::notifyParent(const LLSD& info) onOpen(info); return; } - else if("save_classified" == action) - { - // onOpen(info); - return; - } + LLPanel::notifyParent(info); } diff --git a/indra/newview/skins/default/xui/en/panel_classified_info.xml b/indra/newview/skins/default/xui/en/panel_classified_info.xml index b7a54a7eea..bdca8531dc 100644 --- a/indra/newview/skins/default/xui/en/panel_classified_info.xml +++ b/indra/newview/skins/default/xui/en/panel_classified_info.xml @@ -9,6 +9,14 @@ name="panel_classified_info" top="0" width="333"> + + Mature + + + PG Content + + diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index cbcc3f10ad..5975bb41fd 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -24,6 +24,7 @@ filename="panel_main_inventory.xml" follows="all" layout="topleft" + hide_top_panel="true" left="0" name="panel_main_inventory" top="0" -- cgit v1.2.3 From cc864d86ce91cd26edc3796acbd9580de4fafbc8 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 11 Nov 2009 18:06:44 +0000 Subject: outgoing call dialog. doesn't do anything and is ugly/wrong, but it exists. WIP. --- indra/newview/llimview.cpp | 32 ++++++++++------------ indra/newview/llimview.h | 3 +- indra/newview/llvoicechannel.cpp | 5 +++- .../skins/default/xui/en/floater_outgoing_call.xml | 22 +++++++-------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 33bd483367..bd3ee51c15 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1103,39 +1103,35 @@ LLIMMgr::onConfirmForceCloseError( // Class LLOutgoingCallDialog //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LLOutgoingCallDialog::LLOutgoingCallDialog(const LLSD& payload) : - LLModalDialog(payload), + LLDockableFloater(NULL, payload), mPayload(payload) { } BOOL LLOutgoingCallDialog::postBuild() { - LLSD caller_id = mPayload["caller_id"]; - EInstantMessage type = (EInstantMessage)mPayload["type"].asInteger(); + BOOL success = LLFloater::postBuild(); - std::string call_type = getString("VoiceInviteP2P"); - std::string caller_name = mPayload["caller_name"].asString(); - if (caller_name == "anonymous") + LLSD callee_id = mPayload["session_id"];//mPayload["caller_id"]; + + std::string calling_str = getString("calling"); + std::string callee_name = mPayload["session_name"].asString();//mPayload["caller_name"].asString(); + if (callee_name == "anonymous") { - caller_name = getString("anonymous"); + callee_name = getString("anonymous"); } - setTitle(caller_name + " " + call_type); - - // If it is not a P2P invite, then it's an AdHoc invite - if ( type != IM_SESSION_P2P_INVITE ) - { - call_type = getString("VoiceInviteAdHoc"); - } + setTitle(callee_name); - LLUICtrl* caller_name_widget = getChild("caller name"); - caller_name_widget->setValue(caller_name + " " + call_type); + LLUICtrl* callee_name_widget = getChild("callee name"); + // *TODO: substitute callee name properly + callee_name_widget->setValue(calling_str + " " + callee_name); LLAvatarIconCtrl* icon = getChild("avatar_icon"); - icon->setValue(caller_id); + icon->setValue(callee_id); //childSetAction("Reject", onReject, this); - return TRUE; + return success; } void LLOutgoingCallDialog::processCallResponse(S32 response) diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 942a8f96d0..105ff8dcbb 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -37,6 +37,7 @@ #include "llspeakers.h" //for LLIMSpeakerMgr #include "llimpanel.h" //for voice channels #include "llmodaldialog.h" +#include "lldockablefloater.h" #include "llinstantmessage.h" #include "lluuid.h" #include "llmultifloater.h" @@ -418,7 +419,7 @@ private: LLSD mPayload; }; -class LLOutgoingCallDialog : public LLModalDialog +class LLOutgoingCallDialog : public LLDockableFloater { public: LLOutgoingCallDialog(const LLSD& payload); diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 04ae44e08d..b0ea07946c 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -385,8 +385,11 @@ void LLVoiceChannel::setState(EState state) switch(state) { case STATE_RINGING: - LLFloaterReg::showInstance("outgoing_call", payload, TRUE); llinfos << "RINGINGGGGGGGG " << mSessionName << llendl; + if (!mSessionName.empty()) + { + LLFloaterReg::showInstance("outgoing_call", payload, TRUE); + } gIMMgr->addSystemMessage(mSessionID, "ringing", mNotifyArgs); break; case STATE_CONNECTED: diff --git a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml index 3838fe4bc7..fd936232c9 100644 --- a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml +++ b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml @@ -15,8 +15,8 @@ anonymous - is calling. + name="calling"> + Calling [CALLEE] @@ -38,35 +38,35 @@ layout="topleft" left="77" max_length="2147483647" - name="caller name" + name="callee name" read_only="true" top="21" width="163" word_wrap="true" /> + + + + + - + + thumb_image_disabled="SliderThumb_Disabled" + track_image_horizontal="SliderTrack_Horiz" + track_image_vertical="SliderTrack_Vert" + track_highlight_horizontal_image="SliderTrack_Horiz" + track_highlight_vertical_image="SliderTrack_Vert" /> -- cgit v1.2.3 From 978dd80c963911372b0d311fec01b9d4de279c11 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Thu, 12 Nov 2009 19:54:45 +0200 Subject: Implemented major sub-task EXT-2364 (Items in group/ad-hoc IM participant list (avatar names) should be reshaped when adding/removing the "(Moderator)" label) --HG-- branch : product-engine --- indra/newview/llavatarlistitem.cpp | 15 +++++++++++++++ indra/newview/llavatarlistitem.h | 2 ++ indra/newview/llparticipantlist.cpp | 2 ++ 3 files changed, 19 insertions(+) diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 7df278d887..c670a65bcc 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -311,3 +311,18 @@ void LLAvatarListItem::onNameCache(const std::string& first_name, const std::str mAvatarName->setValue(name); mAvatarName->setToolTip(name); } + +void LLAvatarListItem::reshapeAvatarName() +{ + S32 width_delta = 0; + width_delta += mShowProfileBtn ? mProfileBtnWidth : 0; + width_delta += mSpeakingIndicator->getVisible() ? mSpeakingIndicatorWidth : 0; + width_delta += mAvatarIcon->getVisible() ? mIconWidth : 0; + width_delta += mShowInfoBtn ? mInfoBtnWidth : 0; + width_delta += mLastInteractionTime->getVisible() ? mLastInteractionTime->getRect().getWidth() : 0; + + S32 height = mAvatarName->getRect().getHeight(); + S32 width = getRect().getWidth() - width_delta; + + mAvatarName->reshape(width, height); +} diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index d379797a46..9d48101a44 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -82,6 +82,8 @@ public: void setContextMenu(ContextMenu* menu) { mContextMenu = menu; } + void reshapeAvatarName(); + private: typedef enum e_online_status { diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index f5367c0477..13bd059d45 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -130,6 +130,7 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param) { name.erase(found, moderator_indicator_len); item->setName(name); + item->reshapeAvatarName(); } } } @@ -151,6 +152,7 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param) name += " "; name += moderator_indicator; item->setName(name); + item->reshapeAvatarName(); } } } -- cgit v1.2.3 From 700085a093c71023703b43ca19e7ba114f2183ff Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Thu, 12 Nov 2009 18:03:01 +0000 Subject: EXT-2367: Fixed potential NULL dereference crash in voice chat. --- indra/newview/llimpanel.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 0b8b5935f8..87b801d73b 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -848,8 +848,11 @@ void LLFloaterIMPanel::processSessionUpdate(const LLSD& session_update) } - //update the speakers dropdown too - mSpeakerPanel->setVoiceModerationCtrlMode(voice_moderated); + //update the speakers dropdown too, if it's available + if (mSpeakerPanel) + { + mSpeakerPanel->setVoiceModerationCtrlMode(voice_moderated); + } } } -- cgit v1.2.3 From 1d78ebedbd5da89c2a3180fdb1e6aae81510a86c Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 12 Nov 2009 10:19:23 -0800 Subject: don't use LLWidgetTypeRegistry for now (useful only for schema generation) reverted ui_ctrl registration for creation of dummy LLUICtrls --- indra/llui/lluictrl.cpp | 2 +- indra/llui/lluictrlfactory.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index dd807a3f7e..08fc8fb784 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -38,7 +38,7 @@ #include "llpanel.h" #include "lluictrlfactory.h" -static LLWidgetNameRegistry::StaticRegistrar r(&typeid(LLUICtrl::Params), "ui_ctrl"); +static LLDefaultChildRegistry::Register r("ui_ctrl"); LLUICtrl::Params::Params() : tab_stop("tab_stop", true), diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index adfbb41feb..1c1450d7e9 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -433,8 +433,8 @@ void LLUICtrlFactory::registerWidget(const std::type_info* widget_type, const st LLWidgetNameRegistry ::instance().defaultRegistrar().add(param_block_type, tag); // associate widget type with factory function LLDefaultWidgetRegistry::instance().defaultRegistrar().add(widget_type, creator_func); - LLWidgetTypeRegistry::instance().defaultRegistrar().add(tag, widget_type); //FIXME: comment this in when working on schema generation + //LLWidgetTypeRegistry::instance().defaultRegistrar().add(tag, widget_type); //LLDefaultParamBlockRegistry::instance().defaultRegistrar().add(widget_type, &getEmptyParamBlock); } -- cgit v1.2.3 From a4467f7245dd39b771f8bb210e6ea08ca0408d66 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Thu, 12 Nov 2009 10:19:30 -0800 Subject: Minimized floaters will now follow top left when main view is resized --- indra/llui/llfloater.cpp | 61 +++++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 470ae45414..2a0dcaf333 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1888,41 +1888,50 @@ void LLFloaterView::reshapeFloater(S32 width, S32 height, BOOL called_from_paren // dependents use same follow flags as their "dependee" continue; } - LLRect r = floaterp->getRect(); - - // Compute absolute distance from each edge of screen - S32 left_offset = llabs(r.mLeft - 0); - S32 right_offset = llabs(old_width - r.mRight); - - S32 top_offset = llabs(old_height - r.mTop); - S32 bottom_offset = llabs(r.mBottom - 0); // Make if follow the edge it is closest to U32 follow_flags = 0x0; - if (left_offset < right_offset) + if (floaterp->isMinimized()) { - follow_flags |= FOLLOWS_LEFT; + follow_flags |= (FOLLOWS_LEFT | FOLLOWS_TOP); } else { - follow_flags |= FOLLOWS_RIGHT; - } + LLRect r = floaterp->getRect(); - // "No vertical adjustment" usually means that the bottom of the view - // has been pushed up or down. Hence we want the floaters to follow - // the top. - if (!adjust_vertical) - { - follow_flags |= FOLLOWS_TOP; - } - else if (top_offset < bottom_offset) - { - follow_flags |= FOLLOWS_TOP; - } - else - { - follow_flags |= FOLLOWS_BOTTOM; + // Compute absolute distance from each edge of screen + S32 left_offset = llabs(r.mLeft - 0); + S32 right_offset = llabs(old_width - r.mRight); + + S32 top_offset = llabs(old_height - r.mTop); + S32 bottom_offset = llabs(r.mBottom - 0); + + + if (left_offset < right_offset) + { + follow_flags |= FOLLOWS_LEFT; + } + else + { + follow_flags |= FOLLOWS_RIGHT; + } + + // "No vertical adjustment" usually means that the bottom of the view + // has been pushed up or down. Hence we want the floaters to follow + // the top. + if (!adjust_vertical) + { + follow_flags |= FOLLOWS_TOP; + } + else if (top_offset < bottom_offset) + { + follow_flags |= FOLLOWS_TOP; + } + else + { + follow_flags |= FOLLOWS_BOTTOM; + } } floaterp->setFollows(follow_flags); -- cgit v1.2.3 From 74d5a6605bac7ae76889ce3697fc8f59d982d675 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Thu, 12 Nov 2009 20:23:43 +0200 Subject: Fixed normal bug EXT-2375 (Nearby Chat: Click on object name spawns Person Inspector instead of Object Inspector) --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 43a1aeaefb..046e1d92dc 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -167,7 +167,15 @@ public: void onHeaderPanelClick(S32 x, S32 y, MASK mask) { - LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", mAvatarID)); + if (mSourceType == CHAT_SOURCE_OBJECT) + { + LLFloaterReg::showInstance("inspect_object", LLSD().insert("object_id", mAvatarID)); + } + else if (mSourceType == CHAT_SOURCE_AGENT) + { + LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", mAvatarID)); + } + //if chat source is system, you may add "else" here to define behaviour. } const LLUUID& getAvatarId () const { return mAvatarID;} -- cgit v1.2.3 From 6eb5f380e3320fb181ad5720f82b6b2fd2d7baf5 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 12 Nov 2009 13:40:01 -0500 Subject: Extracted LLInventoryObserver classes from LLInventoryModel.h into their own subclass, LLInventoryObservers.h. This reduces dependencies and compile times, and makes these classes easier to locate. I have not yet refactored classes to remove #include "llinventorymodel.h" and replace with #include "llinventoryobservers.h". This will happen later. --- indra/newview/CMakeLists.txt | 2 + indra/newview/llinventorymodel.cpp | 507 ------------------------------------- indra/newview/llinventorymodel.h | 231 ++--------------- 3 files changed, 17 insertions(+), 723 deletions(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index b129bca1f3..3b7f902032 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -252,6 +252,7 @@ set(viewer_SOURCE_FILES llinventoryfilter.cpp llinventoryfunctions.cpp llinventorymodel.cpp + llinventoryobservers.cpp llinventorypanel.cpp llinventorysubtreepanel.cpp lljoystickbutton.cpp @@ -748,6 +749,7 @@ set(viewer_HEADER_FILES llinventoryfilter.h llinventoryfunctions.h llinventorymodel.h + llinventoryobservers.h llinventorypanel.h llinventorysubtreepanel.h lljoystickbutton.h diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index c57e41e9b3..4b0d524906 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -3721,513 +3721,6 @@ bool LLNameCategoryCollector::operator()( return false; } - - -///---------------------------------------------------------------------------- -/// Observers -///---------------------------------------------------------------------------- - -void LLInventoryCompletionObserver::changed(U32 mask) -{ - // scan through the incomplete items and move or erase them as - // appropriate. - if(!mIncomplete.empty()) - { - for(item_ref_t::iterator it = mIncomplete.begin(); it < mIncomplete.end(); ) - { - LLViewerInventoryItem* item = gInventory.getItem(*it); - if(!item) - { - it = mIncomplete.erase(it); - continue; - } - if(item->isComplete()) - { - mComplete.push_back(*it); - it = mIncomplete.erase(it); - continue; - } - ++it; - } - if(mIncomplete.empty()) - { - done(); - } - } -} - -void LLInventoryCompletionObserver::watchItem(const LLUUID& id) -{ - if(id.notNull()) - { - mIncomplete.push_back(id); - } -} - - -void LLInventoryFetchObserver::changed(U32 mask) -{ - // scan through the incomplete items and move or erase them as - // appropriate. - if(!mIncomplete.empty()) - { - for(item_ref_t::iterator it = mIncomplete.begin(); it < mIncomplete.end(); ) - { - LLViewerInventoryItem* item = gInventory.getItem(*it); - if(!item) - { - // BUG: This can cause done() to get called prematurely below. - // This happens with the LLGestureInventoryFetchObserver that - // loads gestures at startup. JC - it = mIncomplete.erase(it); - continue; - } - if(item->isComplete()) - { - mComplete.push_back(*it); - it = mIncomplete.erase(it); - continue; - } - ++it; - } - if(mIncomplete.empty()) - { - done(); - } - } - //llinfos << "LLInventoryFetchObserver::changed() mComplete size " << mComplete.size() << llendl; - //llinfos << "LLInventoryFetchObserver::changed() mIncomplete size " << mIncomplete.size() << llendl; -} - -bool LLInventoryFetchObserver::isEverythingComplete() const -{ - return mIncomplete.empty(); -} - -void fetch_items_from_llsd(const LLSD& items_llsd) -{ - if (!items_llsd.size()) return; - LLSD body; - body[0]["cap_name"] = "FetchInventory"; - body[1]["cap_name"] = "FetchLib"; - for (S32 i=0; i= body[i].size()) continue; - std::string url = gAgent.getRegion()->getCapability(body[i]["cap_name"].asString()); - - if (!url.empty()) - { - body[i]["agent_id"] = gAgent.getID(); - LLHTTPClient::post(url, body[i], new LLInventoryModel::fetchInventoryResponder(body[i])); - break; - } - - LLMessageSystem* msg = gMessageSystem; - BOOL start_new_message = TRUE; - for (S32 j=0; jnewMessageFast(_PREHASH_FetchInventory); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - } - msg->nextBlockFast(_PREHASH_InventoryData); - msg->addUUIDFast(_PREHASH_OwnerID, item_entry["owner_id"].asUUID()); - msg->addUUIDFast(_PREHASH_ItemID, item_entry["item_id"].asUUID()); - if(msg->isSendFull(NULL)) - { - start_new_message = TRUE; - gAgent.sendReliableMessage(); - } - } - if(!start_new_message) - { - gAgent.sendReliableMessage(); - } - } -} - -void LLInventoryFetchObserver::fetchItems( - const LLInventoryFetchObserver::item_ref_t& ids) -{ - LLUUID owner_id; - LLSD items_llsd; - for(item_ref_t::const_iterator it = ids.begin(); it < ids.end(); ++it) - { - LLViewerInventoryItem* item = gInventory.getItem(*it); - if(item) - { - if(item->isComplete()) - { - // It's complete, so put it on the complete container. - mComplete.push_back(*it); - continue; - } - else - { - owner_id = item->getPermissions().getOwner(); - } - } - else - { - // assume it's agent inventory. - owner_id = gAgent.getID(); - } - - // It's incomplete, so put it on the incomplete container, and - // pack this on the message. - mIncomplete.push_back(*it); - - // Prepare the data to fetch - LLSD item_entry; - item_entry["owner_id"] = owner_id; - item_entry["item_id"] = (*it); - items_llsd.append(item_entry); - } - fetch_items_from_llsd(items_llsd); -} - -// virtual -void LLInventoryFetchDescendentsObserver::changed(U32 mask) -{ - for(folder_ref_t::iterator it = mIncompleteFolders.begin(); it < mIncompleteFolders.end();) - { - LLViewerInventoryCategory* cat = gInventory.getCategory(*it); - if(!cat) - { - it = mIncompleteFolders.erase(it); - continue; - } - if(isComplete(cat)) - { - mCompleteFolders.push_back(*it); - it = mIncompleteFolders.erase(it); - continue; - } - ++it; - } - if(mIncompleteFolders.empty()) - { - done(); - } -} - -void LLInventoryFetchDescendentsObserver::fetchDescendents( - const folder_ref_t& ids) -{ - for(folder_ref_t::const_iterator it = ids.begin(); it != ids.end(); ++it) - { - LLViewerInventoryCategory* cat = gInventory.getCategory(*it); - if(!cat) continue; - if(!isComplete(cat)) - { - cat->fetchDescendents(); //blindly fetch it without seeing if anything else is fetching it. - mIncompleteFolders.push_back(*it); //Add to list of things being downloaded for this observer. - } - else - { - mCompleteFolders.push_back(*it); - } - } -} - -bool LLInventoryFetchDescendentsObserver::isEverythingComplete() const -{ - return mIncompleteFolders.empty(); -} - -bool LLInventoryFetchDescendentsObserver::isComplete(LLViewerInventoryCategory* cat) -{ - S32 version = cat->getVersion(); - S32 descendents = cat->getDescendentCount(); - if((LLViewerInventoryCategory::VERSION_UNKNOWN == version) - || (LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN == descendents)) - { - return false; - } - // it might be complete - check known descendents against - // currently available. - LLInventoryModel::cat_array_t* cats; - LLInventoryModel::item_array_t* items; - gInventory.getDirectDescendentsOf(cat->getUUID(), cats, items); - if(!cats || !items) - { - // bit of a hack - pretend we're done if they are gone or - // incomplete. should never know, but it would suck if this - // kept tight looping because of a corrupt memory state. - return true; - } - S32 known = cats->count() + items->count(); - if(descendents == known) - { - // hey - we're done. - return true; - } - return false; -} - -void LLInventoryFetchComboObserver::changed(U32 mask) -{ - if(!mIncompleteItems.empty()) - { - for(item_ref_t::iterator it = mIncompleteItems.begin(); it < mIncompleteItems.end(); ) - { - LLViewerInventoryItem* item = gInventory.getItem(*it); - if(!item) - { - it = mIncompleteItems.erase(it); - continue; - } - if(item->isComplete()) - { - mCompleteItems.push_back(*it); - it = mIncompleteItems.erase(it); - continue; - } - ++it; - } - } - if(!mIncompleteFolders.empty()) - { - for(folder_ref_t::iterator it = mIncompleteFolders.begin(); it < mIncompleteFolders.end();) - { - LLViewerInventoryCategory* cat = gInventory.getCategory(*it); - if(!cat) - { - it = mIncompleteFolders.erase(it); - continue; - } - if(gInventory.isCategoryComplete(*it)) - { - mCompleteFolders.push_back(*it); - it = mIncompleteFolders.erase(it); - continue; - } - ++it; - } - } - if(!mDone && mIncompleteItems.empty() && mIncompleteFolders.empty()) - { - mDone = true; - done(); - } -} - -void LLInventoryFetchComboObserver::fetch( - const folder_ref_t& folder_ids, - const item_ref_t& item_ids) -{ - lldebugs << "LLInventoryFetchComboObserver::fetch()" << llendl; - for(folder_ref_t::const_iterator fit = folder_ids.begin(); fit != folder_ids.end(); ++fit) - { - LLViewerInventoryCategory* cat = gInventory.getCategory(*fit); - if(!cat) continue; - if(!gInventory.isCategoryComplete(*fit)) - { - cat->fetchDescendents(); - lldebugs << "fetching folder " << *fit <isComplete()) - { - // It's complete, so put it on the complete container. - mCompleteItems.push_back(*iit); - lldebugs << "completing item " << *iit << llendl; - continue; - } - else - { - mIncompleteItems.push_back(*iit); - owner_id = item->getPermissions().getOwner(); - } - if(std::find(mIncompleteFolders.begin(), mIncompleteFolders.end(), item->getParentUUID()) == mIncompleteFolders.end()) - { - LLSD item_entry; - item_entry["owner_id"] = owner_id; - item_entry["item_id"] = (*iit); - items_llsd.append(item_entry); - } - else - { - lldebugs << "not worrying about " << *iit << llendl; - } - } - fetch_items_from_llsd(items_llsd); -} - -void LLInventoryExistenceObserver::watchItem(const LLUUID& id) -{ - if(id.notNull()) - { - mMIA.push_back(id); - } -} - -void LLInventoryExistenceObserver::changed(U32 mask) -{ - // scan through the incomplete items and move or erase them as - // appropriate. - if(!mMIA.empty()) - { - for(item_ref_t::iterator it = mMIA.begin(); it < mMIA.end(); ) - { - LLViewerInventoryItem* item = gInventory.getItem(*it); - if(!item) - { - ++it; - continue; - } - mExist.push_back(*it); - it = mMIA.erase(it); - } - if(mMIA.empty()) - { - done(); - } - } -} - -void LLInventoryAddedObserver::changed(U32 mask) -{ - if(!(mask & LLInventoryObserver::ADD)) - { - return; - } - - // *HACK: If this was in response to a packet off - // the network, figure out which item was updated. - LLMessageSystem* msg = gMessageSystem; - - std::string msg_name; - if (mMessageName.empty()) - { - msg_name = msg->getMessageName(); - } - else - { - msg_name = mMessageName; - } - - if (msg_name.empty()) - { - return; - } - - // We only want newly created inventory items. JC - if ( msg_name != "UpdateCreateInventoryItem") - { - return; - } - - LLPointer titem = new LLViewerInventoryItem; - S32 num_blocks = msg->getNumberOfBlocksFast(_PREHASH_InventoryData); - for(S32 i = 0; i < num_blocks; ++i) - { - titem->unpackMessage(msg, _PREHASH_InventoryData, i); - if (!(titem->getUUID().isNull())) - { - //we don't do anything with null keys - mAdded.push_back(titem->getUUID()); - } - } - if (!mAdded.empty()) - { - done(); - } -} - -LLInventoryTransactionObserver::LLInventoryTransactionObserver( - const LLTransactionID& transaction_id) : - mTransactionID(transaction_id) -{ -} - -void LLInventoryTransactionObserver::changed(U32 mask) -{ - if(mask & LLInventoryObserver::ADD) - { - // This could be it - see if we are processing a bulk update - LLMessageSystem* msg = gMessageSystem; - if(msg->getMessageName() - && (0 == strcmp(msg->getMessageName(), "BulkUpdateInventory"))) - { - // we have a match for the message - now check the - // transaction id. - LLUUID id; - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_TransactionID, id); - if(id == mTransactionID) - { - // woo hoo, we found it - folder_ref_t folders; - item_ref_t items; - S32 count; - count = msg->getNumberOfBlocksFast(_PREHASH_FolderData); - S32 i; - for(i = 0; i < count; ++i) - { - msg->getUUIDFast(_PREHASH_FolderData, _PREHASH_FolderID, id, i); - if(id.notNull()) - { - folders.push_back(id); - } - } - count = msg->getNumberOfBlocksFast(_PREHASH_ItemData); - for(i = 0; i < count; ++i) - { - msg->getUUIDFast(_PREHASH_ItemData, _PREHASH_ItemID, id, i); - if(id.notNull()) - { - items.push_back(id); - } - } - - // call the derived class the implements this method. - done(folders, items); - } - } - } -} - - ///---------------------------------------------------------------------------- /// LLAssetIDMatches ///---------------------------------------------------------------------------- diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index ebfb0a7000..c09d3eba8c 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -41,40 +41,27 @@ #include "lluuid.h" #include "llpermissionsflags.h" #include "llstring.h" - #include #include #include #include -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLInventoryObserver -// -// This class is designed to be a simple abstract base class which can -// relay messages when the inventory changes. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ! REFACTOR ! Remove llinventoryobservers.h and have other files that need it explicitly +// include llinventoryobservers.h instead of llinventorymodel.h . This will reduce dependency on +// llinventorymodel.h. +#include "llinventoryobservers.h" + +class LLInventoryObserver; +class LLInventoryObject; +class LLInventoryItem; +class LLInventoryCategory; +class LLViewerInventoryItem; +class LLViewerInventoryCategory; +class LLViewerInventoryItem; +class LLViewerInventoryCategory; +class LLMessageSystem; +class LLInventoryCollectFunctor; -class LLInventoryObserver -{ -public: - // This enumeration is a way to refer to what changed in a more - // human readable format. You can mask the value provided by - // chaged() to see if the observer is interested in the change. - enum - { - NONE = 0, - LABEL = 1, // name changed - INTERNAL = 2, // internal change, eg, asset uuid different - ADD = 4, // something added - REMOVE = 8, // something deleted - STRUCTURE = 16, // structural change, eg, item or folder moved - CALLING_CARD = 32, // online, grant status, cancel, etc change - ALL = 0xffffffff - }; - virtual ~LLInventoryObserver() {}; - virtual void changed(U32 mask) = 0; - std::string mMessageName; // used by Agent Inventory Service only. [DEV-20328] -}; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInventoryModel @@ -87,16 +74,6 @@ public: //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLInventoryObject; -class LLInventoryItem; -class LLInventoryCategory; -class LLViewerInventoryItem; -class LLViewerInventoryCategory; -class LLViewerInventoryItem; -class LLViewerInventoryCategory; -class LLMessageSystem; -class LLInventoryCollectFunctor; - class LLInventoryModel { public: @@ -771,183 +748,5 @@ public: LLInventoryItem* item); }; - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLInventoryCompletionObserver -// -// Class which can be used as a base class for doing something when -// when all observed items are locally complete. This class implements -// the changed() method of LLInventoryObserver and declares a new -// method named done() which is called when all watched items have -// complete information in the inventory model. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLInventoryCompletionObserver : public LLInventoryObserver -{ -public: - LLInventoryCompletionObserver() {} - virtual void changed(U32 mask); - - void watchItem(const LLUUID& id); - -protected: - virtual void done() = 0; - - typedef std::vector item_ref_t; - item_ref_t mComplete; - item_ref_t mIncomplete; -}; - - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLInventoryFetchObserver -// -// This class is much like the LLInventoryCompletionObserver, except -// that it handles all the the fetching necessary. Override the done() -// method to do the thing you want. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLInventoryFetchObserver : public LLInventoryObserver -{ -public: - LLInventoryFetchObserver() {} - virtual void changed(U32 mask); - - typedef std::vector item_ref_t; - - bool isEverythingComplete() const; - void fetchItems(const item_ref_t& ids); - virtual void done() = 0; - -protected: - item_ref_t mComplete; - item_ref_t mIncomplete; -}; - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLInventoryFetchDescendentsObserver -// -// This class is much like the LLInventoryCompletionObserver, except -// that it handles fetching based on category. Override the done() -// method to do the thing you want. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLInventoryFetchDescendentsObserver : public LLInventoryObserver -{ -public: - LLInventoryFetchDescendentsObserver() {} - virtual void changed(U32 mask); - - typedef std::vector folder_ref_t; - void fetchDescendents(const folder_ref_t& ids); - bool isEverythingComplete() const; - virtual void done() = 0; - -protected: - bool isComplete(LLViewerInventoryCategory* cat); - folder_ref_t mIncompleteFolders; - folder_ref_t mCompleteFolders; -}; - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLInventoryFetchComboObserver -// -// This class does an appropriate combination of fetch descendents and -// item fetches based on completion of categories and items. Much like -// the fetch and fetch descendents, this will call done() when everything -// has arrived. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLInventoryFetchComboObserver : public LLInventoryObserver -{ -public: - LLInventoryFetchComboObserver() : mDone(false) {} - virtual void changed(U32 mask); - - typedef std::vector folder_ref_t; - typedef std::vector item_ref_t; - void fetch(const folder_ref_t& folder_ids, const item_ref_t& item_ids); - - virtual void done() = 0; - -protected: - bool mDone; - folder_ref_t mCompleteFolders; - folder_ref_t mIncompleteFolders; - item_ref_t mCompleteItems; - item_ref_t mIncompleteItems; -}; - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLInventoryExistenceObserver -// -// This class is used as a base class for doing somethign when all the -// observed item ids exist in the inventory somewhere. You can derive -// a class from this class and implement the done() method to do -// something useful. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLInventoryExistenceObserver : public LLInventoryObserver -{ -public: - LLInventoryExistenceObserver() {} - virtual void changed(U32 mask); - - void watchItem(const LLUUID& id); - -protected: - virtual void done() = 0; - - typedef std::vector item_ref_t; - item_ref_t mExist; - item_ref_t mMIA; -}; - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLInventoryAddedObserver -// -// This class is used as a base class for doing something when -// a new item arrives in inventory. -// It does not watch for a certain UUID, rather it acts when anything is added -// Derive a class from this class and implement the done() method to do -// something useful. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLInventoryAddedObserver : public LLInventoryObserver -{ -public: - LLInventoryAddedObserver() : mAdded() {} - virtual void changed(U32 mask); - -protected: - virtual void done() = 0; - - typedef std::vector item_ref_t; - item_ref_t mAdded; -}; - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLInventoryTransactionObserver -// -// Class which can be used as a base class for doing something when an -// inventory transaction completes. -// -// *NOTE: This class is not quite complete. Avoid using unless you fix up it's -// functionality gaps. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLInventoryTransactionObserver : public LLInventoryObserver -{ -public: - LLInventoryTransactionObserver(const LLTransactionID& transaction_id); - virtual void changed(U32 mask); - -protected: - typedef std::vector folder_ref_t; - typedef std::vector item_ref_t; - virtual void done(const folder_ref_t& folders, const item_ref_t& items) = 0; - - LLTransactionID mTransactionID; -}; - - #endif // LL_LLINVENTORYMODEL_H -- cgit v1.2.3 From d53a354a9cc2589a7aa5d2d0cfc83ed0322c5e54 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 12 Nov 2009 13:56:36 -0500 Subject: Rename LLInventoryObservers to LLInventoryObserver --- indra/newview/CMakeLists.txt | 4 +- indra/newview/llinventorymodel.h | 2 +- indra/newview/llinventoryobserver.cpp | 564 ++++++++++++++++++++++++++++++++++ indra/newview/llinventoryobserver.h | 249 +++++++++++++++ 4 files changed, 816 insertions(+), 3 deletions(-) create mode 100644 indra/newview/llinventoryobserver.cpp create mode 100644 indra/newview/llinventoryobserver.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 3b7f902032..9d44f34ea8 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -252,7 +252,7 @@ set(viewer_SOURCE_FILES llinventoryfilter.cpp llinventoryfunctions.cpp llinventorymodel.cpp - llinventoryobservers.cpp + llinventoryobserver.cpp llinventorypanel.cpp llinventorysubtreepanel.cpp lljoystickbutton.cpp @@ -749,7 +749,7 @@ set(viewer_HEADER_FILES llinventoryfilter.h llinventoryfunctions.h llinventorymodel.h - llinventoryobservers.h + llinventoryobserver.h llinventorypanel.h llinventorysubtreepanel.h lljoystickbutton.h diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index c09d3eba8c..bd64591194 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -49,7 +49,7 @@ // ! REFACTOR ! Remove llinventoryobservers.h and have other files that need it explicitly // include llinventoryobservers.h instead of llinventorymodel.h . This will reduce dependency on // llinventorymodel.h. -#include "llinventoryobservers.h" +#include "llinventoryobserver.h" class LLInventoryObserver; class LLInventoryObject; diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp new file mode 100644 index 0000000000..3ccf593d27 --- /dev/null +++ b/indra/newview/llinventoryobserver.cpp @@ -0,0 +1,564 @@ +/** + * @file llinventoryobserver.cpp + * @brief Implementation of the inventory observers used to track agent inventory. + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llinventoryobserver.h" + +#include "llassetstorage.h" +#include "llcrc.h" +#include "lldir.h" +#include "llsys.h" +#include "llxfermanager.h" +#include "message.h" + +#include "llagent.h" +#include "llagentwearables.h" +#include "llfloater.h" +#include "llfocusmgr.h" +#include "llinventorybridge.h" +#include "llinventoryfunctions.h" +#include "llinventorymodel.h" +#include "llviewermessage.h" +#include "llviewerwindow.h" +#include "llviewerregion.h" +#include "llappviewer.h" +#include "lldbstrings.h" +#include "llviewerstats.h" +#include "llmutelist.h" +#include "llnotifications.h" +#include "llcallbacklist.h" +#include "llpreview.h" +#include "llviewercontrol.h" +#include "llvoavatarself.h" +#include "llsdutil.h" +#include + +void LLInventoryCompletionObserver::changed(U32 mask) +{ + // scan through the incomplete items and move or erase them as + // appropriate. + if(!mIncomplete.empty()) + { + for(item_ref_t::iterator it = mIncomplete.begin(); it < mIncomplete.end(); ) + { + LLViewerInventoryItem* item = gInventory.getItem(*it); + if(!item) + { + it = mIncomplete.erase(it); + continue; + } + if(item->isComplete()) + { + mComplete.push_back(*it); + it = mIncomplete.erase(it); + continue; + } + ++it; + } + if(mIncomplete.empty()) + { + done(); + } + } +} + +void LLInventoryCompletionObserver::watchItem(const LLUUID& id) +{ + if(id.notNull()) + { + mIncomplete.push_back(id); + } +} + + +void LLInventoryFetchObserver::changed(U32 mask) +{ + // scan through the incomplete items and move or erase them as + // appropriate. + if(!mIncomplete.empty()) + { + for(item_ref_t::iterator it = mIncomplete.begin(); it < mIncomplete.end(); ) + { + LLViewerInventoryItem* item = gInventory.getItem(*it); + if(!item) + { + // BUG: This can cause done() to get called prematurely below. + // This happens with the LLGestureInventoryFetchObserver that + // loads gestures at startup. JC + it = mIncomplete.erase(it); + continue; + } + if(item->isComplete()) + { + mComplete.push_back(*it); + it = mIncomplete.erase(it); + continue; + } + ++it; + } + if(mIncomplete.empty()) + { + done(); + } + } + //llinfos << "LLInventoryFetchObserver::changed() mComplete size " << mComplete.size() << llendl; + //llinfos << "LLInventoryFetchObserver::changed() mIncomplete size " << mIncomplete.size() << llendl; +} + +bool LLInventoryFetchObserver::isEverythingComplete() const +{ + return mIncomplete.empty(); +} + +void fetch_items_from_llsd(const LLSD& items_llsd) +{ + if (!items_llsd.size()) return; + LLSD body; + body[0]["cap_name"] = "FetchInventory"; + body[1]["cap_name"] = "FetchLib"; + for (S32 i=0; i= body[i].size()) continue; + std::string url = gAgent.getRegion()->getCapability(body[i]["cap_name"].asString()); + + if (!url.empty()) + { + body[i]["agent_id"] = gAgent.getID(); + LLHTTPClient::post(url, body[i], new LLInventoryModel::fetchInventoryResponder(body[i])); + break; + } + + LLMessageSystem* msg = gMessageSystem; + BOOL start_new_message = TRUE; + for (S32 j=0; jnewMessageFast(_PREHASH_FetchInventory); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + } + msg->nextBlockFast(_PREHASH_InventoryData); + msg->addUUIDFast(_PREHASH_OwnerID, item_entry["owner_id"].asUUID()); + msg->addUUIDFast(_PREHASH_ItemID, item_entry["item_id"].asUUID()); + if(msg->isSendFull(NULL)) + { + start_new_message = TRUE; + gAgent.sendReliableMessage(); + } + } + if(!start_new_message) + { + gAgent.sendReliableMessage(); + } + } +} + +void LLInventoryFetchObserver::fetchItems( + const LLInventoryFetchObserver::item_ref_t& ids) +{ + LLUUID owner_id; + LLSD items_llsd; + for(item_ref_t::const_iterator it = ids.begin(); it < ids.end(); ++it) + { + LLViewerInventoryItem* item = gInventory.getItem(*it); + if(item) + { + if(item->isComplete()) + { + // It's complete, so put it on the complete container. + mComplete.push_back(*it); + continue; + } + else + { + owner_id = item->getPermissions().getOwner(); + } + } + else + { + // assume it's agent inventory. + owner_id = gAgent.getID(); + } + + // It's incomplete, so put it on the incomplete container, and + // pack this on the message. + mIncomplete.push_back(*it); + + // Prepare the data to fetch + LLSD item_entry; + item_entry["owner_id"] = owner_id; + item_entry["item_id"] = (*it); + items_llsd.append(item_entry); + } + fetch_items_from_llsd(items_llsd); +} + +// virtual +void LLInventoryFetchDescendentsObserver::changed(U32 mask) +{ + for(folder_ref_t::iterator it = mIncompleteFolders.begin(); it < mIncompleteFolders.end();) + { + LLViewerInventoryCategory* cat = gInventory.getCategory(*it); + if(!cat) + { + it = mIncompleteFolders.erase(it); + continue; + } + if(isComplete(cat)) + { + mCompleteFolders.push_back(*it); + it = mIncompleteFolders.erase(it); + continue; + } + ++it; + } + if(mIncompleteFolders.empty()) + { + done(); + } +} + +void LLInventoryFetchDescendentsObserver::fetchDescendents( + const folder_ref_t& ids) +{ + for(folder_ref_t::const_iterator it = ids.begin(); it != ids.end(); ++it) + { + LLViewerInventoryCategory* cat = gInventory.getCategory(*it); + if(!cat) continue; + if(!isComplete(cat)) + { + cat->fetchDescendents(); //blindly fetch it without seeing if anything else is fetching it. + mIncompleteFolders.push_back(*it); //Add to list of things being downloaded for this observer. + } + else + { + mCompleteFolders.push_back(*it); + } + } +} + +bool LLInventoryFetchDescendentsObserver::isEverythingComplete() const +{ + return mIncompleteFolders.empty(); +} + +bool LLInventoryFetchDescendentsObserver::isComplete(LLViewerInventoryCategory* cat) +{ + S32 version = cat->getVersion(); + S32 descendents = cat->getDescendentCount(); + if((LLViewerInventoryCategory::VERSION_UNKNOWN == version) + || (LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN == descendents)) + { + return false; + } + // it might be complete - check known descendents against + // currently available. + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + gInventory.getDirectDescendentsOf(cat->getUUID(), cats, items); + if(!cats || !items) + { + // bit of a hack - pretend we're done if they are gone or + // incomplete. should never know, but it would suck if this + // kept tight looping because of a corrupt memory state. + return true; + } + S32 known = cats->count() + items->count(); + if(descendents == known) + { + // hey - we're done. + return true; + } + return false; +} + +void LLInventoryFetchComboObserver::changed(U32 mask) +{ + if(!mIncompleteItems.empty()) + { + for(item_ref_t::iterator it = mIncompleteItems.begin(); it < mIncompleteItems.end(); ) + { + LLViewerInventoryItem* item = gInventory.getItem(*it); + if(!item) + { + it = mIncompleteItems.erase(it); + continue; + } + if(item->isComplete()) + { + mCompleteItems.push_back(*it); + it = mIncompleteItems.erase(it); + continue; + } + ++it; + } + } + if(!mIncompleteFolders.empty()) + { + for(folder_ref_t::iterator it = mIncompleteFolders.begin(); it < mIncompleteFolders.end();) + { + LLViewerInventoryCategory* cat = gInventory.getCategory(*it); + if(!cat) + { + it = mIncompleteFolders.erase(it); + continue; + } + if(gInventory.isCategoryComplete(*it)) + { + mCompleteFolders.push_back(*it); + it = mIncompleteFolders.erase(it); + continue; + } + ++it; + } + } + if(!mDone && mIncompleteItems.empty() && mIncompleteFolders.empty()) + { + mDone = true; + done(); + } +} + +void LLInventoryFetchComboObserver::fetch( + const folder_ref_t& folder_ids, + const item_ref_t& item_ids) +{ + lldebugs << "LLInventoryFetchComboObserver::fetch()" << llendl; + for(folder_ref_t::const_iterator fit = folder_ids.begin(); fit != folder_ids.end(); ++fit) + { + LLViewerInventoryCategory* cat = gInventory.getCategory(*fit); + if(!cat) continue; + if(!gInventory.isCategoryComplete(*fit)) + { + cat->fetchDescendents(); + lldebugs << "fetching folder " << *fit <isComplete()) + { + // It's complete, so put it on the complete container. + mCompleteItems.push_back(*iit); + lldebugs << "completing item " << *iit << llendl; + continue; + } + else + { + mIncompleteItems.push_back(*iit); + owner_id = item->getPermissions().getOwner(); + } + if(std::find(mIncompleteFolders.begin(), mIncompleteFolders.end(), item->getParentUUID()) == mIncompleteFolders.end()) + { + LLSD item_entry; + item_entry["owner_id"] = owner_id; + item_entry["item_id"] = (*iit); + items_llsd.append(item_entry); + } + else + { + lldebugs << "not worrying about " << *iit << llendl; + } + } + fetch_items_from_llsd(items_llsd); +} + +void LLInventoryExistenceObserver::watchItem(const LLUUID& id) +{ + if(id.notNull()) + { + mMIA.push_back(id); + } +} + +void LLInventoryExistenceObserver::changed(U32 mask) +{ + // scan through the incomplete items and move or erase them as + // appropriate. + if(!mMIA.empty()) + { + for(item_ref_t::iterator it = mMIA.begin(); it < mMIA.end(); ) + { + LLViewerInventoryItem* item = gInventory.getItem(*it); + if(!item) + { + ++it; + continue; + } + mExist.push_back(*it); + it = mMIA.erase(it); + } + if(mMIA.empty()) + { + done(); + } + } +} + +void LLInventoryAddedObserver::changed(U32 mask) +{ + if(!(mask & LLInventoryObserver::ADD)) + { + return; + } + + // *HACK: If this was in response to a packet off + // the network, figure out which item was updated. + LLMessageSystem* msg = gMessageSystem; + + std::string msg_name; + if (mMessageName.empty()) + { + msg_name = msg->getMessageName(); + } + else + { + msg_name = mMessageName; + } + + if (msg_name.empty()) + { + return; + } + + // We only want newly created inventory items. JC + if ( msg_name != "UpdateCreateInventoryItem") + { + return; + } + + LLPointer titem = new LLViewerInventoryItem; + S32 num_blocks = msg->getNumberOfBlocksFast(_PREHASH_InventoryData); + for(S32 i = 0; i < num_blocks; ++i) + { + titem->unpackMessage(msg, _PREHASH_InventoryData, i); + if (!(titem->getUUID().isNull())) + { + //we don't do anything with null keys + mAdded.push_back(titem->getUUID()); + } + } + if (!mAdded.empty()) + { + done(); + } +} + +LLInventoryTransactionObserver::LLInventoryTransactionObserver( + const LLTransactionID& transaction_id) : + mTransactionID(transaction_id) +{ +} + +void LLInventoryTransactionObserver::changed(U32 mask) +{ + if(mask & LLInventoryObserver::ADD) + { + // This could be it - see if we are processing a bulk update + LLMessageSystem* msg = gMessageSystem; + if(msg->getMessageName() + && (0 == strcmp(msg->getMessageName(), "BulkUpdateInventory"))) + { + // we have a match for the message - now check the + // transaction id. + LLUUID id; + msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_TransactionID, id); + if(id == mTransactionID) + { + // woo hoo, we found it + folder_ref_t folders; + item_ref_t items; + S32 count; + count = msg->getNumberOfBlocksFast(_PREHASH_FolderData); + S32 i; + for(i = 0; i < count; ++i) + { + msg->getUUIDFast(_PREHASH_FolderData, _PREHASH_FolderID, id, i); + if(id.notNull()) + { + folders.push_back(id); + } + } + count = msg->getNumberOfBlocksFast(_PREHASH_ItemData); + for(i = 0; i < count; ++i) + { + msg->getUUIDFast(_PREHASH_ItemData, _PREHASH_ItemID, id, i); + if(id.notNull()) + { + items.push_back(id); + } + } + + // call the derived class the implements this method. + done(folders, items); + } + } + } +} diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h new file mode 100644 index 0000000000..384e6292e8 --- /dev/null +++ b/indra/newview/llinventoryobserver.h @@ -0,0 +1,249 @@ +/** + * @file llinventoryobserver.h + * @brief LLInventoryObserver class header file + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLINVENTORYOBSERVERS_H +#define LL_LLINVENTORYOBSERVERS_H + +#include "lluuid.h" +#include +#include + +class LLViewerInventoryCategory; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInventoryObserver +// +// This class is designed to be a simple abstract base class which can +// relay messages when the inventory changes. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLInventoryObserver +{ +public: + // This enumeration is a way to refer to what changed in a more + // human readable format. You can mask the value provided by + // chaged() to see if the observer is interested in the change. + enum + { + NONE = 0, + LABEL = 1, // name changed + INTERNAL = 2, // internal change, eg, asset uuid different + ADD = 4, // something added + REMOVE = 8, // something deleted + STRUCTURE = 16, // structural change, eg, item or folder moved + CALLING_CARD = 32, // online, grant status, cancel, etc change + ALL = 0xffffffff + }; + virtual ~LLInventoryObserver() {}; + virtual void changed(U32 mask) = 0; + std::string mMessageName; // used by Agent Inventory Service only. [DEV-20328] +}; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInventoryCompletionObserver +// +// Class which can be used as a base class for doing something when +// when all observed items are locally complete. This class implements +// the changed() method of LLInventoryObserver and declares a new +// method named done() which is called when all watched items have +// complete information in the inventory model. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLInventoryCompletionObserver : public LLInventoryObserver +{ +public: + LLInventoryCompletionObserver() {} + virtual void changed(U32 mask); + + void watchItem(const LLUUID& id); + +protected: + virtual void done() = 0; + + typedef std::vector item_ref_t; + item_ref_t mComplete; + item_ref_t mIncomplete; +}; + + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInventoryFetchObserver +// +// This class is much like the LLInventoryCompletionObserver, except +// that it handles all the the fetching necessary. Override the done() +// method to do the thing you want. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLInventoryFetchObserver : public LLInventoryObserver +{ +public: + LLInventoryFetchObserver() {} + virtual void changed(U32 mask); + + typedef std::vector item_ref_t; + + bool isEverythingComplete() const; + void fetchItems(const item_ref_t& ids); + virtual void done() = 0; + +protected: + item_ref_t mComplete; + item_ref_t mIncomplete; +}; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInventoryFetchDescendentsObserver +// +// This class is much like the LLInventoryCompletionObserver, except +// that it handles fetching based on category. Override the done() +// method to do the thing you want. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLInventoryFetchDescendentsObserver : public LLInventoryObserver +{ +public: + LLInventoryFetchDescendentsObserver() {} + virtual void changed(U32 mask); + + typedef std::vector folder_ref_t; + void fetchDescendents(const folder_ref_t& ids); + bool isEverythingComplete() const; + virtual void done() = 0; + +protected: + bool isComplete(LLViewerInventoryCategory* cat); + folder_ref_t mIncompleteFolders; + folder_ref_t mCompleteFolders; +}; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInventoryFetchComboObserver +// +// This class does an appropriate combination of fetch descendents and +// item fetches based on completion of categories and items. Much like +// the fetch and fetch descendents, this will call done() when everything +// has arrived. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLInventoryFetchComboObserver : public LLInventoryObserver +{ +public: + LLInventoryFetchComboObserver() : mDone(false) {} + virtual void changed(U32 mask); + + typedef std::vector folder_ref_t; + typedef std::vector item_ref_t; + void fetch(const folder_ref_t& folder_ids, const item_ref_t& item_ids); + + virtual void done() = 0; + +protected: + bool mDone; + folder_ref_t mCompleteFolders; + folder_ref_t mIncompleteFolders; + item_ref_t mCompleteItems; + item_ref_t mIncompleteItems; +}; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInventoryExistenceObserver +// +// This class is used as a base class for doing somethign when all the +// observed item ids exist in the inventory somewhere. You can derive +// a class from this class and implement the done() method to do +// something useful. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLInventoryExistenceObserver : public LLInventoryObserver +{ +public: + LLInventoryExistenceObserver() {} + virtual void changed(U32 mask); + + void watchItem(const LLUUID& id); + +protected: + virtual void done() = 0; + + typedef std::vector item_ref_t; + item_ref_t mExist; + item_ref_t mMIA; +}; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInventoryAddedObserver +// +// This class is used as a base class for doing something when +// a new item arrives in inventory. +// It does not watch for a certain UUID, rather it acts when anything is added +// Derive a class from this class and implement the done() method to do +// something useful. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLInventoryAddedObserver : public LLInventoryObserver +{ +public: + LLInventoryAddedObserver() : mAdded() {} + virtual void changed(U32 mask); + +protected: + virtual void done() = 0; + + typedef std::vector item_ref_t; + item_ref_t mAdded; +}; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInventoryTransactionObserver +// +// Class which can be used as a base class for doing something when an +// inventory transaction completes. +// +// *NOTE: This class is not quite complete. Avoid using unless you fix up it's +// functionality gaps. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLInventoryTransactionObserver : public LLInventoryObserver +{ +public: + LLInventoryTransactionObserver(const LLTransactionID& transaction_id); + virtual void changed(U32 mask); + +protected: + typedef std::vector folder_ref_t; + typedef std::vector item_ref_t; + virtual void done(const folder_ref_t& folders, const item_ref_t& items) = 0; + + LLTransactionID mTransactionID; +}; + + +#endif // LL_LLINVENTORYOBSERVERS_H + -- cgit v1.2.3 From 02d1776bbc1bbfd7e555bd018dee6b5a31ec0ffa Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Thu, 12 Nov 2009 19:43:23 +0000 Subject: try fixing mysterious layout issue. --- indra/newview/skins/default/xui/en/floater_outgoing_call.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml index 6713700372..f1fa1a8dba 100644 --- a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml +++ b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml @@ -60,6 +60,7 @@ Leaving [CURRENT_CHAT]. - Date: Thu, 12 Nov 2009 20:54:00 -0500 Subject: EXT-2434 update avatar rendering cost First crack at updating the rendering cost calculation for avatars to account for the possibility of invisible avatars. Also generalized rendering cost of attachments to be more general - added debug code to build floater will be post-reviewed --- indra/newview/llfloatertools.cpp | 27 +++++++++ indra/newview/llfloatertools.h | 1 + indra/newview/llvoavatar.cpp | 121 ++++----------------------------------- indra/newview/llvovolume.cpp | 101 ++++++++++++++++++++++++++++++++ indra/newview/llvovolume.h | 2 +- 5 files changed, 141 insertions(+), 111 deletions(-) diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 3c3dfb760e..672160073e 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -422,6 +422,12 @@ void LLFloaterTools::refresh() LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount()); childSetTextArg("prim_count", "[COUNT]", prim_count_string); + // calculate selection rendering cost + std::string prim_cost_string; + LLResMgr::getInstance()->getIntegerString(prim_cost_string, calcRenderCost()); + childSetTextArg("render_cost", "[COUNT]", prim_cost_string); + + // disable the object and prim counts if nothing selected bool have_selection = ! LLSelectMgr::getInstance()->getSelection()->isEmpty(); childSetEnabled("obj_count", have_selection); @@ -964,6 +970,27 @@ void LLFloaterTools::onClickGridOptions() //floaterp->addDependentFloater(LLFloaterBuildOptions::getInstance(), FALSE); } +S32 LLFloaterTools::calcRenderCost() +{ + S32 cost = 0; + for (LLObjectSelection::iterator selection_iter = LLSelectMgr::getInstance()->getSelection()->begin(); + selection_iter != LLSelectMgr::getInstance()->getSelection()->end(); + ++selection_iter) + { + LLSelectNode *select_node = *selection_iter; + if (select_node) + { + LLVOVolume *viewer_volume = (LLVOVolume*)select_node->getObject(); + if (viewer_volume) + { + cost += viewer_volume->getRenderCost(); + } + } + } + + return cost; +} + // static void LLFloaterTools::setEditTool(void* tool_pointer) { diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h index a3e0cac034..05a88a31d3 100644 --- a/indra/newview/llfloatertools.h +++ b/indra/newview/llfloatertools.h @@ -121,6 +121,7 @@ private: static bool multipleFacesSelectedConfirm(const LLSD& notification, const LLSD& response); static void setObjectType( LLPCode pcode ); void onClickGridOptions(); + S32 calcRenderCost(); public: LLButton *mBtnFocus; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 62ac8adad0..d7e31e8436 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -624,7 +624,6 @@ F32 LLVOAvatar::sGreyUpdateTime = 0.f; // Helper functions //----------------------------------------------------------------------------- static F32 calc_bouncy_animation(F32 x); -static U32 calc_shame(const LLVOVolume* volume, std::set &textures); //----------------------------------------------------------------------------- // LLVOAvatar() @@ -7637,9 +7636,17 @@ void LLVOAvatar::idleUpdateRenderCost() return; } - U32 shame = 1; + U32 shame = 0; - std::set textures; + for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) + { + const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index); + ETextureIndex tex_index = baked_dict->mTextureIndex; + if (isTextureVisible(tex_index)) + { + shame +=25; + } + } for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); @@ -7660,15 +7667,13 @@ void LLVOAvatar::idleUpdateRenderCost() const LLVOVolume* volume = drawable->getVOVolume(); if (volume) { - shame += calc_shame(volume, textures); + shame += volume->getRenderCost(); } } } } } - shame += textures.size() * 5; - setDebugText(llformat("%d", shame)); F32 green = 1.f-llclamp(((F32) shame-1024.f)/1024.f, 0.f, 1.f); F32 red = llmin((F32) shame/1024.f, 1.f); @@ -7713,110 +7718,6 @@ const std::string LLVOAvatar::getBakedStatusForPrintout() const } -U32 calc_shame(const LLVOVolume* volume, std::set &textures) -{ - if (!volume) - { - return 0; - } - - U32 shame = 0; - - U32 invisi = 0; - U32 shiny = 0; - U32 glow = 0; - U32 alpha = 0; - U32 flexi = 0; - U32 animtex = 0; - U32 particles = 0; - U32 scale = 0; - U32 bump = 0; - U32 planar = 0; - - if (volume->isFlexible()) - { - flexi = 1; - } - if (volume->isParticleSource()) - { - particles = 1; - } - - const LLVector3& sc = volume->getScale(); - scale += (U32) sc.mV[0] + (U32) sc.mV[1] + (U32) sc.mV[2]; - - const LLDrawable* drawablep = volume->mDrawable; - - if (volume->isSculpted()) - { - const LLSculptParams *sculpt_params = (LLSculptParams *) volume->getParameterEntry(LLNetworkData::PARAMS_SCULPT); - LLUUID sculpt_id = sculpt_params->getSculptTexture(); - textures.insert(sculpt_id); - } - - for (S32 i = 0; i < drawablep->getNumFaces(); ++i) - { - const LLFace* face = drawablep->getFace(i); - const LLTextureEntry* te = face->getTextureEntry(); - const LLViewerTexture* img = face->getTexture(); - - textures.insert(img->getID()); - - if (face->getPoolType() == LLDrawPool::POOL_ALPHA) - { - alpha++; - } - else if (img->getPrimaryFormat() == GL_ALPHA) - { - invisi = 1; - } - - if (te) - { - if (te->getBumpmap()) - { - bump = 1; - } - if (te->getShiny()) - { - shiny = 1; - } - if (te->getGlow() > 0.f) - { - glow = 1; - } - if (face->mTextureMatrix != NULL) - { - animtex++; - } - if (te->getTexGen()) - { - planar++; - } - } - } - - shame += invisi + shiny + glow + alpha*4 + flexi*8 + animtex*4 + particles*16+bump*4+scale+planar; - - LLViewerObject::const_child_list_t& child_list = volume->getChildren(); - for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); - iter != child_list.end(); - ++iter) - { - const LLViewerObject* child_objectp = *iter; - const LLDrawable* child_drawablep = child_objectp->mDrawable; - if (child_drawablep) - { - const LLVOVolume* child_volumep = child_drawablep->getVOVolume(); - if (child_volumep) - { - shame += calc_shame(child_volumep, textures); - } - } - } - - return shame; -} //virtual S32 LLVOAvatar::getTexImageSize() const diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 2def905bbb..e5531a1497 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2541,6 +2541,107 @@ const LLMatrix4 LLVOVolume::getRenderMatrix() const return mDrawable->getWorldMatrix(); } +U32 LLVOVolume::getRenderCost() const +{ + U32 shame = 0; + + U32 invisi = 0; + U32 shiny = 0; + U32 glow = 0; + U32 alpha = 0; + U32 flexi = 0; + U32 animtex = 0; + U32 particles = 0; + U32 scale = 0; + U32 bump = 0; + U32 planar = 0; + + if (isFlexible()) + { + flexi = 1; + } + if (isParticleSource()) + { + particles = 1; + } + + const LLVector3& sc = getScale(); + scale += (U32) sc.mV[0] + (U32) sc.mV[1] + (U32) sc.mV[2]; + + const LLDrawable* drawablep = mDrawable; + + if (isSculpted()) + { + const LLSculptParams *sculpt_params = (LLSculptParams *) getParameterEntry(LLNetworkData::PARAMS_SCULPT); + LLUUID sculpt_id = sculpt_params->getSculptTexture(); + shame += 5; + } + + for (S32 i = 0; i < drawablep->getNumFaces(); ++i) + { + const LLFace* face = drawablep->getFace(i); + const LLTextureEntry* te = face->getTextureEntry(); + const LLViewerTexture* img = face->getTexture(); + + shame += 5; + + if (face->getPoolType() == LLDrawPool::POOL_ALPHA) + { + alpha++; + } + else if (img->getPrimaryFormat() == GL_ALPHA) + { + invisi = 1; + } + + if (te) + { + if (te->getBumpmap()) + { + bump = 1; + } + if (te->getShiny()) + { + shiny = 1; + } + if (te->getGlow() > 0.f) + { + glow = 1; + } + if (face->mTextureMatrix != NULL) + { + animtex++; + } + if (te->getTexGen()) + { + planar++; + } + } + } + + shame += invisi + shiny + glow + alpha*4 + flexi*8 + animtex*4 + particles*16+bump*4+scale+planar; + + LLViewerObject::const_child_list_t& child_list = getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); + ++iter) + { + const LLViewerObject* child_objectp = *iter; + const LLDrawable* child_drawablep = child_objectp->mDrawable; + if (child_drawablep) + { + const LLVOVolume* child_volumep = child_drawablep->getVOVolume(); + if (child_volumep) + { + shame += child_volumep->getRenderCost(); + } + } + } + + return shame; + +} + //static void LLVOVolume::preUpdateGeom() { diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 10fc8865fc..fb543efc04 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -120,7 +120,7 @@ public: const LLMatrix4& getRelativeXform() const { return mRelativeXform; } const LLMatrix3& getRelativeXformInvTrans() const { return mRelativeXformInvTrans; } /*virtual*/ const LLMatrix4 getRenderMatrix() const; - + U32 getRenderCost() const; /*virtual*/ BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end, S32 face = -1, // which face to check, -1 = ALL_SIDES -- cgit v1.2.3 From 4a020b2a1ab85ebfa078ab12457402d1f805f811 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Thu, 12 Nov 2009 18:25:42 -0800 Subject: Couple LLMimeDiscoveryResponder more tightly with LLViewerMediaImpl. This should fix DEV-41596, as well as other potential problems. --- indra/newview/llviewermedia.cpp | 95 ++++++++++++++++++++++++++++++++++++----- indra/newview/llviewermedia.h | 5 ++- 2 files changed, 89 insertions(+), 11 deletions(-) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 493457704b..69d4da373e 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -135,9 +135,19 @@ public: LLMimeDiscoveryResponder( viewer_media_t media_impl) : mMediaImpl(media_impl), mInitialized(false) - {} - + { + if(mMediaImpl->mMimeTypeProbe != NULL) + { + llerrs << "impl already has an outstanding responder" << llendl; + } + + mMediaImpl->mMimeTypeProbe = this; + } + ~LLMimeDiscoveryResponder() + { + disconnectOwner(); + } virtual void completedHeader(U32 status, const std::string& reason, const LLSD& content) { @@ -149,23 +159,54 @@ public: virtual void error( U32 status, const std::string& reason ) { + llwarns << "responder failed with status " << status << ", reason " << reason << llendl; + if(mMediaImpl) + { + mMediaImpl->mMediaSourceFailed = true; + } // completeAny(status, "none/none"); } void completeAny(U32 status, const std::string& mime_type) { - if(!mInitialized && ! mime_type.empty()) + // the call to initializeMedia may disconnect the responder, which will clear mMediaImpl. + // Make a local copy so we can call loadURI() afterwards. + LLViewerMediaImpl *impl = mMediaImpl; + + if(impl && !mInitialized && ! mime_type.empty()) { - if(mMediaImpl->initializeMedia(mime_type)) + if(impl->initializeMedia(mime_type)) { mInitialized = true; - mMediaImpl->loadURI(); + impl->loadURI(); + disconnectOwner(); } } } + + void cancelRequest() + { + disconnectOwner(); + } + +private: + void disconnectOwner() + { + if(mMediaImpl) + { + if(mMediaImpl->mMimeTypeProbe != this) + { + llerrs << "internal error: mMediaImpl->mMimeTypeProbe != this" << llendl; + } - public: - viewer_media_t mMediaImpl; + mMediaImpl->mMimeTypeProbe = NULL; + } + mMediaImpl = NULL; + } + + +public: + LLViewerMediaImpl *mMediaImpl; bool mInitialized; }; static LLViewerMedia::impl_list sViewerMediaImplList; @@ -708,6 +749,7 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id, mIsDisabled(false), mIsParcelMedia(false), mProximity(-1), + mMimeTypeProbe(NULL), mIsUpdated(false) { @@ -811,7 +853,9 @@ void LLViewerMediaImpl::destroyMediaSource() { oldImage->setPlaying(FALSE) ; } - + + cancelMimeTypeProbe(); + if(mMediaSource) { delete mMediaSource; @@ -1316,6 +1360,8 @@ void LLViewerMediaImpl::unload() ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mime_type, bool rediscover_type, bool server_request) { + cancelMimeTypeProbe(); + if(mMediaURL != url) { // Don't carry media play state across distinct URLs. @@ -1358,6 +1404,12 @@ void LLViewerMediaImpl::navigateInternal() // Helpful to have media urls in log file. Shouldn't be spammy. llinfos << "media id= " << mTextureId << " url=" << mMediaURL << " mime_type=" << mMimeType << llendl; + if(mMimeTypeProbe != NULL) + { + llwarns << "MIME type probe already in progress -- bailing out." << llendl; + return; + } + if(mNavigateServerRequest) { setNavState(MEDIANAVSTATE_SERVER_SENT); @@ -1390,7 +1442,7 @@ void LLViewerMediaImpl::navigateInternal() if(scheme.empty() || "http" == scheme || "https" == scheme) { - LLHTTPClient::getHeaderOnly( mMediaURL, new LLMimeDiscoveryResponder(this)); + LLHTTPClient::getHeaderOnly( mMediaURL, new LLMimeDiscoveryResponder(this), 10.0f); } else if("data" == scheme || "file" == scheme || "about" == scheme) { @@ -1521,7 +1573,15 @@ void LLViewerMediaImpl::update() { if(mMediaSource == NULL) { - if(mPriority != LLPluginClassMedia::PRIORITY_UNLOADED) + if(mPriority == LLPluginClassMedia::PRIORITY_UNLOADED) + { + // This media source should not be loaded. + } + else if(mMimeTypeProbe != NULL) + { + // this media source is doing a MIME type probe -- don't try loading it again. + } + else { // This media may need to be loaded. if(sMediaCreateTimer.hasExpired()) @@ -2120,6 +2180,21 @@ void LLViewerMediaImpl::setNavState(EMediaNavState state) } } +void LLViewerMediaImpl::cancelMimeTypeProbe() +{ + if(mMimeTypeProbe != NULL) + { + // There doesn't seem to be a way to actually cancel an outstanding request. + // Simulate it by telling the LLMimeDiscoveryResponder not to write back any results. + mMimeTypeProbe->cancelRequest(); + + // The above should already have set mMimeTypeProbe to NULL. + if(mMimeTypeProbe != NULL) + { + llerrs << "internal error: mMimeTypeProbe is not NULL after cancelling request." << llendl; + } + } +} void LLViewerMediaImpl::addObject(LLVOVolume* obj) { diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 3f5f3ca746..719deb28bf 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -48,6 +48,7 @@ class LLUUID; class LLViewerMediaTexture; class LLMediaEntry; class LLVOVolume ; +class LLMimeDiscoveryResponder; typedef LLPointer viewer_media_t; /////////////////////////////////////////////////////////////////////////////// @@ -294,6 +295,7 @@ public: EMediaNavState getNavState() { return mMediaNavState; } void setNavState(EMediaNavState state); + void cancelMimeTypeProbe(); public: // a single media url with some data and an impl. LLPluginClassMedia* mMediaSource; @@ -331,7 +333,8 @@ public: bool mIsDisabled; bool mIsParcelMedia; S32 mProximity; - + LLMimeDiscoveryResponder *mMimeTypeProbe; + private: BOOL mIsUpdated ; std::list< LLVOVolume* > mObjectList ; -- cgit v1.2.3 From 9054f31f89963f2f24a6b872fbc6816ee01f0d70 Mon Sep 17 00:00:00 2001 From: "Mark Palange (Mani)" Date: Thu, 12 Nov 2009 18:56:55 -0800 Subject: Temporary build un breakage - removing broken unit test from build while fixing. --- indra/viewer_components/login/tests/lllogin_test.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/viewer_components/login/tests/lllogin_test.cpp b/indra/viewer_components/login/tests/lllogin_test.cpp index 56c21016bd..99ea796ad0 100644 --- a/indra/viewer_components/login/tests/lllogin_test.cpp +++ b/indra/viewer_components/login/tests/lllogin_test.cpp @@ -416,6 +416,7 @@ namespace tut ensure_equals("Failed to offline", listener.lastEvent()["state"].asString(), "offline"); } +/* template<> template<> void llviewerlogin_object::test<5>() { @@ -451,4 +452,5 @@ namespace tut ensure_equals("SRV Failure", listener.lastEvent()["change"].asString(), "fail.login"); } +*/ } -- cgit v1.2.3 From 20c0a0b68f82908bc73872ec132775e8c69cca4d Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 12 Nov 2009 19:24:31 -0800 Subject: Test intentionally not-found LLUICtrl. --- indra/newview/llfloatertestinspectors.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/llfloatertestinspectors.cpp b/indra/newview/llfloatertestinspectors.cpp index 8af011c17a..e68faba712 100644 --- a/indra/newview/llfloatertestinspectors.cpp +++ b/indra/newview/llfloatertestinspectors.cpp @@ -53,6 +53,8 @@ LLFloaterTestInspectors::~LLFloaterTestInspectors() BOOL LLFloaterTestInspectors::postBuild() { + getChild("intentionally-not-found"); + // getChild("avatar_2d_btn")->setCommitCallback( // boost::bind(&LLFloaterTestInspectors::onClickAvatar2D, this)); getChild("avatar_3d_btn")->setCommitCallback( -- cgit v1.2.3 From 01f1eaf7e0faaa3ecde36ac28a346fed53a571fd Mon Sep 17 00:00:00 2001 From: angela Date: Fri, 13 Nov 2009 15:19:37 +0800 Subject: fix style readonlycolor overwriting color --- indra/newview/llchathistory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 2b050f3eb5..69e1f8d428 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -351,6 +351,7 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat) LLStyle::Params style_params; style_params.color(txt_color); + style_params.readonly_color(txt_color); style_params.font(fontp); @@ -383,7 +384,6 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat) appendWidget(p, view_text, false); //Append the text message - appendText(chat.mText, FALSE, style_params); mLastFromName = chat.mFromName; -- cgit v1.2.3 From d116185bfd1d64c7108e75ea1a7745f08cb2a3d0 Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Fri, 13 Nov 2009 12:26:57 +0200 Subject: Fixed Low bug EXT-2404-Nearby Chat: There is redundant semicolon in the log for system messages --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 046e1d92dc..5efecfa78f 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -53,7 +53,7 @@ std::string formatCurrentTime() time_t utc_time; utc_time = time_corrected(); std::string timeStr ="["+ LLTrans::getString("TimeHour")+"]:[" - +LLTrans::getString("TimeMin")+"] "; + +LLTrans::getString("TimeMin")+"]"; LLSD substitution; @@ -344,7 +344,9 @@ LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style void LLChatHistory::appendWidgetMessage(const LLChat& chat, LLStyle::Params& style_params) { LLView* view = NULL; - std::string view_text = "\n[" + formatCurrentTime() + "] " + chat.mFromName + ": "; + std::string view_text = "\n[" + formatCurrentTime() + "] "; + if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM) + view_text += chat.mFromName + ": "; LLInlineViewSegment::Params p; p.force_newline = true; -- cgit v1.2.3 From 05d2f3f7647269ffca2da8cba9bd6b91b56a1905 Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Fri, 13 Nov 2009 12:32:06 +0200 Subject: No ticket. A little refactoring. --HG-- branch : product-engine --- indra/newview/lltoastimpanel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp index 9370e318cf..1ea5f515b7 100644 --- a/indra/newview/lltoastimpanel.cpp +++ b/indra/newview/lltoastimpanel.cpp @@ -69,7 +69,7 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notif mNotification = p.notification; // if message comes from the system - there shouldn't be a reply btn - if(p.from == "Second Life") + if(p.from == SYSTEM_FROM) { mAvatar->setVisible(FALSE); sys_msg_icon->setVisible(TRUE); -- cgit v1.2.3 From eb1484a0c9b6a075c900371cc5d7e8c4c0a4f93f Mon Sep 17 00:00:00 2001 From: Andrew Polunin Date: Fri, 13 Nov 2009 12:37:52 +0200 Subject: implemented normal task EXT-2175 Set up functionality for \"Leave Selected Group\" option --HG-- branch : product-engine --- indra/newview/llpanelpeople.cpp | 2 +- .../skins/default/xui/en/menu_people_groups_view_sort.xml | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 9ba94c8ca9..ba30a4710a 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -519,7 +519,6 @@ BOOL LLPanelPeople::postBuild() LLPanel* groups_panel = getChild(GROUP_TAB_NAME); groups_panel->childSetAction("activate_btn", boost::bind(&LLPanelPeople::onActivateButtonClicked, this)); groups_panel->childSetAction("plus_btn", boost::bind(&LLPanelPeople::onGroupPlusButtonClicked, this)); - groups_panel->childSetAction("minus_btn", boost::bind(&LLPanelPeople::onGroupMinusButtonClicked, this)); LLPanel* friends_panel = getChild(FRIENDS_TAB_NAME); friends_panel->childSetAction("add_btn", boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked, this)); @@ -568,6 +567,7 @@ BOOL LLPanelPeople::postBuild() LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; registrar.add("People.Group.Plus.Action", boost::bind(&LLPanelPeople::onGroupPlusMenuItemClicked, this, _2)); + registrar.add("People.Group.Minus.Action", boost::bind(&LLPanelPeople::onGroupMinusButtonClicked, this)); registrar.add("People.Friends.ViewSort.Action", boost::bind(&LLPanelPeople::onFriendsViewSortMenuItemClicked, this, _2)); registrar.add("People.Nearby.ViewSort.Action", boost::bind(&LLPanelPeople::onNearbyViewSortMenuItemClicked, this, _2)); registrar.add("People.Groups.ViewSort.Action", boost::bind(&LLPanelPeople::onGroupsViewSortMenuItemClicked, this, _2)); diff --git a/indra/newview/skins/default/xui/en/menu_people_groups_view_sort.xml b/indra/newview/skins/default/xui/en/menu_people_groups_view_sort.xml index 6dd44255bf..304492bedb 100644 --- a/indra/newview/skins/default/xui/en/menu_people_groups_view_sort.xml +++ b/indra/newview/skins/default/xui/en/menu_people_groups_view_sort.xml @@ -13,15 +13,11 @@ function="CheckControl" parameter="GroupListShowIcons" /> - - - - + + -- cgit v1.2.3 From bed508f9ef3bce8fb67669ab60b01cd4119a7f76 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Fri, 13 Nov 2009 12:58:05 +0200 Subject: EXT-2339 Chat : Nearby chat does not show full text - increase max_length to 512 --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml index a77094e942..ecf35523cd 100644 --- a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml @@ -23,7 +23,7 @@ layout="topleft" left_delta="7" left="0" - max_length="254" + max_length="512" name="chat_box" tool_tip="Press Enter to say, Ctrl+Enter to shout" top="0" -- cgit v1.2.3 From b256d57b0dbdd39dd36abcdb51a6b70698c60bba Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Fri, 13 Nov 2009 12:59:19 +0200 Subject: No ticket. Fix to prevent crash. --HG-- branch : product-engine --- indra/newview/llimpanel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 0b8b5935f8..3178658faa 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -849,7 +849,8 @@ void LLFloaterIMPanel::processSessionUpdate(const LLSD& session_update) //update the speakers dropdown too - mSpeakerPanel->setVoiceModerationCtrlMode(voice_moderated); + if (mSpeakerPanel) + mSpeakerPanel->setVoiceModerationCtrlMode(voice_moderated); } } -- cgit v1.2.3 From 9e11895c258d4dc7bc141804d8b7aa2762de4013 Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Fri, 13 Nov 2009 13:10:30 +0200 Subject: No ticket. Fixed crash caused by wierdly coded std::map by MS --HG-- branch : product-engine --- indra/newview/llspeakers.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 2ed82b7d62..261bdbcfc0 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -359,6 +359,9 @@ void LLSpeakerMgr::updateSpeakerList() LLPointer LLSpeakerMgr::findSpeaker(const LLUUID& speaker_id) { + //In some conditions map causes crash if it is empty(Windows only), adding check (EK) + if (mSpeakers.size() == 0) + return NULL; speaker_map_t::iterator found_it = mSpeakers.find(speaker_id); if (found_it == mSpeakers.end()) { -- cgit v1.2.3 From 0c7a4b6a7d2675a916efacfb9f2f1a6098c027dd Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Fri, 13 Nov 2009 13:49:14 +0200 Subject: EXT-2342 Script : Fails to work in Alpha 6 ok toast for objects are back... also add object inspector to nearby chat object context menu --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 4 ++++ indra/newview/llnearbychathandler.cpp | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 5efecfa78f..f228373063 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -84,6 +84,10 @@ public: if (level == "profile") { + LLSD params; + params["object_id"] = getAvatarId(); + + LLFloaterReg::showInstance("inspect_object", params); } else if (level == "block") { diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index b4e0ab198a..f3b63c8616 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -332,7 +332,8 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg) //only messages from AGENTS if(CHAT_SOURCE_OBJECT == chat_msg.mSourceType) { - return;//dn't show toast for messages from objects + if(chat_msg.mChatType == CHAT_TYPE_DEBUG_MSG) + return;//ok for now we don't skip messeges from object, so skip only debug messages } LLUUID id; -- cgit v1.2.3 From a3dbbeef702317b86de09592412a9d55d3de5991 Mon Sep 17 00:00:00 2001 From: Dmitry Oleshko Date: Fri, 13 Nov 2009 13:55:09 +0200 Subject: fix of normal bug (EXT-2411) Toast for a group notification has bigger width, than other toasts fixed panel's size in XML. Also formatted XML according to standards using viewer's XML util. --HG-- branch : product-engine --- .../skins/default/xui/en/panel_group_notify.xml | 194 +++++++++++++-------- 1 file changed, 117 insertions(+), 77 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_group_notify.xml b/indra/newview/skins/default/xui/en/panel_group_notify.xml index ef3120174e..984a799b41 100644 --- a/indra/newview/skins/default/xui/en/panel_group_notify.xml +++ b/indra/newview/skins/default/xui/en/panel_group_notify.xml @@ -1,77 +1,117 @@ - - - - 4 - - - - - Sender Name / Group Name - - - - subject - - - datetime - - - - - - Attachment - - - - + + + --> - + + + --> function="MediaCtrl.CommitURL"/> - + - + + + + width="16" + auto_resize="false" + user_resize="false"> + + - + + - + + + --> - + + + --> + -- cgit v1.2.3 From 2aa9f1bcbe0c51f9de24d52a08726dc13038f5b8 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Fri, 13 Nov 2009 14:57:06 -0500 Subject: EXT-2477 minimizing while in appearance editing mode leaves a bad state when minimizing the viewer while in appearance editing mode with unsaved changes kicks you out of appearance editing mode and leaves you unable to recover as the editor always starts itself on the shape tab. Fixed this in two ways: 1) if a wearable is dirty when the editor is opened, that is the tab that is selected. 2) the camera mode is not forcibly changed away from appearance editing mode on minimize. This only needs to happen if we are in mouselook. Code reviewed by Vir. --HG-- branch : avatar-pipeline --- indra/newview/llviewerwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 1054223dcf..90a79698f6 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1015,7 +1015,10 @@ BOOL LLViewerWindow::handleActivate(LLWindow *window, BOOL activated) } // SL-53351: Make sure we're not in mouselook when minimised, to prevent control issues - gAgent.changeCameraToDefault(); + if (gAgent.getCameraMode() == CAMERA_MODE_MOUSELOOK) + { + gAgent.changeCameraToDefault(); + } send_agent_pause(); -- cgit v1.2.3 From 4b05dc4890d82b5c13c74ad502f0123fb83072a9 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 13 Nov 2009 15:20:54 -0500 Subject: LLAppearanceManager cleanup - 2 methods renamed --HG-- branch : avatar-pipeline --- indra/newview/llappearancemgr.cpp | 8 ++++---- indra/newview/llappearancemgr.h | 4 ++-- indra/newview/llinventorybridge.cpp | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 8d66cefa4f..f7d1396707 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -802,7 +802,7 @@ bool areMatchingWearables(const LLViewerInventoryItem *a, const LLViewerInventor (a->getWearableType() == b->getWearableType())); } -void LLAppearanceManager::wearItem( LLInventoryItem* item, bool do_update ) +void LLAppearanceManager::addItemLink( LLInventoryItem* item, bool do_update ) { LLViewerInventoryItem *vitem = dynamic_cast(item); if (!vitem) @@ -855,7 +855,7 @@ void LLAppearanceManager::wearItem( LLInventoryItem* item, bool do_update ) return; } -void LLAppearanceManager::wearEnsemble( LLInventoryCategory* cat, bool do_update ) +void LLAppearanceManager::addEnsembleLink( LLInventoryCategory* cat, bool do_update ) { #if SUPPORT_ENSEMBLES // BAP add check for already in COF. @@ -969,7 +969,7 @@ void LLAppearanceManager::registerAttachment(const LLUUID& item_id) if (item) { //LLAppearanceManager::dumpCat(LLAppearanceManager::getCOF(),"Adding attachment link:"); - LLAppearanceManager::wearItem(item,false); // Add COF link for item. + LLAppearanceManager::addItemLink(item,false); // Add COF link for item. gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); gInventory.notifyObservers(); } @@ -1009,7 +1009,7 @@ void LLAppearanceManager::linkRegisteredAttachments() LLViewerInventoryItem *item = gInventory.getItem(item_id); if (item) { - wearItem(item, false); + addItemLink(item, false); gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); gInventory.notifyObservers(); } diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 736dabea31..88d3320d1f 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -54,10 +54,10 @@ public: void changeOutfit(bool proceed, const LLUUID& category, bool append); // Add COF link to individual item. - void wearItem(LLInventoryItem* item, bool do_update = true); + void addItemLink(LLInventoryItem* item, bool do_update = true); // Add COF link to ensemble folder. - void wearEnsemble(LLInventoryCategory* item, bool do_update = true); + void addEnsembleLink(LLInventoryCategory* item, bool do_update = true); // Copy all items in a category. void shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id, diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4aef7b51a5..7162b08845 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1687,7 +1687,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, // BAP - should skip if dup. if (move_is_into_current_outfit) { - LLAppearanceManager::instance().wearEnsemble(inv_cat); + LLAppearanceManager::instance().addEnsembleLink(inv_cat); } else { @@ -2089,7 +2089,7 @@ void LLFolderBridge::performAction(LLFolderView* folder, LLInventoryModel* model if(!model) return; LLViewerInventoryCategory* cat = getCategory(); if(!cat) return; - LLAppearanceManager::instance().wearEnsemble(cat,true); + LLAppearanceManager::instance().addEnsembleLink(cat,true); return; } #endif @@ -2953,7 +2953,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // BAP - should skip if dup. if (move_is_into_current_outfit) { - LLAppearanceManager::instance().wearItem(inv_item); + LLAppearanceManager::instance().addItemLink(inv_item); } else { @@ -4206,7 +4206,7 @@ void wear_inventory_item_on_avatar( LLInventoryItem* item ) lldebugs << "wear_inventory_item_on_avatar( " << item->getName() << " )" << llendl; - LLAppearanceManager::instance().wearItem(item); + LLAppearanceManager::instance().addItemLink(item); } } -- cgit v1.2.3 From f9cacc57e28a2dcbe5801c71becbb8e2b8eae3e4 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 13 Nov 2009 12:36:41 -0800 Subject: EXT-2491 IM text does not appear in private IMs --- indra/newview/llimfloater.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 0f32d0b313..1467e4e0e0 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -479,6 +479,7 @@ void LLIMFloater::updateMessages() LLChat chat; chat.mFromID = from_id; chat.mFromName = from; + chat.mText = message; mChatHistory->appendWidgetMessage(chat); -- cgit v1.2.3 From 581fccecc805d27b8d9dfacb76cefebe26f9e0b9 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 13 Nov 2009 15:47:49 -0500 Subject: For DEV-41818 - text change 'Goto Link' -> 'Find Original' --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 6 +++--- indra/newview/skins/default/xui/en/menu_inventory.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 7162b08845..62ae6f501e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4053,7 +4053,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) LLInventoryItem* item = getItem(); if (item && item->getIsLinkType()) { - items.push_back(std::string("Goto Link")); + items.push_back(std::string("Find Original")); } items.push_back(std::string("Properties")); @@ -4493,7 +4493,7 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if (item && item->getIsLinkType()) { - items.push_back(std::string("Goto Link")); + items.push_back(std::string("Find Original")); } items.push_back(std::string("Properties")); @@ -5157,7 +5157,7 @@ void LLLinkFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { - items.push_back(std::string("Goto Link")); + items.push_back(std::string("Find Original")); items.push_back(std::string("Delete")); if (!isItemRemovable()) { diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index c86d32c8c4..b65a49eaed 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -356,9 +356,9 @@ parameter="restore" /> + name="Find Original"> -- cgit v1.2.3 From 2e70e4e2d7adbca52884186975623e26ab7fb9fb Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 13 Nov 2009 12:59:17 -0800 Subject: Add functionality to nearby media floater: parcel media & autoplay This change implements the enabling/disabling of parcel media, as well as setting the user's autoplay preference. I still am quite confused by this UI, so we'll need to play with it a bit to ensure it is what we want to present to users. This adds a few helpers to llviewerparcelmedia to get the name and URL of media. --- indra/newview/llviewermedia.cpp | 6 ++++-- indra/newview/llviewermedia.h | 3 +++ indra/newview/llviewerparcelmedia.cpp | 26 ++++++++++++++++++++++++++ indra/newview/llviewerparcelmedia.h | 2 ++ 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 69d4da373e..36fef07989 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -54,6 +54,8 @@ #include // for SkinFolder listener #include +/*static*/ const char* LLViewerMedia::AUTO_PLAY_MEDIA_SETTING = "AutoPlayMedia"; + // Move this to its own file. LLViewerMediaEventEmitter::~LLViewerMediaEventEmitter() @@ -313,7 +315,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s // If (the media was already loaded OR the media was set to autoplay) AND this update didn't come from this agent, // do a navigate. - if((was_loaded || (media_entry->getAutoPlay() && gSavedSettings.getBOOL("AutoPlayMedia"))) && !update_from_self) + if((was_loaded || (media_entry->getAutoPlay() && gSavedSettings.getBOOL(AUTO_PLAY_MEDIA_SETTING))) && !update_from_self) { needs_navigate = (media_entry->getCurrentURL() != previous_url); } @@ -330,7 +332,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s media_impl->setHomeURL(media_entry->getHomeURL()); - if(media_entry->getAutoPlay() && gSavedSettings.getBOOL("AutoPlayMedia")) + if(media_entry->getAutoPlay() && gSavedSettings.getBOOL(AUTO_PLAY_MEDIA_SETTING)) { needs_navigate = true; } diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 719deb28bf..639aed4b8a 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -74,6 +74,9 @@ class LLViewerMedia LOG_CLASS(LLViewerMedia); public: + // String to get/set media autoplay in gSavedSettings + static const char *AUTO_PLAY_MEDIA_SETTING; + typedef std::vector impl_list; // Special case early init for just web browser component diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index 336d7f684e..7559fd8e72 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -324,10 +324,36 @@ std::string LLViewerParcelMedia::getMimeType() { return sMediaImpl.notNull() ? sMediaImpl->getMimeType() : "none/none"; } + +//static +std::string LLViewerParcelMedia::getURL() +{ + std::string url; + if(sMediaImpl.notNull()) + url = sMediaImpl->getMediaURL(); + + if (url.empty()) + url = LLViewerParcelMgr::getInstance()->getAgentParcel()->getMediaCurrentURL(); + + if (url.empty()) + url = LLViewerParcelMgr::getInstance()->getAgentParcel()->getMediaURL(); + + return url; +} + +//static +std::string LLViewerParcelMedia::getName() +{ + if(sMediaImpl.notNull()) + return sMediaImpl->getName(); + return ""; +} + viewer_media_t LLViewerParcelMedia::getParcelMedia() { return sMediaImpl; } + ////////////////////////////////////////////////////////////////////////////////////////// // static void LLViewerParcelMedia::processParcelMediaCommandMessage( LLMessageSystem *msg, void ** ) diff --git a/indra/newview/llviewerparcelmedia.h b/indra/newview/llviewerparcelmedia.h index 3f7f898356..19e1ef78d4 100644 --- a/indra/newview/llviewerparcelmedia.h +++ b/indra/newview/llviewerparcelmedia.h @@ -71,6 +71,8 @@ class LLViewerParcelMedia : public LLViewerMediaObserver 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 ** ); -- cgit v1.2.3 From 5890c850f8db30e105717b7c5fbbec91c434ebff Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 13 Nov 2009 13:05:16 -0800 Subject: Prevent the about:blank url from the initial navigate from leaking out of the webkit plugin. This should fix DEV-42766. --- indra/media_plugins/webkit/media_plugin_webkit.cpp | 128 +++++++++++++++------ 1 file changed, 94 insertions(+), 34 deletions(-) diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 3ce8ff3deb..1e79720f43 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -74,8 +74,17 @@ public: private: + enum + { + INIT_STATE_UNINITIALIZED, // Browser instance hasn't been set up yet + INIT_STATE_NAVIGATING, // Browser instance has been set up and initial navigate to about:blank has been issued + INIT_STATE_NAVIGATE_COMPLETE, // initial navigate to about:blank has completed + INIT_STATE_WAIT_REDRAW, // First real navigate begin has been received, waiting for page changed event to start handling redraws + INIT_STATE_RUNNING // All initialization gymnastics are complete. + }; int mBrowserWindowId; - bool mBrowserInitialized; + int mInitState; + std::string mInitialNavigateURL; bool mNeedsUpdate; bool mCanCut; @@ -93,7 +102,17 @@ private: checkEditState(); - if ( mNeedsUpdate ) + if(mInitState == INIT_STATE_NAVIGATE_COMPLETE) + { + if(!mInitialNavigateURL.empty()) + { + // We already have the initial navigate URL -- kick off the navigate. + LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, mInitialNavigateURL ); + mInitialNavigateURL.clear(); + } + } + + if ( (mInitState == INIT_STATE_RUNNING) && mNeedsUpdate ) { const unsigned char* browser_pixels = LLQtWebKit::getInstance()->grabBrowserWindow( mBrowserWindowId ); @@ -123,7 +142,7 @@ private: bool initBrowser() { // already initialized - if ( mBrowserInitialized ) + if ( mInitState > INIT_STATE_UNINITIALIZED ) return true; // not enough information to initialize the browser yet. @@ -210,20 +229,21 @@ private: // set background color to be black - mostly for initial login page LLQtWebKit::getInstance()->setBackgroundColor( mBrowserWindowId, 0x00, 0x00, 0x00 ); + // Set state _before_ starting the navigate, since onNavigateBegin might get called before this call returns. + mInitState = INIT_STATE_NAVIGATING; + // Don't do this here -- it causes the dreaded "white flash" when loading a browser instance. // FIXME: Re-added this because navigating to a "page" initializes things correctly - especially // for the HTTP AUTH dialog issues (DEV-41731). Will fix at a later date. LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, "about:blank" ); - // set flag so we don't do this again - mBrowserInitialized = true; - return true; }; return false; }; + //////////////////////////////////////////////////////////////////////////////// // virtual void onCursorChanged(const EventType& event) @@ -263,6 +283,11 @@ private: // virtual void onPageChanged( const EventType& event ) { + if(mInitState == INIT_STATE_WAIT_REDRAW) + { + mInitState = INIT_STATE_RUNNING; + } + // flag that an update is required mNeedsUpdate = true; }; @@ -271,62 +296,90 @@ private: // virtual void onNavigateBegin(const EventType& event) { - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_begin"); - message.setValue("uri", event.getEventUri()); - sendMessage(message); - - setStatus(STATUS_LOADING); + if(mInitState > INIT_STATE_NAVIGATE_COMPLETE) + { + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_begin"); + message.setValue("uri", event.getEventUri()); + sendMessage(message); + + setStatus(STATUS_LOADING); + } + else if(mInitState == INIT_STATE_NAVIGATE_COMPLETE) + { + mInitState = INIT_STATE_WAIT_REDRAW; + } + } //////////////////////////////////////////////////////////////////////////////// // virtual void onNavigateComplete(const EventType& event) { - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_complete"); - message.setValue("uri", event.getEventUri()); - message.setValueS32("result_code", event.getIntValue()); - message.setValue("result_string", event.getStringValue()); - message.setValueBoolean("history_back_available", LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_BACK)); - message.setValueBoolean("history_forward_available", LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_FORWARD)); - sendMessage(message); - - setStatus(STATUS_LOADED); + if(mInitState > INIT_STATE_NAVIGATE_COMPLETE) + { + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_complete"); + message.setValue("uri", event.getEventUri()); + message.setValueS32("result_code", event.getIntValue()); + message.setValue("result_string", event.getStringValue()); + message.setValueBoolean("history_back_available", LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_BACK)); + message.setValueBoolean("history_forward_available", LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_FORWARD)); + sendMessage(message); + + setStatus(STATUS_LOADED); + } + else if(mInitState == INIT_STATE_NAVIGATING) + { + mInitState = INIT_STATE_NAVIGATE_COMPLETE; + } + } //////////////////////////////////////////////////////////////////////////////// // virtual void onUpdateProgress(const EventType& event) { - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "progress"); - message.setValueS32("percent", event.getIntValue()); - sendMessage(message); + if(mInitState > INIT_STATE_NAVIGATE_COMPLETE) + { + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "progress"); + message.setValueS32("percent", event.getIntValue()); + sendMessage(message); + } } //////////////////////////////////////////////////////////////////////////////// // virtual void onStatusTextChange(const EventType& event) { - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "status_text"); - message.setValue("status", event.getStringValue()); - sendMessage(message); + if(mInitState > INIT_STATE_NAVIGATE_COMPLETE) + { + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "status_text"); + message.setValue("status", event.getStringValue()); + sendMessage(message); + } } //////////////////////////////////////////////////////////////////////////////// // virtual void onTitleChange(const EventType& event) { - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "name_text"); - message.setValue("name", event.getStringValue()); - sendMessage(message); + if(mInitState > INIT_STATE_NAVIGATE_COMPLETE) + { + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "name_text"); + message.setValue("name", event.getStringValue()); + sendMessage(message); + } } //////////////////////////////////////////////////////////////////////////////// // virtual void onLocationChange(const EventType& event) { - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "location_changed"); - message.setValue("uri", event.getEventUri()); - sendMessage(message); + if(mInitState > INIT_STATE_NAVIGATE_COMPLETE) + { + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "location_changed"); + message.setValue("uri", event.getEventUri()); + sendMessage(message); + } } //////////////////////////////////////////////////////////////////////////////// @@ -488,7 +541,7 @@ MediaPluginWebKit::MediaPluginWebKit(LLPluginInstance::sendMessageFunction host_ // std::cerr << "MediaPluginWebKit constructor" << std::endl; mBrowserWindowId = 0; - mBrowserInitialized = false; + mInitState = INIT_STATE_UNINITIALIZED; mNeedsUpdate = true; mCanCut = false; mCanCopy = false; @@ -674,7 +727,14 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) if(!uri.empty()) { - LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, uri ); + if(mInitState >= INIT_STATE_NAVIGATE_COMPLETE) + { + LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, uri ); + } + else + { + mInitialNavigateURL = uri; + } } } else if(message_name == "mouse_event") -- cgit v1.2.3 From 39c53fcf0eb718b0a3d1f43a3c9ee1a38ffef49f Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 13 Nov 2009 13:05:56 -0800 Subject: Clear the media texture to black instead of almost-black. --- indra/newview/llviewermedia.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 69d4da373e..513fae41eb 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1704,7 +1704,7 @@ LLViewerMediaTexture* LLViewerMediaImpl::updatePlaceholderImage() // MEDIAOPT: seems insane that we actually have to make an imageraw then // immediately discard it LLPointer raw = new LLImageRaw(texture_width, texture_height, texture_depth); - raw->clear(0x0f, 0x0f, 0x0f, 0xff); + raw->clear(0x00, 0x00, 0x00, 0xff); int discard_level = 0; // ask media source for correct GL image format constants -- cgit v1.2.3 From f0cd44a6a2c4001111e82425cf2bd4fee63fad27 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 13 Nov 2009 16:18:53 -0500 Subject: EXT-2482 : Newly created folders have wrong default type Removed AT_ROOT_CATEGORY and FT_ROOT_CATEGORY since those types are unused. Changed FT_CATEGORY to FT_ROOT_INVENTORY to make its purpose more clear. This change assumes that no agent inventories have category type 9 for either inventory type or folder preferred type. --HG-- branch : avatar-pipeline --- indra/llcommon/llassettype.h | 5 ----- indra/llcommon/llfoldertype.cpp | 3 +-- indra/llcommon/llfoldertype.h | 17 +++-------------- indra/llinventory/llinventorytype.cpp | 2 +- indra/newview/llfloaterbuy.cpp | 4 ---- indra/newview/llfloaterbuycontents.cpp | 6 +----- indra/newview/llinventorybridge.cpp | 5 ----- indra/newview/llinventorymodel.cpp | 4 ++-- indra/newview/llviewerassettype.cpp | 1 - indra/newview/llviewerfoldertype.cpp | 3 +-- indra/newview/llviewermenu.cpp | 3 +-- indra/newview/llviewermessage.cpp | 6 ++---- 12 files changed, 12 insertions(+), 47 deletions(-) diff --git a/indra/llcommon/llassettype.h b/indra/llcommon/llassettype.h index ec2290d30e..c7bbc2e74a 100644 --- a/indra/llcommon/llassettype.h +++ b/indra/llcommon/llassettype.h @@ -78,11 +78,6 @@ public: // Holds a collection of inventory items. // It's treated as an item in the inventory and therefore needs a type. - AT_ROOT_CATEGORY = 9, - // A user's root inventory category. - // We decided to expose it visually, so it seems logical to fold - // it into the asset types. - AT_LSL_TEXT = 10, AT_LSL_BYTECODE = 11, // The LSL is the scripting language. diff --git a/indra/llcommon/llfoldertype.cpp b/indra/llcommon/llfoldertype.cpp index 9107b11597..079e670b1a 100644 --- a/indra/llcommon/llfoldertype.cpp +++ b/indra/llcommon/llfoldertype.cpp @@ -72,8 +72,7 @@ LLFolderDictionary::LLFolderDictionary() addEntry(LLFolderType::FT_CLOTHING, new FolderEntry("clothing", TRUE)); addEntry(LLFolderType::FT_OBJECT, new FolderEntry("object", TRUE)); addEntry(LLFolderType::FT_NOTECARD, new FolderEntry("notecard", TRUE)); - addEntry(LLFolderType::FT_CATEGORY, new FolderEntry("category", TRUE)); - addEntry(LLFolderType::FT_ROOT_CATEGORY, new FolderEntry("root", TRUE)); + addEntry(LLFolderType::FT_ROOT_INVENTORY, new FolderEntry("root_inv", TRUE)); addEntry(LLFolderType::FT_LSL_TEXT, new FolderEntry("lsltext", TRUE)); addEntry(LLFolderType::FT_BODYPART, new FolderEntry("bodypart", TRUE)); addEntry(LLFolderType::FT_TRASH, new FolderEntry("trash", TRUE)); diff --git a/indra/llcommon/llfoldertype.h b/indra/llcommon/llfoldertype.h index 5374ffd829..7aa77f7f7e 100644 --- a/indra/llcommon/llfoldertype.h +++ b/indra/llcommon/llfoldertype.h @@ -52,23 +52,18 @@ public: FT_LANDMARK = 3, - // FT_SCRIPT = 4, - FT_CLOTHING = 5, FT_OBJECT = 6, FT_NOTECARD = 7, - FT_CATEGORY = 8, - - FT_ROOT_CATEGORY = 9, + FT_ROOT_INVENTORY = 8, + // We'd really like to change this to 9 since AT_CATEGORY is 8, + // but "My Inventory" has been type 8 for a long time. FT_LSL_TEXT = 10, - // FT_LSL_BYTECODE = 11, - // FT_TEXTURE_TGA = 12, - FT_BODYPART = 13, FT_TRASH = 14, @@ -77,16 +72,10 @@ public: FT_LOST_AND_FOUND = 16, - // FT_SOUND_WAV = 17, - // FT_IMAGE_TGA = 18, - // FT_IMAGE_JPEG = 19, - FT_ANIMATION = 20, FT_GESTURE = 21, - // FT_SIMSTATE = 22, - FT_FAVORITE = 23, FT_ENSEMBLE_START = 26, diff --git a/indra/llinventory/llinventorytype.cpp b/indra/llinventory/llinventorytype.cpp index 0e71c0d12d..4ef5df0b28 100644 --- a/indra/llinventory/llinventorytype.cpp +++ b/indra/llinventory/llinventorytype.cpp @@ -106,7 +106,7 @@ DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] = LLInventoryType::IT_OBJECT, // AT_OBJECT LLInventoryType::IT_NOTECARD, // AT_NOTECARD LLInventoryType::IT_CATEGORY, // AT_CATEGORY - LLInventoryType::IT_ROOT_CATEGORY, // AT_ROOT_CATEGORY + LLInventoryType::IT_NONE, // (null entry) LLInventoryType::IT_LSL, // AT_LSL_TEXT LLInventoryType::IT_LSL, // AT_LSL_BYTECODE LLInventoryType::IT_TEXTURE, // AT_TEXTURE_TGA diff --git a/indra/newview/llfloaterbuy.cpp b/indra/newview/llfloaterbuy.cpp index cefd7a3808..c8df6c6135 100644 --- a/indra/newview/llfloaterbuy.cpp +++ b/indra/newview/llfloaterbuy.cpp @@ -230,10 +230,6 @@ void LLFloaterBuy::inventoryChanged(LLViewerObject* obj, if (obj->getType() == LLAssetType::AT_CATEGORY) continue; - // Skip root folders, so we know we have inventory items only - if (obj->getType() == LLAssetType::AT_ROOT_CATEGORY) - continue; - // Skip the mysterious blank InventoryObject if (obj->getType() == LLAssetType::AT_NONE) continue; diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index 32802f6a20..a99d0c918d 100644 --- a/indra/newview/llfloaterbuycontents.cpp +++ b/indra/newview/llfloaterbuycontents.cpp @@ -187,10 +187,6 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj, if (asset_type == LLAssetType::AT_CATEGORY) continue; - // Skip root folders, so we know we have inventory items only - if (asset_type == LLAssetType::AT_ROOT_CATEGORY) - continue; - LLInventoryItem* inv_item = (LLInventoryItem*)((LLInventoryObject*)(*it)); inv_type = inv_item->getInventoryType(); @@ -286,7 +282,7 @@ void LLFloaterBuyContents::onClickBuy() // Put the items where we put new folders. LLUUID category_id; - category_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CATEGORY); + category_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_ROOT_INVENTORY); // *NOTE: doesn't work for multiple object buy, which UI does not // currently support sale info is used for verification only, if diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 6087df33b9..7d2922b561 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -892,7 +892,6 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, new_listener = new LLWearableBridge(inventory, uuid, asset_type, inv_type, (EWearableType)flags); break; case LLAssetType::AT_CATEGORY: - case LLAssetType::AT_ROOT_CATEGORY: if (actual_asset_type == LLAssetType::AT_LINK_FOLDER) { // Create a link folder handler instead. @@ -2847,10 +2846,6 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, BOOL is_movable = TRUE; switch( inv_item->getActualType() ) { - case LLAssetType::AT_ROOT_CATEGORY: - is_movable = FALSE; - break; - case LLAssetType::AT_CATEGORY: is_movable = !LLFolderType::lookupIsProtectedType(((LLInventoryCategory*)inv_item)->getPreferredType()); break; diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 3354a43001..3a1d457877 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -341,7 +341,7 @@ const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType t, bo const LLUUID &LLInventoryModel::findCatUUID(LLFolderType::EType preferred_type) const { const LLUUID &root_id = gInventory.getRootFolderID(); - if(LLFolderType::FT_CATEGORY == preferred_type) + if(LLFolderType::FT_ROOT_INVENTORY == preferred_type) { return root_id; } @@ -2465,7 +2465,7 @@ void LLInventoryModel::buildParentChildMap() { cat->setParent(findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND)); } - else if(LLFolderType::FT_CATEGORY == pref) + else if(LLFolderType::FT_ROOT_INVENTORY == pref) { // it's the root cat->setParent(LLUUID::null); diff --git a/indra/newview/llviewerassettype.cpp b/indra/newview/llviewerassettype.cpp index c974171c2c..b382ff6306 100644 --- a/indra/newview/llviewerassettype.cpp +++ b/indra/newview/llviewerassettype.cpp @@ -71,7 +71,6 @@ LLViewerAssetDictionary::LLViewerAssetDictionary() addEntry(LLViewerAssetType::AT_OBJECT, new ViewerAssetEntry(DAD_OBJECT)); addEntry(LLViewerAssetType::AT_NOTECARD, new ViewerAssetEntry(DAD_NOTECARD)); addEntry(LLViewerAssetType::AT_CATEGORY, new ViewerAssetEntry(DAD_CATEGORY)); - addEntry(LLViewerAssetType::AT_ROOT_CATEGORY, new ViewerAssetEntry(DAD_ROOT_CATEGORY)); addEntry(LLViewerAssetType::AT_LSL_TEXT, new ViewerAssetEntry(DAD_SCRIPT)); addEntry(LLViewerAssetType::AT_LSL_BYTECODE, new ViewerAssetEntry(DAD_NONE)); addEntry(LLViewerAssetType::AT_TEXTURE_TGA, new ViewerAssetEntry(DAD_NONE)); diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index 384538364f..6aabcb11b8 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -109,8 +109,7 @@ LLViewerFolderDictionary::LLViewerFolderDictionary() addEntry(LLFolderType::FT_CLOTHING, new ViewerFolderEntry("Clothing", "inv_folder_clothing.tga")); addEntry(LLFolderType::FT_OBJECT, new ViewerFolderEntry("Objects", "inv_folder_object.tga")); addEntry(LLFolderType::FT_NOTECARD, new ViewerFolderEntry("Notecards", "inv_folder_notecard.tga")); - addEntry(LLFolderType::FT_CATEGORY, new ViewerFolderEntry("New Folder", "inv_folder_plain_closed.tga")); - addEntry(LLFolderType::FT_ROOT_CATEGORY, new ViewerFolderEntry("Inventory", "")); + addEntry(LLFolderType::FT_ROOT_INVENTORY, new ViewerFolderEntry("My Inventory", "")); addEntry(LLFolderType::FT_LSL_TEXT, new ViewerFolderEntry("Scripts", "inv_folder_script.tga")); addEntry(LLFolderType::FT_BODYPART, new ViewerFolderEntry("Body Parts", "inv_folder_bodypart.tga")); addEntry(LLFolderType::FT_TRASH, new ViewerFolderEntry("Trash", "inv_folder_trash.tga")); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 4cc1d986bb..68a9aaef75 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3879,8 +3879,7 @@ void god_force_inv_owner_permissive(LLViewerObject* object, InventoryObjectList::const_iterator inv_end = inventory->end(); for ( ; inv_it != inv_end; ++inv_it) { - if(((*inv_it)->getType() != LLAssetType::AT_CATEGORY) - && ((*inv_it)->getType() != LLAssetType::AT_ROOT_CATEGORY)) + if(((*inv_it)->getType() != LLAssetType::AT_CATEGORY)) { LLInventoryObject* obj = *inv_it; LLPointer new_item = new LLViewerInventoryItem((LLViewerInventoryItem*)obj); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 4088eafe16..f0c1823def 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4833,8 +4833,7 @@ void container_inventory_arrived(LLViewerObject* object, InventoryObjectList::const_iterator end = inventory->end(); for ( ; it != end; ++it) { - if ((*it)->getType() != LLAssetType::AT_CATEGORY && - (*it)->getType() != LLAssetType::AT_ROOT_CATEGORY) + if ((*it)->getType() != LLAssetType::AT_CATEGORY) { LLInventoryObject* obj = (LLInventoryObject*)(*it); LLInventoryItem* item = (LLInventoryItem*)(obj); @@ -4869,8 +4868,7 @@ void container_inventory_arrived(LLViewerObject* object, // one actual object InventoryObjectList::iterator it = inventory->begin(); - if ((*it)->getType() == LLAssetType::AT_CATEGORY || - (*it)->getType() == LLAssetType::AT_ROOT_CATEGORY) + if ((*it)->getType() == LLAssetType::AT_CATEGORY) { ++it; } -- cgit v1.2.3 From d191143cbc3aef7cd68cad98e480fb656c9e8c01 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 13 Nov 2009 13:47:18 -0800 Subject: Special-case a "401" status ("auth required") in LLMimeDiscoveryResponder::error() to be treated as a mime type of "text/html" instead of a failure. --- indra/newview/llviewermedia.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 513fae41eb..b4164a94e8 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -159,12 +159,21 @@ public: virtual void error( U32 status, const std::string& reason ) { - llwarns << "responder failed with status " << status << ", reason " << reason << llendl; - if(mMediaImpl) + if(status == 401) + { + // This is the "you need to authenticate" status. + // Treat this like an html page. + completeAny(status, "text/html"); + } + else { - mMediaImpl->mMediaSourceFailed = true; + llwarns << "responder failed with status " << status << ", reason " << reason << llendl; + + if(mMediaImpl) + { + mMediaImpl->mMediaSourceFailed = true; + } } - // completeAny(status, "none/none"); } void completeAny(U32 status, const std::string& mime_type) -- cgit v1.2.3 From 2c05c3dab31ee0887d58382cecab903707ae0ee4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 13 Nov 2009 16:48:53 -0500 Subject: For DEV-41820: Allow dragging links to Looks and Current Look: copy the link, wear if Current Look --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 62ae6f501e..bfd30df085 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2337,7 +2337,7 @@ void LLFolderBridge::pasteLinkFromClipboard() { link_inventory_item( gAgent.getID(), - item->getUUID(), + item->getLinkedUUID(), parent_id, item->getName(), LLAssetType::AT_LINK, @@ -2960,9 +2960,9 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, LLPointer cb = NULL; link_inventory_item( gAgent.getID(), - inv_item->getUUID(), + inv_item->getLinkedUUID(), mUUID, - std::string(), + inv_item->getName(), LLAssetType::AT_LINK, cb); } -- cgit v1.2.3 From 3027c9fcce0660a3f69a8ce6f6ccbb0de148a3e2 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 13 Nov 2009 16:58:08 -0500 Subject: Header file #include cleanup for llinventorymodel and llinventorypanel. Removed a bunch of unnecessary header inclues. --HG-- branch : avatar-pipeline --- indra/newview/llinventorymodel.cpp | 30 +++++++------------------- indra/newview/llinventorypanel.cpp | 43 ++------------------------------------ 2 files changed, 9 insertions(+), 64 deletions(-) diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 3a1d457877..ffe5f7181d 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -31,40 +31,24 @@ */ #include "llviewerprecompiledheaders.h" - #include "llinventorymodel.h" -#include "llassetstorage.h" -#include "llcrc.h" -#include "lldir.h" -#include "llsys.h" -#include "llxfermanager.h" -#include "message.h" - #include "llagent.h" #include "llagentwearables.h" -#include "llfloater.h" -#include "llfocusmgr.h" -#include "llinventorybridge.h" -#include "llinventoryfunctions.h" #include "llinventorypanel.h" #include "llfloaterinventory.h" -#include "llviewerfoldertype.h" -#include "llviewerinventory.h" +#include "llinventorybridge.h" +#include "llinventoryfunctions.h" +#include "llwindow.h" +#include "llviewercontrol.h" +#include "llpreview.h" #include "llviewermessage.h" +#include "llviewerfoldertype.h" #include "llviewerwindow.h" -#include "llviewerregion.h" #include "llappviewer.h" -#include "lldbstrings.h" -#include "llviewerstats.h" -#include "llmutelist.h" -#include "llnotifications.h" +#include "llviewerregion.h" #include "llcallbacklist.h" -#include "llpreview.h" -#include "llviewercontrol.h" #include "llvoavatarself.h" -#include "llsdutil.h" -#include //#define DIFF_INVENTORY_FILES #ifdef DIFF_INVENTORY_FILES diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index edb65511bc..6b1f7313dd 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -38,55 +38,16 @@ // Seraph TODO: Remove unnecessary headers -// library includes #include "llagent.h" #include "llagentwearables.h" -#include "llcallingcard.h" -#include "llfloaterreg.h" -#include "llsdserialize.h" -#include "llfiltereditor.h" -#include "llspinctrl.h" -#include "llui.h" -#include "message.h" - -// newview includes #include "llappearancemgr.h" -#include "llappviewer.h" -#include "llfirstuse.h" -#include "llfloaterchat.h" -#include "llfloatercustomize.h" -#include "llfocusmgr.h" -#include "llfolderview.h" -#include "llgesturemgr.h" -#include "lliconctrl.h" +#include "llfloaterreg.h" #include "llimview.h" #include "llinventorybridge.h" -#include "llinventoryclipboard.h" -#include "llinventorymodel.h" -#include "lllineeditor.h" -#include "llmenugl.h" -#include "llpreviewanim.h" -#include "llpreviewgesture.h" -#include "llpreviewnotecard.h" -#include "llpreviewscript.h" -#include "llpreviewsound.h" -#include "llpreviewtexture.h" -#include "llresmgr.h" -#include "llscrollbar.h" #include "llscrollcontainer.h" -#include "llselectmgr.h" -#include "lltabcontainer.h" -#include "lltooldraganddrop.h" -#include "lluictrlfactory.h" #include "llviewerfoldertype.h" -#include "llviewerinventory.h" -#include "llviewermessage.h" -#include "llviewerobjectlist.h" -#include "llviewerregion.h" -#include "llviewerwindow.h" -#include "llvoavatarself.h" -#include "llwearablelist.h" #include "llimfloater.h" +#include "llvoavatarself.h" static LLDefaultChildRegistry::Register r("inventory_panel"); -- cgit v1.2.3 From 21357c482256be27780ebf46749b5ccad1c96a9d Mon Sep 17 00:00:00 2001 From: Erica Date: Fri, 13 Nov 2009 14:28:58 -0800 Subject: fixing media texture image names - removing file extention --- indra/newview/skins/default/textures/textures.xml | 56 +++++++++++------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index eea2dfb1a1..d5293bdbb5 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -23,13 +23,13 @@ - - - + + + - - - + + + @@ -109,9 +109,9 @@ - - - + + + @@ -338,12 +338,12 @@ - - - - - - + + + + + + @@ -425,12 +425,12 @@ - - - - - - + + + + + + @@ -449,9 +449,9 @@ - - - + + + @@ -531,7 +531,7 @@ - + @@ -563,9 +563,9 @@ - - - + + + -- cgit v1.2.3 From acdce232994fce7edf9a67a360db2368c5ad6594 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 13 Nov 2009 17:47:00 -0500 Subject: Header file cleanup Removed unnecessary "#include llinventorymodel.h" now that llinventoryobserver was split from llinventorymodel. --HG-- branch : avatar-pipeline --- indra/newview/llagentwearables.cpp | 2 +- indra/newview/llappearancemgr.cpp | 2 +- indra/newview/llassetuploadresponders.cpp | 2 +- indra/newview/llcallingcard.cpp | 2 +- indra/newview/llfavoritesbar.h | 1 + indra/newview/llfloaterproperties.cpp | 1 + indra/newview/llfloaterworldmap.cpp | 1 + indra/newview/llfoldervieweventlistener.h | 2 ++ indra/newview/llfolderviewitem.cpp | 1 - indra/newview/llgesturemgr.h | 2 +- indra/newview/llinventorybridge.h | 10 ++++++---- indra/newview/llinventorymodel.cpp | 1 + indra/newview/llinventorymodel.h | 5 ----- indra/newview/lllocationinputctrl.cpp | 2 +- indra/newview/llpanelmaininventory.h | 3 ++- indra/newview/llpanelpeople.cpp | 1 + indra/newview/llpreview.h | 2 +- indra/newview/llpreviewscript.h | 2 +- indra/newview/llsidepaneliteminfo.cpp | 1 + indra/newview/lltexturectrl.cpp | 2 +- indra/newview/lltracker.cpp | 1 + indra/newview/llviewermessage.cpp | 1 + 22 files changed, 27 insertions(+), 20 deletions(-) diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 5dbbcd727c..17e7eea2f1 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -39,7 +39,7 @@ #include "llfloatercustomize.h" #include "llfloaterinventory.h" #include "llinventorybridge.h" -#include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "llinventorypanel.h" #include "llnotify.h" #include "llviewerregion.h" diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index e46cfe6af9..61c1081d22 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -38,7 +38,7 @@ #include "llfloatercustomize.h" #include "llgesturemgr.h" #include "llinventorybridge.h" -#include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "llnotifications.h" #include "llpanelappearance.h" #include "llsidetray.h" diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 4d85ecb97c..38843c7221 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -40,7 +40,7 @@ #include "llfloaterbuycurrency.h" #include "llfilepicker.h" #include "llnotify.h" -#include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "llinventorypanel.h" #include "llfloaterinventory.h" #include "llpermissionsflags.h" diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index e8812d87ee..0b10255c2f 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -51,7 +51,7 @@ #include "llagent.h" #include "llbutton.h" -//#include "llinventory.h" +#include "llinventoryobserver.h" #include "llinventorymodel.h" #include "llnotify.h" #include "llresmgr.h" diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index e90d13f9d5..20a324c67c 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -35,6 +35,7 @@ #include "lluictrl.h" +#include "llinventoryobserver.h" #include "llinventorymodel.h" class LLFavoritesBarCtrl : public LLUICtrl, public LLInventoryObserver diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index 928126bff9..e0d4a59d9d 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -44,6 +44,7 @@ #include "llbutton.h" #include "llcheckboxctrl.h" #include "llavataractions.h" +#include "llinventoryobserver.h" #include "llinventorymodel.h" #include "lllineeditor.h" //#include "llspinctrl.h" diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 7d2eb98111..85847e5fce 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -51,6 +51,7 @@ #include "llfloaterreg.h" // getTypedInstance() #include "llfocusmgr.h" #include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "lllandmarklist.h" #include "lllineeditor.h" #include "llregionhandle.h" diff --git a/indra/newview/llfoldervieweventlistener.h b/indra/newview/llfoldervieweventlistener.h index 60ece75cea..473d0be912 100644 --- a/indra/newview/llfoldervieweventlistener.h +++ b/indra/newview/llfoldervieweventlistener.h @@ -34,6 +34,8 @@ #include "lldarray.h" // JAMESDEBUG convert to std::vector #include "llfoldertype.h" #include "llfontgl.h" // just for StyleFlags enum +#include "llinventorytype.h" +#include "llpermissionsflags.h" #include "llpointer.h" diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 6fdaefd21a..102651f432 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -38,7 +38,6 @@ #include "llfoldervieweventlistener.h" #include "llinventorybridge.h" // for LLItemBridge in LLInventorySort::operator() #include "llinventoryfilter.h" -#include "llinventorymodel.h" // *TODO: make it take a pointer to an inventory-model interface #include "llviewercontrol.h" // gSavedSettings #include "llviewerwindow.h" // Argh, only for setCursor() diff --git a/indra/newview/llgesturemgr.h b/indra/newview/llgesturemgr.h index 947773d66d..c8b26f7309 100644 --- a/indra/newview/llgesturemgr.h +++ b/indra/newview/llgesturemgr.h @@ -38,7 +38,7 @@ #include #include "llassetstorage.h" // LLAssetType -#include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "llsingleton.h" #include "llviewerinventory.h" diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 3ffeb55d6c..4c7b0a0517 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -33,14 +33,16 @@ #ifndef LL_LLINVENTORYBRIDGE_H #define LL_LLINVENTORYBRIDGE_H -#include "llfloaterproperties.h" -#include "llwearable.h" -#include "llviewercontrol.h" #include "llcallingcard.h" -#include "llinventorymodel.h" +#include "llfloaterproperties.h" #include "llfoldervieweventlistener.h" +#include "llinventorymodel.h" +#include "llinventoryobserver.h" +#include "llviewercontrol.h" +#include "llwearable.h" class LLInventoryPanel; +class LLInventoryModel; class LLMenuGL; enum EInventoryIcon diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index ffe5f7181d..a8e5c4c216 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -39,6 +39,7 @@ #include "llfloaterinventory.h" #include "llinventorybridge.h" #include "llinventoryfunctions.h" +#include "llinventoryobserver.h" #include "llwindow.h" #include "llviewercontrol.h" #include "llpreview.h" diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index bd64591194..3c1f606d5c 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -46,11 +46,6 @@ #include #include -// ! REFACTOR ! Remove llinventoryobservers.h and have other files that need it explicitly -// include llinventoryobservers.h instead of llinventorymodel.h . This will reduce dependency on -// llinventorymodel.h. -#include "llinventoryobserver.h" - class LLInventoryObserver; class LLInventoryObject; class LLInventoryItem; diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 8fe317a292..7e35cfa04c 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -45,7 +45,7 @@ #include "lltooltip.h" // newview includes -#include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "lllandmarkactions.h" #include "lllandmarklist.h" #include "lllocationhistory.h" diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 29e9baa6cf..fbc0f09c50 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -35,7 +35,8 @@ #define LL_LLPANELMAININVENTORY_H #include "llpanel.h" -#include "llinventorymodel.h" +#include "llinventoryobserver.h" + #include "llfolderview.h" class LLFolderViewItem; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 2bbb2b7153..69edccf09f 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -54,6 +54,7 @@ #include "llfriendcard.h" #include "llgroupactions.h" #include "llgrouplist.h" +#include "llinventoryobserver.h" #include "llpanelpeoplemenus.h" #include "llrecentpeople.h" #include "llviewercontrol.h" // for gSavedSettings diff --git a/indra/newview/llpreview.h b/indra/newview/llpreview.h index 506c135ca6..3b9f7f9882 100644 --- a/indra/newview/llpreview.h +++ b/indra/newview/llpreview.h @@ -37,7 +37,7 @@ #include "llresizehandle.h" #include "llpointer.h" #include "lluuid.h" -#include "llinventorymodel.h" // LLInventoryObserver +#include "llinventoryobserver.h" #include class LLInventoryItem; diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index a00f580e32..28a409d3ee 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -41,7 +41,6 @@ #include "lliconctrl.h" #include "llframetimer.h" - class LLMessageSystem; class LLTextEditor; class LLButton; @@ -52,6 +51,7 @@ struct LLEntryAndEdCore; class LLMenuBarGL; class LLFloaterScriptSearch; class LLKeywordToken; +class LLViewerInventoryItem; // Inner, implementation class. LLPreviewScript and LLLiveLSLEditor each own one of these. class LLScriptEdCore : public LLPanel diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 9d2960fbed..a3efea7b7e 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -41,6 +41,7 @@ #include "llfloaterreg.h" #include "llgroupactions.h" #include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "lllineeditor.h" #include "llradiogroup.h" #include "llviewercontrol.h" diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index de00ca8420..5f7c2f5080 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -48,7 +48,7 @@ #include "llfoldervieweventlistener.h" #include "llinventory.h" #include "llinventoryfunctions.h" -#include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "llinventorypanel.h" #include "llfloaterinventory.h" #include "lllineeditor.h" diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index 1a61717658..407cc23d0d 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -55,6 +55,7 @@ #include "llhudtext.h" #include "llhudview.h" #include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "lllandmarklist.h" #include "llsky.h" #include "llui.h" diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index f0c1823def..7f25e567d0 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -89,6 +89,7 @@ #include "llhudeffecttrail.h" #include "llhudmanager.h" #include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "llinventorypanel.h" #include "llfloaterinventory.h" #include "llmenugl.h" -- cgit v1.2.3 From 6cb4b27897462582428e9d469feb6bf8c9335b06 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 13 Nov 2009 14:48:24 -0800 Subject: Fix for DEV-42161 (LLViewerMediaImpl::navigateInternal spam when editing object properties). Made LLPanelMediaSettingsGeneral::updateMediaPreview() only do a navigate when the URL actually changes. --- indra/newview/llpanelmediasettingsgeneral.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp index 2cf56d5571..ad8a379cc1 100644 --- a/indra/newview/llpanelmediasettingsgeneral.cpp +++ b/indra/newview/llpanelmediasettingsgeneral.cpp @@ -322,13 +322,19 @@ void LLPanelMediaSettingsGeneral::updateMediaPreview() { if ( mHomeURL->getValue().asString().length() > 0 ) { - mPreviewMedia->navigateTo( mHomeURL->getValue().asString() ); + if(mPreviewMedia->getCurrentNavUrl() != mHomeURL->getValue().asString()) + { + mPreviewMedia->navigateTo( mHomeURL->getValue().asString() ); + } } else // new home URL will be empty if media is deleted so display a // "preview goes here" data url page { - mPreviewMedia->navigateTo( CHECKERBOARD_DATA_URL ); + if(mPreviewMedia->getCurrentNavUrl() != CHECKERBOARD_DATA_URL) + { + mPreviewMedia->navigateTo( CHECKERBOARD_DATA_URL ); + } }; } -- cgit v1.2.3 From a4addf39e5293e008b534c9c1cfcad14956afe1a Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 13 Nov 2009 15:09:59 -0800 Subject: Small mods based on code review feedback from James --- indra/newview/llpanelprimmediacontrols.cpp | 59 +++++++++++++++--------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 9744d9ac0d..12ad070efd 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -117,34 +117,34 @@ LLPanelPrimMediaControls::~LLPanelPrimMediaControls() BOOL LLPanelPrimMediaControls::postBuild() { - mMediaRegion = getChild("media_region"); assert(mMediaRegion); - mBackCtrl = getChild("back"); assert(mBackCtrl); - mFwdCtrl = getChild("fwd"); assert(mFwdCtrl); - mReloadCtrl = getChild("reload"); assert(mReloadCtrl); - mPlayCtrl = getChild("play"); assert(mPlayCtrl); - mPauseCtrl = getChild("pause"); assert(mPauseCtrl); - mStopCtrl = getChild("stop"); assert(mStopCtrl); - mMediaStopCtrl = getChild("media_stop"); assert(mMediaStopCtrl); - mHomeCtrl = getChild("home"); assert(mHomeCtrl); - mUnzoomCtrl = getChild("close"); assert(mUnzoomCtrl); // This is actually "unzoom" - mOpenCtrl = getChild("new_window"); assert(mOpenCtrl); - mZoomCtrl = getChild("zoom_frame"); assert(mZoomCtrl); - mMediaProgressPanel = getChild("media_progress_indicator"); assert(mMediaProgressPanel); - mMediaProgressBar = getChild("media_progress_bar"); assert(mMediaProgressBar); - mMediaAddressCtrl = getChild("media_address"); assert(mMediaAddressCtrl); - mMediaAddress = getChild("media_address_url"); assert(mMediaAddress); - mMediaPlaySliderPanel = getChild("media_play_position"); assert(mMediaPlaySliderPanel); - mMediaPlaySliderCtrl = getChild("media_play_slider"); assert(mMediaPlaySliderCtrl); - mVolumeCtrl = getChild("media_volume"); assert(mVolumeCtrl); - mVolumeBtn = getChild("media_volume_button"); assert(mVolumeBtn); - mVolumeUpCtrl = getChild("volume_up"); assert(mVolumeUpCtrl); - mVolumeDownCtrl = getChild("volume_down"); assert(mVolumeDownCtrl); - mWhitelistIcon = getChild("media_whitelist_flag"); assert(mWhitelistIcon); - mSecureLockIcon = getChild("media_secure_lock_flag"); assert(mSecureLockIcon); - mMediaControlsStack = getChild("media_controls"); assert(mMediaControlsStack); - mLeftBookend = getChild("left_bookend"); assert(mLeftBookend); - mRightBookend = getChild("right_bookend"); assert(mRightBookend); - mBackgroundImage = LLUI::getUIImage(getString("control_background_image_name")); assert(mBackgroundImage); + mMediaRegion = getChild("media_region"); + mBackCtrl = getChild("back"); + mFwdCtrl = getChild("fwd"); + mReloadCtrl = getChild("reload"); + mPlayCtrl = getChild("play"); + mPauseCtrl = getChild("pause"); + mStopCtrl = getChild("stop"); + mMediaStopCtrl = getChild("media_stop"); + mHomeCtrl = getChild("home"); + mUnzoomCtrl = getChild("close"); // This is actually "unzoom" + mOpenCtrl = getChild("new_window"); + mZoomCtrl = getChild("zoom_frame"); + mMediaProgressPanel = getChild("media_progress_indicator"); + mMediaProgressBar = getChild("media_progress_bar"); + mMediaAddressCtrl = getChild("media_address"); + mMediaAddress = getChild("media_address_url"); + mMediaPlaySliderPanel = getChild("media_play_position"); + mMediaPlaySliderCtrl = getChild("media_play_slider"); + mVolumeCtrl = getChild("media_volume"); + mVolumeBtn = getChild("media_volume_button"); + mVolumeUpCtrl = getChild("volume_up"); + mVolumeDownCtrl = getChild("volume_down"); + mWhitelistIcon = getChild("media_whitelist_flag"); + mSecureLockIcon = getChild("media_secure_lock_flag"); + mMediaControlsStack = getChild("media_controls"); + mLeftBookend = getChild("left_bookend"); + mRightBookend = getChild("right_bookend"); + mBackgroundImage = LLUI::getUIImage(getString("control_background_image_name")); // These are currently removed...but getChild creates a "dummy" widget. // This class handles them missing. @@ -729,8 +729,7 @@ bool LLPanelPrimMediaControls::isMouseOver() getWindow()->getCursorPosition(&cursor_pos_window); getWindow()->convertCoords(cursor_pos_window, &cursor_pos_gl); - //FIXME: rewrite as LLViewQuery or get hover set from LLViewerWindow? - if(mMediaControlsStack && mMediaControlsStack->getVisible()) + if(mMediaControlsStack->getVisible()) { mMediaControlsStack->screenPointToLocal(cursor_pos_gl.mX, cursor_pos_gl.mY, &x, &y); -- cgit v1.2.3 From be429a3ae9bdb45b1fe4bbc185814604167ab18c Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Fri, 13 Nov 2009 18:19:22 -0500 Subject: EXT-2429 body parts out of sync with COF Visual param definitions weren't working properly when the wearable being loaded had fewer visual parameters than the current definition of the wearable. This occurred when you were loading wearables that had been created in older versions of the client (or from the library). Added missing parameters to mSavedVisualParamMap, and modified revertValues() to ensure that the two maps are kept fully in sync on finishing loading the wearable and when reverting the values. Code reviewed by Vir --HG-- branch : avatar-pipeline --- indra/newview/llwearable.cpp | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index c5c97e7649..e37dffd526 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -831,6 +831,7 @@ void LLWearable::addVisualParam(LLVisualParam *param) } param->setIsDummy(FALSE); mVisualParamIndexMap[param->getID()] = param; + mSavedVisualParamMap[param->getID()] = param->getDefaultWeight(); } void LLWearable::setVisualParams() @@ -933,11 +934,39 @@ void LLWearable::setClothesColor( S32 te, const LLColor4& new_color, BOOL upload void LLWearable::revertValues() { //update saved settings so wearable is no longer dirty + // non-driver params first for (param_map_t::const_iterator iter = mSavedVisualParamMap.begin(); iter != mSavedVisualParamMap.end(); iter++) { S32 id = iter->first; F32 value = iter->second; - setVisualParamWeight(id, value, TRUE); + LLVisualParam *param = getVisualParam(id); + if(param && !dynamic_cast(param) ) + { + setVisualParamWeight(id, value, TRUE); + } + } + + //then driver params + for (param_map_t::const_iterator iter = mSavedVisualParamMap.begin(); iter != mSavedVisualParamMap.end(); iter++) + { + S32 id = iter->first; + F32 value = iter->second; + LLVisualParam *param = getVisualParam(id); + if(param && dynamic_cast(param) ) + { + setVisualParamWeight(id, value, TRUE); + } + } + + // make sure that saved values are sane + for (param_map_t::const_iterator iter = mSavedVisualParamMap.begin(); iter != mSavedVisualParamMap.end(); iter++) + { + S32 id = iter->first; + LLVisualParam *param = getVisualParam(id); + if( param ) + { + mSavedVisualParamMap[id] = param->getWeight(); + } } syncImages(mSavedTEMap, mTEMap); -- cgit v1.2.3 From 42319d1ab89bd3d6ba193cc2c374ddc1571f2bdf Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 13 Nov 2009 18:22:00 -0500 Subject: Header file cleanup Moved LLInventoryPanelObserver to be private to LLInventoryPanel --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 10 ---------- indra/newview/llinventorybridge.h | 16 ---------------- indra/newview/llinventorypanel.cpp | 26 ++++++++++++++++++++++++-- 3 files changed, 24 insertions(+), 28 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d7be09efa9..2a1fdb081e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -162,16 +162,6 @@ std::string ICON_NAME[ICON_NAME_COUNT] = "inv_item_linkfolder.tga" }; - -// +=================================================+ -// | LLInventoryPanelObserver | -// +=================================================+ -void LLInventoryPanelObserver::changed(U32 mask) -{ - mIP->modelChanged(mask); -} - - // +=================================================+ // | LLInvFVBridge | // +=================================================+ diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 4c7b0a0517..56cb0f93ed 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -107,22 +107,6 @@ struct LLAttachmentRezAction S32 mAttachPt; }; - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLInventoryPanelObserver -// -// Bridge to support knowing when the inventory has changed. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLInventoryPanelObserver : public LLInventoryObserver -{ -public: - LLInventoryPanelObserver(LLInventoryPanel* ip) : mIP(ip) {} - virtual ~LLInventoryPanelObserver() {} - virtual void changed(U32 mask); -protected: - LLInventoryPanel* mIP; -}; - const std::string safe_inv_type_lookup(LLInventoryType::EType inv_type); void hide_context_entries(LLMenuGL& menu, const std::vector &entries_to_show, diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 6b1f7313dd..dc704f2b82 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -36,8 +36,6 @@ #include "llinventorypanel.h" -// Seraph TODO: Remove unnecessary headers - #include "llagent.h" #include "llagentwearables.h" #include "llappearancemgr.h" @@ -56,6 +54,22 @@ const std::string LLInventoryPanel::RECENTITEMS_SORT_ORDER = std::string("Recent const std::string LLInventoryPanel::INHERIT_SORT_ORDER = std::string(""); static const LLInventoryFVBridgeBuilder INVENTORY_BRIDGE_BUILDER; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInventoryPanelObserver +// +// Bridge to support knowing when the inventory has changed. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLInventoryPanelObserver : public LLInventoryObserver +{ +public: + LLInventoryPanelObserver(LLInventoryPanel* ip) : mIP(ip) {} + virtual ~LLInventoryPanelObserver() {} + virtual void changed(U32 mask); +protected: + LLInventoryPanel* mIP; +}; + LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : LLPanel(p), mInventoryObserver(NULL), @@ -872,3 +886,11 @@ void example_param_block_usage() LLUICtrlFactory::create(param_block); } + +// +=================================================+ +// | LLInventoryPanelObserver | +// +=================================================+ +void LLInventoryPanelObserver::changed(U32 mask) +{ + mIP->modelChanged(mask); +} -- cgit v1.2.3 From 3abee9a4506ed225f15934ab82881e16fa5f9113 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 13 Nov 2009 15:56:46 -0800 Subject: Fix for nearby chat toasts occluding the bottom bar. --- indra/newview/llnearbychathandler.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index cd77f59ee1..458845fff3 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -63,8 +63,6 @@ class LLNearbyChatScreenChannel: public LLScreenChannelBase public: LLNearbyChatScreenChannel(const LLUUID& id):LLScreenChannelBase(id) { mStopProcessing = false;}; - void init (S32 channel_left, S32 channel_right); - void addNotification (LLSD& notification); void arrangeToasts (); void showToastsBottom (); @@ -120,15 +118,6 @@ protected: bool mStopProcessing; }; -void LLNearbyChatScreenChannel::init(S32 channel_left, S32 channel_right) -{ - S32 channel_top = gViewerWindow->getWorldViewRectRaw().getHeight(); - S32 channel_bottom = gViewerWindow->getWorldViewRectRaw().mBottom; - setRect(LLRect(channel_left, channel_top, channel_right, channel_bottom)); - setVisible(TRUE); -} - - void LLNearbyChatScreenChannel::createOverflowToast(S32 bottom, F32 timer) { //we don't need overflow toast in nearby chat -- cgit v1.2.3 From c8ed7710c5305d1a1ec65a04543e3a2b1aad24f1 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 13 Nov 2009 15:57:38 -0800 Subject: Backed out changeset db8e08f8ba36 adding main_view.xml change rev 4863 back --- indra/newview/skins/default/xui/en/main_view.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml index 08f7ee456e..9e35c95d45 100644 --- a/indra/newview/skins/default/xui/en/main_view.xml +++ b/indra/newview/skins/default/xui/en/main_view.xml @@ -51,6 +51,13 @@ name="main_view" user_resize="true" width="500"> + - Date: Fri, 13 Nov 2009 16:16:12 -0800 Subject: EXT-2484 Auto Set Touch to Buy when a user checks the For Sale option Reviewed with Richard. --- indra/newview/llpanelpermissions.cpp | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 2d3f901370..1051326e72 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -970,19 +970,32 @@ void LLPanelPermissions::setAllSaleInfo() if (price < 0) sale_type = LLSaleInfo::FS_NOT; - LLSaleInfo sale_info(sale_type, price); - LLSelectMgr::getInstance()->selectionSetObjectSaleInfo(sale_info); + LLSaleInfo old_sale_info; + LLSelectMgr::getInstance()->selectGetSaleInfo(old_sale_info); + + LLSaleInfo new_sale_info(sale_type, price); + LLSelectMgr::getInstance()->selectionSetObjectSaleInfo(new_sale_info); - // If turned off for-sale, make sure click-action buy is turned - // off as well - if (sale_type == LLSaleInfo::FS_NOT) + U8 old_click_action = 0; + LLSelectMgr::getInstance()->selectionGetClickAction(&old_click_action); + + if (old_sale_info.isForSale() + && !new_sale_info.isForSale() + && old_click_action == CLICK_ACTION_BUY) { - U8 click_action = 0; - LLSelectMgr::getInstance()->selectionGetClickAction(&click_action); - if (click_action == CLICK_ACTION_BUY) - { - LLSelectMgr::getInstance()->selectionSetClickAction(CLICK_ACTION_TOUCH); - } + // If turned off for-sale, make sure click-action buy is turned + // off as well + LLSelectMgr::getInstance()-> + selectionSetClickAction(CLICK_ACTION_TOUCH); + } + else if (new_sale_info.isForSale() + && !old_sale_info.isForSale() + && old_click_action == CLICK_ACTION_TOUCH) + { + // If just turning on for-sale, preemptively turn on one-click buy + // unless user have a different click action set + LLSelectMgr::getInstance()-> + selectionSetClickAction(CLICK_ACTION_BUY); } } -- cgit v1.2.3 From 890da1d3914ffb52d0899c333fe8b8c280fe4d34 Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 13 Nov 2009 16:50:17 -0800 Subject: fix for layout of urls with icons --- indra/llui/lltextbase.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 7b1aaac35c..313d37379b 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2377,6 +2377,14 @@ bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& widt width = mStyle->getFont()->getWidth(text.c_str(), mStart + first_char, num_chars); // if last character is a newline, then return true, forcing line break llwchar last_char = text[mStart + first_char + num_chars - 1]; + + LLUIImagePtr image = mStyle->getImage(); + if( image.notNull()) + { + width += image->getWidth(); + height = llmax(height, image->getHeight()); + } + return num_chars >= 1 && last_char == '\n'; } -- cgit v1.2.3 From 6f52f1e502cf030ceb4e14963fdda1021ea33023 Mon Sep 17 00:00:00 2001 From: "Eric M. Tulla (BigPapi)" Date: Fri, 13 Nov 2009 20:18:44 -0500 Subject: Post merge compile fixes --HG-- branch : avatar-pipeline --- indra/newview/llfloatergesture.cpp | 2 +- indra/newview/llfloatergesture.h | 1 + indra/newview/llfriendcard.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index ca0ba96a08..854d02873a 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -98,7 +98,7 @@ void LLFloaterGesture::done() // we load only gesture folder without childred. LLInventoryModel::cat_array_t* categories; LLInventoryModel::item_array_t* items; - folder_ref_t unloaded_folders; + LLInventoryFetchDescendentsObserver::folder_ref_t unloaded_folders; LL_DEBUGS("Gesture")<< "Get subdirs of Gesture Folder...." << LL_ENDL; gInventory.getDirectDescendentsOf(mGestureFolderID, categories, items); if (categories->empty()) diff --git a/indra/newview/llfloatergesture.h b/indra/newview/llfloatergesture.h index 9d047bf1cf..e7819d2a03 100644 --- a/indra/newview/llfloatergesture.h +++ b/indra/newview/llfloatergesture.h @@ -39,6 +39,7 @@ #include "llfloater.h" #include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "lldarray.h" class LLScrollContainer; diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp index 481b75cf73..23d9436fa6 100644 --- a/indra/newview/llfriendcard.cpp +++ b/indra/newview/llfriendcard.cpp @@ -33,6 +33,7 @@ #include "llviewerprecompiledheaders.h" #include "llinventory.h" +#include "llinventoryobserver.h" #include "lltrans.h" #include "llfriendcard.h" -- cgit v1.2.3 From 6be35d363fb9e9f04c5344cab808ef40e63cbfab Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 13 Nov 2009 17:42:38 -0800 Subject: Integrated most of the final artwork into the media controls --- .../default/xui/en/panel_prim_media_controls.xml | 372 +++++++++++---------- 1 file changed, 193 insertions(+), 179 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml index 70c5d7b823..98025e28db 100644 --- a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml +++ b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml @@ -77,10 +77,14 @@ width="22" top="4"> - - + + + width="14"> @@ -408,27 +422,33 @@ function="MediaCtrl.CommitURL" /> auto_resize="false" user_resize="false" layout="topleft" - min_width="20" + min_width="14" height="14" - width="20"> + width="14"> + + + + + + min_width="22" width="22"> - min_width="22" width="22"> - Date: Fri, 13 Nov 2009 18:15:35 -0800 Subject: Tweaks to media priority calculation. Enabled CPU limit setting by default (set to 100% of 1 CPU). Lowered default limits on plugin priorities: 2 normal+, 4 low, 8 total. Limit on total number of instances now only applies to inworld media -- media instances in the UI (such as the help browser and search) don't count toward the limit. UI media will still bump inworld media down from normal/low priority, though. Several improvements to plugin manager debug code in the nearby media list. Don't load unloaded instances that are at PRIORITY_SLIDESHOW or PRIORITY_HIDDEN (they don't get unloaded, they just won't be loaded unless they're at higher priority). Added LLViewerMediaImpl::isPlayable(), which indicates whether an instance would be loaded if it were high enough in the priority list (taking into account autoplay and current load state). Priority algorithm now takes this into account. Fixed a couple of issues with approximate texture interest calculation and its use in setting priorities. Adjusted sleep times on low and normal priorities to be more friendly. --- indra/llplugin/llpluginclassmedia.cpp | 4 +- indra/llplugin/llpluginprocesschild.cpp | 5 ++- indra/newview/app_settings/settings.xml | 10 ++--- indra/newview/llviewermedia.cpp | 75 +++++++++++++++++++++++++++++---- indra/newview/llviewermedia.h | 5 ++- 5 files changed, 80 insertions(+), 19 deletions(-) diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 42d5ec49cd..c3d8a5aa23 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -593,10 +593,10 @@ void LLPluginClassMedia::setPriority(EPriority priority) mSleepTime = 1.0f; break; case PRIORITY_LOW: - mSleepTime = 1.0f / 50.0f; + mSleepTime = 1.0f / 25.0f; break; case PRIORITY_NORMAL: - mSleepTime = 1.0f / 100.0f; + mSleepTime = 1.0f / 50.0f; break; case PRIORITY_HIGH: mSleepTime = 1.0f / 100.0f; diff --git a/indra/llplugin/llpluginprocesschild.cpp b/indra/llplugin/llpluginprocesschild.cpp index 450dcb3c78..fc95136d9e 100644 --- a/indra/llplugin/llpluginprocesschild.cpp +++ b/indra/llplugin/llpluginprocesschild.cpp @@ -37,12 +37,13 @@ #include "llpluginmessageclasses.h" static const F32 HEARTBEAT_SECONDS = 1.0f; +static const F32 PLUGIN_IDLE_SECONDS = 1.0f / 100.0f; // Each call to idle will give the plugin this much time. LLPluginProcessChild::LLPluginProcessChild() { mInstance = NULL; mSocket = LLSocket::create(gAPRPoolp, LLSocket::STREAM_TCP); - mSleepTime = 1.0f / 100.0f; // default: send idle messages at 100Hz + mSleepTime = PLUGIN_IDLE_SECONDS; // default: send idle messages at 100Hz mCPUElapsed = 0.0f; } @@ -155,7 +156,7 @@ void LLPluginProcessChild::idle(void) { // Provide some time to the plugin LLPluginMessage message("base", "idle"); - message.setValueReal("time", mSleepTime); + message.setValueReal("time", PLUGIN_IDLE_SECONDS); sendMessageToPlugin(message); mInstance->idle(); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 8ad52784d3..52de17bff5 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5369,7 +5369,7 @@ Type F32 Value - 0.0 + 1.0 PluginInstancesLow @@ -5385,24 +5385,24 @@ PluginInstancesNormal Comment - Limit on the number of inworld media plugins that will run at "normal" priority + Limit on the number of inworld media plugins that will run at "normal" or higher priority Persist 1 Type U32 Value - 4 + 2 PluginInstancesTotal Comment - Hard limit on the number of plugins that will be instantiated at once + Hard limit on the number of plugins that will be instantiated at once for inworld media Persist 1 Type U32 Value - 16 + 8 PrecachingDelay diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 251d7d4a13..70490d3a6e 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -541,6 +541,16 @@ bool LLViewerMedia::priorityComparitor(const LLViewerMediaImpl* i1, const LLView // The item with user focus always comes to the front of the list, period. return false; } + else if(i1->isParcelMedia()) + { + // The parcel media impl sorts above all other inworld media, unless one has focus. + return true; + } + else if(i2->isParcelMedia()) + { + // The parcel media impl sorts above all other inworld media, unless one has focus. + return false; + } else if(i1->getUsedInUI() && !i2->getUsedInUI()) { // i1 is a UI element, i2 is not. This makes i1 "less than" i2, so it sorts earlier in our list. @@ -551,14 +561,14 @@ bool LLViewerMedia::priorityComparitor(const LLViewerMediaImpl* i1, const LLView // i2 is a UI element, i1 is not. This makes i2 "less than" i1, so it sorts earlier in our list. return false; } - else if(i1->isParcelMedia()) + else if(i1->isPlayable() && !i2->isPlayable()) { - // The parcel media impl sorts above all other inworld media, unless one has focus. + // Playable items sort above ones that wouldn't play even if they got high enough priority return true; } - else if(i2->isParcelMedia()) + else if(!i1->isPlayable() && i2->isPlayable()) { - // The parcel media impl sorts above all other inworld media, unless one has focus. + // Playable items sort above ones that wouldn't play even if they got high enough priority return false; } else @@ -629,10 +639,12 @@ void LLViewerMedia::updateMedia() else if(pimpl->hasFocus()) { new_priority = LLPluginClassMedia::PRIORITY_HIGH; + impl_count_interest_normal++; // count this against the count of "normal" instances for priority purposes } else if(pimpl->getUsedInUI()) { new_priority = LLPluginClassMedia::PRIORITY_NORMAL; + impl_count_interest_normal++; } else { @@ -640,7 +652,17 @@ void LLViewerMedia::updateMedia() // Heuristic -- if the media texture's approximate screen area is less than 1/4 of the native area of the texture, // turn it down to low instead of normal. This may downsample for plugins that support it. - bool media_is_small = pimpl->getInterest() < (pimpl->getApproximateTextureInterest() / 4); + bool media_is_small = false; + F64 approximate_interest = pimpl->getApproximateTextureInterest(); + if(approximate_interest == 0.0f) + { + // this media has no current size, which probably means it's not loaded. + media_is_small = true; + } + else if(pimpl->getInterest() < (approximate_interest / 4)) + { + media_is_small = true; + } if(pimpl->getInterest() == 0.0f) { @@ -678,7 +700,7 @@ void LLViewerMedia::updateMedia() } } - if(new_priority != LLPluginClassMedia::PRIORITY_UNLOADED) + if(!pimpl->getUsedInUI() && (new_priority != LLPluginClassMedia::PRIORITY_UNLOADED)) { impl_count_total++; } @@ -1588,6 +1610,10 @@ void LLViewerMediaImpl::update() { // This media source should not be loaded. } + else if(mPriority <= LLPluginClassMedia::PRIORITY_SLIDESHOW) + { + // Don't load new instances that are at PRIORITY_SLIDESHOW or below. They're just kept around to preserve state. + } else if(mMimeTypeProbe != NULL) { // this media source is doing a MIME type probe -- don't try loading it again. @@ -1816,7 +1842,7 @@ bool LLViewerMediaImpl::isMediaPaused() ////////////////////////////////////////////////////////////////////////////////////////// // -bool LLViewerMediaImpl::hasMedia() +bool LLViewerMediaImpl::hasMedia() const { return mMediaSource != NULL; } @@ -1850,6 +1876,31 @@ bool LLViewerMediaImpl::isForcedUnloaded() const return false; } +////////////////////////////////////////////////////////////////////////////////////////// +// +bool LLViewerMediaImpl::isPlayable() const +{ + if(isForcedUnloaded()) + { + // All of the forced-unloaded criteria also imply not playable. + return false; + } + + if(hasMedia()) + { + // Anything that's already playing is, by definition, playable. + return true; + } + + if(!mMediaURL.empty()) + { + // If something has navigated the instance, it's ready to be played. + return true; + } + + return false; +} + ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginClassMediaOwner::EMediaEvent event) { @@ -2094,7 +2145,13 @@ F64 LLViewerMediaImpl::getApproximateTextureInterest() result = mMediaSource->getFullWidth(); result *= mMediaSource->getFullHeight(); } - + else + { + // No media source is loaded -- all we have to go on is the texture size that has been set on the impl, if any. + result = mMediaWidth; + result *= mMediaHeight; + } + return result; } @@ -2135,7 +2192,7 @@ void LLViewerMediaImpl::setPriority(LLPluginClassMedia::EPriority priority) { if(mPriority != priority) { - LL_INFOS("PluginPriority") + LL_DEBUGS("PluginPriority") << "changing priority of media id " << mTextureId << " from " << LLPluginClassMedia::priorityToString(mPriority) << " to " << LLPluginClassMedia::priorityToString(priority) diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 639aed4b8a..a06079786e 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -194,7 +194,7 @@ public: bool isMediaPlaying(); bool isMediaPaused(); - bool hasMedia(); + bool hasMedia() const; bool isMediaFailed() const { return mMediaSourceFailed; }; void resetPreviousMediaState(); @@ -204,6 +204,9 @@ public: // returns true if this instance should not be loaded (disabled, muted object, crashed, etc.) bool isForcedUnloaded() const; + // returns true if this instance could be playable based on autoplay setting, current load state, etc. + bool isPlayable() const; + void setIsParcelMedia(bool is_parcel_media) { mIsParcelMedia = is_parcel_media; }; bool isParcelMedia() const { return mIsParcelMedia; }; -- cgit v1.2.3 From 68c6ff791ffdd01e98cf7fae61b868db4a6d1698 Mon Sep 17 00:00:00 2001 From: "Eric M. Tulla (BigPapi)" Date: Fri, 13 Nov 2009 22:22:30 -0500 Subject: Fix for post-merge compile error. --- indra/newview/llagentwearables.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index a6664778fb..ab518adadd 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -2145,7 +2145,7 @@ void LLLibraryOutfitsFetch::contentsDone(void) LLFolderType::FT_OUTFIT, mOutfits[i].second); - LLAppearanceManager::shallowCopyCategory(mOutfits[i].first, folder_id, NULL); + LLAppearanceManager::getInstance()->shallowCopyCategory(mOutfits[i].first, folder_id, NULL); gInventory.notifyObservers(); } mOutfitsPopulated = true; -- cgit v1.2.3 From f67a8ad12ee4984a37d8ac7e551cdcc03ed5ecd3 Mon Sep 17 00:00:00 2001 From: Steve Bennetts Date: Fri, 13 Nov 2009 22:54:55 -0800 Subject: Mutex lock fix for texture cache. Also a fix for texture purging when reducing the cache size. --- indra/llcommon/llqueuedthread.cpp | 1 + indra/newview/lltexturecache.cpp | 58 ++++++++++++++++++++++----------------- 2 files changed, 34 insertions(+), 25 deletions(-) diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index e7ad571a90..eacbbb3ee0 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -96,6 +96,7 @@ void LLQueuedThread::shutdown() if (req->getStatus() == STATUS_QUEUED || req->getStatus() == STATUS_INPROGRESS) { ++active_count; + req->setStatus(STATUS_ABORTED); // avoid assert in deleteRequest } req->deleteRequest(); } diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 9be342c424..2e2f342cca 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -834,9 +834,9 @@ bool LLTextureCache::updateTextureEntryList(const LLUUID& id, S32 bodysize) S32 idx = openAndReadEntry(id, entry, false); if (idx < 0) { - // TODO: change to llwarns - llerrs << "Failed to open entry: " << id << llendl; - removeFromCache(id); + llwarns << "Failed to open entry: " << id << llendl; + removeHeaderCacheEntry(id); + LLAPRFile::remove(getTextureFileName(id), getLocalAPRFilePool()); return false; } else if (oldbodysize != entry.mBodySize) @@ -1212,9 +1212,9 @@ void LLTextureCache::readHeaderCache() if (num_entries) { U32 empty_entries = 0; - typedef std::pair lru_data_t; + typedef std::pair lru_data_t; std::set lru; - std::vector purge_list; + std::vector purge_list; for (U32 i=0; i 0) { if (entry.mBodySize > entry.mImageSize) { // Shouldn't happen, failsafe only llwarns << "Bad entry: " << i << ": " << id << ": BodySize: " << entry.mBodySize << llendl; - purge_list.push_back(id); + purge_list.push_back(i); } } } @@ -1243,6 +1243,7 @@ void LLTextureCache::readHeaderCache() // Special case: cache size was reduced, need to remove entries // Note: After we prune entries, we will call this again and create the LRU U32 entries_to_purge = (num_entries-empty_entries) - sCacheMaxEntries; + llinfos << "Texture Cache Entries: " << num_entries << " Max: " << sCacheMaxEntries << " Empty: " << empty_entries << " Purging: " << entries_to_purge << llendl; if (entries_to_purge > 0) { for (std::set::iterator iter = lru.begin(); iter != lru.end(); ++iter) @@ -1252,13 +1253,17 @@ void LLTextureCache::readHeaderCache() break; } } + llassert_always(entries_to_purge <= 0); + llassert_always(purge_list.size() == entries_to_purge); } else { S32 lru_entries = (S32)((F32)sCacheMaxEntries * TEXTURE_CACHE_LRU_SIZE); for (std::set::iterator iter = lru.begin(); iter != lru.end(); ++iter) { - mLRU.insert(iter->second); + S32 idx = iter->second; + const LLUUID& id = entries[idx].mID; + mLRU.insert(id); // llinfos << "LRU: " << iter->first << " : " << iter->second << llendl; if (--lru_entries <= 0) break; @@ -1267,9 +1272,14 @@ void LLTextureCache::readHeaderCache() if (purge_list.size() > 0) { - for (std::vector::iterator iter = purge_list.begin(); iter != purge_list.end(); ++iter) + for (std::vector::iterator iter = purge_list.begin(); iter != purge_list.end(); ++iter) { - removeFromCache(*iter); + S32 idx = *iter; + const LLUUID& id = entries[idx].mID; + entries[idx].mImageSize = -1; // set cached entry size to -1 + bool res = removeHeaderCacheEntry(id); // sets entry size on disk to -1 + llassert_always(res); + LLAPRFile::remove(getTextureFileName(id), getLocalAPRFilePool()); } // If we removed any entries, we need to rebuild the entries list, // write the header, and call this again @@ -1307,6 +1317,7 @@ void LLTextureCache::purgeAllTextures(bool purge_directories) for (S32 i=0; i<16; i++) { std::string dirname = mTexturesDirName + delem + subdirs[i]; + llinfos << "Deleting files in directory: " << dirname << llendl; gDirUtilp->deleteFilesInDir(dirname,mask); if (purge_directories) { @@ -1624,24 +1635,20 @@ void LLTextureCache::addCompleted(Responder* responder, bool success) ////////////////////////////////////////////////////////////////////////////// // Called from MAIN thread (endWork()) - +// Ensuere that mHeaderMutex is locked first! bool LLTextureCache::removeHeaderCacheEntry(const LLUUID& id) { - if (!mReadOnly) + Entry entry; + S32 idx = openAndReadEntry(id, entry, false); + if (idx >= 0) { - LLMutexLock lock(&mHeaderMutex); - Entry entry; - S32 idx = openAndReadEntry(id, entry, false); - if (idx >= 0) - { - entry.mImageSize = -1; - entry.mBodySize = 0; - writeEntryAndClose(idx, entry); - mFreeList.insert(idx); - mHeaderIDMap.erase(id); - mTexturesSizeMap.erase(id); - return true; - } + entry.mImageSize = -1; + entry.mBodySize = 0; + writeEntryAndClose(idx, entry); + mFreeList.insert(idx); + mHeaderIDMap.erase(id); + mTexturesSizeMap.erase(id); + return true; } return false; } @@ -1651,6 +1658,7 @@ void LLTextureCache::removeFromCache(const LLUUID& id) //llwarns << "Removing texture from cache: " << id << llendl; if (!mReadOnly) { + LLMutexLock lock(&mHeaderMutex); removeHeaderCacheEntry(id); LLAPRFile::remove(getTextureFileName(id), getLocalAPRFilePool()); } -- cgit v1.2.3 From 9e11d70225d3e53e2ee31304c4930f01939fe1c3 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Sat, 14 Nov 2009 18:12:18 +0200 Subject: Fixed major bug EXT-2316 "Insert the option "pay" in the profile": - Added menu item according to Communications design spec in section 4.1.2.1. --HG-- branch : product-engine --- indra/newview/llpanelavatar.cpp | 25 ++++++++++++++++++++++ indra/newview/llpanelavatar.h | 12 +++++++++-- .../skins/default/xui/en/menu_profile_overflow.xml | 15 +++++++++++++ .../newview/skins/default/xui/en/panel_profile.xml | 20 ++++++++++++----- 4 files changed, 65 insertions(+), 7 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/menu_profile_overflow.xml diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 3b54f1546e..f0aa189b7f 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -41,6 +41,7 @@ #include "llimview.h" #include "lltexteditor.h" #include "lltexturectrl.h" +#include "lltoggleablemenu.h" #include "lltooldraganddrop.h" #include "llscrollcontainer.h" #include "llavatariconctrl.h" @@ -333,8 +334,14 @@ BOOL LLPanelAvatarProfile::postBuild() childSetCommitCallback("im",(boost::bind(&LLPanelAvatarProfile::onIMButtonClick,this)),NULL); childSetCommitCallback("call",(boost::bind(&LLPanelAvatarProfile::onCallButtonClick,this)),NULL); childSetCommitCallback("teleport",(boost::bind(&LLPanelAvatarProfile::onTeleportButtonClick,this)),NULL); + childSetCommitCallback("overflow_btn", boost::bind(&LLPanelAvatarProfile::onOverflowButtonClicked, this), NULL); childSetCommitCallback("share",(boost::bind(&LLPanelAvatarProfile::onShareButtonClick,this)),NULL); + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + registrar.add("Profile.Pay", boost::bind(&LLPanelAvatarProfile::pay, this)); + + mProfileMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_profile_overflow.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + LLTextureCtrl* pic = getChild("2nd_life_pic"); pic->setFallbackImageName("default_profile_picture.j2c"); @@ -513,6 +520,11 @@ void LLPanelAvatarProfile::fillAccountStatus(const LLAvatarData* avatar_data) childSetValue("acc_status_text", caption_text); } +void LLPanelAvatarProfile::pay() +{ + LLAvatarActions::pay(getAvatarId()); +} + void LLPanelAvatarProfile::onUrlTextboxClicked(const std::string& url) { LLWeb::loadURL(url); @@ -552,6 +564,19 @@ void LLPanelAvatarProfile::onShareButtonClick() //*TODO not implemented } +void LLPanelAvatarProfile::onOverflowButtonClicked() +{ + if (!mProfileMenu->toggleVisibility()) + return; + + LLView* btn = getChild("overflow_btn"); + LLRect rect = btn->getRect(); + + mProfileMenu->updateParent(LLMenuGL::sMenuContainer); + mProfileMenu->setButtonRect(btn->getLocalRect(), btn); + LLMenuGL::showPopup(this, mProfileMenu, rect.mRight, rect.mTop); +} + ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index ae0b8e9844..a0caf0c915 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -38,6 +38,7 @@ class LLComboBox; class LLLineEditor; +class LLToggleableMenu; enum EOnlineStatus { @@ -160,12 +161,17 @@ protected: * Fills Avatar's online status. */ virtual void fillOnlineStatus(const LLAvatarData* avatar_data); - + /** * Fills account status. */ virtual void fillAccountStatus(const LLAvatarData* avatar_data); + /** + * Opens "Pay Resident" dialog. + */ + void pay(); + void onUrlTextboxClicked(const std::string& url); void onHomepageTextboxClicked(); void onAddFriendButtonClick(); @@ -173,10 +179,12 @@ protected: void onCallButtonClick(); void onTeleportButtonClick(); void onShareButtonClick(); + void onOverflowButtonClicked(); private: - std::string mGroups; + std::string mGroups; + LLToggleableMenu* mProfileMenu; }; /** diff --git a/indra/newview/skins/default/xui/en/menu_profile_overflow.xml b/indra/newview/skins/default/xui/en/menu_profile_overflow.xml new file mode 100644 index 0000000000..7b52fecef7 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_profile_overflow.xml @@ -0,0 +1,15 @@ + + + + + + diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml index 0f5e96416d..5110b6b2ef 100644 --- a/indra/newview/skins/default/xui/en/panel_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_profile.xml @@ -283,7 +283,7 @@ mouse_opaque="false" name="add_friend" top="5" - width="75" /> + width="76" /> + width="18"> + + -- cgit v1.2.3 From aba8b04cfc6763ee565a5ae9929e8be044272b08 Mon Sep 17 00:00:00 2001 From: Dmitry Oleshko Date: Mon, 16 Nov 2009 18:51:54 +0200 Subject: fix of a normal bug (EXT-2448) [BSI] Notification toasts should resize when text is to long to be displayed A maximum number of characters for textbox/texteditor could be set only through XML. In case when a corresponding attribute was absent - the maximun number was set to 255, and there were no chance (no function) to change it. So in this fix such a function was added. --HG-- branch : product-engine --- indra/llui/lltextbase.h | 1 + indra/newview/lltoastnotifypanel.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 70d78c77cd..c376a73615 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -139,6 +139,7 @@ public: // TODO: add optional style parameter virtual void setText(const LLStringExplicit &utf8str , const LLStyle::Params& input_params = LLStyle::Params()); // uses default style virtual std::string getText() const; + void setMaxTextLength(S32 length) { mMaxTextByteLength = length; } // wide-char versions void setWText(const LLWString& text); diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 0c23947a8c..48b68e4292 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -128,6 +128,7 @@ mAddedDefaultBtn(false) // *TODO: magic numbers(???) - copied from llnotify.cpp(250) const S32 MAX_LENGTH = 512 + 20 + DB_FIRST_NAME_BUF_SIZE + DB_LAST_NAME_BUF_SIZE + DB_INV_ITEM_NAME_BUF_SIZE; + mTextBox->setMaxTextLength(MAX_LENGTH); mTextBox->setVisible(TRUE); mTextBox->setValue(notification->getMessage()); -- cgit v1.2.3 From 211529eee9a4cbb36961af75e94af73da920d08d Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 16 Nov 2009 11:54:53 -0500 Subject: re-adding "make outfit button" the "make outfit" button in the appearance editor was accidentally removed (merge issue). Re-adding the XML tag for the button to floater_customize.xml Reviewed by Bigpapi --- indra/newview/skins/default/xui/en/floater_customize.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/indra/newview/skins/default/xui/en/floater_customize.xml b/indra/newview/skins/default/xui/en/floater_customize.xml index 6c4f10e61e..9d2a811d9f 100644 --- a/indra/newview/skins/default/xui/en/floater_customize.xml +++ b/indra/newview/skins/default/xui/en/floater_customize.xml @@ -3379,6 +3379,16 @@ scratch and wear it. layout="topleft" name="panel_list" /> +