std::vector <std::string> lggHunSpell_Wrapper::getExtraDicts() { std::vector<std::string> names; std::string path_name(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "dictionaries", "")); bool found = true; while(found) { std::string name; found = gDirUtilp->getNextFileInDir(path_name, "*.dic", name, false); if(found) { names.push_back(dictName2FullName(name)); } } path_name=gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "dictionaries", ""); found=true; while(found) { std::string name; found = gDirUtilp->getNextFileInDir(path_name, "*.dic", name, false); if(found) { names.push_back(dictName2FullName(name)); } } return names; }
std::vector <std::string> lggHunSpell_Wrapper::getExtraDicts() { std::vector<std::string> names; std::string path_name(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "dictionaries", "")); std::string name; LLDirIterator app_iter(path_name, "*.dic"); while (app_iter.next(name)) { names.push_back(dictName2FullName(name)); } path_name = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "dictionaries", ""); LLDirIterator user_iter(path_name, "*.dic"); while (user_iter.next(name)) { names.push_back(dictName2FullName(name)); } return names; }
std::vector<std::string> lggHunSpell_Wrapper::getInstalledDicts() { std::vector<std::string> toReturn; //expecting short names to be stored... std::vector<std::string> shortNames = CSV2VEC(gSavedSettings.getString("EmeraldSpellInstalled")); for(int i =0;i<(int)shortNames.size();i++) toReturn.push_back(dictName2FullName(shortNames[i])); return toReturn; }
void lggHunSpell_Wrapper::getMoreButton(void* data) { std::vector<std::string> shortNames; std::vector<std::string> longNames; LLSD response = LLHTTPClient::blockingGet(gSavedSettings.getString("SpellDownloadURL")+"dic_list.xml"); if (response.has("body")) { const LLSD &dict_list = response["body"]; if (dict_list.has("isComplete")) { LLSD dics = dict_list["data"]; for (int i = 0; i < dics.size(); i++) { std::string dicFullName = dictName2FullName(dics[i].asString()); longNames.push_back(dicFullName); shortNames.push_back(fullName2DictName(dicFullName)); } LggDicDownload::show(true,shortNames,longNames, data); } } }
void lggHunSpell_Wrapper::getMoreButton(void * data) { //LLWeb::loadURL("http://www.cypherpunks.ca/otr/"); std::vector<std::string> shortNames; std::vector<std::string> longNames; LLSD response = LLHTTPClient::blockingGet("http://www.modularsystems.sl/app/dics/dic_list.xml"); if(response.has("body")) { const LLSD &dict_list = response["body"]; if(dict_list.has("isComplete")) { LLSD dics = dict_list["data"]; for(int i = 0; i < dics.size(); i++) { std::string dicFullName = dictName2FullName(dics[i].asString()); longNames.push_back(dicFullName); shortNames.push_back(fullName2DictName(dicFullName)); } LggDicDownload::show(true,shortNames,longNames, data); } } }