void lggHunSpell_Wrapper::processSettings() { //expects everything to already be in saved settings //this will also reload and read the installed dicts setNewDictionary(gSavedSettings.getString("EmeraldSpellBase")); highlightInRed= gSavedSettings.getBOOL("EmeraldSpellDisplay"); }
void lggHunSpell_Wrapper::setNewDictionary(std::string newDict) { llinfos << "Setting new base dictionary long name is-> " << newDict.c_str() << llendl; currentBaseDic=newDict; //expecting a full name comming in newDict = fullName2DictName(newDict); if(myHunspell)delete myHunspell; std::string dicaffpath(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "dictionaries", std::string(newDict+".aff")).c_str()); std::string dicdicpath(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "dictionaries", std::string(newDict+".dic")).c_str()); //check to make sure this dictionary exists, if not, make it use one we know does if(!gDirUtilp->fileExists(dicaffpath)) { gSavedSettings.setString("EmeraldSpellBase","English (United States of America)"); LLSD args; args["MESSAGE"] = "Your current dictionary could not be found, please re-download it. Setting dictionary to English..."; LLNotifications::instance().add("GenericAlert", args); setNewDictionary("English (United States of America)"); return; } llinfos << "Setting new base dictionary -> " << dicaffpath.c_str() << llendl; myHunspell = new Hunspell(dicaffpath.c_str(),dicdicpath.c_str()); llinfos << "Adding custom dictionary " << llendl; addDictionary("emerald_custom"); std::vector<std::string> toInstall = getInstalledDicts(); for(int i =0;i<(int)toInstall.size();i++) addDictionary(toInstall[i]); }
void lggHunSpell_Wrapper::processSettings() { //expects everything to already be in saved settings //this will also reload and read the installed dicts setNewDictionary(gSavedSettings.getString("SpellBase")); }