Merge branch 'DRTVWR-573-maint-R' of https://github.com/secondlife/viewer

# Conflicts:
#	indra/cmake/Copy3rdPartyLibs.cmake
#	indra/integration_tests/llui_libtest/CMakeLists.txt
#	indra/newview/CMakeLists.txt
#	indra/newview/llviewermessage.cpp
#	indra/newview/skins/default/xui/en/strings.xml
master
Ansariel 2023-03-21 11:32:38 +01:00
commit 51db156b7c
11 changed files with 106 additions and 6 deletions

View File

@ -58,12 +58,19 @@ if (WINDOWS)
# Copy over OpenJPEG.dll
# *NOTE: On Windows with VS2005, only the first comment prints
set(OPENJPEG_RELEASE
"${ARCH_PREBUILT_DIRS_RELEASE}/openjp2.dll")
"${ARCH_PREBUILT_DIRS_RELEASE}/openjp2.dll")
add_custom_command( TARGET llui_libtest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${OPENJPEG_RELEASE} ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Copying OpenJPEG DLLs to binary directory"
)
COMMENT "Copying OpenJPEG DLLs to binary directory"
)
set(OPENJPEG_DEBUG
"${ARCH_PREBUILT_DIRS_DEBUG}/openjp2.dll")
add_custom_command( TARGET llui_libtest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${OPENJPEG_DEBUG} ${CMAKE_CURRENT_BINARY_DIR}
)
endif (WINDOWS)
# Ensure people working on the viewer don't break this library

View File

@ -89,6 +89,8 @@ const U64 REGION_FLAGS_ALLOW_VOICE = (1 << 28);
const U64 REGION_FLAGS_BLOCK_PARCEL_SEARCH = (1 << 29);
const U64 REGION_FLAGS_DENY_AGEUNVERIFIED = (1 << 30);
const U64 REGION_FLAGS_DENY_BOTS = (1 << 31);
const U64 REGION_FLAGS_DEFAULT = REGION_FLAGS_ALLOW_LANDMARK |
REGION_FLAGS_ALLOW_SET_HOME |
REGION_FLAGS_ALLOW_PARCEL_CHANGES |

View File

