From f05952205fe5d861ce272ef377bc5ad96284d577 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Thu, 2 Sep 2010 02:01:19 -0700 Subject: Removed broken edit button from spell check prefs, added a new debug setting DicDownloadBaseURL --- linden/indra/newview/app_settings/settings.xml | 11 +++++++++++ linden/indra/newview/lggdicdownload.cpp | 5 +++-- linden/indra/newview/lgghunspell_wrapper.cpp | 20 +++++++++----------- .../default/xui/en-us/panel_preferences_advanced.xml | 6 +++--- 4 files changed, 26 insertions(+), 16 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index f096811..894473b 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -1537,6 +1537,17 @@ + DicDownloadBaseURL + + Comment + Base url for download dictionaries + Persist + 1 + Type + String + Value + http://www.imprudenceviewer.org/app/dics/ + EmeraldEnableAutoCorrect Comment diff --git a/linden/indra/newview/lggdicdownload.cpp b/linden/indra/newview/lggdicdownload.cpp index bd383e2..5b8b13a 100644 --- a/linden/indra/newview/lggdicdownload.cpp +++ b/linden/indra/newview/lggdicdownload.cpp @@ -44,6 +44,7 @@ #include "llcombobox.h" #include "llview.h" #include "llprefsadvanced.h" +#include "llviewercontrol.h" #include "llhttpclient.h" #include "llbufferstream.h" @@ -128,8 +129,8 @@ void lggDicDownloadFloater::onClickDownload(void* data) { index--; std::string newDict(self->sNames[index]); - LLHTTPClient::get("http://www.imprudenceviewer.org/app/dics/"+newDict+".aff", new EmeraldDicDownloader(self,newDict+".aff")); - LLHTTPClient::get("http://www.imprudenceviewer.org/app/dics/"+newDict+".dic", new EmeraldDicDownloader(NULL,newDict+".dic")); + LLHTTPClient::get(gSavedSettings.getString("DicDownloadBaseURL")+newDict+".aff", new EmeraldDicDownloader(self,newDict+".aff")); + LLHTTPClient::get(gSavedSettings.getString("DicDownloadBaseURL")+newDict+".dic", new EmeraldDicDownloader(NULL,newDict+".dic")); LLButton* butt = self->getChild("Emerald_dic_download"); if(butt) diff --git a/linden/indra/newview/lgghunspell_wrapper.cpp b/linden/indra/newview/lgghunspell_wrapper.cpp index ff5a3d0..5879bac 100644 --- a/linden/indra/newview/lgghunspell_wrapper.cpp +++ b/linden/indra/newview/lgghunspell_wrapper.cpp @@ -503,7 +503,7 @@ void lggHunSpell_Wrapper::setNewDictionary(std::string newDict) myHunspell = new Hunspell(dicaffpath.c_str(),dicdicpath.c_str()); llinfos << "Adding custom dictionary " << llendl; createCustomDic(); - addDictionary("emerald_custom"); + addDictionary("custom"); std::vector toInstall = getInstalledDicts(); for(int i =0;i<(int)toInstall.size();i++) addDictionary(toInstall[i]); @@ -513,7 +513,7 @@ void lggHunSpell_Wrapper::setNewDictionary(std::string newDict) void lggHunSpell_Wrapper::createCustomDic() { std::string filename(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, - "dictionaries", "emerald_custom.dic")); + "dictionaries", "custom.dic")); if(!gDirUtilp->fileExists(filename)) { llofstream export_file; @@ -527,7 +527,7 @@ void lggHunSpell_Wrapper::addWordToCustomDictionary(std::string wordToAdd) { if(!myHunspell)return; myHunspell->add(wordToAdd.c_str()); - std::string filename(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "dictionaries", "emerald_custom.dic")); + std::string filename(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "dictionaries", "custom.dic")); std::vector lines; if(gDirUtilp->fileExists(filename)) { @@ -847,7 +847,7 @@ void lggHunSpell_Wrapper::getMoreButton(void * data) { std::vector shortNames; std::vector longNames; - LLSD response = LLHTTPClient::blockingGet("http://www.imprudenceviewer.org/app/dics/dic_list.xml"); + LLSD response = LLHTTPClient::blockingGet(gSavedSettings.getString("DicDownloadBaseURL")+"dic_list.xml"); if(response.has("body")) { const LLSD &dict_list = response["body"]; @@ -866,16 +866,14 @@ void lggHunSpell_Wrapper::getMoreButton(void * data) } void lggHunSpell_Wrapper::editCustomButton() { - std::string dicdicpath(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "dictionaries", std::string("emerald_custom.dic")).c_str()); - - std::vector lines; - + std::string dicdicpath(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "dictionaries", std::string("custom.dic")).c_str()); + if(!gDirUtilp->fileExists(dicdicpath)) { - createCustomDic(); - //glggHunSpell->addWordToCustomDictionary("temp"); + createCustomDic(); + //glggHunSpell->addWordToCustomDictionary("temp"); } - + gViewerWindow->getWindow()->ShellEx(dicdicpath); } diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml index 74ea621..857d1f1 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml @@ -162,9 +162,9 @@ -