diff --git a/indra/newview/NACLantispam.cpp b/indra/newview/NACLantispam.cpp index cabd47ed0..a46378268 100644 --- a/indra/newview/NACLantispam.cpp +++ b/indra/newview/NACLantispam.cpp @@ -19,7 +19,9 @@ #include "llnotificationsutil.h" #include "llviewerobjectlist.h" #include "llagent.h" +#include "lltrans.h" #include +#include U32 NACLAntiSpamRegistry::globalAmount; U32 NACLAntiSpamRegistry::globalTime; @@ -28,6 +30,7 @@ NACLAntiSpamQueue* NACLAntiSpamRegistry::queues[NACLAntiSpamRegistry::QUEUE_MAX] std::tr1::unordered_map NACLAntiSpamRegistry::globalEntries; std::tr1::unordered_map::iterator NACLAntiSpamRegistry::it2; +// The following sounds will be ignored for purposes of spam protection. They have been gathered from wiki documentation of frequent official sounds. const std::string COLLISION_SOUNDS[] ={"dce5fdd4-afe4-4ea1-822f-dd52cac46b08","51011582-fbca-4580-ae9e-1a5593f094ec","68d62208-e257-4d0c-bbe2-20c9ea9760bb","75872e8c-bc39-451b-9b0b-042d7ba36cba","6a45ba0b-5775-4ea8-8513-26008a17f873","992a6d1b-8c77-40e0-9495-4098ce539694","2de4da5a-faf8-46be-bac6-c4d74f1e5767","6e3fb0f7-6d9c-42ca-b86b-1122ff562d7d","14209133-4961-4acc-9649-53fc38ee1667","bc4a4348-cfcc-4e5e-908e-8a52a8915fe6","9e5c1297-6eed-40c0-825a-d9bcd86e3193","e534761c-1894-4b61-b20c-658a6fb68157","8761f73f-6cf9-4186-8aaa-0948ed002db1","874a26fd-142f-4173-8c5b-890cd846c74d","0e24a717-b97e-4b77-9c94-b59a5a88b2da","75cf3ade-9a5b-4c4d-bb35-f9799bda7fb2","153c8bf7-fb89-4d89-b263-47e58b1b4774","55c3e0ce-275a-46fa-82ff-e0465f5e8703","24babf58-7156-4841-9a3f-761bdbb8e237","aca261d8-e145-4610-9e20-9eff990f2c12","0642fba6-5dcf-4d62-8e7b-94dbb529d117","25a863e8-dc42-4e8a-a357-e76422ace9b5","9538f37c-456e-4047-81be-6435045608d4","8c0f84c3-9afd-4396-b5f5-9bca2c911c20","be582e5d-b123-41a2-a150-454c39e961c8","c70141d4-ba06-41ea-bcbc-35ea81cb8335","7d1826f4-24c4-4aac-8c2e-eff45df37783","063c97d3-033a-4e9b-98d8-05c8074922cb","00000000-0000-0000-0000-000000000120"}; const int COLLISION_SOUNDS_SIZE=29; @@ -45,11 +48,11 @@ void NACLAntiSpamQueueEntry::clearEntry() entryAmount=0; blocked=false; } -U32 NACLAntiSpamQueueEntry::getEntryAmount() +U32 NACLAntiSpamQueueEntry::getEntryAmount() const { return entryAmount; } -U32 NACLAntiSpamQueueEntry::getEntryTime() +U32 NACLAntiSpamQueueEntry::getEntryTime() const { return entryTime; } @@ -65,7 +68,7 @@ void NACLAntiSpamQueueEntry::setBlocked() { blocked=true; } -bool NACLAntiSpamQueueEntry::getBlocked() +bool NACLAntiSpamQueueEntry::getBlocked() const { return blocked; } @@ -85,6 +88,14 @@ void NACLAntiSpamQueue::setTime(U32 time) { queueTime=time; } +U32 NACLAntiSpamQueue::getAmount() const +{ + return queueAmount; +} +U32 NACLAntiSpamQueue::getTime() const +{ + return queueTime; +} void NACLAntiSpamQueue::clearEntries() { for(it = entries.begin(); it != entries.end(); it++) @@ -110,6 +121,7 @@ void NACLAntiSpamQueue::blockEntry(LLUUID& source) entries[source.asString()]->setBlocked(); } int NACLAntiSpamQueue::checkEntry(LLUUID& name, U32 multiplier) +// Returns 0 if unblocked/disabled, 1 if check results in a new block, 2 if by an existing block { static LLCachedControl enabled(gSavedSettings,"AntiSpamEnabled",false); if(!enabled) return 0; @@ -141,6 +153,7 @@ int NACLAntiSpamQueue::checkEntry(LLUUID& name, U32 multiplier) } else { + //lldebugs << "[antispam] New queue entry:" << name.asString() << llendl; entries[name.asString()]=new NACLAntiSpamQueueEntry(); entries[name.asString()]->updateEntryAmount(); entries[name.asString()]->updateEntryTime(); @@ -154,8 +167,8 @@ static const char* QUEUE_NAME[NACLAntiSpamRegistry::QUEUE_MAX] = { "Chat", "Inventory", "Instant Message", -"Calling Card", -"Sound", +"calling card", +"sound", "Sound Preload", "Script Dialog", "Teleport"}; @@ -171,12 +184,14 @@ NACLAntiSpamRegistry::NACLAntiSpamRegistry(U32 time, U32 amount) queues[queue] = new NACLAntiSpamQueue(time,amount); } } +//static const char* NACLAntiSpamRegistry::getQueueName(U32 queue_id) { if(queue_id >= QUEUE_MAX) return "Unknown"; return QUEUE_NAME[queue_id]; } +//static void NACLAntiSpamRegistry::registerQueues(U32 time, U32 amount) { globalTime=time; @@ -188,16 +203,16 @@ void NACLAntiSpamRegistry::registerQueues(U32 time, U32 amount) queues[queue] = new NACLAntiSpamQueue(time,amount); } } -void NACLAntiSpamRegistry::registerQueue(U32 name, U32 time, U32 amount) +//static +/*void NACLAntiSpamRegistry::registerQueue(U32 name, U32 time, U32 amount) { - /* it=queues.find(name); if(it == queues.end()) { queues[name]=new NACLAntiSpamQueue(time,amount); } - */ -} +}*/ +//static void NACLAntiSpamRegistry::setRegisteredQueueTime(U32 name, U32 time) { if(name >= QUEUE_MAX || queues[name] == 0) @@ -208,6 +223,7 @@ void NACLAntiSpamRegistry::setRegisteredQueueTime(U32 name, U32 time) queues[name]->setTime(time); } +//static void NACLAntiSpamRegistry::setRegisteredQueueAmount(U32 name, U32 amount) { if(name >= QUEUE_MAX || queues[name] == 0) @@ -218,23 +234,28 @@ void NACLAntiSpamRegistry::setRegisteredQueueAmount(U32 name, U32 amount) queues[name]->setAmount(amount); } +//static void NACLAntiSpamRegistry::setAllQueueTimes(U32 time) { globalTime=time; for(int queue = 0; queue < QUEUE_MAX; ++queue) - queues[queue]->setTime(time); + if( queues[queue] ) + queues[queue]->setTime(time); } +//static void NACLAntiSpamRegistry::setAllQueueAmounts(U32 amount) { globalAmount=amount; for(int queue = 0; queue < QUEUE_MAX; ++queue) { + if(!queues[queue]) continue; if(queue == QUEUE_SOUND || queue == QUEUE_SOUND_PRELOAD) queues[queue]->setAmount(amount*5); else queues[queue]->setAmount(amount); } } +//static void NACLAntiSpamRegistry::clearRegisteredQueue(U32 name) { if(name >= QUEUE_MAX || queues[name] == 0) @@ -245,6 +266,7 @@ void NACLAntiSpamRegistry::clearRegisteredQueue(U32 name) queues[name]->clearEntries(); } +//static void NACLAntiSpamRegistry::purgeRegisteredQueue(U32 name) { if(name >= QUEUE_MAX || queues[name] == 0) @@ -255,6 +277,7 @@ void NACLAntiSpamRegistry::purgeRegisteredQueue(U32 name) queues[name]->purgeEntries(); } +//static void NACLAntiSpamRegistry::blockOnQueue(U32 name, LLUUID& source) { if(bGlobalQueue) @@ -271,6 +294,7 @@ void NACLAntiSpamRegistry::blockOnQueue(U32 name, LLUUID& source) queues[name]->blockEntry(source); } } +//static void NACLAntiSpamRegistry::blockGlobalEntry(LLUUID& source) { it2=globalEntries.find(source.asString()); @@ -280,13 +304,13 @@ void NACLAntiSpamRegistry::blockGlobalEntry(LLUUID& source) } globalEntries[source.asString()]->setBlocked(); } +//static bool NACLAntiSpamRegistry::checkQueue(U32 name, LLUUID& source, U32 multiplier) +//returns true if blocked { - if(source.isNull()) return false; - if(gAgent.getID() == source) return false; + if(source.isNull() || gAgent.getID() == source) return false; LLViewerObject *obj=gObjectList.findObject(source); - if(obj) - if(obj->permYouOwner()) return false; + if(obj && obj->permYouOwner()) return false; int result; if(bGlobalQueue) @@ -302,40 +326,45 @@ bool NACLAntiSpamRegistry::checkQueue(U32 name, LLUUID& source, U32 multiplier) } result=queues[name]->checkEntry(source,multiplier); } - if(result==0) - { + if(result == 0) //Safe return false; - } - else if(result==2) + else if(result == 2) //Previously blocked { return true; } - else + else //Just blocked! { if(gSavedSettings.getBOOL("AntiSpamNotify")) { - LLSD args; - args["MESSAGE"] = std::string(getQueueName(name))+": Blocked object "+source.asString(); - LLNotificationsUtil::add("SystemMessageTip", args); + LLSD args; + args["SOURCE"] = source.asString().c_str(); + args["TYPE"] = LLTrans::getString(getQueueName(name)); + args["AMOUNT"] = boost::lexical_cast(multiplier * queues[name]->getAmount()); + args["TIME"] = boost::lexical_cast(queues[name]->getTime()); + LLNotificationsUtil::add("AntiSpamBlock", args); } return true; } } // Global queue stoof +//static void NACLAntiSpamRegistry::setGlobalQueue(bool value) { NACLAntiSpamRegistry::purgeAllQueues(); bGlobalQueue=value; } +//static void NACLAntiSpamRegistry::setGlobalAmount(U32 amount) { globalAmount=amount; } +//static void NACLAntiSpamRegistry::setGlobalTime(U32 time) { globalTime=time; } +//static void NACLAntiSpamRegistry::clearAllQueues() { if(bGlobalQueue) @@ -343,9 +372,10 @@ void NACLAntiSpamRegistry::clearAllQueues() else for(int queue = 0; queue < QUEUE_MAX; ++queue) { - queues[queue]->clearEntries(); + if(queues[queue]) queues[queue]->clearEntries(); } } +//static void NACLAntiSpamRegistry::purgeAllQueues() { if(bGlobalQueue) @@ -353,9 +383,11 @@ void NACLAntiSpamRegistry::purgeAllQueues() else for(int queue = 0; queue < QUEUE_MAX; ++queue) { - queues[queue]->purgeEntries(); + if(queues[queue]) queues[queue]->purgeEntries(); } + llinfos << "AntiSpam Queues Purged" << llendl; } +//static int NACLAntiSpamRegistry::checkGlobalEntry(LLUUID& name, U32 multiplier) { static LLCachedControl enabled(gSavedSettings,"AntiSpamEnabled",false); @@ -391,6 +423,7 @@ int NACLAntiSpamRegistry::checkGlobalEntry(LLUUID& name, U32 multiplier) return 0; } } +//static void NACLAntiSpamRegistry::clearGlobalEntries() { for(it2 = globalEntries.begin(); it2 != globalEntries.end(); it2++) @@ -398,6 +431,7 @@ void NACLAntiSpamRegistry::clearGlobalEntries() it2->second->clearEntry(); } } +//static void NACLAntiSpamRegistry::purgeGlobalEntries() { for(it2 = globalEntries.begin(); it2 != globalEntries.end(); it2++) @@ -407,16 +441,21 @@ void NACLAntiSpamRegistry::purgeGlobalEntries() } globalEntries.clear(); } + +//Handlers +//static bool NACLAntiSpamRegistry::handleNaclAntiSpamGlobalQueueChanged(const LLSD& newvalue) { setGlobalQueue(newvalue.asBoolean()); return true; } +//static bool NACLAntiSpamRegistry::handleNaclAntiSpamTimeChanged(const LLSD& newvalue) { setAllQueueTimes(newvalue.asInteger()); return true; } +//static bool NACLAntiSpamRegistry::handleNaclAntiSpamAmountChanged(const LLSD& newvalue) { setAllQueueAmounts(newvalue.asInteger()); diff --git a/indra/newview/NACLantispam.h b/indra/newview/NACLantispam.h index 6da32f5c1..e0476e267 100644 --- a/indra/newview/NACLantispam.h +++ b/indra/newview/NACLantispam.h @@ -25,11 +25,11 @@ class NACLAntiSpamQueueEntry protected: NACLAntiSpamQueueEntry(); void clearEntry(); - U32 getEntryAmount(); - U32 getEntryTime(); + U32 getEntryAmount() const; + U32 getEntryTime() const; void updateEntryAmount(); void updateEntryTime(); - bool getBlocked(); + bool getBlocked() const; void setBlocked(); private: U32 entryAmount; @@ -39,6 +39,9 @@ private: class NACLAntiSpamQueue { friend class NACLAntiSpamRegistry; +public: + U32 getAmount() const; + U32 getTime() const; protected: NACLAntiSpamQueue(U32 time, U32 amount); void setAmount(U32 amount); @@ -58,7 +61,7 @@ class NACLAntiSpamRegistry public: NACLAntiSpamRegistry(U32 time=2, U32 amount=10); static void registerQueues(U32 time=2, U32 amount=10); - static void registerQueue(U32 name, U32 time, U32 amount); +// static void registerQueue(U32 name, U32 time, U32 amount); static void setRegisteredQueueTime(U32 name, U32 time); static void setRegisteredQueueAmount(U32 name,U32 amount); static void setAllQueueTimes(U32 amount); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 36279ab1f..f2b68523e 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1032,7 +1032,7 @@ _NACL_AntiSpamGlobalQueue Comment - Collect spamtypes together, instead of individually counting them + Collect spamtypes together, instead of individually counting them; Use in cases of extreme spam, only. Persist 1 Type @@ -1043,7 +1043,7 @@ _NACL_AntiSpamTime Comment - Time in seconds for spamtype to accumulate the _NACL_AntiSpamAmount and be blocked + Time in seconds for spamtype to accumulate to more than _NACL_AntiSpamAmount and be blocked Persist 1 Type @@ -1054,7 +1054,7 @@ _NACL_AntiSpamAmount Comment - Amount of spamtype to be reached before the blocking will occur. + Count of spamtype to be reached during _NACL_AntiSpamTime before the spam blocking will occur. Persist 1 Type @@ -1065,7 +1065,7 @@ _NACL_AntiSpamSoundMulti Comment - + Multiplier for _NACL_AntiSpamTime for sounds heard in _NACL_AntiSpamTime interval needed to trigger a block, since sounds are more common than messages Persist 1 Type @@ -1076,18 +1076,18 @@ _NACL_AntiSpamNewlines Comment - How many newlines a message can have before it's considered spam. + How many newlines a message is allowed to have without being considered spam. Persist 1 Type U32 Value - 20 + 70 _NACL_AntiSpamSoundPreloadMulti Comment - + Multiplier for _NACL_AntiSpamTime for sounds preloaded in _NACL_AntiSpamTime interval needed to trigger a block, since sound preloads are more common than messages Persist 1 Type diff --git a/indra/newview/llfloateractivespeakers.cpp b/indra/newview/llfloateractivespeakers.cpp index f0f856ef0..1d1fb1ebf 100644 --- a/indra/newview/llfloateractivespeakers.cpp +++ b/indra/newview/llfloateractivespeakers.cpp @@ -35,7 +35,9 @@ #include "llfloateractivespeakers.h" #include "llagent.h" -#include "llvoavatar.h" +#include "llappviewer.h" +#include "llimview.h" +#include "llsdutil.h" #include "llfloateravatarinfo.h" #include "lluictrlfactory.h" #include "llviewercontrol.h" @@ -44,12 +46,10 @@ #include "lltextbox.h" #include "llmutelist.h" #include "llviewerobjectlist.h" +#include "llvoavatar.h" #include "llimpanel.h" // LLVoiceChannel -#include "llsdutil.h" -#include "llimview.h" #include "llviewerwindow.h" #include "llworld.h" -#include "llappviewer.h" // [RLVa:KB] #include "rlvhandler.h" @@ -90,9 +90,7 @@ LLSpeaker::LLSpeaker(const LLUUID& id, const std::string& name, const ESpeakerTy mDisplayName = name; mLegacyName = name; } - gVoiceClient->setUserVolume(id, LLMuteList::getInstance()->getSavedResidentVolume(id)); - mActivityTimer.reset(SPEAKER_TIMEOUT); } @@ -104,7 +102,7 @@ void LLSpeaker::lookupName() // [/Ansariel: Display name support] } -//static +//static // [Ansariel: Display name support] void LLSpeaker::onAvatarNameLookup(const LLUUID& id, const LLAvatarName& avatar_name, void* user_data) // [/Ansariel: Display name support] @@ -122,12 +120,12 @@ void LLSpeaker::onAvatarNameLookup(const LLUUID& id, const LLAvatarName& avatar_ case 2 : speaker_ptr->mDisplayName = avatar_name.mDisplayName; break; default : speaker_ptr->mDisplayName = avatar_name.getLegacyName(); break; } - + // Also set the legacy name. We will need it to initiate a new // IM session. speaker_ptr->mLegacyName = LLCacheName::cleanFullName(avatar_name.getLegacyName()); // [/Ansariel: Display name support] - + // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-1.0.0g // TODO-RLVa: this seems to get called per frame which is very likely an LL bug that will eventuall get fixed if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) @@ -500,7 +498,7 @@ void LLPanelActiveSpeakers::refreshSpeakers() } LLColor4 icon_color; - + if (speakerp->mStatus == LLSpeaker::STATUS_MUTED) { icon_cell->setValue(mute_icon_image); @@ -605,7 +603,7 @@ void LLPanelActiveSpeakers::refreshSpeakers() speaking_status_cell->setValue(speaking_order_sort_string); } } - + // we potentially modified the sort order by touching the list items mSpeakerList->setSorted(FALSE); @@ -860,25 +858,25 @@ void LLPanelActiveSpeakers::onModeratorMuteVoice(LLUICtrl* ctrl, void* user_data if ( gIMMgr ) { - //403 == you're not a mod - //should be disabled if you're not a moderator LLFloaterIMPanel* floaterp; floaterp = gIMMgr->findFloaterBySession(mSessionID); if ( floaterp ) { + //403 == you're not a mod + //should be disabled if you're not a moderator if ( 403 == status ) { floaterp->showSessionEventError( "mute", - "not_a_moderator"); + "not_a_mod_error"); } else { floaterp->showSessionEventError( "mute", - "generic"); + "generic_request_error"); } } } @@ -925,25 +923,25 @@ void LLPanelActiveSpeakers::onModeratorMuteText(LLUICtrl* ctrl, void* user_data) if ( gIMMgr ) { - //403 == you're not a mod - //should be disabled if you're not a moderator LLFloaterIMPanel* floaterp; floaterp = gIMMgr->findFloaterBySession(mSessionID); if ( floaterp ) { + //403 == you're not a mod + //should be disabled if you're not a moderator if ( 403 == status ) { floaterp->showSessionEventError( "mute", - "not_a_moderator"); + "not_a_mod_error"); } else { floaterp->showSessionEventError( "mute", - "generic"); + "generic_request_error"); } } } @@ -1194,6 +1192,9 @@ void LLSpeakerMgr::updateSpeakerList() const LLPointer LLSpeakerMgr::findSpeaker(const LLUUID& speaker_id) { + //In some conditions map causes crash if it is empty(Windows only), adding check (EK) + if (mSpeakers.size() == 0) + return NULL; speaker_map_t::iterator found_it = mSpeakers.find(speaker_id); if (found_it == mSpeakers.end()) { diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index 37bcb873b..ba047ae41 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -74,6 +74,7 @@ #include "llsurface.h" #include "llviewercontrol.h" #include "lluictrlfactory.h" +#include "lltrans.h" #include "lltransfertargetfile.h" #include "lltransfersourcefile.h" @@ -172,6 +173,7 @@ LLFloaterGodTools::~LLFloaterGodTools() // children automatically deleted } + U32 LLFloaterGodTools::computeRegionFlags() const { U32 flags = gAgent.getRegion()->getRegionFlags(); @@ -245,14 +247,16 @@ void LLFloaterGodTools::showPanel(const std::string& panel_name) void LLFloaterGodTools::onTabChanged(LLUICtrl* ctrl, const LLSD& param) { LLPanel* panel = (LLPanel*)ctrl->getChildView(param.asString(),false,false); - if(panel) + if (panel) panel->setFocus(TRUE); } - // static void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg) { + llassert(msg); + if (!msg) return; + //const S32 SIM_NAME_BUF = 256; U32 region_flags; U8 sim_access; @@ -307,12 +311,12 @@ void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg) regionp->setBillableFactor(billable_factor); } + if (!sGodTools) return; + // push values to god tools, if available - if (sGodTools + if ( gAgent.isGodlike() && sGodTools->mPanelRegionTools - && sGodTools->mPanelObjectTools - && msg - && gAgent.isGodlike()) + && sGodTools->mPanelObjectTools) { LLPanelRegionTools* rtool = sGodTools->mPanelRegionTools; sGodTools->mCurrentHost = host; @@ -371,6 +375,8 @@ void LLFloaterGodTools::sendRegionInfoRequest() void LLFloaterGodTools::sendGodUpdateRegionInfo() { + if (!sGodTools) return; + LLViewerRegion *regionp = gAgent.getRegion(); if (gAgent.isGodlike() && sGodTools->mPanelRegionTools @@ -777,9 +783,7 @@ void LLPanelRegionTools::setPricePerMeter(S32 price) // static void LLPanelRegionTools::onChangeAnything(LLUICtrl* ctrl, void* userdata) { - if (sGodTools - && userdata - && gAgent.isGodlike()) + if (sGodTools && userdata && gAgent.isGodlike()) { LLPanelRegionTools* region_tools = (LLPanelRegionTools*) userdata; region_tools->childEnable("Apply"); @@ -803,9 +807,7 @@ void LLPanelRegionTools::onChangePrelude(LLUICtrl* ctrl, void* data) // static void LLPanelRegionTools::onChangeSimName(LLLineEditor* caller, void* userdata ) { - if (sGodTools - && userdata - && gAgent.isGodlike()) + if (sGodTools && userdata && gAgent.isGodlike()) { LLPanelRegionTools* region_tools = (LLPanelRegionTools*) userdata; region_tools->childEnable("Apply"); @@ -815,10 +817,9 @@ void LLPanelRegionTools::onChangeSimName(LLLineEditor* caller, void* userdata ) //static void LLPanelRegionTools::onRefresh(void* userdata) { + if(!sGodTools) return; LLViewerRegion *region = gAgent.getRegion(); - if (region - && sGodTools - && gAgent.isGodlike()) + if (region && gAgent.isGodlike()) { sGodTools->sendRegionInfoRequest(); } @@ -827,11 +828,9 @@ void LLPanelRegionTools::onRefresh(void* userdata) // static void LLPanelRegionTools::onApplyChanges(void* userdata) { + if(!sGodTools) return; LLViewerRegion *region = gAgent.getRegion(); - if (region - && sGodTools - && userdata - && gAgent.isGodlike()) + if (region && userdata && gAgent.isGodlike()) { LLPanelRegionTools* region_tools = (LLPanelRegionTools*) userdata; @@ -840,19 +839,19 @@ void LLPanelRegionTools::onApplyChanges(void* userdata) } } -// static +// static void LLPanelRegionTools::onBakeTerrain(void *userdata) { LLPanelRequestTools::sendRequest("terrain", "bake", gAgent.getRegionHost()); } -// static +// static void LLPanelRegionTools::onRevertTerrain(void *userdata) { LLPanelRequestTools::sendRequest("terrain", "revert", gAgent.getRegionHost()); } -// static +// static void LLPanelRegionTools::onSwapTerrain(void *userdata) { LLPanelRequestTools::sendRequest("terrain", "swap", gAgent.getRegionHost()); @@ -953,7 +952,6 @@ bool LLPanelGridTools::finishKick(const LLSD& notification, const LLSD& response { S32 option = LLNotification::getSelectedOption(notification, response); - if (option == 0) { LLMessageSystem* msg = gMessageSystem; @@ -1027,7 +1025,8 @@ bool LLPanelGridTools::flushMapVisibilityCachesConfirm(const LLSD& notification, // Default constructor LLPanelObjectTools::LLPanelObjectTools(const std::string& title) -: LLPanel(title), mTargetAvatar() + : LLPanel(title), + mTargetAvatar() { } @@ -1063,7 +1062,7 @@ void LLPanelObjectTools::setTargetAvatar(const LLUUID &target_id) mTargetAvatar = target_id; if (target_id.isNull()) { - childSetValue("target_avatar_name", "(no target)"); + childSetValue("target_avatar_name", getString("no_target")); } } @@ -1146,8 +1145,9 @@ void LLPanelObjectTools::enableAllWidgets() // static void LLPanelObjectTools::onGetTopColliders(void* userdata) { - if (sGodTools - && gAgent.isGodlike()) + if(!sGodTools) return; + + if (gAgent.isGodlike()) { LLFloaterTopObjects::show(); LLFloaterTopObjects::setMode(STAT_REPORT_TOP_COLLIDERS); @@ -1158,8 +1158,9 @@ void LLPanelObjectTools::onGetTopColliders(void* userdata) // static void LLPanelObjectTools::onGetTopScripts(void* userdata) { - if (sGodTools - && gAgent.isGodlike()) + if(!sGodTools) return; + + if (gAgent.isGodlike()) { LLFloaterTopObjects::show(); LLFloaterTopObjects::setMode(STAT_REPORT_TOP_SCRIPTS); @@ -1170,8 +1171,7 @@ void LLPanelObjectTools::onGetTopScripts(void* userdata) // static void LLPanelObjectTools::onGetScriptDigest(void* userdata) { - if (sGodTools - && gAgent.isGodlike()) + if (sGodTools && gAgent.isGodlike()) { // get the list of scripts and number of occurences of each // (useful for finding self-replicating objects) @@ -1281,7 +1281,10 @@ void LLPanelObjectTools::onClickSetBySelection(void* data) LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name); panelp->mTargetAvatar = owner_id; - std::string name = "Object " + node->mName + " owned by " + owner_name; + LLStringUtil::format_map_t args; + args["[OBJECT]"] = node->mName; + args["[OWNER]"] = owner_name; + std::string name = LLTrans::getString("GodToolsObjectOwnedBy", args); panelp->childSetValue("target_avatar_name", name); } @@ -1295,11 +1298,10 @@ void LLPanelObjectTools::callbackAvatarID(const std::vector& names, object_tools->refresh(); } - // static void LLPanelObjectTools::onChangeAnything(LLUICtrl* ctrl, void* userdata) { - if (sGodTools + if (sGodTools && userdata && gAgent.isGodlike()) { @@ -1311,15 +1313,12 @@ void LLPanelObjectTools::onChangeAnything(LLUICtrl* ctrl, void* userdata) // static void LLPanelObjectTools::onApplyChanges(void* userdata) { + if(!sGodTools) return; LLViewerRegion *region = gAgent.getRegion(); - if (region - && sGodTools - && userdata - && gAgent.isGodlike()) + if (region && userdata && gAgent.isGodlike()) { LLPanelObjectTools* object_tools = (LLPanelObjectTools*) userdata; // TODO -- implement this - object_tools->childDisable("Apply"); sGodTools->sendGodUpdateRegionInfo(); } diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 20f60e920..ac3e2f7cc 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2260,8 +2260,8 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata) BOOL allow_damage = !self->mCheckSafe->get(); BOOL allow_fly = self->mCheckFly->get(); BOOL allow_landmark = self->mCheckLandmark->get(); - BOOL allow_group_scripts = self->mCheckGroupScripts->get() || self->mCheckOtherScripts->get(); BOOL allow_other_scripts = self->mCheckOtherScripts->get(); + BOOL allow_group_scripts = self->mCheckGroupScripts->get() || allow_other_scripts; BOOL allow_publish = FALSE; BOOL mature_publish = self->mMatureCtrl->get(); BOOL push_restriction = self->mPushRestrictionCtrl->get(); @@ -2424,7 +2424,7 @@ void LLPanelLandAccess::refresh() mListAccess->deleteAllItems(); if (mListBanned) mListBanned->deleteAllItems(); - + LLParcel *parcel = mParcel->getParcel(); // Display options diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 794e774fe..7bf346769 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -165,6 +165,7 @@ bool estate_dispatch_initialized = false; //S32 LLFloaterRegionInfo::sRequestSerial = 0; LLUUID LLFloaterRegionInfo::sRequestInvoice; + LLFloaterRegionInfo::LLFloaterRegionInfo(const LLSD& seed) { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_region_info.xml", NULL, FALSE); @@ -176,26 +177,6 @@ BOOL LLFloaterRegionInfo::postBuild() // contruct the panels LLPanelRegionInfo* panel; - panel = new LLPanelRegionGeneralInfo; - mInfoPanels.push_back(panel); - LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_general.xml"); - mTab->addTabPanel(panel, panel->getLabel(), TRUE); - - panel = new LLPanelRegionDebugInfo; - mInfoPanels.push_back(panel); - LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_debug.xml"); - mTab->addTabPanel(panel, panel->getLabel(), FALSE); - - panel = new LLPanelRegionTextureInfo; - mInfoPanels.push_back(panel); - LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_texture.xml"); - mTab->addTabPanel(panel, panel->getLabel(), FALSE); - - panel = new LLPanelRegionTerrainInfo; - mInfoPanels.push_back(panel); - LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_terrain.xml"); - mTab->addTabPanel(panel, panel->getLabel(), FALSE); - panel = new LLPanelEstateInfo; mInfoPanels.push_back(panel); LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_estate.xml"); @@ -206,6 +187,26 @@ BOOL LLFloaterRegionInfo::postBuild() LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_covenant.xml"); mTab->addTabPanel(panel, panel->getLabel(), FALSE); + panel = new LLPanelRegionGeneralInfo; + mInfoPanels.push_back(panel); + LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_general.xml"); + mTab->addTabPanel(panel, panel->getLabel(), TRUE); + + panel = new LLPanelRegionTerrainInfo; + mInfoPanels.push_back(panel); + LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_terrain.xml"); + mTab->addTabPanel(panel, panel->getLabel(), FALSE); + + panel = new LLPanelRegionTextureInfo; + mInfoPanels.push_back(panel); + LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_texture.xml"); + mTab->addTabPanel(panel, panel->getLabel(), FALSE); + + panel = new LLPanelRegionDebugInfo; + mInfoPanels.push_back(panel); + LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_debug.xml"); + mTab->addTabPanel(panel, panel->getLabel(), FALSE); + gMessageSystem->setHandlerFunc( "EstateOwnerMessage", &processEstateOwnerRequest); @@ -331,6 +332,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) msg->getSize("RegionInfo2", "ProductName") > 0) { msg->getString("RegionInfo2", "ProductName", sim_type); + LLTrans::findString(sim_type, sim_type); // try localizing sim product name } // GENERAL PANEL @@ -1234,6 +1236,7 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region) return LLPanelRegionInfo::refreshFromRegion(region); } + // virtual BOOL LLPanelRegionTerrainInfo::sendUpdate() { @@ -1390,6 +1393,7 @@ bool LLPanelRegionTerrainInfo::callbackBakeTerrain(const LLSD& notification, con strings.push_back("bake"); LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); sendEstateOwnerMessage(gMessageSystem, "terrain", invoice, strings); + return false; } @@ -1669,26 +1673,29 @@ bool LLPanelEstateInfo::kickUserConfirm(const LLSD& notification, const LLSD& re std::string all_estates_text() { LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); - if (!panel) return "(error)"; + if (!panel) return "(" + LLTrans::getString("RegionInfoError") + ")"; + LLStringUtil::format_map_t args; std::string owner = panel->getOwnerName(); LLViewerRegion* region = gAgent.getRegion(); if (gAgent.isGodlike()) { - return llformat("all estates\nowned by %s", owner.c_str()); + args["[OWNER]"] = owner.c_str(); + return LLTrans::getString("RegionInfoAllEstatesOwnedBy", args); } else if (region && region->getOwner() == gAgent.getID()) { - return "all estates you own"; + return LLTrans::getString("RegionInfoAllEstatesYouOwn"); } else if (region && region->isEstateManager()) { - return llformat("all estates that\nyou manage for %s", owner.c_str()); + args["[OWNER]"] = owner.c_str(); + return LLTrans::getString("RegionInfoAllEstatesYouManage", args); } else { - return "(error)"; + return "(" + LLTrans::getString("RegionInfoError") + ")"; } } @@ -2254,6 +2261,7 @@ bool LLPanelEstateInfo::callbackChangeLindenEstate(const LLSD& notification, con LLFloaterRegionInfo::nextInvoice(); commitEstateInfoDataserver(); } + // we don't want to do this because we'll get it automatically from the sim // after the spaceserver processes it // else @@ -2723,7 +2731,6 @@ bool LLPanelEstateCovenant::refreshFromRegion(LLViewerRegion* region) region_landtype->setText(region->getLocalizedSimProductName()); } - // let the parent class handle the general data collection. bool rv = LLPanelRegionInfo::refreshFromRegion(region); LLMessageSystem *msg = gMessageSystem; @@ -2863,7 +2870,7 @@ void LLPanelEstateCovenant::loadInvItem(LLInventoryItem *itemp) else { mAssetStatus = ASSET_LOADED; - setCovenantTextEditor("There is no Covenant provided for this Estate."); + setCovenantTextEditor(LLTrans::getString("RegionNoCovenant")); sendChangeCovenantID(LLUUID::null); } } @@ -3179,9 +3186,10 @@ bool LLDispatchSetEstateAccess::operator()( totalAllowedAgents += allowed_agent_name_list->getItemCount(); } - std::string msg = llformat("Allowed residents: (%d, max %d)", - totalAllowedAgents, - ESTATE_MAX_ACCESS_IDS); + LLStringUtil::format_map_t args; + args["[ALLOWEDAGENTS]"] = llformat ("%d", totalAllowedAgents); + args["[MAXACCESS]"] = llformat ("%d", ESTATE_MAX_ACCESS_IDS); + std::string msg = LLTrans::getString("RegionInfoAllowedResidents", args); panel->childSetValue("allow_resident_label", LLSD(msg)); if (allowed_agent_name_list) @@ -3203,9 +3211,10 @@ bool LLDispatchSetEstateAccess::operator()( LLNameListCtrl* allowed_group_name_list; allowed_group_name_list = panel->getChild("allowed_group_name_list"); - std::string msg = llformat("Allowed groups: (%d, max %d)", - num_allowed_groups, - (S32) ESTATE_MAX_GROUP_IDS); + LLStringUtil::format_map_t args; + args["[ALLOWEDGROUPS]"] = llformat ("%d", num_allowed_groups); + args["[MAXACCESS]"] = llformat ("%d", ESTATE_MAX_GROUP_IDS); + std::string msg = LLTrans::getString("RegionInfoAllowedGroups", args); panel->childSetValue("allow_group_label", LLSD(msg)); if (allowed_group_name_list) diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 8cd9ea972..d541a93e5 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -64,6 +64,7 @@ #include "llscrolllistctrl.h" #include "lltextbox.h" #include "lltracker.h" +#include "lltrans.h" #include "llurldispatcher.h" #include "llviewermenu.h" #include "llviewerregion.h" @@ -1625,7 +1626,8 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) } else { - list->addCommentText(std::string("None found.")); + // if we found nothing, say "none" + list->addCommentText(LLTrans::getString("worldmap_results_none_found")); list->operateOnAll(LLCtrlListInterface::OP_DESELECT); } } diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 27774273a..4ba053a40 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -50,19 +50,20 @@ #include "llchat.h" #include "llconsole.h" #include "llfloater.h" -#include "llfloatergroupinfo.h" -#include "llimview.h" -#include "llfloaterinventory.h" -#include "llinventory.h" -#include "llinventoryfunctions.h" #include "llfloateractivespeakers.h" #include "llfloateravatarinfo.h" #include "llfloaterchat.h" +#include "llfloatergroupinfo.h" +#include "llimview.h" +#include "llinventory.h" +#include "llinventoryfunctions.h" +#include "llfloaterinventory.h" +#include "llcheckboxctrl.h" #include "llkeyboard.h" #include "lllineeditor.h" -#include "llcheckboxctrl.h" #include "llnotify.h" #include "llresmgr.h" +#include "lltrans.h" #include "lltabcontainer.h" #include "llviewertexteditor.h" #include "llviewermessage.h" @@ -2544,7 +2545,7 @@ void LLFloaterIMPanel::chatFromLogFile(LLLogChat::ELogLineType type, std::string // add log end message if (gSavedPerAccountSettings.getBOOL("LogInstantMessages")) { - message = LLFloaterChat::getInstance()->getString("IM_logging_string"); + message = LLFloaterChat::getInstance()->getString("IM_end_log_string"); } break; case LLLogChat::LOG_LINE: @@ -2562,19 +2563,8 @@ void LLFloaterIMPanel::chatFromLogFile(LLLogChat::ELogLineType type, std::string void LLFloaterIMPanel::showSessionStartError( const std::string& error_string) { - //the error strings etc. should be really be static and local - //to this file instead of in the LLFloaterIM - //but they were in llimview.cpp first and unfortunately - //some translations into non English languages already occurred - //thus making it a tad harder to change over to a - //"correct" solution. The best solution - //would be to store all of the misc. strings into - //their own XML file which would be read in by any LLIMPanel - //post build function instead of repeating the same info - //in the group, adhoc and normal IM xml files. LLSD args; - args["REASON"] = - LLFloaterIM::sErrorStringsMap[error_string]; + args["REASON"] = LLTrans::getString(error_string); args["RECIPIENT"] = getTitle(); LLSD payload; @@ -2592,13 +2582,14 @@ void LLFloaterIMPanel::showSessionEventError( const std::string& error_string) { LLSD args; - std::string recipient = getTitle(); - std::string reason = LLFloaterIM::sErrorStringsMap[error_string]; - boost::replace_all(reason, "[RECIPIENT]", recipient); - std::string event = LLFloaterIM::sEventStringsMap[event_string]; - boost::replace_all(event, "[RECIPIENT]", recipient); - args["REASON"] = reason; - args["EVENT"] = event; + LLStringUtil::format_map_t event_args; + + event_args["RECIPIENT"] = getTitle(); + + args["REASON"] = + LLTrans::getString(error_string); + args["EVENT"] = + LLTrans::getString(event_string, event_args); LLNotifications::instance().add( "ChatterBoxSessionEventError", @@ -2611,7 +2602,7 @@ void LLFloaterIMPanel::showSessionForceClose( LLSD args; args["NAME"] = getTitle(); - args["REASON"] = LLFloaterIM::sForceCloseSessionMap[reason_string]; + args["REASON"] = LLTrans::getString(reason_string); LLSD payload; payload["session_id"] = mSessionUUID; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index ba794068a..9783badf7 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -41,6 +41,7 @@ #include "llhttpclient.h" #include "llsdutil_math.h" #include "llstring.h" +#include "lltrans.h" #include "lluictrlfactory.h" #include "llagent.h" @@ -81,19 +82,6 @@ // LLIMMgr* gIMMgr = NULL; -// -// Statics -// -// *FIXME: make these all either UIStrings or Strings -static std::string sOnlyUserMessage; -static LLUIString sOfflineMessage; -static std::string sMutedMessage; -static LLUIString sInviteMessage; - -std::map LLFloaterIM::sEventStringsMap; -std::map LLFloaterIM::sErrorStringsMap; -std::map LLFloaterIM::sForceCloseSessionMap; - // // Helper Functions // @@ -172,18 +160,16 @@ public: gIMMgr->clearPendingAgentListUpdates(mSessionID); gIMMgr->clearPendingInvitation(mSessionID); - LLFloaterIMPanel* floaterp = - gIMMgr->findFloaterBySession(mSessionID); + LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession(mSessionID); if ( floaterp ) { if ( 404 == statusNum ) { std::string error_string; - error_string = "does not exist"; + error_string = "session_does_not_exist_error"; - floaterp->showSessionStartError( - error_string); + floaterp->showSessionStartError(error_string); } } } @@ -250,86 +236,6 @@ LLFloaterIM::LLFloaterIM() LLUICtrlFactory::getInstance()->buildFloater(this, "floater_im.xml"); } -BOOL LLFloaterIM::postBuild() -{ - // IM session initiation warnings - sOnlyUserMessage = getString("only_user_message"); - sOfflineMessage = getString("offline_message"); - sMutedMessage = getString("muted_message"); - - sInviteMessage = getString("invite_message"); - - if ( sErrorStringsMap.find("generic") == sErrorStringsMap.end() ) - { - sErrorStringsMap["generic"] = - getString("generic_request_error"); - } - - if ( sErrorStringsMap.find("unverified") == - sErrorStringsMap.end() ) - { - sErrorStringsMap["unverified"] = - getString("insufficient_perms_error"); - } - - if ( sErrorStringsMap.end() == - sErrorStringsMap.find("no_ability") ) - { - sErrorStringsMap["no_ability"] = - getString("no_ability_error"); - } - - if ( sErrorStringsMap.end() == - sErrorStringsMap.find("muted") ) - { - sErrorStringsMap["muted"] = - getString("muted_error"); - } - - if ( sErrorStringsMap.end() == - sErrorStringsMap.find("not_a_moderator") ) - { - sErrorStringsMap["not_a_moderator"] = - getString("not_a_mod_error"); - } - - if ( sErrorStringsMap.end() == - sErrorStringsMap.find("does not exist") ) - { - sErrorStringsMap["does not exist"] = - getString("session_does_not_exist_error"); - } - - if ( sEventStringsMap.end() == sEventStringsMap.find("add") ) - { - sEventStringsMap["add"] = - getString("add_session_event"); - } - - if ( sEventStringsMap.end() == sEventStringsMap.find("message") ) - { - sEventStringsMap["message"] = - getString("message_session_event"); - } - - - if ( sForceCloseSessionMap.end() == - sForceCloseSessionMap.find("removed") ) - { - sForceCloseSessionMap["removed"] = - getString("removed_from_group"); - } - - if ( sForceCloseSessionMap.end() == - sForceCloseSessionMap.find("no ability") ) - { - sForceCloseSessionMap["no ability"] = - getString("close_on_no_ability"); - } - - return TRUE; -} - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLIMViewFriendObserver // @@ -645,10 +551,10 @@ void LLIMMgr::addMessage( { // *TODO:translate (low priority, god ability) std::ostringstream bonus_info; - bonus_info << "*** parent estate: " + bonus_info << LLTrans::getString("***")+ " "+ LLTrans::getString("IMParentEstate") + LLTrans::getString(":") + " " << parent_estate_id - << ((parent_estate_id == 1) ? ", mainland" : "") - << ((parent_estate_id == 5) ? ", teen" : ""); + << ((parent_estate_id == 1) ? LLTrans::getString(",") + LLTrans::getString("IMMainland") : "") + << ((parent_estate_id == 5) ? LLTrans::getString(",") + LLTrans::getString ("IMTeen") : ""); // once we have web-services (or something) which returns // information about a region id, we can print this out @@ -717,23 +623,20 @@ void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& mess // null session id means near me (chat history) if (session_id.isNull()) { - LLFloaterChat* floaterp = LLFloaterChat::getInstance(); - - message = floaterp->getString(message_name); + message = LLTrans::getString(message_name); message.setArgs(args); LLChat chat(message); chat.mSourceType = CHAT_SOURCE_SYSTEM; + LLFloaterChat::getInstance()->addChatHistory(chat); } else // going to IM session { - LLFloaterIMPanel* floaterp = findFloaterBySession(session_id); - if (floaterp) + message = LLTrans::getString(message_name + "-im"); + message.setArgs(args); + if (hasSession(session_id)) { - message = floaterp->getString(message_name); - message.setArgs(args); - gIMMgr->addMessage(session_id, LLUUID::null, SYSTEM_FROM, message.getString()); } } @@ -764,7 +667,7 @@ int LLIMMgr::getIMUnreadCount() } // This method returns TRUE if the local viewer has a session -// currently open keyed to the uuid. +// currently open keyed to the uuid. BOOL LLIMMgr::isIMSessionOpen(const LLUUID& uuid) { LLFloaterIMPanel* floater = findFloaterBySession(uuid); @@ -780,12 +683,14 @@ LLUUID LLIMMgr::addP2PSession(const std::string& name, LLUUID session_id = addSession(name, IM_NOTHING_SPECIAL, other_participant_id); LLFloaterIMPanel* floater = findFloaterBySession(session_id); - if(floater) + if (floater) { - LLVoiceChannelP2P* voice_channelp = (LLVoiceChannelP2P*)floater->getVoiceChannel(); - voice_channelp->setSessionHandle(voice_session_handle, caller_uri); + LLVoiceChannelP2P* voice_channel = dynamic_cast(floater->getVoiceChannel()); + if (voice_channel) + { + voice_channel->setSessionHandle(voice_session_handle, caller_uri); + } } - return session_id; } @@ -951,7 +856,7 @@ void LLIMMgr::inviteToSession( payload["session_handle"] = session_handle; payload["session_uri"] = session_uri; payload["notify_box_type"] = notify_box_type; - + LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(session_id); if (channelp && channelp->callStarted()) { @@ -962,17 +867,13 @@ void LLIMMgr::inviteToSession( if (type == IM_SESSION_P2P_INVITE || ad_hoc_invite) { - // is the inviter a friend? - if (LLAvatarTracker::instance().getBuddyInfo(caller_id) == NULL) + if ( // we're rejecting non-friend voice calls and this isn't a friend + (gSavedSettings.getBOOL("VoiceCallsFriendsOnly") && (LLAvatarTracker::instance().getBuddyInfo(caller_id) == NULL)) + ) { - // if not, and we are ignoring voice invites from non-friends - // then silently decline - if (gSavedSettings.getBOOL("VoiceCallsFriendsOnly")) - { - // invite not from a friend, so decline - LLNotifications::instance().forceResponse(LLNotification::Params("VoiceInviteP2P").payload(payload), 1); - return; - } + // silently decline the call + LLNotifications::instance().forceResponse(LLNotification::Params("VoiceInviteP2P").payload(payload), 1); + return; } } @@ -980,7 +881,8 @@ void LLIMMgr::inviteToSession( { if (caller_name.empty()) { - gCacheName->get(caller_id, true, boost::bind(&LLIMMgr::onInviteNameLookup,_1,_2,_3,payload)); + gCacheName->get(caller_id, true, // voice + boost::bind(&LLIMMgr::onInviteNameLookup, _1, _2, _3, payload)); } else { @@ -998,7 +900,7 @@ void LLIMMgr::inviteToSession( } } -//static +//static void LLIMMgr::onInviteNameLookup(const LLUUID& id, const std::string& full_name, bool is_group, LLSD payload) { payload["caller_name"] = full_name; @@ -1234,7 +1136,8 @@ void LLIMMgr::noteOfflineUsers( S32 count = ids.count(); if(count == 0) { - floater->addHistoryLine(sOnlyUserMessage, gSavedSettings.getColor4("SystemChatColor")); + const std::string& only_user = LLTrans::getString("only_user_message"); + floater->addHistoryLine(only_user, gSavedSettings.getColor4("SystemChatColor")); } else { @@ -1244,10 +1147,11 @@ void LLIMMgr::noteOfflineUsers( { info = at.getBuddyInfo(ids.get(i)); std::string full_name; - if(info && !info->isOnline() - && gCacheName->getFullName(ids.get(i), full_name)) + if (info + && !info->isOnline() + && gCacheName->getFullName(ids.get(i), full_name)) { - LLUIString offline = sOfflineMessage; + LLUIString offline = LLTrans::getString("offline_message"); offline.setArg("[NAME]", full_name); floater->addHistoryLine(offline, gSavedSettings.getColor4("SystemChatColor")); } @@ -1272,7 +1176,8 @@ void LLIMMgr::noteMutedUsers(LLFloaterIMPanel* floater, { if( ml->isMuted(ids.get(i)) ) { - LLUIString muted = sMutedMessage; + LLUIString muted = LLTrans::getString("muted_message"); + floater->addHistoryLine(muted); break; } @@ -1474,10 +1379,8 @@ public: } else { - //throw an error dialog and close the temp session's - //floater - LLFloaterIMPanel* floater = - gIMMgr->findFloaterBySession(temp_session_id); + //throw an error dialog and close the temp session's floater + LLFloaterIMPanel* floater = gIMMgr->findFloaterBySession(temp_session_id); if ( floater ) { diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index be8db650a..fc2dd33b7 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -221,7 +221,7 @@ private: std::list mIgnoreGroupList; public: - + S32 getIgnoreGroupListCount() { return mIgnoreGroupList.size(); } }; @@ -230,11 +230,6 @@ class LLFloaterIM : public LLMultiFloater { public: LLFloaterIM(); - /*virtual*/ BOOL postBuild(); - - static std::map sEventStringsMap; - static std::map sErrorStringsMap; - static std::map sForceCloseSessionMap; }; // Globals diff --git a/indra/newview/llnotify.h b/indra/newview/llnotify.h index 439cae239..4047430a5 100644 --- a/indra/newview/llnotify.h +++ b/indra/newview/llnotify.h @@ -152,7 +152,7 @@ public: public: Matcher(){} virtual ~Matcher() {} - virtual BOOL matches(const LLNotificationPtr) const = 0; + virtual bool matches(const LLNotificationPtr) const = 0; }; // Walks the list and removes any stacked messages for which the given matcher returns TRUE. // Useful when muting people and things in order to clear out any similar previously queued messages. diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index 4baa6cd8b..9b7ee5c78 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -1105,7 +1105,7 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg, text.append(1, '\n'); - text.append(llformat("%-24s %6d\n", "Total", total_amount)); + text.append(llformat("%-24s %6d\n", LLTrans::getString("GroupMoneyTotal").c_str(), total_amount)); if ( mImplementationp->mTextEditorp ) { @@ -1227,7 +1227,7 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg, S32 transactions = msg->getNumberOfBlocksFast(_PREHASH_HistoryData); if (transactions == 0) { - text.append("(none)"); + text.append(LLTrans::getString("none_text")); } else { @@ -1252,22 +1252,22 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg, switch(type) { case TRANS_OBJECT_SALE: - verb = "bought"; + verb = LLTrans::getString("GroupMoneyBought").c_str(); break; case TRANS_GIFT: - verb = "paid you"; + verb = LLTrans::getString("GroupMoneyPaidYou").c_str(); break; case TRANS_PAY_OBJECT: - verb = "paid into"; + verb = LLTrans::getString("GroupMoneyPaidInto").c_str(); break; case TRANS_LAND_PASS_SALE: - verb = "bought pass to"; + verb = LLTrans::getString("GroupMoneyBoughtPassTo").c_str(); break; case TRANS_EVENT_FEE: - verb = "paid fee for event"; + verb = LLTrans::getString("GroupMoneyPaidFeeForEvent").c_str(); break; case TRANS_EVENT_PRIZE: - verb = "paid prize for event"; + verb = LLTrans::getString("GroupMoneyPaidPrizeForEvent").c_str(); break; default: verb = ""; @@ -1429,15 +1429,18 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg, return; } - text.append("Summary for this week, beginning on "); + text.append(LLTrans::getString("SummaryForTheWeek")); + text.append(start_date); + text.append(". "); if (current_interval == 0) { - text.append("The next stipend day is "); + text.append(LLTrans::getString("NextStipendDay")); + text.append(next_stipend_date); - text.append("\n\n"); - text.append(llformat("%-24s%s%6d\n", "Balance", + text.append(".\n\n"); + text.append(llformat("%-24s%s%6d\n", LLTrans::getString("GroupMoneyBalance").c_str(), gHippoGridManager->getConnectedGrid()->getCurrencySymbol().c_str(), balance)); text.append(1, '\n'); @@ -1445,15 +1448,15 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg, // [DEV-29503] Hide the individual info since // non_exempt_member here is a wrong choice to calculate individual shares. - // text.append( " Group Individual Share\n"); - // text.append(llformat( "%-24s %6d %6d \n", "Credits", total_credits, (S32)floor((F32)total_credits/(F32)non_exempt_members))); - // text.append(llformat( "%-24s %6d %6d \n", "Debits", total_debits, (S32)floor((F32)total_debits/(F32)non_exempt_members))); - // text.append(llformat( "%-24s %6d %6d \n", "Total", total_credits + total_debits, (S32)floor((F32)(total_credits + total_debits)/(F32)non_exempt_members))); +// text.append( LLTrans::getString("GroupIndividualShare")); +// text.append(llformat( "%-24s %6d %6d \n", LLTrans::getString("GroupMoneyCredits").c_str(), total_credits, (S32)floor((F32)total_credits/(F32)non_exempt_members))); +// text.append(llformat( "%-24s %6d %6d \n", LLTrans::getString("GroupMoneyDebits").c_str(), total_debits, (S32)floor((F32)total_debits/(F32)non_exempt_members))); +// text.append(llformat( "%-24s %6d %6d \n", LLTrans::getString("GroupMoneyTotal").c_str(), total_credits + total_debits, (S32)floor((F32)(total_credits + total_debits)/(F32)non_exempt_members))); - text.append( " Group\n"); - text.append(llformat( "%-24s %6d\n", "Credits", total_credits)); - text.append(llformat( "%-24s %6d\n", "Debits", total_debits)); - text.append(llformat( "%-24s %6d\n", "Total", total_credits + total_debits)); + text.append(llformat( "%s\n", LLTrans::getString("GroupColumn").c_str())); + text.append(llformat( "%-24s %6d\n", LLTrans::getString("GroupMoneyCredits").c_str(), total_credits)); + text.append(llformat( "%-24s %6d\n", LLTrans::getString("GroupMoneyDebits").c_str(), total_debits)); + text.append(llformat( "%-24s %6d\n", LLTrans::getString("GroupMoneyTotal").c_str(), total_credits + total_debits)); if ( mImplementationp->mTextEditorp ) { diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index c78f3ce21..8929780d5 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -94,8 +94,8 @@ public: LLTaskInvFVBridge(LLPanelObjectInventory* panel, const LLUUID& uuid, const std::string& name, - U32 flags=0); - virtual ~LLTaskInvFVBridge( ) {} + U32 flags=0); + virtual ~LLTaskInvFVBridge() {} virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } virtual std::string getLabelSuffix() const { return LLStringUtil::null; } @@ -243,9 +243,9 @@ void LLTaskInvFVBridge::buyItem() if (sale_info.getSaleType() != LLSaleInfo::FS_CONTENTS) { U32 next_owner_mask = perm.getMaskNextOwner(); - args["MODIFYPERM"] = LLNotifications::instance().getGlobalString((next_owner_mask & PERM_MODIFY) ? "PermYes" : "PermNo"); - args["COPYPERM"] = LLNotifications::instance().getGlobalString((next_owner_mask & PERM_COPY) ? "PermYes" : "PermNo"); - args["RESELLPERM"] = LLNotifications::instance().getGlobalString((next_owner_mask & PERM_TRANSFER) ? "PermYes" : "PermNo"); + args["MODIFYPERM"] = LLTrans::getString((next_owner_mask & PERM_MODIFY) ? "PermYes" : "PermNo"); + args["COPYPERM"] = LLTrans::getString((next_owner_mask & PERM_COPY) ? "PermYes" : "PermNo"); + args["RESELLPERM"] = LLTrans::getString((next_owner_mask & PERM_TRANSFER) ? "PermYes" : "PermNo"); } std::string alertdesc; @@ -318,10 +318,18 @@ const std::string& LLTaskInvFVBridge::getName() const const std::string& LLTaskInvFVBridge::getDisplayName() const { LLInventoryItem* item = findItem(); + if(item) { mDisplayName.assign(item->getName()); + // Localize "New Script", "New Script 1", "New Script 2", etc. + if (item->getType() == LLAssetType::AT_LSL_TEXT && + LLStringUtil::startsWith(item->getName(), "New Script")) + { + LLStringUtil::replaceString(mDisplayName, "New Script", LLTrans::getString("PanelContentsNewScript")); + } + const LLPermissions& perm(item->getPermissions()); BOOL copy = gAgent.allowOperation(PERM_COPY, perm, GP_OBJECT_MANIPULATE); BOOL mod = gAgent.allowOperation(PERM_MODIFY, perm, GP_OBJECT_MANIPULATE); @@ -677,7 +685,9 @@ void LLTaskInvFVBridge::performAction(LLInventoryModel* model, std::string actio { if (price > 0 && price > gStatusBar->getBalance()) { - LLFloaterBuyCurrency::buyCurrency("This costs", price); + LLStringUtil::format_map_t args; + args["CURRENCY"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); + LLFloaterBuyCurrency::buyCurrency( LLTrans::getString("this_costs", args), price ); } else { @@ -723,7 +733,7 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else { std::ostringstream info; - info << "Buy for " << gHippoGridManager->getConnectedGrid()->getCurrencySymbol() << price; + info << LLTrans::getString("Buyfor") << gHippoGridManager->getConnectedGrid()->getCurrencySymbol() << price; label.assign(info.str()); } @@ -1013,8 +1023,8 @@ class LLTaskSoundBridge : public LLTaskInvFVBridge { public: LLTaskSoundBridge(LLPanelObjectInventory* panel, - const LLUUID& uuid, - const std::string& name) : + const LLUUID& uuid, + const std::string& name) : LLTaskInvFVBridge(panel, uuid, name) {} virtual BOOL canOpenItem() const { return TRUE; } @@ -1086,7 +1096,7 @@ void LLTaskSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else { std::ostringstream info; - info << "Buy for " << gHippoGridManager->getConnectedGrid()->getCurrencySymbol() << price; + info << LLTrans::getString("Buyfor") << gHippoGridManager->getConnectedGrid()->getCurrencySymbol() << price; label.assign(info.str()); } @@ -1121,6 +1131,7 @@ void LLTaskSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } items.push_back(std::string("Task Play")); + /*menu.addSeparator(); menu.append(new LLMenuItemCallGL("Play", &LLTaskSoundBridge::playSound, @@ -1138,8 +1149,8 @@ class LLTaskLandmarkBridge : public LLTaskInvFVBridge { public: LLTaskLandmarkBridge(LLPanelObjectInventory* panel, - const LLUUID& uuid, - const std::string& name) : + const LLUUID& uuid, + const std::string& name) : LLTaskInvFVBridge(panel, uuid, name) {} }; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a48ac85d7..997e452ba 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -184,6 +184,7 @@ // NaCl - Antispam Registry #include "NACLantispam.h" // NaCl - Newline flood protection +#include #include static const boost::regex NEWLINES("\\n{1}"); // NaCl End @@ -1321,7 +1322,7 @@ void inventory_offer_mute_callback(const LLUUID& blocked_id, { public: OfferMatcher(const LLUUID& to_block) : blocked_id(to_block) {} - BOOL matches(const LLNotificationPtr notification) const + bool matches(const LLNotificationPtr notification) const { if(notification->getName() == "ObjectGiveItem" || notification->getName() == "ObjectGiveItemUnknownUser" @@ -1701,7 +1702,7 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) } // [/RLVa:KB] } - + LLSD args; args["[OBJECTNAME]"] = msg; @@ -1711,7 +1712,9 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) std::string typestr = ll_safe_string(LLAssetType::lookupHumanReadable(info->mType)); if (!typestr.empty()) { - args["OBJECTTYPE"] = typestr; + // human readable matches string name from strings.xml + // lets get asset type localized name + args["OBJECTTYPE"] = LLTrans::getString(typestr); } else { @@ -1934,7 +1937,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLChat chat; std::string buffer; - // *TODO:translate - need to fix the full name to first/last (maybe) + // *TODO: Translate - need to fix the full name to first/last (maybe) msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, from_id); msg->getBOOLFast(_PREHASH_MessageBlock, _PREHASH_FromGroup, from_group); msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_ToAgentID, to_id); @@ -1958,11 +1961,13 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if((U32)std::abs(std::distance(iter, boost::sregex_iterator())) > SpamNewlines) { NACLAntiSpamRegistry::blockOnQueue((U32)NACLAntiSpamRegistry::QUEUE_IM,from_id); + llinfos << "[antispam] blocked owner due to too many newlines: " << from_id << llendl; if(gSavedSettings.getBOOL("AntiSpamNotify")) { LLSD args; - args["MESSAGE"] = "Message: Blocked newline flood from "+from_id.asString(); - LLNotificationsUtil::add("SystemMessageTip", args); + args["SOURCE"] = from_id.asString(); + args["AMOUNT"] = boost::lexical_cast(SpamNewlines); + LLNotificationsUtil::add("AntiSpamNewlineFlood", args); } return; } @@ -2438,7 +2443,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_MESSAGEBOX: { // This is a block, modeless dialog. - // *TODO:translate + // *TODO: Translate args["MESSAGE"] = message; LLNotificationsUtil::add("SystemMessage", args); } @@ -2642,19 +2647,12 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) info->mTransactionID = session_id; info->mFolderID = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(info->mType)); - if (dialog == IM_TASK_INVENTORY_OFFERED) - { - info->mFromObject = TRUE; - } - else - { - info->mFromObject = FALSE; - } + info->mFromObject = (dialog == IM_TASK_INVENTORY_OFFERED); info->mFromName = name; info->mDesc = message; info->mHost = msg->getSender(); //if (((is_busy && !is_owned_by_me) || is_muted)) - if ( is_muted ) + if (is_muted) { // Same as closing window info->forceResponse(IOR_DECLINE); @@ -2811,7 +2809,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // Build a link to open the object IM info window. std::string location = ll_safe_string((char*)binary_bucket,binary_bucket_size); - + LLSD query_string; query_string["owner"] = from_id; query_string["slurl"] = location.c_str(); @@ -2819,7 +2817,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if (from_group) { query_string["groupowned"] = "true"; - } + } if (session_id.notNull()) { @@ -2932,7 +2930,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // [/RLVa:KB] LLSD args; - // *TODO:translate -> [FIRST] [LAST] (maybe) + // *TODO: Translate -> [FIRST] [LAST] (maybe) args["NAME"] = name; args["MESSAGE"] = message; LLSD payload; @@ -3085,7 +3083,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) else { args["[MESSAGE]"] = message; - LLNotificationsUtil::add("OfferFriendship", args, payload); + LLNotificationsUtil::add("OfferFriendship", args, payload); } } } @@ -3226,7 +3224,7 @@ void process_offer_callingcard(LLMessageSystem* msg, void**) LLNameValue* nvlast = source->getNVPair("LastName"); if (nvfirst && nvlast) { - args["NAME"] = LLCacheName::buildFullName( + source_name = LLCacheName::buildFullName( nvfirst->getString(), nvlast->getString()); } } @@ -3241,6 +3239,7 @@ void process_offer_callingcard(LLMessageSystem* msg, void**) } else { + args["NAME"] = source_name; LLNotificationsUtil::add("OfferCallingCard", args, payload); } } @@ -3355,7 +3354,7 @@ class AuthHandler : public HippoRestHandlerRaw void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) { - LLChat chat; + LLChat chat; std::string mesg; std::string from_name; U8 source_temp; @@ -3388,7 +3387,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) } msg->getUUID("ChatData", "OwnerID", owner_id); - + msg->getU8Fast(_PREHASH_ChatData, _PREHASH_SourceType, source_temp); chat.mSourceType = (EChatSourceType)source_temp; @@ -3450,7 +3449,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) LLSD args; args["NAME"] = from_name; chat.mPosAgent = chatter->getPositionAgent(); - + // Make swirly things only for talking objects. (not script debug messages, though) // if (chat.mSourceType == CHAT_SOURCE_OBJECT // && chat.mChatType != CHAT_TYPE_DEBUG_MSG @@ -4160,7 +4159,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**) // Make sure we're standing gAgent.standUp(); - + // now, use the circuit info to tell simulator about us! LL_INFOS("Messaging") << "process_teleport_finish() Enabling " << sim_host << " with code " << msg->mOurCircuitCode << LL_ENDL; @@ -4299,9 +4298,9 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) // if (avatarp) { // Chat the "back" SLURL. (DEV-4907) - LLChat chat("Teleport completed from " + gAgent.getTeleportSourceSLURL()); + LLChat chat(LLTrans::getString("completed_from") + gAgent.getTeleportSourceSLURL()); chat.mSourceType = CHAT_SOURCE_SYSTEM; - LLFloaterChat::addChatHistory(chat); + LLFloaterChat::addChatHistory(chat); // Set the new position gAgentAvatarp->setPositionAgent(agent_pos); @@ -4314,7 +4313,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) } else { - // This is likely just the initial logging in phase. + // This is initial log-in or a region crossing gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); if(LLStartUp::getStartupState() < STATE_STARTED) @@ -4557,7 +4556,7 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) control_flag_change != 0 || flag_change != 0) { -/* + /* if (head_rot_chg < THRESHOLD_HEAD_ROT_QDOT) { //LL_INFOS("Messaging") << "head rot " << head_rotation << LL_ENDL; @@ -4579,7 +4578,7 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) { LL_INFOS("Messaging") << "dcf = " << control_flag_change << LL_ENDL; } -*/ + */ duplicate_count = 0; } @@ -5327,7 +5326,7 @@ void process_avatar_appearance(LLMessageSystem *mesgsys, void **user_data) mesgsys->getUUIDFast(_PREHASH_Sender, _PREHASH_ID, uuid); LLVOAvatar* avatarp = gObjectList.findAvatar(uuid); - if( avatarp ) + if (avatarp) { avatarp->processAvatarAppearance( mesgsys ); } @@ -5926,24 +5925,33 @@ void process_alert_core(const std::string& message, BOOL modal) } else { - // *TODO:translate - args["MESSAGE"] = text; + std::string new_msg =LLNotifications::instance().getGlobalString(text); + args["MESSAGE"] = new_msg; LLNotificationsUtil::add("SystemMessage", args); } } else if (modal) { - // *TODO:translate LLSD args; - args["ERROR_MESSAGE"] = message; + std::string new_msg =LLNotifications::instance().getGlobalString(message); + args["ERROR_MESSAGE"] = new_msg; LLNotificationsUtil::add("ErrorMessage", args); } else { - // *TODO:translate - LLSD args; - args["MESSAGE"] = message; - LLNotificationsUtil::add("SystemMessageTip", args); + // Hack fix for EXP-623 (blame fix on RN :)) to avoid a sim deploy + const std::string AUTOPILOT_CANCELED_MSG("Autopilot canceled"); + if (message.find(AUTOPILOT_CANCELED_MSG) == std::string::npos ) + { + LLSD args; + std::string new_msg =LLNotifications::instance().getGlobalString(message); + + std::string localized_msg; + bool is_message_localized = LLTrans::findString(localized_msg, new_msg); + + args["MESSAGE"] = is_message_localized ? localized_msg : new_msg; + LLNotificationsUtil::add("SystemMessageTip", args); + } } } @@ -6230,7 +6238,7 @@ bool script_question_cb(const LLSD& notification, const LLSD& response) { public: OfferMatcher(const LLUUID& to_block) : blocked_id(to_block) {} - BOOL matches(const LLNotificationPtr notification) const + bool matches(const LLNotificationPtr notification) const { if (notification->getName() == "ScriptQuestionCaution" || notification->getName() == "ScriptQuestion") @@ -6416,7 +6424,7 @@ void container_inventory_arrived(LLViewerObject* object, // create a new inventory category to put this in LLUUID cat_id; cat_id = gInventory.createNewCategory(gInventory.getRootFolderID(), - LLFolderType::FT_NONE, + LLFolderType::FT_NONE, LLTrans::getString("AcquiredItems")); LLInventoryObject::object_list_t::const_iterator it = inventory->begin(); @@ -6524,6 +6532,9 @@ void process_teleport_failed(LLMessageSystem *msg, void**) std::string big_reason; LLSD args; + // Let the interested parties know that teleport failed. + LLViewerParcelMgr::getInstance()->onTeleportFailed(); + // if we have additional alert data if (msg->has(_PREHASH_AlertInfo) && msg->getSizeFast(_PREHASH_AlertInfo, _PREHASH_Message) > 0) { @@ -6582,9 +6593,6 @@ void process_teleport_failed(LLMessageSystem *msg, void**) LLNotificationsUtil::add("CouldNotTeleportReason", args); - // Let the interested parties know that teleport failed. - LLViewerParcelMgr::getInstance()->onTeleportFailed(); - if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE ) { gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); @@ -6608,7 +6616,7 @@ void process_teleport_local(LLMessageSystem *msg,void**) msg->getVector3Fast(_PREHASH_Info, _PREHASH_Position, pos); msg->getVector3Fast(_PREHASH_Info, _PREHASH_LookAt, look_at); msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags); - + if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE ) { if( gAgent.getTeleportState() == LLAgent::TELEPORT_LOCAL ) @@ -6782,6 +6790,7 @@ void handle_lure(const uuid_vec_t& ids) if (ids.empty()) return; if (!gAgent.getRegion()) return; + LLSD edit_args; // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-04 (RLVa-1.0.0a) edit_args["REGION"] = @@ -6909,6 +6918,7 @@ const char* SCRIPT_DIALOG_HEADER = "Script Dialog:\n"; bool callback_script_dialog(const LLSD& notification, const LLSD& response) { LLNotificationForm form(notification["form"]); + std::string button = LLNotification::getSelectedOptionName(response); S32 button_idx = LLNotification::getSelectedOption(notification, response); // Didn't click "Ignore" @@ -6954,7 +6964,7 @@ void process_script_dialog(LLMessageSystem* msg, void**) return; // NaCl End - // For compability with OS grids first check for presence of extended packet before fetching data. +// For compability with OS grids first check for presence of extended packet before fetching data. LLUUID owner_id; if (gMessageSystem->getNumberOfBlocks("OwnerData") > 0) { @@ -6974,12 +6984,12 @@ void process_script_dialog(LLMessageSystem* msg, void**) std::string message; std::string first_name; std::string last_name; - std::string title; + std::string object_name; S32 chat_channel; msg->getString("Data", "FirstName", first_name); msg->getString("Data", "LastName", last_name); - msg->getString("Data", "ObjectName", title); + msg->getString("Data", "ObjectName", object_name); msg->getString("Data", "Message", message); msg->getS32("Data", "ChatChannel", chat_channel); @@ -7017,7 +7027,7 @@ void process_script_dialog(LLMessageSystem* msg, void**) } else { - for (i = 1; i < button_count; i++) + for (i = 1; i < button_count; i++) { std::string tdesc; msg->getString("Buttons", "ButtonLabel", tdesc, i); @@ -7026,7 +7036,7 @@ void process_script_dialog(LLMessageSystem* msg, void**) } LLSD args; - args["TITLE"] = title; + args["TITLE"] = object_name; args["MESSAGE"] = message; // args["CHANNEL"] = chat_channel; @@ -7090,7 +7100,7 @@ void callback_load_url_name(const LLUUID& id, const std::string& full_name, bool std::string owner_name; if (is_group) { - owner_name = full_name + " (group)"; + owner_name = full_name + LLTrans::getString("Group"); } else { @@ -7220,7 +7230,7 @@ void process_script_teleport_request(LLMessageSystem* msg, void**) return; // NaCl End if (!gSavedSettings.getBOOL("ScriptsCanShowUI")) return; - + std::string object_name; std::string sim_name; LLVector3 pos; @@ -7292,11 +7302,11 @@ void process_covenant_reply(LLMessageSystem* msg, void**) if (estate_owner_id.isNull()) { // mainland - covenant_text = "There is no Covenant provided for this Estate."; + covenant_text = LLTrans::getString("RegionNoCovenant"); } else { - covenant_text = "There is no Covenant provided for this Estate. The land on this estate is being sold by the Estate owner, not Linden Lab. Please contact the Estate Owner for sales details."; + covenant_text = LLTrans::getString("RegionNoCovenantOtherOwner"); } LLPanelEstateCovenant::updateCovenantText(covenant_text, covenant_id); LLPanelLandCovenant::updateCovenantText(covenant_text); @@ -7432,3 +7442,4 @@ void LLOfferInfo::forceResponse(InventoryOfferResponse response) params.functor(boost::bind(&LLOfferInfo::inventory_offer_callback, this, _1, _2)); LLNotifications::instance().forceResponse(params, response); } + diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index ed81936f7..6f6411ce3 100644 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -177,8 +177,7 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID else { LLSD args; - // *TODO:translate - args["TYPE"] = LLAssetType::lookupHumanReadable(data->mAssetType); + args["TYPE"] =LLTrans::getString(LLAssetType::lookupHumanReadable(data->mAssetType)); if (isNewWearable) { LLNotificationsUtil::add("InvalidWearable"); @@ -230,7 +229,7 @@ LLWearable* LLWearableList::createNewWearable( LLWearableType::EType type ) LLWearable *wearable = generateNewWearable(); wearable->setType( type ); - std::string name = LLWearableType::getTypeDefaultNewName(wearable->getType()); + std::string name = LLTrans::getString( LLWearableType::getTypeDefaultNewName(wearable->getType()) ); wearable->setName( name ); LLPermissions perm; diff --git a/indra/newview/skins/default/xui/en-us/floater_god_tools.xml b/indra/newview/skins/default/xui/en-us/floater_god_tools.xml index c4dd40f74..bb8e1c8a8 100644 --- a/indra/newview/skins/default/xui/en-us/floater_god_tools.xml +++ b/indra/newview/skins/default/xui/en-us/floater_god_tools.xml @@ -154,6 +154,10 @@ + + (no target) + - - You are the only user in this session. - - - [NAME] is offline. - - - Click the [BUTTON NAME] button to accept/connect to this voice chat. - - - You have muted this resident. Sending a message will automatically unmute them. - - - - Error making request, please try again later. - - - You do not have sufficient permissions. - - - The session no longer exists - - - You do not have that ability. - - - You are not a session moderator. - - - A group moderator disabled your text chat. - - - - - Unable to add users to chat session with [RECIPIENT]. - - - Unable to send your message to the chat session with [RECIPIENT]. - - - You have been removed from the group. - - - You no longer have the ability to be in the chat session. - diff --git a/indra/newview/skins/default/xui/en-us/notifications.xml b/indra/newview/skins/default/xui/en-us/notifications.xml index a9c19325f..acb78b1f4 100644 --- a/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/indra/newview/skins/default/xui/en-us/notifications.xml @@ -3346,6 +3346,87 @@ You are no longer frozen. + +Hi [DISPLAY_NAME]! + +Just like in real life, it takes a while for everyone to learn about a new name. Please allow several days for [http://wiki.secondlife.com/wiki/Setting_your_display_name your name to update] in objects, scripts, search, etc. + + + +Sorry, you cannot change your display name. If you feel this is in error, please contact support. + + + +Sorry, that name is too long. Display names can have a maximum of [LENGTH] characters. + +Please try a shorter name. + + + + Sorry, we could not set your display name. Please try again later. + + + + The display names you entered do not match. Please re-enter. + + + + +Sorry, you have to wait longer before you can change your display name. + +See http://wiki.secondlife.com/wiki/Setting_your_display_name + +Please try again later. + + + + Sorry, we could not set your requested name because it contains a banned word. + + Please try a different name. + + + + The display name you wish to set contains invalid characters. + + + + Your display name must contain letters other than punctuation. + + + + [OLD_NAME] ([SLID]) is now known as [NEW_NAME]. + + -You cannot add yourself as a friend. +Although you're very nice, you cannot add yourself as a friend. - You paid [CURRENCY][AMOUNT] to upload. - + -[NAME] accepted your inventory offer. +[NAME] received your inventory offer. - No Media Plugin was found to handle the "[MIME_TYPE]" mime type. Media of this type will be unavailable. +No Media Plugin was found to handle the "[MIME_TYPE]" mime type. Media of this type will be unavailable. - The following Media Plugin has failed: +The following Media Plugin has failed: [PLUGIN] Please re-install the plugin or contact the vendor if you continue to experience problems. @@ -6000,6 +6081,7 @@ You cannot create objects here. yestext="OK" /> + - Teleport cancelled. +Teleport cancelled. - The item you are trying to wear uses a feature that your viewer can't read. Please consider using the latest [APP_NAME]. +The item you are trying to wear uses a feature that your Viewer can't read. Please consider using the latest [APP_NAME]. - -- Your CPU speed does not meet the minimum requirements. - - - - You do not appear to have the proper hardware requirements for [APP_NAME]. The viewer requires an OpenGL graphics card that has multitexture support. If this is the case, you may want to make sure that you have the latest drivers for your graphics card, and service packs and patches for your operating system. - - - - You do not appear to have the proper hardware requirements for [APP_NAME]. The viewer requires a CPU that supports SSE2 - - - - You do not appear to have the proper hardware requirements for [APP_NAME]. The viewer requires a CPU that supports SSE - - - -796 - - - -510 - - - -- Your graphics card does not meet the minimum requirements. - - - -- Your system memory does not meet the minimum requirements. - - - -Yes - - - -No - - - - Hi [DISPLAY_NAME]! - - Just like in real life, it takes a while for everyone to learn about a new name. Please allow several days for [http://wiki.secondlife.com/wiki/Setting_your_display_name your name to update] in objects, scripts, search, etc. - - - - Sorry, you cannot change your display name. If you feel this is in error, please contact support. - - - - Sorry, that name is too long. Display names can have a maximum of [LENGTH] characters. - - Please try a shorter name. - - - - Sorry, we could not set your display name. Please try again later. - - - - The display names you entered do not match. Please re-enter. - - - - - Sorry, you have to wait longer before you can change your display name. - - See http://wiki.secondlife.com/wiki/Setting_your_display_name - - Please try again later. - - - - Sorry, we could not set your requested name because it contains a banned word. - - Please try a different name. - - - - The display name you wish to set contains invalid characters. - - - - Your display name must contain letters other than punctuation. - - - - [OLD_NAME] ([SLID]) is now known as [NEW_NAME]. - - - Blocked calling cards from [NAME] ([SOURCE]) - Blocking all dialogs from [NAME]'s objects. (Origin: [SOURCE]) - Blocked spam from avatar [NAME] ([SOURCE]) - Blocked spam from objects owned by [OWNER] ([SOURCE]) - Blocked chat-spam from avatar [NAME] ([SOURCE]) - Blocked chat-spam from objects owned by [OWNER] ([SOURCE]) - + +You do not appear to have the proper hardware requirements for [APP_NAME]. The viewer requires an OpenGL graphics card that has multitexture support. If this is the case, you may want to make sure that you have the latest drivers for your graphics card, and service packs and patches for your operating system. + + + +796 + + + +510 + + + +- Your CPU speed does not meet the minimum requirements. + + + + You do not appear to have the proper hardware requirements for [APP_NAME]. The viewer requires a CPU that supports SSE2 + + + + You do not appear to have the proper hardware requirements for [APP_NAME]. The viewer requires a CPU that supports SSE + + + +- Your graphics card does not meet the minimum requirements. + + + +- Your system memory does not meet the minimum requirements. + + + + +If you own a piece of land, you can make it your home location. +Otherwise, you can look at the Map and find places marked "Infohub". + + +You died and have been teleported to your home location. + + + +AntiSpam: Blocked [SOURCE] for spamming [TYPE]s [AMOUNT] times in [TIME] seconds. + + + +AntiSpam: Blocked newline flood from [SOURCE] (over [AMOUNT] newlines). + diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml index 64e739716..0708bb56b 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml @@ -73,8 +73,8 @@ - - + + diff --git a/indra/newview/skins/default/xui/en-us/strings.xml b/indra/newview/skins/default/xui/en-us/strings.xml index aa9dfc1d5..360b1b120 100644 --- a/indra/newview/skins/default/xui/en-us/strings.xml +++ b/indra/newview/skins/default/xui/en-us/strings.xml @@ -151,6 +151,45 @@ Viewer and server do not agree on price Unknown status + + + + texture + sound + calling card + inventory + instant message + script dialog + sound preload + teleport + unknown + landmark + legacy script + clothing + object + notecard + folder + root + LSL2 script + LSL bytecode + tga texture + body part + snapshot + Lost and Found + targa image + Trash + jpeg image + animation + gesture + simstate + favorite + link + folder link + current outfit + outfit + my outfits + mesh + (Editing Appearance) Away @@ -234,12 +273,29 @@ Loading... Offline + None found. OK whispers: shouts: + Connecting to in-world Voice Chat... + Connected + Voice not available at your current location + Disconnected from in-world Voice Chat + Take currency from you + Act on your control inputs + Remap your control inputs + Animate your avatar + Attach to your avatar + Release ownership and become public + Link and delink from other objects + Add and remove joints with other objects + Change its permissions + Track your camera + Control your camera + Teleport you PG @@ -1204,7 +1260,7 @@ Returns the mean region frames per second llParticleSystem(list rules) -Creates a particle system based on rules. An empty list removes the particle system. +Creates a particle system based on rules. An empty list removes the particle system. List format is [ rule1, data1, rule2, data2 . . . rulen, datan ] @@ -1241,7 +1297,7 @@ Removes the enabled bits in 'flags' llSitTarget(vector offset, rotation rot) -Sets the sit location for the prim. If offset == <0,0,0> then the sit target is removed. +Sets the sit location for the prim. If offset == <0,0,0> then the sit target is removed. key llAvatarOnSitTarget() @@ -1720,7 +1776,8 @@ Returns the media params for a particular face on an object, given the desired l integer llClearPrimMedia(integer face) -Clears (deletes) the media and all params from the given face. +Clears (deletes) the media and all params from the given face. + llSetLinkPrimitiveParamsFast(integer linknumber, list rules) Set primitive parameters for linknumber based on rules with no built-in script sleep. @@ -2811,10 +2868,14 @@ Where tag = tag string to match. Removes bot's matching the tag. + + Yes + No + - - - + + + @@ -2845,6 +2906,7 @@ Where tag = tag string to match. Removes bot's matching the tag. Buy + Stone Metal @@ -2877,7 +2939,44 @@ Where tag = tag string to match. Removes bot's matching the tag. Save complete. Script (object out of range) + + Object [OBJECT] owned by [OWNER] + + + (Unknown) + + + + + + + parent estate + mainland + teen + + + + error + + all estates owned by [OWNER] + + all estates that you own + + all estates that you manage for [OWNER] + + Allowed Residents: ([ALLOWEDAGENTS], max [MAXACCESS]) + Allowed groups: ([ALLOWEDGROUPS], max [MAXACCESS]) + + + New Script + + + There is no Covenant provided for this Estate. + There is no Covenant provided for this Estate. The land on this estate is being sold by the Estate owner, not Linden Lab. Please contact the Estate Owner for sales details. + + Local Local Settings @@ -2893,6 +2992,18 @@ Where tag = tag string to match. Removes bot's matching the tag. gave you You decline [DESC] from [NAME]. + + Total + bought + paid you + paid into + bought pass to + paid fee for event + paid prize for event + Balance + Credits + Debits + Acquired Items Cancel @@ -3580,7 +3691,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Autoresponse sent to was sent auto-response item (Unnamed) - (Saved [LONG_TIMESTAMP]) + You are bestowed with powers beyond mortal comprehension. Use your newfound abilities wisely. Unlocked: @@ -3589,6 +3700,108 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Destroy objects - Permanently deletes an object immediately, when you don't feel like waiting for the server to respond. Explode objects - Turns an object physical, temporary, and delinks it. + + + + Joining voice call... + + + Connected, click Leave Call to hang up + + + Left voice call + + + Connecting... + + + Inventory item offered + + + + + You are the only user in this session. + + + [NAME] is offline. + + + Click the [BUTTON NAME] button to accept/connect to this voice chat. + + + You have muted this Resident. Sending a message will automatically unmute them. + + + + Error making request, please try again later. + + + Error making request, please try again later. + + + You do not have sufficient permissions. + + + The session no longer exists + + + You do not have that ability. + + + You do not have that ability. + + + You are not a session moderator. + + + + A group moderator disabled your text chat. + + + A group moderator disabled your text chat. + + + Unable to add users to chat session with [RECIPIENT]. + + + + Unable to send your message to the chat session with [RECIPIENT]. + + + Unable to send your message to the chat session with [RECIPIENT]. + + + Error while moderating. + + + + You have been removed from the group. + + + You have been removed from the group. + + + You no longer have the ability to be in the chat session. + + + Home position set. + + + This costs [CURRENCY] + Everyone Officers Owners @@ -3598,13 +3811,13 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. none/none Chat - - Select an editor using the ExternalEditor setting. - Cannot find the external editor you specified. + + Select an editor using the ExternalEditor setting. + Cannot find the external editor you specified. Try enclosing path to the editor with double quotes. (e.g. "/path to my/editor" "%s") - Error parsing the external editor command. - External editor failed to run. + Error parsing the external editor command. + External editor failed to run. http://wiki.secondlife.com/wiki/Pathfinding_Tools_in_the_Second_Life_Viewer @@ -3616,4 +3829,7 @@ Try enclosing path to the editor with double quotes. Left Right + + Teleport completed from +