summaryrefslogtreecommitdiff
path: root/indra/newview/llimfloatercontainer.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-09-04 22:16:24 -0700
committerMerov Linden <merov@lindenlab.com>2012-09-04 22:16:24 -0700
commite271c47994fc9dd86bda9d6ad7e79799229e52aa (patch)
tree39a95ca75541cab5952708b6cfed741394bf9e9c /indra/newview/llimfloatercontainer.cpp
parent8cd5d361600f34a0a7fa504a721bea3301191644 (diff)
parentd41202336b7c797bc3fe4feffa8be2164518e845 (diff)
Pull merge from richard/viewer-chui
Diffstat (limited to 'indra/newview/llimfloatercontainer.cpp')
-rw-r--r--indra/newview/llimfloatercontainer.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index dfe9e6491d..1be0c5f075 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -40,6 +40,7 @@
#include "llavatarnamecache.h"
#include "llgroupiconctrl.h"
#include "llfloateravatarpicker.h"
+#include "llfloaterpreference.h"
#include "llimview.h"
#include "lltransientfloatermgr.h"
#include "llviewercontrol.h"
@@ -53,6 +54,8 @@ LLIMFloaterContainer::LLIMFloaterContainer(const LLSD& seed)
mExpandCollapseBtn(NULL),
mConversationsRoot(NULL)
{
+ mCommitCallbackRegistrar.add("IMFloaterContainer.Action", boost::bind(&LLIMFloaterContainer::onCustomAction, this, _2));
+
// Firstly add our self to IMSession observers, so we catch session events
LLIMMgr::getInstance()->addSessionObserver(this);
@@ -468,8 +471,10 @@ void LLIMFloaterContainer::updateState(bool collapse, S32 delta_width)
void LLIMFloaterContainer::onAddButtonClicked()
{
- LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLIMFloaterContainer::onAvatarPicked, this, _1), TRUE, TRUE, TRUE);
+ LLView * button = findChild<LLView>("conversations_pane_buttons_expanded")->findChild<LLButton>("add_btn");
LLFloater* root_floater = gFloaterView->getParentFloater(this);
+ LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLIMFloaterContainer::onAvatarPicked, this, _1), TRUE, TRUE, TRUE, root_floater->getName(), button);
+
if (picker && root_floater)
{
root_floater->addDependentFloater(picker);
@@ -488,6 +493,25 @@ void LLIMFloaterContainer::onAvatarPicked(const uuid_vec_t& ids)
}
}
+void LLIMFloaterContainer::onCustomAction(const LLSD& userdata)
+{
+ std::string command = userdata.asString();
+
+ if ("chat_preferences" == command)
+ {
+ LLFloaterPreference* floater_prefs = LLFloaterReg::showTypedInstance<LLFloaterPreference>("preferences");
+ if (floater_prefs)
+ {
+ LLTabContainer* tab_container = floater_prefs->getChild<LLTabContainer>("pref core");
+ LLPanel* chat_panel = tab_container->getPanelByName("chat");
+ if (tab_container && chat_panel)
+ {
+ tab_container->selectTabPanel(chat_panel);
+ }
+ }
+ }
+}
+
void LLIMFloaterContainer::repositioningWidgets()
{
LLRect panel_rect = mConversationsListPanel->getRect();