summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llimconversation.cpp32
-rw-r--r--indra/newview/llimconversation.h3
-rw-r--r--indra/newview/llimfloater.cpp8
-rw-r--r--indra/newview/llimfloatercontainer.cpp48
-rw-r--r--indra/newview/llimfloatercontainer.h1
-rw-r--r--indra/newview/llinventorymodel.cpp23
-rw-r--r--indra/newview/llinventorypanel.cpp38
-rw-r--r--indra/newview/llinventorypanel.h1
-rw-r--r--indra/newview/llnearbychat.cpp8
-rw-r--r--indra/newview/llplacesinventorypanel.cpp37
-rw-r--r--indra/newview/skins/default/xui/en/floater_im_session.xml2
11 files changed, 90 insertions, 111 deletions
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp
index ec7e0ee6cb..ec534b903d 100644
--- a/indra/newview/llimconversation.cpp
+++ b/indra/newview/llimconversation.cpp
@@ -43,7 +43,6 @@ const F32 REFRESH_INTERVAL = 0.2f;
LLIMConversation::LLIMConversation(const LLUUID& session_id)
: LLTransientDockableFloater(NULL, true, session_id)
, mIsP2PChat(false)
- , mWasHosted(false)
, mExpandCollapseBtn(NULL)
, mTearOffBtn(NULL)
, mCloseBtn(NULL)
@@ -224,26 +223,17 @@ void LLIMConversation::hideOrShowTitle()
{
bool is_hosted = getHost() != NULL;
- if (mWasHosted != is_hosted)
- {
- mWasHosted = is_hosted;
- LLView* floater_contents = getChild<LLView>("contents_view");
- LLRect contents_rect = floater_contents->getRect();
-
- if (is_hosted)
- {
- // we don't show the header when the floater is hosted, so reshape floater contents
- // to occupy the header space.
- contents_rect.mTop += getHeaderHeight();
- }
- else
- {
- // reduce the floater contents height by header height
- contents_rect.mTop -= getHeaderHeight();
- }
-
- floater_contents->setShape(contents_rect);
- }
+ const LLFloater::Params& default_params = LLFloater::getDefaultParams();
+ S32 floater_header_size = default_params.header_height;
+ LLView* floater_contents = getChild<LLView>("contents_view");
+
+ LLRect floater_rect = getLocalRect();
+ S32 top_border_of_contents = floater_rect.mTop - (is_hosted? 0 : floater_header_size);
+ LLRect handle_rect (0, floater_rect.mTop, floater_rect.mRight, top_border_of_contents);
+ LLRect contents_rect (0, top_border_of_contents, floater_rect.mRight, floater_rect.mBottom);
+ mDragHandle->setShape(handle_rect);
+ mDragHandle->setVisible(! is_hosted);
+ floater_contents->setShape(contents_rect);
}
void LLIMConversation::hideAllStandardButtons()
diff --git a/indra/newview/llimconversation.h b/indra/newview/llimconversation.h
index e6b4f534cc..c3dff96d5d 100644
--- a/indra/newview/llimconversation.h
+++ b/indra/newview/llimconversation.h
@@ -89,12 +89,11 @@ protected:
void buildParticipantList();
void onSortMenuItemClicked(const LLSD& userdata);
- void hideOrShowTitle();
+ void hideOrShowTitle(); // toggle the floater's drag handle
void hideAllStandardButtons();
bool mIsNearbyChat;
bool mIsP2PChat;
- bool mWasHosted;
LLLayoutPanel* mParticipantListPanel;
LLParticipantList* mParticipantList;
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index 23c97c5345..22ce3cd42b 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -346,6 +346,10 @@ BOOL LLIMFloater::postBuild()
initIMFloater();
+ // Add a conversation list item in the left pane
+ LLIMFloaterContainer* im_box = LLIMFloaterContainer::getInstance();
+ im_box->addConversationListItem(getTitle(), getKey(), this);
+
return TRUE;
}
@@ -641,10 +645,6 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id)
}
}
- // Add a conversation list item in the left pane: nothing will be done if already in there
- // but relevant clean up will be done to ensure consistency of the conversation list
- floater_container->addConversationListItem(floater->getTitle(), session_id, floater);
-
floater->openFloater(floater->getKey());
}
else
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index 4f626cb5d2..005794444b 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -150,9 +150,6 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
LLMultiFloater::addFloater(floaterp, select_added_floater, insertion_point);
LLUUID session_id = floaterp->getKey();
-
- // Add a conversation list item in the left pane
- addConversationListItem(floaterp->getTitle(), session_id, floaterp);
LLIconCtrl* icon = 0;
@@ -280,6 +277,8 @@ void LLIMFloaterContainer::draw()
collapseMessagesPane(true);
}
LLFloater::draw();
+
+ repositioningWidgets();
}
void LLIMFloaterContainer::tabClose()
@@ -306,7 +305,7 @@ void LLIMFloaterContainer::setVisible(BOOL visible)
LLFloaterReg::toggleInstanceOrBringToFront(name);
}
}
-
+
// We need to show/hide all the associated conversations that have been torn off
// (and therefore, are not longer managed by the multifloater),
// so that they show/hide with the conversations manager.
@@ -409,6 +408,23 @@ void LLIMFloaterContainer::onAvatarPicked(const uuid_vec_t& ids)
}
}
+void LLIMFloaterContainer::repositioningWidgets()
+{
+ LLRect panel_rect = mConversationsListPanel->getRect();
+ S32 item_height = 16;
+ int index = 0;
+ for (conversations_widgets_map::iterator 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 : Temporary implementation of conversations list
void LLIMFloaterContainer::addConversationListItem(std::string name, const LLUUID& uuid, LLFloater* floaterp)
{
@@ -443,14 +459,11 @@ void LLIMFloaterContainer::addConversationListItem(std::string name, const LLUUI
// Add it to the UI
widget->setVisible(TRUE);
+
+ repositioningWidgets();
+
mConversationsListPanel->addChild(widget);
- 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)));
+
return;
}
@@ -470,18 +483,7 @@ void LLIMFloaterContainer::removeConversationListItem(LLFloater* floaterp, bool
mConversationsItems.erase(floaterp);
mConversationsWidgets.erase(floaterp);
- // 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)));
- }
+ repositioningWidgets();
// Don't let the focus fall IW, select and refocus on the first conversation in the list
if (change_focus)
diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h
index b624b7558a..a25ea0ab46 100644
--- a/indra/newview/llimfloatercontainer.h
+++ b/indra/newview/llimfloatercontainer.h
@@ -254,6 +254,7 @@ private:
void collapseConversationsPane(bool collapse);
void updateState(bool collapse, S32 delta_width);
+ void repositioningWidgets();
void onAddButtonClicked();
void onAvatarPicked(const uuid_vec_t& ids);
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 9b0d12b353..fe65b87afd 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -1240,14 +1240,33 @@ void LLInventoryModel::purgeDescendentsOf(const LLUUID& id)
items,
INCLUDE_TRASH);
S32 count = items.count();
+
+ item_map_t::iterator item_map_end = mItemMap.end();
+ cat_map_t::iterator cat_map_end = mCategoryMap.end();
+ LLUUID uu_id;
+
for(S32 i = 0; i < count; ++i)
{
- deleteObject(items.get(i)->getUUID());
+ uu_id = items.get(i)->getUUID();
+
+ // This check prevents the deletion of a previously deleted item.
+ // This is necessary because deletion is not done in a hierarchical
+ // order. The current item may have been already deleted as a child
+ // of its deleted parent.
+ if (mItemMap.find(uu_id) != item_map_end)
+ {
+ deleteObject(uu_id);
+ }
}
+
count = categories.count();
for(S32 i = 0; i < count; ++i)
{
- deleteObject(categories.get(i)->getUUID());
+ uu_id = categories.get(i)->getUUID();
+ if (mCategoryMap.find(uu_id) != cat_map_end)
+ {
+ deleteObject(uu_id);
+ }
}
}
}
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index ed370e9add..6a7ee3b6a0 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -193,6 +193,15 @@ void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params)
void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
{
+ // Clear up the root view
+ // Note: This needs to be done *before* we build the new folder view
+ LLFolderViewItem* root_view = getItemByID(gInventory.getRootFolderID());
+ if (root_view)
+ {
+ removeItemID(static_cast<LLFolderViewModelItemInventory*>(root_view->getViewModelItem())->getUUID());
+ root_view->destroyView();
+ }
+
LLMemType mt(LLMemType::MTYPE_INVENTORY_POST_BUILD);
mCommitCallbackRegistrar.pushScope(); // registered as a widget; need to push callback scope ourselves
@@ -228,6 +237,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
{
initializeViews();
}
+
gIdleCallbacks.addFunction(onIdle, (void*)this);
if (mSortOrderSetting != INHERIT_SORT_ORDER)
@@ -411,7 +421,14 @@ void LLInventoryPanel::modelChanged(U32 mask)
// LLFolderViewFolder is derived from LLFolderViewItem so dynamic_cast from item
// to folder is the fast way to get a folder without searching through folders tree.
- LLFolderViewFolder* view_folder = dynamic_cast<LLFolderViewFolder*>(view_item);
+ LLFolderViewFolder* view_folder = NULL;
+
+ // Check requires as this item might have already been deleted
+ // as a child of its deleted parent.
+ if (model_item && view_item)
+ {
+ view_folder = dynamic_cast<LLFolderViewFolder*>(view_item);
+ }
//////////////////////////////
// LABEL Operation
@@ -438,7 +455,7 @@ void LLInventoryPanel::modelChanged(U32 mask)
if (mask & LLInventoryObserver::REBUILD)
{
handled = true;
- if (model_item && view_item)
+ if (model_item && view_item && viewmodel_item)
{
view_item->destroyView();
removeItemID(viewmodel_item->getUUID());
@@ -528,7 +545,7 @@ void LLInventoryPanel::modelChanged(U32 mask)
//////////////////////////////
// REMOVE Operation
// This item has been removed from memory, but its associated UI element still exists.
- else if (!model_item && view_item)
+ else if (!model_item && view_item && viewmodel_item)
{
// Remove the item's UI.
removeItemID(viewmodel_item->getUUID());
@@ -595,7 +612,7 @@ void LLInventoryPanel::initializeViews()
{
if (!gInventory.isInventoryUsable()) return;
- rebuildViewsFor(gInventory.getRootFolderID());
+ buildNewViews(gInventory.getRootFolderID());
gIdleCallbacks.addFunction(idle, this);
@@ -622,19 +639,6 @@ void LLInventoryPanel::initializeViews()
}
}
-LLFolderViewItem* LLInventoryPanel::rebuildViewsFor(const LLUUID& id)
-{
- // Destroy the old view for this ID so we can rebuild it.
- LLFolderViewItem* old_view = getItemByID(id);
- if (old_view)
- {
- old_view->destroyView();
- removeItemID(static_cast<LLFolderViewModelItemInventory*>(old_view->getViewModelItem())->getUUID());
- }
-
- return buildNewViews(id);
-}
-
LLFolderView * LLInventoryPanel::createFolderView(LLInvFVBridge * bridge, bool useLabelSuffix)
{
LLRect folder_rect(0,
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index 465ccdd582..4fcc93b0c4 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -237,7 +237,6 @@ public:
protected:
// Builds the UI. Call this once the inventory is usable.
void initializeViews();
- LLFolderViewItem* rebuildViewsFor(const LLUUID& id); // Given the id and the parent, build all of the folder views.
virtual void buildFolderView(const LLInventoryPanel::Params& params);
LLFolderViewItem* buildNewViews(const LLUUID& id);
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index 1c81cdc4bc..a21690bed8 100644
--- a/indra/newview/llnearbychat.cpp
+++ b/indra/newview/llnearbychat.cpp
@@ -158,7 +158,7 @@ BOOL LLNearbyChat::postBuild()
enableResizeCtrls(true, true, false);
- // title must be defined BEFORE call addToHost() because
+ // title must be defined BEFORE call addConversationListItem() because
// it is used for show the item's name in the conversations list
setTitle(getString("NearbyChatTitle"));
@@ -186,6 +186,9 @@ BOOL LLNearbyChat::postBuild()
loadHistory();
}
+ // added row in the conversations list when nearby chat is tear-off
+ LLIMFloaterContainer* im_box = LLIMFloaterContainer::getInstance();
+ im_box->addConversationListItem(getTitle(), LLSD(), this);
return LLIMConversation::postBuild();
}
@@ -363,9 +366,6 @@ void LLNearbyChat::addToHost()
LLIMFloaterContainer* im_box = LLIMFloaterContainer::getInstance();
if (im_box)
{
- // Make sure the Nearby Chat is present in the conversations list
- im_box->addConversationListItem(getTitle(), getKey(), this);
-
if (gSavedSettings.getBOOL("NearbyChatIsNotTornOff"))
{
im_box->addFloater(this, TRUE, LLTabContainer::END);
diff --git a/indra/newview/llplacesinventorypanel.cpp b/indra/newview/llplacesinventorypanel.cpp
index 65d9691902..c46681f556 100644
--- a/indra/newview/llplacesinventorypanel.cpp
+++ b/indra/newview/llplacesinventorypanel.cpp
@@ -60,44 +60,9 @@ LLPlacesInventoryPanel::~LLPlacesInventoryPanel()
void LLPlacesInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params)
{
- // Determine the root folder in case specified, and
- // build the views starting with that folder.
- const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(params.start_folder);
-
- LLUUID root_id;
-
- if ("LIBRARY" == params.start_folder())
- {
- root_id = gInventory.getLibraryRootFolderID();
- }
- else
- {
- root_id = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type) : LLUUID::null);
- }
-
- LLRect folder_rect(0,
- 0,
- getRect().getWidth(),
- 0);
- LLPlacesFolderView::Params p;
- p.name = getName();
- p.title = getLabel();
- p.rect = folder_rect;
- p.listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY,
- LLAssetType::AT_CATEGORY,
- LLInventoryType::IT_CATEGORY,
- this,
- &mInventoryViewModel,
- NULL,
- root_id);
- p.parent_panel = this;
- p.allow_multiselect = mAllowMultiSelect;
- p.use_ellipses = true; // truncate inventory item text so remove horizontal scroller
- p.view_model = &mInventoryViewModel;
- mFolderRoot = LLUICtrlFactory::create<LLPlacesFolderView>(p);
+ LLInventoryPanel::buildFolderView(params);
}
-
// save current folder open state
void LLPlacesInventoryPanel::saveFolderState()
{
diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml
index 95f6708e96..560e1be213 100644
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -9,7 +9,7 @@
can_dock="false"
can_minimize="true"
can_close="true"
- save_rect="true"
+ save_rect="false"
visible="false"
width="394"
can_resize="true"