diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index cc73ffc32..542a22b46 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -77,6 +77,7 @@ set(viewer_SOURCE_FILES
cofmgr.cpp
ascentdaycyclemanager.cpp
ascentfloatercontactgroups.cpp
+ ascentkeyword.cpp
ascentprefssys.cpp
ascentprefsvan.cpp
dhparam.cpp
@@ -549,6 +550,7 @@ set(viewer_HEADER_FILES
cofmgr.h
ascentdaycyclemanager.h
ascentfloatercontactgroups.h
+ ascentkeyword.h
ascentprefssys.h
ascentprefsvan.h
emerald.h
diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml
index cab1429ca..c740123ab 100644
--- a/indra/newview/app_settings/settings_per_account.xml
+++ b/indra/newview/app_settings/settings_per_account.xml
@@ -673,5 +673,100 @@
Value
0
+
+ KeywordsChangeColor
+
+ KeywordsColor
+
+ KeywordsInChat
+
+ KeywordsInIM
+
+ KeywordsList
+
+ KeywordsOn
+
+ KeywordsPlaySound
+
+ KeywordsSound
+
+
diff --git a/indra/newview/ascentkeyword.cpp b/indra/newview/ascentkeyword.cpp
new file mode 100644
index 000000000..bcbc8a28e
--- /dev/null
+++ b/indra/newview/ascentkeyword.cpp
@@ -0,0 +1,88 @@
+/**
+ * @file ascentprefssys.cpp
+ * @Ascent Viewer preferences panel
+ *
+ * $LicenseInfo:firstyear=2011&license=viewergpl$
+ *
+ * Copyright (c) 2011, Tigh MacFanatic.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "ascentkeyword.h"
+#include "llviewercontrol.h"
+#include
+
+
+BOOL AscentKeyword::hasKeyword(std::string msg,int source)
+{
+ static const LLCachedControl mKeywordsOn("KeywordsOn", false, gSavedPerAccountSettings);
+ static const LLCachedControl mKeywordsInChat("KeywordsInChat", false, gSavedPerAccountSettings);
+ static const LLCachedControl mKeywordsInIM("KeywordsInIM", false, gSavedPerAccountSettings);
+
+ if (mKeywordsOn)
+ {
+ if ((source == 1) && (mKeywordsInChat))
+ {
+ return containsKeyWord(msg);
+ }
+
+ if ((source == 2) && (mKeywordsInIM))
+ {
+ return containsKeyWord(msg);
+ }
+ }
+
+ return FALSE;
+}
+
+bool AscentKeyword::containsKeyWord(std::string source)
+{
+ static const LLCachedControl mKeywordsList("KeywordsList", "", gSavedPerAccountSettings);
+ static const LLCachedControl mKeywordsPlaySound("KeywordsPlaySound", false, gSavedPerAccountSettings);
+ static const LLCachedControl mKeywordsSound("KeywordsSound", "", gSavedPerAccountSettings);
+
+ std::string s = mKeywordsList;
+ LLStringUtil::toLower(s);
+ LLStringUtil::toLower(source);
+ boost::regex re(",");
+ boost::sregex_token_iterator i(s.begin(), s.end(), re, -1);
+ boost::sregex_token_iterator j;
+
+ while(i != j)
+ {
+ if(source.find( *i++) != std::string::npos)
+ {
+ if (mKeywordsPlaySound)
+ {
+ LLUI::sAudioCallback(LLUUID(mKeywordsSound));
+ }
+
+ return true;
+ }
+ }
+
+ return false;
+}
diff --git a/indra/newview/ascentkeyword.h b/indra/newview/ascentkeyword.h
new file mode 100644
index 000000000..1e22f8ae1
--- /dev/null
+++ b/indra/newview/ascentkeyword.h
@@ -0,0 +1,53 @@
+/**
+ * @file ascentprefssys.cpp
+ * @Ascent Viewer preferences panel
+ *
+ * $LicenseInfo:firstyear=2011&license=viewergpl$
+ *
+ * Copyright (c) 2011, Tigh MacFanatic.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#ifndef ASCENTKEYWORD_H
+#define ASCENTKEYWORD_H
+
+
+class AscentKeyword
+{
+public:
+ enum MessageSource
+ {
+ LocalChat=1,
+ PrivateMessage=2,
+ GroupChat=3
+ };
+
+ static BOOL hasKeyword(std::string msg, int source);
+
+private:
+ static bool containsKeyWord(std::string source);
+};
+
+
+#endif
diff --git a/indra/newview/ascentprefssys.cpp b/indra/newview/ascentprefssys.cpp
index 677280b1f..b8461ea0b 100644
--- a/indra/newview/ascentprefssys.cpp
+++ b/indra/newview/ascentprefssys.cpp
@@ -51,7 +51,6 @@
#include "lgghunspell_wrapper.h"
-
LLPrefsAscentSys::LLPrefsAscentSys()
{
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_system.xml");
@@ -67,6 +66,9 @@ LLPrefsAscentSys::LLPrefsAscentSys()
childSetAction("EmSpell_Add", onSpellAdd, this);
childSetAction("EmSpell_Remove", onSpellRemove, this);
+ childSetCommitCallback("Keywords_Alert", onCommitCheckBox, this);
+
+
refreshValues();
refresh();
}
@@ -110,6 +112,17 @@ void LLPrefsAscentSys::onCommitCheckBox(LLUICtrl* ctrl, void* user_data)
bool enabled = self->childGetValue("enable_clouds").asBoolean();
self->childSetEnabled("enable_classic_clouds", enabled);
}
+ else if (ctrl->getName() == "Keywords_Alert")
+ {
+ bool enabled = self->childGetValue("Keywords_Alert").asBoolean();
+ self->childSetEnabled("Keywords_Entries", enabled);
+ self->childSetEnabled("Keywords_LocalChat", enabled);
+ self->childSetEnabled("Keywords_IM", enabled);
+ self->childSetEnabled("Keywords_Highlight", enabled);
+ self->childSetEnabled("Keywords_Color", enabled);
+ self->childSetEnabled("Keywords_PlaySound", enabled);
+ self->childSetEnabled("Keywords_SoundUUID", enabled);
+ }
}
void LLPrefsAscentSys::onSpellAdd(void* data)
@@ -204,6 +217,15 @@ void LLPrefsAscentSys::refreshValues()
mDisableClickSit = gSavedSettings.getBOOL("DisableClickSit");
//Text Options ------------------------------------------------------------------------
mSpellDisplay = gSavedSettings.getBOOL("SpellDisplay");
+
+ mKeywordsOn = gSavedPerAccountSettings.getBOOL("KeywordsOn");
+ mKeywordsList = gSavedPerAccountSettings.getString("KeywordsList");
+ mKeywordsInChat = gSavedPerAccountSettings.getBOOL("KeywordsInChat");
+ mKeywordsInIM = gSavedPerAccountSettings.getBOOL("KeywordsInIM");
+ mKeywordsChangeColor = gSavedPerAccountSettings.getBOOL("KeywordsChangeColor");
+ mKeywordsColor = gSavedPerAccountSettings.getColor4("KeywordsColor");
+ mKeywordsPlaySound = gSavedPerAccountSettings.getBOOL("KeywordsPlaySound");
+ mKeywordsSound = static_cast(gSavedPerAccountSettings.getString("KeywordsSound"));
}
void LLPrefsAscentSys::refresh()
@@ -359,10 +381,21 @@ void LLPrefsAscentSys::refresh()
combo->setSimple(std::string(""));
}
+
+ childSetValue("Keywords_Alert", mKeywordsOn);
+ childSetValue("Keywords_Entries", mKeywordsList);
+ childSetValue("Keywords_LocalChat", mKeywordsInChat);
+ childSetValue("Keywords_IM", mKeywordsInIM);
+ childSetValue("Keywords_Highlight", mKeywordsChangeColor);
+ childSetValue("Keywords_PlaySound", mKeywordsPlaySound);
+ childSetValue("Keywords_SoundUUID", mKeywordsSound);
+
+ LLColorSwatchCtrl* colorctrl = getChild("Keywords_Color");
+ colorctrl->set(LLColor4(mKeywordsColor),TRUE);
}
void LLPrefsAscentSys::cancel()
-{
+{/*
//General -----------------------------------------------------------------------------
childSetValue("double_click_teleport_check", mDoubleClickTeleport);
childSetValue("center_after_teleport_check", mResetCameraAfterTP);
@@ -412,7 +445,18 @@ void LLPrefsAscentSys::cancel()
//Text Options ------------------------------------------------------------------------
childSetValue("SpellDisplay", mSpellDisplay);
-}
+
+ childSetValue("Keywords_Alert", mKeywordsOn);
+ childSetValue("Keywords_Entries", mKeywordsList);
+ childSetValue("Keywords_LocalChat", mKeywordsInChat);
+ childSetValue("Keywords_IM", mKeywordsInIM);
+ childSetValue("Keywords_Highlight", mKeywordsChangeColor);
+ childSetValue("Keywords_PlaySound", mKeywordsPlaySound);
+ childSetValue("Keywords_SoundUUID", mKeywordsSound);
+
+ LLColorSwatchCtrl* colorctrl = getChild("Keywords_Color");
+ colorctrl->set(LLColor4(mKeywordsColor),TRUE);
+*/}
void LLPrefsAscentSys::apply()
{
@@ -549,7 +593,18 @@ void LLPrefsAscentSys::apply()
LLHUDEffectLookAt::sDebugLookAt = childGetValue("show_look_at_check");
gSavedSettings.setBOOL("RevokePermsOnStandUp", childGetValue("revoke_perms_on_stand_up_check"));
gSavedSettings.setBOOL("DisableClickSit", childGetValue("disable_click_sit_check"));
-
+
+
+ //Text Options ---------------------------------------------------------------------------
+ gSavedPerAccountSettings.setBOOL("KeywordsOn", childGetValue("Keywords_Alert"));
+ gSavedPerAccountSettings.setString("KeywordsList", childGetValue("Keywords_Entries"));
+ gSavedPerAccountSettings.setBOOL("KeywordsInChat", childGetValue("Keywords_LocalChat"));
+ gSavedPerAccountSettings.setBOOL("KeywordsInIM", childGetValue("Keywords_IM"));
+ gSavedPerAccountSettings.setBOOL("KeywordsChangeColor", childGetValue("Keywords_Highlight"));
+ gSavedPerAccountSettings.setColor4("KeywordsColor", childGetValue("Keywords_Color"));
+ gSavedPerAccountSettings.setBOOL("KeywordsPlaySound", childGetValue("Keywords_PlaySound"));
+ gSavedPerAccountSettings.setString("KeywordsSound", childGetValue("Keywords_SoundUUID"));
+
refreshValues();
refresh();
}
diff --git a/indra/newview/ascentprefssys.h b/indra/newview/ascentprefssys.h
index f9e507d9f..8e0a7671a 100644
--- a/indra/newview/ascentprefssys.h
+++ b/indra/newview/ascentprefssys.h
@@ -98,6 +98,14 @@ protected:
BOOL mDisableClickSit;
//Text Options ------------------------------------------------------------------------
BOOL mSpellDisplay;
+ BOOL mKeywordsOn;
+ std::string mKeywordsList;
+ BOOL mKeywordsInIM;
+ BOOL mKeywordsInChat;
+ BOOL mKeywordsChangeColor;
+ BOOL mKeywordsPlaySound;
+ LLUUID mKeywordsSound;
+ LLColor4 mKeywordsColor;
};
#endif
\ No newline at end of file
diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp
index d434ecdb8..3f5641558 100644
--- a/indra/newview/llfloaterchat.cpp
+++ b/indra/newview/llfloaterchat.cpp
@@ -75,6 +75,7 @@
#include "llfloaterhtml.h"
#include "llweb.h"
#include "llstylemap.h"
+#include "ascentkeyword.h"
// linden library includes
#include "llaudioengine.h"
@@ -595,6 +596,20 @@ LLColor4 get_text_color(const LLChat& chat)
}
}
+ static const LLCachedControl mKeywordsChangeColor("KeywordsChangeColor", false, gSavedPerAccountSettings);
+ static const LLCachedControl mKeywordsColor("KeywordsColor", LLColor4(1.f, 1.f, 1.f, 1.f), gSavedPerAccountSettings);
+
+ if (gAgent.getID() != chat.mFromID)
+ {
+ if (mKeywordsChangeColor)
+ {
+ if (AscentKeyword::hasKeyword(chat.mText, 1))
+ {
+ text_color = mKeywordsColor;
+ }
+ }
+ }
+
return text_color;
}
diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp
index 5476db1e2..cef6f9daa 100644
--- a/indra/newview/llimpanel.cpp
+++ b/indra/newview/llimpanel.cpp
@@ -74,6 +74,7 @@
#include "llhttpclient.h"
#include "llmutelist.h"
#include "llstylemap.h"
+#include "ascentkeyword.h"
#include "boost/algorithm/string.hpp"
@@ -1592,8 +1593,23 @@ BOOL LLFloaterIMPanel::inviteToSession(const LLDynamicArray& ids)
return TRUE;
}
-void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, const LLColor4& color, bool log_to_file, const LLUUID& source, const std::string& name)
+void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incolor, bool log_to_file, const LLUUID& source, const std::string& name)
{
+ static const LLCachedControl mKeywordsChangeColor("KeywordsChangeColor", false, gSavedPerAccountSettings);
+ static const LLCachedControl mKeywordsColor("KeywordsColor", LLColor4(1.f, 1.f, 1.f, 1.f), gSavedPerAccountSettings);
+
+ if (gAgent.getID() != source)
+ {
+ if (mKeywordsChangeColor)
+ {
+ if (AscentKeyword::hasKeyword(utf8msg, 2))
+ {
+ incolor = mKeywordsColor;
+ }
+ }
+ }
+
+ const LLColor4& color = incolor;
// start tab flashing when receiving im for background session from user
if (source != LLUUID::null)
{
diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h
index c839a2ca2..5787fc603 100644
--- a/indra/newview/llimpanel.h
+++ b/indra/newview/llimpanel.h
@@ -211,7 +211,7 @@ public:
BOOL inviteToSession(const LLDynamicArray& agent_ids);
void addHistoryLine(const std::string &utf8msg,
- const LLColor4& color = LLColor4::white,
+ LLColor4 incolor = LLColor4::white,
bool log_to_file = true,
const LLUUID& source = LLUUID::null,
const std::string& name = LLStringUtil::null);
diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml
index 3bec868fd..cc9004f55 100644
--- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml
+++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml
@@ -530,40 +530,80 @@ Use #f for user's first name, #l for last name,
-
Current language (dictionary):
-
-
Downloaded languages (dictionaries):
-
-
Additional custom languages (dictionaries):
-
-
-
- To use spellcheck, right-click a misspelled word
- (red or otherwise) and select its replacement
+To use spellcheck, right-click a misspelled word
+(red or otherwise) and select its replacement
+
+
+
+
+
+
+ (separated by commas)
+
+
+
+
+ Is found within:
+
+
+
+
+
+
+
+
+
+
+
+
+