All submissions to this site are governed by the Second Life Viewer Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.

Review Board 1.6.11

Welcome to the Second Life Viewer Code Review tool.
See the documentation on our wiki for how to use this site.

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.
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
 
  1. indra/llui/lllineeditor.h: Loading...
  2. indra/llui/lllineeditor.cpp: Loading...
  3. indra/newview/CMakeLists.txt: Loading...
  4. indra/newview/llautoreplace.h: Loading...
  5. indra/newview/llautoreplace.cpp: Loading...
  6. indra/newview/llfloaterautoreplacesettings.h: Loading...
  7. indra/newview/llfloaterautoreplacesettings.cpp: Loading...
  8. indra/newview/llfloaterpreference.h: Loading...
  9. indra/newview/llfloaterpreference.cpp: Loading...
  10. indra/newview/llimfloater.cpp: Loading...
  11. indra/newview/llnearbychatbar.cpp: Loading...
  12. indra/newview/llviewerfloaterreg.cpp: Loading...
  13. indra/newview/llviewermenu.cpp: Loading...
  14. indra/newview/app_settings/autoreplace.xml: Loading...
  15. indra/newview/app_settings/settings.xml: Loading...
  16. indra/newview/skins/default/xui/en/floater_autoreplace.xml: Loading...
  17. indra/newview/skins/default/xui/en/notifications.xml: Loading...
  18. indra/newview/skins/default/xui/en/panel_preferences_chat.xml: Loading...