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.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/linden/indra/newview/llchatbar.cpp b/linden/indra/newview/llchatbar.cpp
index 403ab20..608fb54 100644
--- a/linden/indra/newview/llchatbar.cpp
+++ b/linden/indra/newview/llchatbar.cpp
@@ -102,7 +102,7 @@ private:
102 102
103LLChatBar::LLChatBar() 103LLChatBar::LLChatBar()
104: LLPanel(LLStringUtil::null, LLRect(), BORDER_NO), 104: LLPanel(LLStringUtil::null, LLRect(), BORDER_NO),
105 mChannelControl(FALSE), 105 mChanCtrlEnabled(FALSE),
106 mInputEditor(NULL), 106 mInputEditor(NULL),
107 mGestureLabelTimer(), 107 mGestureLabelTimer(),
108 mLastSpecialChatChannel(0), 108 mLastSpecialChatChannel(0),
@@ -157,6 +157,8 @@ BOOL LLChatBar::postBuild()
157 mInputEditor->setEnableLineHistory(TRUE); 157 mInputEditor->setEnableLineHistory(TRUE);
158 } 158 }
159 159
160 mChannelControl = getChild<LLSpinCtrl>("channel_control");
161
160 toggleChannelControl(); 162 toggleChannelControl();
161 163
162 mIsBuilt = TRUE; 164 mIsBuilt = TRUE;
@@ -218,7 +220,7 @@ void LLChatBar::refresh()
218 220
219 childSetValue("History", LLFloaterChat::instanceVisible(LLSD())); 221 childSetValue("History", LLFloaterChat::instanceVisible(LLSD()));
220 222
221 childSetValue("channel_control",( 1.f * ((S32)(getChild<LLSpinCtrl>("channel_control")->get()))) ); 223 //childSetValue("channel_control",( 1.f * ((S32)(mChannelControl->get()))) );
222 childSetEnabled("Say", mInputEditor->getText().size() > 0); 224 childSetEnabled("Say", mInputEditor->getText().size() > 0);
223 childSetEnabled("Shout", mInputEditor->getText().size() > 0); 225 childSetEnabled("Shout", mInputEditor->getText().size() > 0);
224 226
@@ -379,7 +381,7 @@ LLWString LLChatBar::stripChannelNumber(const LLWString &mesg, S32* channel)
379 } 381 }
380 else 382 else
381 { 383 {
382 if (!mChannelControl) 384 if (!mChanCtrlEnabled)
383 { 385 {
384 // This is normal chat. 386 // This is normal chat.
385 *channel = 0; 387 *channel = 0;
@@ -399,7 +401,7 @@ void LLChatBar::sendChat( EChatType type )
399 // store sent line in history, duplicates will get filtered 401 // store sent line in history, duplicates will get filtered
400 if (mInputEditor) mInputEditor->updateHistory(); 402 if (mInputEditor) mInputEditor->updateHistory();
401 // Check if this is destined for another channel 403 // Check if this is destined for another channel
402 S32 channel = mChannelControl ? (S32)(getChild<LLSpinCtrl>("channel_control")->get()) : 0; 404 S32 channel = mChanCtrlEnabled ? (S32)(mChannelControl->get()) : 0;
403 405
404 stripChannelNumber(text, &channel); 406 stripChannelNumber(text, &channel);
405 407
@@ -441,9 +443,9 @@ void LLChatBar::sendChat( EChatType type )
441void LLChatBar::toggleChannelControl() 443void LLChatBar::toggleChannelControl()
442{ 444{
443 LLRect input_rect = mInputEditor->getRect(); 445 LLRect input_rect = mInputEditor->getRect();
444 S32 chan_width = getChild<LLSpinCtrl>("channel_control")->getRect().getWidth(); 446 S32 chan_width = mChannelControl->getRect().getWidth();
445 BOOL visible = gSavedSettings.getBOOL("ChatChannelSelect"); 447 BOOL visible = gSavedSettings.getBOOL("ChatChannelSelect");
446 BOOL control = getChild<LLSpinCtrl>("channel_control")->getVisible(); 448 BOOL control = mChannelControl->getVisible();
447 449
448 if (visible && !control) 450 if (visible && !control)
449 { 451 {
@@ -460,7 +462,7 @@ void LLChatBar::toggleChannelControl()
460 462
461 childSetVisible("channel_control", visible); 463 childSetVisible("channel_control", visible);
462 childSetEnabled("channel_control", visible); 464 childSetEnabled("channel_control", visible);
463 mChannelControl = visible; 465 mChanCtrlEnabled = visible;
464} 466}
465 467
466 468
@@ -616,7 +618,7 @@ void LLChatBar::sendChatFromViewer(const std::string &utf8text, EChatType type,
616void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate) 618void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate)
617{ 619{
618 // Look for "/20 foo" channel chats. 620 // Look for "/20 foo" channel chats.
619 S32 channel = mChannelControl ? (S32)(getChild<LLSpinCtrl>("channel_control")->get()) : 0; 621 S32 channel = mChanCtrlEnabled ? (S32)(mChannelControl->get()) : 0;
620 622
621 LLWString out_text = stripChannelNumber(wtext, &channel); 623 LLWString out_text = stripChannelNumber(wtext, &channel);
622 std::string utf8_out_text = wstring_to_utf8str(out_text); 624 std::string utf8_out_text = wstring_to_utf8str(out_text);