STORM-1738: auto-replace chat text
Review Request #581 - Created May 30, 2012 and submitted
Oz Linden | Reviewers | ||
viewer | |||
STORM-1738 | richard.linden | ||
None | viewer-release |
Add the ability to configure lists of keyword/replacement pairs. When a keyword is entered in a chat input bar either at the beginning of a line or preceded by any non-word character (the definition of a "word" character depends on the chosen language), and is followed by a space (' ') character, the keyword is removed from the chat input bar and replaced with the configured replacement. Replacement can be prevented for an entered keyword by following it with a non-breaking space character (alt-space on Mac or Linux, control-space on Windows). If the same keyword appears in more than one list, the one in the highest list in the preference order is used. A list may be exported to an xml file, and then imported from that file.
In QA now.
Diff revision 1 (Latest)
- indra/llui/lllineeditor.h:
- indra/llui/lllineeditor.cpp:
- indra/newview/CMakeLists.txt:
- indra/newview/llautoreplace.h:
- indra/newview/llautoreplace.cpp:
- indra/newview/llfloaterautoreplacesettings.h:
- indra/newview/llfloaterautoreplacesettings.cpp:
- indra/newview/llfloaterpreference.h:
- indra/newview/llfloaterpreference.cpp:
- indra/newview/llimfloater.cpp:
- indra/newview/llnearbychatbar.cpp:
- indra/newview/llviewerfloaterreg.cpp:
- indra/newview/llviewermenu.cpp:
- indra/newview/app_settings/autoreplace.xml:
- indra/newview/app_settings/settings.xml:
- indra/newview/skins/default/xui/en/floater_autoreplace.xml:
- indra/newview/skins/default/xui/en/notifications.xml:
- indra/newview/skins/default/xui/en/panel_preferences_chat.xml:
indra/llui/lllineeditor.h | |||
---|---|---|---|
Revision 675668bd24d3 | New Change | ||
... | 161 lines hidden [Expand] | ||
public: |
|||
162 |
virtual void onCommit(); |
162 |
virtual void onCommit(); |
163 |
virtual BOOL isDirty() const; // Returns TRUE if user changed value at all |
163 |
virtual BOOL isDirty() const; // Returns TRUE if user changed value at all |
164 |
virtual void resetDirty(); // Clear dirty state |
164 |
virtual void resetDirty(); // Clear dirty state |
165 | 165 | ||
166 |
// assumes UTF8 text |
166 |
// assumes UTF8 text |
167 |
virtual void setValue(const LLSD& value ); |
167 |
virtual void setValue(const LLSD& value ); |
168 |
virtual LLSD getValue() const; |
168 |
virtual LLSD getValue() const; |
169 |
virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); |
169 |
virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); |
170 |
virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); |
170 |
virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); |
171 | 171 | ||
172 |
typedef boost::function<void(LLUIString&, S32&)> autoreplace_callback_t; |
||
173 |
autoreplace_callback_t mAutoreplaceCallback; |
||
174 |
void setAutoreplaceCallback(autoreplace_callback_t cb) { mAutoreplaceCallback = cb; } |
||
172 |
void setLabel(const LLStringExplicit &new_label) { mLabel = new_label; } |
175 |
void setLabel(const LLStringExplicit &new_label) { mLabel = new_label; } |
173 |
const std::string& getLabel() { return mLabel.getString(); } |
176 |
const std::string& getLabel() { return mLabel.getString(); } |
174 | 177 | ||
175 |
void setText(const LLStringExplicit &new_text); |
178 |
void setText(const LLStringExplicit &new_text); |
176 | 179 | ||
177 |
const std::string& getText() const { return mText.getString(); } |
180 |
const std::string& getText() const { return mText.getString(); } |
178 |
LLWString getWText() const { return mText.getWString(); } |
181 |
LLWString getWText() const { return mText.getWString(); } |
179 |
LLWString getConvertedText() const; // trimmed text with paragraphs converted to newlines |
182 |
LLWString getConvertedText() const; // trimmed text with paragraphs converted to newlines |
180 | 183 | ||
181 |
S32 getLength() const { return mText.length(); } |
184 |
S32 getLength() const { return mText.length(); } |
... | 229 lines hidden [Expand] |
indra/llui/lllineeditor.cpp | |
---|---|
Revision 675668bd24d3 | New Change |
indra/newview/CMakeLists.txt | |
---|---|
Revision 675668bd24d3 | New Change |
indra/newview/llautoreplace.h | |
---|---|
New File | |
indra/newview/llautoreplace.cpp | |
---|---|
New File | |
indra/newview/llfloaterautoreplacesettings.h | |
---|---|
New File | |
indra/newview/llfloaterautoreplacesettings.cpp | |
---|---|
New File | |
indra/newview/llfloaterpreference.h | |
---|---|
Revision 675668bd24d3 | New Change |
indra/newview/llfloaterpreference.cpp | |
---|---|
Revision 675668bd24d3 | New Change |
indra/newview/llimfloater.cpp | |
---|---|
Revision 675668bd24d3 | New Change |
indra/newview/llnearbychatbar.cpp | |
---|---|
Revision 675668bd24d3 | New Change |
indra/newview/llviewerfloaterreg.cpp | |
---|---|
Revision 675668bd24d3 | New Change |
indra/newview/llviewermenu.cpp | |
---|---|
Revision 675668bd24d3 | New Change |
indra/newview/app_settings/autoreplace.xml | |
---|---|
New File | |
indra/newview/app_settings/settings.xml | |
---|---|
Revision 675668bd24d3 | New Change |
indra/newview/skins/default/xui/en/floater_autoreplace.xml | |
---|---|
New File | |
indra/newview/skins/default/xui/en/notifications.xml | |
---|---|
Revision 675668bd24d3 | New Change |
indra/newview/skins/default/xui/en/panel_preferences_chat.xml | |
---|---|
Revision 675668bd24d3 | New Change |
- indra/llui/lllineeditor.h:
- indra/llui/lllineeditor.cpp:
- indra/newview/CMakeLists.txt:
- indra/newview/llautoreplace.h:
- indra/newview/llautoreplace.cpp:
- indra/newview/llfloaterautoreplacesettings.h:
- indra/newview/llfloaterautoreplacesettings.cpp:
- indra/newview/llfloaterpreference.h:
- indra/newview/llfloaterpreference.cpp:
- indra/newview/llimfloater.cpp:
- indra/newview/llnearbychatbar.cpp:
- indra/newview/llviewerfloaterreg.cpp:
- indra/newview/llviewermenu.cpp:
- indra/newview/app_settings/autoreplace.xml:
- indra/newview/app_settings/settings.xml:
- indra/newview/skins/default/xui/en/floater_autoreplace.xml:
- indra/newview/skins/default/xui/en/notifications.xml:
- indra/newview/skins/default/xui/en/panel_preferences_chat.xml:
Other reviews