diff --git a/doc/contributions.txt b/doc/contributions.txt
index bebe433aca..86188653bb 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -1194,6 +1194,7 @@ PanteraPolnocy
SL-18891
SL-18904
SL-18937
+ SL-19681
Parvati Silverweb
Patric Mills
VWR-2645
@@ -1418,6 +1419,7 @@ Sovereign Engineer
SL-18497
SL-18525
SL-18534
+ SL-19336
SL-19690
SpacedOut Frye
VWR-34
diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp
index f2d7a4bbcd..d09310a3c4 100644
--- a/indra/llcharacter/llkeyframemotion.cpp
+++ b/indra/llcharacter/llkeyframemotion.cpp
@@ -1394,6 +1394,8 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
// get number of joint motions
//-------------------------------------------------------------------------
U32 num_motions = 0;
+ S32 rotation_dupplicates = 0;
+ S32 position_dupplicates = 0;
if (!dp.unpackU32(num_motions, "num_joints"))
{
LL_WARNS() << "can't read number of joints"
@@ -1624,6 +1626,12 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
rCurve->mKeys[time] = rot_key;
}
+ if (joint_motion->mRotationCurve.mNumKeys > joint_motion->mRotationCurve.mKeys.size())
+ {
+ rotation_dupplicates++;
+ LL_INFOS() << "Motion: " << asset_id << " had dupplicate rotation keys that were removed" << LL_ENDL;
+ }
+
//---------------------------------------------------------------------
// scan position curve header
//---------------------------------------------------------------------
@@ -1726,9 +1734,24 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
}
}
+ if (joint_motion->mPositionCurve.mNumKeys > joint_motion->mPositionCurve.mKeys.size())
+ {
+ position_dupplicates++;
+ }
+
joint_motion->mUsage = joint_state->getUsage();
}
+ if (rotation_dupplicates > 0)
+ {
+ LL_INFOS() << "Motion: " << asset_id << " had " << rotation_dupplicates << " dupplicate rotation keys that were removed" << LL_ENDL;
+ }
+
+ if (position_dupplicates > 0)
+ {
+ LL_INFOS() << "Motion: " << asset_id << " had " << position_dupplicates << " dupplicate position keys that were removed" << LL_ENDL;
+ }
+
//-------------------------------------------------------------------------
// get number of constraints
//-------------------------------------------------------------------------
@@ -2008,10 +2031,13 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const
JointMotion* joint_motionp = mJointMotionList->getJointMotion(i);
success &= dp.packString(joint_motionp->mJointName, "joint_name");
success &= dp.packS32(joint_motionp->mPriority, "joint_priority");
- success &= dp.packS32(joint_motionp->mRotationCurve.mNumKeys, "num_rot_keys");
+ success &= dp.packS32(joint_motionp->mRotationCurve.mKeys.size(), "num_rot_keys");
- LL_DEBUGS("BVH") << "Joint " << joint_motionp->mJointName << LL_ENDL;
- for (RotationCurve::key_map_t::value_type& rot_pair : joint_motionp->mRotationCurve.mKeys)
+ LL_DEBUGS("BVH") << "Joint " << i
+ << " name: " << joint_motionp->mJointName
+ << " Rotation keys: " << joint_motionp->mRotationCurve.mKeys.size()
+ << " Position keys: " << joint_motionp->mPositionCurve.mKeys.size() << LL_ENDL;
+ for (RotationCurve::key_map_t::value_type& rot_pair : joint_motionp->mRotationCurve.mKeys)
{
RotationKey& rot_key = rot_pair.second;
U16 time_short = F32_to_U16(rot_key.mTime, 0.f, mJointMotionList->mDuration);
@@ -2031,7 +2057,7 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const
LL_DEBUGS("BVH") << " rot: t " << rot_key.mTime << " angles " << rot_angles.mV[VX] <<","<< rot_angles.mV[VY] <<","<< rot_angles.mV[VZ] << LL_ENDL;
}
- success &= dp.packS32(joint_motionp->mPositionCurve.mNumKeys, "num_pos_keys");
+ success &= dp.packS32(joint_motionp->mPositionCurve.mKeys.size(), "num_pos_keys");
for (PositionCurve::key_map_t::value_type& pos_pair : joint_motionp->mPositionCurve.mKeys)
{
PositionKey& pos_key = pos_pair.second;
diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 4b8dd0d1a8..9504ed800e 100644
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -40,7 +40,6 @@ set(llcommon_SOURCE_FILES
lldependencies.cpp
lldictionary.cpp
llerror.cpp
- llerrorthread.cpp
llevent.cpp
lleventapi.cpp
lleventcoro.cpp
@@ -153,7 +152,6 @@ set(llcommon_HEADER_FILES
llendianswizzle.h
llerror.h
llerrorcontrol.h
- llerrorthread.h
llevent.h
lleventapi.h
lleventcoro.h
diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp
index fc78662f09..284bfb2afa 100644
--- a/indra/llcommon/llapp.cpp
+++ b/indra/llcommon/llapp.cpp
@@ -39,7 +39,6 @@
#include "llcommon.h"
#include "llapr.h"
#include "llerrorcontrol.h"
-#include "llerrorthread.h"
#include "llframetimer.h"
#include "lllivefile.h"
#include "llmemory.h"
@@ -108,12 +107,7 @@ LLAppErrorHandler LLApp::sErrorHandler = NULL;
BOOL LLApp::sErrorThreadRunning = FALSE;
-LLApp::LLApp() : mThreadErrorp(NULL)
-{
- commonCtor();
-}
-
-void LLApp::commonCtor()
+LLApp::LLApp()
{
// Set our status to running
setStatus(APP_STATUS_RUNNING);
@@ -143,12 +137,6 @@ void LLApp::commonCtor()
mCrashReportPipeStr = L"\\\\.\\pipe\\LLCrashReporterPipe";
}
-LLApp::LLApp(LLErrorThread *error_thread) :
- mThreadErrorp(error_thread)
-{
- commonCtor();
-}
-
LLApp::~LLApp()
{
@@ -158,13 +146,6 @@ LLApp::~LLApp()
mLiveFiles.clear();
setStopped();
- // HACK: wait for the error thread to clean itself
- ms_sleep(20);
- if (mThreadErrorp)
- {
- delete mThreadErrorp;
- mThreadErrorp = NULL;
- }
SUBSYSTEM_CLEANUP_DBG(LLCommon);
}
@@ -393,27 +374,6 @@ void LLApp::setupErrorHandling(bool second_instance)
#endif // ! LL_BUGSPLAT
#endif // ! LL_WINDOWS
-
-#ifdef LL_BUGSPLAT
- // do not start our own error thread
-#else // ! LL_BUGSPLAT
- startErrorThread();
-#endif
-}
-
-void LLApp::startErrorThread()
-{
- //
- // Start the error handling thread, which is responsible for taking action
- // when the app goes into the APP_STATUS_ERROR state
- //
- if(!mThreadErrorp)
- {
- LL_INFOS() << "Starting error thread" << LL_ENDL;
- mThreadErrorp = new LLErrorThread();
- mThreadErrorp->setUserData((void *) this);
- mThreadErrorp->start();
- }
}
void LLApp::setErrorHandler(LLAppErrorHandler handler)
@@ -476,7 +436,7 @@ void LLApp::setStatus(EAppStatus status)
// static
void LLApp::setError()
{
- // set app status to ERROR so that the LLErrorThread notices
+ // set app status to ERROR
setStatus(APP_STATUS_ERROR);
}
diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h
index c65fe21c9c..c832c8b142 100644
--- a/indra/llcommon/llapp.h
+++ b/indra/llcommon/llapp.h
@@ -34,7 +34,6 @@
#include
#include
// Forward declarations
-class LLErrorThread;
class LLLiveFile;
#if LL_LINUX
#include
@@ -53,7 +52,6 @@ void clear_signals();
class LL_COMMON_API LLApp
{
- friend class LLErrorThread;
public:
typedef enum e_app_status
{
@@ -67,11 +65,6 @@ public:
LLApp();
virtual ~LLApp();
-protected:
- LLApp(LLErrorThread* error_thread);
- void commonCtor();
-public:
-
/**
* @brief Return the static app instance if one was created.
*/
@@ -257,14 +250,14 @@ public:
void setupErrorHandling(bool mSecondInstance=false);
void setErrorHandler(LLAppErrorHandler handler);
- static void runErrorHandler(); // run shortly after we detect an error, ran in the relatively robust context of the LLErrorThread - preferred.
+ static void runErrorHandler(); // run shortly after we detect an error
//@}
-
+
// the maximum length of the minidump filename returned by getMiniDumpFilename()
static const U32 MAX_MINDUMP_PATH_LENGTH = 256;
// change the directory where Breakpad minidump files are written to
- void setDebugFileNames(const std::string &path);
+ void setDebugFileNames(const std::string &path);
// Return the Google Breakpad minidump filename after a crash.
char *getMiniDumpFilename() { return mMinidumpPath; }
@@ -310,13 +303,11 @@ protected:
void stepFrame();
private:
- void startErrorThread();
-
// Contains the filename of the minidump file after a crash.
char mMinidumpPath[MAX_MINDUMP_PATH_LENGTH];
- std::string mStaticDebugFileName;
- std::string mDynamicDebugFileName;
+ std::string mStaticDebugFileName;
+ std::string mDynamicDebugFileName;
// *NOTE: On Windows, we need a routine to reset the structured
// exception handler when some evil driver has taken it over for
@@ -324,9 +315,6 @@ private:
typedef int(*signal_handler_func)(int signum);
static LLAppErrorHandler sErrorHandler;
- // Default application threads
- LLErrorThread* mThreadErrorp; // Waits for app to go to status ERROR, then runs the error callback
-
// This is the application level runnable scheduler.
LLRunner mRunner;
diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h
index e45140ace8..beff30f069 100644
--- a/indra/llcommon/llerror.h
+++ b/indra/llcommon/llerror.h
@@ -288,7 +288,6 @@ namespace LLError
// used to indicate no class info known for logging
//LLCallStacks keeps track of call stacks and output the call stacks to log file
- //when LLAppViewer::handleViewerCrash() is triggered.
//
//Note: to be simple, efficient and necessary to keep track of correct call stacks,
//LLCallStacks is designed not to be thread-safe.
diff --git a/indra/llcommon/llerrorthread.cpp b/indra/llcommon/llerrorthread.cpp
deleted file mode 100644
index 221ccf9811..0000000000
--- a/indra/llcommon/llerrorthread.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/**
- * @file llerrorthread.cpp
- *
- * $LicenseInfo:firstyear=2004&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-#include "llerrorthread.h"
-
-#include "llapp.h"
-#include "lltimer.h" // ms_sleep()
-
-LLErrorThread::LLErrorThread()
- : LLThread("Error"),
- mUserDatap(NULL)
-{
-}
-
-LLErrorThread::~LLErrorThread()
-{
-}
-
-void LLErrorThread::setUserData(void* user_data)
-{
- mUserDatap = user_data;
-}
-
-
-void* LLErrorThread::getUserData() const
-{
- return mUserDatap;
-}
-
-#if !LL_WINDOWS
-//
-// Various signal/error handling functions that can't be put into the class
-//
-void get_child_status(const int waitpid_status, int &process_status, bool &exited, bool do_logging)
-{
- exited = false;
- process_status = -1;
- // The child process exited. Call its callback, and then clean it up
- if (WIFEXITED(waitpid_status))
- {
- process_status = WEXITSTATUS(waitpid_status);
- exited = true;
- if (do_logging)
- {
- LL_INFOS() << "get_child_status - Child exited cleanly with return of " << process_status << LL_ENDL;
- }
- return;
- }
- else if (WIFSIGNALED(waitpid_status))
- {
- process_status = WTERMSIG(waitpid_status);
- exited = true;
- if (do_logging)
- {
- LL_INFOS() << "get_child_status - Child died because of uncaught signal " << process_status << LL_ENDL;
-#ifdef WCOREDUMP
- if (WCOREDUMP(waitpid_status))
- {
- LL_INFOS() << "get_child_status - Child dumped core" << LL_ENDL;
- }
- else
- {
- LL_INFOS() << "get_child_status - Child didn't dump core" << LL_ENDL;
- }
-#endif
- }
- return;
- }
- else if (do_logging)
- {
- // This is weird. I just dump the waitpid status into the status code,
- // not that there's any way of telling what it is...
- LL_INFOS() << "get_child_status - Got SIGCHILD but child didn't exit" << LL_ENDL;
- process_status = waitpid_status;
- }
-
-}
-#endif
-
-void LLErrorThread::run()
-{
- LLApp::sErrorThreadRunning = TRUE;
- // This thread sits and waits for the sole purpose
- // of waiting for the signal/exception handlers to flag the
- // application state as APP_STATUS_ERROR.
-
- // Do not log as this can lead to deadlocks during startup.
- // LL_INFOS() << "thread_error - Waiting for an error" << LL_ENDL;
-
- S32 counter = 0;
- while (! (LLApp::isError() || LLApp::isStopped()))
- {
- ms_sleep(10);
- counter++;
- }
- if (LLApp::isError())
- {
- // The app is in an error state, run the application's error handler.
- //LL_INFOS() << "thread_error - An error has occurred, running error callback!" << LL_ENDL;
- // Run the error handling callback
- LLApp::runErrorHandler();
- }
- else
- {
- // Everything is okay, a clean exit.
- //LL_INFOS() << "thread_error - Application exited cleanly" << LL_ENDL;
- }
-
- //LL_INFOS() << "thread_error - Exiting" << LL_ENDL;
- LLApp::sErrorThreadRunning = FALSE;
-}
-
diff --git a/indra/llcommon/llerrorthread.h b/indra/llcommon/llerrorthread.h
deleted file mode 100644
index 474cef3a50..0000000000
--- a/indra/llcommon/llerrorthread.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * @file llerrorthread.h
- * @brief Specialized thread to handle runtime errors.
- *
- * $LicenseInfo:firstyear=2004&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLERRORTHREAD_H
-#define LL_LLERRORTHREAD_H
-
-#include "llthread.h"
-
-class LL_COMMON_API LLErrorThread : public LLThread
-{
-public:
- LLErrorThread();
- ~LLErrorThread();
-
- /*virtual*/ void run(void);
- void setUserData(void *user_data);
- void *getUserData() const;
-
-protected:
- void* mUserDatap; // User data associated with this thread
-};
-
-#endif // LL_LLERRORTHREAD_H
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp
index 50bba94d4c..4aaa257676 100644
--- a/indra/llmessage/llcachename.cpp
+++ b/indra/llmessage/llcachename.cpp
@@ -606,7 +606,9 @@ std::string LLCacheName::buildUsername(const std::string& full_name)
// if the input wasn't a correctly formatted legacy name, just return it
// cleaned up from a potential terminal "Resident"
- return cleanFullName(full_name);
+ std::string clean_name = cleanFullName(full_name);
+ LLStringUtil::toLower(clean_name);
+ return clean_name;
}
//static
diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp
index 37525e4a3d..f6cb3c8b70 100644
--- a/indra/llprimitive/llmaterial.cpp
+++ b/indra/llprimitive/llmaterial.cpp
@@ -438,18 +438,18 @@ bool LLMaterial::operator != (const LLMaterial& rhs) const
}
-U32 LLMaterial::getShaderMask(U32 alpha_mode)
+U32 LLMaterial::getShaderMask(U32 alpha_mode, BOOL is_alpha)
{ //NEVER incorporate this value into the message system -- this function will vary depending on viewer implementation
- U32 ret = 0;
- //two least significant bits are "diffuse alpha mode"
- if (alpha_mode != DIFFUSE_ALPHA_MODE_DEFAULT)
+ //two least significant bits are "diffuse alpha mode"
+ U32 ret = alpha_mode;
+ if (ret == DIFFUSE_ALPHA_MODE_DEFAULT)
{
- ret = alpha_mode;
- }
- else
- {
- ret = getDiffuseAlphaMode();
+ ret = getDiffuseAlphaMode();
+ if (ret == DIFFUSE_ALPHA_MODE_BLEND && !is_alpha)
+ {
+ ret = DIFFUSE_ALPHA_MODE_NONE;
+ }
}
llassert(ret < SHADER_COUNT);
diff --git a/indra/llprimitive/llmaterial.h b/indra/llprimitive/llmaterial.h
index 56bfef20fa..cbf900da0c 100644
--- a/indra/llprimitive/llmaterial.h
+++ b/indra/llprimitive/llmaterial.h
@@ -133,7 +133,7 @@ public:
bool operator == (const LLMaterial& rhs) const;
bool operator != (const LLMaterial& rhs) const;
- U32 getShaderMask(U32 alpha_mode = DIFFUSE_ALPHA_MODE_DEFAULT);
+ U32 getShaderMask(U32 alpha_mode, BOOL is_alpha);
LLUUID getHash() const;
protected:
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index c5483d1cfe..b169e27fa5 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -520,7 +520,7 @@ F32 LLFontGL::getWidthF32(const std::string& utf8text, S32 begin_offset, S32 max
return getWidthF32(wtext.c_str(), begin_offset, max_chars);
}
-F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars) const
+F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars, bool no_padding) const
{
const S32 LAST_CHARACTER = LLFontFreetype::LAST_CHAR_FULL;
@@ -543,12 +543,15 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars
F32 advance = mFontFreetype->getXAdvance(fgi);
- // for the last character we want to measure the greater of its width and xadvance values
- // so keep track of the difference between these values for the each character we measure
- // so we can fix things up at the end
- width_padding = llmax( 0.f, // always use positive padding amount
- width_padding - advance, // previous padding left over after advance of current character
- (F32)(fgi->mWidth + fgi->mXBearing) - advance); // difference between width of this character and advance to next character
+ if (!no_padding)
+ {
+ // for the last character we want to measure the greater of its width and xadvance values
+ // so keep track of the difference between these values for the each character we measure
+ // so we can fix things up at the end
+ width_padding = llmax(0.f, // always use positive padding amount
+ width_padding - advance, // previous padding left over after advance of current character
+ (F32)(fgi->mWidth + fgi->mXBearing) - advance); // difference between width of this character and advance to next character
+ }
cur_x += advance;
llwchar next_char = wchars[i+1];
@@ -565,8 +568,11 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars
cur_x = (F32)ll_round(cur_x);
}
- // add in extra pixels for last character's width past its xadvance
- cur_x += width_padding;
+ if (!no_padding)
+ {
+ // add in extra pixels for last character's width past its xadvance
+ cur_x += width_padding;
+ }
return cur_x / sScaleX;
}
diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h
index f73ddc13eb..edff8ebc5f 100644
--- a/indra/llrender/llfontgl.h
+++ b/indra/llrender/llfontgl.h
@@ -138,7 +138,7 @@ public:
F32 getWidthF32(const std::string& utf8text) const;
F32 getWidthF32(const llwchar* wchars) const;
F32 getWidthF32(const std::string& text, S32 offset, S32 max_chars ) const;
- F32 getWidthF32(const llwchar* wchars, S32 offset, S32 max_chars) const;
+ F32 getWidthF32(const llwchar* wchars, S32 offset, S32 max_chars, bool no_padding = false) const;
// The following are called often, frequently with large buffers, so do not use a string interface
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index fdae85b843..515022f128 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -904,21 +904,18 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32
{
stop_glerror();
- // Fix use-after-free
- // if (prev_mip_data)
- // delete[] prev_mip_data;
- // if (cur_mip_data)
- // delete[] cur_mip_data;
- if (prev_mip_data != cur_mip_data)
+ if (prev_mip_data)
{
- delete[] prev_mip_data;
+ if (prev_mip_data != cur_mip_data)
+ delete[] prev_mip_data;
+ prev_mip_data = nullptr;
}
- delete[] cur_mip_data;
-
- prev_mip_data = nullptr;
- cur_mip_data = nullptr;
- //
-
+ if (cur_mip_data)
+ {
+ delete[] cur_mip_data;
+ cur_mip_data = nullptr;
+ }
+
mGLTextureCreated = false;
return FALSE;
}
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 3378bcaadb..6811ac506c 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -432,7 +432,7 @@ S32 LLFolderViewItem::arrange( S32* width, S32* height )
// it is purely visual, so it is fine to do at our laisure
refreshSuffix();
}
- mLabelWidth = getLabelXPos() + getLabelFontForStyle(mLabelStyle)->getWidth(mLabel) + getLabelFontForStyle(mLabelStyle)->getWidth(mLabelSuffix) + mLabelPaddingRight;
+ mLabelWidth = getLabelXPos() + getLabelFontForStyle(mLabelStyle)->getWidth(mLabel) + getLabelFontForStyle(mLabelStyle)->getWidth(mLabelSuffix) + mLabelPaddingRight;
mLabelWidthDirty = false;
}
diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp
index e01aba402e..2791377a5e 100644
--- a/indra/llui/lliconctrl.cpp
+++ b/indra/llui/lliconctrl.cpp
@@ -37,6 +37,8 @@
#include "lluiimage.h"
#include "llwindow.h"
+#include "llgltexture.h"
+
static LLDefaultChildRegistry::Register r("icon");
LLIconCtrl::Params::Params()
@@ -94,6 +96,22 @@ BOOL LLIconCtrl::handleHover(S32 x, S32 y, MASK mask)
return LLUICtrl::handleHover(x, y, mask);
}
+void LLIconCtrl::onVisibilityChange(BOOL new_visibility)
+{
+ LLUICtrl::onVisibilityChange(new_visibility);
+ if (mPriority == LLGLTexture::BOOST_ICON)
+ {
+ if (new_visibility)
+ {
+ loadImage(getValue(), mPriority);
+ }
+ else
+ {
+ mImagep = nullptr;
+ }
+ }
+}
+
// virtual
// value might be a string or a UUID
void LLIconCtrl::setValue(const LLSD& value)
@@ -110,6 +128,14 @@ void LLIconCtrl::setValue(const LLSD& value, S32 priority)
tvalue = LLSD(LLUUID(value.asString()));
}
LLUICtrl::setValue(tvalue);
+
+ loadImage(tvalue, priority);
+}
+
+void LLIconCtrl::loadImage(const LLSD& tvalue, S32 priority)
+{
+ if(mPriority == LLGLTexture::BOOST_ICON && !getVisible()) return;
+
if (tvalue.isUUID())
{
mImagep = LLUI::getUIImageByID(tvalue.asUUID(), priority);
diff --git a/indra/llui/lliconctrl.h b/indra/llui/lliconctrl.h
index 9c3b517bca..5d6c544571 100644
--- a/indra/llui/lliconctrl.h
+++ b/indra/llui/lliconctrl.h
@@ -72,6 +72,7 @@ public:
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
// lluictrl overrides
+ void onVisibilityChange(BOOL new_visibility);
virtual void setValue(const LLSD& value );
std::string getImageName() const;
@@ -95,6 +96,8 @@ protected:
bool mInteractable;
private:
+ void loadImage(const LLSD& value, S32 priority);
+
LLUIColor mColor;
LLPointer mImagep;
};
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 7b0d4e4af2..bb0f4440c9 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -320,6 +320,17 @@ void LLLayoutStack::draw()
}
}
+void LLLayoutStack::deleteAllChildren()
+{
+ mPanels.clear();
+ LLView::deleteAllChildren();
+
+ // Not really needed since nothing is left to
+ // display, but for the sake of consistency
+ updateFractionalSizes();
+ mNeedsLayout = true;
+}
+
void LLLayoutStack::removeChild(LLView* view)
{
LLLayoutPanel* embedded_panelp = findEmbeddedPanel(dynamic_cast(view));
@@ -327,21 +338,14 @@ void LLLayoutStack::removeChild(LLView* view)
if (embedded_panelp)
{
mPanels.erase(std::find(mPanels.begin(), mPanels.end(), embedded_panelp));
- // delete embedded_panelp; // Fix crash when removing layout panels from a stack
+ LLView::removeChild(view);
updateFractionalSizes();
mNeedsLayout = true;
}
-
- LLView::removeChild(view);
-
- // Fix crash when removing layout panels from a stack
- if (embedded_panelp)
- {
- // only delete the panel after it was removed from LLView to prevent
- // LLView::removeChild() to run into an already deleted pointer
- delete embedded_panelp;
- }
- //
+ else
+ {
+ LLView::removeChild(view);
+ }
}
BOOL LLLayoutStack::postBuild()
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index 87a9dd9921..142712b5f5 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -72,6 +72,7 @@ public:
virtual ~LLLayoutStack();
/*virtual*/ void draw();
+ /*virtual*/ void deleteAllChildren();
/*virtual*/ void removeChild(LLView*);
/*virtual*/ BOOL postBuild();
/*virtual*/ bool addChild(LLView* child, S32 tab_group = 0);
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 18b789da24..7ec9f3028c 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -1905,6 +1905,13 @@ bool LLMenuGL::addContextChild(LLView* view, S32 tab_group)
return false;
}
+
+void LLMenuGL::deleteAllChildren()
+{
+ mItems.clear();
+ LLUICtrl::deleteAllChildren();
+}
+
void LLMenuGL::removeChild( LLView* ctrl)
{
// previously a dynamic_cast with if statement to check validity
diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h
index 760d3eff6c..9caf356183 100644
--- a/indra/llui/llmenugl.h
+++ b/indra/llui/llmenugl.h
@@ -443,6 +443,7 @@ public:
/*virtual*/ void drawBackground(LLMenuItemGL* itemp, F32 alpha);
/*virtual*/ void setVisible(BOOL visible);
/*virtual*/ bool addChild(LLView* view, S32 tab_group = 0);
+ /*virtual*/ void deleteAllChildren();
/*virtual*/ void removeChild( LLView* ctrl);
/*virtual*/ BOOL postBuild();
diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h
index 175808be00..597597a37b 100644
--- a/indra/llui/llpanel.h
+++ b/indra/llui/llpanel.h
@@ -127,6 +127,7 @@ public:
virtual void clearCtrls(); // overridden in LLPanelObject and LLPanelVolume
// Border controls
+ const LLViewBorder* getBorder() const { return mBorder; }
void addBorder( LLViewBorder::Params p);
void addBorder();
void removeBorder();
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index aa8822a00e..6291bf503b 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -504,7 +504,7 @@ void LLTextBase::drawHighlightsBackground(const highlight_list_t& highlights, co
}
// [/SL:KB]
-std::vector LLTextBase::getSelctionRects()
+std::vector LLTextBase::getSelectionRects()
{
// Nor supposed to be called without selection
llassert(hasSelection());
@@ -601,7 +601,7 @@ void LLTextBase::drawSelectionBackground()
// Draw selection even if we don't have keyboard focus for search/replace
if (hasSelection() && !mLineInfoList.empty())
{
- std::vector selection_rects = getSelctionRects();
+ std::vector selection_rects = getSelectionRects();
// Draw the selection box (we're using a box instead of reversing the colors on the selected text).
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
@@ -1526,9 +1526,9 @@ void LLTextBase::draw()
drawCursor();
}
- mDocumentView->setVisible(FALSE);
+ mDocumentView->setVisibleDirect(FALSE);
LLUICtrl::draw();
- mDocumentView->setVisible(TRUE);
+ mDocumentView->setVisibleDirect(TRUE);
}
@@ -3822,7 +3822,7 @@ bool LLNormalTextSegment::getDimensionsF32(S32 first_char, S32 num_chars, F32& w
height = mFontHeight;
const LLWString &text = getWText();
// if last character is a newline, then return true, forcing line break
- width = mStyle->getFont()->getWidthF32(text.c_str(), mStart + first_char, num_chars);
+ width = mStyle->getFont()->getWidthF32(text.c_str(), mStart + first_char, num_chars, true);
}
return false;
}
diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h
index fa15b17b89..6837637d2f 100644
--- a/indra/llui/lltextbase.h
+++ b/indra/llui/lltextbase.h
@@ -685,7 +685,7 @@ protected:
return mLabel.getString() + getToolTip();
}
- std::vector getSelctionRects();
+ std::vector getSelectionRects();
protected:
// text segmentation and flow
diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp
index c2e399cacc..e0799333b4 100644
--- a/indra/llui/lltextbox.cpp
+++ b/indra/llui/lltextbox.cpp
@@ -177,7 +177,8 @@ void LLTextBox::reshapeToFitText(BOOL called_from_parent)
S32 width = getTextPixelWidth();
S32 height = getTextPixelHeight();
- reshape( width + 2 * mHPad, height + 2 * mVPad, called_from_parent );
+ //consider investigating reflow() to find missing width pixel (see SL-17045 changes)
+ reshape( width + 2 * mHPad + 1, height + 2 * mVPad, called_from_parent );
}
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index c208c0006b..b03e53a643 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -1915,7 +1915,10 @@ void LLTextEditor::unindentLineBeforeCloseBrace()
LLWString text = getWText();
if( ' ' == text[ mCursorPos - 1 ] )
{
- S32 line = getLineNumFromDocIndex(mCursorPos, false);
+ // FIRE-19959: Fix unindent after } when a previous line had a word wrap
+ //S32 line = getLineNumFromDocIndex(mCursorPos, false);
+ S32 line = getLineNumFromDocIndex(mCursorPos, true);
+ //
S32 line_start = getLineStart(line);
// Jump over spaces in the current line
diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp
index d44c932b1f..20051b330c 100644
--- a/indra/llui/lluicolortable.cpp
+++ b/indra/llui/lluicolortable.cpp
@@ -226,7 +226,6 @@ LLUIColor LLUIColorTable::getColor( char const *name, const LLColor4& default_co
void LLUIColorTable::setColor(const std::string& name, const LLColor4& color)
{
setColor(name, color, mUserSetColors);
- setColor(name, color, mLoadedColors);
}
bool LLUIColorTable::loadFromSettings()
@@ -255,6 +254,11 @@ void LLUIColorTable::saveUserSettings() const
it != mUserSetColors.end();
++it)
{
+ // Compare user color value with the default value, skip if equal
+ string_color_map_t::const_iterator itd = mLoadedColors.find(it->first);
+ if(itd != mLoadedColors.end() && itd->second == it->second)
+ continue;
+
ColorEntryParams color_entry;
// color_entry.name = it->first;
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index df6d8ef5b8..a5d6c2345a 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -626,8 +626,10 @@ void LLView::deleteAllChildren()
while (!mChildList.empty())
{
- LLView* viewp = mChildList.front();
- delete viewp; // will remove the child from mChildList
+ LLView* viewp = mChildList.front();
+ viewp->mParentView = NULL;
+ delete viewp;
+ mChildList.pop_front();
}
}
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index b3244e8a7a..d23af4a789 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -293,6 +293,7 @@ public:
void setAllChildrenEnabled(BOOL b);
virtual void setVisible(BOOL visible);
+ void setVisibleDirect(BOOL visible) { mVisible = visible; }
const BOOL& getVisible() const { return mVisible; }
virtual void setEnabled(BOOL enabled);
BOOL getEnabled() const { return mEnabled; }
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index 78c0ccd4a1..be6f961b61 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -118,7 +118,8 @@ public:
// Sets cursor, may set to arrow+hourglass
virtual void setCursor(ECursorType cursor) { mNextCursor = cursor; };
- virtual ECursorType getCursor() const;
+ virtual ECursorType getCursor() const;
+ virtual ECursorType getNextCursor() const { return mNextCursor; };
virtual void updateCursor() = 0;
virtual void captureMouse() = 0;
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 6c9e19b96a..63b73040a5 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -16351,13 +16351,13 @@ Change of this parameter will affect the layout of buttons in notification toast
TranslationService
GoogleTranslateAPIKey
", begin);
- err_msg = body.substr(begin, end-begin);
- LLStringUtil::replaceString(err_msg, "
", ""); // strip CR
+ if (http_response.has("error_body"))
+ err_msg = parseErrorResponse(http_response["error_body"].asString());
return false;
}
- // Sample response: Hola
- size_t begin = body.find(">");
- if (begin == std::string::npos || begin >= (body.size() - 1))
- {
- begin = 0;
- }
- else
- {
- ++begin;
- }
+ //Example:
+ // "[{\"detectedLanguage\":{\"language\":\"en\",\"score\":1.0},\"translations\":[{\"text\":\"Hello, what is your name?\",\"to\":\"en\"}]}]"
- size_t end = body.find("", begin);
+ Json::Value root;
+ Json::Reader reader;
- detected_lang = ""; // unsupported by this API
- translation = body.substr(begin, end-begin);
- LLStringUtil::replaceString(translation, "
", ""); // strip CR
- return true;
+ if (!reader.parse(body, root))
+ {
+ err_msg = reader.getFormatedErrorMessages();
+ return false;
+ }
+
+ if (!root.isArray()) // empty response? should not happen
+ {
+ return false;
+ }
+
+ // Request succeeded, extract translation from the response.
+
+ const Json::Value& data = root[0U];
+ if (!data.isObject()
+ || !data.isMember("detectedLanguage")
+ || !data.isMember("translations"))
+ {
+ return false;
+ }
+
+ const Json::Value& detectedLanguage = data["detectedLanguage"];
+ if (!detectedLanguage.isObject() || !detectedLanguage.isMember("language"))
+ {
+ return false;
+ }
+ detected_lang = detectedLanguage["language"].asString();
+
+ const Json::Value& translations = data["translations"];
+ if (!translations.isArray() || translations.size() == 0)
+ {
+ return false;
+ }
+
+ const Json::Value& first = translations[0U];
+ if (!first.isObject() || !first.isMember("text"))
+ {
+ return false;
+ }
+
+ translation = first["text"].asString();
+
+ return true;
}
// virtual
-bool LLBingTranslationHandler::isConfigured() const
+bool LLAzureTranslationHandler::isConfigured() const
{
- return !getAPIKey().empty();
+ return getAPIKey().isMap();
+}
+
+//static
+std::string LLAzureTranslationHandler::parseErrorResponse(
+ const std::string& body)
+{
+ // Expected: "{\"error\":{\"code\":400000,\"message\":\"One of the request inputs is not valid.\"}}"
+ // But for now just verify response is a valid json with an error
+
+ Json::Value root;
+ Json::Reader reader;
+
+ if (!reader.parse(body, root))
+ {
+ return std::string();
+ }
+
+ if (!root.isObject() || !root.isMember("error"))
+ {
+ return std::string();
+ }
+
+ const Json::Value& error_map = root["error"];
+
+ if (!error_map.isObject() || !error_map.isMember("message"))
+ {
+ return std::string();
+ }
+
+ return error_map["message"].asString();
}
// static
-std::string LLBingTranslationHandler::getAPIKey()
+LLSD LLAzureTranslationHandler::getAPIKey()
{
- return gSavedSettings.getString("BingTranslateAPIKey");
+ static LLCachedControl azure_key(gSavedSettings, "AzureTranslateAPIKey");
+ return azure_key;
}
// static
-std::string LLBingTranslationHandler::getAPILanguageCode(const std::string& lang)
+std::string LLAzureTranslationHandler::getAPILanguageCode(const std::string& lang)
{
return lang == "zh" ? "zh-CHT" : lang; // treat Chinese as Traditional Chinese
}
/*virtual*/
-void LLBingTranslationHandler::verifyKey(const std::string &key, LLTranslate::KeyVerificationResult_fn fnc)
+void LLAzureTranslationHandler::verifyKey(const LLSD &key, LLTranslate::KeyVerificationResult_fn fnc)
{
- LLCoros::instance().launch("Bing /Verify Key", boost::bind(&LLTranslationAPIHandler::verifyKeyCoro,
- this, LLTranslate::SERVICE_BING, key, fnc));
+ LLCoros::instance().launch("Azure /Verify Key", boost::bind(&LLTranslationAPIHandler::verifyKeyCoro,
+ this, LLTranslate::SERVICE_AZURE, key, fnc));
+}
+/*virtual*/
+void LLAzureTranslationHandler::initHttpHeader(
+ LLCore::HttpHeaders::ptr_t headers,
+ const std::string& user_agent) const
+{
+ initHttpHeader(headers, user_agent, getAPIKey());
+}
+
+/*virtual*/
+void LLAzureTranslationHandler::initHttpHeader(
+ LLCore::HttpHeaders::ptr_t headers,
+ const std::string& user_agent,
+ const LLSD &key) const
+{
+ headers->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_JSON);
+ headers->append(HTTP_OUT_HEADER_USER_AGENT, user_agent);
+
+ if (key.has("id"))
+ {
+ // Token based autorization
+ headers->append("Ocp-Apim-Subscription-Key", key["id"].asString());
+ }
+ if (key.has("region"))
+ {
+ // ex: "westeurope"
+ headers->append("Ocp-Apim-Subscription-Region", key["region"].asString());
+ }
+}
+
+LLSD LLAzureTranslationHandler::sendMessageAndSuspend(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t adapter,
+ LLCore::HttpRequest::ptr_t request,
+ LLCore::HttpOptions::ptr_t options,
+ LLCore::HttpHeaders::ptr_t headers,
+ const std::string & url,
+ const std::string & msg,
+ const std::string& from_lang,
+ const std::string& to_lang) const
+{
+ LLCore::BufferArray::ptr_t rawbody(new LLCore::BufferArray);
+ LLCore::BufferArrayStream outs(rawbody.get());
+ outs << "[{\"text\":\"";
+ outs << msg;
+ outs << "\"}]";
+
+ return adapter->postRawAndSuspend(request, url, rawbody, options, headers);
+}
+
+LLSD LLAzureTranslationHandler::verifyAndSuspend(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t adapter,
+ LLCore::HttpRequest::ptr_t request,
+ LLCore::HttpOptions::ptr_t options,
+ LLCore::HttpHeaders::ptr_t headers,
+ const std::string & url) const
+{
+ LLCore::BufferArray::ptr_t rawbody(new LLCore::BufferArray);
+ LLCore::BufferArrayStream outs(rawbody.get());
+ outs << "[{\"intentionally_invalid_400\"}]";
+
+ return adapter->postRawAndSuspend(request, url, rawbody, options, headers);
+}
+
+//=========================================================================
+/// DeepL Translator API handler.
+class LLDeepLTranslationHandler: public LLTranslationAPIHandler
+{
+ LOG_CLASS(LLDeepLTranslationHandler);
+
+public:
+ std::string getTranslateURL(
+ const std::string& from_lang,
+ const std::string& to_lang,
+ const std::string& text) const override;
+ std::string getKeyVerificationURL(
+ const LLSD& key) const override;
+ bool checkVerificationResponse(
+ const LLSD& response,
+ int status) const override;
+ bool parseResponse(
+ const LLSD& http_response,
+ int& status,
+ const std::string& body,
+ std::string& translation,
+ std::string& detected_lang,
+ std::string& err_msg) const override;
+ bool isConfigured() const override;
+
+ LLTranslate::EService getCurrentService() override
+ {
+ return LLTranslate::EService::SERVICE_DEEPL;
+ }
+
+ void verifyKey(const LLSD& key, LLTranslate::KeyVerificationResult_fn fnc) override;
+
+ void initHttpHeader(LLCore::HttpHeaders::ptr_t headers, const std::string& user_agent) const override;
+ void initHttpHeader(LLCore::HttpHeaders::ptr_t headers, const std::string& user_agent, const LLSD& key) const override;
+ LLSD sendMessageAndSuspend(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t adapter,
+ LLCore::HttpRequest::ptr_t request,
+ LLCore::HttpOptions::ptr_t options,
+ LLCore::HttpHeaders::ptr_t headers,
+ const std::string& url,
+ const std::string& msg,
+ const std::string& from_lang,
+ const std::string& to_lang) const override;
+
+ LLSD verifyAndSuspend(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t adapter,
+ LLCore::HttpRequest::ptr_t request,
+ LLCore::HttpOptions::ptr_t options,
+ LLCore::HttpHeaders::ptr_t headers,
+ const std::string& url) const override;
+private:
+ static std::string parseErrorResponse(
+ const std::string& body);
+ static LLSD getAPIKey();
+ static std::string getAPILanguageCode(const std::string& lang);
+};
+
+//-------------------------------------------------------------------------
+// virtual
+std::string LLDeepLTranslationHandler::getTranslateURL(
+ const std::string& from_lang,
+ const std::string& to_lang,
+ const std::string& text) const
+{
+ std::string url;
+ LLSD key = getAPIKey();
+ if (key.isMap())
+ {
+ url = key["domain"].asString();
+
+ if (*url.rbegin() != '/')
+ {
+ url += "/";
+ }
+ url += std::string("v2/translate");
+ }
+ return url;
+}
+
+
+// virtual
+std::string LLDeepLTranslationHandler::getKeyVerificationURL(
+ const LLSD& key) const
+{
+ std::string url;
+ if (key.isMap())
+ {
+ url = key["domain"].asString();
+
+ if (*url.rbegin() != '/')
+ {
+ url += "/";
+ }
+ url += std::string("v2/translate");
+ }
+ return url;
+}
+
+//virtual
+bool LLDeepLTranslationHandler::checkVerificationResponse(
+ const LLSD& response,
+ int status) const
+{
+ // Might need to parse body to make sure we got
+ // a valid response and not a message
+ return status == HTTP_OK;
+}
+
+// virtual
+bool LLDeepLTranslationHandler::parseResponse(
+ const LLSD& http_response,
+ int& status,
+ const std::string& body,
+ std::string& translation,
+ std::string& detected_lang,
+ std::string& err_msg) const
+{
+ if (status != HTTP_OK)
+ {
+ if (http_response.has("error_body"))
+ err_msg = parseErrorResponse(http_response["error_body"].asString());
+ return false;
+ }
+
+ //Example:
+ // "{\"translations\":[{\"detected_source_language\":\"EN\",\"text\":\"test\"}]}"
+
+ Json::Value root;
+ Json::Reader reader;
+
+ if (!reader.parse(body, root))
+ {
+ err_msg = reader.getFormatedErrorMessages();
+ return false;
+ }
+
+ if (!root.isObject()
+ || !root.isMember("translations")) // empty response? should not happen
+ {
+ return false;
+ }
+
+ // Request succeeded, extract translation from the response.
+ const Json::Value& translations = root["translations"];
+ if (!translations.isArray() || translations.size() == 0)
+ {
+ return false;
+ }
+
+ const Json::Value& data= translations[0U];
+ if (!data.isObject()
+ || !data.isMember("detected_source_language")
+ || !data.isMember("text"))
+ {
+ return false;
+ }
+
+ detected_lang = data["detected_source_language"].asString();
+ LLStringUtil::toLower(detected_lang);
+ translation = data["text"].asString();
+
+ return true;
+}
+
+// virtual
+bool LLDeepLTranslationHandler::isConfigured() const
+{
+ return getAPIKey().isMap();
+}
+
+//static
+std::string LLDeepLTranslationHandler::parseErrorResponse(
+ const std::string& body)
+{
+ // Example: "{\"message\":\"One of the request inputs is not valid.\"}"
+
+ Json::Value root;
+ Json::Reader reader;
+
+ if (!reader.parse(body, root))
+ {
+ return std::string();
+ }
+
+ if (!root.isObject() || !root.isMember("message"))
+ {
+ return std::string();
+ }
+
+ return root["message"].asString();
+}
+
+// static
+LLSD LLDeepLTranslationHandler::getAPIKey()
+{
+ static LLCachedControl deepl_key(gSavedSettings, "DeepLTranslateAPIKey");
+ return deepl_key;
+}
+
+// static
+std::string LLDeepLTranslationHandler::getAPILanguageCode(const std::string& lang)
+{
+ return lang == "zh" ? "zh-CHT" : lang; // treat Chinese as Traditional Chinese
+}
+
+/*virtual*/
+void LLDeepLTranslationHandler::verifyKey(const LLSD& key, LLTranslate::KeyVerificationResult_fn fnc)
+{
+ LLCoros::instance().launch("DeepL /Verify Key", boost::bind(&LLTranslationAPIHandler::verifyKeyCoro,
+ this, LLTranslate::SERVICE_DEEPL, key, fnc));
+}
+/*virtual*/
+void LLDeepLTranslationHandler::initHttpHeader(
+ LLCore::HttpHeaders::ptr_t headers,
+ const std::string& user_agent) const
+{
+ initHttpHeader(headers, user_agent, getAPIKey());
+}
+
+/*virtual*/
+void LLDeepLTranslationHandler::initHttpHeader(
+ LLCore::HttpHeaders::ptr_t headers,
+ const std::string& user_agent,
+ const LLSD& key) const
+{
+ headers->append(HTTP_OUT_HEADER_CONTENT_TYPE, "application/x-www-form-urlencoded");
+ headers->append(HTTP_OUT_HEADER_USER_AGENT, user_agent);
+
+ if (key.has("id"))
+ {
+ std::string authkey = "DeepL-Auth-Key " + key["id"].asString();
+ headers->append(HTTP_OUT_HEADER_AUTHORIZATION, authkey);
+ }
+}
+
+LLSD LLDeepLTranslationHandler::sendMessageAndSuspend(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t adapter,
+ LLCore::HttpRequest::ptr_t request,
+ LLCore::HttpOptions::ptr_t options,
+ LLCore::HttpHeaders::ptr_t headers,
+ const std::string& url,
+ const std::string& msg,
+ const std::string& from_lang,
+ const std::string& to_lang) const
+{
+ LLCore::BufferArray::ptr_t rawbody(new LLCore::BufferArray);
+ LLCore::BufferArrayStream outs(rawbody.get());
+ outs << "text=";
+ std::string escaped_string = LLURI::escape(msg);
+ outs << escaped_string;
+ outs << "&target_lang=";
+ std::string lang = to_lang;
+ LLStringUtil::toUpper(lang);
+ outs << lang;
+
+ return adapter->postRawAndSuspend(request, url, rawbody, options, headers);
+}
+
+LLSD LLDeepLTranslationHandler::verifyAndSuspend(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t adapter,
+ LLCore::HttpRequest::ptr_t request,
+ LLCore::HttpOptions::ptr_t options,
+ LLCore::HttpHeaders::ptr_t headers,
+ const std::string& url) const
+{
+ LLCore::BufferArray::ptr_t rawbody(new LLCore::BufferArray);
+ LLCore::BufferArrayStream outs(rawbody.get());
+ outs << "text=&target_lang=EN";
+
+ return adapter->postRawAndSuspend(request, url, rawbody, options, headers);
}
//=========================================================================
@@ -569,58 +1140,78 @@ void LLTranslate::translateMessage(const std::string &from_lang, const std::stri
std::string LLTranslate::addNoTranslateTags(std::string mesg)
{
- if (getPreferredHandler().getCurrentService() != SERVICE_BING)
+ if (getPreferredHandler().getCurrentService() == SERVICE_GOOGLE)
{
return mesg;
}
- std::string upd_msg(mesg);
- LLUrlMatch match;
- S32 dif = 0;
- //surround all links (including SLURLs) with 'no-translate' tags to prevent unnecessary translation
- while (LLUrlRegistry::instance().findUrl(mesg, match))
+ if (getPreferredHandler().getCurrentService() == SERVICE_DEEPL)
{
- upd_msg.insert(dif + match.getStart(), BING_NOTRANSLATE_OPENING_TAG);
- upd_msg.insert(dif + BING_NOTRANSLATE_OPENING_TAG.size() + match.getEnd() + 1, BING_NOTRANSLATE_CLOSING_TAG);
- mesg.erase(match.getStart(), match.getEnd() - match.getStart());
- dif += match.getEnd() - match.getStart() + BING_NOTRANSLATE_OPENING_TAG.size() + BING_NOTRANSLATE_CLOSING_TAG.size();
+ return mesg;
}
- return upd_msg;
+
+ if (getPreferredHandler().getCurrentService() == SERVICE_AZURE)
+ {
+ // https://learn.microsoft.com/en-us/azure/cognitive-services/translator/prevent-translation
+ std::string upd_msg(mesg);
+ LLUrlMatch match;
+ S32 dif = 0;
+ //surround all links (including SLURLs) with 'no-translate' tags to prevent unnecessary translation
+ while (LLUrlRegistry::instance().findUrl(mesg, match))
+ {
+ upd_msg.insert(dif + match.getStart(), AZURE_NOTRANSLATE_OPENING_TAG);
+ upd_msg.insert(dif + AZURE_NOTRANSLATE_OPENING_TAG.size() + match.getEnd() + 1, AZURE_NOTRANSLATE_CLOSING_TAG);
+ mesg.erase(match.getStart(), match.getEnd() - match.getStart());
+ dif += match.getEnd() - match.getStart() + AZURE_NOTRANSLATE_OPENING_TAG.size() + AZURE_NOTRANSLATE_CLOSING_TAG.size();
+ }
+ return upd_msg;
+ }
+ return mesg;
}
std::string LLTranslate::removeNoTranslateTags(std::string mesg)
{
- if (getPreferredHandler().getCurrentService() != SERVICE_BING)
+ if (getPreferredHandler().getCurrentService() == SERVICE_GOOGLE)
{
return mesg;
}
- std::string upd_msg(mesg);
- LLUrlMatch match;
- S32 opening_tag_size = BING_NOTRANSLATE_OPENING_TAG.size();
- S32 closing_tag_size = BING_NOTRANSLATE_CLOSING_TAG.size();
- S32 dif = 0;
- //remove 'no-translate' tags we added to the links before
- while (LLUrlRegistry::instance().findUrl(mesg, match))
+ if (getPreferredHandler().getCurrentService() == SERVICE_DEEPL)
{
- if (upd_msg.substr(dif + match.getStart() - opening_tag_size, opening_tag_size) == BING_NOTRANSLATE_OPENING_TAG)
- {
- upd_msg.erase(dif + match.getStart() - opening_tag_size, opening_tag_size);
- dif -= opening_tag_size;
-
- if (upd_msg.substr(dif + match.getEnd() + 1, closing_tag_size) == BING_NOTRANSLATE_CLOSING_TAG)
- {
- upd_msg.replace(dif + match.getEnd() + 1, closing_tag_size, " ");
- dif -= closing_tag_size - 1;
- }
- }
- mesg.erase(match.getStart(), match.getUrl().size());
- dif += match.getUrl().size();
+ return mesg;
}
- return upd_msg;
+
+ if (getPreferredHandler().getCurrentService() == SERVICE_AZURE)
+ {
+ std::string upd_msg(mesg);
+ LLUrlMatch match;
+ S32 opening_tag_size = AZURE_NOTRANSLATE_OPENING_TAG.size();
+ S32 closing_tag_size = AZURE_NOTRANSLATE_CLOSING_TAG.size();
+ S32 dif = 0;
+ //remove 'no-translate' tags we added to the links before
+ while (LLUrlRegistry::instance().findUrl(mesg, match))
+ {
+ if (upd_msg.substr(dif + match.getStart() - opening_tag_size, opening_tag_size) == AZURE_NOTRANSLATE_OPENING_TAG)
+ {
+ upd_msg.erase(dif + match.getStart() - opening_tag_size, opening_tag_size);
+ dif -= opening_tag_size;
+
+ if (upd_msg.substr(dif + match.getEnd() + 1, closing_tag_size) == AZURE_NOTRANSLATE_CLOSING_TAG)
+ {
+ upd_msg.replace(dif + match.getEnd() + 1, closing_tag_size, " ");
+ dif -= closing_tag_size - 1;
+ }
+ }
+ mesg.erase(match.getStart(), match.getUrl().size());
+ dif += match.getUrl().size();
+ }
+ return upd_msg;
+ }
+
+ return mesg;
}
/*static*/
-void LLTranslate::verifyKey(EService service, const std::string &key, KeyVerificationResult_fn fnc)
+void LLTranslate::verifyKey(EService service, const LLSD &key, KeyVerificationResult_fn fnc)
{
LLTranslationAPIHandler& handler = getHandler(service);
@@ -686,13 +1277,21 @@ LLSD LLTranslate::asLLSD() const
// static
LLTranslationAPIHandler& LLTranslate::getPreferredHandler()
{
- EService service = SERVICE_BING;
+ EService service = SERVICE_AZURE;
std::string service_str = gSavedSettings.getString("TranslationService");
if (service_str == "google")
{
service = SERVICE_GOOGLE;
}
+ if (service_str == "azure")
+ {
+ service = SERVICE_AZURE;
+ }
+ if (service_str == "deepl")
+ {
+ service = SERVICE_DEEPL;
+ }
return getHandler(service);
}
@@ -701,12 +1300,19 @@ LLTranslationAPIHandler& LLTranslate::getPreferredHandler()
LLTranslationAPIHandler& LLTranslate::getHandler(EService service)
{
static LLGoogleTranslationHandler google;
- static LLBingTranslationHandler bing;
+ static LLAzureTranslationHandler azure;
+ static LLDeepLTranslationHandler deepl;
- if (service == SERVICE_GOOGLE)
- {
- return google;
- }
+ switch (service)
+ {
+ case SERVICE_AZURE:
+ return azure;
+ case SERVICE_GOOGLE:
+ return google;
+ case SERVICE_DEEPL:
+ return deepl;
+ }
+
+ return azure;
- return bing;
}
diff --git a/indra/newview/lltranslate.h b/indra/newview/lltranslate.h
index 58707e2d36..4a5d80737c 100644
--- a/indra/newview/lltranslate.h
+++ b/indra/newview/lltranslate.h
@@ -59,11 +59,12 @@ class LLTranslate: public LLSingleton
public :
typedef enum e_service {
- SERVICE_BING,
+ SERVICE_AZURE,
SERVICE_GOOGLE,
+ SERVICE_DEEPL,
} EService;
- typedef boost::function KeyVerificationResult_fn;
+ typedef boost::function KeyVerificationResult_fn;
typedef boost::function TranslationSuccess_fn;
typedef boost::function TranslationFailure_fn;
@@ -78,12 +79,12 @@ public :
static void translateMessage(const std::string &from_lang, const std::string &to_lang, const std::string &mesg, TranslationSuccess_fn success, TranslationFailure_fn failure);
/**
- * Verify given API key of a translation service.
- *
- * @param receiver Object to pass verification result to.
- * @param key Key to verify.
- */
- static void verifyKey(EService service, const std::string &key, KeyVerificationResult_fn fnc);
+ * Verify given API key of a translation service.
+ *
+ * @param receiver Object to pass verification result to.
+ * @param key Key to verify.
+ */
+ static void verifyKey(EService service, const LLSD &key, KeyVerificationResult_fn fnc);
/**
* @return translation target language
diff --git a/indra/newview/llviewerinput.cpp b/indra/newview/llviewerinput.cpp
index df68909ffc..430fd1a86a 100644
--- a/indra/newview/llviewerinput.cpp
+++ b/indra/newview/llviewerinput.cpp
@@ -1690,7 +1690,8 @@ bool LLViewerInput::scanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level)
BOOL LLViewerInput::handleMouse(LLWindow *window_impl, LLCoordGL pos, MASK mask, EMouseClickType clicktype, BOOL down)
{
- BOOL handled = gViewerWindow->handleAnyMouseClick(window_impl, pos, mask, clicktype, down);
+ bool is_toolmgr_action = false;
+ BOOL handled = gViewerWindow->handleAnyMouseClick(window_impl, pos, mask, clicktype, down, is_toolmgr_action);
if (clicktype != CLICK_NONE)
{
@@ -1709,7 +1710,7 @@ BOOL LLViewerInput::handleMouse(LLWindow *window_impl, LLCoordGL pos, MASK mask,
// If the first LMB click is handled by the menu, skip the following double click
static bool skip_double_click = false;
- if (clicktype == CLICK_LEFT && down )
+ if (clicktype == CLICK_LEFT && down && !is_toolmgr_action)
{
skip_double_click = handled;
}
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index d2123a5e11..091fa42d6e 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -107,7 +107,7 @@
const S32 MAX_CAP_REQUEST_ATTEMPTS = 30;
const U32 DEFAULT_MAX_REGION_WIDE_PRIM_COUNT = 15000;
-BOOL LLViewerRegion::sFSAreaSearchActive = FALSE;
+bool LLViewerRegion::sFSAreaSearchActive = false; // FIRE-32688 Area Search improvements
BOOL LLViewerRegion::sVOCacheCullingEnabled = FALSE;
S32 LLViewerRegion::sLastCameraUpdated = 0;
S32 LLViewerRegion::sNewObjectCreationThrottle = -1;
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 70b1abf1ae..8b6be234b4 100644
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -490,7 +490,7 @@ public:
std::vector mMapAvatars;
std::vector mMapAvatarIDs;
- static BOOL sFSAreaSearchActive; // FIRE-32688 Area Search improvements
+ static bool sFSAreaSearchActive; // FIRE-32688 Area Search improvements
static BOOL sVOCacheCullingEnabled; //vo cache culling enabled or not.
static S32 sLastCameraUpdated;
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 608872db4f..72be049aa3 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -228,6 +228,8 @@ void LLViewerTextureList::doPrefetchImages()
LLViewerTextureManager::getFetchedTexture(IMG_SHOT);
LLViewerTextureManager::getFetchedTexture(IMG_SMOKE_POOF);
+ LLViewerFetchedTexture::sSmokeImagep = LLViewerTextureManager::getFetchedTexture(IMG_SMOKE, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI);
+ LLViewerFetchedTexture::sSmokeImagep->setNoDelete();
LLStandardBumpmap::addstandard();
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 7f455d31b8..3e2cab3ba6 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1099,7 +1099,7 @@ void LLViewerWindow::handlePieMenu(S32 x, S32 y, MASK mask)
}
}
-BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mask, EMouseClickType clicktype, BOOL down)
+BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mask, EMouseClickType clicktype, BOOL down, bool& is_toolmgr_action)
{
const char* buttonname = "";
const char* buttonstatestr = "";
@@ -1248,6 +1248,7 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK m
if(!gDisconnected && LLToolMgr::getInstance()->getCurrentTool()->handleAnyMouseClick( x, y, mask, clicktype, down ) )
{
LLViewerEventRecorder::instance().clear_xui();
+ is_toolmgr_action = true;
return TRUE;
}
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index e15df41161..c49570ef7f 100644
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -182,7 +182,7 @@ public:
void reshapeStatusBarContainer();
- BOOL handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mask, EMouseClickType clicktype, BOOL down);
+ BOOL handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mask, EMouseClickType clicktype, BOOL down, bool &is_toolmgr_action);
//
// LLWindowCallback interface implementation
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index b7e9c216a6..7f9ca41925 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -276,13 +276,13 @@ static void killGateway()
///////////////////////////////////////////////////////////////////////////////////////////////
bool LLVivoxVoiceClient::sShuttingDown = false;
+bool LLVivoxVoiceClient::sConnected = false;
+LLPumpIO *LLVivoxVoiceClient::sPump = nullptr;
LLVivoxVoiceClient::LLVivoxVoiceClient() :
mSessionTerminateRequested(false),
mRelogRequested(false),
- mConnected(false),
mTerminateDaemon(false),
- mPump(NULL),
mSpatialJoiningNum(0),
mTuningMode(false),
@@ -351,7 +351,11 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() :
mIsProcessingChannels(false),
mIsCoroutineActive(false),
mVivoxPump("vivoxClientPump")
-{
+{
+ sShuttingDown = false;
+ sConnected = false;
+ sPump = nullptr;
+
mSpeakerVolume = scale_speaker_volume(0);
mVoiceVersion.serverVersion = "";
@@ -393,7 +397,7 @@ LLVivoxVoiceClient::~LLVivoxVoiceClient()
void LLVivoxVoiceClient::init(LLPumpIO *pump)
{
// constructor will set up LLVoiceClient::getInstance()
- mPump = pump;
+ sPump = pump;
// LLCoros::instance().launch("LLVivoxVoiceClient::voiceControlCoro",
// boost::bind(&LLVivoxVoiceClient::voiceControlCoro, LLVivoxVoiceClient::getInstance()));
@@ -414,10 +418,10 @@ void LLVivoxVoiceClient::terminate()
logoutOfVivox(false);
}
- if(mConnected)
+ if(sConnected)
{
breakVoiceConnection(false);
- mConnected = false;
+ sConnected = false;
}
else
{
@@ -426,7 +430,7 @@ void LLVivoxVoiceClient::terminate()
}
sShuttingDown = true;
- mPump = NULL;
+ sPump = NULL;
// Delete useless Vivox logs on logout
if (gSavedSettings.getString("VivoxDebugLevel") == "0")
@@ -482,7 +486,7 @@ bool LLVivoxVoiceClient::writeString(const std::string &str)
bool result = false;
LL_DEBUGS("LowVoice") << "sending:\n" << str << LL_ENDL;
- if(mConnected)
+ if(sConnected)
{
apr_status_t err;
apr_size_t size = (apr_size_t)str.size();
@@ -1167,7 +1171,7 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
int retryCount(0);
LLVoiceVivoxStats::getInstance()->reset();
- while (!mConnected && !sShuttingDown && retryCount++ <= DAEMON_CONNECT_RETRY_MAX)
+ while (!sConnected && !sShuttingDown && retryCount++ <= DAEMON_CONNECT_RETRY_MAX)
{
LLVoiceVivoxStats::getInstance()->connectionAttemptStart();
LL_DEBUGS("Voice") << "Attempting to connect to vivox daemon: " << mDaemonHost << LL_ENDL;
@@ -1177,23 +1181,23 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
mSocket = LLSocket::create(gAPRPoolp, LLSocket::STREAM_TCP);
}
- mConnected = mSocket->blockingConnect(mDaemonHost);
- LLVoiceVivoxStats::getInstance()->connectionAttemptEnd(mConnected);
- if (!mConnected)
+ sConnected = mSocket->blockingConnect(mDaemonHost);
+ LLVoiceVivoxStats::getInstance()->connectionAttemptEnd(sConnected);
+ if (!sConnected)
{
llcoro::suspendUntilTimeout(DAEMON_CONNECT_THROTTLE_SECONDS);
}
}
//---------------------------------------------------------------------
- if (sShuttingDown && !mConnected)
+ if (sShuttingDown && !sConnected)
{
return false;
}
llcoro::suspendUntilTimeout(UPDATE_THROTTLE_SECONDS);
- while (!mPump && !sShuttingDown)
+ while (!sPump && !sShuttingDown)
{ // Can't use the pump until we have it available.
llcoro::suspend();
}
@@ -1215,7 +1219,7 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
readChain.push_back(LLIOPipe::ptr_t(new LLVivoxProtocolParser()));
- mPump->addChain(readChain, NEVER_CHAIN_EXPIRY_SECS);
+ sPump->addChain(readChain, NEVER_CHAIN_EXPIRY_SECS);
//---------------------------------------------------------------------
@@ -1437,9 +1441,9 @@ bool LLVivoxVoiceClient::breakVoiceConnection(bool corowait)
// the message, yet we need to receive "connector shutdown response".
// Either wait a bit and emulate it or check gMessageSystem for specific message
_sleep(1000);
- if (mConnected)
+ if (sConnected)
{
- mConnected = false;
+ sConnected = false;
LLSD vivoxevent(LLSDMap("connector", LLSD::Boolean(false)));
mVivoxPump.post(vivoxevent);
}
@@ -1451,7 +1455,7 @@ bool LLVivoxVoiceClient::breakVoiceConnection(bool corowait)
LL_DEBUGS("Voice") << "closing SLVoice socket" << LL_ENDL;
closeSocket(); // Need to do this now -- bad things happen if the destructor does it later.
cleanUp();
- mConnected = false;
+ sConnected = false;
return retval;
}
@@ -2637,7 +2641,7 @@ bool LLVivoxVoiceClient::performMicTuning()
void LLVivoxVoiceClient::closeSocket(void)
{
mSocket.reset();
- mConnected = false;
+ sConnected = false;
mConnectorEstablished = false;
mAccountLoggedIn = false;
}
@@ -3144,7 +3148,7 @@ bool LLVivoxVoiceClient::deviceSettingsAvailable()
{
bool result = true;
- if(!mConnected)
+ if(!sConnected)
result = false;
if(mRenderDevices.empty())
@@ -3973,7 +3977,7 @@ void LLVivoxVoiceClient::connectorShutdownResponse(int statusCode, std::string &
// Should this ever fail? do we care if it does?
}
- mConnected = false;
+ sConnected = false;
mShutdownComplete = true;
LLSD vivoxevent(LLSDMap("connector", LLSD::Boolean(false)));
@@ -7568,7 +7572,7 @@ LLIOPipe::EStatus LLVivoxProtocolParser::process_impl(
LL_DEBUGS("VivoxProtocolParser") << "at end, mInput is: " << mInput << LL_ENDL;
- if(!LLVivoxVoiceClient::getInstance()->mConnected)
+ if(!LLVivoxVoiceClient::sConnected)
{
// If voice has been disabled, we just want to close the socket. This does so.
LL_INFOS("Voice") << "returning STATUS_STOP" << LL_ENDL;
diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h
index 2097b71192..19725849f8 100644
--- a/indra/newview/llvoicevivox.h
+++ b/indra/newview/llvoicevivox.h
@@ -676,12 +676,10 @@ private:
LLHost mDaemonHost;
LLSocket::ptr_t mSocket;
- bool mConnected;
// We should kill the voice daemon in case of connection alert
bool mTerminateDaemon;
- LLPumpIO *mPump;
friend class LLVivoxProtocolParser;
std::string mAccountName;
@@ -930,7 +928,10 @@ private:
bool mIsProcessingChannels;
bool mIsCoroutineActive;
- static bool sShuttingDown; // corutines can last longer than vivox so we need a static variable as a shutdown flag
+ // This variables can last longer than vivox in coroutines so we need them as static
+ static bool sShuttingDown;
+ static bool sConnected;
+ static LLPumpIO* sPump;
LLEventMailDrop mVivoxPump;
};
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 3f3f4c3d57..5a25fda4b5 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -5602,13 +5602,14 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
if (mat)
{
+ BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) || (facep->getTextureEntry()->getColor().mV[3] < 0.999f) ? TRUE : FALSE;
if (type == LLRenderPass::PASS_ALPHA)
{
- shader_mask = mat->getShaderMask(LLMaterial::DIFFUSE_ALPHA_MODE_BLEND);
+ shader_mask = mat->getShaderMask(LLMaterial::DIFFUSE_ALPHA_MODE_BLEND, is_alpha);
}
else
{
- shader_mask = mat->getShaderMask();
+ shader_mask = mat->getShaderMask(LLMaterial::DIFFUSE_ALPHA_MODE_DEFAULT, is_alpha);
}
}
@@ -6146,18 +6147,23 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
}
else
{
- // Even more crash avoidance ...
- // if (te->getColor().mV[3] > 0.f || te->getGlow() > 0.f)
- if (te && (te->getColor().mV[3] > 0.f || te->getGlow() > 0.f))
- //
- { //only treat as alpha in the pipeline if < 100% transparent
- drawablep->setState(LLDrawable::HAS_ALPHA);
- add_face(sAlphaFaces, alpha_count, facep);
- }
- else if (LLDrawPoolAlpha::sShowDebugAlpha)
- {
- add_face(sAlphaFaces, alpha_count, facep);
- }
+ // Even more crash avoidance ...
+ //if (te->getColor().mV[3] > 0.f || te->getGlow() > 0.f)
+ if (te && (te->getColor().mV[3] > 0.f || te->getGlow() > 0.f))
+ //
+ { //only treat as alpha in the pipeline if < 100% transparent
+ drawablep->setState(LLDrawable::HAS_ALPHA);
+ add_face(sAlphaFaces, alpha_count, facep);
+ }
+ else if (LLDrawPoolAlpha::sShowDebugAlpha ||
+ (gPipeline.sRenderHighlight && !drawablep->getParent() &&
+ //only root objects are highlighted with red color in this case
+ drawablep->getVObj() && drawablep->getVObj()->flagScripted() &&
+ (LLPipeline::getRenderScriptedBeacons() ||
+ (LLPipeline::getRenderScriptedTouchBeacons() && drawablep->getVObj()->flagHandleTouch()))))
+ { //draw the transparent face for debugging purposes using a custom texture
+ add_face(sAlphaFaces, alpha_count, facep);
+ }
}
}
else
@@ -6920,7 +6926,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
{ // HACK - this should never happen, but sometimes we get a material that thinks it has alpha blending when it ought not
alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
}
- U32 mask = mat->getShaderMask(alpha_mode);
+ U32 mask = mat->getShaderMask(alpha_mode, is_alpha);
U32 vb_mask = facep->getVertexBuffer()->getTypeMask();
diff --git a/indra/newview/skins/default/textures/icons/profile_badge_beta.png b/indra/newview/skins/default/textures/icons/profile_badge_beta.png
new file mode 100644
index 0000000000..7c8a723c47
Binary files /dev/null and b/indra/newview/skins/default/textures/icons/profile_badge_beta.png differ
diff --git a/indra/newview/skins/default/textures/icons/profile_badge_beta_lifetime.png b/indra/newview/skins/default/textures/icons/profile_badge_beta_lifetime.png
new file mode 100644
index 0000000000..7c38e9e2ae
Binary files /dev/null and b/indra/newview/skins/default/textures/icons/profile_badge_beta_lifetime.png differ
diff --git a/indra/newview/skins/default/textures/icons/profile_badge_lifetime.png b/indra/newview/skins/default/textures/icons/profile_badge_lifetime.png
new file mode 100644
index 0000000000..475edd080e
Binary files /dev/null and b/indra/newview/skins/default/textures/icons/profile_badge_lifetime.png differ
diff --git a/indra/newview/skins/default/textures/icons/profile_badge_linden.png b/indra/newview/skins/default/textures/icons/profile_badge_linden.png
new file mode 100644
index 0000000000..1b6ac03e86
Binary files /dev/null and b/indra/newview/skins/default/textures/icons/profile_badge_linden.png differ
diff --git a/indra/newview/skins/default/textures/icons/profile_badge_pplus_lifetime.png b/indra/newview/skins/default/textures/icons/profile_badge_pplus_lifetime.png
new file mode 100644
index 0000000000..4286995202
Binary files /dev/null and b/indra/newview/skins/default/textures/icons/profile_badge_pplus_lifetime.png differ
diff --git a/indra/newview/skins/default/textures/icons/profile_badge_premium_lifetime.png b/indra/newview/skins/default/textures/icons/profile_badge_premium_lifetime.png
new file mode 100644
index 0000000000..47e93c4fac
Binary files /dev/null and b/indra/newview/skins/default/textures/icons/profile_badge_premium_lifetime.png differ
diff --git a/indra/newview/skins/default/textures/icons/profile_badge_team.png b/indra/newview/skins/default/textures/icons/profile_badge_team.png
new file mode 100644
index 0000000000..4af3c54366
Binary files /dev/null and b/indra/newview/skins/default/textures/icons/profile_badge_team.png differ
diff --git a/indra/newview/skins/default/textures/icons/radar_b.png b/indra/newview/skins/default/textures/icons/radar_b.png
new file mode 100644
index 0000000000..df91915f76
Binary files /dev/null and b/indra/newview/skins/default/textures/icons/radar_b.png differ
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 0077d7ad33..449a58945a 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -608,7 +608,14 @@ with the same filename but different name
-
+
+
+
+
+
+
+
+
diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml
index dae4b58038..abb6811dee 100644
--- a/indra/newview/skins/default/xui/de/notifications.xml
+++ b/indra/newview/skins/default/xui/de/notifications.xml
@@ -2598,6 +2598,9 @@ Möchten Sie den Nicht-stören-Modus deaktivieren, bevor Sie diese Transaktion a
Ihr Papierkorb läuft über. Dies kann zu Anmeldeproblemen führen.
+
+ Es gibt Probleme mit Ihrem Inventar. Bitte kontaktieren Sie den Support Ihres Grids.
+
Sind Sie sicher, dass Sie Ihren Reise-, Internet- und Suchverlauf löschen möchten?
diff --git a/indra/newview/skins/default/xui/de/panel_profile_secondlife.xml b/indra/newview/skins/default/xui/de/panel_profile_secondlife.xml
index 28f7b3abdd..bddfde5a7c 100644
--- a/indra/newview/skins/default/xui/de/panel_profile_secondlife.xml
+++ b/indra/newview/skins/default/xui/de/panel_profile_secondlife.xml
@@ -9,6 +9,20 @@
Unbekannt
+
+
+
+
+
+
+
http://www.secondlife.com/account/billing.php?lang=de
diff --git a/indra/newview/skins/default/xui/en/floater_translation_settings.xml b/indra/newview/skins/default/xui/en/floater_translation_settings.xml
index 9b12552fc4..ba2b1ff270 100644
--- a/indra/newview/skins/default/xui/en/floater_translation_settings.xml
+++ b/indra/newview/skins/default/xui/en/floater_translation_settings.xml
@@ -1,7 +1,7 @@
- Bing appID not verified. Please try again.
- Google API key not verified. Please try again.
+ Azure service identifier not verified. Status: [STATUS]. Please check your settings and try again.
+ Google API key not verified. Status: [STATUS]. Please check your key and try again.
+ DeepL Auth Key key not verified. Status: [STATUS]. Please check your key and try again.
- Bing appID verified.
+ Azure service identifier verified.
Google API key verified.
+ DeepL API key verified.
+ name="azure" />
+ top_pad="115" />
+
+
+ [https://learn.microsoft.com/en-us/azure/cognitive-services/translator/create-translator-resource Setup]
+
+
+
+ Endpoint:
+
+
+
+
+
+
+
+
+
- Bing [http://www.bing.com/developers/createapp.aspx AppID]:
+ Azure Key:
-
+
+ Region:
+
+
+
Google [http://code.google.com/apis/language/translate/v2/getting_started.html#auth API key]:
@@ -209,7 +294,7 @@
left_pad="10"
name="verify_google_api_key_btn"
top_delta="-2"
- width="90" />
+ width="90" />
+
+ Endpoint:
+
+
+
+
+
+
+
+
+ DeepL API key:
+
+
+
+
+
+
+
+ [https://www.deepl.com/pro/select-country?cta=header-prices Pricing]
+
+
+
+Your inventory is experiencing issues. Please contact support of your grid.
+ fail
+
+
+
+
+
+
+
+
+
+
+
@@ -432,22 +455,59 @@
layout="topleft"
follows="left|top|right"
bevel_style="in"/>
-
+ orientation="horizontal">
+
+
+
+
+
+
+
- Nie można zweryfikować Bing appID. Spróbuj ponownie.
+ Nie można zweryfikować ID usługi Azure. Spróbuj ponownie.
Nie można zweryfikować klucza Google API. Spróbuj ponownie.
- Bing appID zweryfikowany.
+ Nie można zweryfikować klucza DeepL. Status: [STATUS]. Spróbuj ponownie.
+ ID usługi Azure zweryfikowany.
Klucz Google API zweryfikowany.
+ Klucz DeepL zweryfikowany.
Tłumacz czat na:
@@ -30,13 +32,28 @@
Usługa tłumacząca:
-
-
+
+ [https://learn.microsoft.com/en-us/azure/cognitive-services/translator/create-translator-resource Wskazówki]
+
+
+ Klucz Azure:
+
+
+
+
[http://code.google.com/apis/language/translate/v2/pricing.html Koszty] | [https://code.google.com/apis/console Statystyki]
+
+ Klucz DeepL:
+
+
+
+
+ [https://www.deepl.com/pro/select-country?cta=header-prices Koszty]
+
diff --git a/indra/newview/skins/default/xui/pl/notifications.xml b/indra/newview/skins/default/xui/pl/notifications.xml
index 7e935ec9f9..a6b71d6c07 100644
--- a/indra/newview/skins/default/xui/pl/notifications.xml
+++ b/indra/newview/skins/default/xui/pl/notifications.xml
@@ -2465,6 +2465,9 @@ Czy chcesz je odtworzyć?
Twój kosz się przepełnia. Może to sprawić, że będziesz mieć problemy z zalogowaniem się.
+
+ W Twojej Szafie występują problemy. Skontaktuj się z pomocą techniczną swojego świata.
+
Na pewno chcesz wyczyścić bufory przeglądarki internetowej, wyszukiwania i podróży?
diff --git a/indra/newview/skins/default/xui/pl/panel_profile_secondlife.xml b/indra/newview/skins/default/xui/pl/panel_profile_secondlife.xml
index 59e836e021..b4fb11d0fe 100644
--- a/indra/newview/skins/default/xui/pl/panel_profile_secondlife.xml
+++ b/indra/newview/skins/default/xui/pl/panel_profile_secondlife.xml
@@ -3,6 +3,13 @@
Nieznane
+
+
+
+
+
+
+
@@ -31,6 +38,11 @@
+
+
+
+
+
diff --git a/indra/newview/skins/default/xui/pt/panel_edit_hair.xml b/indra/newview/skins/default/xui/pt/panel_edit_hair.xml
index 13f1f892f9..e9750a1c2e 100644
--- a/indra/newview/skins/default/xui/pt/panel_edit_hair.xml
+++ b/indra/newview/skins/default/xui/pt/panel_edit_hair.xml
@@ -7,7 +7,7 @@
-
+
diff --git a/indra/newview/skins/vintage/xui/en/panel_profile_secondlife.xml b/indra/newview/skins/vintage/xui/en/panel_profile_secondlife.xml
index dbd4453f99..3a558429a8 100644
--- a/indra/newview/skins/vintage/xui/en/panel_profile_secondlife.xml
+++ b/indra/newview/skins/vintage/xui/en/panel_profile_secondlife.xml
@@ -26,6 +26,30 @@
[PAYMENTINFO]
[FIRESTORM][FSDEV][FSSUPP][FSQA][FSGW]
+
+
+
+
+
+
+
+
+
+
http://www.secondlife.com/account/billing.php?lang=en
@@ -401,9 +425,33 @@
name="info_border_acc_status_text"
bevel_style="in" />
+
+
+
+
+
+
diff --git a/indra/newview/skins/vintage/xui/pl/panel_profile_secondlife.xml b/indra/newview/skins/vintage/xui/pl/panel_profile_secondlife.xml
index ec4705961c..1b410b0ba7 100644
--- a/indra/newview/skins/vintage/xui/pl/panel_profile_secondlife.xml
+++ b/indra/newview/skins/vintage/xui/pl/panel_profile_secondlife.xml
@@ -3,6 +3,13 @@
Nieznane
+
+
+
+
+
+
+