aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llchatbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llchatbar.cpp')
-rw-r--r--linden/indra/newview/llchatbar.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/linden/indra/newview/llchatbar.cpp b/linden/indra/newview/llchatbar.cpp
index 31fa653..59aa572 100644
--- a/linden/indra/newview/llchatbar.cpp
+++ b/linden/indra/newview/llchatbar.cpp
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$ 5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2002-2008, Linden Research, Inc. 7 * Copyright (c) 2002-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -48,6 +48,7 @@
48#include "llcommandhandler.h" // secondlife:///app/chat/ support 48#include "llcommandhandler.h" // secondlife:///app/chat/ support
49#include "llviewercontrol.h" 49#include "llviewercontrol.h"
50#include "llfloaterchat.h" 50#include "llfloaterchat.h"
51#include "llfloatergesture.h"
51#include "llgesturemgr.h" 52#include "llgesturemgr.h"
52#include "llkeyboard.h" 53#include "llkeyboard.h"
53#include "lllineeditor.h" 54#include "lllineeditor.h"
@@ -553,15 +554,17 @@ void LLChatBar::onInputEditorGainFocus( LLFocusableElement* caller, void* userda
553// static 554// static
554void LLChatBar::onClickSay( LLUICtrl* ctrl, void* userdata ) 555void LLChatBar::onClickSay( LLUICtrl* ctrl, void* userdata )
555{ 556{
556 LLChatBar* self = (LLChatBar*) userdata; 557 e_chat_type chat_type = CHAT_TYPE_NORMAL;
557 if (ctrl->getValue().asString() == "shout") 558 if (ctrl->getValue().asString() == "shout")
558 { 559 {
559 self->sendChat( CHAT_TYPE_SHOUT ); 560 chat_type = CHAT_TYPE_SHOUT;
560 } 561 }
561 else 562 else if (ctrl->getValue().asString() == "whisper")
562 { 563 {
563 self->sendChat( CHAT_TYPE_NORMAL ); 564 chat_type = CHAT_TYPE_WHISPER;
564 } 565 }
566 LLChatBar* self = (LLChatBar*) userdata;
567 self->sendChat(chat_type);
565} 568}
566 569
567void LLChatBar::sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate) 570void LLChatBar::sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate)
@@ -644,8 +647,9 @@ void LLChatBar::onCommitGesture(LLUICtrl* ctrl, void* data)
644 if (gestures) 647 if (gestures)
645 { 648 {
646 S32 index = gestures->getFirstSelectedIndex(); 649 S32 index = gestures->getFirstSelectedIndex();
647 if (index == 0) 650 if (index <= 0)
648 { 651 {
652 LLFloaterGesture::toggleVisibility();
649 return; 653 return;
650 } 654 }
651 const std::string& trigger = gestures->getSelectedValue().asString(); 655 const std::string& trigger = gestures->getSelectedValue().asString();
@@ -655,7 +659,6 @@ void LLChatBar::onCommitGesture(LLUICtrl* ctrl, void* data)
655 std::string text(trigger); 659 std::string text(trigger);
656 std::string revised_text; 660 std::string revised_text;
657 gGestureManager.triggerAndReviseString(text, &revised_text); 661 gGestureManager.triggerAndReviseString(text, &revised_text);
658
659 revised_text = utf8str_trim(revised_text); 662 revised_text = utf8str_trim(revised_text);
660 if (!revised_text.empty()) 663 if (!revised_text.empty())
661 { 664 {