remove autocorrect, to be replaced by Auto Replace from LL

Tank_Master 2012-07-09 23:30:54 -07:00
parent 36e25cfb8a
commit 0d52c043d4
22 changed files with 528 additions and 10687 deletions

View File

@ -51,7 +51,6 @@
#include "lluictrlfactory.h"
#include "llclipboard.h"
#include "llmenugl.h"
#include "../newview/lggautocorrect.h"
#include "../newview/llviewercontrol.h"
// [SL:KB] - Patch: Misc-Spellcheck | Checked: 2010-12-19 (Catznip-2.7.0a)
#include "llhunspell.h"
@ -214,60 +213,6 @@ LLLineEditor::~LLLineEditor()
// calls onCommit() while LLLineEditor still valid
gFocusMgr.releaseFocusIfNeeded( this );
}
void LLLineEditor::autoCorrectText()
{
static LLCachedControl<bool> doAnything(gSavedSettings, "FSEnableAutoCorrect");
if( (!mReadOnly) && (doAnything))// && (isDirty()))
{
S32 wordStart = 0;
S32 wordEnd = mCursorPos-1;
//llinfos <<"Checking Word, Cursor is at "<<mCursorPos<<" and text is "<<mText.getString().c_str()<<llendl;
if(wordEnd < 1)
return;
LLWString text = mText.getWString();
if(text.size()<1)
return;
if( LLWStringUtil::isPartOfWord( text[wordEnd] ))
return;//we only check on word breaks
wordEnd--;
if( LLWStringUtil::isPartOfWord( text[wordEnd] ) )
{
while ((wordEnd > 0) && (' '!=text[wordEnd-1]))
{
wordEnd--;
}
wordStart=wordEnd;
while ((wordEnd < (S32)text.length()) && (' '!=text[wordEnd] ) )
{
wordEnd++;
}
std::string strLastWord = std::string(text.begin(), text.end());
std::string lastTypedWord = strLastWord.substr( wordStart, wordEnd-wordStart);
std::string correctedWord( LGGAutoCorrect::getInstance()->replaceWord(lastTypedWord));
if(correctedWord!=lastTypedWord)
{
LLWString strNew = utf8str_to_wstring( correctedWord );
LLWString strOld = utf8str_to_wstring( lastTypedWord );
int nDiff = strNew.size() - strOld.size();
//int wordStart = regText.find(lastTypedWord);
text.replace(wordStart,lastTypedWord.length(),strNew);
mText = wstring_to_utf8str(text);
mCursorPos+=nDiff;
}
}
}
}
void LLLineEditor::onFocusReceived()
{
@ -1044,8 +989,6 @@ void LLLineEditor::addChar(const llwchar uni_char)
LLUI::reportBadKeystroke();
}
autoCorrectText();
getWindow()->hideCursorUntilMouseMove();
}

View File

@ -197,7 +197,6 @@ public:
virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text );
virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text );
void autoCorrectText();
void setLabel(const LLStringExplicit &new_label) { mLabel = new_label; }
const std::string& getLabel() { return mLabel.getString(); }

View File

