VirLinden avatar VirLinden committed dbcedeb Merge

merge

Comments (0)

Files changed (6)

indra/newview/llfolderview.cpp

 	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();

indra/newview/llfolderview.h

 	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);
 	

indra/newview/llinventorybridge.cpp

 
 	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,
 		}
 
 		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);
 			// 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());

indra/newview/llinventoryobserver.h

 		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();

indra/newview/llinventorypanel.cpp

 		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
 				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

indra/newview/llviewermenu.cpp

 
 void handle_object_inspect()
 {
-	// Disable sidepanel inspector
-	/*
 	LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
 	LLViewerObject* selected_objectp = selection->getFirstRootObject();
 	if (selected_objectp)
 		key["task"] = "task";
 		LLSideTray::getInstance()->showPanel("sidepanel_inventory", key);
 	}
+
+	/*
+	// Old floater properties
+	LLFloaterReg::showInstance("inspect", LLSD());
 	*/
-
-	LLFloaterReg::showInstance("inspect", LLSD());
 }
 
 //---------------------------------------------------------------------------
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.