aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-09-25 21:12:46 -0700
committerMcCabe Maxsted2009-09-25 21:12:46 -0700
commit3d4e223fd343d1b436f0dacdce969e548ecb4e79 (patch)
treea3b908817680a2bea3e6082f5eb3d31c39199be7 /linden
parentFixed chat channel control value not updating when Return key pressed (diff)
downloadmeta-impy-3d4e223fd343d1b436f0dacdce969e548ecb4e79.zip
meta-impy-3d4e223fd343d1b436f0dacdce969e548ecb4e79.tar.gz
meta-impy-3d4e223fd343d1b436f0dacdce969e548ecb4e79.tar.bz2
meta-impy-3d4e223fd343d1b436f0dacdce969e548ecb4e79.tar.xz
Cleaned up channel control code in llchatbar.cpp some
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/newview/llchatbar.cpp18
-rw-r--r--linden/indra/newview/llchatbar.h4
2 files changed, 13 insertions, 9 deletions
diff --git a/linden/indra/newview/llchatbar.cpp b/linden/indra/newview/llchatbar.cpp
index 46024ab..8c22931 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),
@@ -156,6 +156,8 @@ BOOL LLChatBar::postBuild()
156 mInputEditor->setEnableLineHistory(TRUE); 156 mInputEditor->setEnableLineHistory(TRUE);
157 } 157 }
158 158
159 mChannelControl = getChild<LLSpinCtrl>("channel_control");
160
159 toggleChannelControl(); 161 toggleChannelControl();
160 162
161 mIsBuilt = TRUE; 163 mIsBuilt = TRUE;
@@ -217,7 +219,7 @@ void LLChatBar::refresh()
217 219
218 childSetValue("History", LLFloaterChat::instanceVisible(LLSD())); 220 childSetValue("History", LLFloaterChat::instanceVisible(LLSD()));
219 221
220 //childSetValue("channel_control",( 1.f * ((S32)(getChild<LLSpinCtrl>("channel_control")->get()))) ); 222 //childSetValue("channel_control",( 1.f * ((S32)(mChannelControl->get()))) );
221 childSetEnabled("Say", mInputEditor->getText().size() > 0); 223 childSetEnabled("Say", mInputEditor->getText().size() > 0);
222 childSetEnabled("Shout", mInputEditor->getText().size() > 0); 224 childSetEnabled("Shout", mInputEditor->getText().size() > 0);
223 225
@@ -378,7 +380,7 @@ LLWString LLChatBar::stripChannelNumber(const LLWString &mesg, S32* channel)
378 } 380 }
379 else 381 else
380 { 382 {
381 if (!mChannelControl) 383 if (!mChanCtrlEnabled)
382 { 384 {
383 // This is normal chat. 385 // This is normal chat.
384 *channel = 0; 386 *channel = 0;
@@ -398,7 +400,7 @@ void LLChatBar::sendChat( EChatType type )
398 // store sent line in history, duplicates will get filtered 400 // store sent line in history, duplicates will get filtered
399 if (mInputEditor) mInputEditor->updateHistory(); 401 if (mInputEditor) mInputEditor->updateHistory();
400 // Check if this is destined for another channel 402 // Check if this is destined for another channel
401 S32 channel = mChannelControl ? (S32)(getChild<LLSpinCtrl>("channel_control")->get()) : 0; 403 S32 channel = mChanCtrlEnabled ? (S32)(mChannelControl->get()) : 0;
402 404
403 stripChannelNumber(text, &channel); 405 stripChannelNumber(text, &channel);
404 406
@@ -440,9 +442,9 @@ void LLChatBar::sendChat( EChatType type )
440void LLChatBar::toggleChannelControl() 442void LLChatBar::toggleChannelControl()
441{ 443{
442 LLRect input_rect = mInputEditor->getRect(); 444 LLRect input_rect = mInputEditor->getRect();
443 S32 chan_width = getChild<LLSpinCtrl>("channel_control")->getRect().getWidth(); 445 S32 chan_width = mChannelControl->getRect().getWidth();
444 BOOL visible = gSavedSettings.getBOOL("ChatChannelSelect"); 446 BOOL visible = gSavedSettings.getBOOL("ChatChannelSelect");
445 BOOL control = getChild<LLSpinCtrl>("channel_control")->getVisible(); 447 BOOL control = mChannelControl->getVisible();
446 448
447 if (visible && !control) 449 if (visible && !control)
448 { 450 {
@@ -459,7 +461,7 @@ void LLChatBar::toggleChannelControl()
459 461
460 childSetVisible("channel_control", visible); 462 childSetVisible("channel_control", visible);
461 childSetEnabled("channel_control", visible); 463 childSetEnabled("channel_control", visible);
462 mChannelControl = visible; 464 mChanCtrlEnabled = visible;
463} 465}
464 466
465 467
@@ -615,7 +617,7 @@ void LLChatBar::sendChatFromViewer(const std::string &utf8text, EChatType type,
615void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate) 617void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate)
616{ 618{
617 // Look for "/20 foo" channel chats. 619 // Look for "/20 foo" channel chats.
618 S32 channel = mChannelControl ? (S32)(getChild<LLSpinCtrl>("channel_control")->get()) : 0; 620 S32 channel = mChanCtrlEnabled ? (S32)(mChannelControl->get()) : 0;
619 621
620 LLWString out_text = stripChannelNumber(wtext, &channel); 622 LLWString out_text = stripChannelNumber(wtext, &channel);
621 std::string utf8_out_text = wstring_to_utf8str(out_text); 623 std::string utf8_out_text = wstring_to_utf8str(out_text);
diff --git a/linden/indra/newview/llchatbar.h b/linden/indra/newview/llchatbar.h
index 53ac233..96961ae 100644
--- a/linden/indra/newview/llchatbar.h
+++ b/linden/indra/newview/llchatbar.h
@@ -43,6 +43,7 @@ class LLUUID;
43class LLFrameTimer; 43class LLFrameTimer;
44class LLChatBarGestureObserver; 44class LLChatBarGestureObserver;
45class LLComboBox; 45class LLComboBox;
46class LLSpinCtrl;
46 47
47class LLChatBar 48class LLChatBar
48: public LLPanel 49: public LLPanel
@@ -113,7 +114,8 @@ protected:
113 LLChatBarGestureObserver* mObserver; 114 LLChatBarGestureObserver* mObserver;
114 115
115private: 116private:
116 BOOL mChannelControl; 117 BOOL mChanCtrlEnabled;
118 LLSpinCtrl* mChannelControl;
117}; 119};
118 120
119extern LLChatBar *gChatBar; 121extern LLChatBar *gChatBar;