diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 33 | ||||
-rw-r--r-- | indra/newview/llautocorrect.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llautocorrectfloater.cpp | 13 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_autocorrect.xml | 4 |
4 files changed, 20 insertions, 43 deletions
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 @@ <key>Value</key> <integer>0</integer> </map> - <key>AutoCorrectCount</key> - <map> - <key>Comment</key> - <string>How many words have been auto replaced.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>0</integer> - </map> + <key>AutoCorrect</key> + <map> + <key>Comment</key> + <string>Replaces common spelling mistakes with correct word</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>AutoAcceptNewInventory</key> <map> <key>Comment</key> @@ -2808,17 +2808,6 @@ <key>Value</key> <integer>1</integer> </map> - <key>EnableAutoCorrect</key> - <map> - <key>Comment</key> - <string>Enables or disables the autocorrect function</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> <key>EnableGroupChatPopups</key> <map> <key>Comment</key> 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<bool> doAnything(gSavedSettings, "EnableAutoCorrect"); - if(doAnything) + static LLCachedControl<bool> 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<bool> doAnything(gSavedSettings, "EnableAutoCorrect"); - if(!(doAnything))return currentWord; + static LLCachedControl<bool> 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<bool> doAnything(gSavedSettings, "EnableAutoCorrect"); - if(!(doAnything))return words; + static LLCachedControl<bool> 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<S32> 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<bool> enabledd(gSavedSettings, "EnableAutoCorrect"); - if(!(enabledd)) + if(!gSavedSettings, "AutoCorrect") { updateItemsList(); return; } - static LLCachedControl<S32> 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<bool> enabledd(gSavedSettings, "EnableAutoCorrect"); - if(!(enabledd)) + if(!gSavedSettings, "AutoCorrect") { LLCheckBoxCtrl *enBox = getChild<LLCheckBoxCtrl>("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:</text> <view_border bottom_delta="-0" left_delta="180" height="16" width="70" follows="left|top" bevel_style="in" mouse_opaque="false" name="ac_statsbox"/> - <text bottom_delta="0" left_delta="0" height="16" width="70" follows="left|top" halign="center" - font="SansSerifSmall" mouse_opaque="true" name="ac_stats" - >Count</text> - </floater>
\ No newline at end of file |