@ -74,6 +74,7 @@ bool LLEstateInfoModel::getDenyAgeUnverified() const { return getFlag(REGION_FL
bool LLEstateInfoModel::getAllowVoiceChat() const { return getFlag(REGION_FLAGS_ALLOW_VOICE); }
bool LLEstateInfoModel::getAllowAccessOverride() const { return getFlag(REGION_FLAGS_ALLOW_ACCESS_OVERRIDE); }
bool LLEstateInfoModel::getAllowEnvironmentOverride() const { return getFlag(REGION_FLAGS_ALLOW_ENVIRONMENT_OVERRIDE); }
bool LLEstateInfoModel::getDenyScriptedAgents() const { return getFlag(REGION_FLAGS_DENY_BOTS); }
void LLEstateInfoModel::setUseFixedSun(bool val) { setFlag(REGION_FLAGS_SUN_FIXED, val); }
void LLEstateInfoModel::setIsExternallyVisible(bool val) { setFlag(REGION_FLAGS_EXTERNALLY_VISIBLE, val); }
@ -83,6 +84,7 @@ void LLEstateInfoModel::setDenyAgeUnverified(bool val) { setFlag(REGION_FLAGS_D
void LLEstateInfoModel::setAllowVoiceChat(bool val) { setFlag(REGION_FLAGS_ALLOW_VOICE, val); }
void LLEstateInfoModel::setAllowAccessOverride(bool val) { setFlag(REGION_FLAGS_ALLOW_ACCESS_OVERRIDE, val); }
void LLEstateInfoModel::setAllowEnvironmentOverride(bool val) { setFlag(REGION_FLAGS_ALLOW_ENVIRONMENT_OVERRIDE, val); }
void LLEstateInfoModel::setDenyScriptedAgents(bool val) { setFlag(REGION_FLAGS_DENY_BOTS, val); }
void LLEstateInfoModel::update(const strings_t& strings)
{
@ -148,6 +150,7 @@ void LLEstateInfoModel::commitEstateInfoCapsCoro(std::string url)
body["allow_direct_teleport"] = getAllowDirectTeleport();
body["deny_anonymous"] = getDenyAnonymous();
body["deny_age_unverified"] = getDenyAgeUnverified();
body["block_bots"] = getDenyScriptedAgents();
body["allow_voice_chat"] = getAllowVoiceChat();
body["override_public_access"] = getAllowAccessOverride();
// <FS:Beq> FIRE-29683 Update the (currently unused in SL) Cap to align to EEP as Opensim needs it
@ -224,6 +227,7 @@ std::string LLEstateInfoModel::getInfoDump()
dump["allow_direct_teleport"] = getAllowDirectTeleport();
dump["deny_anonymous" ] = getDenyAnonymous();
dump["deny_age_unverified" ] = getDenyAgeUnverified();
dump["block_bots" ] = getDenyScriptedAgents();
dump["allow_voice_chat" ] = getAllowVoiceChat();
dump["override_public_access"] = getAllowAccessOverride();
dump["override_environment"] = getAllowEnvironmentOverride();

View File

@ -57,6 +57,7 @@ public:
bool getAllowVoiceChat() const;
bool getAllowAccessOverride() const;
bool getAllowEnvironmentOverride() const;
bool getDenyScriptedAgents() const;
const std::string& getName() const { return mName; }
const LLUUID& getOwnerID() const { return mOwnerID; }
@ -72,6 +73,7 @@ public:
void setAllowVoiceChat(bool val);
void setAllowAccessOverride(bool val);
void setAllowEnvironmentOverride(bool val);
void setDenyScriptedAgents(bool val);
void setSunHour(F32 sun_hour) { mSunHour = sun_hour; }

View File

@ -2115,6 +2115,7 @@ BOOL LLPanelEstateInfo::postBuild()
initCtrl("allow_direct_teleport");
initCtrl("limit_payment");
initCtrl("limit_age_verified");
initCtrl("limit_bots");
initCtrl("voice_chat_check");
initCtrl("parcel_access_override");
@ -2139,12 +2140,14 @@ void LLPanelEstateInfo::refresh()
// getChildView("Only Allow")->setEnabled(public_access);
getChildView("limit_payment")->setEnabled(public_access);
getChildView("limit_age_verified")->setEnabled(public_access);
getChildView("limit_bots")->setEnabled(public_access);
// if this is set to false, then the limit fields are meaningless and should be turned off
if (public_access == false)
{
getChild<LLUICtrl>("limit_payment")->setValue(false);
getChild<LLUICtrl>("limit_age_verified")->setValue(false);
getChild<LLUICtrl>("limit_bots")->setValue(false);
}
}
@ -2161,6 +2164,7 @@ void LLPanelEstateInfo::refreshFromEstate()
getChild<LLUICtrl>("limit_payment")->setValue(estate_info.getDenyAnonymous());
getChild<LLUICtrl>("limit_age_verified")->setValue(estate_info.getDenyAgeUnverified());
getChild<LLUICtrl>("parcel_access_override")->setValue(estate_info.getAllowAccessOverride());
getChild<LLUICtrl>("limit_bots")->setValue(estate_info.getDenyScriptedAgents());
// Ensure appriopriate state of the management UI
updateControls(gAgent.getRegion());
@ -2204,6 +2208,7 @@ bool LLPanelEstateInfo::callbackChangeLindenEstate(const LLSD& notification, con
estate_info.setDenyAgeUnverified(getChild<LLUICtrl>("limit_age_verified")->getValue().asBoolean());
estate_info.setAllowVoiceChat(getChild<LLUICtrl>("voice_chat_check")->getValue().asBoolean());
estate_info.setAllowAccessOverride(getChild<LLUICtrl>("parcel_access_override")->getValue().asBoolean());
estate_info.setDenyScriptedAgents(getChild<LLUICtrl>("limit_bots")->getValue().asBoolean());
// JIGGLYPUFF
//estate_info.setAllowAccessOverride(getChild<LLUICtrl>("")->getValue().asBoolean());
// send the update to sim

View File

@ -546,6 +546,18 @@ void LLBingTranslationHandler::verifyKey(const std::string &key, LLTranslate::Ke
}
//=========================================================================
LLTranslate::LLTranslate():
mCharsSeen(0),
mCharsSent(0),
mFailureCount(0),
mSuccessCount(0)
{
}
LLTranslate::~LLTranslate()
{
}
/*static*/
void LLTranslate::translateMessage(const std::string &from_lang, const std::string &to_lang,
const std::string &mesg, TranslationSuccess_fn success, TranslationFailure_fn failure)
@ -634,6 +646,43 @@ bool LLTranslate::isTranslationConfigured()
return getPreferredHandler().isConfigured();
}
void LLTranslate::logCharsSeen(size_t count)
{
mCharsSeen += count;
}
void LLTranslate::logCharsSent(size_t count)
{
mCharsSent += count;
}
void LLTranslate::logSuccess(S32 count)
{
mSuccessCount += count;
}
void LLTranslate::logFailure(S32 count)
{
mFailureCount += count;
}
LLSD LLTranslate::asLLSD() const
{
LLSD res;
bool on = gSavedSettings.getBOOL("TranslateChat");
res["on"] = on;
res["chars_seen"] = (S32) mCharsSeen;
if (on)
{
res["chars_sent"] = (S32) mCharsSent;
res["success_count"] = mSuccessCount;
res["failure_count"] = mFailureCount;
res["language"] = getTranslateLanguage();
res["service"] = gSavedSettings.getString("TranslationService");
}
return res;
}
// static
LLTranslationAPIHandler& LLTranslate::getPreferredHandler()
{

View File

@ -30,6 +30,8 @@
#include "llbufferstream.h"
#include <boost/function.hpp>
#include "llsingleton.h"
namespace Json
{
class Value;
@ -48,8 +50,10 @@ class LLTranslationAPIHandler;
*
* API keys for translation are taken from saved settings.
*/
class LLTranslate
class LLTranslate: public LLSingleton<LLTranslate>
{
LLSINGLETON(LLTranslate);
~LLTranslate();
LOG_CLASS(LLTranslate);
public :
@ -94,9 +98,19 @@ public :
static std::string addNoTranslateTags(std::string mesg);
static std::string removeNoTranslateTags(std::string mesg);
void logCharsSeen(size_t count);
void logCharsSent(size_t count);
void logSuccess(S32 count);
void logFailure(S32 count);
LLSD asLLSD() const;
private:
static LLTranslationAPIHandler& getPreferredHandler();
static LLTranslationAPIHandler& getHandler(EService service);
size_t mCharsSeen;
size_t mCharsSent;
S32 mFailureCount;
S32 mSuccessCount;
};
#endif

View File

@ -2865,6 +2865,7 @@ void translateSuccess(LLChat chat, LLSD toastArgs, std::string originalMsg, std:
chat.mText += " (" + LLTranslate::removeNoTranslateTags(translation) + ")";
}
LLTranslate::instance().logSuccess(1);
LLNotificationsUI::LLNotificationManager::instance().onChat(chat, toastArgs);
}
@ -2874,6 +2875,7 @@ void translateFailure(LLChat chat, LLSD toastArgs, int status, const std::string
LLStringUtil::replaceString(msg, "\n", " "); // we want one-line error messages
chat.mText += " (" + msg + ")";
LLTranslate::instance().logFailure(1);
LLNotificationsUI::LLNotificationManager::instance().onChat(chat, toastArgs);
}
@ -3419,6 +3421,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
}
// </FS:PP>
LLTranslate::instance().logCharsSeen(mesg.size());
// <FS:PP> gSavedSettings to LLCachedControl
// if (gSavedSettings.getBOOL("TranslateChat") && chat.mSourceType != CHAT_SOURCE_SYSTEM)
static LLCachedControl<bool> TranslateChat(gSavedSettings, "TranslateChat");
@ -3432,6 +3435,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
const std::string from_lang = ""; // leave empty to trigger autodetect
const std::string to_lang = LLTranslate::getTranslateLanguage();
LLTranslate::instance().logCharsSent(mesg.size());
LLTranslate::translateMessage(from_lang, to_lang, mesg,
boost::bind(&translateSuccess, chat, args, mesg, from_lang, _1, _2),
boost::bind(&translateFailure, chat, args, _1, _2));

View File

@ -64,6 +64,7 @@
#include "llvoicevivox.h"
#include "llinventorymodel.h"
#include "lluiusage.h"
#include "lltranslate.h"
namespace LLStatViewer
{
@ -506,6 +507,7 @@ void send_viewer_stats(bool include_preferences)
agent["meters_traveled"] = gAgent.getDistanceTraveled();
agent["regions_visited"] = gAgent.getRegionsVisited();
agent["mem_use"] = LLMemory::getCurrentRSS() / 1024.0;
agent["translation"] = LLTranslate::instance().asLLSD();
LLSD &system = body["system"];
@ -537,6 +539,7 @@ void send_viewer_stats(bool include_preferences)
gGLManager.asLLSD(system["gl"]);
S32 shader_level = 0;
if (LLPipeline::sRenderDeferred)
{

View File

@ -82,7 +82,7 @@
<view_border
bevel_style="none"
follows="top|left"
height="185"
height="205"
layout="topleft"
left="6"
top_pad="5"
@ -125,6 +125,16 @@
tool_tip="Residents must have payment information on file to access this estate. See the [SUPPORT_SITE] for more information."
top_pad="2"
width="278" />
<check_box
follows="top|left"
height="18"
label="Must not be a scripted agent"
layout="topleft"
left_delta="0"
name="limit_bots"
tool_tip="Residents must not be a scripted agents (bots) to access this estate. See the [SUPPORT_SITE] for more information."
top_pad="2"
width="278" />
<check_box
height="18"
label="Parcel owners can be more restrictive"

View File

@ -152,7 +152,7 @@ https://www.firestormviewer.org/choose-your-platform/
For more information, see our FAQ below:
http://secondlife.com/viewer-access-faq</string>
<string name="LoginFailed">Grid emergency login failure.
<string name="LoginFailed">Login failure.
If you feel this is an error, please contact the grid support.</string>
<string name="LoginIntermediateOptionalUpdateAvailable">Optional viewer update available: [VERSION]</string>
<string name="LoginFailedRequiredUpdate">Required viewer update: [VERSION]</string>