From 2cf5307c9211b813689f0e441b9f56bc21f63348 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 22 Aug 2012 19:29:22 -0700 Subject: CHUI-282 : WIP : Isolated llconversationview classes and suppressed the dependency of model to widgets --- indra/newview/llconversationview.cpp | 64 ++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 indra/newview/llconversationview.cpp (limited to 'indra/newview/llconversationview.cpp') 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(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 -- cgit v1.2.3 From 679d0f78f9a4a83e5eb2ec857ceb2d9b8c6f4d91 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 22 Aug 2012 23:14:01 -0700 Subject: CHUI-282 : WIP, Clean up dependencies --- indra/newview/llconversationview.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llconversationview.cpp') diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 7d90a154e5..464d061a82 100644 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -28,6 +28,7 @@ #include "llviewerprecompiledheaders.h" #include "llconversationview.h" +#include "llconversationmodel.h" #include "llimconversation.h" #include "llimfloatercontainer.h" -- cgit v1.2.3 From 4ea73df484d22815026367771f9d728d755f6274 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 23 Aug 2012 11:32:20 -0700 Subject: CHUI-282 : WIP : Further separate view from model for llconversation items --- indra/newview/llconversationview.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/newview/llconversationview.cpp') diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 464d061a82..6cc911ecef 100644 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -62,4 +62,17 @@ void LLConversationViewSession::selectItem() session_floater->setFocus(TRUE); } +void LLConversationViewSession::setVisibleIfDetached(BOOL visible) +{ + // Do this only if the conversation floater has been torn off (i.e. no multi floater host) and is not minimized + // Note: minimized dockable floaters are brought to front hence unminimized when made visible and we don't want that here + LLConversationItem* item = dynamic_cast(mViewModelItem); + LLFloater* session_floater = LLIMConversation::getConversation(item->getUUID()); + + if (session_floater && !session_floater->getHost() && !session_floater->isMinimized()) + { + session_floater->setVisible(visible); + } +} + // EOF -- cgit v1.2.3 From e537d6477dfa1eea86dc16c767b793fb530d1ebc Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 23 Aug 2012 19:44:10 -0700 Subject: CHUI-98 : Defining the various llconversation sub classes in their respective file --- indra/newview/llconversationview.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/newview/llconversationview.cpp') diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 6cc911ecef..fefb7e9cac 100644 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -32,6 +32,10 @@ #include "llimconversation.h" #include "llimfloatercontainer.h" +// +// Implementation of conversations list session widgets +// + LLConversationViewSession::Params::Params() : container() {} @@ -75,4 +79,13 @@ void LLConversationViewSession::setVisibleIfDetached(BOOL visible) } } +// +// Implementation of conversations list participant (avatar) widgets +// + +LLConversationViewParticipant::LLConversationViewParticipant( const LLFolderViewItem::Params& p ): + LLFolderViewItem(p) +{ +} + // EOF -- cgit v1.2.3 From 8cd5d361600f34a0a7fa504a721bea3301191644 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 4 Sep 2012 22:11:28 -0700 Subject: CHUI-285 : Create participant widgets in the conversation list --- indra/newview/llconversationview.cpp | 38 ++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'indra/newview/llconversationview.cpp') diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index fefb7e9cac..2f71e92a7d 100644 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -79,12 +79,46 @@ void LLConversationViewSession::setVisibleIfDetached(BOOL visible) } } +LLConversationViewParticipant* LLConversationViewSession::findParticipant(const LLUUID& participant_id) +{ + // This is *not* a general tree parsing algorithm. We search only in the mItems list + // assuming there is no mFolders which makes sense for sessions (sessions don't contain + // sessions). + LLConversationViewParticipant* participant = NULL; + items_t::const_iterator iter; + for (iter = getItemsBegin(); iter != getItemsEnd(); iter++) + { + participant = dynamic_cast(*iter); + if (participant->hasSameValue(participant_id)) + { + break; + } + } + return (iter == getItemsEnd() ? NULL : participant); +} + +void LLConversationViewSession::refresh() +{ + // Refresh the session view from its model data + // LLConversationItemSession* vmi = dynamic_cast(getViewModelItem()); + + // Note: for the moment, all that needs to be done is done by LLFolderViewItem::refresh() + + // Do the regular upstream refresh + LLFolderViewFolder::refresh(); +} + // // Implementation of conversations list participant (avatar) widgets // -LLConversationViewParticipant::LLConversationViewParticipant( const LLFolderViewItem::Params& p ): - LLFolderViewItem(p) +LLConversationViewParticipant::Params::Params() : + participant_id() +{} + +LLConversationViewParticipant::LLConversationViewParticipant( const LLConversationViewParticipant::Params& p ): + LLFolderViewItem(p), + mUUID(p.participant_id) { } -- cgit v1.2.3 From 1229f42ade088f69164b59742305119bacc8f4de Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 5 Sep 2012 18:55:07 -0700 Subject: CHUI-285 : Clear the needs refresh flag when refreshing, comment clean up. --- indra/newview/llconversationview.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'indra/newview/llconversationview.cpp') diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 2f71e92a7d..9f3df93aba 100644 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -100,7 +100,8 @@ LLConversationViewParticipant* LLConversationViewSession::findParticipant(const void LLConversationViewSession::refresh() { // Refresh the session view from its model data - // LLConversationItemSession* vmi = dynamic_cast(getViewModelItem()); + LLConversationItem* vmi = dynamic_cast(getViewModelItem()); + vmi->resetRefresh(); // Note: for the moment, all that needs to be done is done by LLFolderViewItem::refresh() @@ -122,4 +123,16 @@ LLConversationViewParticipant::LLConversationViewParticipant( const LLConversati { } +void LLConversationViewParticipant::refresh() +{ + // Refresh the participant view from its model data + LLConversationItem* vmi = dynamic_cast(getViewModelItem()); + vmi->resetRefresh(); + + // Note: for the moment, all that needs to be done is done by LLFolderViewItem::refresh() + + // Do the regular upstream refresh + LLFolderViewItem::refresh(); +} + // EOF -- cgit v1.2.3 From 5dc8738076d158aa74a93f7f3630a17d9102fdc4 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 10 Sep 2012 07:40:13 -0700 Subject: CHUI-283: Basic Implementation, just have hard coded avatar icon appearing and profile/info buttons visible. profile/info buttons do not have proper positioning or mouseclick events. --- indra/newview/llconversationview.cpp | 110 ++++++++++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 1 deletion(-) mode change 100644 => 100755 indra/newview/llconversationview.cpp (limited to 'indra/newview/llconversationview.cpp') diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp old mode 100644 new mode 100755 index fefb7e9cac..d1a8478697 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -32,9 +32,15 @@ #include "llimconversation.h" #include "llimfloatercontainer.h" + +#include "lluictrlfactory.h" +#include "llavatariconctrl.h" + // // Implementation of conversations list session widgets // + + LLConversationViewSession::Params::Params() : container() @@ -83,9 +89,111 @@ void LLConversationViewSession::setVisibleIfDetached(BOOL visible) // Implementation of conversations list participant (avatar) widgets // -LLConversationViewParticipant::LLConversationViewParticipant( const LLFolderViewItem::Params& p ): +static LLDefaultChildRegistry::Register r("conversation_view_participant"); + +LLConversationViewParticipant::Params::Params() : +container(), +view_profile_button("view_profile_button"), +info_button("info_button") +{} + +LLConversationViewParticipant::LLConversationViewParticipant( const LLConversationViewParticipant::Params& p ): LLFolderViewItem(p) +{ + +} + +void LLConversationViewParticipant::initFromParams(const LLConversationViewParticipant::Params& params) +{ + LLButton::Params view_profile_button_params(params.view_profile_button()); + LLButton * button = LLUICtrlFactory::create(view_profile_button_params); + addChild(button); + + LLButton::Params info_button_params(params.info_button()); + button = LLUICtrlFactory::create(info_button_params); + addChild(button); +} + +BOOL LLConversationViewParticipant::postBuild() +{ + mInfoBtn = getChild("info_btn"); + mProfileBtn = getChild("profile_btn"); + + mInfoBtn->setClickedCallback(boost::bind(&LLConversationViewParticipant::onInfoBtnClick, this)); + mProfileBtn->setClickedCallback(boost::bind(&LLConversationViewParticipant::onProfileBtnClick, this)); + + + LLFolderViewItem::postBuild(); + return TRUE; +} + +void LLConversationViewParticipant::onInfoBtnClick() +{ + + +} + +void LLConversationViewParticipant::onProfileBtnClick() +{ + +} + +LLButton* LLConversationViewParticipant::createProfileButton() +{ + + LLButton::Params params; + + + //