summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterspellchecksettings.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2012-06-20 21:52:42 -0400
committerOz Linden <oz@lindenlab.com>2012-06-20 21:52:42 -0400
commit5dceb6b06c8493d0bf0e21ead14539185bd4b4a8 (patch)
tree2e5dee7a1d5747b4275723e78e25331aafd18443 /indra/newview/llfloaterspellchecksettings.cpp
parent8ef14ffb299a55d29284111899415d824db89263 (diff)
STORM-1889: require all fields when importing spelling dictionary
Diffstat (limited to 'indra/newview/llfloaterspellchecksettings.cpp')
-rw-r--r--indra/newview/llfloaterspellchecksettings.cpp56
1 files changed, 31 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 )
{