V3 merge part 1 / 2.

This commit is contained in:
Shyotl
2012-04-13 22:39:39 -05:00
parent 3bd9ffe135
commit e1d243272f
34 changed files with 879 additions and 780 deletions

View File

@@ -138,7 +138,7 @@ LLChatBar::~LLChatBar()
BOOL LLChatBar::postBuild()
{
childSetAction("History", toggleChatHistory, this);
childSetCommitCallback("Say", onClickSay, this);
getChild<LLUICtrl>("Say")->setCommitCallback(boost::bind(&LLChatBar::onClickSay, this, _1));
// attempt to bind to an existing combo box named gesture
setGestureCombo(getChild<LLComboBox>( "Gesture"));
@@ -249,7 +249,8 @@ void LLChatBar::refreshGestures()
// collect list of unique gestures
std::map <std::string, BOOL> unique;
LLGestureMgr::item_map_t::const_iterator it;
for (it = LLGestureMgr::instance().getActiveGestures().begin(); it != LLGestureMgr::instance().getActiveGestures().end(); ++it)
const LLGestureMgr::item_map_t& active_gestures = LLGestureMgr::instance().getActiveGestures();
for (it = active_gestures.begin(); it != active_gestures.end(); ++it)
{
LLMultiGesture* gesture = (*it).second;
if (gesture)
@@ -330,8 +331,7 @@ void LLChatBar::setGestureCombo(LLComboBox* combo)
mGestureCombo = combo;
if (mGestureCombo)
{
mGestureCombo->setCommitCallback(onCommitGesture);
mGestureCombo->setCallbackUserData(this);
mGestureCombo->setCommitCallback(boost::bind(&LLChatBar::onCommitGesture, this, _1));
// now register observer since we have a place to put the results
mObserver = new LLChatBarGestureObserver(this);
@@ -637,19 +637,19 @@ void LLChatBar::onInputEditorGainFocus()
}
// static
void LLChatBar::onClickSay( LLUICtrl* ctrl, void* userdata )
void LLChatBar::onClickSay( LLUICtrl* ctrl )
{
std::string cmd = ctrl->getValue().asString();
e_chat_type chat_type = CHAT_TYPE_NORMAL;
if (ctrl->getValue().asString() == "shout")
if (cmd == "shout")
{
chat_type = CHAT_TYPE_SHOUT;
}
else if (ctrl->getValue().asString() == "whisper")
else if (cmd == "whisper")
{
chat_type = CHAT_TYPE_WHISPER;
}
LLChatBar* self = (LLChatBar*) userdata;
self->sendChat(chat_type);
sendChat(chat_type);
}
void LLChatBar::sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate)
@@ -861,11 +861,9 @@ void really_send_chat_from_viewer(const std::string& utf8_out_text, EChatType ty
}
// static
void LLChatBar::onCommitGesture(LLUICtrl* ctrl, void* data)
void LLChatBar::onCommitGesture(LLUICtrl* ctrl)
{
LLChatBar* self = (LLChatBar*)data;
LLCtrlListInterface* gestures = self->mGestureCombo ? self->mGestureCombo->getListInterface() : NULL;
LLCtrlListInterface* gestures = mGestureCombo ? mGestureCombo->getListInterface() : NULL;
if (gestures)
{
S32 index = gestures->getFirstSelectedIndex();
@@ -885,14 +883,14 @@ void LLChatBar::onCommitGesture(LLUICtrl* ctrl, void* data)
if (!revised_text.empty())
{
// Don't play nodding animation
self->sendChatFromViewer(revised_text, CHAT_TYPE_NORMAL, FALSE);
sendChatFromViewer(revised_text, CHAT_TYPE_NORMAL, FALSE);
}
}
self->mGestureLabelTimer.start();
if (self->mGestureCombo != NULL)
mGestureLabelTimer.start();
if (mGestureCombo != NULL)
{
// free focus back to chat bar
self->mGestureCombo->setFocus(FALSE);
mGestureCombo->setFocus(FALSE);
}
}