summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorJonathan Yap <none@none>2012-02-17 17:19:27 -0500
committerJonathan Yap <none@none>2012-02-17 17:19:27 -0500
commit6bd03d160d3235f5d314e182c86474cfb0d62548 (patch)
treef232e954f6667ff43b297cadf53a5e0e2390cc0b /indra
parente1fa05d8be51febec618d5ba124dbbab350ab747 (diff)
STORM-1738 Initial support for adding new entries
warn-on-failure:open-license
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llautocorrectfloater.cpp21
-rw-r--r--indra/newview/llautocorrectfloater.h3
-rw-r--r--indra/newview/skins/default/xui/en/floater_autocorrect.xml57
3 files changed, 53 insertions, 28 deletions
diff --git a/indra/newview/llautocorrectfloater.cpp b/indra/newview/llautocorrectfloater.cpp
index 97170fc65c..1cbb08cc1e 100644
--- a/indra/newview/llautocorrectfloater.cpp
+++ b/indra/newview/llautocorrectfloater.cpp
@@ -74,6 +74,8 @@ BOOL AutoCorrectFloater::postBuild(void)
namesList = getChild<LLScrollListCtrl>("ac_list_name");
entryList = getChild<LLScrollListCtrl>("ac_list_entry");
+ mOldText = getChild<LLLineEditor>("ac_old_text");
+ mNewText = getChild<LLLineEditor>("ac_new_text");
childSetCommitCallback("ac_enable",onBoxCommitEnabled,this);
@@ -273,7 +275,7 @@ void AutoCorrectFloater::deleteEntry(void* data)
if((self->entryList->getAllSelected().size())>0)
{
std::string wrong= self->entryList->getFirstSelected()->getColumn(0)->getValue().asString();
- AutoCorrect::getInstance()->removeEntryFromList(wrong,listName);
+ AutoCorrect::getInstance()->removeEntryFromList(wrong,listName);
self->updateItemsList();
AutoCorrect::getInstance()->save();
}
@@ -348,17 +350,16 @@ void AutoCorrectFloater::addEntry(void* data)
if ( self )
{
std::string listName= self->namesList->getFirstSelected()->getColumn(0)->getValue().asString();
- LLChat chat;
- chat.mText ="To add an entry, please type in chat \""+gSavedSettings.getString("CmdLineAutocorrect")+" "+listName+"|wrongWord|rightWord\"";
-
- chat.mSourceType = CHAT_SOURCE_SYSTEM;
- LLSD args;
- args["type"] = LLNotificationsUI::NT_NEARBYCHAT;
- LLNotificationsUI::LLNotificationManager::instance().onChat(chat, args);
-
+ std::string wrong = self->mOldText->getText();
+ std::string right = self->mNewText->getText();
+ if(wrong != "" && right != "")
+ {
+ AutoCorrect::getInstance()->addEntryToList(wrong, right, listName);
+ self->updateItemsList();
+ AutoCorrect::getInstance()->save();
+ }
}
}
-
}
AutoCorrectFloater* AutoCorrectFloater::showFloater()
{
diff --git a/indra/newview/llautocorrectfloater.h b/indra/newview/llautocorrectfloater.h
index bec7161d1a..6c932a3a1d 100644
--- a/indra/newview/llautocorrectfloater.h
+++ b/indra/newview/llautocorrectfloater.h
@@ -24,6 +24,7 @@
#include "llfloater.h"
#include "llmediactrl.h"
#include "llscrolllistctrl.h"
+#include "lllineeditor.h"
#include "llviewerinventory.h"
#include <boost/bind.hpp>
@@ -47,6 +48,8 @@ public:
LLScrollListCtrl *namesList;
LLScrollListCtrl *entryList;
+ LLLineEditor* mOldText;
+ LLLineEditor* mNewText;
//LLPanel * empanel;
private:
//static JCInvDropTarget* mNotecardDropTarget;
diff --git a/indra/newview/skins/default/xui/en/floater_autocorrect.xml b/indra/newview/skins/default/xui/en/floater_autocorrect.xml
index 05683c9907..7e54798d80 100644
--- a/indra/newview/skins/default/xui/en/floater_autocorrect.xml
+++ b/indra/newview/skins/default/xui/en/floater_autocorrect.xml
@@ -6,7 +6,7 @@
bottom="400"
left="300"
can_resize="false"
- height="430"
+ height="500"
width="400"
name="ac_floater"
title="Autocorrect Settings">
@@ -237,7 +237,7 @@
mouse_opaque="false"
name="divisor3"/>
<button
- bottom="400"
+ top="100"
left="5"
height="22"
width="90"
@@ -291,24 +291,45 @@
name="ac_rementry"
label="Remove Entry"/>
<text
- bottom_delta="25"
- left_delta="-240"
- height="16"
- width="170"
+ type="string"
+ length="1"
follows="left|top"
- halign="center"
- font="SansSerifSmall"
- mouse_opaque="true"
- name="ac_text3">
- Words automatically corrected:
+ height="16"
+ layout="topleft"
+ left="10"
+ top="440"
+ width="364">
+ Original text:
</text>
- <view_border
- bottom_delta="-0"
- left_delta="180"
+ <line_editor
+ follows="left|top"
+ height="23"
+ layout="topleft"
+ left="100"
+ max_length_bytes="255"
+ name="ac_old_text"
+ top_delta="0"
+ right="-15"
+ select_on_focus="true" />
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
height="16"
- width="70"
+ layout="topleft"
+ left="10"
+ top="470"
+ width="364">
+ New text:
+ </text>
+ <line_editor
follows="left|top"
- bevel_style="in"
- mouse_opaque="false"
- name="ac_statsbox"/>
+ height="23"
+ layout="topleft"
+ left="100"
+ max_length_bytes="255"
+ name="ac_new_text"
+ top_delta="0"
+ right="-15"
+ select_on_focus="true" />
</floater> \ No newline at end of file