From d3a7a7ad4bd3d2c921f6e829aa283fece0a9da6a Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 2 Feb 2012 11:00:11 -0500 Subject: STORM-1738 Settings cleanup warn-on-failure:open-license --- indra/newview/app_settings/settings.xml | 33 ++++++++-------------- indra/newview/llautocorrect.cpp | 13 ++++----- indra/newview/llautocorrectfloater.cpp | 13 ++------- .../skins/default/xui/en/floater_autocorrect.xml | 4 --- 4 files changed, 20 insertions(+), 43 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 060ec8bd5a..16fa3a1cb2 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -346,17 +346,17 @@ Value 0 - AutoCorrectCount - - Comment - How many words have been auto replaced. - Persist - 1 - Type - S32 - Value - 0 - + AutoCorrect + + Comment + Replaces common spelling mistakes with correct word + Persist + 1 + Type + Boolean + Value + 0 + AutoAcceptNewInventory Comment @@ -2808,17 +2808,6 @@ Value 1 - EnableAutoCorrect - - Comment - Enables or disables the autocorrect function - Persist - 1 - Type - Boolean - Value - 0 - EnableGroupChatPopups Comment diff --git a/indra/newview/llautocorrect.cpp b/indra/newview/llautocorrect.cpp index d1aa2384b7..cca5c6913f 100644 --- a/indra/newview/llautocorrect.cpp +++ b/indra/newview/llautocorrect.cpp @@ -41,8 +41,8 @@ AutoCorrect::~AutoCorrect() void AutoCorrect::autocorrectCallback(LLUIString& inputText, S32& cursorPos) { - static LLCachedControl doAnything(gSavedSettings, "EnableAutoCorrect"); - if(doAnything) + static LLCachedControl perform_autocorrect(gSavedSettings, "AutoCorrect"); + if(perform_autocorrect) { S32 wordStart = 0; S32 wordEnd = cursorPos-1; @@ -290,8 +290,8 @@ LLSD AutoCorrect::getAutoCorrectEntries(std::string listName) } std::string AutoCorrect::replaceWord(std::string currentWord) { - static LLCachedControl doAnything(gSavedSettings, "EnableAutoCorrect"); - if(!(doAnything))return currentWord; + static LLCachedControl perform_autocorrect(gSavedSettings, "AutoCorrect"); + if(!(perform_autocorrect))return currentWord; //loop through priorities for(int currentPriority = 10;currentPriority>=0;currentPriority--) { @@ -337,7 +337,6 @@ std::string AutoCorrect::replaceWord(std::string currentWord) args["REPLACEMENT"]=replacement; LLNotificationsUtil::add("AutoReplace",args); } - gSavedSettings.setS32("AutoCorrectCount",gSavedSettings.getS32("AutoCorrectCount")+1); llinfos << "found a word in list " << location.c_str() << " and it will replace " << currentWord.c_str() << " => " << replacement.c_str() << llendl; return replacement; } @@ -348,8 +347,8 @@ std::string AutoCorrect::replaceWord(std::string currentWord) } std::string AutoCorrect::replaceWords(std::string words) { - static LLCachedControl doAnything(gSavedSettings, "EnableAutoCorrect"); - if(!(doAnything))return words; + static LLCachedControl perform_autocorrect(gSavedSettings, "AutoCorrect"); + if(!(perform_autocorrect))return words; //TODO update this function to use the "wordStyle" thing, //but so far this function is never used, so later diff --git a/indra/newview/llautocorrectfloater.cpp b/indra/newview/llautocorrectfloater.cpp index 6dca759b02..74762a876f 100644 --- a/indra/newview/llautocorrectfloater.cpp +++ b/indra/newview/llautocorrectfloater.cpp @@ -130,8 +130,6 @@ void AutoCorrectFloater::updateItemsList() childSetValue("ac_text_name",listName); childSetValue("ac_text_author",listData["author"]); childSetValue("ac_priority",listData["priority"]); - static LLCachedControl countAuto(gSavedSettings, "AutoCorrectCount"); - childSetValue("ac_stats",(S32)countAuto); LLSD autoCorrects = listData["data"]; LLSD::map_const_iterator loc_it = autoCorrects.beginMap(); @@ -161,14 +159,11 @@ void AutoCorrectFloater::updateItemsList() void AutoCorrectFloater::updateNamesList() { namesList->deleteAllItems(); - static LLCachedControl enabledd(gSavedSettings, "EnableAutoCorrect"); - if(!(enabledd)) + if(!gSavedSettings, "AutoCorrect") { updateItemsList(); return; } - static LLCachedControl countAuto(gSavedSettings, "AutoCorrectCount"); - childSetValue("ac_stats",(S32)countAuto); LLSD autoCorrects = AutoCorrect::getInstance()->getAutoCorrects(); LLSD::map_const_iterator loc_it = autoCorrects.beginMap(); LLSD::map_const_iterator loc_end = autoCorrects.endMap(); @@ -213,8 +208,7 @@ void AutoCorrectFloater::updateListControlsEnabled(BOOL selected) } void AutoCorrectFloater::updateEnabledStuff() { - static LLCachedControl enabledd(gSavedSettings, "EnableAutoCorrect"); - if(!(enabledd)) + if(!gSavedSettings, "AutoCorrect") { LLCheckBoxCtrl *enBox = getChild("ac_enable"); enBox->setDisabledColor(LLColor4::red); @@ -234,7 +228,6 @@ void AutoCorrectFloater::updateEnabledStuff() } void AutoCorrectFloater::setData(void * data) { - //empanel = (LLPanel*)data; } void AutoCorrectFloater::onBoxCommitEnabled(LLUICtrl* caller, void* user_data) { @@ -301,7 +294,7 @@ void AutoCorrectFloater::loadList(void* data) LLSDSerialize::fromXMLDocument(blankllsd, file); } file.close(); - gSavedSettings.setBOOL("EnableAutoCorrect",true); + gSavedSettings.setBOOL("AutoCorrect",true); AutoCorrect::getInstance()->addCorrectionList(blankllsd); if ( data ) { diff --git a/indra/newview/skins/default/xui/en/floater_autocorrect.xml b/indra/newview/skins/default/xui/en/floater_autocorrect.xml index 0b8ed1c067..b67b2e7ec0 100644 --- a/indra/newview/skins/default/xui/en/floater_autocorrect.xml +++ b/indra/newview/skins/default/xui/en/floater_autocorrect.xml @@ -75,9 +75,5 @@ >Words automatically corrected: - Count - \ No newline at end of file -- cgit v1.2.3