summaryrefslogtreecommitdiff
path: root/indra/newview/llconversationview.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-08-22 19:29:22 -0700
committerMerov Linden <merov@lindenlab.com>2012-08-22 19:29:22 -0700
commit2cf5307c9211b813689f0e441b9f56bc21f63348 (patch)
treee4e521308d788c5de96bccc20d60a57ef1579dd7 /indra/newview/llconversationview.cpp
parentb93e2f7c84a8e14d7ca6c58c35183216a7fbf5bb (diff)
CHUI-282 : WIP : Isolated llconversationview classes and suppressed the dependency of model to widgets
Diffstat (limited to 'indra/newview/llconversationview.cpp')
-rw-r--r--indra/newview/llconversationview.cpp64
1 files changed, 64 insertions, 0 deletions
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
new file mode 100644
index 0000000000..7d90a154e5
--- /dev/null
+++ b/indra/newview/llconversationview.cpp
@@ -0,0 +1,64 @@
+/**
+ * @file llconversationview.cpp
+ * @brief Implementation of conversations list widgets and views
+ *
+ * $LicenseInfo:firstyear=2009&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llconversationview.h"
+#include "llimconversation.h"
+#include "llimfloatercontainer.h"
+
+LLConversationViewSession::Params::Params() :
+ container()
+{}
+
+LLConversationViewSession::LLConversationViewSession( const LLConversationViewSession::Params& p ):
+ LLFolderViewFolder(p),
+ mContainer(p.container)
+{
+}
+
+void LLConversationViewSession::selectItem()
+{
+ LLFolderViewItem::selectItem();
+
+ LLConversationItem* item = dynamic_cast<LLConversationItem*>(mViewModelItem);
+ LLFloater* session_floater = LLIMConversation::getConversation(item->getUUID());
+ LLMultiFloater* host_floater = session_floater->getHost();
+
+ if (host_floater == mContainer)
+ {
+ // Always expand the message pane if the panel is hosted by the container
+ mContainer->collapseMessagesPane(false);
+ // Switch to the conversation floater that is being selected
+ mContainer->selectFloater(session_floater);
+ }
+
+ // Set the focus on the selected floater
+ session_floater->setFocus(TRUE);
+}
+
+// EOF