From 85e553638e51994824683497bd9ccc964c7cc1fc Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 6 Jun 2012 19:37:59 -0700 Subject: CHUI-137 : Implement temporary conversations list (not working yet) --- indra/newview/llfolderviewitem.cpp | 2 +- indra/newview/llimfloatercontainer.cpp | 79 +++++++++++++++++++++++++++++++++ indra/newview/llimfloatercontainer.h | 81 ++++++++++++++++++++++++++++++++++ 3 files changed, 161 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 43d3675d17..126de95551 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -287,7 +287,7 @@ void LLFolderViewItem::refreshFromListener() setCreationDate(creation_date); dirtyFilter(); } - if (mRoot->useLabelSuffix()) + if (mRoot && mRoot->useLabelSuffix()) { mLabelStyle = mListener->getLabelStyle(); mLabelSuffix = mListener->getLabelSuffix(); diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 3b6240de44..134d345148 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -71,6 +71,8 @@ BOOL LLIMFloaterContainer::postBuild() mConversationsStack = getChild("conversations_stack"); mConversationsPane = getChild("conversations_layout_panel"); mMessagesPane = getChild("messages_layout_panel"); + + mConversationsListPanel = getChild("conversations_list_panel"); mExpandCollapseBtn = getChild("expand_collapse_btn"); mExpandCollapseBtn->setClickedCallback(boost::bind(&LLIMFloaterContainer::onExpandCollapseButtonClicked, this)); @@ -112,6 +114,22 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp, LLMultiFloater::addFloater(floaterp, select_added_floater, insertion_point); + // CHUI-137 + llinfos << "Merov debug : addFloater, title = " << floaterp->getTitle() << llendl; + // Create a conversation item + LLConversationItem item(floaterp->getTitle()); + // Add it to the list + mConversationsItems.push_back(item); + // Create a widget from it + LLFolderViewItem* widget = createConversationItemWidget(&item); + // Add it to the list of widgets + mConversationsWidgets.push_back(widget); + // Add it to the UI + widget->setVisible(TRUE); + mConversationsListPanel->addChild(widget); + // Reposition it... + // CHUI-137 : end + LLView* floater_contents = floaterp->getChild("contents_view"); // we don't show the header when the floater is hosted, @@ -150,6 +168,8 @@ void LLIMFloaterContainer::removeFloater(LLFloater* floaterp) { LLMultiFloater::removeFloater(floaterp); + llinfos << "Merov debug : removeFloater, title = " << floaterp->getTitle() << llendl; + LLRect contents_rect = floaterp->getRect(); // reduce the floater contents height by header height @@ -313,4 +333,63 @@ void LLIMFloaterContainer::updateState(bool collapse, S32 delta_width) setCanMinimize(is_left_pane_expanded || is_right_pane_expanded); } +// CHUI-137 : Temp implementation of conversations list +LLFolderViewItem* LLIMFloaterContainer::createConversationItemWidget(LLConversationItem* item) +{ + LLFolderViewItem::Params params; + + params.name = item->getDisplayName(); + //params.icon = bridge->getIcon(); + //params.icon_open = bridge->getOpenIcon(); + + //params.creation_date = bridge->getCreationDate(); + //params.root = mFolderRoot; + params.listener = item; + params.rect = LLRect (0, 0, 0, 0); + params.tool_tip = params.name; + + return LLUICtrlFactory::create(params); +} + +// Conversation items +LLConversationItem::LLConversationItem(std::string name) : + mName(name), + mUUID(LLUUID::null) +{ + if (name == "") + mName = "Nearby Chat"; +} + +// Virtual action callbacks +void LLConversationItem::performAction(LLInventoryModel* model, std::string action) +{ + llinfos << "Merov debug : performAction, title = " << mName << ", action = " << action << llendl; +} + +void LLConversationItem::openItem( void ) +{ + llinfos << "Merov debug : openItem, title = " << mName << llendl; +} + +void LLConversationItem::closeItem( void ) +{ + llinfos << "Merov debug : closeItem, title = " << mName << llendl; +} + +void LLConversationItem::previewItem( void ) +{ + llinfos << "Merov debug : previewItem, title = " << mName << llendl; +} + +void LLConversationItem::selectItem(void) +{ + llinfos << "Merov debug : selectItem, title = " << mName << llendl; +} + +void LLConversationItem::showProperties(void) +{ + llinfos << "Merov debug : showProperties, title = " << mName << llendl; +} + + // EOF diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 92938ff405..5cfdb41ad3 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -35,11 +35,85 @@ #include "llavatarpropertiesprocessor.h" #include "llgroupmgr.h" +#include "llfolderviewitem.h" +#include "llfoldervieweventlistener.h" + class LLButton; class LLLayoutPanel; class LLLayoutStack; class LLTabContainer; +// CHUI-137 : Temporary implementation of conversations list +class LLConversationItem; + +typedef std::list conversations_items_list_t; +typedef std::list conversations_widgets_list_t; + +// Conversation items: we hold a list of those and create an LLFolderViewItem widget for each that we tuck +// into the mConversationsListPanel. +class LLConversationItem : public LLFolderViewEventListener +{ +public: + LLConversationItem(std::string name); + virtual ~LLConversationItem() {} + + // Stub those things we won't really be using in this conversation context + virtual const std::string& getName() const { return mName; } + virtual const std::string& getDisplayName() const { return mName; } + virtual const LLUUID& getUUID() const { return mUUID; } + virtual time_t getCreationDate() const { return 0; } + virtual PermissionMask getPermissionMask() const { return PERM_ALL; } + virtual LLFolderType::EType getPreferredType() const { return LLFolderType::FT_NONE; } + virtual LLPointer getIcon() const { return NULL; } + virtual LLPointer getOpenIcon() const { return getIcon(); } + virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } + virtual std::string getLabelSuffix() const { return LLStringUtil::null; } + virtual BOOL isItemRenameable() const { return FALSE; } + virtual BOOL renameItem(const std::string& new_name) { return FALSE; } + virtual BOOL isItemMovable( void ) const { return FALSE; } + virtual BOOL isItemRemovable( void ) const { return FALSE; } + virtual BOOL isItemInTrash( void) const { return FALSE; } + virtual BOOL removeItem() { return FALSE; } + virtual void removeBatch(LLDynamicArray& batch) { } + virtual void move( LLFolderViewEventListener* parent_listener ) { } + virtual BOOL isItemCopyable() const { return FALSE; } + virtual BOOL copyToClipboard() const { return FALSE; } + virtual void cutToClipboard() { } + virtual BOOL isClipboardPasteable() const { return FALSE; } + virtual void pasteFromClipboard() { } + virtual void pasteLinkFromClipboard() { } + virtual void buildContextMenu(LLMenuGL& menu, U32 flags) { } + virtual BOOL isUpToDate() const { return TRUE; } + virtual BOOL hasChildren() const { return FALSE; } + virtual LLInventoryType::EType getInventoryType() const { return LLInventoryType::IT_NONE; } + virtual LLWearableType::EType getWearableType() const { return LLWearableType::WT_NONE; } + + // The action callbacks (or so we think...) + virtual void performAction(LLInventoryModel* model, std::string action); + virtual void openItem( void ); + virtual void closeItem( void ); + virtual void previewItem( void ); + virtual void selectItem(void); + virtual void showProperties(void); + + // This method should be called when a drag begins. returns TRUE + // if the drag can begin, otherwise FALSE. + virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const { return FALSE; } + + // This method will be called to determine if a drop can be + // performed, and will set drop to TRUE if a drop is + // requested. Returns TRUE if a drop is possible/happened, + // otherwise FALSE. + virtual BOOL dragOrDrop(MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + std::string& tooltip_msg) { return FALSE; } +private: + std::string mName; + LLUUID mUUID; +}; + // CHUI-137 : End + class LLIMFloaterContainer : public LLMultiFloater { public: @@ -64,6 +138,8 @@ public: virtual void setMinimized(BOOL b); void collapseMessagesPane(bool collapse); + + LLFolderViewItem* createConversationItemWidget(LLConversationItem* item); private: typedef std::map avatarID_panel_map_t; @@ -84,6 +160,11 @@ private: LLLayoutPanel* mMessagesPane; LLLayoutPanel* mConversationsPane; LLLayoutStack* mConversationsStack; + + // CHUI-137 : Data + LLPanel* mConversationsListPanel; // The widget we add list item to (title of each conversation) + conversations_items_list_t mConversationsItems; + conversations_widgets_list_t mConversationsWidgets; }; #endif // LL_LLIMFLOATERCONTAINER_H -- cgit v1.2.3 From 3f7ecef1968b9087ba7c885a2dd6213120dfa547 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 8 Jun 2012 11:31:50 -0700 Subject: CHUI-137 : Fix crasher in item drawing --- indra/newview/llfolderviewitem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 126de95551..73715c78df 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -864,8 +864,8 @@ void LLFolderViewItem::draw() const S32 FOCUS_LEFT = 1; const LLFontGL* font = getLabelFontForStyle(mLabelStyle); - const BOOL in_inventory = getListener() && gInventory.isObjectDescendentOf(getListener()->getUUID(), gInventory.getRootFolderID()); - const BOOL in_library = getListener() && gInventory.isObjectDescendentOf(getListener()->getUUID(), gInventory.getLibraryRootFolderID()); + const BOOL in_inventory = getListener() && getListener()->getUUID().notNull() && gInventory.isObjectDescendentOf(getListener()->getUUID(), gInventory.getRootFolderID()); + const BOOL in_library = getListener() && getListener()->getUUID().notNull() && gInventory.isObjectDescendentOf(getListener()->getUUID(), gInventory.getLibraryRootFolderID()); //--------------------------------------------------------------------------------// // Draw open folder arrow -- cgit v1.2.3 From 1aba6c119ef05a4cfd91325c8455dc8c60098746 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 8 Jun 2012 17:26:13 -0700 Subject: CHUI-137 : Implement conversation list, temporary solution: add but doesn't take out items from the list --- indra/newview/llfolderviewitem.cpp | 32 +++++++++++++++++++++----------- indra/newview/llimfloatercontainer.cpp | 15 +++++++++------ indra/newview/llimfloatercontainer.h | 4 ++-- 3 files changed, 32 insertions(+), 19 deletions(-) diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 73715c78df..0800e0baa2 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -377,7 +377,10 @@ void LLFolderViewItem::setSelectionFromRoot(LLFolderViewItem* selection, BOOL openitem, BOOL take_keyboard_focus) { - getRoot()->setSelection(selection, openitem, take_keyboard_focus); + if (getRoot()) + { + getRoot()->setSelection(selection, openitem, take_keyboard_focus); + } } // helper function to change the selection from the root. @@ -754,7 +757,10 @@ BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask ) } else { - getRoot()->setShowSelectionContext(FALSE); + if (getRoot()) + { + getRoot()->setShowSelectionContext(FALSE); + } gViewerWindow->setCursor(UI_CURSOR_ARROW); // let parent handle this then... return FALSE; @@ -797,7 +803,10 @@ BOOL LLFolderViewItem::handleMouseUp( S32 x, S32 y, MASK mask ) if( hasMouseCapture() ) { - getRoot()->setShowSelectionContext(FALSE); + if (getRoot()) + { + getRoot()->setShowSelectionContext(FALSE); + } gFocusMgr.setMouseCapture( NULL ); } return TRUE; @@ -864,8 +873,9 @@ void LLFolderViewItem::draw() const S32 FOCUS_LEFT = 1; const LLFontGL* font = getLabelFontForStyle(mLabelStyle); - const BOOL in_inventory = getListener() && getListener()->getUUID().notNull() && gInventory.isObjectDescendentOf(getListener()->getUUID(), gInventory.getRootFolderID()); - const BOOL in_library = getListener() && getListener()->getUUID().notNull() && gInventory.isObjectDescendentOf(getListener()->getUUID(), gInventory.getLibraryRootFolderID()); + const LLUUID uuid = (getListener() ? getListener()->getUUID() : LLUUID::null); + const BOOL in_inventory = (uuid.notNull() ? gInventory.isObjectDescendentOf(uuid, gInventory.getRootFolderID()) : FALSE); + const BOOL in_library = (uuid.notNull() ? gInventory.isObjectDescendentOf(uuid, gInventory.getLibraryRootFolderID()) : FALSE); //--------------------------------------------------------------------------------// // Draw open folder arrow @@ -885,8 +895,8 @@ void LLFolderViewItem::draw() //--------------------------------------------------------------------------------// // Draw highlight for selected items // - const BOOL show_context = getRoot()->getShowSelectionContext(); - const BOOL filled = show_context || (getRoot()->getParentPanel()->hasFocus()); // If we have keyboard focus, draw selection filled + const BOOL show_context = (getRoot() ? getRoot()->getShowSelectionContext() : FALSE); + const BOOL filled = show_context || (getRoot() ? getRoot()->getParentPanel()->hasFocus() : FALSE); // If we have keyboard focus, draw selection filled const S32 focus_top = getRect().getHeight(); const S32 focus_bottom = getRect().getHeight() - mItemHeight; const bool folder_open = (getRect().getHeight() > mItemHeight + 4); @@ -897,8 +907,8 @@ void LLFolderViewItem::draw() if (!mIsCurSelection) { // do time-based fade of extra objects - F32 fade_time = getRoot()->getSelectionFadeElapsedTime(); - if (getRoot()->getShowSingleSelection()) + F32 fade_time = (getRoot() ? getRoot()->getSelectionFadeElapsedTime() : 0.0f); + if (getRoot() && getRoot()->getShowSingleSelection()) { // fading out bg_color.mV[VALPHA] = clamp_rescale(fade_time, 0.f, 0.4f, bg_color.mV[VALPHA], 0.f); @@ -1009,7 +1019,7 @@ void LLFolderViewItem::draw() //--------------------------------------------------------------------------------// // Highlight filtered text // - if (getRoot()->getDebugFilters()) + if (getRoot() && getRoot()->getDebugFilters()) { if (!getFiltered() && !possibly_has_children) { @@ -1070,7 +1080,7 @@ void LLFolderViewItem::draw() if (mStringMatchOffset != std::string::npos) { // don't draw backgrounds for zero-length strings - S32 filter_string_length = getRoot()->getFilterSubString().size(); + S32 filter_string_length = (getRoot() ? getRoot()->getFilterSubString().size() : 0); if (filter_string_length > 0) { std::string combined_string = mLabel + mLabelSuffix; diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 134d345148..cd19105860 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -115,19 +115,22 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp, LLMultiFloater::addFloater(floaterp, select_added_floater, insertion_point); // CHUI-137 - llinfos << "Merov debug : addFloater, title = " << floaterp->getTitle() << llendl; // Create a conversation item - LLConversationItem item(floaterp->getTitle()); - // Add it to the list + LLConversationItem* item = new LLConversationItem(floaterp->getTitle()); mConversationsItems.push_back(item); // Create a widget from it - LLFolderViewItem* widget = createConversationItemWidget(&item); - // Add it to the list of widgets + LLFolderViewItem* widget = createConversationItemWidget(item); mConversationsWidgets.push_back(widget); // Add it to the UI widget->setVisible(TRUE); mConversationsListPanel->addChild(widget); - // Reposition it... + LLRect panel_rect = mConversationsListPanel->getRect(); + S32 item_height = 16; + S32 index = mConversationsWidgets.size() - 1; + widget->setRect(LLRect(0, + panel_rect.getHeight() - item_height*index, + panel_rect.getWidth(), + panel_rect.getHeight() - item_height*(index+1))); // CHUI-137 : end LLView* floater_contents = floaterp->getChild("contents_view"); diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 5cfdb41ad3..d04ac873fa 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -46,7 +46,7 @@ class LLTabContainer; // CHUI-137 : Temporary implementation of conversations list class LLConversationItem; -typedef std::list conversations_items_list_t; +typedef std::list conversations_items_list_t; typedef std::list conversations_widgets_list_t; // Conversation items: we hold a list of those and create an LLFolderViewItem widget for each that we tuck @@ -110,7 +110,7 @@ public: std::string& tooltip_msg) { return FALSE; } private: std::string mName; - LLUUID mUUID; + const LLUUID mUUID; }; // CHUI-137 : End -- cgit v1.2.3 From e286330365576e67fa9b59166f6019e89f09f3cf Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 8 Jun 2012 17:58:15 -0700 Subject: CHUI-137 : Fix build error after merge --- indra/newview/llimfloatercontainer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index d04ac873fa..84b1c864cc 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -78,7 +78,7 @@ public: virtual void move( LLFolderViewEventListener* parent_listener ) { } virtual BOOL isItemCopyable() const { return FALSE; } virtual BOOL copyToClipboard() const { return FALSE; } - virtual void cutToClipboard() { } + virtual BOOL cutToClipboard() const { return FALSE; } virtual BOOL isClipboardPasteable() const { return FALSE; } virtual void pasteFromClipboard() { } virtual void pasteLinkFromClipboard() { } -- cgit v1.2.3 From db67c21f901800d27c9dd2ea2ce6134dc3bd33f1 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 11 Jun 2012 17:25:17 -0700 Subject: CHUI-137 : Implemented switch conversation in the conversation list --- indra/newview/llfolderviewitem.cpp | 4 ++++ indra/newview/llimfloatercontainer.cpp | 20 +++++++++++++------- indra/newview/llimfloatercontainer.h | 5 ++++- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index d7d5195c14..8ae779326c 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -387,6 +387,10 @@ void LLFolderViewItem::setSelectionFromRoot(LLFolderViewItem* selection, { getRoot()->setSelection(selection, openitem, take_keyboard_focus); } + else if (mListener) + { + mListener->selectItem(); + } } // helper function to change the selection from the root. diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index cd19105860..9c6cee6cb5 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -85,6 +85,7 @@ BOOL LLIMFloaterContainer::postBuild() void LLIMFloaterContainer::onOpen(const LLSD& key) { + llinfos << "Merov debug : onOpen, key = " << key.asUUID() << llendl; LLMultiFloater::onOpen(key); /* if (key.isDefined()) @@ -114,9 +115,11 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp, LLMultiFloater::addFloater(floaterp, select_added_floater, insertion_point); + LLUUID session_id = floaterp->getKey(); + // CHUI-137 // Create a conversation item - LLConversationItem* item = new LLConversationItem(floaterp->getTitle()); + LLConversationItem* item = new LLConversationItem(floaterp->getTitle(),session_id, floaterp, this); mConversationsItems.push_back(item); // Create a widget from it LLFolderViewItem* widget = createConversationItemWidget(item); @@ -139,8 +142,6 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp, // so reshape floater contents to occupy the header space floater_contents->setShape(floaterp->getRect()); - LLUUID session_id = floaterp->getKey(); - LLIconCtrl* icon = 0; if(gAgent.isInGroup(session_id, TRUE)) @@ -164,6 +165,8 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp, floaterp->mCloseSignal.connect(boost::bind(&LLIMFloaterContainer::onCloseFloater, this, session_id)); } mTabContainer->setTabImage(floaterp, icon); + + llinfos << "Merov debug : addFloater, title = " << floaterp->getTitle() << ", uuid = " << session_id << llendl; } // virtual @@ -171,7 +174,7 @@ void LLIMFloaterContainer::removeFloater(LLFloater* floaterp) { LLMultiFloater::removeFloater(floaterp); - llinfos << "Merov debug : removeFloater, title = " << floaterp->getTitle() << llendl; + llinfos << "Merov debug : removeFloater, title = " << floaterp->getTitle() << ", uuid = " << floaterp->getKey() << llendl; LLRect contents_rect = floaterp->getRect(); @@ -355,9 +358,11 @@ LLFolderViewItem* LLIMFloaterContainer::createConversationItemWidget(LLConversat } // Conversation items -LLConversationItem::LLConversationItem(std::string name) : +LLConversationItem::LLConversationItem(std::string name, const LLUUID& uuid, LLFloater* floaterp, LLIMFloaterContainer* containerp) : mName(name), - mUUID(LLUUID::null) + mUUID(uuid), + mFloater(floaterp), + mContainer(containerp) { if (name == "") mName = "Nearby Chat"; @@ -386,7 +391,8 @@ void LLConversationItem::previewItem( void ) void LLConversationItem::selectItem(void) { - llinfos << "Merov debug : selectItem, title = " << mName << llendl; + llinfos << "Merov debug : selectItem, title = " << mName << ", uuid = " << mUUID << llendl; + mContainer->selectFloater(mFloater); } void LLConversationItem::showProperties(void) diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 84b1c864cc..afb65671ae 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -45,6 +45,7 @@ class LLTabContainer; // CHUI-137 : Temporary implementation of conversations list class LLConversationItem; +class LLIMFloaterContainer; typedef std::list conversations_items_list_t; typedef std::list conversations_widgets_list_t; @@ -54,7 +55,7 @@ typedef std::list conversations_widgets_list_t; class LLConversationItem : public LLFolderViewEventListener { public: - LLConversationItem(std::string name); + LLConversationItem(std::string name, const LLUUID& uuid, LLFloater* floaterp, LLIMFloaterContainer* containerp); virtual ~LLConversationItem() {} // Stub those things we won't really be using in this conversation context @@ -111,6 +112,8 @@ public: private: std::string mName; const LLUUID mUUID; + LLFloater* mFloater; + LLIMFloaterContainer* mContainer; }; // CHUI-137 : End -- cgit v1.2.3 From 0e2f5c2ebad0a19e9c5e151a4ac3ae7321f2f296 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 11 Jun 2012 22:12:43 -0700 Subject: CHUI-137 : Implemented tear off and close of conversation in the list --- indra/newview/llimfloatercontainer.cpp | 56 ++++++++++++++++++++++------------ indra/newview/llimfloatercontainer.h | 8 ++--- 2 files changed, 41 insertions(+), 23 deletions(-) diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 9c6cee6cb5..9084c07cc7 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -85,7 +85,6 @@ BOOL LLIMFloaterContainer::postBuild() void LLIMFloaterContainer::onOpen(const LLSD& key) { - llinfos << "Merov debug : onOpen, key = " << key.asUUID() << llendl; LLMultiFloater::onOpen(key); /* if (key.isDefined()) @@ -120,10 +119,10 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp, // CHUI-137 // Create a conversation item LLConversationItem* item = new LLConversationItem(floaterp->getTitle(),session_id, floaterp, this); - mConversationsItems.push_back(item); + mConversationsItems[session_id] = item; // Create a widget from it LLFolderViewItem* widget = createConversationItemWidget(item); - mConversationsWidgets.push_back(widget); + mConversationsWidgets[session_id] = widget; // Add it to the UI widget->setVisible(TRUE); mConversationsListPanel->addChild(widget); @@ -165,8 +164,6 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp, floaterp->mCloseSignal.connect(boost::bind(&LLIMFloaterContainer::onCloseFloater, this, session_id)); } mTabContainer->setTabImage(floaterp, icon); - - llinfos << "Merov debug : addFloater, title = " << floaterp->getTitle() << ", uuid = " << session_id << llendl; } // virtual @@ -174,8 +171,34 @@ void LLIMFloaterContainer::removeFloater(LLFloater* floaterp) { LLMultiFloater::removeFloater(floaterp); - llinfos << "Merov debug : removeFloater, title = " << floaterp->getTitle() << ", uuid = " << floaterp->getKey() << llendl; - + // CHUI-137 : Clean up the conversations list + LLUUID session_id = floaterp->getKey(); + // Delete the widget and the associated conversation item + // Note : since the mConversationsItems is a listener to the widget, deleting the widget also + // delete its listener + conversations_widgets_map::iterator widget_it = mConversationsWidgets.find(session_id); + if (widget_it != mConversationsWidgets.end()) + { + LLFolderViewItem* widget = widget_it->second; + delete widget; + } + // Suppress the conversation items and widgets from their respective maps + mConversationsItems.erase(session_id); + mConversationsWidgets.erase(session_id); + // Reposition the leftover conversation items + LLRect panel_rect = mConversationsListPanel->getRect(); + S32 item_height = 16; + int index = 0; + for (widget_it = mConversationsWidgets.begin(); widget_it != mConversationsWidgets.end(); ++widget_it, ++index) + { + LLFolderViewItem* widget = widget_it->second; + widget->setRect(LLRect(0, + panel_rect.getHeight() - item_height*index, + panel_rect.getWidth(), + panel_rect.getHeight() - item_height*(index+1))); + } + // CHUI-137 + LLRect contents_rect = floaterp->getRect(); // reduce the floater contents height by header height @@ -364,41 +387,36 @@ LLConversationItem::LLConversationItem(std::string name, const LLUUID& uuid, LLF mFloater(floaterp), mContainer(containerp) { + // Hack: the nearby chat has no name so we catch that and impose one if (name == "") mName = "Nearby Chat"; } // Virtual action callbacks +void LLConversationItem::selectItem(void) +{ + // Select the conversation floater that is being selected + mContainer->selectFloater(mFloater); +} + void LLConversationItem::performAction(LLInventoryModel* model, std::string action) { - llinfos << "Merov debug : performAction, title = " << mName << ", action = " << action << llendl; } void LLConversationItem::openItem( void ) { - llinfos << "Merov debug : openItem, title = " << mName << llendl; } void LLConversationItem::closeItem( void ) { - llinfos << "Merov debug : closeItem, title = " << mName << llendl; } void LLConversationItem::previewItem( void ) { - llinfos << "Merov debug : previewItem, title = " << mName << llendl; -} - -void LLConversationItem::selectItem(void) -{ - llinfos << "Merov debug : selectItem, title = " << mName << ", uuid = " << mUUID << llendl; - mContainer->selectFloater(mFloater); } void LLConversationItem::showProperties(void) { - llinfos << "Merov debug : showProperties, title = " << mName << llendl; } - // EOF diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index afb65671ae..3df5a07df8 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -47,8 +47,8 @@ class LLTabContainer; class LLConversationItem; class LLIMFloaterContainer; -typedef std::list conversations_items_list_t; -typedef std::list conversations_widgets_list_t; +typedef std::map conversations_items_map; +typedef std::map conversations_widgets_map; // Conversation items: we hold a list of those and create an LLFolderViewItem widget for each that we tuck // into the mConversationsListPanel. @@ -166,8 +166,8 @@ private: // CHUI-137 : Data LLPanel* mConversationsListPanel; // The widget we add list item to (title of each conversation) - conversations_items_list_t mConversationsItems; - conversations_widgets_list_t mConversationsWidgets; + conversations_items_map mConversationsItems; + conversations_widgets_map mConversationsWidgets; }; #endif // LL_LLIMFLOATERCONTAINER_H -- cgit v1.2.3 From b01ab3b9b2d55a8536894a049354b87bb1d71cdb Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 13 Jun 2012 13:52:26 -0700 Subject: EXP-137 : Comments cleanup --- indra/newview/llimfloatercontainer.cpp | 19 ++++++++++--------- indra/newview/llimfloatercontainer.h | 23 ++++++++++++----------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 9084c07cc7..77bb103bda 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -116,7 +116,7 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp, LLUUID session_id = floaterp->getKey(); - // CHUI-137 + // CHUI-137 : Temporary implementation of conversations list // Create a conversation item LLConversationItem* item = new LLConversationItem(floaterp->getTitle(),session_id, floaterp, this); mConversationsItems[session_id] = item; @@ -171,11 +171,12 @@ void LLIMFloaterContainer::removeFloater(LLFloater* floaterp) { LLMultiFloater::removeFloater(floaterp); - // CHUI-137 : Clean up the conversations list + // CHUI-137 : Temporary implementation of conversations list + // Clean up the conversations list LLUUID session_id = floaterp->getKey(); // Delete the widget and the associated conversation item - // Note : since the mConversationsItems is a listener to the widget, deleting the widget also - // delete its listener + // Note : since the mConversationsItems is also the listener to the widget, deleting + // the widget will also delete its listener conversations_widgets_map::iterator widget_it = mConversationsWidgets.find(session_id); if (widget_it != mConversationsWidgets.end()) { @@ -197,7 +198,7 @@ void LLIMFloaterContainer::removeFloater(LLFloater* floaterp) panel_rect.getWidth(), panel_rect.getHeight() - item_height*(index+1))); } - // CHUI-137 + // CHUI-137 : end LLRect contents_rect = floaterp->getRect(); @@ -362,7 +363,7 @@ void LLIMFloaterContainer::updateState(bool collapse, S32 delta_width) setCanMinimize(is_left_pane_expanded || is_right_pane_expanded); } -// CHUI-137 : Temp implementation of conversations list +// CHUI-137 : Temporary implementation of conversations list LLFolderViewItem* LLIMFloaterContainer::createConversationItemWidget(LLConversationItem* item) { LLFolderViewItem::Params params; @@ -370,7 +371,6 @@ LLFolderViewItem* LLIMFloaterContainer::createConversationItemWidget(LLConversat params.name = item->getDisplayName(); //params.icon = bridge->getIcon(); //params.icon_open = bridge->getOpenIcon(); - //params.creation_date = bridge->getCreationDate(); //params.root = mFolderRoot; params.listener = item; @@ -387,7 +387,8 @@ LLConversationItem::LLConversationItem(std::string name, const LLUUID& uuid, LLF mFloater(floaterp), mContainer(containerp) { - // Hack: the nearby chat has no name so we catch that and impose one + // Hack: the nearby chat has no name so we catch that case and impose one + // Of course, we won't be doing this in the final code if (name == "") mName = "Nearby Chat"; } @@ -395,7 +396,7 @@ LLConversationItem::LLConversationItem(std::string name, const LLUUID& uuid, LLF // Virtual action callbacks void LLConversationItem::selectItem(void) { - // Select the conversation floater that is being selected + // Switch to the conversation floater that is being selected mContainer->selectFloater(mFloater); } diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 3df5a07df8..23927239a5 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -42,16 +42,16 @@ class LLButton; class LLLayoutPanel; class LLLayoutStack; class LLTabContainer; +class LLIMFloaterContainer; // CHUI-137 : Temporary implementation of conversations list class LLConversationItem; -class LLIMFloaterContainer; typedef std::map conversations_items_map; typedef std::map conversations_widgets_map; -// Conversation items: we hold a list of those and create an LLFolderViewItem widget for each that we tuck -// into the mConversationsListPanel. +// Conversation items: we hold a list of those and create an LLFolderViewItem widget for each +// that we tuck into the mConversationsListPanel. class LLConversationItem : public LLFolderViewEventListener { public: @@ -89,7 +89,7 @@ public: virtual LLInventoryType::EType getInventoryType() const { return LLInventoryType::IT_NONE; } virtual LLWearableType::EType getWearableType() const { return LLWearableType::WT_NONE; } - // The action callbacks (or so we think...) + // The action callbacks virtual void performAction(LLInventoryModel* model, std::string action); virtual void openItem( void ); virtual void closeItem( void ); @@ -97,14 +97,14 @@ public: virtual void selectItem(void); virtual void showProperties(void); - // This method should be called when a drag begins. returns TRUE - // if the drag can begin, otherwise FALSE. + // This method should be called when a drag begins. + // Returns TRUE if the drag can begin, FALSE otherwise. virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const { return FALSE; } // This method will be called to determine if a drop can be // performed, and will set drop to TRUE if a drop is - // requested. Returns TRUE if a drop is possible/happened, - // otherwise FALSE. + // requested. + // Returns TRUE if a drop is possible/happened, FALSE otherwise. virtual BOOL dragOrDrop(MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, @@ -115,7 +115,7 @@ private: LLFloater* mFloater; LLIMFloaterContainer* mContainer; }; - // CHUI-137 : End +// CHUI-137 : End class LLIMFloaterContainer : public LLMultiFloater { @@ -164,8 +164,9 @@ private: LLLayoutPanel* mConversationsPane; LLLayoutStack* mConversationsStack; - // CHUI-137 : Data - LLPanel* mConversationsListPanel; // The widget we add list item to (title of each conversation) + // CHUI-137 : Temporary implementation of conversations list + // Conversation list data + LLPanel* mConversationsListPanel; // This is the widget we add items to (i.e. clickable title for each conversation) conversations_items_map mConversationsItems; conversations_widgets_map mConversationsWidgets; }; -- cgit v1.2.3 From d34746b596bad717f7d0c10e263700738a06aa43 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Thu, 14 Jun 2012 17:37:16 +0300 Subject: CHUI-144 FIXED Residents picker added to Conversations panel + button. --- indra/newview/llimfloatercontainer.cpp | 26 ++++++++++++++++++++++++++ indra/newview/llimfloatercontainer.h | 3 +++ 2 files changed, 29 insertions(+) diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 3b6240de44..71b69dfbc8 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -34,8 +34,10 @@ #include "llnearbychat.h" #include "llagent.h" +#include "llavataractions.h" #include "llavatariconctrl.h" #include "llgroupiconctrl.h" +#include "llfloateravatarpicker.h" #include "llimview.h" #include "lltransientfloatermgr.h" #include "llviewercontrol.h" @@ -75,6 +77,8 @@ BOOL LLIMFloaterContainer::postBuild() mExpandCollapseBtn = getChild("expand_collapse_btn"); mExpandCollapseBtn->setClickedCallback(boost::bind(&LLIMFloaterContainer::onExpandCollapseButtonClicked, this)); + childSetAction("add_btn", boost::bind(&LLIMFloaterContainer::onAddButtonClicked, this)); + collapseMessagesPane(gSavedPerAccountSettings.getBOOL("ConversationsMessagePaneCollapsed")); collapseConversationsPane(gSavedPerAccountSettings.getBOOL("ConversationsListPaneCollapsed")); @@ -313,4 +317,26 @@ void LLIMFloaterContainer::updateState(bool collapse, S32 delta_width) setCanMinimize(is_left_pane_expanded || is_right_pane_expanded); } +void LLIMFloaterContainer::onAddButtonClicked() +{ + LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLIMFloaterContainer::onAvatarPicked, this, _1), TRUE, TRUE); + LLFloater* root_floater = gFloaterView->getParentFloater(this); + if (picker && root_floater) + { + root_floater->addDependentFloater(picker); + } +} + +void LLIMFloaterContainer::onAvatarPicked(const uuid_vec_t& ids) +{ + if (ids.size() == 1) + { + LLAvatarActions::startIM(ids.back()); + } + else + { + LLAvatarActions::startConference(ids); + } +} + // EOF diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 92938ff405..7b395fb18f 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -80,6 +80,9 @@ private: void updateState(bool collapse, S32 delta_width); + void onAddButtonClicked(); + void onAvatarPicked(const uuid_vec_t& ids); + LLButton* mExpandCollapseBtn; LLLayoutPanel* mMessagesPane; LLLayoutPanel* mConversationsPane; -- cgit v1.2.3 From c238027dd9917b1633ff5f16911fbdbe437f9a55 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 14 Jun 2012 16:47:43 -0700 Subject: CHUI-139 : Use the Chat toolbar button to open and close the conversations multi floater. Force Nearby Conversation if floater is empty. --- indra/newview/app_settings/commands.xml | 6 +++--- indra/newview/llimfloatercontainer.cpp | 13 +++++++++++-- indra/newview/skins/default/xui/en/strings.xml | 2 ++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 73df064ab2..51211a8ce5 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -46,11 +46,11 @@ available_in_toybox="true" icon="Command_Chat_Icon" label_ref="Command_Chat_Label" - tooltip_ref="Command_Chat_Tooltip" + tooltip_ref="Command_Conversations_Tooltip" execute_function="Floater.ToggleOrBringToFront" - execute_parameters="chat_bar" + execute_parameters="im_container" is_running_function="Floater.IsOpen" - is_running_parameters="chat_bar" + is_running_parameters="im_container" /> openFloater(); } } -*/ + */ } // virtual diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 0a2fc13aff..7790a382d9 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3692,6 +3692,7 @@ Try enclosing path to the editor with double quotes. Avatar Build Chat + Conversations Compass Destinations Gestures @@ -3718,6 +3719,7 @@ Try enclosing path to the editor with double quotes. Choose a complete avatar Building objects and reshaping terrain Chat with people nearby using text + Converse with everyone Compass Destinations of interest Gestures for your avatar -- cgit v1.2.3