Esempio n. 1
0
void LocalAssetBrowser::DelBitmap( std::vector<LLScrollListItem*> delete_vector, S32 column )
{
	bool change_happened = false;
	for( std::vector<LLScrollListItem*>::iterator list_iter = delete_vector.begin();
		 list_iter != delete_vector.end(); list_iter++ )
	{
		LLScrollListItem* list_item = *list_iter; 
		if ( list_item )
		{
			LLUUID id = list_item->getColumn(column)->getValue().asUUID();
			for (local_list_iter iter = loaded_bitmaps.begin();
				 iter != loaded_bitmaps.end();)
			{
				if ((*iter).getID() == id)
				{	
					LLViewerFetchedTexture* image = gTextureList.findImage(id);
					gTextureList.deleteImage( image );
					image->unref();
					iter = loaded_bitmaps.erase(iter);
					change_happened = true;
				}
				else
					++iter;
			}
		}
	}

	if (change_happened) onChangeHappened();
}
Esempio n. 2
0
void LocalAssetBrowser::AddBitmap_continued(AIFilePicker* filepicker)
{
	if (!filepicker->hasFilename())
		return;

	bool change_happened = false;
	std::vector<std::string> const& filenames(filepicker->getFilenames());
	for(std::vector<std::string>::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename)
	{
		LocalBitmap unit(*filename);
		if (unit.getIfValidBool())
		{
			loaded_bitmaps.push_back(unit);
			change_happened = true;
		}
	}

	if (change_happened) onChangeHappened();
}
Esempio n. 3
0
void LocalAssetBrowser::AddBitmap()
{
	LLFilePicker& picker = LLFilePicker::instance();
	if ( !picker.getMultipleOpenFiles(LLFilePicker::FFLOAD_IMAGE) ) 
	   { return; }

	bool change_happened = false;
	std::string filename = picker.getFirstFile();	
	while( !filename.empty() )
	{
		LocalBitmap* unit = new LocalBitmap( filename );

		if	( unit->getIfValidBool() )
		{
			loaded_bitmaps.push_back( unit ); 
			change_happened = true;
		}

		filename = picker.getNextFile();
	}

	if ( change_happened )
	{ onChangeHappened(); }
}
void LocalAssetBrowser::DelBitmap( std::vector<LLScrollListItem*> delete_vector, S32 column )
{
	bool change_happened = false;
	for( std::vector<LLScrollListItem*>::iterator list_iter = delete_vector.begin();
		 list_iter != delete_vector.end(); list_iter++ )
	{
		LLScrollListItem* list_item = *list_iter; 
		if ( list_item )
		{
			LLUUID id = list_item->getColumn(column)->getValue().asUUID();
			for (local_list_iter iter = loaded_bitmaps.begin();
				 iter != loaded_bitmaps.end();)
			{
				LocalBitmap* unit = (*iter)->getThis();

				if ( unit->getID() == id )
				{	
					LLViewerImage* image = gImageList.hasImage(id);
					gImageList.deleteImage( image );
					image->unref();

					iter = loaded_bitmaps.erase(iter);
					delete unit;
					unit = NULL;

					change_happened = true;
				}
				else
				{ iter++; }
			}
		}
	}

	if ( change_happened )
	{ onChangeHappened(); }
}