diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterspellchecksettings.cpp | 56 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 8 |
2 files changed, 39 insertions, 25 deletions
diff --git a/indra/newview/llfloaterspellchecksettings.cpp b/indra/newview/llfloaterspellchecksettings.cpp index c62577bc94..5ecdd11918 100644 --- a/indra/newview/llfloaterspellchecksettings.cpp +++ b/indra/newview/llfloaterspellchecksettings.cpp @@ -294,47 +294,53 @@ void LLFloaterSpellCheckerImport::onBtnOK() const std::string dict_aff = mDictionaryDir + gDirUtilp->getDirDelimiter() + mDictionaryBasename + ".aff"; std::string dict_language = getChild<LLUICtrl>("dictionary_language")->getValue().asString(); LLStringUtil::trim(dict_language); - if ( (dict_language.empty()) || (!gDirUtilp->fileExists(dict_dic)) || - (mDictionaryDir.empty()) || (mDictionaryBasename.empty()) ) - { - return; - } bool imported = false; - std::string settings_dic = LLSpellChecker::getDictionaryUserPath() + mDictionaryBasename + ".dic"; - if ( copyFile( dict_dic, settings_dic ) ) + if ( dict_language.empty() + || mDictionaryDir.empty() + || mDictionaryBasename.empty() + || ! gDirUtilp->fileExists(dict_dic) + ) { - if (gDirUtilp->fileExists(dict_aff)) + LLNotificationsUtil::add("SpellingDictImportRequired"); + } + else + { + std::string settings_dic = LLSpellChecker::getDictionaryUserPath() + mDictionaryBasename + ".dic"; + if ( copyFile( dict_dic, settings_dic ) ) { - std::string settings_aff = LLSpellChecker::getDictionaryUserPath() + mDictionaryBasename + ".aff"; - if (copyFile( dict_aff, settings_aff )) + if (gDirUtilp->fileExists(dict_aff)) { - imported = true; + std::string settings_aff = LLSpellChecker::getDictionaryUserPath() + mDictionaryBasename + ".aff"; + if (copyFile( dict_aff, settings_aff )) + { + imported = true; + } + else + { + LLSD args = LLSD::emptyMap(); + args["FROM_NAME"] = dict_aff; + args["TO_NAME"] = settings_aff; + LLNotificationsUtil::add("SpellingDictImportFailed", args); + } } else { LLSD args = LLSD::emptyMap(); - args["FROM_NAME"] = dict_aff; - args["TO_NAME"] = settings_aff; - LLNotificationsUtil::add("SpellingDictImportFailed", args); + args["DIC_NAME"] = dict_dic; + LLNotificationsUtil::add("SpellingDictIsSecondary", args); + + imported = true; } } else { LLSD args = LLSD::emptyMap(); - args["DIC_NAME"] = dict_dic; - LLNotificationsUtil::add("SpellingDictIsSecondary", args); - - imported = true; + args["FROM_NAME"] = dict_dic; + args["TO_NAME"] = settings_dic; + LLNotificationsUtil::add("SpellingDictImportFailed", args); } } - else - { - LLSD args = LLSD::emptyMap(); - args["FROM_NAME"] = dict_dic; - args["TO_NAME"] = settings_dic; - LLNotificationsUtil::add("SpellingDictImportFailed", args); - } if ( imported ) { diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 79e02727e9..1cb0fad9a9 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -2398,6 +2398,14 @@ Would you be my friend? <notification icon="alertmodal.tga" + name="SpellingDictImportRequired" + type="alertmodal"> + You must specify a file, a name, and a language. + <tag>fail</tag> + </notification> + + <notification + icon="alertmodal.tga" name="SpellingDictIsSecondary" type="alertmodal"> The dictionary [DIC_NAME] does not appear to have an "aff" file; this means that it is a "secondary" dictionary. |