diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 22 | ||||
-rw-r--r-- | indra/newview/llfloaterimagepreview.cpp | 33 | ||||
-rw-r--r-- | indra/newview/llfloaterimagepreview.h | 3 | ||||
-rw-r--r-- | indra/newview/llnearbychat.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llnearbychat.h | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_voice_controls.xml | 2 |
6 files changed, 70 insertions, 3 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c9b5631d54..6b9d30423d 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10972,7 +10972,27 @@ <key>Value</key> <integer>0</integer> </map> - + <key>max_texture_dimension_X</key> + <map> + <key>Comment</key> + <string>Maximum texture width for user uploaded textures</string> + <key>Persist</key> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>2048</integer> + </map> + <key>max_texture_dimension_Y</key> + <map> + <key>Comment</key> + <string>Maximum texture height for user uploaded textures</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>2048</integer> + </map> <!-- End of back compatibility settings --> </map> </llsd> diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index ef9da30552..8a20712ea8 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -59,13 +59,18 @@ #include "llviewertexturelist.h" #include "llstring.h" +#include "llendianswizzle.h" + +#include "llviewercontrol.h" +#include "lltrans.h" +#include "llimagedimensionsinfo.h" + 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 PREF_BUTTON_HEIGHT = 16 + 7 + 16; const S32 PREVIEW_TEXTURE_HEIGHT = 300; - //----------------------------------------------------------------------------- // LLFloaterImagePreview() //----------------------------------------------------------------------------- @@ -124,6 +129,11 @@ BOOL LLFloaterImagePreview::postBuild() childShow("bad_image_text"); childDisable("clothing_type_combo"); childDisable("ok_btn"); + + if(!mImageLoadError.empty()) + { + childSetValue("bad_image_text",mImageLoadError.c_str()); + } } getChild<LLUICtrl>("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this)); @@ -341,6 +351,27 @@ bool LLFloaterImagePreview::loadImage(const std::string& src_filename) codec = IMG_CODEC_PNG; } + LLImageDimensionsInfo image_info; + if(!image_info.load(src_filename,codec)) + { + mImageLoadError = image_info.getLastError(); + return false; + } + + S32 max_width = gSavedSettings.getS32("max_texture_dimension_X"); + S32 max_heigh = gSavedSettings.getS32("max_texture_dimension_Y"); + + if(image_info.getWidth() > max_width|| image_info.getHeight() > max_heigh) + { + LLStringUtil::format_map_t args; + args["WIDTH"] = llformat("%d", max_width); + args["HEIGHT"] = llformat("%d", max_heigh); + + mImageLoadError = LLTrans::getString("texture_load_dimensions_error", args); + return false; + } + + LLPointer<LLImageRaw> raw_image = new LLImageRaw; switch (codec) diff --git a/indra/newview/llfloaterimagepreview.h b/indra/newview/llfloaterimagepreview.h index 466bd1d0ec..3a7e1ff7d8 100644 --- a/indra/newview/llfloaterimagepreview.h +++ b/indra/newview/llfloaterimagepreview.h @@ -143,7 +143,8 @@ protected: LLRect mPreviewRect; LLRectf mPreviewImageRect; LLPointer<LLViewerTexture> mImagep ; - + + std::string mImageLoadError; }; #endif // LL_LLFLOATERIMAGEPREVIEW_H diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 5d72827a7a..e5710cd632 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -351,3 +351,14 @@ void LLNearbyChat::onFocusLost() LLPanel::onFocusLost(); } +BOOL LLNearbyChat::handleMouseDown(S32 x, S32 y, MASK mask) +{ + //fix for EXT-6625 + //highlight NearbyChat history whenever mouseclick happen in NearbyChat + //setting focus to eidtor will force onFocusLost() call that in its turn will change + //background opaque. This all happenn since NearByChat is "chrome" and didn't process focus change. + + if(mChatHistory) + mChatHistory->setFocus(TRUE); + return LLDockableFloater::handleMouseDown(x, y, mask); +} diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h index 6ef2a1fee3..3c116dbe83 100644 --- a/indra/newview/llnearbychat.h +++ b/indra/newview/llnearbychat.h @@ -53,6 +53,8 @@ public: void onNearbyChatContextMenuItemClicked(const LLSD& userdata); bool onNearbyChatCheckContextMenuItem(const LLSD& userdata); + virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); + // focus overrides /*virtual*/ void onFocusLost(); /*virtual*/ void onFocusReceived(); diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml index 114b9a84e3..5b77f11d71 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml @@ -10,7 +10,9 @@ name="floater_voice_controls" help_topic="floater_voice_controls" title="Voice Controls" + save_dock_state="true" save_visibility="true" + save_rect="true" single_instance="true" width="282"> <string |