@ -105,8 +105,6 @@ set(viewer_SOURCE_FILES
fspanelprofile.cpp
fsradarlistctrl.cpp
#growlmanager.cpp
lggautocorrect.cpp
lggautocorrectfloater.cpp
lggbeammapfloater.cpp
lggbeammaps.cpp
lggbeamscolors.cpp
@ -735,8 +733,6 @@ set(viewer_HEADER_FILES
fsslurl.h
#growlmanager.h
#growlnotifier.h
lggautocorrect.h
lggautocorrectfloater.h
lggbeammapfloater.h
lggbeammaps.h
lggbeamscolors.h
@ -1595,7 +1591,6 @@ set(viewer_APPSETTINGS_FILES
app_settings/settings_phoenix.xml
app_settings/settings_v3.xml
app_settings/settings.xml
app_settings/settings_autocorrect.xml
app_settings/settings_crash_behavior.xml
app_settings/settings_files.xml
app_settings/settings_per_account.xml

View File

@ -839,39 +839,6 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>FSEnableAutoCorrect</key>
<map>
<key>Comment</key>
<string>whether to enable autocorrect or not</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>FSAutoCorrectCount</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>FSCmdLineAutocorrect</key>
<map>
<key>Comment</key>
<string>Command for adding new entries to autocorrect</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>/addac</string>
</map>
<key>FSUseNearbyChatConsole</key>
<map>
<key>Comment</key>
@ -15930,17 +15897,6 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<string>cao</string>
</map>
<key>FSCmdLineAutocorrect</key>
<map>
<key>Comment</key>
<string>Command for adding new entries to autocorrect</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>/addac</string>
</map>
<key>FSCmdLineMedia</key>
<map>
<key>Comment</key>

File diff suppressed because it is too large Load Diff

View File

@ -75,8 +75,6 @@
#include "llparcel.h"
#include "llaudioengine.h"
#include "llviewerparcelmediaautoplay.h"
#include "lggautocorrectfloater.h"
#include "lggautocorrect.h"
#include "rlvhandler.h"
@ -514,7 +512,6 @@ bool cmd_line_chat(std::string revised_text, EChatType type, bool from_gesture)
static LLCachedControl<std::string> sFSCmdLineClearChat(gSavedSettings, "FSCmdLineClearChat");
static LLCachedControl<std::string> sFSCmdLineMedia(gSavedSettings, "FSCmdLineMedia");
static LLCachedControl<std::string> sFSCmdLineMusic(gSavedSettings, "FSCmdLineMusic");
static LLCachedControl<std::string> sFSCmdLineAutocorrect(gSavedSettings, "FSCmdLineAutocorrect");
//<FS:HG> FIRE-6340, FIRE-6567 - Setting Bandwidth issues
static LLCachedControl<std::string> sFSCmdLineBandwidth(gSavedSettings, "FSCmdLineBandWidth");
@ -950,53 +947,6 @@ bool cmd_line_chat(std::string revised_text, EChatType type, bool from_gesture)
cmdline_printchat("Displaying Contact Sets Floater.");
return false;
}
#ifdef LGG_AUTO_CORRECT
else if(revised_text == "/ac")
{
LGGAutoCorrectFloater::showFloater();
cmdline_printchat("Displaying Auto Correction Floater.");
return false;
}
else if(command == std::string(sFSCmdLineAutocorrect))
{
if (revised_text.length() < (std::string(sFSCmdLineAutocorrect)).length()+2)
{
cmdline_printchat("Wrong usage, correct usage is"+
std::string(sFSCmdLineAutocorrect)+" list Name|wrong word|right word.");
return false;
}
std::string info = revised_text.substr(std::string(sFSCmdLineAutocorrect).length()+1);
//addac list name|wrong word|right word
int bar = info.find("|");
if (bar==std::string::npos)
{
cmdline_printchat("Wrong usage, correct usage is"+
std::string(sFSCmdLineAutocorrect)+" list Name|wrong word|right word.");
return false;
}
std::string listName = info.substr(0,bar);
info = info.substr(bar+1);
bar = info.find("|");
if (bar==std::string::npos)
{
cmdline_printchat("Wrong usage, correct usage is"+
std::string(sFSCmdLineAutocorrect)+" list Name|wrong word|right word.");
return false;
}
std::string wrong = info.substr(0,bar);
std::string right = info.substr(bar+1);
if(LGGAutoCorrect::getInstance()->addEntryToList(wrong,right,listName))
{
cmdline_printchat("Added "+wrong+"=>"+right+" to the "+listName+" list.");
LGGAutoCorrect::getInstance()->save();
return false;
}
}
#endif
else if(command == std::string(sFSCmdLineClearChat))
{

View File

@ -1,402 +0,0 @@
/**
* @file lggautocorrect.cpp
* @brief Auto Correct Manager
* @copyright Copyright (c) 2011 LordGregGreg Back
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "llviewerprecompiledheaders.h"
#include "lggautocorrect.h"
#include "llsdserialize.h"
#include "llboost.h"
#include "llcontrol.h"
#include "llviewercontrol.h"
#include "llnotificationsutil.h"
LGGAutoCorrect* LGGAutoCorrect::sInstance;
LGGAutoCorrect::LGGAutoCorrect()
{
sInstance = this;
sInstance->loadFromDisk();
}
LGGAutoCorrect::~LGGAutoCorrect()
{
sInstance = NULL;
}
LGGAutoCorrect* LGGAutoCorrect::getInstance()
{
if(sInstance)return sInstance;
else
{
sInstance = new LGGAutoCorrect();
return sInstance;
}
}
void LGGAutoCorrect::save()
{
saveToDisk(mAutoCorrects);
}
std::string LGGAutoCorrect::getFileName()
{
std::string path=gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "");
if (!path.empty())
{
path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings_autocorrect.xml");
}
return path;
}
std::string LGGAutoCorrect::getDefaultFileName()
{
std::string path=gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "");
if (!path.empty())
{
path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "settings_autocorrect.xml");
}
return path;
}
LLSD LGGAutoCorrect::exportList(std::string listName)
{
LLSD toReturn;
if(mAutoCorrects.has(listName))
{
toReturn["listName"]=listName;
toReturn["data"]=mAutoCorrects[listName]["data"];
toReturn["author"]=mAutoCorrects[listName]["author"];
toReturn["wordStyle"]=mAutoCorrects[listName]["wordStyle"];
toReturn["priority"]=mAutoCorrects[listName]["priority"];
}
return toReturn;
}
BOOL LGGAutoCorrect::addCorrectionList(LLSD newList)
{
if(newList.has("listName"))
{
std::string name = newList["listName"];
//if(!mAutoCorrects.has(name)){
LLSD newPart;
newPart["data"]=newList["data"];
newPart["enabled"]=TRUE;
newPart["announce"]=FALSE;
newPart["author"]=newList["author"];
newPart["wordStyle"]=newList["wordStyle"];
newPart["priority"]=newList["priority"].asInteger();
llinfos << "adding new list with settings priority "<<newPart["priority"].asInteger() <<llendl;
mAutoCorrects[name]=newPart;
return TRUE;
}
return FALSE;
}
BOOL LGGAutoCorrect::removeCorrectionList(std::string listName)
{
if(mAutoCorrects.has(listName))
{
mAutoCorrects.erase(listName);
return TRUE;
}
return FALSE;
}
BOOL LGGAutoCorrect::setListEnabled(std::string listName, BOOL enabled)
{
if(mAutoCorrects.has(listName))
{
mAutoCorrects[listName]["enabled"]=enabled;
return TRUE;
}
return FALSE;
}
BOOL LGGAutoCorrect::setListAnnounceeState(std::string listName, BOOL announce)
{
if(mAutoCorrects.has(listName))
{
mAutoCorrects[listName]["announce"]=announce;
return TRUE;
}
return FALSE;
}
BOOL LGGAutoCorrect::setListStyle(std::string listName, BOOL announce)
{
if(mAutoCorrects.has(listName))
{
mAutoCorrects[listName]["wordStyle"]=announce;
return TRUE;
}
return FALSE;
}
BOOL LGGAutoCorrect::setListPriority(std::string listName, int priority)
{
if(mAutoCorrects.has(listName))
{
mAutoCorrects[listName]["priority"]=priority;
return TRUE;
}
return FALSE;
}
LLSD LGGAutoCorrect::getAutoCorrects()
{
//loadFromDisk();
return mAutoCorrects;
}
void LGGAutoCorrect::loadFromDisk()
{
std::string filename=getFileName();
if (filename.empty())
{
llinfos << "no valid user directory." << llendl;
}
if(!gDirUtilp->fileExists(filename))
{
std::string defaultName = getDefaultFileName();
llinfos << " user settings file doesnt exist, going to try and read default one from "<<defaultName.c_str()<< llendl;
if(gDirUtilp->fileExists(defaultName))
{
LLSD blankllsd;
llifstream file;
file.open(defaultName.c_str());
if (file.is_open())
{
LLSDSerialize::fromXMLDocument(blankllsd, file);
}
file.close();
saveToDisk(blankllsd);
}else
saveToDisk(getExampleLLSD());
}
else
{
llifstream file;
file.open(filename.c_str());
if (file.is_open())
{
LLSDSerialize::fromXML(mAutoCorrects, file);
}
file.close();
}
}
void LGGAutoCorrect::saveToDisk(LLSD newSettings)
{
mAutoCorrects=newSettings;
std::string filename=getFileName();
llofstream file;
file.open(filename.c_str());
LLSDSerialize::toPrettyXML(mAutoCorrects, file);
file.close();
}
void LGGAutoCorrect::runTest()
{
std::string startS("He just abandonned all his abilties");
std::string endS = replaceWords(startS);
llinfos << "!!! Test of autoreplace; start with "<<startS.c_str() << " end with " << endS.c_str()<<llendl;
}
BOOL LGGAutoCorrect::saveListToDisk(std::string listName, std::string fileName)
{
if(mAutoCorrects.has(listName))
{
llofstream file;
file.open(fileName.c_str());
LLSDSerialize::toPrettyXML(exportList(listName), file);
file.close();
return TRUE;
}
return FALSE;
}
LLSD LGGAutoCorrect::getAutoCorrectEntries(std::string listName)
{
LLSD toReturn;
if(mAutoCorrects.has(listName))
{
toReturn=mAutoCorrects[listName];
}
return toReturn;
}
std::string LGGAutoCorrect::replaceWord(std::string currentWord)
{
static LLCachedControl<bool> doAnything(gSavedSettings, "FSEnableAutoCorrect");
if(!(doAnything))return currentWord;
//loop through priorities
for(int currentPriority = 10;currentPriority>=0;currentPriority--)
{
LLSD::map_const_iterator loc_it = mAutoCorrects.beginMap();
LLSD::map_const_iterator loc_end = mAutoCorrects.endMap();
for ( ; loc_it != loc_end; ++loc_it)
{
const std::string& location = (*loc_it).first;
//llinfos << "location is "<<location.c_str() << " word is "<<currentWord.c_str()<<llendl;
const LLSD& loc_map = (*loc_it).second;
if(loc_map["priority"].asInteger()==currentPriority)
{
if(!loc_map["wordStyle"].asBoolean())
{
//this means look for partial matches instead of a full word
if(loc_map["enabled"].asBoolean())
{
LLSD::map_const_iterator inner_it = loc_map["data"].beginMap();
LLSD::map_const_iterator inner_end = loc_map["data"].endMap();
for ( ; inner_it != inner_end; ++inner_it)
{
const std::string& wrong = (*inner_it).first;
const std::string& right = (*inner_it).second;
int location = currentWord.find(wrong);
if(location!=std::string::npos)
{
currentWord=currentWord.replace(location,wrong.length(),right);
}
}
}
}else
if((loc_map["data"].has(currentWord))&&(loc_map["enabled"].asBoolean()))
{
std::string replacement = loc_map["data"][currentWord];
if(loc_map["announce"].asBoolean())
{
LLSD args;
//"[Before]" has been auto replaced by "[Replacement]"
// based on your [ListName] list.
args["BEFORE"] = currentWord;
args["LISTNAME"]=location;
args["REPLACEMENT"]=replacement;
LLNotificationsUtil::add("PhoenixAutoReplace",args);
}
gSavedSettings.setS32("FSAutoCorrectCount",gSavedSettings.getS32("FSAutoCorrectCount")+1);
llinfos << "found a word in list " << location.c_str() << " and it will replace " << currentWord.c_str() << " => " << replacement.c_str() << llendl;
return replacement;
}
}
}
}
return currentWord;
}
std::string LGGAutoCorrect::replaceWords(std::string words)
{
static LLCachedControl<bool> doAnything(gSavedSettings, "FSEnableAutoCorrect");
if(!(doAnything))return words;
//TODO update this function to use the "wordStyle" thing,
//but so far this function is never used, so later
boost_tokenizer tokens(words, boost::char_separator<char>(" "));
for (boost_tokenizer::iterator token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter)
{
std::string currentWord(*token_iter);
LLSD::map_const_iterator loc_it = mAutoCorrects.beginMap();
LLSD::map_const_iterator loc_end = mAutoCorrects.endMap();
for ( ; loc_it != loc_end; ++loc_it)
{
const std::string& location = (*loc_it).first;
//llinfos << "location is "<<location.c_str() << " word is "<<currentWord.c_str()<<llendl;
const LLSD& loc_map = (*loc_it).second;
if((loc_map["data"].has(currentWord))&&(loc_map["enabled"].asBoolean()))
{
std::string replacement = loc_map["data"][currentWord];
if(loc_map["announce"].asBoolean())
{
LLSD args;
//"[Before]" has been auto replaced by "[Replacement]"
// based on your [ListName] list.
args["BEFORE"] = currentWord;
args["LISTNAME"]=location;
args["REPLACEMENT"]=replacement;
LLNotificationsUtil::add("PhoenixAutoReplace",args);
}
llinfos << "found a word in list " << location.c_str() << " and it will replace " << currentWord.c_str() << " => " << replacement.c_str() << llendl;
int wordStart = words.find(currentWord);
words.replace(wordStart,currentWord.length(),replacement);
return replaceWords(words);//lol recursion!
}
}
}
return words;
}
BOOL LGGAutoCorrect::addEntryToList(std::string wrong, std::string right, std::string listName)
{
// *HACK: Make sure the "Custom" list exists, because the design of this
// system prevents us from updating it by changing the original file...
if(mAutoCorrects.has(listName))
{
mAutoCorrects[listName]["data"][wrong]=right;
return TRUE;
}
else if(listName == "Custom")
{
mAutoCorrects[listName]["announce"] = 0;
mAutoCorrects[listName]["author"] = "You";
mAutoCorrects[listName]["data"][wrong] = right;
mAutoCorrects[listName]["enabled"] = 1;
mAutoCorrects[listName]["priority"] = 10;
mAutoCorrects[listName]["wordStyle"] = 1;
return TRUE;
}
return FALSE;
}
BOOL LGGAutoCorrect::removeEntryFromList(std::string wrong, std::string listName)
{
if(mAutoCorrects.has(listName))
{
if(mAutoCorrects[listName]["data"].has(wrong))
{
mAutoCorrects[listName]["data"].erase(wrong);
return TRUE;
}
}
return FALSE;
}
LLSD LGGAutoCorrect::getExampleLLSD()
{
LLSD toReturn;
LLSD listone;
LLSD listtwo;
LLSD itemOne;
itemOne["wrong"]="wrong1";
itemOne["right"]="right1";
listone[0]=itemOne;
LLSD itemTwo;
itemTwo["wrong"]="wrong2";
itemTwo["right"]="right2";
listone[1]=itemTwo;
toReturn["listOne"]=listone;
itemOne["wrong"]="secondwrong1";
itemOne["right"]="secondright1";
listone[0]=itemOne;
itemTwo["wrong"]="secondwrong2";
itemTwo["right"]="secondright2";
listone[1]=itemTwo;
toReturn["listTwo"]=listone;
return toReturn;
}

View File

@ -1,60 +0,0 @@
/**
* @file lggautocorrect.h
* @brief Auto Correct Manager
* @copyright Copyright (c) 2011 LordGregGreg Back
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef LGG_AUTO_CORRECT
#define LGG_AUTO_CORRECT
class LGGAutoCorrect
{
LGGAutoCorrect();
~LGGAutoCorrect();
static LGGAutoCorrect* sInstance;
public:
static LGGAutoCorrect* getInstance();
BOOL addCorrectionList(LLSD newList);
BOOL removeCorrectionList(std::string listName);
BOOL setListEnabled(std::string listName, BOOL enabled);
BOOL setListAnnounceeState(std::string listName, BOOL announce);
BOOL setListPriority(std::string listName, int priority);
BOOL setListStyle(std::string listName, BOOL announce);
std::string replaceWords(std::string words);
std::string replaceWord(std::string currentWord);
BOOL addEntryToList(std::string wrong, std::string right, std::string listName);
BOOL removeEntryFromList(std::string wrong, std::string listName);
BOOL saveListToDisk(std::string listName, std::string fileName);
LLSD exportList(std::string listName);
void runTest();
LLSD getAutoCorrects();
LLSD getAutoCorrectEntries(std::string listName);
void save();
void loadFromDisk();
private:
void saveToDisk(LLSD newSettings);
LLSD getExampleLLSD();
std::string getFileName();
std::string getDefaultFileName();
LLSD mAutoCorrects;
};
#endif

View File

@ -1,457 +0,0 @@
/**
* @file lggautocorrectfloater.cpp
* @brief Auto Correct List floater
* @copyright Copyright (c) 2011 LordGregGreg Back
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "llviewerprecompiledheaders.h"
#include "lggautocorrectfloater.h"
#include "llagentdata.h"
#include "llcommandhandler.h"
#include "llfloater.h"
#include "lluictrlfactory.h"
#include "llagent.h"
#include "llpanel.h"
#include "llbutton.h"
#include "llcolorswatch.h"
#include "llcombobox.h"
#include "llview.h"
#include "llhttpclient.h"
#include "llbufferstream.h"
#include "llcheckboxctrl.h"
#include "llviewercontrol.h"
#include "llui.h"
#include "llcontrol.h"
#include "llscrollingpanellist.h"
#include "lggautocorrect.h"
#include "llfilepicker.h"
#include "llfile.h"
#include "llsdserialize.h"
#include "llchat.h"
#include "llinventorymodel.h"
#include "llhost.h"
#include "llassetstorage.h"
#include "roles_constants.h"
#include "llviewertexteditor.h"
#include <boost/tokenizer.hpp>
#include <iosfwd>
#include "llfloaterreg.h"
#include "llinspecttoast.h"
#include "llnotificationhandler.h"
#include "llnotificationmanager.h"
//JCInvDropTarget * lggAutoCorrectFloater::mNotecardDropTarget;
//lggAutoCorrectFloater* lggAutoCorrectFloater::sInstance;
//LGGAutoCorrectFloater::~LGGAutoCorrectFloater()
//{
//delete mNotecardDropTarget;
//mNotecardDropTarget = NULL;
//}
LGGAutoCorrectFloater::LGGAutoCorrectFloater(const LLSD& key) :
LLFloater(key)
{
}
void LGGAutoCorrectFloater::onClose(bool app_quitting)
{
destroy(); // Die die die!
}
BOOL LGGAutoCorrectFloater::postBuild(void)
{
namesList = getChild<LLScrollListCtrl>("lgg_ac_list_name");
entryList = getChild<LLScrollListCtrl>("lgg_ac_list_entry");
childSetCommitCallback("lgg_ac_enable",onBoxCommitEnabled,this);
childSetCommitCallback("lgg_ac_list_enabled",onEntrySettingChange,this);
childSetCommitCallback("lgg_ac_list_show",onEntrySettingChange,this);
childSetCommitCallback("lgg_ac_list_style",onEntrySettingChange,this);
childSetCommitCallback("lgg_ac_priority",onEntrySettingChange,this);
updateEnabledStuff();
updateNamesList();
namesList->setCommitOnSelectionChange(TRUE);
childSetCommitCallback("lgg_ac_list_name", onSelectName, this);
childSetAction("lgg_ac_deletelist",removeList,this);
childSetAction("lgg_ac_rementry",deleteEntry,this);
childSetAction("lgg_ac_exportlist",exportList,this);
childSetAction("lgg_ac_addentry",addEntry,this);
childSetAction("lgg_ac_loadlist",loadList,this);
/*LLView *target_view = getChild<LLView>("lgg_ac_notecard_target");
if(target_view)
{
if (mNotecardDropTarget)//shouldn't happen
{
delete mNotecardDropTarget;
}
mNotecardDropTarget = new JCInvDropTarget("drop target", target_view->getRect(), ResponseItemDrop);//, mAvatarID);
addChild(mNotecardDropTarget);
}
*/
return true;
}
/*
void LGGAutoCorrectFloater::ResponseItemDrop(LLViewerInventoryItem* item)
{
if(item)
{
if (gAgent.allowOperation(PERM_COPY, item->getPermissions(),GP_OBJECT_MANIPULATE) || gAgent.isGodlike())
{
if(!item->getAssetUUID().isNull())
gAssetStorage->getInvItemAsset(LLHost::invalid,
gAgent.getID(),
gAgent.getSessionID(),
item->getPermissions().getOwner(),
LLUUID::null,
item->getUUID(),
item->getAssetUUID(),
item->getType(),
&onNotecardLoadComplete,
(void*)item,
TRUE);
gSavedSettings.setBOOL("FSEnableAutoCorrect",true);
}
}
}
void LGGAutoCorrectFloater::onNotecardLoadComplete(LLVFS *vfs,const LLUUID& asset_uuid,LLAssetType::EType type,void* user_data, S32 status, LLExtStat ext_status)
{
if(status == LL_ERR_NOERR)
{
S32 size = vfs->getSize(asset_uuid, type);
U8* buffer = new U8[size];
vfs->getData(asset_uuid, type, buffer, 0, size);
if(type == LLAssetType::AT_NOTECARD)
{
LLViewerTextEditor* edit = new LLViewerTextEditor("",LLRect(0,0,0,0),S32_MAX,"");
if(edit->importBuffer((char*)buffer, (S32)size))
{
llinfos << "decode success" << llendl;
std::string card = "";//edit->getText();
//edit->die();
LLSD info;
std::istringstream ins; // Declare an input string stream.
ins.str(card); // Specify string to read.
LLSDSerialize::fromXML(info,ins);
LGGAutoCorrect::getInstance()->addCorrectionList(info);
llinfos << "read success" << llendl;
updateEnabledStuff();
}
else
{
llinfos << "decode error" << llendl;
}
}
}
else
{
llinfos << "read error" << llendl;
}
}
*/
void LGGAutoCorrectFloater::onSelectName(LLUICtrl* ctrl, void* user_data)
{
if ( user_data )
{
LGGAutoCorrectFloater* self = ( LGGAutoCorrectFloater* )user_data;
if ( self )
self->updateItemsList();
}
}
void LGGAutoCorrectFloater::updateItemsList()
{
entryList->deleteAllItems();
if((namesList->getAllSelected().size())<=0)
{
updateListControlsEnabled(FALSE);
return;
}
updateListControlsEnabled(TRUE);
std::string listName= namesList->getFirstSelected()->getColumn(0)->getValue().asString();
LLSD listData = LGGAutoCorrect::getInstance()->getAutoCorrectEntries(listName);
childSetValue("lgg_ac_list_enabled",listData["enabled"].asBoolean());
childSetValue("lgg_ac_list_style",listData["wordStyle"].asBoolean());
childSetValue("lgg_ac_list_show",listData["announce"].asBoolean());
childSetValue("lgg_ac_text_name",listName);
childSetValue("lgg_ac_text_author",listData["author"]);
childSetValue("lgg_ac_priority",listData["priority"]);
static LLCachedControl<S32> countAuto(gSavedSettings, "FSAutoCorrectCount");
childSetValue("lgg_ac_stats",(S32)countAuto);
LLSD autoCorrects = listData["data"];
LLSD::map_const_iterator loc_it = autoCorrects.beginMap();
LLSD::map_const_iterator loc_end = autoCorrects.endMap();
for ( ; loc_it != loc_end; ++loc_it)
{
const std::string& wrong = (*loc_it).first;
const std::string& right = (*loc_it).second;
//std::string lentry(wrong+"=>"+right);
LLSD element;
element["id"] = wrong;
LLSD& s_column = element["columns"][0];
s_column["column"] = getString("Search");
s_column["value"] = wrong;
s_column["font"] = "SANSSERIF";
LLSD& r_column = element["columns"][1];
r_column["column"] = getString("Replace");
r_column["value"] = right;
r_column["font"] = "SANSSERIF";
entryList->addElement(element, ADD_BOTTOM);
}
}
void LGGAutoCorrectFloater::updateNamesList()
{
namesList->deleteAllItems();
static LLCachedControl<bool> enabledd(gSavedSettings, "FSEnableAutoCorrect");
if(!(enabledd))
{
updateItemsList();
return;
}
static LLCachedControl<S32> countAuto(gSavedSettings, "FSAutoCorrectCount");
childSetValue("lgg_ac_stats",(S32)countAuto);
LLSD autoCorrects = LGGAutoCorrect::getInstance()->getAutoCorrects();
LLSD::map_const_iterator loc_it = autoCorrects.beginMap();
LLSD::map_const_iterator loc_end = autoCorrects.endMap();
for ( ; loc_it != loc_end; ++loc_it)
{
const std::string& listName = (*loc_it).first;
LLSD element;
element["id"] = listName;
LLSD& friend_column = element["columns"][0];
friend_column["column"] = getString("Entries");
friend_column["value"] = listName;
//friend_column["font"] = "SANSSERIF";
const LLSD& loc_map = (*loc_it).second;
if(loc_map["enabled"].asBoolean())
friend_column["font"] = "SANSSERIF";
//friend_column["style"] = "BOLD";
else
friend_column["font"] = "SANSSERIF_SMALL";
//friend_column["style"] = "NORMAL";
if(namesList)
namesList->addElement(element, ADD_BOTTOM);
}
updateItemsList();
}
void LGGAutoCorrectFloater::updateListControlsEnabled(BOOL selected)
{
childSetEnabled("lgg_ac_text1",selected);
childSetEnabled("lgg_ac_text2",selected);
childSetEnabled("lgg_ac_text_name",selected);
childSetEnabled("lgg_ac_text_author",selected);
childSetEnabled("lgg_ac_list_enabled",selected);
childSetEnabled("lgg_ac_list_show",selected);
childSetEnabled("lgg_ac_list_style",selected);
childSetEnabled("lgg_ac_deletelist",selected);
childSetEnabled("lgg_ac_exportlist",selected);
childSetEnabled("lgg_ac_addentry",selected);
childSetEnabled("lgg_ac_rementry",selected);
childSetEnabled("lgg_ac_priority",selected);
}
void LGGAutoCorrectFloater::updateEnabledStuff()
{
static LLCachedControl<bool> enabledd(gSavedSettings, "FSEnableAutoCorrect");
if(!(enabledd))
{
LLCheckBoxCtrl *enBox = getChild<LLCheckBoxCtrl>("lgg_ac_enable");
enBox->setDisabledColor(LLColor4::red);
getChild<LLCheckBoxCtrl>("lgg_ac_enable")->setEnabledColor(LLColor4(1.0f,0.0f,0.0f,1.0f));
}else
{
getChild<LLCheckBoxCtrl>("lgg_ac_enable")->setEnabledColor(
LLUIColorTable::instance().getColor( "LabelTextColor" ));
}
childSetEnabled("lgg_ac_list_name",enabledd);
childSetEnabled("lgg_ac_list_entry",enabledd);
updateListControlsEnabled(enabledd);
updateNamesList();
LGGAutoCorrect::getInstance()->save();
}
void LGGAutoCorrectFloater::setData(void * data)
{
//empanel = (LLPanelPhoenix*)data;
}
void LGGAutoCorrectFloater::onBoxCommitEnabled(LLUICtrl* caller, void* user_data)
{
if ( user_data )
{
LGGAutoCorrectFloater* self = ( LGGAutoCorrectFloater* )user_data;
if ( self )
{
self->updateEnabledStuff();
}
}
}
void LGGAutoCorrectFloater::onEntrySettingChange(LLUICtrl* caller, void* user_data)
{
if ( user_data )
{
LGGAutoCorrectFloater* self = ( LGGAutoCorrectFloater* )user_data;
if ( self )
{
std::string listName= self->namesList->getFirstSelected()->getColumn(0)->getValue().asString();
LGGAutoCorrect::getInstance()->setListEnabled(listName,self->childGetValue("lgg_ac_list_enabled").asBoolean());
LGGAutoCorrect::getInstance()->setListAnnounceeState(listName,self->childGetValue("lgg_ac_list_show").asBoolean());
LGGAutoCorrect::getInstance()->setListStyle(listName,self->childGetValue("lgg_ac_list_style").asBoolean());
LGGAutoCorrect::getInstance()->setListPriority(listName,self->childGetValue("lgg_ac_priority").asInteger());
//sInstance->updateEnabledStuff();
self->updateItemsList();
LGGAutoCorrect::getInstance()->save();
}
}
}
void LGGAutoCorrectFloater::deleteEntry(void* data)
{
if ( data )
{
LGGAutoCorrectFloater* self = ( LGGAutoCorrectFloater* )data;
if ( self )
{
std::string listName=self->namesList->getFirstSelected()->getColumn(0)->getValue().asString();
if((self->entryList->getAllSelected().size())>0)
{
std::string wrong= self->entryList->getFirstSelected()->getColumn(0)->getValue().asString();
LGGAutoCorrect::getInstance()->removeEntryFromList(wrong,listName);
self->updateItemsList();
LGGAutoCorrect::getInstance()->save();
}
}
}
}
void LGGAutoCorrectFloater::loadList(void* data)
{
LLFilePicker& picker = LLFilePicker::instance();
if(!picker.getOpenFile( LLFilePicker::FFLOAD_XML) )
{return;
}
llifstream file;
file.open(picker.getFirstFile().c_str());
LLSD blankllsd;
if (file.is_open())
{
LLSDSerialize::fromXMLDocument(blankllsd, file);
}
file.close();
gSavedSettings.setBOOL("FSEnableAutoCorrect",true);
LGGAutoCorrect::getInstance()->addCorrectionList(blankllsd);
if ( data )
{
LGGAutoCorrectFloater* self = ( LGGAutoCorrectFloater* )data;
if ( self )
self->updateEnabledStuff();
}
}
void LGGAutoCorrectFloater::removeList(void* data)
{
if ( data )
{
LGGAutoCorrectFloater* self = ( LGGAutoCorrectFloater* )data;
if ( self )
{
std::string listName= self->namesList->getFirstSelected()->getColumn(0)->getValue().asString();
LGGAutoCorrect::getInstance()->removeCorrectionList(listName);
self->updateEnabledStuff();
}
}
}
void LGGAutoCorrectFloater::exportList(void *data)
{
if ( data )
{
LGGAutoCorrectFloater* self = ( LGGAutoCorrectFloater* )data;
if ( self )
{
std::string listName=self->namesList->getFirstSelected()->getColumn(0)->getValue().asString();
LLFilePicker& picker = LLFilePicker::instance();
if(!picker.getSaveFile( LLFilePicker::FFSAVE_XML) )
{return;
}
llofstream file;
file.open(picker.getFirstFile().c_str());
LLSDSerialize::toPrettyXML(LGGAutoCorrect::getInstance()->exportList(listName), file);
file.close();
}
}
}
void LGGAutoCorrectFloater::addEntry(void* data)
{
if ( data )
{
LGGAutoCorrectFloater* self = ( LGGAutoCorrectFloater* )data;
if ( self )
{
std::string listName= self->namesList->getFirstSelected()->getColumn(0)->getValue().asString();
LLChat chat;
LLStringUtil::format_map_t message_args;
message_args["[COMMAND]"] = gSavedSettings.getString("FSCmdLineAutocorrect");
message_args["[LISTNAME]"] = listName;
chat.mText = self->getString("AddNewEntryMessage", message_args);
chat.mSourceType = CHAT_SOURCE_SYSTEM;
LLSD args;
args["type"] = LLNotificationsUI::NT_NEARBYCHAT;
LLNotificationsUI::LLNotificationManager::instance().onChat(chat, args);
}
}
}
LGGAutoCorrectFloater* LGGAutoCorrectFloater::showFloater()
{
return LLFloaterReg::showTypedInstance<LGGAutoCorrectFloater>("autocorrect");
}

View File

@ -1,67 +0,0 @@
/**
* @file lggautocorrectfloater.h
* @brief Auto Correct List floater
* @copyright Copyright (c) 2011 LordGregGreg Back
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef LGG_LGGAUTOCORRECTFLOATER_H
#define LGG_LGGAUTOCORRECTFLOATER_H
#include "llfloater.h"
#include "llmediactrl.h"
#include "llscrolllistctrl.h"
#include "llviewerinventory.h"
#include <boost/bind.hpp>
class LGGAutoCorrectFloater :
public LLFloater
{
public:
LGGAutoCorrectFloater(const LLSD& key);
/*virtual*/ BOOL postBuild();
/*virtual*/ void onClose(bool app_quitting);
static LGGAutoCorrectFloater* showFloater();
void setData(void * data);
void updateEnabledStuff();
void updateNamesList();
void updateListControlsEnabled(BOOL selected);
void updateItemsList();
LLScrollListCtrl *namesList;
LLScrollListCtrl *entryList;
//LLPanelPhoenix * empanel;
private:
//static JCInvDropTarget* mNotecardDropTarget;
static void onBoxCommitEnabled(LLUICtrl* caller, void* user_data);
static void onEntrySettingChange(LLUICtrl* caller, void* user_data);
static void onSelectName(LLUICtrl* caller, void* user_data);
//static void ResponseItemDrop(LLViewerInventoryItem* item);
//static void onNotecardLoadComplete(LLVFS *vfs,const LLUUID& asset_uuid,LLAssetType::EType type,void* user_data, S32 status, LLExtStat ext_status);
static void deleteEntry(void* data);
static void addEntry(void* data);
static void exportList(void* data);
static void removeList(void* data);
static void loadList(void* data);
};
#endif // LGG_LGGAUTOCORRECTFLOATER_H

View File

@ -38,7 +38,6 @@
#include "llcontrol.h"
#include "llscrolllistctrl.h"
#include "llscrollingpanellist.h"
#include "lggautocorrect.h"
#include "llfilepicker.h"
#include "llfile.h"
#include "llsdserialize.h"

View File

@ -788,7 +788,6 @@ bool LLAppViewer::init()
LLFile::remove(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings_v3.xml"));
LLFile::remove(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings_minimal.xml"));
LLFile::remove(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "account_settings_phoenix.xml"));
LLFile::remove(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings_autocorrect.xml"));
LLFile::remove(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "bin_conf.dat"));
LLFile::remove(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "password.dat"));
LLFile::remove(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "ignorable_dialogs.xml"));

