From 9ac109040215a765d03addcf03ef4bfcac68f03e Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Thu, 2 May 2019 10:47:30 +0300 Subject: SL-10992 FIXED SLURLs and SLApp links are translated in chat when using the translator --- indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index e50c8ee9f0..c8f75c79c4 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2415,7 +2415,7 @@ void translateSuccess(LLChat chat, LLSD toastArgs, std::string originalMsg, std: && ((detected_language.empty()) || (expectLang != detected_language)) && (LLStringUtil::compareInsensitive(translation, originalMsg) != 0)) { - chat.mText += " (" + translation + ")"; + chat.mText += " (" + LLTranslate::removeNoTranslateTags(translation) + ")"; } LLNotificationsUI::LLNotificationManager::instance().onChat(chat, toastArgs); -- cgit v1.3 From 19221d9ccf38a5b10e7e2ecefb1ad121f1fb51d7 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 12 Jun 2019 16:17:37 +0300 Subject: SL-11402 Save last session image per grid --- indra/newview/llappviewer.cpp | 2 +- indra/newview/llstartup.cpp | 36 ++++++++++++++++++++++++++++++++---- indra/newview/llstartup.h | 6 ++---- indra/newview/llviewerdisplay.cpp | 2 +- indra/newview/llviewermessage.cpp | 4 ++-- 5 files changed, 38 insertions(+), 12 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e201d56815..24886b01fb 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4505,7 +4505,7 @@ void LLAppViewer::saveFinalSnapshot() std::string snap_filename = gDirUtilp->getLindenUserDir(); snap_filename += gDirUtilp->getDirDelimiter(); - snap_filename += SCREEN_LAST_FILENAME; + snap_filename += LLStartUp::getScreenLastFilename(); // use full pixel dimensions of viewer window (not post-scale dimensions) gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, TRUE); mSavedFinalSnapshot = TRUE; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index e9d3cfa993..e34a9beb49 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -210,8 +210,8 @@ bool gAgentMovementCompleted = false; S32 gMaxAgentGroups; -std::string SCREEN_HOME_FILENAME = "screen_home.bmp"; -std::string SCREEN_LAST_FILENAME = "screen_last.bmp"; +const std::string SCREEN_HOME_FILENAME = "screen_home%s.bmp"; +const std::string SCREEN_LAST_FILENAME = "screen_last%s.bmp"; LLPointer gStartTexture; @@ -2577,6 +2577,34 @@ bool callback_choose_gender(const LLSD& notification, const LLSD& response) return false; } +std::string get_screen_filename(const std::string& pattern) +{ + if (LLGridManager::getInstance()->isInProductionGrid()) + { + return llformat(pattern.c_str(), ""); + } + else + { + const std::string& grid_id_str = LLGridManager::getInstance()->getGridId(); + const std::string& grid_id_lower = utf8str_tolower(grid_id_str); + std::string grid = "." + grid_id_lower; + return llformat(pattern.c_str(), grid.c_str()); + } +} + +//static +std::string LLStartUp::getScreenLastFilename() +{ + return get_screen_filename(SCREEN_LAST_FILENAME); +} + +//static +std::string LLStartUp::getScreenHomeFilename() +{ + return get_screen_filename(SCREEN_HOME_FILENAME); +} + +//static void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, const std::string& gender_name ) { @@ -2674,11 +2702,11 @@ void init_start_screen(S32 location_id) if ((S32)START_LOCATION_ID_LAST == location_id) { - temp_str += SCREEN_LAST_FILENAME; + temp_str += LLStartUp::getScreenLastFilename(); } else { - temp_str += SCREEN_HOME_FILENAME; + temp_str += LLStartUp::getScreenHomeFilename(); } LLPointer start_image_bmp = new LLImageBMP; diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h index d434e86f82..db37207022 100644 --- a/indra/newview/llstartup.h +++ b/indra/newview/llstartup.h @@ -41,10 +41,6 @@ bool idle_startup(); void release_start_screen(); bool login_alert_done(const LLSD& notification, const LLSD& response); -// constants, variables, & enumerations -extern std::string SCREEN_HOME_FILENAME; -extern std::string SCREEN_LAST_FILENAME; - // start location constants enum EStartLocation { @@ -95,6 +91,8 @@ public: static void setStartupState( EStartupState state ); static EStartupState getStartupState() { return gStartupState; }; static std::string getStartupStateString() { return startupStateToString(gStartupState); }; + static std::string getScreenLastFilename(); // screenshot taken on exit + static std::string getScreenHomeFilename(); // screenshot taken on setting Home static void multimediaInit(); // Initialize LLViewerMedia multimedia engine. diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index e2554bc9bc..fd49d3b3d3 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1588,7 +1588,7 @@ void render_disconnected_background() LL_INFOS() << "Loading last bitmap..." << LL_ENDL; std::string temp_str; - temp_str = gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + SCREEN_LAST_FILENAME; + temp_str = gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + LLStartUp::getScreenLastFilename(); LLPointer image_bmp = new LLImageBMP; if( !image_bmp->load(temp_str) ) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index c8f75c79c4..b70b077618 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5107,7 +5107,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) // save the home location image to disk std::string snap_filename = gDirUtilp->getLindenUserDir(); snap_filename += gDirUtilp->getDirDelimiter(); - snap_filename += SCREEN_HOME_FILENAME; + snap_filename += LLStartUp::getScreenHomeFilename(); gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); } @@ -5190,7 +5190,7 @@ static void process_special_alert_messages(const std::string & message) // save the home location image to disk std::string snap_filename = gDirUtilp->getLindenUserDir(); snap_filename += gDirUtilp->getDirDelimiter(); - snap_filename += SCREEN_HOME_FILENAME; + snap_filename += LLStartUp::getScreenHomeFilename(); gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); } } -- cgit v1.3 From 04e67fa12d1dac368e2f88a04af4cd266b8b2063 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 12 Jun 2019 19:12:09 +0300 Subject: SL-11402 Last session image should be saved as png --- indra/newview/llappviewer.cpp | 2 +- indra/newview/llstartup.cpp | 16 +++++------ indra/newview/llviewerdisplay.cpp | 10 +++---- indra/newview/llviewermessage.cpp | 4 +-- indra/newview/llviewerwindow.cpp | 60 ++++++++++++++++++++++++--------------- indra/newview/llviewerwindow.h | 2 +- 6 files changed, 54 insertions(+), 40 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 24886b01fb..f3915b9210 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4507,7 +4507,7 @@ void LLAppViewer::saveFinalSnapshot() snap_filename += gDirUtilp->getDirDelimiter(); snap_filename += LLStartUp::getScreenLastFilename(); // use full pixel dimensions of viewer window (not post-scale dimensions) - gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, TRUE); + gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, TRUE, LLSnapshotModel::SNAPSHOT_TYPE_COLOR, LLSnapshotModel::SNAPSHOT_FORMAT_PNG); mSavedFinalSnapshot = TRUE; } } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index e34a9beb49..256ece594c 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -113,7 +113,7 @@ #include "llgroupmgr.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" -#include "llimagebmp.h" +#include "llimagepng.h" #include "llinventorybridge.h" #include "llinventorymodel.h" #include "llinventorymodelbackgroundfetch.h" @@ -210,8 +210,8 @@ bool gAgentMovementCompleted = false; S32 gMaxAgentGroups; -const std::string SCREEN_HOME_FILENAME = "screen_home%s.bmp"; -const std::string SCREEN_LAST_FILENAME = "screen_last%s.bmp"; +const std::string SCREEN_HOME_FILENAME = "screen_home%s.png"; +const std::string SCREEN_LAST_FILENAME = "screen_last%s.png"; LLPointer gStartTexture; @@ -2709,7 +2709,7 @@ void init_start_screen(S32 location_id) temp_str += LLStartUp::getScreenHomeFilename(); } - LLPointer start_image_bmp = new LLImageBMP; + LLPointer start_image_png = new LLImagePNG; // Turn off start screen to get around the occasional readback // driver bug @@ -2718,18 +2718,18 @@ void init_start_screen(S32 location_id) LL_INFOS("AppInit") << "Bitmap load disabled" << LL_ENDL; return; } - else if(!start_image_bmp->load(temp_str) ) + else if(!start_image_png->load(temp_str) ) { LL_WARNS("AppInit") << "Bitmap load failed" << LL_ENDL; gStartTexture = NULL; } else { - gStartImageWidth = start_image_bmp->getWidth(); - gStartImageHeight = start_image_bmp->getHeight(); + gStartImageWidth = start_image_png->getWidth(); + gStartImageHeight = start_image_png->getHeight(); LLPointer raw = new LLImageRaw; - if (!start_image_bmp->decode(raw, 0.0f)) + if (!start_image_png->decode(raw, 0.0f)) { LL_WARNS("AppInit") << "Bitmap decode failed" << LL_ENDL; gStartTexture = NULL; diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index fd49d3b3d3..5924dbc260 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -42,7 +42,7 @@ #include "llfeaturemanager.h" //#include "llfirstuse.h" #include "llhudmanager.h" -#include "llimagebmp.h" +#include "llimagepng.h" #include "llmemory.h" #include "llselectmgr.h" #include "llsky.h" @@ -1590,15 +1590,15 @@ void render_disconnected_background() std::string temp_str; temp_str = gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + LLStartUp::getScreenLastFilename(); - LLPointer image_bmp = new LLImageBMP; - if( !image_bmp->load(temp_str) ) + LLPointer image_png = new LLImagePNG; + if( !image_png->load(temp_str) ) { //LL_INFOS() << "Bitmap load failed" << LL_ENDL; return; } LLPointer raw = new LLImageRaw; - if (!image_bmp->decode(raw, 0.0f)) + if (!image_png->decode(raw, 0.0f)) { LL_INFOS() << "Bitmap decode failed" << LL_ENDL; gDisconnectedImagep = NULL; @@ -1606,7 +1606,7 @@ void render_disconnected_background() } U8 *rawp = raw->getData(); - S32 npixels = (S32)image_bmp->getWidth()*(S32)image_bmp->getHeight(); + S32 npixels = (S32)image_png->getWidth()*(S32)image_png->getHeight(); for (S32 i = 0; i < npixels; i++) { S32 sum = 0; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index b70b077618..6e5c77e4a9 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5108,7 +5108,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) std::string snap_filename = gDirUtilp->getLindenUserDir(); snap_filename += gDirUtilp->getDirDelimiter(); snap_filename += LLStartUp::getScreenHomeFilename(); - gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); + gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE, LLSnapshotModel::SNAPSHOT_TYPE_COLOR, LLSnapshotModel::SNAPSHOT_FORMAT_PNG); } if (notificationID == "RegionRestartMinutes" || @@ -5191,7 +5191,7 @@ static void process_special_alert_messages(const std::string & message) std::string snap_filename = gDirUtilp->getLindenUserDir(); snap_filename += gDirUtilp->getDirDelimiter(); snap_filename += LLStartUp::getScreenHomeFilename(); - gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); + gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE, LLSnapshotModel::SNAPSHOT_TYPE_COLOR, LLSnapshotModel::SNAPSHOT_FORMAT_PNG); } } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 8e6df22171..74770dc483 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -122,7 +122,7 @@ #include "llhudmanager.h" #include "llhudobject.h" #include "llhudview.h" -#include "llimagebmp.h" +#include "llimage.h" #include "llimagej2c.h" #include "llimageworker.h" #include "llkeyboard.h" @@ -4487,32 +4487,46 @@ void LLViewerWindow::movieSize(S32 new_width, S32 new_height) } } -BOOL LLViewerWindow::saveSnapshot(const std::string& filepath, S32 image_width, S32 image_height, BOOL show_ui, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type) +BOOL LLViewerWindow::saveSnapshot(const std::string& filepath, S32 image_width, S32 image_height, BOOL show_ui, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type, LLSnapshotModel::ESnapshotFormat format) { - LL_INFOS() << "Saving snapshot to: " << filepath << LL_ENDL; + LL_INFOS() << "Saving snapshot to: " << filepath << LL_ENDL; - LLPointer raw = new LLImageRaw; - BOOL success = rawSnapshot(raw, image_width, image_height, TRUE, FALSE, show_ui, do_rebuild); + LLPointer raw = new LLImageRaw; + BOOL success = rawSnapshot(raw, image_width, image_height, TRUE, FALSE, show_ui, do_rebuild); - if (success) - { - LLPointer bmp_image = new LLImageBMP; - success = bmp_image->encode(raw, 0.0f); - if( success ) - { - success = bmp_image->save(filepath); - } - else - { - LL_WARNS() << "Unable to encode bmp snapshot" << LL_ENDL; - } - } - else - { - LL_WARNS() << "Unable to capture raw snapshot" << LL_ENDL; - } + if (success) + { + U8 image_codec = IMG_CODEC_BMP; + switch (format) + { + case LLSnapshotModel::SNAPSHOT_FORMAT_PNG: + image_codec = IMG_CODEC_PNG; + break; + case LLSnapshotModel::SNAPSHOT_FORMAT_JPEG: + image_codec = IMG_CODEC_JPEG; + break; + default: + image_codec = IMG_CODEC_BMP; + break; + } - return success; + LLPointer formated_image = LLImageFormatted::createFromType(image_codec); + success = formated_image->encode(raw, 0.0f); + if (success) + { + success = formated_image->save(filepath); + } + else + { + LL_WARNS() << "Unable to encode snapshot of format " << format << LL_ENDL; + } + } + else + { + LL_WARNS() << "Unable to capture raw snapshot" << LL_ENDL; + } + + return success; } diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index d41a606f11..071a3632dd 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -347,7 +347,7 @@ public: // snapshot functionality. // perhaps some of this should move to llfloatershapshot? -MG - BOOL saveSnapshot(const std::string& filename, S32 image_width, S32 image_height, BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, LLSnapshotModel::ESnapshotLayerType type = LLSnapshotModel::SNAPSHOT_TYPE_COLOR); + BOOL saveSnapshot(const std::string& filename, S32 image_width, S32 image_height, BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, LLSnapshotModel::ESnapshotLayerType type = LLSnapshotModel::SNAPSHOT_TYPE_COLOR, LLSnapshotModel::ESnapshotFormat format = LLSnapshotModel::SNAPSHOT_FORMAT_BMP); BOOL rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_height, BOOL keep_window_aspect = TRUE, BOOL is_texture = FALSE, BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, LLSnapshotModel::ESnapshotLayerType type = LLSnapshotModel::SNAPSHOT_TYPE_COLOR, S32 max_size = MAX_SNAPSHOT_IMAGE_SIZE); BOOL thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type); -- cgit v1.3