From 63eafec8d80560647a22e20657049852f01746bb Mon Sep 17 00:00:00 2001 From: Pork Chop Date: Tue, 4 Apr 2023 12:06:28 +1000 Subject: [PATCH 01/19] Linux: Update 3p again, wrong colladadom 3p (and associated 3p's it depended on) had crept into the dependency chain. --- autobuild.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index e3058c92e5..c42b4fc1cf 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -736,9 +736,9 @@ archive hash - 93db28a4c0185c054e705f7069830bcc + 8b79711b4fa914c16f1284939d55dcc1 url - https://3p.firestormviewer.org/colladadom-2.3.230021615-linux64-230021615.tar.bz2 + https://3p.firestormviewer.org/colladadom-2.3.230940029-linux64-230940029.tar.bz2 name linux64 @@ -2000,9 +2000,9 @@ archive hash - a01304d63a12ad3d11bde52c47a3134b + d72c6d8db827ce3d83c5703f519a2ac9 url - http://3p.firestormviewer.org/libxml2-2.10.3.230021454-linux64-230021454.tar.bz2 + http://3p.firestormviewer.org/libxml2-2.10.3.230940019-linux64-230940019.tar.bz2 name linux64 @@ -3328,9 +3328,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 684de242071b78042c1837c15496d2b5 + 71a9c7c03a2c26cdb21fa476de485d9c url - http://3p.firestormviewer.org/xmlrpc_epi-0.54.2.230021554-linux64-230021554.tar.bz2 + http://3p.firestormviewer.org/xmlrpc_epi-0.54.2.230940042-linux64-230940042.tar.bz2 name linux64 From ff3aa5f436ad21b17d04505b37f82eaa60819ed7 Mon Sep 17 00:00:00 2001 From: Zi Ree Date: Tue, 4 Apr 2023 05:38:46 +0200 Subject: [PATCH 02/19] Linux: take out glib dependency from volume catcher, restore cef functionality, some cmake cleanup by PorkChop --- indra/cmake/MediaPluginBase.cmake | 1 - indra/media_plugins/cef/CMakeLists.txt | 4 --- .../cef/linux_volume_catcher.cpp | 26 ++++++------------- .../cef/linux_volume_catcher_pa_syms.inc | 4 +++ .../cef/linux_volume_catcher_paglib_syms.inc | 3 +++ 5 files changed, 15 insertions(+), 23 deletions(-) diff --git a/indra/cmake/MediaPluginBase.cmake b/indra/cmake/MediaPluginBase.cmake index 7a7f64c0b3..b459455362 100644 --- a/indra/cmake/MediaPluginBase.cmake +++ b/indra/cmake/MediaPluginBase.cmake @@ -1,5 +1,4 @@ # -*- cmake -*- -set(CMAKE_VERBOSE_MAKEFILE ON) # remove this once things work # Try to find pulse header, if we got them we can use the linux volume catcher if (LINUX) diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index 53cb2d4d1d..5c0029bc5d 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -31,8 +31,6 @@ set(media_plugin_cef_HEADER_FILES volume_catcher.h ) -if (NOT DISABLE_VOLUME_CATCHER) # disable volume catcher in cef with -DDISABLE_VOLUME_CATCHER=TRUE - add_compile_definitions(LL_VOLUME_CATCHER) # Select which VolumeCatcher implementation to use @@ -54,8 +52,6 @@ elseif (WINDOWS) list(APPEND media_plugin_cef_SOURCE_FILES windows_volume_catcher.cpp) endif (LINUX) -endif (NOT DISABLE_VOLUME_CATCHER) - list(APPEND media_plugin_cef_SOURCE_FILES ${media_plugin_cef_HEADER_FILES}) add_library(media_plugin_cef diff --git a/indra/media_plugins/cef/linux_volume_catcher.cpp b/indra/media_plugins/cef/linux_volume_catcher.cpp index fdea6fb15f..43773bb952 100755 --- a/indra/media_plugins/cef/linux_volume_catcher.cpp +++ b/indra/media_plugins/cef/linux_volume_catcher.cpp @@ -41,13 +41,11 @@ extern "C" { -#include -#include - #include #include #include -#include // There's no special reason why we want the *glib* PA mainloop, but the generic polling implementation seems broken. + +#include #include "apr_pools.h" #include "apr_dso.h" @@ -62,7 +60,6 @@ extern "C" { #define LL_PA_SYM(REQUIRED, PASYM, RTN, ...) RTN (*ll##PASYM)(__VA_ARGS__) = NULL #include "linux_volume_catcher_pa_syms.inc" -#include "linux_volume_catcher_paglib_syms.inc" #undef LL_PA_SYM static bool sSymsGrabbed = false; @@ -94,7 +91,6 @@ bool grab_pa_syms(std::string pulse_dso_name) INFOMSG("Found DSO: %s", pulse_dso_name.c_str()); #include "linux_volume_catcher_pa_syms.inc" -#include "linux_volume_catcher_paglib_syms.inc" if ( sSymPADSOHandle ) { @@ -141,7 +137,6 @@ void ungrab_pa_syms() // NULL-out all of the symbols we'd grabbed #define LL_PA_SYM(REQUIRED, PASYM, RTN, ...) do{ll##PASYM = NULL;}while(0) #include "linux_volume_catcher_pa_syms.inc" -#include "linux_volume_catcher_paglib_syms.inc" #undef LL_PA_SYM sSymsGrabbed = false; @@ -178,7 +173,7 @@ public: std::set mSinkInputIndices; std::map mSinkInputNumChannels; F32 mDesiredVolume; - pa_glib_mainloop *mMainloop; + pa_mainloop *mMainloop; pa_context *mPAContext; bool mConnected; bool mGotSyms; @@ -210,18 +205,14 @@ void VolumeCatcherImpl::init() // bit fragile and (for our purposes) we'd rather simply not function // than crash - // we cheat and rely upon libpulse-mainloop-glib.so.0 to pull-in - // libpulse.so.0 - this isn't a great assumption, and the two DSOs should - // probably be loaded separately. Our Linux DSO framework needs refactoring, - // we do this sort of thing a lot with practically identical logic... - mGotSyms = loadsyms("libpulse-mainloop-glib.so.0"); + mGotSyms = loadsyms("libpulse.so.0"); if (!mGotSyms) return; - mMainloop = llpa_glib_mainloop_new(g_main_context_default()); + mMainloop = llpa_mainloop_new(); if (mMainloop) { - pa_mainloop_api *api = llpa_glib_mainloop_get_api(mMainloop); + pa_mainloop_api *api = llpa_mainloop_get_api(mMainloop); if (api) { @@ -274,7 +265,7 @@ void VolumeCatcherImpl::cleanup() if (mGotSyms && mMainloop) { - llpa_glib_mainloop_free(mMainloop); + llpa_mainloop_free(mMainloop); } mMainloop = NULL; } @@ -295,8 +286,7 @@ void VolumeCatcherImpl::setVolume(F32 volume) void VolumeCatcherImpl::pump() { - gboolean may_block = FALSE; - g_main_context_iteration(g_main_context_default(), may_block); + return; } void VolumeCatcherImpl::connected_okay() diff --git a/indra/media_plugins/cef/linux_volume_catcher_pa_syms.inc b/indra/media_plugins/cef/linux_volume_catcher_pa_syms.inc index d806b48428..2c9f760fba 100755 --- a/indra/media_plugins/cef/linux_volume_catcher_pa_syms.inc +++ b/indra/media_plugins/cef/linux_volume_catcher_pa_syms.inc @@ -18,4 +18,8 @@ LL_PA_SYM(true, pa_proplist_new, pa_proplist*, void); LL_PA_SYM(true, pa_proplist_sets, int, pa_proplist *p, const char *key, const char *value); LL_PA_SYM(true, pa_sw_volume_from_linear, pa_volume_t, double v); +LL_PA_SYM(true, pa_mainloop_free, void, pa_mainloop* m); +LL_PA_SYM(true, pa_mainloop_get_api, pa_mainloop_api*, pa_mainloop* m); +LL_PA_SYM(true, pa_mainloop_new, pa_mainloop*, void); + // optional symbols to grab diff --git a/indra/media_plugins/cef/linux_volume_catcher_paglib_syms.inc b/indra/media_plugins/cef/linux_volume_catcher_paglib_syms.inc index abf628c96c..caa7a25b99 100755 --- a/indra/media_plugins/cef/linux_volume_catcher_paglib_syms.inc +++ b/indra/media_plugins/cef/linux_volume_catcher_paglib_syms.inc @@ -1,6 +1,9 @@ +// No longer needed +/* // required symbols to grab LL_PA_SYM(true, pa_glib_mainloop_free, void, pa_glib_mainloop* g); LL_PA_SYM(true, pa_glib_mainloop_get_api, pa_mainloop_api*, pa_glib_mainloop* g); LL_PA_SYM(true, pa_glib_mainloop_new, pa_glib_mainloop *, GMainContext *c); // optional symbols to grab +*/ From 83c45e8237e6fc6fb46228fd9caad3b0b7d12b74 Mon Sep 17 00:00:00 2001 From: Pork Chop Date: Tue, 4 Apr 2023 13:46:06 +1000 Subject: [PATCH 03/19] Linux: Minor cmake cleanup in MediaPluginBase, no longer needs glib --- indra/cmake/MediaPluginBase.cmake | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/indra/cmake/MediaPluginBase.cmake b/indra/cmake/MediaPluginBase.cmake index b459455362..f24b2a0fa2 100644 --- a/indra/cmake/MediaPluginBase.cmake +++ b/indra/cmake/MediaPluginBase.cmake @@ -2,11 +2,8 @@ # Try to find pulse header, if we got them we can use the linux volume catcher if (LINUX) - include(GLIB) - include_directories( ${GLIB_INCLUDE_DIRS} ) - - foreach( PULSE_FILE pulse/introspect.h pulse/context.h pulse/subscribe.h pulse/glib-mainloop.h ) + foreach( PULSE_FILE pulse/introspect.h pulse/context.h pulse/subscribe.h ) find_path( PULSE_FILE_${PULSE_FILE}_FOUND ${PULSE_FILE} NO_CACHE) if( NOT PULSE_FILE_${PULSE_FILE}_FOUND ) message( "Looking for ${PULSE_FILE} ... not found") From 29b9da8895a62f12a37cf097c4d0b8d19ba350ae Mon Sep 17 00:00:00 2001 From: Zi Ree Date: Tue, 4 Apr 2023 11:10:51 +0200 Subject: [PATCH 04/19] Make upload image preview area to be not hard-coded but follow one XUI element, so the UI can be changed easier without changing code. --- indra/newview/llfloaterimagepreview.cpp | 61 +++++++++++-------- .../default/xui/en/floater_image_preview.xml | 21 +++++-- 2 files changed, 53 insertions(+), 29 deletions(-) diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 4d9af5bc84..b3a86d562f 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -67,12 +67,14 @@ #include "llnotificationsutil.h" // detect and strip empty alpha layers from images on upload -const S32 PREVIEW_BORDER_WIDTH = 2; -const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH; -const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE; -const S32 PREVIEW_VPAD = -24 + 35; // yuk, hard coded -const S32 PREF_BUTTON_HEIGHT = 16 + 7 + 16 + 35; -const S32 PREVIEW_TEXTURE_HEIGHT = 320; +// Make preview area position to be not hard-coded +// const S32 PREVIEW_BORDER_WIDTH = 2; +// const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH; +// const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE; +// const S32 PREVIEW_VPAD = -24 + 35; // yuk, hard coded +// const S32 PREF_BUTTON_HEIGHT = 16 + 7 + 16 + 35; +// const S32 PREVIEW_TEXTURE_HEIGHT = 320; +// // detect and strip empty alpha layers from images on upload const U8 ALPHA_EMPTY_THRESHOLD = 253; @@ -110,10 +112,13 @@ BOOL LLFloaterImagePreview::postBuild() } childSetCommitCallback("clothing_type_combo", onPreviewTypeCommit, this); - mPreviewRect.set(PREVIEW_HPAD, - PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD, - getRect().getWidth() - PREVIEW_HPAD, - PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); + // Make preview area position to be not hard-coded + // mPreviewRect.set(PREVIEW_HPAD, + // PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD, + // getRect().getWidth() - PREVIEW_HPAD, + // PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); + mPreviewRect = getChildView("preview_area")->getRect(); + // mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f); getChildView("bad_image_text")->setVisible(FALSE); @@ -407,24 +412,27 @@ void LLFloaterImagePreview::draw() // gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD); //} //gGL.end(); + // + + // Make preview area position to be not hard-coded gGL.begin( LLRender::TRIANGLES ); { gGL.texCoord2f(mPreviewImageRect.mLeft, mPreviewImageRect.mTop); - gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD); + gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mTop); gGL.texCoord2f(mPreviewImageRect.mLeft, mPreviewImageRect.mBottom); - gGL.vertex2i(PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); + gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mBottom); gGL.texCoord2f(mPreviewImageRect.mRight, mPreviewImageRect.mBottom); - gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); + gGL.vertex2i(mPreviewRect.mRight, mPreviewRect.mBottom); gGL.texCoord2f(mPreviewImageRect.mLeft, mPreviewImageRect.mTop); - gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD); + gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mTop); gGL.texCoord2f(mPreviewImageRect.mRight, mPreviewImageRect.mBottom); - gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); + gGL.vertex2i(mPreviewRect.mRight, mPreviewRect.mBottom); gGL.texCoord2f(mPreviewImageRect.mRight, mPreviewImageRect.mTop); - gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD); + gGL.vertex2i(mPreviewRect.mRight, mPreviewRect.mTop); } gGL.end(); - // + // gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -458,24 +466,27 @@ void LLFloaterImagePreview::draw() // gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD); //} //gGL.end(); + // + + // Make preview area position to be not hard-coded gGL.begin( LLRender::TRIANGLES ); { gGL.texCoord2f(0.f, 1.f); - gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD); + gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mTop); gGL.texCoord2f(0.f, 0.f); - gGL.vertex2i(PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); + gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mBottom); gGL.texCoord2f(1.f, 0.f); - gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); + gGL.vertex2i(mPreviewRect.mRight, mPreviewRect.mBottom); - gGL.texCoord2f(1.f, 0.f); - gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); gGL.texCoord2f(0.f, 1.f); - gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD); + gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mTop); + gGL.texCoord2f(1.f, 0.f); + gGL.vertex2i(mPreviewRect.mRight, mPreviewRect.mBottom); gGL.texCoord2f(1.f, 1.f); - gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD); + gGL.vertex2i(mPreviewRect.mRight, mPreviewRect.mTop); } gGL.end(); - // + // gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); } diff --git a/indra/newview/skins/default/xui/en/floater_image_preview.xml b/indra/newview/skins/default/xui/en/floater_image_preview.xml index 7d1f01b6ac..35430d6403 100644 --- a/indra/newview/skins/default/xui/en/floater_image_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_image_preview.xml @@ -106,7 +106,7 @@ name="SculptedPrim" /> - - + /> + /> + + Date: Tue, 4 Apr 2023 13:08:59 +0200 Subject: [PATCH 05/19] Fix copy dependencies --- indra/newview/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 825f33cf7d..2e58eafb6f 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2169,7 +2169,7 @@ if (WINDOWS) ${CMAKE_CURRENT_SOURCE_DIR}/featuretable.txt ${viewer_APPSETTINGS_FILES} ${ARCH_PREBUILT_DIRS_RELEASE}/growl.dll - ${SHARED_LIB_STAGING_DIR}/Release/glod.dll # Restore GLOD build dependencies + ${SHARED_LIB_STAGING_DIR}/glod.dll # Restore GLOD build dependencies SLPlugin media_plugin_cef media_plugin_libvlc @@ -2179,7 +2179,7 @@ if (WINDOWS) # Only copy OpenJPEG dll if needed if (NOT USE_KDU) list(APPEND COPY_INPUT_DEPENDENCIES - ${SHARED_LIB_STAGING_DIR}/Release/openjp2.dll + ${SHARED_LIB_STAGING_DIR}/openjp2.dll ) endif (NOT USE_KDU) # From 2428f9754a1313aece799809c95206db5bc53f7b Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 4 Apr 2023 13:10:58 +0200 Subject: [PATCH 06/19] Remove unused members --- indra/newview/fsfloatersearch.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/indra/newview/fsfloatersearch.h b/indra/newview/fsfloatersearch.h index 35158980d0..31d31d2e27 100644 --- a/indra/newview/fsfloatersearch.h +++ b/indra/newview/fsfloatersearch.h @@ -110,7 +110,6 @@ private: LLSD mResultsContent; LLUUID mQueryID; - FSFloaterSearch* mParent; LLSearchComboBox* mSearchComboBox; FSScrollListCtrl* mSearchResults; }; @@ -145,7 +144,6 @@ private: LLSD mResultsContent; LLUUID mQueryID; - FSFloaterSearch* mParent; LLSearchComboBox* mSearchComboBox; LLScrollListCtrl* mSearchResults; }; @@ -180,7 +178,6 @@ private: LLSD mResultsContent; LLUUID mQueryID; - FSFloaterSearch* mParent; LLSearchComboBox* mSearchComboBox; LLScrollListCtrl* mSearchResults; LLComboBox* mPlacesCategory; @@ -214,7 +211,6 @@ private: LLSD mResultsContent; LLUUID mQueryID; - FSFloaterSearch* mParent; LLLineEditor* mPriceEditor; LLLineEditor* mAreaEditor; LLScrollListCtrl* mSearchResults; @@ -250,7 +246,6 @@ private: LLSD mResultsContent; LLUUID mQueryID; - FSFloaterSearch* mParent; LLSearchComboBox* mSearchComboBox; LLScrollListCtrl* mSearchResults; LLComboBox* mClassifiedsCategory; @@ -292,7 +287,6 @@ private: LLSD mResultsContent; LLUUID mQueryID; - FSFloaterSearch* mParent; LLSearchComboBox* mSearchComboBox; LLScrollListCtrl* mSearchResults; LLRadioGroup* mEventsMode; From 25f20cfd597c8d310491fec437799a1f98ff66da Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 4 Apr 2023 13:16:14 +0200 Subject: [PATCH 07/19] const ref please! --- indra/llfilesystem/lldiskcache.cpp | 2 +- indra/llfilesystem/lldiskcache.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llfilesystem/lldiskcache.cpp b/indra/llfilesystem/lldiskcache.cpp index da3530604d..f2ecd9f5b0 100644 --- a/indra/llfilesystem/lldiskcache.cpp +++ b/indra/llfilesystem/lldiskcache.cpp @@ -534,7 +534,7 @@ void LLDiskCache::removeOldVFSFiles() } } -uintmax_t LLDiskCache::dirFileSize(const std::string dir) +uintmax_t LLDiskCache::dirFileSize(const std::string& dir) { uintmax_t total_file_size = 0; diff --git a/indra/llfilesystem/lldiskcache.h b/indra/llfilesystem/lldiskcache.h index f3b5c36e3f..4b51b66e1f 100644 --- a/indra/llfilesystem/lldiskcache.h +++ b/indra/llfilesystem/lldiskcache.h @@ -164,7 +164,7 @@ class LLDiskCache : * directory. Primarily used here to determine the directory size * before and after the cache purge */ - uintmax_t dirFileSize(const std::string dir); + uintmax_t dirFileSize(const std::string& dir); /** * Utility function to convert an LLAssetType enum into a From e770782e990debc5e2997f3f23de68ee8eec6d94 Mon Sep 17 00:00:00 2001 From: Zi Ree Date: Tue, 4 Apr 2023 13:49:53 +0200 Subject: [PATCH 08/19] Image upload preview now tells you the final upload size and alpha status, also some minor XUI cleanup and alignment --- indra/newview/llfloaterimagepreview.cpp | 16 +++- .../default/xui/en/floater_image_preview.xml | 79 +++++++++++++------ 2 files changed, 69 insertions(+), 26 deletions(-) diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index b3a86d562f..dc57b37973 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -183,9 +183,14 @@ BOOL LLFloaterImagePreview::postBuild() // getChild("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this)); getChild("ok_btn")->setCommitCallback(boost::bind(&LLFloaterImagePreview::onBtnUpload, this)); + getChild("uploaded_size_text")->setTextArg("[X_RES]", llformat("%d", mRawImagep->getWidth())); + getChild("uploaded_size_text")->setTextArg("[Y_RES]", llformat("%d", mRawImagep->getHeight())); + if (mRawImagep->getComponents() != 4) { - return TRUE; + getChild("image_alpha_warning")->setVisible(false); + getChild("uploaded_size_text")->setTextArg("[ALPHA]", getString("no_alpha")); + return true; } U32 imageBytes = mRawImagep->getWidth() * mRawImagep->getHeight() * 4; @@ -214,6 +219,8 @@ BOOL LLFloaterImagePreview::postBuild() getChild("image_alpha_warning")->setVisible(false); mEmptyAlphaCheck->setValue(false); } + + getChild("uploaded_size_text")->setTextArg("[ALPHA]", getString(mEmptyAlphaCheck->getValue() ? "no_alpha" : "with_alpha")); // return TRUE; } @@ -221,7 +228,11 @@ BOOL LLFloaterImagePreview::postBuild() // detect and strip empty alpha layers from images on upload void LLFloaterImagePreview::emptyAlphaCheckboxCallback() { - if (!mEmptyAlphaCheck->getValue()) + if (mEmptyAlphaCheck->getValue()) + { + getChild("uploaded_size_text")->setTextArg("[ALPHA]", getString("no_alpha")); + } + else { LLNotificationsUtil::add("ImageEmptyAlphaLayer", LLSD(), LLSD(), boost::bind(&LLFloaterImagePreview::imageEmptyAlphaCallback, this, _1, _2)); } @@ -237,6 +248,7 @@ bool LLFloaterImagePreview::imageEmptyAlphaCallback(const LLSD& notification, co mEmptyAlphaCheck->setValue(true); } + getChild("uploaded_size_text")->setTextArg("[ALPHA]", getString(option == 0 ? "no_alpha" : "with_alpha")); return true; } diff --git a/indra/newview/skins/default/xui/en/floater_image_preview.xml b/indra/newview/skins/default/xui/en/floater_image_preview.xml index 35430d6403..b766602994 100644 --- a/indra/newview/skins/default/xui/en/floater_image_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_image_preview.xml @@ -7,6 +7,17 @@ name="Image Preview" help_topic="image_preview" width="300"> + + + + + @@ -108,13 +119,13 @@ + visible="true"> + + +Uploaded Size: [X_RES]x[Y_RES], [ALPHA] + + -