summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2009-12-15 16:12:24 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2009-12-15 16:12:24 -0500
commit109de76574c7fe1944a1330972d796de7894882c (patch)
tree8129f36f44628700cdcf92bfe01417c7a0b12496
parent0905d857614153e682032ab4630468708812707a (diff)
parentfbf5d1a99221d54c242b67ffcf13d5510b5ce0a7 (diff)
merge
--HG-- branch : avatar-pipeline
-rw-r--r--indra/newview/llfolderview.cpp20
-rw-r--r--indra/newview/llfolderview.h1
-rw-r--r--indra/newview/llinventorybridge.cpp9
-rw-r--r--indra/newview/llinventoryobserver.h1
-rw-r--r--indra/newview/llinventorypanel.cpp14
-rw-r--r--indra/newview/llviewermenu.cpp6
6 files changed, 44 insertions, 7 deletions
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 321982ceb6..adf7f08702 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -1939,6 +1939,26 @@ LLFolderViewItem* LLFolderView::getItemByID(const LLUUID& id)
return NULL;
}
+LLFolderViewFolder* LLFolderView::getFolderByID(const LLUUID& id)
+{
+ if (id.isNull())
+ {
+ return this;
+ }
+
+ for (folders_t::iterator iter = mFolders.begin();
+ iter != mFolders.end();
+ ++iter)
+ {
+ LLFolderViewFolder *folder = (*iter);
+ if (folder->getListener()->getUUID() == id)
+ {
+ return folder;
+ }
+ }
+ return NULL;
+}
+
bool LLFolderView::doToSelected(LLInventoryModel* model, const LLSD& userdata)
{
std::string action = userdata.asString();
diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h
index d18ba385d8..2598af4df4 100644
--- a/indra/newview/llfolderview.h
+++ b/indra/newview/llfolderview.h
@@ -248,6 +248,7 @@ public:
void addItemID(const LLUUID& id, LLFolderViewItem* itemp);
void removeItemID(const LLUUID& id);
LLFolderViewItem* getItemByID(const LLUUID& id);
+ LLFolderViewFolder* getFolderByID(const LLUUID& id);
bool doToSelected(LLInventoryModel* model, const LLSD& userdata);
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index ab06ac1691..1b374a15a0 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -2930,6 +2930,10 @@ void updateItemsOrder(LLInventoryModel::item_array_t& items, const LLUUID& srcIt
items.erase(findItemByUUID(items, srcItem->getUUID()));
items.insert(findItemByUUID(items, destItem->getUUID()), srcItem);
+
+ // Refresh the folder view.
+ gInventory.addChangedMask(LLInventoryObserver::SORT, srcItem->getParentUUID());
+ gInventory.notifyObservers();
}
BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
@@ -2998,8 +3002,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
}
const LLUUID& favorites_id = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
- const LLUUID& landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK);
- const BOOL folder_allows_reorder = ((mUUID == landmarks_id) || (mUUID == favorites_id));
+ const BOOL folder_allows_reorder = (mUUID == favorites_id);
// we can move item inside a folder only if this folder is Favorites. See EXT-719
accept = is_movable && ((mUUID != inv_item->getParentUUID()) || folder_allows_reorder);
@@ -3014,7 +3017,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
// everything in the active window so that we don't follow
// the selection to its new location (which is very
// annoying).
- LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel();
+ LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
if (active_panel)
{
LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h
index 99e6dbe3c8..c1f192e2bf 100644
--- a/indra/newview/llinventoryobserver.h
+++ b/indra/newview/llinventoryobserver.h
@@ -62,6 +62,7 @@ public:
STRUCTURE = 16, // structural change (eg item or folder moved)
CALLING_CARD = 32, // (eg online, grant status, cancel)
REBUILD = 64, // item UI changed (eg item type different)
+ SORT = 128, // folder needs to be resorted.
ALL = 0xffffffff
};
LLInventoryObserver();
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 92b9dc427f..ef7069195e 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -278,6 +278,7 @@ void LLInventoryPanel::modelChanged(U32 mask)
const LLUUID& item_id = (*items_iter);
const LLInventoryObject* model_item = model->getObject(item_id);
LLFolderViewItem* view_item = mFolders->getItemByID(item_id);
+ LLFolderViewFolder* view_folder = mFolders->getFolderByID(item_id);
//////////////////////////////
// LABEL Operation
@@ -320,7 +321,18 @@ void LLInventoryPanel::modelChanged(U32 mask)
view_item->refresh();
}
}
-
+
+ //////////////////////////////
+ // SORT Operation
+ // Sort the folder.
+ if (mask & LLInventoryObserver::SORT)
+ {
+ if (view_folder)
+ {
+ view_folder->requestSort();
+ }
+ }
+
// We don't typically care which of these masks the item is actually flagged with, since the masks
// may not be accurate (e.g. in the main inventory panel, I move an item from My Inventory into
// Landmarks; this is a STRUCTURE change for that panel but is an ADD change for the Landmarks
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 36d9e7935f..e38d03c60b 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -2519,8 +2519,6 @@ void handle_object_edit()
void handle_object_inspect()
{
- // Disable sidepanel inspector
- /*
LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
LLViewerObject* selected_objectp = selection->getFirstRootObject();
if (selected_objectp)
@@ -2529,9 +2527,11 @@ void handle_object_inspect()
key["task"] = "task";
LLSideTray::getInstance()->showPanel("sidepanel_inventory", key);
}
- */
+ /*
+ // Old floater properties
LLFloaterReg::showInstance("inspect", LLSD());
+ */
}
//---------------------------------------------------------------------------