View File

@ -122,7 +122,6 @@
#include "fslslbridge.h"
//-TT
#include "NACLantispam.h"
#include "lggautocorrectfloater.h"
// [SL:KB] - Patch: Misc-Spellcheck | Checked: 2011-09-06 (Catznip-2.8.0a) | Added: Catznip-2.8.0a
#include "llhunspell.h"
@ -455,12 +454,6 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
gSavedSettings.getControl("UseLSLFlightAssist")->getCommitSignal()->connect(boost::bind(&handleFlightAssistOptionChanged, _2));
gSavedSettings.getControl("FSPublishRadarTag")->getCommitSignal()->connect(boost::bind(&handlePublishRadarTagOptionChanged, _2));
//[FIX FIRE-1927 - enable DoubleClickTeleport shortcut : SJ] no longer exists!
//gSavedSettings.getControl("DoubleClickTeleport")->getCommitSignal()->connect(boost::bind(&LLFloaterPreference::onChangeDoubleClickSettings, this));
//autocorrect button
mCommitCallbackRegistrar.add("FSPref.ShowAC", boost::bind(&LGGAutoCorrectFloater::showFloater));
LLAvatarPropertiesProcessor::getInstance()->addObserver( gAgent.getID(), this );
}

View File

@ -158,7 +158,6 @@
#include "ao.h" // ## Zi: Animation Overrider
#include "kvfloaterflickrauth.h"
#include "kvfloaterflickrupload.h"
#include "lggautocorrectfloater.h"
#include "lggbeamcolormapfloater.h"
#include "lggbeammapfloater.h"
#include "fsgrouptitles.h"
@ -369,7 +368,6 @@ void LLViewerFloaterReg::registerFloaters()
// *NOTE: Please keep these alphabetized for easier merges
// ND: And for FS please put yours after this line, for easier merges too
LLFloaterReg::add("autocorrect", "floater_autocorrect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LGGAutoCorrectFloater>);
LLFloaterReg::add("imcontacts", "floater_fs_contacts.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<FSFloaterContacts>);
// AO: Firestorm Money (tip) tracker
LLFloaterReg::add("money_tracker", "floater_fs_money_tracker.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<FSMoneyTracker>);

View File

@ -1,57 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater name="autocorrect" title="AUTO-KORREKTUR-EINSTELLUNGEN">
<floater.string name="Entries">
Einträge
</floater.string>
<floater.string name="Search">
Suche
</floater.string>
<floater.string name="Replace">
Ersetzung
</floater.string>
<floater.string name="AddNewEntryMessage">
Um einen neuen Eintrag hinzuzufügen, bitte im Chat folgenden Befehl eingeben: &quot;[COMMAND] [LISTNAME]|falschesWort|richtigesWort&quot;
</floater.string>
<panel label="lgg_ac_panel" name="Autocorrect Settings">
<check_box width="160" label="Auto-Korrektur aktivieren" name="lgg_ac_enable" tool_tip="Diese Checkbox muss aktiviert sein, um die hier gemachten Einstellungen zu nutzen. Texteingaben werden daraufhin entsprechend ersetzt."/>
<button name="lgg_ac_loadlist" label="Liste laden" tool_tip="Lädt eine zuvor exportierte Liste."/>
<panel name="priority_stack" width="280">
<text name="lgg_ac_text3" width="180">
Anzahl korrigierter Wörter:
</text>
<text name="lgg_ac_stats">
Anzahl
</text>
</panel>
<text name="lgg_ac_text1">
Listen-Namen
</text>
<button name="lgg_ac_deletelist" label="Liste löschen" tool_tip="Löscht die komplette Wortliste mitsamt den Ersetzungen. Dies kann nicht rückgängig gemacht werden!"/>
<button name="lgg_ac_exportlist" width="100" label="Liste exportieren" tool_tip="Speichert die Wortliste in einer Datei, um sie beispielsweise mit Freunden teilen zu können."/>
<text name="lgg_ac_text1a">
Listen-Einträge
</text>
<panel name="entry_settings_stack">
<text name="lgg_ac_text_name">
Listen-Name
</text>
<panel name="author_stack">
<text name="lgg_ac_text2">
Autor:
</text>
<text name="lgg_ac_text_author">
Name des Autors
</text>
</panel>
<panel name="priority_stack">
<check_box label="Aktiviert, Priorität:" name="lgg_ac_list_enabled" tool_tip="Aktiviert bzw. deaktiviert diese Liste."/>
<spinner name="lgg_ac_priority" tool_tip="Definiert in welcher Reihenfolge diese Liste für Ersetzungen genutzt wird. Eine höherer Wert besitzt Priorität gegenüber einem niedrigeren Wert."/>
</panel>
<check_box label="Benachrichtigung anzeigen" name="lgg_ac_list_show" tool_tip="Falls aktiviert, wird bei jeder Ersetzung eine Benachrichtigung eingeblendet."/>
<check_box label="Ganze Wörter" name="lgg_ac_list_style" tool_tip="Falls aktiviert, werden nur ganze Wörter geprüft und ersetzt. Falls deaktiviert, erfolgt eine Prüfung und Ersetzung auch innerhalb von Wörtern."/>
<button name="lgg_ac_addentry" label="Eintrag hinzufügen" width="120"/>
<button name="lgg_ac_rementry" label="Eintrag löschen" width="100"/>
</panel>
</panel>
</floater>

View File

@ -1,359 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater
can_close="true"
can_minimize="true"
bottom="400"
left="300"
can_resize="false"
height="390"
width="540"
name="autocorrect"
help_topic="fs_auto_correct"
positioning="centered"
save_rect="true"
title="AUTOCORRECT SETTINGS">
<floater.string name="Entries">
Entries
</floater.string>
<floater.string name="Search">
Search
</floater.string>
<floater.string name="Replace">
Replace
</floater.string>
<floater.string name="AddNewEntryMessage">
To add an entry, please type in chat &quot;[COMMAND] [LISTNAME]|wrongWord|rightWord&quot;
</floater.string>
<panel
border="true"
follows="all"
height="388"
layout="topleft"
left="1"
top="1"
width="538"
label="lgg_ac_panel"
name="Autocorrect Settings">
<check_box
top="20"
left="10"
height="16"
width="140"
follows="left|top"
layout="topleft"
label="Enable Autocorrect"
control_name="FSEnableAutoCorrect"
name="lgg_ac_enable"
tool_tip="You must have this check box enabled to use any of these settings, it will search your writable text entry, and replace any of the search entries with their replacement"/>
<button
left_pad="10"
height="22"
width="80"
follows="left|top"
layout="topleft"
name="lgg_ac_loadlist"
label="Load List.."
tool_tip="Click this to load a previously exported list from a file."/>
<panel
left_pad="5"
name="priority_stack"
height="20"
width="300"
user_resize="false"
follows="left|top"
layout="topleft">
<text
top="2"
left="10"
height="16"
width="200"
follows="left|top"
layout="topleft"
halign="right"
name="lgg_ac_text3">
Words automatically corrected:
</text>
<view_border
top="0"
left_pad="5"
height="16"
width="70"
follows="left|top"
layout="topleft"
bevel_style="in"
name="lgg_ac_statsbox"/>
<text
top="2"
left_delta="0"
height="16"
width="70"
follows="left|top"
layout="topleft"
halign="center"
name="lgg_ac_stats">
Count
</text>
</panel>
<!--
<view_border
top="10"
left_pad="15"
height="40"
width="130"
follows="left|top"
layout="topleft"
bevel_style="in"
name="lgg_ac_notecard_target"/>
<text
bottom_delta="-8"
left_delta="4"
height="24"
width="120"
follows="left|top"
layout="topleft"
halign="center"
wrap="true"
name="lgg_ac_notecard">
Drop a Notecard here to load from it.
</text>
-->
<view_border
top="45"
left="4"
right="-4"
height="0"
follows="left|top|right"
layout="topleft"
bevel_style="none"
border_thickness="1"
name="lgg_divisor1"/>
<!-- Autocorrect Lists -->
<text
top="50"
left="5"
height="16"
width="200"
follows="left|top"
layout="topleft"
halign="center"
name="lgg_ac_text1">
List Names
</text>
<scroll_list
top_pad="2"
height="280"
width="200"
follows="left|top"
layout="topleft"
column_padding="0"
draw_heading="true"
multi_select="false"
name="lgg_ac_list_name"
search_column="1">
</scroll_list>
<button
top_pad="10"
height="22"
width="90"
follows="left|top"
layout="topleft"
name="lgg_ac_deletelist"
label="Delete List"
tool_tip="This will delete the entire list of words and their replacements, it is not reversible."/>
<button
left_pad="5"
height="22"
width="90"
follows="left|top"
layout="topleft"
name="lgg_ac_exportlist"
label="Export List"
tool_tip="This will save your current list to a file so you can share it with your friends or edit it."/>
<view_border
top="50"
left="210"
height="330"
width="0"
follows="left|top"
layout="topleft"
bevel_style="none"
border_thickness="1"
name="lgg_divisor2"/>
<!-- Autocorrect Entries -->
<text
top="50"
left="215"
right="-5"
height="16"
follows="left|top|right"
layout="topleft"
halign="center"
name="lgg_ac_text1a">
List Entries
</text>
<scroll_list
top_pad="2"
left="215"
right="-5"
height="180"
follows="left|top|right"
layout="topleft"
column_padding="0"
draw_heading="true"
multi_select="false"
name="lgg_ac_list_entry"
search_column="1">
</scroll_list>
<panel
top_pad="10"
left="220"
right="-1"
height="130"
name="entry_settings_stack"
user_resize="false"
follows="left|top|right"
layout="topleft">
<view_border
top_pad="0"
left="0"
right="-10"
height="18"
width="190"
follows="left|top|right"
layout="topleft"
bevel_style="in"
name="lgg_ac_box1"/>
<text
top_delta="3"
left_delta="3"
right="-13"
height="16"
follows="left|top|right"
layout="topleft"
name="lgg_ac_text_name">
List Name
</text>
<panel
top_pad="5"
right="-8"
name="author_stack"
height="16"
user_resize="false"
follows="left|top|right"
layout="topleft">
<text
top="2"
height="16"
width="46"
follows="left|top"
layout="topleft"
halign="center"
name="lgg_ac_text2">
Author:
</text>
<view_border
top="0"
left_pad="4"
right="-2"
height="16"
follows="left|top|right"
layout="topleft"
bevel_style="in"
name="lgg_ac_box2"/>
<text
top="2"
left_delta="2"
right="-4"
height="16"
follows="left|top|right"
layout="topleft"
name="lgg_ac_text_author">
Author Name
</text>
</panel>
<panel
top_pad="5"
name="priority_stack"
height="20"
width="200"
user_resize="false"
follows="left|top"
layout="topleft">
<check_box
top="4"
height="16"
width="115"
follows="left|top"
layout="topleft"
label="Enabled, priority:"
control_name="lgg_ac_enabled"
name="lgg_ac_list_enabled"
tool_tip="Whether or not you wish to use this particular list."/>
<spinner
top="0"
left_pad="10"
height="20"
width="50"
follows="left|top"
layout="topleft"
decimal_digits="0"
increment="1"
min_val="0"
max_val="10"
label=""
label_width="0"
name="lgg_ac_priority"
tool_tip="This number determine what order your list will be used to replace words. A higher priority means it will be used before lower priority lists."/>
</panel>
<check_box
top_pad="1"
height="16"
width="100"
follows="left|top"
layout="topleft"
radio_style="false"
label="Show Notifications"
control_name="lgg_ac_list_show"
name="lgg_ac_list_show"
tool_tip="Having this enabled will make a notification pop up every time a word is replaced."/>
<check_box
top_pad="1"
height="16"
width="100"
follows="left|top"
layout="topleft"
label="Word Style"
control_name="lgg_ac_list_style"
name="lgg_ac_list_style"
tool_tip="Having this checked means the list is for full words that should be replaced, unchecked means that it will look within words contents as well."/>
<button
top_pad="1"
height="22"
width="90"
follows="left|top"
layout="topleft"
name="lgg_ac_addentry"
label="Add Entry"/>
<button
left_pad="5"
height="22"
width="90"
follows="left|top"
layout="topleft"
name="lgg_ac_rementry"
label="Remove Entry"/>
</panel>
</panel>
</floater>

View File

@ -1153,29 +1153,6 @@
name="comboDictionaryMain"
top_pad="-15"
width="175" />
<check_box
top_pad="20"
left="30"
height="16"
width="140"
follows="left|top"
layout="topleft"
label="Enable Autocorrect"
control_name="FSEnableAutoCorrect"
name="lgg_ac_enable"
tool_tip="You must have this check box enabled to use any of these settings, it will search your writable text entry, and replace any of the search entries with their replacement"/>
<button
follows="top|left"
height="20"
layout="topleft"
top_pad="-20"
left_pad="5"
name="lgg_ac_showgui"
commit_callback.function="FSPref.ShowAC"
label="AutoCorrect Settings"
width="150">
</button>
</panel>
</tab_container>
</panel>
</panel>

View File

@ -851,24 +851,6 @@
tool_tip=""
control_name="FSCmdLineCalc"
width="200"/>
<!--autocorrect-->
<text
top_pad="5"
follows="left|top"
height="16"
name="FSCmdLineAutocorrect_txt"
width="250">
Add autocorrect word(cmd list|bad|good)
</text>
<line_editor
top_pad="0"
follows="left|top"
height="20"
max_length="256"
name="FSCmdLineAutocorrect"
tool_tip=""
control_name="FSCmdLineAutocorrect"
width="200"/>
<!--drawdistance-->
<text
top_pad="5"

View File

@ -1,56 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater name="autocorrect" title="Configuración de autocorrección">
<floater.string name="Entries">
Entradas
</floater.string>
<floater.string name="Search">
Buscar
</floater.string>
<floater.string name="Replace">
Remplazar
</floater.string>
<floater.string name="AddNewEntryMessage">
Para añadir una entrada, por favor escribe en el chat &quot;[COMMAND] [LISTNAME]|palabraerrónea|palabracorrecta&quot;
</floater.string>
<panel label="lgg_ac_panel" name="Autocorrect Settings">
<check_box label="Activar autocorrección" name="lgg_ac_enable" tool_tip="Debes tener activada esta casilla para usar cualquiera de estas configuraciones. Buscará en tu escritura las ocurrencias incluídas en la lista de búsqueda y las reemplazará por el texto corrrespondiente."/>
<button name="lgg_ac_loadlist" label="Cargar lista..." tool_tip="Pulsa para cargar una lista previamente exportada a un archivo."/>
<panel name="priority_stack">
<text name="lgg_ac_text3" width="205">
Palabras corregidas automáticamente:
</text>
<text name="lgg_ac_stats" width="65">
Recuento
</text>
</panel>
<text name="lgg_ac_text1">
Nombres de lista
</text>
<button name="lgg_ac_deletelist" label="Eliminar lista" tool_tip="Borra la lista completa de palabras y sus sustituciones. No es reversible."/>
<button name="lgg_ac_exportlist" label="Exportar lista" tool_tip="Guarda la lista actual en un archivo para que puedas compartirla con tus amigos o editarla."/>
<text name="lgg_ac_text1a">
Entradas
</text>
<panel name="entry_settings_stack">
<text name="lgg_ac_text_name">
Nombre de la lista
</text>
<panel name="author_stack">
<text name="lgg_ac_text2">
Autor:
</text>
<text name="lgg_ac_text_author">
Nombre del autor
</text>
</panel>
<panel name="priority_stack">
<check_box label="Activado, prioridad:" name="lgg_ac_list_enabled" tool_tip="Determina si deseas o no usar esta lista en particular." width="120"/>
<spinner name="lgg_ac_priority" tool_tip="Este número determina en qué orden se usará esta lista para reemplazar palabras. Una prioridad más alta significa que será usada antes que otras con menor prioridad."/>
</panel>
<check_box label="Mostrar notificaciones" name="lgg_ac_list_show" tool_tip="Muestra una notificación emergente cada vez que una palabra sea reemplazada."/>
<check_box label="Estilo Palabra" name="lgg_ac_list_style" tool_tip="Determina si sólo se reemplazarán palabras completas o se buscará también coincidencias dentro de las palabras."/>
<button name="lgg_ac_addentry" label="Añadir entrada" width="110"/>
<button name="lgg_ac_rementry" label="Eliminar entrada" width="110"/>
</panel>
</panel>
</floater>

View File

@ -1,54 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<!--alba-->
<floater name="lgg_ac_floater"
title="Paramètres de l'autocorrection">
<check_box name="lgg_ac_enable"
label="Activer l'autocorrection"
tool_tip="Cocher pour activer l'autocorrection et tous les autres paramètres. Cette fonction cherche dans le texte que vous tapez les mots incorrects et leur substitue le mot corrigé selon les listes utilisées."/>
<button name="lgg_ac_loadlist"
label="Importer"
tool_tip="Cliquer pour importer une liste précédemment sauvegardée dans vos dossiers."/>
<text name="lgg_ac_notecard"
><!--
Drop a Notecard here
to load from it.-->
</text>
<text name="lgg_ac_text1"
>Nom de la liste Liste des entrées</text>
<text name="lgg_ac_text_name">
Nom de la liste
</text>
<text name="lgg_ac_text2">
Auteur
</text>
<text name="lgg_ac_text_author">
Nom de l'auteur
</text>
<check_box name="lgg_ac_list_enabled"
label="Actif Priorité"
tool_tip="Actif, que vous souhaitiez ou non utiliser cette liste en particulier."/>
<spinner name="lgg_ac_priority"
tool_tip="Ce nombre détermine dans quel ordre vos listes sont utilisées pour remplacer les mots incorrects (0 à 10). Une priorité élevée signifie qu'elle est utilisée avant une priorité basse."/>
<check_box name="lgg_ac_list_show"
label="Notification"
tool_tip="Afficher une notification lors de chaque autocorrection."/>
<check_box name="lgg_ac_list_style"
label="Mot entier uniquement"
tool_tip="Coché, recherche des mots complets, suivis d'un espace. Décoché, recherche également à l'intérieur des mots."/>
<button name="lgg_ac_deletelist"
label="Suppr. la liste"
tool_tip="Supprimer la liste sélectionnée. Irréversible lorsque cette liste n'est pas préalablement enregistrée dans un dossier."/>
<button name="lgg_ac_exportlist"
label="Enreg. la liste"
tool_tip="Enregistrer la liste dans un dossier. Permet de l'éditer facilement et de la partager."/>
<button name="lgg_ac_addentry"
label="Ajouter un mot"/>
<button name="lgg_ac_rementry"
label="Suppr. un mot"/>
<text name="lgg_ac_text3">
Nb de mots autocorrigés
</text>
<text name="lgg_ac_stats">
Compte
</text>
</floater>

View File

@ -1,61 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater name="autocorrect" title="USTAWIENIA AUTOKOREKTY">
<floater.string name="Entries">
Wpisy
</floater.string>
<floater.string name="Search">
Szukaj
</floater.string>
<floater.string name="Replace">
Zamień
</floater.string>
<floater.string name="AddNewEntryMessage">
Aby dodać nową pozycję wpisz w czacie &quot;[COMMAND] [LISTNAME]|złeSłowo|dobreSłowo&quot;
</floater.string>
<panel label="lgg_ac_panel" name="Autocorrect Settings">
<check_box label="Włącz Autokorektę" name="lgg_ac_enable" tool_tip="To pole musi być zaznaczone, jeśli chcesz korzystać z jakichkolwiek opcji tutaj się znajdujących. Autokorekta będzie sprawdzać wszystko co napiszesz w poszukiwaniu słów zdefiniowanych na pierwszej liście i wstawiać na ich na miejsce zamienniki z drugiej listy." />
<button name="lgg_ac_loadlist" label="Wczytaj listę" tool_tip="Kliknij, aby wczytać z pliku wyeksportowaną wcześniej listę." />
<panel name="priority_stack">
<text name="lgg_ac_text3">
Słów automatycznie poprawianych:
</text>
<text name="lgg_ac_stats">
Ilość
</text>
</panel>
<!--
<text name="lgg_ac_notecard">
Upuść tutaj Notę, aby z niej załadować.
</text>
-->
<text name="lgg_ac_text1">
Nazwy list
</text>
<button name="lgg_ac_deletelist" label="Usuń listę" tool_tip="To usunie całą listę słów i ich zamienników, operacji nie można cofnąć." />
<button name="lgg_ac_exportlist" label="Eksportuj listę" tool_tip="Zapisz swoją listę do pliku, aby podzielić się nią ze znajomymi bądź poddać dalszej edycji." />
<text name="lgg_ac_text1a">
Pozycje na liście
</text>
<panel name="entry_settings_stack">
<text name="lgg_ac_text_name">
Nazwa listy
</text>
<panel name="author_stack">
<text name="lgg_ac_text2">
Autor:
</text>
<text name="lgg_ac_text_author">
Nick / Imię autora
</text>
</panel>
<panel name="priority_stack">
<check_box label="Włącz, priorytet:" name="lgg_ac_list_enabled" tool_tip="Zaznacz lub odznacz, aby używać tej listy bądź nie." />
<spinner name="lgg_ac_priority" tool_tip="Ta cyfra wskazuje, która w kolejności będzie ta lista brana pod uwagę podczas sprawdzania słów. Wyższy priorytet oznacza, że lista będzie używana przed innymi o mniejszym pierwszeństwie." />
</panel>
<check_box label="Pokazuj powiadomienia" name="lgg_ac_list_show" tool_tip="Jeśli ta opcja będzie włączona, to za każdym razem gdy słowo zostanie zamienione wyświetli się odpowiedni komunikat." />
<check_box label="Tryb pełnych słów" name="lgg_ac_list_style" tool_tip="Zaznaczenie oznacza, że lista jest przeznaczona do zastąpiania wyłącznie całych słów. Brak zaznaczenia powoduje, że wyszukiwanie jest kontekstowe - także wewnątrz ich treści." />
<button name="lgg_ac_addentry" label="Dodaj pozycję" />
<button name="lgg_ac_rementry" label="Usuń pozycję" />
</panel>
</panel>
</floater>