From 1acae5b2915aacff7a2c7892ea2ab094b60b67c9 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 11 Jun 2012 08:21:39 -0400 Subject: fix error notices to be more prominent for invalid list names and keywords --- indra/newview/llautoreplace.cpp | 12 +++++++----- indra/newview/llautoreplace.h | 2 +- indra/newview/llfloaterautoreplacesettings.cpp | 13 ++++++------- indra/newview/skins/default/xui/en/notifications.xml | 8 ++++---- 4 files changed, 18 insertions(+), 17 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llautoreplace.cpp b/indra/newview/llautoreplace.cpp index 641e354605..0f1ce2bcd0 100644 --- a/indra/newview/llautoreplace.cpp +++ b/indra/newview/llautoreplace.cpp @@ -64,6 +64,7 @@ void LLAutoReplace::autoreplaceCallback(LLUIString& inputText, S32& cursorPos) } if (haveWord) { + // wordEnd points to the end of a word, now find the start of the word std::string word; S32 wordStart = wordEnd; for ( S32 backOne = wordStart - 1; @@ -650,6 +651,7 @@ std::string LLAutoReplaceSettings::replaceWord(const std::string currentWord) static LLCachedControl autoreplace_enabled(gSavedSettings, "AutoReplace"); if ( autoreplace_enabled ) { + LL_DEBUGS("AutoReplace")<<"checking '"< '" << replacements[currentWord].asString() << "'" + << " found in list '" << checkList[AUTOREPLACE_LIST_NAME].asString() + << " => '" << replacements[currentWord].asString() << "'" << LL_ENDL; returnedWord = replacements[currentWord].asString(); } @@ -674,7 +676,7 @@ std::string LLAutoReplaceSettings::replaceWord(const std::string currentWord) return returnedWord; } -bool LLAutoReplaceSettings::addEntryToList(std::string keyword, std::string replacement, std::string listName) +bool LLAutoReplaceSettings::addEntryToList(LLWString keyword, LLWString replacement, std::string listName) { bool added = false; @@ -685,7 +687,7 @@ bool LLAutoReplaceSettings::addEntryToList(std::string keyword, std::string repl { if ( ! LLWStringUtil::isPartOfWord(keyword[character]) ) { - LL_WARNS("AutoReplace") << "keyword '" << keyword << "' not a single word" << LL_ENDL; + LL_WARNS("AutoReplace") << "keyword '" << wstring_to_utf8str(keyword) << "' not a single word (len "<getValue().asString(); - std::string replacement = mReplacement->getValue().asString(); + LLWString keyword = mKeyword->getWText(); + LLWString replacement = mReplacement->getWText(); if ( mSettings.addEntryToList(keyword, replacement, mSelectedListName) ) { // insert the new keyword->replacement pair LL_INFOS("AutoReplace") << "list '" << mSelectedListName << "' " - << "added '" << keyword - << "' -> '" << replacement + << "added '" << wstring_to_utf8str(keyword) + << "' -> '" << wstring_to_utf8str(replacement) << "'" << LL_ENDL; updateReplacementsList(); @@ -568,8 +567,8 @@ void LLFloaterAutoReplaceSettings::onSaveEntry() { LLNotificationsUtil::add("InvalidAutoReplaceEntry"); LL_WARNS("AutoReplace")<<"invalid entry " - << "keyword '" << keyword - << "' replacement '" << replacement + << "keyword '" << wstring_to_utf8str(keyword) + << "' replacement '" << wstring_to_utf8str(replacement) << "'" << LL_ENDL; } } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 47cf35092c..bc69e973ed 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -2381,17 +2381,17 @@ Would you be my friend? + type="alertmodal"> The keyword must be a single word, and the replacement may not be empty. fail + type="alertmodal"> That replacement list is not valid. fail -- cgit v1.2.3